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

Project1

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

[已经过期] 这个脚本怎么用?

[复制链接]

Lv2.观梦者

梦石
0
星屑
299
在线时间
208 小时
注册时间
2007-6-23
帖子
78
跳转到指定楼层
1
发表于 2013-6-1 18:34:56 | 只看该作者 |只看大图 回帖奖励 |正序浏览 |阅读模式

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

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

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

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

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

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

  200. #==============================================================================
  201. # ■ Numeric
  202. #==============================================================================

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

  213. #==============================================================================
  214. # ■ DataManager
  215. #==============================================================================

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

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

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

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

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

  371. #==============================================================================
  372. # ■ Game_Battler
  373. #==============================================================================

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

  386. #==============================================================================
  387. # ■ Game_Enemy
  388. #==============================================================================

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

  527. #==============================================================================
  528. # ■ Game_Party
  529. #==============================================================================

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

  588. #==============================================================================
  589. #
  590. # ▼ End of File
  591. #
  592. #==============================================================================
复制代码
我想个别设置敌人等级,应该填什么?

Lv1.梦旅人

梦石
0
星屑
50
在线时间
135 小时
注册时间
2013-6-10
帖子
29
3
发表于 2013-6-10 22:26:52 | 只看该作者
ttp://yanflychannel.wordpress.com/rmvxa/gameplay-scripts/enemy-levels/

elv-01.jpg (130.72 KB, 下载次数: 25)

elv-01.jpg

elv-02.jpg (141.56 KB, 下载次数: 25)

elv-02.jpg

elv-03.jpg (141.7 KB, 下载次数: 27)

elv-03.jpg

elv-05.jpg (130.35 KB, 下载次数: 25)

elv-05.jpg

elv-04.jpg (140.35 KB, 下载次数: 26)

elv-04.jpg

评分

参与人数 1梦石 +1 收起 理由
Sion + 1 感谢帮忙

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
73 小时
注册时间
2013-2-18
帖子
56
2
发表于 2013-6-10 16:18:23 | 只看该作者
这个脚本拿来干什么的?
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-18 14:23

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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