Advertisement
Guest User

Yanfly Victory Aftermath

a guest
Aug 1st, 2012
1,153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 47.18 KB | None | 0 0
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Victory Aftermath v1.03
  4. # -- Last Updated: 2012.01.07
  5. # -- Level: Easy, Normal, Hard
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================
  9.  
  10. $imported = {} if $imported.nil?
  11. $imported["YEA-VictoryAftermath"] = true
  12.  
  13. #==============================================================================
  14. # ▼ Updates
  15. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  16. # 2012.08.01 - Added No quotes switch #Xypher
  17. # 2012.01.07 - Compatibility Update: JP Manager
  18. # 2012.01.01 - Bug Fixed: Quote tags were mislabeled.
  19. # 2011.12.26 - Compatibility Update: Command Autobattle
  20. # 2011.12.16 - Started Script and Finished.
  21. #
  22. #==============================================================================
  23. # ▼ Introduction
  24. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  25. # At the end of each battle, RPG Maker VX Ace by default shows text saying that
  26. # the party has gained so-and-so EXP while this person leveled up and your
  27. # party happened to find these drops. This script changes that text into
  28. # something more visual for your players to see. Active battle members will be
  29. # seen gaining EXP, any kind of level up changes, and a list of the items
  30. # obtained through drops.
  31. #
  32. #==============================================================================
  33. # ▼ Instructions
  34. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  35. # To install this script, open up your script editor and copy/paste this script
  36. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  37. #
  38. # -----------------------------------------------------------------------------
  39. # Actor Notetags - These notetags go in the actors notebox in the database.
  40. # -----------------------------------------------------------------------------
  41. # <win quotes>
  42. #  string
  43. #  string
  44. # </win quotes>
  45. # Sets the win quote for the actor. The strings are continuous and can use
  46. # text codes. Use \n for a line break. Type in what you want the actor to say
  47. # for the particular win quote. Use [New Quote] in between the two tags to
  48. # start up a new quote.
  49. #
  50. # <level quotes>
  51. #  string
  52. #  string
  53. # </level quotes>
  54. # Sets the level up quote for the actor. The strings are continuous and can use
  55. # text codes. Use \n for a line break. Type in what you want the actor to say
  56. # for the particular win quote. Use [New Quote] in between the two tags to
  57. # start up a new quote.
  58. #
  59. # <drops quotes>
  60. #  string
  61. #  string
  62. # </drops quotes>
  63. # Sets the drops quote for the actor. The strings are continuous and can use
  64. # text codes. Use \n for a line break. Type in what you want the actor to say
  65. # for the particular win quote. Use [New Quote] in between the two tags to
  66. # start up a new quote.
  67. #
  68. # -----------------------------------------------------------------------------
  69. # Class Notetags - These notetags go in the class notebox in the database.
  70. # -----------------------------------------------------------------------------
  71. # <win quotes>
  72. #  string
  73. #  string
  74. # </win quotes>
  75. # Sets the win quote for the class. The strings are continuous and can use
  76. # text codes. Use \n for a line break. Type in what you want the actor to say
  77. # for the particular win quote. Use [New Quote] in between the two tags to
  78. # start up a new quote.
  79. #
  80. # <level quotes>
  81. #  string
  82. #  string
  83. # </level quotes>
  84. # Sets the level up quote for the class. The strings are continuous and can use
  85. # text codes. Use \n for a line break. Type in what you want the actor to say
  86. # for the particular win quote. Use [New Quote] in between the two tags to
  87. # start up a new quote.
  88. #
  89. # <drops quotes>
  90. #  string
  91. #  string
  92. # </drops quotes>
  93. # Sets the drops quote for the class. The strings are continuous and can use
  94. # text codes. Use \n for a line break. Type in what you want the actor to say
  95. # for the particular win quote. Use [New Quote] in between the two tags to
  96. # start up a new quote.
  97. #
  98. #==============================================================================
  99. # ▼ Compatibility
  100. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  101. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  102. # it will run with RPG Maker VX without adjusting.
  103. #
  104. #==============================================================================
  105.  
  106. module YEA
  107.   module VICTORY_AFTERMATH
  108.    
  109.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  110.     # - General Settings -
  111.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  112.     # These are various settings that are used throughout the Victory Aftermath
  113.     # portion of a battle. Adjust them as you see fit.
  114.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  115.     VICTORY_BGM  = RPG::BGM.new("Field1", 100, 100)    # Victory BGM
  116.     VICTORY_TICK = RPG::SE.new("Decision1", 100, 150)  # EXP ticking SFX
  117.     LEVEL_SOUND  = RPG::SE.new("Up4", 80, 150)         # Level Up SFX
  118.     SKILLS_TEXT  = "New Skills"                        # New skills text title.
  119.    
  120.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  121.     # - Important Settings -
  122.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  123.     # These are some important settings so please set them up properly. This
  124.     # section includes a switch that allows you to skip the victory aftermath
  125.     # phase (for those back to back battles and making them seamless) and it
  126.     # also allows you to declare a common event to run after each battle. If
  127.     # you do not wish to use either of these features, set them to 0. The
  128.     # common event will run regardless of win or escape.
  129.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  130.     SKIP_AFTERMATH_SWITCH  = 0  # If switch on, skip aftermath. 0 to disable.
  131.     SKIP_MUSIC_SWITCH      = 0  # If switch on, skip music. 0 to disable.
  132.     AFTERMATH_COMMON_EVENT = 0  # Runs common event after battle. 0 to disable.
  133.     NO_QUOTES_SWITCH         = 10  # If switch on, skips quotes. 0 to disable
  134.    
  135.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  136.     # - Top Text Settings -
  137.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  138.     # Here, you can adjust the various text that appears in the window that
  139.     # appears at the top of the screen.
  140.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  141.     TOP_TEAM         = "%s's team"           # Team name used.
  142.     TOP_VICTORY_TEXT = "%s is victorious!"   # Text used to display victory.
  143.     TOP_LEVEL_UP     = "%s has leveled up!"  # Text used to display level up.
  144.     TOP_SPOILS       = "Victory Spoils!"     # Text used for spoils.
  145.    
  146.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  147.     # - EXP Gauge Settings -
  148.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  149.     # Adjust how the EXP Gauge appears for the Victory Aftermath here. This
  150.     # includes the text display, the font size, the colour of the gauges, and
  151.     # more. Adjust it all here.
  152.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  153.     VICTORY_EXP  = "+%sEXP"      # Text used to display EXP.
  154.     EXP_PERCENT  = "%1.2f%%"     # The way EXP percentage will be displayed.
  155.     LEVELUP_TEXT = "LEVEL UP!"   # Text to replace percentage when leveled.
  156.     MAX_LVL_TEXT = "MAX LEVEL"   # Text to replace percentage when max level.
  157.     FONTSIZE_EXP = 20            # Font size used for EXP.
  158.     EXP_TICKS    = 15            # Ticks to full EXP
  159.     EXP_GAUGE1   = 12            # "Window" skin text colour for gauge.
  160.     EXP_GAUGE2   = 4             # "Window" skin text colour for gauge.
  161.     LEVEL_GAUGE1 = 13            # "Window" skin text colour for leveling.
  162.     LEVEL_GAUGE2 = 5             # "Window" skin text colour for leveling.
  163.    
  164.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  165.     # - Victory Messages -
  166.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  167.     # In the Victory Aftermath, actors can say unique things. This is the pool
  168.     # of quotes used for actors without any custom victory quotes. Note that
  169.     # actors with custom quotes will take priority over classes with custom
  170.     # quotes, which will take priority over these default quotes. Use \n for
  171.     # a line break in the quotes.
  172.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  173.     HEADER_TEXT = "\e>\eC[6]%s\eC[0]\e<\n"  # Always at start of messages.
  174.     FOOTER_TEXT = ""                        # Always at end of messages.
  175.    
  176.     # Win Quotes are what the actors say when a battle is won.
  177.     VICTORY_QUOTES ={
  178.     # :type   => Quotes
  179.       #------------------------------------------------------------------------
  180.       :win    => [ # Occurs as initial victory quote.
  181.                    '"We won! What an exciting fight!"',
  182.                    '"I didn\'t even break a sweat."',
  183.                    '"That wasn\'t so tough."',
  184.                    '"Let\'s fight something harder!"',
  185.                  ],# Do not remove this.
  186.       #------------------------------------------------------------------------
  187.       :level  => [ # Occurs as initial victory quote.
  188.                    '"Yes! Level up!"',
  189.                    '"I\'ve gotten stronger!"',
  190.                    '"Try to keep up with me!"',
  191.                    '"I\'ve grown again!"',
  192.                  ],# Do not remove this.
  193.       #------------------------------------------------------------------------
  194.       :drops  => [ # Occurs as initial victory quote.
  195.                    '"I\'ll be taking these."',
  196.                    '"To the victor goes the spoils."',
  197.                    '"The enemies dropped something!"',
  198.                    '"Hey, what\'s this?"',
  199.                  ],# Do not remove this.
  200.       #------------------------------------------------------------------------
  201.     } # Do not remove this.
  202.    
  203.   end # VICTORY_AFTERMATH
  204. end # YEA
  205.  
  206. #==============================================================================
  207. # ▼ Editting anything past this point may potentially result in causing
  208. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  209. # halitosis so edit at your own risk.
  210. #==============================================================================
  211.  
  212. module YEA
  213.   module REGEXP
  214.   module BASEITEM
  215.    
  216.     NEW_QUOTE = /\[(?:NEW_QUOTE|new quote)\]/i
  217.    
  218.     WIN_QUOTE_ON    = /<(?:WIN_QUOTES|win quote|win quotes)>/i
  219.     WIN_QUOTE_OFF   = /<\/(?:WIN_QUOTES|win quote|win quotes)>/i
  220.     LEVEL_QUOTE_ON  = /<(?:LEVEL_QUOTES|level quote|level quotes)>/i
  221.     LEVEL_QUOTE_OFF = /<\/(?:LEVEL_QUOTES|level quote|level quotes)>/i
  222.     DROPS_QUOTE_ON  = /<(?:DROPS_QUOTES|drops quote|drops quotes)>/i
  223.     DROPS_QUOTE_OFF = /<\/(?:DROPS_QUOTES|drops quote|drops quotes)>/i
  224.    
  225.   end # BASEITEM
  226.   end # REGEXP
  227. end # YEA
  228.  
  229. #==============================================================================
  230. # ■ Switch
  231. #==============================================================================
  232.  
  233. module Switch
  234.  
  235.   #--------------------------------------------------------------------------
  236.   # self.skip_aftermath
  237.   #--------------------------------------------------------------------------
  238.   def self.skip_aftermath
  239.     return false if YEA::VICTORY_AFTERMATH::SKIP_AFTERMATH_SWITCH <= 0
  240.     return $game_switches[YEA::VICTORY_AFTERMATH::SKIP_AFTERMATH_SWITCH]
  241.   end
  242.  
  243.   #--------------------------------------------------------------------------
  244.   # self.skip_aftermath_music
  245.   #--------------------------------------------------------------------------
  246.   def self.skip_aftermath_music
  247.     return false if YEA::VICTORY_AFTERMATH::SKIP_MUSIC_SWITCH <=0
  248.     return $game_switches[YEA::VICTORY_AFTERMATH::SKIP_MUSIC_SWITCH]
  249.   end
  250.  
  251.  
  252.     def self.no_quotes
  253.     return false if YEA::VICTORY_AFTERMATH::NO_QUOTES_SWITCH <= 0
  254.     return $game_switches[YEA::VICTORY_AFTERMATH::NO_QUOTES_SWITCH]
  255.   end
  256.    
  257. end # Switch
  258.  
  259. #==============================================================================
  260. # ■ Numeric
  261. #==============================================================================
  262.  
  263. class Numeric
  264.  
  265.   #--------------------------------------------------------------------------
  266.   # new method: group_digits
  267.   #--------------------------------------------------------------------------
  268.   unless $imported["YEA-CoreEngine"]
  269.   def group; return self.to_s; end
  270.   end # $imported["YEA-CoreEngine"]
  271.    
  272. end # Numeric
  273.  
  274. #==============================================================================
  275. # ■ DataManager
  276. #==============================================================================
  277.  
  278. module DataManager
  279.  
  280.   #--------------------------------------------------------------------------
  281.   # alias method: load_database
  282.   #--------------------------------------------------------------------------
  283.   class <<self; alias load_database_va load_database; end
  284.   def self.load_database
  285.     load_database_va
  286.     load_notetags_va
  287.   end
  288.  
  289.   #--------------------------------------------------------------------------
  290.   # new method: load_notetags_va
  291.   #--------------------------------------------------------------------------
  292.   def self.load_notetags_va
  293.     groups = [$data_actors, $data_classes]
  294.     for group in groups
  295.       for obj in group
  296.         next if obj.nil?
  297.         obj.load_notetags_va
  298.       end
  299.     end
  300.   end
  301.  
  302. end # DataManager
  303.  
  304. #==============================================================================
  305. # ■ RPG::BaseItem
  306. #==============================================================================
  307.  
  308. class RPG::BaseItem
  309.  
  310.   #--------------------------------------------------------------------------
  311.   # public instance variables
  312.   #--------------------------------------------------------------------------
  313.   attr_accessor :win_quotes
  314.   attr_accessor :level_quotes
  315.   attr_accessor :drops_quotes
  316.  
  317.   #--------------------------------------------------------------------------
  318.   # common cache: load_notetags_va
  319.   #--------------------------------------------------------------------------
  320.   def load_notetags_va
  321.     @win_quotes = [""]
  322.     @level_quotes = [""]
  323.     @drops_quotes = [""]
  324.     @victory_quote_type = nil
  325.     #---
  326.     self.note.split(/[\r\n]+/).each { |line|
  327.       case line
  328.       #---
  329.       when YEA::REGEXP::BASEITEM::WIN_QUOTE_ON
  330.         @victory_quote_type = :win_quote
  331.       when YEA::REGEXP::BASEITEM::WIN_QUOTE_OFF
  332.         @victory_quote_type = nil
  333.       when YEA::REGEXP::BASEITEM::LEVEL_QUOTE_ON
  334.         @victory_quote_type = :level_quote
  335.       when YEA::REGEXP::BASEITEM::LEVEL_QUOTE_OFF
  336.         @victory_quote_type = nil
  337.       when YEA::REGEXP::BASEITEM::DROPS_QUOTE_ON
  338.         @victory_quote_type = :drops_quote
  339.       when YEA::REGEXP::BASEITEM::DROPS_QUOTE_OFF
  340.         @victory_quote_type = nil
  341.       #---
  342.       when YEA::REGEXP::BASEITEM::NEW_QUOTE
  343.         case @victory_quote_type
  344.         when nil; next
  345.         when :win_quote;   @win_quotes.push("")
  346.         when :level_quote; @level_quotes.push("")
  347.         when :drops_quote; @drops_quotes.push("")
  348.         end
  349.       #---
  350.       else
  351.         case @victory_quote_type
  352.         when nil; next
  353.         when :win_quote;   @win_quotes[@win_quotes.size-1] += line.to_s
  354.         when :level_quote; @level_quotes[@level_quotes.size-1] += line.to_s
  355.         when :drops_quote; @drops_quotes[@drops_quotes.size-1] += line.to_s
  356.         end
  357.       end
  358.     } # self.note.split
  359.     #---
  360.     return unless self.is_a?(RPG::Class)
  361.     quotes = YEA::VICTORY_AFTERMATH::VICTORY_QUOTES
  362.     @win_quotes = quotes[:win].clone if @win_quotes == [""]
  363.     @level_quotes = quotes[:level].clone if @level_quotes == [""]
  364.     @drops_quotes = quotes[:drops].clone if @drops_quotes == [""]
  365.   end
  366.  
  367. end # RPG::BaseItem
  368.  
  369. #==============================================================================
  370. # ■ BattleManager
  371. #==============================================================================
  372.  
  373. module BattleManager
  374.  
  375.   #--------------------------------------------------------------------------
  376.   # overwrite method: self.process_victory
  377.   #--------------------------------------------------------------------------
  378.   def self.process_victory
  379.     if $imported["YEA-CommandAutobattle"]
  380.       SceneManager.scene.close_disable_autobattle_window
  381.     end
  382.     return skip_aftermath if Switch.skip_aftermath
  383.     play_battle_end_me
  384.     gain_jp if $imported["YEA-JPManager"]
  385.     display_exp
  386.     gain_exp
  387.     gain_gold
  388.     gain_drop_items
  389.     close_windows
  390.     SceneManager.return
  391.     replay_bgm_and_bgs
  392.     battle_end(0)
  393.     return true
  394.   end
  395.  
  396.   #--------------------------------------------------------------------------
  397.   # new method: self.skip_aftermath
  398.   #--------------------------------------------------------------------------
  399.   def self.skip_aftermath
  400.     $game_party.all_members.each do |actor|
  401.       actor.gain_exp($game_troop.exp_total)
  402.     end
  403.     $game_party.gain_gold($game_troop.gold_total)
  404.     $game_troop.make_drop_items.each do |item|
  405.       $game_party.gain_item(item, 1)
  406.     end
  407.     close_windows
  408.     SceneManager.return
  409.     replay_bgm_and_bgs
  410.     battle_end(0)
  411.   end
  412.  
  413.   #--------------------------------------------------------------------------
  414.   # overwrite method: self.play_battle_end_me
  415.   #--------------------------------------------------------------------------
  416.   def self.play_battle_end_me
  417.     return if Switch.skip_aftermath_music
  418.     $game_system.battle_end_me.play
  419.     YEA::VICTORY_AFTERMATH::VICTORY_BGM.play
  420.   end
  421.  
  422.   #--------------------------------------------------------------------------
  423.   # new method: self.set_victory_text
  424.   #--------------------------------------------------------------------------
  425.   def self.set_victory_text(actor, type)
  426.     if Switch.no_quotes
  427.       text = ""
  428.     $game_message.background = 2
  429.     $game_message.face_name = ""
  430.     $game_message.face_index = 0
  431.       else
  432.     text = "" + sprintf(YEA::VICTORY_AFTERMATH::HEADER_TEXT, actor.name)
  433.     text += actor.victory_quotes(type)[rand(actor.victory_quotes(type).size)]
  434.     text += YEA::VICTORY_AFTERMATH::FOOTER_TEXT
  435.     $game_message.face_name = actor.face_name
  436.     $game_message.face_index = actor.face_index
  437.     end
  438.     $game_message.add(text)
  439.     wait_for_message
  440.   end
  441.  
  442.   #--------------------------------------------------------------------------
  443.   # overwrite method: self.display_exp
  444.   #--------------------------------------------------------------------------
  445.   def self.display_exp
  446.     SceneManager.scene.show_victory_display_exp
  447.     actor = $game_party.random_target
  448.     @victory_actor = actor
  449.     set_victory_text(@victory_actor, :win)
  450.   end
  451.  
  452.   #--------------------------------------------------------------------------
  453.   # overwrite method: self.gain_exp
  454.   #--------------------------------------------------------------------------
  455.   def self.gain_exp
  456.     $game_party.all_members.each do |actor|
  457.       temp_actor = Marshal.load(Marshal.dump(actor))
  458.       actor.gain_exp($game_troop.exp_total)
  459.       next if actor.level == temp_actor.level
  460.       SceneManager.scene.show_victory_level_up(actor, temp_actor)
  461.       set_victory_text(actor, :level)
  462.       wait_for_message
  463.     end
  464.   end
  465.  
  466.   #--------------------------------------------------------------------------
  467.   # overwrite method: self.gain_gold
  468.   #--------------------------------------------------------------------------
  469.   def self.gain_gold
  470.     $game_party.gain_gold($game_troop.gold_total)
  471.   end
  472.  
  473.   #--------------------------------------------------------------------------
  474.   # overwrite method: self.gain_drop_items
  475.   #--------------------------------------------------------------------------
  476.   def self.gain_drop_items
  477.     drops = []
  478.     $game_troop.make_drop_items.each do |item|
  479.       $game_party.gain_item(item, 1)
  480.       drops.push(item)
  481.     end
  482.     SceneManager.scene.show_victory_spoils($game_troop.gold_total, drops)
  483.     set_victory_text(@victory_actor, :drops)
  484.     wait_for_message
  485.   end
  486.  
  487.   #--------------------------------------------------------------------------
  488.   # new method: self.close_windows
  489.   #--------------------------------------------------------------------------
  490.   def self.close_windows
  491.     SceneManager.scene.close_victory_windows
  492.   end
  493.  
  494.   #--------------------------------------------------------------------------
  495.   # alias method: load_database
  496.   #--------------------------------------------------------------------------
  497.   class <<self; alias battle_end_va battle_end; end
  498.   def self.battle_end(result)
  499.     battle_end_va(result)
  500.     return if result == 2
  501.     return if YEA::VICTORY_AFTERMATH::AFTERMATH_COMMON_EVENT <= 0
  502.     event_id = YEA::VICTORY_AFTERMATH::AFTERMATH_COMMON_EVENT
  503.     $game_temp.reserve_common_event(event_id)
  504.   end
  505.  
  506. end # BattleManager
  507.  
  508. #==============================================================================
  509. # ■ Game_Actor
  510. #==============================================================================
  511.  
  512. class Game_Actor < Game_Battler
  513.  
  514.   #--------------------------------------------------------------------------
  515.   # overwrite method: gain_exp
  516.   #--------------------------------------------------------------------------
  517.   def gain_exp(exp)
  518.     enabled = !SceneManager.scene_is?(Scene_Battle)
  519.     change_exp(self.exp + (exp * final_exp_rate).to_i, enabled)
  520.   end
  521.  
  522.   #--------------------------------------------------------------------------
  523.   # new method: victory_quotes
  524.   #--------------------------------------------------------------------------
  525.   def victory_quotes(type)
  526.     case type
  527.     when :win
  528.       return self.actor.win_quotes if self.actor.win_quotes != [""]
  529.       return self.class.win_quotes
  530.     when :level
  531.       return self.actor.level_quotes if self.actor.level_quotes != [""]
  532.       return self.class.level_quotes
  533.     when :drops
  534.       return self.actor.drops_quotes if self.actor.drops_quotes != [""]
  535.       return self.class.drops_quotes
  536.     else
  537.       return ["NOTEXT"]
  538.     end
  539.   end
  540.  
  541. end # Game_Actor
  542.  
  543. #==============================================================================
  544. # ■ Window_VictoryTitle
  545. #==============================================================================
  546.  
  547. class Window_VictoryTitle < Window_Base
  548.  
  549.   #--------------------------------------------------------------------------
  550.   # initialize
  551.   #--------------------------------------------------------------------------
  552.   def initialize
  553.     super(0, 0, Graphics.width, fitting_height(1))
  554.     self.z = 200
  555.     self.openness = 0
  556.   end
  557.  
  558.   #--------------------------------------------------------------------------
  559.   # refresh
  560.   #--------------------------------------------------------------------------
  561.   def refresh(message = "")
  562.     contents.clear
  563.     draw_text(0, 0, contents.width, line_height, message, 1)
  564.   end
  565.  
  566. end # Window_VictoryTitle
  567.  
  568. #==============================================================================
  569. # ■ Window_VictoryEXP_Back
  570. #==============================================================================
  571.  
  572. class Window_VictoryEXP_Back < Window_Selectable
  573.  
  574.   #--------------------------------------------------------------------------
  575.   # initialize
  576.   #--------------------------------------------------------------------------
  577.   def initialize
  578.     super(0, fitting_height(1), Graphics.width, window_height)
  579.     self.z = 200
  580.     self.openness = 0
  581.   end
  582.  
  583.   #--------------------------------------------------------------------------
  584.   # window_height
  585.   #--------------------------------------------------------------------------
  586.   def window_height
  587.     if Switch.no_quotes
  588.     return Graphics.height - fitting_height(1)
  589.     else
  590.     return Graphics.height - fitting_height(4) - fitting_height(1)
  591.     end
  592.   end
  593.  
  594.   #--------------------------------------------------------------------------
  595.   # col_max
  596.   #--------------------------------------------------------------------------
  597.   def col_max; return item_max; end
  598.  
  599.   #--------------------------------------------------------------------------
  600.   # spacing
  601.   #--------------------------------------------------------------------------
  602.   def spacing; return 8; end
  603.  
  604.   #--------------------------------------------------------------------------
  605.   # item_max
  606.   #--------------------------------------------------------------------------
  607.   def item_max; return $game_party.battle_members.size; end
  608.  
  609.   #--------------------------------------------------------------------------
  610.   # open
  611.   #--------------------------------------------------------------------------
  612.   def open
  613.     @exp_total = $game_troop.exp_total
  614.     super
  615.   end
  616.  
  617.   #--------------------------------------------------------------------------
  618.   # item_rect
  619.   #--------------------------------------------------------------------------
  620.   def item_rect(index)
  621.     rect = Rect.new
  622.     rect.width = item_width
  623.     rect.height = contents.height
  624.     rect.x = index % col_max * (item_width + spacing)
  625.     rect.y = index / col_max * item_height
  626.     return rect
  627.   end
  628.  
  629.   #--------------------------------------------------------------------------
  630.   # draw_item
  631.   #--------------------------------------------------------------------------
  632.   def draw_item(index)
  633.     actor = $game_party.battle_members[index]
  634.     return if actor.nil?
  635.     rect = item_rect(index)
  636.     reset_font_settings
  637.     draw_actor_name(actor, rect)
  638.     draw_exp_gain(actor, rect)
  639.     draw_jp_gain(actor, rect)
  640.     draw_actor_face(actor, rect)
  641.   end
  642.  
  643.   #--------------------------------------------------------------------------
  644.   # draw_actor_name
  645.   #--------------------------------------------------------------------------
  646.   def draw_actor_name(actor, rect)
  647.     name = actor.name
  648.     draw_text(rect.x, rect.y+line_height, rect.width, line_height, name, 1)
  649.   end
  650.  
  651.   #--------------------------------------------------------------------------
  652.   # draw_actor_face
  653.   #--------------------------------------------------------------------------
  654.   def draw_actor_face(actor, rect)
  655.     face_name = actor.face_name
  656.     face_index = actor.face_index
  657.     bitmap = Cache.face(face_name)
  658.     rw = [rect.width, 96].min
  659.     face_rect = Rect.new(face_index % 4 * 96, face_index / 4 * 96, rw, 96)
  660.     rx = (rect.width - rw) / 2 + rect.x
  661.     contents.blt(rx, rect.y + line_height * 2, bitmap, face_rect, 255)
  662.   end
  663.  
  664.   #--------------------------------------------------------------------------
  665.   # draw_exp_gain
  666.   #--------------------------------------------------------------------------
  667.   def draw_exp_gain(actor, rect)
  668.     dw = rect.width - (rect.width - [rect.width, 96].min) / 2
  669.     dy = rect.y + line_height * 3 + 96
  670.     fmt = YEA::VICTORY_AFTERMATH::VICTORY_EXP
  671.     text = sprintf(fmt, actor_exp_gain(actor).group)
  672.     contents.font.size = YEA::VICTORY_AFTERMATH::FONTSIZE_EXP
  673.     change_color(power_up_color)
  674.     draw_text(rect.x, dy, dw, line_height, text, 2)
  675.   end
  676.  
  677.   #--------------------------------------------------------------------------
  678.   # actor_exp_gain
  679.   #--------------------------------------------------------------------------
  680.   def actor_exp_gain(actor)
  681.     n = @exp_total * actor.final_exp_rate
  682.     return n.to_i
  683.   end
  684.  
  685.   #--------------------------------------------------------------------------
  686.   # draw_jp_gain
  687.   #--------------------------------------------------------------------------
  688.   def draw_jp_gain(actor, rect)
  689.     return unless $imported["YEA-JPManager"]
  690.     dw = rect.width - (rect.width - [rect.width, 96].min) / 2
  691.     dy = rect.y + line_height * 4 + 96
  692.     fmt = YEA::JP::VICTORY_AFTERMATH
  693.     text = sprintf(fmt, actor_jp_gain(actor).group, Vocab::jp)
  694.     contents.font.size = YEA::VICTORY_AFTERMATH::FONTSIZE_EXP
  695.     change_color(power_up_color)
  696.     draw_text(rect.x, dy, dw, line_height, text, 2)
  697.   end
  698.  
  699.   #--------------------------------------------------------------------------
  700.   # actor_jp_gain
  701.   #--------------------------------------------------------------------------
  702.   def actor_jp_gain(actor)
  703.     n = actor.battle_jp_earned
  704.     if actor.exp + actor_exp_gain(actor) > actor.exp_for_level(actor.level + 1)
  705.       n += YEA::JP::LEVEL_UP unless actor.max_level?
  706.     end
  707.     return n
  708.   end
  709.  
  710. end # Window_VictoryEXP_Back
  711.  
  712. #==============================================================================
  713. # ■ Window_VictoryEXP_Front
  714. #==============================================================================
  715.  
  716. class Window_VictoryEXP_Front < Window_VictoryEXP_Back
  717.  
  718.   #--------------------------------------------------------------------------
  719.   # initialize
  720.   #--------------------------------------------------------------------------
  721.   def initialize
  722.     super
  723.     self.back_opacity = 0
  724.     @ticks = 0
  725.     @counter = 30
  726.     contents.font.size = YEA::VICTORY_AFTERMATH::FONTSIZE_EXP
  727.   end
  728.  
  729.   #--------------------------------------------------------------------------
  730.   # update
  731.   #--------------------------------------------------------------------------
  732.   def update
  733.     super
  734.     update_tick
  735.   end
  736.  
  737.   #--------------------------------------------------------------------------
  738.   # update_tick
  739.   #--------------------------------------------------------------------------
  740.   def update_tick
  741.     return unless self.openness >= 255
  742.     return unless self.visible
  743.     return if complete_ticks?
  744.     @counter -= 1
  745.     return unless @counter <= 0
  746.     return if @ticks >= YEA::VICTORY_AFTERMATH::EXP_TICKS
  747.     YEA::VICTORY_AFTERMATH::VICTORY_TICK.play
  748.     @counter = 4
  749.     @ticks += 1
  750.     refresh
  751.   end
  752.  
  753.   #--------------------------------------------------------------------------
  754.   # complete_ticks?
  755.   #--------------------------------------------------------------------------
  756.   def complete_ticks?
  757.     for actor in $game_party.battle_members
  758.       total_ticks = YEA::VICTORY_AFTERMATH::EXP_TICKS
  759.       bonus_exp = actor_exp_gain(actor) * @ticks / total_ticks
  760.       now_exp = actor.exp - actor.current_level_exp + bonus_exp
  761.       next_exp = actor.next_level_exp - actor.current_level_exp
  762.       rate = now_exp * 1.0 / next_exp
  763.       return false if rate < 1.0
  764.     end
  765.     return true
  766.   end
  767.  
  768.   #--------------------------------------------------------------------------
  769.   # draw_item
  770.   #--------------------------------------------------------------------------
  771.   def draw_item(index)
  772.     actor = $game_party.battle_members[index]
  773.     return if actor.nil?
  774.     rect = item_rect(index)
  775.     draw_actor_exp(actor, rect)
  776.   end
  777.  
  778.   #--------------------------------------------------------------------------
  779.   # exp_gauge1
  780.   #--------------------------------------------------------------------------
  781.   def exp_gauge1; return text_color(YEA::VICTORY_AFTERMATH::EXP_GAUGE1); end
  782.  
  783.   #--------------------------------------------------------------------------
  784.   # exp_gauge2
  785.   #--------------------------------------------------------------------------
  786.   def exp_gauge2; return text_color(YEA::VICTORY_AFTERMATH::EXP_GAUGE2); end
  787.  
  788.   #--------------------------------------------------------------------------
  789.   # lvl_gauge1
  790.   #--------------------------------------------------------------------------
  791.   def lvl_gauge1; return text_color(YEA::VICTORY_AFTERMATH::LEVEL_GAUGE1); end
  792.  
  793.   #--------------------------------------------------------------------------
  794.   # lvl_gauge2
  795.   #--------------------------------------------------------------------------
  796.   def lvl_gauge2; return text_color(YEA::VICTORY_AFTERMATH::LEVEL_GAUGE2); end
  797.  
  798.   #--------------------------------------------------------------------------
  799.   # draw_actor_exp
  800.   #--------------------------------------------------------------------------
  801.   def draw_actor_exp(actor, rect)
  802.     if actor.max_level?
  803.       draw_exp_gauge(actor, rect, 1.0)
  804.       return
  805.     end
  806.     total_ticks = YEA::VICTORY_AFTERMATH::EXP_TICKS
  807.     bonus_exp = actor_exp_gain(actor) * @ticks / total_ticks
  808.     now_exp = actor.exp - actor.current_level_exp + bonus_exp
  809.     next_exp = actor.next_level_exp - actor.current_level_exp
  810.     rate = now_exp * 1.0 / next_exp
  811.     draw_exp_gauge(actor, rect, rate)
  812.   end
  813.  
  814.   #--------------------------------------------------------------------------
  815.   # draw_exp_gauge
  816.   #--------------------------------------------------------------------------
  817.   def draw_exp_gauge(actor, rect, rate)
  818.     rate = [[rate, 1.0].min, 0.0].max
  819.     dx = (rect.width - [rect.width, 96].min) / 2 + rect.x
  820.     dy = rect.y + line_height * 2 + 96
  821.     dw = [rect.width, 96].min
  822.     colour1 = rate >= 1.0 ? lvl_gauge1 : exp_gauge1
  823.     colour2 = rate >= 1.0 ? lvl_gauge2 : exp_gauge2
  824.     draw_gauge(dx, dy, dw, rate, colour1, colour2)
  825.     fmt = YEA::VICTORY_AFTERMATH::EXP_PERCENT
  826.     text = sprintf(fmt, [rate * 100, 100.00].min)
  827.     if [rate * 100, 100.00].min == 100.00
  828.       text = YEA::VICTORY_AFTERMATH::LEVELUP_TEXT
  829.       text = YEA::VICTORY_AFTERMATH::MAX_LVL_TEXT if actor.max_level?
  830.     end
  831.     draw_text(dx, dy, dw, line_height, text, 1)
  832.   end
  833.  
  834. end # Window_VictoryEXP_Front
  835.  
  836. #==============================================================================
  837. # ■ Window_VictoryLevelUp
  838. #==============================================================================
  839.  
  840. class Window_VictoryLevelUp < Window_Base
  841.  
  842.   #--------------------------------------------------------------------------
  843.   # initialize
  844.   #--------------------------------------------------------------------------
  845.   def initialize
  846.     super(0, fitting_height(1), Graphics.width, window_height)
  847.     self.z = 200
  848.     hide
  849.   end
  850.  
  851.   #--------------------------------------------------------------------------
  852.   # window_height
  853.   #--------------------------------------------------------------------------
  854.   def window_height
  855.     if Switch.no_quotes
  856.     return Graphics.height - fitting_height(1)
  857.     else
  858.     return Graphics.height - fitting_height(4) - fitting_height(1)
  859.     end
  860.   end
  861.  
  862.   #--------------------------------------------------------------------------
  863.   # refresh
  864.   #--------------------------------------------------------------------------
  865.   def refresh(actor, temp_actor)
  866.     contents.clear
  867.     reset_font_settings
  868.     YEA::VICTORY_AFTERMATH::LEVEL_SOUND.play
  869.     draw_actor_changes(actor, temp_actor)
  870.   end
  871.  
  872.   #--------------------------------------------------------------------------
  873.   # draw_actor_changes
  874.   #--------------------------------------------------------------------------
  875.   def draw_actor_changes(actor, temp_actor)
  876.     dx = contents.width / 16
  877.     draw_actor_image(actor, temp_actor, dx)
  878.     draw_param_names(actor, dx)
  879.     draw_former_stats(temp_actor)
  880.     draw_arrows
  881.     draw_newer_stats(actor, temp_actor)
  882.     draw_new_skills(actor, temp_actor)
  883.   end
  884.  
  885.   #--------------------------------------------------------------------------
  886.   # draw_actor_image
  887.   #--------------------------------------------------------------------------
  888.   def draw_actor_image(actor, temp_actor, dx)
  889.     draw_text(dx, line_height, 96, line_height, actor.name, 1)
  890.     draw_actor_face(actor, dx, line_height * 2)
  891.     exp = actor.exp - temp_actor.exp
  892.     text = sprintf(YEA::VICTORY_AFTERMATH::VICTORY_EXP, exp.group)
  893.     change_color(power_up_color)
  894.     contents.font.size = YEA::VICTORY_AFTERMATH::FONTSIZE_EXP
  895.     draw_text(0, line_height * 2 + 96, dx + 96, line_height, text, 2)
  896.     reset_font_settings
  897.   end
  898.  
  899.   #--------------------------------------------------------------------------
  900.   # draw_param_names
  901.   #--------------------------------------------------------------------------
  902.   def draw_param_names(actor, dx)
  903.     dx += 108
  904.     change_color(system_color)
  905.     text = Vocab.level
  906.     draw_text(dx, 0, contents.width - dx, line_height, text)
  907.     dy = 0
  908.     for i in 0...8
  909.       dy += line_height
  910.       text = Vocab.param(i)
  911.       draw_text(dx, dy, contents.width - dx, line_height, text)
  912.     end
  913.   end
  914.  
  915.   #--------------------------------------------------------------------------
  916.   # draw_former_stats
  917.   #--------------------------------------------------------------------------
  918.   def draw_former_stats(actor)
  919.     dw = contents.width / 2 - 12
  920.     dy = 0
  921.     change_color(normal_color)
  922.     draw_text(0, dy, dw, line_height, actor.level.group, 2)
  923.     for i in 0...8
  924.       dy += line_height
  925.       draw_text(0, dy, dw, line_height, actor.param(i).group, 2)
  926.     end
  927.   end
  928.  
  929.   #--------------------------------------------------------------------------
  930.   # draw_arrows
  931.   #--------------------------------------------------------------------------
  932.   def draw_arrows
  933.     dx = contents.width / 2 - 12
  934.     dy = 0
  935.     change_color(system_color)
  936.     for i in 0..8
  937.       draw_text(dx, dy, 24, line_height, "→", 1)
  938.       dy += line_height
  939.     end
  940.   end
  941.  
  942.   #--------------------------------------------------------------------------
  943.   # draw_newer_stats
  944.   #--------------------------------------------------------------------------
  945.   def draw_newer_stats(actor, temp_actor)
  946.     dx = contents.width / 2 + 12
  947.     dw = contents.width - dx
  948.     dy = 0
  949.     change_color(param_change_color(actor.level - temp_actor.level))
  950.     draw_text(dx, dy, dw, line_height, actor.level.group, 0)
  951.     for i in 0...8
  952.       dy += line_height
  953.       change_color(param_change_color(actor.param(i) - temp_actor.param(i)))
  954.       draw_text(dx, dy, dw, line_height, actor.param(i).group, 0)
  955.     end
  956.   end
  957.  
  958.   #--------------------------------------------------------------------------
  959.   # draw_new_skills
  960.   #--------------------------------------------------------------------------
  961.   def draw_new_skills(actor, temp_actor)
  962.     return if temp_actor.skills.size == actor.skills.size
  963.     dw = 172 + 24
  964.     dx = contents.width - dw
  965.     change_color(system_color)
  966.     text = YEA::VICTORY_AFTERMATH::SKILLS_TEXT
  967.     draw_text(dx, 0, dw, line_height, text, 0)
  968.   end
  969.  
  970. end # Window_VictoryLevelUp
  971.  
  972. #==============================================================================
  973. # ■ Window_VictorySkills
  974. #==============================================================================
  975.  
  976. class Window_VictorySkills < Window_Selectable
  977.  
  978.   #--------------------------------------------------------------------------
  979.   # initialize
  980.   #--------------------------------------------------------------------------
  981.   def initialize
  982.     dy = fitting_height(1) + 24
  983.    
  984.     dw = 172 + 24 + 24
  985.     if Switch.no_quotes
  986.       dh = Graphics.height - fitting_height(1) - 24
  987.       else
  988.     dh = Graphics.height - fitting_height(4) - fitting_height(1) - 24
  989.     end
  990.     super(Graphics.width - dw, dy, dw, dh)
  991.     self.opacity = 0
  992.     self.z = 200
  993.     hide
  994.   end
  995.  
  996.   #--------------------------------------------------------------------------
  997.   # item_max
  998.   #--------------------------------------------------------------------------
  999.   def item_max; return @data.nil? ? 0 : @data.size; end
  1000.  
  1001.   #--------------------------------------------------------------------------
  1002.   # refresh
  1003.   #--------------------------------------------------------------------------
  1004.   def refresh(actor, temp_actor)
  1005.     contents.clear
  1006.     if actor.skills.size == temp_actor.skills.size
  1007.       unselect
  1008.       @data = []
  1009.       create_contents
  1010.       return
  1011.     end
  1012.     @data = actor.skills - temp_actor.skills
  1013.     if @data.size > 8
  1014.       select(0)
  1015.       activate
  1016.     else
  1017.       unselect
  1018.       deactivate
  1019.     end
  1020.     create_contents
  1021.     draw_all_items
  1022.   end
  1023.  
  1024.   #--------------------------------------------------------------------------
  1025.   # refresh
  1026.   #--------------------------------------------------------------------------
  1027.   def draw_item(index)
  1028.     rect = item_rect(index)
  1029.     skill = @data[index]
  1030.     return if skill.nil?
  1031.     rect.width -= 4
  1032.     draw_item_name(skill, rect.x, rect.y, true)
  1033.   end
  1034.  
  1035. end # Window_VictorySkills
  1036.  
  1037. #==============================================================================
  1038. # ■ Window_VictorySpoils
  1039. #==============================================================================
  1040.  
  1041. class Window_VictorySpoils < Window_ItemList
  1042.  
  1043.   #--------------------------------------------------------------------------
  1044.   # initialize
  1045.   #--------------------------------------------------------------------------
  1046.   def initialize
  1047.     super(0, fitting_height(1), Graphics.width, window_height)
  1048.     self.z = 200
  1049.     hide
  1050.   end
  1051.  
  1052.   #--------------------------------------------------------------------------
  1053.   # window_height
  1054.   #--------------------------------------------------------------------------
  1055.   def window_height
  1056.     if Switch.no_quotes
  1057.     return Graphics.height - fitting_height(1)
  1058.     else
  1059.     return Graphics.height - fitting_height(4) - fitting_height(1)
  1060.     end
  1061.   end
  1062.  
  1063.   #--------------------------------------------------------------------------
  1064.   # spacing
  1065.   #--------------------------------------------------------------------------
  1066.   def spacing; return 32; end
  1067.  
  1068.   #--------------------------------------------------------------------------
  1069.   # make
  1070.   #--------------------------------------------------------------------------
  1071.   def make(gold, drops)
  1072.     @gold = gold
  1073.     @drops = drops
  1074.     refresh
  1075.     select(0)
  1076.     activate
  1077.   end
  1078.  
  1079.   #--------------------------------------------------------------------------
  1080.   # make_item_list
  1081.   #--------------------------------------------------------------------------
  1082.   def make_item_list
  1083.     @data = [nil]
  1084.     items = {}
  1085.     weapons = {}
  1086.     armours = {}
  1087.     @goods = {}
  1088.     for item in @drops
  1089.       case item
  1090.       when RPG::Item
  1091.         items[item] = 0 if items[item].nil?
  1092.         items[item] += 1
  1093.       when RPG::Weapon
  1094.         weapons[item] = 0 if weapons[item].nil?
  1095.         weapons[item] += 1
  1096.       when RPG::Armor
  1097.         armours[item] = 0 if armours[item].nil?
  1098.         armours[item] += 1
  1099.       end
  1100.     end
  1101.     items = items.sort { |a,b| a[0].id <=> b[0].id }
  1102.     weapons = weapons.sort { |a,b| a[0].id <=> b[0].id }
  1103.     armours = armours.sort { |a,b| a[0].id <=> b[0].id }
  1104.     for key in items; @goods[key[0]] = key[1]; @data.push(key[0]); end
  1105.     for key in weapons; @goods[key[0]] = key[1]; @data.push(key[0]); end
  1106.     for key in armours; @goods[key[0]] = key[1]; @data.push(key[0]); end
  1107.   end
  1108.  
  1109.   #--------------------------------------------------------------------------
  1110.   # draw_item
  1111.   #--------------------------------------------------------------------------
  1112.   def draw_item(index)
  1113.     item = @data[index]
  1114.     rect = item_rect(index)
  1115.     reset_font_settings
  1116.     if item.nil?
  1117.       draw_gold(rect)
  1118.       return
  1119.     end
  1120.     rect.width -= 4
  1121.     draw_item_name(item, rect.x, rect.y, true, rect.width - 24)
  1122.     draw_item_number(rect, item)
  1123.   end
  1124.  
  1125.   #--------------------------------------------------------------------------
  1126.   # draw_gold
  1127.   #--------------------------------------------------------------------------
  1128.   def draw_gold(rect)
  1129.     text = Vocab.currency_unit
  1130.     draw_currency_value(@gold, text, rect.x, rect.y, rect.width)
  1131.   end
  1132.  
  1133.   #--------------------------------------------------------------------------
  1134.   # draw_item_number
  1135.   #--------------------------------------------------------------------------
  1136.   def draw_item_number(rect, item)
  1137.     number = @goods[item].group
  1138.     if $imported["YEA-AdjustLimits"]
  1139.       contents.font.size = YEA::LIMIT::ITEM_FONT
  1140.       text = sprintf(YEA::LIMIT::ITEM_PREFIX, number)
  1141.       draw_text(rect, text, 2)
  1142.     else
  1143.       draw_text(rect, sprintf(":%s", number), 2)
  1144.     end
  1145.   end
  1146.  
  1147. end # Window_VictorySpoils
  1148.  
  1149. #==============================================================================
  1150. # ■ Scene_Battle
  1151. #==============================================================================
  1152.  
  1153. class Scene_Battle < Scene_Base
  1154.  
  1155.   #--------------------------------------------------------------------------
  1156.   # alias method: create_all_windows
  1157.   #--------------------------------------------------------------------------
  1158.   alias scene_battle_create_all_windows_va create_all_windows
  1159.   def create_all_windows
  1160.     scene_battle_create_all_windows_va
  1161.     create_victory_aftermath_windows
  1162.   end
  1163.  
  1164.   #--------------------------------------------------------------------------
  1165.   # new method: create_victory_aftermath_windows
  1166.   #--------------------------------------------------------------------------
  1167.   def create_victory_aftermath_windows
  1168.     @victory_title_window = Window_VictoryTitle.new
  1169.     @victory_exp_window_back = Window_VictoryEXP_Back.new
  1170.     @victory_exp_window_front = Window_VictoryEXP_Front.new
  1171.     @victory_level_window = Window_VictoryLevelUp.new
  1172.     @victory_level_skills = Window_VictorySkills.new
  1173.     @victory_spoils_window = Window_VictorySpoils.new
  1174.   end
  1175.  
  1176.   #--------------------------------------------------------------------------
  1177.   # new method: show_victory_display_exp
  1178.   #--------------------------------------------------------------------------
  1179.   def show_victory_display_exp
  1180.     @victory_title_window.open
  1181.     name = $game_party.battle_members[0].name
  1182.     fmt = YEA::VICTORY_AFTERMATH::TOP_TEAM
  1183.     name = sprintf(fmt, name) if $game_party.battle_members.size > 1
  1184.     fmt = YEA::VICTORY_AFTERMATH::TOP_VICTORY_TEXT
  1185.     text = sprintf(fmt, name)
  1186.     @victory_title_window.refresh(text)
  1187.     #---
  1188.     @victory_exp_window_back.open
  1189.     @victory_exp_window_back.refresh
  1190.     @victory_exp_window_front.open
  1191.     @victory_exp_window_front.refresh
  1192.   end
  1193.  
  1194.   #--------------------------------------------------------------------------
  1195.   # new method: show_victory_level_up
  1196.   #--------------------------------------------------------------------------
  1197.   def show_victory_level_up(actor, temp_actor)
  1198.     @victory_exp_window_back.hide
  1199.     @victory_exp_window_front.hide
  1200.     #---
  1201.     fmt = YEA::VICTORY_AFTERMATH::TOP_LEVEL_UP
  1202.     text = sprintf(fmt, actor.name)
  1203.     @victory_title_window.refresh(text)
  1204.     #---
  1205.     @victory_level_window.show
  1206.     @victory_level_window.refresh(actor, temp_actor)
  1207.     @victory_level_skills.show
  1208.     @victory_level_skills.refresh(actor, temp_actor)
  1209.   end
  1210.  
  1211.   #--------------------------------------------------------------------------
  1212.   # new method: show_victory_spoils
  1213.   #--------------------------------------------------------------------------
  1214.   def show_victory_spoils(gold, drops)
  1215.     @victory_exp_window_back.hide
  1216.     @victory_exp_window_front.hide
  1217.     @victory_level_window.hide
  1218.     @victory_level_skills.hide
  1219.     #---
  1220.     text = YEA::VICTORY_AFTERMATH::TOP_SPOILS
  1221.     @victory_title_window.refresh(text)
  1222.     #---
  1223.     @victory_spoils_window.show
  1224.     @victory_spoils_window.make(gold, drops)
  1225.   end
  1226.  
  1227.   #--------------------------------------------------------------------------
  1228.   # new method: close_victory_windows
  1229.   #--------------------------------------------------------------------------
  1230.   def close_victory_windows
  1231.     @victory_title_window.close
  1232.     @victory_exp_window_back.close
  1233.     @victory_exp_window_front.close
  1234.     @victory_level_window.close
  1235.     @victory_level_skills.close
  1236.     @victory_spoils_window.close
  1237.     wait(16)
  1238.   end
  1239.  
  1240. end # Scene_Battle
  1241.  
  1242. #==============================================================================
  1243. #
  1244. # ▼ End of File
  1245. #
  1246. #==============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement