Skip to content

Start Self, Enchanted, Equipped and AttachedBy statics from AffectedDefined$ - #11932

Open
khaliostr wants to merge 1 commit into
Card-Forge:masterfrom
witchesofthehill:khaliostr/upstream-affected-defined
Open

khaliostr wants to merge 1 commit into
Card-Forge:masterfrom
witchesofthehill:khaliostr/upstream-affected-defined

Conversation

@khaliostr

@khaliostr khaliostr commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Follow-up to the review on #11931. Affected$ Card.Self, Creature.EnchantedBy, Creature.EquippedBy and Creature.AttachedBy walked the whole battlefield to find one card the static already knows. AffectedDefined$ Self, Enchanted, Equipped and AttachedBy Self name that card; a type or extra restriction stays as the Affected$ filter. Mechanical: 2608 lines in 2404 scripts, only where the effect zone and the affected zone are the battlefield.

The AI read Affected$ as text in five places (ComputerUtilCard.applyStaticContPT, the two haste-source checks in ComputerUtil, three attachment checks in AttachAi) and now handles AffectedDefined$. Three seeded four-player games make identical decisions before and after; the widest runs 280 s to 252 s. IsRemembered is left out: Remembered resolves through getCardState and is not zone-bound, so it is not the same set.

khaliostr added a commit to witchesofthehill/manabrew that referenced this pull request Sep 16, 2026
Fork commit 16, same as Card-Forge/forge#11932: Self, Enchanted, Equipped and
AttachedBy statics start from the one card they know. Exact on three seeds.
Comment thread forge-gui/res/cardsfolder/a/aang_a_lot_to_learn.txt Outdated
…tics

Affected$ Card.Self, Creature.EnchantedBy, Creature.EquippedBy and
Creature.AttachedBy walked the whole battlefield to find one card the static
already knows. AffectedDefined$ Self, Enchanted, Equipped and AttachedBy Self
name that card; a type or extra restriction stays as the Affected$ filter.
Only statics whose effect and affected zones are the battlefield. Mechanical:
2608 lines in 2404 scripts.

The AI read Affected$ as text in five places and now understands
AffectedDefined$: applyStaticContPT asks the defined set whether it holds the
virtual card, the two haste-source checks skip statics on a defined card, and
AttachAi's attachment checks look at AffectedDefined$ first. Same seeds,
identical decisions.
@khaliostr
khaliostr force-pushed the khaliostr/upstream-affected-defined branch from 18e50b4 to 33fc9b3 Compare September 16, 2026 12:27
khaliostr added a commit to witchesofthehill/manabrew that referenced this pull request Sep 16, 2026
Fork commit 16 amended after the Card-Forge/forge#11932 review: Affected$
reduced to the residual filter, five AI readers taught AffectedDefined$.
Exact on three seeds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants