Moved the player inventory and selected slot to VesnaEntity

This commit is contained in:
jonathan
2026-02-04 21:32:24 +01:00
parent 7841252809
commit a6fa4315dc
14 changed files with 166 additions and 221 deletions
@@ -3,6 +3,8 @@ using System.Diagnostics;
using System.Threading.Tasks;
using Babushka.scripts.CSharp.Common.Inventory;
using Babushka.scripts.CSharp.Common.Util;
using Babushka.scripts.CSharp.GameEntity.Entities;
using Babushka.scripts.CSharp.GameEntity.Management;
namespace Babushka.scripts.CSharp.Common.Fight.Actions;
@@ -17,7 +19,7 @@ public class EatBeetrootAction : FighterAction
{
Debug.Assert(FightWorld.Instance.itemBeetrootToEatForHealth != null,
"Item to eat for health has not been set in the FightWorld autoload");
return !InventoryManager.Instance.playerInventory!.HasItems(new ItemInstance
return !EntityManager.Instance.GetUniqueEntity<VesnaEntity>().inventory.HasItems(new ItemInstance
{ blueprint = FightWorld.Instance.itemBeetrootToEatForHealth });
}
@@ -35,7 +37,7 @@ public class EatBeetrootAction : FighterAction
{
var fighter = HappeningData.fighterTurn.Current;
var result = InventoryManager.Instance.playerInventory!.TryRemoveAllItems(
var result = EntityManager.Instance.GetUniqueEntity<VesnaEntity>().inventory.TryRemoveAllItems(
new ItemInstance { blueprint = FightWorld.Instance.itemBeetrootToEatForHealth! });
if (result != InventoryActionResult.Success)