Skip to main content

EffectRecord

Struct EffectRecord 

Source
pub struct EffectRecord {
    pub id: String,
    pub kind: EffectKind,
    pub category: Option<String>,
    pub power: Option<u32>,
    pub mtype: Option<String>,
    pub accuracy: Option<u32>,
    pub cost: Vec<ResourceCost>,
    pub hooks: Vec<HookRecord>,
}
Expand description

One effect record (doc 11 §1). kind selects which resolver hosts it and the engine EffectType; the optional category/power/type/accuracy are per-move data the provider’s damage formula reads (the engine never sees them).

Fields§

§id: String

Opaque effect id string (e.g. "move.ember"). Maps to a synthesized EffectId per hook at compile.

§kind: EffectKind

Which resolver hosts this effect + the engine EffectType.

§category: Option<String>

Optional per-move category (Physical/Special) — provider-read data.

§power: Option<u32>

Optional base power — provider-read data.

§mtype: Option<String>

Optional attacking type name — used by ApplyTypeChart to recover the in-flight move’s type from source_effect (doc 12 §3.3).

§accuracy: Option<u32>

Optional accuracy — provider-read data.

§cost: Vec<ResourceCost>

Optional resource cost of this move (MP / SP / mana — doc 13 §4). Each entry names a resource from the ruleset’s resources: list and the amount to pay. The loader interns the names to resource ids; the engine’s cost gate (the move_cost provider hook) reads them before BeforeMove. Empty by default ⇒ no cost ⇒ the gate is inert (the move always costs nothing).

§hooks: Vec<HookRecord>

The event hooks.

Trait Implementations§

Source§

impl Clone for EffectRecord

Source§

fn clone(&self) -> EffectRecord

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 EffectRecord

Source§

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

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

impl<'de> Deserialize<'de> for EffectRecord

Source§

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

Deserialize this value from the given Serde deserializer. 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> 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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> 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.