设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 699|回复: 3
打印 上一主题 下一主题

[已经解决] 使用脚本,战斗结束后无法正常显示获得的物品!!

[复制链接]

Lv2.观梦者

梦石
0
星屑
558
在线时间
267 小时
注册时间
2008-1-23
帖子
96
跳转到指定楼层
1
发表于 2014-2-4 17:03:53 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 ffmgame 于 2014-2-4 17:46 编辑

直接上图


战斗结束后无法正常显示获得的金钱,只有经验



无法正常显示战斗后获得的物品。自己设置的物品根本不显示,默认的物品只显示编号?









不使用脚本正常显示




小弟使用的脚本
  1. [size=6][b]胜利基础系统[/b][/size]
  2. #==============================================================================
  3. # ** Victor Engine - Basic Module
  4. #------------------------------------------------------------------------------
  5. # Author : Victor Sant
  6. #
  7. # Version History:
  8. #  v 1.00 - 2011.12.19 > First relase
  9. #  v 1.01 - 2011.12.21 > Added Event Troop notes
  10. #  v 1.02 - 2011.12.22 > Added character frames value
  11. #  v 1.03 - 2011.12.30 > Added Actor and Enemy notes
  12. #  v 1.04 - 2012.01.01 > Added party average level and map actors
  13. #  v 1.05 - 2012.01.04 > Compatibility with Characters Scripts
  14. #  v 1.06 - 2012.01.07 > Compatibility with Fog and Light Effect
  15. #                      > Added new Sprite Character functions
  16. #  v 1.07 - 2012.01.11 > Compatibility with Control Text and Codes
  17. #  v 1.08 - 2012.01.13 > Compatibility with Trait Control
  18. #  v 1.09 - 2012.01.15 > Fixed the Regular Expressions problem with "" and “”
  19. #  v 1.10 - 2012.01.18 > Compatibility with Automatic Battlers
  20. #  v 1.11 - 2012.01.26 > Compatibility with Followers Options
  21. #                        Compatibility with Animated Battle beta
  22. #  v 1.12 - 2012.02.08 > Compatibility with Animated Battle
  23. #  v 1.13 - 2012.02.18 > Fix for non RTP dependant encrypted projects
  24. #  v 1.14 - 2012.03.11 > Better version handling and required messages
  25. #  v 1.15 - 2012.03.11 > Added level variable for enemies (to avoid crashes)
  26. #  v 1.16 - 2012.03.21 > Compatibility with Follower Control
  27. #  v 1.17 - 2012.03.22 > Compatibility with Follower Control new method
  28. #------------------------------------------------------------------------------
  29. #   This is the basic script for the system from Victory Engine and is
  30. # required to use the scripts from the engine. This script offer some new
  31. # functions to be used within many scripts of the engine.
  32. #------------------------------------------------------------------------------
  33. # Compatibility
  34. #   Required for the Victor Engine
  35. #
  36. # * Overwrite methods (Default)
  37. #   module Cache
  38. #     def self.character(filename)
  39. #
  40. #   class Sprite_Character < Sprite_Base
  41. #     def set_character_bitmap
  42. #
  43. # * Alias methods (Default)
  44. #   class Game_Interpreter
  45. #     def command_108
  46. #
  47. #   class Window_Base < Window
  48. #     def convert_escape_characters(text)
  49. #
  50. #------------------------------------------------------------------------------
  51. # Instructions:
  52. #  To instal the script, open you script editor and paste this script on
  53. #  a new section on bellow the Materials section.
  54. #
  55. #------------------------------------------------------------------------------
  56. # New functions
  57. #
  58. # * Random number between two vales
  59. #   rand_between(min, max)
  60. #    min : min value
  61. #    max : max value
  62. #   Can be called from any class, this method return an random value between
  63. #   two specific numbers
  64. #
  65. # * Random array value
  66. #   <Array>.random
  67. #   <Array>.random!
  68. #   Returns a random object from the array, the method .random! is destructive,
  69. #   removing the value returned from the array.
  70. #
  71. # * Sum of the numeric values of a array
  72. #   <Array>.sum
  73. #   Returns the sum of all numeric values
  74. #
  75. # * Avarage of all numeric values from the array
  76. #   <Array>.average(float = false)
  77. #    float : float flag
  78. #   Returns the average of all numeric values, if floa is true, the value
  79. #   returned is a float, otherwise it's a integer.
  80. #
  81. # * Note for events
  82. #   <Event>.note
  83. #   By default, events doesn't have note boxes. This command allows to use
  84. #   comments as note boxes, following the same format as the ones on the
  85. #   database. Returns all comments on the active page of the event.
  86. #
  87. # * Comment calls
  88. #   <Event>.comment_call
  89. #   Another function for comment boxes, by default, they have absolutely no
  90. #   effect in game when called. But this method allows to make the comment
  91. #   box to behave like an script call, but with the versatility of the
  92. #   note boxes. Remember that the commands will only take effect if there
  93. #   is scripts to respond to the comment code.
  94. #
  95. #==============================================================================

  96. #==============================================================================
  97. # ** Victor Engine
  98. #------------------------------------------------------------------------------
  99. #   Setting module for the Victor Engine
  100. #==============================================================================

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  950. class Scene_Battle < Scene_Base
  951.   #--------------------------------------------------------------------------
  952.   # * Public Instance Variables
  953.   #--------------------------------------------------------------------------
  954.   attr_reader   :spriteset
  955. end
复制代码
  1. [size=6][b]胜利显示[/b][/size]
  2. #==============================================================================
  3. #
  4. # ▼ Yanfly Engine Ace - Victory Aftermath v1.03
  5. # -- Last Updated: 2012.01.07
  6. # -- Level: Easy, Normal, Hard
  7. # -- Requires: n/a
  8. #
  9. #==============================================================================

  10. $imported = {} if $imported.nil?
  11. $imported["YEA-VictoryAftermath"] = true

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

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

  192. #==============================================================================
  193. # ▼ Editting anything past this point may potentially result in causing
  194. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  195. # halitosis so edit at your own risk.
  196. #==============================================================================

  197. module YEA
  198.   module REGEXP
  199.   module BASEITEM
  200.    
  201.     NEW_QUOTE = /\[(?:NEW_QUOTE|new quote)\]/i
  202.    
  203.     WIN_QUOTE_ON    = /<(?:WIN_QUOTES|win quote|win quotes)>/i
  204.     WIN_QUOTE_OFF   = /<\/(?:WIN_QUOTES|win quote|win quotes)>/i
  205.     LEVEL_QUOTE_ON  = /<(?:LEVEL_QUOTES|level quote|level quotes)>/i
  206.     LEVEL_QUOTE_OFF = /<\/(?:LEVEL_QUOTES|level quote|level quotes)>/i
  207.     DROPS_QUOTE_ON  = /<(?:DROPS_QUOTES|drops quote|drops quotes)>/i
  208.     DROPS_QUOTE_OFF = /<\/(?:DROPS_QUOTES|drops quote|drops quotes)>/i
  209.    
  210.   end # BASEITEM
  211.   end # REGEXP
  212. end # YEA

  213. #==============================================================================
  214. # ■ Switch
  215. #==============================================================================

  216. module Switch
  217.   
  218.   #--------------------------------------------------------------------------
  219.   # self.skip_aftermath
  220.   #--------------------------------------------------------------------------
  221.   def self.skip_aftermath
  222.     return false if YEA::VICTORY_AFTERMATH::SKIP_AFTERMATH_SWITCH <= 0
  223.     return $game_switches[YEA::VICTORY_AFTERMATH::SKIP_AFTERMATH_SWITCH]
  224.   end
  225.    
  226. end # Switch

  227. #==============================================================================
  228. # ■ Numeric
  229. #==============================================================================

  230. class Numeric
  231.   
  232.   #--------------------------------------------------------------------------
  233.   # new method: group_digits
  234.   #--------------------------------------------------------------------------
  235.   unless $imported["YEA-CoreEngine"]
  236.   def group; return self.to_s; end
  237.   end # $imported["YEA-CoreEngine"]
  238.    
  239. end # Numeric

  240. #==============================================================================
  241. # ■ DataManager
  242. #==============================================================================

  243. module DataManager
  244.   
  245.   #--------------------------------------------------------------------------
  246.   # alias method: load_database
  247.   #--------------------------------------------------------------------------
  248.   class <<self; alias load_database_va load_database; end
  249.   def self.load_database
  250.     load_database_va
  251.     load_notetags_va
  252.   end
  253.   
  254.   #--------------------------------------------------------------------------
  255.   # new method: load_notetags_va
  256.   #--------------------------------------------------------------------------
  257.   def self.load_notetags_va
  258.     groups = [$data_actors, $data_classes]
  259.     for group in groups
  260.       for obj in group
  261.         next if obj.nil?
  262.         obj.load_notetags_va
  263.       end
  264.     end
  265.   end
  266.   
  267. end # DataManager

  268. #==============================================================================
  269. # ■ RPG::BaseItem
  270. #==============================================================================

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

  331. #==============================================================================
  332. # ■ BattleManager
  333. #==============================================================================

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

  463. #==============================================================================
  464. # ■ Game_Actor
  465. #==============================================================================

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

  496. #==============================================================================
  497. # ■ Window_VictoryTitle
  498. #==============================================================================

  499. class Window_VictoryTitle < Window_Base
  500.   
  501.   #--------------------------------------------------------------------------
  502.   # initialize
  503.   #--------------------------------------------------------------------------
  504.   def initialize
  505.     super(0, 0, Graphics.width, fitting_height(1))
  506.     self.z = 200
  507.     self.openness = 0
  508.   end
  509.   
  510.   #--------------------------------------------------------------------------
  511.   # refresh
  512.   #--------------------------------------------------------------------------
  513.   def refresh(message = "")
  514.     contents.clear
  515.     draw_text(0, 0, contents.width, line_height, message, 1)
  516.   end
  517.   
  518. end # Window_VictoryTitle

  519. #==============================================================================
  520. # ■ Window_VictoryEXP_Back
  521. #==============================================================================

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

  657. #==============================================================================
  658. # ■ Window_VictoryEXP_Front
  659. #==============================================================================

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

  779. #==============================================================================
  780. # ■ Window_VictoryLevelUp
  781. #==============================================================================

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

  909. #==============================================================================
  910. # ■ Window_VictorySkills
  911. #==============================================================================

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

  967. #==============================================================================
  968. # ■ Window_VictorySpoils
  969. #==============================================================================

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

  1073. #==============================================================================
  1074. # ■ Scene_Battle
  1075. #==============================================================================

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

  1164. #==============================================================================
  1165. #
  1166. # ▼ End of File
  1167. #
  1168. #==============================================================================
复制代码
求指点啊!!


   

Lv2.观梦者

梦石
0
星屑
714
在线时间
224 小时
注册时间
2009-2-19
帖子
227
2
发表于 2014-2-4 22:26:18 手机端发表。 | 只看该作者
我也用的这个,没什么问题,我想应该是你的脚本冲突了。
备份下你的工程,然后,把你用的脚本删一个试一下,再删一个再试一下,直到没问题了就知道哪个脚本冲突了
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
558
在线时间
267 小时
注册时间
2008-1-23
帖子
96
3
 楼主| 发表于 2014-2-5 15:20:22 | 只看该作者
根五 发表于 2014-2-4 22:26
我也用的这个,没什么问题,我想应该是你的脚本冲突了。
备份下你的工程,然后,把你用的脚本删一个试一下 ...

看来只得这样了。3Q
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
558
在线时间
267 小时
注册时间
2008-1-23
帖子
96
4
 楼主| 发表于 2014-2-5 15:46:53 | 只看该作者
根五 发表于 2014-2-4 22:26
我也用的这个,没什么问题,我想应该是你的脚本冲突了。
备份下你的工程,然后,把你用的脚本删一个试一下 ...

是“自动信息”那个脚本的问题。
我把text = "\\T[#{item.id}]"大括号里改成item.name就OK了。
回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-11-16 14:36

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表