#============================================================================== # ■ XP-RGSS-55 二重隊列システム-連携攻撃 [Ver.1.0.0] by Claimh #------------------------------------------------------------------------------ #・要:パーティー拡張, 二重隊列システム #・待機メンバーとの連携攻撃をします。 #------------------------------------------------------------------------------ #<<連携攻撃の仕組み>> # 戦闘メンバーがあるスキルを使用した際に # 待機メンバーがいる場合、連携攻撃が発動します。 # そのときは連携攻撃として指定されたスキルが発動します。 # なお、発動者(戦闘メンバー)と連携者(待機メンバー)の両者からSPが引かれます。 #============================================================================== module UniteSkill #============================================================================== # 掛け合い表示をする MESSAGE = true # 掛け合い表示時間 UNIT_TIME = 20 # 掛け合い設定 # XXX = [["発動者表示1", "連携者表示1"], ["発動者表示2","連携者表示2"],…] TL57_1 = [["いくぞ!","あっ、ハイ"],["あああ", "いいい"]] TL57_2 = [["オレに合わせろ!","まかせて"]] # 連携設定 UNIT = { # 発動スキルID => [ 57 => [ #[発動者ID,連携者ID, 発動成功率, 連携スキルID, 掛け合い設定] [ 1, 3, 100, 59, TL57_1], #[発動者ID,連携者ID, 発動成功率, 連携スキルID, 掛け合い設定] [ 1, 4, 100, 60, TL57_2] ], # 発動スキルID => [ 58 => [ #[発動者ID,連携者ID, 発動成功率, 連携スキルID, 掛け合い設定] [ 1, 2, 100, 60, TL57_1], ], } #============================================================================== end class Scene_Battle #-------------------------------------------------------------------------- # ● フレーム更新 (メインフェーズ ステップ 1 : アクション準備) #-------------------------------------------------------------------------- alias update_phase4_step1_unit_skill update_phase4_step1 def update_phase4_step1 @unit_skill = nil update_phase4_step1_unit_skill end #-------------------------------------------------------------------------- # ● 連携スキル発動判定 #-------------------------------------------------------------------------- def unit_skill_check(skill_id) # return if @flash_flag return unless @active_battler.is_a?(Game_Actor) unit_all_skill = UniteSkill::UNIT[skill_id] ok_unit = [] return if unit_all_skill.nil? for judge_unit in unit_all_skill # 発動者判別 if @active_battler.id == judge_unit[0] # 連携者判定(待機メンバーにいるか?) if $game_party.subactor_include?($game_actors[judge_unit[1]]) ok_unit.push(judge_unit) end end end # 対象なしなら判定終了 return if ok_unit.empty? # 連携対象の決定 last_unit = ok_unit[rand(ok_unit.size)] # 連携発動判定 return if rand(100) >= last_unit[2] @unit_actor = $game_actors[last_unit[1]] @unit_skill = last_unit # 一時的にスキル習得 @active_battler.learn_skill(@unit_skill[3]) @unit_actor.learn_skill(@unit_skill[3]) # 連携スキルを使用することが出来るか? if @active_battler.skill_can_use?(@unit_skill[3]) and @unit_actor.skill_can_use?(@unit_skill[3]) # 連携スキル発動 @active_battler.current_action.skill_id = @unit_skill[3] else # 使用できないならやめる @active_battler.forget_skill(@unit_skill[3]) @unit_actor.forget_skill(@unit_skill[3]) @unit_skill = nil @unit_actor = nil end end #-------------------------------------------------------------------------- # ● スキルアクション 結果作成 #-------------------------------------------------------------------------- alias make_skill_action_result_unit_skill make_skill_action_result def make_skill_action_result # 連携スキル発動判定 unit_skill_check(@active_battler.current_action.skill_id) make_skill_action_result_unit_skill # 原物 unless @unit_skill.nil? @unit_actor.sp -= $data_skills[@unit_skill[3]].sp_cost @unit_actor.bp -= SysSkill_BP.bp_cost(@unit_skill[3]) if Double_Team::SHOW_BP @active_battler.forget_skill(@unit_skill[3]) @unit_actor.forget_skill(@unit_skill[3]) end end #-------------------------------------------------------------------------- # ● フレーム更新 (メインフェーズ ステップ 3 : 行動側アニメーション) #-------------------------------------------------------------------------- alias update_phase4_step3_unit_skill update_phase4_step3 def update_phase4_step3 update_phase4_step3_unit_skill show_unit_message unless @unit_skill.nil? end #-------------------------------------------------------------------------- # ● 掛け合い表示 #-------------------------------------------------------------------------- def show_unit_message if UniteSkill::MESSAGE mess = @unit_skill[4] message = mess[rand(mess.size)] main_actor_window = Window_UnitSkill.new(640, 100, @active_battler, message[0], 0) sub_actor_window = Window_UnitSkill.new(-640, 164, @unit_actor, message[1], 2) for i in 0...UniteSkill::UNIT_TIME main_actor_window.x -= 640/UniteSkill::UNIT_TIME sub_actor_window.x += 640/UniteSkill::UNIT_TIME @spriteset.update Graphics.update end for i in 0...UniteSkill::UNIT_TIME @spriteset.update Graphics.update end sub_actor_window.dispose main_actor_window.dispose end @unit_skill = nil @unit_actor = nil end end class Window_UnitSkill < Window_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(x, y, actor, message, type) super(x, y, 640, 64) self.contents = Bitmap.new(width - 32, height - 32) self.opacity = 160 return if message.nil? text = actor.name + "「" + message + "」" refresh(text, type) end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh(text, type) self.contents.clear self.contents.draw_text(0, 0, self.contents.width, 32, text, type) end end