delurbelako/scripts/structures/debug_item_deposit.gd
2025-10-15 09:35:37 +05:00

9 lines
476 B
GDScript

extends Node
const test_item :=preload("res://generic/items/dbg_item.tres")
func _process(_delta: float) -> void:
for point in [Vector2(-1,0),Vector2(1,0),Vector2(0,1),Vector2(0,-1)]:
var found_structure :Structure = get_parent().get_relative(point)
if found_structure and found_structure.inventory:
found_structure.inventory.add_from_side(Stack.new(test_item,randi_range(1,test_item.stack_size)),Structure.facing_to_vector(found_structure.facing).angle_to(point))