QOL and Inventory

This commit is contained in:
dingo
2026-01-21 13:34:05 -05:00
parent a1c6140143
commit 0863fe1a9f
4 changed files with 146 additions and 7 deletions
+25 -1
View File
@@ -368,7 +368,31 @@ public partial class DungeonSimulation
{
UpdatePlayer(player);
}
// Handle corpse cleanup (remove corpses 10 seconds after loot is empty)
var corpsesToRemove = new List<int>();
foreach (var mob in Mobs.Values.Where(m => !m.IsAlive))
{
// Check if loot just became empty
if (!mob.HasDeathLoot && !mob.LootEmptiedAtTick.HasValue)
{
mob.LootEmptiedAtTick = CurrentTick;
}
// Remove corpse 10 seconds after loot emptied (10 ticks per second)
if (mob.LootEmptiedAtTick.HasValue &&
CurrentTick - mob.LootEmptiedAtTick.Value >= 10 * TicksPerSecond)
{
corpsesToRemove.Add(mob.Id);
}
}
// Remove corpses
foreach (var mobId in corpsesToRemove)
{
Mobs.Remove(mobId, out _);
}
// Check dungeon completion
if (Mobs.Values.All(m => !m.IsAlive))
{