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

[转载发布] Lovelace - StateStackCombineDecay

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

    连续签到: 2 天

    [LV.7]常住居民III

    5778

    主题

    864

    回帖

    3万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 前天 16:39 | 显示全部楼层 |阅读模式
    StateStackCombineDecay (V1.0.1)
    Lowrell Lovelace


    Introduction
    This plugin allows for multiples of the same state to be stacked on itself to become a single higher state and allows developers to control the traits of that state based off the amount of stacks. It also allows for combining multiple different states to inflict a new one. Or even to add a new state when one state is removed.



    Features
    1. State Stacking

    States are able to transform linearly into other states when applied with states from the same state group.
    Examples: Bleed I + Bleed II = Bleed III | Bleed II + III = Bleed V

    2. State Combine

    Combine two or more parent states into a single child state.
    Examples: Wet + Cold = Frozen | Injured + Stun + Concussion = Dead

    3. State Decay

    When a parent state is removed it adds one or more child states.
    Examples: Bleed V => Bleed IV | Invincibility => Weakness + Stun

    Applying different features to the same state is also possible.
    Examples: Wet + Cold = Frozen I | Frozen V + Hot = Melt




    Spoiler: How to use
    How to use
    This plugin works primarily through note tags with only a handful of parameters.
    Put these note tags in the notes section of your state and the plugin will work automatically on all attacks, items, and skills.

    Note tags:

    1. State Stacking

    <LLL_SStack: [(state group), (state position), (stack num), (max position), ("multiply" || "add"), ("multiply" || "subtract"), (true || false)]>

    Apply on all states that have stacks.
    State group: Forces the plugin to only stack states with other states from the same group.
    State position: Bleed I = 1, Bleed II = 2, etc.
    Stack num: What number to add to the state position for the inflicted stack state, typically equivalent to the state position.
    Max position: Highest state position this state can stack to.
    Multi or add: Multiply or add with position zero's attack state rate (EXPLANATION BELOW).
    Multi or sub: Multiply or subtract with position zero's state rate (EXPLANATION BELOW)
    True or false: Does this group have state combinations?
    Example: Bleed II with a max position of Bleed V and no combinations => <LLL_SStack: [1, 2, 2, 5, "m", "s", 0]>

    2. State Combine

    <LLL_SCombine: [(parent state), (parent state 2)..., (child state), (true || false), (true || false)]>

    Apply on all parent states unless you want a combination check to only occur on a certain parent.
    Parent state: Which stateId(s) to check target for.
    Child state: Which stateId to replace parents with.
    True or false: Does the child state have stacks?
    True or false: Does the child state have combinations?
    Example: Ice (stateId: 12) + Fire (stateId: 15) => Water (stateId: 20) => <LLL_SCombine: [12, 15, 20, 0, 0]>

    3. State Decay

    <LLL_SDecay: [(child state), (child state 2)... (true || false), (true || false), (true || false), (true || false), (true || false)]>

    Apply on parent state.
    Child state: Which stateId(s) to apply to target on state removal.
    True or false: Show parent state removal message?
    True or false: Show child state(s) infliction message?
    True or false: Completely remove parent state without decay on battle end or restriction?
    True or false: Do the child state(s) have stacks?
    True or false: Do the child state(s) have combinations?
    Example: Bleed I => Wounded (stateId: 93) => <LLL_SDecay: [93, 0, 1, 0, 0, 1]>

    State position zero
    But what if you wanted an enemy completely immune to all bleed stacks and don't want to crowd their traits putting in state resist Bleed I, state resist Bleed II, etc.? That introduces state position zero. Just put it under state position one (i.e. Bleed I) and make the enemy immune to that state while making sure to properly tag it with LLL_SStack. Adding state rate and attack state rate also works for state position zero. The multiply or add in LLL_SStack decides whether to multiply or add the attack state rate of state position zero to state position one.

    Example:
    Multiply: (Bleed 0) 200% * (Bleed I) 10% = (Bleed I) 20%
    Add: 200% + 10% = 210%.

    However, you must explicitly put 86% in state attack rate for position zero to become 0% since by default all state attack rates are 0% so I've hardcoded states with my tag to ignore 0%. But multiply or subtract is for target state rate.

    Example:
    Multiply: (Bleed 0) 90% * (Bleed I) 10% = (Bleed I) 9%
    Subtract: (Bleed 1) 10% - (1 - (Bleed 0) 90%) = 0%.
    Spoiler: Parameters
    Parameters:
    areStateStacksOptimized

    The only truly important parameter here. Turning this to true means the plugin assumes all your state stacks are in order in the database.

    Example: stateId 3: Bleed 0, stateId 4: Bleed I, stateId 5: bleed II, etc.

    This makes it easier and faster for the plugin to manage the calculations for state stacking.

    If this parameter is turned to false then it will search for all the metadata in the target's ._states array and if it finds a state from the same state group it will then find the calculated inflicted state by searching through all the metadata in the state database. But this allows you to put your states wherever you want in the database.

    doesLuckAffectState

    If true it uses this formula to multiply with the chance variable to inflict a state in the code.
    Math.max(1.0 + (this.subject().luk - target.luk) * 0.001, 0.0)

    If false then it ignores the formula. State combine and state decay automatically ignore luck because of code shenanigans.

    doesRateAffectCombine

    If true then whenever a combine parent state check successfully happens it then does a state rate check with the target. So if I apply all parent states to a target but they have a 90% state rate to the child then there's a 10% chance the combination will fail and the parent states remain unchanged.

    If false then the child state will always be applied no matter the state rate unless the target has state resist to that child state.

    doesRateAffectDecay

    If true then whenever a parent state decays the child state will undergo a state rate check with the target. If succeeded then the parent will be removed and the child will be inflicted. If failed then the parent will still be removed and the child won't be inflicted.

    If false then the child state will always be applied no matter the state rate unless the target has state resist to that child state.
    Spoiler: WIP

    • Work on this thread
    • Add intergroup stacking
    • Give state combine multiple combination possibilities
    • Skills and items that can remove a state without activating decay
    • Make explaining my plugin not sound like a schizophrenic talking about numbers
    • Make my plugin help instead of doomscrolling
    • Fix infinite recursion when state decay child into own stack
    Spoiler: Changelog
    V1.0.1

    • Fixed state decay not properly checking meta data
    V1

    • Released lol
    brb im to sleep rq

    Terms and Credits

    Credit me or I'm legally entitled to your first born.


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

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-7-26 03:52 , Processed in 0.106570 second(s), 53 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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