Code:
#================================================
# ====Create a new script above main and put all that code in it. ======
#================================================
#
#
#
#
#
# Window_BattleStatus
#
#Â¥£ÂÂ¥ XRXS_BP10. LEVEL UP!â\âÃÂã¸â¢\Ž¦ÆEÆBÆâÆhÆE plus! Â¥£ÂÂ¥
# by Â÷â°Ã« ÂÃây
#
# âvÂFXRXS.RGSSâ°Ã¼âÃÆJÆXÆ^Æ}ÆCÆY
#
#
#Script found at http://f26.aaa.livedoor.jp/~xxms/RPGXP_XRXS_BP10.htm
#Modified by Sutebe-san
#
#
#==============================================================================
#  ÆJÆXÆ^Æ}ÆCÆYÆ|ÆCÆâÆg
#==============================================================================
class Scene_Battle
LEVEL_UP_SE = "Audio/SE/new (6) level_up" # ÆÅÆxÆâ¹ÆAÆbÆvSEÂB""âÃ
â³âµÂB new (6) level_up
LEVEL_UP_ME = "" #"Audio/ME/007-Fanfare01" # ÆÅÆxÆâ¹ÆAÆbÆvME
end
class Window_SkillLearning < Window_Base
SKILLLEARN_SE = "Audio/SE/new (12)enigme_resolue" # ÆXÆLÆâ¹ÂKâ¾SEÂB
end
#==============================================================================
# ¡ Window_LevelUpWindow
#------------------------------------------------------------------------------
# Â@ÆoÆgÆâ¹ÂI⹎žÂAÆÅÆxÆâ¹ÆAÆbÆvâµâ½ÂêÂâ¡âÃÆXÆeÂ[Æ^ÆXâðâ¢\Ž¦â·âéÆEÆBÆâÆhÆEâÃ
â·ÂB
#==============================================================================
class Window_LevelUpWindow < Window_Base
#--------------------------------------------------------------------------
# ÂÅ ÆIÆuÆWÆFÆNÆgÂâ°Å úâ°Â»
#--------------------------------------------------------------------------
def initialize(x, y, actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
# super(x, y, 160, 192)
super(x-x, y-64, 160, 192+64)
self.contents = Bitmap.new(width - 32, height - 32)
self.visible = false
self.back_opacity = 160
refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
end
#--------------------------------------------------------------------------
# ÂÅ ÆÅ ÆtÆÅÆbÆVÆâ¦
#--------------------------------------------------------------------------
def refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
self.contents.clear
self.contents.font.color = system_color
self.contents.font.size = 20
self.contents.font.name = $fontface
self.contents.draw_text( 20, 0, 160, 24, "LEVEL UP!!")
self.contents.font.size = 20
self.contents.font.name = $fontface
self.contents.draw_text( 0, 28+64, 160, 24, $data_system.words.hp)
self.contents.draw_text( 0, 50+64, 160, 24, $data_system.words.sp)
self.contents.font.size = 20
self.contents.font.name = $fontface
self.contents.draw_text( 0, 0+64, 80, 24, "Level")
self.contents.draw_text( 0, 72+64, 80, 24, $data_system.words.str[0,3])
self.contents.draw_text( 0, 94+64, 80, 24, $data_system.words.dex[0,3])
self.contents.draw_text( 0, 116+64, 80, 24, $data_system.words.agi[0,3])
self.contents.draw_text( 0, 138+64, 80, 24, $data_system.words.int[0,3])
self.contents.draw_text(76, 0+64, 128, 24, "=")
self.contents.draw_text(76, 28+64, 128, 24, "=")
self.contents.draw_text(76, 50+64, 128, 24, "=")
self.contents.draw_text(76, 72+64, 128, 24, "=")
self.contents.draw_text(76, 94+64, 128, 24, "=")
self.contents.draw_text(76, 116+64, 128, 24, "=")
self.contents.draw_text(76, 138+64, 128, 24, "=")
self.contents.font.size = 20
self.contents.font.color = Color.new(128, 255, 128)
self.contents.draw_text( 0, 0+64, 72, 24, "+" + (actor.level-last_lv).to_s, 2)
self.contents.draw_text( 0, 28+64, 72, 24, "+" + up_hp.to_s, 2)
self.contents.draw_text( 0, 50+64, 72, 24, "+" + up_sp.to_s, 2)
self.contents.draw_text( 0, 72+64, 72, 24, "+" + up_str.to_s, 2)
self.contents.draw_text( 0, 94+64, 72, 24, "+" + up_dex.to_s, 2)
self.contents.draw_text( 0, 116+64, 72, 24, "+" + up_agi.to_s, 2)
self.contents.draw_text( 0, 138+64, 72, 24, "+" + up_int.to_s, 2)
self.contents.font.size = 20
self.contents.font.name = $fontface
self.contents.draw_text( 0, 0+64, 128, 24, actor.level.to_s, 2)
self.contents.draw_text( 0, 26+64, 128, 24, actor.maxhp.to_s, 2)
self.contents.draw_text( 0, 48+64, 128, 24, actor.maxsp.to_s, 2)
self.contents.draw_text( 0, 70+64, 128, 24, actor.str.to_s, 2)
self.contents.draw_text( 0, 92+64, 128, 24, actor.dex.to_s, 2)
self.contents.draw_text( 0, 114+64, 128, 24, actor.agi.to_s, 2)
self.contents.draw_text( 0, 136+64, 128, 24, actor.int.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text( -40, 26, 128, 24, actor.name, 2)
end
end
#==============================================================================
# ¡ Window_SkillLearning
#------------------------------------------------------------------------------
# Â@ÆÅÆxÆâ¹ÆAÆbÆvŽžâÃâÃâÃÆXÆLÆâ¹âðÂKâ¾âµâ½ÂêÂâ¡âÃâ»âêâðâ¢\Ž¦â·âéÆEÆBÆâÆhÆEâÃ
â·ÂB
#==============================================================================
class Window_SkillLearning < Window_Base
#--------------------------------------------------------------------------
# ÂÅ ÅöŠJÆCÆâÆXÆ^ÆâÆXâ¢ÃÂâ
#--------------------------------------------------------------------------
attr_reader :learned # ÆXÆLÆâ¹âðÂKâ¾âµâ½â©âÃâ¤â©
#--------------------------------------------------------------------------
# ÂÅ ÆIÆuÆWÆFÆNÆgÂâ°Å úâ°Â»
#--------------------------------------------------------------------------
def initialize(class_id, last_lv, now_lv)
super(160, 64-32, 320, 64)
self.contents = Bitmap.new(width - 32, height - 28) # âÃâ´âäâðâ¢\Ž¦
self.visible = false
self.back_opacity = 160
@learned = false
refresh(class_id, last_lv, now_lv)
end
#--------------------------------------------------------------------------
# ÂÅ ÆÅ ÆtÆÅÆbÆVÆâ¦
#--------------------------------------------------------------------------
def refresh(class_id, last_lv, now_lv)
for i in 0...$data_classes[class_id].learnings.size
learn_lv = $data_classes[class_id].learnings[i].level
# ¡â°Ã±âÃÆÅÆxÆâ¹ÆAÆbÆvâÃËÃâÃ
ÂKâ¾â·âéÆXÆLÆâ¹âÃÂêÂâ¡
if learn_lv > last_lv and learn_lv <= now_lv
@learned = true
# SEâÃÂö
if SKILLLEARN_SE != ""
Audio.se_play(SKILLLEARN_SE)
end
# Å eâ¢`ŽÃ
skill_name = $data_skills[$data_classes[class_id].learnings[i].skill_id].name
self.contents.clear
self.contents.font.name = $fontface
self.contents.draw_text(0,0,448,32, skill_name + " appris !")
self.visible = true
# ÆÂÆCÆâÆâ¹Â[Æv
loop do
# ÆQÂ[Æâ¬â°Ã¦âÃâðÂXÂV
Graphics.update
# âüâÃÂîâ¢Ã±âðÂXÂV
Input.update
# ÆtÆÅÂ[Æâ¬ÂXÂV
update
# â°Ã¦âÃâªÂÃâèâÃâÃâÃâ½âçÆâ¹Â[Ævâðââ âf
if @learned == false
break
end
end
# ÆÂÆCÆâÆâ¹Â[Ævâ±â±âÃâÃ
end
end
end
#--------------------------------------------------------------------------
# ÂÅ ÆtÆÅÂ[Æâ¬ÂXÂV
#--------------------------------------------------------------------------
def update
# C Æ{Æ^Æââªâ°Å¸â³âêâ½ÂêÂâ¡
if Input.trigger?(Input::C)
@learned = false
self.visible = false
end
end
end
#==============================================================================
# ¡ Window_BattleStatus
#==============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# ÂÅ âÃâ°ÃÂEÅöŠJÆCÆâÆXÆ^ÆâÆXâ¢ÃÂâ
#--------------------------------------------------------------------------
attr_accessor :level_up_flags # LEVEL UP!â¢\Ž¦
end
#==============================================================================
# ¡ Scene_Battle
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# ÂÅ ÆAÆtÆ^Â[ÆoÆgÆâ¹ÆtÆFÂ[ÆYÅ JŽn
#--------------------------------------------------------------------------
alias xrxs_bp10_start_phase5 start_phase5
def start_phase5
xrxs_bp10_start_phase5
# Å lâ¾ EXPâðŽæâ¾
@exp_gained = battle_exp
# EXP Å lâ¾âðŽæâèÂÃâ·
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_gained
if actor.level < last_level
@status_window.level_up_flags[i] = false
end
end
end
# ÂÃâè
@exp_gain_actor = -1
# ÆÅ ÆUÆâ¹ÆgÆEÆBÆâÆhÆEâðâ¢\Ž¦
@result_window.visible = true
end
#--------------------------------------------------------------------------
# ÂÅ ÆtÆÅÂ[Æâ¬ÂXÂV (ÆAÆtÆ^Â[ÆoÆgÆâ¹ÆtÆFÂ[ÆY)
#--------------------------------------------------------------------------
alias xrxs_bp10_update_phase5 update_phase5
def update_phase5
@level_up_phase_done = false if @level_up_phase_done != true
# C Æ{Æ^Æââªâ°Å¸â³âêâ½ÂêÂâ¡
if Input.trigger?(Input::C)
# ÆEÆBÆâÆhÆEâðâ¢Ãâ¶âÃŽŸâÃÆAÆNÆ^Â[âÃ
@levelup_window.visible = false if @levelup_window != nil
@status_window.level_up_flags[@exp_gain_actor] = false
@level_up_phase_done = phase5_next_levelup
end
if @level_up_phase_done
if @phase5_wait_count < 2
# ÆÅ ÆUÆâ¹ÆgÆEÆBÆâÆhÆEâðvisible=trueâÃ
âà â¢sâ°ÃŽâ¹âÃ
@result_window.opacity = 0
@result_window.back_opacity = 0
@result_window.contents_opacity = 0
end
# ÅÃâÃâÃâ·
xrxs_bp10_update_phase5
# ÆÅÆxÆâ¹ÆAÆbÆvâµâÃâ¢âéÂêÂâ¡âÃâ¹Â§ÆoÆgÆâ¹ÂIâ¹
battle_end(0) if @levelup_window != nil and @phase5_wait_count <= 0
end
end
#--------------------------------------------------------------------------
# ŠŽŸâÃÆAÆNÆ^Â[âÃÆÅÆxÆâ¹ÆAÆbÆvâ¢\Ž¦âÃ
#--------------------------------------------------------------------------
def phase5_next_levelup
begin
# ŽŸâÃÆAÆNÆ^Â[âÃ
@exp_gain_actor += 1
# ÂÃ
ÅãâÃÆAÆNÆ^Â[âÃÂêÂâ¡
if @exp_gain_actor >= $game_party.actors.size
# ÆAÆtÆ^Â[ÆoÆgÆâ¹ÆtÆFÂ[ÆYÅ JŽn
return true
end
actor = $game_party.actors[@exp_gain_actor]
if actor.cant_get_exp? == false
# Å»ÂÃâÃâ\âÃâlâðâ¢ÃŽÂ
last_level = actor.level
last_maxhp = actor.maxhp
last_maxsp = actor.maxsp
last_str = actor.str
last_dex = actor.dex
last_agi = actor.agi
last_int = actor.int
# ÂÃâ¬ÅoűâlâÃÂÃŽæâ¾
actor.exp += @exp_gained
# â»âè
if actor.level > last_level
# ÆÅÆxÆâ¹ÆAÆbÆvâµâ½ÂêÂâ¡
@status_window.level_up(@exp_gain_actor)
# ÆÅ ÆUÆâ¹ÆgÆEÆBÆâÆhÆEâðÂÃâ·
@result_window.visible = false
# SEâÃÂö
if LEVEL_UP_SE != ""
Audio.se_play(LEVEL_UP_SE)
end
# MEâÃÂö
if LEVEL_UP_ME != ""
Audio.me_stop
Audio.me_play(LEVEL_UP_ME)
end
# LEVEL-UPÆEÆBÆâÆhÆEâÃÂÃâè
actors_size = [$game_party.actors.size, 4].max
x_shift = 160 + (640 - 160*actors_size)/(actors_size - 1)
x = x_shift * @exp_gain_actor
y = 128
@levelup_window = Window_LevelUpWindow.new(x, y, actor, last_level,
actor.maxhp - last_maxhp, actor.maxsp - last_maxsp, actor.str - last_str,
actor.dex - last_dex, actor.agi - last_agi, actor.int - last_int)
@levelup_window.visible = true
# ÆXÆeÂ[Æ^ÆXÆEÆBÆâÆhÆEâðÆÅ ÆtÆÅÆbÆVÆâ¦
@status_window.refresh
# ÆXÆLÆâ¹ÂKâ¾ÆEÆBÆâÆhÆEâÃÂÃâè
@skilllearning_window = Window_SkillLearning.new(actor.class_id, last_level, actor.level)
# ÆEÆFÆCÆgÆJÆEÆâÆgâðÂÃâè
@phase5_wait_count = 40
return false
end
end
end until false
end
def battle_exp
bexp = 0
# Æâ¹Â[Æv
for enemy in $game_troop.enemies
# ÆGÆlÆ~Â[âªâ°BâêÂóâÃâÃ
âÃâ¢ÂêÂâ¡
unless enemy.hidden
# Å lâ¾âðâÃâ°Ã
bexp += enemy.exp
end
end
return bexp
end
end