fix(forge-game): set tokenSpawningAbility on Endure-created tokens#4
Merged
fix(forge-game): set tokenSpawningAbility on Endure-created tokens#4
Conversation
EndureEffect creates its Spirit token via TokenInfo.getProtoType(...) but omits the result.setTokenSpawningAbility(sa) call that every other token-creating effect in forge-game performs: - TokenEffectBase.createTokenTable - TokenEffectBase.makeTokenTableInternal - AmassEffect.resolve - CopyPermanentEffect.resolve - ReplaceTokenEffect (replacement and creation paths) Card.tokenSpawningAbility is the canonical back-reference from a token to the SA that produced it. Engine resolution doesn't depend on it, but any consumer that traces a token to its source ability (replay tooling, custom GUIs, simulation harnesses) sees a null source for Endure tokens. The fix mirrors AmassEffect line 69 — a single setTokenSpawningAbility(sa) call right after the token prototype is built. Co-Authored-By: Claude Opus 4.7 (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
EndureEffectcreates its Spirit token viaTokenInfo.getProtoType(...)directly but forgets to callresult.setTokenSpawningAbility(sa)afterward. Every other token-creating effect inforge-gamedoes this:TokenEffectBase.createTokenTableTokenEffectBase.makeTokenTableInternalAmassEffect.resolveCopyPermanentEffect.resolveReplaceTokenEffectCard.tokenSpawningAbilityis the canonical back-reference from a token to the SA that produced it. Engine resolution doesn't depend on it (Endure works fine in vanilla Forge today) — but any consumer that traces a token back to its source ability (replay tooling, custom GUIs, simulation harnesses) sees a null source for Endure tokens.Change
One line, mirroring
AmassEffectline 69:```java
result.setTokenSpawningAbility(sa);
```
placed right after the token prototype is built and PT set.
Test plan
PATCHES.md
Added a new "Engine fixes" section noting this as a fork-local patch.