Expand description
Effect resolution system.
Each effect type lives in its own file, mirroring the Java Forge
ability/effects/ package (204 files). Effects are dispatched by
API type string extracted from the ability text.
Re-exports§
pub use effect_context::EffectContext;pub use effect_resolver::resolve_effect;pub use effect_resolver::resolve_effect_chain;pub use effect_resolver::resolve_effect_chain_with_parent;pub use effect_resolver::IMPLEMENTED_API_TYPES;pub use crate::mana::mana_atom_from_produced;pub use crate::svar::evaluate_svar;pub use crate::svar::resolve_count_svar;pub use crate::svar::resolve_count_svar_for_sa;pub use crate::svar::resolve_numeric_svar;pub use crate::svar::resolve_numeric_value;pub use helpers::*;pub use zone_triggers::*;
Modules§
- abandon_
effect - Abandon — leave a game in a multiplayer match. Ported from Java’s AbandonEffect: sets player as lost.
- activate_
ability_ effect - add_
phase_ effect - add_
turn_ effect - advance_
crank_ effect - AdvanceCrank — advance a crank counter (Unfinity). Ported from Java’s AdvanceCrankEffect: advances the player’s CRANK! counter to the next sprocket and cranks contraptions on that sprocket.
- airbend_
effect - Airbend — exile target cards, their owner may cast them for {2}.
Mirrors Java
AirbendEffect: exiles each card and creates a per-card Effect in the Command zone that grantsMayPlaywith an alternate mana cost of{2}, so the owner may cast the exiled card from exile. - alter_
attribute_ effect - AlterAttribute — change a creature’s attribute (Plotted, Suspected, etc.). Ported from Java’s AlterAttributeEffect: toggles various card attributes like Plotted, Harnessed, Solved, Suspected, Saddled, Commander.
- amass_
effect - Amass effect — create or grow an Army token.
- animate_
all_ effect - animate_
effect - ascend_
effect - Ascend effect — gain the City’s Blessing if you control 10+ permanents.
- assemble_
contraption_ effect - AssembleContraption — assemble contraptions from the contraption deck (Unstable). Ported from Java’s AssembleContraptionEffect: moves top card of contraption deck to battlefield, assigns a sprocket.
- assign_
group_ effect - AssignGroup — assign creatures to groups (Conspiracy draft). Ported from Java’s AssignGroupEffect: assigns defined objects to groups chosen by the player, then resolves sub-abilities for each group.
- attach_
effect - balance_
effect - become_
monarch_ effect - becomes_
blocked_ effect - BecomesBlocked — mark attacking creatures as blocked. Ported from Java’s BecomesBlockedEffect: marks attacker as blocked in combat and fires AttackerBlocked triggers.
- bid_
life_ effect - BidLife effect — players bid life, highest bidder wins.
- blank_
line_ effect - BlankLine — no-op formatting effect used in card scripts.
- blight_
effect - Blight — mark a permanent with a blight counter or effect.
- block_
effect - Block effect — force a creature to block a specific attacker.
- bond_
effect - Bond effect — partner/bond mechanic for pairing creatures.
- branch_
effect - camouflage_
effect - Camouflage — old-school combat concealment. Ported from Java’s CamouflageEffect: the attacking player divides their creatures into face-down piles, then combat blockers are randomly assigned. In digital: we randomize the blocker assignments since the physical “face-down piles” mechanic can’t be faithfully reproduced.
- cast_
from_ effect - Shared “cast from effect” pipeline.
- change_
combatants_ effect - ChangeCombatants effect — modify combat participants.
- change_
speed_ effect - ChangeSpeed — modifies a player’s speed. Ported from Java’s ChangeSpeedEffect.
- change_
targets_ effect - ChangeTargets effect — redirect a spell or ability’s targets.
- change_
text_ effect - ChangeText effect — modify text on a card (color words, land types, etc.)
- change_
x_ effect - ChangeX effect — modify the X value of a spell or ability.
- change_
zone_ all_ effect - change_
zone_ effect - ChangeZone effect — moves cards between zones.
- change_
zone_ resolve_ effect - ChangeZoneResolve effect — resolves accumulated zone changes.
- chaos_
ensues_ effect - ChaosEnsues — trigger chaos ability in Planechase. Ported from Java’s ChaosEnsuesEffect: fires the ChaosEnsues trigger which causes all Planechase chaos abilities to trigger.
- charm_
effect - choose_
card_ effect - choose_
card_ name_ effect - ChooseCardName effect — name a card.
- choose_
color_ effect - choose_
direction_ effect - choose_
even_ odd_ effect - choose_
generic_ effect - ChooseGeneric effect — generic modal choice.
- choose_
number_ effect - choose_
player_ effect - choose_
sector_ effect - ChooseSector — choose a sector (Unfinity attraction board). Ported from Java’s ChooseSectorEffect: stores chosen sector on host card.
- choose_
source_ effect - choose_
type_ effect - claim_
the_ prize_ effect - ClaimThePrize — Unfinity prize mechanic. Ported from Java’s ClaimThePrizeEffect: fires ClaimPrize trigger for each defined attraction.
- clash_
effect - Clash effect — each player reveals top card, higher CMC wins.
- class_
level_ up_ effect - ClassLevelUp effect — increase a Class enchantment’s level.
- clean_
up_ effect - CleanUpEffect — cleanup/reset effect.
- cleanup_
effect - cloak_
effect - Cloak effect — like Manifest but with Ward {2}.
- clone_
effect - combat_
helpers - Combat-side helpers shared by effect resolvers.
- condition
- SpellAbility condition gating.
- connive_
effect - control_
exchange_ effect - ControlExchange effect — swap control of two permanents.
- control_
exchange_ variant_ effect - ControlExchangeVariant effect — variant of control exchange.
- control_
gain_ effect - control_
gain_ variant_ effect - control_
player_ effect - ControlPlayer effect — take control of another player’s turn (Mindslaver).
- control_
spell_ effect - ControlSpell effect — gain control of a spell on the stack.
- copy_
permanent_ effect - copy_
spell_ ability_ effect - cost_
payment - Cost-payment helpers used by effect resolution.
- counter_
effect - counters_
move_ effect - CountersMove effect — move counters between permanents.
- counters_
multiply_ effect - CountersMultiply effect — double (or multiply) counters on a permanent.
- counters_
note_ effect - CountersNote effect — note the number of counters on a permanent.
- counters_
proliferate_ effect - counters_
put_ all_ effect - counters_
put_ effect - counters_
put_ or_ remove_ effect - counters_
remove_ all_ effect - CountersRemoveAll effect — remove all counters of a type from permanents.
- counters_
remove_ effect - damage_
all_ effect - damage_
base_ effect - DamageBaseEffect — abstract base for damage effects.
- damage_
deal_ effect - damage_
each_ effect - damage_
prevent_ effect - DamagePrevent effect — prevent the next N damage to a target.
- damage_
resolve_ effect - DamageResolve — resolve accumulated damage from a damage map. Ported from Java’s DamageResolveEffect.
- day_
time_ effect - DayTime effect — switch between Day and Night.
- debuff_
effect - Debuff — reduce stats permanently (digital-only).
- delayed_
trigger_ effect - destroy_
all_ effect - destroy_
effect - detached_
card_ effect - DetachedCardEffect — card effect data structure.
- detain_
effect - dig_
effect - dig_
multiple_ effect - dig_
until_ effect - discard_
effect - discover_
effect - Discover effect — exile from library until a nonland card with CMC ≤ N.
- draft_
effect - Draft — draft a card from a spellbook (Conspiracy/Arena). Ported from Java’s DraftEffect: picks cards from a spellbook list, presents 3 random options, player chooses one, it goes to hand.
- drain_
mana_ effect - draw_
effect - earthbend_
effect - Earthbend — turn a land into a 0/0 creature with haste and +1/+1 counters. Ported from Java’s EarthbendEffect: adds creature type, haste, and counters to target land, plus sets up a delayed trigger to return it when it dies.
- effect_
context EffectContext— bundle of subsystem refs threaded through effect resolution.- effect_
effect - EffectEffect — mirrors Java
forge.game.ability.effects.EffectEffect. - effect_
resolver - Effect resolution driver — dispatch on
ApiTypeand walk sub-ability chains. - encode_
effect - end_
combat_ phase_ effect - end_
turn_ effect - endure_
effect - Endure — creature endures: either put +1/+1 counters on it, or create a Spirit token with power/toughness equal to the endure amount. Ported from Java’s EndureEffect.
- explore_
effect - fight_
effect - flip_
coin_ effect - flip_
onto_ battlefield_ effect - FlipOntoBattlefield effect — Chaos Orb style flipping.
- fog_
effect - game_
draw_ effect - game_
loss_ effect - game_
win_ effect - goad_
effect - haunt_
effect - Haunt effect — exile card haunting a creature.
- heist_
effect - Heist effect — exile cards from opponent’s library, may cast them.
- helpers
- Helper functions for effect resolution — re-export shim.
- immediate_
trigger_ effect - ImmediateTrigger effect — fire a trigger immediately without waiting.
- incubate_
effect - Incubate effect — create Incubator artifact token with +1/+1 counters.
- intensify_
effect - Intensify — increase effect power (escalating).
- internal_
radiation_ effect - InternalRadiation effect — process radiation counter damage.
- investigate_
effect - Investigate effect — create Clue artifact tokens.
- learn_
effect - Learn effect — reveal a Lesson from outside the game, or discard to draw.
- life_
exchange_ effect - life_
exchange_ variant_ effect - LifeExchangeVariant effect — variant life total exchange.
- life_
gain_ effect - life_
lose_ effect - life_
set_ effect - look_
at_ effect - lose_
perpetual_ effect - LosePerpetual — remove perpetual effects (digital-only, Alchemy). Ported from Java’s LosePerpetualEffect: removes a perpetual trait change identified by the triggering trigger’s timestamp.
- make_
card_ effect - MakeCard — conjure a card with specific properties (digital-only, Arena). Ported from Java’s MakeCardEffect: creates a real card (not a token) from a named card, spellbook, or choices, and places it in a zone.
- mana_
effect - mana_
reflected_ effect - manifest_
base_ effect - ManifestBaseEffect — abstract base for manifest variants.
- manifest_
dread_ effect - ManifestDread effect — look at top 2 cards, manifest one, other goes to graveyard.
- manifest_
effect - Manifest effect — put cards onto the battlefield face-down as 2/2 creatures.
- meld_
effect - Meld effect — exile two named cards, return melded as one creature.
- mill_
effect - move_
counter_ effect - multiple_
piles_ effect - MultiplePiles — Fact or Fiction style pile splitting. Ported from Java’s MultiplePilesEffect: separates cards into N piles, optionally remembers a randomly chosen pile.
- must_
block_ effect - mutate_
effect - Mutate — mutate onto a creature (Ikoria). Ported from Java’s MutateEffect: merges the host card with a target creature, choosing which goes on top, combining abilities.
- name_
card_ effect - open_
attraction_ effect - OpenAttraction — open an attraction from the attraction deck (Unfinity). Ported from Java’s OpenAttractionEffect: moves top card of attraction deck to battlefield.
- ownership_
gain_ effect - GainOwnership — change ownership of a card (rare silver-bordered). Ported from Java’s OwnershipGainEffect: changes the owner of target cards to the defined player.
- peek_
and_ reveal_ effect - permanent_
creature_ effect - PermanentCreature — move host card to battlefield as a creature permanent. Ported from Java’s PermanentCreatureEffect.
- permanent_
effect - PermanentEffect — move spell to battlefield.
- permanent_
noncreature_ effect - PermanentNoncreature — move host card to battlefield as a noncreature permanent. Ported from Java’s PermanentNoncreatureEffect.
- phases_
effect - planeswalk_
effect - Planeswalk — move to a new plane (Planechase). Ported from Java’s PlaneswalkEffect: leaves current plane, moves to new one. Planechase format support — fires trigger for plane change.
- play_
effect - play_
land_ variant_ effect - PlayLandVariant effect — variant play land.
- plot_
effect - poison_
effect - power_
exchange_ effect - prevent_
damage_ effect - protect_
all_ effect - protect_
effect - pump_
all_ effect - pump_
effect - radiation_
effect - Radiation — give radiation counters (Fallout).
- rearrange_
top_ of_ library_ effect - regenerate_
effect - regeneration_
effect - Regeneration — set up a regeneration shield (older mechanic).
- remove_
from_ combat_ effect - remove_
from_ game_ effect - RemoveFromGame — exile (old terminology).
- remove_
from_ match_ effect - RemoveFromMatch — remove cards from the entire match (Conspiracy). Ported from Java’s RemoveFromMatchEffect: permanently removes cards from all game zones, ceasing to exist.
- reorder_
zone_ effect - ReorderZone effect — let a player reorder cards in a zone.
- repeat_
each_ effect - repeat_
effect - Repeat effect — execute a sub-ability loop.
- replace_
counter_ effect - ReplaceCounter effect — replace counter placement with another effect.
- replace_
damage_ effect - ReplaceDamage effect — replace damage with another effect.
- replace_
effect - Replace effect — generic replacement effect registration.
- replace_
mana_ effect - ReplaceMana effect — replace mana production with different mana.
- replace_
split_ damage_ effect - ReplaceSplitDamage effect — replace split damage assignment.
- replace_
token_ effect - ReplaceToken effect — replace token creation with another effect.
- restart_
game_ effect - RestartGame — restart the game (Karn Liberated ultimate). Ported from Java’s RestartGameEffect: resets all game state, moves all cards back to libraries, resets life totals, clears counters, and restarts.
- reveal_
effect - reveal_
hand_ effect - reverse_
turn_ order_ effect - ring_
tempts_ you_ effect - RingTempts effect — The Ring tempts you (Lord of the Rings mechanic).
- roll_
dice_ effect - roll_
planar_ dice_ effect - RollPlanarDice — roll the planar die (Planechase). Ported from Java’s RollPlanarDiceEffect: rolls the planar die which can result in Planeswalk, Chaos, or blank.
- run_
chaos_ effect - RunChaos — run the chaos ability of the current plane card. Ported from Java’s RunChaosEffect: finds ChaosEnsues triggers on target plane cards and fires them.
- sacrifice_
all_ effect - sacrifice_
effect - scry_
effect - seek_
effect - Seek effect — randomly find cards matching criteria from library.
- set_
in_ motion_ effect - SetInMotion — set a scheme in motion (Archenemy). Ported from Java’s SetInMotionEffect: activates the top scheme card from the scheme deck.
- set_
state_ effect - shuffle_
effect - skip_
phase_ effect - skip_
turn_ effect - store_
s_ var_ effect - StoreSVar effect — store a value in an SVar for later use.
- subgame_
effect - Subgame — play a subgame (Shahrazad). Ported from Java’s SubgameEffect: creates a full sub-game with each player’s library, plays it to completion, then returns cards and applies results. This is an enormously complex operation — we implement the core structure but the actual sub-game execution requires the full game loop.
- surveil_
effect - switch_
block_ effect - SwitchBlock effect — change blockers during combat.
- take_
initiative_ effect - tap_
all_ effect - tap_
effect - tap_
or_ untap_ all_ effect - tap_
or_ untap_ effect - targeting_
triggers BecomesTarget/BecomesTargetOncetrigger emission.- text_
box_ exchange_ effect - TextBoxExchange effect — swap text boxes of two cards.
- time_
travel_ effect - token_
effect - token_
effect_ base - TokenEffectBase — shared token creation machinery.
- trait_
animate_ effect - AnimateEffectBase — abstract base for animate effects.
- two_
piles_ effect - unattach_
effect - Unattach effect — remove equipment or aura from a permanent.
- unlock_
door_ effect - UnlockDoor — unlock a door on a Room card. Ported from Java’s UnlockDoorEffect: unlocks one side of a Room enchantment, activating its abilities.
- untap_
all_ effect - untap_
effect - venture_
effect - Venture effect — venture into the dungeon.
- villainous_
choice_ effect - VillainousChoice effect — opponent chooses which punishment to receive.
- vote_
effect - Vote effect — Council’s Dilemma and Will of the Council voting.
- zone_
exchange_ effect - ZoneExchange effect — swap a card between two zones.
- zone_
triggers - Zone trigger emission helpers.