# 設定項目_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ class Window_Status# < Window_Selectable # ステータス画面で描画するパラメーター # パラメーターを参照するメソッドに ":" をつけた、シンボルで表記 VIEW_PARAMATERS = [ :atk, :def, :spi, :agi ] end class Window_EquipStatus# < Window_Selectable # 装備変更画面で描画するパラメーター VIEW_PARAMATERS = [ :atk, :def, :spi, :agi ] end # 設定項目_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ =begin ステータスや装備画面で任意のパラメーターを表示する =end class Window_MenuStatus < Window_Selectable #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh self.contents.clear @item_max = $game_party.members.size for actor in $game_party.members draw_actor_face(actor, 2, actor.index * 96 + 2, 92) x = 104 y = actor.index * 96 + WLH / 2 draw_actor_name(actor, x, y) draw_actor_level(actor, x, y + WLH * 1) xx = Vocab.maxer.push(x + 120, contents.width - 150).max draw_actor_state(actor, x, y + WLH * 2, contents.width - x - xx) draw_actor_class(actor, xx, y) draw_actor_hp(actor, xx, y + WLH * 1, 150) draw_actor_mp(actor, xx, y + WLH * 2, 150) end end end class Window_BattleStatus < Window_Selectable #-------------------------------------------------------------------------- # ● 項目の描画 # index : 項目番号 #-------------------------------------------------------------------------- def draw_item(index) rect = item_rect(index) rect.x += 4 rect.width -= 8 self.contents.clear_rect(rect) self.contents.font.color = normal_color actor = $game_party.members[index] draw_actor_name(actor, 4, rect.y) xx = contents.width xx -= 90 draw_actor_mp(actor, xx, rect.y, 85) xx -= 150 draw_actor_hp(actor, xx, rect.y, 145) draw_actor_state(actor, 114, rect.y, xx - 114) end end class Window_Base #-------------------------------------------------------------------------- # ● 能力値の描画 #-------------------------------------------------------------------------- def draw_actor_parameter(actor, x, y, type) case type when 0 parameter_name = Vocab::atk parameter_value = actor.atk when 1 parameter_name = Vocab::def parameter_value = actor.def when 2 parameter_name = Vocab::spi parameter_value = actor.spi when 3 parameter_name = Vocab::agi parameter_value = actor.agi else begin parameter_name = Vocab.__send__(type) rescue parameter_name = type.to_s end parameter_value = actor.__send__(type) parameter_value /= 100.0 if type == :atkn end self.contents.font.color = system_color self.contents.draw_text(x, y, 120, WLH, parameter_name) self.contents.font.color = normal_color self.contents.draw_text(x + 120, y, 36, WLH, parameter_value, 2) end end class Window_Status < Window_Base #-------------------------------------------------------------------------- # ● 能力値の描画 #-------------------------------------------------------------------------- def draw_parameters(x, y) for i in 0...VIEW_PARAMATERS.size draw_actor_parameter(@actor, x, y + WLH * i, VIEW_PARAMATERS[i]) end end end class Window_Equip #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(x, y, actor) super(x, y, Graphics.width - x, WLH * actor.equips.size + 32) @actor = actor refresh self.index = 0 end end class Scene_Equip < Scene_Base #-------------------------------------------------------------------------- # ● 開始処理 #-------------------------------------------------------------------------- alias start_for_status_adjust start def start @item_x = 0 @item_y = 208 start_for_status_adjust remake = false if @equip_window.height > @status_window.height @status_window.height = @equip_window.height @item_y = @status_window.y + @status_window.height remake = true end if @status_window.height > @equip_window.height @status_window.height = Graphics::height - @status_window.y @item_x = @status_window.x + @status_window.width remake = true end if remake for i in 0...@actor.equips.size#EQUIP_TYPE_MAX @item_windows[i].dispose end create_item_windows end end #-------------------------------------------------------------------------- # ● アイテムウィンドウの作成 #-------------------------------------------------------------------------- def create_item_windows @item_windows = [] for i in 0...@actor.equips.size#EQUIP_TYPE_MAX @item_windows[i] = Window_EquipItem.new(@item_x, @item_y, Graphics.width - @item_x, Graphics::height - @item_y, @actor, i) @item_windows[i].help_window = @help_window @item_windows[i].visible = (@equip_index == i) @item_windows[i].y = @item_y @item_windows[i].height = Graphics::height - @item_y @item_windows[i].active = false @item_windows[i].index = -1 end end #-------------------------------------------------------------------------- # ● ステータスウィンドウの更新 #-------------------------------------------------------------------------- def update_status_window if @equip_window.active paramaters = [] pms = Window_EquipStatus.const_get(:VIEW_PARAMATERS) for i in 0...pms.size paramaters << nil end @status_window.set_new_parameters(*paramaters) elsif @item_window.active temp_actor = @actor.clone temp_actor.change_equip(@equip_window.index, @item_window.item, true) paramaters = [] pms = Window_EquipStatus.const_get(:VIEW_PARAMATERS) for i in 0...pms.size parameter_value = temp_actor.__send__(pms[i]) parameter_value /= 100.0 if pms[i] == :atkn paramaters << parameter_value end @status_window.set_new_parameters(*paramaters) end @status_window.update end end class Window_EquipStatus < Window_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(x, y, actor) super(x, y, 208, WLH + WLH * VIEW_PARAMATERS.size + 32) @actor = actor refresh end #-------------------------------------------------------------------------- # ● 装備変更後の能力値設定 #-------------------------------------------------------------------------- def set_new_parameters(*paramaters) @last_paramaters = [] unless @last_paramaters changed = false for i in 0...paramaters.size next if paramaters[i] == @last_paramaters[i] changed = true break end return unless changed @last_paramaters.clear for i in 0...paramaters.size @last_paramaters << paramaters[i] end refresh end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh self.contents.clear draw_actor_name(@actor, 4, 0) for i in 0...VIEW_PARAMATERS.size draw_parameter(0, WLH * (i + 1), VIEW_PARAMATERS[i]) end end #-------------------------------------------------------------------------- # ● 能力値の描画 #-------------------------------------------------------------------------- def draw_parameter(x, y, type) @last_paramaters = [] unless @last_paramaters case type when 0 name = Vocab::atk value = @actor.atk new_value = @new_atk when 1 name = Vocab::def value = @actor.def new_value = @new_def when 2 name = Vocab::spi value = @actor.spi new_value = @new_spi when 3 name = Vocab::agi value = @actor.agi new_value = @new_agi else begin name = Vocab.__send__(type) rescue name = type.to_s end value = @actor.__send__(type) new_value = @last_paramaters[VIEW_PARAMATERS.index(type)] value /= 100.0 if type == :atkn end self.contents.font.color = system_color self.contents.draw_text(x + 4, y, 80, WLH, name) self.contents.font.color = normal_color self.contents.draw_text(x + 90, y, 30, WLH, value, 2) self.contents.font.color = system_color self.contents.draw_text(x + 122, y, 20, WLH, "→", 1) if new_value != nil self.contents.font.color = new_parameter_color(value, new_value) self.contents.draw_text(x + 142, y, 30, WLH, new_value, 2) end end end