Pick up thrown items

This commit is contained in:
2025-03-27 00:37:16 -07:00
parent 096786f97e
commit 2378030a0f
5 changed files with 53 additions and 8 deletions

View File

@@ -596,6 +596,17 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<ISaveChunk<Play
else
_gameRepo.AnnounceMessageOnMainScreen($"Could not pick up {droppedItem.Item.ItemName}.");
}
if (area.GetParent() is ThrownItem thrownItem)
{
var isAdded = Inventory.TryAdd(thrownItem.ItemThatIsThrown);
if (isAdded)
{
_gameRepo.AnnounceMessageOnMainScreen($"{thrownItem.ItemThatIsThrown.ItemName} picked up.");
thrownItem.QueueFree();
}
else
_gameRepo.AnnounceMessageOnMainScreen($"Could not pick up {thrownItem.ItemThatIsThrown.ItemName}.");
}
if (area.GetParent() is Restorative restorative)
{
_gameRepo.OnRestorativePickedUp(restorative);