Add scene-authored FX library and bull ability effects

An Fx autoload + one_shot_effect base so every effect is an inspector-editable
.tscn (the systems/fx/ authoring dir): blood/slam/spark/flash primitives and the
bull's kick/dash/slam/roll + movement effects (bull_*.tscn), fired via
Fx.spawn() / Fx.attach(). Plus a preview gallery + smoke test, and
bull_impact_fx.gd for the coded, non-particle slam rings + kick flash-pop.

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:56:01 +03:00
parent 9458085abb
commit c0a022fed4
26 changed files with 1174 additions and 0 deletions
+51
View File
@@ -0,0 +1,51 @@
extends SceneTree
## Smoke test for the FX library: every registered effect instantiates and attaches without error,
## and an unknown name fails soft (returns null, no crash). Catches a broken effect .tscn before it
## ships. Run: godot --headless --script tests/fx_gallery_test.gd
var _pass := 0
var _fail := 0
func _init() -> void:
_run.call_deferred()
func _ok(cond: bool, msg: String) -> void:
if cond:
_pass += 1
print(" PASS: ", msg)
else:
_fail += 1
print(" FAIL: ", msg)
func _run() -> void:
var fx: Node = root.get_node("/root/Fx")
var host := Node3D.new()
root.add_child(host)
current_scene = host
for id: StringName in [&"blood_burst", &"slam_dust", &"spark", &"hit_flash",
&"bull_slam", &"bull_kick", &"bull_dash"]:
var inst: Node = fx.call("spawn", id, Transform3D.IDENTITY, host)
_ok(inst != null and is_instance_valid(inst), "spawns %s" % id)
# Continuous bull effects are held (attach), not fired-and-forgotten (spawn).
for id: StringName in [&"bull_hoof_dust", &"bull_charge_trail", &"bull_roll_sparks"]:
var inst: Node = fx.call("attach", id, host)
_ok(inst != null and is_instance_valid(inst), "attaches %s" % id)
var missing: Node = fx.call("spawn", &"does_not_exist", Transform3D.IDENTITY, host)
_ok(missing == null, "unknown effect returns null instead of crashing")
# The preview gallery scene is wired (has its controller script + label).
var gallery: Node = load("res://systems/fx/effect_gallery.tscn").instantiate()
_ok(gallery.get_script() != null, "gallery scene keeps its controller script")
host.add_child(gallery)
await process_frame
_ok(gallery.get_node_or_null("UI/Label") != null, "gallery scene has its name label")
await process_frame
print("Results: %d passed, %d failed" % [_pass, _fail])
quit(1 if _fail > 0 else 0)