#============================================================================== # ■ XP-RGSS-65 転職屋 [シーン] by Claimh #============================================================================== #============================================================================== # ■ Scene_JobChange #============================================================================== class Scene_JobChange include JobChange::MesCmd TXT1 = "誰のクラスを変更しますか?" #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(index=-1) @menu_index = index end #-------------------------------------------------------------------------- # ● メイン処理 #-------------------------------------------------------------------------- def main start # 開始処理 Graphics.transition # トランジション実行 loop do Graphics.update # ゲーム画面を更新 Input.update # 入力情報を更新 update # フレーム更新 break if $scene != self # 画面が切り替わったらループを中断 end Graphics.update Graphics.freeze # トランジション準備 terminate # 終了処理 end #-------------------------------------------------------------------------- # ● 開始処理 #-------------------------------------------------------------------------- def start @actor_window = Window_JobActors.new @info_window = Window_JobActInfo.new @list_window = Window_JobList.new @help_window = Window_Help.new @mes_window = Window_JobMessage.new @gold_window = Window_JobGold.new if JobChange::USE_GOLD # @list_window.help_window = @info_window @actor_window.help_window = @info_window @help_window.set_text(TXT1) end #-------------------------------------------------------------------------- # ● 終了処理 #-------------------------------------------------------------------------- def terminate @actor_window.dispose @info_window.dispose @list_window.dispose @help_window.dispose @mes_window.dispose @gold_window.dispose if JobChange::USE_GOLD end #---------------------------------------------------------------------------- # ● Callback #---------------------------------------------------------------------------- def callback(c=0) d = @list_window.data actor = @actor_window.actor enable = [ actor.weapon_id == 0 ? true : d.weapon_set.include?(actor.weapon_id), actor.armor1_id == 0 ? true : d.armor_set.include?(actor.armor1_id), actor.armor2_id == 0 ? true : d.armor_set.include?(actor.armor2_id), actor.armor3_id == 0 ? true : d.armor_set.include?(actor.armor3_id), actor.armor4_id == 0 ? true : d.armor_set.include?(actor.armor4_id) ] if enable.include?(false) $game_system.se_play($data_system.equip_se) @mes_window.set_text(M_EQUIP, actor) end @actor_window.actor.class_id = d.id @list_window.disable @actor_window.enable @actor_window.refresh @info_window.class_id = 0 @help_window.set_text(TXT1) @gold_window.visible = false if JobChange::USE_GOLD end #---------------------------------------------------------------------------- # ● フレーム更新 #---------------------------------------------------------------------------- def update if @mes_window.visible @mes_window.update elsif Input.trigger?(Input::RIGHT) and !@info_window.fix? $game_system.se_play($data_system.cursor_se) @info_window.page_right elsif Input.trigger?(Input::LEFT) and !@info_window.fix? $game_system.se_play($data_system.cursor_se) @info_window.page_left elsif @actor_window.active update_actors elsif @list_window.active update_list end end #---------------------------------------------------------------------------- # ● フレーム更新 : @actor_window #---------------------------------------------------------------------------- def update_actors @actor_window.update if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) $scene = @menu_index < 0 ? Scene_Map.new : Scene_Menu.new(@menu_index) elsif Input.trigger?(Input::C) $game_system.se_play($data_system.decision_se) @actor_window.disable @list_window.set_actor(@actor_window.actor) @list_window.enable @gold_window.visible = true if JobChange::USE_GOLD end end #---------------------------------------------------------------------------- # ● フレーム更新 : @list_window #---------------------------------------------------------------------------- def update_list @list_window.update @help_window.set_text(JobChange.text(@list_window.data.id)) if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @info_window.class_id = 0 @actor_window.enable @list_window.disable @help_window.set_text(TXT1) @gold_window.visible = false if JobChange::USE_GOLD elsif Input.trigger?(Input::C) unless @list_window.enable? $game_system.se_play($data_system.buzzer_se) @mes_window.set_text(@list_window.message, @list_window.cond_text) return end if JobChange::USE_GOLD $game_system.se_play($data_system.shop_se) $game_party.lose_gold(JobChange.price(@actor_window.actor.id, @list_window.data.id)) @gold_window.refresh else $game_system.se_play($data_system.decision_se) end @mes_window.set_text(M_CHANGE, @list_window.data) @mes_window.set_callback(0) end end end