Skip to main content

CombatCommand

Enum CombatCommand 

Source
pub enum CombatCommand {
Show 19 variants AddCombatant { combatant: Combatant, }, AddMonsters { monster: Uuid, count: u16, roll: bool, }, RemoveCombatant { combatant: Uuid, }, RollInitiative { combatant: Uuid, roll: Option<u8>, }, RollInitiativeForAll, SetInitiative { combatant: Uuid, total: i16, }, Start, NextTurn, Damage { combatant: Uuid, amount: u32, }, Heal { combatant: Uuid, amount: u32, }, SetTemporaryHitPoints { combatant: Uuid, amount: u16, }, AddEffect { effect: NewEffect, }, RemoveEffect { effect: Uuid, }, CastSpell { caster: Uuid, spell: String, slot: Option<SpellSlot>, targets: Vec<Uuid>, concentration: Option<Uuid>, }, UseFeature { combatant: Uuid, feature: String, amount: u16, }, Pause, Resume, End, Undo { command: Option<Uuid>, },
}
Expand description

What a participant wants to happen. Turned into events by decide.

Variants§

§

AddCombatant

Join the combat, at any point. If initiative is already set the combatant slots straight into the turn order.

Fields

§combatant: Combatant
§

AddMonsters

Add count of a monster from the campaign’s monsters, named and numbered on from any already in the fight (“Goblin 3”), at their maximum hit points or, with roll, rolled. Only the server can decide this (it needs the stat block and dice); see super::add_monsters.

Fields

§monster: Uuid
§count: u16
§roll: bool
§

RemoveCombatant

Fields

§combatant: Uuid
§

RollInitiative

Roll d20 + modifier. Pass roll when the player rolled physical dice; leave it out to have the server roll.

Fields

§combatant: Uuid
§roll: Option<u8>
§

RollInitiativeForAll

Server rolls for everyone who hasn’t got initiative yet.

§

SetInitiative

Fields

§combatant: Uuid
§total: i16
§

Start

§

NextTurn

§

Damage

Fields

§combatant: Uuid
§amount: u32
§

Heal

Fields

§combatant: Uuid
§amount: u32
§

SetTemporaryHitPoints

Fields

§combatant: Uuid
§amount: u16
§

AddEffect

Fields

§effect: NewEffect
§

RemoveEffect

Fields

§effect: Uuid
§

CastSpell

Record a spell cast in the log. The slot is spent on the caster’s character sheet, separately; slot says which, for the record. For a concentration spell, concentration is the id of the effect that puts it into play on its targets (ending the caster’s previous concentration).

Fields

§caster: Uuid
§spell: String
§targets: Vec<Uuid>
§concentration: Option<Uuid>
§

UseFeature

Use a limited feature (Rage, Action Surge…). For a character, the combat service spends the uses on their sheet first.

Fields

§combatant: Uuid
§feature: String
§amount: u16
§

Pause

Interrupt an active combat. While paused, only Resume and End are accepted.

§

Resume

§

End

§

Undo

Take back one of the sender’s own earlier commands: command, or when that’s left out, their latest one not yet undone. Only the server can decide this (it needs the log); see super::undo.

Fields

§command: Option<Uuid>

Implementations§

Source§

impl CombatCommand

Source

pub fn sheet_cost(&self) -> Option<(Uuid, SheetCost)>

What running this costs the sheet of which combatant, if anything.

Trait Implementations§

Source§

impl Clone for CombatCommand

Source§

fn clone(&self) -> CombatCommand

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 ComposeSchema for CombatCommand

Source§

fn compose(generics: Vec<RefOr<Schema>>) -> RefOr<Schema>

Source§

impl Debug for CombatCommand

Source§

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

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

impl<'de> Deserialize<'de> for CombatCommand

Source§

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 CombatCommand

Source§

fn eq(&self, other: &CombatCommand) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for CombatCommand

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl ToSchema for CombatCommand

Source§

fn name() -> Cow<'static, str>

Return name of the schema. Read more
Source§

fn schemas(schemas: &mut Vec<(String, RefOr<Schema>)>)

Implement reference [utoipa::openapi::schema::Schema]s for this type. Read more
Source§

impl Eq for CombatCommand

Source§

impl StructuralPartialEq for CombatCommand

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
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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.

§

impl<T> PartialSchema for T
where T: ComposeSchema + ?Sized,

§

fn schema() -> RefOr<Schema>

Return ref or schema of implementing type that can then be used to construct combined schemas.
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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,