pub type Spell = SpellAbility;Expand description
Type alias for SpellAbility when used as a cast spell.
In Java, Spell is a subclass; in Rust it’s the same struct with is_spell = true.
Aliased Type§
pub struct Spell {Show 68 fields
pub id: u32,
pub api: Option<ApiType>,
pub source: Option<CardId>,
pub original_host: Option<CardId>,
pub activating_player: PlayerId,
pub targeting_player: Option<PlayerId>,
pub ability_text: String,
pub record_type: AbilityRecordType,
pub ir: SpellAbilityIr,
pub target_restrictions: Option<TargetRestrictions>,
pub target_chosen: TargetChoices,
pub pay_costs: Option<Cost>,
pub sub_ability: Option<Box<SpellAbility>>,
pub wrapped_ability: Option<Box<SpellAbility>>,
pub is_spell: bool,
pub is_trigger: bool,
pub is_activated: bool,
pub intrinsic: bool,
pub trigger_source: Option<CardId>,
pub trigger_source_zone_timestamp: Option<u64>,
pub source_zone_timestamp: Option<u64>,
pub source_trigger_id: Option<u32>,
pub trigger_index: Option<usize>,
pub alt_cost: Option<AlternativeCost>,
pub alt_cost_index: u8,
pub evoke_keyword_count: u8,
pub kicked: bool,
pub buyback_paid: bool,
pub overloaded: bool,
pub is_copy: bool,
pub paid_life_amount: i32,
pub kick_count: u32,
pub replicate_count: u32,
pub optional_generic_cost_paid: bool,
pub trigger_remembered_amount: i32,
pub x_mana_cost_paid: u32,
pub discarded_cost_cards: Vec<CardId>,
pub optional_costs: Vec<OptionalCost>,
pub paid_hash: HashMap<String, Vec<String>>,
pub paying_mana: Vec<u16>,
pub paid_abilities: Vec<SpellAbility>,
pub mana_part: Option<AbilityManaPart>,
pub express_mana_choice: Option<u16>,
pub convoke_tapped: Vec<CardId>,
pub spliced_cards: Vec<CardId>,
pub announce_vars: HashMap<String, i32>,
pub sacrificed_as_emerge: Option<CardId>,
pub sacrificed_as_offering: Option<CardId>,
pub description: String,
pub stack_description: String,
pub is_mana_ability: bool,
pub is_land_ability: bool,
pub cast_face_down: bool,
pub trigger_objects: HashMap<AbilityKey, AbilityValue>,
pub trigger_spell_abilities: HashMap<AbilityKey, SpellAbility>,
pub additional_ability_lists: HashMap<String, Vec<SpellAbility>>,
pub replacing_objects: HashMap<AbilityKey, AbilityValue>,
pub trigger_remembered: Vec<AbilityValue>,
pub restriction: SpellAbilityRestriction,
pub condition: SpellAbilityCondition,
pub rollback_effects: Vec<String>,
pub optional_keyword_amounts: HashMap<String, i32>,
pub pips_to_reduce: Vec<String>,
pub may_choose_new_targets: bool,
pub last_state: HashMap<String, String>,
pub change_zone_table: Option<CardZoneTable>,
pub damage_map: Option<CardDamageMap>,
pub prevent_map: Option<CardDamageMap>,
}Fields§
§id: u32§api: Option<ApiType>Effect API type (e.g. DealDamage, Destroy, Draw).
Mirrors Java’s ApiType api field.
source: Option<CardId>The card that hosts this ability. Mirrors Java’s hostCard.
original_host: Option<CardId>Java parity: original host card for granted/copied abilities.
Used by costs like Unattach<OriginalHost>.
activating_player: PlayerIdThe player who activated/cast this. Mirrors Java’s activatingPlayer.
targeting_player: Option<PlayerId>The player who chooses this ability’s targets. Mirrors Java’s
targetingPlayer field.
ability_text: StringThe raw ability text (pipe-delimited params).
record_type: AbilityRecordTypeJava parity: AB/SP/ST/DB record kind used to distinguish sub-abilities.
ir: SpellAbilityIrCompiled Forge script IR; resolution reads typed fields from here.
Skipped on serde: a deserialized SpellAbility must rebuild it from
ability_text before use or every typed param reads as absent.
target_restrictions: Option<TargetRestrictions>Targeting restrictions parsed from ValidTgts$.
None means this ability doesn’t use targeting.
Mirrors Java’s targetRestrictions field.
target_chosen: TargetChoicesThe chosen targets for this ability.
Mirrors Java’s targetChosen field.
pay_costs: Option<Cost>Parsed costs from Cost$ parameter.
Mirrors Java’s payCosts field.
sub_ability: Option<Box<SpellAbility>>Linked sub-ability chain. Mirrors Java’s subAbility field
(AbilitySub extends SpellAbility).
wrapped_ability: Option<Box<SpellAbility>>Java parity: payload carried by WrappedAbility.
is_spell: boolWhether this is a spell (not an ability).
is_trigger: boolWhether this is a triggered ability.
is_activated: boolWhether this is an activated ability.
intrinsic: boolJava parity: whether this ability is intrinsic to its host.
trigger_source: Option<CardId>Card that owns the trigger (for intervening-if recheck).
trigger_source_zone_timestamp: Option<u64>Zone timestamp of the trigger source when this triggered ability was created. Used to preserve object identity across zone changes (CR 400.7).
source_zone_timestamp: Option<u64>Zone timestamp of source when this SpellAbility instance was created.
Used for non-target references like Defined$ Self to preserve object identity.
source_trigger_id: Option<u32>Source trigger id (Java sourceTrigger), used for state-trigger dedupe.
trigger_index: Option<usize>Index into card.triggers for intervening-if recheck.
alt_cost: Option<AlternativeCost>Alternative cost used to cast this spell (Flashback, Spectacle, Evoke, Dash, etc.).
alt_cost_index: u8Index within the card’s list of same-kind alternative costs. Zero for all cases except multi-cost Evoke (intrinsic + granted by Ashling-style static AddKeyword): 0 = first payable Evoke, 1 = second, …
evoke_keyword_count: u8Number of Evoke keywords on the card at cast time (intrinsic + granted
from hand — e.g. Ashling, the Limitless’s AddKeyword$ Evoke:4).
Java parity: CardFactoryUtil attaches one Evoke “sacrifice when it
enters” trigger per Evoke keyword, so a card with two Evoke keywords
carries two sac triggers. Captured at cast because granted keywords from
zone-gated statics (AffectedZone$ Hand) are gone once the card moves
to the stack.
kicked: boolWhether the kicker cost was paid.
buyback_paid: boolWhether buyback was paid (spell returns to hand on resolve).
overloaded: boolWhether this spell is overloaded (targets all valid instead of one).
is_copy: boolWhether this spell is a copy (created by Storm, Replicate, etc.).
paid_life_amount: i32Java parity: life paid while activating or casting this ability.
kick_count: u32Number of times the kicker/multikicker cost was paid.
replicate_count: u32Number of times the replicate cost was paid.
optional_generic_cost_paid: boolWhether a generic optional additional cost was paid.
trigger_remembered_amount: i32Sum of integer values remembered on the trigger that spawned this ability (Java: TriggerRememberAmount / sa.getTriggerRemembered()).
x_mana_cost_paid: u32The value chosen for X in the mana cost (e.g. Fireball X=5 means 5 damage).
Mirrors Java’s SpellAbility.getXManaCostPaid().
discarded_cost_cards: Vec<CardId>Cards discarded as part of the cost payment.
Mirrors Java’s CostPayment.getPaidList("Discarded").
optional_costs: Vec<OptionalCost>Optional costs that have been paid for this spell.
Mirrors Java’s SpellAbility.optionalCosts.
paid_hash: HashMap<String, Vec<String>>Hash of costs paid, keyed by cost type with list of values.
Mirrors Java’s SpellAbility.paidHash.
paying_mana: Vec<u16>Java parity: mana atoms used to pay this spell or ability.
paid_abilities: Vec<SpellAbility>Java parity: paid abilities list.
mana_part: Option<AbilityManaPart>Mana-producing part of this ability (for mana abilities).
Mirrors Java’s SpellAbility.manaPart.
express_mana_choice: Option<u16>Express mana choice forced by callback/autopay for flexible mana abilities.
convoke_tapped: Vec<CardId>Cards tapped for convoke cost reduction.
Mirrors Java’s SpellAbility.tappedForConvoke.
spliced_cards: Vec<CardId>Cards spliced onto this spell.
Mirrors Java’s SpellAbility.splicedCards.
announce_vars: HashMap<String, i32>Announced variable values (e.g. X, number of targets).
Mirrors Java’s SpellAbility.announceVars.
sacrificed_as_emerge: Option<CardId>Card sacrificed as part of emerge cost.
Mirrors Java’s SpellAbility.sacrificedAsEmerge.
sacrificed_as_offering: Option<CardId>Card sacrificed as part of offering cost.
Mirrors Java’s SpellAbility.sacrificedAsOffering.
description: StringHuman-readable description of this ability.
Mirrors Java’s SpellAbility.description.
stack_description: StringDescription used when this ability is on the stack.
Mirrors Java’s SpellAbility.stackDescription.
is_mana_ability: boolWhether this is a mana ability (doesn’t use the stack).
Mirrors Java’s SpellAbility.isManaAbility.
is_land_ability: boolWhether this is a land ability (play land action).
Mirrors Java’s LandAbility subclass flag.
cast_face_down: boolRuntime-only face-down cast state used by morph/disguise-style spells.
trigger_objects: HashMap<AbilityKey, AbilityValue>Trigger objects map for tracking trigger context.
trigger_spell_abilities: HashMap<AbilityKey, SpellAbility>Java parity: non-scalar trigger objects that carry spell/ability context.
additional_ability_lists: HashMap<String, Vec<SpellAbility>>Java parity: additional ability lists used by mode/charm-style abilities.
replacing_objects: HashMap<AbilityKey, AbilityValue>Java parity: replacing-objects payload.
trigger_remembered: Vec<AbilityValue>Java parity: trigger remembered objects copied from the originating trigger.
restriction: SpellAbilityRestrictionActivation restriction for this ability.
condition: SpellAbilityConditionCondition that must be met for the effect to apply.
rollback_effects: Vec<String>Rollback effects tracked for undo support.
optional_keyword_amounts: HashMap<String, i32>Keyword amounts for optional keyword costs.
pips_to_reduce: Vec<String>Pips to reduce from cost.
may_choose_new_targets: boolJava parity: whether copied effects may choose new targets.
last_state: HashMap<String, String>Last known state for LKI tracking.
change_zone_table: Option<CardZoneTable>Java parity: batched zone-change table accumulated for ChangeZoneResolve.
damage_map: Option<CardDamageMap>Java parity: accumulated damage map for DamageResolve.
prevent_map: Option<CardDamageMap>Java parity: accumulated prevented-damage map for DamageResolve.