Move bull ability FX into the authorable systems/fx/ library
CI / Decide whether to run (push) Has been cancelled
CI / Lint & headless tests (push) Has been cancelled

The bull's kick/dash/slam/roll and movement particles were ~112 lines of
hand-built CPUParticles3D in player.gd, bypassing the Fx system entirely
(Fx.spawn had zero callers) — so Siim couldn't author them in the inspector.

- Add six inspector-editable effect scenes (bull_slam/kick/dash one-shots +
  bull_hoof_dust/charge_trail/roll_sparks continuous); wire player.gd to
  Fx.spawn() / new Fx.attach(); register them + the gallery + smoke test.
- Extract the coded, non-particle slam rings + kick flash into a new
  bull_impact_fx.gd component (bull_legs.gd pattern).
- Drop 12 now-obsolete DP dust look-params (the .tscn owns the look now).
- Trim god-file comment noise: rewrite an AI-placeholder barrel block to typed
  code, drop dead commented-out bounce/topple code, fix stale post-reorg file
  paths (Assets/… → art/…, PascalCase scene names → snake_case).
- Document the Siim workflow in systems/fx/README.md; update CLAUDE.md.

player.gd 1307 → 944 lines. Full suite green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CCyaJPTHCH9EDthpf4A5Sj
This commit is contained in:
2026-09-08 14:35:25 +03:00
parent c742c4ae0e
commit a4d18e4928
18 changed files with 580 additions and 462 deletions
+32 -3
View File
@@ -6,8 +6,9 @@ change to how a hit *feels* is a `.tscn` Siim edits in the inspector — no code
```gdscript
# anywhere in gameplay code
Fx.spawn(&"blood_burst", global_transform) # at a node
Fx.spawn(&"blood_burst", global_transform) # one-shot: fire and forget (self-frees)
Fx.spawn(&"slam_dust", Transform3D(Basis(), point)) # at a world point
var trail := Fx.attach(&"bull_charge_trail", node) # continuous: caller keeps it + toggles .emitting
```
## Siim's workflow
@@ -25,6 +26,33 @@ Fx.spawn(&"slam_dust", Transform3D(Basis(), point)) # at a world point
New effect? Add a `fx/<name>.tscn` (root = `CPUParticles3D` with `one_shot_effect.gd` attached — copy
an existing one), then register its name → path in `fx/fx.gd`.
## Bull ability effects
The bull's moves are wired to effect scenes here, so **you can retune every one in the inspector** —
open the `.tscn`, drag its colour ramp / curves / emission, save. No code.
| Ability | Effect scene(s) | Kind |
|---|---|---|
| Ground slam | `bull_slam.tscn` (dust) | one-shot burst |
| Back-kick | `bull_kick.tscn` — dust **+** its `stones` and `sparks` child emitters | one-shot burst |
| Dash / roll launch | `bull_dash.tscn` | one-shot burst |
| Hoof dust (walking / sprinting) | `bull_hoof_dust.tscn` | continuous |
| Charge trail (the blue streak) | `bull_charge_trail.tscn` | continuous |
| Roll sparks | `bull_roll_sparks.tscn` | continuous |
**Two kinds, edited the same way.** *One-shot* effects fire once and clean themselves up — they show
up in the gallery, so preview and tune them there. *Continuous* effects follow the bull and switch on
and off with what it's doing (dust while moving, the trail during a roll); the gallery can't show
those, so preview one by opening its `.tscn` and ticking **Emitting** on in the inspector's viewport.
Two things stay in code and aren't yours to tune here: the slam's expanding shockwave **rings** and the
kick's white **flash-pop** — those are stretched flat meshes, not particles (`actors/player/bull_impact_fx.gd`).
The dust's *walk-vs-sprint size* is also code (a fixed multiplier); its colour and shape are the `.tscn`.
**Composite effect** (like the kick): one scene, several `CPUParticles3D` — a root plus child emitters.
`one_shot_effect.gd` fires every emitter in the scene together, so you can build a layered hit
(dust + debris + sparks) as one file and tune each layer separately.
## House style (keep effects reading as one game)
**Palette** — pull from these, don't invent per-effect colours:
@@ -52,8 +80,9 @@ the inspector and safe on-device. Keep this constraint when adding effects.
| File | What it is |
|---|---|
| `fx.gd` | The `Fx` autoload — `spawn(name, xform, parent=null)`; name→path registry |
| `one_shot_effect.gd` | Root helper: fires the emitter(s) once, frees the scene when done |
| `fx.gd` | The `Fx` autoload — `spawn()` (one-shot) / `attach()` (continuous); name→path registry |
| `one_shot_effect.gd` | Root helper: fires every emitter in the scene once, frees it when done |
| `blood_burst.tscn` etc. | The effects themselves — **edit these** |
| `bull_*.tscn` | The bull's ability effects (see the table above) — **edit these** |
| `effect_gallery.tscn` | Preview stage (run it to review) |
| `_seed_placeholders.gd` | One-off generator that wrote the first-draft defaults; not used at runtime |