#==============================================================================
# ■ Game Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● Display_level_up
#--------------------------------------------------------------------------
alias mog_result_display_level_up display_level_up
def display_level_up(new_skills)
if $game_temp.result
$game_temp.level_parameter = [@level,new_skills]
return
end
mog_result_display_level_up(new_skills)
end
#--------------------------------------------------------------------------
# ● Process Victory
#--------------------------------------------------------------------------
def self.process_victory
play_battle_end_me
replay_bgm_and_bgs
battle_end(0)
SceneManager.return
return true
end
end
#==============================================================================
# ■ Spriteset Battle
#==============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# ● Dispose
#--------------------------------------------------------------------------
alias mog_battle_result_pre_terminate pre_terminate
def pre_terminate
execute_result if can_enable_battle_result?
mog_battle_result_pre_terminate
end
#--------------------------------------------------------------------------
# ● Can Enable Battle Result?
#--------------------------------------------------------------------------
def can_enable_battle_result?
return false if !$game_troop.all_dead?
return false if $game_party.members.empty?
return false if $game_party.all_dead?
return true
end
#--------------------------------------------------------------------------
# ● Execute Result
#--------------------------------------------------------------------------
def execute_result
@result = Battle_Result.new
if $mog_rgss3_combo_count != nil
$game_temp.combo_time = 0 rescue nil
end
loop do
@result.update
@spriteset.update
Graphics.update
Input.update
break if @result.victory_phase == 10
end
@result.dispose
end
end
#==============================================================================
# ■ Battle Result
#==============================================================================
class Battle_Result
include MOG_BATLE_RESULT
#==============================================================================
# ■ Battle Result
#==============================================================================
class Battle_Result
#--------------------------------------------------------------------------
# ● Dispose Result Actor Bitmap
#--------------------------------------------------------------------------
def dispose_result_actor_bitmap
return if @result_actor_sprite == nil
return if @result_actor_sprite.bitmap == nil
@result_actor_sprite.bitmap.dispose
end
#--------------------------------------------------------------------------
# ● Dispose Level UP
#--------------------------------------------------------------------------
def dispose_level_up
return if @levelup_layout == nil
@levelup_layout.bitmap.dispose
@levelup_layout.dispose
@levelup_word.bitmap.dispose
@levelup_word.dispose
@result_actor_sprite.bitmap.dispose
@result_actor_sprite.dispose
@parameter_sprite.bitmap.dispose
@parameter_sprite.dispose
@level_sprite.bitmap.dispose
@level_sprite.dispose
if @new_skill_window != nil
@new_skill_window.dispose
end
end
end
#==============================================================================
# ■ Battle Result
#==============================================================================
class Battle_Result
#--------------------------------------------------------------------------
# ● Update
#--------------------------------------------------------------------------
def update
if $mog_rgss3_pause != nil
update_pause if MOG_PAUSE::PAUSE_SCENE_BATTLE
end
return if @victory_phase == nil
update_victory_fade if @fade_result_window
return if victory_wait?
case @victory_phase
when 0; update_victory_initial
when 1; update_victory_initial2
when 2; update_victory_initial3
when 3; update_victory_exp
when 4; update_victory_gold
when 5; update_victory_item
when 6; update_victory_levelup
when 9; update_skip_result
end
if Input.trigger?(:C)
if @victory_phase == 10
end_victory
elsif @victory_phase.between?(1,5)
Sound.play_cursor
@victory_phase = 9
end
end
end
#--------------------------------------------------------------------------
# ● Skip Result
#--------------------------------------------------------------------------
def update_skip_result
@victory_sprite.opacity -= 10
@victory_sprite.visible = false
@victory_layout_sprite.opacity += 10
@victory_layout_sprite.zoom_x = 1.00
@gold_number.opacity += 10
@gold_number.zoom_x = 1.00
@gold_number.zoom_y = 1.00
@exp_number.opacity += 10
@exp_number.zoom_x = 1.00
@exp_number.zoom_y = 1.00
@window_treasure.contents_opacity += 10
if @exp_old != @exp_total
@exp_old = @exp_total
refresh_exp_number
end
if @gold_old = @gold_total
@gold_old = @gold_total
refresh_gold_number
end
@window_treasure.x = 0
update_victory_item if @window_treasure.contents_opacity == 255
end
#==============================================================================
# ■ Battle Result
#==============================================================================
class Battle_Result
#--------------------------------------------------------------------------
# ● Update EXP Sprite
#--------------------------------------------------------------------------
def update_exp_sprite
@exp_number.opacity += 15
if @exp_number.zoom_x > 1.00
@exp_number.zoom_x -= 0.03
@exp_number.zoom_x = 1.00 if @exp_number.zoom_x <= 1.00
end
@exp_number.zoom_y = @exp_number.zoom_x
if (@exp_old >= @exp_total) and @exp_number.zoom_x == 1.00
@victory_phase = 4
Sound.play_cursor
end
end
#--------------------------------------------------------------------------
# ● Refresh Exp Number
#--------------------------------------------------------------------------
def refresh_exp_number
@exp_number.bitmap.clear
draw_result_exp(@exp_old, 0,0)
end
#--------------------------------------------------------------------------
# ● Update Exp_number
#--------------------------------------------------------------------------
def update_exp_number
return if @exp_old == @exp_total
@exp_old += @exp_ref
@exp_old = @exp_total if @exp_old > @exp_total
refresh_exp_number
end
#--------------------------------------------------------------------------
# ● Draw Result EXP
#--------------------------------------------------------------------------
def draw_result_exp(value,x,y)
ncw = @result_cw
nch = @result_ch
number = value.abs.to_s.split(//)
x2 = x - (number.size * ncw)
@exp_number.ox = (number.size * ncw) / 2
@exp_number.oy = @result_ch / 2
@exp_number.x = (RESULT_EXP_POSITION[0] + @result_cw + @exp_number.ox) - (number.size * ncw)
for r in 0..number.size - 1
number_abs = number[r].to_i
nsrc_rect = Rect.new(ncw * number_abs, 0, ncw, nch)
@exp_number.bitmap.blt(x + (ncw * r), y, @result_number, nsrc_rect)
end
end
end
#==============================================================================
# ■ Battle Result
#==============================================================================
class Battle_Result
#--------------------------------------------------------------------------
# ● Update GOLD Sprite
#--------------------------------------------------------------------------
def update_gold_sprite
@gold_number.opacity += 15
if @gold_number.zoom_x > 1.00
@gold_number.zoom_x -= 0.03
@gold_number.zoom_x = 1.00 if @gold_number.zoom_x <= 1.00
end
@gold_number.zoom_y = @gold_number.zoom_x
if @gold_old >= @gold_total and @gold_number.zoom_x == 1.00
@victory_phase = 5
Sound.play_cursor
end
end
#--------------------------------------------------------------------------
# ● Refresh gold Number
#--------------------------------------------------------------------------
def refresh_gold_number
@gold_number.bitmap.clear
draw_result_gold(@gold_old, 0,0)
end
#--------------------------------------------------------------------------
# ● Update Gold Number
#--------------------------------------------------------------------------
def update_gold_number
return if @gold_old == @gold_total
@gold_old += @gold_ref
@gold_old = @gold_total if @gold_old > @gold_total
refresh_gold_number
end
#--------------------------------------------------------------------------
# ● Draw Result Gold
#--------------------------------------------------------------------------
def draw_result_gold(value,x,y)
ncw = @result_cw
nch = @result_ch
number = value.abs.to_s.split(//)
x2 = x - (number.size * ncw)
@gold_number.ox = (number.size * ncw) / 2
@gold_number.oy = @result_ch / 2
@gold_number.x = (RESULT_GOLD_POSITION[0] + @result_cw + @gold_number.ox) - (number.size * ncw)
for r in 0..number.size - 1
number_abs = number[r].to_i
nsrc_rect = Rect.new(ncw * number_abs, @result_ch, ncw, nch)
@gold_number.bitmap.blt(x + (ncw * r), y, @result_number, nsrc_rect)
end
end
end
#==============================================================================
# ■ Battle Result
#==============================================================================
class Battle_Result
#--------------------------------------------------------------------------
# ● Draw_Treasure
#--------------------------------------------------------------------------
def draw_treasure
contents.clear
t_index = 0
$game_troop.make_drop_items.each do |item|
yi = (t_index / 3) * 32
$game_party.gain_item(item, 1)
draw_item_name(item, 0, yi, true, 200)
t_index += 3
end
@range_max = (t_index / 3) * 32
@scroll = true if t_index > 1#1
end
#--------------------------------------------------------------------------
# ● Update
#--------------------------------------------------------------------------
def update
super
self.contents_opacity += 10
if @scroll and self.contents_opacity == 255
@wait_time -= 1 if @wait_time > 0
return if @wait_time > 0
self.y -= 1
self.y = 200 if self.y < -@range_max
@wait_time = 20 if self.y == -10
end
end
end
#==============================================================================
# ■ Battle Result
#==============================================================================
class Battle_Result
#--------------------------------------------------------------------------
# ● Draw Result EXP
#--------------------------------------------------------------------------
def draw_result_parameter(value,value2,x,y)
ncw = @result2_cw
nch = @result2_ch
number = value.abs.to_s.split(//)
x2 = x + (number.size * ncw) + 16
for r in 0..number.size - 1
number_abs = number[r].to_i
nsrc_rect = Rect.new(ncw * number_abs, 0, ncw, nch)
@parameter_sprite.bitmap.blt(x + (ncw * r), y, @result_number2, nsrc_rect)
end
value3 = value - value2
par = ""
if value > value2
par = "+"
@parameter_sprite.bitmap.font.color = Color.new(50,255,255)
elsif value < value2
par = ""
@parameter_sprite.bitmap.font.color = Color.new(255,155,100)
end
return if value == value2
@parameter_sprite.bitmap.draw_text(x2,y - 8,100,32,par.to_s + value3.to_s,0)
end
#--------------------------------------------------------------------------
# ● Create Result Actor
#--------------------------------------------------------------------------
def create_result_actor
if @result_actor_sprite == nil
@result_actor_sprite = Sprite.new
@result_actor_sprite.z = 999
end
dispose_result_actor_bitmap
@result_actor_sprite.bitmap = Cache.picture("Actor1")
@result_actor_org = [380 - (@result_actor_sprite.bitmap.width / 2), Graphics.height - @result_actor_sprite.bitmap.height]
@result_actor_sprite.x = @result_actor_org[0] + 200
@result_actor_sprite.y = @result_actor_org[1]
@result_actor_sprite.opacity = 0
end
#--------------------------------------------------------------------------
# ● Check New Skill
#--------------------------------------------------------------------------
def check_new_skill
@new_skills = $game_temp.level_parameter[1]
@new_skills_index = 0
end
#--------------------------------------------------------------------------
# ● Show New Skill
#--------------------------------------------------------------------------
def show_new_skill(start = false)
Sound.play_recovery unless start
@new_skill_window.draw_new_skill(@new_skills[@new_skills_index])
@new_skills_index += 1
if @new_skills_index == @new_skills.size or
@new_skills[@new_skills_index] == nil
@new_skills = nil
end
end
#--------------------------------------------------------------------------
# ● Check Level UP
#--------------------------------------------------------------------------
def check_level_up
if @new_skills != nil and !@new_skills.empty?
show_new_skill
return
end
for battler_id in @result_member_id..@result_member_max
actor_result = $game_party.members[@result_member_id]
$game_temp.level_parameter = [] if $game_temp.level_parameter == nil
$game_temp.level_parameter_old = [] if $game_temp.level_parameter_old == nil
$game_temp.level_parameter.clear
$game_temp.level_parameter_old.clear
$game_temp.level_parameter_old = [actor_result.level,actor_result.mhp,actor_result.mmp,
actor_result.atk, actor_result.def, actor_result.mat, actor_result.mdf, actor_result.agi, actor_result.luk] rescue nil
actor_result.gain_exp($game_troop.exp_total) rescue nil
@result_member_id += 1
@new_skills = nil
@new_skills_index = 0
if $game_temp.level_parameter != nil and !$game_temp.level_parameter.empty?
show_level_result
break
end
end
return if !$game_temp.level_parameter.empty?
@victory_phase = 10 if @result_member_id >= @result_member_max
end
#--------------------------------------------------------------------------
# ● Create New Skill Windos
#--------------------------------------------------------------------------
def create_new_skill_window
if @new_skill_window == nil
@new_skill_window = Window_Result_Skill.new
end
@new_skill_window.x = RESULT_NEW_SKILL_POSITION[0]
@new_skill_window.y = RESULT_NEW_SKILL_POSITION[1]
check_new_skill
if @new_skills != nil and !@new_skills.empty?
show_new_skill
else
@new_skill_window.x = -640
end
end
#--------------------------------------------------------------------------
# ● Show Level Result
#--------------------------------------------------------------------------
def show_level_result
Sound.play_cursor
@actor_result = $game_party.members[@result_member_id - 1] rescue nil
return if @actor_result == nil
@actor_result.animation_id = RESULT_LEVELUP_ANIMATION_ID
@fade_result_window = true
create_levelup
create_level
create_parameter_number
create_result_actor
create_new_skill_window
end
end
#==============================================================================
# ■ Battle Result
#==============================================================================
class Battle_Result
#--------------------------------------------------------------------------
# ● Update Victory Item
#--------------------------------------------------------------------------
def update_victory_levelup
check_level_up if Input.trigger?(:C)
update_show_levelup
if @levelup_layout == nil
@window_treasure.update
else
@window_treasure.contents_opacity -= 15
end
end
#--------------------------------------------------------------------------
# ● Update Show Level UP
#--------------------------------------------------------------------------
def update_show_levelup
return if @levelup_layout == nil
return if @result_actor_sprite == nil
@new_skill_window.update
if @result_actor_sprite.x > @result_actor_org[0]
@result_actor_sprite.x -= 5
@result_actor_sprite.opacity += 7
if @result_actor_sprite.x <= @result_actor_org[0]
@result_actor_sprite.x = @result_actor_org[0]
@result_actor_sprite.opacity = 255
end
end
if @levelup_word.zoom_x > 1.00
@levelup_word.zoom_x -= 0.03
if @levelup_word.zoom_x < 1.00
@levelup_word.zoom_x = 1.00
@levelup_word.blend_type = 0
end
end
@levelup_word.zoom_y = @levelup_word.zoom_x
if @parameter_sprite.x < 70
@parameter_sprite.opacity += 13
@parameter_sprite.x += 5
if @parameter_sprite.x >= 70
@parameter_sprite.opacity = 255
@parameter_sprite.x = 70
end
end
end
end
#==============================================================================
# ■ Window Result Skill
#==============================================================================
class Window_Result_Skill < Window_Base