#============================================================================== # ■ Window_Status #------------------------------------------------------------------------------ #  ステータス画面で表示する、フル仕様のステータスウィンドウです。 #============================================================================== class Window_Status < Window_Base #-------------------------------------------------------------------------- # ◎ 定数 #-------------------------------------------------------------------------- GAUGE_COLOR = { :hp => [Color.new(0, 0, 0), Color.new(0, 0, 0)], :mp => [], :exp => [Color.new(64, 64, 64), Color.new(192, 192, 192)], :para => [] } ACTIVE_ELEMENT_ICONS = %w[炎 氷 雷 水 地 風 光 闇] ACTIVE_ELEMENT_RANKS = [9, 10, 11, 12, 13, 14, 15, 16] ACTIVE_STATE_RANKS = [2, 3, 4, 5, 6, 7, 8, 17] #-------------------------------------------------------------------------- # ○ オブジェクト初期化 # actor : アクター #-------------------------------------------------------------------------- def initialize(actor) super(0, 0, 544, 416) self.opacity = 0 @actor = actor refresh end #-------------------------------------------------------------------------- # ○ リフレッシュ #-------------------------------------------------------------------------- def refresh self.contents.clear #~ draw_actor_face(@actor, 272, 128) draw_actor_level(@actor, 32, 4) draw_actor_name(@actor, 110, 4) draw_actor_class(@actor, 4, 34) draw_basic_info(4, 88) draw_parameters(4, 160) draw_equipments(300, 240) draw_weak_ranks(4, 230) draw_character(16, 352) end #-------------------------------------------------------------------------- # ○ 基本情報の描画 # x : 描画先 X 座標 # y : 描画先 Y 座標 #-------------------------------------------------------------------------- def draw_basic_info(x, y) draw_actor_hp(@actor, x, y) draw_actor_mp(@actor, x + 126, y) draw_exp_info(x, y + WLH) end #-------------------------------------------------------------------------- # ○ 能力値の描画 # x : 描画先 X 座標 # y : 描画先 Y 座標 #-------------------------------------------------------------------------- def draw_parameters(x, y) for i in 0...4 xx = x + 126 * (i % 2) yy = y + WLH * (i / 2) draw_actor_parameter(@actor, xx, yy, i) end end #-------------------------------------------------------------------------- # ○ 能力値の描画 # actor : アクター # x : 描画先 X 座標 # y : 描画先 Y 座標 # type : 能力値の種類 (0〜3) #-------------------------------------------------------------------------- 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 end self.contents.font.color = system_color self.contents.draw_text(x, y, 78, WLH, parameter_name) self.contents.font.color = normal_color self.contents.draw_text(x + 78, y, 42, WLH, parameter_value, 2) end #-------------------------------------------------------------------------- # ○ 経験値情報の描画 # x : 描画先 X 座標 # y : 描画先 Y 座標 #-------------------------------------------------------------------------- def draw_exp_info(x, y) width = 246 now = @actor.exp max = @actor.next_rest_exp_s.to_i max = now if max == 0 draw_actor_gauge(x, y, now, max, :exp, width) self.contents.font.color = system_color self.contents.draw_text(x, y, width, WLH, Vocab::ExpTotal) self.contents.font.color = normal_color self.contents.draw_text(x, y, width, WLH, @actor.exp_s, 2) end #-------------------------------------------------------------------------- # ◎ # x : 描画先 X 座標 # y : 描画先 Y 座標 #-------------------------------------------------------------------------- def draw_weak_ranks(x, y) # e_rank = $data_classes[@actor.class_id].element_ranks self.contents.font.color = system_color self.contents.draw_text(x, y, 120, WLH, "弱点属性") count = 0 for i in 0...ACTIVE_ELEMENT_RANKS.size if e_rank[ACTIVE_ELEMENT_RANKS[i]] < 3 xx = x + 26 * count + 24 enabled = e_rank[ACTIVE_ELEMENT_RANKS[i]] == 1 ? true : false if ACTIVE_ELEMENT_ICONS[i].class == String self.contents.font.color = enabled ? knockout_color : normal_color self.contents.draw_text(xx, y + WLH, 24, WLH, ACTIVE_ELEMENT_ICONS[i]) else draw_icon(ACTIVE_ELEMENT_ICONS[i], xx, y + WLH, enabled) end count += 1 end end # s_rank = $data_classes[@actor.class_id].state_ranks self.contents.font.color = system_color self.contents.draw_text(x, y + 48, 120, WLH, "弱点ステート") count = 0 for state in ACTIVE_STATE_RANKS if s_rank[state] < 3 xx = x + 26 * count + 24 enabled = s_rank[state] == 1 ? true : false draw_icon($data_states[state].icon_index, xx, y + WLH * 3, enabled) count += 1 end end end #-------------------------------------------------------------------------- # ○ 歩行グラフィックの描画 # x : 描画先 X 座標 # y : 描画先 Y 座標 #-------------------------------------------------------------------------- def draw_character(x, y) for i in 0...$game_party.members.size actor = $game_party.members[i] return if actor.character_name == nil bitmap = Cache.character(actor.character_name) sign = actor.character_name[/^[\!\$]./] if sign != nil and sign.include?('$') cw = bitmap.width / 3 ch = bitmap.height / 4 else cw = bitmap.width / 12 ch = bitmap.height / 8 end n = actor.character_index src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch) enabled = actor == @actor ? 255 : 128 self.contents.blt(x + 48 * i, y, bitmap, src_rect, enabled) end end #-------------------------------------------------------------------------- # ○ レベルの描画 # actor : アクター # x : 描画先 X 座標 # y : 描画先 Y 座標 #-------------------------------------------------------------------------- def draw_actor_level(actor, x, y) self.contents.font.color = normal_color self.contents.draw_text(x, y, 24, WLH, actor.level, 2) end #-------------------------------------------------------------------------- # ◎ ゲージの描画 # x : 描画先 X 座標 # y : 描画先 Y 座標 # mow : 現在の数値 # max : 最大の数値 # type : ゲージのタイプ # width : 幅 #-------------------------------------------------------------------------- def draw_actor_gauge(x, y, now, max, type, width = 120) gw = width * now / max gc1 = GAUGE_COLOR[type][0] gc2 = GAUGE_COLOR[type][1] self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color) self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2) end end #============================================================================== # ■ Scene_Status #------------------------------------------------------------------------------ #  ステータス画面の処理を行うクラスです。 #============================================================================== class Scene_Status < Scene_Base #-------------------------------------------------------------------------- # ○ 開始処理 #-------------------------------------------------------------------------- def start super create_menu_background @actor = $game_party.members[@actor_index] @status_window = Window_Status.new(@actor) @actor_sprite = Sprite.new #~ @actor_sprite.bitmap = Cache.face("Actor#{@actor.id}") @actor_sprite.bitmap = Cache.face(@actor.name) @actor_sprite.x = 272 end #-------------------------------------------------------------------------- # ○ 終了処理 #-------------------------------------------------------------------------- def terminate super dispose_menu_background @status_window.dispose @actor_sprite.dispose end #-------------------------------------------------------------------------- # ○ メニュー画面系の背景作成 #-------------------------------------------------------------------------- def create_menu_background @menuback_sprite = Sprite.new @menuback_sprite.bitmap = Cache.system("StatusBack") update_menu_background end end