DeathLoot
This commit is contained in:
@@ -25,6 +25,11 @@ public class DungeonSimulation
|
||||
public ConcurrentDictionary<int, ChestInstance> Chests { get; } = new();
|
||||
public ConcurrentDictionary<int, DroppedItem> DroppedItems { get; } = new();
|
||||
public ConcurrentDictionary<int, PortalInstance> Portals { get; } = new();
|
||||
public ConcurrentDictionary<int, LootChestInstance> LootChests { get; } = new();
|
||||
|
||||
// ID generator for loot chests
|
||||
private int _nextLootChestId = 1;
|
||||
public int GetNextLootChestId() => _nextLootChestId++;
|
||||
|
||||
// Combat tracking
|
||||
private readonly List<DamageEvent> _pendingDamageEvents = new();
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
namespace Server.Game.Dungeon;
|
||||
|
||||
/// <summary>
|
||||
/// Runtime instance of a personal loot chest (from death overflow)
|
||||
/// Only visible to the owner player
|
||||
/// </summary>
|
||||
public class LootChestInstance
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public ulong DatabaseId { get; set; } // Reference to DeathChest in DB
|
||||
|
||||
public float X { get; set; }
|
||||
public float Y { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Character ID who can see/access this chest
|
||||
/// </summary>
|
||||
public ulong OwnerCharacterId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gold stored in this chest
|
||||
/// </summary>
|
||||
public long Gold { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Items in the chest (100 slots max)
|
||||
/// </summary>
|
||||
public List<LootChestItem> Items { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Whether the chest is currently open by the owner
|
||||
/// </summary>
|
||||
public bool IsOpen { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Check if chest is empty and can be removed
|
||||
/// </summary>
|
||||
public bool IsEmpty => Items.Count == 0 && Gold == 0;
|
||||
}
|
||||
|
||||
public class LootChestItem
|
||||
{
|
||||
public int SlotIndex { get; set; }
|
||||
public int ItemDefinitionId { get; set; }
|
||||
public int Quantity { get; set; }
|
||||
}
|
||||
@@ -3,6 +3,23 @@ using Server.Data.Enums;
|
||||
|
||||
namespace Server.Game.Dungeon;
|
||||
|
||||
/// <summary>
|
||||
/// Loot carried by a mob from killing a player
|
||||
/// </summary>
|
||||
public class CarriedLoot
|
||||
{
|
||||
public ulong VictimCharacterId { get; set; }
|
||||
public string VictimName { get; set; } = "";
|
||||
public List<CarriedLootItem> Items { get; set; } = new();
|
||||
public long Gold { get; set; }
|
||||
}
|
||||
|
||||
public class CarriedLootItem
|
||||
{
|
||||
public int ItemDefinitionId { get; set; }
|
||||
public int Quantity { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Runtime instance of a mob in a dungeon
|
||||
/// </summary>
|
||||
@@ -34,6 +51,14 @@ public class MobInstance
|
||||
public int SpriteWidth { get; set; } = 32;
|
||||
public int SpriteHeight { get; set; } = 32;
|
||||
public string TintColor { get; set; } = "#ffffff";
|
||||
|
||||
// Carried loot from player kills
|
||||
public List<CarriedLoot> CarriedPlayerLoot { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Check if this mob is carrying loot from player kills
|
||||
/// </summary>
|
||||
public bool HasCarriedLoot => CarriedPlayerLoot.Count > 0;
|
||||
}
|
||||
|
||||
public enum MobState
|
||||
|
||||
Reference in New Issue
Block a user