cirnogodot/Scripts/Interactables/ItemPickup.cs

26 lines
620 B
C#
Raw Normal View History

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
{
2025-03-23 16:39:47 +01:00
[Export] public Array<LootItem> LootTable = [];
2025-01-31 10:06:27 +01:00
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;
}
}