#============================================================================== # [ZTBS] -Zenith Tactical Battle System- タクティカルバトルシステム #  〜+B17:リザルト経験値表示〜   by 水夜 #  ver0.90  Zenith Creation (http://zenith.ifdef.jp/) #------------------------------------------------------------------------------ # マップ上での戦略的なバトルを実現。 #============================================================================== #============================================================================== # □ カスタマイズポイント #============================================================================== module ZTBSB17 RESULT_TIME = 80 end class Scene_Map #-------------------------------------------------------------------------- # ● 経験値など獲得 #-------------------------------------------------------------------------- def get_exp_etc(target) @level_up = {} if @level_up == nil @gold = 0 if @gold == nil @exp = 0 if @exp == nil @treasures = [] if @treasures == nil # 経験値全員獲得の場合 if ZTBS::EXP_ALL exp = target.exp @exp += target.exp for actor in $game_system.tactics_actors.values if actor == @attacker pre_level = actor.level actor.exp += exp if !actor.cant_get_exp? if actor.level > pre_level if @level_up[actor] == nil @level_up[actor] = [pre_level, actor.level] else @level_up[actor][1] = actor.level end end else pre_level = actor.level actor.exp += Integer(exp * ZTBS::C_EXP) if !actor.cant_get_exp? if actor.level > pre_level if @level_up[actor] == nil @level_up[actor] = [pre_level, actor.level] else @level_up[actor][1] = actor.level end end end end # トドメをさしたアクターのみ経験値獲得の場合 elsif $game_system.tactics_step == 9 if @attacker.is_a?(Game_Actor) and !@attacker.cant_get_exp? pre_level = @attacker.level @attacker.exp += target.exp @exp += target.exp if @attacker.level > pre_level if @level_up[@attacker] == nil @level_up[@attacker] = [pre_level, @attacker.level] else @level_up[@attacker][1] = @attacker.level end end end end # ゴールド獲得 $game_party.gain_gold(target.gold) @gold += target.gold # トレジャー獲得 if target.item_id > 0 item = $data_items[target.item_id] end if target.weapon_id > 0 item = $data_weapons[target.weapon_id] end if target.armor_id > 0 item = $data_armors[target.armor_id] end if rand(100) < target.treasure_prob case item when RPG::Item @treasures.push(item) $game_party.gain_item(item.id, 1) when RPG::Weapon @treasures.push(item) $game_party.gain_weapon(item.id, 1) when RPG::Armor @treasures.push(item) $game_party.gain_armor(item.id, 1) end end if !defined? result_window @level_up = nil @gold = nil @exp = nil @treasures = nil end end #-------------------------------------------------------------------------- # ● リザルトウィンドウ表示 #-------------------------------------------------------------------------- def result_window if @level_up == nil or @gold == nil or @exp == nil or @treasures == nil return false end # ゴールドとトレジャー用ウィンドウ作成 if @treasures.size == 0 width = 140 else width = 240 end window = Window_Base.new(0, 64, width, 96 + @treasures.size * 32) window.contents = Bitmap.new(window.width - 32, window.height - 32) window.back_opacity = 160 window.opacity = 0 # EXP cx = window.contents.text_size("P").width window.contents.font.color = window.normal_color window.contents.draw_text(4, 0, window.width-44-cx, 32, @exp.to_s, 2) window.contents.font.color = window.system_color window.contents.draw_text(window.width-32-cx, 0, cx, 32, "P", 2) # ゴールド cx = window.contents.text_size($data_system.words.gold).width window.contents.font.color = window.normal_color window.contents.draw_text(4, 32, window.width-44-cx, 32, @gold.to_s, 2) window.contents.font.color = window.system_color window.contents.draw_text(window.width-32-cx, 32, cx, 32, $data_system.words.gold, 2) # トレジャー y = 64 for item in @treasures window.draw_item_name(item, 4, y) y += 32 end if @level_up.keys.size > 0 # SE を演奏 if LEVEL_UP_SE != nil and LEVEL_UP_SE != "" Audio.se_play("Audio/SE/" + LEVEL_UP_SE, 80, 100) end # レベルアップ用ウィンドウ作成 height = [352, 64+@level_up.keys.size*32].min window2 = Window_Base.new(window.width+48, 64, 320, height) window2.contents = Bitmap.new(window2.width - 32, 32+@level_up.keys.size*32) window2.back_opacity = 160 window2.opacity = 0 window2.contents.font.color = window.system_color window2.contents.draw_text(0, 0, window2.width-32, 32, "-LEVEL UP-", 1) y = 32 for actor in @level_up.keys window2.draw_actor_name(actor, 4, y) window2.contents.font.color = window2.system_color window2.contents.draw_text(168, y, 24, 32, "Lv") window2.contents.draw_text(228, y, 24, 32, "→") window2.contents.font.color = window2.normal_color lv1 = @level_up[actor][0].to_s window2.contents.draw_text(192, y, 32, 32, lv1, 2) lv2 = @level_up[actor][1].to_s window2.contents.draw_text(254, y, 32, 32, lv2) y += 32 end end count = 0 # リザルト表示 while count < ZTBSB17::RESULT_TIME # ゲーム画面を更新 Graphics.update # 入力情報を更新 Input.update # カウントアップ count += 1 # スライド if count <= 10 window.opacity += 25 window.x += 1 if window2 != nil window2.opacity += 25 window2.x += 1 end next elsif count >= (ZTBSB17::RESULT_TIME - 10) window.opacity -= 25 window.x -= 1 if window2 != nil window2.opacity -= 25 window2.x -= 1 end next end if Input.press?(Input::DOWN) and window2 != nil max = [window2.contents.height - (window2.height - 32), 0].max window2.oy = [window2.oy + 6, max].min elsif Input.press?(Input::UP) and window2 != nil max = [window2.contents.height - (window2.height - 32), 0].max window2.oy = [window2.oy - 6, 0].max end end # 解放 window.dispose window = nil if window2 != nil window2.dispose window2 = nil end @level_up = nil @gold = nil @exp = nil @treasures = nil return true end end