Ace 스크립트

  1. =begin
    #==============================================================================
     ** Casting Time
     Author: Tsukihime
     Date: Sep 21, 2012
    ------------------------------------------------------------------------------
     ** Change log
     Sep 21
       - added "state added" battle log message
     Aug 26
       - added "suspended" state
       - fixed bug where using item crashes the game
     Aug 25
       - initial release
    ------------------------------------------------------------------------------   
     This script allows you to specify the amount of time that must pass
     before your skill is executed. Time is specified in "turns" but can be
     modified to support frames for active battle systems.
     
     It uses a "casting" state to in order to determine whether you are in the
     middle of casting the spell.
     
     The battler cannot accept any commands while in the casting state.
     
     When the amount of time required to cast the spell has passed, if the
     battler is still casting, then the cast state will be removed and the
     skill executed.
     
     A "suspended" state is available to pause the casting. When the suspended
     state is inflicted, the battler will still be casting, but the countdown
     does not change. When the suspended state is removed, the countdown will
     resume.
     
     When the casting state is removed, the battler's reserved casting skill will
     be removed as well, and control goes back to the battler.
    #==============================================================================
    =end
    $imported = {} if $imported.nil?
    $imported["Tsuki_CastingTime"] = true
    #==============================================================================
    # ** Configuration
    #==============================================================================
    module Tsuki
      module CastingTime
        
        # state to inflict when the battler is preparing for a skill
        Cast_State = 27
        
        # state to inflict when the casting should be paused
        Suspended_State = 28
        
        Cast_Time_Regex = /<cast-time:\s*(\d+)>/i
      end
    end
    #==============================================================================
    # ** Rest of script
    #==============================================================================
    module RPG
      class UsableItem
        
        # amount of time required to cast this skill
        def cast_time
          return @cast_time unless @cast_time.nil?
          r = Tsuki::CastingTime::Cast_Time_Regex.match(self.note) 
          return @cast_time = r ? r[1].to_i : 0
        end
      end
    end
    
    class Game_Action
       
      def cast_time
        return item ? item.cast_time : 0
      end
    end
    
    class Game_Battler
      attr_reader :casting_item
      attr_reader :casting_time
      
      alias :th_cast_time_init :initialize
      def initialize
        th_cast_time_init
        @casting_item = nil
        @casting_time = 0
      end
      
      # clear all casting 
      def clear_casting
        @casting_item = nil
        @casting_time = 0
      end
      
      def casting_state_id
        Tsuki::CastingTime::Cast_State
      end
      
      def suspend_casting_state_id
        Tsuki::CastingTime::Suspended_State
      end
      
      def casting?
        @states.include?(casting_state_id)
      end
      
      def suspend_casting?
        @states.include?(suspend_casting_state_id)
      end
    
      alias :th_cast_time_turn_end :on_turn_end
      def on_turn_end
        th_cast_time_turn_end
        update_cast_time unless suspend_casting?
      end
      
      alias :th_cast_time_battle_end :on_battle_end
      def on_battle_end
        th_cast_time_battle_end
        clear_casting
      end
      
      # decrease by 1 per turn (although it could be arbitrary in the future...)
      def update_cast_time
        @casting_time = [@casting_time - 1, 0].max
      end
      
      # determine whether we are going to cast, or starting to cast
      def check_cast_time
        if casting?
          if @casting_item && @casting_time <= 0
            execute_cast_item
            clear_casting
          end
        elsif suspend_casting?
          return false
        elsif current_action && current_action.cast_time > 0
          prepare_cast_time
          return true
        else
          clear_casting
        end
      end
      
      # automatically set up actions based on the casting
      def execute_cast_item
        remove_state(casting_state_id)
        make_actions
        @actions[0].set_skill(@casting_item.id)
      end  
      
      # initiate casting
      def prepare_cast_time
        @casting_item = current_action.item
        @casting_time = current_action.cast_time
        add_state(casting_state_id)
        @result.used = true
        @result.success = true
        @result.hp_damage = 0
        
        # action has been stored so we can just clear it out
        remove_current_action
      end
    end
    
    class Scene_Battle
      
      #-----------------------------------------------------------------------------
      # Skip command input if casting
      #-----------------------------------------------------------------------------
      alias :th_cast_time_start_actor_command_selection :start_actor_command_selection 
      def start_actor_command_selection
        if BattleManager.actor.casting?
          next_command 
        else
          th_cast_time_start_actor_command_selection
        end
      end
      
      # replace...might be bad
      def process_action
        return if scene_changing?
        if !@subject || !@subject.current_action
          @subject = BattleManager.next_subject
        end
        return turn_end unless @subject
        if @subject.check_cast_time # new line
          @log_window.display_action_results(@subject, @subject.casting_item)
        end
        if @subject.current_action
          @subject.current_action.prepare
          if @subject.current_action.valid?
            @status_window.open
            execute_action
          end
          @subject.remove_current_action 
        end
        process_action_end unless @subject.current_action
      end
    end

    사용 방법
    n에 숫자를 넣는데.. 정확한 캐스팅시간은 모르겠네요.
    아마 행동에 따른 횟수겠지만 ( 아니면 턴단위 )

    <cast-time: n>

Who's 스리아씨

?
뺘라뺘뺘

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 5605
공지 RPG VX ACE 유용한 링크 모음 16 아방스 2012.01.03 29441
39 전투 LNX11 전투 RPGXP 전투처럼 만들기 큔. 2018.11.23 1505
38 전투 기본전투의 커스텀 명중률 제작 안나카레리나 2018.06.10 585
37 전투 SPRG 컨버터 NEXT 1 file 게임애호가 2016.06.09 1940
36 전투 Tomoaky's RGSS3_SRPG ver.0.15a 한국어번역 3 file 초코빙수 2016.06.05 2108
35 전투 theolized 사이드뷰 스크립트 2 하늘바라KSND 2014.12.19 2511
34 전투 GTBS 2.4 버전 에코 2014.11.28 1919
33 전투 사이드뷰 배틀 스크립트 (Animated Battlers By Jet10985) 6 file Rebiart 2014.05.18 4549
32 전투 Yanfly 엔진 - 몬스터의 레벨 설정 6 file 스리아씨 2013.11.08 13054
31 전투 데미지의 한계치를 정하는 스크립트 3 file 스리아씨 2013.11.07 2086
» 전투 스킬 캐스팅 시스템 3 스리아씨 2013.10.12 32457
29 전투 자동전투 명령어 추가 스크립트 2 스리아씨 2013.10.11 1994
28 전투 공격시 반동데미지 스크립트 8 스리아씨 2013.10.11 1931
27 전투 Symbol Encounter 5 파송송뇌진탕 2013.09.29 2569
26 전투 GTBS v2 for VX Ace by GubiD 1 Alkaid 2013.07.19 3079
25 전투 Ra TBS Alpha by Eshra 1 file 습작 2013.05.13 3878
24 전투 多人数SRPGコンバータ for Ace by AD.Bank 6 습작 2013.05.13 4074
23 전투 Schala 전투 시스템 (XAS에 의해 구동) 11 홍색의환상향 2013.05.05 5361
22 전투 Basic Enemy HP Bars 2.1 by V.M 10 Alkaid 2013.02.21 4239
21 전투 Etude87_SRPG_converter_for_Ace_Add_on ver.1.02 2 습작 2013.02.18 3116
20 전투 CP's Battle Engine by Neon Black 20 Alkaid 2013.02.14 5013
Board Pagination Prev 1 2 Next
/ 2