#===================行動オプション ver0.92============================ # by かーい # 2006/9/24 #===================================================================== =begin 挿入場所は「スキル・種類別」拡張子「バトル中適用」より下かつActionEXの上 特殊効果郡があると、拡張ActionEXと拡張ScopeEXをいれないとうまくいかない。 かなり再定義しているので注意。戦闘計算式とか自作している人はこっちに組み込んでおいてください。 スコープEXとスキル分類とこことパラメーター追加 =end module Ka_battle #----------------------------------------------------------- # 行動オプション #----------------------------------------------------------- ###############書き換え変数部分######################## #特殊効果詰め合わせ ActionEXを導入しているのなら true になる @@action_ex_in = defined?(XRXS37) ####先制オプションをActionEX::優先度+1より、早く行動させたい場合はtrue @@accel_precedence = true # 先制オプションの属性名 ACCELERATOR_ELEMENT_NAME = /[Oo]pt 先制/ # 先制オプション使用時追加表示名 ACCELERATOR_HELP = "先制:" # 先制オプション発動者用アニメーションID ACCELERATOR_USR_A_ID = 157 # 物理強化オプションの属性名 LIMIT_ELEMENT_NAME = /[Oo]pt 物理強化/ # 物理強化オプション使用時追加表示名 LIMIT_HELP = "強化:" # 物理強化オプション発動者用アニメーションID LIMIT_USR_A_ID = 20 # 全体化オプションの属性名 MYSTIC_ELEMENT_NAME = /[Oo]pt 全体化/ # 全体化オプション使用時追加表示名 MYSTIC_HELP = "全体化:" # 全体化オプション発動者用アニメーションID MYSTIC_USER_A_ID = 159 # 全体化オプションをアイテムだけに適用するか MYSTIC_NORMAL = false # 魔法強化オプションの属性名 HISPELL_ELEMENT_NAME = /[Oo]pt 魔法強化/ # 魔法強化オプション使用時追加表示名 HISPELL_HELP = "強化:" # 魔法強化オプション発動者用アニメーションID HISPELL_USR_A_ID = 20 # 詠唱短縮オプションの属性名 QUICK_SPELL_ELEMENT_NAME = /[Oo]pt 詠唱短縮/ # 詠唱短縮オプション使用時追加表示名 QUICK_SPELL_HELP = "詠唱短縮:" # 詠唱短縮オプション発動者用アニメーションID QUICK_SPELL_USR_A_ID = 20 #################################################### ############管理変数########## @@accel_user = Array.new @@accel_s = false @@accel_skill = Array.new @@accel_re_index = Array.new @@limit_user = Array.new @@limit_s = false @@limit_skill = Array.new @@limit_re_index = Array.new @@limit_mul = Array.new @@mystic_user = Array.new @@mystic_s = false @@mystic_skill = Array.new @@mystic_re_index = Array.new @@hispell_user = Array.new @@hispell_s = false @@hispell_skill = Array.new @@hispell_re_index = Array.new @@hispell_mul = Array.new @@quick_spell_user = Array.new @@quick_spell_s = false @@quick_spell_skill = Array.new @@quick_spell_re_index = Array.new @@rember_cursol = 0 ################################## end =begin &&&&&&&&改変部位=アクセラレイターとミステック ===========class Game_Battler========== include Ka #######################Game_Battler1 #------------------------------------------------------------- # ● アクションスピードの決定 #===============再定義 #-------------------------------------------------------------------------- def make_action_speed(battler) (Game_Battler 1) #######################Game_Battler3 #-------------------------------------------------------------------------- # ● スキルの使用可能判定 # skill_id : スキル ID #=======二重選択防止を追加 alias #-------------------------------------------------------------------------- def skill_can_use?(skill_id) ============================== ==========class Scene_Battle========= #####################Scene_Battle2 #-------------------------------------------------------------------------- # ● パーティコマンドフェーズ開始 #-------------------------------------------------------------------------- alias ka_start_phase2 start_phase2 def start_phase2 #####################Scene_Battle3 #-------------------------------------------------------------------------- # ● 次のアクターのコマンド入力へ #=============再定義。多分併用性:高い #-------------------------------------------------------------------------- def phase3_next_actor #-------------------------------------------------------------------------- # ● 前のアクターのコマンド入力へ #======再定義。多分併用性:高い #-------------------------------------------------------------------------- def phase3_prior_actor #-------------------------------------------------------------------------- # ● フレーム更新 (アクターコマンドフェーズ : 基本コマンド) #============前方追加処理 alias 弄らないと多分併用性:小〜中 #-------------------------------------------------------------------------- def update_phase3_basic_command #-------------------------------------------------------------------------- # ● フレーム更新 (アクターコマンドフェーズ : スキル選択) #===============再定義。弄らないと多分併用性:小 #-------------------------------------------------------------------------- def update_phase3_skill_select #-------------------------------------------------------------------------- # ● フレーム更新 (アクターコマンドフェーズ : アイテム選択) #===============再定義。弄らないと多分併用性:小〜中 #-------------------------------------------------------------------------- def update_phase3_item_select #####################Scene_Battle4 #-------------------------------------------------------------------------- # ● 基本アクション 結果作成 多分併用性:中 #-------------------------------------------------------------------------- def make_basic_action_result #-------------------------------------------------------------------------- # ● スキルアクション 結果作成 #==================アニメーションID上書き alias 多分併用性:小〜中 #-------------------------------------------------------------------------- def make_skill_action_result #-------------------------------------------------------------------------- # ● アイテムアクション 結果作成 #==================アニメーションID上書き alias 多分併用性:小〜中 #-------------------------------------------------------------------------- def make_item_action_result ============================== &&&&&&&&&&&&&&&&&&&&&&& =end #改造開始!! #============================================================================== # ■ Game_Battler #------------------------------------------------------------------------------ #  バトラーを扱うクラスです。このクラスは Game_Actor クラスと Game_Enemy クラ # スのスーパークラスとして使用されます。 #============================================================================== class Game_Battler ################## include Ka_battle ################## #------------------------------------------------------------------------- # ● アクションスピードの決定 #-------------------------------------------------------------------------- def make_action_speed @current_action.speed = 0 skill = $data_skills[@current_action.skill_id] # アクセラレイター優先処理 if(@@accel_user.include?(self)) @current_action.speed += agi * 32 end if defined?(XRXS37) if self.class.method_defined?("multy_element_set") eleset = self.multy_element_set else eleset = self.equip_element_set end # 詠唱発動 if skill != nil and XRXS.element_include?(self.skill_element_set(skill), XRXS37::CAST_CHANT) percent = XRXS.element_percent(eleset, "#{XRXS37::CAST_CHANT}加速") @current_action.speed += (agi * (100 + percent) / 100) end end @current_action.speed += agi + rand(agi / 4) end #-------------------------------------------------------------------------- # ● スキルの使用可能判定 #-------------------------------------------------------------------------- alias :ka_skill_can_use? :skill_can_use? def skill_can_use?(skill_id) # SP が足りない場合は使用不可 if $data_skills[skill_id].sp_cost > self.sp || $data_skills[skill_id].ssp_cost > self.ssp return false end #########同オプション二重選択防止 if @@accel_skill.include?(skill_id) return false end if @@limit_skill.include?(skill_id) return false end if @@mystic_skill.include?(skill_id) return false end if(@@hispell_skill.include?(skill_id)) return false end if(@@quick_spell_skill.include?(skill_id)) return false end ################### # 呼び戻す return ka_skill_can_use?(skill_id) end #-------------------------------------------------------------------------- # ● 通常攻撃の効果適用 # attacker : 攻撃者 (バトラー) #-------------------------------------------------------------------------- alias :ka_attack_effect :attack_effect def attack_effect(attacker) result = ka_attack_effect(attacker) if self.damage.is_a?(Numeric) # 物理強化オプション調整 if(@@limit_user.include?(attacker)) if Numset.const_defined?("ATTACK") if XRXS.element_include?(attacker.multy_element_set, Numset::ATTACK) self.damage = (self.damage * @@limit_mul(@@limit_user.index(attacker))).round end elsif XRXS19.const_defined?("ATTACK") if XRXS.element_include?(attacker.multy_element_set, XRXS19::ATTACK) self.damage = (self.damage * @@limit_mul(@@limit_user.index(attacker))).round end else self.damage = (self.damage * @@limit_mul(@@limit_user.index(attacker))).round end end # 魔法強化オプション調整 if(@@hispell_user.include?(attacker)) if Numset.const_defined?("MAGIC") if XRXS.element_include?(attacker.multy_element_set, Numset::MAGIC) self.damage = (self.damage * @@hispell_mul(@@limit_user.index(attacker))).round end elsif XRXS19.const_defined?("MAGIC") if XRXS.element_include?(attacker.multy_element_set, XRXS19::MAGIC) self.damage = (self.damage * @@hispell_mul(@@limit_user.index(attacker))).round end end self.damage = (self.damage * @@hispell_mul(@@limit_user.index(attacker))).round end end return result end #-------------------------------------------------------------------------- # ● スキルの効果適用 # user : スキルの使用者 (バトラー) # skill : スキル #-------------------------------------------------------------------------- alias :ka_skill_effect :skill_effect def skill_effect(user, skill) effective = ka_skill_effect(user, skill) if self.damage.is_a?(Numeric) # 物理強化オプション調整 if(@@limit_user.include?(user)) if Numset.const_defined?("ATTACK") if XRXS.element_include?(attacker.multy_element_set, Numset::ATTACK) self.damage = (self.damage * @@limit_mul(@@limit_user.index(user))).round end elsif XRXS19.const_defined?("ATTACK") if XRXS.element_include?(attacker.multy_element_set, XRXS19::ATTACK) self.damage = (self.damage * @@limit_mul(@@limit_user.index(user))).round end elsif (skill.atk_f < skill.int_f) self.damage = (self.damage * @@limit_mul(@@limit_user.index(auser))).round end end # 魔法強化オプション調整 if(@@hispell_user.include?(user)) if Numset.const_defined?("MAGIC") if XRXS.element_include?(attacker.multy_element_set, Numset::MAGIC) self.damage = (self.damage * @@hispell_mul(@@hispell_user.index(user))).round end elsif XRXS19.const_defined?("MAGIC") if XRXS.element_include?(attacker.multy_element_set, XRXS19::MAGIC) self.damage = (self.damage * @@hispell_mul(@@hispell_user.index(user))).round end elsif (skill.atk_f < skill.int_f) self.damage = (self.damage * @@hispell_mul(@@hispell_user.index(user))).round end end end # メソッド終了 return effective end end #============================== #============================================================================== # ■ Scene_Battle #------------------------------------------------------------------------------ #  バトル画面の処理を行うクラスです。 #============================================================================== class Scene_Battle ##################### include Ka_battle ##################### #-------------------------------------------------------------------------- # ● パーティコマンドフェーズ開始 #-------------------------------------------------------------------------- alias ka_start_phase2 start_phase2 def start_phase2 ka_start_phase2 user_clear = Array.new @@accel_user.clear @@accel_s = false @@accel_skill.clear @@accel_re_index.clear @@limit_user.clear @@limit_s = false @@limit_skill.clear @@limit_re_index.clear @@limit_mul.clear @@mystic_user.clear @@mystic_s = false @@mystic_skill.clear @@mystic_re_index.clear if(@@action_ex_in == true) @@hispell_user.each do |x| if(x.state?(get_state_id_cast_chant)) else user_clear.push(x) end @@hispell_user = (@@hispell_user - user_clear) else @@hispell_user.clear end user_clear.clear @@hispell_s = false @@hispell_skill.clear @@hispell_re_index.clear @@hispell_mul.clear @@quick_spell_user.clear @@quick_spell_s = false @@quick_spell_skill.clear @@quick_spell_re_index.clear end #-------------------------------------------------------------------------- # ● 次のアクターのコマンド入力へ #-------------------------------------------------------------------------- def phase3_next_actor # ループ begin ##判定 if( @@accel_s or @@mystic_s or @@hispell_s or @@limit_s) if(@@accel_s == true) @active_battler = $game_party.actors[@actor_index] @active_battler.blink = true end if(@@limit_s == true) @active_battler = $game_party.actors[@actor_index] @active_battler.blink = true end if(@@hispell_s == true) @active_battler = $game_party.actors[@actor_index] @active_battler.blink = true end if(@@quick_spell_s == true) @active_battler = $game_party.actors[@actor_index] @active_battler.blink = true end if(@@mystic_s == true) @active_battler = $game_party.actors[@actor_index] @active_battler.blink = true @actor_command_window.active = false @actor_command_window.visible = false end else # アクターの明滅エフェクト OFF if @active_battler != nil @active_battler.blink = false end # 最後のアクターの場合 if @actor_index == $game_party.actors.size-1 # メインフェーズ開始 start_phase4 return end # アクターのインデックスを進める @actor_index += 1 @active_battler = $game_party.actors[@actor_index] @active_battler.blink = true end # アクターがコマンド入力を受け付けない状態ならもう一度 end until @active_battler.inputable? # アクターコマンドウィンドウをセットアップ phase3_setup_command_window end #-------------------------------------------------------------------------- # ● 前のアクターのコマンド入力へ #-------------------------------------------------------------------------- def phase3_prior_actor # ループ begin # アクターの明滅エフェクト OFF if @active_battler != nil @active_battler.blink = false end # 最初のアクターの場合 if @actor_index == 0 # パーティコマンドフェーズ開始 start_phase2 return end # アクターのインデックスを戻す @actor_index -= 1 @active_battler = $game_party.actors[@actor_index] @active_battler.blink = true if((@@accel_re_index.include?(@actor_index)) && (@@accel_user.include?(@active_battler))) acid = @@accel_skill.pop @@accel_user.pop @@accel_re_index.pop @active_battler.sp += $data_skills[acid].sp_cost @active_battler.ssp += $data_skills[acid].ssp_cost @@accel_s = false @status_window.refresh end if((@@limit_re_index.include?(@actor_index)) && (@@limit_user.include?(@active_battler))) lim = @@limit_skill.pop @@limit_user.pop @@limit_re_index.pop @@limit_mul.pop @active_battler.sp += $data_skills[lim].sp_cost @active_battler.ssp += $data_skills[lim].ssp_cost @@limit_s = false @status_window.refresh end if((@@hispell_re_index.include?(@actor_index)) && (@@hispell_user.include?(@active_battler))) his = @@hispell_skill.pop @@hispell_user.pop @@hispell_re_index.pop @@hispell_mul.pop @active_battler.sp += $data_skills[his].sp_cost @active_battler.ssp += $data_skills[his].ssp_cost @@hispell_s = false @status_window.refresh end if((@@quick_spell_re_index.include?(@actor_index)) && (@@quick_spell_user.include?(@active_battler))) qus = @@quick_spell_skill.pop @@quick_spell_user.pop @@quick_spell_re_index.pop @active_battler.sp += $data_skills[qus].sp_cost @active_battler.ssp += $data_skills[qus].ssp_cost @@quick_spell_s = false @status_window.refresh end if((@@mystic_re_index.include?(@actor_index)) && (@@mystic_user.include?(@active_battler))) myid = @@mystic_skill.pop @@mystic_user.pop @@mystic_re_index.pop @active_battler.sp += $data_skills[myid].sp_cost @active_battler.ssp += $data_skills[myid].ssp_cost @@mystic_s = false @status_window.refresh end # アクターがコマンド入力を受け付けない状態ならもう一度 end until @active_battler.inputable? # アクターコマンドウィンドウをセットアップ phase3_setup_command_window end #-------------------------------------------------------------------------- # ● フレーム更新 (アクターコマンドフェーズ : 基本コマンド) #-------------------------------------------------------------------------- alias :ka_update_phase3_basic_command :update_phase3_basic_command def update_phase3_basic_command # B ボタンが押された場合 if Input.trigger?(Input::B) # 先制オプション if(@@accel_user.include?(@active_battler)) @@accel_s = false acid = @@accel_skill.pop @@accel_user.pop @@accel_re_index.pop @active_battler.sp += $data_skills[acid].sp_cost @active_battler.ssp += $data_skills[acid].ssp_cost end # 物理強化オプション if(@@limit_user.include?(@active_battler)) @@limit_s = false lim = @@limit_skill.pop @@limit_user.pop @@limit_re_index.pop @@limit_mul.pop @active_battler.sp += $data_skills[lim].sp_cost @active_battler.ssp += $data_skills[lim].ssp_cost end # 魔法強化オプション if(@@hispell_user.include?(@active_battler)) @@hispell_s = false his = @@hispell_skill.pop @@hispell_user.pop @@hispell_re_index.pop @@hispell_mul.pop @active_battler.sp += $data_skills[his].sp_cost @active_battler.ssp += $data_skills[his].ssp_cost end # 全体化オプション if(@@mystic_user.include?(@active_battler)) @@mystic_s = false mys = @@mystic_skill.pop @@mystic_user.pop @@mystic_re_index.pop @active_battler.sp += $data_skills[mys].sp_cost @active_battler.ssp += $data_skills[mys].ssp_cost end # キャンセル SE を演奏 $game_system.se_play($data_system.cancel_se) @status_window.refresh return end # C ボタンが押された場合 if Input.trigger?(Input::C) # アクターコマンドウィンドウのカーソル位置で分岐 @@accel_s = false if (@@accel_s == true) @@limit_s = false if (@@limit_s == true) @@hispell_s = false if (@@hispell_s == true) end ka_update_phase3_basic_command end #-------------------------------------------------------------------------- # ● フレーム更新 (アクターコマンドフェーズ : スキル選択) #===================再定義 #-------------------------------------------------------------------------- def update_phase3_skill_select # スキルウィンドウを可視状態にする @skill_window.visible = true # スキルウィンドウを更新 @skill_window.update # B ボタンが押された場合 if Input.trigger?(Input::B) ##################追加改造部分。 ##########他スクリプトとダブったら、ここをコピペしてみよう # 先制オプション if((@@accel_re_index.include?(@actor_index)) && (@@accel_user.include?(@active_battler))) acid = @@accel_skill.pop @@accel_user.pop @@accel_re_index.pop @@accel_mul.pop @active_battler.sp += $data_skills[acid].sp_cost @active_battler.ssp += $data_skills[acid].ssp_cost @@accel_s = false end # 物理強化オプション if((@@limit_re_index.include?(@actor_index)) && (@@limit_user.include?(@active_battler))) lim = @@limit_skill.pop @@limit_user.pop @@limit_re_index.pop @@limit_mul.pop @active_battler.sp += $data_skills[lim].sp_cost @active_battler.ssp += $data_skills[lim].ssp_cost @@limit_s = false end # 魔法強化オプション if((@@hispell_re_index.include?(@actor_index)) && (@@hispell_user.include?(@active_battler))) his = @@hispell_skill.pop @@hispell_user.pop @@hispell_re_index.pop @active_battler.sp += $data_skills[his].sp_cost @active_battler.ssp += $data_skills[his].ssp_cost @@hispell_s = false end # 詠唱短縮オプション if((@@quick_spell_re_index.include?(@actor_index)) && (@@quick_spell_user.include?(@active_battler))) qus = @@quick_spell_skill.pop @@quick_spell_user.pop @@quick_spell_re_index.pop @active_battler.sp += $data_skills[qus].sp_cost @active_battler.ssp += $data_skills[qus].ssp_cost @@quick_spell_s = false end # 全体化オプション if((@@mystic_re_index.include?(@actor_index)) && (@@mystic_user.include?(@active_battler))) mys = @@mystic_skill.pop @@mystic_user.pop @@mystic_re_index.pop @active_battler.sp += $data_skills[mys].sp_cost @active_battler.ssp += $data_skills[mys].ssp_cost @@mystic_s = false end ############################################### # キャンセル SE を演奏 $game_system.se_play($data_system.cancel_se) @status_window.refresh # スキルの選択を終了 end_skill_select return end # C ボタンが押された場合 if Input.trigger?(Input::C) # スキルウィンドウで現在選択されているデータを取得 @skill = @skill_window.skill # 使用できない場合 if @skill == nil or not @active_battler.skill_can_use?(@skill.id) # ブザー SE を演奏 $game_system.se_play($data_system.buzzer_se) return end # スキルウィンドウで現在選択されているデータを取得 @skill = @skill_window.skill # 使用できない場合 if @skill == nil || !@active_battler.skill_can_use?(@skill.id) # ブザー SE を演奏 $game_system.se_play($data_system.buzzer_se) return end # ヘルプウィンドウを隠す if @help_window2 != nil @help_window2.visible = false else @help_window.visible = false end ##################追加改造部分。 ##########他スクリプトとダブったら、ここをコピペしてみよう # アクションを設定 @active_battler.current_action.skill_id = @skill.id if Game_Battler.method_defined?(skill_element_set) eleset = @active_battler.skill_element_set(@skill) else eleset = @skill.element_set end if defined?(XRXS) accel_ok = XRXS.element_include?(eleset, Ka_battle::ACCEL_ELEMENT_NAME) limit_ok = XRXS.element_include?(eleset, Ka_battle::LIMIT_ELEMENT_NAME) mystic_ok = XRXS.element_include?(eleset, Ka_battle::MYSTIC_ELEMENT_NAME) hispell_ok = XRXS.element_include?(eleset, Ka_battle::HISPELL_ELEMENT_NAME) quick_spell_ok = XRXS.element_include?(eleset, Ka_battle::QUICK_ELEMENT_NAME) else accel_ok = (eleset.fill{|e| $data_system.elements[e]}).include?(Ka_battle::ACCEL_ELEMENT_NAME) limit_ok = (eleset.fill{|e| $data_system.elements[e]}).include?(Ka_battle::LIMIT_ELEMENT_NAME) mystic_ok = (eleset.fill{|e| $data_system.elements[e]}).include?(Ka_battle::MYSTIC_ELEMENT_NAME) hispell_ok = (eleset.fill{|e| $data_system.elements[e]}).include?(Ka_battle::HISPELL_ELEMENT_NAME) quick_spell_ok = (eleset.fill{|e| $data_system.elements[e]}).include?(Ka_battle::QUICK_SPELL_ELEMENT_NAME) end unless(accel_ok || limit_ok || mystic_ok || hispell_ok || quick_spell_ok) #ノーマル処理 # 決定 SE を演奏 $game_system.se_play($data_system.decision_se) @@accel_s = false @@limit_s = false @@hispell_s = false @@quick_spell_s = false @@mystic_s = false # スキルウィンドウを不可視状態にする @skill_window.visible = false else # コマンドオプションを検出 accel_ss = false limit_ss = false mystic_ss = false hi_ss = false qu_ss = false # 先制オプション if(accel_ok) @@accel_s = true @@accel_user.push(@active_battler) @@accel_skill.push(@skill.id) @@accel_re_index.push(@actor_index) accel_ss = true end # 物理強化オプション if(limit_ok) @@limit_s = true @@limit_user.push(@active_battler) @@limit_skill.push(@skill.id) @@limit_re_index.push(@actor_index) if defined?(XRXS) @@hispell_mul.push(XRXS.element_percent(@active_battler.skill_element_set, Ka_battle::LIMIT_ELEMENT_NAME)) else percent = 0 for i in set if $data_system.elements[i] =~ /^#{Ka_battle::LIMIT_ELEMENT_NAME}([+-]?([1-9]\d*|0)\.?\d*)?(~([+-]?([1-9]\d*|0)\.?\d*))?[%%]/ percent += $1.to_i end end @@hispell_mul.push(percent) end limit_ss = true end # 全体化オプション if(mystic_ok) @@mystic_s = true @@mystic_user.push(@active_battler) @@mystic_skill.push(@skill.id) @@mystic_re_index.push(@actor_index) mystic_ss = true end # 魔法強化オプション if(hispell_ok) @@hispell_s = true @@hispell_user.push(@active_battler) @@hispell_skill.push(@skill.id) @@hispell_re_index.push(@actor_index) if defined?(XRXS) @@hispell_mul.push(XRXS.element_percent(@active_battler.skill_element_set, Ka_battle::HISPELL_ELEMENT_NAME)) else percent = 0 for i in set if $data_system.elements[i] =~ /^#{Ka_battle::HISPELL_ELEMENT_NAME}([+-]?([1-9]\d*|0)\.?\d*)?(~([+-]?([1-9]\d*|0)\.?\d*))?[%%]/ percent += $1.to_i end end @@hispell_mul.push(percent) end hi_ss = true end # 詠唱短縮オプション if(quick_spell_ok) @@quick_spell_s = true @@quick_spell_user.push(@active_battler) @@quick_spell_skill.push(@skill.id) @@quick_spell_re_index.push(@actor_index) qu_ss = true end ###どれか一つでもあれば、SPを引いておく if(accel_ss || limit_ss || mystic_ss || qu_ss || hi_ss) @active_battler.sprite.animation($data_animations[@skill.animation1id]) @active_battler.sp -= $data_skills[@skill.id].sp_cost @active_battler.ssp -= $data_skills[@skill.id].ssp_cost @status_window.refresh end_skill_select if mystic_ss and Ka_battle::MYSTIC_NORMAL # アクションを設定 @active_battler.current_action.kind = 2 # アイテムの選択を開始 @actor_command_window.active = false @actor_command_window.visible = false start_item_select # 詠唱短縮オプションがついている場合 elsif @@quick_spell_user.include?(@active_battler) start_skill_select end return end end ################################################ # 効果範囲が敵単体の場合 if @skill.scope == 1 # エネミーの選択を開始 start_enemy_select # 効果範囲が味方単体の場合 elsif @skill.scope == 3 or @skill.scope == 5 # アクターの選択を開始 start_actor_select # 効果範囲が単体ではない場合 else # スキルの選択を終了 end_skill_select # 次のアクターのコマンド入力へ phase3_next_actor end return end end #-------------------------------------------------------------------------- # ● フレーム更新 (アクターコマンドフェーズ : アイテム選択) #-------------------------------------------------------------------------- def update_phase3_item_select # アイテムウィンドウを可視状態にする @item_window.visible = true # アイテムウィンドウを更新 @item_window.update # B ボタンが押された場合 if Input.trigger?(Input::B) ####################ミステック解除 if(@@mystic_user.include?(@active_battler)) @@mystic_s = false myid = @@mystic_skill.pop @@mystic_user.pop @@mystic_re_index.pop @active_battler.sp += $data_skills[myid].sp_cost @active_battler.ssp += $data_skills[myid].ssp_cost @status_window.refresh end ##################################### # キャンセル SE を演奏 $game_system.se_play($data_system.cancel_se) # アイテムの選択を終了 end_item_select return end # C ボタンが押された場合 if Input.trigger?(Input::C) # アイテムウィンドウで現在選択されているデータを取得 @item = @item_window.item # 使用できない場合 unless $game_party.item_can_use?(@item.id) # ブザー SE を演奏 $game_system.se_play($data_system.buzzer_se) return end # 決定 SE を演奏 $game_system.se_play($data_system.decision_se) # アクションを設定 #### if(@@accel_s == true) @@accel_s = false end ### if(@@limit_s == true) @@limit_s = false end ### if(@@hispell_s == true) @@hispell_s = false end ### @active_battler.current_action.item_id = @item.id # アイテムウィンドウを不可視状態にする @item_window.visible = false if(@@mystic_s == false) # 効果範囲が敵単体の場合 if (@item.scope == 1) # エネミーの選択を開始 start_enemy_select # 効果範囲が味方単体の場合 elsif @item.scope == 3 or @item.scope == 5 # アクターの選択を開始 start_actor_select # 効果範囲が単体ではない場合 else # アイテムの選択を終了 end_item_select # 次のアクターのコマンド入力へ phase3_next_actor end else ##### if(@@mystic_s == true) @@mystic_s = false end #### # アイテムの選択を終了 end_item_select # 次のアクターのコマンド入力へ phase3_next_actor end return end end #-------------------------------------------------------------------------- # ● 行動順序作成 #-------------------------------------------------------------------------- def make_action_orders # 配列 @action_battlers を初期化 @action_battlers = [] # エネミーを配列 @action_battlers に追加 for enemy in $game_troop.enemies @action_battlers.push(enemy) end # アクターを配列 @action_battlers に追加 for actor in $game_party.actors @action_battlers.push(actor) end # 全員のアクションスピードを決定 for battler in @action_battlers battler.make_action_speed end # ソート部分を別メソッドに sort_action_orders end #-------------------------------------------------------------------------- # ○ 行動順序整列 #-------------------------------------------------------------------------- def sort_action_orders @action_battlers.sort!{|a, b| if @@accel_precedence if @@accel_user.include?(a) a_priority = a.current_action.speed_priority + 1 else a_priority = a.current_action.speed_priority end if @@accel_user.include?(b) b_priority = b.current_action.speed_priority + 1 else b_priority = b.current_action.speed_priority end end if a_priority != b_priority a_priority <=> b_priority elsif a.current_action.speed != b.current_action.speed a.current_action.speed <=> b.current_action.spee elsif a.is_a?(Game_Actor) == b.is_a?(Game_Actor) a.is_a? ? 1 : -1 else a.index <=> b.index end } end #-------------------------------------------------------------------------- # ● フレーム更新 (メインフェーズ ステップ 1 : アクション準備) #-------------------------------------------------------------------------- def update_phase4_step1 # ヘルプウィンドウを隠す @help_window.visible = false # 勝敗判定 if judge # 勝利または敗北の場合 : メソッド終了 return end # アクションを強制されているバトラーが存在しない場合 if $game_temp.forcing_battler == nil # バトルイベントをセットアップ setup_battle_event # バトルイベント実行中の場合 if $game_system.battle_interpreter.running? return end end # アクションを強制されているバトラーが存在する場合 if $game_temp.forcing_battler != nil # 先頭に追加または移動 @action_battlers.delete($game_temp.forcing_battler) @action_battlers.unshift($game_temp.forcing_battler) end # 未行動バトラーが存在しない場合 (全員行動した) if @action_battlers.size == 0 # パーティコマンドフェーズ開始 start_phase2 return end # アニメーション ID およびコモンイベント ID を初期化 @animation1_id = 0 @animation2_id = 0 @common_event_id = 0 # 未行動バトラー配列の先頭からシフト #する前に、再設定と再ソート # for battler in @action_battlers battler.make_action_speed(battler) end sort_action_orders # @active_battler = @action_battlers.shift # すでに戦闘から外されている場合 if @active_battler.index == nil return end # スリップダメージ if @active_battler.hp > 0 and @active_battler.slip_damage? @active_battler.slip_damage_effect @active_battler.damage_pop = true end # ステート自然解除 @active_battler.remove_states_auto # ステータスウィンドウをリフレッシュ @status_window.refresh # ステップ 2 に移行 @phase4_step = 2 end #-------------------------------------------------------------------------- # ● 基本アクション 結果作成 #-------------------------------------------------------------------------- alias :ka_make_basic_action_result :make_basic_action_result def make_basic_action_result ka_make_basic_action_result # 攻撃の場合 if @active_battler.current_action.basic == 0 help = $data_system.words.attack # 先制 if(@@accel_user.include?(@active_battler)) help = (Ka_battle::ACCELERATOR_HELP + help) @animation1_id = Ka_battle::ACCELERATOR_USR_A_ID end # 全体化 if(@@mystic_user.include?(@active_battler)) help = (Ka_battle::MYSTIC_HELP + help) @animation1_id = Ka_battle::MYSTIC_USR_A_ID end # 強化 if(@@limit_user.include?(@active_battler)) if(@@hispell_user.include?(@active_battler)) && (Ka_battle::LIMIT_HELP != Ka_battle::HISPELL_HELP) help = (Ka_battle::LIMIT_HELP + Ka_battle:HISPELL_HELP + help) @animation1_id = Ka_battle::LIMIT_USR_A_ID else help = (Ka_battle::LIMIT_HELP + help) @animation1_id = Ka_battle::LIMIT_USR_A_ID end elsif(@@hispell_user.include?(@active_battler)) help = (Ka_battle:HISPELL_HELP + help) @animation1_id = Ka_battle::HISPELL_USR_A_ID end @help_window.set_text(help, 1) end # 防御の場合 if @active_battler.current_action.basic == 1 #########先制オプション改良 if(@@accel_user.include?(@active_battler)) # ヘルプウィンドウに "防御" を表示 @help_window.set_text(Ka_battle::ACCELERATOR_HELP + $data_system.words.guard, 1) # アニメーション ID を設定 @animation1_id = @active_battler.animation1_id return else # ヘルプウィンドウに "防御" を表示 @help_window.set_text($data_system.words.guard, 1) return end end end #-------------------------------------------------------------------------- # ● スキルまたはアイテムの対象側バトラー設定 # scope : スキルまたはアイテムの効果範囲 #-------------------------------------------------------------------------- alias ka_set_target_battlers set_target_battlers def set_target_battlers(scope) # 行動側バトラーがアクターの場合 if @active_battler.is_a?(Game_Actor) # 効果範囲で分岐 case scope when 1, 9 # 敵単体 #########全体化 if(@@mystic_user.include?(@active_battler)) scope = 2 end when 3, 10 # 味方単体 #########全体化 if(@@mystic_user.include?(@active_battler)) scope = 4 end when 5 # 味方単体 (HP 0) ############全体化 if(@@mystic_user.include?(@active_battler)) scope = 6 end end end ka_set_target_battlers(scope) end #-------------------------------------------------------------------------- # ● スキルアクション 結果作成 #-------------------------------------------------------------------------- def make_skill_action_result # スキルを取得 @skill = $data_skills[@active_battler.current_action.skill_id] if defined?(XRXS37) # キャスト中でない場合 if @active_battler.current_action.cast_duration <= 0 # 特殊効果:詠唱発動 returnar = XRXS.element_check(@active_battler.skill_element_set(@skill), XRXS37::CAST_CHANT) if returnar[0] if ((@@quick_spell_user.include?(@active_battler)) || (@@quick_spell_skill.include?(@active_battler.current_action.skill_id)) @active_battler.current_action.cast_duration = returnar[1] state_id = get_state_id_cast_chant @active_battler.current_action.condition_state_id = state_id @active_battler.add_state(state_id) if state_id > 0 # 実際にステート付加 end end # 特殊効果:溜め発動 returnar = XRXS.element_check(@active_battler.skill_element_set(@skill), XRXS37::CAST_DURATION) if returnar[0] @active_battler.current_action.cast_duration = returnar[1] end end # キャスト中の場合 if @active_battler.current_action.cast_duration >= 2 @animation1_id = @skill.animation1_id @animation2_id = 0 return end # [消費ステート]の判別 if @active_battler.current_action.condition_state_id > 0 # 設定されている場合 if @active_battler.state?(@active_battler.current_action.condition_state_id) # 条件を満たした場合 ステートを解除する @active_battler.remove_state(@active_battler.current_action.condition_state_id) else # 条件を満たしていない場合 @animation1_id = 0 @animation2_id = 0 return end end # 既に一回以上行動している場合 if @phase4_act_times >= 1 or @phase4_hit_times >= 1 # # スキルの消費分を復旧させ、擬似的にHP/SPを減らさない ( HP消費に対応 ) # @active_battler.cost_restore(@skill) else # 使用するスキルの特殊効果の取得 @active_battler.current_action.set_xrxs37_special_effect(@active_battler.skill_element_set(@skill)) # 特殊効果:行動回数 @phase4_act_times_max = @active_battler.current_action.move_times @phase4_act_times_max = 1 if @phase4_act_times_max == 0 # 0は1にする # 特殊効果:ヒット回数 @phase4_hit_times_max = @active_battler.current_action.hit_times @phase4_hit_times_max = 1 if @phase4_hit_times_max == 0 # 0は1にする end # HP消費スキルの場合 if XRXS.element_include?(@active_battler.skill_element_set(@skill), XRXS37::HP_COST) # HPが足りるか判定 if @active_battler.hp <= @skill.sp_cost # 足りない場合 # ステップ 1 に移行 @phase4_step = 1 return end # SP消費分のSPを回復させて擬似的にSPを減らさない(最大値を超えて回復) @active_battler.sp0_ban = true @active_battler.sp += @skill.sp_cost # # HPを消費 # ( make_skill_action_result メソッドにステータスウィンドウの # リフレッシュがあるため、呼び戻すより前に HP を消費させる。) # @active_battler.hp -= @skill.sp_cost @active_battler.hp_cost_done = true # 呼び戻す xrxs37_make_skill_action_result # SPの制限の解除 @active_battler.hp_cost_done = nil @active_battler.sp0_ban = false else # 呼び戻す xrxs37_make_skill_action_result end else # 呼び戻す xrxs37_make_skill_action_result end if defined?(XRXS37) # 既に一回以上ヒット/行動している、またはため中の場合 if (@phase4_hit_times >= 1 or @phase4_act_times >= 1) or (@active_battler.current_action.cast_duration >= 2) @help_window.visible = false end # ためスキル発動時はアニメ1を消す if @active_battler.current_action.cast_duration == 1 @animation1_id = 0 end end # スキルを取得 @skill = $data_skills[@active_battler.current_action.skill_id] help = @skill.name ######################先制オプション if(@@accel_user.include?(@active_battler)) help = Ka_battle::ACCELERATOR_HELP + help) @animation1_id = Ka_battle::ACCELERATOR_USR_A_ID end ####################全体化オプション if(@@mystic_user.include?(@active_battler)) help = Ka_battle::MYSTIC_HELP + help) @animation1_id = Ka_battle::MYSTIC_USR_A_ID end ####################詠唱短縮オプション if(@@quick_spell_user.include?(@active_battler)) help = Ka_battle::QUICK_SPELL_HELP + help) @animation1_id = Ka_battle::QUICK_SPELL_USR_A_ID end ####################強化オプション if(@@limit_user.include?(@active_battler)) if(@@hispell_user.include?(@active_battler)) && (Ka_battle::LIMIT_HELP != Ka_battle::HISPELL_HELP) help = (Ka_battle::LIMIT_HELP + Ka_battle:HISPELL_HELP + help) @animation1_id = Ka_battle::LIMIT_USR_A_ID else help = (Ka_battle::LIMIT_HELP + help) @animation1_id = Ka_battle::LIMIT_USR_A_ID end elsif(@@hispell_user.include?(@active_battler)) help = (Ka_battle:HISPELL_HELP + help) @animation1_id = Ka_battle::HISPELL_USR_A_ID end ################################################ @help_window.set_text(help, 1) end #-------------------------------------------------------------------------- # ● アイテムアクション 結果作成 #-------------------------------------------------------------------------- alias :ka_make_item_action_result :make_item_action_result def make_item_action_result ka_make_item_action_result # アイテムを取得 @item = $data_items[@active_battler.current_action.item_id] hepl = @item.name ##############先制オプション修正 if(@@accel_user.include?(@active_battler)) help = (Ka_battle::ACCELERATOR_HELP + help) @animation1_id = Ka_battle::ACCELERATOR_USR_A_ID end ###全体化 if(@@mystic_user.include?(@active_battler)) help = (Ka_battle::MYSTIC_HELP + help) @animation1_id = Ka_battle::MYSTIC_USER_A_ID end @help_window.set_text(help, 1) end end