#============================================================================== # ■ VX-RGSS-25 ステータス画面-改 [Ver.1.0.0] by Claimh #------------------------------------------------------------------------------ # ステータス画面を改変します。 #【変更点】 # ・ページ切り替え追加 # ・キャラ表示をバストアップに変更 # Graphics/Pictures/Actor#{ID}のファイル(Actor1など)を描画 # ・レイアウト変更 # ・属性耐性表示追加(2ページ目) #============================================================================== class StatusEx # ページ数 # Page.1 : ステータス # Page.2 : 属性防御率(2ページ目を使用する場合はアイコン設定が必要) PAGE_MAX = 2 # 表示対象の属性 ELEMENTS = [9,10,11,12,13,14,15,16] # 属性のアイコン[ID:0,…] E_ICON = [0, 50, 2, 4, 14, 16, 12, 0, 0, 104, 105, 106, 107, 108, 109, 110, 111] end #============================================================================== # ■ Window_Status #============================================================================== class Window_Status < Window_Base ELEMENTS = [9,10,11,12,13,14,15,16] # 耐性を表示する属性 #-------------------------------------------------------------------------- # ● オブジェクト初期化 # actor : アクター # page : ページ #-------------------------------------------------------------------------- def initialize(actor, page=0) super(0, 0, 544, 416) @actor = actor refresh(page) end #-------------------------------------------------------------------------- # ● ウィンドウ内容の作成 #-------------------------------------------------------------------------- def create_contents(page=0) self.contents.dispose h = height - 32 if StatusEx::PAGE_MAX == 1 self.oy = 0 elsif page == 0 h += 5 self.oy = 0 elsif (page+1) == StatusEx::PAGE_MAX h += 5 self.oy = 5 else h += 10 self.oy = 5 end self.contents = Bitmap.new(width - 32, h) end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh(page=0) create_contents(page) draw_actor_name(@actor, 4, self.oy) draw_actor_class(@actor, 128, self.oy) draw_actor_level(@actor, 264, self.oy) draw_actor_picture(@actor, 544-272-32, self.oy+416-288-32) case page when 0; refresh_page0 when 1; refresh_page1 end end #-------------------------------------------------------------------------- # ● リフレッシュ : Page0 #-------------------------------------------------------------------------- def refresh_page0 draw_basic_info(32, self.oy+32) draw_parameters(32, self.oy+120) draw_exp_info(264, self.oy+32) draw_equipments(32, self.oy+230) end #-------------------------------------------------------------------------- # ● リフレッシュ : Page1 #-------------------------------------------------------------------------- def refresh_page1 draw_elements(32, self.oy+32) end #-------------------------------------------------------------------------- # ● 基本情報の描画 # x : 描画先 X 座標 # y : 描画先 Y 座標 #-------------------------------------------------------------------------- def draw_basic_info(x, y) draw_actor_hp(@actor, x, y + WLH * 0) draw_actor_mp(@actor, x, y + WLH * 1) draw_actor_state(@actor, x, y + WLH * 2) end #-------------------------------------------------------------------------- # ● 能力値の描画 # x : 描画先 X 座標 # y : 描画先 Y 座標 #-------------------------------------------------------------------------- def draw_parameters(x, y) draw_actor_parameter(@actor, x, y + WLH * 0, 0) draw_actor_parameter(@actor, x, y + WLH * 1, 1) draw_actor_parameter(@actor, x, y + WLH * 2, 2) draw_actor_parameter(@actor, x, y + WLH * 3, 3) end #-------------------------------------------------------------------------- # ● 経験値情報の描画 # x : 描画先 X 座標 # y : 描画先 Y 座標 #-------------------------------------------------------------------------- def draw_exp_info(x, y) s1 = @actor.exp_s s2 = @actor.next_rest_exp_s s_next = sprintf(Vocab::ExpNext, Vocab::level) self.contents.font.color = system_color self.contents.draw_text(x, y + WLH * 0, 180, WLH, Vocab::ExpTotal) self.contents.draw_text(x, y + WLH * 1, 180, WLH, s_next) self.contents.font.color = normal_color self.contents.draw_text(x+60, y + WLH * 0, 180, WLH, s1, 2) self.contents.draw_text(x+60, y + WLH * 1, 180, WLH, s2, 2) end #-------------------------------------------------------------------------- # ● 装備品の描画 # x : 描画先 X 座標 # y : 描画先 Y 座標 #-------------------------------------------------------------------------- def draw_equipments(x, y) self.contents.font.color = system_color self.contents.draw_text(x, y, 120, WLH, Vocab::equip) for i in 0..4 draw_item_name(@actor.equips[i], x + 16, y + WLH * (i + 1)) end end #-------------------------------------------------------------------------- # ● 属性耐性の描画 # x : 描画先 X 座標 # y : 描画先 Y 座標 #-------------------------------------------------------------------------- def draw_elements(x, y) self.contents.font.color = system_color self.contents.draw_text(x, y, 120, WLH, "属性耐性") self.contents.font.color = normal_color for i in 0...StatusEx::ELEMENTS.size yy = y + WLH * (i+1) element_id = StatusEx::ELEMENTS[i] draw_element_icon(element_id, x+16, yy) self.contents.draw_text(x+16+24, yy, 180, WLH, $data_system.elements[element_id]) rate = @actor.element_rate(element_id) self.contents.draw_text(x+16, yy, 180, WLH, rate.to_s+" %", 2) end end #-------------------------------------------------------------------------- # ● 属性アイコンの描画 #-------------------------------------------------------------------------- def draw_element_icon(element_id, x, y, enabled = true) draw_icon(StatusEx::E_ICON[element_id], x, y, enabled) end #-------------------------------------------------------------------------- # ● ピクチャーグラフィックの描画 # name : ファイル名 # x : 描画先 X 座標 # y : 描画先 Y 座標 # w : 表示矩形幅 # h : 表示矩形高さ #-------------------------------------------------------------------------- def draw_picture(name, x, y, w=272 ,h=288) bitmap = Cache.picture(name) rect = Rect.new(0, 0, 0, 0) rect.x = (bitmap.width - w) / 2 rect.y = (bitmap.height - h) / 2 rect.width = w rect.height = h self.contents.blt(x, y, bitmap, rect) bitmap.dispose end #-------------------------------------------------------------------------- # ● ピクチャーグラフィックの描画 #-------------------------------------------------------------------------- def draw_actor_picture(actor, x, y) draw_picture("Actor#{actor.id}", x, y) end end #============================================================================== # ■ Scene_Status #============================================================================== class Scene_Status < Scene_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 # actor_index : アクターインデックス # menu_index : メニューインデックス # page_index : ページインデックス #-------------------------------------------------------------------------- def initialize(actor_index = 0, menu_index=3, page_index=0) @actor_index = actor_index @menu_index = menu_index @page_index = page_index end #-------------------------------------------------------------------------- # ● 開始処理 #-------------------------------------------------------------------------- def start super create_menu_background @actor = $game_party.members[@actor_index] @status_window = Window_Status.new(@actor, @page_index) end #-------------------------------------------------------------------------- # ● 終了処理 #-------------------------------------------------------------------------- def terminate super dispose_menu_background @status_window.dispose end #-------------------------------------------------------------------------- # ● 元の画面へ戻る #-------------------------------------------------------------------------- def return_scene $scene = Scene_Menu.new(@menu_index) end #-------------------------------------------------------------------------- # ● 次のアクターの画面に切り替え #-------------------------------------------------------------------------- def next_actor @actor_index += 1 @actor_index %= $game_party.members.size $scene = Scene_Status.new(@actor_index, @menu_index, @page_index) end #-------------------------------------------------------------------------- # ● 前のアクターの画面に切り替え #-------------------------------------------------------------------------- def prev_actor @actor_index += $game_party.members.size - 1 @actor_index %= $game_party.members.size $scene = Scene_Status.new(@actor_index, @menu_index, @page_index) end #-------------------------------------------------------------------------- # ● ページ切り替え #-------------------------------------------------------------------------- def change_page page_up end def page_up @page_index = (@page_index + 1) % StatusEx::PAGE_MAX @status_window.refresh(@page_index) end def page_down @page_index = (@page_index + StatusEx::PAGE_MAX - 1) % StatusEx::PAGE_MAX @status_window.refresh(@page_index) end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update update_menu_background @status_window.update if Input.trigger?(Input::B) Sound.play_cancel return_scene elsif Input.trigger?(Input::R) Sound.play_cursor next_actor elsif Input.trigger?(Input::L) Sound.play_cursor prev_actor elsif StatusEx::PAGE_MAX > 1 if Input.trigger?(Input::C) Sound.play_decision change_page elsif Input.trigger?(Input::UP) and @page_index > 0 Sound.play_decision page_up elsif Input.trigger?(Input::DOWN) and @page_index < (StatusEx::PAGE_MAX-1) Sound.play_decision page_down end end super end end