Redesign and reimplement inventory menu

Add jewels but no implementation yet (needed redesign of inventory menu to function correctly)
This commit is contained in:
2026-02-11 04:08:42 -08:00
parent 5451f0b31f
commit 8ce38c3c13
51 changed files with 1695 additions and 256 deletions

View File

@@ -11,6 +11,7 @@ using Zennysoft.Game.Abstractions;
using Zennysoft.Ma.Adapter;
using System.IO;
using System.Threading.Tasks;
using Zennysoft.Game.Implementation;
[Meta(typeof(IAutoNode))]
public partial class Game : Node3D, IGame
@@ -226,6 +227,9 @@ public partial class Game : Node3D, IGame
case ThrowableItem throwableItem:
EnactThrowableItemEffects(throwableItem);
break;
case Jewel jewel:
EnactJewelItemEffects(jewel);
break;
}
await ToSignal(GetTree().CreateTimer(0.3f), "timeout");
@@ -240,6 +244,7 @@ public partial class Game : Node3D, IGame
dropped.Item = item;
_map.AddChild(dropped);
dropped.Drop();
_player.Inventory.Remove(item);
}
public void SetItem(InventoryItem item)
@@ -248,6 +253,7 @@ public partial class Game : Node3D, IGame
var setItem = setScene.Instantiate<SetItem>();
_map.AddChild(setItem);
setItem.Set();
_player.Inventory.Remove(item);
}
public void ThrowItem(InventoryItem item)
@@ -257,6 +263,7 @@ public partial class Game : Node3D, IGame
thrown.ItemThatIsThrown = item;
_map.AddChild(thrown);
thrown.Throw(_effectService);
_player.Inventory.Remove(item);
}
public IDungeonFloor CurrentFloor => _map.CurrentFloor;
@@ -560,9 +567,6 @@ public partial class Game : Node3D, IGame
_effectService.TeleportToRandomRoom(_player);
GameRepo.CloseInventory();
break;
case ThrowableItemTag.CanChangeAffinity:
_effectService.ChangeAffinity(throwableItem);
break;
case ThrowableItemTag.WarpToExitIfFound:
_effectService.WarpToExit();
GameRepo.CloseInventory();
@@ -575,10 +579,17 @@ public partial class Game : Node3D, IGame
_player.VTComponent.Restore(throwableItem.HealVTAmount);
}
private void EnactJewelItemEffects(Jewel jewel)
{
switch (jewel.Stats.JewelTag)
{
//case JewelTags.AeolicElement
}
}
private void RemoveItemOrSubtractFromItemCount(InventoryItem item)
{
if (item is IStackable stackableItem && stackableItem.Count > 1)
stackableItem.SetCount(stackableItem.Count - 1);
if (item is IStackable stackableItem && stackableItem.Count.Value > 1)
stackableItem.SetCount(stackableItem.Count.Value - 1);
else
_player.Inventory.Remove(item);
}