pub enum CombatEvent {
Show 22 variants
Created {
name: String,
campaign: String,
},
CombatantAdded {
combatant: Combatant,
},
CombatantRemoved {
combatant: Uuid,
},
InitiativeRolled {
combatant: Uuid,
roll: u8,
modifier: i8,
total: i16,
},
InitiativeSet {
combatant: Uuid,
total: i16,
},
Started,
RoundStarted {
round: u32,
},
TurnStarted {
combatant: Uuid,
},
Damaged {
combatant: Uuid,
amount: u32,
hit_points: HitPoints,
},
Healed {
combatant: Uuid,
amount: u32,
hit_points: HitPoints,
},
TemporaryHitPointsSet {
combatant: Uuid,
hit_points: HitPoints,
},
EffectAdded {
effect: Effect,
},
EffectEnded {
effect: Uuid,
reason: EffectEndReason,
},
SpellCast {
caster: Uuid,
spell: String,
slot: Option<SpellSlot>,
targets: Vec<Uuid>,
},
FeatureUsed {
combatant: Uuid,
feature: String,
amount: u16,
},
Paused,
Resumed,
Ended,
Undone {
command: Uuid,
},
CombatantRestored {
combatant: Combatant,
},
EffectRestored {
effect: Effect,
},
ProgressRestored {
status: CombatStatus,
round: u32,
current_turn: Option<Uuid>,
},
}Expand description
Something that happened in a combat. Events are facts: they carry outcomes (the rolled number, the resulting HP) so replaying the log never needs to re-roll or re-decide anything.
Variants§
Created
CombatantAdded
CombatantRemoved
InitiativeRolled
InitiativeSet
Started
RoundStarted
TurnStarted
Damaged
Healed
TemporaryHitPointsSet
EffectAdded
EffectEnded
SpellCast
A record only: the slot was spent on the caster’s sheet.
FeatureUsed
A record; the combat service spends the use on the character’s sheet before logging it.
Paused
Resumed
Ended
Undone
The command command was undone. The events after it, from the
same undo, put back what that command changed.
CombatantRestored
A combatant put back as they were (or with their own command’s change reverted), joining again if they had left.
EffectRestored
An effect put back, in play again if it had ended.
ProgressRestored
Status, round and turn set back.
Implementations§
Source§impl CombatEvent
impl CombatEvent
Sourcepub fn sheet_cost(&self) -> Option<(Uuid, SheetCost)>
pub fn sheet_cost(&self) -> Option<(Uuid, SheetCost)>
What the command that logged this event cost a sheet: what undoing it gives back.
Trait Implementations§
Source§impl Clone for CombatEvent
impl Clone for CombatEvent
Source§fn clone(&self) -> CombatEvent
fn clone(&self) -> CombatEvent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ComposeSchema for CombatEvent
impl ComposeSchema for CombatEvent
Source§impl Debug for CombatEvent
impl Debug for CombatEvent
Source§impl<'de> Deserialize<'de> for CombatEvent
impl<'de> Deserialize<'de> for CombatEvent
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 PartialEq for CombatEvent
impl PartialEq for CombatEvent
Source§fn eq(&self, other: &CombatEvent) -> bool
fn eq(&self, other: &CombatEvent) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for CombatEvent
impl Serialize for CombatEvent
Source§impl ToSchema for CombatEvent
impl ToSchema for CombatEvent
impl Eq for CombatEvent
impl StructuralPartialEq for CombatEvent
Auto Trait Implementations§
impl Freeze for CombatEvent
impl RefUnwindSafe for CombatEvent
impl Send for CombatEvent
impl Sync for CombatEvent
impl Unpin for CombatEvent
impl UnsafeUnpin for CombatEvent
impl UnwindSafe for CombatEvent
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.