Fix para los items que no caen

This commit is contained in:
Diego De la Viuda Llorente committed 2026-10-21 12:53:19 +02:00
1 parent 5012879591
commit e1e29f02f1
9 files changed
+233 -65

No files matched your search

+9 -4
View File
@@ -98,6 +98,10 @@ enum AttackState {
## object drops with 100% probability INSTEAD of the random table.
@export var guaranteed_drop: PickupData
## In the Android lab, Level01 watches deaths and spawns the fixed reward.
## Other levels keep using this enemy's own random/guaranteed drop logic.
var drops_handled_by_level: bool = false
@export_category("Respawn")
@@ -510,10 +514,11 @@ func _die() -> void:
# Test encounters always drop their assigned item, including the two items
# absent from the normal Walker table. Other levels keep their random loot.
var drops: Array[PickupData] = []
if guaranteed_drop != null:
drops.append(guaranteed_drop)
elif drop_table != null:
drops = DROP_MANAGER.roll_drop(drop_table)
if not drops_handled_by_level:
if guaranteed_drop != null:
drops.append(guaranteed_drop)
elif drop_table != null:
drops = DROP_MANAGER.roll_drop(drop_table)
if not drops.is_empty():
var parent: Node = get_tree().current_scene
if parent == null: