mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-06 17:55:54 +00:00
Chests and strafing speed
This commit is contained in:
parent
0ccc272ada
commit
b645e1724e
17 changed files with 286 additions and 21 deletions
|
|
@ -1,19 +1,29 @@
|
|||
using Godot;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Cirno.Scripts;
|
||||
using Cirno.Scripts.Resources;
|
||||
using Godot.Collections;
|
||||
|
||||
public partial class Pickupper : Activable
|
||||
{
|
||||
private InventoryManager _inventoryManager;
|
||||
|
||||
private InventoryManager inventoryManager;
|
||||
[Export] public Array<LootItem> LootTable = new Array<LootItem>();
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
inventoryManager = GetNode<InventoryManager>("/root/GameScene/InventoryManager");
|
||||
}
|
||||
|
||||
public override void Activate()
|
||||
{
|
||||
inventoryManager.AddRedKeycard();
|
||||
GetParent().QueueFree();
|
||||
}
|
||||
}
|
||||
public override void _Ready()
|
||||
{
|
||||
_inventoryManager = GetNode<InventoryManager>("/root/GameScene/InventoryManager");
|
||||
}
|
||||
|
||||
public override void Activate()
|
||||
{
|
||||
foreach (var item in LootTable)
|
||||
{
|
||||
_inventoryManager.AddItem(item.Item, item.Amount);
|
||||
}
|
||||
|
||||
//inventoryManager.AddRedKeycard();
|
||||
GetParent().QueueFree(); // TODO: send a signal instead
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue