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.
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]>
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]>
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.
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.
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.