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.
ContinuousCannotAttack
Continuous “cannot attack” modifier while on stage.
ContinuousAttackCost
Continuous attack cost modifier while on stage.
AutoOnPlayDraw
Auto ability: on play, draw cards.
AutoOnPlaySalvage
Auto ability: on play, salvage cards from waiting room.
Fields
AutoOnPlaySearchDeckTop
Auto ability: on play, search the top of the deck and take cards.
Fields
AutoOnPlayRevealDeckTop
Auto ability: on play, reveal the top cards of the deck.
AutoOnPlayStockCharge
Auto ability: on play, stock charge.
AutoOnPlayMillTop
Auto ability: on play, mill cards from the top of the deck.
AutoOnPlayHeal
Auto ability: on play, heal.
AutoOnAttackDealDamage
Auto ability: on attack, deal effect damage.
AutoEndPhaseDraw
Auto ability: end of phase draw.
AutoOnReverseDraw
Auto ability: on reverse, draw.
AutoOnReverseSalvage
Auto ability: on reverse, salvage cards from waiting room.
Fields
EventDealDamage
Event ability: deal effect damage.
ActivatedPlaceholder
Placeholder for an activated ability without a concrete template.
ActivatedTargetedPower
Activated ability: grant power to targets.
Fields
target: TargetTemplateTarget template to select from.
ActivatedPaidTargetedPower
Activated ability (paid): grant power to targets.
Fields
target: TargetTemplateTarget template to select from.
ActivatedTargetedMoveToHand
Activated ability: move selected targets to hand.
ActivatedPaidTargetedMoveToHand
Activated ability (paid): move selected targets to hand.
Fields
target: TargetTemplateTarget template to select from.
ActivatedChangeController
Activated ability: change controller of selected targets.
ActivatedPaidChangeController
Activated ability (paid): change controller of selected targets.
Fields
target: TargetTemplateTarget template to select from.
CounterBackup
Counter ability: power backup.
CounterDamageReduce
Counter ability: reduce incoming damage.
CounterDamageCancel
Counter ability: cancel the next damage instance.
Bond
Activated ability: “bond” search with structured cost.
Fields
cost: AbilityCostActivation cost specification.
EncoreVariant
Encore ability variant with structured cost.
Fields
cost: AbilityCostEncore cost specification.
AbilityDef(AbilityDef)
Fully specified ability definition parsed from a rule pack.
Tuple Fields
0: AbilityDefDefinition payload.
Unsupported
Unknown/unsupported ability template id.
Implementations§
Source§impl AbilityTemplate
impl AbilityTemplate
Sourcepub fn tag(&self) -> AbilityTemplateTag
pub fn tag(&self) -> AbilityTemplateTag
Return the template tag for this ability.
Sourcepub fn activation_cost(&self) -> Option<u8>
pub fn activation_cost(&self) -> Option<u8>
Return the stock cost for activated templates (if any).
Sourcepub fn activation_cost_spec(&self) -> AbilityCost
pub fn activation_cost_spec(&self) -> AbilityCost
Return a full cost spec for activated templates.
Sourcepub fn encore_variant_cost(&self) -> Option<AbilityCost>
pub fn encore_variant_cost(&self) -> Option<AbilityCost>
Return encore variant cost for keyword encore templates.
Sourcepub fn timing(&self) -> Option<AbilityTiming>
pub fn timing(&self) -> Option<AbilityTiming>
Return the implied timing for this template, if any.
Sourcepub fn is_event_play(&self) -> bool
pub fn is_event_play(&self) -> bool
Whether this template represents an event play.
Trait Implementations§
Source§impl Clone for AbilityTemplate
impl Clone for AbilityTemplate
Source§fn clone(&self) -> AbilityTemplate
fn clone(&self) -> AbilityTemplate
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AbilityTemplate
impl Debug for AbilityTemplate
Source§impl<'de> Deserialize<'de> for AbilityTemplate
impl<'de> Deserialize<'de> for AbilityTemplate
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Hash for AbilityTemplate
impl Hash for AbilityTemplate
Source§impl PartialEq for AbilityTemplate
impl PartialEq for AbilityTemplate
Source§impl Serialize for AbilityTemplate
impl Serialize for AbilityTemplate
impl Eq for AbilityTemplate
impl StructuralPartialEq for AbilityTemplate
Auto Trait Implementations§
impl Freeze for AbilityTemplate
impl RefUnwindSafe for AbilityTemplate
impl Send for AbilityTemplate
impl Sync for AbilityTemplate
impl Unpin for AbilityTemplate
impl UnwindSafe for AbilityTemplate
Blanket Implementations§
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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