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: WaveIdUnique wave id.
anchor: AnchorIdThe anchor the wave’s mobs spawn at.
mobs: Vec<WaveMob>The mobs that make up the wave (1..N).
respawns_on_rest: boolRe-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<'de> Deserialize<'de> for Wave
impl<'de> Deserialize<'de> for Wave
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 JsonSchema for Wave
impl JsonSchema for Wave
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more