pub struct AbilityDef {Show 13 fields
pub kind: AbilityKind,
pub timing: Option<AbilityTiming>,
pub effects: Vec<EffectTemplate>,
pub effect_optional: Vec<bool>,
pub targets: Vec<TargetTemplate>,
pub cost: AbilityCost,
pub conditions: AbilityDefConditions,
pub target_card_type: Option<CardType>,
pub target_trait: Option<u16>,
pub target_level_max: Option<u8>,
pub target_cost_max: Option<u8>,
pub target_card_ids: Vec<CardId>,
pub target_limit: Option<u8>,
}Expand description
Fully specified ability definition.
Fields§
§kind: AbilityKindAbility kind (continuous/activated/auto).
timing: Option<AbilityTiming>Optional timing for auto/continuous effects.
effects: Vec<EffectTemplate>Effect templates executed by this ability.
effect_optional: Vec<bool>Optionality flags per effect index.
targets: Vec<TargetTemplate>Target templates for the ability.
cost: AbilityCostCosts required to activate (only for activated abilities).
conditions: AbilityDefConditionsOptional ability-level conditions.
target_card_type: Option<CardType>Optional target card type restriction.
target_trait: Option<u16>Optional target trait restriction.
target_level_max: Option<u8>Optional target max level restriction.
target_cost_max: Option<u8>Optional target max cost restriction.
target_card_ids: Vec<CardId>Optional target card-id restriction.
target_limit: Option<u8>Optional target count limit.
Implementations§
Trait Implementations§
Source§impl Clone for AbilityDef
impl Clone for AbilityDef
Source§fn clone(&self) -> AbilityDef
fn clone(&self) -> AbilityDef
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AbilityDef
impl Debug for AbilityDef
Source§impl<'de> Deserialize<'de> for AbilityDef
impl<'de> Deserialize<'de> for AbilityDef
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for AbilityDef
impl Hash for AbilityDef
Source§impl PartialEq for AbilityDef
impl PartialEq for AbilityDef
Source§impl Serialize for AbilityDef
impl Serialize for AbilityDef
impl Eq for AbilityDef
impl StructuralPartialEq for AbilityDef
Auto Trait Implementations§
impl Freeze for AbilityDef
impl RefUnwindSafe for AbilityDef
impl Send for AbilityDef
impl Sync for AbilityDef
impl Unpin for AbilityDef
impl UnwindSafe for AbilityDef
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
Mutably borrows from an owned value. Read more
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>
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 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>
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