Skip to main content

CostPart

Enum CostPart 

Source
pub enum CostPart {
Show 42 variants Tap, Mana { cost: ManaCost, x_min: i32, is_exiled_creature_cost: bool, is_enchanted_creature_cost: bool, is_cost_pay_any_number_of_times: bool, max_waterbend: Option<String>, }, PayLife(AmountSpec), Sacrifice { amount: AmountSpec, type_filter: String, }, Discard { amount: AmountSpec, type_filter: String, }, SubCounter { amount: AmountSpec, counter_type: CounterType, type_filter: String, }, AddCounter { amount: AmountSpec, counter_type: CounterType, }, Exile { amount: AmountSpec, type_filter: String, from: ZoneType, }, ExileFromAnyGrave { amount: AmountSpec, type_filter: String, }, ExileFromSameGrave { amount: AmountSpec, type_filter: String, }, Return { amount: AmountSpec, type_filter: String, }, TapType { amount: AmountSpec, type_filter: String, min_total_power: Option<i32>, }, Untap, UntapType { amount: AmountSpec, type_filter: String, can_untap_source: bool, }, PayEnergy(AmountSpec), PayShards(AmountSpec), DamageYou(AmountSpec), Draw(AmountSpec), Mill(AmountSpec), Reveal { amount: AmountSpec, type_filter: String, from: RevealFrom, }, Exert { amount: AmountSpec, type_filter: String, }, GainLife(AmountSpec), GainControl { amount: AmountSpec, type_filter: String, }, RemoveAnyCounter { amount: AmountSpec, type_filter: String, counter_type: Option<CounterType>, }, Unattach { type_filter: String, description: Option<String>, }, ExiledMoveToGrave { amount: AmountSpec, type_filter: String, }, AddMana { amount: AmountSpec, mana_type: String, }, Waterbend { amount: AmountSpec, }, ChooseColor(AmountSpec), ChooseCreatureType(AmountSpec), FlipCoin(AmountSpec), RollDice { amount: AmountSpec, sides: i32, result_svar: String, }, ExileFromStack { amount: AmountSpec, type_filter: String, }, CollectEvidence(AmountSpec), Forage, PutCardToLib { amount: AmountSpec, lib_pos: i32, type_filter: String, from: ZoneType, same_zone: bool, }, Enlist { amount: AmountSpec, type_filter: String, }, PromiseGift, RevealChosen { reveal_type: String, }, Behold { amount: AmountSpec, type_filter: String, exile: bool, }, Blight(AmountSpec), ExileCtrlOrGrave { amount: AmountSpec, type_filter: String, },
}

Variants§

§

Tap

Tap the source permanent. {T}

§

Mana

Pay mana. Mirrors Java CostPartMana.

Fields

§x_min: i32

Minimum value for X in the mana cost (parsed from restriction “XMin”).

§is_exiled_creature_cost: bool

When true, the base mana cost is augmented by the exiled creature’s mana cost.

§is_enchanted_creature_cost: bool

When true, the base mana cost is augmented by the enchanted creature’s mana cost.

§is_cost_pay_any_number_of_times: bool

When true, the base mana cost is multiplied by an SVar-determined count.

§max_waterbend: Option<String>

Maximum number of permanents that can be tapped to reduce the mana cost via the Waterbend mechanic. Mirrors Java’s CostPartMana.maxWaterbend.

§

PayLife(AmountSpec)

Pay life. Mirrors CostPayLife.

§

Sacrifice

Sacrifice permanents. type_filter “CARDNAME” means sacrifice self.

Fields

§amount: AmountSpec
§type_filter: String
§

Discard

Discard cards. type_filter “CARDNAME” means discard self.

Fields

§amount: AmountSpec
§type_filter: String
§

SubCounter

Remove counters from a permanent (e.g. SubCounter<1/DREAM/NICKNAME>).

Fields

§amount: AmountSpec
§counter_type: CounterType
§type_filter: String
§

AddCounter

Add counters to the source permanent (e.g. AddCounter<1/LOYALTY>). Mirrors CostPutCounter.

Fields

§amount: AmountSpec
§counter_type: CounterType
§

Exile

Exile cards from a specific zone (own zone) as cost. Mirrors CostExile.

Fields

§amount: AmountSpec
§type_filter: String
§

ExileFromAnyGrave

Exile cards from any player’s graveyard as cost (ExileAnyGrave). Mirrors CostExile zoneMode=-1.

Fields

§amount: AmountSpec
§type_filter: String
§

ExileFromSameGrave

Exile cards from the same graveyard as cost (ExileSameGrave). Mirrors CostExile zoneMode=0.

Fields

§amount: AmountSpec
§type_filter: String
§

Return

Return permanents to owner’s hand as cost. Mirrors CostReturn.

Fields

§amount: AmountSpec
§type_filter: String
§

TapType

Tap other permanents of a type as cost (tapXType<n/filter>). Mirrors CostTapType. When min_total_power is Some(N), tap any number of creatures whose total power >= N (used by Crew). When None, tap exactly amount matching permanents.

Fields

§amount: AmountSpec
§type_filter: String
§min_total_power: Option<i32>
§

Untap

Untap permanents as cost. Mirrors CostUntap.

§

UntapType

Untap other permanents of a type as cost (untapYType<n/filter>). Mirrors CostUntapType.

Fields

§amount: AmountSpec
§type_filter: String
§can_untap_source: bool
§

PayEnergy(AmountSpec)

Pay energy counters. Mirrors CostPayEnergy.

§

PayShards(AmountSpec)

Pay shard counters. Mirrors CostPayShards.

§

DamageYou(AmountSpec)

Deal damage to the source’s controller as cost. Mirrors CostDamage.

§

Draw(AmountSpec)

Draw cards as cost. Mirrors CostDraw.

§

Mill(AmountSpec)

Mill cards as cost. Mirrors CostMill.

§

Reveal

Reveal cards as cost. Mirrors CostReveal.

Fields

§amount: AmountSpec
§type_filter: String
§

Exert

Exert permanent(s) as cost. Mirrors CostExert.

Fields

§amount: AmountSpec
§type_filter: String
§

GainLife(AmountSpec)

Opponent gains life as cost. Mirrors CostGainLife.

§

GainControl

Gain control of permanents matching type_filter as cost. Mirrors CostGainControl.

Fields

§amount: AmountSpec
§type_filter: String
§

RemoveAnyCounter

Remove any counter type from permanents matching type_filter. Mirrors CostRemoveAnyCounter. counter_type is None means any counter type.

Fields

§amount: AmountSpec
§type_filter: String
§counter_type: Option<CounterType>
§

Unattach

Unattach equipment as a cost. Mirrors CostUnattach. type_filter can be “CARDNAME” (source is the equipment), “OriginalHost”, or a card filter expression (source is the equipped creature, filter matches equipment).

Fields

§type_filter: String
§description: Option<String>
§

ExiledMoveToGrave

Move cards from exile to graveyard as cost. Mirrors CostExiledMoveToGrave.

Fields

§amount: AmountSpec
§type_filter: String
§

AddMana

Add mana to the pool as a cost (AddMana<amount/type>). Mirrors CostAddMana. Always payable. Payment adds the specified mana to the activating player’s pool.

Fields

§amount: AmountSpec
§mana_type: String
§

Waterbend

Waterbend cost (Waterbend). Mirrors CostWaterbend. Pay N generic mana, but you can tap your artifacts and creatures to help (each tapped = {1}).

Fields

§amount: AmountSpec
§

ChooseColor(AmountSpec)

Choose one or more colors as a cost. Mirrors CostChooseColor.

§

ChooseCreatureType(AmountSpec)

Choose a creature type as a cost. Mirrors CostChooseCreatureType.

§

FlipCoin(AmountSpec)

Flip one or more coins as a cost. Mirrors CostFlipCoin.

§

RollDice

Roll dice as a cost. Mirrors CostRollDice.

Fields

§amount: AmountSpec
§sides: i32
§result_svar: String
§

ExileFromStack

Exile spells from stack as a cost. Mirrors CostExileFromStack.

Fields

§amount: AmountSpec
§type_filter: String
§

CollectEvidence(AmountSpec)

Collect evidence N (exile cards from your graveyard with total MV >= N).

§

Forage

Forage: exile 3 from your graveyard or sacrifice a Food.

§

PutCardToLib

Put card(s) to library from a zone as a cost. Mirrors CostPutCardToLib.

Fields

§amount: AmountSpec
§lib_pos: i32
§type_filter: String
§same_zone: bool
§

Enlist

Enlist another creature as a cost. Mirrors CostEnlist.

Fields

§amount: AmountSpec
§type_filter: String
§

PromiseGift

Promise gift to an opponent as a cost. Mirrors CostPromiseGift.

§

RevealChosen

Reveal previously chosen player/type as a cost. Mirrors CostRevealChosen.

Fields

§reveal_type: String
§

Behold

Behold (reveal from hand/battlefield), optionally exile revealed cards.

Fields

§amount: AmountSpec
§type_filter: String
§exile: bool
§

Blight(AmountSpec)

Blight N = put N -1/-1 counters on creature(s) you control.

§

ExileCtrlOrGrave

Exile from battlefield or graveyard as a combined cost (craft).

Fields

§amount: AmountSpec
§type_filter: String

Trait Implementations§

Source§

impl Clone for CostPart

Source§

fn clone(&self) -> CostPart

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 CostPart

Source§

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

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

impl<'de> Deserialize<'de> for CostPart

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for CostPart

Source§

impl Ord for CostPart

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for CostPart

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl PartialOrd for CostPart

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialize for CostPart

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

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<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

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