Files
systemrevivalserver/Game/Dungeon/MobInstance.cs
T

72 lines
1.8 KiB
C#

using DataServer.Data.Entities;
using DataServer.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>
public class MobInstance
{
public int Id { get; set; }
public int DefinitionId { get; set; }
public string Name { get; set; } = "";
public float X { get; set; }
public float Y { get; set; }
public float Rotation { get; set; }
public float SpawnX { get; set; }
public float SpawnY { get; set; }
public int Health { get; set; }
public int MaxHealth { get; set; }
public bool IsAlive { get; set; } = true;
public DungeonMobCombatStats Stats { get; set; } = new();
public MobState State { get; set; } = MobState.Idle;
public MobType Type { get; set; }
public ulong? TargetId { get; set; }
public long LastAttackTick { get; set; }
// Visual - sprite configuration JSON
public string? SpriteConfigJson { get; set; }
public string TintColor { get; set; } = "#ffffff";
public float Scale { get; set; } = 1.0f;
// 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
{
Idle,
Chasing,
Attacking,
Returning,
Fleeing,
Dead
}