Skip to main content

Module ability_activated

Module ability_activated 

Source
Expand description

AbilityActivated – helper functions for activated abilities. Mirrors Java’s AbilityActivated.java. In Rust the subclass is flattened: SpellAbility.is_activated == true.

Functions§

can_play
Whether this activated ability can currently be played. Mirrors Java’s AbilityActivated.canPlay().
check_restrictions
Check cant-be-activated restrictions from static abilities. Mirrors Java’s AbilityActivated.checkRestrictions().
is_detained
Check if the source card is detained (can’t attack, block, or activate abilities).
is_possible_activated
Whether this activated ability is possible (zone and activator checks). Mirrors Java’s AbilityActivated.isPossible().
is_suppressed
Check if the source card is suppressed by a naming effect (Pithing Needle). A card is suppressed if an opponent controls a permanent that names it and prevents activated abilities.
prompt_if_only_possible_ability
Whether to prompt even if this is the only possible ability. Mirrors Java’s AbilityActivated.promptIfOnlyPossibleAbility(). Returns false – activated abilities don’t need confirmation when they’re the only option (unlike spells which may have alternative costs).