2025-01-20 16:47:15 +01:00
|
|
|
using Godot;
|
|
|
|
|
using System;
|
2025-01-28 14:05:38 +01:00
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using Cirno.Scripts;
|
|
|
|
|
using Cirno.Scripts.Resources;
|
|
|
|
|
using Godot.Collections;
|
2025-01-20 16:47:15 +01:00
|
|
|
|
|
|
|
|
public partial class Pickupper : Activable
|
|
|
|
|
{
|
2025-01-28 14:05:38 +01:00
|
|
|
private InventoryManager _inventoryManager;
|
2025-01-20 21:58:59 +01:00
|
|
|
|
2025-01-28 14:05:38 +01:00
|
|
|
[Export] public Array<LootItem> LootTable = new Array<LootItem>();
|
2025-01-20 21:58:59 +01:00
|
|
|
|
2025-01-28 14:05:38 +01:00
|
|
|
public override void _Ready()
|
|
|
|
|
{
|
|
|
|
|
_inventoryManager = GetNode<InventoryManager>("/root/GameScene/InventoryManager");
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-06 17:57:06 +01:00
|
|
|
public override void Activate(ActivationType activationType = ActivationType.Toggle)
|
2025-01-28 14:05:38 +01:00
|
|
|
{
|
|
|
|
|
foreach (var item in LootTable)
|
|
|
|
|
{
|
2025-02-10 17:29:14 +01:00
|
|
|
_inventoryManager.AddItem(item);
|
2025-01-28 14:05:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//inventoryManager.AddRedKeycard();
|
2025-01-30 17:24:40 +01:00
|
|
|
//GetParent().QueueFree(); // TODO: send a signal instead
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-28 14:05:38 +01:00
|
|
|
}
|
|
|
|
|
}
|