#============================================================================== # ■ XP-RGSS-11-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::SWORD, SysUpdate::LANCE, SysUpdate::AX, SysUpdate::BOW, SysUpdate::GUN, SysUpdate::WAND] # 表示属性(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, 640, 480) self.contents = Bitmap.new(width - 32, height - 32) @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+100, y, 100, 32, @actor.element_rate(ele[j]).to_s, 2) self.contents.draw_text(x+208, y, 100, 32, "%") end end end end #============================================================================== # ■ Scene_ElementStatus #============================================================================== class Scene_ElementStatus #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(actor_index=0, menu_index=-1) @actor_index = actor_index @menu_index = menu_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 @status_window = Window_ElementStatus.new($game_party.actors[@actor_index]) end #-------------------------------------------------------------------------- # ● 終了処理 #-------------------------------------------------------------------------- def terminate @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) $game_system.se_play($data_system.cancel_se) exit_scene elsif Input.trigger?(Input::R) $game_system.se_play($data_system.cursor_se) @actor_index = (@actor_index + 1) % $game_party.actors.size $scene = Scene_ElementStatus.new(@actor_index, @menu_index) elsif Input.trigger?(Input::L) $game_system.se_play($data_system.cursor_se) @actor_index = (@actor_index + $game_party.actors.size - 1) % $game_party.actors.size $scene = Scene_ElementStatus.new(@actor_index, @menu_index) end end end