pub struct Mana {
pub color: u16,
pub source_card: Option<CardId>,
pub is_snow: bool,
pub is_persistent: bool,
pub is_combat_mana: bool,
pub restriction: Option<String>,
pub adds_no_counter: bool,
pub adds_keywords: Option<String>,
pub adds_keywords_valid: Option<String>,
pub adds_counters: Option<String>,
pub adds_counters_valid: Option<String>,
pub triggers_when_spent: Option<String>,
}Expand description
An individual mana object in the pool, tracking source and properties.
Fields§
§color: u16§source_card: Option<CardId>§is_snow: bool§is_persistent: boolMana that persists across all phase transitions (Omnath, Kruphix).
is_combat_mana: boolMana that persists through combat phases but empties at end of combat.
restriction: Option<String>Restriction on what this mana can be spent on (from RestrictValid$). e.g. “Spell.Creature”, “Spell.Artifact”, “Activated”, “nonSpell”.
adds_no_counter: boolIf true, spells paid with this mana can’t be countered (Cavern of Souls).
adds_keywords: Option<String>Keywords to add to spells cast with this mana (e.g. “Haste” from Generator Servant). Format: “Keyword” with optional valid filter “Keyword|ValidFilter” (e.g. “Haste|Spell.Creature”).
adds_keywords_valid: Option<String>Valid filter for which spells get the keywords (e.g. “Spell.Creature”).
adds_counters: Option<String>Counter spec to add to permanents cast with this mana (e.g. “P1P1” from Guildmages’ Forum).
adds_counters_valid: Option<String>Valid filter for which cards get the counters.
triggers_when_spent: Option<String>SVar name of a trigger to fire when this mana is spent to cast a spell.
The SVar lives on the source card (identified by source_card).
Implementations§
Source§impl Mana
impl Mana
pub fn simple(color: u16) -> Self
Sourcepub fn adds_no_counter_magic(&self) -> bool
pub fn adds_no_counter_magic(&self) -> bool
Whether spells paid with this mana can’t be countered.
Mirrors Java’s Mana.addsNoCounterMagic().
Sourcepub fn adds_counters(&self) -> bool
pub fn adds_counters(&self) -> bool
Whether this mana adds counters to permanents cast with it.
Mirrors Java’s Mana.addsCounters().
Sourcepub fn adds_keywords(&self) -> bool
pub fn adds_keywords(&self) -> bool
Whether this mana adds keywords to spells cast with it.
Mirrors Java’s Mana.addsKeywords().
Sourcepub fn adds_keywords_type(&self) -> bool
pub fn adds_keywords_type(&self) -> bool
Whether this mana adds keywords with a type restriction.
Mirrors Java’s Mana.addsKeywordsType().
Sourcepub fn adds_keywords_until(&self) -> bool
pub fn adds_keywords_until(&self) -> bool
Whether this mana adds keywords with a duration.
Mirrors Java’s Mana.addsKeywordsUntil().
Sourcepub fn triggers_when_spent(&self) -> bool
pub fn triggers_when_spent(&self) -> bool
Whether this mana has a trigger-when-spent effect.
Mirrors Java’s Mana.triggersWhenSpent().
Trait Implementations§
impl Eq for Mana
impl StructuralPartialEq for Mana
Auto Trait Implementations§
impl Freeze for Mana
impl RefUnwindSafe for Mana
impl Send for Mana
impl Sync for Mana
impl Unpin for Mana
impl UnsafeUnpin for Mana
impl UnwindSafe for Mana
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.