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

Project1

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

[已经过期] 求解,关于敌人等级脚本

[复制链接]

Lv1.梦旅人

梦石
0
星屑
40
在线时间
80 小时
注册时间
2014-11-3
帖子
71
跳转到指定楼层
1
发表于 2015-9-21 18:43:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
就是va超级整合的脚本
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Enemy Levels v1.01
  4. # -- Last Updated: 2012.01.24
  5. # -- Level: Normal, Hard
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================

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

  11. #==============================================================================
  12. # ▼ Updates
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. # 2012.01.24 - Added <hide level> notetag for enemies.
  15. #            - Option to change Party Level function in Action Conditions to
  16. #              enemy level requirements.
  17. # 2011.12.30 - Started Script and Finished.
  18. #
  19. #==============================================================================
  20. # ▼ Introduction
  21. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  22. # RPG's with enemies that level up with the party enforces the player to stay
  23. # on their toes the whole time. This is both a good and bad thing as it can
  24. # cause the player to stay alert, but can also cause the player to meet some
  25. # roadblocks. This script will not only provide enemies the ability to level up
  26. # but also allow the script's user to go around these roadblocks using various
  27. # tags to limit or slow down the rate of growth across all enemies.
  28. #
  29. #==============================================================================
  30. # ▼ Instructions
  31. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  32. # To install this script, open up your script editor and copy/paste this script
  33. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  34. #
  35. # -----------------------------------------------------------------------------
  36. # Skill Notetags - These notetags go in the skill notebox in the database.
  37. # -----------------------------------------------------------------------------
  38. # <enemy level: +x>
  39. # <enemy level: -x>
  40. # This causes the enemy to raise or drop x levels depending on the tag used.
  41. # The new level will readjust the enemy's stats (including HP and MP).
  42. #
  43. # <enemy level reset>
  44. # This resets the enemy's level back to the typical range it should be plus or
  45. # minus any level fluctuations it was given. This occurs before enemy level +
  46. # and enemy level - tags.
  47. #
  48. # -----------------------------------------------------------------------------
  49. # Enemy Notetags - These notetags go in the enemies notebox in the database.
  50. # -----------------------------------------------------------------------------
  51. # <hide level>
  52. # This notetag will hide the level of the enemy. If YEA - Enemy Target Info is
  53. # installed, the level will be revealed upon a parameter scan.
  54. #
  55. # <min level: x>
  56. # <max level: x>
  57. # This will adjust the minimum and maximum levels for the enemy. By default,
  58. # the minimum level is 1 and the maximum level is whatever is set in the module
  59. # as MAX_LEVEL.
  60. #
  61. # <set level: x>
  62. # This will set the enemy's level to exactly x. It a sense, this is just the
  63. # usage of both the min and max level tags together as the same value.
  64. #
  65. # <level type: x>
  66. # Choosing a value from 0 to 4, you can adjust the different leveling rulesets
  67. # for the enemy. See the list below.
  68. # Type 0 - Lowest level of all actors that have joined.
  69. # Type 1 - Lowest level in the battle party.
  70. # Type 2 - Average level of the battle party.
  71. # Type 3 - Highest level of the battle party.
  72. # Type 4 - Highest level of all actors that have joined.
  73. #
  74. # <level random: x>
  75. # This will give the level a random flunctuation in either direction. Set this
  76. # value to 0 if you don't wish to use it. Adjust RANDOM_FLUCTUATION inside the
  77. # module to change the default fluctuation value.
  78. #
  79. # <stat: +x per level>
  80. # <stat: -x per level>
  81. # <stat: +x% per level>
  82. # <stat: -x% per level>
  83. # This will raise or lower the stat by x or x% per level (depending on the tag
  84. # used). This will override the default growth settings found inside the module
  85. # hash called DEFAULT_GROWTH. You may replace stat with:
  86. # MAXHP, MAXMP, ATK, DEF, MAT, MDF, AGI, LUK, GOLD, EXP
  87. #
  88. #==============================================================================
  89. # ▼ Compatibility
  90. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  91. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  92. # it will run with RPG Maker VX without adjusting.
  93. #
  94. #==============================================================================

  95. module YEA
  96.   module ENEMY_LEVEL
  97.    
  98.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  99.     # - General Level Settings -
  100.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  101.     # These settings adjust the general level setup for your enemies from the
  102.     # way levels appear in the game to the default maximum level for enemies,
  103.     # to the way their levels are calculated by default, and the random level
  104.     # fluctuation they have. If you want enemies to have different settings,
  105.     # use notetags to change the respective setting.
  106.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  107.     # This is how the level text will appear whenever enemy levels are shown.
  108.     LEVEL_TEXT = "LV%s %s"
  109.    
  110.     # This is the maximum level your enemies can achieve. They cannot go higher
  111.     # no exceptions. Adjust this accordingly to fit your game.
  112.     MAX_LEVEL = 9999
  113.    
  114.     # Default level calculations for your enemies will be adjusted as such.
  115.     # Type 0 - Lowest level of all actors that have joined.
  116.     # Type 1 - Lowest level in the battle party.
  117.     # Type 2 - Average level of the battle party.
  118.     # Type 3 - Highest level of the battle party.
  119.     # Type 4 - Highest level of all actors that have joined.
  120.     DEFAULT_LEVEL_TYPE = 2
  121.    
  122.     # If you want your enemies to have random +/- levels of some degree, change
  123.     # this number to something other than 0. This is the default value.
  124.     RANDOM_FLUCTUATION = 2
  125.    
  126.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  127.     # - Parameter Growth Settings -
  128.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  129.     # Here, you adjust how much stats grow for enemies by default, including
  130.     # the formula used to calculate those stats. If you wish for enemies to
  131.     # have different growth settings, use notetags to change them.
  132.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  133.     # These settings adjust the default growth rates (not the base stat formula)
  134.     # for each stat. These are the values that will exist for each enemy unless
  135.     # defined otherwise by the tags inside their noteboxes.
  136.     DEFAULT_GROWTH ={
  137.     # ParamID => [:param, per%, +set],
  138.             0 => [:maxhp, 0.20,   0],
  139.             1 => [:maxmp, 0.20,   0],
  140.             2 => [  :atk, 0.20,    0],
  141.             3 => [  :def, 0.20,    0],
  142.             4 => [  :mat, 0.20,    0],
  143.             5 => [  :mdf, 0.20,    0],
  144.             6 => [  :agi, 0.20,    0],
  145.             7 => [  :luk, 0.20,    0],
  146.             8 => [ :gold, 0.00,   0],
  147.             9 => [  :exp, 1.25,   0],
  148.     } # Do not remove this.
  149.    
  150.     # The following hash will adjust each of the formulas for each base stat.
  151.     # Adjust them as you see fit but only if you know what you're doing.
  152.     #   base  - The base stat from the enemy database.
  153.     #   per   - Growth rate which has not been yet converted to a percent.
  154.     #   set   - Set growth rate. Modified
  155.     # Default:   "base * (1.00 + (level-1) * per) + (set * (level-1))"
  156.     STAT_FORMULA = "base * (1.00 + (level-1) * per) + (set * (level-1))"
  157.    
  158.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  159.     # - Party Level to Enemy Level Action Conditions -
  160.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  161.     # Setting the below to true will cause the Party Level requirement under
  162.     # Action Conditions in the Action Patterns list to become an Enemy Level
  163.     # requirement. The enemy must be at least the level or else it cannot use
  164.     # the listed action.
  165.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  166.     PARTY_LEVEL_TO_ENEMY_LEVEL = true
  167.    
  168.   end # ENEMY_LEVEL
  169. end # YEA

  170. #==============================================================================
  171. # ▼ Editting anything past this point may potentially result in causing
  172. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  173. # halitosis so edit at your own risk.
  174. #==============================================================================

  175. module YEA
  176.   module REGEXP
  177.   module USABLEITEM
  178.    
  179.     LEVEL_CHANGE = /<(?:ENEMY LEVEL|enemy level):[ ]([\+\-]\d+)>/i
  180.     LEVEL_RESET  = /<(?:ENEMY LEVEL RESET|enemy level reset)>/i
  181.    
  182.   end # USABLEITEM
  183.   module ENEMY
  184.    
  185.     LEVEL_TYPE = /<(?:LEVEL_TYPE|level type):[ ](\d+)>/i
  186.     LEVEL_MIN = /<(?:MIN_LEVEL|min level|minimum level):[ ](\d+)>/i
  187.     LEVEL_MAX = /<(?:MAX_LEVEL|max level|maximum level):[ ](\d+)>/i
  188.     LEVEL_SET = /<(?:SET_LEVEL|set level|permanent level):[ ](\d+)>/i
  189.    
  190.     LEVEL_RAND = /<(?:LEVEL_RANDOM|level random):[ ](\d+)>/i
  191.     GROWTH_PER = /<(.*):[ ]([\+\-]\d+)([%%])[ ](?:PER_LEVEL|per level)>/i
  192.     GROWTH_SET = /<(.*):[ ]([\+\-]\d+)[ ](?:PER_LEVEL|per level)>/i
  193.    
  194.     HIDE_LEVEL = /<(?:HIDE_LEVEL|hide level)>/i
  195.       
  196.   end # ENEMY
  197.   end # REGEXP
  198. end # YEA

  199. #==============================================================================
  200. # ■ Numeric
  201. #==============================================================================

  202. class Numeric
  203.   
  204.   #--------------------------------------------------------------------------
  205.   # new method: group_digits
  206.   #--------------------------------------------------------------------------
  207.   unless $imported["YEA-CoreEngine"]
  208.   def group; return self.to_s; end
  209.   end # $imported["YEA-CoreEngine"]
  210.    
  211. end # Numeric

  212. #==============================================================================
  213. # ■ DataManager
  214. #==============================================================================

  215. module DataManager
  216.   
  217.   #--------------------------------------------------------------------------
  218.   # alias method: load_database
  219.   #--------------------------------------------------------------------------
  220.   class <<self; alias load_database_elv load_database; end
  221.   def self.load_database
  222.     load_database_elv
  223.     load_notetags_elv
  224.   end
  225.   
  226.   #--------------------------------------------------------------------------
  227.   # new method: load_notetags_elv
  228.   #--------------------------------------------------------------------------
  229.   def self.load_notetags_elv
  230.     groups = [$data_enemies, $data_skills, $data_items]
  231.     for group in groups
  232.       for obj in group
  233.         next if obj.nil?
  234.         obj.load_notetags_elv
  235.       end
  236.     end
  237.   end
  238.   
  239. end # DataManager

  240. #==============================================================================
  241. # ■ RPG::UsableItem
  242. #==============================================================================

  243. class RPG::UsableItem < RPG::BaseItem
  244.   
  245.   #--------------------------------------------------------------------------
  246.   # public instance variables
  247.   #--------------------------------------------------------------------------
  248.   attr_accessor :level_change
  249.   attr_accessor :level_reset
  250.   
  251.   #--------------------------------------------------------------------------
  252.   # common cache: load_notetags_elv
  253.   #--------------------------------------------------------------------------
  254.   def load_notetags_elv
  255.     @level_change = 0
  256.     @level_reset = false
  257.     #---
  258.     self.note.split(/[\r\n]+/).each { |line|
  259.       case line
  260.       #---
  261.       when YEA::REGEXP::USABLEITEM::LEVEL_CHANGE
  262.         @level_change = $1.to_i
  263.       when YEA::REGEXP::USABLEITEM::LEVEL_RESET
  264.         @level_reset = true
  265.       end
  266.     } # self.note.split
  267.     #---
  268.   end
  269.   
  270. end # RPG::UsableItem

  271. #==============================================================================
  272. # ■ RPG::Enemy
  273. #==============================================================================

  274. class RPG::Enemy < RPG::BaseItem
  275.   
  276.   #--------------------------------------------------------------------------
  277.   # public instance variables
  278.   #--------------------------------------------------------------------------
  279.   attr_accessor :hide_level
  280.   attr_accessor :level_type
  281.   attr_accessor :level_min
  282.   attr_accessor :level_max
  283.   attr_accessor :level_rand
  284.   attr_accessor :level_growth
  285.   
  286.   #--------------------------------------------------------------------------
  287.   # common cache: load_notetags_elv
  288.   #--------------------------------------------------------------------------
  289.   def load_notetags_elv
  290.     @hide_level = false
  291.     @level_type = YEA::ENEMY_LEVEL::DEFAULT_LEVEL_TYPE
  292.     @level_min = 1
  293.     @level_max = YEA::ENEMY_LEVEL::MAX_LEVEL
  294.     @level_rand = YEA::ENEMY_LEVEL::RANDOM_FLUCTUATION
  295.     @level_growth = YEA::ENEMY_LEVEL::DEFAULT_GROWTH.clone
  296.     #---
  297.     self.note.split(/[\r\n]+/).each { |line|
  298.       case line
  299.       #---
  300.       when YEA::REGEXP::ENEMY::HIDE_LEVEL
  301.         @hide_level = true
  302.       when YEA::REGEXP::ENEMY::LEVEL_TYPE
  303.         @level_type = $1.to_i
  304.       when YEA::REGEXP::ENEMY::LEVEL_MIN
  305.         @level_min = [$1.to_i, 1].max
  306.       when YEA::REGEXP::ENEMY::LEVEL_MAX
  307.         @level_max = [$1.to_i, YEA::ENEMY_LEVEL::MAX_LEVEL].min
  308.       when YEA::REGEXP::ENEMY::LEVEL_SET
  309.         @level_min = [[$1.to_i, 1].max, YEA::ENEMY_LEVEL::MAX_LEVEL].min
  310.         @level_max = [[$1.to_i, 1].max, YEA::ENEMY_LEVEL::MAX_LEVEL].min
  311.       when YEA::REGEXP::ENEMY::LEVEL_RAND
  312.         @level_rand = $1.to_i
  313.       #---
  314.       when YEA::REGEXP::ENEMY::GROWTH_PER
  315.         case $1.upcase
  316.         when "MAXHP", "MHP", "HP"
  317.           type = 0
  318.         when "MAXMP", "MMP", "MP", "MAXSP", "MSP", "SP"
  319.           type = 1
  320.         when "ATK", "ATTACK"
  321.           type = 2
  322.         when "DEF", "DEFENSE"
  323.           type = 3
  324.         when "MAT", "MAGIC ATTACK", "INT", "INTELLIGENCE", "SPI", "SPIRIT"
  325.           type = 4
  326.         when "MDF", "MAGIC DEFENSE", "RES", "RESISTANCE"
  327.           type = 5
  328.         when "AGI", "AGILITY"
  329.           type = 6
  330.         when "LUK", "LUCK"
  331.           type = 7
  332.         when "GOLD", "MONEY"
  333.           type = 8
  334.         when "EXP", "EXPERIENCE", "XP"
  335.           type = 9
  336.         else; next
  337.         end
  338.         @level_growth[type][1] = $2.to_i * 0.01
  339.       when YEA::REGEXP::ENEMY::GROWTH_SET
  340.         case $1.upcase
  341.         when "MAXHP", "MHP", "HP"
  342.           type = 0
  343.         when "MAXMP", "MMP", "MP", "MAXSP", "MSP", "SP"
  344.           type = 1
  345.         when "ATK", "ATTACK"
  346.           type = 2
  347.         when "DEF", "DEFENSE"
  348.           type = 3
  349.         when "MAT", "MAGIC ATTACK", "INT", "INTELLIGENCE", "SPI", "SPIRIT"
  350.           type = 4
  351.         when "MDF", "MAGIC DEFENSE", "RES", "RESISTANCE"
  352.           type = 5
  353.         when "AGI", "AGILITY"
  354.           type = 6
  355.         when "LUK", "LUCK"
  356.           type = 7
  357.         when "GOLD", "MONEY"
  358.           type = 8
  359.         when "EXP", "EXPERIENCE", "XP"
  360.           type = 9
  361.         else; next
  362.         end
  363.         @level_growth[type][2] = $2.to_i
  364.       end
  365.     } # self.note.split
  366.     #---
  367.   end
  368.   
  369. end # RPG::Enemy

  370. #==============================================================================
  371. # ■ Game_Battler
  372. #==============================================================================

  373. class Game_Battler < Game_BattlerBase
  374.   
  375.   #--------------------------------------------------------------------------
  376.   # alias method: item_user_effect
  377.   #--------------------------------------------------------------------------
  378.   alias game_battler_item_user_effect_elv item_user_effect
  379.   def item_user_effect(user, item)
  380.     game_battler_item_user_effect_elv(user, item)
  381.     apply_level_changes(item) if self.is_a?(Game_Enemy)
  382.   end
  383.   
  384. end # Game_Battler

  385. #==============================================================================
  386. # ■ Game_Enemy
  387. #==============================================================================

  388. class Game_Enemy < Game_Battler
  389.   
  390.   #--------------------------------------------------------------------------
  391.   # alias method: initialize
  392.   #--------------------------------------------------------------------------
  393.   alias game_enemy_initialize_elv initialize
  394.   def initialize(index, enemy_id)
  395.     game_enemy_initialize_elv(index, enemy_id)
  396.     create_init_level
  397.   end
  398.   
  399.   #--------------------------------------------------------------------------
  400.   # new method: level
  401.   #--------------------------------------------------------------------------
  402.   def level
  403.     create_init_level if @level.nil?
  404.     return @level
  405.   end
  406.   
  407.   #--------------------------------------------------------------------------
  408.   # new method: level=
  409.   #--------------------------------------------------------------------------
  410.   def level=(value)
  411.     create_init_level if @level.nil?
  412.     return if @level == value
  413.     hp_rate = self.hp.to_f / self.mhp.to_f
  414.     mp_rate = self.mp.to_f / [self.mmp, 1].max.to_f
  415.     @level = [[value, 1].max, YEA::ENEMY_LEVEL::MAX_LEVEL].min
  416.     self.hp = (self.mhp * hp_rate).to_i
  417.     self.mp = (self.mmp * mp_rate).to_i
  418.   end
  419.   
  420.   #--------------------------------------------------------------------------
  421.   # new method: create_init_level
  422.   #--------------------------------------------------------------------------
  423.   def create_init_level
  424.     set_level_type
  425.     @hp = mhp
  426.     @mp = mmp
  427.   end
  428.   
  429.   #--------------------------------------------------------------------------
  430.   # new method: set_level_type
  431.   #--------------------------------------------------------------------------
  432.   def set_level_type
  433.     @level = $game_party.match_party_level(enemy.level_type)
  434.     @level += rand(enemy.level_rand+1)
  435.     @level -= rand(enemy.level_rand+1)
  436.     @level = [[@level, enemy.level_max].min, enemy.level_min].max
  437.   end
  438.   
  439.   #--------------------------------------------------------------------------
  440.   # alias method: transform
  441.   #--------------------------------------------------------------------------
  442.   alias game_enemy_transform_elv transform
  443.   def transform(enemy_id)
  444.     game_enemy_transform_elv(enemy_id)
  445.     create_init_level
  446.   end
  447.   
  448.   #--------------------------------------------------------------------------
  449.   # new method: apply_level_changes
  450.   #--------------------------------------------------------------------------
  451.   def apply_level_changes(item)
  452.     create_init_level if item.level_reset
  453.     self.level += item.level_change
  454.   end
  455.   
  456.   #--------------------------------------------------------------------------
  457.   # alias method: param_base
  458.   #--------------------------------------------------------------------------
  459.   alias game_enemy_param_base_elv param_base
  460.   def param_base(param_id)
  461.     base = game_enemy_param_base_elv(param_id)
  462.     per = enemy.level_growth[param_id][1]
  463.     set = enemy.level_growth[param_id][2]
  464.     total = eval(YEA::ENEMY_LEVEL::STAT_FORMULA)
  465.     return total.to_i
  466.   end
  467.   
  468.   #--------------------------------------------------------------------------
  469.   # alias method: exp
  470.   #--------------------------------------------------------------------------
  471.   alias game_enemy_exp_elv exp
  472.   def exp
  473.     base = game_enemy_exp_elv
  474.     per = enemy.level_growth[8][1]
  475.     set = enemy.level_growth[8][2]
  476.     total = eval(YEA::ENEMY_LEVEL::STAT_FORMULA)
  477.     return total.to_i
  478.   end
  479.   
  480.   #--------------------------------------------------------------------------
  481.   # alias method: gold
  482.   #--------------------------------------------------------------------------
  483.   alias game_enemy_gold_elv gold
  484.   def gold
  485.     base = game_enemy_gold_elv
  486.     per = enemy.level_growth[9][1]
  487.     set = enemy.level_growth[9][2]
  488.     total = eval(YEA::ENEMY_LEVEL::STAT_FORMULA)
  489.     return total.to_i
  490.   end
  491.   
  492.   #--------------------------------------------------------------------------
  493.   # alias method: name
  494.   #--------------------------------------------------------------------------
  495.   alias game_enemy_name_elv name
  496.   def name
  497.     text = game_enemy_name_elv
  498.     if add_level_name?
  499.       fmt = YEA::ENEMY_LEVEL::LEVEL_TEXT
  500.       text = sprintf(fmt, @level.group, text)
  501.     end
  502.     return text
  503.   end
  504.   
  505.   #--------------------------------------------------------------------------
  506.   # new method: add_level_name?
  507.   #--------------------------------------------------------------------------
  508.   def add_level_name?
  509. #    if $imported["YEA-EnemyTargetInfo"] && show_info_param?
  510.       return true
  511.     end
  512. #    return false if enemy.hide_level
  513. #    return true
  514.   end
  515.   
  516.   #--------------------------------------------------------------------------
  517.   # overwrite method: conditions_met_party_level?
  518.   #--------------------------------------------------------------------------
  519.   if YEA::ENEMY_LEVEL::PARTY_LEVEL_TO_ENEMY_LEVEL
  520.   def conditions_met_party_level?(param1, param2)
  521.     return @level >= param1
  522.   end
  523.   end
  524.   
  525. #end # Game_Enemy

  526. #==============================================================================
  527. # ■ Game_Party
  528. #==============================================================================

  529. class Game_Party < Game_Unit
  530.   
  531.   #--------------------------------------------------------------------------
  532.   # new method: match_party_level
  533.   #--------------------------------------------------------------------------
  534.   def match_party_level(level_type)
  535.     case level_type
  536.     when 0; return all_lowest_level
  537.     when 1; return lowest_level
  538.     when 2; return average_level
  539.     when 3; return highest_level
  540.     else;   return all_highest_level
  541.     end
  542.   end
  543.   
  544.   #--------------------------------------------------------------------------
  545.   # new method: all_lowest_level
  546.   #--------------------------------------------------------------------------
  547.   def all_lowest_level
  548.     lv = all_members.collect {|actor| actor.level }.min
  549.     return lv
  550.   end
  551.   
  552.   #--------------------------------------------------------------------------
  553.   # new method: lowest_level
  554.   #--------------------------------------------------------------------------
  555.   def lowest_level
  556.     lv = members.collect {|actor| actor.level }.min
  557.     return lv
  558.   end
  559.   
  560.   #--------------------------------------------------------------------------
  561.   # new method: average_level
  562.   #--------------------------------------------------------------------------
  563.   def average_level
  564.     lv = 0
  565.     for member in all_members; lv += member.level; end
  566.     lv /= all_members.size
  567.     return lv
  568.   end
  569.   
  570.   #--------------------------------------------------------------------------
  571.   # overwrite method: highest_level
  572.   #--------------------------------------------------------------------------
  573.   def highest_level
  574.     lv = members.collect {|actor| actor.level }.max
  575.     return lv
  576.   end
  577.   
  578.   #--------------------------------------------------------------------------
  579.   # all method: all_highest_level
  580.   #--------------------------------------------------------------------------
  581.   def all_highest_level
  582.     lv = all_members.collect {|actor| actor.level }.max
  583.     return lv
  584.   end
  585.   
  586. end # Game_Party

  587. #==============================================================================
  588. #
  589. # ▼ End of File
  590. #
  591. #==============================================================================
复制代码
有什么办法可以让提升等级的敌人得到的经验也会提升?
我用了许多办法都没有效果……
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

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

GMT+8, 2024-11-16 19:29

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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