Skip to main content

Module spell

Module spell 

Source
Expand description

Spell – helper functions for cast spells. Mirrors Java’s Spell.java (subclass of SpellAbility for spells cast from hand/zone). In Rust the subclass is flattened: SpellAbility.is_spell == true marks a spell.

Functions§

can_play
Whether this spell can currently be played. Mirrors Java’s Spell.canPlay().
can_play_from_host
Whether this spell can be played from its host card. Mirrors Java’s Spell.canPlayFromHost(). Returns the card if playable, None otherwise.
check_restrictions
Check cant-be-cast restrictions from static abilities. Mirrors Java’s Spell.checkRestrictions().
is_counterable_by
Whether this spell can be countered by the given counter spell/ability. Mirrors Java’s Spell.isCounterableBy(SpellAbility).
set_cast_face_down
Set whether this spell is cast face down (Morph). Mirrors Java’s Spell.setCastFaceDown(boolean).

Type Aliases§

Spell
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.