设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 121|回复: 0

[转载发布] Relative Basic Stats

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    2026-7-12 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    9071

    主题

    864

    回帖

    6万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    58883
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    68848

    灌水之王

    发表于 2026-8-1 19:28:21 | 显示全部楼层 |阅读模式
    Relative Basic Stats
    by: Rinobi


    Adjusts a battler's HP, MP, and TP values to remain relative to respective maximum values when modified by buffs, states, equipment, and levels.

    For Example:

    Normally This Happens
    Actor's HP = 800 / 1000
    Buff MHP +50%
    Actor's HP 800 / 1500

    Although the actor's maximum HP was increased, allowing the potential for greater Health values, the actor's health percentage actually drops from 80% to 53%. The modification itself has no immediate advantage.

    With This Script
    Actor's HP = 800 / 1000
    Buff MHP +50%
    Actor's HP 1200 / 1500

    Because 80% of 1500 is 1200
    When the actor's maximum HP is increased, their HP value is adjusted to remain at the 80% it began with. This keeps the actor's overall condition exactly the same while providing an immediate health advantage.

    The Opposite Is Also True:

    Normally This Happens
    Actor's HP = 800 / 1000
    Debuff MHP -15%
    Actor's HP = 800 / 850

    By default, this has little to no effect depending on when the modification happens, and the actor's Health percentage actually increases from 80% to 94%. The Health bar will deceptively imply that the actor's condition improved.

    With This Script
    Actor's HP = 800 / 1000
    Debuff MHP -15%
    Actor's HP = 680 / 850

    Because 80% of 850 is 680
    The actor will also loose the equivalent health.​



    Spoiler: Change Log

    • [05/28/2017] 1.00 Public Release
    • [08/17/2017] 1.10 Included missing Buffs/Debuffs
    • [09/04/2017] 1.30 Settings added. Restriction fix.
    Spoiler: Features

    • Plug & Play, functions as advertised.
    Spoiler: Script
                    Code:       
    1. module RINOBI module RBS # DO NOT MODIFY
    2. #==============================================================================
    3. # # RELATIVE BASIC STATS
    4. # -----------------------------------------------------------------------------
    5. # 1.0 [06/06/2016] Completed
    6. # 1.1 [08/14/2017] Also affects buffs and debuffs.
    7. # 1.3 [09/03/2017] Settings added. Restriction fix.
    8. #-
    9. # Basic stats are HP, MP, and TP values.
    10. #
    11. # Adjusts a battler's HP, MP, and TP values to remain relative to maximum
    12. # values when modified by buffs, states, equipment, and levels. This basically
    13. # means that if a basic stat such as MAX HP is reduced or increased, the HP
    14. # value will instantly adjust to the same percentage value.
    15. #==============================================================================
    16. # # SCRIPT CALLS
    17. #------------------------------------------------------------------------------
    18. # rbs_levels      Adjust basic stats on level up/down.
    19. # rbs_classes     Adjust basic stats on class change.
    20. # rbs_equipment   Adjust basic stats on equipment change.
    21. # rbs_buffs       Adjust basic stats on buff/debuff.
    22. # rbs_states      Adjust basic stats on state add/remove.
    23. #-------------------------------------------
    24. # $game_actors[1].rbs_levels = true
    25. # $game_party.members[2].rbs_classes = false
    26. # $game_troop.members[4].rbs_buffs = true
    27. # a.rbs_states = false
    28. # b.rbs_buffs = true
    29. #==============================================================================
    30. # # TERMS OF USE
    31. #------------------------------------------------------------------------------
    32. # 1. Preserve this header.
    33. # 2. Do not re-upload this script.
    34. # 3. Do not claim this script as your own work.
    35. # 4. Do not release modified versions of this script.
    36. # 5. You may use this script within commercial project.
    37. #==============================================================================
    38. # # SETTINGS
    39. # -----------------------------------------------------------------------------
    40. # Adjust the below settings to your liking.
    41.     #======================================================================
    42.     # >> RBS Levels
    43.     # ---------------------------------------------------------------------
    44.     # Basic Stat values adjusted on level up/down.
    45.     #======================================================================
    46.       RBS_Levels = true
    47.    
    48.     #======================================================================
    49.     # >> RBS Class
    50.     # ---------------------------------------------------------------------
    51.     # Basic Stat values adjusted on class change.
    52.     #======================================================================
    53.       RBS_Classes = true
    54.    
    55.     #======================================================================
    56.     # >> RBS Equipment
    57.     # ---------------------------------------------------------------------
    58.     # Basic Stat values adjusted on equipment change/removal.
    59.     #======================================================================
    60.       RBS_Equipment = true
    61.    
    62.     #======================================================================
    63.     # >> RBS Buffs
    64.     # ---------------------------------------------------------------------
    65.     # Basic Stat values adjusted on buff/debuff.
    66.     #======================================================================
    67.       RBS_Buffs = true
    68.    
    69.     #======================================================================
    70.     # >> RBS States
    71.     # ---------------------------------------------------------------------
    72.     # Basic Stat values adjusted on add/remove state.
    73.     #======================================================================
    74.       RBS_States = true
    75. #==============================================================================
    76. #                             END OF SETTINGS
    77. #==============================================================================
    78. end end # DO NOT MODIFY
    79. #==============================================================================
    80. # ** IMPORT SCRIPT
    81. #------------------------------------------------------------------------------
    82. $imported = {} if $imported.nil?
    83. $imported[:RIN_RBS] = true
    84. #==============================================================================
    85. # ** Game_BattlerBase
    86. #------------------------------------------------------------------------------
    87. #  This base class handles battlers. It mainly contains methods for calculating
    88. # parameters. It is used as a super class of the Game_Battler class.
    89. #==============================================================================
    90. class Game_BattlerBase
    91.   #--------------------------------------------------------------------------
    92.   # * Alias: Object Initialization
    93.   #--------------------------------------------------------------------------
    94.   alias :rbs_initialize :initialize
    95.   def initialize
    96.     rbs_initialize
    97.     rbs_default_settings
    98.   end
    99.   #--------------------------------------------------------------------------
    100.   # * Set Relative Default Settings
    101.   #--------------------------------------------------------------------------
    102.   def rbs_default_settings
    103.     @rbs_levels = RINOBI::RBS::RBS_Levels
    104.     @rbs_classes = RINOBI::RBS::RBS_Classes
    105.     @rbs_equipment = RINOBI::RBS::RBS_Equipment
    106.     @rbs_buffs = RINOBI::RBS::RBS_Buffs
    107.     @rbs_states = RINOBI::RBS::RBS_States
    108.   end
    109.   #--------------------------------------------------------------------------
    110.   # * Get Relative Settings
    111.   #--------------------------------------------------------------------------
    112.   def rbs_levels; @rbs_levels end
    113.   def rbs_classes; @rbs_classes end
    114.   def rbs_equipment; @rbs_equipment end
    115.   def rbs_buffs; @rbs_buffs end
    116.   def rbs_states; @rbs_states end
    117.   #--------------------------------------------------------------------------
    118.   # * Alias: Erase States
    119.   #--------------------------------------------------------------------------
    120.   alias :rbs_erase_state :erase_state
    121.   def erase_state(state_id)
    122.     get_relative_values if rbs_states
    123.     rbs_erase_state(state_id)
    124.     set_relative_values if rbs_states
    125.   end
    126.   #--------------------------------------------------------------------------
    127.   # * Get Rate Values
    128.   #--------------------------------------------------------------------------
    129.   def get_relative_values
    130.     @ohp_rate = hp_rate
    131.     @omp_rate = mp_rate
    132.     @otp_rate = tp_rate
    133.   end
    134.   #--------------------------------------------------------------------------
    135.   # * Set Relative Values
    136.   #--------------------------------------------------------------------------
    137.   def set_relative_values
    138.     @hp = [mhp * @ohp_rate, 0].max.round.to_i
    139.     @mp = [mmp * @omp_rate, 0].max.round.to_i
    140.     @tp = [max_tp * @otp_rate, 0].max.round.to_i
    141.   end
    142. end
    143. #==============================================================================
    144. # ** Game_Battler
    145. #------------------------------------------------------------------------------
    146. #  A battler class with methods for sprites and actions added. This class
    147. # is used as a super class of the Game_Actor class and Game_Enemy class.
    148. #==============================================================================
    149. class Game_Battler < Game_BattlerBase
    150.   #--------------------------------------------------------------------------
    151.   # * Public Instance Variables
    152.   #--------------------------------------------------------------------------
    153.   attr_accessor :rbs_levels
    154.   attr_accessor :rbs_classes
    155.   attr_accessor :rbs_equipment
    156.   attr_accessor :rbs_buffs
    157.   attr_accessor :rbs_states
    158.   #--------------------------------------------------------------------------
    159.   # * Inherit Relative Values
    160.   #--------------------------------------------------------------------------
    161.   def rbs_levels; super end
    162.   def rbs_classes; super end
    163.   def rbs_equipment; super end
    164.   def rbs_buffs; super end
    165.   def rbs_states; super end
    166.   def get_relative_values; super end
    167.   def set_relative_values; super end
    168.   #--------------------------------------------------------------------------
    169.   # * Overwrite: Add New State
    170.   #--------------------------------------------------------------------------
    171.   def add_new_state(state_id)
    172.     die if state_id == death_state_id
    173.     get_relative_values if rbs_states
    174.     @states.push(state_id)
    175.     set_relative_values if rbs_states
    176.     on_restrict if restriction > 0
    177.     sort_states
    178.     refresh
    179.   end
    180.   #--------------------------------------------------------------------------
    181.   # * Alias: Add Buff
    182.   #--------------------------------------------------------------------------
    183.   alias :rbs_add_buff :add_buff
    184.   def add_buff(param_id, turns)
    185.     get_relative_values if rbs_buffs
    186.     rbs_add_buff(param_id, turns)
    187.     set_relative_values if rbs_buffs
    188.   end
    189.   #--------------------------------------------------------------------------
    190.   # * Alias: Add Debuff
    191.   #--------------------------------------------------------------------------
    192.   alias :rbs_add_debuff :add_debuff
    193.   def add_debuff(param_id, turns)
    194.     get_relative_values if rbs_buffs
    195.     rbs_add_debuff(param_id, turns)
    196.     set_relative_values if rbs_buffs
    197.   end
    198.   #--------------------------------------------------------------------------
    199.   # * Alias: Erase Buff/Debuff
    200.   #--------------------------------------------------------------------------
    201.   alias :rbs_erase_buff :erase_buff
    202.   def erase_buff(param_id)
    203.     get_relative_values if rbs_buffs
    204.     rbs_erase_buff(param_id)
    205.     set_relative_values if rbs_buffs
    206.   end
    207. end
    208. #==============================================================================
    209. # ** Game_Actor
    210. #------------------------------------------------------------------------------
    211. #  This class handles actors. It is used within the Game_Actors class
    212. # ($game_actors) and is also referenced from the Game_Party class ($game_party).
    213. #==============================================================================
    214. class Game_Actor < Game_Battler
    215.   #--------------------------------------------------------------------------
    216.   # * Alias: Change Class
    217.   #     keep_exp:  Keep EXP
    218.   #--------------------------------------------------------------------------
    219.   alias :rbs_change_class :change_class
    220.   def change_class(class_id, keep_exp = false)
    221.     get_relative_values if rbs_classes
    222.     rbs_change_class(class_id, keep_exp = false)
    223.     set_relative_values if rbs_classes
    224.   end
    225.   #--------------------------------------------------------------------------
    226.   # * Alias: Change Equipment
    227.   #     slot_id:  Equipment slot ID
    228.   #     item:    Weapon/armor (remove equipment if nil)
    229.   #--------------------------------------------------------------------------
    230.   alias :rbs_change_equip :change_equip
    231.   def change_equip(slot_id, item)
    232.     get_relative_values if rbs_equipment
    233.     rbs_change_equip(slot_id, item)
    234.     set_relative_values if rbs_equipment
    235.   end
    236.   #--------------------------------------------------------------------------
    237.   # * Alias: Forcibly Change Equipment
    238.   #     slot_id:  Equipment slot ID
    239.   #     item:     Weapon/armor (remove equipment if nil)
    240.   #--------------------------------------------------------------------------
    241.   alias :rbs_force_equip :force_change_equip
    242.   def force_change_equip(slot_id, item)
    243.     get_relative_values if rbs_equipment
    244.     rbs_force_equip(slot_id, item)
    245.     set_relative_values if rbs_equipment
    246.   end
    247.   #--------------------------------------------------------------------------
    248.   # * Alias: Level Up
    249.   #--------------------------------------------------------------------------
    250.   alias :rbs_level_up :level_up
    251.   def level_up
    252.     get_relative_values if rbs_levels
    253.     rbs_level_up
    254.     set_relative_values if rbs_levels
    255.   end
    256.   #--------------------------------------------------------------------------
    257.   # * Alias: Level Down
    258.   #--------------------------------------------------------------------------
    259.   alias :rbs_level_down :level_down
    260.   def level_down
    261.     get_relative_values if rbs_levels
    262.     rbs_level_down
    263.     set_relative_values if rbs_levels
    264.   end
    265.   #--------------------------------------------------------------------------
    266.   # * Alias: Change Level
    267.   #     show : Level up display flag
    268.   #--------------------------------------------------------------------------
    269.   alias :rbs_change_level :change_level
    270.   def change_level(level, show)
    271.     get_relative_values if rbs_levels
    272.     rbs_change_level(level, show)
    273.     set_relative_values if rbs_levels
    274.   end
    275. end
    复制代码

    Spoiler: Downloads

    本贴来自国际rpgmaker官方论坛作者:Rinobi处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/relative-basic-stats.79197/

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-8-18 08:56 , Processed in 0.137530 second(s), 53 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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