class Scene_Battle
def start_phase5
# フェーズ 5 ã«ç§»è¡Œ
@phase = 5
# ãƒãƒˆãƒ«çµ‚了 ME ã‚’æ¼”å¥
$game_system.me_play($game_system.battle_end_me)
# ãƒãƒˆãƒ«é–‹å§‹å‰ã® BGM ã«æˆ»ã™
$game_system.bgm_play($game_temp.map_bgm)
# EXPã€ã‚´ãƒ¼ãƒ«ãƒ‰ã€ãƒˆãƒ¬ã‚¸ãƒ£ãƒ¼ã‚’åˆæœŸåŒ–
exp = 0
gold = 0
elem_xp = 0
treasures = []
if @active_actor != nil
@active_actor.blink = false
end
# メインフェーズフラグをセット
$game_temp.battle_main_phase = true
# パーティコマンドウィンドウを無効化
@party_command_window.active = false
@party_command_window.visible = false
# アクターコマンドウィンドウを無効化
@actor_command_window.active = false
@actor_command_window.visible = false
if @skill_window != nil
# スã‚ルウィンドウを解放
@skill_window.dispose
@skill_window = nil
end
if @item_window != nil
# アイテムウィンドウを解放
@item_window.dispose
@item_window = nil
end
# ãƒ˜ãƒ«ãƒ—ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚’éš ã™
@help_window.visible = false
# ループ
for enemy in $game_troop.enemies
# エãƒãƒŸãƒ¼ãŒéš れ状態ã§ãªã„å ´åˆ
unless enemy.hidden
# ç²å¾— EXPã€ã‚´ãƒ¼ãƒ«ãƒ‰ã‚’追åŠ
exp += enemy.exp
gold += enemy.gold
elem_xp += 1
# トレジャー出ç¾åˆ¤å®š
if rand(100) < enemy.treasure_prob
if enemy.item_id > 0
treasures.push($data_items[enemy.item_id])
end
if enemy.weapon_id > 0
treasures.push($data_weapons[enemy.weapon_id])
end
if enemy.armor_id > 0
treasures.push($data_armors[enemy.armor_id])
end
end
end
end
# トレジャーã®æ•°ã‚’ 6 個ã¾ã§ã«é™å®š
treasures = treasures[0..5]
# EXP ç²å¾—
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
if actor.cant_get_exp? == false
last_level = actor.level
actor.exp += exp
if actor.level > last_level
@status_window.level_up(i)
actor.damage[[actor, -1]] = "Level up!"
actor.up_level = actor.level - last_level
end
actor.elem_xp += elem_xp
if actor.elem_xp >= (10 + actor.elem_points)
actor.elem_xp -= (10 + actor.elem_points)
actor.elem_points += 1
end
end
end
# ゴールドç²å¾—
$game_party.gain_gold(gold)
# トレジャーç²å¾—
for item in treasures
case item
when RPG::Item
$game_party.gain_item(item.id, 1)
when RPG::Weapon
$game_party.gain_weapon(item.id, 1)
when RPG::Armor
$game_party.gain_armor(item.id, 1)
end
end
# ãƒãƒˆãƒ«ãƒªã‚¶ãƒ«ãƒˆã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚’作æˆ
@result_window = Window_BattleResult.new(exp, gold, treasures)
# ウェイトカウントをè¨å®š
@phase5_wait_count = 100
end
end
class Window_Elem_Levels < Window_Base
def refresh
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(0, 0, 640, 32, "Please edit your mastery of elements here:")
self.contents.draw_text(0, 32, 90, 32, "You have ")
self.contents.draw_text(90, 32, 40, 32,@actor.elem_points.to_s)
self.contents.draw_text(130, 32, 300, 32, "elemental points to distribute.")
self.contents.draw_text(0, 64, 90, 32, "You have ")
x = @actor.elem_points
x -= (@actor.elem_fire + @actor.elem_water + @actor.elem_wind + @actor.elem_earth)
self.contents.draw_text(90, 64, 40, 32, x.to_s)
self.contents.draw_text(130, 64, 400, 32, "elemental points remaining to distribute.")
x = (10 + @actor.elem_points) - @actor.elem_xp
x = x.to_s
x = x + ' elemental experience to next element point'
self.contents.draw_text(200, 106, 440, 32, x)
for i in 0...4
string = ''
case i
when 0
string = string + @actor.elem_fire.to_s
when 1
string = string + @actor.elem_water.to_s
when 2
string = string + @actor.elem_wind.to_s
when 3
string = string + @actor.elem_earth.to_s
end
string = string + '/50'
self.contents.draw_text(120, (106 + 32 * i) , 150, 32, string)
end
end
end