cirnogodot/Scripts/Interactables/ItemPickup.cs
2025-03-02 16:48:18 +01:00

26 lines
No EOL
586 B
C#

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>();
public override bool Activate()
{
GD.Print("Attempting to Pickup Item");
if (!MeetsRequirements()) return false;
foreach (var item in LootTable)
{
InventoryManager.Instance.AddItem(item);
}
// Delet This
QueueFree();
return true;
}
}