전투 종료후 나오는 결과 화면을 개조 시키는 스크립트 입니다. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ #_/ ◆결과 화면 개조 - KGC_ResultAlter◆ #_/---------------------------------------------------------------------------- #_/ 결과 화면을 개조합니다. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ $imported["ResultAlter"] = true #============================================================================== # ■ Window_BattleStatus #============================================================================== class Window_BattleStatus < Window_Base #-------------------------------------------------------------------------- # ● 公開インスタンス変数 #-------------------------------------------------------------------------- attr_reader :level_up_flags # レベルアップフラグ end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #============================================================================== # ■ Window_BattleResult #============================================================================== class Window_BattleResult < Window_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 # exp : EXP # gold : ゴールド # treasures : トレジャー #-------------------------------------------------------------------------- def initialize(exp, gold, treasures) @exp = exp @gold = gold @treasures = treasures @level_up_flags = [false, false, false, false, false] @gold_window = Window_Gold.new @gold_window.x = 480 @gold_window.back_opacity = 160 @gold_window.z = 3000 super(0, 0, 640, 480) self.contents = Bitmap.new(width - 32, height - 32) self.back_opacity = 160 self.visible = false self.z = 2000 end #-------------------------------------------------------------------------- # ● 解放 #-------------------------------------------------------------------------- def dispose @gold_window.dispose super end #-------------------------------------------------------------------------- # ● 可視/不可視 #-------------------------------------------------------------------------- def visible=(n) @gold_window.visible = n super end #-------------------------------------------------------------------------- # ● レベルアップフラグの設定 # actor_index : アクターインデックス #-------------------------------------------------------------------------- def level_up(actor_index) @level_up_flags[actor_index] = true end #-------------------------------------------------------------------------- # ● リフレッシュ # last_level : 上昇前のレベル配列 #-------------------------------------------------------------------------- def refresh(last_level) self.contents.clear x = 0 # 経験値2倍ボーナス(1)が入っている場合 if $imported["BonusGauge"] && $game_temp.bonus_effects.include?(1) self.contents.font.color = text_color(6) else self.contents.font.color = normal_color end cx = contents.text_size(@exp.to_s).width self.contents.draw_shadow_text(x, 0, cx, 32, @exp.to_s) x += cx + 4 self.contents.font.color = system_color cx = contents.text_size("EXP").width self.contents.draw_shadow_text(x, 0, 64, 32, "EXP") x += cx + 16 # 金2倍ボーナス(2)が入っている場合 if $imported["BonusGauge"] && $game_temp.bonus_effects.include?(2) self.contents.font.color = text_color(6) else self.contents.font.color = normal_color end cx = contents.text_size(@gold.to_s).width self.contents.draw_shadow_text(x, 0, cx, 32, @gold.to_s) x += cx + 4 self.contents.font.color = system_color self.contents.draw_shadow_text(x, 0, 128, 32, $data_system.words.gold) # アイテム入手率上昇ボーナス(3)が入っている場合 if $imported["BonusGauge"] && $game_temp.bonus_effects.include?(3) self.contents.fill_rect(0, 32, 608, 96, Color.new(255, 255, 128, 64)) end x = 0; y = 32 for item in @treasures draw_item_name(item, x, y) y += 32 if y == 128 x += 224; y = 32 end end # キャラクター情報を描画 y = 128 for i in 0...$game_party.actors.size actor = $game_party.actors[i] self.contents.font.color = system_color self.contents.draw_shadow_text(128, y, 32, 32, "Lv") self.contents.draw_shadow_text(0, y + 32, 32, 32, $data_system.words.hp) self.contents.draw_shadow_text(96, y + 32, 32, 32, $data_system.words.sp) self.contents.font.color = normal_color self.contents.draw_shadow_text(0, y, 120, 32, actor.name) self.contents.draw_shadow_text(160, y, 24, 32, actor.level.to_s) self.contents.draw_shadow_text(32, y + 32, 48, 32, actor.maxhp.to_s, 2) self.contents.draw_shadow_text(128, y + 32, 48, 32, actor.maxsp.to_s, 2) self.contents.font.color = system_color self.contents.draw_shadow_text(192, y, 80, 32, "EXP") self.contents.font.color = normal_color self.contents.draw_shadow_text(192 + 80, y, 84, 32, actor.exp_s, 2) if @level_up_flags[i] self.contents.font.color = text_color(6) self.contents.draw_shadow_text(192, y + 32, 120, 32, "LEVEL UP!") # クラス取得 actor_class = $data_classes[actor.class_id] # 修得するスキルを確認 @learn_skills = [] for j in 0...actor_class.learnings.size learn_skill = actor_class.learnings[j] # 今回のレベルアップで修得するスキルをリストに追加 if actor.level >= learn_skill.level && last_level[i] < learn_skill.level @learn_skills.push(learn_skill.skill_id) end end unless @learn_skills == [] # ウィンドウに描画 self.contents.font.size = 16 self.contents.font.color = text_color(3) self.contents.draw_shadow_text(360, y + 8, 48, 32, "New", 1) self.contents.draw_shadow_text(360, y + 28, 48, 32, "Skill", 1) self.contents.font.color = normal_color sy = y + (20 - [@learn_skills.size - 1, 2].min * 10) for j in 0...[@learn_skills.size, 3].min skill = $data_skills[@learn_skills[j]] icon = RPG::Cache.icon(skill.icon_name) dest_rect = Rect.new(408, sy + j * 20, 20, 20) src_rect = Rect.new(0, 0, 24, 24) self.contents.stretch_blt(dest_rect, icon, src_rect) self.contents.draw_text(428, sy - 4 + j * 20, 180, 32, skill.name) end self.contents.font.size = 22 end else self.contents.font.color = system_color self.contents.draw_shadow_text(192, y + 32, 80, 32, "NEXT") self.contents.font.color = normal_color self.contents.draw_shadow_text(192 + 80, y + 32, 84, 32, actor.next_rest_exp_s, 2) end y += 64 end end end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #============================================================================== # ■ Scene_Battle (分割定義 2) #============================================================================== class Scene_Battle #-------------------------------------------------------------------------- # ● アフターバトルフェーズ開始 #-------------------------------------------------------------------------- alias start_phase5_KGC_ResultAlter start_phase5 def start_phase5 # 元のレベルを保存 actor_last_level = [] for i in 0...$game_party.actors.size actor_last_level[i] = $game_party.actors[i].level end # 元の処理を実行 start_phase5_KGC_ResultAlter # レベルアップ判定 for i in 0...$game_party.actors.size if @status_window.level_up_flags[i] @result_window.level_up(i) end end @result_window.refresh(actor_last_level) end end