2025-01-31 10:06:27 +01:00
|
|
|
|
using Cirno.Scripts.Resources;
|
|
|
|
|
|
using Godot;
|
|
|
|
|
|
using Godot.Collections;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Cirno.Scripts.Interactables;
|
|
|
|
|
|
|
|
|
|
|
|
public partial class ItemPickup : Interactable
|
|
|
|
|
|
{
|
|
|
|
|
|
[Export] public Array<LootItem> LootTable = new Array<LootItem>();
|
|
|
|
|
|
|
2025-03-09 21:58:25 +01:00
|
|
|
|
public override bool Activate(ActivationType activationType = ActivationType.Toggle)
|
2025-01-31 10:06:27 +01:00
|
|
|
|
{
|
|
|
|
|
|
GD.Print("Attempting to Pickup Item");
|
|
|
|
|
|
|
|
|
|
|
|
if (!MeetsRequirements()) return false;
|
|
|
|
|
|
foreach (var item in LootTable)
|
|
|
|
|
|
{
|
2025-03-02 16:48:18 +01:00
|
|
|
|
InventoryManager.Instance.AddItem(item);
|
2025-01-31 10:06:27 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Delet This
|
|
|
|
|
|
QueueFree();
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|