Move bull ability FX into the authorable systems/fx/ library
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:
@@ -7,10 +7,18 @@ extends Node
|
||||
## placeholder .tscn are seeded — see tools/seed_fx_placeholders.gd.
|
||||
|
||||
const _PATHS: Dictionary = {
|
||||
# Generic hit effects.
|
||||
&"blood_burst": "res://systems/fx/blood_burst.tscn",
|
||||
&"slam_dust": "res://systems/fx/slam_dust.tscn",
|
||||
&"spark": "res://systems/fx/spark.tscn",
|
||||
&"hit_flash": "res://systems/fx/hit_flash.tscn",
|
||||
# Bull ability effects — one-shots fired by spawn(), continuous ones held via attach().
|
||||
&"bull_slam": "res://systems/fx/bull_slam.tscn",
|
||||
&"bull_kick": "res://systems/fx/bull_kick.tscn",
|
||||
&"bull_dash": "res://systems/fx/bull_dash.tscn",
|
||||
&"bull_hoof_dust": "res://systems/fx/bull_hoof_dust.tscn",
|
||||
&"bull_charge_trail": "res://systems/fx/bull_charge_trail.tscn",
|
||||
&"bull_roll_sparks": "res://systems/fx/bull_roll_sparks.tscn",
|
||||
}
|
||||
|
||||
var _cache: Dictionary = {}
|
||||
@@ -32,6 +40,18 @@ func spawn(effect: StringName, xform: Transform3D, parent: Node = null) -> Node:
|
||||
return inst
|
||||
|
||||
|
||||
# Instance a CONTINUOUS effect as a child of `parent` and hand it back. Unlike spawn(), it neither
|
||||
# positions nor auto-frees the effect — the caller keeps the reference to place it and toggle
|
||||
# `emitting` (hoof dust that follows the bull, the charge trail). Returns null if unknown/missing.
|
||||
func attach(effect: StringName, parent: Node) -> Node:
|
||||
var scene := _scene(effect)
|
||||
if scene == null or parent == null:
|
||||
return null
|
||||
var inst := scene.instantiate()
|
||||
parent.add_child(inst)
|
||||
return inst
|
||||
|
||||
|
||||
func _scene(effect: StringName) -> PackedScene:
|
||||
if _cache.has(effect):
|
||||
return _cache[effect]
|
||||
|
||||
Reference in New Issue
Block a user