mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 11:15:33 +00:00
graphics and ammo counting
This commit is contained in:
parent
7548cf7d84
commit
dfe936461e
11 changed files with 45 additions and 35 deletions
|
|
@ -65,9 +65,10 @@ public partial class InventoryManager : Node2D
|
|||
|
||||
itm.Count -= amount;
|
||||
|
||||
if (itm.Count <= 0)
|
||||
if (itm.Count < 0)
|
||||
{
|
||||
_itemsDict.Remove(itemKey);
|
||||
itm.Count = 0;
|
||||
//_itemsDict.Remove(itemKey);
|
||||
}
|
||||
|
||||
EmitSignal(SignalName.ItemRemoved, itemKey, itm.Count);
|
||||
|
|
@ -118,17 +119,7 @@ public partial class InventoryManager : Node2D
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void AddRedKeycard()
|
||||
{
|
||||
RedKeycard = true;
|
||||
}
|
||||
|
||||
public void RemoveRedKeycard()
|
||||
{
|
||||
RedKeycard = false;
|
||||
}
|
||||
|
||||
|
||||
public bool UseItem(string itemKey)
|
||||
{
|
||||
if (!_itemsDict.TryGetValue(itemKey, out var itm)) return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue