Repository navigation
Slip elements: a state's damage over time can carry elements - #99
Merged
Psychronic-Games merged 3 commits intoNov 30, 2026
Merged
Conversation
… 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: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:<Multi-Element Rule: x>and<Element Pierce>read from the state's note, the way they are read from a skill's;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; revision20261129.2)regenerateHp/regenerateMpaddslipElementRegenAdjust(pool)before flooring. For each state with slip elements whose own Regeneration Rate share is damage, that is share × max HP/MP × (rate − 1).hrg/mrg(equipment, class, states without elements) are untouched.slipElementIds(stateId),slipElementSubject(stateId),slipElementRate(stateId, pool)andslipStateRegenRate(state, xparamId).Game_Action.makeSlipAction(subject, state, ids, pool)builds a realGame_Actionwhose instancesubject,itemandelementssit ahead of any plugin's prototype methods.Game_Battler.installSlipElementShim()runs on all threeScene_Boot.startpaths, besideinstallMultiElementShimandinstallBuffRateGate. It wraps a plugin'sonRegenerateCustomStateDamageOverTime(SkillsStatesCore) as the outermost wrapper and scales the storedslipHp/slipMpdamage only for the duration of the call:Editor
ActionElements) in a new list-only mode, with no Normal Attack row, no None row and no First badge.js/reactor_plugins.jsenables VisuMZ_1_ElementStatusCore. It is detected the way the Passive States section detects SkillsStatesCore.<Multi-Element Rule: x>tag into the Note, through the Note's change listener, so no new data field exists.highest,avgand so on).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.cjsties the newest changelog file topackage.json. Please add one when you cut the next release.Compatibility
slipElementIdsregenerates exactly as before. A test checks this for every Demo state at five max-HP values.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: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
regenerateAllchain, and every one matched expectations computed from the test actor's measured base rates. No exceptions were logged. They cover:<Multi-Element Rule: Max>in the state's note;<JS HP/MP Slip Damage>state scaled, and absorbed into healing;<JS HP Slip Heal>left untouched by weakness and absorption, also beside a rated burn;The editor, driven over CDP at 1280 and 2400 px wide:
[2, 3], and the value survives leaving the state;avgmoves the dropdown, and Default empties the note again;npm teston 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, nozip, GNUtarreadingC:as a host, POSIX fixture paths, the%APPDATA%RTP tests, a load-sensitive timing) exceptthree-version.test.cjs, which fails only in a git worktree whosenode_modulesis 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
xparamRatemultiplier still scales the whole ofhrg, but the element adjustment is taken from the unmultiplied trait value. Stacks a plugin adds throughxparamPlusare not counted in the share.slipStateRegenRateis the seam to override if either matters.userin that case.target.elementRate(n)would be rated twice once its state is given slip elements. Remove the hand-written factor at the same time.regenerateAll, which the turn end calls.🤖 Generated with Claude Code