Skip to content

Slip elements: a state's damage over time can carry elements - #99

Merged
Psychronic-Games merged 3 commits into
Psychronic-Games:mainfrom
Xehanort88:feat/slip-elements
Nov 30, 2026
Merged

Psychronic-Games merged 3 commits into
Psychronic-Games:mainfrom
Xehanort88:feat/slip-elements

Conversation

@Xehanort88

Copy link
Copy Markdown
Contributor

The problem

A state's damage over time had no element. Poison, Burn or Bleed lowers HP through the HP Regeneration Rate trait (Ex-Parameter 7, a negative percentage), or through a plugin's stored per-state slip such as VisuMZ_1_SkillsStatesCore's <JS HP Slip Damage>. Neither path looked at element rates:

  • a fire-immune enemy burned like anyone else;
  • a battler that absorbs Fire was hurt by Burn instead of healed;
  • resistances, weaknesses, absorption and multi-element rulings set up for skills never reached damage over time.

The usual workaround is to hand-write target.elementRate(n) into each JS slip formula. That reads one element's raw rate only. It skips absorption and the element plugin's multi-element rules, and it can't reach the trait-based slip at all.

What changed

A state may list the elements its damage over time carries, in a new field: slipElementIds, edited at Database › States › General › Slip Damage Elements. Each tick, the state's share of slip damage is multiplied by the rate an action carrying those elements would get against the afflicted battler. Healing over time is healing: a positive regeneration share and a stored slip heal are never rated.

That rate comes from Game_Action.calcElementRate, so whichever element plugin replaced it applies its own rules, exactly as it does to a skill. With VisuMZ_1_ElementStatusCore:

  • absorption turns the damage into healing;
  • the Maximum / Minimum / Multiply / Additive / Average ruling applies, with <Multi-Element Rule: x> and <Element Pierce> read from the state's note, the way they are read from a skill's;
  • the dealt-element bonuses of whoever applied the state count, where SkillsStatesCore recorded who that was.

Without an element plugin, the runtime's own rule applies: the highest rate, and no absorption.

Runtime (reactor_objects_battlers.js, reactor_objects_actions.js; revision 20261129.2)

  • regenerateHp / regenerateMp add slipElementRegenAdjust(pool) before flooring. For each state with slip elements whose own Regeneration Rate share is damage, that is share × max HP/MP × (rate − 1).
    • It is exactly 0 when every rate is 1. A state without the field regenerates with the stock formula, unchanged.
    • Other contributions to hrg / mrg (equipment, class, states without elements) are untouched.
  • Overridable seams: slipElementIds(stateId), slipElementSubject(stateId), slipElementRate(stateId, pool) and slipStateRegenRate(state, xparamId).
  • Game_Action.makeSlipAction(subject, state, ids, pool) builds a real Game_Action whose instance subject, item and elements sit ahead of any plugin's prototype methods.
    • Its elements are the state's alone, never the subject's attack elements or a forced element.
    • Its subject may no longer be in the party or troop.
    • Its item is a stand-in skill built from the state's name, note and meta.
  • Game_Battler.installSlipElementShim() runs on all three Scene_Boot.start paths, beside installMultiElementShim and installBuffRateGate. It wraps a plugin's onRegenerateCustomStateDamageOverTime (SkillsStatesCore) as the outermost wrapper and scales the stored slipHp / slipMp damage only for the duration of the call:
    • the stored value stays unscaled, so a change in resistance or absorption between ticks applies on the next tick;
    • inner wrappers, such as a stack multiplier, see the scaled value;
    • stored heals and TP slip are left alone;
    • without that method, the shim is inert.

Editor

  • Slip Damage Elements fills the empty column beside [SV] Overlay in the States General section.
    • It reuses the Skills/Items multi-element picker (ActionElements) in a new list-only mode, with no Normal Attack row, no None row and no First badge.
    • An empty list deletes the field, so a state without slip elements saves exactly as before.
  • Multi-Element Rule appears under it only when the project's js/reactor_plugins.js enables VisuMZ_1_ElementStatusCore. It is detected the way the Passive States section detects SkillsStatesCore.
    • Options: Default (naming the plugin's own setting, e.g. "Default (Multiply)"), Maximum, Minimum, Multiply, Additive, Average.
    • Storage: it writes the plugin's own <Multi-Element Rule: x> tag into the Note, through the Note's change listener, so no new data field exists.
    • Reading: it reads the tag as the plugin does: the first tag only, plus the plugin's synonyms (highest, avg and so on).
    • Editing: choosing a rule removes every older tag, so no dead second tag is left. Default removes the tag and returns the Note byte for byte. Typing a tag by hand moves the dropdown.

Strings

Four new phrases in all 17 locales. These are a machine-assisted first pass and need a native review. The catalog's existing "Slip Damage Death" entries translate "slip" as physically slipping (es resbalón, ru скольжения). The new strings use each language's ordinary term for damage over time instead (ja スリップダメージ, es daño por turno, de Schaden über Zeit). The old entries are untouched.

Not included

No changelog entry: 0.99.7 has shipped and docs.test.cjs ties the newest changelog file to package.json. Please add one when you cut the next release.

Compatibility

  • A state without slipElementIds regenerates exactly as before. A test checks this for every Demo state at five max-HP values.
  • An older runtime ignores the field.
  • The dropdown only edits a note tag that ElementStatusCore already reads.

Verification

state-slip-elements.test.cjs (new, 14 tests). It runs the shipped methods in a vm, against the runtime's own rules and against stand-ins for ElementStatusCore and SkillsStatesCore. It covers:

  • stock parity;
  • share-only scaling;
  • stray ids;
  • multiply, absorption, and a ruling read from the state's note;
  • origin bonuses;
  • healing left alone beside rated damage;
  • slip death;
  • stored slip scaled and restored, including when the tick throws;
  • the boot paths;
  • the rule tag read and written as the plugin does: synonyms, first tag only, CRLF and mixed line endings, round-trip, exact project setting;
  • the editor wiring.

A real game (a production project with 133 enabled plugins, VisuStella's Core, Battle Core, Skills & States Core and Element Status Core among them; SDK NW.js 0.120; Battle Test). 17 scenarios ran through the full regenerateAll chain, and every one matched expectations computed from the test actor's measured base rates. No exceptions were logged. They cover:

  • resistance, weakness and absorption on one element;
  • Fire + Ice under the project's Multiply ruling, and under <Multi-Element Rule: Max> in the state's note;
  • absorption flipping a multiplied product;
  • MP slip;
  • a plain state beside an elemental one;
  • a <JS HP/MP Slip Damage> state scaled, and absorbed into healing;
  • a Regeneration Rate heal and a <JS HP Slip Heal> left untouched by weakness and absorption, also beside a rated burn;
  • plain states and plain JS slip unchanged.

The editor, driven over CDP at 1280 and 2400 px wide:

  • the field and picker render;
  • ticking Fire and Ice stores [2, 3], and the value survives leaving the state;
  • unticking both deletes the key;
  • the Multi-Element Rule row is absent without Element Status Core and present with it;
  • choosing Maximum saves the tag, typing avg moves the dropdown, and Default empties the note again;
  • no console errors in either window.

npm test on Windows (Git Bash): 10,150 tests: 10,066 pass, 47 fail, 37 skipped. Every failing file is on the Windows-environment list (symlinks without Developer Mode, no zip, GNU tar reading C: as a host, POSIX fixture paths, the %APPDATA% RTP tests, a load-sensitive timing) except three-version.test.cjs, which fails only in a git worktree whose node_modules is a junction and passes in the main checkout. Every one is a file on the baseline recorded for this machine at 0.99.7; none touches this change.

Limits

  • Trait share: only the state's own Regeneration Rate traits are scaled. A VisuMZ_0_CoreEngine xparamRate multiplier still scales the whole of hrg, but the element adjustment is taken from the unmultiplied trait value. Stacks a plugin adds through xparamPlus are not counted in the share. slipStateRegenRate is the seam to override if either matters.
  • No recorded origin: the subject is the afflicted battler, so its own dealt-element bonuses apply to its own slip. That is also what SkillsStatesCore's formulas see as user in that case.
  • Existing formulas: a JS slip formula that already multiplies by target.elementRate(n) would be rated twice once its state is given slip elements. Remove the hand-written factor at the same time.
  • Display: popups and the battle log are unchanged; absorbed slip damage shows as healing, the way an absorbed skill does. At 1280 px the dropdown's default label shortens to "Default (Mult…", as other narrow dropdowns there do.
  • Turn end: a full turn end in the turn-order battle system was not played. The tick was exercised through regenerateAll, which the turn end calls.

🤖 Generated with Claude Code

Xehanort88 and others added 3 commits November 29, 2026 10:53
… 20261129.1)

A state's damage over time ignored elements: the HP/MP Regeneration Rate
traits and a plugin's stored slip (SkillsStatesCore's <JS HP Slip Damage>)
never looked at element rates, so a fire-immune battler burned and one that
absorbs Fire was hurt by Burn.

A state may now list slipElementIds (Database > States > General > Slip
Damage Elements). Each tick the state's share of slip is scaled by the rate
an action carrying those elements gets, asked of Game_Action.calcElementRate,
so an element plugin's rules apply as they do to a skill: ElementStatusCore's
absorption, pierce and multi-element rulings, read from the state's note.

- regenerateHp/regenerateMp add slipElementRegenAdjust before flooring: the
  state's own Regeneration Rate traits x (rate - 1), exactly 0 at rate 1, so
  a state without elements regenerates with the stock formula.
- Game_Action.makeSlipAction: a real action whose instance subject, item
  and elements are the state's, ahead of any plugin's prototype methods.
- Game_Battler.installSlipElementShim (all three Scene_Boot paths) wraps a
  plugin's onRegenerateCustomStateDamageOverTime outermost and scales the
  stored slipHp/slipMp for the call only; TP slip is untouched.
- The States editor reuses the Skills/Items element picker in a list-only
  mode (no Normal Attack, None or First). An empty list deletes the field.
- Two phrases in all 17 locales (machine-assisted first pass).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…entStatusCore (runtime 20261129.2)

Healing over time is healing: a positive Regeneration Rate share and a
stored <JS HP/MP Slip Heal> are no longer rated or absorbed, only damage is.
slipElementRate(stateId, pool) and makeSlipAction(subject, state, ids, pool)
lose their recover argument.

When the project enables VisuMZ_1_ElementStatusCore, the States General
section shows a Multi-Element Rule dropdown under Slip Damage Elements:
Default (naming the plugin's own setting), Maximum, Minimum, Multiply,
Additive, Average. It reads and writes the plugin's <Multi-Element Rule>
tag in the Note through the Note's own change listener, reads it the way
the plugin does (first tag, its synonyms), removes every old tag so none
is left dead, and follows a tag typed by hand. Without the plugin the row
is not shown.

Three phrases in all 17 locales (machine-assisted first pass); the slip
tooltip no longer mentions healing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… exactly

- writeRuleToNote works line by line and keeps each line's own ending, so
  setting a rule and choosing Default again returns the note byte for byte
  (it used to leave a trailing newline); a note with mixed line endings
  round-trips untouched.
- Choosing Default on a note with no tag no longer saves it again, so it
  does not mark the database modified.
- projectRule matches ElementStatusCore's select values exactly, as the
  plugin's switch does; anything else is its default branch, Maximum.
- Comment fixes: the field is "Slip Damage Elements"; the General column
  note no longer describes an empty column.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Psychronic-Games
Psychronic-Games merged commit e6e9dd9 into Psychronic-Games:main Nov 30, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants