cirnogodot/Scripts/Interactables/ItemPickup.cs

26 lines
No EOL
620 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 = [];
public override bool Activate(ActivationType activationType = ActivationType.Toggle)
{
GD.Print("Attempting to Pickup Item");
if (!MeetsRequirements()) return false;
foreach (var item in LootTable)
{
InventoryManager.Instance.AddItem(item);
}
// Delet This
QueueFree();
return true;
}
}