bear fx v2

This commit is contained in:
2026-08-28 21:43:59 +03:00
parent 6b6a926715
commit 41f18cb5d6
16 changed files with 3483 additions and 294 deletions
+3 -18
View File
@@ -78,9 +78,7 @@ const _BULL_STANDOFF: float = 1.9
@onready var _mesh: Node3D = $bear_model
@onready var _hit_area: Area3D = $HitArea
var _dust: CPUParticles3D = null
# Claw-slash bursts bound to the paw bones, fired one per hit of the 1-2 punch.
var _claw_l: CPUParticles3D = null
var _claw_r: CPUParticles3D = null
const RigidSkin = preload("res://rigid_skin.gd")
@@ -116,7 +114,6 @@ func _ready() -> void:
_hit_area.body_entered.connect(_on_body_entered)
_blood_burst = preload("res://blood_burst.gd").new()
add_child(_blood_burst)
_dust = _make_slam_dust()
add_child(_dust)
_setup_claws()
_enter_neutral()
@@ -166,8 +163,6 @@ func _clear_hit_flash() -> void:
func _setup_claws() -> void:
if _skeleton == null:
return
_claw_r = _attach_claw("hand_r")
_claw_l = _attach_claw("hand_l")
func _attach_claw(bone: String) -> CPUParticles3D:
@@ -395,11 +390,9 @@ func _tick_swipe(delta: float) -> void:
if _hits_done == 0 and frac >= 0.25:
_hits_done = 1
_try_hit(DP.f("bear_swipe_reach"))
_claw_slash(true) # first paw (right) rakes across
elif _hits_done == 1 and frac >= 0.65:
_hits_done = 2
_try_hit(DP.f("bear_swipe_reach"))
_claw_slash(false) # back-hand with the left paw
if _phase_timer <= 0.0:
_begin_recover(DP.f("bear_swipe_recover"))
Phase.RECOVER:
@@ -601,7 +594,7 @@ func _slam_dust() -> void:
_dust.restart()
_dust.emitting = true
"
# Tan ground-impact dust: a fast, wide, low burst that arcs up and settles — built in code
# so the Bear scene needs no extra particle node.
func _make_slam_dust() -> CPUParticles3D:
@@ -649,15 +642,7 @@ func _make_slam_dust() -> CPUParticles3D:
p.scale_amount_min = 0.6
p.scale_amount_max = 1.4
return p
# Fire the claw-slash burst on one paw for a swipe hit (right paw first, then left).
func _claw_slash(right: bool) -> void:
var claw := _claw_r if right else _claw_l
if claw == null:
return
claw.restart()
claw.emitting = true
"
# A short fan of pale streaks raked from a paw — thin boxes aligned to their velocity so