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

Project1

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

[已经过期] 有没有敌人等级随动的脚本没各位大佬。

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1024
在线时间
76 小时
注册时间
2020-12-11
帖子
92
跳转到指定楼层
1
发表于 2021-2-8 11:15:59 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
RT,我自己设置的敌人之后发现游戏怪物平衡太难了,所以就想把所有怪物设置成统一属性的,然后弄一个敌人的属性是根据自己伙伴的等级或是属性增长的。这样可以吗??
忍一时越想越气,退一步越想越亏~~~

Lv3.寻梦者

梦石
0
星屑
1024
在线时间
76 小时
注册时间
2020-12-11
帖子
92
2
 楼主| 发表于 2021-2-8 11:17:30 | 只看该作者
搜索过论坛里面的“敌人等级”脚本,好像和我需要的不大一样,那个是自己设置等级的吧~~~~
忍一时越想越气,退一步越想越亏~~~
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
24277
在线时间
5046 小时
注册时间
2016-3-8
帖子
1618
3
发表于 2021-2-8 13:31:08 | 只看该作者
你都搜到的哪个
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1024
在线时间
76 小时
注册时间
2020-12-11
帖子
92
4
 楼主| 发表于 2021-2-8 15:41:05 | 只看该作者


就是这几个  VA区的  我看也有问这个类似的问题的,但是没有解决方案

QQ截图20210208153932.jpg (74.16 KB, 下载次数: 28)

QQ截图20210208153932.jpg
忍一时越想越气,退一步越想越亏~~~
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
24277
在线时间
5046 小时
注册时间
2016-3-8
帖子
1618
5
发表于 2021-2-8 16:30:12 | 只看该作者
那个YEA的敌人等级不就是么
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1024
在线时间
76 小时
注册时间
2020-12-11
帖子
92
6
 楼主| 发表于 2021-2-8 20:06:10 | 只看该作者
alexncf125 发表于 2021-2-8 16:30
那个YEA的敌人等级不就是么

呃,,,这个过期了  然后自己找了一下 不清楚他的原理是怎么,大佬帮我看下这玩意对不对
RUBY 代码复制
  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.  
  10. $imported = {} if $imported.nil?
  11. $imported["YEA-EnemyLevels"] = true
  12.  
  13. #==============================================================================
  14. # ▼ Updates
  15. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  16. # 2012.01.24 - Added <hide level> notetag for enemies.
  17. #            - Option to change Party Level function in Action Conditions to
  18. #              enemy level requirements.
  19. # 2011.12.30 - Started Script and Finished.
  20. #
  21. #==============================================================================
  22. # ▼ Introduction
  23. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  24. # RPG's with enemies that level up with the party enforces the player to stay
  25. # on their toes the whole time. This is both a good and bad thing as it can
  26. # cause the player to stay alert, but can also cause the player to meet some
  27. # roadblocks. This script will not only provide enemies the ability to level up
  28. # but also allow the script's user to go around these roadblocks using various
  29. # tags to limit or slow down the rate of growth across all enemies.
  30. #
  31. #==============================================================================
  32. # ▼ Instructions
  33. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  34. # To install this script, open up your script editor and copy/paste this script
  35. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  36. #
  37. # -----------------------------------------------------------------------------
  38. # Skill Notetags - These notetags go in the skill notebox in the database.
  39. # -----------------------------------------------------------------------------
  40. # <enemy level: +x>
  41. # <enemy level: -x>
  42. # This causes the enemy to raise or drop x levels depending on the tag used.
  43. # The new level will readjust the enemy's stats (including HP and MP).
  44. #
  45. # <enemy level reset>
  46. # This resets the enemy's level back to the typical range it should be plus or
  47. # minus any level fluctuations it was given. This occurs before enemy level +
  48. # and enemy level - tags.
  49. #
  50. # -----------------------------------------------------------------------------
  51. # Enemy Notetags - These notetags go in the enemies notebox in the database.
  52. # -----------------------------------------------------------------------------
  53. # <hide level>
  54. # This notetag will hide the level of the enemy. If YEA - Enemy Target Info is
  55. # installed, the level will be revealed upon a parameter scan.
  56. #
  57. # <min level: x>
  58. # <max level: x>
  59. # This will adjust the minimum and maximum levels for the enemy. By default,
  60. # the minimum level is 1 and the maximum level is whatever is set in the module
  61. # as MAX_LEVEL.
  62. #
  63. # <set level: x>
  64. # This will set the enemy's level to exactly x. It a sense, this is just the
  65. # usage of both the min and max level tags together as the same value.
  66. #
  67. # <level type: x>
  68. # Choosing a value from 0 to 4, you can adjust the different leveling rulesets
  69. # for the enemy. See the list below.
  70. # Type 0 - Lowest level of all actors that have joined.
  71. # Type 1 - Lowest level in the battle party.
  72. # Type 2 - Average level of the battle party.
  73. # Type 3 - Highest level of the battle party.
  74. # Type 4 - Highest level of all actors that have joined.
  75. #
  76. # <level random: x>
  77. # This will give the level a random flunctuation in either direction. Set this
  78. # value to 0 if you don't wish to use it. Adjust RANDOM_FLUCTUATION inside the
  79. # module to change the default fluctuation value.
  80. #
  81. # <stat: +x per level>
  82. # <stat: -x per level>
  83. # <stat: +x% per level>
  84. # <stat: -x% per level>
  85. # This will raise or lower the stat by x or x% per level (depending on the tag
  86. # used). This will override the default growth settings found inside the module
  87. # hash called DEFAULT_GROWTH. You may replace stat with:
  88. # MAXHP, MAXMP, ATK, DEF, MAT, MDF, AGI, LUK, GOLD, EXP
  89. #
  90. #==============================================================================
  91. # ▼ Compatibility
  92. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  93. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  94. # it will run with RPG Maker VX without adjusting.
  95. #
  96. #==============================================================================
  97.  
  98. module YEA
  99.   module ENEMY_LEVEL
  100.  
  101.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  102.     # - General Level Settings -
  103.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  104.     # These settings adjust the general level setup for your enemies from the
  105.     # way levels appear in the game to the default maximum level for enemies,
  106.     # to the way their levels are calculated by default, and the random level
  107.     # fluctuation they have. If you want enemies to have different settings,
  108.     # use notetags to change the respective setting.
  109.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  110.     # This is how the level text will appear whenever enemy levels are shown.
  111.     #LEVEL_TEXT = "等级%s %s"
  112.     LEVEL_TEXT = "%s"
  113.     # This is the maximum level your enemies can achieve. They cannot go higher
  114.     # no exceptions. Adjust this accordingly to fit your game.
  115.     MAX_LEVEL = 255
  116.  
  117.     # Default level calculations for your enemies will be adjusted as such.
  118.     # Type 0 - Lowest level of all actors that have joined.
  119.     # Type 1 - Lowest level in the battle party.
  120.     # Type 2 - Average level of the battle party.
  121.     # Type 3 - Highest level of the battle party.
  122.     # Type 4 - Highest level of all actors that have joined.
  123.     DEFAULT_LEVEL_TYPE = 3
  124.  
  125.     # If you want your enemies to have random +/- levels of some degree, change
  126.     # this number to something other than 0. This is the default value.
  127.     RANDOM_FLUCTUATION = 5
  128.  
  129.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  130.     # - Parameter Growth Settings -
  131.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  132.     # Here, you adjust how much stats grow for enemies by default, including
  133.     # the formula used to calculate those stats. If you wish for enemies to
  134.     # have different growth settings, use notetags to change them.
  135.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  136.     # These settings adjust the default growth rates (not the base stat formula)
  137.     # for each stat. These are the values that will exist for each enemy unless
  138.     # defined otherwise by the tags inside their noteboxes.
  139.     DEFAULT_GROWTH ={
  140.     # ParamID => [:param, per%, +set],
  141.             #0 => [:maxhp, 0.50,   500],
  142.            # 1 => [:maxmp, 0.10,   10],
  143.           #  2 => [  :atk, 0.05,    5],
  144.           #  3 => [  :def, 0.05,    5],
  145.           #  4 => [  :mat, 0.05,    5],
  146.           #  5 => [  :mdf, 0.05,    5],
  147.           #  6 => [  :agi, 0.05,    5],
  148.           #  7 => [  :luk, 0.05,    5],
  149.           #  8 => [ :gold, 0.15,   10],
  150.           #  9 => [  :exp, 0.05,   10],
  151.             0 => [:maxhp, 0.5,   100],  #0.5, 200
  152.             1 => [:maxmp, 0.05,   10],
  153.             2 => [  :atk, 0.1,     0],  #0.07, 1
  154.             3 => [  :def, 0.05,  0.5],  #0.5
  155.             4 => [  :mat, 0.07,    1],
  156.             5 => [  :mdf, 0.05,  0.5],  #0.5
  157.             6 => [  :agi, 0.05,    0],
  158.             7 => [  :luk, 0.05,    1],
  159.             8 => [ :gold, 0.15,   2],
  160.             9 => [  :exp, 0.05,   2],
  161.     } # Do not remove this.
  162.  
  163.     # The following hash will adjust each of the formulas for each base stat.
  164.     # Adjust them as you see fit but only if you know what you're doing.
  165.     #   base  - The base stat from the enemy database.
  166.     #   per   - Growth rate which has not been yet converted to a percent.
  167.     #   set   - Set growth rate. Modified
  168.     # Default:   "base * (1.00 + (level-1) * per) + (set * (level-1))"
  169.     #STAT_FORMULA = "base + (1.00 + (level-1) * per) + (set + (level-1))"
  170.      STAT_FORMULA = "base + (1.00 + (level-1) * per) + (set * (level-1))"
  171.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  172.     # - Party Level to Enemy Level Action Conditions -
  173.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  174.     # Setting the below to true will cause the Party Level requirement under
  175.     # Action Conditions in the Action Patterns list to become an Enemy Level
  176.     # requirement. The enemy must be at least the level or else it cannot use
  177.     # the listed action.
  178.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  179.     PARTY_LEVEL_TO_ENEMY_LEVEL = true
  180.  
  181.   end # ENEMY_LEVEL
  182. end # YEA
  183.  
  184. #==============================================================================
  185. # ▼ Editting anything past this point may potentially result in causing
  186. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  187. # halitosis so edit at your own risk.
  188. #==============================================================================
  189.  
  190. module YEA
  191.   module REGEXP
  192.   module USABLEITEM
  193.  
  194.     LEVEL_CHANGE = /<(?:ENEMY LEVEL|enemy level):[ ]([\+\-]\d+)>/i
  195.     LEVEL_RESET  = /<(?:ENEMY LEVEL RESET|enemy level reset)>/i
  196.  
  197.   end # USABLEITEM
  198.   module ENEMY
  199.  
  200.     LEVEL_TYPE = /<(?:LEVEL_TYPE|level type):[ ](\d+)>/i
  201.     LEVEL_MIN = /<(?:MIN_LEVEL|min level|minimum level):[ ](\d+)>/i
  202.     LEVEL_MAX = /<(?:MAX_LEVEL|max level|maximum level):[ ](\d+)>/i
  203.     LEVEL_SET = /<(?:SET_LEVEL|set level|permanent level):[ ](\d+)>/i
  204.  
  205.     LEVEL_RAND = /<(?:LEVEL_RANDOM|level random):[ ](\d+)>/i
  206.     GROWTH_PER = /<(.*):[ ]([\+\-]\d+)([%%])[ ](?:PER_LEVEL|per level)>/i
  207.     GROWTH_SET = /<(.*):[ ]([\+\-]\d+)[ ](?:PER_LEVEL|per level)>/i
  208.  
  209.     HIDE_LEVEL = /<(?:HIDE_LEVEL|hide level)>/i
  210.  
  211.   end # ENEMY
  212.   end # REGEXP
  213. end # YEA
  214.  
  215. #==============================================================================
  216. # ■ Numeric
  217. #==============================================================================
  218.  
  219. class Numeric
  220.  
  221.   #--------------------------------------------------------------------------
  222.   # new method: group_digits
  223.   #--------------------------------------------------------------------------
  224.   unless $imported["YEA-CoreEngine"]
  225.   def group; return self.to_s; end
  226.   end # $imported["YEA-CoreEngine"]
  227.  
  228. end # Numeric
  229.  
  230. #==============================================================================
  231. # ■ DataManager
  232. #==============================================================================
  233.  
  234. module DataManager
  235.  
  236.   #--------------------------------------------------------------------------
  237.   # alias method: load_database
  238.   #--------------------------------------------------------------------------
  239.   class <<self; alias load_database_elv load_database; end
  240.   def self.load_database
  241.     load_database_elv
  242.     load_notetags_elv
  243.   end
  244.  
  245.   #--------------------------------------------------------------------------
  246.   # new method: load_notetags_elv
  247.   #--------------------------------------------------------------------------
  248.   def self.load_notetags_elv
  249.     groups = [$data_enemies, $data_skills, $data_items]
  250.     for group in groups
  251.       for obj in group
  252.         next if obj.nil?
  253.         obj.load_notetags_elv
  254.       end
  255.     end
  256.   end
  257.  
  258. end # DataManager
  259.  
  260. #==============================================================================
  261. # ■ RPG::UsableItem
  262. #==============================================================================
  263.  
  264. class RPG::UsableItem < RPG::BaseItem
  265.  
  266.   #--------------------------------------------------------------------------
  267.   # public instance variables
  268.   #--------------------------------------------------------------------------
  269.   attr_accessor :level_change
  270.   attr_accessor :level_reset
  271.  
  272.   #--------------------------------------------------------------------------
  273.   # common cache: load_notetags_elv
  274.   #--------------------------------------------------------------------------
  275.   def load_notetags_elv
  276.     @level_change = 0
  277.     @level_reset = false
  278.     #---
  279.     self.note.split(/[\r\n]+/).each { |line|
  280.       case line
  281.       #---
  282.       when YEA::REGEXP::USABLEITEM::LEVEL_CHANGE
  283.         @level_change = $1.to_i
  284.       when YEA::REGEXP::USABLEITEM::LEVEL_RESET
  285.         @level_reset = true
  286.       end
  287.     } # self.note.split
  288.     #---
  289.   end
  290.  
  291. end # RPG::UsableItem
  292.  
  293. #==============================================================================
  294. # ■ RPG::Enemy
  295. #==============================================================================
  296.  
  297. class RPG::Enemy < RPG::BaseItem
  298.  
  299.   #--------------------------------------------------------------------------
  300.   # public instance variables
  301.   #--------------------------------------------------------------------------
  302.   attr_accessor :hide_level
  303.   attr_accessor :level_type
  304.   attr_accessor :level_min
  305.   attr_accessor :level_max
  306.   attr_accessor :level_rand
  307.   attr_accessor :level_growth
  308.  
  309.   #--------------------------------------------------------------------------
  310.   # common cache: load_notetags_elv
  311.   #--------------------------------------------------------------------------
  312.   def load_notetags_elv
  313.     @hide_level = false
  314.     @level_type = YEA::ENEMY_LEVEL::DEFAULT_LEVEL_TYPE
  315.     @level_min = 1
  316.     @level_max = YEA::ENEMY_LEVEL::MAX_LEVEL
  317.     @level_rand = YEA::ENEMY_LEVEL::RANDOM_FLUCTUATION
  318.     @level_growth = YEA::ENEMY_LEVEL::DEFAULT_GROWTH.clone
  319.     #---
  320.     self.note.split(/[\r\n]+/).each { |line|
  321.       case line
  322.       #---
  323.       when YEA::REGEXP::ENEMY::HIDE_LEVEL
  324.         @hide_level = true
  325.       when YEA::REGEXP::ENEMY::LEVEL_TYPE
  326.         @level_type = $1.to_i
  327.       when YEA::REGEXP::ENEMY::LEVEL_MIN
  328.         @level_min = [$1.to_i, 1].max
  329.       when YEA::REGEXP::ENEMY::LEVEL_MAX
  330.         @level_max = [$1.to_i, YEA::ENEMY_LEVEL::MAX_LEVEL].min
  331.       when YEA::REGEXP::ENEMY::LEVEL_SET
  332.         @level_min = [[$1.to_i, 1].max, YEA::ENEMY_LEVEL::MAX_LEVEL].min
  333.         @level_max = [[$1.to_i, 1].max, YEA::ENEMY_LEVEL::MAX_LEVEL].min
  334.       when YEA::REGEXP::ENEMY::LEVEL_RAND
  335.         @level_rand = $1.to_i
  336.       #---
  337.       when YEA::REGEXP::ENEMY::GROWTH_PER
  338.         case $1.upcase
  339.         when "MAXHP", "MHP", "HP"
  340.           type = 0
  341.         when "MAXMP", "MMP", "MP", "MAXSP", "MSP", "SP"
  342.           type = 1
  343.         when "ATK", "ATTACK"
  344.           type = 2
  345.         when "DEF", "DEFENSE"
  346.           type = 3
  347.         when "MAT", "MAGIC ATTACK", "INT", "INTELLIGENCE", "SPI", "SPIRIT"
  348.           type = 4
  349.         when "MDF", "MAGIC DEFENSE", "RES", "RESISTANCE"
  350.           type = 5
  351.         when "AGI", "AGILITY"
  352.           type = 6
  353.         when "LUK", "LUCK"
  354.           type = 7
  355.         when "GOLD", "MONEY"
  356.           type = 8
  357.         when "EXP", "EXPERIENCE", "XP"
  358.           type = 9
  359.         else; next
  360.         end
  361.         @level_growth[type][1] = $2.to_i * 0.01
  362.       when YEA::REGEXP::ENEMY::GROWTH_SET
  363.         case $1.upcase
  364.         when "MAXHP", "MHP", "HP"
  365.           type = 0
  366.         when "MAXMP", "MMP", "MP", "MAXSP", "MSP", "SP"
  367.           type = 1
  368.         when "ATK", "ATTACK"
  369.           type = 2
  370.         when "DEF", "DEFENSE"
  371.           type = 3
  372.         when "MAT", "MAGIC ATTACK", "INT", "INTELLIGENCE", "SPI", "SPIRIT"
  373.           type = 4
  374.         when "MDF", "MAGIC DEFENSE", "RES", "RESISTANCE"
  375.           type = 5
  376.         when "AGI", "AGILITY"
  377.           type = 6
  378.         when "LUK", "LUCK"
  379.           type = 7
  380.         when "GOLD", "MONEY"
  381.           type = 8
  382.         when "EXP", "EXPERIENCE", "XP"
  383.           type = 9
  384.         else; next
  385.         end
  386.         @level_growth[type][2] = $2.to_i
  387.       end
  388.     } # self.note.split
  389.     #---
  390.   end
  391.  
  392. end # RPG::Enemy
  393.  
  394. #==============================================================================
  395. # ■ Game_Battler
  396. #==============================================================================
  397.  
  398. class Game_Battler < Game_BattlerBase
  399.  
  400.   #--------------------------------------------------------------------------
  401.   # alias method: item_user_effect
  402.   #--------------------------------------------------------------------------
  403.   alias game_battler_item_user_effect_elv item_user_effect
  404.   def item_user_effect(user, item)
  405.     game_battler_item_user_effect_elv(user, item)
  406.     apply_level_changes(item) if self.is_a?(Game_Enemy)
  407.   end
  408.  
  409. end # Game_Battler
  410.  
  411. #==============================================================================
  412. # ■ Game_Enemy
  413. #==============================================================================
  414.  
  415. class Game_Enemy < Game_Battler
  416.  
  417.   #--------------------------------------------------------------------------
  418.   # alias method: initialize
  419.   #--------------------------------------------------------------------------
  420.   alias game_enemy_initialize_elv initialize
  421.   def initialize(index, enemy_id)
  422.     game_enemy_initialize_elv(index, enemy_id)
  423.     create_init_level
  424.   end
  425.  
  426.   #--------------------------------------------------------------------------
  427.   # new method: level
  428.   #--------------------------------------------------------------------------
  429.   def level
  430.     create_init_level if @level.nil?
  431.     return @level
  432.   end
  433.  
  434.   #--------------------------------------------------------------------------
  435.   # new method: level=
  436.   #--------------------------------------------------------------------------
  437.   def level=(value)
  438.     create_init_level if @level.nil?
  439.     return if @level == value
  440.     hp_rate = self.hp.to_f / self.mhp.to_f
  441.     mp_rate = self.mp.to_f / [self.mmp, 1].max.to_f
  442.     @level = [[value, 1].max, YEA::ENEMY_LEVEL::MAX_LEVEL].min
  443.     self.hp = (self.mhp * hp_rate).to_i
  444.     self.mp = (self.mmp * mp_rate).to_i
  445.   end
  446.  
  447.   #--------------------------------------------------------------------------
  448.   # new method: create_init_level
  449.   #--------------------------------------------------------------------------
  450.   def create_init_level
  451.     set_level_type
  452.     @hp = mhp
  453.     @mp = mmp
  454.   end
  455.  
  456.   #--------------------------------------------------------------------------
  457.   # new method: set_level_type
  458.   #--------------------------------------------------------------------------
  459.   def set_level_type
  460.     @level = $game_party.match_party_level(enemy.level_type)
  461.     @level += rand(enemy.level_rand+1)
  462.     @level -= rand(enemy.level_rand+1)
  463.     @level = [[@level, enemy.level_max].min, enemy.level_min].max
  464.   end
  465.  
  466.   #--------------------------------------------------------------------------
  467.   # alias method: transform
  468.   #--------------------------------------------------------------------------
  469.   alias game_enemy_transform_elv transform
  470.   def transform(enemy_id)
  471.     game_enemy_transform_elv(enemy_id)
  472.     create_init_level
  473.   end
  474.  
  475.   #--------------------------------------------------------------------------
  476.   # new method: apply_level_changes
  477.   #--------------------------------------------------------------------------
  478.   def apply_level_changes(item)
  479.     create_init_level if item.level_reset
  480.     self.level += item.level_change
  481.   end
  482.  
  483.   #--------------------------------------------------------------------------
  484.   # alias method: param_base
  485.   #--------------------------------------------------------------------------
  486.   alias game_enemy_param_base_elv param_base
  487.   def param_base(param_id)
  488.     base = game_enemy_param_base_elv(param_id)
  489.     per = enemy.level_growth[param_id][1]
  490.     set = enemy.level_growth[param_id][2]
  491.     total = eval(YEA::ENEMY_LEVEL::STAT_FORMULA)
  492.     return total.to_i
  493.   end
  494.  
  495.   #--------------------------------------------------------------------------
  496.   # alias method: exp
  497.   #--------------------------------------------------------------------------
  498.   alias game_enemy_exp_elv exp
  499.   def exp
  500.     base = game_enemy_exp_elv
  501.     per = enemy.level_growth[8][1]
  502.     set = enemy.level_growth[8][2]
  503.     total = eval(YEA::ENEMY_LEVEL::STAT_FORMULA)
  504.     return total.to_i
  505.   end
  506.  
  507.   #--------------------------------------------------------------------------
  508.   # alias method: gold
  509.   #--------------------------------------------------------------------------
  510.   alias game_enemy_gold_elv gold
  511.   def gold
  512.     base = game_enemy_gold_elv
  513.     per = enemy.level_growth[9][1]
  514.     set = enemy.level_growth[9][2]
  515.     total = eval(YEA::ENEMY_LEVEL::STAT_FORMULA)
  516.     return total.to_i
  517.   end
  518.  
  519.   #--------------------------------------------------------------------------
  520.   # alias method: name
  521.   #--------------------------------------------------------------------------
  522.   alias game_enemy_name_elv name
  523.   def name
  524.     text = game_enemy_name_elv
  525.     if add_level_name?
  526.       fmt = YEA::ENEMY_LEVEL::LEVEL_TEXT
  527.       #text = sprintf(fmt, @level.group, text)
  528.       text = sprintf(fmt, text)
  529.     end
  530.     return text
  531.   end
  532.  
  533.   #--------------------------------------------------------------------------
  534.   # new method: add_level_name?
  535.   #--------------------------------------------------------------------------
  536.   def add_level_name?
  537.     if $imported["YEA-EnemyTargetInfo"] && show_info_param?
  538.       return true
  539.     end
  540.     return false if enemy.hide_level
  541.     return true
  542.   end
  543.  
  544.   #--------------------------------------------------------------------------
  545.   # overwrite method: conditions_met_party_level?
  546.   #--------------------------------------------------------------------------
  547.   if YEA::ENEMY_LEVEL::PARTY_LEVEL_TO_ENEMY_LEVEL
  548.   def conditions_met_party_level?(param1, param2)
  549.     return @level >= param1
  550.   end
  551.   end
  552.  
  553. end # Game_Enemy
  554.  
  555. #==============================================================================
  556. # ■ Game_Party
  557. #==============================================================================
  558.  
  559. class Game_Party < Game_Unit
  560.  
  561.   #--------------------------------------------------------------------------
  562.   # new method: match_party_level
  563.   #--------------------------------------------------------------------------
  564.   def match_party_level(level_type)
  565.     case level_type
  566.     when 0; return all_lowest_level
  567.     when 1; return lowest_level
  568.     when 2; return average_level
  569.     when 3; return highest_level
  570.     else;   return all_highest_level
  571.     end
  572.   end
  573.  
  574.   #--------------------------------------------------------------------------
  575.   # new method: all_lowest_level
  576.   #--------------------------------------------------------------------------
  577.   def all_lowest_level
  578.     lv = all_members.collect {|actor| actor.level }.min
  579.     return lv
  580.   end
  581.  
  582.   #--------------------------------------------------------------------------
  583.   # new method: lowest_level
  584.   #--------------------------------------------------------------------------
  585.   def lowest_level
  586.     lv = members.collect {|actor| actor.level }.min
  587.     return lv
  588.   end
  589.  
  590.   #--------------------------------------------------------------------------
  591.   # new method: average_level
  592.   #--------------------------------------------------------------------------
  593.   def average_level
  594.     lv = 0
  595.     for member in all_members; lv += member.level; end
  596.     lv /= all_members.size
  597.     return lv
  598.   end
  599.  
  600.   #--------------------------------------------------------------------------
  601.   # overwrite method: highest_level
  602.   #--------------------------------------------------------------------------
  603.   def highest_level
  604.     lv = members.collect {|actor| actor.level }.max
  605.     return lv
  606.   end
  607.  
  608.   #--------------------------------------------------------------------------
  609.   # all method: all_highest_level
  610.   #--------------------------------------------------------------------------
  611.   def all_highest_level
  612.     lv = all_members.collect {|actor| actor.level }.max
  613.     return lv
  614.   end
  615.  
  616. end # Game_Party
  617.  
  618. #==============================================================================
  619. #
  620. # ▼ End of File
  621. #
  622. #==============================================================================

QQ截图20210208200155.png (237.03 KB, 下载次数: 29)

QQ截图20210208200155.png
忍一时越想越气,退一步越想越亏~~~
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
24277
在线时间
5046 小时
注册时间
2016-3-8
帖子
1618
7
发表于 2021-2-8 20:24:38 | 只看该作者
本帖最后由 alexncf125 于 2021-2-8 20:30 编辑

不用管什么过期不过期的...

原理??你是想要懂什么原理...
看不懂那些英文说明的话, 烦请自行去机翻...

不过我看了一下, 好像是即插即用的,
可以在设定部分(module)改一下参数达致不同效果

要在技能公式获取敌人等级的话, 应该也可以用 a.level / b.level 来获取
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1024
在线时间
76 小时
注册时间
2020-12-11
帖子
92
8
 楼主| 发表于 2021-2-8 21:31:50 | 只看该作者
alexncf125 发表于 2021-2-8 20:24
不用管什么过期不过期的...

原理??你是想要懂什么原理...

根据脚本第67行至第74行的提示,我在数据中把敌人备注加上<level type:3>  是不是就代表着怪物属性会随着我人物队伍最高角色来定义属性?是不是这样解释的大佬?
忍一时越想越气,退一步越想越亏~~~
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
24277
在线时间
5046 小时
注册时间
2016-3-8
帖子
1618
9
发表于 2021-2-8 21:53:44 | 只看该作者
不太正确...
应该说...敌人的等级会随着 "我人物队伍最高角色 & RANDOM_FLUCTUATION" 来定义...
敌人的属性再随 "敌人等级 & DEFAULT_GROWTH & STAT_FORMULA" 来定义

另外...根据脚本第123行显示, level type的预设值经已是3了
所以除非你改了预设值, 否则你这个<level type:3>加不加也一样
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1024
在线时间
76 小时
注册时间
2020-12-11
帖子
92
10
 楼主| 发表于 2021-2-8 23:15:47 | 只看该作者
alexncf125 发表于 2021-2-8 21:53
不太正确...
应该说...敌人的等级会随着 "我人物队伍最高角色 & RANDOM_FLUCTUATION" 来定义...
敌人的属性 ...

我不明白脚本,我就直接把这个复制到脚本里 随便插个地方就行了吧,数据库不用写备注
忍一时越想越气,退一步越想越亏~~~
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-25 21:00

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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