mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-09 19:25:54 +00:00
Multicolored keycards
This commit is contained in:
parent
ad985ce1ac
commit
5110cace07
17 changed files with 273 additions and 22 deletions
26
Scripts/Interactables/ItemPickup.cs
Normal file
26
Scripts/Interactables/ItemPickup.cs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
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.AddItem(item.Item, item.Amount);
|
||||
}
|
||||
|
||||
// Delet This
|
||||
QueueFree();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue