Skip to main content

Mana

Struct Mana 

Source
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: bool

Mana that persists across all phase transitions (Omnath, Kruphix).

§is_combat_mana: bool

Mana 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: bool

If 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

Source

pub fn simple(color: u16) -> Self

Source

pub fn adds_no_counter_magic(&self) -> bool

Whether spells paid with this mana can’t be countered. Mirrors Java’s Mana.addsNoCounterMagic().

Source

pub fn adds_counters(&self) -> bool

Whether this mana adds counters to permanents cast with it. Mirrors Java’s Mana.addsCounters().

Source

pub fn adds_keywords(&self) -> bool

Whether this mana adds keywords to spells cast with it. Mirrors Java’s Mana.addsKeywords().

Source

pub fn adds_keywords_type(&self) -> bool

Whether this mana adds keywords with a type restriction. Mirrors Java’s Mana.addsKeywordsType().

Source

pub fn adds_keywords_until(&self) -> bool

Whether this mana adds keywords with a duration. Mirrors Java’s Mana.addsKeywordsUntil().

Source

pub fn triggers_when_spent(&self) -> bool

Whether this mana has a trigger-when-spent effect. Mirrors Java’s Mana.triggersWhenSpent().

Trait Implementations§

Source§

impl Clone for Mana

Source§

fn clone(&self) -> Mana

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Mana

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Mana

Source§

impl PartialEq for Mana

Source§

fn eq(&self, other: &Mana) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

Source§

fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Gets the layout of the type.
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The type for metadata in pointers and references to Self.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V