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

Project1

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

[已经解决] Taroxd 的 被动技能状态 脚本跳错

[复制链接]

Lv1.梦旅人

梦石
0
星屑
209
在线时间
104 小时
注册时间
2014-2-23
帖子
60
跳转到指定楼层
1
发表于 2015-9-12 22:35:53 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
RUBY 代码复制
  1. #--------------------------------------------------------------------------
  2. # ● require Taroxd基础设置
  3. #    使用方法:在技能/状态上备注<passive x>,
  4. #              表示习得该技能/获得该状态等同于装备了x号武器。
  5. #--------------------------------------------------------------------------
  6.  
  7. Taroxd::Passive = true
  8.  
  9. RPG::Skill.note_i :passive
  10. RPG::State.note_i :passive
  11.  
  12. class Game_Actor < Game_Battler
  13.  
  14.   # 带有被动技能效果的所有实例
  15.   def passive_objects
  16.     @skills.map { |id| $data_skills[id] } + states
  17.   end
  18.   # 特性表和能力中加上被动武器
  19.   def_with(:feature_objects) { |old| old + passive_weapons }
  20.  
  21.   def_with :param_plus do |old, param_id|
  22.     passive_weapons.sum(old) { |item| item.params[param_id] }
  23.   end
  24.  
  25.   # 被动技能/状态对应的武器实例构成的数组
  26.   def passive_weapons
  27.     passive_objects.map { |obj| $data_weapons[obj.passive] }.compact
  28.   end
  29. end





置顶的脚本我也放了。
先谢谢了。
头像被屏蔽

Lv1.梦旅人 (禁止访问)

梦石
0
星屑
88
在线时间
631 小时
注册时间
2014-8-4
帖子
3600
2
发表于 2015-9-12 22:38:56 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

Lv3.寻梦者 (版主)

…あたしは天使なんかじゃないわ

梦石
0
星屑
2208
在线时间
4033 小时
注册时间
2010-10-4
帖子
10779

开拓者贵宾

3
发表于 2015-9-13 07:29:48 | 只看该作者
请确认一下置顶脚本最新,以及在新工程里也会出现这样的问题(非脚本冲突)

如果还是有问题,请上一下工程
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
209
在线时间
104 小时
注册时间
2014-2-23
帖子
60
4
 楼主| 发表于 2015-9-13 09:27:37 | 只看该作者
taroxd 发表于 2015-9-13 07:29
请确认一下置顶脚本最新,以及在新工程里也会出现这样的问题(非脚本冲突)

如果还是有问题,请上一下工程 ...

终于试出来了,和这个脚本冲突
  1. #==============================================================================
  2. # ** Victor Engine - Basic Module
  3. #------------------------------------------------------------------------------
  4. # Author : Victor Sant
  5. #
  6. # Version History:
  7. #  v 1.00 - 2011.12.19 > First release
  8. #  v 1.01 - 2011.12.21 > Added Event Troop notes
  9. #  v 1.02 - 2011.12.22 > Added character frames value
  10. #  v 1.03 - 2011.12.30 > Added Actor and Enemy notes
  11. #  v 1.04 - 2012.01.01 > Added party average level and map actors
  12. #  v 1.05 - 2012.01.04 > Compatibility with Characters Scripts
  13. #  v 1.06 - 2012.01.07 > Compatibility with Fog and Light Effect
  14. #                      > Added new Sprite Character functions
  15. #  v 1.07 - 2012.01.11 > Compatibility with Control Text and Codes
  16. #  v 1.08 - 2012.01.13 > Compatibility with Trait Control
  17. #  v 1.09 - 2012.01.15 > Fixed the Regular Expressions problem with "" and “”
  18. #  v 1.10 - 2012.01.18 > Compatibility with Automatic Battlers
  19. #  v 1.11 - 2012.01.26 > Compatibility with Followers Options
  20. #                        Compatibility with Animated Battle beta
  21. #  v 1.12 - 2012.02.08 > Compatibility with Animated Battle
  22. #  v 1.13 - 2012.02.18 > Fix for non RTP dependant encrypted projects
  23. #  v 1.14 - 2012.03.11 > Better version handling and required messages
  24. #  v 1.15 - 2012.03.11 > Added level variable for enemies (to avoid crashes)
  25. #  v 1.16 - 2012.03.21 > Compatibility with Follower Control
  26. #  v 1.17 - 2012.03.22 > Compatibility with Follower Control new method
  27. #  v 1.18 - 2012.03.22 > Added Battler Types tag support
  28. #  v 1.19 - 2012.05.20 > Compatibility with Map Turn Battle
  29. #  v 1.20 - 2012.05.21 > Fix for older RMVXa versions
  30. #  v 1.21 - 2012.05.29 > Compatibility with Pixel Movement
  31. #  v 1.22 - 2012.07.02 > Compatibility with Terrain States
  32. #  v 1.23 - 2012.07.03 > Fix for Pixel Movement
  33. #  v 1.24 - 2012.07.17 > Compatibility with Critical Hit Effects
  34. #  v 1.25 - 2012.07.24 > Compatibility with Moving Plaforms
  35. #  v 1.26 - 2012.07.30 > Compatibility with Automatic Battlers
  36. #  v 1.27 - 2012.08.01 > Compatibility with Custom Slip Effect
  37. #  v 1.28 - 2012.08.01 > Compatibility with Custom Slip Effect v 1.01
  38. #  v 1.29 - 2012.11.03 > Fixed returning value division by 0 error.
  39. #  v 1.30 - 2012.12.13 > Compatibility with State Graphics
  40. #  v 1.31 - 2012.12.16 > Compatibility with Active Time Battle
  41. #  v 1.32 - 2012.12.24 > Compatibility with Active Time Battle v 1.01
  42. #  v 1.33 - 2012.12.30 > Compatibility with Leap Attack
  43. #  v 1.34 - 2013.01.07 > Compatibility with Critical Hit Effects v 1.01
  44. #  v 1.35 - 2013.02.13 > Compatibility with Cooperation Skills
  45. #------------------------------------------------------------------------------
  46. #   This is the basic script for the system from Victory Engine and is
  47. # required to use the scripts from the engine. This script offer some new
  48. # functions to be used within many scripts of the engine.
  49. #------------------------------------------------------------------------------
  50. # Compatibility
  51. #   Required for the Victor Engine
  52. #
  53. # * Overwrite methods
  54. #   class << Cache
  55. #     def self.character(filename)
  56. #
  57. #   class Sprite_Character < Sprite_Base
  58. #     def set_character_bitmap
  59. #
  60. #   class Game_Battler < Game_BattlerBase
  61. #     def item_effect_recover_hp(user, item, effect)
  62. #     def item_effect_recover_mp(user, item, effect)
  63. #     def item_effect_gain_tp
  64. #
  65. # * Alias methods
  66. #   class Game_Interpreter
  67. #     def command_108
  68. #
  69. #   class Window_Base < Window
  70. #     def convert_escape_characters(text)
  71. #
  72. #------------------------------------------------------------------------------
  73. # Instructions:
  74. #  To instal the script, open you script editor and paste this script on
  75. #  a new section bellow the Materials section.
  76. #
  77. #------------------------------------------------------------------------------
  78. # New functions
  79. #
  80. # * Random number between two vales
  81. #   rand_between(min, max)
  82. #    min : min value
  83. #    max : max value
  84. #   Can be called from any class, this method return an random value between
  85. #   two specific numbers
  86. #
  87. # * Random array value
  88. #   <Array>.random
  89. #   <Array>.random!
  90. #   Returns a random object from the array, the method .random! is destructive,
  91. #   removing the value returned from the array.
  92. #
  93. # * Sum of the numeric values of a array
  94. #   <Array>.sum
  95. #   Returns the sum of all numeric values
  96. #
  97. # * Average of all numeric values from the array
  98. #   <Array>.average(float = false)
  99. #    float : float flag
  100. #   Returns the average of all numeric values, if floa is true, the value
  101. #   returned is a float, otherwise it's a integer.
  102. #
  103. # * Note for events
  104. #   <Event>.note
  105. #   By default, events doesn't have note boxes. This command allows to use
  106. #   comments as note boxes, following the same format as the ones on the
  107. #   database. Returns all comments on the active page of the event.
  108. #
  109. # * Comment calls
  110. #   <Event>.comment_call
  111. #   Another function for comment boxes, by default, they have absolutely no
  112. #   effect in game when called. But this method allows to make the comment
  113. #   box to behave like an script call, but with the versatility of the
  114. #   note boxes. Remember that the commands will only take effect if there
  115. #   is scripts to respond to the comment code.
  116. #
  117. #==============================================================================

  118. #==============================================================================
  119. # ** Victor Engine
  120. #------------------------------------------------------------------------------
  121. #   Setting module for the Victor Engine
  122. #==============================================================================

  123. module Victor_Engine
  124.   #--------------------------------------------------------------------------
  125.   # * New method: required_script
  126.   #--------------------------------------------------------------------------
  127.   def self.required_script(name, req, version, type = 0)
  128.     if type != :bellow && (!$imported[req] || $imported[req] < version)
  129.       msg = "The script '%s' requires the script\n"
  130.       case type
  131.       when :above
  132.         msg += "'%s' v%s or higher above it to work properly\n"
  133.       else
  134.         msg += "'%s' v%s or higher to work properly\n"
  135.       end
  136.       msg += "Go to http://victorscripts.wordpress.com/ to download this script."
  137.       self.exit_message(msg, name, req, version)
  138.     elsif type == :bellow && $imported[req]
  139.       msg =  "The script '%s' requires the script\n"
  140.       msg += "'%s' to be put bellow it\n"
  141.       msg += "move the scripts to the proper position"
  142.       self.exit_message(msg, name, req, version)
  143.     end
  144.   end
  145.   #--------------------------------------------------------------------------
  146.   # * New method: exit_message
  147.   #--------------------------------------------------------------------------
  148.   def self.exit_message(message, name, req, version)
  149.     name = self.script_name(name)
  150.     req  = self.script_name(req)
  151.     msgbox(sprintf(message, name, req, version))
  152.     exit
  153.   end
  154.   #--------------------------------------------------------------------------
  155.   # * New method: script_name
  156.   #--------------------------------------------------------------------------
  157.   def self.script_name(name, ext = "VE")
  158.     name = name.to_s.gsub("_", " ").upcase.split
  159.     name.collect! {|char| char == ext ? "#{char} -" : char.capitalize }
  160.     name.join(" ")
  161.   end
  162. end

  163. $imported ||= {}
  164. $imported[:ve_basic_module] = 1.35

  165. #==============================================================================
  166. # ** Object
  167. #------------------------------------------------------------------------------
  168. #  This class is the superclass of all other classes.
  169. #==============================================================================

  170. class Object
  171.   #--------------------------------------------------------------------------
  172.   # * Include setting module
  173.   #--------------------------------------------------------------------------
  174.   include Victor_Engine
  175.   #-------------------------------------------------------------------------
  176.   # * New method: rand_between
  177.   #-------------------------------------------------------------------------
  178.   def rand_between(min, max)
  179.     min + rand(max - min + 1)
  180.   end
  181.   #--------------------------------------------------------------------------
  182.   # * New method: numeric?
  183.   #--------------------------------------------------------------------------
  184.   def numeric?
  185.     return false
  186.   end
  187.   #--------------------------------------------------------------------------
  188.   # * New method: string?
  189.   #--------------------------------------------------------------------------
  190.   def string?
  191.     return false
  192.   end
  193.   #--------------------------------------------------------------------------
  194.   # * New method: array?
  195.   #--------------------------------------------------------------------------
  196.   def array?
  197.     return false
  198.   end
  199.   #--------------------------------------------------------------------------
  200.   # * New method: float?
  201.   #--------------------------------------------------------------------------
  202.   def float?
  203.     return false
  204.   end
  205.   #--------------------------------------------------------------------------
  206.   # * New method: symbol?
  207.   #--------------------------------------------------------------------------
  208.   def symbol?
  209.     return false
  210.   end
  211.   #--------------------------------------------------------------------------
  212.   # * New method: item?
  213.   #--------------------------------------------------------------------------
  214.   def item?
  215.     return false
  216.   end
  217.   #--------------------------------------------------------------------------
  218.   # * New method: skill?
  219.   #--------------------------------------------------------------------------
  220.   def skill?
  221.     return false
  222.   end
  223.   #--------------------------------------------------------------------------
  224.   # * New method: file_exist?
  225.   #--------------------------------------------------------------------------
  226.   def file_exist?(path, filename)
  227.     $file_list ||= {}
  228.     $file_list[path + filename] ||= file_test(path, filename)
  229.     $file_list[path + filename]
  230.   end
  231.   #--------------------------------------------------------------------------
  232.   # * New method: get_file_list
  233.   #--------------------------------------------------------------------------
  234.   def file_test(path, filename)
  235.     bitmap = Cache.load_bitmap(path, filename) rescue nil
  236.     bitmap ? true : false
  237.   end
  238.   #--------------------------------------------------------------------------
  239.   # * New method: character_exist?
  240.   #--------------------------------------------------------------------------
  241.   def character_exist?(filename)
  242.     file_exist?("Graphics/Characters/", filename)
  243.   end
  244.   #--------------------------------------------------------------------------
  245.   # * New method: battler_exist?
  246.   #--------------------------------------------------------------------------
  247.   def battler_exist?(filename)
  248.     file_exist?("Graphics/Battlers/", filename)
  249.   end
  250.   #--------------------------------------------------------------------------
  251.   # * New method: face_exist?
  252.   #--------------------------------------------------------------------------
  253.   def face_exist?(filename)
  254.     file_exist?("Graphics/Faces/", filename)
  255.   end
  256.   #--------------------------------------------------------------------------
  257.   # * New method: get_filename
  258.   #--------------------------------------------------------------------------
  259.   def get_filename
  260.     "[\"'“‘]([^\"'”‘”’]+)[\"'”’]"
  261.   end
  262.   #--------------------------------------------------------------------------
  263.   # * New method: get_all_values
  264.   #--------------------------------------------------------------------------
  265.   def get_all_values(value1, value2 = nil)
  266.     value2 = value1 unless value2
  267.     /<#{value1}>((?:[^<]|<[^\/])*)<\/#{value2}>/im
  268.   end
  269.   #--------------------------------------------------------------------------
  270.   # * New method: make_symbol
  271.   #--------------------------------------------------------------------------
  272.   def make_symbol(string)
  273.     string.downcase.gsub(" ", "_").to_sym
  274.   end
  275.   #--------------------------------------------------------------------------
  276.   # * New method: make_string
  277.   #--------------------------------------------------------------------------
  278.   def make_string(symbol)
  279.     symbol.to_s.gsub("_", " ").upcase
  280.   end
  281.   #--------------------------------------------------------------------------
  282.   # * New method: returning_value
  283.   #--------------------------------------------------------------------------
  284.   def returning_value(i, x)
  285.     y = [x * 2, 1].max
  286.     i % y  >= x ? (x * 2) - i % y : i % y
  287.   end
  288.   #--------------------------------------------------------------------------
  289.   # New method: in_rect?
  290.   #--------------------------------------------------------------------------
  291.   def in_rect?(w, h, x1, y1, x2, y2, fx = 0)
  292.     aw, ah, ax, ay, bx, by = setup_area(w, h, x1, y1, x2, y2, fx)
  293.     bx > ax - aw && bx < ax + aw && by > ay - ah && by < ay + ah
  294.   end
  295.   #--------------------------------------------------------------------------
  296.   # New method: in_radius?
  297.   #--------------------------------------------------------------------------
  298.   def in_radius?(w, h, x1, y1, x2, y2, fx = 0)
  299.     aw, ah, ax, ay, bx, by = setup_area(w, h, x1, y1, x2, y2, fx)
  300.     ((bx - ax) ** 2 / aw ** 2) + ((by - ay) ** 2 / ah ** 2) <= 1
  301.   end
  302.   #--------------------------------------------------------------------------
  303.   # New method: setup_area
  304.   #--------------------------------------------------------------------------
  305.   def setup_area(w, h, x1, y1, x2, y2, fx)
  306.     aw = w
  307.     ah = h * aw
  308.     ax = x1
  309.     ay = y1
  310.     bx = x2
  311.     by = y2
  312.     bx += fx / 4 if ax > bx
  313.     bx -= fx / 4 if ax < bx
  314.     [aw, ah, ax, ay, bx, by]
  315.   end
  316.   #--------------------------------------------------------------------------
  317.   # * New method: get_param_id
  318.   #--------------------------------------------------------------------------
  319.   def get_param_id(text)
  320.     case text.upcase
  321.     when "MAXHP", "HP" then 0
  322.     when "MAXMP", "MP" then 1
  323.     when "ATK" then 2
  324.     when "DEF" then 3
  325.     when "MAT" then 4
  326.     when "MDF" then 5
  327.     when "AGI" then 6
  328.     when "LUK" then 7
  329.     end
  330.   end
  331.   #--------------------------------------------------------------------------
  332.   # * New method: get_param_text
  333.   #--------------------------------------------------------------------------
  334.   def get_param_text(id)
  335.     case id
  336.     when 0 then "HP"
  337.     when 1 then "MP"
  338.     when 2 then "ATK"
  339.     when 3 then "DEF"
  340.     when 4 then "MAT"
  341.     when 5 then "MDF"
  342.     when 6 then "AGI"
  343.     when 7 then "LUK"
  344.     end
  345.   end
  346.   #--------------------------------------------------------------------------
  347.   # * New method: get_xparam_id
  348.   #--------------------------------------------------------------------------
  349.   def get_xparam_id(text)
  350.     case text.upcase
  351.     when "HIT" then 0
  352.     when "EVA" then 1
  353.     when "CRI" then 2
  354.     when "CEV" then 3
  355.     when "MEV" then 4
  356.     when "MRF" then 5
  357.     when "CNT" then 6
  358.     when "HRG" then 7
  359.     when "MRG" then 8
  360.     when "TRG" then 9
  361.     end
  362.   end
  363.   #--------------------------------------------------------------------------
  364.   # * New method: get_xparam_text
  365.   #--------------------------------------------------------------------------
  366.   def get_xparam_text(id)
  367.     case id
  368.     when 0 then "HIT"
  369.     when 1 then "EVA"
  370.     when 2 then "CRI"
  371.     when 3 then "CEV"
  372.     when 4 then "MEV"
  373.     when 5 then "MRF"
  374.     when 6 then "CNT"
  375.     when 7 then "HRG"
  376.     when 8 then "MRG"
  377.     when 9 then "TRG"
  378.     end
  379.   end
  380.   #--------------------------------------------------------------------------
  381.   # * New method: get_sparam_id
  382.   #--------------------------------------------------------------------------
  383.   def get_sparam_id(text)
  384.     case text.upcase
  385.     when "TGR" then 0
  386.     when "GRD" then 1
  387.     when "REC" then 2
  388.     when "PHA" then 3
  389.     when "MCR" then 4
  390.     when "TCR" then 5
  391.     when "PDR" then 6
  392.     when "MDR" then 7
  393.     when "FDR" then 8
  394.     when "EXR" then 9
  395.     end
  396.   end
  397.   #--------------------------------------------------------------------------
  398.   # * New method: get_sparam_text
  399.   #--------------------------------------------------------------------------
  400.   def get_sparam_text(id)
  401.     case id
  402.     when 0 then "TGR"
  403.     when 1 then "GRD"
  404.     when 2 then "REC"
  405.     when 3 then "PHA"
  406.     when 4 then "MCR"
  407.     when 5 then "TCR"
  408.     when 6 then "PDR"
  409.     when 7 then "MDR"
  410.     when 8 then "FDR"
  411.     when 9 then "EXR"
  412.     end
  413.   end
  414.   #--------------------------------------------------------------------------
  415.   # * New method: get_cond
  416.   #--------------------------------------------------------------------------
  417.   def get_cond(text)
  418.     case text.upcase
  419.     when "HIGHER"    then ">"
  420.     when "LOWER"     then "<"
  421.     when "EQUAL"     then "=="
  422.     when "DIFFERENT" then "!="
  423.     else "!="
  424.     end
  425.   end
  426. end

  427. #==============================================================================
  428. # ** String
  429. #------------------------------------------------------------------------------
  430. #  The string class. Can handle character sequences of arbitrary lengths.
  431. #==============================================================================

  432. class String
  433.   #--------------------------------------------------------------------------
  434.   # * New method: string?
  435.   #--------------------------------------------------------------------------
  436.   def string?
  437.     return true
  438.   end
  439. end

  440. #==============================================================================
  441. # ** String
  442. #------------------------------------------------------------------------------
  443. #  The class that represents symbols.
  444. #==============================================================================

  445. class Symbol
  446.   #--------------------------------------------------------------------------
  447.   # * New method: symbol?
  448.   #--------------------------------------------------------------------------
  449.   def symbol?
  450.     return true
  451.   end
  452. end

  453. #==============================================================================
  454. # ** Numeric
  455. #------------------------------------------------------------------------------
  456. #  This is the abstract class for numbers.
  457. #==============================================================================

  458. class Numeric
  459.   #--------------------------------------------------------------------------
  460.   # * New method: numeric?
  461.   #--------------------------------------------------------------------------
  462.   def numeric?
  463.     return true
  464.   end
  465.   #--------------------------------------------------------------------------
  466.   # * New method: ceil?
  467.   #--------------------------------------------------------------------------
  468.   def ceil?
  469.     return false
  470.   end
  471.   #--------------------------------------------------------------------------
  472.   # * New method: to_ceil
  473.   #--------------------------------------------------------------------------
  474.   def to_ceil
  475.     self > 0 ? self.abs.ceil : -self.abs.ceil
  476.   end
  477. end

  478. #==============================================================================
  479. # ** Float
  480. #------------------------------------------------------------------------------
  481. #  This is the abstract class for the floating point values.
  482. #==============================================================================

  483. class Float
  484.   #--------------------------------------------------------------------------
  485.   # * New method: float?
  486.   #--------------------------------------------------------------------------
  487.   def float?
  488.     return true
  489.   end
  490.   #--------------------------------------------------------------------------
  491.   # * New method: ceil?
  492.   #--------------------------------------------------------------------------
  493.   def ceil?
  494.     self != self.ceil
  495.   end
  496. end

  497. #==============================================================================
  498. # ** Array     
  499. #------------------------------------------------------------------------------
  500. #  This class store arbitrary Ruby objects.
  501. #==============================================================================

  502. class Array
  503.   #--------------------------------------------------------------------------
  504.   # * New method: array?
  505.   #--------------------------------------------------------------------------
  506.   def array?
  507.     return true
  508.   end
  509.   #-------------------------------------------------------------------------
  510.   # * New method: random
  511.   #-------------------------------------------------------------------------
  512.   def random
  513.     self[rand(size)]
  514.   end
  515.   #-------------------------------------------------------------------------
  516.   # * New method: random!
  517.   #-------------------------------------------------------------------------
  518.   def random!
  519.     self.delete_at(rand(size))
  520.   end
  521.   #---------------------------------------------------------------------------
  522.   # * New method: sum
  523.   #---------------------------------------------------------------------------
  524.   def sum
  525.     self.inject(0) {|r, n| r += (n.numeric? ? n : 0)}
  526.   end
  527.   #---------------------------------------------------------------------------
  528.   # * New method: average
  529.   #---------------------------------------------------------------------------
  530.   def average(float = false)
  531.     self.sum / [(float ? size.to_f : size.to_i), 1].max
  532.   end
  533.   #---------------------------------------------------------------------------
  534.   # * New method: next_item
  535.   #---------------------------------------------------------------------------
  536.   def next_item
  537.     item = self.shift
  538.     self.push(item)
  539.     item
  540.   end
  541.   #---------------------------------------------------------------------------
  542.   # * New method: previous_item
  543.   #---------------------------------------------------------------------------
  544.   def previous_item
  545.     item = self.pop
  546.     self.unshift(item)
  547.     item
  548.   end
  549. end

  550. #==============================================================================
  551. # ** RPG::Troop::Page
  552. #------------------------------------------------------------------------------
  553. #  This is the data class for battle events (pages).
  554. #==============================================================================

  555. class RPG::Troop::Page
  556.   #--------------------------------------------------------------------------
  557.   # * New method: note
  558.   #--------------------------------------------------------------------------
  559.   def note
  560.     return "" if !@list || @list.size <= 0
  561.     comment_list = []
  562.     @list.each do |item|
  563.       next unless item && (item.code == 108 || item.code == 408)
  564.       comment_list.push(item.parameters[0])
  565.     end
  566.     comment_list.join("\r\n")
  567.   end
  568. end

  569. #==============================================================================
  570. # ** RPG::UsableItem
  571. #------------------------------------------------------------------------------
  572. #  This is the superclass for skills and items.
  573. #==============================================================================

  574. class RPG::UsableItem < RPG::BaseItem
  575.   #--------------------------------------------------------------------------
  576.   # * New method: for_all_targets?
  577.   #--------------------------------------------------------------------------
  578.   def for_all_targets?
  579.     return false
  580.   end
  581.   #--------------------------------------------------------------------------
  582.   # * New method: element_set
  583.   #--------------------------------------------------------------------------
  584.   def element_set
  585.     [damage.element_id]
  586.   end
  587. end

  588. #==============================================================================
  589. # ** RPG::Skill
  590. #------------------------------------------------------------------------------
  591. #  This is the data class for skills.
  592. #==============================================================================

  593. class RPG::Skill < RPG::UsableItem
  594.   #--------------------------------------------------------------------------
  595.   # * New method: item?
  596.   #--------------------------------------------------------------------------
  597.   def item?
  598.     return false
  599.   end
  600.   #--------------------------------------------------------------------------
  601.   # * New method: skill?
  602.   #--------------------------------------------------------------------------
  603.   def skill?
  604.     return true
  605.   end
  606.   #--------------------------------------------------------------------------
  607.   # * New method: type_set
  608.   #--------------------------------------------------------------------------
  609.   def type_set
  610.     [stype_id]
  611.   end  
  612. end

  613. #==============================================================================
  614. # ** RPG::Item
  615. #------------------------------------------------------------------------------
  616. #  This is the data class for items.
  617. #==============================================================================

  618. class RPG::Item < RPG::UsableItem
  619.   #--------------------------------------------------------------------------
  620.   # * New method: item?
  621.   #--------------------------------------------------------------------------
  622.   def item?
  623.     return true
  624.   end
  625.   #--------------------------------------------------------------------------
  626.   # * New method: skill?
  627.   #--------------------------------------------------------------------------
  628.   def skill?
  629.     return false
  630.   end
  631.   #--------------------------------------------------------------------------
  632.   # * New method: type_set
  633.   #--------------------------------------------------------------------------
  634.   def type_set
  635.     [itype_id]
  636.   end
  637. end

  638. #==============================================================================
  639. # ** Cache
  640. #------------------------------------------------------------------------------
  641. #  This module loads each of graphics, creates a Bitmap object, and retains it.
  642. # To speed up load times and conserve memory, this module holds the created
  643. # Bitmap object in the internal hash, allowing the program to return
  644. # preexisting objects when the same bitmap is requested again.
  645. #==============================================================================

  646. class << Cache
  647.   #--------------------------------------------------------------------------
  648.   # * Overwrite method: character
  649.   #--------------------------------------------------------------------------
  650.   def character(filename, hue = 0)
  651.     load_bitmap("Graphics/Characters/", filename, hue)
  652.   end
  653.   #--------------------------------------------------------------------------
  654.   # * New method: cache
  655.   #--------------------------------------------------------------------------
  656.   def cache
  657.     @cache
  658.   end
  659. end

  660. #==============================================================================
  661. # ** BattleManager
  662. #------------------------------------------------------------------------------
  663. #  This module handles the battle processing
  664. #==============================================================================

  665. class << BattleManager
  666.   #--------------------------------------------------------------------------
  667.   # * New method: all_battle_members
  668.   #--------------------------------------------------------------------------
  669.   def all_battle_members
  670.     $game_party.members + $game_troop.members
  671.   end
  672.   #--------------------------------------------------------------------------
  673.   # * New method: all_dead_members
  674.   #--------------------------------------------------------------------------
  675.   def all_dead_members
  676.     $game_party.dead_members + $game_troop.dead_members
  677.   end
  678.   #--------------------------------------------------------------------------
  679.   # * New method: all_movable_members
  680.   #--------------------------------------------------------------------------
  681.   def all_movable_members
  682.     $game_party.movable_members + $game_troop.movable_members
  683.   end
  684. end

  685. #==============================================================================
  686. # ** Game_BattlerBase
  687. #------------------------------------------------------------------------------
  688. #  This class handles battlers. It's used as a superclass of the Game_Battler
  689. # classes.
  690. #==============================================================================

  691. class Game_BattlerBase
  692.   #--------------------------------------------------------------------------
  693.   # * Public Instance Variables
  694.   #--------------------------------------------------------------------------
  695.   attr_reader   :buffs
  696.   #--------------------------------------------------------------------------
  697.   # * New method: get_param
  698.   #--------------------------------------------------------------------------
  699.   def get_param(text)
  700.     case text.upcase
  701.     when "MAXHP" then self.mhp
  702.     when "MAXMP" then self.mmp
  703.     when "MAXTP" then self.max_tp
  704.     else eval("self.#{text.downcase}")
  705.     end
  706.   end
  707.   #--------------------------------------------------------------------------
  708.   # * New method: type
  709.   #--------------------------------------------------------------------------
  710.   def type
  711.     list = []
  712.     get_all_notes.scan(/<BATTLER TYPE: ((?:\w+ *,? *)+)>/i) do
  713.       $1.scan(/(\d+)/i) { list.push(make_symbol($1)) }
  714.     end
  715.     list.uniq
  716.   end
  717.   #--------------------------------------------------------------------------
  718.   # * New method: danger?
  719.   #--------------------------------------------------------------------------
  720.   def danger?
  721.     hp < mhp * 25 / 100
  722.   end
  723.   #--------------------------------------------------------------------------
  724.   # * New method: sprite
  725.   #--------------------------------------------------------------------------
  726.   def sprite
  727.     valid = SceneManager.scene_is?(Scene_Battle) && SceneManager.scene.spriteset
  728.     valid ? SceneManager.scene.spriteset.sprite(self) : nil
  729.   end
  730.   #--------------------------------------------------------------------------
  731.   # * New method: element_set
  732.   #--------------------------------------------------------------------------
  733.   def element_set(item)
  734.     element_set  = item.element_set
  735.     element_set += atk_elements if item.damage.element_id < 0
  736.     element_set.delete(0)
  737.     element_set.compact
  738.   end
  739.   #--------------------------------------------------------------------------
  740.   # * New method: add_state_normal
  741.   #--------------------------------------------------------------------------
  742.   def add_state_normal(state_id, rate = 1, user = self)
  743.     chance  = rate
  744.     chance *= state_rate(state_id)
  745.     chance *= luk_effect_rate(user)
  746.     add_state(state_id) if rand < chance
  747.   end
  748.   #--------------------------------------------------------------------------
  749.   # * New method: damaged?
  750.   #--------------------------------------------------------------------------
  751.   def damaged?
  752.     @result.hp_damage != 0 || @result.mp_damage != 0 || @result.tp_damage != 0
  753.   end
  754.   #--------------------------------------------------------------------------
  755.   # * New method: mtp
  756.   #--------------------------------------------------------------------------
  757.   def mtp
  758.     return 100
  759.   end
  760. end

  761. #==============================================================================
  762. # ** Game_Battler
  763. #------------------------------------------------------------------------------
  764. #  This class deals with battlers. It's used as a superclass of the Game_Actor
  765. # and Game_Enemy classes.
  766. #==============================================================================

  767. class Game_Battler < Game_BattlerBase
  768.   #--------------------------------------------------------------------------
  769.   # * Overwrite method: item_effect_recover_hp
  770.   #--------------------------------------------------------------------------
  771.   def item_effect_recover_hp(user, item, effect)
  772.     value = item_value_recover_hp(user, item, effect).to_i
  773.     @result.hp_damage -= value
  774.     @result.success    = true
  775.     self.hp += value
  776.   end
  777.   #--------------------------------------------------------------------------
  778.   # * Overwrite method: item_effect_recover_mp
  779.   #--------------------------------------------------------------------------
  780.   def item_effect_recover_mp(user, item, effect)
  781.     value = item_value_recover_mp(user, item, effect).to_i
  782.     @result.mp_damage -= value
  783.     @result.success    = true if value != 0
  784.     self.mp += value
  785.   end
  786.   #--------------------------------------------------------------------------
  787.   # * Overwrite method: item_effect_gain_tp
  788.   #--------------------------------------------------------------------------
  789.   def item_effect_gain_tp(user, item, effect)
  790.     value    = item_value_recover_tp(user, item, effect)
  791.     self.tp += value
  792.   end
  793.   #--------------------------------------------------------------------------
  794.   # * New method: item_value_recover_hp
  795.   #--------------------------------------------------------------------------
  796.   def item_value_recover_hp(user, item, effect)
  797.     value  = (mhp * effect.value1 + effect.value2) * rec
  798.     value *= user.pha if item.is_a?(RPG::Item)
  799.     value
  800.   end
  801.   #--------------------------------------------------------------------------
  802.   # * New method: item_value_recover_mp
  803.   #--------------------------------------------------------------------------
  804.   def item_value_recover_mp(user, item, effect)
  805.     value  = (mmp * effect.value1 + effect.value2) * rec
  806.     value *= user.pha if item.is_a?(RPG::Item)
  807.     value
  808.   end
  809.   #--------------------------------------------------------------------------
  810.   # * New method: item_value_recover_tp
  811.   #--------------------------------------------------------------------------
  812.   def item_value_recover_tp(user, item, effect)
  813.     effect.value1.to_i
  814.   end
  815.   #--------------------------------------------------------------------------
  816.   # * New method: cri_rate
  817.   #--------------------------------------------------------------------------
  818.   def cri_rate(user, item)
  819.     user.cri
  820.   end
  821.   #--------------------------------------------------------------------------
  822.   # * New method: cri_eva
  823.   #--------------------------------------------------------------------------
  824.   def cri_eva(user, item)
  825.     cev
  826.   end
  827.   #--------------------------------------------------------------------------
  828.   # * New method: setup_critical
  829.   #--------------------------------------------------------------------------
  830.   def setup_critical(user, item)
  831.     cri_rate(user, item) * (1 - cri_eva(user, item))
  832.   end
  833. end

  834. #==============================================================================
  835. # ** Game_Enemy
  836. #------------------------------------------------------------------------------
  837. #  This class handles enemy characters. It's used within the Game_Troop class
  838. # ($game_troop).
  839. #==============================================================================

  840. class Game_Enemy < Game_Battler
  841.   #--------------------------------------------------------------------------
  842.   # * New method: id
  843.   #--------------------------------------------------------------------------
  844.   def id
  845.     @enemy_id
  846.   end
  847.   #--------------------------------------------------------------------------
  848.   # * New method: note
  849.   #--------------------------------------------------------------------------
  850.   def note
  851.     enemy ? enemy.note : ""
  852.   end
  853.   #--------------------------------------------------------------------------
  854.   # * New method: get_all_notes
  855.   #--------------------------------------------------------------------------
  856.   def get_all_notes(*args)
  857.     notes  = ""
  858.     notes += note if !args.include?(:self)
  859.     states.compact.each {|state| notes += state.note } if !args.include?(:state)
  860.     notes
  861.   end
  862.   #--------------------------------------------------------------------------
  863.   # * New method: get_all_objects
  864.   #--------------------------------------------------------------------------
  865.   def get_all_objects(*args)
  866.     result = []
  867.     result += [self] if !args.include?(:self)
  868.     result += states.compact if !args.include?(:state)
  869.     result
  870.   end
  871.   #--------------------------------------------------------------------------
  872.   # * New method: level
  873.   #--------------------------------------------------------------------------
  874.   def level
  875.     return 1
  876.   end
  877.   #--------------------------------------------------------------------------
  878.   # * New method: skill_learn?
  879.   #--------------------------------------------------------------------------
  880.   def skill_learn?(skill)
  881.     skill.skill? && skills.include?(skill)
  882.   end
  883.   #--------------------------------------------------------------------------
  884.   # * New method: skills
  885.   #--------------------------------------------------------------------------
  886.   def skills
  887.     (enemy_actions | added_skills).sort.collect {|id| $data_skills[id] }
  888.   end
  889.   #--------------------------------------------------------------------------
  890.   # * New method: enemy_actions
  891.   #--------------------------------------------------------------------------
  892.   def enemy_actions
  893.     enemy.actions.collect {|action| action.skill_id }
  894.   end
  895. end

  896. #==============================================================================
  897. # ** Game_Actor
  898. #------------------------------------------------------------------------------
  899. #  This class handles actors. It's used within the Game_Actors class
  900. # ($game_actors) and referenced by the Game_Party class ($game_party).
  901. #==============================================================================

  902. class Game_Actor < Game_Battler
  903.   #--------------------------------------------------------------------------
  904.   # * New method: note
  905.   #--------------------------------------------------------------------------
  906.   def note
  907.     actor ? actor.note : ""
  908.   end
  909.   #--------------------------------------------------------------------------
  910.   # * New method: hue
  911.   #--------------------------------------------------------------------------
  912.   def hue
  913.     @hue ? @hue : 0
  914.   end
  915.   #--------------------------------------------------------------------------
  916.   # * New method: get_all_notes
  917.   #--------------------------------------------------------------------------
  918.   def get_all_notes(*args)
  919.     notes = ""
  920.     notes += note if !args.include?(:self)
  921.     notes += self.class.note if !args.include?(:class)
  922.     equips.compact.each {|equip| notes += equip.note } if !args.include?(:equip)
  923.     states.compact.each {|state| notes += state.note } if !args.include?(:state)
  924.     notes
  925.   end
  926.   #--------------------------------------------------------------------------
  927.   # * New method: get_all_objects
  928.   #--------------------------------------------------------------------------
  929.   def get_all_objects(*args)
  930.     result = []
  931.     result += [self] if !args.include?(:self)
  932.     result += [self.class]   if !args.include?(:class)
  933.     result += equips.compact if !args.include?(:equip)
  934.     result += states.compact if !args.include?(:state)
  935.     result
  936.   end
  937.   #--------------------------------------------------------------------------
  938.   # * New method: in_active_party?
  939.   #--------------------------------------------------------------------------
  940.   def in_active_party?
  941.     $game_party.battle_members.include?(self)
  942.   end
  943.   #--------------------------------------------------------------------------
  944.   # * New method: in_reserve_party?
  945.   #--------------------------------------------------------------------------
  946.   def in_reserve_party?
  947.     $game_party.reserve_members.include?(self)
  948.   end
  949.   #--------------------------------------------------------------------------
  950.   # * New method: in_party?
  951.   #--------------------------------------------------------------------------
  952.   def in_party?
  953.     $game_party.all_members.include?(self)
  954.   end
  955.   #--------------------------------------------------------------------------
  956.   # * New method: map_animation
  957.   #--------------------------------------------------------------------------
  958.   def map_animation(id)
  959.     $game_map.actors.each do |member|
  960.       member.animation_id = id if member.actor == self
  961.     end
  962.   end
  963.   #--------------------------------------------------------------------------
  964.   # * New method: on_damage_floor
  965.   #--------------------------------------------------------------------------
  966.   def on_damage_floor?
  967.     $game_player.on_damage_floor?
  968.   end
  969. end

  970. #==============================================================================
  971. # ** Game_Unit
  972. #------------------------------------------------------------------------------
  973. #  This class handles units. It's used as a superclass of the Game_Party and
  974. # Game_Troop classes.
  975. #==============================================================================

  976. class Game_Unit
  977.   #--------------------------------------------------------------------------
  978.   # * New method: refresh
  979.   #--------------------------------------------------------------------------
  980.   def refresh
  981.     members.each {|member| member.refresh }
  982.   end
  983. end

  984. #==============================================================================
  985. # ** Game_Party
  986. #------------------------------------------------------------------------------
  987. #  This class handles the party. It includes information on amount of gold
  988. # and items. The instance of this class is referenced by $game_party.
  989. #==============================================================================

  990. class Game_Party < Game_Unit
  991.   #--------------------------------------------------------------------------
  992.   # * New method: average_level
  993.   #--------------------------------------------------------------------------
  994.   def average_level
  995.     battle_members.collect {|actor| actor.level }.average
  996.   end
  997.   #--------------------------------------------------------------------------
  998.   # * New method: reserve_members
  999.   #--------------------------------------------------------------------------
  1000.   def reserve_members
  1001.     all_members - battle_members
  1002.   end
  1003. end

  1004. #==============================================================================
  1005. # ** Game_Map
  1006. #------------------------------------------------------------------------------
  1007. #  This class handles maps. It includes scrolling and passage determination
  1008. # functions. The instance of this class is referenced by $game_map.
  1009. #==============================================================================

  1010. class Game_Map
  1011.   #--------------------------------------------------------------------------
  1012.   # * New method: event_list
  1013.   #--------------------------------------------------------------------------
  1014.   def event_list
  1015.     events.values
  1016.   end
  1017.   #--------------------------------------------------------------------------
  1018.   # * New method: note
  1019.   #--------------------------------------------------------------------------
  1020.   def note
  1021.     @map ? @map.note : ""
  1022.   end
  1023.   #--------------------------------------------------------------------------
  1024.   # * New method: vehicles
  1025.   #--------------------------------------------------------------------------
  1026.   def vehicles
  1027.     @vehicles
  1028.   end
  1029.   #--------------------------------------------------------------------------
  1030.   # * New method: map_events
  1031.   #--------------------------------------------------------------------------
  1032.   def map_events
  1033.     @map.events
  1034.   end
  1035.   #--------------------------------------------------------------------------
  1036.   # * New method: actors
  1037.   #--------------------------------------------------------------------------
  1038.   def actors
  1039.     [$game_player] + $game_player.followers.visible_followers
  1040.   end
  1041. end

  1042. #==============================================================================
  1043. # ** Game_CharacterBase
  1044. #------------------------------------------------------------------------------
  1045. #  This class deals with characters. Common to all characters, stores basic
  1046. # data, such as coordinates and graphics. It's used as a superclass of the
  1047. # Game_Character class.
  1048. #==============================================================================

  1049. class Game_CharacterBase
  1050.   #--------------------------------------------------------------------------
  1051.   # * Public Instance Variables
  1052.   #--------------------------------------------------------------------------
  1053.   attr_accessor :move_speed
  1054.   attr_accessor :move_frequency
  1055.   #--------------------------------------------------------------------------
  1056.   # * New method: player?
  1057.   #--------------------------------------------------------------------------
  1058.   def player?
  1059.     return false
  1060.   end
  1061.   #--------------------------------------------------------------------------
  1062.   # * New method: event?
  1063.   #--------------------------------------------------------------------------
  1064.   def event?
  1065.     return false
  1066.   end
  1067.   #--------------------------------------------------------------------------
  1068.   # * New method: follower?
  1069.   #--------------------------------------------------------------------------
  1070.   def follower?
  1071.     return false
  1072.   end
  1073.   #--------------------------------------------------------------------------
  1074.   # * New method: vehicle?
  1075.   #--------------------------------------------------------------------------
  1076.   def vehicle?
  1077.     return false
  1078.   end
  1079.   #--------------------------------------------------------------------------
  1080.   # * New method: frames
  1081.   #--------------------------------------------------------------------------
  1082.   def frames
  1083.     return 3
  1084.   end
  1085.   #--------------------------------------------------------------------------
  1086.   # * New method: hue
  1087.   #--------------------------------------------------------------------------
  1088.   def hue
  1089.     @hue ? @hue : 0
  1090.   end
  1091. end

  1092. #==============================================================================
  1093. # ** Game_Character
  1094. #------------------------------------------------------------------------------
  1095. #  This class deals with characters. It's used as a superclass of the
  1096. # Game_Player and Game_Event classes.
  1097. #==============================================================================

  1098. class Game_Character < Game_CharacterBase
  1099.   #--------------------------------------------------------------------------
  1100.   # * New method: move_toward_position
  1101.   #--------------------------------------------------------------------------
  1102.   def move_toward_position(x, y)
  1103.     sx = distance_x_from(x)
  1104.     sy = distance_y_from(y)
  1105.     if sx.abs > sy.abs
  1106.       move_straight(sx > 0 ? 4 : 6)
  1107.       move_straight(sy > 0 ? 8 : 2) if !@move_succeed && sy != 0
  1108.     elsif sy != 0
  1109.       move_straight(sy > 0 ? 8 : 2)
  1110.       move_straight(sx > 0 ? 4 : 6) if !@move_succeed && sx != 0
  1111.     end
  1112.   end
  1113.   #--------------------------------------------------------------------------
  1114.   # * New method: move_toward_position
  1115.   #--------------------------------------------------------------------------
  1116.   def turn_toward_position(x, y)
  1117.     sx = distance_x_from(x)
  1118.     sy = distance_y_from(y)
  1119.     if sx.abs > sy.abs
  1120.       set_direction(sx > 0 ? 4 : 6)
  1121.     elsif sy != 0
  1122.       set_direction(sy > 0 ? 8 : 2)
  1123.     end
  1124.   end
  1125. end

  1126. #==============================================================================
  1127. # ** Game_Player
  1128. #------------------------------------------------------------------------------
  1129. #  This class handles the player.
  1130. # The instance of this class is referenced by $game_map.
  1131. #==============================================================================

  1132. class Game_Player < Game_Character
  1133.   #--------------------------------------------------------------------------
  1134.   # * New method: player?
  1135.   #--------------------------------------------------------------------------
  1136.   def player?
  1137.     return true
  1138.   end
  1139.   #--------------------------------------------------------------------------
  1140.   # * New method: perform_transfer
  1141.   #--------------------------------------------------------------------------
  1142.   def new_map_id
  1143.     @new_map_id
  1144.   end
  1145.   #--------------------------------------------------------------------------
  1146.   # * New method: hue
  1147.   #--------------------------------------------------------------------------
  1148.   def hue
  1149.     actor ? actor.hue : 0
  1150.   end
  1151. end

  1152. #==============================================================================
  1153. # ** Game_Follower
  1154. #------------------------------------------------------------------------------
  1155. #  This class handles the followers. Followers are the actors of the party
  1156. # that follows the leader in a line. It's used within the Game_Followers class.
  1157. #==============================================================================

  1158. class Game_Follower < Game_Character
  1159.   #--------------------------------------------------------------------------
  1160.   # * New method: follower?
  1161.   #--------------------------------------------------------------------------
  1162.   def follower?
  1163.     return true
  1164.   end
  1165.   #--------------------------------------------------------------------------
  1166.   # * New method: index
  1167.   #--------------------------------------------------------------------------
  1168.   def index
  1169.     @member_index
  1170.   end
  1171.   #--------------------------------------------------------------------------
  1172.   # * New method: gathering?
  1173.   #--------------------------------------------------------------------------
  1174.   def gathering?
  1175.     $game_player.followers.gathering? && !gather?
  1176.   end
  1177. end

  1178. #==============================================================================
  1179. # ** Game_Followers
  1180. #------------------------------------------------------------------------------
  1181. #  This class handles the followers. It's a wrapper for the built-in class
  1182. # "Array." It's used within the Game_Player class.
  1183. #==============================================================================

  1184. class Game_Followers
  1185.   #--------------------------------------------------------------------------
  1186.   # * New method: get_actor
  1187.   #--------------------------------------------------------------------------
  1188.   def get_actor(id)
  1189.     list = [$game_player] + visible_followers
  1190.     list.select {|follower| follower.actor && follower.actor.id == id }.first
  1191.   end
  1192.   #--------------------------------------------------------------------------
  1193.   # * Method fix: visble_folloers
  1194.   #--------------------------------------------------------------------------
  1195.   unless method_defined?(:visible_followers)
  1196.     def visible_followers; visible_folloers; end
  1197.   end
  1198. end

  1199. #==============================================================================
  1200. # ** Game_Vehicle
  1201. #------------------------------------------------------------------------------
  1202. #  This class handles vehicles. It's used within the Game_Map class. If there
  1203. # are no vehicles on the current map, the coordinates is set to (-1,-1).
  1204. #==============================================================================

  1205. class Game_Vehicle < Game_Character
  1206.   #--------------------------------------------------------------------------
  1207.   # * New method: vehicle?
  1208.   #--------------------------------------------------------------------------
  1209.   def vehicle?
  1210.     return true
  1211.   end
  1212.   #--------------------------------------------------------------------------
  1213.   # * New method: map_id
  1214.   #--------------------------------------------------------------------------
  1215.   def map_id
  1216.     @map_id
  1217.   end
  1218.   #--------------------------------------------------------------------------
  1219.   # * New method: type
  1220.   #--------------------------------------------------------------------------
  1221.   def type
  1222.     @type
  1223.   end
  1224.   #--------------------------------------------------------------------------
  1225.   # * New method: aerial?
  1226.   #--------------------------------------------------------------------------
  1227.   def aerial?
  1228.     type == :airship
  1229.   end
  1230.   #--------------------------------------------------------------------------
  1231.   # * New method: above?
  1232.   #--------------------------------------------------------------------------
  1233.   def above?
  1234.     aerial?
  1235.   end
  1236. end

  1237. #==============================================================================
  1238. # ** Game_Event
  1239. #------------------------------------------------------------------------------
  1240. #  This class deals with events. It handles functions including event page
  1241. # switching via condition determinants, and running parallel process events.
  1242. # It's used within the Game_Map class.
  1243. #==============================================================================

  1244. class Game_Event < Game_Character
  1245.   #--------------------------------------------------------------------------
  1246.   # * New method: name
  1247.   #--------------------------------------------------------------------------
  1248.   def name
  1249.     @event.name
  1250.   end
  1251.   #--------------------------------------------------------------------------
  1252.   # * New method: event?
  1253.   #--------------------------------------------------------------------------
  1254.   def event?
  1255.     return true
  1256.   end
  1257.   #--------------------------------------------------------------------------
  1258.   # * New method: erased?
  1259.   #--------------------------------------------------------------------------
  1260.   def erased?
  1261.     @erased
  1262.   end
  1263.   #--------------------------------------------------------------------------
  1264.   # * New method: note
  1265.   #--------------------------------------------------------------------------
  1266.   def note
  1267.     return ""     if !@page || [email protected] || @page.list.size <= 0
  1268.     return @notes if @notes && @page.list == @note_page
  1269.     @note_page = @page.list.dup
  1270.     comment_list = []
  1271.     @page.list.each do |item|
  1272.       next unless item && (item.code == 108 || item.code == 408)
  1273.       comment_list.push(item.parameters[0])
  1274.     end
  1275.     @notes = comment_list.join("\r\n")
  1276.     @notes
  1277.   end  
  1278. end

  1279. #==============================================================================
  1280. # ** Game_Interpreter
  1281. #------------------------------------------------------------------------------
  1282. #  An interpreter for executing event commands. This class is used within the
  1283. # Game_Map, Game_Troop, and Game_Event classes.
  1284. #==============================================================================

  1285. class Game_Interpreter
  1286.   #--------------------------------------------------------------------------
  1287.   # * Alias method: command_108
  1288.   #--------------------------------------------------------------------------
  1289.   alias :command_108_ve_basic_module :command_108
  1290.   def command_108
  1291.     command_108_ve_basic_module
  1292.     comment_call
  1293.   end
  1294.   #--------------------------------------------------------------------------
  1295.   # * New method: comment_call
  1296.   #--------------------------------------------------------------------------
  1297.   def comment_call
  1298.   end
  1299.   #--------------------------------------------------------------------------
  1300.   # * New method: note
  1301.   #--------------------------------------------------------------------------
  1302.   def note
  1303.     @comments ? @comments.join("\r\n") : ""
  1304.   end
  1305. end

  1306. #==============================================================================
  1307. # ** Game_Animation
  1308. #------------------------------------------------------------------------------
  1309. #  Classe that handles Animation data
  1310. #==============================================================================

  1311. class Game_Animation
  1312.   #--------------------------------------------------------------------------
  1313.   # * Public Instance Variables
  1314.   #--------------------------------------------------------------------------
  1315.   attr_accessor :ox
  1316.   attr_accessor :oy
  1317.   attr_accessor :rate
  1318.   attr_accessor :zoom
  1319.   attr_accessor :loop
  1320.   attr_accessor :type
  1321.   attr_accessor :map_x
  1322.   attr_accessor :map_y
  1323.   attr_accessor :mirror
  1324.   attr_accessor :follow
  1325.   attr_accessor :height
  1326.   attr_accessor :bitmap1
  1327.   attr_accessor :bitmap2
  1328.   attr_accessor :sprites
  1329.   attr_accessor :duration
  1330.   attr_accessor :direction
  1331.   attr_accessor :duplicated
  1332.   #--------------------------------------------------------------------------
  1333.   # * New method: initialize
  1334.   #--------------------------------------------------------------------------
  1335.   def initialize(animation, mirror, user = nil)
  1336.     @animation = animation
  1337.     @rate      = animation.name =~ /<RATE: ([+-]?\d+)>/i ? [$1.to_i, 1].max : 4
  1338.     @zoom      = animation.name =~ /<ZOOM: (\d+)%?>/i ? $1.to_i / 100.0 : 1.0
  1339.     @follow    = animation.name =~ /<FOLLOW>/i ? true : false
  1340.     @mirror    = mirror
  1341.     @duration  = frame_max * @rate
  1342.     @direction = user.anim_direction if user
  1343.     @sprites   = []
  1344.     bellow     = animation.name =~ /<BELLOW>/i
  1345.     above      = animation.name =~ /<ABOVE>/i
  1346.     @height    = bellow ? -1 : above ? 300 : 1
  1347.   end
  1348.   #--------------------------------------------------------------------------
  1349.   # * New method: data
  1350.   #--------------------------------------------------------------------------  
  1351.   def data
  1352.     @animation
  1353.   end
  1354.   #--------------------------------------------------------------------------
  1355.   # * New method: id
  1356.   #--------------------------------------------------------------------------  
  1357.   def id
  1358.     @animation.id
  1359.   end
  1360.   #--------------------------------------------------------------------------
  1361.   # * New method: name
  1362.   #--------------------------------------------------------------------------  
  1363.   def name
  1364.     @animation.name
  1365.   end
  1366.   #--------------------------------------------------------------------------
  1367.   # * New method: frame_max
  1368.   #--------------------------------------------------------------------------
  1369.   def frame_max
  1370.     @animation.frame_max
  1371.   end
  1372.   #--------------------------------------------------------------------------
  1373.   # * New method: position
  1374.   #--------------------------------------------------------------------------
  1375.   def position
  1376.     @animation.position
  1377.   end
  1378.   #--------------------------------------------------------------------------
  1379.   # * New method: animation1_name
  1380.   #--------------------------------------------------------------------------
  1381.   def animation1_name
  1382.     @animation.animation1_name
  1383.   end
  1384.   #--------------------------------------------------------------------------
  1385.   # * New method: animation2_name
  1386.   #--------------------------------------------------------------------------
  1387.   def animation2_name
  1388.     @animation.animation2_name
  1389.   end
  1390.   #--------------------------------------------------------------------------
  1391.   # * New method: animation1_hue
  1392.   #--------------------------------------------------------------------------
  1393.   def animation1_hue
  1394.     @animation.animation1_hue
  1395.   end
  1396.   #--------------------------------------------------------------------------
  1397.   # * New method: animation2_hue
  1398.   #--------------------------------------------------------------------------
  1399.   def animation2_hue
  1400.     @animation.animation2_hue
  1401.   end
  1402.   #--------------------------------------------------------------------------
  1403.   # * New method: frames
  1404.   #--------------------------------------------------------------------------
  1405.   def frames
  1406.     @animation.frames
  1407.   end
  1408.   #--------------------------------------------------------------------------
  1409.   # * New method: timings
  1410.   #--------------------------------------------------------------------------
  1411.   def timings
  1412.     @animation.timings
  1413.   end
  1414. end

  1415. #==============================================================================
  1416. # ** Sprite_Character
  1417. #------------------------------------------------------------------------------
  1418. #  This sprite is used to display characters. It observes a instance of the
  1419. # Game_Character class and automatically changes sprite conditions.
  1420. #==============================================================================

  1421. class Sprite_Character < Sprite_Base
  1422.   #--------------------------------------------------------------------------
  1423.   # * Overwrite method: set_character_bitmap
  1424.   #--------------------------------------------------------------------------
  1425.   def set_character_bitmap
  1426.     update_character_info
  1427.     set_bitmap
  1428.     set_bitmap_position
  1429.   end
  1430.   #--------------------------------------------------------------------------
  1431.   # * New method: center_y
  1432.   #--------------------------------------------------------------------------
  1433.   def actor?
  1434.     @character.is_a?(Game_Player) || @character.is_a?(Game_Follower)
  1435.   end
  1436.   #--------------------------------------------------------------------------
  1437.   # * New method: center_y
  1438.   #--------------------------------------------------------------------------
  1439.   def actor
  1440.     actor? ? @character.actor : nil
  1441.   end
  1442.   #--------------------------------------------------------------------------
  1443.   # * New method: update_character_info
  1444.   #--------------------------------------------------------------------------
  1445.   def update_character_info
  1446.   end
  1447.   #--------------------------------------------------------------------------
  1448.   # * New method: hue
  1449.   #--------------------------------------------------------------------------
  1450.   def hue
  1451.     @character.hue
  1452.   end
  1453.   #--------------------------------------------------------------------------
  1454.   # * New method: set_bitmap
  1455.   #--------------------------------------------------------------------------
  1456.   def set_bitmap
  1457.     self.bitmap = Cache.character(set_bitmap_name, hue)
  1458.   end
  1459.   #--------------------------------------------------------------------------
  1460.   # * New method: set_bitmap_name
  1461.   #--------------------------------------------------------------------------
  1462.   def set_bitmap_name
  1463.     @character_name
  1464.   end
  1465.   #--------------------------------------------------------------------------
  1466.   # * New method: set_bitmap_position
  1467.   #--------------------------------------------------------------------------
  1468.   def set_bitmap_position
  1469.     sign = get_sign
  1470.     if sign && sign.include?(')
  1471.       @cw = bitmap.width / @character.frames
  1472.       @ch = bitmap.height / 4
  1473.     else
  1474.       @cw = bitmap.width / (@character.frames * 4)
  1475.       @ch = bitmap.height / 8
  1476.     end
  1477.     self.ox = @cw / 2
  1478.     self.oy = @ch
  1479.   end
  1480.   #--------------------------------------------------------------------------
  1481.   # * New method: get_sign
  1482.   #--------------------------------------------------------------------------
  1483.   def get_sign
  1484.     @character_name[/^[\!\$]./]
  1485.   end
  1486. end

  1487. #==============================================================================
  1488. # ** Sprite_Battler
  1489. #------------------------------------------------------------------------------
  1490. #  This sprite is used to display battlers. It observes a instance of the
  1491. # Game_Battler class and automatically changes sprite conditions.
  1492. #==============================================================================

  1493. class Sprite_Battler < Sprite_Base
  1494.   #--------------------------------------------------------------------------
  1495.   # * Public Instance Variables
  1496.   #--------------------------------------------------------------------------
  1497.   attr_accessor :dmg_mirror
  1498.   #--------------------------------------------------------------------------
  1499.   # * New method: center_x
  1500.   #--------------------------------------------------------------------------
  1501.   def center_x
  1502.     self.ox
  1503.   end
  1504.   #--------------------------------------------------------------------------
  1505.   # * New method: center_y
  1506.   #--------------------------------------------------------------------------
  1507.   def center_y
  1508.     self.oy / 2
  1509.   end
  1510. end

  1511. #==============================================================================
  1512. # ** Spriteset_Battle
  1513. #------------------------------------------------------------------------------
  1514. #  This class brings together battle screen sprites. It's used within the
  1515. # Scene_Battle class.
  1516. #==============================================================================

  1517. class Spriteset_Battle
  1518.   #--------------------------------------------------------------------------
  1519.   # * Public Instance Variables
  1520.   #--------------------------------------------------------------------------
  1521.   attr_reader   :viewport1
  1522.   #--------------------------------------------------------------------------
  1523.   # * New method: sprite
  1524.   #--------------------------------------------------------------------------
  1525.   def sprite(subject)
  1526.     battler_sprites.compact.select {|sprite| sprite.battler == subject }.first
  1527.   end
  1528. end

  1529. #==============================================================================
  1530. # ** Window_Base
  1531. #------------------------------------------------------------------------------
  1532. #  This is a superclass of all windows in the game.
  1533. #==============================================================================

  1534. class Window_Base < Window
  1535.   #--------------------------------------------------------------------------
  1536.   # * Alias method: convert_escape_characters
  1537.   #--------------------------------------------------------------------------
  1538.   alias :convert_escape_ve_basic_module :convert_escape_characters
  1539.   def convert_escape_characters(text)
  1540.     result = text.to_s.clone
  1541.     result = text_replace(result)
  1542.     result = convert_escape_ve_basic_module(text)
  1543.     result
  1544.   end
  1545.   #--------------------------------------------------------------------------
  1546.   # * New method: text_replace
  1547.   #--------------------------------------------------------------------------
  1548.   def text_replace(result)
  1549.     result.gsub!(/\r/) { "" }
  1550.     result.gsub!(/\\/) { "\e" }
  1551.     result
  1552.   end
  1553. end

  1554. #==============================================================================
  1555. # ** Scene_Battle
  1556. #------------------------------------------------------------------------------
  1557. #  This class performs battle screen processing.
  1558. #==============================================================================

  1559. class Scene_Battle < Scene_Base
  1560.   #--------------------------------------------------------------------------
  1561.   # * Public Instance Variables
  1562.   #--------------------------------------------------------------------------
  1563.   attr_reader   :subject
  1564.   attr_reader   :spriteset
  1565. end

  1566. #==============================================================================
  1567. # ** Scene_Battle
  1568. #------------------------------------------------------------------------------
  1569. #  This class performs map screen processing.
  1570. #==============================================================================

  1571. class Scene_Map < Scene_Base
  1572.   #--------------------------------------------------------------------------
  1573.   # * Public Instance Variables
  1574.   #--------------------------------------------------------------------------
  1575.   attr_reader   :spriteset
  1576. end
复制代码
回复 支持 反对

使用道具 举报

Lv3.寻梦者 (版主)

…あたしは天使なんかじゃないわ

梦石
0
星屑
2208
在线时间
4033 小时
注册时间
2010-10-4
帖子
10779

开拓者贵宾

5
发表于 2015-9-13 09:34:15 | 只看该作者
huct08 发表于 2015-9-13 09:27
终于试出来了,和这个脚本冲突

删除下面脚本的
  1.   def sum
  2.     self.inject(0) {|r, n| r += (n.numeric? ? n : 0)}
  3.   end
复制代码

评分

参与人数 1星屑 +200 收起 理由
VIPArcher + 200 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
209
在线时间
104 小时
注册时间
2014-2-23
帖子
60
6
 楼主| 发表于 2015-9-13 10:05:56 | 只看该作者
taroxd 发表于 2015-9-13 09:34
删除下面脚本的

那个脚本我直接删了
很久以前放的 现在也不知道是干什么用的了
谢谢{:2_249:}

点评

那个是另外一个作者的前置脚本  发表于 2015-9-13 10:07
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-16 20:33

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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