Fix inventory menu, add armor as equippable item

This commit is contained in:
2024-09-07 01:01:50 -07:00
parent dc035eb1fe
commit b478ad39fe
23 changed files with 305 additions and 84 deletions

View File

@@ -1,8 +1,26 @@
using Chickensoft.AutoInject;
using Chickensoft.Introspection;
using GameJamDungeon;
using Godot;
using System.Linq;
[Meta(typeof(IAutoNode))]
public partial class Armor : InventoryItem
{
public override void _Notification(int what) => this.Notify(what);
[Export]
public override InventoryItemInfo InventoryInfo { get; set; }
public void OnReady()
{
Pickup.BodyEntered += OnEntered;
}
public void OnEntered(Node3D body)
{
var inventoryList = GameRepo.InventoryItems.Value.Append(InventoryInfo).ToList();
GameRepo.InventoryItems.OnNext(inventoryList);
QueueFree();
}
}