#============================================================================== # ■ VX-RGSS2-4-opt 熟練度画面 [Ver.1.0.0] by Claimh #------------------------------------------------------------------------------ # ・各属性の熟練度と属性有効度を表示する画面です。 #------------------------------------------------------------------------------ # ・呼び出し方 # $scene = Scene_ElementStatus.new(actor_index, menu_index) # actor_index : アクターIndex(省略時は先頭アクター) # menu_index : メニューIndex(省略時はマップに戻る) #============================================================================== class Window_ElementStatus < Window_Base ELEMENTS=[] # 表示属性(1列目) ELEMENTS[0] = [SysUpdate::FIGHT, SysUpdate::SLASH, SysUpdate::THRUST, SysUpdate::BANG, SysUpdate::BOW, SysUpdate::WHIP] # 表示属性(2列目) ELEMENTS[1] = [SysUpdate::FIRE, SysUpdate::ICE, SysUpdate::THUNDER, SysUpdate::WATER, SysUpdate::GROUND, SysUpdate::WIND, SysUpdate::LIGHT, SysUpdate::DARK] #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(actor) super(0, 0, 544, 416) @actor = actor refresh end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh self.contents.clear draw_actor_name(@actor, 4, 0) # self.contents.font.color = system_color self.contents.draw_text(4, 32, 100, 32, "熟練度") # self.contents.font.color = normal_color elements = ELEMENTS for i in 0...elements.size ele = elements[i] x = 24 + (i % elements.size) * (self.contents.width / 2) for j in 0...ele.size y = 32 * 2 + 32 * j draw_attr_icon_lv(@actor, ele[j], x, y) # 属性有効度 self.contents.draw_text(x+80, y, 100, 32, @actor.element_rate(ele[j]).to_s, 2) self.contents.draw_text(x+188, y, 100, 32, "%") end end end end #============================================================================== # ■ Scene_ElementStatus #============================================================================== class Scene_ElementStatus < Scene_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(actor_index=0, menu_index=-1) @actor_index = actor_index @menu_index = menu_index end #-------------------------------------------------------------------------- # ● 開始処理 #-------------------------------------------------------------------------- def start super create_menu_background @status_window = Window_ElementStatus.new($game_party.members[@actor_index]) end #-------------------------------------------------------------------------- # ● 終了処理 #-------------------------------------------------------------------------- def terminate super dispose_menu_background @status_window.dispose end #---------------------------------------------------------------------------- # ● シーン終了 #---------------------------------------------------------------------------- def exit_scene $scene = @menu_index < 0 ? Scene_Map.new : Scene_Menu.new(@menu_index) end #---------------------------------------------------------------------------- # ● フレーム更新 #---------------------------------------------------------------------------- def update if Input.trigger?(Input::B) Sound.play_cancel exit_scene elsif Input.trigger?(Input::R) Sound.play_cursor @actor_index = (@actor_index + 1) % $game_party.members.size $scene = Scene_ElementStatus.new(@actor_index, @menu_index) elsif Input.trigger?(Input::L) Sound.play_cursor @actor_index = (@actor_index + $game_party.members.size - 1) % $game_party.members.size $scene = Scene_ElementStatus.new(@actor_index, @menu_index) end end end