Item spawning

This commit is contained in:
2024-09-08 14:19:30 -07:00
parent 29a6d1072c
commit a47d1306b9
417 changed files with 17412 additions and 1019 deletions

View File

@@ -9,23 +9,21 @@ public partial class Armor : InventoryItem
{
public override void _Notification(int what) => this.Notify(what);
[Export]
internal override InventoryItemInfo Info { get; set; }
public new InventoryItemInfo Info => ArmorInfo;
public ArmorInfo ArmorInfo { get => (ArmorInfo)Info; }
[Export]
public ArmorInfo ArmorInfo { get; set; }
public void OnReady()
{
Sprite.Texture = ArmorInfo.Texture;
Pickup.BodyEntered += OnEntered;
}
public void OnEntered(Node body)
public void OnEntered(Node3D body)
{
if (GameRepo.InventoryItems.Value.Count() >= GameRepo.MaxItemSize)
{
AnimationPlayer.Play("drop");
return;
}
var inventoryList = GameRepo.InventoryItems.Value.Append(this).ToList();
GameRepo.InventoryItems.OnNext(inventoryList);