查看: 1336|回复: 1

[已经过期] 请问怎么在升级后能直接显示能力变动的资料

[复制链接]
梦石
0
星屑
155
在线时间
61 小时
注册时间
2011-3-9
回帖
64
发表于 2012-12-20 21:53:58 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
请问怎么在升级后能直接显示能力变动的资料
我的梦幻让我用双手让他飞翔。
梦石
0
星屑
50
在线时间
47 小时
注册时间
2012-12-13
回帖
22
发表于 2012-12-21 02:10:32 | 显示全部楼层
  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. # ** Victor Engine
  97. #------------------------------------------------------------------------------
  98. #   Setting module for the Victor Engine
  99. #==============================================================================

  100. module Victor_Engine
  101.   #--------------------------------------------------------------------------
  102.   # * New method: required_script
  103.   #--------------------------------------------------------------------------
  104.   def self.required_script(name, req, version, type = 0)
  105.     if type != :bellow && (!$imported[req] || $imported[req] < version)
  106.       msg = "The script '%s' requires the script\n"
  107.       case type
  108.       when :above
  109.         msg += "'%s' v%s or higher above it to work properly\n"
  110.       else
  111.         msg += "'%s' v%s or higher to work properly\n"
  112.       end
  113.       msg += "Go to [url]http://victorscripts.wordpress.com/[/url] to download this script."
  114.       self.exit_message(msg, name, req, version)
  115.     elsif type == :bellow && $imported[req]
  116.       msg =  "The script '%s' requires the script\n"
  117.       msg += "'%s' to be put bellow it\n"
  118.       msg += "move the scripts to the proper position"
  119.       self.exit_message(msg, name, req, version)
  120.     end
  121.   end
  122.   #--------------------------------------------------------------------------
  123.   # * New method: exit_message
  124.   #--------------------------------------------------------------------------
  125.   def self.exit_message(message, name, req, version)
  126.     name = self.script_name(name)
  127.     req  = self.script_name(req)
  128.     msgbox(sprintf(message, name, req, version))
  129.     exit
  130.   end
  131.   #--------------------------------------------------------------------------
  132.   # * New method: script_name
  133.   #--------------------------------------------------------------------------
  134.   def self.script_name(name, ext = "VE")
  135.     name = name.to_s.gsub("_", " ").upcase.split
  136.     name.collect! {|char| char == ext ? "#{char} -" : char.capitalize }
  137.     name.join(" ")
  138.   end
  139. end

  140. $imported ||= {}
  141. $imported[:ve_basic_module] = 1.17

  142. #==============================================================================
  143. # ** Object
  144. #------------------------------------------------------------------------------
  145. #  This class is the superclass of all other classes.
  146. #==============================================================================

  147. class Object
  148.   #--------------------------------------------------------------------------
  149.   # * Include setting module
  150.   #--------------------------------------------------------------------------
  151.   include Victor_Engine
  152.   #-------------------------------------------------------------------------
  153.   # * New method: rand_between
  154.   #-------------------------------------------------------------------------
  155.   def rand_between(min, max)
  156.     min + rand(max - min + 1)
  157.   end
  158.   #--------------------------------------------------------------------------
  159.   # * New method: numeric?
  160.   #--------------------------------------------------------------------------
  161.   def numeric?
  162.     return false
  163.   end
  164.   #--------------------------------------------------------------------------
  165.   # * New method: float?
  166.   #--------------------------------------------------------------------------
  167.   def float?
  168.     return false
  169.   end
  170.   #--------------------------------------------------------------------------
  171.   # * New method: item?
  172.   #--------------------------------------------------------------------------
  173.   def item?
  174.     return false
  175.   end
  176.   #--------------------------------------------------------------------------
  177.   # * New method: skill?
  178.   #--------------------------------------------------------------------------
  179.   def skill?
  180.     return false
  181.   end
  182.   #--------------------------------------------------------------------------
  183.   # * New method: file_exist?
  184.   #--------------------------------------------------------------------------
  185.   def file_exist?(path, filename)
  186.     $file_list ||= {}
  187.     $file_list[path + filename] ||= file_test(path, filename)
  188.     $file_list[path + filename] == :exist
  189.   end
  190.   #--------------------------------------------------------------------------
  191.   # * New method: get_file_list
  192.   #--------------------------------------------------------------------------
  193.   def file_test(path, filename)
  194.     bitmap = Cache.load_bitmap(path, filename) rescue nil
  195.     bitmap ? :exist : :inexist
  196.   end
  197.   #--------------------------------------------------------------------------
  198.   # * New method: character_exist?
  199.   #--------------------------------------------------------------------------
  200.   def character_exist?(filename)
  201.     file_exist?("Graphics/Characters/", filename)
  202.   end
  203.   #--------------------------------------------------------------------------
  204.   # * New method: battler_exist?
  205.   #--------------------------------------------------------------------------
  206.   def battler_exist?(filename)
  207.     file_exist?("Graphics/Battlers/", filename)
  208.   end
  209.   #--------------------------------------------------------------------------
  210.   # * New method: get_filename
  211.   #--------------------------------------------------------------------------
  212.   def get_filename
  213.     "["'“‘]([^"'”‘”’]+)["'”’]"
  214.   end
  215.   #--------------------------------------------------------------------------
  216.   # * New method: make_symbol
  217.   #--------------------------------------------------------------------------
  218.   def make_symbol(string)
  219.     string.downcase.gsub(" ", "_").to_sym
  220.   end
  221.   #--------------------------------------------------------------------------
  222.   # * New method: make_string
  223.   #--------------------------------------------------------------------------
  224.   def make_string(symbol)
  225.     symbol.to_s.gsub("_", " ").upcase
  226.   end
  227.   #--------------------------------------------------------------------------
  228.   # * New method: returing_value
  229.   #--------------------------------------------------------------------------
  230.   def returing_value(i, x)
  231.     i % (x * 2) >= x ? (x * 2) - i % (x * 2) : i % (x * 2)
  232.   end
  233. end

  234. #==============================================================================
  235. # ** Numeric
  236. #------------------------------------------------------------------------------
  237. #  This is the abstract class for numbers.
  238. #==============================================================================

  239. class Numeric
  240.   #--------------------------------------------------------------------------
  241.   # * New method: numeric?
  242.   #--------------------------------------------------------------------------
  243.   def numeric?
  244.     return true
  245.   end
  246. end

  247. #==============================================================================
  248. # ** Float
  249. #------------------------------------------------------------------------------
  250. #  This is the abstract class for the floating point values.
  251. #==============================================================================

  252. class Float
  253.   #--------------------------------------------------------------------------
  254.   # * New method: float?
  255.   #--------------------------------------------------------------------------
  256.   def float?
  257.     return true
  258.   end
  259. end

  260. #==============================================================================
  261. # ** Array     
  262. #------------------------------------------------------------------------------
  263. #  This class store arbitrary Ruby objects.
  264. #==============================================================================

  265. class Array
  266.   #-------------------------------------------------------------------------
  267.   # * New method: random
  268.   #-------------------------------------------------------------------------
  269.   def random
  270.     self[rand(size)]
  271.   end
  272.   #-------------------------------------------------------------------------
  273.   # * New method: random!
  274.   #-------------------------------------------------------------------------
  275.   def random!
  276.     self.delete_at(rand(size))
  277.   end
  278.   #---------------------------------------------------------------------------
  279.   # * New method: sum
  280.   #---------------------------------------------------------------------------
  281.   def sum
  282.     self.inject(0) {|r, n| r += (n.numeric? ? n : 0)}
  283.   end
  284.   #---------------------------------------------------------------------------
  285.   # * New method: average
  286.   #---------------------------------------------------------------------------
  287.   def average(float = false)
  288.     self.sum / [(float ? size.to_f : size.to_i), 1].max
  289.   end
  290.   #---------------------------------------------------------------------------
  291.   # * New method: next_item
  292.   #---------------------------------------------------------------------------
  293.   def next_item
  294.     item = self.shift
  295.     self.push(item)
  296.     item
  297.   end
  298.   #---------------------------------------------------------------------------
  299.   # * New method: previous_item
  300.   #---------------------------------------------------------------------------
  301.   def previous_item
  302.     item = self.pop
  303.     self.unshift(item)
  304.     item
  305.   end
  306. end

  307. #==============================================================================
  308. # ** RPG::Troop::Page
  309. #------------------------------------------------------------------------------
  310. #  This is the data class for battle events (pages).
  311. #==============================================================================

  312. class RPG::Troop::Page
  313.   #--------------------------------------------------------------------------
  314.   # * New method: note
  315.   #--------------------------------------------------------------------------
  316.   def note
  317.     return "" if !@list || @list.size <= 0
  318.     comment_list = []
  319.     @list.each do |item|
  320.       next unless item && (item.code == 108 || item.code == 408)
  321.       comment_list.push(item.parameters[0])
  322.     end
  323.     comment_list.join("\r\n")
  324.   end
  325. end

  326. #==============================================================================
  327. # ** RPG::Skill
  328. #------------------------------------------------------------------------------
  329. #  This is the data class for skills.
  330. #==============================================================================

  331. class RPG::Skill
  332.   #--------------------------------------------------------------------------
  333.   # * New method: item?
  334.   #--------------------------------------------------------------------------
  335.   def item?
  336.     return false
  337.   end
  338.   #--------------------------------------------------------------------------
  339.   # * New method: skill?
  340.   #--------------------------------------------------------------------------
  341.   def skill?
  342.     return true
  343.   end
  344. end

  345. #==============================================================================
  346. # ** RPG::Item
  347. #------------------------------------------------------------------------------
  348. #  This is the data class for sitems.
  349. #==============================================================================

  350. class RPG::Item
  351.   #--------------------------------------------------------------------------
  352.   # * New method: item?
  353.   #--------------------------------------------------------------------------
  354.   def item?
  355.     return true
  356.   end
  357.   #--------------------------------------------------------------------------
  358.   # * New method: skill?
  359.   #--------------------------------------------------------------------------
  360.   def skill?
  361.     return false
  362.   end
  363. end

  364. #==============================================================================
  365. # ** RPG::UsableItem
  366. #------------------------------------------------------------------------------
  367. #  This is the superclass for skills and items.
  368. #==============================================================================

  369. class RPG::UsableItem < RPG::BaseItem
  370.   #--------------------------------------------------------------------------
  371.   # * New method: for_all_targets?
  372.   #--------------------------------------------------------------------------
  373.   def for_all_targets?
  374.     return false
  375.   end
  376. end

  377. #==============================================================================
  378. # ** Cache
  379. #------------------------------------------------------------------------------
  380. #  This module loads each of graphics, creates a Bitmap object, and retains it.
  381. # To speed up load times and conserve memory, this module holds the created
  382. # Bitmap object in the internal hash, allowing the program to return
  383. # preexisting objects when the same bitmap is requested again.
  384. #==============================================================================

  385. module Cache
  386.   #--------------------------------------------------------------------------
  387.   # * New method: cache
  388.   #--------------------------------------------------------------------------
  389.   def self.cache
  390.     @cache
  391.   end
  392.   #--------------------------------------------------------------------------
  393.   # * New method: character
  394.   #--------------------------------------------------------------------------
  395.   def self.character(filename, hue = 0)
  396.     load_bitmap("Graphics/Characters/", filename, hue)
  397.   end
  398. end

  399. #==============================================================================
  400. # ** Game_BattlerBase
  401. #------------------------------------------------------------------------------
  402. #  This class handles battlers. It's used as a superclass of the Game_Battler
  403. # classes.
  404. #==============================================================================

  405. class Game_BattlerBase
  406.   #--------------------------------------------------------------------------
  407.   # * Public Instance Variables
  408.   #--------------------------------------------------------------------------
  409.   attr_reader   :buffs
  410.   #--------------------------------------------------------------------------
  411.   # * New method: get_cond
  412.   #--------------------------------------------------------------------------
  413.   def get_cond(text)
  414.     case text.upcase
  415.     when "HIGHER"    then ">"
  416.     when "LOWER"     then "<"
  417.     when "EQUAL"     then "=="
  418.     when "DIFFERENT" then "!="
  419.     else "!="
  420.     end
  421.   end
  422.   #--------------------------------------------------------------------------
  423.   # * New method: get_param
  424.   #--------------------------------------------------------------------------
  425.   def get_param(text)
  426.     case text.upcase
  427.     when "MAXHP" then self.mhp
  428.     when "MAXMP" then self.mmp
  429.     when "MAXTP" then self.max_tp
  430.     else eval("self.#{text.downcase}")
  431.     end
  432.   end
  433.   #--------------------------------------------------------------------------
  434.   # * New method: get_param_id
  435.   #--------------------------------------------------------------------------
  436.   def get_param_id(text)
  437.     case text.upcase
  438.     when "MAXHP", "HP" then 0
  439.     when "MAXMP", "MP" then 1
  440.     when "ATK" then 2
  441.     when "DEF" then 3
  442.     when "MAT" then 4
  443.     when "MDF" then 5
  444.     when "AGI" then 6
  445.     when "LUK" then 7
  446.     end
  447.   end
  448.   #--------------------------------------------------------------------------
  449.   # * New method: danger?
  450.   #--------------------------------------------------------------------------
  451.   def danger?
  452.     hp < mhp * 25 / 100
  453.   end
  454.   #--------------------------------------------------------------------------
  455.   # * New method: sprite
  456.   #--------------------------------------------------------------------------
  457.   def sprite
  458.     valid = SceneManager.scene_is?(Scene_Battle) && SceneManager.scene.spriteset
  459.     valid ? SceneManager.scene.spriteset.sprite(self) : nil
  460.   end
  461. end

  462. #==============================================================================
  463. # ** Game_Enemy
  464. #------------------------------------------------------------------------------
  465. #  This class handles enemy characters. It's used within the Game_Troop class
  466. # ($game_troop).
  467. #==============================================================================

  468. class Game_Enemy < Game_Battler
  469.   #--------------------------------------------------------------------------
  470.   # * New method: note
  471.   #--------------------------------------------------------------------------
  472.   def note
  473.     enemy ? enemy.note : ""
  474.   end
  475.   #--------------------------------------------------------------------------
  476.   # * New method: get_all_notes
  477.   #--------------------------------------------------------------------------
  478.   def get_all_notes
  479.     result = note
  480.     states.compact.each {|state| result += state.note }
  481.     result
  482.   end
  483.   #--------------------------------------------------------------------------
  484.   # * New method: level
  485.   #--------------------------------------------------------------------------
  486.   def level
  487.     return 1
  488.   end
  489. end

  490. #==============================================================================
  491. # ** Game_Actor
  492. #------------------------------------------------------------------------------
  493. #  This class handles actors. It's used within the Game_Actors class
  494. # ($game_actors) and referenced by the Game_Party class ($game_party).
  495. #==============================================================================

  496. class Game_Actor < Game_Battler
  497.   #--------------------------------------------------------------------------
  498.   # * New method: note
  499.   #--------------------------------------------------------------------------
  500.   def note
  501.     actor ? actor.note : ""
  502.   end
  503.   #--------------------------------------------------------------------------
  504.   # * New method: hue
  505.   #--------------------------------------------------------------------------
  506.   def hue
  507.     @hue ? @hue : 0
  508.   end
  509.   #--------------------------------------------------------------------------
  510.   # * New method: get_all_notes
  511.   #--------------------------------------------------------------------------
  512.   def get_all_notes
  513.     result = note
  514.     result += self.class.note
  515.     equips.compact.each {|equip| result += equip.note }
  516.     states.compact.each {|state| result += state.note }
  517.     result
  518.   end
  519.   #--------------------------------------------------------------------------
  520.   # * New method: in_active_party?
  521.   #--------------------------------------------------------------------------
  522.   def in_active_party?
  523.     $game_party.battle_members.include?(self)
  524.   end
  525.   #--------------------------------------------------------------------------
  526.   # * New method: in_reserve_party?
  527.   #--------------------------------------------------------------------------
  528.   def in_reserve_party?
  529.     $game_party.reserve_members.include?(self)
  530.   end
  531.   #--------------------------------------------------------------------------
  532.   # * New method: in_party?
  533.   #--------------------------------------------------------------------------
  534.   def in_party?
  535.     $game_party.all_members.include?(self)
  536.   end
  537. end

  538. #==============================================================================
  539. # ** Game_Party
  540. #------------------------------------------------------------------------------
  541. #  This class handles the party. It includes information on amount of gold
  542. # and items. The instance of this class is referenced by $game_party.
  543. #==============================================================================

  544. class Game_Party < Game_Unit
  545.   #--------------------------------------------------------------------------
  546.   # * New method: average_level
  547.   #--------------------------------------------------------------------------
  548.   def average_level
  549.     battle_members.collect {|actor| actor.level }.average
  550.   end
  551.   #--------------------------------------------------------------------------
  552.   # * New method: reserve_members
  553.   #--------------------------------------------------------------------------
  554.   def reserve_members
  555.     all_members - battle_members
  556.   end
  557. end

  558. #==============================================================================
  559. # ** Game_Map
  560. #------------------------------------------------------------------------------
  561. #  This class handles maps. It includes scrolling and passage determination
  562. # functions. The instance of this class is referenced by $game_map.
  563. #==============================================================================

  564. class Game_Map
  565.   #--------------------------------------------------------------------------
  566.   # * New method: event_list
  567.   #--------------------------------------------------------------------------
  568.   def event_list
  569.     events.values
  570.   end
  571.   #--------------------------------------------------------------------------
  572.   # * New method: note
  573.   #--------------------------------------------------------------------------
  574.   def note
  575.     @map ? @map.note : ""
  576.   end
  577.   #--------------------------------------------------------------------------
  578.   # * New method: vehicles
  579.   #--------------------------------------------------------------------------
  580.   def vehicles
  581.     @vehicles
  582.   end
  583.   #--------------------------------------------------------------------------
  584.   # * New method: actors
  585.   #--------------------------------------------------------------------------
  586.   def actors
  587.     [$game_player] + $game_player.followers.visible_followers
  588.   end
  589. end

  590. #==============================================================================
  591. # ** Game_CharacterBase
  592. #------------------------------------------------------------------------------
  593. #  This class deals with characters. Common to all characters, stores basic
  594. # data, such as coordinates and graphics. It's used as a superclass of the
  595. # Game_Character class.
  596. #==============================================================================

  597. class Game_CharacterBase
  598.   #--------------------------------------------------------------------------
  599.   # * Public Instance Variables
  600.   #--------------------------------------------------------------------------
  601.   attr_accessor :move_speed
  602.   attr_accessor :move_frequency
  603.   #--------------------------------------------------------------------------
  604.   # * New method: is_player?
  605.   #--------------------------------------------------------------------------
  606.   def is_player?
  607.     return false
  608.   end
  609.   #--------------------------------------------------------------------------
  610.   # * New method: is_event?
  611.   #--------------------------------------------------------------------------
  612.   def is_event?
  613.     return false
  614.   end
  615.   #--------------------------------------------------------------------------
  616.   # * New method: is_follower?
  617.   #--------------------------------------------------------------------------
  618.   def is_follower?
  619.     return false
  620.   end
  621.   #--------------------------------------------------------------------------
  622.   # * New method: is_vehicle?
  623.   #--------------------------------------------------------------------------
  624.   def is_vehicle?
  625.     return false
  626.   end
  627.   #--------------------------------------------------------------------------
  628.   # * New method: frames
  629.   #--------------------------------------------------------------------------
  630.   def frames
  631.     return 3
  632.   end
  633.   #--------------------------------------------------------------------------
  634.   # * New method: hue
  635.   #--------------------------------------------------------------------------
  636.   def hue
  637.     @hue ? @hue : 0
  638.   end
  639. end

  640. #==============================================================================
  641. # ** Game_Character
  642. #------------------------------------------------------------------------------
  643. #  This class deals with characters. It's used as a superclass of the
  644. # Game_Player and Game_Event classes.
  645. #==============================================================================

  646. class Game_Character < Game_CharacterBase
  647.   #--------------------------------------------------------------------------
  648.   # * New method: move_toward_position
  649.   #--------------------------------------------------------------------------
  650.   def move_toward_position(x, y)
  651.     sx = distance_x_from(x)
  652.     sy = distance_y_from(y)
  653.     if sx.abs > sy.abs
  654.       move_straight(sx > 0 ? 4 : 6)
  655.       move_straight(sy > 0 ? 8 : 2) if !@move_succeed && sy != 0
  656.     elsif sy != 0
  657.       move_straight(sy > 0 ? 8 : 2)
  658.       move_straight(sx > 0 ? 4 : 6) if !@move_succeed && sx != 0
  659.     end
  660.   end
  661. end

  662. #==============================================================================
  663. # ** Game_Player
  664. #------------------------------------------------------------------------------
  665. #  This class handles the player.
  666. # The instance of this class is referenced by $game_map.
  667. #==============================================================================

  668. class Game_Player < Game_Character
  669.   #--------------------------------------------------------------------------
  670.   # * New method: is_player?
  671.   #--------------------------------------------------------------------------
  672.   def is_player?
  673.     return true
  674.   end
  675.   #--------------------------------------------------------------------------
  676.   # * New method: perform_transfer
  677.   #--------------------------------------------------------------------------
  678.   def new_map_id
  679.     @new_map_id
  680.   end
  681.   #--------------------------------------------------------------------------
  682.   # * New method: hue
  683.   #--------------------------------------------------------------------------
  684.   def hue
  685.     actor ? actor.hue : 0
  686.   end
  687. end

  688. #==============================================================================
  689. # ** Game_Follower
  690. #------------------------------------------------------------------------------
  691. #  This class handles the followers. Followers are the actors of the party
  692. # that follows the leader in a line. It's used within the Game_Followers class.
  693. #==============================================================================

  694. class Game_Follower < Game_Character
  695.   #--------------------------------------------------------------------------
  696.   # * New method: is_follower?
  697.   #--------------------------------------------------------------------------
  698.   def is_follower?
  699.     return true
  700.   end
  701.   #--------------------------------------------------------------------------
  702.   # * New method: index
  703.   #--------------------------------------------------------------------------
  704.   def index
  705.     @member_index
  706.   end
  707. end

  708. #==============================================================================
  709. # ** Game_Followers
  710. #------------------------------------------------------------------------------
  711. #  This class handles the followers. It's a wrapper for the built-in class
  712. # "Array." It's used within the Game_Player class.
  713. #==============================================================================

  714. class Game_Followers
  715.   #--------------------------------------------------------------------------
  716.   # * New method: get_actor
  717.   #--------------------------------------------------------------------------
  718.   def get_actor(id)
  719.     list = [$game_player] + visible_followers.select do |follower|
  720.       follower.actor && follower.actor.id == id
  721.     end
  722.     list.first
  723.   end
  724. end

  725. #==============================================================================
  726. # ** Game_Vehicle
  727. #------------------------------------------------------------------------------
  728. #  This class handles vehicles. It's used within the Game_Map class. If there
  729. # are no vehicles on the current map, the coordinates is set to (-1,-1).
  730. #==============================================================================

  731. class Game_Vehicle < Game_Character
  732.   #--------------------------------------------------------------------------
  733.   # * New method: is_vehicle?
  734.   #--------------------------------------------------------------------------
  735.   def is_vehicle?
  736.     return true
  737.   end
  738.   #--------------------------------------------------------------------------
  739.   # * New method: map_id
  740.   #--------------------------------------------------------------------------
  741.   def map_id
  742.     @map_id
  743.   end
  744. end

  745. #==============================================================================
  746. # ** Game_Event
  747. #------------------------------------------------------------------------------
  748. #  This class deals with events. It handles functions including event page
  749. # switching via condition determinants, and running parallel process events.
  750. # It's used within the Game_Map class.
  751. #==============================================================================

  752. class Game_Event < Game_Character
  753.   #--------------------------------------------------------------------------
  754.   # * New method: name
  755.   #--------------------------------------------------------------------------
  756.   def name
  757.     @event.name
  758.   end
  759.   #--------------------------------------------------------------------------
  760.   # * New method: is_event?
  761.   #--------------------------------------------------------------------------
  762.   def is_event?
  763.     return true
  764.   end
  765.   #--------------------------------------------------------------------------
  766.   # * New method: note
  767.   #--------------------------------------------------------------------------
  768.   def note
  769.     return "" if !@page || !@page.list || @page.list.size <= 0
  770.     comment_list = []
  771.     @page.list.each do |item|
  772.       next unless item && (item.code == 108 || item.code == 408)
  773.       comment_list.push(item.parameters[0])
  774.     end
  775.     comment_list.join("\r\n")
  776.   end  
  777. end

  778. #==============================================================================
  779. # ** Game_Interpreter
  780. #------------------------------------------------------------------------------
  781. #  An interpreter for executing event commands. This class is used within the
  782. # Game_Map, Game_Troop, and Game_Event classes.
  783. #==============================================================================

  784. class Game_Interpreter
  785.   #--------------------------------------------------------------------------
  786.   # * Alias method: command_108
  787.   #--------------------------------------------------------------------------
  788.   alias :command_108_ve_basic_module :command_108
  789.   def command_108
  790.     command_108_ve_basic_module
  791.     comment_call
  792.   end
  793.   #--------------------------------------------------------------------------
  794.   # * New method: comment_call
  795.   #--------------------------------------------------------------------------
  796.   def comment_call
  797.   end
  798.   #--------------------------------------------------------------------------
  799.   # * New method: note
  800.   #--------------------------------------------------------------------------
  801.   def note
  802.     @comments ? @comments.join("\r\n") : ""
  803.   end
  804. end

  805. #==============================================================================
  806. # ** Sprite_Character
  807. #------------------------------------------------------------------------------
  808. #  This sprite is used to display characters. It observes a instance of the
  809. # Game_Character class and automatically changes sprite conditions.
  810. #==============================================================================

  811. class Sprite_Character < Sprite_Base
  812.   #--------------------------------------------------------------------------
  813.   # * Overwrite method: set_character_bitmap
  814.   #--------------------------------------------------------------------------
  815.   def set_character_bitmap
  816.     update_character_info
  817.     set_bitmap
  818.     set_bitmap_position
  819.   end
  820.   #--------------------------------------------------------------------------
  821.   # * New method: center_y
  822.   #--------------------------------------------------------------------------
  823.   def actor?
  824.     @character.is_a?(Game_Player) || @character.is_a?(Game_Follower)
  825.   end
  826.   #--------------------------------------------------------------------------
  827.   # * New method: center_y
  828.   #--------------------------------------------------------------------------
  829.   def actor
  830.     actor? ? @character.actor : nil
  831.   end
  832.   #--------------------------------------------------------------------------
  833.   # * New method: update_character_info
  834.   #--------------------------------------------------------------------------
  835.   def update_character_info
  836.   end
  837.   #--------------------------------------------------------------------------
  838.   # * New method: hue
  839.   #--------------------------------------------------------------------------
  840.   def hue
  841.     @character.hue
  842.   end
  843.   #--------------------------------------------------------------------------
  844.   # * New method: set_bitmap
  845.   #--------------------------------------------------------------------------
  846.   def set_bitmap
  847.     self.bitmap = Cache.character(set_bitmap_name, hue)
  848.   end
  849.   #--------------------------------------------------------------------------
  850.   # * New method: set_bitmap_name
  851.   #--------------------------------------------------------------------------
  852.   def set_bitmap_name
  853.     @character_name
  854.   end
  855.   #--------------------------------------------------------------------------
  856.   # * New method: set_bitmap_position
  857.   #--------------------------------------------------------------------------
  858.   def set_bitmap_position
  859.     sign = get_sign
  860.     if sign && sign.include?('$')
  861.       @cw = bitmap.width / @character.frames
  862.       @ch = bitmap.height / 4
  863.     else
  864.       @cw = bitmap.width / (@character.frames * 4)
  865.       @ch = bitmap.height / 8
  866.     end
  867.     self.ox = @cw / 2
  868.     self.oy = @ch
  869.   end
  870.   #--------------------------------------------------------------------------
  871.   # * New method: get_sign
  872.   #--------------------------------------------------------------------------
  873.   def get_sign
  874.     @character_name[/^[\!\$]./]
  875.   end
  876. end

  877. #==============================================================================
  878. # ** Sprite_Battler
  879. #------------------------------------------------------------------------------
  880. #  This sprite is used to display battlers. It observes a instance of the
  881. # Game_Battler class and automatically changes sprite conditions.
  882. #==============================================================================

  883. class Sprite_Battler < Sprite_Base
  884.   #--------------------------------------------------------------------------
  885.   # * Public Instance Variables
  886.   #--------------------------------------------------------------------------
  887.   attr_accessor :dmg_mirror
  888.   #--------------------------------------------------------------------------
  889.   # * New method: center_x
  890.   #--------------------------------------------------------------------------
  891.   def center_x
  892.     self.ox
  893.   end
  894.   #--------------------------------------------------------------------------
  895.   # * New method: center_y
  896.   #--------------------------------------------------------------------------
  897.   def center_y
  898.     self.oy / 2
  899.   end
  900. end

  901. #==============================================================================
  902. # ** Spriteset_Battle
  903. #------------------------------------------------------------------------------
  904. #  This class brings together battle screen sprites. It's used within the
  905. # Scene_Battle class.
  906. #==============================================================================

  907. class Spriteset_Battle
  908.   #--------------------------------------------------------------------------
  909.   # * Public Instance Variables
  910.   #--------------------------------------------------------------------------
  911.   attr_reader   :viewport1
  912.   #--------------------------------------------------------------------------
  913.   # * New method: sprite
  914.   #--------------------------------------------------------------------------
  915.   def sprite(subject)
  916.     battler_sprites.compact.select {|sprite| sprite.battler == subject }.first
  917.   end
  918. end

  919. #==============================================================================
  920. # ** Window_Base
  921. #------------------------------------------------------------------------------
  922. #  This is a superclass of all windows in the game.
  923. #==============================================================================

  924. class Window_Base < Window
  925.   #--------------------------------------------------------------------------
  926.   # * Alias method: convert_escape_characters
  927.   #--------------------------------------------------------------------------
  928.   alias :convert_escape_ve_basic_module :convert_escape_characters
  929.   def convert_escape_characters(text)
  930.     result = text.to_s.clone
  931.     result = text_replace(result)
  932.     result = convert_escape_ve_basic_module(text)
  933.     result
  934.   end
  935.   #--------------------------------------------------------------------------
  936.   # * New method: text_replace
  937.   #--------------------------------------------------------------------------
  938.   def text_replace(result)
  939.     result.gsub!(/\r/) { "" }
  940.     result.gsub!(/\\/) { "\e" }
  941.     result
  942.   end
  943. end

  944. #==============================================================================
  945. # ** Scene_Battle
  946. #------------------------------------------------------------------------------
  947. #  This class performs battle screen processing.
  948. #==============================================================================

  949. class Scene_Battle < Scene_Base
  950.   #--------------------------------------------------------------------------
  951.   # * Public Instance Variables
  952.   #--------------------------------------------------------------------------
  953.   attr_reader   :spriteset
  954. end
复制代码



  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. $imported = {} if $imported.nil?
  10. $imported["YEA-VictoryAftermath"] = true

  11. #==============================================================================
  12. # ▼ Updates
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. # 2012.01.07 - Compatibility Update: JP Manager
  15. # 2012.01.01 - Bug Fixed: Quote tags were mislabeled.
  16. # 2011.12.26 - Compatibility Update: Command Autobattle
  17. # 2011.12.16 - Started Script and Finished.
  18. #
  19. #==============================================================================
  20. # ▼ Introduction
  21. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  22. # At the end of each battle, RPG Maker VX Ace by default shows text saying that
  23. # the party has gained so-and-so EXP while this person leveled up and your
  24. # party happened to find these drops. This script changes that text into
  25. # something more visual for your players to see. Active battle members will be
  26. # seen gaining EXP, any kind of level up changes, and a list of the items
  27. # obtained through drops.
  28. #
  29. #==============================================================================
  30. # ▼ Instructions
  31. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  32. # To install this script, open up your script editor and copy/paste this script
  33. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  34. #
  35. # -----------------------------------------------------------------------------
  36. # Actor Notetags - These notetags go in the actors notebox in the database.
  37. # -----------------------------------------------------------------------------
  38. # <win quotes>
  39. #  string
  40. #  string
  41. # </win quotes>
  42. # Sets the win quote for the actor. The strings are continuous and can use
  43. # text codes. Use \n for a line break. Type in what you want the actor to say
  44. # for the particular win quote. Use [New Quote] in between the two tags to
  45. # start up a new quote.
  46. #
  47. # <level quotes>
  48. #  string
  49. #  string
  50. # </level quotes>
  51. # Sets the level up quote for the actor. The strings are continuous and can use
  52. # text codes. Use \n for a line break. Type in what you want the actor to say
  53. # for the particular win quote. Use [New Quote] in between the two tags to
  54. # start up a new quote.
  55. #
  56. # <drops quotes>
  57. #  string
  58. #  string
  59. # </drops quotes>
  60. # Sets the drops quote for the actor. The strings are continuous and can use
  61. # text codes. Use \n for a line break. Type in what you want the actor to say
  62. # for the particular win quote. Use [New Quote] in between the two tags to
  63. # start up a new quote.
  64. #
  65. # -----------------------------------------------------------------------------
  66. # Class Notetags - These notetags go in the class notebox in the database.
  67. # -----------------------------------------------------------------------------
  68. # <win quotes>
  69. #  string
  70. #  string
  71. # </win quotes>
  72. # Sets the win quote for the class. The strings are continuous and can use
  73. # text codes. Use \n for a line break. Type in what you want the actor to say
  74. # for the particular win quote. Use [New Quote] in between the two tags to
  75. # start up a new quote.
  76. #
  77. # <level quotes>
  78. #  string
  79. #  string
  80. # </level quotes>
  81. # Sets the level up quote for the class. The strings are continuous and can use
  82. # text codes. Use \n for a line break. Type in what you want the actor to say
  83. # for the particular win quote. Use [New Quote] in between the two tags to
  84. # start up a new quote.
  85. #
  86. # <drops quotes>
  87. #  string
  88. #  string
  89. # </drops quotes>
  90. # Sets the drops quote for the class. The strings are continuous and can use
  91. # text codes. Use \n for a line break. Type in what you want the actor to say
  92. # for the particular win quote. Use [New Quote] in between the two tags to
  93. # start up a new quote.
  94. #
  95. #==============================================================================
  96. # ▼ Compatibility
  97. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  98. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  99. # it will run with RPG Maker VX without adjusting.
  100. #
  101. #==============================================================================

  102. module YEA
  103.   module VICTORY_AFTERMATH
  104.    
  105.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  106.     # - General Settings -
  107.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  108.     # These are various settings that are used throughout the Victory Aftermath
  109.     # portion of a battle. Adjust them as you see fit.
  110.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  111.     VICTORY_BGM  = RPG::BGM.new("Field1", 100, 100)    # Victory BGM
  112.     VICTORY_TICK = RPG::SE.new("Decision1", 100, 150)  # EXP ticking SFX
  113.     LEVEL_SOUND  = RPG::SE.new("Up4", 80, 150)         # Level Up SFX
  114.     SKILLS_TEXT  = "新技能"                        # New skills text title.
  115.    
  116.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  117.     # - Important Settings -
  118.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  119.     # These are some important settings so please set them up properly. This
  120.     # section includes a switch that allows you to skip the victory aftermath
  121.     # phase (for those back to back battles and making them seamless) and it
  122.     # also allows you to declare a common event to run after each battle. If
  123.     # you do not wish to use either of these features, set them to 0. The
  124.     # common event will run regardless of win or escape.
  125.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  126.     SKIP_AFTERMATH_SWITCH  = 0  # If switch on, skip aftermath. 0 to disable.
  127.     AFTERMATH_COMMON_EVENT = 0  # Runs common event after battle. 0 to disable.
  128.    
  129.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  130.     # - Top Text Settings -
  131.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  132.     # Here, you can adjust the various text that appears in the window that
  133.     # appears at the top of the screen.
  134.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  135.     TOP_TEAM         = "%s的队伍"           # Team name used.
  136.     TOP_VICTORY_TEXT = "%s胜利了!"   # Text used to display victory.
  137.     TOP_LEVEL_UP     = "%s升级!"  # Text used to display level up.
  138.     TOP_SPOILS       = "胜利战利品!"     # Text used for spoils.
  139.    
  140.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  141.     # - EXP Gauge Settings -
  142.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  143.     # Adjust how the EXP Gauge appears for the Victory Aftermath here. This
  144.     # includes the text display, the font size, the colour of the gauges, and
  145.     # more. Adjust it all here.
  146.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  147.     VICTORY_EXP  = "+%sEXP"      # Text used to display EXP.
  148.     EXP_PERCENT  = "%1.2f%%"     # The way EXP percentage will be displayed.
  149.     LEVELUP_TEXT = "LEVEL UP!"   # Text to replace percentage when leveled.
  150.     MAX_LVL_TEXT = "MAX LEVEL"   # Text to replace percentage when max level.
  151.     FONTSIZE_EXP = 20            # Font size used for EXP.
  152.     EXP_TICKS    = 15            # Ticks to full EXP
  153.     EXP_GAUGE1   = 12            # "Window" skin text colour for gauge.
  154.     EXP_GAUGE2   = 4             # "Window" skin text colour for gauge.
  155.     LEVEL_GAUGE1 = 13            # "Window" skin text colour for leveling.
  156.     LEVEL_GAUGE2 = 5             # "Window" skin text colour for leveling.
  157.    
  158.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  159.     # - Victory Messages -
  160.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  161.     # In the Victory Aftermath, actors can say unique things. This is the pool
  162.     # of quotes used for actors without any custom victory quotes. Note that
  163.     # actors with custom quotes will take priority over classes with custom
  164.     # quotes, which will take priority over these default quotes. Use \n for
  165.     # a line break in the quotes.
  166.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  167.     HEADER_TEXT = "\e>\eC[6]%s\eC[0]\e<\n"  # Always at start of messages.
  168.     FOOTER_TEXT = ""                        # Always at end of messages.
  169.    
  170.     # Win Quotes are what the actors say when a battle is won.
  171.     VICTORY_QUOTES ={
  172.     # :type   => Quotes
  173.       #------------------------------------------------------------------------
  174.       :win    => [ # Occurs as initial victory quote.
  175.                    '"我们赢了! 多么激烈的战斗!"',
  176.                    '"我出了一身汗."',
  177.                    '"这并不难."',
  178.                    '"让我们挑战更厉害的!"',
  179.                  ],# Do not remove this.
  180.       #------------------------------------------------------------------------
  181.       :level  => [ # Occurs as initial victory quote.
  182.                    '"好! 升级了!"',
  183.                    '"我变强了!"',
  184.                    '"试试超过我!"',
  185.                    '"我又成长了!"',
  186.                  ],# Do not remove this.
  187.       #------------------------------------------------------------------------
  188.       :drops  => [ # Occurs as initial victory quote.
  189.                    '"带走这些东西."',
  190.                    '"胜利者的战利品."',
  191.                    '"怪物掉了些东西!"',
  192.                    '"嘿, 这是什么?"',
  193.                  ],# Do not remove this.
  194.       #------------------------------------------------------------------------
  195.     } # Do not remove this.
  196.    
  197.   end # VICTORY_AFTERMATH
  198. end # YEA

  199. #==============================================================================
  200. # ▼ Editting anything past this point may potentially result in causing
  201. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  202. # halitosis so edit at your own risk.
  203. #==============================================================================

  204. module YEA
  205.   module REGEXP
  206.   module BASEITEM
  207.    
  208.     NEW_QUOTE = /\[(?:NEW_QUOTE|new quote)\]/i
  209.    
  210.     WIN_QUOTE_ON    = /<(?:WIN_QUOTES|win quote|win quotes)>/i
  211.     WIN_QUOTE_OFF   = /<\/(?:WIN_QUOTES|win quote|win quotes)>/i
  212.     LEVEL_QUOTE_ON  = /<(?:LEVEL_QUOTES|level quote|level quotes)>/i
  213.     LEVEL_QUOTE_OFF = /<\/(?:LEVEL_QUOTES|level quote|level quotes)>/i
  214.     DROPS_QUOTE_ON  = /<(?:DROPS_QUOTES|drops quote|drops quotes)>/i
  215.     DROPS_QUOTE_OFF = /<\/(?:DROPS_QUOTES|drops quote|drops quotes)>/i
  216.    
  217.   end # BASEITEM
  218.   end # REGEXP
  219. end # YEA

  220. #==============================================================================
  221. # ■ Switch
  222. #==============================================================================

  223. module Switch
  224.   
  225.   #--------------------------------------------------------------------------
  226.   # self.skip_aftermath
  227.   #--------------------------------------------------------------------------
  228.   def self.skip_aftermath
  229.     return false if YEA::VICTORY_AFTERMATH::SKIP_AFTERMATH_SWITCH <= 0
  230.     return $game_switches[YEA::VICTORY_AFTERMATH::SKIP_AFTERMATH_SWITCH]
  231.   end
  232.    
  233. end # Switch

  234. #==============================================================================
  235. # ■ Numeric
  236. #==============================================================================

  237. class Numeric
  238.   
  239.   #--------------------------------------------------------------------------
  240.   # new method: group_digits
  241.   #--------------------------------------------------------------------------
  242.   unless $imported["YEA-CoreEngine"]
  243.   def group; return self.to_s; end
  244.   end # $imported["YEA-CoreEngine"]
  245.    
  246. end # Numeric

  247. #==============================================================================
  248. # ■ DataManager
  249. #==============================================================================

  250. module DataManager
  251.   
  252.   #--------------------------------------------------------------------------
  253.   # alias method: load_database
  254.   #--------------------------------------------------------------------------
  255.   class <<self; alias load_database_va load_database; end
  256.   def self.load_database
  257.     load_database_va
  258.     load_notetags_va
  259.   end
  260.   
  261.   #--------------------------------------------------------------------------
  262.   # new method: load_notetags_va
  263.   #--------------------------------------------------------------------------
  264.   def self.load_notetags_va
  265.     groups = [$data_actors, $data_classes]
  266.     for group in groups
  267.       for obj in group
  268.         next if obj.nil?
  269.         obj.load_notetags_va
  270.       end
  271.     end
  272.   end
  273.   
  274. end # DataManager

  275. #==============================================================================
  276. # ■ RPG::BaseItem
  277. #==============================================================================

  278. class RPG::BaseItem
  279.   
  280.   #--------------------------------------------------------------------------
  281.   # public instance variables
  282.   #--------------------------------------------------------------------------
  283.   attr_accessor :win_quotes
  284.   attr_accessor :level_quotes
  285.   attr_accessor :drops_quotes
  286.   
  287.   #--------------------------------------------------------------------------
  288.   # common cache: load_notetags_va
  289.   #--------------------------------------------------------------------------
  290.   def load_notetags_va
  291.     @win_quotes = [""]
  292.     @level_quotes = [""]
  293.     @drops_quotes = [""]
  294.     @victory_quote_type = nil
  295.     #---
  296.     self.note.split(/[\r\n]+/).each { |line|
  297.       case line
  298.       #---
  299.       when YEA::REGEXP::BASEITEM::WIN_QUOTE_ON
  300.         @victory_quote_type = :win_quote
  301.       when YEA::REGEXP::BASEITEM::WIN_QUOTE_OFF
  302.         @victory_quote_type = nil
  303.       when YEA::REGEXP::BASEITEM::LEVEL_QUOTE_ON
  304.         @victory_quote_type = :level_quote
  305.       when YEA::REGEXP::BASEITEM::LEVEL_QUOTE_OFF
  306.         @victory_quote_type = nil
  307.       when YEA::REGEXP::BASEITEM::DROPS_QUOTE_ON
  308.         @victory_quote_type = :drops_quote
  309.       when YEA::REGEXP::BASEITEM::DROPS_QUOTE_OFF
  310.         @victory_quote_type = nil
  311.       #---
  312.       when YEA::REGEXP::BASEITEM::NEW_QUOTE
  313.         case @victory_quote_type
  314.         when nil; next
  315.         when :win_quote;   @win_quotes.push("")
  316.         when :level_quote; @level_quotes.push("")
  317.         when :drops_quote; @drops_quotes.push("")
  318.         end
  319.       #---
  320.       else
  321.         case @victory_quote_type
  322.         when nil; next
  323.         when :win_quote;   @win_quotes[@win_quotes.size-1] += line.to_s
  324.         when :level_quote; @level_quotes[@level_quotes.size-1] += line.to_s
  325.         when :drops_quote; @drops_quotes[@drops_quotes.size-1] += line.to_s
  326.         end
  327.       end
  328.     } # self.note.split
  329.     #---
  330.     return unless self.is_a?(RPG::Class)
  331.     quotes = YEA::VICTORY_AFTERMATH::VICTORY_QUOTES
  332.     @win_quotes = quotes[:win].clone if @win_quotes == [""]
  333.     @level_quotes = quotes[:level].clone if @level_quotes == [""]
  334.     @drops_quotes = quotes[:drops].clone if @drops_quotes == [""]
  335.   end
  336.   
  337. end # RPG::BaseItem

  338. #==============================================================================
  339. # ■ BattleManager
  340. #==============================================================================

  341. module BattleManager
  342.   
  343.   #--------------------------------------------------------------------------
  344.   # overwrite method: self.process_victory
  345.   #--------------------------------------------------------------------------
  346.   def self.process_victory
  347.     if $imported["YEA-CommandAutobattle"]
  348.       SceneManager.scene.close_disable_autobattle_window
  349.     end
  350.     if Switch.skip_aftermath
  351.       skip_aftermath
  352.       return
  353.     end
  354.     play_battle_end_me
  355.     gain_jp if $imported["YEA-JPManager"]
  356.     display_exp
  357.     gain_exp
  358.     gain_gold
  359.     gain_drop_items
  360.     close_windows
  361.     SceneManager.return
  362.     replay_bgm_and_bgs
  363.     battle_end(0)
  364.     return true
  365.   end
  366.   
  367.   #--------------------------------------------------------------------------
  368.   # new method: self.skip_aftermath
  369.   #--------------------------------------------------------------------------
  370.   def self.skip_aftermath
  371.     $game_party.all_members.each do |actor|
  372.       actor.gain_exp($game_troop.exp_total)
  373.     end
  374.     $game_party.gain_gold($game_troop.gold_total)
  375.     $game_troop.make_drop_items.each do |item|
  376.       $game_party.gain_item(item, 1)
  377.     end
  378.     close_windows
  379.     SceneManager.return
  380.     replay_bgm_and_bgs
  381.     battle_end(0)
  382.   end
  383.   
  384.   #--------------------------------------------------------------------------
  385.   # overwrite method: self.play_battle_end_me
  386.   #--------------------------------------------------------------------------
  387.   def self.play_battle_end_me
  388.     $game_system.battle_end_me.play
  389.     YEA::VICTORY_AFTERMATH::VICTORY_BGM.play
  390.   end
  391.   
  392.   #--------------------------------------------------------------------------
  393.   # new method: self.set_victory_text
  394.   #--------------------------------------------------------------------------
  395.   def self.set_victory_text(actor, type)
  396.     text = "" + sprintf(YEA::VICTORY_AFTERMATH::HEADER_TEXT, actor.name)
  397.     text += actor.victory_quotes(type)[rand(actor.victory_quotes(type).size)]
  398.     text += YEA::VICTORY_AFTERMATH::FOOTER_TEXT
  399.     $game_message.face_name = actor.face_name
  400.     $game_message.face_index = actor.face_index
  401.     $game_message.add(text)
  402.     wait_for_message
  403.   end
  404.   
  405.   #--------------------------------------------------------------------------
  406.   # overwrite method: self.display_exp
  407.   #--------------------------------------------------------------------------
  408.   def self.display_exp
  409.     SceneManager.scene.show_victory_display_exp
  410.     actor = $game_party.random_target
  411.     @victory_actor = actor
  412.     set_victory_text(@victory_actor, :win)
  413.   end
  414.   
  415.   #--------------------------------------------------------------------------
  416.   # overwrite method: self.gain_exp
  417.   #--------------------------------------------------------------------------
  418.   def self.gain_exp
  419.     $game_party.all_members.each do |actor|
  420.       temp_actor = Marshal.load(Marshal.dump(actor))
  421.       actor.gain_exp($game_troop.exp_total)
  422.       next if actor.level == temp_actor.level
  423.       SceneManager.scene.show_victory_level_up(actor, temp_actor)
  424.       set_victory_text(actor, :level)
  425.       wait_for_message
  426.     end
  427.   end
  428.   
  429.   #--------------------------------------------------------------------------
  430.   # overwrite method: self.gain_gold
  431.   #--------------------------------------------------------------------------
  432.   def self.gain_gold
  433.     $game_party.gain_gold($game_troop.gold_total)
  434.   end
  435.   
  436.   #--------------------------------------------------------------------------
  437.   # overwrite method: self.gain_drop_items
  438.   #--------------------------------------------------------------------------
  439.   def self.gain_drop_items
  440.     drops = []
  441.     $game_troop.make_drop_items.each do |item|
  442.       $game_party.gain_item(item, 1)
  443.       drops.push(item)
  444.     end
  445.     SceneManager.scene.show_victory_spoils($game_troop.gold_total, drops)
  446.     set_victory_text(@victory_actor, :drops)
  447.     wait_for_message
  448.   end
  449.   
  450.   #--------------------------------------------------------------------------
  451.   # new method: self.close_windows
  452.   #--------------------------------------------------------------------------
  453.   def self.close_windows
  454.     SceneManager.scene.close_victory_windows
  455.   end
  456.   
  457.   #--------------------------------------------------------------------------
  458.   # alias method: load_database
  459.   #--------------------------------------------------------------------------
  460.   class <<self; alias battle_end_va battle_end; end
  461.   def self.battle_end(result)
  462.     battle_end_va(result)
  463.     return if result == 2
  464.     return if YEA::VICTORY_AFTERMATH::AFTERMATH_COMMON_EVENT <= 0
  465.     event_id = YEA::VICTORY_AFTERMATH::AFTERMATH_COMMON_EVENT
  466.     $game_temp.reserve_common_event(event_id)
  467.   end
  468.   
  469. end # BattleManager

  470. #==============================================================================
  471. # ■ Game_Actor
  472. #==============================================================================

  473. class Game_Actor < Game_Battler
  474.   
  475.   #--------------------------------------------------------------------------
  476.   # overwrite method: gain_exp
  477.   #--------------------------------------------------------------------------
  478.   def gain_exp(exp)
  479.     enabled = !SceneManager.scene_is?(Scene_Battle)
  480.     change_exp(self.exp + (exp * final_exp_rate).to_i, enabled)
  481.   end
  482.   
  483.   #--------------------------------------------------------------------------
  484.   # new method: victory_quotes
  485.   #--------------------------------------------------------------------------
  486.   def victory_quotes(type)
  487.     case type
  488.     when :win
  489.       return self.actor.win_quotes if self.actor.win_quotes != [""]
  490.       return self.class.win_quotes
  491.     when :level
  492.       return self.actor.level_quotes if self.actor.level_quotes != [""]
  493.       return self.class.level_quotes
  494.     when :drops
  495.       return self.actor.drops_quotes if self.actor.drops_quotes != [""]
  496.       return self.class.drops_quotes
  497.     else
  498.       return ["NOTEXT"]
  499.     end
  500.   end
  501.   
  502. end # Game_Actor

  503. #==============================================================================
  504. # ■ Window_VictoryTitle
  505. #==============================================================================

  506. class Window_VictoryTitle < Window_Base
  507.   
  508.   #--------------------------------------------------------------------------
  509.   # initialize
  510.   #--------------------------------------------------------------------------
  511.   def initialize
  512.     super(0, 0, Graphics.width, fitting_height(1))
  513.     self.z = 200
  514.     self.openness = 0
  515.   end
  516.   
  517.   #--------------------------------------------------------------------------
  518.   # refresh
  519.   #--------------------------------------------------------------------------
  520.   def refresh(message = "")
  521.     contents.clear
  522.     draw_text(0, 0, contents.width, line_height, message, 1)
  523.   end
  524.   
  525. end # Window_VictoryTitle

  526. #==============================================================================
  527. # ■ Window_VictoryEXP_Back
  528. #==============================================================================

  529. class Window_VictoryEXP_Back < Window_Selectable
  530.   
  531.   #--------------------------------------------------------------------------
  532.   # initialize
  533.   #--------------------------------------------------------------------------
  534.   def initialize
  535.     super(0, fitting_height(1), Graphics.width, window_height)
  536.     self.z = 200
  537.     self.openness = 0
  538.   end
  539.   
  540.   #--------------------------------------------------------------------------
  541.   # window_height
  542.   #--------------------------------------------------------------------------
  543.   def window_height
  544.     return Graphics.height - fitting_height(4) - fitting_height(1)
  545.   end
  546.   
  547.   #--------------------------------------------------------------------------
  548.   # col_max
  549.   #--------------------------------------------------------------------------
  550.   def col_max; return item_max; end
  551.   
  552.   #--------------------------------------------------------------------------
  553.   # spacing
  554.   #--------------------------------------------------------------------------
  555.   def spacing; return 8; end
  556.   
  557.   #--------------------------------------------------------------------------
  558.   # item_max
  559.   #--------------------------------------------------------------------------
  560.   def item_max; return $game_party.battle_members.size; end
  561.   
  562.   #--------------------------------------------------------------------------
  563.   # open
  564.   #--------------------------------------------------------------------------
  565.   def open
  566.     @exp_total = $game_troop.exp_total
  567.     super
  568.   end
  569.   
  570.   #--------------------------------------------------------------------------
  571.   # item_rect
  572.   #--------------------------------------------------------------------------
  573.   def item_rect(index)
  574.     rect = Rect.new
  575.     rect.width = item_width
  576.     rect.height = contents.height
  577.     rect.x = index % col_max * (item_width + spacing)
  578.     rect.y = index / col_max * item_height
  579.     return rect
  580.   end
  581.   
  582.   #--------------------------------------------------------------------------
  583.   # draw_item
  584.   #--------------------------------------------------------------------------
  585.   def draw_item(index)
  586.     actor = $game_party.battle_members[index]
  587.     return if actor.nil?
  588.     rect = item_rect(index)
  589.     reset_font_settings
  590.     draw_actor_name(actor, rect)
  591.     draw_exp_gain(actor, rect)
  592.     draw_jp_gain(actor, rect)
  593.     draw_actor_face(actor, rect)
  594.   end
  595.   
  596.   #--------------------------------------------------------------------------
  597.   # draw_actor_name
  598.   #--------------------------------------------------------------------------
  599.   def draw_actor_name(actor, rect)
  600.     name = actor.name
  601.     draw_text(rect.x, rect.y+line_height, rect.width, line_height, name, 1)
  602.   end
  603.   
  604.   #--------------------------------------------------------------------------
  605.   # draw_actor_face
  606.   #--------------------------------------------------------------------------
  607.   def draw_actor_face(actor, rect)
  608.     face_name = actor.face_name
  609.     face_index = actor.face_index
  610.     bitmap = Cache.face(face_name)
  611.     rw = [rect.width, 96].min
  612.     face_rect = Rect.new(face_index % 4 * 96, face_index / 4 * 96, rw, 96)
  613.     rx = (rect.width - rw) / 2 + rect.x
  614.     contents.blt(rx, rect.y + line_height * 2, bitmap, face_rect, 255)
  615.   end
  616.   
  617.   #--------------------------------------------------------------------------
  618.   # draw_exp_gain
  619.   #--------------------------------------------------------------------------
  620.   def draw_exp_gain(actor, rect)
  621.     dw = rect.width - (rect.width - [rect.width, 96].min) / 2
  622.     dy = rect.y + line_height * 3 + 96
  623.     fmt = YEA::VICTORY_AFTERMATH::VICTORY_EXP
  624.     text = sprintf(fmt, actor_exp_gain(actor).group)
  625.     contents.font.size = YEA::VICTORY_AFTERMATH::FONTSIZE_EXP
  626.     change_color(power_up_color)
  627.     draw_text(rect.x, dy, dw, line_height, text, 2)
  628.   end
  629.   
  630.   #--------------------------------------------------------------------------
  631.   # actor_exp_gain
  632.   #--------------------------------------------------------------------------
  633.   def actor_exp_gain(actor)
  634.     n = @exp_total * actor.final_exp_rate
  635.     return n.to_i
  636.   end
  637.   
  638.   #--------------------------------------------------------------------------
  639.   # draw_jp_gain
  640.   #--------------------------------------------------------------------------
  641.   def draw_jp_gain(actor, rect)
  642.     return unless $imported["YEA-JPManager"]
  643.     dw = rect.width - (rect.width - [rect.width, 96].min) / 2
  644.     dy = rect.y + line_height * 4 + 96
  645.     fmt = YEA::JP::VICTORY_AFTERMATH
  646.     text = sprintf(fmt, actor_jp_gain(actor).group, Vocab::jp)
  647.     contents.font.size = YEA::VICTORY_AFTERMATH::FONTSIZE_EXP
  648.     change_color(power_up_color)
  649.     draw_text(rect.x, dy, dw, line_height, text, 2)
  650.   end
  651.   
  652.   #--------------------------------------------------------------------------
  653.   # actor_jp_gain
  654.   #--------------------------------------------------------------------------
  655.   def actor_jp_gain(actor)
  656.     n = actor.battle_jp_earned
  657.     if actor.exp + actor_exp_gain(actor) > actor.exp_for_level(actor.level + 1)
  658.       n += YEA::JP::LEVEL_UP unless actor.max_level?
  659.     end
  660.     return n
  661.   end
  662.   
  663. end # Window_VictoryEXP_Back

  664. #==============================================================================
  665. # ■ Window_VictoryEXP_Front
  666. #==============================================================================

  667. class Window_VictoryEXP_Front < Window_VictoryEXP_Back
  668.   
  669.   #--------------------------------------------------------------------------
  670.   # initialize
  671.   #--------------------------------------------------------------------------
  672.   def initialize
  673.     super
  674.     self.back_opacity = 0
  675.     @ticks = 0
  676.     @counter = 30
  677.     contents.font.size = YEA::VICTORY_AFTERMATH::FONTSIZE_EXP
  678.   end
  679.   
  680.   #--------------------------------------------------------------------------
  681.   # update
  682.   #--------------------------------------------------------------------------
  683.   def update
  684.     super
  685.     update_tick
  686.   end
  687.   
  688.   #--------------------------------------------------------------------------
  689.   # update_tick
  690.   #--------------------------------------------------------------------------
  691.   def update_tick
  692.     return unless self.openness >= 255
  693.     return unless self.visible
  694.     return if complete_ticks?
  695.     @counter -= 1
  696.     return unless @counter <= 0
  697.     return if @ticks >= YEA::VICTORY_AFTERMATH::EXP_TICKS
  698.     YEA::VICTORY_AFTERMATH::VICTORY_TICK.play
  699.     @counter = 4
  700.     @ticks += 1
  701.     refresh
  702.   end
  703.   
  704.   #--------------------------------------------------------------------------
  705.   # complete_ticks?
  706.   #--------------------------------------------------------------------------
  707.   def complete_ticks?
  708.     for actor in $game_party.battle_members
  709.       total_ticks = YEA::VICTORY_AFTERMATH::EXP_TICKS
  710.       bonus_exp = actor_exp_gain(actor) * @ticks / total_ticks
  711.       now_exp = actor.exp - actor.current_level_exp + bonus_exp
  712.       next_exp = actor.next_level_exp - actor.current_level_exp
  713.       rate = now_exp * 1.0 / next_exp
  714.       return false if rate < 1.0
  715.     end
  716.     return true
  717.   end
  718.   
  719.   #--------------------------------------------------------------------------
  720.   # draw_item
  721.   #--------------------------------------------------------------------------
  722.   def draw_item(index)
  723.     actor = $game_party.battle_members[index]
  724.     return if actor.nil?
  725.     rect = item_rect(index)
  726.     draw_actor_exp(actor, rect)
  727.   end
  728.   
  729.   #--------------------------------------------------------------------------
  730.   # exp_gauge1
  731.   #--------------------------------------------------------------------------
  732.   def exp_gauge1; return text_color(YEA::VICTORY_AFTERMATH::EXP_GAUGE1); end
  733.   
  734.   #--------------------------------------------------------------------------
  735.   # exp_gauge2
  736.   #--------------------------------------------------------------------------
  737.   def exp_gauge2; return text_color(YEA::VICTORY_AFTERMATH::EXP_GAUGE2); end
  738.   
  739.   #--------------------------------------------------------------------------
  740.   # lvl_gauge1
  741.   #--------------------------------------------------------------------------
  742.   def lvl_gauge1; return text_color(YEA::VICTORY_AFTERMATH::LEVEL_GAUGE1); end
  743.   
  744.   #--------------------------------------------------------------------------
  745.   # lvl_gauge2
  746.   #--------------------------------------------------------------------------
  747.   def lvl_gauge2; return text_color(YEA::VICTORY_AFTERMATH::LEVEL_GAUGE2); end
  748.   
  749.   #--------------------------------------------------------------------------
  750.   # draw_actor_exp
  751.   #--------------------------------------------------------------------------
  752.   def draw_actor_exp(actor, rect)
  753.     if actor.max_level?
  754.       draw_exp_gauge(actor, rect, 1.0)
  755.       return
  756.     end
  757.     total_ticks = YEA::VICTORY_AFTERMATH::EXP_TICKS
  758.     bonus_exp = actor_exp_gain(actor) * @ticks / total_ticks
  759.     now_exp = actor.exp - actor.current_level_exp + bonus_exp
  760.     next_exp = actor.next_level_exp - actor.current_level_exp
  761.     rate = now_exp * 1.0 / next_exp
  762.     draw_exp_gauge(actor, rect, rate)
  763.   end
  764.   
  765.   #--------------------------------------------------------------------------
  766.   # draw_exp_gauge
  767.   #--------------------------------------------------------------------------
  768.   def draw_exp_gauge(actor, rect, rate)
  769.     rate = [[rate, 1.0].min, 0.0].max
  770.     dx = (rect.width - [rect.width, 96].min) / 2 + rect.x
  771.     dy = rect.y + line_height * 2 + 96
  772.     dw = [rect.width, 96].min
  773.     colour1 = rate >= 1.0 ? lvl_gauge1 : exp_gauge1
  774.     colour2 = rate >= 1.0 ? lvl_gauge2 : exp_gauge2
  775.     draw_gauge(dx, dy, dw, rate, colour1, colour2)
  776.     fmt = YEA::VICTORY_AFTERMATH::EXP_PERCENT
  777.     text = sprintf(fmt, [rate * 100, 100.00].min)
  778.     if [rate * 100, 100.00].min == 100.00
  779.       text = YEA::VICTORY_AFTERMATH::LEVELUP_TEXT
  780.       text = YEA::VICTORY_AFTERMATH::MAX_LVL_TEXT if actor.max_level?
  781.     end
  782.     draw_text(dx, dy, dw, line_height, text, 1)
  783.   end
  784.   
  785. end # Window_VictoryEXP_Front

  786. #==============================================================================
  787. # ■ Window_VictoryLevelUp
  788. #==============================================================================

  789. class Window_VictoryLevelUp < Window_Base
  790.   
  791.   #--------------------------------------------------------------------------
  792.   # initialize
  793.   #--------------------------------------------------------------------------
  794.   def initialize
  795.     super(0, fitting_height(1), Graphics.width, window_height)
  796.     self.z = 200
  797.     hide
  798.   end
  799.   
  800.   #--------------------------------------------------------------------------
  801.   # window_height
  802.   #--------------------------------------------------------------------------
  803.   def window_height
  804.     return Graphics.height - fitting_height(4) - fitting_height(1)
  805.   end
  806.   
  807.   #--------------------------------------------------------------------------
  808.   # refresh
  809.   #--------------------------------------------------------------------------
  810.   def refresh(actor, temp_actor)
  811.     contents.clear
  812.     reset_font_settings
  813.     YEA::VICTORY_AFTERMATH::LEVEL_SOUND.play
  814.     draw_actor_changes(actor, temp_actor)
  815.   end
  816.   
  817.   #--------------------------------------------------------------------------
  818.   # draw_actor_changes
  819.   #--------------------------------------------------------------------------
  820.   def draw_actor_changes(actor, temp_actor)
  821.     dx = contents.width / 16
  822.     draw_actor_image(actor, temp_actor, dx)
  823.     draw_param_names(actor, dx)
  824.     draw_former_stats(temp_actor)
  825.     draw_arrows
  826.     draw_newer_stats(actor, temp_actor)
  827.     draw_new_skills(actor, temp_actor)
  828.   end
  829.   
  830.   #--------------------------------------------------------------------------
  831.   # draw_actor_image
  832.   #--------------------------------------------------------------------------
  833.   def draw_actor_image(actor, temp_actor, dx)
  834.     draw_text(dx, line_height, 96, line_height, actor.name, 1)
  835.     draw_actor_face(actor, dx, line_height * 2)
  836.     exp = actor.exp - temp_actor.exp
  837.     text = sprintf(YEA::VICTORY_AFTERMATH::VICTORY_EXP, exp.group)
  838.     change_color(power_up_color)
  839.     contents.font.size = YEA::VICTORY_AFTERMATH::FONTSIZE_EXP
  840.     draw_text(0, line_height * 2 + 96, dx + 96, line_height, text, 2)
  841.     reset_font_settings
  842.   end
  843.   
  844.   #--------------------------------------------------------------------------
  845.   # draw_param_names
  846.   #--------------------------------------------------------------------------
  847.   def draw_param_names(actor, dx)
  848.     dx += 108
  849.     change_color(system_color)
  850.     text = Vocab.level
  851.     draw_text(dx, 0, contents.width - dx, line_height, text)
  852.     dy = 0
  853.     for i in 0...8
  854.       dy += line_height
  855.       text = Vocab.param(i)
  856.       draw_text(dx, dy, contents.width - dx, line_height, text)
  857.     end
  858.   end
  859.   
  860.   #--------------------------------------------------------------------------
  861.   # draw_former_stats
  862.   #--------------------------------------------------------------------------
  863.   def draw_former_stats(actor)
  864.     dw = contents.width / 2 - 12
  865.     dy = 0
  866.     change_color(normal_color)
  867.     draw_text(0, dy, dw, line_height, actor.level.group, 2)
  868.     for i in 0...8
  869.       dy += line_height
  870.       draw_text(0, dy, dw, line_height, actor.param(i).group, 2)
  871.     end
  872.   end
  873.   
  874.   #--------------------------------------------------------------------------
  875.   # draw_arrows
  876.   #--------------------------------------------------------------------------
  877.   def draw_arrows
  878.     dx = contents.width / 2 - 12
  879.     dy = 0
  880.     change_color(system_color)
  881.     for i in 0..8
  882.       draw_text(dx, dy, 24, line_height, "→", 1)
  883.       dy += line_height
  884.     end
  885.   end
  886.   
  887.   #--------------------------------------------------------------------------
  888.   # draw_newer_stats
  889.   #--------------------------------------------------------------------------
  890.   def draw_newer_stats(actor, temp_actor)
  891.     dx = contents.width / 2 + 12
  892.     dw = contents.width - dx
  893.     dy = 0
  894.     change_color(param_change_color(actor.level - temp_actor.level))
  895.     draw_text(dx, dy, dw, line_height, actor.level.group, 0)
  896.     for i in 0...8
  897.       dy += line_height
  898.       change_color(param_change_color(actor.param(i) - temp_actor.param(i)))
  899.       draw_text(dx, dy, dw, line_height, actor.param(i).group, 0)
  900.     end
  901.   end
  902.   
  903.   #--------------------------------------------------------------------------
  904.   # draw_new_skills
  905.   #--------------------------------------------------------------------------
  906.   def draw_new_skills(actor, temp_actor)
  907.     return if temp_actor.skills.size == actor.skills.size
  908.     dw = 172 + 24
  909.     dx = contents.width - dw
  910.     change_color(system_color)
  911.     text = YEA::VICTORY_AFTERMATH::SKILLS_TEXT
  912.     draw_text(dx, 0, dw, line_height, text, 0)
  913.   end
  914.   
  915. end # Window_VictoryLevelUp

  916. #==============================================================================
  917. # ■ Window_VictorySkills
  918. #==============================================================================

  919. class Window_VictorySkills < Window_Selectable
  920.   
  921.   #--------------------------------------------------------------------------
  922.   # initialize
  923.   #--------------------------------------------------------------------------
  924.   def initialize
  925.     dy = fitting_height(1) + 24
  926.     dw = 172 + 24 + 24
  927.     dh = Graphics.height - fitting_height(4) - fitting_height(1) - 24
  928.     super(Graphics.width - dw, dy, dw, dh)
  929.     self.opacity = 0
  930.     self.z = 200
  931.     hide
  932.   end
  933.   
  934.   #--------------------------------------------------------------------------
  935.   # item_max
  936.   #--------------------------------------------------------------------------
  937.   def item_max; return @data.nil? ? 0 : @data.size; end
  938.   
  939.   #--------------------------------------------------------------------------
  940.   # refresh
  941.   #--------------------------------------------------------------------------
  942.   def refresh(actor, temp_actor)
  943.     contents.clear
  944.     if actor.skills.size == temp_actor.skills.size
  945.       unselect
  946.       @data = []
  947.       create_contents
  948.       return
  949.     end
  950.     @data = actor.skills - temp_actor.skills
  951.     if @data.size > 8
  952.       select(0)
  953.       activate
  954.     else
  955.       unselect
  956.       deactivate
  957.     end
  958.     create_contents
  959.     draw_all_items
  960.   end
  961.   
  962.   #--------------------------------------------------------------------------
  963.   # refresh
  964.   #--------------------------------------------------------------------------
  965.   def draw_item(index)
  966.     rect = item_rect(index)
  967.     skill = @data[index]
  968.     return if skill.nil?
  969.     rect.width -= 4
  970.     draw_item_name(skill, rect.x, rect.y, true)
  971.   end
  972.   
  973. end # Window_VictorySkills

  974. #==============================================================================
  975. # ■ Window_VictorySpoils
  976. #==============================================================================

  977. class Window_VictorySpoils < Window_ItemList
  978.   
  979.   #--------------------------------------------------------------------------
  980.   # initialize
  981.   #--------------------------------------------------------------------------
  982.   def initialize
  983.     super(0, fitting_height(1), Graphics.width, window_height)
  984.     self.z = 200
  985.     hide
  986.   end
  987.   
  988.   #--------------------------------------------------------------------------
  989.   # window_height
  990.   #--------------------------------------------------------------------------
  991.   def window_height
  992.     return Graphics.height - fitting_height(4) - fitting_height(1)
  993.   end
  994.   
  995.   #--------------------------------------------------------------------------
  996.   # spacing
  997.   #--------------------------------------------------------------------------
  998.   def spacing; return 32; end
  999.   
  1000.   #--------------------------------------------------------------------------
  1001.   # make
  1002.   #--------------------------------------------------------------------------
  1003.   def make(gold, drops)
  1004.     [url=home.php?mod=space&uid=236945]@gold[/url] = gold
  1005.     @drops = drops
  1006.     refresh
  1007.     select(0)
  1008.     activate
  1009.   end
  1010.   
  1011.   #--------------------------------------------------------------------------
  1012.   # make_item_list
  1013.   #--------------------------------------------------------------------------
  1014.   def make_item_list
  1015.     @data = [nil]
  1016.     items = {}
  1017.     weapons = {}
  1018.     armours = {}
  1019.     @goods = {}
  1020.     for item in @drops
  1021.       case item
  1022.       when RPG::Item
  1023.         items[item] = 0 if items[item].nil?
  1024.         items[item] += 1
  1025.       when RPG::Weapon
  1026.         weapons[item] = 0 if weapons[item].nil?
  1027.         weapons[item] += 1
  1028.       when RPG::Armor
  1029.         armours[item] = 0 if armours[item].nil?
  1030.         armours[item] += 1
  1031.       end
  1032.     end
  1033.     items = items.sort { |a,b| a[0].id <=> b[0].id }
  1034.     weapons = weapons.sort { |a,b| a[0].id <=> b[0].id }
  1035.     armours = armours.sort { |a,b| a[0].id <=> b[0].id }
  1036.     for key in items; @goods[key[0]] = key[1]; @data.push(key[0]); end
  1037.     for key in weapons; @goods[key[0]] = key[1]; @data.push(key[0]); end
  1038.     for key in armours; @goods[key[0]] = key[1]; @data.push(key[0]); end
  1039.   end
  1040.   
  1041.   #--------------------------------------------------------------------------
  1042.   # draw_item
  1043.   #--------------------------------------------------------------------------
  1044.   def draw_item(index)
  1045.     item = @data[index]
  1046.     rect = item_rect(index)
  1047.     reset_font_settings
  1048.     if item.nil?
  1049.       draw_gold(rect)
  1050.       return
  1051.     end
  1052.     rect.width -= 4
  1053.     draw_item_name(item, rect.x, rect.y, true, rect.width - 24)
  1054.     draw_item_number(rect, item)
  1055.   end
  1056.   
  1057.   #--------------------------------------------------------------------------
  1058.   # draw_gold
  1059.   #--------------------------------------------------------------------------
  1060.   def draw_gold(rect)
  1061.     text = Vocab.currency_unit
  1062.     draw_currency_value(@gold, text, rect.x, rect.y, rect.width)
  1063.   end
  1064.   
  1065.   #--------------------------------------------------------------------------
  1066.   # draw_item_number
  1067.   #--------------------------------------------------------------------------
  1068.   def draw_item_number(rect, item)
  1069.     number = @goods[item].group
  1070.     if $imported["YEA-AdjustLimits"]
  1071.       contents.font.size = YEA::LIMIT::ITEM_FONT
  1072.       text = sprintf(YEA::LIMIT::ITEM_PREFIX, number)
  1073.       draw_text(rect, text, 2)
  1074.     else
  1075.       draw_text(rect, sprintf(":%s", number), 2)
  1076.     end
  1077.   end
  1078.   
  1079. end # Window_VictorySpoils

  1080. #==============================================================================
  1081. # ■ Scene_Battle
  1082. #==============================================================================

  1083. class Scene_Battle < Scene_Base
  1084.   
  1085.   #--------------------------------------------------------------------------
  1086.   # alias method: create_all_windows
  1087.   #--------------------------------------------------------------------------
  1088.   alias scene_battle_create_all_windows_va create_all_windows
  1089.   def create_all_windows
  1090.     scene_battle_create_all_windows_va
  1091.     create_victory_aftermath_windows
  1092.   end
  1093.   
  1094.   #--------------------------------------------------------------------------
  1095.   # new method: create_victory_aftermath_windows
  1096.   #--------------------------------------------------------------------------
  1097.   def create_victory_aftermath_windows
  1098.     @victory_title_window = Window_VictoryTitle.new
  1099.     @victory_exp_window_back = Window_VictoryEXP_Back.new
  1100.     @victory_exp_window_front = Window_VictoryEXP_Front.new
  1101.     @victory_level_window = Window_VictoryLevelUp.new
  1102.     @victory_level_skills = Window_VictorySkills.new
  1103.     @victory_spoils_window = Window_VictorySpoils.new
  1104.   end
  1105.   
  1106.   #--------------------------------------------------------------------------
  1107.   # new method: show_victory_display_exp
  1108.   #--------------------------------------------------------------------------
  1109.   def show_victory_display_exp
  1110.     @victory_title_window.open
  1111.     name = $game_party.battle_members[0].name
  1112.     fmt = YEA::VICTORY_AFTERMATH::TOP_TEAM
  1113.     name = sprintf(fmt, name) if $game_party.battle_members.size > 1
  1114.     fmt = YEA::VICTORY_AFTERMATH::TOP_VICTORY_TEXT
  1115.     text = sprintf(fmt, name)
  1116.     @victory_title_window.refresh(text)
  1117.     #---
  1118.     @victory_exp_window_back.open
  1119.     @victory_exp_window_back.refresh
  1120.     @victory_exp_window_front.open
  1121.     @victory_exp_window_front.refresh
  1122.   end
  1123.   
  1124.   #--------------------------------------------------------------------------
  1125.   # new method: show_victory_level_up
  1126.   #--------------------------------------------------------------------------
  1127.   def show_victory_level_up(actor, temp_actor)
  1128.     @victory_exp_window_back.hide
  1129.     @victory_exp_window_front.hide
  1130.     #---
  1131.     fmt = YEA::VICTORY_AFTERMATH::TOP_LEVEL_UP
  1132.     text = sprintf(fmt, actor.name)
  1133.     @victory_title_window.refresh(text)
  1134.     #---
  1135.     @victory_level_window.show
  1136.     @victory_level_window.refresh(actor, temp_actor)
  1137.     @victory_level_skills.show
  1138.     @victory_level_skills.refresh(actor, temp_actor)
  1139.   end
  1140.   
  1141.   #--------------------------------------------------------------------------
  1142.   # new method: show_victory_spoils
  1143.   #--------------------------------------------------------------------------
  1144.   def show_victory_spoils(gold, drops)
  1145.     @victory_exp_window_back.hide
  1146.     @victory_exp_window_front.hide
  1147.     @victory_level_window.hide
  1148.     @victory_level_skills.hide
  1149.     #---
  1150.     text = YEA::VICTORY_AFTERMATH::TOP_SPOILS
  1151.     @victory_title_window.refresh(text)
  1152.     #---
  1153.     @victory_spoils_window.show
  1154.     @victory_spoils_window.make(gold, drops)
  1155.   end
  1156.   
  1157.   #--------------------------------------------------------------------------
  1158.   # new method: close_victory_windows
  1159.   #--------------------------------------------------------------------------
  1160.   def close_victory_windows
  1161.     @victory_title_window.close
  1162.     @victory_exp_window_back.close
  1163.     @victory_exp_window_front.close
  1164.     @victory_level_window.close
  1165.     @victory_level_skills.close
  1166.     @victory_spoils_window.close
  1167.     wait(16)
  1168.   end
  1169.   
  1170. end # Scene_Battle

  1171. #==============================================================================
  1172. #
  1173. # ▼ End of File
  1174. #
  1175. #==============================================================================
复制代码



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

点评

插入后,测试时提示脚本错误  发表于 2012-12-25 15:13
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部