+death animation bear

This commit is contained in:
2026-08-24 08:36:48 +03:00
parent e1899e49f4
commit d632670092
4 changed files with 16 additions and 14 deletions
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -27,7 +27,7 @@ shape = SubResource("CapsuleShape3D_hit")
[node name="bear_model" parent="." unique_id=359217823 instance=ExtResource("2_bearglb")]
[node name="Skeleton3D" parent="bear_model/bear-rig" parent_id_path=PackedInt32Array(359217823, 1583139235) index="0" unique_id=1390877201]
[node name="Skeleton3D" parent="bear_model/bear-rig" parent_id_path=PackedInt32Array(359217823, 1596019385) index="0" unique_id=1622005156]
bones/1/position = Vector3(-0.011276185, 0.70064664, 0.6516155)
bones/1/rotation = Quaternion(0.62049717, 0.5337393, -0.48571983, 0.3068907)
bones/2/rotation = Quaternion(0.22357878, -0.0038946574, 0.14433223, 0.9639324)
+14 -12
View File
@@ -57,6 +57,7 @@ var _anim_stand: StringName = &"" # IDLE_standing — reared-up wind-up / ro
var _anim_swipe: StringName = &"" # ONE_TWO_HIT — double swipe
var _anim_smash: StringName = &"" # SMASH_HIT — overhead smash
var _anim_leap: StringName = &"" # JUMP_SMASH — leap slam
var _anim_death: StringName = &"" # DEATH — death
const _ACCEL_FACTOR: float = 9.0
# Hard deceleration for planted states (wind-up / recovery / neutral settle) so the bear
@@ -100,11 +101,12 @@ func _ready() -> void:
_anim_swipe = _resolve_anim(["ONE_TWO_HIT", "SMASH_HIT"])
_anim_smash = _resolve_anim(["SMASH_HIT", "ONE_TWO_HIT"])
_anim_leap = _resolve_anim(["JUMP_SMASH", "SMASH_HIT"])
_anim_death = _resolve_anim(["DEATH"])
# Loop the locomotion / idle clips; the attack clips (swipe/smash/leap) are one-shot,
# so their on-ground settle frames play once and then hold instead of looping.
for a in [_anim_idle, _anim_run, _anim_walk2, _anim_stand]:
_ensure_loop(a)
for a in [_anim_swipe, _anim_smash, _anim_leap]:
for a in [_anim_swipe, _anim_smash, _anim_leap, _anim_death]:
_set_no_loop(a)
_anim_player.playback_default_blend_time = 0.12
_hit_area.body_entered.connect(_on_body_entered)
@@ -735,19 +737,19 @@ func _die(hit_dir: Vector3) -> void:
_hit_area.monitoring = false
velocity = Vector3.ZERO
_blood_burst.burst(global_position + Vector3(0.0, 1.4, 0.0), hit_dir)
_play(_anim_idle)
_play(_anim_death)
# No death clip on the rig — topple the beast onto its side (about the hit direction,
# so it falls the way it was struck) and sink it away, then free.
var fall_axis := Vector3(-hit_dir.z, 0.0, hit_dir.x)
if fall_axis.length() < 0.01:
fall_axis = Vector3.RIGHT
var tween := create_tween()
tween.tween_property(_mesh, "rotation",
_mesh.rotation + fall_axis.normalized() * deg_to_rad(88.0), 0.7)\
.set_trans(Tween.TRANS_QUAD).set_ease(Tween.EASE_IN)
tween.tween_interval(2.5)
tween.tween_property(_mesh, "position:y", _mesh.position.y - 3.0, 1.0)
tween.tween_callback(queue_free)
#var fall_axis := Vector3(-hit_dir.z, 0.0, hit_dir.x)
#if fall_axis.length() < 0.01:
# fall_axis = Vector3.RIGHT
#var tween := create_tween()
#tween.tween_property(_mesh, "rotation",
# _mesh.rotation + fall_axis.normalized() * deg_to_rad(88.0), 0.7)\
# .set_trans(Tween.TRANS_QUAD).set_ease(Tween.EASE_IN)
#tween.tween_interval(2.5)
#tween.tween_property(_mesh, "position:y", _mesh.position.y - 3.0, 1.0)
#tween.tween_callback(queue_free)
# ── Interface shared with the matador (guarded elsewhere via has_method) ─────────────
+1 -1
View File
@@ -191,7 +191,7 @@ func _register_all() -> void:
# routine (wind-up → active → recovery); each routine plays to the end (the recovery
# is the player's punish window). Below bear_enrage_frac HP it enters phase 2: faster
# tells and recovery (× bear_enrage_scale) and longer combo chains.
_reg_f("Bear", "bear_max_hp", 50.0, 1.0, 100.0, 1.0)
_reg_f("Bear", "bear_max_hp", 20.0, 1.0, 100.0, 1.0)
# HP fraction at which phase 2 ("Fury") triggers, and how much it multiplies every
# wind-up / recovery timer (lower = snappier, more dangerous).
_reg_f("Bear", "bear_enrage_frac", 0.4, 0.0, 1.0, 0.05)