2026-01-10 23:17:55 +11:00
|
|
|
extends Control
|
|
|
|
|
|
|
|
|
|
@export var bin_inventory : Inventory
|
|
|
|
|
@export var loot_button : Button
|
|
|
|
|
@export var loot_pool : Array[ItemData]
|
|
|
|
|
|
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
|
|
|
func _ready() -> void:
|
|
|
|
|
pass # Replace with function body.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
|
|
|
func _process(delta: float) -> void:
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _on_loot_button_pressed() -> void:
|
2026-01-11 16:37:57 +11:00
|
|
|
if Clock.has_time(10):
|
|
|
|
|
Clock.use_time(10)
|
|
|
|
|
bin_inventory.add_item(pick_random_item())
|
|
|
|
|
|
|
|
|
|
#loot_button.hide()
|
|
|
|
|
#bin_inventory.show()
|
|
|
|
|
#bin_inventory.add_item(pick_random_item())
|
|
|
|
|
#bin_inventory.add_item(pick_random_item())
|
|
|
|
|
#bin_inventory.add_item(pick_random_item())
|
|
|
|
|
#bin_inventory.add_item(pick_random_item())
|
|
|
|
|
#bin_inventory.add_item(pick_random_item())
|
|
|
|
|
#bin_inventory.add_item(pick_random_item())
|
|
|
|
|
#bin_inventory.add_item(pick_random_item())
|
|
|
|
|
#bin_inventory.add_item(pick_random_item())
|
2026-01-10 23:17:55 +11:00
|
|
|
|
|
|
|
|
func pick_random_item() -> ItemData:
|
|
|
|
|
var icount = loot_pool.size()
|
|
|
|
|
return loot_pool[randi() % icount]
|
2026-01-11 17:38:55 +11:00
|
|
|
|
|
|
|
|
|
|
|
|
|
func _on_return_button_pressed() -> void:
|
|
|
|
|
get_tree().change_scene_to_file("res://scenes/workshop.tscn")
|