#=============================================================================== # # Yanfly Engine RD - Display Victory Aftermath # Last Date Updated: 2009.06.24 # Level: Easy, Normal, Hard, Lunatic # # I'm remaking this script for multiple reasons. Biggest of which is so that the # code's a whole lot cleaner. The second biggest reason is because I actualy # know what I'm doing this time around. And the third reason is that out there # in the VX scripting community, a decent victory aftermath script has yet to be # made. This will hopefully provide everything adequate for a victory aftermath. # # This script consists of a couple of phases. The first being displayed exp for # each member prior to gaining the experience earned in battle. Nothing too # special here, you basically see what happens before the experience is applied. # # The second phase goes into giving each of the actors experience. This supports # multi-leveling as well as learning a whole bunch of skills. Actors that level # up will create a window that displays their previous stats in comparison to # their new stats. Alongside that is also a list of the new skills they have # learned from the level up. # # This script leaves an "extra" phase if there's any add-ons made for Victory # Aftermath in the future. By default, there's nothing visible here, but should # add-ons be made, this phase will be providing for it without need to actually # modify the script itself. # # The last phase goes into the drop listing. This generates a list of drops and # displays them from most to least number of drops. This means that drops of the # same type will stack upon another. If no drops present, this phase is skipped. # #=============================================================================== # Updates: # ---------------------------------------------------------------------------- # o 2009.06.20 - Bug fix for Double EXP Gain not calculated properly. # o 2009.06.14 - Bug fix for dead actor EXP bars rising. # o 2009.05.30 - Compatibility with Scene Battle ReDux. # o 2009.05.17 - Game_Actor's change_exp is now overwritten. Now, newly learned # skills will show when there are other skill altering scripts # inside a game. # VA_PERCENT_EXP added to change decimal spaces. # o 2009.05.12 - Ticking sound stops after all actors reach 100% bar. # o 2009.05.08 - Fixed a max level bug. # o 2009.05.03 - Disposed windows bugfix (another one this time) # Added more personal actor quotes for defaults. # o 2009.05.02 - Disposed windows bugfix. Made the exp bar sound into a tick. # o 2009.05.01 - Animated experience bar going up. # Added a switch to allow skipping the victory screens. # o 2009.04.28 - Bugfix for skill window not disappearing. # o 2009.04.27 - Major Updates: # Option to use faces or not ala VA_USE_FACES # Switch to bypass Battle BGM's ala VA_BYPASS_BGM_SWITCH # Major bugfix to prevent save corruption. # o 2009.04.26 - Added more options. # Stat Next Display Type # Leveled Up Stat Display Type # Play Victory BGM # Hide skill window if no skills learned. # Bugfix for gaining EXP outside of battle. # Bugfix for not actually getting items. # o 2009.04.25 - Finished script and publicized. # o 2009.04.23 - Started script. #=============================================================================== # Instructions #=============================================================================== # # Just plug and play it. If you wish to to extend further and modify the content # a bit more, scroll down to the module and edit whatever you see fit. There's # a lot of things you can potentially edit and modify. Instructions and comments # are provided alongside the various options. # #=============================================================================== # # Compatibility # - Works With: KGC LargeParty, KGC Extra Drop # - Alias: Game_Actor, initialize, display_level_up # - Alias: Scene_Battle, terminate # - Alias: Scene_Map, call_battle # - Overwrites: Game_Actor, change_exp # - Overwrites: Scene_Battle, process_victory, display_exp_and_gold # #=============================================================================== $imported = {} if $imported == nil $imported["DisplayVictoryAftermath"] = true module YE module BATTLE module DISPLAY # This is the number of frames to wait before displaying the victory # windows on screen. One second consists of 60 frames. VA_WAIT = 30 # This adjusts the background opacity level of all the windows. VA_BACK_OPACITY = 200 # Set this to false if you don't wish to use faces. VA_USE_FACES = true # This BGM will be played while the victory aftermath windows are present. # Once the victory aftermath windows are closed, the theme will revert # back to the map theme. VA_PLAY_VICTORY_BGM = true VA_BGM = RPG::BGM.new("Field1", 100, 100) # The following adjusts how long to play the Victory ME after finishing # battle in milliseconds (if it is still continuing). VA_ME_FADE = 1000 # This is the switch ID to use if you wish to bypass any BGM's played # before the battle and after the battle. VA_BYPASS_BGM_SWITCH = 63 # If there are some game sequences in which you'd like to skip the victory # aftermath part together as a whole, turn on this switch. Skipping the # victory screens will still give the actors experience, gold, and drops. VA_BYPASS_WHOLE_SWITCH = 64 # These adjust the string data show in their respective windows. VA_TOP_MSG = "Battle Results" VA_EXP_MSG = "Earned %d EXP" VA_GOLD_MSG = "Found %d Gold" # This is how many ticks for animating the experience bar going up. # One tick is 6 frames. There are 60 frames in a second. VA_EXP_TICK = 10 VA_TICK_SOUND = RPG::SE.new("Decision1", 80, 100) # This adjusts the experience split by percentage dependent on how many # party members you have. Set them all to 100 if you prefer no experienc# # splitting amongst the members. If you have more than 5 members, it will # use experience split as if there's 4 members. VA_EXP_SPLIT = false # Set to true if you desire EXP Splitting. VA_EXP_1_MEMBER = 100 VA_EXP_2_MEMBERS = 50 VA_EXP_3_MEMBERS = 34 VA_EXP_4_MEMBERS = 25 # This adjusts the face opacity shown in the party experience gain window. # This also lets you enable or disable the sprites shown. VA_FACE_OPACITY = 128 VA_SHOW_SPRITES = true # This adjusts the gauge colour of the experience bar to the next level. VA_EXP_GAUGE_COLOUR1 = 28 VA_EXP_GAUGE_COLOUR2 = 29 # The next portion adjusts how you would like the to next level portion # drawn and adjusted. The display types are as follows: VA_PERCENT_EXP = "%#.05g%%" # Adjusts how exp percentage is shown. VA_MSG_NEXT_LVL = "To Level %d" VA_MSG_MAX_LVL = "Max Level" VA_NEXT_LV_EXP = "%s EXP" VA_FONT_SIZE = 18 # This part adjusts the level up portion of the victory aftermath. Alters # the group party window. VA_LVL_UP_SOUND = RPG::SE.new("Flash1", 100, 100) VA_LVL_UP_TEXT = "LEVELS UP" VA_LVL_UP_LEVEL = "to LV%d" VA_LVL_UP_TEXT_COLOUR = 6 VA_LVL_UP_GAUGE1 = 20 VA_LVL_UP_GAUGE2 = 21 # This will hide the skill window if there are no skills learned. VA_HIDE_SKILL_IF_NONE = true # This part allows your actors to heal upon leveling up. Adjust the rates # if desired. For the rates, 80 would mean 80%. VA_LVL_UP_HEAL = false VA_LVL_UP_HEAL_HP = 80 VA_LVL_UP_HEAL_MP = 50 VA_LVL_UP_HEAL_STATES = false # This part adjusts the level up windows (when the actor actually has # leveled up). Stat text and stat icons are in the following section. VA_LVL_UP_TITLE = "%s has reached level %d!" VA_SKILLS_TITLE = "Skills Acquired" VA_SKILL_COLOUR = 4 VA_SKILLS_NONE = "No New Skills" VA_SKILLS_MORE = "%s acquired new abilities!" VA_SKILLS_SOUND = RPG::SE.new("Book", 100, 100) # These affect the text shown in the stat level up screen and the icons # paired along with them. The VA_NEXT_DISPLAY_TYPE works as such: # 1 - Displays the text. # 2 - Displays the icon VA_NEXT_DISPLAY_TYPE = 1 VA_TEXT_NEXT = "->" # Text for old stat to new stat. VA_ICON_NEXT = 142 # Icon ID for next text. VA_TEXT_LEVEL = "Level" # Category text for level. VA_TEXT_MAXHP = "MaxHP" # Category text for MaxHP. VA_TEXT_MAXMP = "MaxMP" # Category text for MaxMP. VA_TEXT_ATK = "ATK" # Category text for attack. VA_TEXT_DEF = "DEF" # Category text for defense. VA_TEXT_SPI = "SPI" # Category text for spirit. VA_TEXT_AGI = "AGI" # Category text for agility. VA_ICON_LEVEL = 62 # Icon ID for level. VA_ICON_MAXHP = 99 # Icon ID for MaxHP. VA_ICON_MAXMP = 100 # Icon ID for MaxMP. VA_ICON_ATK = 2 # Icon ID for attack. VA_ICON_DEF = 52 # Icon ID for defense. VA_ICON_SPI = 21 # Icon ID for spirit. VA_ICON_AGI = 48 # Icon ID for agility. # This part changes how the new stats appear for the display. # 1 - Shows the new stat itself. # 2 - Shows The difference in change from old stat to new stat. VA_NEW_STAT_TYPE = 1 # These adjust the colours for the stat level up screen. VA_STAT_SIZE = 18 # Adjusts the font size for categories and stats. VA_CAT_COLOUR = 4 # Adjusts the colour for stat category. VA_BEFORE_COLOUR = 5 # Adjusts the colour for before stats. VA_NEXT_COLOUR = 4 # Adjusts the colour for the next arrows. VA_AFTER_COLOUR = 6 # Adjusts the colour for after stats. # This part adjusts the drops portion of the victory aftermath. The drops # portion will consist of a drop total check and a drop display. VA_FOUND_DROP = RPG::SE.new("Chest", 100, 100) VA_DROPS_TITLE = "Drop Results" VA_DROP_TOTAL_NONE = "%s has found no drops." VA_DROP_TOTAL_ONE = "%s has received 1 drop." VA_DROP_TOTAL_MANY = "%s has received %d drops." VA_DROP_CLOSE = "Press X to continue." VA_DROP_LIST_TEXT = "Drop List" VA_DROP_LISTCOLOUR = 4 VA_DROP_WIN_ONE = "Found %d Drop" VA_DROP_WIN_MANY = "Found %d Drops" # This changes the way drops are displayed. # 1 - Lists them vertically. # 2 - Lists them horizontally. VA_DROP_DISPLAY_TYPE = 1 VA_DROP_AMOUNT = "%dx" # This will trigger a common event to occur after battle if enabled. # Set which common event you would like for the battle to trigger. VA_USE_COMEVENT = false VA_COMMON_EVENT = 1 end # DISPLAY end # BATTLE end # YE #=============================================================================== # How to Use: Lunatic Mode #=============================================================================== # # This part will allow your actors to say personal messages during the victory # aftermath phase of battle. Actors can say a variety of things from random # messages in the common actor pool or they can say their own personal things. # Scroll down below to the hash, set VA_DISPLAY_ACTOR_PERSONAL_MSG to true, and # begin modifying what you wish the actors to say. # # ACTOR_VICTORY_MSG # Adjusts what the actor says upon completing a battle. # # ACTOR_LV_UP_MSG # Adjusts what the actor says if they leveled up. # # ACTOR_MORE_SKILL_MSG # Adjusts what the actor says if they learned skills. # # ACTOR_NO_DROPS_MSG # Adjusts what the actor says if no drops were found. # # ACTOR_HAS_DROPS_MSG # Adjusts what the actor says if drops were present. # #=============================================================================== module YE module HASH # If this portion is enabled, your actors can have level up quotes to # accompany their level up display. If no actor ID is set for an actor, it # will automatically use quote set 0. To edit the quotes, scroll down # below to the HASH module and edit there. VA_DISPLAY_ACTOR_PERSONAL_MSG = true # This section adjusts the victory messages. Non-listed actors will use # Actor 0 as their reference list for quotes to be used. ACTOR_VICTORY_MSG ={ # Actor.ID => # ---------------------------------------------------------- 0 => [# This is for all actors that don't have an ID set here. # Note that for Actor 0, \\n[1] will use the current # actor's name instead of Actor ID 1's name. [# This is the 1st random message that can be said. "\\>\\c[6]\\n[1]\\c[0]\\<", "\"Victory is ours!\"", " ", " "], [# This is the 2nd random message that can be said. "\\>\\c[6]\\n[1]\\c[0]\\<", "\"We beat them all!\"", " ", " "], [# This is the 3rd random message that can be said. "\\>\\c[6]\\n[1]\\c[0]\\<", "\"This battle is over!\"", " ", " "], ],# This ends Actor 0 # Actor.ID => # ---------------------------------------------------------- 1 => [# This is Actor 1's quotes. [# This is the 1st random message that can be said. "\\>\\c[6]\\n[1]\\c[0]\\<", "\"Hmph! I didn't break a sweat.\"", " ", " "], [# This is the 2nd random message that can be said. "\\>\\c[6]\\n[1]\\c[0]\\<", "\"Is that all you've got?\"", " ", " "], [# This is the 3rd random message that can be said. "\\>\\c[6]\\n[1]\\c[0]\\<", "\"You need to do better than that!\"", " ", " "], ],# This ends Actor 1 # Actor.ID => # ---------------------------------------------------------- 2 => [# This is Actor 2's quotes. [# This is the 1st random message that can be said. "\\>\\c[6]\\n[2]\\c[0]\\<", "\"\\n[1], we beat them!\"", " ", " "], [# This is the 2nd random message that can be said. "\\>\\c[6]\\n[2]\\c[0]\\<", "\"I must train harder!\"", " ", " "], [# This is the 3rd random message that can be said. "\\>\\c[6]\\n[2]\\c[0]\\<", "\"That was decent training.\"", " ", " "], ],# This ends Actor 2 # Actor.ID => # ---------------------------------------------------------- 3 => [# This is Actor 3's quotes. [# This is the 1st random message that can be said. "\\>\\c[6]\\n[3]\\c[0]\\<", "\"How do you like them apples!?\"", " ", " "], [# This is the 2nd random message that can be said. "\\>\\c[6]\\n[3]\\c[0]\\<", "\"What a glorious battle!\"", " ", " "], [# This is the 3rd random message that can be said. "\\>\\c[6]\\n[3]\\c[0]\\<", "\"Boo-yah! You got SERVED!\"", " ", " "], ],# This ends Actor 3 # Actor.ID => # ---------------------------------------------------------- 4 => [# This is Actor 4's quotes. [# This is the 1st random message that can be said. "\\>\\c[6]\\n[4]\\c[0]\\<", "\"Burnt away to a crisp.\"", " ", " "], [# This is the 2nd random message that can be said. "\\>\\c[6]\\n[4]\\c[0]\\<", "\"Just as planned.\"", " ", " "], [# This is the 1st random message that can be said. "\\>\\c[6]\\n[4]\\c[0]\\<", "\"Ohoho~ We just beat them good!\"", " ", " "], ],# This ends Actor 4 # Actor.ID => # ---------------------------------------------------------- } # Do not remove this. # This section adjusts the level up quotes for the listed actors and the # non-listed actors. Non-listed actors will use Actor 0 as their reference # list for quotes to be used. ACTOR_LV_UP_MSG ={ # Actor.ID => # ---------------------------------------------------------- 0 => [# This is for all actors that don't have an ID set here. # Note that for Actor 0, \\n[1] will use the current # actor's name instead of Actor ID 1's name. [# This is the 1st random message that can be said. "\\>\\c[6]\\n[1]\\c[0]\\<", "\"I've become stronger!\"", " ", " "], [# This is the 2nd random message that can be said. "\\>\\c[6]\\n[1]\\c[0]\\<", "\"I feel great!\"", " ", " "], [# This is the 3rd random message that can be said. "\\>\\c[6]\\n[1]\\c[0]\\<", "\"I will fight even better!\"", " ", " "], ],# This ends Actor 0 # Actor.ID => # ---------------------------------------------------------- 1 => [# This is Actor 1's quotes. [# This is the 1st random message that can be said. "\\>\\c[6]\\n[1]\\c[0]\\<", "\"Man, I feel good!\"", " ", " "], [# This is the 2nd random message that can be said. "\\>\\c[6]\\n[1]\\c[0]\\<", "\"Stronger and stronger!\"", " ", " "], [# This is the 3rd random message that can be said. "\\>\\c[6]\\n[1]\\c[0]\\<", "\"This is how I fight!\"", " ", " "], ],# This ends Actor 1 # Actor.ID => # ---------------------------------------------------------- 2 => [# This is Actor 2's quotes. [# This is the 1st random message that can be said. "\\>\\c[6]\\n[2]\\c[0]\\<", "\"\\n[1], I'm catching up to you!\"", " ", " "], [# This is the 2nd random message that can be said. "\\>\\c[6]\\n[2]\\c[0]\\<", "\"I don't want to fall behind.\"", " ", " "], [# This is the 3rd random message that can be said. "\\>\\c[6]\\n[2]\\c[0]\\<", "\"Strength comes from diligence!\"", " ", " "], ],# This ends Actor 2 # Actor.ID => # ---------------------------------------------------------- 3 => [# This is Actor 3's quotes. [# This is the 1st random message that can be said. "\\>\\c[6]\\n[3]\\c[0]\\<", "\"TAH-TA-DA-DAAAAAAAAAAAAH!!!", " Never fear, \\n[3] is here!\"", " "], [# This is the 2nd random message that can be said. "\\>\\c[6]\\n[3]\\c[0]\\<", "\"WHO THE MAN!?", " \\n[3] the man!\"", " "], [# This is the 3rd random message that can be said. "\\>\\c[6]\\n[3]\\c[0]\\<", "\"I've regained honor and glory!", " How do you like it!?\"", " "], ],# This ends Actor 3 # Actor.ID => # ---------------------------------------------------------- 4 => [# This is Actor 4's quotes. [# This is the 1st random message that can be said. "\\>\\c[6]\\n[4]\\c[0]\\<", "\"And that is how it's done!\"", " ", " "], [# This is the 2nd random message that can be said. "\\>\\c[6]\\n[4]\\c[0]\\<", "\"It's about time.\"", " ", " "], [# This is the 2nd random message that can be said. "\\>\\c[6]\\n[4]\\c[0]\\<", "\"All in a good day's work.\"", " ", " "], ],# This ends Actor 4 # Actor.ID => # ---------------------------------------------------------- } # Do not remove this. # This section adjusts the more skills to be learned messages. It will only # appear if the actor has learned more than 7 skills in the one level up # process. However, if the actor's ID does not appear in this hash, it will # use Actor 0 for hash referencing. ACTOR_MORE_SKILL_MSG ={ # Actor.ID => # ---------------------------------------------------------- 0 => [# This is for all actors that don't have an ID set here. # Note that for Actor 0, \\n[1] will use the current # actor's name instead of Actor ID 1's name. [# This is the 1st random message that can be said. "\\>\\c[6]\\n[1]\\c[0]\\<", "\"I have a new skill!\"", " ", " "], [# This is the 2nd random message that can be said. "\\>\\c[6]\\n[1]\\c[0]\\<", "\"I learn something new everyday.\"", " ", " "], [# This is the 3rd random message that can be said. "\\>\\c[6]\\n[1]\\c[0]\\<", "\"Let's try out this new skill.\"", " ", " "], ],# This ends Actor 0 # Actor.ID => # ---------------------------------------------------------- 1 => [# This is Actor 1's quotes. [# This is the 1st random message that can be said. "\\>\\c[6]\\n[1]\\c[0]\\<", "\"I have more techniques to learn!\"", " ", " "], [# This is the 2nd random message that can be said. "\\>\\c[6]\\n[1]\\c[0]\\<", "\"I have acquired more techniques!\"", " ", " "], ],# This ends Actor 1 # Actor.ID => # ---------------------------------------------------------- 2 => [# This is Actor 2's quotes. [# This is the 1st random message that can be said. "\\>\\c[6]\\n[2]\\c[0]\\<", "\"\\n[1], I'm learning more!\"", " ", " "], [# This is the 2nd random message that can be said. "\\>\\c[6]\\n[2]\\c[0]\\<", "\"All that training paid off.\"", " ", " "], ],# This ends Actor 2 # Actor.ID => # ---------------------------------------------------------- 3 => [# This is Actor 3's quotes. [# This is the 1st random message that can be said. "\\>\\c[6]\\n[3]\\c[0]\\<", "\"\\n[3] Smaaaaaaaaash!!!", " Moooooooore skiiilllllz-aaah!!!\"", " "], [# This is the 2nd random message that can be said. "\\>\\c[6]\\n[3]\\c[0]\\<", "\"I'm so fricken awesome!\"", " ", " "], ],# This ends Actor 3 # Actor.ID => # ---------------------------------------------------------- 4 => [# This is Actor 4's quotes. [# This is the 1st random message that can be said. "\\>\\c[6]\\n[4]\\c[0]\\<", "\"I have even more skills to learn!\"", " ", " "], [# This is the 2nd random message that can be said. "\\>\\c[6]\\n[4]\\c[0]\\<", "\"Something else to add to the book.\"", " ", " "], ],# This ends Actor 4 # Actor.ID => # ---------------------------------------------------------- } # Do not remove this. # This section adjusts the messages regarding no enemy drops. If there is # an actor without an ID specified here, it will automatically take on # Actor 0 as its reference. ACTOR_NO_DROPS_MSG ={ # Actor.ID => # ---------------------------------------------------------- 0 => [# This is for all actors that don't have an ID set here. # Note that for Actor 0, \\n[1] will use the current # actor's name instead of Actor ID 1's name. [# This is the 1st random message that can be said. "\\>\\c[6]\\n[1]\\c[0]\\<", "\"There weren't any enemy drops.\"", " ", " "], [# This is the 2nd random message that can be said. "\\>\\c[6]\\n[1]\\c[0]\\<", "\"The enemies didn't drop any goods.\"", " ", " "], [# This is the 2nd random message that can be said. "\\>\\c[6]\\n[1]\\c[0]\\<", "\"We didn't find any drops.\"", " ", " "], ],# This ends Actor 0 # Actor.ID => # ---------------------------------------------------------- 1 => [# This is Actor 1's quotes. [# This is the 1st random message that can be said. "\\>\\c[6]\\n[1]\\c[0]\\<", "\"Worthless bunch of monsters.\"", " ", " "], ],# This ends Actor 1 # Actor.ID => # ---------------------------------------------------------- 2 => [# This is Actor 2's quotes. [# This is the 1st random message that can be said. "\\>\\c[6]\\n[2]\\c[0]\\<", "\"\\n[1], they didn't drop anything.\"", " ", " "], ],# This ends Actor 2 # Actor.ID => # ---------------------------------------------------------- 3 => [# This is Actor 3's quotes. [# This is the 1st random message that can be said. "\\>\\c[6]\\n[3]\\c[0]\\<", "\"NOOOOOOOOOOOOOOOOOOOOOOO!", " No lewt...\"", " "], ],# This ends Actor 3 # Actor.ID => # ---------------------------------------------------------- 4 => [# This is Actor 4's quotes. [# This is the 1st random message that can be said. "\\>\\c[6]\\n[4]\\c[0]\\<", "\"What a meaningless battle.\"", " ", " "], ],# This ends Actor 4 # Actor.ID => # ---------------------------------------------------------- } # Do not remove this. # This section adjusts the messages regarding present enemy drops. If there # is an actor without an ID specified here, it will automatically take on # Actor 0 as its reference. ACTOR_HAS_DROPS_MSG ={ # Actor.ID => # ---------------------------------------------------------- 0 => [# This is for all actors that don't have an ID set here. # Note that for Actor 0, \\n[1] will use the current # actor's name instead of Actor ID 1's name. [# This is the 1st random message that can be said. "\\>\\c[6]\\n[1]\\c[0]\\<", "\"The monsters have dropped something!\"", " ", " "], [# This is the 2nd random message that can be said. "\\>\\c[6]\\n[1]\\c[0]\\<", "\"We found some spoils.\"", " ", " "], [# This is the 3rd random message that can be said. "\\>\\c[6]\\n[1]\\c[0]\\<", "\"This was found on the enemy.\"", " ", " "], ],# This ends Actor 0 # Actor.ID => # ---------------------------------------------------------- 1 => [# This is Actor 1's quotes. [# This is the 1st random message that can be said. "\\>\\c[6]\\n[1]\\c[0]\\<", "\"To the victor goes the spoils.\"", " ", " "], ],# This ends Actor 1 # Actor.ID => # ---------------------------------------------------------- 2 => [# This is Actor 2's quotes. [# This is the 1st random message that can be said. "\\>\\c[6]\\n[2]\\c[0]\\<", "\"\\n[1], they drop some goods!\"", " ", " "], ],# This ends Actor 2 # Actor.ID => # ---------------------------------------------------------- 3 => [# This is Actor 3's quotes. [# This is the 1st random message that can be said. "\\>\\c[6]\\n[3]\\c[0]\\<", "\"WOOT! Check out my phat lewt!\"", " ", " "], ],# This ends Actor 3 # Actor.ID => # ---------------------------------------------------------- 4 => [# This is Actor 4's quotes. [# This is the 1st random message that can be said. "\\>\\c[6]\\n[4]\\c[0]\\<", "\"Wonderful, I'll take these.\"", " ", " "], ],# This ends Actor 4 # Actor.ID => # ---------------------------------------------------------- } # Do not remove this. end # HASH end # YE #=============================================================================== # 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. #=============================================================================== #=============================================================================== # Game_Actor #=============================================================================== class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # old level #-------------------------------------------------------------------------- def old_level update_old_level if $old_level[self.id] == nil return $old_level[self.id] end def update_old_level $old_level[self.id] = @level end #-------------------------------------------------------------------------- # Now Exp - The experience gained for the current level. #-------------------------------------------------------------------------- def now_exp return @exp - @exp_list[@level] end #-------------------------------------------------------------------------- # Next Exp - The experience needed for the next level. #-------------------------------------------------------------------------- def next_exp return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0 end #-------------------------------------------------------------------------- # full skills #-------------------------------------------------------------------------- def full_skills result = [] for i in @skills result.push($data_skills[i]) end return result end #-------------------------------------------------------------------------- # overwrite change exp #-------------------------------------------------------------------------- def change_exp(exp, show) $old_level = {} if $old_level == nil $old_level[self.id] = @level $old_maxhp = {} if $old_maxhp == nil $old_maxhp[self.id] = self.maxhp $old_maxmp = {} if $old_maxmp == nil $old_maxmp[self.id] = self.maxmp $old_atk = {} if $old_atk == nil $old_atk[self.id] = self.atk $old_def = {} if $old_def == nil $old_def[self.id] = self.def $old_spi = {} if $old_spi == nil $old_spi[self.id] = self.spi $old_agi = {} if $old_agi == nil $old_agi[self.id] = self.agi last_level = @level last_skills = full_skills if $imported["LimitBreak"] @exp = [[exp, exp_limit].min, 0].max else @exp = [[exp, 9999999].min, 0].max end while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0 level_up end while @exp < @exp_list[@level] level_down end @hp = [@hp, maxhp].min @mp = [@mp, maxmp].min if show and @level > last_level display_level_up(full_skills - last_skills) end end #-------------------------------------------------------------------------- # alias display level up #-------------------------------------------------------------------------- alias display_level_up_dva display_level_up unless $@ def display_level_up(new_skills) if $scene.is_a?(Scene_Battle) $scene.hide_1st_page_windows; remove_state(1) original_name = $game_actors[1].name sound = YE::BATTLE::DISPLAY::VA_LVL_UP_SOUND sound.play unless sound == nil #----------------------------- text = sprintf(YE::BATTLE::DISPLAY::VA_LVL_UP_TITLE, actor.name, @level) $level_up_title_window = Window_Base.new(0, 0, 544, 56) $level_up_title_window.contents.draw_text(2, 0, 504, 24, text, 1) $level_up_title_window.back_opacity = YE::BATTLE::DISPLAY::VA_BACK_OPACITY if YE::BATTLE::DISPLAY::VA_HIDE_SKILL_IF_NONE and new_skills == [] $level_up_stats_window = Window_Level_Up_Stats.new(self, false) $level_up_skills_window = Window_Level_Up_Skills.new(new_skills) $level_up_skills_window.visible = false else $level_up_stats_window = Window_Level_Up_Stats.new(self, true) $level_up_skills_window = Window_Level_Up_Skills.new(new_skills) $level_up_skills_window.visible = true end #----------------------------- $game_message.new_page if YE::BATTLE::DISPLAY::VA_USE_FACES $game_message.face_name = @face_name $game_message.face_index = @face_index end if YE::HASH::VA_DISPLAY_ACTOR_PERSONAL_MSG if YE::BATTLE::DISPLAY::VA_USE_FACES $game_message.face_name = @face_name $game_message.face_index = @face_index end #-------------------------------------------------------------------- if YE::HASH::ACTOR_LV_UP_MSG.include?(@actor_id) msg_array = YE::HASH::ACTOR_LV_UP_MSG[@actor_id] else msg_array = YE::HASH::ACTOR_LV_UP_MSG[0] $game_actors[1].name = @name end #-------------------------------------------------------------------- ax = msg_array.size random_array = msg_array[rand(ax)] $scene.personal_text(random_array, self) $scene.wait_for_message if new_skills.size > 0 sound = YE::BATTLE::DISPLAY::VA_SKILLS_SOUND sound.play unless sound == nil $game_actors[1].name = original_name if YE::HASH::ACTOR_MORE_SKILL_MSG.include?(@actor_id) msg_array = YE::HASH::ACTOR_MORE_SKILL_MSG[@actor_id] else msg_array = YE::HASH::ACTOR_MORE_SKILL_MSG[0] $game_actors[1].name = @name end ax = msg_array.size random_array = msg_array[rand(ax)] $scene.personal_text(random_array, self) $level_up_skills_window.refresh(new_skills) $scene.wait_for_message end while new_skills.size > 6 sound = YE::BATTLE::DISPLAY::VA_SKILLS_SOUND sound.play unless sound == nil $game_actors[1].name = original_name new_skills = delete_skills(new_skills) if YE::HASH::ACTOR_MORE_SKILL_MSG.include?(@actor_id) msg_array = YE::HASH::ACTOR_MORE_SKILL_MSG[@actor_id] else msg_array = YE::HASH::ACTOR_MORE_SKILL_MSG[0] $game_actors[1].name = @name end ax = msg_array.size random_array = msg_array[rand(ax)] $scene.personal_text(random_array, self) $level_up_skills_window.refresh(new_skills) $scene.wait_for_message end #-------------------------------------------------------------------- else text = sprintf(Vocab::LevelUp, @name, Vocab::level, @level) text = "\\>" + text + "\\<" $game_message.texts.push(text) $scene.wait_for_message if new_skills.size > 0 sound = YE::BATTLE::DISPLAY::VA_SKILLS_SOUND sound.play unless sound == nil if YE::BATTLE::DISPLAY::VA_USE_FACES $game_message.face_name = @face_name $game_message.face_index = @face_index end text = sprintf(Vocab::LevelUp, @name, Vocab::level, @level) text = "\\>" + text + "\\<" $game_message.texts.push(text) text = sprintf(YE::BATTLE::DISPLAY::VA_SKILLS_MORE, @name) text = "\\>" + text + "\\<" $game_message.texts.push(text) $level_up_skills_window.refresh(new_skills) $scene.wait_for_message end while new_skills.size > 6 sound = YE::BATTLE::DISPLAY::VA_SKILLS_SOUND sound.play unless sound == nil if YE::BATTLE::DISPLAY::VA_USE_FACES $game_message.face_name = @face_name $game_message.face_index = @face_index end new_skills = delete_skills(new_skills) text = sprintf(Vocab::LevelUp, @name, Vocab::level, @level) text = "\\>" + text + "\\<" $game_message.texts.push(text) text = sprintf(YE::BATTLE::DISPLAY::VA_SKILLS_MORE, @name) text = "\\>" + text + "\\<" $game_message.texts.push(text) $level_up_skills_window.refresh(new_skills) $scene.wait_for_message end end $game_actors[1].name = original_name #--------------------------- if YE::BATTLE::DISPLAY::VA_LVL_UP_HEAL if YE::BATTLE::DISPLAY::VA_LVL_UP_HEAL_STATES for i in @states.clone do remove_state(i) end end self.hp += (self.hp * YE::BATTLE::DISPLAY::VA_LVL_UP_HEAL_HP) / 100 self.mp += (self.mp * YE::BATTLE::DISPLAY::VA_LVL_UP_HEAL_MP) / 100 end #--------------------------- $level_up_title_window.dispose if $level_up_title_window != nil $level_up_stats_window.dispose if $level_up_stats_window != nil $level_up_skills_window.dispose if $level_up_skills_window != nil else display_level_up_dva(new_skills) end end #-------------------------------------------------------------------------- # Mass Delete Skills #-------------------------------------------------------------------------- def delete_skills(new_skills) for i in 0..5 new_skills.delete_at 0 end return new_skills end end # Game_Actor #=============================================================================== # Scene Map #=============================================================================== class Scene_Map < Scene_Base #-------------------------------------------------------------------------- # alias call battle #-------------------------------------------------------------------------- alias call_battle_dva call_battle unless $@ def call_battle if $game_switches[YE::BATTLE::DISPLAY::VA_BYPASS_BGM_SWITCH] @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_dva end end end # Scene Map #=============================================================================== # Scene_Battle #=============================================================================== class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # alias terminate #-------------------------------------------------------------------------- alias terminate_dva terminate unless $@ def terminate unless $game_switches[YE::BATTLE::DISPLAY::VA_BYPASS_WHOLE_SWITCH] $victory_message_window.dispose if $victory_message_window != nil $gold_gain_window.dispose if $gold_gain_window != nil $exp_gain_window.dispose if $exp_gain_window != nil $party_exp_window.dispose if $party_exp_window != nil $party_img_window.dispose if $party_img_window != nil $victory_message_window = nil $gold_gain_window = nil $party_exp_window = nil $exp_gain_window = nil $party_img_window = nil @drops_title_window.dispose if @drops_title_window != nil @drops_total_window.dispose if @drops_total_window != nil @drops_display_window.dispose if @drops_display_window != nil @drops_close_window.dispose if @drops_close_window != nil end terminate_dva end #-------------------------------------------------------------------------- # initialize globals #-------------------------------------------------------------------------- def initialize_globals $old_level = {}; $old_maxhp = {}; $old_maxmp = {} $old_atk = {}; $old_def = {}; $old_spi = {}; $old_agi = {} for actor in $game_party.members $old_level[actor.id] = actor.level $old_maxhp[actor.id] = actor.maxhp $old_maxmp[actor.id] = actor.maxmp $old_atk[actor.id] = actor.atk $old_def[actor.id] = actor.def $old_spi[actor.id] = actor.spi $old_agi[actor.id] = actor.agi end end #-------------------------------------------------------------------------- # overwrite process victory #-------------------------------------------------------------------------- def process_victory initialize_globals @onscreen_status_window.close if $imported["OnScreenStatus"] wait(YE::BATTLE::DISPLAY::VA_WAIT) @info_viewport.visible = false if $imported["SceneBattleReDux"] and @redux_msg @message_window.dispose @message_window = Window_BattleMessage.new end @message_window.visible = true unless $game_switches[YE::BATTLE::DISPLAY::VA_BYPASS_WHOLE_SWITCH] unless $game_switches[YE::BATTLE::DISPLAY::VA_BYPASS_BGM_SWITCH] RPG::BGM.stop $game_system.battle_end_me.play if YE::BATTLE::DISPLAY::VA_PLAY_VICTORY_BGM victory_bgm = YE::BATTLE::DISPLAY::VA_BGM victory_bgm.play else $game_temp.map_bgm.play $game_temp.map_bgs.play end end @message_window.back_opacity = YE::BATTLE::DISPLAY::VA_BACK_OPACITY if $imported["VictoryAftermathCompatibility"] @message_window.dispose if @message_window != nil @message_window = Window_BattleMessageCompatible.new end display_first_page display_extra_pages if $imported["VictoryAftermathExtras"] create_drop_items display_last_page else value = YE::BATTLE::DISPLAY::VA_WAIT value = 60 if value < 60 wait(value) #--------- gold = $game_troop.gold_total $game_party.gain_gold(gold) exp = $game_troop.exp_total members = $game_party.members.size if YE::BATTLE::DISPLAY::VA_EXP_SPLIT if members == 1 exp *= YE::BATTLE::DISPLAY::VA_EXP_1_MEMBER elsif members == 2 exp *= YE::BATTLE::DISPLAY::VA_EXP_2_MEMBERS elsif members == 3 exp *= YE::BATTLE::DISPLAY::VA_EXP_3_MEMBERS else exp *= YE::BATTLE::DISPLAY::VA_EXP_4_MEMBERS end exp /= 100 end drop_items = $game_troop.make_drop_items for item in drop_items $game_party.gain_item(item, 1) end for actor in $game_party.existing_members actor.gain_exp(exp, false) end hidden_extra_pages if $imported["VictoryAftermathExtras"] #--------- end unless $BTEST or $game_switches[YE::BATTLE::DISPLAY::VA_BYPASS_BGM_SWITCH] $game_temp.map_bgm.play unless !YE::BATTLE::DISPLAY::VA_PLAY_VICTORY_BGM $game_temp.map_bgs.play unless !YE::BATTLE::DISPLAY::VA_PLAY_VICTORY_BGM end victory_me = Thread.new { time = YE::BATTLE::DISPLAY::VA_ME_FADE RPG::ME.fade(time) sleep(time / 1000.0) RPG::ME.stop } battle_end(0) if YE::BATTLE::DISPLAY::VA_USE_COMEVENT $game_temp.common_event_id = YE::BATTLE::DISPLAY::VA_COMMON_EVENT end end #-------------------------------------------------------------------------- # Apply Personal Texts #-------------------------------------------------------------------------- def personal_text(array, actor) text0 = array[0] text1 = array[1] text2 = array[2] text3 = array[3] if YE::BATTLE::DISPLAY::VA_USE_FACES $game_message.face_name = actor.face_name $game_message.face_index = actor.face_index end $game_message.texts.push(text0) $game_message.texts.push(text1) $game_message.texts.push(text2) $game_message.texts.push(text3) end #-------------------------------------------------------------------------- # display_first_page #-------------------------------------------------------------------------- def display_first_page $game_message.new_page #----- $victory_message_window = Window_Base.new(0, 0, 544, 56) text = YE::BATTLE::DISPLAY::VA_TOP_MSG $victory_message_window.contents.draw_text(2, 0, 504, 24, text, 1) $victory_message_window.back_opacity = YE::BATTLE::DISPLAY::VA_BACK_OPACITY #----- gold = $game_troop.gold_total text = sprintf(YE::BATTLE::DISPLAY::VA_GOLD_MSG, gold) $game_party.gain_gold(gold) $gold_gain_window = Window_Base.new(0, 56, 272, 56) $gold_gain_window.contents.draw_text(2, 0, 232, 24, text, 1) $gold_gain_window.back_opacity = YE::BATTLE::DISPLAY::VA_BACK_OPACITY #----- $party_img_window = Window_Party_Exp_Back.new $party_exp_window = Window_Party_Exp_Front.new #----- exp = $game_troop.exp_total members = $game_party.members.size if YE::BATTLE::DISPLAY::VA_EXP_SPLIT if members == 1 exp *= YE::BATTLE::DISPLAY::VA_EXP_1_MEMBER elsif members == 2 exp *= YE::BATTLE::DISPLAY::VA_EXP_2_MEMBERS elsif members == 3 exp *= YE::BATTLE::DISPLAY::VA_EXP_3_MEMBERS else exp *= YE::BATTLE::DISPLAY::VA_EXP_4_MEMBERS end exp /= 100 end text = sprintf(YE::BATTLE::DISPLAY::VA_EXP_MSG, exp) $exp_gain_window = Window_Base.new(272, 56, 272, 56) $exp_gain_window.contents.draw_text(2, 0, 232, 24, text, 1) $exp_gain_window.back_opacity = YE::BATTLE::DISPLAY::VA_BACK_OPACITY #----- original_name = $game_actors[1].name if YE::HASH::VA_DISPLAY_ACTOR_PERSONAL_MSG @ractor = $game_party.random_target @ractor = @ractor.id if YE::BATTLE::DISPLAY::VA_USE_FACES $game_message.face_name = $game_actors[@ractor].face_name $game_message.face_index = $game_actors[@ractor].face_index end if YE::HASH::ACTOR_VICTORY_MSG.include?(@ractor) msg_array = YE::HASH::ACTOR_VICTORY_MSG[@ractor] $game_actors[1].name = original_name else msg_array = YE::HASH::ACTOR_VICTORY_MSG[0] $game_actors[1].name = $game_actors[@ractor].name end ax = msg_array.size random_array = msg_array[rand(ax)] personal_text(random_array, $game_actors[@ractor]) else if YE::BATTLE::DISPLAY::VA_USE_FACES $game_message.face_name = $game_party.members[0].face_name $game_message.face_index = $game_party.members[0].face_index end text = sprintf(Vocab::Victory, $game_party.name) $game_message.texts.push(text) end ticks = 0 percent = 0 pincrease = 100 / (YE::BATTLE::DISPLAY::VA_EXP_TICK) if exp > 0 and YE::BATTLE::DISPLAY::VA_TICK_SOUND != nil play_sound = true else play_sound = false end until ticks > YE::BATTLE::DISPLAY::VA_EXP_TICK wait(6) ticks += 1 percent += pincrease $party_exp_window.refresh(percent) if $party_exp_window.full_actors != $game_party.existing_members.size YE::BATTLE::DISPLAY::VA_TICK_SOUND.play if play_sound end update_basic end wait_for_message $game_actors[1].name = original_name #--- for actor in $game_party.existing_members actor.gain_exp(exp, true) show_1st_page_windows $party_exp_window.refresh end for actor in $game_party.existing_members actor.update_old_level end if $imported["LargeParty"] exp *= KGC::LargeParty::STAND_BY_EXP_RATE exp /= 1000 $game_party.stand_by_members.each { |actor| if actor.exist? actor.gain_exp(exp, KGC::LargeParty::SHOW_STAND_BY_LEVEL_UP) end } end #----- $game_actors[1].name = original_name wait_for_message @drop_collection = [] end #-------------------------------------------------------------------------- # Hide and Show First Page Windows #-------------------------------------------------------------------------- def hide_1st_page_windows $victory_message_window.visible = false $gold_gain_window.visible = false $exp_gain_window.visible = false $party_exp_window.visible = false $party_img_window.visible = false end def show_1st_page_windows $victory_message_window.visible = true $gold_gain_window.visible = true $exp_gain_window.visible = true $party_exp_window.visible = true $party_img_window.visible = true end #-------------------------------------------------------------------------- # display_extra_pages #-------------------------------------------------------------------------- def display_extra_pages # This will be used for add-ons later on. @message_window.visible = true show_1st_page_windows end #-------------------------------------------------------------------------- # hidden_extra_pages #-------------------------------------------------------------------------- def hidden_extra_pages # This will be used for add-ons later on. end #-------------------------------------------------------------------------- # create_drop_items #-------------------------------------------------------------------------- def create_drop_items @total_drops = 0 @drop_collection += $game_troop.make_drop_items @drop_collection.each { |item| @total_drops += 1 } @total_drops = @drop_collection.size end #-------------------------------------------------------------------------- # display_last_page #-------------------------------------------------------------------------- def display_last_page @message_window.visible = true show_1st_page_windows $game_message.new_page original_name = $game_actors[1].name if YE::HASH::VA_DISPLAY_ACTOR_PERSONAL_MSG if YE::BATTLE::DISPLAY::VA_USE_FACES $game_message.face_name = $game_actors[@ractor].face_name $game_message.face_index = $game_actors[@ractor].face_index end if @total_drops > 0 if YE::HASH::ACTOR_HAS_DROPS_MSG.include?(@ractor) msg_array = YE::HASH::ACTOR_HAS_DROPS_MSG[@ractor] else msg_array = YE::HASH::ACTOR_HAS_DROPS_MSG[0] $game_actors[1].name = $game_actors[@ractor].name end else if YE::HASH::ACTOR_NO_DROPS_MSG.include?(@ractor) msg_array = YE::HASH::ACTOR_NO_DROPS_MSG[@ractor] else msg_array = YE::HASH::ACTOR_NO_DROPS_MSG[0] $game_actors[1].name = $game_actors[@ractor].name end end ax = msg_array.size random_array = msg_array[rand(ax)] personal_text(random_array, $game_actors[@ractor]) else if YE::BATTLE::DISPLAY::VA_USE_FACES $game_message.face_name = $game_party.members[0].face_name $game_message.face_index = $game_party.members[0].face_index end if @total_drops == 0 text = YE::BATTLE::DISPLAY::VA_DROP_TOTAL_NONE text = sprintf(text, $game_party.name) elsif @total_drops == 1 text = YE::BATTLE::DISPLAY::VA_DROP_TOTAL_ONE text = sprintf(text, $game_party.name) else text = YE::BATTLE::DISPLAY::VA_DROP_TOTAL_MANY text = sprintf(text, $game_party.name, @total_drops) end $game_message.texts.push(text) end wait_for_message $game_actors[1].name = original_name #----- if @total_drops > 0 sound = YE::BATTLE::DISPLAY::VA_FOUND_DROP sound.play unless sound == nil hide_1st_page_windows $gold_gain_window.visible = true #----- @message_window.visible = false text = YE::BATTLE::DISPLAY::VA_DROPS_TITLE @drops_title_window = Window_Base.new(0, 0, 544, 56) @drops_title_window.contents.draw_text(2, 0, 504, 24, text, 1) @drops_title_window.back_opacity = YE::BATTLE::DISPLAY::VA_BACK_OPACITY #----- if @total_drops == 1 text = sprintf(YE::BATTLE::DISPLAY::VA_DROP_WIN_ONE, @total_drops) else text = sprintf(YE::BATTLE::DISPLAY::VA_DROP_WIN_MANY, @total_drops) end @drops_total_window = Window_Base.new(272, 56, 272, 56) @drops_total_window.contents.draw_text(2, 0, 232, 24, text, 1) @drops_total_window.back_opacity = YE::BATTLE::DISPLAY::VA_BACK_OPACITY #----- text = YE::BATTLE::DISPLAY::VA_DROP_CLOSE @drops_close_window = Window_Base.new(0, 360, 544, 56) @drops_close_window.contents.draw_text(2, 0, 504, 24, text, 1) @drops_close_window.back_opacity = YE::BATTLE::DISPLAY::VA_BACK_OPACITY #----- @drops_display_window = Window_Drops.new(@drop_collection) #----- while @drops_title_window.visible update_basic if Input.trigger?(Input::C) Sound.play_decision break end if Input.trigger?(Input::B) Sound.play_cancel break end end # end while end # if total drops end end # Scene_Battle #=============================================================================== # Window_Party_Exp_Front #=============================================================================== class Window_Party_Exp_Front < Window_Base #-------------------------------------------------------------------------- # initialize #-------------------------------------------------------------------------- def initialize super(0, 112, 544, 176) self.opacity = 0 refresh end #-------------------------------------------------------------------------- # refresh #-------------------------------------------------------------------------- def refresh(extraper = 0) self.contents.clear px = (self.width - 32) / 2 - ($game_party.members.size * 120) / 2 @full_actors = 0 for actor in $game_party.members #--- self.contents.font.color = normal_color self.contents.font.size = Font.default_size py = WLH * 4 #--- pw = 96 gc1 = text_color(YE::BATTLE::DISPLAY::VA_EXP_GAUGE_COLOUR1) gc2 = text_color(YE::BATTLE::DISPLAY::VA_EXP_GAUGE_COLOUR2) if actor.level > $old_level[actor.id] gw = pw gc1 = text_color(YE::BATTLE::DISPLAY::VA_LVL_UP_GAUGE1) gc2 = text_color(YE::BATTLE::DISPLAY::VA_LVL_UP_GAUGE2) elsif actor.next_exp != 0 gw = pw * (actor.now_exp + exp_gained(extraper, actor)) gw /= actor.next_exp gw = pw if gw > pw else gw = pw end self.contents.fill_rect(px + 12, py - 6, pw, 6, gauge_back_color) self.contents.gradient_fill_rect(px + 12, py - 6, gw, 6, gc1, gc2) #--- self.contents.font.size = YE::BATTLE::DISPLAY::VA_FONT_SIZE if actor.level > $old_level[actor.id] colour = text_color(YE::BATTLE::DISPLAY::VA_LVL_UP_TEXT_COLOUR) self.contents.font.color = colour text = YE::BATTLE::DISPLAY::VA_LVL_UP_TEXT elsif actor.next_exp != 0 text = sprintf(YE::BATTLE::DISPLAY::VA_MSG_NEXT_LVL, actor.level + 1) else text = YE::BATTLE::DISPLAY::VA_MSG_MAX_LVL end self.contents.draw_text(px, py, 120, WLH, text, 1) self.contents.font.color = normal_color #--- py += WLH if actor.level > $old_level[actor.id] expercent = 100.000 text = sprintf(YE::BATTLE::DISPLAY::VA_PERCENT_EXP, expercent) self.contents.draw_text(px, py - WLH * 2, 120, WLH, text, 1) text = sprintf(YE::BATTLE::DISPLAY::VA_LVL_UP_LEVEL, actor.level) self.contents.draw_text(px, py, 120, WLH, text, 1) else if actor.next_exp != 0 expercent = (actor.now_exp + exp_gained(extraper, actor))* 100.000 expercent /= actor.next_exp if expercent > 100.000 expercent = 100.000 @full_actors += 1 end value = actor.next_rest_exp_s - exp_gained(extraper, actor) value = 0 if value < 0 else expercent = 100.000 @full_actors += 1 end text = sprintf(YE::BATTLE::DISPLAY::VA_PERCENT_EXP, expercent) self.contents.draw_text(px, py - WLH * 2, 120, WLH, text, 1) if actor.next_exp != 0 text = sprintf(YE::BATTLE::DISPLAY::VA_NEXT_LV_EXP, value) else text = "" end self.contents.draw_text(px, py, 120, WLH, text, 1) end #--- px += 120 end end #-------------------------------------------------------------------------- # exp_gained #-------------------------------------------------------------------------- def exp_gained(extraper, actor) return 0 if actor.dead? extraper = 100 if extraper > 100 exp = $game_troop.exp_total members = $game_party.members.size if YE::BATTLE::DISPLAY::VA_EXP_SPLIT if members == 1 exp *= YE::BATTLE::DISPLAY::VA_EXP_1_MEMBER elsif members == 2 exp *= YE::BATTLE::DISPLAY::VA_EXP_2_MEMBERS elsif members == 3 exp *= YE::BATTLE::DISPLAY::VA_EXP_3_MEMBERS else exp *= YE::BATTLE::DISPLAY::VA_EXP_4_MEMBERS end exp /= 100 end exp *= 2 if actor.double_exp_gain exp *= extraper exp /= 100 return exp end #-------------------------------------------------------------------------- # full actors #-------------------------------------------------------------------------- def full_actors @full_actors = 0 if @full_actors == nil return @full_actors end end # class Window_Party_Exp_Front #=============================================================================== # Window_Party_Exp_Back #=============================================================================== class Window_Party_Exp_Back < Window_Base #-------------------------------------------------------------------------- # initialize #-------------------------------------------------------------------------- def initialize super(0, 112, 544, 176) self.back_opacity = YE::BATTLE::DISPLAY::VA_BACK_OPACITY refresh end #-------------------------------------------------------------------------- # refresh #-------------------------------------------------------------------------- def refresh(extraper = 0) self.contents.clear px = (self.width - 32) / 2 - ($game_party.members.size * 120) / 2 for actor in $game_party.members #--- self.contents.font.color = normal_color self.contents.font.size = Font.default_size py = 0 opacity = YE::BATTLE::DISPLAY::VA_FACE_OPACITY draw_party_face(actor, px + 12, py, opacity) self.contents.draw_text(px, py, 120, WLH, actor.name, 1) py += WLH * 3 if YE::BATTLE::DISPLAY::VA_SHOW_SPRITES draw_actor_graphic(actor, px + 60, py) end px += 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 # class Window_Party_Exp_Back #=============================================================================== # Window_Level_Up_Skills #=============================================================================== class Window_Level_Up_Skills < Window_Base #-------------------------------------------------------------------------- # initialize #-------------------------------------------------------------------------- def initialize(new_skills) super(340, 56, 204, 232) self.back_opacity = YE::BATTLE::DISPLAY::VA_BACK_OPACITY refresh(new_skills) end #-------------------------------------------------------------------------- # refresh #-------------------------------------------------------------------------- def refresh(skills) self.contents.clear dx = 0 dy = WLH / 4 self.contents.font.color = text_color(YE::BATTLE::DISPLAY::VA_SKILL_COLOUR) text = YE::BATTLE::DISPLAY::VA_SKILLS_TITLE self.contents.draw_text(dx, dy, self.width - 32, WLH, text, 1) dy += WLH + WLH / 4 for skill in skills break if (dy + WLH) > (self.height - 32) draw_skill_name(skill, dx, dy, true) dy += WLH end if skills == [] self.contents.font.color = normal_color dy = ((self.height - 32) / 2) - (WLH / 2) text = YE::BATTLE::DISPLAY::VA_SKILLS_NONE self.contents.draw_text(dx, dy, self.width - 32, WLH, text, 1) end end #-------------------------------------------------------------------------- # Draw Skill Name #-------------------------------------------------------------------------- def draw_skill_name(item, x, y, enabled = true) if item != nil draw_icon(item.icon_index, x, y, enabled) self.contents.font.color = normal_color self.contents.font.color.alpha = enabled ? 255 : 128 self.contents.draw_text(x + 24, y, 148, WLH, item.name) end end end #=============================================================================== # Window_Level_Up_Stats #=============================================================================== class Window_Level_Up_Stats < Window_Base #-------------------------------------------------------------------------- # initialize #-------------------------------------------------------------------------- def initialize(actor, condition) if condition super(0, 56, 340, 232) px = 0 else super(0, 56, 544, 232) px = (self.width - 32 - 324) / 2 end self.back_opacity = YE::BATTLE::DISPLAY::VA_BACK_OPACITY refresh(actor, px) end #-------------------------------------------------------------------------- # refresh #-------------------------------------------------------------------------- def refresh(actor, px) self.contents.clear py = WLH / 2 #--------------------------------------------- self.contents.font.color = normal_color self.contents.font.size = Font.default_size self.contents.draw_text(px, py, 110, WLH, actor.name, 1) py += WLH opacity = YE::BATTLE::DISPLAY::VA_FACE_OPACITY draw_party_face(actor, px + 7, py, opacity) py += WLH * 3 if YE::BATTLE::DISPLAY::VA_SHOW_SPRITES draw_actor_graphic(actor, px + 55, py) end py += WLH #--- pw = 96 gw = 96 gc1 = text_color(YE::BATTLE::DISPLAY::VA_LVL_UP_GAUGE1) gc2 = text_color(YE::BATTLE::DISPLAY::VA_LVL_UP_GAUGE2) self.contents.gradient_fill_rect(px + 7, py - 6, gw, 6, gc1, gc2) #--- self.contents.font.size = YE::BATTLE::DISPLAY::VA_FONT_SIZE colour = text_color(YE::BATTLE::DISPLAY::VA_LVL_UP_TEXT_COLOUR) self.contents.font.color = colour text = YE::BATTLE::DISPLAY::VA_LVL_UP_TEXT self.contents.draw_text(px, py, 110, WLH, text, 1) self.contents.font.color = normal_color #--- py += WLH expercent = 100.000 text = sprintf(YE::BATTLE::DISPLAY::VA_PERCENT_EXP, expercent) self.contents.draw_text(px, py - WLH * 2, 120, WLH, text, 1) text = sprintf(YE::BATTLE::DISPLAY::VA_LVL_UP_LEVEL, actor.level) self.contents.draw_text(px, py, 110, WLH, text, 1) #--- py = WLH / 2 px += 110 self.contents.font.size = YE::BATTLE::DISPLAY::VA_STAT_SIZE self.contents.font.color = text_color(YE::BATTLE::DISPLAY::VA_CAT_COLOUR) icon = YE::BATTLE::DISPLAY::VA_ICON_LEVEL text = YE::BATTLE::DISPLAY::VA_TEXT_LEVEL draw_icon(icon, px, py, true) self.contents.draw_text(px + 24, py, 60, WLH, text, 0); py += WLH icon = YE::BATTLE::DISPLAY::VA_ICON_MAXHP text = YE::BATTLE::DISPLAY::VA_TEXT_MAXHP draw_icon(icon, px, py, true) self.contents.draw_text(px + 24, py, 60, WLH, text, 0); py += WLH icon = YE::BATTLE::DISPLAY::VA_ICON_MAXMP text = YE::BATTLE::DISPLAY::VA_TEXT_MAXMP draw_icon(icon, px, py, true) self.contents.draw_text(px + 24, py, 60, WLH, text, 0); py += WLH icon = YE::BATTLE::DISPLAY::VA_ICON_ATK text = YE::BATTLE::DISPLAY::VA_TEXT_ATK draw_icon(icon, px, py, true) self.contents.draw_text(px + 24, py, 60, WLH, text, 0); py += WLH icon = YE::BATTLE::DISPLAY::VA_ICON_DEF text = YE::BATTLE::DISPLAY::VA_TEXT_DEF draw_icon(icon, px, py, true) self.contents.draw_text(px + 24, py, 60, WLH, text, 0); py += WLH icon = YE::BATTLE::DISPLAY::VA_ICON_SPI text = YE::BATTLE::DISPLAY::VA_TEXT_SPI draw_icon(icon, px, py, true) self.contents.draw_text(px + 24, py, 60, WLH, text, 0); py += WLH icon = YE::BATTLE::DISPLAY::VA_ICON_AGI text = YE::BATTLE::DISPLAY::VA_TEXT_AGI draw_icon(icon, px, py, true) self.contents.draw_text(px + 24, py, 60, WLH, text, 0); py += WLH #--- px += 64 py = WLH / 2 self.contents.font.color = text_color(YE::BATTLE::DISPLAY::VA_BEFORE_COLOUR) self.contents.draw_text(px, py, 60, WLH, $old_level[actor.id], 2); py += WLH self.contents.draw_text(px, py, 60, WLH, $old_maxhp[actor.id], 2); py += WLH self.contents.draw_text(px, py, 60, WLH, $old_maxmp[actor.id], 2); py += WLH self.contents.draw_text(px, py, 60, WLH, $old_atk[actor.id], 2); py += WLH self.contents.draw_text(px, py, 60, WLH, $old_def[actor.id], 2); py += WLH self.contents.draw_text(px, py, 60, WLH, $old_spi[actor.id], 2); py += WLH self.contents.draw_text(px, py, 60, WLH, $old_agi[actor.id], 2) #--- self.contents.font.color = text_color(YE::BATTLE::DISPLAY::VA_NEXT_COLOUR) px += 60 py = WLH / 2 if YE::BATTLE::DISPLAY::VA_NEXT_DISPLAY_TYPE == 1 text = YE::BATTLE::DISPLAY::VA_TEXT_NEXT for i in 0..6 self.contents.draw_text(px, py, 30, WLH, text, 1); py += WLH end else icon = YE::BATTLE::DISPLAY::VA_ICON_NEXT for i in 0..6 draw_icon(icon, px + 3, py, true); py += WLH end end #--- px += 30 py = WLH / 2 if YE::BATTLE::DISPLAY::VA_NEW_STAT_TYPE == 1 self.contents.font.color = text_color(YE::BATTLE::DISPLAY::VA_AFTER_COLOUR) self.contents.draw_text(px, py, 60, WLH, actor.level, 0); py += WLH self.contents.draw_text(px, py, 60, WLH, actor.maxhp, 0); py += WLH self.contents.draw_text(px, py, 60, WLH, actor.maxmp, 0); py += WLH self.contents.draw_text(px, py, 60, WLH, actor.atk, 0); py += WLH self.contents.draw_text(px, py, 60, WLH, actor.def, 0); py += WLH self.contents.draw_text(px, py, 60, WLH, actor.spi, 0); py += WLH self.contents.draw_text(px, py, 60, WLH, actor.agi, 0) else text = sprintf("%+d", actor.level - $old_level[actor.id]) self.contents.draw_text(px, py, 60, WLH, text, 0); py += WLH text = sprintf("%+d", actor.maxhp - $old_maxhp[actor.id]) self.contents.draw_text(px, py, 60, WLH, text, 0); py += WLH text = sprintf("%+d", actor.maxmp - $old_maxmp[actor.id]) self.contents.draw_text(px, py, 60, WLH, text, 0); py += WLH text = sprintf("%+d", actor.atk - $old_atk[actor.id]) self.contents.draw_text(px, py, 60, WLH, text, 0); py += WLH text = sprintf("%+d", actor.def - $old_def[actor.id]) self.contents.draw_text(px, py, 60, WLH, text, 0); py += WLH text = sprintf("%+d", actor.spi - $old_spi[actor.id]) self.contents.draw_text(px, py, 60, WLH, text, 0); py += WLH text = sprintf("%+d", actor.agi - $old_agi[actor.id]) self.contents.draw_text(px, py, 60, WLH, text, 0); py += WLH 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_Drops #=============================================================================== class Window_Drops < Window_Base #-------------------------------------------------------------------------- # initialize #-------------------------------------------------------------------------- def initialize(treasures) super(0, 112, 544, 248) self.back_opacity = YE::BATTLE::DISPLAY::VA_BACK_OPACITY refresh(treasures) end #-------------------------------------------------------------------------- # refresh #-------------------------------------------------------------------------- def refresh(treasures) self.contents.clear top = 0 px = 0 py = top drop_list = {} for item in treasures $game_party.gain_item(item, 1) if drop_list.has_key?(item) drop_list[item] += 1 else drop_list[item] = 1 end end drop_list = drop_list.sort{ |x,y| x[0].name <=> y[0].name y[1] <=> x[1] } drop_list.each { |item, count| text = sprintf(YE::BATTLE::DISPLAY::VA_DROP_AMOUNT, count) self.contents.draw_text(px, py, 50, WLH, text, 2) draw_item_name(item, px + 50, py) if YE::BATTLE::DISPLAY::VA_DROP_DISPLAY_TYPE == 1 py += WLH if py + WLH > self.height - 32 py = top px += (self.width - 32) / 2 end break if px > self.width - 32 else px += (self.width - 32) / 2 if px > self.width - 32 py += WLH px = 0 end break if py + WLH > self.height - 32 end } end end # Window Drops #=============================================================================== # # END OF FILE # #===============================================================================