# ▼▲▼ No69. 特殊効果詰め合わせ ScopeEX ▼▲▼ # # update 2006/ 2/15 # # [採用] 付加属性名判定・装備属性取得 #============================================================================== # ▽ 特殊効果の設定 ( 名称設定、取得設定 ) #============================================================================== module XRXS69 AREA_EXTEND = "全体化" # 「  全体化  」属性の名前 AREA_ACTOR_ALL = "味方全体" # 「 味方全体 」属性の名前 AREA_SELF = "使用者" # 「  使用者  」属性の名前 AREA_WHOLE = "全域化" # 「  全域化  」属性の名前 AREA_ENEMY_RAND = "敵ランダム" # 「 敵ランダム 」属性の名前 AREA_ACTOR_RAND = "味方ランダム" # 「味方ランダム」属性の名前 AREA_ALL_RAND = "対象ランダム" # 「対象ランダム」属性の名前 SELF_EXCLUSION = "自分以外" # 「 自分以外 」属性の名前 SELF_INCLUSION = "諸刃" # 「  諸刃  」属性の名前 end class Game_BattleAction attr_accessor :scope_force # 「対象強制値」 (Numeric) attr_accessor :self_exclusion # 「自分以外」 (true/false) attr_accessor :self_inclusion # 「諸刃」 (true/false) end #============================================================================== # ■ Game_BattleAction #============================================================================== class Game_BattleAction #-------------------------------------------------------------------------- # ● クリア #-------------------------------------------------------------------------- alias xrxs69_clear clear def clear # 呼び戻す xrxs69_clear # 特殊効果をクリア clear_xrxs69_special_effect end #-------------------------------------------------------------------------- # ○ 特殊効果をクリア #-------------------------------------------------------------------------- def clear_xrxs69_special_effect self.scope_force = 0 self.self_exclusion = false self.self_inclusion = false end #-------------------------------------------------------------------------- # ○ 特殊効果インスタンスを削除 #-------------------------------------------------------------------------- def nillize_xrxs69_special_effect self.scope_force = nil self.self_exclusion = nil self.self_inclusion = nil end end #============================================================================== # ■ Game_Battler #============================================================================== class Game_Battler #-------------------------------------------------------------------------- # ● スキルの使用可能判定 #-------------------------------------------------------------------------- alias xrxs69_skill_can_use? skill_can_use? def skill_can_use?(skill_id) # スキルを取得 @skill = $data_skills[skill_id] # 範囲を計算 set_xrxs69_special_scope(self.skill_element_set(@skill)) scope = @skill.scope scope = self.current_action.scope_force if self.current_action.scope_force > 0 # 「自分以外」スキルの場合 if self.current_action.self_exclusion # 仲間の取得 battlers = (self.is_a?(Game_Actor) ? $game_party.actors : $game_troop.enemies) # 範囲によって分岐 case scope when 3,4,10 # 生存している仲間の数を取得 n = 0 battlers.each {|battler| n += 1 unless battler.dead?} when 5,6 # 全仲間の数を取得 n = battlers.size else n = 2 end # 対象が存在できない場合 return false if n <= 1 end # 呼び戻す return xrxs69_skill_can_use?(skill_id) end end #============================================================================== # ■ Scene_Skill #============================================================================== class Scene_Skill #-------------------------------------------------------------------------- # ● フレーム更新 (ターゲットウィンドウがアクティブの場合) #-------------------------------------------------------------------------- alias xrxs69_update_target update_target def update_target # 特殊効果の取得 if Input.trigger?(Input::C) @actor.set_xrxs69_special_scope(@actor.skill_element_set(@skill)) end # 呼び戻す xrxs69_update_target # 特殊効果を消去 for actor in $game_party.actors actor.current_action.nillize_xrxs69_special_effect end end end #============================================================================== # --- アクターカーソル # カーソル右へ --- #============================================================================== class Arrow_Actor < Arrow_Base def input_right @index += 1 @index %= $game_party.actors.size end end #============================================================================== # ■ Scene_Battle #============================================================================== class Scene_Battle #-------------------------------------------------------------------------- # ● メイン処理 #-------------------------------------------------------------------------- alias xrxs69_main main def main # 呼び戻す xrxs69_main # 特殊効果をクリア for actor in $game_party.actors actor.current_action.nillize_xrxs69_special_effect end end #-------------------------------------------------------------------------- # ● フレーム更新 (アクターコマンドフェーズ : アクター選択) #-------------------------------------------------------------------------- alias xrxs69_update_phase3_actor_select update_phase3_actor_select def update_phase3_actor_select # 呼び戻す xrxs69_update_phase3_actor_select # 「自分以外」の場合、自分を通過 if @active_battler != nil and @active_battler.current_action.self_exclusion and @actor_arrow != nil and @actor_arrow.actor == @active_battler @actor_arrow.update end end #-------------------------------------------------------------------------- # ● エネミー選択開始 #-------------------------------------------------------------------------- alias xrxs69_start_enemy_select start_enemy_select def start_enemy_select return if start_select_check xrxs69_start_enemy_select end #-------------------------------------------------------------------------- # ● アクター選択開始 #-------------------------------------------------------------------------- alias xrxs69_start_actor_select start_actor_select def start_actor_select return if start_select_check xrxs69_start_actor_select # 「自分以外」の場合、まずカーソルを一回右にずらす if @active_battler.current_action.self_exclusion @actor_arrow.input_right end end #-------------------------------------------------------------------------- # ○ 選択開始時のチェック #-------------------------------------------------------------------------- def start_select_check # "全体化"、"全域化"、"対象ランダム"の判定 case @active_battler.current_action.kind when 0 # 攻撃 # 使用する武器の特殊効果の取得 @active_battler.set_xrxs69_special_scope(@active_battler.equip_element_set) scope_force = @active_battler.current_action.scope_force if scope_force == 2 or scope_force == 4 or scope_force >= 8 phase3_next_actor return true end when 1 # スキル # 使用する武器の特殊効果の取得 @active_battler.set_xrxs69_special_scope(@active_battler.skill_element_set(@skill)) scope_force = @active_battler.current_action.scope_force if scope_force == 2 or scope_force == 4 or scope_force >= 8 end_skill_select phase3_next_actor return true end when 2 # アイテム @active_battler.set_xrxs69_special_scope(@item.element_set) scope_force = @active_battler.current_action.scope_force if scope_force == 2 or scope_force == 4 or scope_force >= 8 end_item_select phase3_next_actor return true end end return false end #-------------------------------------------------------------------------- # ● 基本アクション 結果作成 [〜.basic == 0 の時のみ再定義] #-------------------------------------------------------------------------- alias xrxs69_make_basic_action_result make_basic_action_result def make_basic_action_result # 攻撃の場合 if @active_battler.current_action.basic == 0 # アニメーション ID を設定 @animation1_id = @active_battler.animation1_id @animation2_id = @active_battler.animation2_id # 武器IDの取得 @weapon_id = @active_battler.is_a?(Game_Actor) ? @active_battler.weapon_id : 0 # 使用する武器の特殊効果の取得 @active_battler.set_xrxs69_special_scope(@active_battler.equip_element_set) # 基本アクションのターゲット配列作成 make_basic_action_target_set # 通常攻撃の効果を適用 for target in @target_battlers target.attack_effect(@active_battler) end return else xrxs69_make_basic_action_result end end #-------------------------------------------------------------------------- # ● スキルアクション 結果作成 #-------------------------------------------------------------------------- alias xrxs69_make_skill_action_result make_skill_action_result def make_skill_action_result # スキルを取得 @skill = $data_skills[@active_battler.current_action.skill_id] # 使用するスキルの特殊効果の取得 @active_battler.set_xrxs69_special_scope(@active_battler.skill_element_set(@skill)) # 呼び戻す xrxs69_make_skill_action_result end #-------------------------------------------------------------------------- # ● アイテムアクション 結果作成 #-------------------------------------------------------------------------- alias xrxs69_make_item_action_result make_item_action_result def make_item_action_result # アイテムを取得 @item = $data_items[@active_battler.current_action.item_id] # アイテム切れなどで使用できなくなった場合 unless $game_party.item_can_use?(@item.id) # 呼び戻す xrxs69_make_item_action_result return end # 特殊効果の設定 @active_battler.set_xrxs69_special_scope(@item.element_set) # 呼び戻す xrxs69_make_item_action_result end #-------------------------------------------------------------------------- # ○ 基本アクションのターゲット配列作成(1:敵単体 が基本) #-------------------------------------------------------------------------- def make_basic_action_target_set # 行動側バトラーがエネミーの場合 if @active_battler.is_a?(Game_Enemy) if @active_battler.restriction == 3 target = $game_troop.random_target_enemy elsif @active_battler.restriction == 2 target = $game_party.random_target_actor else set_target_battlers(1) return end # 行動側バトラーがアクターの場合 elsif @active_battler.is_a?(Game_Actor) if @active_battler.restriction == 3 target = $game_party.random_target_actor elsif @active_battler.restriction == 2 target = $game_troop.random_target_enemy else set_target_battlers(1) return end end # 対象側バトラーの配列を設定 @target_battlers = [target] end #-------------------------------------------------------------------------- # ● スキルまたはアイテムの対象側バトラー設定 [武器もここを使用!] #-------------------------------------------------------------------------- alias xrxs69_set_target_battlers set_target_battlers def set_target_battlers(scope) # 範囲強制値 case @active_battler.current_action.scope_force when 12 # 「拡散」 case scope when 1 scope = 2 when 3,7 scope = 4 when 5 scope = 6 end when 0 # else scope = @active_battler.current_action.scope_force end # case scope when 8, 11 # 全域化、対象ランダム @target_battlers = [] for battler in $game_party.actors + $game_troop.enemies @target_battlers.push(battler) if battler.exist? end # 自分以外 if @active_battler.current_action.self_exclusion @target_battlers -= [@active_battler] end # 対象ランダムの場合は一体に絞る if scope == 11 @target_battlers = [@target_battlers[rand(@target_battlers.size)]] end when 9 # 敵ランダム targets = [] for battler in @active_battler.is_a?(Game_Actor) ? $game_troop.enemies : $game_party.actors targets.push(battler) if battler.exist? end # 自分以外 if @active_battler.current_action.self_exclusion targets -= [@active_battler] end @target_battlers = [targets[rand(targets.size)]] when 10 # 味方ランダム targets = [] for battler in @active_battler.is_a?(Game_Actor) ? $game_party.actors : $game_troop.enemies targets.push(battler) if battler.exist? end # 自分以外 if @active_battler.current_action.self_exclusion targets -= [@active_battler] end @target_battlers = [targets[rand(targets.size)]] else # そのほか(1:敵単体 〜 7:使用者) # 呼び戻す xrxs69_set_target_battlers(scope) end # nil が入った場合は削除 (ランダム範囲時) @target_battlers.compact! # 特殊効果「自分以外」 if @active_battler.current_action.self_exclusion @target_battlers -= [@active_battler] end # 特殊効果「諸刃」 if @active_battler.current_action.self_inclusion @target_battlers.push(@active_battler) unless @target_battlers.include?(@active_battler) end # 全滅時はクリア unless @target_battlers[0].is_a?(Game_Battler) @target_battlers.clear end end end #============================================================================== # # --- 設定部 --- # #============================================================================== class Game_Battler #-------------------------------------------------------------------------- # ○ 特殊効果を設定 (範囲) #-------------------------------------------------------------------------- def set_xrxs69_special_scope(set) # 範囲強制値 if XRXS.element_include?(set, XRXS69::AREA_EXTEND) self.current_action.scope_force = 12 elsif XRXS.element_include?(set, XRXS69::AREA_ACTOR_ALL) self.current_action.scope_force = 4 elsif XRXS.element_include?(set, XRXS69::AREA_WHOLE) self.current_action.scope_force = 8 elsif XRXS.element_include?(set, XRXS69::AREA_ENEMY_RAND) self.current_action.scope_force = 9 elsif XRXS.element_include?(set, XRXS69::AREA_ACTOR_RAND) self.current_action.scope_force = 10 elsif XRXS.element_include?(set, XRXS69::AREA_ALL_RAND) self.current_action.scope_force = 11 else self.current_action.scope_force = 0 end # 自分以外 self.current_action.self_exclusion = XRXS.element_include?(set, XRXS69::SELF_EXCLUSION) # 諸刃 self.current_action.self_inclusion = XRXS.element_include?(set, XRXS69::SELF_INCLUSION) end end