Project1

标题: 请问怎么在升级后能直接显示能力变动的资料 [打印本页]

作者: tidusm    时间: 2012-12-20 21:53
标题: 请问怎么在升级后能直接显示能力变动的资料
请问怎么在升级后能直接显示能力变动的资料
作者: KyoCheng    时间: 2012-12-21 02:10
RUBY 代码复制
  1. #==============================================================================
  2. # ** Victor Engine - Basic Module
  3. #------------------------------------------------------------------------------
  4. # Author : Victor Sant
  5. #
  6. # Version History:
  7. #  v 1.00 - 2011.12.19 > First relase
  8. #  v 1.01 - 2011.12.21 > Added Event Troop notes
  9. #  v 1.02 - 2011.12.22 > Added character frames value
  10. #  v 1.03 - 2011.12.30 > Added Actor and Enemy notes
  11. #  v 1.04 - 2012.01.01 > Added party average level and map actors
  12. #  v 1.05 - 2012.01.04 > Compatibility with Characters Scripts
  13. #  v 1.06 - 2012.01.07 > Compatibility with Fog and Light Effect
  14. #                      > Added new Sprite Character functions
  15. #  v 1.07 - 2012.01.11 > Compatibility with Control Text and Codes
  16. #  v 1.08 - 2012.01.13 > Compatibility with Trait Control
  17. #  v 1.09 - 2012.01.15 > Fixed the Regular Expressions problem with "" and “”
  18. #  v 1.10 - 2012.01.18 > Compatibility with Automatic Battlers
  19. #  v 1.11 - 2012.01.26 > Compatibility with Followers Options
  20. #                        Compatibility with Animated Battle beta
  21. #  v 1.12 - 2012.02.08 > Compatibility with Animated Battle
  22. #  v 1.13 - 2012.02.18 > Fix for non RTP dependant encrypted projects
  23. #  v 1.14 - 2012.03.11 > Better version handling and required messages
  24. #  v 1.15 - 2012.03.11 > Added level variable for enemies (to avoid crashes)
  25. #  v 1.16 - 2012.03.21 > Compatibility with Follower Control
  26. #  v 1.17 - 2012.03.22 > Compatibility with Follower Control new method
  27. #------------------------------------------------------------------------------
  28. #   This is the basic script for the system from Victory Engine and is
  29. # required to use the scripts from the engine. This script offer some new
  30. # functions to be used within many scripts of the engine.
  31. #------------------------------------------------------------------------------
  32. # Compatibility
  33. #   Required for the Victor Engine
  34. #
  35. # * Overwrite methods (Default)
  36. #   module Cache
  37. #     def self.character(filename)
  38. #
  39. #   class Sprite_Character < Sprite_Base
  40. #     def set_character_bitmap
  41. #
  42. # * Alias methods (Default)
  43. #   class Game_Interpreter
  44. #     def command_108
  45. #
  46. #   class Window_Base < Window
  47. #     def convert_escape_characters(text)
  48. #
  49. #------------------------------------------------------------------------------
  50. # Instructions:
  51. #  To instal the script, open you script editor and paste this script on
  52. #  a new section on bellow the Materials section.
  53. #
  54. #------------------------------------------------------------------------------
  55. # New functions
  56. #
  57. # * Random number between two vales
  58. #   rand_between(min, max)
  59. #    min : min value
  60. #    max : max value
  61. #   Can be called from any class, this method return an random value between
  62. #   two specific numbers
  63. #
  64. # * Random array value
  65. #   <Array>.random
  66. #   <Array>.random!
  67. #   Returns a random object from the array, the method .random! is destructive,
  68. #   removing the value returned from the array.
  69. #
  70. # * Sum of the numeric values of a array
  71. #   <Array>.sum
  72. #   Returns the sum of all numeric values
  73. #
  74. # * Avarage of all numeric values from the array
  75. #   <Array>.average(float = false)
  76. #    float : float flag
  77. #   Returns the average of all numeric values, if floa is true, the value
  78. #   returned is a float, otherwise it's a integer.
  79. #
  80. # * Note for events
  81. #   <Event>.note
  82. #   By default, events doesn't have note boxes. This command allows to use
  83. #   comments as note boxes, following the same format as the ones on the
  84. #   database. Returns all comments on the active page of the event.
  85. #
  86. # * Comment calls
  87. #   <Event>.comment_call
  88. #   Another function for comment boxes, by default, they have absolutely no
  89. #   effect in game when called. But this method allows to make the comment
  90. #   box to behave like an script call, but with the versatility of the
  91. #   note boxes. Remember that the commands will only take effect if there
  92. #   is scripts to respond to the comment code.
  93. #
  94. #==============================================================================
  95.  
  96. #==============================================================================
  97. # ** Victor Engine
  98. #------------------------------------------------------------------------------
  99. #   Setting module for the Victor Engine
  100. #==============================================================================
  101.  
  102. module Victor_Engine
  103.   #--------------------------------------------------------------------------
  104.   # * New method: required_script
  105.   #--------------------------------------------------------------------------
  106.   def self.required_script(name, req, version, type = 0)
  107.     if type != :bellow && (!$imported[req] || $imported[req] < version)
  108.       msg = "The script '%s' requires the script\n"
  109.       case type
  110.       when :above
  111.         msg += "'%s' v%s or higher above it to work properly\n"
  112.       else
  113.         msg += "'%s' v%s or higher to work properly\n"
  114.       end
  115.       msg += "Go to [url]http://victorscripts.wordpress.com/[/url] to download this script."
  116.       self.exit_message(msg, name, req, version)
  117.     elsif type == :bellow && $imported[req]
  118.       msg =  "The script '%s' requires the script\n"
  119.       msg += "'%s' to be put bellow it\n"
  120.       msg += "move the scripts to the proper position"
  121.       self.exit_message(msg, name, req, version)
  122.     end
  123.   end
  124.   #--------------------------------------------------------------------------
  125.   # * New method: exit_message
  126.   #--------------------------------------------------------------------------
  127.   def self.exit_message(message, name, req, version)
  128.     name = self.script_name(name)
  129.     req  = self.script_name(req)
  130.     msgbox(sprintf(message, name, req, version))
  131.     exit
  132.   end
  133.   #--------------------------------------------------------------------------
  134.   # * New method: script_name
  135.   #--------------------------------------------------------------------------
  136.   def self.script_name(name, ext = "VE")
  137.     name = name.to_s.gsub("_", " ").upcase.split
  138.     name.collect! {|char| char == ext ? "#{char} -" : char.capitalize }
  139.     name.join(" ")
  140.   end
  141. end
  142.  
  143. $imported ||= {}
  144. $imported[:ve_basic_module] = 1.17
  145.  
  146. #==============================================================================
  147. # ** Object
  148. #------------------------------------------------------------------------------
  149. #  This class is the superclass of all other classes.
  150. #==============================================================================
  151.  
  152. class Object
  153.   #--------------------------------------------------------------------------
  154.   # * Include setting module
  155.   #--------------------------------------------------------------------------
  156.   include Victor_Engine
  157.   #-------------------------------------------------------------------------
  158.   # * New method: rand_between
  159.   #-------------------------------------------------------------------------
  160.   def rand_between(min, max)
  161.     min + rand(max - min + 1)
  162.   end
  163.   #--------------------------------------------------------------------------
  164.   # * New method: numeric?
  165.   #--------------------------------------------------------------------------
  166.   def numeric?
  167.     return false
  168.   end
  169.   #--------------------------------------------------------------------------
  170.   # * New method: float?
  171.   #--------------------------------------------------------------------------
  172.   def float?
  173.     return false
  174.   end
  175.   #--------------------------------------------------------------------------
  176.   # * New method: item?
  177.   #--------------------------------------------------------------------------
  178.   def item?
  179.     return false
  180.   end
  181.   #--------------------------------------------------------------------------
  182.   # * New method: skill?
  183.   #--------------------------------------------------------------------------
  184.   def skill?
  185.     return false
  186.   end
  187.   #--------------------------------------------------------------------------
  188.   # * New method: file_exist?
  189.   #--------------------------------------------------------------------------
  190.   def file_exist?(path, filename)
  191.     $file_list ||= {}
  192.     $file_list[path + filename] ||= file_test(path, filename)
  193.     $file_list[path + filename] == :exist
  194.   end
  195.   #--------------------------------------------------------------------------
  196.   # * New method: get_file_list
  197.   #--------------------------------------------------------------------------
  198.   def file_test(path, filename)
  199.     bitmap = Cache.load_bitmap(path, filename) rescue nil
  200.     bitmap ? :exist : :inexist
  201.   end
  202.   #--------------------------------------------------------------------------
  203.   # * New method: character_exist?
  204.   #--------------------------------------------------------------------------
  205.   def character_exist?(filename)
  206.     file_exist?("Graphics/Characters/", filename)
  207.   end
  208.   #--------------------------------------------------------------------------
  209.   # * New method: battler_exist?
  210.   #--------------------------------------------------------------------------
  211.   def battler_exist?(filename)
  212.     file_exist?("Graphics/Battlers/", filename)
  213.   end
  214.   #--------------------------------------------------------------------------
  215.   # * New method: get_filename
  216.   #--------------------------------------------------------------------------
  217.   def get_filename
  218.     "[\"'“‘]([^\"'”‘”’]+)[\"'”’]"
  219.   end
  220.   #--------------------------------------------------------------------------
  221.   # * New method: make_symbol
  222.   #--------------------------------------------------------------------------
  223.   def make_symbol(string)
  224.     string.downcase.gsub(" ", "_").to_sym
  225.   end
  226.   #--------------------------------------------------------------------------
  227.   # * New method: make_string
  228.   #--------------------------------------------------------------------------
  229.   def make_string(symbol)
  230.     symbol.to_s.gsub("_", " ").upcase
  231.   end
  232.   #--------------------------------------------------------------------------
  233.   # * New method: returing_value
  234.   #--------------------------------------------------------------------------
  235.   def returing_value(i, x)
  236.     i % (x * 2) >= x ? (x * 2) - i % (x * 2) : i % (x * 2)
  237.   end
  238. end
  239.  
  240. #==============================================================================
  241. # ** Numeric
  242. #------------------------------------------------------------------------------
  243. #  This is the abstract class for numbers.
  244. #==============================================================================
  245.  
  246. class Numeric
  247.   #--------------------------------------------------------------------------
  248.   # * New method: numeric?
  249.   #--------------------------------------------------------------------------
  250.   def numeric?
  251.     return true
  252.   end
  253. end
  254.  
  255. #==============================================================================
  256. # ** Float
  257. #------------------------------------------------------------------------------
  258. #  This is the abstract class for the floating point values.
  259. #==============================================================================
  260.  
  261. class Float
  262.   #--------------------------------------------------------------------------
  263.   # * New method: float?
  264.   #--------------------------------------------------------------------------
  265.   def float?
  266.     return true
  267.   end
  268. end
  269.  
  270. #==============================================================================
  271. # ** Array     
  272. #------------------------------------------------------------------------------
  273. #  This class store arbitrary Ruby objects.
  274. #==============================================================================
  275.  
  276. class Array
  277.   #-------------------------------------------------------------------------
  278.   # * New method: random
  279.   #-------------------------------------------------------------------------
  280.   def random
  281.     self[rand(size)]
  282.   end
  283.   #-------------------------------------------------------------------------
  284.   # * New method: random!
  285.   #-------------------------------------------------------------------------
  286.   def random!
  287.     self.delete_at(rand(size))
  288.   end
  289.   #---------------------------------------------------------------------------
  290.   # * New method: sum
  291.   #---------------------------------------------------------------------------
  292.   def sum
  293.     self.inject(0) {|r, n| r += (n.numeric? ? n : 0)}
  294.   end
  295.   #---------------------------------------------------------------------------
  296.   # * New method: average
  297.   #---------------------------------------------------------------------------
  298.   def average(float = false)
  299.     self.sum / [(float ? size.to_f : size.to_i), 1].max
  300.   end
  301.   #---------------------------------------------------------------------------
  302.   # * New method: next_item
  303.   #---------------------------------------------------------------------------
  304.   def next_item
  305.     item = self.shift
  306.     self.push(item)
  307.     item
  308.   end
  309.   #---------------------------------------------------------------------------
  310.   # * New method: previous_item
  311.   #---------------------------------------------------------------------------
  312.   def previous_item
  313.     item = self.pop
  314.     self.unshift(item)
  315.     item
  316.   end
  317. end
  318.  
  319. #==============================================================================
  320. # ** RPG::Troop::Page
  321. #------------------------------------------------------------------------------
  322. #  This is the data class for battle events (pages).
  323. #==============================================================================
  324.  
  325. class RPG::Troop::Page
  326.   #--------------------------------------------------------------------------
  327.   # * New method: note
  328.   #--------------------------------------------------------------------------
  329.   def note
  330.     return "" if !@list || @list.size <= 0
  331.     comment_list = []
  332.     @list.each do |item|
  333.       next unless item && (item.code == 108 || item.code == 408)
  334.       comment_list.push(item.parameters[0])
  335.     end
  336.     comment_list.join("\r\n")
  337.   end
  338. end
  339.  
  340. #==============================================================================
  341. # ** RPG::Skill
  342. #------------------------------------------------------------------------------
  343. #  This is the data class for skills.
  344. #==============================================================================
  345.  
  346. class RPG::Skill
  347.   #--------------------------------------------------------------------------
  348.   # * New method: item?
  349.   #--------------------------------------------------------------------------
  350.   def item?
  351.     return false
  352.   end
  353.   #--------------------------------------------------------------------------
  354.   # * New method: skill?
  355.   #--------------------------------------------------------------------------
  356.   def skill?
  357.     return true
  358.   end
  359. end
  360.  
  361. #==============================================================================
  362. # ** RPG::Item
  363. #------------------------------------------------------------------------------
  364. #  This is the data class for sitems.
  365. #==============================================================================
  366.  
  367. class RPG::Item
  368.   #--------------------------------------------------------------------------
  369.   # * New method: item?
  370.   #--------------------------------------------------------------------------
  371.   def item?
  372.     return true
  373.   end
  374.   #--------------------------------------------------------------------------
  375.   # * New method: skill?
  376.   #--------------------------------------------------------------------------
  377.   def skill?
  378.     return false
  379.   end
  380. end
  381.  
  382. #==============================================================================
  383. # ** RPG::UsableItem
  384. #------------------------------------------------------------------------------
  385. #  This is the superclass for skills and items.
  386. #==============================================================================
  387.  
  388. class RPG::UsableItem < RPG::BaseItem
  389.   #--------------------------------------------------------------------------
  390.   # * New method: for_all_targets?
  391.   #--------------------------------------------------------------------------
  392.   def for_all_targets?
  393.     return false
  394.   end
  395. end
  396.  
  397. #==============================================================================
  398. # ** Cache
  399. #------------------------------------------------------------------------------
  400. #  This module loads each of graphics, creates a Bitmap object, and retains it.
  401. # To speed up load times and conserve memory, this module holds the created
  402. # Bitmap object in the internal hash, allowing the program to return
  403. # preexisting objects when the same bitmap is requested again.
  404. #==============================================================================
  405.  
  406. module Cache
  407.   #--------------------------------------------------------------------------
  408.   # * New method: cache
  409.   #--------------------------------------------------------------------------
  410.   def self.cache
  411.     @cache
  412.   end
  413.   #--------------------------------------------------------------------------
  414.   # * New method: character
  415.   #--------------------------------------------------------------------------
  416.   def self.character(filename, hue = 0)
  417.     load_bitmap("Graphics/Characters/", filename, hue)
  418.   end
  419. end
  420.  
  421. #==============================================================================
  422. # ** Game_BattlerBase
  423. #------------------------------------------------------------------------------
  424. #  This class handles battlers. It's used as a superclass of the Game_Battler
  425. # classes.
  426. #==============================================================================
  427.  
  428. class Game_BattlerBase
  429.   #--------------------------------------------------------------------------
  430.   # * Public Instance Variables
  431.   #--------------------------------------------------------------------------
  432.   attr_reader   :buffs
  433.   #--------------------------------------------------------------------------
  434.   # * New method: get_cond
  435.   #--------------------------------------------------------------------------
  436.   def get_cond(text)
  437.     case text.upcase
  438.     when "HIGHER"    then ">"
  439.     when "LOWER"     then "<"
  440.     when "EQUAL"     then "=="
  441.     when "DIFFERENT" then "!="
  442.     else "!="
  443.     end
  444.   end
  445.   #--------------------------------------------------------------------------
  446.   # * New method: get_param
  447.   #--------------------------------------------------------------------------
  448.   def get_param(text)
  449.     case text.upcase
  450.     when "MAXHP" then self.mhp
  451.     when "MAXMP" then self.mmp
  452.     when "MAXTP" then self.max_tp
  453.     else eval("self.#{text.downcase}")
  454.     end
  455.   end
  456.   #--------------------------------------------------------------------------
  457.   # * New method: get_param_id
  458.   #--------------------------------------------------------------------------
  459.   def get_param_id(text)
  460.     case text.upcase
  461.     when "MAXHP", "HP" then 0
  462.     when "MAXMP", "MP" then 1
  463.     when "ATK" then 2
  464.     when "DEF" then 3
  465.     when "MAT" then 4
  466.     when "MDF" then 5
  467.     when "AGI" then 6
  468.     when "LUK" then 7
  469.     end
  470.   end
  471.   #--------------------------------------------------------------------------
  472.   # * New method: danger?
  473.   #--------------------------------------------------------------------------
  474.   def danger?
  475.     hp < mhp * 25 / 100
  476.   end
  477.   #--------------------------------------------------------------------------
  478.   # * New method: sprite
  479.   #--------------------------------------------------------------------------
  480.   def sprite
  481.     valid = SceneManager.scene_is?(Scene_Battle) && SceneManager.scene.spriteset
  482.     valid ? SceneManager.scene.spriteset.sprite(self) : nil
  483.   end
  484. end
  485.  
  486. #==============================================================================
  487. # ** Game_Enemy
  488. #------------------------------------------------------------------------------
  489. #  This class handles enemy characters. It's used within the Game_Troop class
  490. # ($game_troop).
  491. #==============================================================================
  492.  
  493. class Game_Enemy < Game_Battler
  494.   #--------------------------------------------------------------------------
  495.   # * New method: note
  496.   #--------------------------------------------------------------------------
  497.   def note
  498.     enemy ? enemy.note : ""
  499.   end
  500.   #--------------------------------------------------------------------------
  501.   # * New method: get_all_notes
  502.   #--------------------------------------------------------------------------
  503.   def get_all_notes
  504.     result = note
  505.     states.compact.each {|state| result += state.note }
  506.     result
  507.   end
  508.   #--------------------------------------------------------------------------
  509.   # * New method: level
  510.   #--------------------------------------------------------------------------
  511.   def level
  512.     return 1
  513.   end
  514. end
  515.  
  516. #==============================================================================
  517. # ** Game_Actor
  518. #------------------------------------------------------------------------------
  519. #  This class handles actors. It's used within the Game_Actors class
  520. # ($game_actors) and referenced by the Game_Party class ($game_party).
  521. #==============================================================================
  522.  
  523. class Game_Actor < Game_Battler
  524.   #--------------------------------------------------------------------------
  525.   # * New method: note
  526.   #--------------------------------------------------------------------------
  527.   def note
  528.     actor ? actor.note : ""
  529.   end
  530.   #--------------------------------------------------------------------------
  531.   # * New method: hue
  532.   #--------------------------------------------------------------------------
  533.   def hue
  534.     @hue ? @hue : 0
  535.   end
  536.   #--------------------------------------------------------------------------
  537.   # * New method: get_all_notes
  538.   #--------------------------------------------------------------------------
  539.   def get_all_notes
  540.     result = note
  541.     result += self.class.note
  542.     equips.compact.each {|equip| result += equip.note }
  543.     states.compact.each {|state| result += state.note }
  544.     result
  545.   end
  546.   #--------------------------------------------------------------------------
  547.   # * New method: in_active_party?
  548.   #--------------------------------------------------------------------------
  549.   def in_active_party?
  550.     $game_party.battle_members.include?(self)
  551.   end
  552.   #--------------------------------------------------------------------------
  553.   # * New method: in_reserve_party?
  554.   #--------------------------------------------------------------------------
  555.   def in_reserve_party?
  556.     $game_party.reserve_members.include?(self)
  557.   end
  558.   #--------------------------------------------------------------------------
  559.   # * New method: in_party?
  560.   #--------------------------------------------------------------------------
  561.   def in_party?
  562.     $game_party.all_members.include?(self)
  563.   end
  564. end
  565.  
  566. #==============================================================================
  567. # ** Game_Party
  568. #------------------------------------------------------------------------------
  569. #  This class handles the party. It includes information on amount of gold
  570. # and items. The instance of this class is referenced by $game_party.
  571. #==============================================================================
  572.  
  573. class Game_Party < Game_Unit
  574.   #--------------------------------------------------------------------------
  575.   # * New method: average_level
  576.   #--------------------------------------------------------------------------
  577.   def average_level
  578.     battle_members.collect {|actor| actor.level }.average
  579.   end
  580.   #--------------------------------------------------------------------------
  581.   # * New method: reserve_members
  582.   #--------------------------------------------------------------------------
  583.   def reserve_members
  584.     all_members - battle_members
  585.   end
  586. end
  587.  
  588. #==============================================================================
  589. # ** Game_Map
  590. #------------------------------------------------------------------------------
  591. #  This class handles maps. It includes scrolling and passage determination
  592. # functions. The instance of this class is referenced by $game_map.
  593. #==============================================================================
  594.  
  595. class Game_Map
  596.   #--------------------------------------------------------------------------
  597.   # * New method: event_list
  598.   #--------------------------------------------------------------------------
  599.   def event_list
  600.     events.values
  601.   end
  602.   #--------------------------------------------------------------------------
  603.   # * New method: note
  604.   #--------------------------------------------------------------------------
  605.   def note
  606.     @map ? @map.note : ""
  607.   end
  608.   #--------------------------------------------------------------------------
  609.   # * New method: vehicles
  610.   #--------------------------------------------------------------------------
  611.   def vehicles
  612.     @vehicles
  613.   end
  614.   #--------------------------------------------------------------------------
  615.   # * New method: actors
  616.   #--------------------------------------------------------------------------
  617.   def actors
  618.     [$game_player] + $game_player.followers.visible_followers
  619.   end
  620. end
  621.  
  622. #==============================================================================
  623. # ** Game_CharacterBase
  624. #------------------------------------------------------------------------------
  625. #  This class deals with characters. Common to all characters, stores basic
  626. # data, such as coordinates and graphics. It's used as a superclass of the
  627. # Game_Character class.
  628. #==============================================================================
  629.  
  630. class Game_CharacterBase
  631.   #--------------------------------------------------------------------------
  632.   # * Public Instance Variables
  633.   #--------------------------------------------------------------------------
  634.   attr_accessor :move_speed
  635.   attr_accessor :move_frequency
  636.   #--------------------------------------------------------------------------
  637.   # * New method: is_player?
  638.   #--------------------------------------------------------------------------
  639.   def is_player?
  640.     return false
  641.   end
  642.   #--------------------------------------------------------------------------
  643.   # * New method: is_event?
  644.   #--------------------------------------------------------------------------
  645.   def is_event?
  646.     return false
  647.   end
  648.   #--------------------------------------------------------------------------
  649.   # * New method: is_follower?
  650.   #--------------------------------------------------------------------------
  651.   def is_follower?
  652.     return false
  653.   end
  654.   #--------------------------------------------------------------------------
  655.   # * New method: is_vehicle?
  656.   #--------------------------------------------------------------------------
  657.   def is_vehicle?
  658.     return false
  659.   end
  660.   #--------------------------------------------------------------------------
  661.   # * New method: frames
  662.   #--------------------------------------------------------------------------
  663.   def frames
  664.     return 3
  665.   end
  666.   #--------------------------------------------------------------------------
  667.   # * New method: hue
  668.   #--------------------------------------------------------------------------
  669.   def hue
  670.     @hue ? @hue : 0
  671.   end
  672. end
  673.  
  674. #==============================================================================
  675. # ** Game_Character
  676. #------------------------------------------------------------------------------
  677. #  This class deals with characters. It's used as a superclass of the
  678. # Game_Player and Game_Event classes.
  679. #==============================================================================
  680.  
  681. class Game_Character < Game_CharacterBase
  682.   #--------------------------------------------------------------------------
  683.   # * New method: move_toward_position
  684.   #--------------------------------------------------------------------------
  685.   def move_toward_position(x, y)
  686.     sx = distance_x_from(x)
  687.     sy = distance_y_from(y)
  688.     if sx.abs > sy.abs
  689.       move_straight(sx > 0 ? 4 : 6)
  690.       move_straight(sy > 0 ? 8 : 2) if !@move_succeed && sy != 0
  691.     elsif sy != 0
  692.       move_straight(sy > 0 ? 8 : 2)
  693.       move_straight(sx > 0 ? 4 : 6) if !@move_succeed && sx != 0
  694.     end
  695.   end
  696. end
  697.  
  698. #==============================================================================
  699. # ** Game_Player
  700. #------------------------------------------------------------------------------
  701. #  This class handles the player.
  702. # The instance of this class is referenced by $game_map.
  703. #==============================================================================
  704.  
  705. class Game_Player < Game_Character
  706.   #--------------------------------------------------------------------------
  707.   # * New method: is_player?
  708.   #--------------------------------------------------------------------------
  709.   def is_player?
  710.     return true
  711.   end
  712.   #--------------------------------------------------------------------------
  713.   # * New method: perform_transfer
  714.   #--------------------------------------------------------------------------
  715.   def new_map_id
  716.     @new_map_id
  717.   end
  718.   #--------------------------------------------------------------------------
  719.   # * New method: hue
  720.   #--------------------------------------------------------------------------
  721.   def hue
  722.     actor ? actor.hue : 0
  723.   end
  724. end
  725.  
  726. #==============================================================================
  727. # ** Game_Follower
  728. #------------------------------------------------------------------------------
  729. #  This class handles the followers. Followers are the actors of the party
  730. # that follows the leader in a line. It's used within the Game_Followers class.
  731. #==============================================================================
  732.  
  733. class Game_Follower < Game_Character
  734.   #--------------------------------------------------------------------------
  735.   # * New method: is_follower?
  736.   #--------------------------------------------------------------------------
  737.   def is_follower?
  738.     return true
  739.   end
  740.   #--------------------------------------------------------------------------
  741.   # * New method: index
  742.   #--------------------------------------------------------------------------
  743.   def index
  744.     @member_index
  745.   end
  746. end
  747.  
  748. #==============================================================================
  749. # ** Game_Followers
  750. #------------------------------------------------------------------------------
  751. #  This class handles the followers. It's a wrapper for the built-in class
  752. # "Array." It's used within the Game_Player class.
  753. #==============================================================================
  754.  
  755. class Game_Followers
  756.   #--------------------------------------------------------------------------
  757.   # * New method: get_actor
  758.   #--------------------------------------------------------------------------
  759.   def get_actor(id)
  760.     list = [$game_player] + visible_followers.select do |follower|
  761.       follower.actor && follower.actor.id == id
  762.     end
  763.     list.first
  764.   end
  765. end
  766.  
  767. #==============================================================================
  768. # ** Game_Vehicle
  769. #------------------------------------------------------------------------------
  770. #  This class handles vehicles. It's used within the Game_Map class. If there
  771. # are no vehicles on the current map, the coordinates is set to (-1,-1).
  772. #==============================================================================
  773.  
  774. class Game_Vehicle < Game_Character
  775.   #--------------------------------------------------------------------------
  776.   # * New method: is_vehicle?
  777.   #--------------------------------------------------------------------------
  778.   def is_vehicle?
  779.     return true
  780.   end
  781.   #--------------------------------------------------------------------------
  782.   # * New method: map_id
  783.   #--------------------------------------------------------------------------
  784.   def map_id
  785.     @map_id
  786.   end
  787. end
  788.  
  789. #==============================================================================
  790. # ** Game_Event
  791. #------------------------------------------------------------------------------
  792. #  This class deals with events. It handles functions including event page
  793. # switching via condition determinants, and running parallel process events.
  794. # It's used within the Game_Map class.
  795. #==============================================================================
  796.  
  797. class Game_Event < Game_Character
  798.   #--------------------------------------------------------------------------
  799.   # * New method: name
  800.   #--------------------------------------------------------------------------
  801.   def name
  802.     @event.name
  803.   end
  804.   #--------------------------------------------------------------------------
  805.   # * New method: is_event?
  806.   #--------------------------------------------------------------------------
  807.   def is_event?
  808.     return true
  809.   end
  810.   #--------------------------------------------------------------------------
  811.   # * New method: note
  812.   #--------------------------------------------------------------------------
  813.   def note
  814.     return "" if !@page || !@page.list || @page.list.size <= 0
  815.     comment_list = []
  816.     @page.list.each do |item|
  817.       next unless item && (item.code == 108 || item.code == 408)
  818.       comment_list.push(item.parameters[0])
  819.     end
  820.     comment_list.join("\r\n")
  821.   end  
  822. end
  823.  
  824. #==============================================================================
  825. # ** Game_Interpreter
  826. #------------------------------------------------------------------------------
  827. #  An interpreter for executing event commands. This class is used within the
  828. # Game_Map, Game_Troop, and Game_Event classes.
  829. #==============================================================================
  830.  
  831. class Game_Interpreter
  832.   #--------------------------------------------------------------------------
  833.   # * Alias method: command_108
  834.   #--------------------------------------------------------------------------
  835.   alias :command_108_ve_basic_module :command_108
  836.   def command_108
  837.     command_108_ve_basic_module
  838.     comment_call
  839.   end
  840.   #--------------------------------------------------------------------------
  841.   # * New method: comment_call
  842.   #--------------------------------------------------------------------------
  843.   def comment_call
  844.   end
  845.   #--------------------------------------------------------------------------
  846.   # * New method: note
  847.   #--------------------------------------------------------------------------
  848.   def note
  849.     @comments ? @comments.join("\r\n") : ""
  850.   end
  851. end
  852.  
  853. #==============================================================================
  854. # ** Sprite_Character
  855. #------------------------------------------------------------------------------
  856. #  This sprite is used to display characters. It observes a instance of the
  857. # Game_Character class and automatically changes sprite conditions.
  858. #==============================================================================
  859.  
  860. class Sprite_Character < Sprite_Base
  861.   #--------------------------------------------------------------------------
  862.   # * Overwrite method: set_character_bitmap
  863.   #--------------------------------------------------------------------------
  864.   def set_character_bitmap
  865.     update_character_info
  866.     set_bitmap
  867.     set_bitmap_position
  868.   end
  869.   #--------------------------------------------------------------------------
  870.   # * New method: center_y
  871.   #--------------------------------------------------------------------------
  872.   def actor?
  873.     @character.is_a?(Game_Player) || @character.is_a?(Game_Follower)
  874.   end
  875.   #--------------------------------------------------------------------------
  876.   # * New method: center_y
  877.   #--------------------------------------------------------------------------
  878.   def actor
  879.     actor? ? @character.actor : nil
  880.   end
  881.   #--------------------------------------------------------------------------
  882.   # * New method: update_character_info
  883.   #--------------------------------------------------------------------------
  884.   def update_character_info
  885.   end
  886.   #--------------------------------------------------------------------------
  887.   # * New method: hue
  888.   #--------------------------------------------------------------------------
  889.   def hue
  890.     @character.hue
  891.   end
  892.   #--------------------------------------------------------------------------
  893.   # * New method: set_bitmap
  894.   #--------------------------------------------------------------------------
  895.   def set_bitmap
  896.     self.bitmap = Cache.character(set_bitmap_name, hue)
  897.   end
  898.   #--------------------------------------------------------------------------
  899.   # * New method: set_bitmap_name
  900.   #--------------------------------------------------------------------------
  901.   def set_bitmap_name
  902.     @character_name
  903.   end
  904.   #--------------------------------------------------------------------------
  905.   # * New method: set_bitmap_position
  906.   #--------------------------------------------------------------------------
  907.   def set_bitmap_position
  908.     sign = get_sign
  909.     if sign && sign.include?('$')
  910.       @cw = bitmap.width / @character.frames
  911.       @ch = bitmap.height / 4
  912.     else
  913.       @cw = bitmap.width / (@character.frames * 4)
  914.       @ch = bitmap.height / 8
  915.     end
  916.     self.ox = @cw / 2
  917.     self.oy = @ch
  918.   end
  919.   #--------------------------------------------------------------------------
  920.   # * New method: get_sign
  921.   #--------------------------------------------------------------------------
  922.   def get_sign
  923.     @character_name[/^[\!\$]./]
  924.   end
  925. end
  926.  
  927. #==============================================================================
  928. # ** Sprite_Battler
  929. #------------------------------------------------------------------------------
  930. #  This sprite is used to display battlers. It observes a instance of the
  931. # Game_Battler class and automatically changes sprite conditions.
  932. #==============================================================================
  933.  
  934. class Sprite_Battler < Sprite_Base
  935.   #--------------------------------------------------------------------------
  936.   # * Public Instance Variables
  937.   #--------------------------------------------------------------------------
  938.   attr_accessor :dmg_mirror
  939.   #--------------------------------------------------------------------------
  940.   # * New method: center_x
  941.   #--------------------------------------------------------------------------
  942.   def center_x
  943.     self.ox
  944.   end
  945.   #--------------------------------------------------------------------------
  946.   # * New method: center_y
  947.   #--------------------------------------------------------------------------
  948.   def center_y
  949.     self.oy / 2
  950.   end
  951. end
  952.  
  953. #==============================================================================
  954. # ** Spriteset_Battle
  955. #------------------------------------------------------------------------------
  956. #  This class brings together battle screen sprites. It's used within the
  957. # Scene_Battle class.
  958. #==============================================================================
  959.  
  960. class Spriteset_Battle
  961.   #--------------------------------------------------------------------------
  962.   # * Public Instance Variables
  963.   #--------------------------------------------------------------------------
  964.   attr_reader   :viewport1
  965.   #--------------------------------------------------------------------------
  966.   # * New method: sprite
  967.   #--------------------------------------------------------------------------
  968.   def sprite(subject)
  969.     battler_sprites.compact.select {|sprite| sprite.battler == subject }.first
  970.   end
  971. end
  972.  
  973. #==============================================================================
  974. # ** Window_Base
  975. #------------------------------------------------------------------------------
  976. #  This is a superclass of all windows in the game.
  977. #==============================================================================
  978.  
  979. class Window_Base < Window
  980.   #--------------------------------------------------------------------------
  981.   # * Alias method: convert_escape_characters
  982.   #--------------------------------------------------------------------------
  983.   alias :convert_escape_ve_basic_module :convert_escape_characters
  984.   def convert_escape_characters(text)
  985.     result = text.to_s.clone
  986.     result = text_replace(result)
  987.     result = convert_escape_ve_basic_module(text)
  988.     result
  989.   end
  990.   #--------------------------------------------------------------------------
  991.   # * New method: text_replace
  992.   #--------------------------------------------------------------------------
  993.   def text_replace(result)
  994.     result.gsub!(/\r/) { "" }
  995.     result.gsub!(/\\/) { "\e" }
  996.     result
  997.   end
  998. end
  999.  
  1000. #==============================================================================
  1001. # ** Scene_Battle
  1002. #------------------------------------------------------------------------------
  1003. #  This class performs battle screen processing.
  1004. #==============================================================================
  1005.  
  1006. class Scene_Battle < Scene_Base
  1007.   #--------------------------------------------------------------------------
  1008.   # * Public Instance Variables
  1009.   #--------------------------------------------------------------------------
  1010.   attr_reader   :spriteset
  1011. end



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



两端都插入就可以了,胜利显示经验,升级显示能力




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1