pub struct AttackContext {Show 22 fields
pub attacker_slot: u8,
pub defender_slot: Option<u8>,
pub attack_type: AttackType,
pub trigger_card: Option<CardId>,
pub trigger_instance_id: Option<CardInstanceId>,
pub trigger_checks_total: u8,
pub trigger_checks_resolved: u8,
pub damage: i32,
pub counter_allowed: bool,
pub counter_played: bool,
pub counter_power: i32,
pub damage_modifiers: Vec<DamageModifier>,
pub pending_shot_damage: u8,
pub next_modifier_id: u32,
pub last_damage_event_id: Option<u32>,
pub auto_trigger_enqueued: bool,
pub auto_damage_enqueued: bool,
pub battle_damage_applied: bool,
pub step: AttackStep,
pub decl_window_done: bool,
pub trigger_window_done: bool,
pub damage_window_done: bool,
}Expand description
Context for an ongoing attack.
Fields§
§attacker_slot: u8Attacker stage slot index.
defender_slot: Option<u8>Optional defender stage slot index (None for direct attacks).
attack_type: AttackTypeDeclared attack type.
trigger_card: Option<CardId>Trigger-check revealed card id (if any).
trigger_instance_id: Option<CardInstanceId>Trigger-check revealed card instance id (if any).
trigger_checks_total: u8Total trigger checks required.
trigger_checks_resolved: u8Trigger checks already resolved.
damage: i32Current damage amount.
counter_allowed: boolWhether counter is allowed.
counter_played: boolWhether a counter was played.
counter_power: i32Power added by counters.
damage_modifiers: Vec<DamageModifier>Active damage modifiers.
pending_shot_damage: u8Pending shot damage remaining to apply.
next_modifier_id: u32Next id for damage modifier instances within this attack.
last_damage_event_id: Option<u32>Last damage event id emitted for this attack (if any).
auto_trigger_enqueued: boolWhether auto triggers were enqueued for this attack.
auto_damage_enqueued: boolWhether auto damage effects were enqueued for this attack.
battle_damage_applied: boolWhether battle damage has been applied.
step: AttackStepCurrent sub-step within the attack.
decl_window_done: boolWhether the declaration timing window is complete.
trigger_window_done: boolWhether the trigger timing window is complete.
damage_window_done: boolWhether the damage timing window is complete.
Trait Implementations§
Source§impl Clone for AttackContext
impl Clone for AttackContext
Source§fn clone(&self) -> AttackContext
fn clone(&self) -> AttackContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AttackContext
impl Debug for AttackContext
Source§impl<'de> Deserialize<'de> for AttackContext
impl<'de> Deserialize<'de> for AttackContext
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 AttackContext
impl Hash for AttackContext
Auto Trait Implementations§
impl Freeze for AttackContext
impl RefUnwindSafe for AttackContext
impl Send for AttackContext
impl Sync for AttackContext
impl Unpin for AttackContext
impl UnwindSafe for AttackContext
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