#============================================================================== # ■ VXAce-RGSS3-39 特殊戦闘コマンド [Ver.1.0.0] by Claimh #------------------------------------------------------------------------------ # スキル一覧を表示せず、ダイレクトにスキルを使用できるようになります。 #============================================================================== module SpSkill SKT = { # スキルタイプ => 発動スキルID 3 => 21, # 体当たり 4 => 80 # 強撃 } #-------------------------------------------------------------------------- # ● 特殊戦闘コマンドの対象? #-------------------------------------------------------------------------- def self.include?(stype) SKT.keys.include?(stype) end #-------------------------------------------------------------------------- # ● 発動スキル #-------------------------------------------------------------------------- def self.skill(stype) $data_skills[SKT[stype]] end #-------------------------------------------------------------------------- # ● コマンド追加許可 #-------------------------------------------------------------------------- def self.add?(actor, stype) include?(stype) ? actor.skill_learn?(skill(stype)) : true end #-------------------------------------------------------------------------- # ● コマンド使用許可 #-------------------------------------------------------------------------- def self.usable?(actor, stype) include?(stype) ? actor.usable?(skill(stype)) : true end end #============================================================================== # ■ Window_ActorCommand #============================================================================== class Window_ActorCommand < Window_Command #-------------------------------------------------------------------------- # ● スキルコマンドをリストに追加 [再定義] #-------------------------------------------------------------------------- def add_skill_commands @actor.added_skill_types.sort.each do |stype_id| next unless SpSkill.add?(@actor, stype_id) name = $data_system.skill_types[stype_id] add_command(name, :skill, SpSkill.usable?(@actor, stype_id), stype_id) end end end #============================================================================== # ■ Scene_Battle #============================================================================== class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # ● コマンド[スキル] #-------------------------------------------------------------------------- alias command_skill_spskill command_skill def command_skill stype = @actor_command_window.current_ext if SpSkill.include?(stype) @skill = SpSkill.skill(stype) BattleManager.actor.input.set_skill(@skill.id) BattleManager.actor.last_skill.object = @skill if !@skill.need_selection? next_command elsif @skill.for_opponent? select_enemy_selection else select_actor_selection end else command_skill_spskill end end #-------------------------------------------------------------------------- # ● アクター[キャンセル] #-------------------------------------------------------------------------- alias on_actor_cancel_spskill on_actor_cancel def on_actor_cancel if @actor_command_window.current_symbol == :skill and SpSkill.include?(@actor_command_window.current_ext) @actor_window.hide @actor_command_window.activate else on_actor_cancel_spskill end end #-------------------------------------------------------------------------- # ● 敵キャラ[キャンセル] #-------------------------------------------------------------------------- alias on_enemy_cancel_spskill on_enemy_cancel def on_enemy_cancel if @actor_command_window.current_symbol == :skill and SpSkill.include?(@actor_command_window.current_ext) @enemy_window.hide @actor_command_window.activate else on_enemy_cancel_spskill end end end