Loot change

This commit is contained in:
dingo
2026-01-21 08:43:18 -05:00
parent 5aa92abce8
commit 85c95e9f6a
3 changed files with 83 additions and 16 deletions
+9 -15
View File
@@ -114,17 +114,13 @@ func update_data(data: Dictionary):
_initialized = true
# Update visual state
#var state = data.get("state", data.get("State", "idle")).to_lower()
#var rotation = data.get("rotation", data.get("Rotation", 0.0))
#
#_update_animation_state(state, rotation)
var raw_state = data.get("state", data.get("State", "idle")).to_lower()
var animation_state := _state_to_animation(raw_state)
var rotation = data.get("rotation", data.get("Rotation", 0.0))
# Update visual state (skip for dead mobs to preserve death animation)
if _current_state != "dead":
var raw_state = data.get("state", data.get("State", "idle")).to_lower()
var animation_state := _state_to_animation(raw_state)
var rotation = data.get("rotation", data.get("Rotation", 0.0))
_update_animation_state(animation_state, rotation)
_update_animation_state(animation_state, rotation)
# Apply scale
@@ -536,15 +532,13 @@ func play_death_animation():
break
if death_anim_name != "":
# Disable looping for death animation BEFORE playing
_animated_sprite.sprite_frames.set_animation_loop(death_anim_name, false)
# Play the death animation
_last_animation = death_anim_name
_animated_sprite.play(death_anim_name)
# Wait for animation to finish
if _animated_sprite.sprite_frames.get_animation_loop(death_anim_name):
# If it loops, disable looping temporarily
_animated_sprite.sprite_frames.set_animation_loop(death_anim_name, false)
# Wait for animation to complete
await _animated_sprite.animation_finished