#============================================================================== # ■ XP-RGSS-66 精霊システム [status] by Claimh #------------------------------------------------------------------------------ # ★精霊ステータス画面 # $scene = Scene_SpiritStatus.new(spirit_index, menu_index) # spirit_index : 精霊Index(省略時は0) # menu_index : メニューIndex(省略時は-1 = Mapに戻る) #============================================================================== #============================================================================== # ■ Window_Status #============================================================================== class Window_Status < Window_Base #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- alias refresh_spirit refresh def refresh refresh_spirit draw_partner_name(@actor, 320, 0) end end #============================================================================== # ■ Window_SpiritStatus #============================================================================== class Window_SpiritStatus < Window_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(spirit) super(0, 0, 640, 480) self.contents = Bitmap.new(width - 32, height - 32) @spirit = spirit refresh end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh self.contents.clear draw_actor_name(@spirit, 4, 0) draw_spirit_level(@spirit, 200, 0) draw_actor_battler(@spirit, 460, 120) # self.contents.font.color = system_color self.contents.draw_text(24, 32*1, 80, 32, "EXP") self.contents.draw_text(24, 32*2, 80, 32, "NEXT") self.contents.draw_text(24, 32*6, 120, 32, "能力付与") self.contents.draw_text(200, 32*6, 120, 32, "スキル") # self.contents.font.color = normal_color self.contents.draw_text(24 + 80, 32*1, 84, 32, @spirit.exp_s, 2) self.contents.draw_text(24 + 80, 32*2, 84, 32, @spirit.next_rest_exp_s, 2) draw_partner_name2(@spirit, 24, 32*3) for i in 0..5 draw_actor_parameter(@spirit, 24+20, 32*(i+7), i) end skills = @spirit.skills clumn = 2 # 列数 for i in 0...skills.size x = 200+20 + (i % clumn) * 180 y = 32*(i/clumn+7) draw_item_name($data_skills[skills[i]], x, y) end end #-------------------------------------------------------------------------- # ● バトラー描画(Graphics/Battlers内の画像を表示) #-------------------------------------------------------------------------- def draw_actor_battler(spirit, x, y) bitmap = spirit.graphic cw = bitmap.width ch = bitmap.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x-cw/2, y-ch/2, bitmap, src_rect) end #-------------------------------------------------------------------------- # ● パラメータの描画 #-------------------------------------------------------------------------- def draw_actor_parameter(spirit, x, y, type) case type when 0 parameter_name = "最大"+$data_system.words.hp parameter_value = spirit.maxhp when 1 parameter_name = "最大"+$data_system.words.sp parameter_value = spirit.maxsp when 2 parameter_name = $data_system.words.str parameter_value = spirit.str when 3 parameter_name = $data_system.words.dex parameter_value = spirit.dex when 4 parameter_name = $data_system.words.agi parameter_value = spirit.agi when 5 parameter_name = $data_system.words.int parameter_value = spirit.int end self.contents.font.color = system_color self.contents.draw_text(x, y, 120, 32, parameter_name) self.contents.font.color = normal_color self.contents.draw_text(x + 80, y, 36, 32, parameter_value.to_s, 2) end end #============================================================================== # ■ Scene_SpiritStatus #============================================================================== class Scene_SpiritStatus #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(spirit_index=0, menu_index=-1) @spirit_index = spirit_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 id = $game_party.spirits[@spirit_index] @status_window = Window_SpiritStatus.new($game_party.spirit[id]) 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) @spirit_index = (@spirit_index + 1) % $game_party.spirits.size $scene = Scene_SpiritStatus.new(@spirit_index, @menu_index) elsif Input.trigger?(Input::L) $game_system.se_play($data_system.cursor_se) @spirit_index = (@spirit_index + $game_party.spirits.size - 1) % $game_party.spirits.size $scene = Scene_SpiritStatus.new(@spirit_index, @menu_index) end end end