AbilityTemplate

Enum AbilityTemplate 

Source
pub enum AbilityTemplate {
Show 30 variants Vanilla, ContinuousPower { amount: i32, }, ContinuousCannotAttack, ContinuousAttackCost { cost: u8, }, AutoOnPlayDraw { count: u8, }, AutoOnPlaySalvage { count: u8, optional: bool, card_type: Option<CardType>, }, AutoOnPlaySearchDeckTop { count: u8, optional: bool, card_type: Option<CardType>, }, AutoOnPlayRevealDeckTop { count: u8, }, AutoOnPlayStockCharge { count: u8, }, AutoOnPlayMillTop { count: u8, }, AutoOnPlayHeal { count: u8, }, AutoOnAttackDealDamage { amount: u8, cancelable: bool, }, AutoEndPhaseDraw { count: u8, }, AutoOnReverseDraw { count: u8, }, AutoOnReverseSalvage { count: u8, optional: bool, card_type: Option<CardType>, }, EventDealDamage { amount: u8, cancelable: bool, }, ActivatedPlaceholder, ActivatedTargetedPower { amount: i32, count: u8, target: TargetTemplate, }, ActivatedPaidTargetedPower { cost: u8, amount: i32, count: u8, target: TargetTemplate, }, ActivatedTargetedMoveToHand { count: u8, target: TargetTemplate, }, ActivatedPaidTargetedMoveToHand { cost: u8, count: u8, target: TargetTemplate, }, ActivatedChangeController { count: u8, target: TargetTemplate, }, ActivatedPaidChangeController { cost: u8, count: u8, target: TargetTemplate, }, CounterBackup { power: i32, }, CounterDamageReduce { amount: u8, }, CounterDamageCancel, Bond { cost: AbilityCost, count: u8, target_ids: Vec<CardId>, }, EncoreVariant { cost: AbilityCost, }, AbilityDef(AbilityDef), Unsupported { id: u32, },
}
Expand description

Template-driven ability definitions used by the DB loader.

Variants§

§

Vanilla

No special behavior (placeholder template).

§

ContinuousPower

Continuous power modifier while on stage.

Fields

§amount: i32

Power delta to apply.

§

ContinuousCannotAttack

Continuous “cannot attack” modifier while on stage.

§

ContinuousAttackCost

Continuous attack cost modifier while on stage.

Fields

§cost: u8

Additional stock cost to declare an attack.

§

AutoOnPlayDraw

Auto ability: on play, draw cards.

Fields

§count: u8

Number of cards to draw.

§

AutoOnPlaySalvage

Auto ability: on play, salvage cards from waiting room.

Fields

§count: u8

Number of cards to salvage.

§optional: bool

Whether salvaging is optional.

§card_type: Option<CardType>

Optional card type restriction.

§

AutoOnPlaySearchDeckTop

Auto ability: on play, search the top of the deck and take cards.

Fields

§count: u8

Maximum number of cards to take.

§optional: bool

Whether taking a card is optional.

§card_type: Option<CardType>

Optional card type restriction.

§

AutoOnPlayRevealDeckTop

Auto ability: on play, reveal the top cards of the deck.

Fields

§count: u8

Number of cards to reveal.

§

AutoOnPlayStockCharge

Auto ability: on play, stock charge.

Fields

§count: u8

Number of cards to stock charge.

§

AutoOnPlayMillTop

Auto ability: on play, mill cards from the top of the deck.

Fields

§count: u8

Number of cards to mill.

§

AutoOnPlayHeal

Auto ability: on play, heal.

Fields

§count: u8

Number of clock cards to heal.

§

AutoOnAttackDealDamage

Auto ability: on attack, deal effect damage.

Fields

§amount: u8

Damage amount.

§cancelable: bool

Whether the damage is cancelable.

§

AutoEndPhaseDraw

Auto ability: end of phase draw.

Fields

§count: u8

Number of cards to draw.

§

AutoOnReverseDraw

Auto ability: on reverse, draw.

Fields

§count: u8

Number of cards to draw.

§

AutoOnReverseSalvage

Auto ability: on reverse, salvage cards from waiting room.

Fields

§count: u8

Number of cards to salvage.

§optional: bool

Whether salvaging is optional.

§card_type: Option<CardType>

Optional card type restriction.

§

EventDealDamage

Event ability: deal effect damage.

Fields

§amount: u8

Damage amount.

§cancelable: bool

Whether the damage is cancelable.

§

ActivatedPlaceholder

Placeholder for an activated ability without a concrete template.

§

ActivatedTargetedPower

Activated ability: grant power to targets.

Fields

§amount: i32

Power delta to apply.

§count: u8

Number of targets to select.

§target: TargetTemplate

Target template to select from.

§

ActivatedPaidTargetedPower

Activated ability (paid): grant power to targets.

Fields

§cost: u8

Stock cost to pay.

§amount: i32

Power delta to apply.

§count: u8

Number of targets to select.

§target: TargetTemplate

Target template to select from.

§

ActivatedTargetedMoveToHand

Activated ability: move selected targets to hand.

Fields

§count: u8

Number of targets to select.

§target: TargetTemplate

Target template to select from.

§

ActivatedPaidTargetedMoveToHand

Activated ability (paid): move selected targets to hand.

Fields

§cost: u8

Stock cost to pay.

§count: u8

Number of targets to select.

§target: TargetTemplate

Target template to select from.

§

ActivatedChangeController

Activated ability: change controller of selected targets.

Fields

§count: u8

Number of targets to select.

§target: TargetTemplate

Target template to select from.

§

ActivatedPaidChangeController

Activated ability (paid): change controller of selected targets.

Fields

§cost: u8

Stock cost to pay.

§count: u8

Number of targets to select.

§target: TargetTemplate

Target template to select from.

§

CounterBackup

Counter ability: power backup.

Fields

§power: i32

Power amount to add.

§

CounterDamageReduce

Counter ability: reduce incoming damage.

Fields

§amount: u8

Reduction amount.

§

CounterDamageCancel

Counter ability: cancel the next damage instance.

§

Bond

Activated ability: “bond” search with structured cost.

Fields

§cost: AbilityCost

Activation cost specification.

§count: u8

Number of cards to search for.

§target_ids: Vec<CardId>

Optional card id whitelist for bond targets.

§

EncoreVariant

Encore ability variant with structured cost.

Fields

§cost: AbilityCost

Encore cost specification.

§

AbilityDef(AbilityDef)

Fully specified ability definition parsed from a rule pack.

Tuple Fields

§0: AbilityDef

Definition payload.

§

Unsupported

Unknown/unsupported ability template id.

Fields

§id: u32

Raw template id encountered during parsing.

Implementations§

Source§

impl AbilityTemplate

Source

pub fn tag(&self) -> AbilityTemplateTag

Return the template tag for this ability.

Source

pub fn activation_cost(&self) -> Option<u8>

Return the stock cost for activated templates (if any).

Source

pub fn activation_cost_spec(&self) -> AbilityCost

Return a full cost spec for activated templates.

Source

pub fn encore_variant_cost(&self) -> Option<AbilityCost>

Return encore variant cost for keyword encore templates.

Source

pub fn timing(&self) -> Option<AbilityTiming>

Return the implied timing for this template, if any.

Source

pub fn is_event_play(&self) -> bool

Whether this template represents an event play.

Trait Implementations§

Source§

impl Clone for AbilityTemplate

Source§

fn clone(&self) -> AbilityTemplate

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for AbilityTemplate

Source§

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

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

impl<'de> Deserialize<'de> for AbilityTemplate

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 Hash for AbilityTemplate

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for AbilityTemplate

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for AbilityTemplate

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
Source§

impl Eq for AbilityTemplate

Source§

impl StructuralPartialEq for AbilityTemplate

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> 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<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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,