Kakis

Regular
Regular
Joined
Dec 20, 2018
Messages
34
Reaction score
2
First Language
English
Primarily Uses
RMMV
Hello,
So I've been using RPG Maker Vx Ace and I wanted to make a battle result/level up screen that looks like this:
to be able to add in the visuals of when a character levels up, but to also add in dialogue of said character levelling up. Like, when a battle is over, it'll show items that drop with randomised dialogue from a party member, then if a character levels up it'll show a visual image of them and the dialogue correspondent to the character shown visually.

Now, I like Yanfly's Battle Aftermath screen, which includes randomised dialogue, whenever the battle ends, when a character levels up and when there are item drops. But, I would like to add in more visuals for the battle results screen.




Though whilst I was using it, I came across Moghunter's battle result screen and liked the visuals that are included.




I was wondering if there was a way I could combine the two scripts through changes, to combine the elements I like of them, so that I can create something similar to the level up results screen shown before: or if this is too complex and that I'll have to choose between the two for it to work. I did try running both scripts in my project, but only Yanfly's script appeared between the two.

I'd appreciate any help for this :)

EDIT:
Yanfly: https://yanflychannel.wordpress.com/rmvxa/battle-scripts/victory-aftermath/
Moghunter: https://mogplugins.wordpress.com/rpg-maker-vx-ace/
 
Last edited:

Kakis

Regular
Regular
Joined
Dec 20, 2018
Messages
34
Reaction score
2
First Language
English
Primarily Uses
RMMV
I'm including the scripts here, so the first post isn't too big:

Yanfly's Script
#==============================================================================
#
# ¥ Yanfly Engine Ace - Victory Aftermath v1.04
# -- Last Updated: 2014.03.019
# -- Level: Easy, Normal, Hard
# -- Requires: n/a
# -- Special Thanks: Yami for Bug Fixes.
#
#==============================================================================

$imported = {} if $imported.nil?
$imported["YEA-VictoryAftermath"] = true

#==============================================================================
# ¥ Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2014.03.19 - Fixed a bug where if the battle ends with a stat buff/debuff and
# it will display the wrong parameters.
# 2012.01.07 - Compatibility Update: JP Manager
# 2012.01.01 - Bug Fixed: Quote tags were mislabeled.
# 2011.12.26 - Compatibility Update: Command Autobattle
# 2011.12.16 - Started Script and Finished.
#
#==============================================================================
# ¥ Introduction
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# At the end of each battle, RPG Maker VX Ace by default shows text saying that
# the party has gained so-and-so EXP while this person leveled up and your
# party happened to find these drops. This script changes that text into
# something more visual for your players to see. Active battle members will be
# seen gaining EXP, any kind of level up changes, and a list of the items
# obtained through drops.
#
#==============================================================================
# ¥ Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ¥ Materials/‘fÞ but above ¥ Main. Remember to save.
#
# -----------------------------------------------------------------------------
# Actor Notetags - These notetags go in the actors notebox in the database.
# -----------------------------------------------------------------------------
# <win quotes>
# string
# string
# </win quotes>
# Sets the win quote for the actor. The strings are continuous and can use
# text codes. Use \n for a line break. Type in what you want the actor to say
# for the particular win quote. Use [New Quote] in between the two tags to
# start up a new quote.
#
# <level quotes>
# string
# string
# </level quotes>
# Sets the level up quote for the actor. The strings are continuous and can use
# text codes. Use \n for a line break. Type in what you want the actor to say
# for the particular win quote. Use [New Quote] in between the two tags to
# start up a new quote.
#
# <drops quotes>
# string
# string
# </drops quotes>
# Sets the drops quote for the actor. The strings are continuous and can use
# text codes. Use \n for a line break. Type in what you want the actor to say
# for the particular win quote. Use [New Quote] in between the two tags to
# start up a new quote.
#
# -----------------------------------------------------------------------------
# Class Notetags - These notetags go in the class notebox in the database.
# -----------------------------------------------------------------------------
# <win quotes>
# string
# string
# </win quotes>
# Sets the win quote for the class. The strings are continuous and can use
# text codes. Use \n for a line break. Type in what you want the actor to say
# for the particular win quote. Use [New Quote] in between the two tags to
# start up a new quote.
#
# <level quotes>
# string
# string
# </level quotes>
# Sets the level up quote for the class. The strings are continuous and can use
# text codes. Use \n for a line break. Type in what you want the actor to say
# for the particular win quote. Use [New Quote] in between the two tags to
# start up a new quote.
#
# <drops quotes>
# string
# string
# </drops quotes>
# Sets the drops quote for the class. The strings are continuous and can use
# text codes. Use \n for a line break. Type in what you want the actor to say
# for the particular win quote. Use [New Quote] in between the two tags to
# start up a new quote.
#
#==============================================================================
# ¥ Compatibility
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
# it will run with RPG Maker VX without adjusting.
#
#==============================================================================

module YEA
module VICTORY_AFTERMATH

#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - General Settings -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# These are various settings that are used throughout the Victory Aftermath
# portion of a battle. Adjust them as you see fit.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
VICTORY_BGM = RPG::BGM.new("Field1", 100, 100) # Victory BGM
VICTORY_TICK = RPG::SE.new("Decision1", 100, 150) # EXP ticking SFX
LEVEL_SOUND = RPG::SE.new("Up4", 80, 150) # Level Up SFX
SKILLS_TEXT = "New Skills" # New skills text title.

#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - Important Settings -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# These are some important settings so please set them up properly. This
# section includes a switch that allows you to skip the victory aftermath
# phase (for those back to back battles and making them seamless) and it
# also allows you to declare a common event to run after each battle. If
# you do not wish to use either of these features, set them to 0. The
# common event will run regardless of win or escape.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
SKIP_AFTERMATH_SWITCH = 0 # If switch on, skip aftermath. 0 to disable.
SKIP_MUSIC_SWITCH = 0 # If switch on, skip music. 0 to disable.
AFTERMATH_COMMON_EVENT = 0 # Runs common event after battle. 0 to disable.

#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - Top Text Settings -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# Here, you can adjust the various text that appears in the window that
# appears at the top of the screen.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
TOP_TEAM = "%s's team" # Team name used.
TOP_VICTORY_TEXT = "%s is victorious!" # Text used to display victory.
TOP_LEVEL_UP = "%s has leveled up!" # Text used to display level up.
TOP_SPOILS = "Victory Spoils!" # Text used for spoils.

#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - EXP Gauge Settings -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# Adjust how the EXP Gauge appears for the Victory Aftermath here. This
# includes the text display, the font size, the colour of the gauges, and
# more. Adjust it all here.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
VICTORY_EXP = "+%sEXP" # Text used to display EXP.
EXP_PERCENT = "%1.2f%%" # The way EXP percentage will be displayed.
LEVELUP_TEXT = "LEVEL UP!" # Text to replace percentage when leveled.
MAX_LVL_TEXT = "MAX LEVEL" # Text to replace percentage when max level.
FONTSIZE_EXP = 20 # Font size used for EXP.
EXP_TICKS = 15 # Ticks to full EXP
EXP_GAUGE1 = 12 # "Window" skin text colour for gauge.
EXP_GAUGE2 = 4 # "Window" skin text colour for gauge.
LEVEL_GAUGE1 = 13 # "Window" skin text colour for leveling.
LEVEL_GAUGE2 = 5 # "Window" skin text colour for leveling.

#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - Victory Messages -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# In the Victory Aftermath, actors can say unique things. This is the pool
# of quotes used for actors without any custom victory quotes. Note that
# actors with custom quotes will take priority over classes with custom
# quotes, which will take priority over these default quotes. Use \n for
# a line break in the quotes.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
HEADER_TEXT = "\e>\eC[6]%s\eC[0]\e<\n" # Always at start of messages.
FOOTER_TEXT = "" # Always at end of messages.

# Win Quotes are what the actors say when a battle is won.
VICTORY_QUOTES ={
# :type => Quotes
#------------------------------------------------------------------------
:win => [ # Occurs as initial victory quote.
'"We won! What an exciting fight!"',
'"I didn\'t even break a sweat."',
'"That wasn\'t so tough."',
'"Let\'s fight something harder!"',
],# Do not remove this.
#------------------------------------------------------------------------
:level => [ # Occurs as initial victory quote.
'"Yes! Level up!"',
'"I\'ve gotten stronger!"',
'"Try to keep up with me!"',
'"I\'ve grown again!"',
],# Do not remove this.
#------------------------------------------------------------------------
:drops => [ # Occurs as initial victory quote.
'"I\'ll be taking these."',
'"To the victor goes the spoils."',
'"The enemies dropped something!"',
'"Hey, what\'s this?"',
],# Do not remove this.
#------------------------------------------------------------------------
} # Do not remove this.

end # VICTORY_AFTERMATH
end # YEA

#==============================================================================
# ¥ Editting anything past this point may potentially result in causing
# computer damage, incontinence, explosion of user's head, coma, death, and/or
# halitosis so edit at your own risk.
#==============================================================================

module YEA
module REGEXP
module BASEITEM

NEW_QUOTE = /\[(?:NEW_QUOTE|new quote)\]/i

WIN_QUOTE_ON = /<(?:WIN_QUOTES|win quote|win quotes)>/i
WIN_QUOTE_OFF = /<\/(?:WIN_QUOTES|win quote|win quotes)>/i
LEVEL_QUOTE_ON = /<(?:LEVEL_QUOTES|level quote|level quotes)>/i
LEVEL_QUOTE_OFF = /<\/(?:LEVEL_QUOTES|level quote|level quotes)>/i
DROPS_QUOTE_ON = /<(?:DROPS_QUOTES|drops quote|drops quotes)>/i
DROPS_QUOTE_OFF = /<\/(?:DROPS_QUOTES|drops quote|drops quotes)>/i

end # BASEITEM
end # REGEXP
end # YEA

#==============================================================================
# ¡ Switch
#==============================================================================

module Switch

#--------------------------------------------------------------------------
# self.skip_aftermath
#--------------------------------------------------------------------------
def self.skip_aftermath
return false if YEA::VICTORY_AFTERMATH::SKIP_AFTERMATH_SWITCH <= 0
return $game_switches[YEA::VICTORY_AFTERMATH::SKIP_AFTERMATH_SWITCH]
end

#--------------------------------------------------------------------------
# self.skip_aftermath_music
#--------------------------------------------------------------------------
def self.skip_aftermath_music
return false if YEA::VICTORY_AFTERMATH::SKIP_MUSIC_SWITCH <=0
return $game_switches[YEA::VICTORY_AFTERMATH::SKIP_MUSIC_SWITCH]
end

end # Switch

#==============================================================================
# ¡ Numeric
#==============================================================================

class Numeric

#--------------------------------------------------------------------------
# new method: group_digits
#--------------------------------------------------------------------------
unless $imported["YEA-CoreEngine"]
def group; return self.to_s; end
end # $imported["YEA-CoreEngine"]

end # Numeric

#==============================================================================
# ¡ DataManager
#==============================================================================

module DataManager

#--------------------------------------------------------------------------
# alias method: load_database
#--------------------------------------------------------------------------
class <<self; alias load_database_va load_database; end
def self.load_database
load_database_va
load_notetags_va
end

#--------------------------------------------------------------------------
# new method: load_notetags_va
#--------------------------------------------------------------------------
def self.load_notetags_va
groups = [$data_actors, $data_classes]
for group in groups
for obj in group
next if obj.nil?
obj.load_notetags_va
end
end
end

end # DataManager

#==============================================================================
# ¡ RPG::BaseItem
#==============================================================================

class RPG::BaseItem

#--------------------------------------------------------------------------
# public instance variables
#--------------------------------------------------------------------------
attr_accessor :win_quotes
attr_accessor :level_quotes
attr_accessor :drops_quotes

#--------------------------------------------------------------------------
# common cache: load_notetags_va
#--------------------------------------------------------------------------
def load_notetags_va
@win_quotes = [""]
@level_quotes = [""]
@drops_quotes = [""]
@victory_quote_type = nil
#---
self.note.split(/[\r\n]+/).each { |line|
case line
#---
when YEA::REGEXP::BASEITEM::WIN_QUOTE_ON
@victory_quote_type = :win_quote
when YEA::REGEXP::BASEITEM::WIN_QUOTE_OFF
@victory_quote_type = nil
when YEA::REGEXP::BASEITEM::LEVEL_QUOTE_ON
@victory_quote_type = :level_quote
when YEA::REGEXP::BASEITEM::LEVEL_QUOTE_OFF
@victory_quote_type = nil
when YEA::REGEXP::BASEITEM::DROPS_QUOTE_ON
@victory_quote_type = :drops_quote
when YEA::REGEXP::BASEITEM::DROPS_QUOTE_OFF
@victory_quote_type = nil
#---
when YEA::REGEXP::BASEITEM::NEW_QUOTE
case @victory_quote_type
when nil; next
when :win_quote; @win_quotes.push("")
when :level_quote; @level_quotes.push("")
when :drops_quote; @drops_quotes.push("")
end
#---
else
case @victory_quote_type
when nil; next
when :win_quote; @win_quotes[@win_quotes.size-1] += line.to_s
when :level_quote; @level_quotes[@level_quotes.size-1] += line.to_s
when :drops_quote; @drops_quotes[@drops_quotes.size-1] += line.to_s
end
end
} # self.note.split
#---
return unless self.is_a?(RPG::Class)
quotes = YEA::VICTORY_AFTERMATH::VICTORY_QUOTES
@win_quotes = quotes[:win].clone if @win_quotes == [""]
@level_quotes = quotes[:level].clone if @level_quotes == [""]
@drops_quotes = quotes[:drops].clone if @drops_quotes == [""]
end

end # RPG::BaseItem

#==============================================================================
# ¡ BattleManager
#==============================================================================

module BattleManager

#--------------------------------------------------------------------------
# overwrite method: self.process_victory
#--------------------------------------------------------------------------
def self.process_victory
if $imported["YEA-CommandAutobattle"]
SceneManager.scene.close_disable_autobattle_window
end
return skip_aftermath if Switch.skip_aftermath
play_battle_end_me
gain_jp if $imported["YEA-JPManager"]
display_exp
gain_exp
gain_gold
gain_drop_items
close_windows
SceneManager.return
replay_bgm_and_bgs
battle_end(0)
return true
end

#--------------------------------------------------------------------------
# new method: self.skip_aftermath
#--------------------------------------------------------------------------
def self.skip_aftermath
$game_party.all_members.each do |actor|
actor.gain_exp($game_troop.exp_total)
end
$game_party.gain_gold($game_troop.gold_total)
$game_troop.make_drop_items.each do |item|
$game_party.gain_item(item, 1)
end
close_windows
SceneManager.return
replay_bgm_and_bgs
battle_end(0)
end

#--------------------------------------------------------------------------
# overwrite method: self.play_battle_end_me
#--------------------------------------------------------------------------
def self.play_battle_end_me
return if Switch.skip_aftermath_music
$game_system.battle_end_me.play
YEA::VICTORY_AFTERMATH::VICTORY_BGM.play
end

#--------------------------------------------------------------------------
# new method: self.set_victory_text
#--------------------------------------------------------------------------
def self.set_victory_text(actor, type)
text = "" + sprintf(YEA::VICTORY_AFTERMATH::HEADER_TEXT, actor.name)
text += actor.victory_quotes(type)[rand(actor.victory_quotes(type).size)]
text += YEA::VICTORY_AFTERMATH::FOOTER_TEXT
$game_message.face_name = actor.face_name
$game_message.face_index = actor.face_index
$game_message.add(text)
wait_for_message
end

#--------------------------------------------------------------------------
# overwrite method: self.display_exp
#--------------------------------------------------------------------------
def self.display_exp
SceneManager.scene.show_victory_display_exp
actor = $game_party.random_target
@victory_actor = actor
set_victory_text(@victory_actor, :win)
end

#--------------------------------------------------------------------------
# overwrite method: self.gain_exp
#--------------------------------------------------------------------------
def self.gain_exp
$game_party.all_members.each do |actor|
temp_actor = Marshal.load(Marshal.dump(actor))
actor.gain_exp($game_troop.exp_total)
next if actor.level == temp_actor.level
SceneManager.scene.show_victory_level_up(actor, temp_actor)
set_victory_text(actor, :level)
wait_for_message
end
end

#--------------------------------------------------------------------------
# overwrite method: self.gain_gold
#--------------------------------------------------------------------------
def self.gain_gold
$game_party.gain_gold($game_troop.gold_total)
end

#--------------------------------------------------------------------------
# overwrite method: self.gain_drop_items
#--------------------------------------------------------------------------
def self.gain_drop_items
drops = []
$game_troop.make_drop_items.each do |item|
$game_party.gain_item(item, 1)
drops.push(item)
end
SceneManager.scene.show_victory_spoils($game_troop.gold_total, drops)
set_victory_text(@victory_actor, :drops)
wait_for_message
end

#--------------------------------------------------------------------------
# new method: self.close_windows
#--------------------------------------------------------------------------
def self.close_windows
SceneManager.scene.close_victory_windows
end

#--------------------------------------------------------------------------
# alias method: load_database
#--------------------------------------------------------------------------
class <<self; alias battle_end_va battle_end; end
def self.battle_end(result)
battle_end_va(result)
return if result == 2
return if YEA::VICTORY_AFTERMATH::AFTERMATH_COMMON_EVENT <= 0
event_id = YEA::VICTORY_AFTERMATH::AFTERMATH_COMMON_EVENT
$game_temp.reserve_common_event(event_id)
end

end # BattleManager

#==============================================================================
# ¡ Game_Actor
#==============================================================================

class Game_Actor < Game_Battler

#--------------------------------------------------------------------------
# overwrite method: gain_exp
#--------------------------------------------------------------------------
def gain_exp(exp)
enabled = !SceneManager.scene_is?(Scene_Battle)
change_exp(self.exp + (exp * final_exp_rate).to_i, enabled)
end

#--------------------------------------------------------------------------
# new method: victory_quotes
#--------------------------------------------------------------------------
def victory_quotes(type)
case type
when :win
return self.actor.win_quotes if self.actor.win_quotes != [""]
return self.class.win_quotes
when :level
return self.actor.level_quotes if self.actor.level_quotes != [""]
return self.class.level_quotes
when :drops
return self.actor.drops_quotes if self.actor.drops_quotes != [""]
return self.class.drops_quotes
else
return ["NOTEXT"]
end
end

end # Game_Actor

#==============================================================================
# ¡ Window_VictoryTitle
#==============================================================================

class Window_VictoryTitle < Window_Base

#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize
super(0, 0, Graphics.width, fitting_height(1))
self.z = 200
self.openness = 0
end

#--------------------------------------------------------------------------
# refresh
#--------------------------------------------------------------------------
def refresh(message = "")
contents.clear
draw_text(0, 0, contents.width, line_height, message, 1)
end

end # Window_VictoryTitle

#==============================================================================
# ¡ Window_VictoryEXP_Back
#==============================================================================

class Window_VictoryEXP_Back < Window_Selectable

#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize
super(0, fitting_height(1), Graphics.width, window_height)
self.z = 200
self.openness = 0
end

#--------------------------------------------------------------------------
# window_height
#--------------------------------------------------------------------------
def window_height
return Graphics.height - fitting_height(4) - fitting_height(1)
end

#--------------------------------------------------------------------------
# col_max
#--------------------------------------------------------------------------
def col_max; return item_max; end

#--------------------------------------------------------------------------
# spacing
#--------------------------------------------------------------------------
def spacing; return 8; end

#--------------------------------------------------------------------------
# item_max
#--------------------------------------------------------------------------
def item_max; return $game_party.battle_members.size; end

#--------------------------------------------------------------------------
# open
#--------------------------------------------------------------------------
def open
@exp_total = $game_troop.exp_total
super
end

#--------------------------------------------------------------------------
# item_rect
#--------------------------------------------------------------------------
def item_rect(index)
rect = Rect.new
rect.width = item_width
rect.height = contents.height
rect.x = index % col_max * (item_width + spacing)
rect.y = index / col_max * item_height
return rect
end

#--------------------------------------------------------------------------
# draw_item
#--------------------------------------------------------------------------
def draw_item(index)
actor = $game_party.battle_members[index]
return if actor.nil?
rect = item_rect(index)
reset_font_settings
draw_actor_name(actor, rect)
draw_exp_gain(actor, rect)
draw_jp_gain(actor, rect)
draw_actor_face(actor, rect)
end

#--------------------------------------------------------------------------
# draw_actor_name
#--------------------------------------------------------------------------
def draw_actor_name(actor, rect)
name = actor.name
draw_text(rect.x, rect.y+line_height, rect.width, line_height, name, 1)
end

#--------------------------------------------------------------------------
# draw_actor_face
#--------------------------------------------------------------------------
def draw_actor_face(actor, rect)
face_name = actor.face_name
face_index = actor.face_index
bitmap = Cache.face(face_name)
rw = [rect.width, 96].min
face_rect = Rect.new(face_index % 4 * 96, face_index / 4 * 96, rw, 96)
rx = (rect.width - rw) / 2 + rect.x
contents.blt(rx, rect.y + line_height * 2, bitmap, face_rect, 255)
end

#--------------------------------------------------------------------------
# draw_exp_gain
#--------------------------------------------------------------------------
def draw_exp_gain(actor, rect)
dw = rect.width - (rect.width - [rect.width, 96].min) / 2
dy = rect.y + line_height * 3 + 96
fmt = YEA::VICTORY_AFTERMATH::VICTORY_EXP
text = sprintf(fmt, actor_exp_gain(actor).group)
contents.font.size = YEA::VICTORY_AFTERMATH::FONTSIZE_EXP
change_color(power_up_color)
draw_text(rect.x, dy, dw, line_height, text, 2)
end

#--------------------------------------------------------------------------
# actor_exp_gain
#--------------------------------------------------------------------------
def actor_exp_gain(actor)
n = @exp_total * actor.final_exp_rate
return n.to_i
end

#--------------------------------------------------------------------------
# draw_jp_gain
#--------------------------------------------------------------------------
def draw_jp_gain(actor, rect)
return unless $imported["YEA-JPManager"]
dw = rect.width - (rect.width - [rect.width, 96].min) / 2
dy = rect.y + line_height * 4 + 96
fmt = YEA::JP::VICTORY_AFTERMATH
text = sprintf(fmt, actor_jp_gain(actor).group, Vocab::jp)
contents.font.size = YEA::VICTORY_AFTERMATH::FONTSIZE_EXP
change_color(power_up_color)
draw_text(rect.x, dy, dw, line_height, text, 2)
end

#--------------------------------------------------------------------------
# actor_jp_gain
#--------------------------------------------------------------------------
def actor_jp_gain(actor)
n = actor.battle_jp_earned
if actor.exp + actor_exp_gain(actor) > actor.exp_for_level(actor.level + 1)
n += YEA::JP::LEVEL_UP unless actor.max_level?
end
return n
end

end # Window_VictoryEXP_Back

#==============================================================================
# ¡ Window_VictoryEXP_Front
#==============================================================================

class Window_VictoryEXP_Front < Window_VictoryEXP_Back

#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize
super
self.back_opacity = 0
@ticks = 0
@counter = 30
contents.font.size = YEA::VICTORY_AFTERMATH::FONTSIZE_EXP
end

#--------------------------------------------------------------------------
# update
#--------------------------------------------------------------------------
def update
super
update_tick
end

#--------------------------------------------------------------------------
# update_tick
#--------------------------------------------------------------------------
def update_tick
return unless self.openness >= 255
return unless self.visible
return if complete_ticks?
@counter -= 1
return unless @counter <= 0
return if @ticks >= YEA::VICTORY_AFTERMATH::EXP_TICKS
YEA::VICTORY_AFTERMATH::VICTORY_TICK.play
@counter = 4
@ticks += 1
refresh
end

#--------------------------------------------------------------------------
# complete_ticks?
#--------------------------------------------------------------------------
def complete_ticks?
for actor in $game_party.battle_members
total_ticks = YEA::VICTORY_AFTERMATH::EXP_TICKS
bonus_exp = actor_exp_gain(actor) * @ticks / total_ticks
now_exp = actor.exp - actor.current_level_exp + bonus_exp
next_exp = actor.next_level_exp - actor.current_level_exp
rate = now_exp * 1.0 / next_exp
return false if rate < 1.0
end
return true
end

#--------------------------------------------------------------------------
# draw_item
#--------------------------------------------------------------------------
def draw_item(index)
actor = $game_party.battle_members[index]
return if actor.nil?
rect = item_rect(index)
draw_actor_exp(actor, rect)
end

#--------------------------------------------------------------------------
# exp_gauge1
#--------------------------------------------------------------------------
def exp_gauge1; return text_color(YEA::VICTORY_AFTERMATH::EXP_GAUGE1); end

#--------------------------------------------------------------------------
# exp_gauge2
#--------------------------------------------------------------------------
def exp_gauge2; return text_color(YEA::VICTORY_AFTERMATH::EXP_GAUGE2); end

#--------------------------------------------------------------------------
# lvl_gauge1
#--------------------------------------------------------------------------
def lvl_gauge1; return text_color(YEA::VICTORY_AFTERMATH::LEVEL_GAUGE1); end

#--------------------------------------------------------------------------
# lvl_gauge2
#--------------------------------------------------------------------------
def lvl_gauge2; return text_color(YEA::VICTORY_AFTERMATH::LEVEL_GAUGE2); end

#--------------------------------------------------------------------------
# draw_actor_exp
#--------------------------------------------------------------------------
def draw_actor_exp(actor, rect)
if actor.max_level?
draw_exp_gauge(actor, rect, 1.0)
return
end
total_ticks = YEA::VICTORY_AFTERMATH::EXP_TICKS
bonus_exp = actor_exp_gain(actor) * @ticks / total_ticks
now_exp = actor.exp - actor.current_level_exp + bonus_exp
next_exp = actor.next_level_exp - actor.current_level_exp
rate = now_exp * 1.0 / next_exp
draw_exp_gauge(actor, rect, rate)
end

#--------------------------------------------------------------------------
# draw_exp_gauge
#--------------------------------------------------------------------------
def draw_exp_gauge(actor, rect, rate)
rate = [[rate, 1.0].min, 0.0].max
dx = (rect.width - [rect.width, 96].min) / 2 + rect.x
dy = rect.y + line_height * 2 + 96
dw = [rect.width, 96].min
colour1 = rate >= 1.0 ? lvl_gauge1 : exp_gauge1
colour2 = rate >= 1.0 ? lvl_gauge2 : exp_gauge2
draw_gauge(dx, dy, dw, rate, colour1, colour2)
fmt = YEA::VICTORY_AFTERMATH::EXP_PERCENT
text = sprintf(fmt, [rate * 100, 100.00].min)
if [rate * 100, 100.00].min == 100.00
text = YEA::VICTORY_AFTERMATH::LEVELUP_TEXT
text = YEA::VICTORY_AFTERMATH::MAX_LVL_TEXT if actor.max_level?
end
draw_text(dx, dy, dw, line_height, text, 1)
end

end # Window_VictoryEXP_Front

#==============================================================================
# ¡ Window_VictoryLevelUp
#==============================================================================

class Window_VictoryLevelUp < Window_Base

#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize
super(0, fitting_height(1), Graphics.width, window_height)
self.z = 200
hide
end

#--------------------------------------------------------------------------
# window_height
#--------------------------------------------------------------------------
def window_height
return Graphics.height - fitting_height(4) - fitting_height(1)
end

#--------------------------------------------------------------------------
# refresh
#--------------------------------------------------------------------------
def refresh(actor, temp_actor)
contents.clear
reset_font_settings
YEA::VICTORY_AFTERMATH::LEVEL_SOUND.play
draw_actor_changes(actor, temp_actor)
end

#--------------------------------------------------------------------------
# draw_actor_changes
#--------------------------------------------------------------------------
def draw_actor_changes(actor, temp_actor)
dx = contents.width / 16
draw_actor_image(actor, temp_actor, dx)
draw_param_names(actor, dx)
draw_former_stats(temp_actor)
draw_arrows
draw_newer_stats(actor, temp_actor)
draw_new_skills(actor, temp_actor)
end

#--------------------------------------------------------------------------
# draw_actor_image
#--------------------------------------------------------------------------
def draw_actor_image(actor, temp_actor, dx)
draw_text(dx, line_height, 96, line_height, actor.name, 1)
draw_actor_face(actor, dx, line_height * 2)
exp = actor.exp - temp_actor.exp
text = sprintf(YEA::VICTORY_AFTERMATH::VICTORY_EXP, exp.group)
change_color(power_up_color)
contents.font.size = YEA::VICTORY_AFTERMATH::FONTSIZE_EXP
draw_text(0, line_height * 2 + 96, dx + 96, line_height, text, 2)
reset_font_settings
end

#--------------------------------------------------------------------------
# draw_param_names
#--------------------------------------------------------------------------
def draw_param_names(actor, dx)
dx += 108
change_color(system_color)
text = Vocab.level
draw_text(dx, 0, contents.width - dx, line_height, text)
dy = 0
for i in 0...8
dy += line_height
text = Vocab.param(i)
draw_text(dx, dy, contents.width - dx, line_height, text)
end
end

#--------------------------------------------------------------------------
# draw_former_stats
#--------------------------------------------------------------------------
def draw_former_stats(actor)
dw = contents.width / 2 - 12
dy = 0
change_color(normal_color)
draw_text(0, dy, dw, line_height, actor.level.group, 2)
for i in 0...8
dy += line_height
draw_text(0, dy, dw, line_height, actor.param_base(i).group, 2)
end
end

#--------------------------------------------------------------------------
# draw_arrows
#--------------------------------------------------------------------------
def draw_arrows
dx = contents.width / 2 - 12
dy = 0
change_color(system_color)
for i in 0..8
draw_text(dx, dy, 24, line_height, "¨", 1)
dy += line_height
end
end

#--------------------------------------------------------------------------
# draw_newer_stats
#--------------------------------------------------------------------------
def draw_newer_stats(actor, temp_actor)
dx = contents.width / 2 + 12
dw = contents.width - dx
dy = 0
change_color(param_change_color(actor.level - temp_actor.level))
draw_text(dx, dy, dw, line_height, actor.level.group, 0)
for i in 0...8
dy += line_height
change_color(param_change_color(actor.param_base(i) - temp_actor.param_base(i)))
draw_text(dx, dy, dw, line_height, actor.param_base(i).group, 0)
end
end
#--------------------------------------------------------------------------
# draw_new_skills
#--------------------------------------------------------------------------
def draw_new_skills(actor, temp_actor)
return if temp_actor.skills.size == actor.skills.size
dw = 172 + 24
dx = contents.width - dw
change_color(system_color)
text = YEA::VICTORY_AFTERMATH::SKILLS_TEXT
draw_text(dx, 0, dw, line_height, text, 0)
end

end # Window_VictoryLevelUp

#==============================================================================
# ¡ Window_VictorySkills
#==============================================================================

class Window_VictorySkills < Window_Selectable

#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize
dy = fitting_height(1) + 24
dw = 172 + 24 + 24
dh = Graphics.height - fitting_height(4) - fitting_height(1) - 24
super(Graphics.width - dw, dy, dw, dh)
self.opacity = 0
self.z = 200
hide
end

#--------------------------------------------------------------------------
# item_max
#--------------------------------------------------------------------------
def item_max; return @data.nil? ? 0 : @data.size; end

#--------------------------------------------------------------------------
# refresh
#--------------------------------------------------------------------------
def refresh(actor, temp_actor)
contents.clear
if actor.skills.size == temp_actor.skills.size
unselect
@data = []
create_contents
return
end
@data = actor.skills - temp_actor.skills
if @data.size > 8
select(0)
activate
else
unselect
deactivate
end
create_contents
draw_all_items
end

#--------------------------------------------------------------------------
# refresh
#--------------------------------------------------------------------------
def draw_item(index)
rect = item_rect(index)
skill = @data[index]
return if skill.nil?
rect.width -= 4
draw_item_name(skill, rect.x, rect.y, true)
end

end # Window_VictorySkills

#==============================================================================
# ¡ Window_VictorySpoils
#==============================================================================

class Window_VictorySpoils < Window_ItemList

#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize
super(0, fitting_height(1), Graphics.width, window_height)
self.z = 200
hide
end

#--------------------------------------------------------------------------
# window_height
#--------------------------------------------------------------------------
def window_height
return Graphics.height - fitting_height(4) - fitting_height(1)
end

#--------------------------------------------------------------------------
# spacing
#--------------------------------------------------------------------------
def spacing; return 32; end

#--------------------------------------------------------------------------
# make
#--------------------------------------------------------------------------
def make(gold, drops)
@gold = gold
@drops = drops
refresh
select(0)
activate
end

#--------------------------------------------------------------------------
# make_item_list
#--------------------------------------------------------------------------
def make_item_list
@data = [nil]
items = {}
weapons = {}
armours = {}
@goods = {}
for item in @drops
case item
when RPG::Item
items[item] = 0 if items[item].nil?
items[item] += 1
when RPG::Weapon
weapons[item] = 0 if weapons[item].nil?
weapons[item] += 1
when RPG::Armor
armours[item] = 0 if armours[item].nil?
armours[item] += 1
end
end
items = items.sort { |a,b| a[0].id <=> b[0].id }
weapons = weapons.sort { |a,b| a[0].id <=> b[0].id }
armours = armours.sort { |a,b| a[0].id <=> b[0].id }
for key in items; @goods[key[0]] = key[1]; @data.push(key[0]); end
for key in weapons; @goods[key[0]] = key[1]; @data.push(key[0]); end
for key in armours; @goods[key[0]] = key[1]; @data.push(key[0]); end
end

#--------------------------------------------------------------------------
# draw_item
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
rect = item_rect(index)
reset_font_settings
if item.nil?
draw_gold(rect)
return
end
rect.width -= 4
draw_item_name(item, rect.x, rect.y, true, rect.width - 24)
draw_item_number(rect, item)
end

#--------------------------------------------------------------------------
# draw_gold
#--------------------------------------------------------------------------
def draw_gold(rect)
text = Vocab.currency_unit
draw_currency_value(@gold, text, rect.x, rect.y, rect.width)
end

#--------------------------------------------------------------------------
# draw_item_number
#--------------------------------------------------------------------------
def draw_item_number(rect, item)
number = @goods[item].group
if $imported["YEA-AdjustLimits"]
contents.font.size = YEA::LIMIT::ITEM_FONT
text = sprintf(YEA::LIMIT::ITEM_PREFIX, number)
draw_text(rect, text, 2)
else
draw_text(rect, sprintf(":%s", number), 2)
end
end

end # Window_VictorySpoils

#==============================================================================
# ¡ Scene_Battle
#==============================================================================

class Scene_Battle < Scene_Base

#--------------------------------------------------------------------------
# alias method: create_all_windows
#--------------------------------------------------------------------------
alias scene_battle_create_all_windows_va create_all_windows
def create_all_windows
scene_battle_create_all_windows_va
create_victory_aftermath_windows
end

#--------------------------------------------------------------------------
# new method: create_victory_aftermath_windows
#--------------------------------------------------------------------------
def create_victory_aftermath_windows
@victory_title_window = Window_VictoryTitle.new
@victory_exp_window_back = Window_VictoryEXP_Back.new
@victory_exp_window_front = Window_VictoryEXP_Front.new
@victory_level_window = Window_VictoryLevelUp.new
@victory_level_skills = Window_VictorySkills.new
@victory_spoils_window = Window_VictorySpoils.new
end

#--------------------------------------------------------------------------
# new method: show_victory_display_exp
#--------------------------------------------------------------------------
def show_victory_display_exp
@victory_title_window.open
name = $game_party.battle_members[0].name
fmt = YEA::VICTORY_AFTERMATH::TOP_TEAM
name = sprintf(fmt, name) if $game_party.battle_members.size > 1
fmt = YEA::VICTORY_AFTERMATH::TOP_VICTORY_TEXT
text = sprintf(fmt, name)
@victory_title_window.refresh(text)
#---
@victory_exp_window_back.open
@victory_exp_window_back.refresh
@victory_exp_window_front.open
@victory_exp_window_front.refresh
end

#--------------------------------------------------------------------------
# new method: show_victory_level_up
#--------------------------------------------------------------------------
def show_victory_level_up(actor, temp_actor)
@victory_exp_window_back.hide
@victory_exp_window_front.hide
#---
fmt = YEA::VICTORY_AFTERMATH::TOP_LEVEL_UP
text = sprintf(fmt, actor.name)
@victory_title_window.refresh(text)
#---
@victory_level_window.show
@victory_level_window.refresh(actor, temp_actor)
@victory_level_skills.show
@victory_level_skills.refresh(actor, temp_actor)
end

#--------------------------------------------------------------------------
# new method: show_victory_spoils
#--------------------------------------------------------------------------
def show_victory_spoils(gold, drops)
@victory_exp_window_back.hide
@victory_exp_window_front.hide
@victory_level_window.hide
@victory_level_skills.hide
#---
text = YEA::VICTORY_AFTERMATH::TOP_SPOILS
@victory_title_window.refresh(text)
#---
@victory_spoils_window.show
@victory_spoils_window.make(gold, drops)
end

#--------------------------------------------------------------------------
# new method: close_victory_windows
#--------------------------------------------------------------------------
def close_victory_windows
@victory_title_window.close
@victory_exp_window_back.close
@victory_exp_window_front.close
@victory_level_window.close
@victory_level_skills.close
@victory_spoils_window.close
wait(16)
end

end # Scene_Battle

#==============================================================================
#
# ¥ End of File
#
#==============================================================================
 

Kakis

Regular
Regular
Joined
Dec 20, 2018
Messages
34
Reaction score
2
First Language
English
Primarily Uses
RMMV
And Moghunter's script:
#==============================================================================
# +++ MOG - Battle Result (2.0) +++
#==============================================================================
# By Moghunter
# https://atelierrgss.wordpress.com/
#==============================================================================
# Apresentação animada do resultado da batalha.
#==============================================================================
# Arquivos necessários. (Graphics/System)
#
# Result.png
# Result_Layout.png
# Result_Levelup.png
# Result_Levelword.png
# Result_Number_1.png
# Result_Number_2.png
#
#==============================================================================
# ● Histórico (Version History)
#==============================================================================
# v2.0 - Correção do bug de não ativar o resultado em inimigos ocultos.
#==============================================================================
module MOG_BATLE_RESULT
#Posição do EXP.
RESULT_EXP_POSITION = [440,80]
#Posição do GOLD.
RESULT_GOLD_POSITION = [476,125]
#Posição da palavra LeveL UP.
RESULT_LEVELWORD_POSITION = [0,0]
#Posição do Level.
RESULT_LEVEL_POSITION = [230,-7]
#Posição dos parâmetros
RESULT_PARAMETER_POSITION = [70,70]
#Posição da janela de skill.
RESULT_NEW_SKILL_POSITION = [240,230]
#Definição da animação de Level UP.
RESULT_LEVELUP_ANIMATION_ID = 37
end

$imported = {} if $imported.nil?
$imported[:mog_battler_result] = true

#==============================================================================
# ■ Game Temp
#==============================================================================
class Game_Temp
attr_accessor :level_parameter
attr_accessor :level_parameter_old
attr_accessor :result
attr_accessor :battle_end
attr_accessor :battle_result

#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
alias mog_result_initialize initialize
def initialize
@level_parameter = [] ; @level_parameter_old = []
@result = false ; @battle_end = false ; @battle_result = false
mog_result_initialize
end

#--------------------------------------------------------------------------
# ● Sprite Visible
#--------------------------------------------------------------------------
def sprite_visible
return false if $game_message.visible
return false if $game_temp.battle_end
return true
end

end

#==============================================================================
# ■ 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

end

#==============================================================================
# ■ BattleManager
#==============================================================================
module BattleManager

#--------------------------------------------------------------------------
# ● Process Victory
#--------------------------------------------------------------------------
def self.process_victory
@phase = nil
@event_proc.call(0) if @event_proc
$game_temp.battle_result = true ;play_battle_end_me ; replay_bgm_and_bgs
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_temp.battle_result
return true
end

#--------------------------------------------------------------------------
# ● Execute Result
#--------------------------------------------------------------------------
def execute_result
$game_temp.battle_result = false
result = Battle_Result.new
$game_temp.combo_hit[2] = 0 rescue nil if $imported[:mog_combo_count]
@status_window.visible = false
if $imported[:mog_battle_command_ex]
@window_actor_face.visible = false if @window_actor_face != nil
end
loop do
result.update ; @spriteset.update
Graphics.update ; Input.update
break if result.victory_phase == 10
end
result.dispose
$game_party.on_battle_end
$game_troop.on_battle_end
SceneManager.exit if $BTEST
end

end

#==============================================================================
# ■ Battle Result
#==============================================================================
class Battle_Result
include MOG_BATLE_RESULT

attr_accessor :victory_phase

#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize
$game_temp.battle_end = true ; $game_temp.result = true
@victory_phase = 0 ; @victory_wait_duration = 0
@fade_result_window = false ; create_victory_sprites
end

#--------------------------------------------------------------------------
# ● Create Victory Sprites
#--------------------------------------------------------------------------
def create_victory_sprites
@result_number = Cache.system("Result_Number_1")
@result_number2 = Cache.system("Result_Number_2")
@result_cw = @result_number.width / 10
@result_ch = @result_number.height / 2
@result2_cw = @result_number2.width / 10
@result2_ch = @result_number2.height / 2
create_victory_text ; create_victory_layout ; create_victory_exp
create_victory_gold ; create_window_treasure
end

#--------------------------------------------------------------------------
# ● Victory Wait ?
#--------------------------------------------------------------------------
def victory_wait?
return false if @victory_wait_duration <= 0
@victory_wait_duration -= 1
return true
end

#--------------------------------------------------------------------------
# ● End Victory
#--------------------------------------------------------------------------
def end_victory
@victory_wait_duration = 10 ; dispose
end

#--------------------------------------------------------------------------
# ● Create Victory Layout
#--------------------------------------------------------------------------
def create_victory_layout
return if @victory_layout_sprite != nil
@victory_layout_sprite = Sprite.new
@victory_layout_sprite.z = 1001
@victory_layout_sprite.bitmap = Cache.system("Result_Layout")
@victory_layout_sprite.zoom_x = 2.0
@victory_layout_sprite.opacity = 0
end

#--------------------------------------------------------------------------
# ● Create Victory Text
#--------------------------------------------------------------------------
def create_victory_text
return if @victory_sprite != nil
@victory_sprite = Sprite.new
@victory_sprite.z = 1000
@victory_sprite.bitmap = Cache.system("Result")
@victory_sprite.ox = @victory_sprite.width / 2
@victory_sprite.oy = @victory_sprite.height / 2
@victory_sprite.x = @victory_sprite.ox
@victory_sprite.y = @victory_sprite.oy
@victory_sprite.zoom_x = 1.5
@victory_sprite.zoom_y = 1.5
@victory_sprite.opacity = 0
end

end

#==============================================================================
# ■ Battle Result
#==============================================================================
class Battle_Result

#--------------------------------------------------------------------------
# ● Dispose
#--------------------------------------------------------------------------
def dispose
$game_temp.result = false
@victory_sprite.bitmap.dispose ; @victory_sprite.dispose
@victory_layout_sprite.bitmap.dispose ; @victory_layout_sprite.dispose
@exp_number.bitmap.dispose ; @exp_number.dispose
@gold_number.bitmap.dispose ; @gold_number.dispose
@result_number.dispose ; @window_treasure.dispose
dispose_level_up ; @result_number.dispose ; @result_number2.dispose
@tr_viewport.dispose
end

#--------------------------------------------------------------------------
# ● 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
@new_skill_window.dispose if @new_skill_window
end

end

#==============================================================================
# ■ Battle Result
#==============================================================================
class Battle_Result

#--------------------------------------------------------------------------
# ● Update
#--------------------------------------------------------------------------
def update
$game_temp.battle_end = true
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

#--------------------------------------------------------------------------
# ● Update Victory Fade
#--------------------------------------------------------------------------
def update_victory_fade
fade_speed = 10
@victory_sprite.opacity -= fade_speed
@victory_layout_sprite.opacity -= fade_speed
@gold_number.opacity -= fade_speed
@exp_number.opacity -= fade_speed
@window_treasure.contents_opacity -= fade_speed
end

#--------------------------------------------------------------------------
# ● Update Victory Initial
#--------------------------------------------------------------------------
def update_victory_initial
@victory_sprite.zoom_x -= 0.01
@victory_sprite.zoom_y -= 0.01
@victory_sprite.opacity += 10
if @victory_sprite.zoom_x <= 1.00
@victory_sprite.zoom_x = 1
@victory_sprite.zoom_y = 1
@victory_sprite.opacity = 255
@victory_phase = 1
@victory_wait_duration = 20
end
end

#--------------------------------------------------------------------------
# ● Update Victory Initial 2
#--------------------------------------------------------------------------
def update_victory_initial2
@victory_sprite.zoom_x += 0.01
@victory_sprite.zoom_y += 0.01
@victory_sprite.opacity -= 10
if @victory_sprite.opacity <= 0
@victory_sprite.zoom_x = 1
@victory_sprite.zoom_y = 1
@victory_sprite.opacity = 0
@victory_phase = 2
end
end

#--------------------------------------------------------------------------
# ● Update Victory Initial 3
#--------------------------------------------------------------------------
def update_victory_initial3
@victory_layout_sprite.zoom_x -= 0.02
@victory_layout_sprite.opacity += 10
if @victory_layout_sprite.zoom_x <= 1.00
@victory_layout_sprite.zoom_x = 1
@victory_layout_sprite.opacity = 255
@victory_phase = 3
end
end

end

#==============================================================================
# ■ Battle Result
#==============================================================================
class Battle_Result

#--------------------------------------------------------------------------
# ● Create Victory Exp
#--------------------------------------------------------------------------
def create_victory_exp
@exp_number = Sprite.new
@exp_number.bitmap = Bitmap.new(@result_number.width,@result_ch)
@exp_number.z = 1002 ; @exp_number.y = RESULT_EXP_POSITION[1]
@exp_number.zoom_x = 2 ; @exp_number.zoom_y = 2
@exp_total = $game_troop.exp_total ; @exp_number.opacity = 0
@exp_old = 0
@exp_ref = ((1 * @exp_total) / 111).truncate rescue nil
@exp_ref = 1 if @exp_ref < 1 or @exp_ref == nil
@exp_ref = 0 if @exp_total == 0
refresh_exp_number
end

#--------------------------------------------------------------------------
# ● Update Victory Exp
#--------------------------------------------------------------------------
def update_victory_exp
update_exp_sprite ; update_exp_number
end

#--------------------------------------------------------------------------
# ● 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

#--------------------------------------------------------------------------
# ● Create Victory Gold
#--------------------------------------------------------------------------
def create_victory_gold
@gold_number = Sprite.new
@gold_number.bitmap = Bitmap.new(@result_number.width,@result_ch)
@gold_number.z = 1002
@gold_number.y = RESULT_GOLD_POSITION[1]
@gold_number.opacity = 0
@gold_number.zoom_x = 2
@gold_number.zoom_y = 2
@gold_total = $game_troop.gold_total
@gold_old = 0
@gold_ref = ((1 * @gold_total) / 111).truncate rescue nil
@gold_ref = 1 if @gold_ref < 1 or @gold_ref == nil
@gold_ref = 0 if @gold_total == 0
$game_party.gain_gold($game_troop.gold_total)
refresh_gold_number
end

#--------------------------------------------------------------------------
# ● Update Victory Gold
#--------------------------------------------------------------------------
def update_victory_gold
update_gold_sprite ; update_gold_number
end

#--------------------------------------------------------------------------
# ● 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

#--------------------------------------------------------------------------
# ● Create Window Treasure
#--------------------------------------------------------------------------
def create_window_treasure
@tr_viewport = Viewport.new(-8, 164, Graphics.width + 32, 118)
@tr_viewport.z = 1003
@window_treasure = Window_Treasure.new
@window_treasure.viewport = @tr_viewport
end

#--------------------------------------------------------------------------
# ● Update Victory Item
#--------------------------------------------------------------------------
def update_victory_item
@window_treasure.update
@actor_level = []
return if @window_treasure.x != 0 and @victory_phase >= 6
@victory_phase = 6
if $data_system.opt_extra_exp
@result_member_max = $game_party.members.size
else
@result_member_max = $game_party.battle_members.size
end
@result_member_id = 0
end

end

#==============================================================================
# ■ Window Treasure
#==============================================================================
class Window_Treasure < Window_Base

#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize
super(-Graphics.width,-10, Graphics.width + 32, 288)
self.opacity = 0 ; self.contents_opacity = 0
self.contents.font.size = 24 ; self.contents.font.bold = true
self.z = 1003 ; @range_max = 256 ; @wait_time = 30 ; @scroll = false
draw_treasure
end

#--------------------------------------------------------------------------
# ● Draw_Treasure
#--------------------------------------------------------------------------
def draw_treasure
contents.clear
space_x = Graphics.width / 3
$game_troop.make_drop_items.each_with_index do |item, index|
xi = (index * space_x) - ((index / 3) * (space_x * 3))
yi = (index / 3) * 32
$game_party.gain_item(item, 1)
draw_item_name(item,xi, yi, true, 140)
end
@range_max = ($game_troop.make_drop_items.size / 3) * 32
@scroll = true if $game_troop.make_drop_items.size > 12
end

#--------------------------------------------------------------------------
# ● Update
#--------------------------------------------------------------------------
def update
super
self.contents_opacity += 10
if self.x < 0
self.x += 15
(self.x = 0 ; Sound.play_cursor) if self.x >= 0
end
if @scroll and self.contents_opacity == 255 and self.x == 0
@wait_time -= 1 if @wait_time > 0
return if @wait_time > 0
self.y -= 1
self.y = 128 if self.y < -@range_max
@wait_time = 30 if self.y == -10
end
end

end

#==============================================================================
# ■ Battle Result
#==============================================================================
class Battle_Result

#--------------------------------------------------------------------------
# ● Create Levelup
#--------------------------------------------------------------------------
def create_levelup
if @levelup_layout == nil
@levelup_layout = Sprite.new ; @levelup_layout.z = 1000
@levelup_layout.bitmap = Cache.system("Result_Levelup")
end
if @levelup_word == nil
@levelup_word = Sprite.new ; @levelup_word.z = 1001
@levelup_word.bitmap = Cache.system("Result_Levelword")
@levelup_word.ox = @levelup_word.bitmap.width / 2
@levelup_word.oy = @levelup_word.bitmap.height / 2
@levelup_word.x = @levelup_word.ox + RESULT_LEVELWORD_POSITION[0]
@levelup_word.y = @levelup_word.oy + RESULT_LEVELWORD_POSITION[1]
end
@levelup_word.blend_type = 1
@levelup_word.zoom_x = 2 ; @levelup_word.zoom_y = 2
end

#--------------------------------------------------------------------------
# ● Create Parameter Number
#--------------------------------------------------------------------------
def create_parameter_number
if @parameter_sprite == nil
@parameter_sprite = Sprite.new
@parameter_sprite.bitmap = Bitmap.new(250,220)
@parameter_sprite.z = 1001
@parameter_sprite.x = RESULT_PARAMETER_POSITION[0]
@parameter_sprite.y = RESULT_PARAMETER_POSITION[1]
@parameter_sprite.bitmap.font.size = 16
@parameter_sprite.bitmap.font.bold = true
end
refresh_parameter
end

#--------------------------------------------------------------------------
# ● Refresh Parameter
#--------------------------------------------------------------------------
def refresh_parameter
@parameter_animation = 0
@parameter_sprite.bitmap.clear
@parameter_sprite.opacity = 0
@parameter_sprite.x = RESULT_PARAMETER_POSITION[0] - 200
actor_old = $game_temp.level_parameter_old
draw_result_parameter(@actor_result.mhp,actor_old[1],0,28 * 0)
draw_result_parameter(@actor_result.mmp,actor_old[2],0,28 * 1)
draw_result_parameter(@actor_result.atk,actor_old[3],0,28 * 2)
draw_result_parameter(@actor_result.def,actor_old[4],0,28 * 3)
draw_result_parameter(@actor_result.mat,actor_old[5],0,28 * 4)
draw_result_parameter(@actor_result.mdf,actor_old[6],0,28 * 5)
draw_result_parameter(@actor_result.agi,actor_old[7],0,28 * 6)
draw_result_parameter(@actor_result.luk,actor_old[8],0,28 * 7)
end

#--------------------------------------------------------------------------
# ● 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("Actor" + @actor_result.id.to_s)
@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 = []
$game_temp.level_parameter_old = []
$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 @result_member_id > $game_party.battle_members.size
$game_temp.level_parameter = []
$game_temp.level_parameter_old = []
next
end
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 Level
#--------------------------------------------------------------------------
def create_level
if @level_sprite == nil
@level_sprite = Sprite.new ; @level_sprite.bitmap = Bitmap.new(200,64)
@level_sprite.z = 1002
end
@level_sprite.bitmap.font.size = 48
@level_sprite.bitmap.font.bold = true
@level_sprite.x = RESULT_LEVEL_POSITION[0]
@level_sprite.y = RESULT_LEVEL_POSITION[1]
@level_sprite.bitmap.clear
@level_sprite.bitmap.font.color = Color.new(255,255,255)
@level_sprite.bitmap.draw_text(0,0,100,64,@actor_result.level,1)
levelup = @actor_result.level - $game_temp.level_parameter_old[0]
@level_sprite.bitmap.font.color = Color.new(50,255,255)
@level_sprite.bitmap.font.size = 18
@level_sprite.bitmap.draw_text(80,0,100,64,"+" + levelup.to_s ,0)
end

#--------------------------------------------------------------------------
# ● Create New Skill Windos
#--------------------------------------------------------------------------
def create_new_skill_window
@new_skill_window = Window_Result_Skill.new if @new_skill_window == nil
@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 = -Graphics.width
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 < RESULT_PARAMETER_POSITION[0]
@parameter_sprite.opacity += 13
@parameter_sprite.x += 5
if @parameter_sprite.x >= RESULT_PARAMETER_POSITION[0]
@parameter_sprite.opacity = 255
@parameter_sprite.x = RESULT_PARAMETER_POSITION[0]
end
end
end

end

#==============================================================================
# ■ Window Result Skill
#==============================================================================
class Window_Result_Skill < Window_Base

#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize
super(0,0, 270, 58)
self.opacity = 160 ; self.contents_opacity = 255
self.contents.font.bold = true ; self.z = 1003 ; @animation_time = 999
@org = [MOG_BATLE_RESULT::RESULT_NEW_SKILL_POSITION[0],MOG_BATLE_RESULT::RESULT_NEW_SKILL_POSITION[1]]
end

#--------------------------------------------------------------------------
# ● DrawNew Skill
#--------------------------------------------------------------------------
def draw_new_skill(skill)
contents.clear
self.contents.font.size = 16
self.contents.font.color = Color.new(100,200,100)
contents.draw_text(0,0,100,32, "New Skill",0)
self.contents.font.color = Color.new(255,255,255)
draw_item_name_skill(skill,70,0, true, 170)
self.x = @org[0] ; self.y = @org[1]
@animation_time = 0 ; self.opacity = 0 ; self.contents_opacity = 0
end

#--------------------------------------------------------------------------
# ● Draw Item Name
#--------------------------------------------------------------------------
def draw_item_name_skill(item, x, y, enabled = true, width = 172)
return unless item
draw_icon(item.icon_index, x, y, enabled)
change_color(normal_color, enabled)
draw_text(x + 24, y + 4, width, line_height, item.name)
end

#--------------------------------------------------------------------------
# ● Update
#--------------------------------------------------------------------------
def update
super
return if @animation_time == 999
@animation_time += 1 if @animation_time != 999
case @animation_time
when 0..30
self.y -= 1 ; self.opacity += 5 ; self.contents_opacity += 5
when 31..60
self.y += 1 ; self.opacity += 5 ; self.contents_opacity += 5
else
self.y = @org[1] ; self.opacity = 255 ; self.contents_opacity = 255
@animation_time = 999
end
end

end
 

Roninator2

Gamer
Regular
Joined
May 22, 2016
Messages
5,242
Reaction score
1,571
First Language
English
Primarily Uses
RMVXA
@Kakis First let me ask Please use spoilers and code tags.
Pasting the code like you did causes the forums to convert some of the code into smiley's
1663425105318.png

Which way do you want to go.

Add stuff to Yanfly, or add stuff to MOG.
What needs to be added and how should it look. These are question anyone that would try this will ask.
 

Kakis

Regular
Regular
Joined
Dec 20, 2018
Messages
34
Reaction score
2
First Language
English
Primarily Uses
RMMV
@Kakis First let me ask Please use spoilers and code tags.
Pasting the code like you did causes the forums to convert some of the code into smiley's
View attachment 240624

Which way do you want to go.

Add stuff to Yanfly, or add stuff to MOG.
What needs to be added and how should it look. These are question anyone that would try this will ask.
Sorry, I don't understand how to do that, even with what's indicated. I tried changing it to code as Ruby, but the preview doesn't make it clear to me. It just removes what I put down. Same with trying to add the spoiler tag.

I also don't understand what you mean by:
What needs to be added and how should it look. These are question anyone that would try this will ask.
I showed visual examples of how I would like it to look, or do I need to specify further?

I haven't thought of which one I'd work into, since I wouldn't really know where to start. Ideally, I'd like to try to keep Moghunter's visual display and then add the dialogue mechanic from Yanfly.
 
Last edited:

Roninator2

Gamer
Regular
Joined
May 22, 2016
Messages
5,242
Reaction score
1,571
First Language
English
Primarily Uses
RMVXA
I don't understand how to do that, even with what's indicated.
You click on the spoiler button. Type in a name or text.
You click on the code button. You paste the code into the box that pops up. You click ok.

I showed visual examples of how I would like it to look
You showed images of the default scripts and an example from another game.
If what you showed is what you want then the job is done, those script do what you showed. But of course you have to choose which one.
Yet you said you want elements from each to be in the other, in essence combining them.
That needs more clarification.
1. Do you use yanfly's code and have the character busts show up on the experience screen (you didn't show the levelup window) or is there something missing from Yanfly's level up window that you want.

2. If you want to use MOG's victory data, you say you want to see the varied messages.
Is that to be on the experience screen or on the level up screen.

So have I explained it better to you?

Ideally, I'd like to try to keep Moghunter's visual display and then add the dialogue mechanic from Yanfly
Hence the second option I mentioned.

I may try to help, or someone else.
Thank you for detailing it further.

How does this work for you?

Using MOG battle results and this script
Place below MOG battle results.
Ruby:
module YEA
  module VICTORY_AFTERMATH
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - Victory Messages -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # In the Victory Aftermath, actors can say unique things. This is the pool
    # of quotes used for actors without any custom victory quotes. Note that
    # actors with custom quotes will take priority over classes with custom
    # quotes, which will take priority over these default quotes. Use \n for
    # a line break in the quotes.
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    HEADER_TEXT = "\e>\eC[6]%s\eC[0]\e<\n"  # Always at start of messages.
    FOOTER_TEXT = ""                        # Always at end of messages.
   
    # Win Quotes are what the actors say when a battle is won.
    VICTORY_QUOTES ={
    # :type   => Quotes
      #------------------------------------------------------------------------
      :win    => [ # Occurs as initial victory quote.
                   '"We won! What an exciting fight!"',
                   '"I didn\'t even break a sweat."',
                   '"That wasn\'t so tough."',
                   '"Let\'s fight something harder!"',
                 ],# Do not remove this.
      #------------------------------------------------------------------------
      :level  => [ # Occurs as initial victory quote.
                   '"Yes! Level up!"',
                   '"I\'ve gotten stronger!"',
                   '"Try to keep up with me!"',
                   '"I\'ve grown again!"',
                 ],# Do not remove this.
      #------------------------------------------------------------------------
      :drops  => [ # Occurs as initial victory quote.
                   '"I\'ll be taking these."',
                   '"To the victor goes the spoils."',
                   '"The enemies dropped something!"',
                   '"Hey, what\'s this?"',
                 ],# Do not remove this.
      #------------------------------------------------------------------------
    } # Do not remove this.
   
  end # VICTORY_AFTERMATH
end # YEA

module YEA
  module REGEXP
  module BASEITEM
   
    NEW_QUOTE = /\[(?:NEW_QUOTE|new quote)\]/i
   
    WIN_QUOTE_ON    = /<(?:WIN_QUOTES|win quote|win quotes)>/i
    WIN_QUOTE_OFF   = /<\/(?:WIN_QUOTES|win quote|win quotes)>/i
    LEVEL_QUOTE_ON  = /<(?:LEVEL_QUOTES|level quote|level quotes)>/i
    LEVEL_QUOTE_OFF = /<\/(?:LEVEL_QUOTES|level quote|level quotes)>/i
    DROPS_QUOTE_ON  = /<(?:DROPS_QUOTES|drops quote|drops quotes)>/i
    DROPS_QUOTE_OFF = /<\/(?:DROPS_QUOTES|drops quote|drops quotes)>/i
   
  end # BASEITEM
  end # REGEXP
end # YEA

module DataManager
 
  #--------------------------------------------------------------------------
  # alias method: load_database
  #--------------------------------------------------------------------------
  class <<self; alias load_database_va load_database; end
  def self.load_database
    load_database_va
    load_notetags_va
  end
 
  #--------------------------------------------------------------------------
  # new method: load_notetags_va
  #--------------------------------------------------------------------------
  def self.load_notetags_va
    groups = [$data_actors, $data_classes]
    for group in groups
      for obj in group
        next if obj.nil?
        obj.load_notetags_va
      end
    end
  end
 
end # DataManager

class RPG::BaseItem
 
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :win_quotes
  attr_accessor :level_quotes
  attr_accessor :drops_quotes
 
  #--------------------------------------------------------------------------
  # common cache: load_notetags_va
  #--------------------------------------------------------------------------
  def load_notetags_va
    @win_quotes = [""]
    @level_quotes = [""]
    @drops_quotes = [""]
    @victory_quote_type = nil
    #---
    self.note.split(/[\r\n]+/).each { |line|
      case line
      #---
      when YEA::REGEXP::BASEITEM::WIN_QUOTE_ON
        @victory_quote_type = :win_quote
      when YEA::REGEXP::BASEITEM::WIN_QUOTE_OFF
        @victory_quote_type = nil
      when YEA::REGEXP::BASEITEM::LEVEL_QUOTE_ON
        @victory_quote_type = :level_quote
      when YEA::REGEXP::BASEITEM::LEVEL_QUOTE_OFF
        @victory_quote_type = nil
      when YEA::REGEXP::BASEITEM::DROPS_QUOTE_ON
        @victory_quote_type = :drops_quote
      when YEA::REGEXP::BASEITEM::DROPS_QUOTE_OFF
        @victory_quote_type = nil
      #---
      when YEA::REGEXP::BASEITEM::NEW_QUOTE
        case @victory_quote_type
        when nil; next
        when :win_quote;   @win_quotes.push("")
        when :level_quote; @level_quotes.push("")
        when :drops_quote; @drops_quotes.push("")
        end
      #---
      else
        case @victory_quote_type
        when nil; next
        when :win_quote;   @win_quotes[@win_quotes.size-1] += line.to_s
        when :level_quote; @level_quotes[@level_quotes.size-1] += line.to_s
        when :drops_quote; @drops_quotes[@drops_quotes.size-1] += line.to_s
        end
      end
    } # self.note.split
    #---
    return unless self.is_a?(RPG::Class)
    quotes = YEA::VICTORY_AFTERMATH::VICTORY_QUOTES
    @win_quotes = quotes[:win].clone if @win_quotes == [""]
    @level_quotes = quotes[:level].clone if @level_quotes == [""]
    @drops_quotes = quotes[:drops].clone if @drops_quotes == [""]
  end
 
end # RPG::BaseItem

class Game_Actor < Game_Battler
 
  #--------------------------------------------------------------------------
  # overwrite method: gain_exp
  #--------------------------------------------------------------------------
  def gain_exp(exp)
    enabled = !SceneManager.scene_is?(Scene_Battle)
    change_exp(self.exp + (exp * final_exp_rate).to_i, enabled)
  end
 
  #--------------------------------------------------------------------------
  # new method: victory_quotes
  #--------------------------------------------------------------------------
  def victory_quotes(type)
    case type
    when :win
      return self.actor.win_quotes if self.actor.win_quotes != [""]
      return self.class.win_quotes
    when :level
      return self.actor.level_quotes if self.actor.level_quotes != [""]
      return self.class.level_quotes
    when :drops
      return self.actor.drops_quotes if self.actor.drops_quotes != [""]
      return self.class.drops_quotes
    else
      return ["NOTEXT"]
    end
  end
 
end # Game_Actor

module BattleManager
  def self.set_victory_text(actor, type)
    text = "" + sprintf(YEA::VICTORY_AFTERMATH::HEADER_TEXT, actor.name)
    text += actor.victory_quotes(type)[rand(actor.victory_quotes(type).size)]
    text += YEA::VICTORY_AFTERMATH::FOOTER_TEXT
    $game_message.face_name = actor.face_name
    $game_message.face_index = actor.face_index
    $game_message.add(text)
    wait_for_message
  end
end

#==============================================================================
# ■ Battle Result
#==============================================================================
class Battle_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
    @window_treasure.hide
    @victory_layout_sprite.opacity = 0
    @exp_number.opacity = 0
    @gold_number.opacity = 0
    BattleManager.set_victory_text(@actor_result, :level)
    create_new_skill_window
  end
  def update_victory_levelup      
    check_level_up if Input.trigger?(:C)
    @drops = false
    update_show_levelup
    if @levelup_layout == nil
      @window_treasure.update
    else
      @window_treasure.contents_opacity -= 15
    end
  end
  def member_win_text
    @result_member_max = $game_party.battle_members.size
    memquote = rand(@result_member_max - 1)
    actor_result = $game_party.battle_members[memquote]  
    BattleManager.set_victory_text(actor_result, :win)
  end
  def create_victory_text
    return if @victory_sprite != nil
    @victory_sprite = Sprite.new
    @victory_sprite.z = 1000
    @victory_sprite.bitmap = Cache.system("Result")
    @victory_sprite.ox = @victory_sprite.width / 2
    @victory_sprite.oy = @victory_sprite.height / 2
    @victory_sprite.x = @victory_sprite.ox
    @victory_sprite.y = @victory_sprite.oy
    @victory_sprite.zoom_x = 1.5
    @victory_sprite.zoom_y = 1.5
    @victory_sprite.opacity = 0
    member_win_text
  end  
  def member_drop_text
    @result_member_max = $game_party.battle_members.size
    memquote = rand(@result_member_max - 1)
    actor_result = $game_party.battle_members[memquote]
    BattleManager.set_victory_text(actor_result, :drops)
  end
  def update_victory_item
    @window_treasure.update
    @actor_level = []
    return if @window_treasure.x != 0 and @victory_phase >= 6
    @victory_phase = 6
    if $data_system.opt_extra_exp
       @result_member_max = $game_party.members.size 
    else
       @result_member_max = $game_party.battle_members.size
    end
    @result_member_id = 0
    member_drop_text
  end
end
 
Last edited:

Shaz

Keeper of the Nuts
Global Mod
Joined
Mar 2, 2012
Messages
46,153
Reaction score
16,971
First Language
English
Primarily Uses
RMMV

@Kakis, please avoid double posting, as it is against the forum rules. You can use the "Edit" function on your posts to add additional information you've forgotten or respond to multiple people. You can review our forum rules here. Thank you.



Please do not post other people's scripts at all. Instead, just provide a link to the place you originally got them from. That will avoid your double (or in this case triple) posting, and you won't have to worry about adding codes to make sure the formatting doesn't get messed up or that characters don't get replaced due to forum shortcut codes.
 

Kakis

Regular
Regular
Joined
Dec 20, 2018
Messages
34
Reaction score
2
First Language
English
Primarily Uses
RMMV
[dpost]@Kakis[/dpost]

Please do not post other people's scripts at all. Instead, just provide a link to the place you originally got them from. That will avoid your double (or in this case triple) posting, and you won't have to worry about adding codes to make sure the formatting doesn't get messed up or that characters don't get replaced due to forum shortcut codes.
Apologies, feel free to remove the double post I did. I've edited my first post, so the other posts aren't necessary anymore. I did it because I don't post here often, so I'm not familiar with the interface and I was trying to add the scripts onto one post, but it was too big a post whenever I tried.

I mainly shared it, so that I could more directly get the help I was looking for. For Moghunter's VXACE scripts, they are combined into one, so I thought I'd share the one that I only wanted to look at. I'll change the links so it goes to the respected works of the creators.
 

Kakis

Regular
Regular
Joined
Dec 20, 2018
Messages
34
Reaction score
2
First Language
English
Primarily Uses
RMMV
You click on the spoiler button. Type in a name or text.
You click on the code button. You paste the code into the box that pops up. You click ok.


You showed images of the default scripts and an example from another game.
If what you showed is what you want then the job is done, those script do what you showed. But of course you have to choose which one.
Yet you said you want elements from each to be in the other, in essence combining them.
That needs more clarification.
1. Do you use yanfly's code and have the character busts show up on the experience screen (you didn't show the levelup window) or is there something missing from Yanfly's level up window that you want.

2. If you want to use MOG's victory data, you say you want to see the varied messages.
Is that to be on the experience screen or on the level up screen.

So have I explained it better to you?


Hence the second option I mentioned.

I may try to help, or someone else.
Thank you for detailing it further.

How does this work for you?

Using MOG battle results and this script
Place below MOG battle results.
Ruby:
module YEA
  module VICTORY_AFTERMATH
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - Victory Messages -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # In the Victory Aftermath, actors can say unique things. This is the pool
    # of quotes used for actors without any custom victory quotes. Note that
    # actors with custom quotes will take priority over classes with custom
    # quotes, which will take priority over these default quotes. Use \n for
    # a line break in the quotes.
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    HEADER_TEXT = "\e>\eC[6]%s\eC[0]\e<\n"  # Always at start of messages.
    FOOTER_TEXT = ""                        # Always at end of messages.
  
    # Win Quotes are what the actors say when a battle is won.
    VICTORY_QUOTES ={
    # :type   => Quotes
      #------------------------------------------------------------------------
      :win    => [ # Occurs as initial victory quote.
                   '"We won! What an exciting fight!"',
                   '"I didn\'t even break a sweat."',
                   '"That wasn\'t so tough."',
                   '"Let\'s fight something harder!"',
                 ],# Do not remove this.
      #------------------------------------------------------------------------
      :level  => [ # Occurs as initial victory quote.
                   '"Yes! Level up!"',
                   '"I\'ve gotten stronger!"',
                   '"Try to keep up with me!"',
                   '"I\'ve grown again!"',
                 ],# Do not remove this.
      #------------------------------------------------------------------------
      :drops  => [ # Occurs as initial victory quote.
                   '"I\'ll be taking these."',
                   '"To the victor goes the spoils."',
                   '"The enemies dropped something!"',
                   '"Hey, what\'s this?"',
                 ],# Do not remove this.
      #------------------------------------------------------------------------
    } # Do not remove this.
  
  end # VICTORY_AFTERMATH
end # YEA

module YEA
  module REGEXP
  module BASEITEM
  
    NEW_QUOTE = /\[(?:NEW_QUOTE|new quote)\]/i
  
    WIN_QUOTE_ON    = /<(?:WIN_QUOTES|win quote|win quotes)>/i
    WIN_QUOTE_OFF   = /<\/(?:WIN_QUOTES|win quote|win quotes)>/i
    LEVEL_QUOTE_ON  = /<(?:LEVEL_QUOTES|level quote|level quotes)>/i
    LEVEL_QUOTE_OFF = /<\/(?:LEVEL_QUOTES|level quote|level quotes)>/i
    DROPS_QUOTE_ON  = /<(?:DROPS_QUOTES|drops quote|drops quotes)>/i
    DROPS_QUOTE_OFF = /<\/(?:DROPS_QUOTES|drops quote|drops quotes)>/i
  
  end # BASEITEM
  end # REGEXP
end # YEA

module DataManager
 
  #--------------------------------------------------------------------------
  # alias method: load_database
  #--------------------------------------------------------------------------
  class <<self; alias load_database_va load_database; end
  def self.load_database
    load_database_va
    load_notetags_va
  end
 
  #--------------------------------------------------------------------------
  # new method: load_notetags_va
  #--------------------------------------------------------------------------
  def self.load_notetags_va
    groups = [$data_actors, $data_classes]
    for group in groups
      for obj in group
        next if obj.nil?
        obj.load_notetags_va
      end
    end
  end
 
end # DataManager

class RPG::BaseItem
 
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :win_quotes
  attr_accessor :level_quotes
  attr_accessor :drops_quotes
 
  #--------------------------------------------------------------------------
  # common cache: load_notetags_va
  #--------------------------------------------------------------------------
  def load_notetags_va
    @win_quotes = [""]
    @level_quotes = [""]
    @drops_quotes = [""]
    @victory_quote_type = nil
    #---
    self.note.split(/[\r\n]+/).each { |line|
      case line
      #---
      when YEA::REGEXP::BASEITEM::WIN_QUOTE_ON
        @victory_quote_type = :win_quote
      when YEA::REGEXP::BASEITEM::WIN_QUOTE_OFF
        @victory_quote_type = nil
      when YEA::REGEXP::BASEITEM::LEVEL_QUOTE_ON
        @victory_quote_type = :level_quote
      when YEA::REGEXP::BASEITEM::LEVEL_QUOTE_OFF
        @victory_quote_type = nil
      when YEA::REGEXP::BASEITEM::DROPS_QUOTE_ON
        @victory_quote_type = :drops_quote
      when YEA::REGEXP::BASEITEM::DROPS_QUOTE_OFF
        @victory_quote_type = nil
      #---
      when YEA::REGEXP::BASEITEM::NEW_QUOTE
        case @victory_quote_type
        when nil; next
        when :win_quote;   @win_quotes.push("")
        when :level_quote; @level_quotes.push("")
        when :drops_quote; @drops_quotes.push("")
        end
      #---
      else
        case @victory_quote_type
        when nil; next
        when :win_quote;   @win_quotes[@win_quotes.size-1] += line.to_s
        when :level_quote; @level_quotes[@level_quotes.size-1] += line.to_s
        when :drops_quote; @drops_quotes[@drops_quotes.size-1] += line.to_s
        end
      end
    } # self.note.split
    #---
    return unless self.is_a?(RPG::Class)
    quotes = YEA::VICTORY_AFTERMATH::VICTORY_QUOTES
    @win_quotes = quotes[:win].clone if @win_quotes == [""]
    @level_quotes = quotes[:level].clone if @level_quotes == [""]
    @drops_quotes = quotes[:drops].clone if @drops_quotes == [""]
  end
 
end # RPG::BaseItem

class Game_Actor < Game_Battler
 
  #--------------------------------------------------------------------------
  # overwrite method: gain_exp
  #--------------------------------------------------------------------------
  def gain_exp(exp)
    enabled = !SceneManager.scene_is?(Scene_Battle)
    change_exp(self.exp + (exp * final_exp_rate).to_i, enabled)
  end
 
  #--------------------------------------------------------------------------
  # new method: victory_quotes
  #--------------------------------------------------------------------------
  def victory_quotes(type)
    case type
    when :win
      return self.actor.win_quotes if self.actor.win_quotes != [""]
      return self.class.win_quotes
    when :level
      return self.actor.level_quotes if self.actor.level_quotes != [""]
      return self.class.level_quotes
    when :drops
      return self.actor.drops_quotes if self.actor.drops_quotes != [""]
      return self.class.drops_quotes
    else
      return ["NOTEXT"]
    end
  end
 
end # Game_Actor

module BattleManager
  def self.set_victory_text(actor, type)
    text = "" + sprintf(YEA::VICTORY_AFTERMATH::HEADER_TEXT, actor.name)
    text += actor.victory_quotes(type)[rand(actor.victory_quotes(type).size)]
    text += YEA::VICTORY_AFTERMATH::FOOTER_TEXT
    $game_message.face_name = actor.face_name
    $game_message.face_index = actor.face_index
    $game_message.add(text)
    wait_for_message
  end
end

#==============================================================================
# ■ Battle Result
#==============================================================================
class Battle_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
      BattleManager.set_victory_text(@actor_result, :level)
      create_new_skill_window
  end
  def member_win_text
    @result_member_max = $game_party.battle_members.size
    memquote = rand(@result_member_max - 1)
    actor_result = $game_party.battle_members[memquote]
    BattleManager.set_victory_text(actor_result, :win)
  end
  def create_victory_text
      return if @victory_sprite != nil
      @victory_sprite = Sprite.new
      @victory_sprite.z = 1000
      @victory_sprite.bitmap = Cache.system("Result")
      @victory_sprite.ox = @victory_sprite.width / 2
      @victory_sprite.oy = @victory_sprite.height / 2
      @victory_sprite.x = @victory_sprite.ox
      @victory_sprite.y = @victory_sprite.oy
      @victory_sprite.zoom_x = 1.5
      @victory_sprite.zoom_y = 1.5
      @victory_sprite.opacity = 0 
      member_win_text
  end
  def member_drop_text
    @result_member_max = $game_party.battle_members.size
    memquote = rand(@result_member_max - 1)
    actor_result = $game_party.battle_members[memquote]
    BattleManager.set_victory_text(actor_result, :drops)
  end
  def update_victory_item
      @window_treasure.update
      member_drop_text
      @actor_level = []
      return if @window_treasure.x != 0 and @victory_phase >= 6
      @victory_phase = 6
      if $data_system.opt_extra_exp
         @result_member_max = $game_party.members.size
      else
         @result_member_max = $game_party.battle_members.size
      end
      @result_member_id = 0
  end
end
Thank you for the explanation. I've edited my post to fix the issue, so that my other posts can be deleted. I will have a try at the changes you've given my project, thank you for your time in helping me.

So, I've had a try at the changes made. It does visualise what I wanted to achieve from it. Though I'm not sure what the exact cause is, for the 2nd image. It happens between item drops and when the character levels up. The same applies for other party members too, where the item drop image and the level up image overlaps. But in the final (3rd image), everything appears normal from what I've tried.
 
Last edited:

Roninator2

Gamer
Regular
Joined
May 22, 2016
Messages
5,242
Reaction score
1,571
First Language
English
Primarily Uses
RMVXA
It happens between item drops and when the character levels up
I did notice it before, but didn't pay any attention to it.
But your right, it's out of place.
I updated the code above.
 

Kakis

Regular
Regular
Joined
Dec 20, 2018
Messages
34
Reaction score
2
First Language
English
Primarily Uses
RMMV
I did notice it before, but didn't pay any attention to it.
But your right, it's out of place.
I updated the code above.
Thank you for the help! The images no longer overlap.
 

Latest Threads

Latest Profile Posts

Larvae.gif
They're larvae, not fightae, honest!
I've made a big emphasis on visually representing things to make the game as accessible as possible.

MP.png

Grimoires will consist of 5 - 10 pages of skills (still finalizing that max number)

Since each actor is able to take multiple actions per turn, each skill will cost 1-5 pages
This prevents more powerful skills from being uber spammed during an actors turn.
Cats are so easy. I noticed the gray one would never nap in the office while I worked, so I put a blanket on the spare chair in here and now she won't leave.
1701793108356.png
still work in progress, had not much time at the weekend^^
Oh deer! Have you checked my calendar today already? ;3
1701790624587.png

Forum statistics

Threads
136,773
Messages
1,269,734
Members
180,514
Latest member
Ikana
Top