Salve a tutti.
Come da titolo, avrei gentilmente bisogno di un'anima pia che mi dia una mano a sistemare alcuni script. La mia ignoranza colossale in fatto di RGSS-2(che provvederò a colmare non appena questi esami smetteranno di succhiarmi tutto il tempo) non mi permette di apportare alcune (ma indispensabili) modifiche ad un paio di script che uso.
Chiunque sia così gentile da darmi una mano....mi faccia un fischio e gli sarò grato per l'eternità! :D
Grazie mille in anticipo,
Lif
Toggle Chat
RM - Chat
|
E' severamente vietato richiedere supporto su RPG Maker in chat!
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Modificare alcuni script
Iniziato da
lifaen
, Feb 24 2011 01:03 PM
- Per cortesia connettiti per rispondere
4 risposte a questa discussione
#2 OFFLINE Melosx
Melosx
-
- RM-Dreamers
- 895 Messaggi:
Maker di rpgmkr.net
- LocalitàAvola
-
- Ruolo:
- Scripter
-
- Progetto Ace:
- Menu Chora
-
- Tool:
- RPG Maker VX/VX Ace
Inviato 24 February 2011 - 10:27 PM
Hai omesso di dire quali script ti serve da modificare e quale modifica ci vuole... Magari ti aiuto io se é una cosa semplice...






Targhette vinte nei contest
Spoiler
16° Screen Contest:
17° Screen Contest:
19° Screen Contest:
25° Screen Contest:
30° Screen Contest:
16° Screen Contest:

17° Screen Contest:

19° Screen Contest:

25° Screen Contest:

30° Screen Contest:

from skype with love
Spoiler
[20] Ally: si[20] Ally: più tardi apro il topic ^^
[20] Carmelo B.: spicciati fallo adesso interropmpi tutto quello che stai facendo e aprilo immediatamente..." questo è un ordine figliolo arriva dal presidente in persona" (cit. Cpt. Melo - Film "Quel topic che non arrivava") ...
[20] Ally:
[20] Ally: sarebbe da firma questa
FATTO 
[20] Ally: si[20] Ally: più tardi apro il topic ^^
[20] Carmelo B.: spicciati fallo adesso interropmpi tutto quello che stai facendo e aprilo immediatamente..." questo è un ordine figliolo arriva dal presidente in persona" (cit. Cpt. Melo - Film "Quel topic che non arrivava") ...
[20] Ally:
#3 OFFLINE lifaen
lifaen
-
- Utenti RM
- 123 Messaggi:
Maker Viandante
-
- Progetto XP:
- Mimesis
-
- Progetto VX:
- Mimesis
Inviato 25 February 2011 - 12:10 AM
Già...volevo prima vedere se c'era qualcuno di interessato. Il lavoro è, più o meno il seguente:
ho bisogno di implemetare uno script per l'apprendimento delle abilità (apprendi abilità tramite AP) in modo tale da poter assegare a delle armi la proprietà di fornire APx2\APx3 o AP=1. Poi, siccome uso uno script per il battle result modificato, ho bisogno di fare in modo che i punti AP vengano effettivamente assegnati (perchè, ora come ora, non me li assegna). Inoltre avrei bisogno di togliere la finestra con il nome del nemico e i suoi HP in alto e creare una skill "Scan" che permetta, usandola, di vedere tutta quella roba più debolezze\resistenze. Per finire ho bisogno di bloccare il comando per accedere alla gestione delle abilità fino a quando non si sblocca una switch ad un punto del gioco.
Chi volsse eventualmente darmi una mano, mi mandi pure un MP e vedrò di farmi capire meglio, mandando anche i relativi script.
Spero di essere riuscito a spiegarmi U.U
Lif
ho bisogno di implemetare uno script per l'apprendimento delle abilità (apprendi abilità tramite AP) in modo tale da poter assegare a delle armi la proprietà di fornire APx2\APx3 o AP=1. Poi, siccome uso uno script per il battle result modificato, ho bisogno di fare in modo che i punti AP vengano effettivamente assegnati (perchè, ora come ora, non me li assegna). Inoltre avrei bisogno di togliere la finestra con il nome del nemico e i suoi HP in alto e creare una skill "Scan" che permetta, usandola, di vedere tutta quella roba più debolezze\resistenze. Per finire ho bisogno di bloccare il comando per accedere alla gestione delle abilità fino a quando non si sblocca una switch ad un punto del gioco.
Chi volsse eventualmente darmi una mano, mi mandi pure un MP e vedrò di farmi capire meglio, mandando anche i relativi script.
Spero di essere riuscito a spiegarmi U.U
Lif
#4 OFFLINE Ally
Ally
-
- Amministratori
-
- 5558 Messaggi:
Fondatori
- Localitàrpgmkr
-
- Ruolo:
- Scripter
-
- Progetto VX:
- Essence
-
- Tool:
- RM2k/2k3
Inviato 25 February 2011 - 01:08 AM
Dovremmo andare per gradi, se no si fa una confusione immane.
Postaci gli script, così oltre a noi, potrebbe darti una mano qualcun'altro (spero di riprendere il mio pc domani, così ritorno attivo).
Postaci gli script, così oltre a noi, potrebbe darti una mano qualcun'altro (spero di riprendere il mio pc domani, così ritorno attivo).
Spoiler
Figlio Illegittimo n°001 della:


#5 OFFLINE lifaen
lifaen
-
- Utenti RM
- 123 Messaggi:
Maker Viandante
-
- Progetto XP:
- Mimesis
-
- Progetto VX:
- Mimesis
Inviato 25 February 2011 - 04:49 PM
Ok allora...iniziamo dal principio. Cercherò di essere il più chiaro possibile.
Avviso già da ora che lo script per la gestione delle abilità (la materia di FF VII vi ricorda nulla?) è enorme...quindi posterò un allegato con lo script dentro.
Ora, detto questo, iniziamo.
1-Avrei gentilmente bisogno di inserire un nuovo comando, sotto "Overdrive" chiamato "Materia". Questi due comandi dovrebbero essere "bloccati", inselezionabili. Vorrei che si attivassero poi in seguito, con il procedere della storia, tramite due switch dedicate apposta. (Per esempio: if switch90=ON --> Overdrive=enable).
Questo che c'è di seguito è lo script del menù che, per intenderci, è quello presente nella demo del Takentai + Overdrive.
2-Il nuovo comando "Materia" dovrebbe richiamare il relativo script. Selezionandolo, si accede alla scelta del personaggio e poi, scelto il pg, alla schermata di gestione delle abilità.
Ora, il mio secondo problema è il seguente, ovvero che io, come finestra del battle_result, non uso quella standard ma ne uso una modificata, ovvero questa:
3-Il terzo punto è più un'aggiunta che altro. Semplicemente, parlando di materia, volevo aggiungere allo script allegato (quindi quello della materia) la possibilità di assegare a delle armi (magari gestibile direttamente dallo script) alcune caratteristiche come APx2 o AP=1. Cioè, se la "spada-pesce" ha come proprietà bonus APx2, se uccido un nemico con quella spada che normalmente mi frutterebbe 3 Ap, ne otterrò 6 (claro no?! XD).
Le varie proprietà bonus delle armi dovrebbero essere visibili nella schermata di equip della materia!
4-Ultima richiesta. Sarebbe bello eliminare la tendina nel combattimento che ti fa vedere HP e nome del nemico. Questo pechè orrei poter creare una skill "scan" che faccia apparire la suddetta "tendina" solo se usata! Altrimenti...con i boss che senso ha?
Ecco....spero di essere stato chiaro.
In ultimo vi allego la demo con lo script enorme....così è più comodo.
Grazie, ma davvero grazie di cuore, a chiunque possa darmi una mano!
Allegato:
Avviso già da ora che lo script per la gestione delle abilità (la materia di FF VII vi ricorda nulla?) è enorme...quindi posterò un allegato con lo script dentro.
Ora, detto questo, iniziamo.
1-Avrei gentilmente bisogno di inserire un nuovo comando, sotto "Overdrive" chiamato "Materia". Questi due comandi dovrebbero essere "bloccati", inselezionabili. Vorrei che si attivassero poi in seguito, con il procedere della storia, tramite due switch dedicate apposta. (Per esempio: if switch90=ON --> Overdrive=enable).
Questo che c'è di seguito è lo script del menù che, per intenderci, è quello presente nella demo del Takentai + Overdrive.
Spoiler
#===============================================================================
#CrimsonSeas Customized Menu Command
#For use with CrimsonSeas Overdrive
#by CrimsonSeas
#===============================================================================
#Just an example showing how this is done, most of you are probably using custom
#menu commands already so this is only as an example on how to add new menu
#command.
class Scene_Menu
def create_command_window
s1 = Vocab::item
s2 = Vocab::skill
s3 = Vocab::equip
s4 = Vocab::status
s5 = "Overdrive"
s6 = Vocab::save
s7 = Vocab::game_end
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
@command_window.index = @menu_index
if $game_party.members.size == 0 # If number of party members is 0
@command_window.draw_item(0, false) # Disable item
@command_window.draw_item(1, false) # Disable skill
@command_window.draw_item(2, false) # Disable equipment
@command_window.draw_item(3, false) # Disable status
end
if $game_system.save_disabled # If save is forbidden
@command_window.draw_item(4, false) # Disable save
end
end
#--------------------------------------------------------------------------
# * Update Command Selection
#--------------------------------------------------------------------------
def update_command_selection
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
if $game_party.members.size == 0 and @command_window.index < 4
Sound.play_buzzer
return
elsif $game_system.save_disabled and @command_window.index == 4
Sound.play_buzzer
return
end
Sound.play_decision
case @command_window.index
when 0 # Item
$scene = Scene_Item.new
when 1,2,3,4 # Skill, equipment, status
start_actor_selection
when 5 # Save
$scene = Scene_File.new(true, false, false)
when 6 # End Game
$scene = Scene_End.new
end
end
end
alias crmsn_update_actor_selection update_actor_selection
def update_actor_selection
crmsn_update_actor_selection
if Input.trigger?(Input::C) && @command_window.index == 4
Sound.play_decision
$scene = Scene_Overdrive.new(@status_window.index)
end
end
end
class Scene_File
def return_scene
if @from_title
$scene = Scene_Title.new
elsif @from_event
$scene = Scene_Map.new
else
$scene = Scene_Menu.new(5)
end
end
end
class Scene_End
def return_scene
$scene = Scene_Menu.new(6)
end
end
#CrimsonSeas Customized Menu Command
#For use with CrimsonSeas Overdrive
#by CrimsonSeas
#===============================================================================
#Just an example showing how this is done, most of you are probably using custom
#menu commands already so this is only as an example on how to add new menu
#command.
class Scene_Menu
def create_command_window
s1 = Vocab::item
s2 = Vocab::skill
s3 = Vocab::equip
s4 = Vocab::status
s5 = "Overdrive"
s6 = Vocab::save
s7 = Vocab::game_end
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
@command_window.index = @menu_index
if $game_party.members.size == 0 # If number of party members is 0
@command_window.draw_item(0, false) # Disable item
@command_window.draw_item(1, false) # Disable skill
@command_window.draw_item(2, false) # Disable equipment
@command_window.draw_item(3, false) # Disable status
end
if $game_system.save_disabled # If save is forbidden
@command_window.draw_item(4, false) # Disable save
end
end
#--------------------------------------------------------------------------
# * Update Command Selection
#--------------------------------------------------------------------------
def update_command_selection
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
if $game_party.members.size == 0 and @command_window.index < 4
Sound.play_buzzer
return
elsif $game_system.save_disabled and @command_window.index == 4
Sound.play_buzzer
return
end
Sound.play_decision
case @command_window.index
when 0 # Item
$scene = Scene_Item.new
when 1,2,3,4 # Skill, equipment, status
start_actor_selection
when 5 # Save
$scene = Scene_File.new(true, false, false)
when 6 # End Game
$scene = Scene_End.new
end
end
end
alias crmsn_update_actor_selection update_actor_selection
def update_actor_selection
crmsn_update_actor_selection
if Input.trigger?(Input::C) && @command_window.index == 4
Sound.play_decision
$scene = Scene_Overdrive.new(@status_window.index)
end
end
end
class Scene_File
def return_scene
if @from_title
$scene = Scene_Title.new
elsif @from_event
$scene = Scene_Map.new
else
$scene = Scene_Menu.new(5)
end
end
end
class Scene_End
def return_scene
$scene = Scene_Menu.new(6)
end
end
2-Il nuovo comando "Materia" dovrebbe richiamare il relativo script. Selezionandolo, si accede alla scelta del personaggio e poi, scelto il pg, alla schermata di gestione delle abilità.
Ora, il mio secondo problema è il seguente, ovvero che io, come finestra del battle_result, non uso quella standard ma ne uso una modificata, ovvero questa:
Spoiler
Il problema sorge quando, alla fine della battaglia dovrei ricevere gli AP utili per far salire le skill di livello; infatti non ottengo nessun AP! Quindi mi chiedevo se fosse possibile far apparire una finestrella con la quantità di AP ottenuti (e che, effettivamente, questi vengano ottenuti!).#===============================================================================
#
# Yanfly Engine Melody - Victory Aftermath
# Last Date Updated: 2010.05.28
# Level: Normal, Hard, Lunatic
#
# The victory aftermath scene after battles are finished hardly display any
# data at all for the player. All that's generally mentioned is how much EXP
# they've acquired, who levels up, and what items are dropped in only a message
# box window. Now, the whole process is more visual and will contain lists to
# show the player what changes have been made as far as the victory portion is
# concerned. The item drop list will also no longer go on and on forever with
# the message windows, but instead, show them properly in a list window.
#
#===============================================================================
# Updates
# -----------------------------------------------------------------------------
# o 2010.05.28 - Double EXP "gain" bugfix.
# o 2010.05.22 - Compatibility Update with Custom Message Melody.
# o 2010.05.20 - Converted to Yanfly Engine Melody.
#===============================================================================
# Instructions
# -----------------------------------------------------------------------------
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ▼ Materials but above ▼ Main. Remember to save.
#===============================================================================
$imported = {} if $imported == nil
$imported["VictoryAftermath"] = true
module YEM
module VICTORY
#===========================================================================
# Section I. General Settings
# --------------------------------------------------------------------------
# The following below will adjust the basic settings and vocabulary that
# will display throughout the script. These settings will also determine
# which windows you would like to have appear. Change them as you see fit.
#===========================================================================
# This is how many frames to wait before displaying the victory aftermath
# scene on the screen.
WAIT = 60
# The following adjusts the two switches that are associated with this
# script so bind them accordingly. Bypassing the BGM will cause no BGM
# change from battle start to end. Skip victory switch will cause the
# victory display portion to be ignored (but gaining EXP and such will
# still occur).
BYPASS_BGM_SWITCH = 61
SKIP_VICTORY_SWITCH = 62
# This hash adjusts the vocabulary used throughout the script.
VOCAB ={
:top_message => "Battle Results",
:gold_found => "Found %s Gold",
:exp_receive => "Earned %s EXP",
:percent_exp => "%1.2f%%",
:next_level => "To Level %s",
:max_level => "Max Level",
:next_exp => "%s EXP",
:level_up => "LEVEL UP!",
:to_level => "to Level %s",
:level_msg => "%s has reached level %s!",
:next_stat => "→",
:new_skills => "Skills Acquired",
:spoils => "Victory Spoils",
:no_items => "No items were found.",
:found_items => "%s has found items!",
:item_amount => "×%2d",
} # Do not remove this.
# This determines the gauge information for the victory screens.
FACE_OPACITY = 200 # This adjusts the opacity of the actor's faces
EXP_TICKS = 10 # This is how many ticks it takes to fill the gauge.
EXP_GAUGE_1 = 28 # Experience gauge colour 1 for non-leveled characters.
EXP_GAUGE_2 = 29 # Experience gauge colour 2 for non-leveled characters.
EXP_FONT_SIZE = 18 # Font size used for experience gauge.
LVL_COLOUR = 6 # Text colour used for leveling up.
LVL_GAUGE_1 = 20 # Experience gauge colour 1 for leveled characters.
LVL_GAUGE_2 = 21 # Experience gauge colour 2 for leveled characters.
# These constants determine which series of windows will appear. By default
# all of the windows will show up. The EXP windows will appear if there
# are no drop items present.
SHOW_EXP_WINDOWS = true
SHOW_LEVEL_WINDOWS = true
SHOW_ITEM_WINDOWS = true
#===========================================================================
# Section II. Experience Settings
# --------------------------------------------------------------------------
# The following below allows you to adjust the amount of experience each
# actor will earn and the rules that govern the experience gained.
#===========================================================================
# If any allies are dead, are they allowed to gain EXP?
DEAD_ALLY_EXP = false
# Do you want the game to scale the experience based on how many actors are
# in the party? This means actors can earn more or less.
PARTY_SPLIT_EXP = false
PARTY_SIZE_SCALING ={
1 => 1.000, # If one actor is active.
2 => 0.500, # If two actors are active.
3 => 0.334, # If three actors are active.
4 => 0.250, # If four actors are active.
5 => 0.200, # If five actors are active.
6 => 0.167, # If six actors are active.
7 => 0.143, # If seven actors are active.
8 => 0.125, # If eight actors are active.
} # Do not remove this.
#===========================================================================
# Section III. Level Settings
# --------------------------------------------------------------------------
# The following below allows you to adjust the amount of experience each
# actor will earn and the rules that govern the experience gained.
#===========================================================================
# The following array determines which stats will be shown with level up
# increases and also what order. Only the following can be used.
# :maxhp, :maxmp, :atk, :def, :spi, :res, :dex, :agi
SHOWN_STATS = [:maxhp, :maxmp, :atk, :def, :spi, :res, :dex, :agi]
# The following hash adjusts the colours used to display each of the
# various objects inside of the level window.
LEVEL_COLOURS ={
:stat_name => 4, # The stat's name.
:arrow => 4, # Arrow in between the old and new stats.
:old_stat => 5, # The older unleveled stat.
:new_stat => 6, # The newer leveled stat.
} # Do not remove this.
# Changing the following value to an icon ID will change the → arrow to use
# an icon instead. i.e. ARROW_ICON = 142
ARROW_ICON = nil
# Changing the following below will show the change in stat difference from
# the old stat to the new stat rather than just showing the new stat.
SHOW_DIFFERENCE = false
# The following will determine how HP and MP recovery is calculated upon
# leveling up. 0 - no change. 1 - difference from max. 2 - full recovery.
HP_RECOVERY = 1 # Adjusts HP Recovery Style
MP_RECOVERY = 1 # Adjusts MP Recovery Style
#===========================================================================
# Section IV. Audio Settings
# --------------------------------------------------------------------------
# This part of the module adjusts everything that's audio related. Be sure
# to modify them accordingly.
#===========================================================================
# This victory BGM will play once the fanfare finishes.
BGM = RPG::BGM.new("Field1", 100, 100)
# This sound adjusts the ticking noise that occurs as the experience bar
# goes upward. Adjust it accordingly.
TICK_SOUND = RPG::SE.new("Decision1", 80, 100)
# The following adjusts how long to play the Victory ME after finishing
# battle in milliseconds (if it is still continuing).
FANFARE_FADE = 1000
# This is the level up sound that plays when an actor levels up.
LEVEL_SOUND = RPG::SE.new("Flash1", 100, 100)
# This is the sound that will play if items were found.
ITEM_SOUND = RPG::SE.new("Item1", 80, 100)
end # VICTORY
end # YEM
#===============================================================================
# Lunatic Mode - Victory Aftermath
# -----------------------------------------------------------------------------
# This mode allows you to add in a bit more of a personal touch to your game by
# adding in victory battle quotes. If they're on, actors who were participating
# in battle can brief the victory spoils and whatnot.
#
# To use this mode, bind each actor to a common event ID. Those common events
# will play out the messages written for them. However, to distinguish when to
# display each message, use conditional branches with a script value check.
# Insert the following into your script value checks:
#
# victory_quote("Main") Occurs at the first page of victory.
# victory_quote("Level") Occurs when leveling up your character.
# victory_quote("Skill") Occurs when leveling up and learning a skill.
# victory_quote("Nothing") Occurs when no drops are found.
# victory_quote("Drops") Occurs if the enemy has left drops.
#
# When displaying the message events, a few new text shortcuts should be taken
# note of. They are the two following:
#
# \VN This displays the talking actor's name.
# \VF This displays the talking actor's face.
#
# Anything else in the common event will run normally.
#===============================================================================
module YEM::VICTORY
# If this is enabled, victory quotes will occur instead of the typical
# battle end messages.
ENABLE_QUOTES = true
# The following hash determines which common event ID's are bound to which
# actors when their victory quotes are to be launched.
ACTOR_QUOTES ={ # Actor 0 is the actor used for unlisted actors.
# ActorID => Common Event ID
0 => 20, # Common Victory Quotes
1 => 21, # Ralph's Victory Quotes
2 => 22, # Ulrika's Victory Quotes
3 => 23, # Bennett's Victory Quotes
4 => 24, # Ylva's Victory Quotes
5 => 25, # Lawrence's Victory Quotes
6 => 26, # Oscar's Victory Quotes
7 => 27, # Vera's Victory Quotes
8 => 28, # Elmer's Victory Quotes
} # Do not remove this.
end # YEM::VICTORY
#===============================================================================
# Editting anything past this point may potentially result in causing computer
# damage, incontinence, explosion of user's head, coma, death, and/or halitosis.
# Therefore, edit at your own risk.
#===============================================================================
#===============================================================================
# module Icon
#===============================================================================
if !$imported["BattleEngineMelody"] and !$imported["IconModuleLibrary"]
module Icon
#--------------------------------------------------------------------------
# self.stat
#--------------------------------------------------------------------------
def self.stat(actor, item); return 0; end
end # Icon
end # !$imported["BattleEngineMelody"] and !$imported["IconModuleLibrary"]
#===============================================================================
# Game_Temp
#===============================================================================
class Game_Temp
#--------------------------------------------------------------------------
# public instance variables
#--------------------------------------------------------------------------
attr_accessor :victory_actor
attr_accessor :victory_quote
attr_accessor :victory_clone
end # Game_Temp
#===============================================================================
# Game_Actor
#===============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# new method: learned_skills
#--------------------------------------------------------------------------
def learned_skills
result = []
for i in @skills
result.push($data_skills[i])
end
return result
end
#--------------------------------------------------------------------------
# new method: now_exp
#--------------------------------------------------------------------------
def now_exp
return @exp - @exp_list[@level]
end
#--------------------------------------------------------------------------
# new method: next_exp
#--------------------------------------------------------------------------
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end # Game_Actor
#==============================================================================
# Game_Interpreter
#==============================================================================
class Game_Interpreter
#--------------------------------------------------------------------------
# victory_quote
#--------------------------------------------------------------------------
def victory_quote(text)
return false unless $game_temp.in_battle and $scene.is_a?(Scene_Battle)
return false if $game_temp.victory_quote == nil
return true if text.upcase == $game_temp.victory_quote
return false
end
end # Game_Interpreter
#===============================================================================
# Window_Message
#===============================================================================
class Window_Message < Window_Selectable
#--------------------------------------------------------------------------
# alias method: convert_special_characters
#--------------------------------------------------------------------------
unless $imported["CustomMessageMelody"]
alias convert_special_characters_va convert_special_characters unless $@
def convert_special_characters
@text.gsub!(/\\VF/i) { victory_face_art }
@text.gsub!(/\\VN/i) { victory_actor_name }
convert_special_characters_va
end
end # $imported["CustomMessageMelody"]
#--------------------------------------------------------------------------
# new method: victory_actor_name
#--------------------------------------------------------------------------
def victory_actor_name
return "" unless $scene.is_a?(Scene_Battle)
return $scene.victory_actor.name
end
#--------------------------------------------------------------------------
# new method: victory_face_art
#--------------------------------------------------------------------------
def victory_face_art
return "" unless $scene.is_a?(Scene_Battle)
$game_message.face_name = $scene.victory_actor.face_name
$game_message.face_index = $scene.victory_actor.face_index
return ""
end
end # Window_Message
#===============================================================================
# Window_Party_Exp_Back
#===============================================================================
class Window_Party_Exp_Back < Window_Base
#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize
super(0, 112, 544, 176)
refresh
end
#--------------------------------------------------------------------------
# refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
sw = self.width - 32
dy = 0
dx = (sw/2) - $game_party.members.size*60
for actor in $game_party.members
opacity = YEM::VICTORY::FACE_OPACITY
draw_party_face(actor, dx+12, dy, opacity)
self.contents.draw_text(dx+12, dy, 96, WLH, actor.name, 1)
dx += 120
end
end
#--------------------------------------------------------------------------
# Draw Party Face
#--------------------------------------------------------------------------
def draw_party_face(actor, x, y, opacity = 255, size = 96)
face_name = actor.face_name
face_index = actor.face_index
bitmap = Cache.face(face_name)
rect = Rect.new(0, 0, 0, 0)
rect.x = face_index % 4 * 96 + (96 - size) / 2
rect.y = face_index / 4 * 96 + (96 - size) / 2
rect.width = size
rect.height = size
self.contents.blt(x, y, bitmap, rect, opacity)
bitmap.dispose
end
end # Window_Party_Exp_Back
#===============================================================================
# Window_Party_Exp_Front
#===============================================================================
class Window_Party_Exp_Front < Window_Base
#--------------------------------------------------------------------------
# public instance variables
#--------------------------------------------------------------------------
attr_accessor :full_actors
#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize
super(0, 112, 544, 176)
self.opacity = 0
@extra_per = 0
@increase = 100 / YEM::VICTORY::EXP_TICKS
refresh
end
#--------------------------------------------------------------------------
# refresh
#--------------------------------------------------------------------------
def refresh(extra_per = 0)
@full = true if extra_per >= 100
self.contents.clear
@full_actors = 0
sw = self.width - 32
dy = WLH*4
dx = (sw/2) - $game_party.members.size*60
for actor in $game_party.members
self.contents.font.color = normal_color
self.contents.font.size = Font.default_size
draw_exp_gauge(actor, dx, dy, extra_per)
draw_exp_text(actor, dx, dy+WLH, extra_per)
dx += 120
end
end
#--------------------------------------------------------------------------
# draw_exp_gauge
#--------------------------------------------------------------------------
def draw_exp_gauge(actor, dx, dy, extra_per)
self.contents.font.size = YEM::VICTORY::EXP_FONT_SIZE
gc1 = text_color(YEM::VICTORY::EXP_GAUGE_1)
gc2 = text_color(YEM::VICTORY::EXP_GAUGE_2)
if actor.level > $game_temp.victory_clone[actor.id].level
gc1 = text_color(YEM::VICTORY::LVL_GAUGE_1)
gc2 = text_color(YEM::VICTORY::LVL_GAUGE_2)
gw = 96
self.contents.font.color = text_color(YEM::VICTORY::LVL_COLOUR)
text = YEM::VICTORY::VOCAB[:level_up]
elsif actor.next_exp != 0
gw = 96 * (actor.now_exp + exp_gained(extra_per, actor))
gw /= actor.next_exp
gw = [[gw, 96].min, 0].max
text = sprintf(YEM::VICTORY::VOCAB[:next_level], actor.level + 1)
if gw == 96
self.contents.font.color = text_color(YEM::VICTORY::LVL_COLOUR)
gc1 = text_color(YEM::VICTORY::LVL_GAUGE_1)
gc2 = text_color(YEM::VICTORY::LVL_GAUGE_2)
text = YEM::VICTORY::VOCAB[:level_up]
end
else
gw = 96
text = YEM::VICTORY::VOCAB[:max_level]
end
if $imported["CoreFixesUpgradesMelody"] and YEM::UPGRADE::OUTLINE
self.contents.fill_rect(dx + 12, dy - 8, 96, 8, gauge_back_color)
self.contents.gradient_fill_rect(dx + 13, dy - 7, gw-2, 6, gc1, gc2)
else
self.contents.fill_rect(dx + 12, dy - 6, 96, 6, gauge_back_color)
self.contents.gradient_fill_rect(dx + 12, dy - 6, gw, 6, gc1, gc2)
end
self.contents.draw_text(dx, dy, 120, WLH, text, 1)
self.contents.font.color = normal_color
end
#--------------------------------------------------------------------------
# draw_exp_text
#--------------------------------------------------------------------------
def draw_exp_text(actor, dx, dy, extra_per)
if actor.level > $game_temp.victory_clone[actor.id].level
exp_percent = 100.0
text1 = sprintf(YEM::VICTORY::VOCAB[:percent_exp], exp_percent)
text2 = sprintf(YEM::VICTORY::VOCAB[:to_level], actor.level)
elsif actor.next_exp != 0
exp_percent = (actor.now_exp + exp_gained(extra_per, actor)) * 100.0
exp_percent /= actor.next_exp
exp_percent = [[exp_percent, 100.0].min, 0].max
@full_actors += 1 if exp_percent >= 100.0
value = [actor.next_rest_exp_s - exp_gained(extra_per, actor), 0].max
text1 = sprintf(YEM::VICTORY::VOCAB[:percent_exp], exp_percent)
text2 = sprintf(YEM::VICTORY::VOCAB[:next_exp], value)
else
exp_percent = 100.0
@full_actors += 1
text1 = sprintf(YEM::VICTORY::VOCAB[:percent_exp], exp_percent)
text2 = ""
end
self.contents.draw_text(dx, dy - WLH * 2, 120, WLH, text1, 1)
self.contents.draw_text(dx, dy, 120, WLH, text2, 1)
end
#--------------------------------------------------------------------------
# exp_gained
#--------------------------------------------------------------------------
def exp_gained(extra_per, actor)
return 0 if actor.dead?
extra_per = 100 if extra_per > 100
exp = $game_troop.exp_total
members = $game_party.members.size
if YEM::VICTORY::PARTY_SPLIT_EXP
size = YEM::VICTORY::DEAD_ALLY_EXP ?
$game_party.members.size : $game_party.existing_members.size
exp = Integer(exp * YEM::VICTORY::PARTY_SIZE_SCALING[size])
end
exp *= 2 if actor.double_exp_gain
exp *= extra_per
exp /= 100
return exp
end
end # Window_Party_Exp_Front
#===============================================================================
# Window_New_Skills
#===============================================================================
class Window_New_Skills < Window_Selectable
#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize(new_skills)
@new_skills = new_skills
super(316, 80, 228, 208)
self.index = -1
self.opacity = 0
refresh
end
#--------------------------------------------------------------------------
# skill
#--------------------------------------------------------------------------
def skill; return @data[self.index]; end
#--------------------------------------------------------------------------
# refresh
#--------------------------------------------------------------------------
def refresh
@data = []
for skill in @new_skills
@data.push(skill)
end
@item_max = @data.size
create_contents
for i in 0..(@item_max-1)
draw_item(i)
end
end
#--------------------------------------------------------------------------
# draw_item
#--------------------------------------------------------------------------
def draw_item(index)
rect = item_rect(index)
self.contents.clear_rect(rect)
skill = @data[index]
return if skill == nil
draw_item_name(skill, rect.x, rect.y)
end
#--------------------------------------------------------------------------
# update_help
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(skill == nil ? "" : skill.description)
end
end # Window_New_Skills
#===============================================================================
# Window_BattleDrops
#===============================================================================
class Window_BattleDrops < Window_Selectable
#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize(drop_items)
super(0, 56, 544, 232)
@drop_items = drop_items
@column_max = 2
self.index = -1
refresh
end
#--------------------------------------------------------------------------
# item
#--------------------------------------------------------------------------
def item; return @data[self.index]; end
#--------------------------------------------------------------------------
# refrehs
#--------------------------------------------------------------------------
def refresh
@items = {}; @weapons = {}; @armours = {}; @goods = {}; @data = []
for item in @drop_items
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
@item_max = @data.size
create_contents
for i in 0..(@item_max-1); draw_item(i); end
end
#--------------------------------------------------------------------------
# draw_item
#--------------------------------------------------------------------------
def draw_item(index)
rect = item_rect(index)
self.contents.clear_rect(rect)
item = @data[index]
return if item == nil
number = @goods[item]
rect.width -= 4
self.contents.font.size = Font.default_size
self.contents.font.color = normal_color
draw_item_name(item, rect.x, rect.y)
if $imported["BattleEngineMelody"]
text = YEM::BATTLE_ENGINE::ITEM_SETTINGS[:text]
self.contents.font.size = YEM::BATTLE_ENGINE::ITEM_SETTINGS[:size]
colour = YEM::BATTLE_ENGINE::ITEM_SETTINGS[:colour]
self.contents.font.color = text_color(colour)
self.contents.draw_text(rect, sprintf(text, number), 2)
else
text = YEM::VICTORY::VOCAB[:item_amount]
self.contents.draw_text(rect, sprintf(text, number), 2)
end
end
#--------------------------------------------------------------------------
# update_help
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(item == nil ? "" : item.description)
end
end # Window_BattleDrops
#===============================================================================
# Window_Level_Up
#===============================================================================
class Window_Level_Up < Window_Base
#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize(actor, dx, dy, dw, dh)
super(dx, dy, dw, dh)
@actor = actor
@clone = $game_temp.victory_clone[actor.id]
refresh
end
#--------------------------------------------------------------------------
# refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
sw = self.width - 32
dy = 0; dx = sw/2 - 210/2
draw_stats(dx, dy)
end
#--------------------------------------------------------------------------
# draw_stats
#--------------------------------------------------------------------------
def draw_stats(dx, dy)
arrow = YEM::VICTORY::VOCAB[:next_stat]
colours = YEM::VICTORY::LEVEL_COLOURS
@actor.clear_battle_cache if $imported["BattleEngineMelody"]
for stat in YEM::VICTORY::SHOWN_STATS
case stat
when :maxhp
text = Vocab.hp
value1 = @clone.maxhp
value2 = @actor.maxhp
when :maxmp
text = Vocab.mp
value1 = @clone.maxmp
value2 = @actor.maxmp
when :atk
text = Vocab.atk
value1 = @clone.atk
value2 = @actor.atk
when :def
text = Vocab.def
value1 = @clone.def
value2 = @actor.def
when :spi
text = Vocab.spi
value1 = @clone.spi
value2 = @actor.spi
when :agi
text = Vocab.agi
value1 = @clone.agi
value2 = @actor.agi
when :dex
next unless $imported["DEX Stat"]
text = Vocab.dex
value1 = @clone.dex
value2 = @actor.dex
when :res
next unless $imported["RES Stat"]
text = Vocab.res
value1 = @clone.res
value2 = @actor.res
else; next
end
icon = Icon.stat(@actor, stat)
icon = 0 if icon == nil
value2 = sprintf("%+d", value2 - value1) if YEM::VICTORY::SHOW_DIFFERENCE
draw_icon(icon, dx, dy)
self.contents.font.color = text_color(colours[:stat_name])
self.contents.draw_text(dx+24, dy, 60, WLH, text, 0)
self.contents.font.color = text_color(colours[:old_stat])
self.contents.draw_text(dx+84, dy, 60, WLH, value1, 2)
if YEM::VICTORY::ARROW_ICON.is_a?(Integer)
draw_icon(YEM::VICTORY::ARROW_ICON, dx+147, dy)
else
self.contents.font.color = text_color(colours[:arrow])
self.contents.draw_text(dx+144, dy, 30, WLH, arrow, 1)
end
self.contents.font.color = text_color(colours[:new_stat])
self.contents.draw_text(dx+174, dy, 60, WLH, value2, 0)
dy += WLH
end
end
end # Window_Level_Up
#===============================================================================
# Scene Map
#===============================================================================
class Scene_Map < Scene_Base
#--------------------------------------------------------------------------
# alias method: call battle
#--------------------------------------------------------------------------
alias call_battle_va call_battle unless $@
def call_battle
if $game_switches[YEM]
@spriteset.update
Graphics.update
$game_player.make_encounter_count
$game_player.straighten
$game_temp.map_bgm = RPG::BGM.last
$game_temp.map_bgs = RPG::BGS.last
Sound.play_battle_start
$game_temp.next_scene = nil
$scene = Scene_Battle.new
else
call_battle_va
end
end
end # Scene Map
#===============================================================================
# Scene_Battle
#===============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# alias method: terminate
#--------------------------------------------------------------------------
alias terminate_va terminate unless $@
def terminate
@top_window.dispose if @top_window != nil
@exp_window.dispose if @exp_window != nil
@gold_window.dispose if @gold_window != nil
@exp_back_window.dispose if @exp_back_window != nil
@exp_front_window.dispose if @exp_front_window != nil
@drops_window.dispose if @drops_window != nil
terminate_va
end
#--------------------------------------------------------------------------
# overwrite method: process_victory
#--------------------------------------------------------------------------
def process_victory
if $imported["BattleEngineMelody"]
@judge_win_loss = true
pause_atb(true, true)
@enemy_gauge_window.dispose if @enemy_gauge_window != nil
@hide_battlecursor = true
@party_input_flag = true
end
wait_for_deaths if $imported["FancyDeaths"]
unless $game_switches[YEM]
RPG::BGM.stop
$game_system.battle_end_me.play
YEM::VICTORY::BGM.play unless YEM::VICTORY::BGM == nil
end
if $imported["BattleEngineMelody"]
start_victory_poses
@spriteset.update_dtb_order
@spriteset.update_ctb_order
end
wait(YEM::VICTORY::WAIT, true)
@info_viewport.visible = false
if $imported["BattleEngineMelody"]
@message_window.dispose
@message_window = Window_BattleMessage.new
elsif $imported["VictoryCompatibility"]
@message_window.dispose
@message_window = Window_BattleMessageCompatible.new
end
@message_window.visible = true
create_victory_clones
create_victory_actor
display_exp_and_gold
display_level_up
display_drop_items
battle_end(0)
$game_temp.victory_actor = nil
$game_temp.victory_clone = nil
victory_me = Thread.new {
time = YEM::VICTORY::FANFARE_FADE
RPG::ME.fade(time)
sleep(time / 1000.0)
RPG::ME.stop }
battle_end(0)
end
#--------------------------------------------------------------------------
# overwrite method: display_exp_and_gold
#--------------------------------------------------------------------------
def display_exp_and_gold
unless $game_switches[YEM]
show_exp_and_gold
else
@exp = $game_troop.exp_total
if YEM::VICTORY::PARTY_SPLIT_EXP
size = YEM::VICTORY::DEAD_ALLY_EXP ?
$game_party.members.size : $game_party.existing_members.size
@exp = Integer(@exp * YEM::VICTORY::PARTY_SIZE_SCALING[size])
end
$game_party.gain_gold($game_troop.gold_total)
end
end
#--------------------------------------------------------------------------
# overwrite method: display_level_up
#--------------------------------------------------------------------------
def display_level_up
unless $game_switches[YEM]
show_level_up
else
group = YEM::VICTORY::DEAD_ALLY_EXP ?
$game_party.members : $game_party.existing_members
for actor in group
last_level = actor.level
last_skills = actor.learned_skills.clone
actor.gain_exp(@exp, false)
end
end
end
#--------------------------------------------------------------------------
# overwrite method: display_drop_items
#--------------------------------------------------------------------------
def display_drop_items
@active_battler = nil
unless $game_switches[YEM]
show_drop_items
else
drop_items = $game_troop.make_drop_items
for item in drop_items; $game_party.gain_item(item, 1); end
end
end
#--------------------------------------------------------------------------
# new method: create_victory_clones
#--------------------------------------------------------------------------
def create_victory_clones
$game_temp.victory_clone = {}
$game_temp.in_battle = false
for actor in $game_party.members
$game_temp.victory_clone[actor.id] = actor.clone
end
$game_temp.in_battle = true
end
#--------------------------------------------------------------------------
# new method: create_victory_actor
#--------------------------------------------------------------------------
def create_victory_actor
$game_temp.victory_actor = nil
@original_victory_actor = victory_actor
end
#--------------------------------------------------------------------------
# new method: victory_actor
#--------------------------------------------------------------------------
def victory_actor
if $game_temp.victory_actor == nil
roulette = []
for actor in $game_party.existing_members; roulette.push(actor); end
$game_temp.victory_actor = roulette.size > 0 ?
roulette[rand(roulette.size)] : nil
end
return $game_temp.victory_actor
end
#--------------------------------------------------------------------------
# new method: victory_actor_quote
#--------------------------------------------------------------------------
def victory_actor_quote(value)
$game_temp.victory_quote = value
if YEM::VICTORY::ACTOR_QUOTES.include?(victory_actor.id)
$game_temp.common_event_id = YEM::VICTORY::ACTOR_QUOTES[victory_actor.id]
else
$game_temp.common_event_id = YEM::VICTORY::ACTOR_QUOTES[0]
end
@message_window.visible = true
process_victory_event
end
#--------------------------------------------------------------------------
# new method: process_victory_event
#--------------------------------------------------------------------------
def process_victory_event
loop do
$game_troop.interpreter.update
$game_troop.setup_battle_event
wait_for_message
return unless $game_troop.interpreter.running?
update_basic
end
end
#--------------------------------------------------------------------------
# new method: show_exp_and_gold
#--------------------------------------------------------------------------
def show_exp_and_gold
#--- Draw Victory Message
@top_window = Window_Help.new
text = YEM::VICTORY::VOCAB[:top_message]
@top_window.set_text(text, 1)
#--- Draw EXP Window
@exp = $game_troop.exp_total
if YEM::VICTORY::PARTY_SPLIT_EXP
size = YEM::VICTORY::DEAD_ALLY_EXP ?
$game_party.members.size : $game_party.existing_members.size
@exp = Integer(@exp * YEM::VICTORY::PARTY_SIZE_SCALING[size])
end
@exp_window = Window_Base.new(272, 56, 272, 56)
text = sprintf(YEM::VICTORY::VOCAB[:exp_receive], @exp)
@exp_window.contents.draw_text(0, 0, 240, 24, text, 1)
#--- Draw Gold Window
@gold = $game_troop.gold_total
$game_party.gain_gold(@gold)
@gold_window = Window_Base.new(0, 56, 272, 56)
text = sprintf(YEM::VICTORY::VOCAB[:gold_found], @gold)
@gold_window.contents.draw_text(0, 0, 240, 24, text, 1)
#--- Draw Party EXP Windows
@exp_back_window = Window_Party_Exp_Back.new
@exp_front_window = Window_Party_Exp_Front.new
if $imported["BattleEngineMelody"]
@top_window.viewport = @spriteset.viewportC
@exp_window.viewport = @spriteset.viewportC
@gold_window.viewport = @spriteset.viewportC
@exp_back_window.viewport = @spriteset.viewportC
@exp_front_window.viewport = @spriteset.viewportC
end
if !YEM::VICTORY::SHOW_EXP_WINDOWS
@top_window.visible = false
@exp_window.visible = false
@gold_window.visible = false
@exp_back_window.visible = false
@exp_front_window.refresh(100)
@exp_front_window.visible = false
return
end
fill_exp_gauge
#--- Battle Quotes
if YEM::VICTORY::ENABLE_QUOTES
victory_actor_quote("MAIN")
else
text = sprintf(Vocab::Victory, $game_party.name)
$game_message.texts.push(text)
wait_for_message
end
end
#--------------------------------------------------------------------------
# new method: fill_exp_gauge
#--------------------------------------------------------------------------
def fill_exp_gauge
ticks = 0
percent = 0
increase = 100 / YEM::VICTORY::EXP_TICKS
until ticks > YEM::VICTORY::EXP_TICKS
ticks += 1
percent += increase
@exp_front_window.refresh(percent)
if @exp_front_window.full_actors != $game_party.existing_members.size
YEM::VICTORY::TICK_SOUND.play if YEM::VICTORY::TICK_SOUND != nil
end
update_basic
end
end
#--------------------------------------------------------------------------
# new method: show_level_up
#--------------------------------------------------------------------------
def show_level_up
return unless YEM::VICTORY::SHOW_LEVEL_WINDOWS
@top_window.visible = true
@exp_window.visible = false
@gold_window.visible = false
@exp_back_window.visible = false
@exp_front_window.visible = false
group = YEM::VICTORY::DEAD_ALLY_EXP ?
$game_party.members : $game_party.existing_members
for actor in group
last_level = actor.level
last_skills = actor.learned_skills.clone
actor.gain_exp(@exp, false)
create_level_up_windows(actor, last_skills) if actor.level > last_level
end
wait_for_message
end
#--------------------------------------------------------------------------
# new method: create_level_up_windows
#--------------------------------------------------------------------------
def create_level_up_windows(actor, last_skills)
@active_battler = actor
#--- Basic Settings
YEM::VICTORY::LEVEL_SOUND.play if YEM::VICTORY::LEVEL_SOUND != nil
$game_temp.victory_actor = actor
new_skills = actor.learned_skills - last_skills
@top_window.contents.clear
text = sprintf(YEM::VICTORY::VOCAB[:level_msg], actor.name, actor.level)
@top_window.set_text(text, 1)
#--- HP and MP Recovery
case YEM::VICTORY::HP_RECOVERY
when 1; actor.hp += actor.maxhp - $game_temp.victory_clone[actor.id].maxhp
when 2; actor.hp = actor.maxhp
end
case YEM::VICTORY::MP_RECOVERY
when 1; actor.mp += actor.maxmp - $game_temp.victory_clone[actor.id].maxmp
when 2; actor.mp = actor.maxmp
end
#--- Create Windows
if new_skills != []
@levelup_window = Window_Level_Up.new(actor, 0, 56, 316, 232)
@skill_back_window = Window_Base.new(316, 56, 228, 232)
@skill_back_window.contents.font.color = @skill_back_window.system_color
text = YEM::VICTORY::VOCAB[:new_skills]
@skill_back_window.contents.draw_text(0, 0, 196, 24, text, 1)
@skill_list_window = Window_New_Skills.new(new_skills)
else
@levelup_window = Window_Level_Up.new(actor, 0, 56, 544, 232)
end
if $imported["BattleEngineMelody"]
@levelup_window.viewport = @spriteset.viewportC
if @skill_back_window != nil
@skill_back_window.viewport = @spriteset.viewportC
@skill_list_window.viewport = @spriteset.viewportC
end
end
if YEM::VICTORY::ENABLE_QUOTES
value = (last_skills != actor.learned_skills) ? "SKILL" : "LEVEL"
victory_actor_quote(value)
else
text = sprintf(Vocab::LevelUp, actor.name, Vocab::level, actor.level)
$game_message.new_page
$game_message.texts.push(text)
if new_skills != []
for skill in new_skills
text = sprintf(Vocab::ObtainSkill, skill.name)
$game_message.texts.push(text)
end
end
wait_for_message
end
#--- Skill Window Scrolling
if new_skills.size > 7
@skill_list_window.index = 0
@skill_list_window.active = true
@skill_list_window.help_window = @top_window
loop do
update_basic
@skill_list_window.update
if Input.trigger?(Input::C)
Sound.play_decision; break
elsif Input.trigger?(Input::B)
Sound.play_cancel; break
elsif Input.press?(Input::A)
break
end
end
end
#--- Disposal of Windows
@levelup_window.dispose if @levelup_window != nil
@levelup_window = nil
@skill_back_window.dispose if @skill_back_window != nil
@skill_back_window = nil
@skill_list_window.dispose if @skill_list_window != nil
@skill_list_window = nil
end
#--------------------------------------------------------------------------
# new method: show_drop_items
#--------------------------------------------------------------------------
def show_drop_items
@drop_items = $game_troop.make_drop_items
for item in @drop_items; $game_party.gain_item(item, 1); end
return unless YEM::VICTORY::SHOW_ITEM_WINDOWS
@top_window.visible = true
if @drop_items != []
@top_window.set_text(YEM::VICTORY::VOCAB[:spoils],1)
YEM::VICTORY::ITEM_SOUND.play if YEM::VICTORY::ITEM_SOUND != nil
@drops_window = Window_BattleDrops.new(@drop_items)
if $imported["BattleEngineMelody"]
@drops_window.viewport = @spriteset.viewportC
end
else
@top_window.set_text(YEM::VICTORY::VOCAB[:no_items],1)
@exp_window.visible = true
@gold_window.visible = true
@exp_back_window.visible = true
@exp_front_window.visible = true
end
if YEM::VICTORY::ENABLE_QUOTES
$game_temp.victory_actor = @original_victory_actor
value = (@drop_items == []) ? "NOTHING" : "DROPS"
victory_actor_quote(value)
else
if @drop_items == []
text = YEM::VICTORY::VOCAB[:no_items]
else
text = sprintf(YEM::VICTORY::VOCAB[:found_items], $game_party.name)
end
$game_message.texts.push(text)
wait_for_message
end
if @drop_items != [] and @drops_window.item_max > 16
@drops_window.index = 0
@drops_window.active = true
@drops_window.help_window = @top_window
loop do
update_basic
@drops_window.update
if Input.trigger?(Input::C)
Sound.play_decision; break
elsif Input.trigger?(Input::B)
Sound.play_cancel; break
elsif Input.press?(Input::A)
break
end
end
end
end
end # Scene_Battle
#===============================================================================
#
# END OF FILE
#
#===============================================================================
#
# Yanfly Engine Melody - Victory Aftermath
# Last Date Updated: 2010.05.28
# Level: Normal, Hard, Lunatic
#
# The victory aftermath scene after battles are finished hardly display any
# data at all for the player. All that's generally mentioned is how much EXP
# they've acquired, who levels up, and what items are dropped in only a message
# box window. Now, the whole process is more visual and will contain lists to
# show the player what changes have been made as far as the victory portion is
# concerned. The item drop list will also no longer go on and on forever with
# the message windows, but instead, show them properly in a list window.
#
#===============================================================================
# Updates
# -----------------------------------------------------------------------------
# o 2010.05.28 - Double EXP "gain" bugfix.
# o 2010.05.22 - Compatibility Update with Custom Message Melody.
# o 2010.05.20 - Converted to Yanfly Engine Melody.
#===============================================================================
# Instructions
# -----------------------------------------------------------------------------
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ▼ Materials but above ▼ Main. Remember to save.
#===============================================================================
$imported = {} if $imported == nil
$imported["VictoryAftermath"] = true
module YEM
module VICTORY
#===========================================================================
# Section I. General Settings
# --------------------------------------------------------------------------
# The following below will adjust the basic settings and vocabulary that
# will display throughout the script. These settings will also determine
# which windows you would like to have appear. Change them as you see fit.
#===========================================================================
# This is how many frames to wait before displaying the victory aftermath
# scene on the screen.
WAIT = 60
# The following adjusts the two switches that are associated with this
# script so bind them accordingly. Bypassing the BGM will cause no BGM
# change from battle start to end. Skip victory switch will cause the
# victory display portion to be ignored (but gaining EXP and such will
# still occur).
BYPASS_BGM_SWITCH = 61
SKIP_VICTORY_SWITCH = 62
# This hash adjusts the vocabulary used throughout the script.
VOCAB ={
:top_message => "Battle Results",
:gold_found => "Found %s Gold",
:exp_receive => "Earned %s EXP",
:percent_exp => "%1.2f%%",
:next_level => "To Level %s",
:max_level => "Max Level",
:next_exp => "%s EXP",
:level_up => "LEVEL UP!",
:to_level => "to Level %s",
:level_msg => "%s has reached level %s!",
:next_stat => "→",
:new_skills => "Skills Acquired",
:spoils => "Victory Spoils",
:no_items => "No items were found.",
:found_items => "%s has found items!",
:item_amount => "×%2d",
} # Do not remove this.
# This determines the gauge information for the victory screens.
FACE_OPACITY = 200 # This adjusts the opacity of the actor's faces
EXP_TICKS = 10 # This is how many ticks it takes to fill the gauge.
EXP_GAUGE_1 = 28 # Experience gauge colour 1 for non-leveled characters.
EXP_GAUGE_2 = 29 # Experience gauge colour 2 for non-leveled characters.
EXP_FONT_SIZE = 18 # Font size used for experience gauge.
LVL_COLOUR = 6 # Text colour used for leveling up.
LVL_GAUGE_1 = 20 # Experience gauge colour 1 for leveled characters.
LVL_GAUGE_2 = 21 # Experience gauge colour 2 for leveled characters.
# These constants determine which series of windows will appear. By default
# all of the windows will show up. The EXP windows will appear if there
# are no drop items present.
SHOW_EXP_WINDOWS = true
SHOW_LEVEL_WINDOWS = true
SHOW_ITEM_WINDOWS = true
#===========================================================================
# Section II. Experience Settings
# --------------------------------------------------------------------------
# The following below allows you to adjust the amount of experience each
# actor will earn and the rules that govern the experience gained.
#===========================================================================
# If any allies are dead, are they allowed to gain EXP?
DEAD_ALLY_EXP = false
# Do you want the game to scale the experience based on how many actors are
# in the party? This means actors can earn more or less.
PARTY_SPLIT_EXP = false
PARTY_SIZE_SCALING ={
1 => 1.000, # If one actor is active.
2 => 0.500, # If two actors are active.
3 => 0.334, # If three actors are active.
4 => 0.250, # If four actors are active.
5 => 0.200, # If five actors are active.
6 => 0.167, # If six actors are active.
7 => 0.143, # If seven actors are active.
8 => 0.125, # If eight actors are active.
} # Do not remove this.
#===========================================================================
# Section III. Level Settings
# --------------------------------------------------------------------------
# The following below allows you to adjust the amount of experience each
# actor will earn and the rules that govern the experience gained.
#===========================================================================
# The following array determines which stats will be shown with level up
# increases and also what order. Only the following can be used.
# :maxhp, :maxmp, :atk, :def, :spi, :res, :dex, :agi
SHOWN_STATS = [:maxhp, :maxmp, :atk, :def, :spi, :res, :dex, :agi]
# The following hash adjusts the colours used to display each of the
# various objects inside of the level window.
LEVEL_COLOURS ={
:stat_name => 4, # The stat's name.
:arrow => 4, # Arrow in between the old and new stats.
:old_stat => 5, # The older unleveled stat.
:new_stat => 6, # The newer leveled stat.
} # Do not remove this.
# Changing the following value to an icon ID will change the → arrow to use
# an icon instead. i.e. ARROW_ICON = 142
ARROW_ICON = nil
# Changing the following below will show the change in stat difference from
# the old stat to the new stat rather than just showing the new stat.
SHOW_DIFFERENCE = false
# The following will determine how HP and MP recovery is calculated upon
# leveling up. 0 - no change. 1 - difference from max. 2 - full recovery.
HP_RECOVERY = 1 # Adjusts HP Recovery Style
MP_RECOVERY = 1 # Adjusts MP Recovery Style
#===========================================================================
# Section IV. Audio Settings
# --------------------------------------------------------------------------
# This part of the module adjusts everything that's audio related. Be sure
# to modify them accordingly.
#===========================================================================
# This victory BGM will play once the fanfare finishes.
BGM = RPG::BGM.new("Field1", 100, 100)
# This sound adjusts the ticking noise that occurs as the experience bar
# goes upward. Adjust it accordingly.
TICK_SOUND = RPG::SE.new("Decision1", 80, 100)
# The following adjusts how long to play the Victory ME after finishing
# battle in milliseconds (if it is still continuing).
FANFARE_FADE = 1000
# This is the level up sound that plays when an actor levels up.
LEVEL_SOUND = RPG::SE.new("Flash1", 100, 100)
# This is the sound that will play if items were found.
ITEM_SOUND = RPG::SE.new("Item1", 80, 100)
end # VICTORY
end # YEM
#===============================================================================
# Lunatic Mode - Victory Aftermath
# -----------------------------------------------------------------------------
# This mode allows you to add in a bit more of a personal touch to your game by
# adding in victory battle quotes. If they're on, actors who were participating
# in battle can brief the victory spoils and whatnot.
#
# To use this mode, bind each actor to a common event ID. Those common events
# will play out the messages written for them. However, to distinguish when to
# display each message, use conditional branches with a script value check.
# Insert the following into your script value checks:
#
# victory_quote("Main") Occurs at the first page of victory.
# victory_quote("Level") Occurs when leveling up your character.
# victory_quote("Skill") Occurs when leveling up and learning a skill.
# victory_quote("Nothing") Occurs when no drops are found.
# victory_quote("Drops") Occurs if the enemy has left drops.
#
# When displaying the message events, a few new text shortcuts should be taken
# note of. They are the two following:
#
# \VN This displays the talking actor's name.
# \VF This displays the talking actor's face.
#
# Anything else in the common event will run normally.
#===============================================================================
module YEM::VICTORY
# If this is enabled, victory quotes will occur instead of the typical
# battle end messages.
ENABLE_QUOTES = true
# The following hash determines which common event ID's are bound to which
# actors when their victory quotes are to be launched.
ACTOR_QUOTES ={ # Actor 0 is the actor used for unlisted actors.
# ActorID => Common Event ID
0 => 20, # Common Victory Quotes
1 => 21, # Ralph's Victory Quotes
2 => 22, # Ulrika's Victory Quotes
3 => 23, # Bennett's Victory Quotes
4 => 24, # Ylva's Victory Quotes
5 => 25, # Lawrence's Victory Quotes
6 => 26, # Oscar's Victory Quotes
7 => 27, # Vera's Victory Quotes
8 => 28, # Elmer's Victory Quotes
} # Do not remove this.
end # YEM::VICTORY
#===============================================================================
# Editting anything past this point may potentially result in causing computer
# damage, incontinence, explosion of user's head, coma, death, and/or halitosis.
# Therefore, edit at your own risk.
#===============================================================================
#===============================================================================
# module Icon
#===============================================================================
if !$imported["BattleEngineMelody"] and !$imported["IconModuleLibrary"]
module Icon
#--------------------------------------------------------------------------
# self.stat
#--------------------------------------------------------------------------
def self.stat(actor, item); return 0; end
end # Icon
end # !$imported["BattleEngineMelody"] and !$imported["IconModuleLibrary"]
#===============================================================================
# Game_Temp
#===============================================================================
class Game_Temp
#--------------------------------------------------------------------------
# public instance variables
#--------------------------------------------------------------------------
attr_accessor :victory_actor
attr_accessor :victory_quote
attr_accessor :victory_clone
end # Game_Temp
#===============================================================================
# Game_Actor
#===============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# new method: learned_skills
#--------------------------------------------------------------------------
def learned_skills
result = []
for i in @skills
result.push($data_skills[i])
end
return result
end
#--------------------------------------------------------------------------
# new method: now_exp
#--------------------------------------------------------------------------
def now_exp
return @exp - @exp_list[@level]
end
#--------------------------------------------------------------------------
# new method: next_exp
#--------------------------------------------------------------------------
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end # Game_Actor
#==============================================================================
# Game_Interpreter
#==============================================================================
class Game_Interpreter
#--------------------------------------------------------------------------
# victory_quote
#--------------------------------------------------------------------------
def victory_quote(text)
return false unless $game_temp.in_battle and $scene.is_a?(Scene_Battle)
return false if $game_temp.victory_quote == nil
return true if text.upcase == $game_temp.victory_quote
return false
end
end # Game_Interpreter
#===============================================================================
# Window_Message
#===============================================================================
class Window_Message < Window_Selectable
#--------------------------------------------------------------------------
# alias method: convert_special_characters
#--------------------------------------------------------------------------
unless $imported["CustomMessageMelody"]
alias convert_special_characters_va convert_special_characters unless $@
def convert_special_characters
@text.gsub!(/\\VF/i) { victory_face_art }
@text.gsub!(/\\VN/i) { victory_actor_name }
convert_special_characters_va
end
end # $imported["CustomMessageMelody"]
#--------------------------------------------------------------------------
# new method: victory_actor_name
#--------------------------------------------------------------------------
def victory_actor_name
return "" unless $scene.is_a?(Scene_Battle)
return $scene.victory_actor.name
end
#--------------------------------------------------------------------------
# new method: victory_face_art
#--------------------------------------------------------------------------
def victory_face_art
return "" unless $scene.is_a?(Scene_Battle)
$game_message.face_name = $scene.victory_actor.face_name
$game_message.face_index = $scene.victory_actor.face_index
return ""
end
end # Window_Message
#===============================================================================
# Window_Party_Exp_Back
#===============================================================================
class Window_Party_Exp_Back < Window_Base
#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize
super(0, 112, 544, 176)
refresh
end
#--------------------------------------------------------------------------
# refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
sw = self.width - 32
dy = 0
dx = (sw/2) - $game_party.members.size*60
for actor in $game_party.members
opacity = YEM::VICTORY::FACE_OPACITY
draw_party_face(actor, dx+12, dy, opacity)
self.contents.draw_text(dx+12, dy, 96, WLH, actor.name, 1)
dx += 120
end
end
#--------------------------------------------------------------------------
# Draw Party Face
#--------------------------------------------------------------------------
def draw_party_face(actor, x, y, opacity = 255, size = 96)
face_name = actor.face_name
face_index = actor.face_index
bitmap = Cache.face(face_name)
rect = Rect.new(0, 0, 0, 0)
rect.x = face_index % 4 * 96 + (96 - size) / 2
rect.y = face_index / 4 * 96 + (96 - size) / 2
rect.width = size
rect.height = size
self.contents.blt(x, y, bitmap, rect, opacity)
bitmap.dispose
end
end # Window_Party_Exp_Back
#===============================================================================
# Window_Party_Exp_Front
#===============================================================================
class Window_Party_Exp_Front < Window_Base
#--------------------------------------------------------------------------
# public instance variables
#--------------------------------------------------------------------------
attr_accessor :full_actors
#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize
super(0, 112, 544, 176)
self.opacity = 0
@extra_per = 0
@increase = 100 / YEM::VICTORY::EXP_TICKS
refresh
end
#--------------------------------------------------------------------------
# refresh
#--------------------------------------------------------------------------
def refresh(extra_per = 0)
@full = true if extra_per >= 100
self.contents.clear
@full_actors = 0
sw = self.width - 32
dy = WLH*4
dx = (sw/2) - $game_party.members.size*60
for actor in $game_party.members
self.contents.font.color = normal_color
self.contents.font.size = Font.default_size
draw_exp_gauge(actor, dx, dy, extra_per)
draw_exp_text(actor, dx, dy+WLH, extra_per)
dx += 120
end
end
#--------------------------------------------------------------------------
# draw_exp_gauge
#--------------------------------------------------------------------------
def draw_exp_gauge(actor, dx, dy, extra_per)
self.contents.font.size = YEM::VICTORY::EXP_FONT_SIZE
gc1 = text_color(YEM::VICTORY::EXP_GAUGE_1)
gc2 = text_color(YEM::VICTORY::EXP_GAUGE_2)
if actor.level > $game_temp.victory_clone[actor.id].level
gc1 = text_color(YEM::VICTORY::LVL_GAUGE_1)
gc2 = text_color(YEM::VICTORY::LVL_GAUGE_2)
gw = 96
self.contents.font.color = text_color(YEM::VICTORY::LVL_COLOUR)
text = YEM::VICTORY::VOCAB[:level_up]
elsif actor.next_exp != 0
gw = 96 * (actor.now_exp + exp_gained(extra_per, actor))
gw /= actor.next_exp
gw = [[gw, 96].min, 0].max
text = sprintf(YEM::VICTORY::VOCAB[:next_level], actor.level + 1)
if gw == 96
self.contents.font.color = text_color(YEM::VICTORY::LVL_COLOUR)
gc1 = text_color(YEM::VICTORY::LVL_GAUGE_1)
gc2 = text_color(YEM::VICTORY::LVL_GAUGE_2)
text = YEM::VICTORY::VOCAB[:level_up]
end
else
gw = 96
text = YEM::VICTORY::VOCAB[:max_level]
end
if $imported["CoreFixesUpgradesMelody"] and YEM::UPGRADE::OUTLINE
self.contents.fill_rect(dx + 12, dy - 8, 96, 8, gauge_back_color)
self.contents.gradient_fill_rect(dx + 13, dy - 7, gw-2, 6, gc1, gc2)
else
self.contents.fill_rect(dx + 12, dy - 6, 96, 6, gauge_back_color)
self.contents.gradient_fill_rect(dx + 12, dy - 6, gw, 6, gc1, gc2)
end
self.contents.draw_text(dx, dy, 120, WLH, text, 1)
self.contents.font.color = normal_color
end
#--------------------------------------------------------------------------
# draw_exp_text
#--------------------------------------------------------------------------
def draw_exp_text(actor, dx, dy, extra_per)
if actor.level > $game_temp.victory_clone[actor.id].level
exp_percent = 100.0
text1 = sprintf(YEM::VICTORY::VOCAB[:percent_exp], exp_percent)
text2 = sprintf(YEM::VICTORY::VOCAB[:to_level], actor.level)
elsif actor.next_exp != 0
exp_percent = (actor.now_exp + exp_gained(extra_per, actor)) * 100.0
exp_percent /= actor.next_exp
exp_percent = [[exp_percent, 100.0].min, 0].max
@full_actors += 1 if exp_percent >= 100.0
value = [actor.next_rest_exp_s - exp_gained(extra_per, actor), 0].max
text1 = sprintf(YEM::VICTORY::VOCAB[:percent_exp], exp_percent)
text2 = sprintf(YEM::VICTORY::VOCAB[:next_exp], value)
else
exp_percent = 100.0
@full_actors += 1
text1 = sprintf(YEM::VICTORY::VOCAB[:percent_exp], exp_percent)
text2 = ""
end
self.contents.draw_text(dx, dy - WLH * 2, 120, WLH, text1, 1)
self.contents.draw_text(dx, dy, 120, WLH, text2, 1)
end
#--------------------------------------------------------------------------
# exp_gained
#--------------------------------------------------------------------------
def exp_gained(extra_per, actor)
return 0 if actor.dead?
extra_per = 100 if extra_per > 100
exp = $game_troop.exp_total
members = $game_party.members.size
if YEM::VICTORY::PARTY_SPLIT_EXP
size = YEM::VICTORY::DEAD_ALLY_EXP ?
$game_party.members.size : $game_party.existing_members.size
exp = Integer(exp * YEM::VICTORY::PARTY_SIZE_SCALING[size])
end
exp *= 2 if actor.double_exp_gain
exp *= extra_per
exp /= 100
return exp
end
end # Window_Party_Exp_Front
#===============================================================================
# Window_New_Skills
#===============================================================================
class Window_New_Skills < Window_Selectable
#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize(new_skills)
@new_skills = new_skills
super(316, 80, 228, 208)
self.index = -1
self.opacity = 0
refresh
end
#--------------------------------------------------------------------------
# skill
#--------------------------------------------------------------------------
def skill; return @data[self.index]; end
#--------------------------------------------------------------------------
# refresh
#--------------------------------------------------------------------------
def refresh
@data = []
for skill in @new_skills
@data.push(skill)
end
@item_max = @data.size
create_contents
for i in 0..(@item_max-1)
draw_item(i)
end
end
#--------------------------------------------------------------------------
# draw_item
#--------------------------------------------------------------------------
def draw_item(index)
rect = item_rect(index)
self.contents.clear_rect(rect)
skill = @data[index]
return if skill == nil
draw_item_name(skill, rect.x, rect.y)
end
#--------------------------------------------------------------------------
# update_help
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(skill == nil ? "" : skill.description)
end
end # Window_New_Skills
#===============================================================================
# Window_BattleDrops
#===============================================================================
class Window_BattleDrops < Window_Selectable
#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize(drop_items)
super(0, 56, 544, 232)
@drop_items = drop_items
@column_max = 2
self.index = -1
refresh
end
#--------------------------------------------------------------------------
# item
#--------------------------------------------------------------------------
def item; return @data[self.index]; end
#--------------------------------------------------------------------------
# refrehs
#--------------------------------------------------------------------------
def refresh
@items = {}; @weapons = {}; @armours = {}; @goods = {}; @data = []
for item in @drop_items
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
@item_max = @data.size
create_contents
for i in 0..(@item_max-1); draw_item(i); end
end
#--------------------------------------------------------------------------
# draw_item
#--------------------------------------------------------------------------
def draw_item(index)
rect = item_rect(index)
self.contents.clear_rect(rect)
item = @data[index]
return if item == nil
number = @goods[item]
rect.width -= 4
self.contents.font.size = Font.default_size
self.contents.font.color = normal_color
draw_item_name(item, rect.x, rect.y)
if $imported["BattleEngineMelody"]
text = YEM::BATTLE_ENGINE::ITEM_SETTINGS[:text]
self.contents.font.size = YEM::BATTLE_ENGINE::ITEM_SETTINGS[:size]
colour = YEM::BATTLE_ENGINE::ITEM_SETTINGS[:colour]
self.contents.font.color = text_color(colour)
self.contents.draw_text(rect, sprintf(text, number), 2)
else
text = YEM::VICTORY::VOCAB[:item_amount]
self.contents.draw_text(rect, sprintf(text, number), 2)
end
end
#--------------------------------------------------------------------------
# update_help
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(item == nil ? "" : item.description)
end
end # Window_BattleDrops
#===============================================================================
# Window_Level_Up
#===============================================================================
class Window_Level_Up < Window_Base
#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize(actor, dx, dy, dw, dh)
super(dx, dy, dw, dh)
@actor = actor
@clone = $game_temp.victory_clone[actor.id]
refresh
end
#--------------------------------------------------------------------------
# refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
sw = self.width - 32
dy = 0; dx = sw/2 - 210/2
draw_stats(dx, dy)
end
#--------------------------------------------------------------------------
# draw_stats
#--------------------------------------------------------------------------
def draw_stats(dx, dy)
arrow = YEM::VICTORY::VOCAB[:next_stat]
colours = YEM::VICTORY::LEVEL_COLOURS
@actor.clear_battle_cache if $imported["BattleEngineMelody"]
for stat in YEM::VICTORY::SHOWN_STATS
case stat
when :maxhp
text = Vocab.hp
value1 = @clone.maxhp
value2 = @actor.maxhp
when :maxmp
text = Vocab.mp
value1 = @clone.maxmp
value2 = @actor.maxmp
when :atk
text = Vocab.atk
value1 = @clone.atk
value2 = @actor.atk
when :def
text = Vocab.def
value1 = @clone.def
value2 = @actor.def
when :spi
text = Vocab.spi
value1 = @clone.spi
value2 = @actor.spi
when :agi
text = Vocab.agi
value1 = @clone.agi
value2 = @actor.agi
when :dex
next unless $imported["DEX Stat"]
text = Vocab.dex
value1 = @clone.dex
value2 = @actor.dex
when :res
next unless $imported["RES Stat"]
text = Vocab.res
value1 = @clone.res
value2 = @actor.res
else; next
end
icon = Icon.stat(@actor, stat)
icon = 0 if icon == nil
value2 = sprintf("%+d", value2 - value1) if YEM::VICTORY::SHOW_DIFFERENCE
draw_icon(icon, dx, dy)
self.contents.font.color = text_color(colours[:stat_name])
self.contents.draw_text(dx+24, dy, 60, WLH, text, 0)
self.contents.font.color = text_color(colours[:old_stat])
self.contents.draw_text(dx+84, dy, 60, WLH, value1, 2)
if YEM::VICTORY::ARROW_ICON.is_a?(Integer)
draw_icon(YEM::VICTORY::ARROW_ICON, dx+147, dy)
else
self.contents.font.color = text_color(colours[:arrow])
self.contents.draw_text(dx+144, dy, 30, WLH, arrow, 1)
end
self.contents.font.color = text_color(colours[:new_stat])
self.contents.draw_text(dx+174, dy, 60, WLH, value2, 0)
dy += WLH
end
end
end # Window_Level_Up
#===============================================================================
# Scene Map
#===============================================================================
class Scene_Map < Scene_Base
#--------------------------------------------------------------------------
# alias method: call battle
#--------------------------------------------------------------------------
alias call_battle_va call_battle unless $@
def call_battle
if $game_switches[YEM]
@spriteset.update
Graphics.update
$game_player.make_encounter_count
$game_player.straighten
$game_temp.map_bgm = RPG::BGM.last
$game_temp.map_bgs = RPG::BGS.last
Sound.play_battle_start
$game_temp.next_scene = nil
$scene = Scene_Battle.new
else
call_battle_va
end
end
end # Scene Map
#===============================================================================
# Scene_Battle
#===============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# alias method: terminate
#--------------------------------------------------------------------------
alias terminate_va terminate unless $@
def terminate
@top_window.dispose if @top_window != nil
@exp_window.dispose if @exp_window != nil
@gold_window.dispose if @gold_window != nil
@exp_back_window.dispose if @exp_back_window != nil
@exp_front_window.dispose if @exp_front_window != nil
@drops_window.dispose if @drops_window != nil
terminate_va
end
#--------------------------------------------------------------------------
# overwrite method: process_victory
#--------------------------------------------------------------------------
def process_victory
if $imported["BattleEngineMelody"]
@judge_win_loss = true
pause_atb(true, true)
@enemy_gauge_window.dispose if @enemy_gauge_window != nil
@hide_battlecursor = true
@party_input_flag = true
end
wait_for_deaths if $imported["FancyDeaths"]
unless $game_switches[YEM]
RPG::BGM.stop
$game_system.battle_end_me.play
YEM::VICTORY::BGM.play unless YEM::VICTORY::BGM == nil
end
if $imported["BattleEngineMelody"]
start_victory_poses
@spriteset.update_dtb_order
@spriteset.update_ctb_order
end
wait(YEM::VICTORY::WAIT, true)
@info_viewport.visible = false
if $imported["BattleEngineMelody"]
@message_window.dispose
@message_window = Window_BattleMessage.new
elsif $imported["VictoryCompatibility"]
@message_window.dispose
@message_window = Window_BattleMessageCompatible.new
end
@message_window.visible = true
create_victory_clones
create_victory_actor
display_exp_and_gold
display_level_up
display_drop_items
battle_end(0)
$game_temp.victory_actor = nil
$game_temp.victory_clone = nil
victory_me = Thread.new {
time = YEM::VICTORY::FANFARE_FADE
RPG::ME.fade(time)
sleep(time / 1000.0)
RPG::ME.stop }
battle_end(0)
end
#--------------------------------------------------------------------------
# overwrite method: display_exp_and_gold
#--------------------------------------------------------------------------
def display_exp_and_gold
unless $game_switches[YEM]
show_exp_and_gold
else
@exp = $game_troop.exp_total
if YEM::VICTORY::PARTY_SPLIT_EXP
size = YEM::VICTORY::DEAD_ALLY_EXP ?
$game_party.members.size : $game_party.existing_members.size
@exp = Integer(@exp * YEM::VICTORY::PARTY_SIZE_SCALING[size])
end
$game_party.gain_gold($game_troop.gold_total)
end
end
#--------------------------------------------------------------------------
# overwrite method: display_level_up
#--------------------------------------------------------------------------
def display_level_up
unless $game_switches[YEM]
show_level_up
else
group = YEM::VICTORY::DEAD_ALLY_EXP ?
$game_party.members : $game_party.existing_members
for actor in group
last_level = actor.level
last_skills = actor.learned_skills.clone
actor.gain_exp(@exp, false)
end
end
end
#--------------------------------------------------------------------------
# overwrite method: display_drop_items
#--------------------------------------------------------------------------
def display_drop_items
@active_battler = nil
unless $game_switches[YEM]
show_drop_items
else
drop_items = $game_troop.make_drop_items
for item in drop_items; $game_party.gain_item(item, 1); end
end
end
#--------------------------------------------------------------------------
# new method: create_victory_clones
#--------------------------------------------------------------------------
def create_victory_clones
$game_temp.victory_clone = {}
$game_temp.in_battle = false
for actor in $game_party.members
$game_temp.victory_clone[actor.id] = actor.clone
end
$game_temp.in_battle = true
end
#--------------------------------------------------------------------------
# new method: create_victory_actor
#--------------------------------------------------------------------------
def create_victory_actor
$game_temp.victory_actor = nil
@original_victory_actor = victory_actor
end
#--------------------------------------------------------------------------
# new method: victory_actor
#--------------------------------------------------------------------------
def victory_actor
if $game_temp.victory_actor == nil
roulette = []
for actor in $game_party.existing_members; roulette.push(actor); end
$game_temp.victory_actor = roulette.size > 0 ?
roulette[rand(roulette.size)] : nil
end
return $game_temp.victory_actor
end
#--------------------------------------------------------------------------
# new method: victory_actor_quote
#--------------------------------------------------------------------------
def victory_actor_quote(value)
$game_temp.victory_quote = value
if YEM::VICTORY::ACTOR_QUOTES.include?(victory_actor.id)
$game_temp.common_event_id = YEM::VICTORY::ACTOR_QUOTES[victory_actor.id]
else
$game_temp.common_event_id = YEM::VICTORY::ACTOR_QUOTES[0]
end
@message_window.visible = true
process_victory_event
end
#--------------------------------------------------------------------------
# new method: process_victory_event
#--------------------------------------------------------------------------
def process_victory_event
loop do
$game_troop.interpreter.update
$game_troop.setup_battle_event
wait_for_message
return unless $game_troop.interpreter.running?
update_basic
end
end
#--------------------------------------------------------------------------
# new method: show_exp_and_gold
#--------------------------------------------------------------------------
def show_exp_and_gold
#--- Draw Victory Message
@top_window = Window_Help.new
text = YEM::VICTORY::VOCAB[:top_message]
@top_window.set_text(text, 1)
#--- Draw EXP Window
@exp = $game_troop.exp_total
if YEM::VICTORY::PARTY_SPLIT_EXP
size = YEM::VICTORY::DEAD_ALLY_EXP ?
$game_party.members.size : $game_party.existing_members.size
@exp = Integer(@exp * YEM::VICTORY::PARTY_SIZE_SCALING[size])
end
@exp_window = Window_Base.new(272, 56, 272, 56)
text = sprintf(YEM::VICTORY::VOCAB[:exp_receive], @exp)
@exp_window.contents.draw_text(0, 0, 240, 24, text, 1)
#--- Draw Gold Window
@gold = $game_troop.gold_total
$game_party.gain_gold(@gold)
@gold_window = Window_Base.new(0, 56, 272, 56)
text = sprintf(YEM::VICTORY::VOCAB[:gold_found], @gold)
@gold_window.contents.draw_text(0, 0, 240, 24, text, 1)
#--- Draw Party EXP Windows
@exp_back_window = Window_Party_Exp_Back.new
@exp_front_window = Window_Party_Exp_Front.new
if $imported["BattleEngineMelody"]
@top_window.viewport = @spriteset.viewportC
@exp_window.viewport = @spriteset.viewportC
@gold_window.viewport = @spriteset.viewportC
@exp_back_window.viewport = @spriteset.viewportC
@exp_front_window.viewport = @spriteset.viewportC
end
if !YEM::VICTORY::SHOW_EXP_WINDOWS
@top_window.visible = false
@exp_window.visible = false
@gold_window.visible = false
@exp_back_window.visible = false
@exp_front_window.refresh(100)
@exp_front_window.visible = false
return
end
fill_exp_gauge
#--- Battle Quotes
if YEM::VICTORY::ENABLE_QUOTES
victory_actor_quote("MAIN")
else
text = sprintf(Vocab::Victory, $game_party.name)
$game_message.texts.push(text)
wait_for_message
end
end
#--------------------------------------------------------------------------
# new method: fill_exp_gauge
#--------------------------------------------------------------------------
def fill_exp_gauge
ticks = 0
percent = 0
increase = 100 / YEM::VICTORY::EXP_TICKS
until ticks > YEM::VICTORY::EXP_TICKS
ticks += 1
percent += increase
@exp_front_window.refresh(percent)
if @exp_front_window.full_actors != $game_party.existing_members.size
YEM::VICTORY::TICK_SOUND.play if YEM::VICTORY::TICK_SOUND != nil
end
update_basic
end
end
#--------------------------------------------------------------------------
# new method: show_level_up
#--------------------------------------------------------------------------
def show_level_up
return unless YEM::VICTORY::SHOW_LEVEL_WINDOWS
@top_window.visible = true
@exp_window.visible = false
@gold_window.visible = false
@exp_back_window.visible = false
@exp_front_window.visible = false
group = YEM::VICTORY::DEAD_ALLY_EXP ?
$game_party.members : $game_party.existing_members
for actor in group
last_level = actor.level
last_skills = actor.learned_skills.clone
actor.gain_exp(@exp, false)
create_level_up_windows(actor, last_skills) if actor.level > last_level
end
wait_for_message
end
#--------------------------------------------------------------------------
# new method: create_level_up_windows
#--------------------------------------------------------------------------
def create_level_up_windows(actor, last_skills)
@active_battler = actor
#--- Basic Settings
YEM::VICTORY::LEVEL_SOUND.play if YEM::VICTORY::LEVEL_SOUND != nil
$game_temp.victory_actor = actor
new_skills = actor.learned_skills - last_skills
@top_window.contents.clear
text = sprintf(YEM::VICTORY::VOCAB[:level_msg], actor.name, actor.level)
@top_window.set_text(text, 1)
#--- HP and MP Recovery
case YEM::VICTORY::HP_RECOVERY
when 1; actor.hp += actor.maxhp - $game_temp.victory_clone[actor.id].maxhp
when 2; actor.hp = actor.maxhp
end
case YEM::VICTORY::MP_RECOVERY
when 1; actor.mp += actor.maxmp - $game_temp.victory_clone[actor.id].maxmp
when 2; actor.mp = actor.maxmp
end
#--- Create Windows
if new_skills != []
@levelup_window = Window_Level_Up.new(actor, 0, 56, 316, 232)
@skill_back_window = Window_Base.new(316, 56, 228, 232)
@skill_back_window.contents.font.color = @skill_back_window.system_color
text = YEM::VICTORY::VOCAB[:new_skills]
@skill_back_window.contents.draw_text(0, 0, 196, 24, text, 1)
@skill_list_window = Window_New_Skills.new(new_skills)
else
@levelup_window = Window_Level_Up.new(actor, 0, 56, 544, 232)
end
if $imported["BattleEngineMelody"]
@levelup_window.viewport = @spriteset.viewportC
if @skill_back_window != nil
@skill_back_window.viewport = @spriteset.viewportC
@skill_list_window.viewport = @spriteset.viewportC
end
end
if YEM::VICTORY::ENABLE_QUOTES
value = (last_skills != actor.learned_skills) ? "SKILL" : "LEVEL"
victory_actor_quote(value)
else
text = sprintf(Vocab::LevelUp, actor.name, Vocab::level, actor.level)
$game_message.new_page
$game_message.texts.push(text)
if new_skills != []
for skill in new_skills
text = sprintf(Vocab::ObtainSkill, skill.name)
$game_message.texts.push(text)
end
end
wait_for_message
end
#--- Skill Window Scrolling
if new_skills.size > 7
@skill_list_window.index = 0
@skill_list_window.active = true
@skill_list_window.help_window = @top_window
loop do
update_basic
@skill_list_window.update
if Input.trigger?(Input::C)
Sound.play_decision; break
elsif Input.trigger?(Input::B)
Sound.play_cancel; break
elsif Input.press?(Input::A)
break
end
end
end
#--- Disposal of Windows
@levelup_window.dispose if @levelup_window != nil
@levelup_window = nil
@skill_back_window.dispose if @skill_back_window != nil
@skill_back_window = nil
@skill_list_window.dispose if @skill_list_window != nil
@skill_list_window = nil
end
#--------------------------------------------------------------------------
# new method: show_drop_items
#--------------------------------------------------------------------------
def show_drop_items
@drop_items = $game_troop.make_drop_items
for item in @drop_items; $game_party.gain_item(item, 1); end
return unless YEM::VICTORY::SHOW_ITEM_WINDOWS
@top_window.visible = true
if @drop_items != []
@top_window.set_text(YEM::VICTORY::VOCAB[:spoils],1)
YEM::VICTORY::ITEM_SOUND.play if YEM::VICTORY::ITEM_SOUND != nil
@drops_window = Window_BattleDrops.new(@drop_items)
if $imported["BattleEngineMelody"]
@drops_window.viewport = @spriteset.viewportC
end
else
@top_window.set_text(YEM::VICTORY::VOCAB[:no_items],1)
@exp_window.visible = true
@gold_window.visible = true
@exp_back_window.visible = true
@exp_front_window.visible = true
end
if YEM::VICTORY::ENABLE_QUOTES
$game_temp.victory_actor = @original_victory_actor
value = (@drop_items == []) ? "NOTHING" : "DROPS"
victory_actor_quote(value)
else
if @drop_items == []
text = YEM::VICTORY::VOCAB[:no_items]
else
text = sprintf(YEM::VICTORY::VOCAB[:found_items], $game_party.name)
end
$game_message.texts.push(text)
wait_for_message
end
if @drop_items != [] and @drops_window.item_max > 16
@drops_window.index = 0
@drops_window.active = true
@drops_window.help_window = @top_window
loop do
update_basic
@drops_window.update
if Input.trigger?(Input::C)
Sound.play_decision; break
elsif Input.trigger?(Input::B)
Sound.play_cancel; break
elsif Input.press?(Input::A)
break
end
end
end
end
end # Scene_Battle
#===============================================================================
#
# END OF FILE
#
#===============================================================================
3-Il terzo punto è più un'aggiunta che altro. Semplicemente, parlando di materia, volevo aggiungere allo script allegato (quindi quello della materia) la possibilità di assegare a delle armi (magari gestibile direttamente dallo script) alcune caratteristiche come APx2 o AP=1. Cioè, se la "spada-pesce" ha come proprietà bonus APx2, se uccido un nemico con quella spada che normalmente mi frutterebbe 3 Ap, ne otterrò 6 (claro no?! XD).
Le varie proprietà bonus delle armi dovrebbero essere visibili nella schermata di equip della materia!
4-Ultima richiesta. Sarebbe bello eliminare la tendina nel combattimento che ti fa vedere HP e nome del nemico. Questo pechè orrei poter creare una skill "scan" che faccia apparire la suddetta "tendina" solo se usata! Altrimenti...con i boss che senso ha?
Ecco....spero di essere stato chiaro.
In ultimo vi allego la demo con lo script enorme....così è più comodo.
Grazie, ma davvero grazie di cuore, a chiunque possa darmi una mano!
Allegato:
1 utente(i) stanno leggendo questa discussione
0 utenti, 1 ospiti, 0 utenti anonimi
Rispondi al messaggio citato Pulisci










