compw00ter โ Incidents / Traits / Powers rewrite (with bosses)
Date: 2026-07-16 Goal: Replace the open-ended incident-types catalogue with a fixed set of incidents, make traits cause them and powers clear them, and wire the whole thing live in the launch game โ including two bosses (The Wife, The Martin).
Decisions below were agreed by grilling the user; this supersedes the earlier
2026-07-06-...-power-trait-incident-model sketch and the editable incident_types catalogue.
1. Incidents โ a FIXED set of 7
Defined in config.php as W00T_INCIDENTS (ordered map key โ metadata). The set is
code-fixed (no add/remove); only each incident's messages + sounds are editable.
| key | Label | kind | halts w00ting | how it clears | notes |
|---|---|---|---|---|---|
pee |
Pee | puddle | no | mop (~5s) or a power | universal: full Bladder (existing) |
poo |
Poo | puddle | no | mop (~60s, collaborative) or a power | universal: too drunk+weird (existing) |
spillage |
Spillage | puddle | no | mop (~8s) or a power | trait-only (spilt booze) |
smoke_break |
Smoke break | status | no | timer (~25s) | force-walks all smokers to the communal area, locks them |
internet_fail |
Internet fail | global | YES | power only | not moppable |
the_wife |
The Wife | boss | YES | power only | boss entity; halts everything |
the_martin |
The Martin | boss | no | power only | boss entity; pulls all players toward him |
Metadata shape (per incident): label, kind โ puddle|status|global|boss,
halts (bool โ contributes to the global w00t-halt), clear โ mop|power|timer,
clean (mop seconds, puddles), duration (timed incidents), pull (bool, the Martin),
universal (bladder|drunk, for the two auto-accidents), boss (bool).
Editable content (per incident, stored in incident_types keyed by the fixed key โ
repurposed, not seeded): player_msg, global_msg, player_sound, global_sound.
The Incidents page renders the 7 fixed rows and saves this content; a missing row = blanks.
Every incident is player-caused now, so the global message is always prefixed with the
culprit's name (drop the old player_caused checkbox).
Traits vs bosses as sources
- Traits can cause one of the 5 non-boss incidents (pee/poo/spillage/smoke_break/internet_fail).
- Bosses (
the_wife,the_martin) are summoned by the host from the Commander page (very LAN-party โ the real Wife/Martin turns up). Ambient random boss spawns are a future option.
2. Traits (per hero) โ CAUSE an incident
Fields: name ยท description ยท causes โ [1 of the 5] ยท trigger ยท sound.
Trigger is one of two modes:
- Meter condition โ
trigger_meterat an extremetrigger_direction(high>75/ low<25), fires on crossing the threshold and re-arms only after the meter leaves the extreme (no spam), exactly like today's poo mechanic. - Random โ
randomcheckbox +random_timer(seconds) +random_chance(%). Everyrandom_timerseconds it rolls; on success (< chance%) it fires. Default 50%.
Dropped from the model/UI: severity, effect, trigger_state (columns kept for back-compat).
3. Powers (per hero) โ CLEAR an incident
Fields: name ยท description ยท clears โ [1 of the 7] ยท reach ยท cooldown(s) ยท sound.
- reach โ
aoe|global.aoe: clears all active incidents of that type within 2 tiles of the hero.global: clears all active incidents of that type anywhere.
- cooldown (seconds) โ a power can't be re-fired until it elapses.
- Fired with number keys 1 / 2 / 3 (a hero has up to 3 powers, in editor order).
- Clearing is instant. Powers can clear ANY incident, including bosses and internet_fail (the only way to clear those).
Dropped: scope 3-way (now reach aoe/global), aoe_range (fixed 2), power strength,
flavour, target, provides_meter (columns kept for back-compat).
4. Hero editor
- Add a Smoker checkbox (
heroes.smoker). - Traits/powers rows simplified to the fields above.
5. Live in-game wiring (launch)
Authoritative model stays: PHP + SQLite polling; each client owns its hero and reports.
5.1 Trait evaluation (client, own hero, each tick)
- Meter mode: when the named meter crosses its extreme, fire
causesincident once, re-arm when it leaves the extreme. - Random mode: every
random_timers, roll; on success fire. - Firing = spawn the incident server-side at the hero's position (
issue.php action=spillgeneralised tospawn,type=<incident key>,by=<name>). Global/boss incidents ignore x/y. - The universal accidents remain: full Bladder โ
pee; too drunk+weird โpoo(these already exist; just renamed types). Spillage is trait-only.
5.2 Powers (client)
- Keys 1/2/3 โ the hero's power[0..2]. If off cooldown:
- resolve
clears+reach;aoeโ incidents of that type within 2 tiles of me;globalโ all. - POST
issue.php action=clear type=<key> [reach=aoe x,y | global]; server deletes matching rows. - start the power's cooldown (client-tracked); play the power sound.
- resolve
5.3 Incident effects
- w00t halt:
state.phpsetsblocked = trueif ANY active incident hashalts=true(internet_fail,the_wife). (Was: any issue at all โ now only halting incidents.) - Puddles (pee/poo/spillage): render + mop as today; no longer halt w00ting.
- smoke_break: server row with
expires_at. While active, every smoker client force-walks its hero toward the communal area (nearestcommmap cell) and locks input until it expires; auto-pruned atexpires_at. - the_martin: while active, every client applies a pull โ bias the hero's movement toward the Martin's position each tick (harder to stay at a rig). Cleared only by a power.
- the_wife: global w00t halt (via
halts); cleared only by a power.
5.4 Bosses
- Summoned from Commander (
Summon The Wife/Summon The Martin) โ inserts an issue of that type at the ground-floor entrance. Rendered as a labelled boss marker on the map. - Only a power clears them; The Wife also flips the global halt; The Martin pulls players.
6. Data model changes
- config.php:
W00T_INCIDENTSmap (7). KeepW00T_SEVERITIES,W00T_DIRECTIONS, meters. AddW00T_POWER_REACH = ['aoe','global']. DeprecateW00T_POWER_SCOPES. - traits:
+trigger_kind TEXT('meter'|'random'),+random_timer INTEGER,+random_chance INTEGER. (causes_incident,trigger_meter,trigger_direction,soundalready exist.) - abilities: reuse
counters_typeas clears_incident,scopeas reach (values nowaoe|global). (cooldown,soundexist;aoe_range/power/flavour/target/provides_meterunused.) - heroes:
+smoker INTEGER DEFAULT 0. - issues:
+expires_at INTEGER(0 = never). type โ the 7 keys. Keep clean_needed/clean_done (puddles). Bosses/global rows use x/y where relevant (bosses positional, internet_fail global). - incident_types: repurposed to store per-incident editable content for the 7 fixed keys (rows created on save only โ no seeding). Add/remove removed from the UI.
7. Out of scope / future
- Ambient random boss spawns (host-summon only for now).
- Per-room internet fail (global only).
- Trait meter thresholds beyond high/low.
- PvP brawler.
8. Testing
php -lall; smoke repos (trait/power/incident round-trips, incident content).- Playwright: Incidents page (7 fixed rows) save; hero editor trait(meter/random)+power+smoker round-trip; in-game โ trait fires an incident, power key clears it (AoE + global), internet_fail & The Wife halt w00t, smoke_break walks a smoker to the comm area + locks, The Martin pulls players, Commander summons bosses. Zero console errors.