#=============================================================================== # # Yanfly Engine RD Victory Aftermath Extra Page - Gain JP # Last Date Updated: 2009.05.01 # Level: Normal, Lunatic # # - Requires: Yanfly Engine: Display Victory Aftermath # - Requires: Yanfly Engine: Subclass Selection System # # This is an add-on for Display Victory Aftermath. That said, this script will # absolutely require you to possess Display Victory Aftermath should these # options be displayed. Also on the same aspect, this script requires having # the Subclass Selection system that this script is practically made for. # # This script is plug and play. It'll show an extra page with the various pages # under victory aftermath to show the amount of JP earned per character. In # addition to that, it also shows the total JP accumulated for that character's # primary class. # #=============================================================================== # Updates: # ---------------------------------------------------------------------------- # o 2009.05.01 - Started script and finished. #=============================================================================== # # Compatibility # - Alias: Scene_Battle: display_extra_pages # #=============================================================================== $imported = {} if $imported == nil $imported["VictoryAftermathExtras"] = true $imported["VAEP-GainJP"] = true module YE module SUBCLASS # This needs to be enabled if you wish to use it with Yanfly Engine ReDux's # Display Victory Aftermath script. ENABLE_VICTORY_AFTERMATH_JP_PAGES = true # This decides what kind of title will be displayed. JP_VICTORY_TITLE = "Acquired %d JP from Battle" JP_GAIN_SOUND = RPG::SE.new("Fog2", 80, 100) # This is the message displayed during the JP earned phase. JP_EARNED_MESSAGE = "%s earns %d JP from battle." JP_EARNED_TOTAL = "Individual JP Gains" # This determines how the JP gains appear in the victory screen. JP_EARNED_COLOUR = 24 JP_EARNED_DATA = "%+d JP" end end #=============================================================================== # How to Use: Lunatic Mode #=============================================================================== # # This section is an add-on for Display Victory Aftermath should you choose to # enable personal actor quotes. It works just like any other personal actor # quotes set (if you've used them before) so now, your actors have a new set of # quotes to display for battle. # # ACTOR_JP_MSG # Adjusts what the actor says during JP earning screen. # #=============================================================================== module YE module HASH ACTOR_JP_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]\\<", "\"Let's learn some new abilities!\"", " ", " "], [# This is the 2nd random message that can be said. "\\>\\c[6]\\n[1]\\c[0]\\<", "\"What new skills should I acquire?\"", " ", " "], [# This is the 3rd random message that can be said. "\\>\\c[6]\\n[1]\\c[0]\\<", "\"Now I can be stronger.\"", " ", " "], ],# 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]\\<", "\"Is that all? So be it.\"", " ", " "], ],# 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]\\<", "\"Hmmm, what should I learn?\"", " ", " "], ],# 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]\\<", "\"For GLORY!", " For HONOR!", " For EVER!\""], ],# 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]\\<", "\"New possibilities await.\"", " ", " "], ],# This ends Actor 4 # Actor.ID => # ---------------------------------------------------------- } # Do not remove this. end end #=============================================================================== # 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. #=============================================================================== #============================================================================== # Scene_Battle #============================================================================== class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # alias display_extra_pages #-------------------------------------------------------------------------- alias display_extra_pages_sss display_extra_pages unless $@ def display_extra_pages create_jp_pages if $imported["SubclassSelectionSystem"] display_extra_pages_sss end #-------------------------------------------------------------------------- # alias hidden_extra_pages #-------------------------------------------------------------------------- alias hidden_extra_pages_sss hidden_extra_pages unless $@ def hidden_extra_pages hidden_extra_pages_sss jp_earned = $game_troop.jp_total if $imported["SubclassSelectionSystem"] for actor in $game_party.existing_members actor.gain_jp(jp_earned) if $imported["SubclassSelectionSystem"] end end #-------------------------------------------------------------------------- # create JP pages #-------------------------------------------------------------------------- def create_jp_pages return unless YE::SUBCLASS::ENABLE_VICTORY_AFTERMATH_JP_PAGES hide_1st_page_windows #----- jp_earned = $game_troop.jp_total for actor in $game_party.members actor.gain_jp(jp_earned) end unless YE::SUBCLASS::JP_GAIN_SOUND == nil YE::SUBCLASS::JP_GAIN_SOUND.play if jp_earned > 0 end @jp_victory_window = Window_Base.new(0, 0, 544, 56) text = sprintf(YE::SUBCLASS::JP_VICTORY_TITLE, jp_earned) @jp_victory_window.contents.draw_text(2, 0, 504, 24, text, 1) @jp_victory_window.back_opacity = YE::BATTLE::DISPLAY::VA_BACK_OPACITY @jp_victory_window.visible = true #----- @party_jp_window = Window_Party_Jp.new #----- 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 YE::HASH::ACTOR_JP_MSG.include?(@ractor) msg_array = YE::HASH::ACTOR_JP_MSG[@ractor] $game_actors[1].name = original_name else msg_array = YE::HASH::ACTOR_JP_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(YE::SUBCLASS::JP_EARNED_MESSAGE, $game_party.name, jp_earned) $game_message.texts.push(text) end wait_for_message $game_actors[1].name = original_name dispose_jp_windows end #-------------------------------------------------------------------------- # dispose jp windows #-------------------------------------------------------------------------- def dispose_jp_windows @jp_victory_window.dispose if @jp_victory_window != nil @party_jp_window.dispose if @party_jp_window != nil end end #=============================================================================== # Window_Party_Jp #=============================================================================== class Window_Party_Jp < Window_Base #-------------------------------------------------------------------------- # initialize #-------------------------------------------------------------------------- def initialize super(0, 56, 544, 232) self.back_opacity = YE::BATTLE::DISPLAY::VA_BACK_OPACITY refresh end #-------------------------------------------------------------------------- # refresh #-------------------------------------------------------------------------- def refresh self.contents.clear sw = self.width - 32 #--- text = YE::SUBCLASS::JP_EARNED_TOTAL self.contents.draw_text(0, WLH / 2, sw, WLH, text, 1) #--- members = $game_party.members.size 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 = WLH * 2 + WLH / 2 - 4 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 #--- self.contents.font.color = text_color(YE::SUBCLASS::JP_EARNED_COLOUR) text = sprintf(YE::SUBCLASS::JP_EARNED_DATA, actor.jp_counter) self.contents.draw_text(px, py, 106, WLH, text, 2) py += WLH #--- self.contents.font.color = normal_color icon = YE::SUBCLASS::JP_ICON draw_icon(icon, px+12, py) text = sprintf(YE::SUBCLASS::JP_DEFINITION, actor.class_jp(actor.class.id)) self.contents.draw_text(px, py, 106, WLH, text, 2) #--- 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 #Window_Party_Jp #=============================================================================== # # END OF FILE # #===============================================================================