#============================================================================== # ■ コマンド封印 #------------------------------------------------------------------------------ # 戦闘時に指定したスイッチがオンの時、そのコマンドを使えなくなるようにする # チュートリアルで特定の行動だけさせたいときなどに使える # 全てのスイッチをオンにしたら戦闘自体が出来なくなるので # セーフティ機能搭載(防御だけオンになる) # # *月の下の宿 # URL:http://gekkasou.shiteyattari.com/ #============================================================================== module An #↓消さないでください Seal_Command = [] #Seal_Command[アクター番号] = [スイッチ1,スイッチ2,スイッチ3,スイッチ4] #1から順に攻撃、特技、防御、道具に対応してます #0で全アクター共通設定を変更出来ます Seal_Command[0] = [6,7,8,9] Seal_Command[1] = [6,7,8,10] #↓消さないでください module_function #セーフティ機能 def seal_command_safety(actor) for i in 0..3 return if $game_switches[seal_command(actor.id)[i]] end $game_switches[seal_command(actor.id)[2]] = false end #封印判定 def check_sealing_command(actor, command) return $game_switches[seal_command(actor.id)[command]] end #その他処理 def seal_command(id) if Seal_Command[id].nil? id = 0 end return Seal_Command[id] end end #============================================================================== # ■ Window_ActorCommand #============================================================================== class Window_ActorCommand < Window_Command #-------------------------------------------------------------------------- # ● セットアップ #-------------------------------------------------------------------------- alias an_seal_command_setup setup def setup(actor) An::seal_command_safety(actor) @an_command_seal = [] for i in 0..3 @an_command_seal[i] = !An::check_sealing_command(actor, i) end an_seal_command_setup(actor) end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- alias an_seal_command_refresh refresh unless $@ def refresh an_seal_command_refresh self.contents.clear for i in 0...@item_max draw_item(i, @an_command_seal[i]) end end end #============================================================================== # ■ Scene_Battle #============================================================================== class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # ● アクターコマンド選択の更新 #-------------------------------------------------------------------------- alias an_seal_update_actor_command_selection update_actor_command_selection def update_actor_command_selection An::seal_command_safety(@active_battler) if Input.trigger?(Input::C) && An::check_sealing_command(@active_battler, @actor_command_window.index) Sound.play_buzzer return end an_seal_update_actor_command_selection end end #Ver1.02