#============================================================================== # □ DS_Custom_Status Ver.1.0.1(2011/08/04) #------------------------------------------------------------------------------ #  カスタムステータス画面のウィンドウ管理と処理を行います。 #------------------------------------------------------------------------------ #  ※ 注意事項 ※ # #   このスクリプトでは、「オーバードライブ - KGC_OverDrive」のゲージ表記を #  行っております。 #   また、「装備拡張 - KGC_EquipExtension」でひとつ装備品を追加された状態 #  での記述にデザインされています。 # #============================================================================== #============================================================================== # ◆ ユーザー設定 #============================================================================== module DS module CST module Vocab NameTitle = "名前" # 「名前」タイトルの表記 ClassTitle = "称号" # 「職業」タイトルの表記 ExpTotal = "EXP" # 「現在の経験値」タイトルの表記 ExpNext = "次のLvまであと" # 「次のレベルまで」タイトルの表記 OdName = "OD" # 「KGC_オーバードライブ」タイトルの表記 PrmName = "能力値" # 「能力値」タイトルの表記 end end end #/////////////////////////////////////////////////////////////////////////////# # # # 下記のスクリプトを変更する必要はありません。 # # # #/////////////////////////////////////////////////////////////////////////////# #============================================================================== # □ DS_CST_Actor_Info #------------------------------------------------------------------------------ #  ステータス画面で、名前・レベル・称号を表示するウィンドウです。 #============================================================================== class CST_Actor_Info < Window_Base #-------------------------------------------------------------------------- # ○ オブジェクト初期化 # actor : アクター #-------------------------------------------------------------------------- def initialize(actor) super(0, 0, 272, 80) # ウィンドウの位置とサイズ @actor = actor refresh end #-------------------------------------------------------------------------- # ○ リフレッシュ #-------------------------------------------------------------------------- def refresh self.contents.clear draw_actor_name(@actor, 0, 0) # 名前 draw_actor_lv(@actor, 180, 0) # レベル draw_actor_class(@actor, 0, 24) # 職業 end #-------------------------------------------------------------------------- # ○ 名前の描画 # actor : アクター # x : 描画先 X 座標 # y : 描画先 Y 座標 #-------------------------------------------------------------------------- def draw_actor_name(actor, x, y) self.contents.font.color = system_color self.contents.draw_text(x, y, 48, WLH, DS::CST::Vocab::NameTitle) self.contents.font.color = hp_color(actor) self.contents.draw_text(x + 36, y, 120, WLH, actor.name, 2) end #-------------------------------------------------------------------------- # ○ レベルの描画 # x : 描画先 X 座標 # y : 描画先 Y 座標 #-------------------------------------------------------------------------- def draw_actor_lv(actor, x, y) self.contents.font.color = system_color self.contents.draw_text(x, y, 32, WLH, Vocab::level_a) self.contents.font.color = normal_color self.contents.draw_text(x + 32, y, 24, WLH, actor.level, 2) end #-------------------------------------------------------------------------- # ○ クラスの描画 # actor : アクター # x : 描画先 X 座標 # y : 描画先 Y 座標 #-------------------------------------------------------------------------- def draw_actor_class(actor, x, y) self.contents.font.color = system_color self.contents.draw_text(x, y, 48, WLH, DS::CST::Vocab::ClassTitle) self.contents.font.color = normal_color self.contents.draw_text(x + 36, y, 120, WLH, actor.class.name, 2) end end # class CST_Actor_Info < Window_Base のend #============================================================================== # □ DS_CST_Actor_Body #------------------------------------------------------------------------------ #  ステータス画面で、立ち絵とステートを表示するウィンドウです。 #============================================================================== class CST_Actor_Body < Window_Base #-------------------------------------------------------------------------- # ○ オブジェクト初期化 # actor : アクター #-------------------------------------------------------------------------- def initialize(actor) super(0, 80, 272, 256) # ウィンドウの位置とサイズ @actor = actor refresh end #-------------------------------------------------------------------------- # ○ リフレッシュ #-------------------------------------------------------------------------- def refresh self.contents.clear draw_actor_body end #-------------------------------------------------------------------------- # ○ アクターの立ち絵の描画 (立ち絵:x =272, y = 288) #-------------------------------------------------------------------------- def draw_actor_body file_name = @actor.face_name + "-#{@actor.character_index + 1}" bitmap = Cache.picture(file_name) #self.contents.blt(0, 112, bitmap, bitmap.rect) self.contents.blt(-20, -26, bitmap, bitmap.rect) draw_actor_state_info(@actor, 0, 0) end #-------------------------------------------------------------------------- # ○ ステートの描画 # actor : アクター # x : 描画先 X 座標 # y : 描画先 Y 座標 # width : 描画先の幅 #-------------------------------------------------------------------------- def draw_actor_state_info(actor, x, y, width = 224) count = 0 for state in actor.states draw_icon(state.icon_index, x + 24 * count, y) count += 1 break if (24 * count > width - 24) end end end # class CST_Actor_Body < Window_Base のend #============================================================================== # □ DS_CST_Actor_Exp #------------------------------------------------------------------------------ #  ステータス画面で、経験値の情報を表示するウィンドウです。 #============================================================================== class CST_Actor_Exp < Window_Base #-------------------------------------------------------------------------- # ○ オブジェクト初期化 # actor : アクター #-------------------------------------------------------------------------- def initialize(actor) super(0, 336, 272, 80) # ウィンドウの位置とサイズ @actor = actor refresh end #-------------------------------------------------------------------------- # ○ リフレッシュ #-------------------------------------------------------------------------- def refresh self.contents.clear draw_actor_exp_info(0, 0) end #-------------------------------------------------------------------------- # ○ 経験値情報の描画 # x : 描画先 X 座標 # y : 描画先 Y 座標 #-------------------------------------------------------------------------- def draw_actor_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, 120, WLH, DS::CST::Vocab::ExpTotal) self.contents.draw_text(x, y + WLH * 1, 120, WLH, DS::CST::Vocab::ExpNext) self.contents.font.color = normal_color self.contents.draw_text(x + 112, y + WLH * 0, 120, WLH, s1, 2) self.contents.draw_text(x + 112, y + WLH * 1, 120, WLH, s2, 2) end end # class CST_Actor_Exp < Window_Base のend #============================================================================== # □ DS_CST_Actor_Basic #------------------------------------------------------------------------------ #  ステータス画面で、HP・MP・KGC_ODを表示するウィンドウです。 #============================================================================== class CST_Actor_Basic < Window_Base #-------------------------------------------------------------------------- # ○ オブジェクト初期化 # actor : アクター #-------------------------------------------------------------------------- def initialize(actor) super(272, 0, 272, 104) @actor = actor refresh end #-------------------------------------------------------------------------- # ○ リフレッシュ #-------------------------------------------------------------------------- def refresh self.contents.clear draw_actor_basic_info(0, 0) end #-------------------------------------------------------------------------- # ○ 基本情報の描画 # x : 描画先 X 座標 # y : 描画先 Y 座標 #-------------------------------------------------------------------------- def draw_actor_basic_info(x, y) draw_actor_hp(@actor, x, y + WLH * 0) # HP draw_actor_mp(@actor, x, y + WLH * 1) # MP draw_actor_od(@actor, x, y + WLH * 2) # KGC_OD end #-------------------------------------------------------------------------- # ○ HP の描画 # actor : アクター # x : 描画先 X 座標 # y : 描画先 Y 座標 # width : 幅 #-------------------------------------------------------------------------- def draw_actor_hp(actor, x, y, width = 240) draw_actor_hp_gauge(actor, x, y, width) self.contents.font.color = system_color self.contents.draw_text(x, y, 30, WLH, Vocab::hp_a) self.contents.font.color = hp_color(actor) xr = x + width if width < 120 self.contents.draw_text(xr - 40, y, 40, WLH, actor.hp, 2) else self.contents.draw_text(xr - 90, y, 40, WLH, actor.hp, 2) self.contents.font.color = normal_color self.contents.draw_text(xr - 50, y, 10, WLH, "/", 2) self.contents.draw_text(xr - 40, y, 40, WLH, actor.maxhp, 2) end end #-------------------------------------------------------------------------- # ○ MP の描画 # actor : アクター # x : 描画先 X 座標 # y : 描画先 Y 座標 # width : 幅 #-------------------------------------------------------------------------- def draw_actor_mp(actor, x, y, width = 240) draw_actor_mp_gauge(actor, x, y, width) self.contents.font.color = system_color self.contents.draw_text(x, y, 30, WLH, Vocab::mp_a) self.contents.font.color = mp_color(actor) xr = x + width if width < 120 self.contents.draw_text(xr - 40, y, 40, WLH, actor.mp, 2) else self.contents.draw_text(xr - 90, y, 40, WLH, actor.mp, 2) self.contents.font.color = normal_color self.contents.draw_text(xr - 50, y, 10, WLH, "/", 2) self.contents.draw_text(xr - 40, y, 40, WLH, actor.maxmp, 2) end end #-------------------------------------------------------------------------- # ○ KGC_ODの描画 # actor : アクター # x : 描画先 X 座標 # y : 描画先 Y 座標 #-------------------------------------------------------------------------- def draw_actor_od(actor, x, y, width = 240) draw_actor_od_gauge(actor, x, y, width) self.contents.font.color = system_color self.contents.draw_text(x, y, 30, WLH, DS::CST::Vocab::OdName) end end # class CST_Actor_Basic < Window_Base のend #============================================================================== # □ DS_CST_Actor_Parameter #------------------------------------------------------------------------------ #  ステータス画面で、基本パラメーターを表示するウィンドウです。 #============================================================================== class CST_Actor_Parameter < Window_Base #-------------------------------------------------------------------------- # ○ オブジェクト初期化 # actor : アクター #-------------------------------------------------------------------------- def initialize(actor) super(272, 104, 272, 104) # ウィンドウの位置とサイズ @actor = actor refresh end #-------------------------------------------------------------------------- # ○ リフレッシュ #-------------------------------------------------------------------------- def refresh self.contents.clear draw_actor_parameters(0, 0) end #-------------------------------------------------------------------------- # ○ 能力値の描画 # x : 描画先 X 座標 # y : 描画先 Y 座標 #-------------------------------------------------------------------------- def draw_actor_parameters(x, y) self.contents.font.color = system_color self.contents.draw_text(x, y, 120, WLH, DS::CST::Vocab::PrmName) draw_actor_parameter(@actor, x, y + WLH * 1, 0) draw_actor_parameter(@actor, x + 120, y + WLH * 1, 1) draw_actor_parameter(@actor, x, y + WLH * 2, 2) draw_actor_parameter(@actor, x + 120, y + WLH * 2, 3) 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 basic = actor.actor.parameters[type + 2, actor.level] params = [:@atk_plus, :@def_plus, :@spi_plus, :@agi_plus] plus = actor.instance_variable_get(params[type]) parameter_value = "#{parameter_value} (#{sprintf("%3d", basic + plus)})" self.contents.font.color = system_color self.contents.draw_text(x, y, 24, WLH, parameter_name) self.contents.font.color = normal_color self.contents.draw_text(x + 24, y, 96, WLH, parameter_value, 2) end end # class CST_Actor_Parameter < Window_Base のend #============================================================================== # □ DS_CST_Actor_Equip #------------------------------------------------------------------------------ #  ステータス画面で、装備一覧を表示するウィンドウです。 #============================================================================== class CST_Actor_Equip < Window_Base #-------------------------------------------------------------------------- # ○ オブジェクト初期化 # actor : アクター #-------------------------------------------------------------------------- def initialize(actor) super(272, 208, 272, 208) # ウィンドウの位置とサイズ @actor = actor refresh end #-------------------------------------------------------------------------- # ○ リフレッシュ #-------------------------------------------------------------------------- def refresh self.contents.clear draw_actor_equip(0, 4) end #-------------------------------------------------------------------------- # ○ 装備品の描画 # x : 描画先 X 座標 # y : 描画先 Y 座標 #-------------------------------------------------------------------------- def draw_actor_equip(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 # 以下、KGC装備拡張による描画追加 @actor.equips.each_with_index { |item, i| draw_item_name(item, x + 36, WLH * (i + 1)) } end end # class CST_Actor_Equip < Window_Base のend #============================================================================== # □ DS_CST_Scene_Status #------------------------------------------------------------------------------ #  ステータス画面の処理を行うクラスです。 #============================================================================== class Scene_Status < Scene_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 # actor_index : アクターインデックス #-------------------------------------------------------------------------- def initialize(actor_index = 0) @actor_index = actor_index end #-------------------------------------------------------------------------- # ○ 開始処理 #-------------------------------------------------------------------------- def start super create_menu_background @actor = $game_party.members[@actor_index] @status_window = CST_Actor_Info.new(@actor) # DS_CST_Actor_Infoの開始 @actor_body = CST_Actor_Body.new(@actor) # DS_CST_Actor_Bodyの開始 @actor_exp = CST_Actor_Exp.new(@actor) # DS_CST_Actor_Expの開始 @actor_basic = CST_Actor_Basic.new(@actor) # DS_CST_Actor_Basicの開始 @actor_parameters = CST_Actor_Parameter.new(@actor) # DS_CST_Actor_Parameterの開始 @actor_equip = CST_Actor_Equip.new(@actor) # DS_CST_Actor_Equipの開始 end #-------------------------------------------------------------------------- # ○ 終了処理 #-------------------------------------------------------------------------- def terminate super dispose_menu_background @status_window.dispose # DS_CST_Actor_Infoの終了 @actor_body.dispose # DS_CST_Actor_Bodyの終了 @actor_exp.dispose # DS_CST_Actor_Expの終了 @actor_basic.dispose # DS_CST_Actor_Basicの終了 @actor_parameters.dispose # DS_CST_Actor_Parameterの終了 @actor_equip.dispose # DS_CST_Actor_Equipの終了 end #-------------------------------------------------------------------------- # ● 元の画面へ戻る #-------------------------------------------------------------------------- def return_scene $scene = Scene_Menu.new(3) end #-------------------------------------------------------------------------- # ● 次のアクターの画面に切り替え #-------------------------------------------------------------------------- def next_actor @actor_index += 1 @actor_index %= $game_party.members.size $scene = Scene_Status.new(@actor_index) end #-------------------------------------------------------------------------- # ● 前のアクターの画面に切り替え #-------------------------------------------------------------------------- def prev_actor @actor_index += $game_party.members.size - 1 @actor_index %= $game_party.members.size $scene = Scene_Status.new(@actor_index) end #-------------------------------------------------------------------------- # ○ フレーム更新 #-------------------------------------------------------------------------- def update update_menu_background @status_window.update # DS_CST_Actor_Infoの更新 @actor_body.update # DS_CST_Actor_Bodyの更新 @actor_exp.update # DS_CST_Actor_Expの更新 @actor_basic.update # DS_CST_Actor_Basicの更新 @actor_parameters.update # DS_CST_Actor_Parameterの更新 @actor_equip.update # DS_CST_Actor_Equipの更新 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 end super end end #/////////////////////////////////////////////////////////////////////////////# #  製作者:SOLA@DEEP SEASONS # #  配布元:http://deepseasons.seesaa.net/ # #  更新日:2011/08/04 # #/////////////////////////////////////////////////////////////////////////////#