[Gear] Zatha'tek: model Necrotic Tear as a per-target debuff#2
Open
NN0323 wants to merge 1 commit into
Open
Conversation
Necrotic Tear (spell 1305391) is a stacking debuff applied to each target that persists until that target dies. It was modeled as a single player-wide buff via make_buff(e.player, ...), with the damage multiplier keyed off that shared stack count regardless of which target was hit. Single-target results were correct, but in multi-target / cleave / target-swap sims the shared buff (a) let stacks built on one target inflate Breath of Corruption damage dealt to another, and (b) never reset on a target's death, so stacks only ever ramped up. The bug was silent in single-target smoke tests. Convert it to the per-target debuff infrastructure already used elsewhere in this file (void_execution_mandate, torments_duality, potion_of_zealotry): set target_debuff to spell 1305391 and read/trigger via find_debuff(s->target) and get_debuff(s->target). max_stack (10) and the infinite duration are still inherited from the spell data. The +5%/stack value (driver effectN(2)) and the base Nature damage (driver effectN(1)) are unchanged, so single-target output is identical; only multi-target/target-death behavior is corrected. Also const-qualify stack_mod and drop the now-redundant stack guard (the per-target debuff is created lazily, so the null check from find_debuff is the necessary guard). Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Summary
Fixes the one substantive issue found in code review of
zathatek-breath-of-corruption: Necrotic Tear (spell 1305391) was modeled as a single player-wide buff instead of a per-target debuff.In-game, Necrotic Tear is a stacking debuff applied to each target that persists until that target dies, granting +5% Breath of Corruption damage per stack (max 10). The implementation used
make_buff(e.player, ...)— one shared stack counter — and amplified damage off that shared count regardless of which target was hit.Why it mattered
Single-target results were correct, so this was silent in single-target (Patchwerk) smoke tests. But in multi-target / cleave / target-swap sims the shared player buff:
composite_da_multiplierread the global stack count, nots->target's), andThe fix
Convert Necrotic Tear to the per-target debuff infrastructure already used elsewhere in
unique_gear_midnight.cpp(void_execution_mandate,torments_duality,potion_of_zealotry):target_debuff = e.player->find_spell( 1305391 );composite_da_multiplier:if ( auto debuff = find_debuff( s->target ) ) m *= 1.0 + debuff->check() * stack_mod;impact:get_debuff( s->target )->trigger();get_debuff(t)lazily creates the debuff per target viamake_buff(actor_pair_t(t, player), …, target_debuff), so max_stack (10) and the infinite duration are still inherited from the spell data and per-target stacks now reset on target death for free. Deliberately does not copypotion_of_zealotry's target-swap expiry logic — Necrotic Tear persists per target until death.Also:
const-qualifystack_mod, drop the now-redundant stack guard (the lazyfind_debuffnull check is the necessary one), and clarify the spell-id header comment (the +5%/stack value lives on the driver'seffectN(2), not the tear spell).Behavior impact
effectN(1)damage andeffectN(2)+5%/stack.Verification
action_t::target_debuff/get_debuff/find_debuffinaction.hpp/action.cpp) and the neighboring precedents: API type-checks, single-target equivalence holds, impact ordering preserved, no danglingnecrotic_tearreferences.-Wall -Wextra -Wpedanticbut not-Werror.🤖 Generated with Claude Code