Skip to main content

Wave

Struct Wave 

Source
pub struct Wave {
    pub id: WaveId,
    pub anchor: AnchorId,
    pub mobs: Vec<WaveMob>,
    pub respawns_on_rest: bool,
    pub lane: Option<WaveLane>,
    pub summon: Option<WaveSummon>,
    pub tier: Option<EncounterTier>,
    pub health_bar: Option<HealthBar>,
    pub on_kill: Option<OnKill>,
}
Expand description

A combat wave (DSL v0.3): a bundle of mobs spawned at an anchor and slain to complete a kill objective. Emission (spec-0002): a spawn-wave effect summons the mobs tagged dw_wave_<id> (AI enabled — they fight); a player_killed_entity advancement per tag decrements a scoreboard countdown, and the kill objective completes when the count reaches zero.

Fields§

§id: WaveId

Unique wave id.

§anchor: AnchorId

The anchor the wave’s mobs spawn at.

§mobs: Vec<WaveMob>

The mobs that make up the wave (1..N).

§respawns_on_rest: bool

Re-seat this wave every time the party rests at (or respawns from) a bonfire (spec-0016 §1) — the souls contract: progress is kept, the enemies come back. The compiler kills any survivor carrying the wave tag and re-runs the wave’s own spawn function, so the room is restored to its authored composition and spawn cells.

Inert without a bonfire in the campaign, which is a compile error (DW0370) rather than a silent no-op.

§lane: Option<WaveLane>

Tower-defense lane routing (spec-0016 §6): march this wave along a waypoint polyline while distant, hand it to native AI the instant a player is inside aggro_radius. Absent = today’s behaviour (spawn and stand), byte-identical.

§summon: Option<WaveSummon>

Where the wave’s mobs materialize (spec-0016 §6). Absent = WaveSummon::Anchor, the pre-0.6 behaviour: standable cells around the wave anchor.

§tier: Option<EncounterTier>

How hard this encounter is meant to be (DSL v0.7, spec-0023). Absent = EncounterTier::Ordinary, byte-identical to every pre-0.7 campaign.

This is a declaration, not a knob: the compiler never scales content from it (spec-0023 “Out of scope”). It exists because the validation ladder’s inverted floor gate needs to know which fights the content claims are hard — an elite/boss encounter the unassisted bot beats on its first attempt is reported as too easy for its billing. Marking it is how the author opts into that scrutiny; the alternative — inferring “elite” from how tuned a stack looks — is exactly the downstream folklore CLAUDE.md’s no-hack rule forbids.

It does reach emission in exactly one place (spec-0016 §1): in a campaign with a bonfire, a billed elite/ boss wave that does not declare respawns_on_rest is refreshed by a rest while it is still standing — deleted and re-seated at full count and full health, so chipping it down one life at a time is never a path. Beat it and it stays beaten. DW0499 forbids billing a wave boss and respawns_on_rest at once.

§health_bar: Option<HealthBar>

A health bar over this wave’s bodies (DSL v0.31, spec-0073): a named bar over their total health, drawn for every player within range blocks of a live one. Absent = no bar, byte-identical. Declared, never derived from tier; a boss-billed wave without one is advised (DW0912).

§on_kill: Option<OnKill>

What happens each time a player is credited with killing one of this wave’s bodies (spec-0074) — effect root R9, the same OnKill an actor declares. Absent = no bundle, and the wave’s emission is byte-identical.

Trait Implementations§

Source§

impl Clone for Wave

Source§

fn clone(&self) -> Self

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 Wave

Source§

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

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

impl<'de> Deserialize<'de> for Wave

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 JsonSchema for Wave

Source§

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

The name of the generated JSON Schema. Read more
Source§

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

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl PartialEq for Wave

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl Serialize for Wave

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 StructuralPartialEq for Wave

Auto Trait Implementations§

§

impl Freeze for Wave

§

impl RefUnwindSafe for Wave

§

impl Send for Wave

§

impl Sync for Wave

§

impl Unpin for Wave

§

impl UnsafeUnpin for Wave

§

impl UnwindSafe for Wave

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> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.