51 lines
1.7 KiB
C#
51 lines
1.7 KiB
C#
using System.Text.Json.Serialization;
|
|
|
|
namespace NeonSprawl.Server.Game.Npc;
|
|
|
|
/// <summary>JSON body for <c>GET /game/world/npc-behavior-definitions</c> (NEO-90).</summary>
|
|
public sealed class NpcBehaviorDefinitionsListResponse
|
|
{
|
|
public const int CurrentSchemaVersion = 1;
|
|
|
|
[JsonPropertyName("schemaVersion")]
|
|
public int SchemaVersion { get; init; } = CurrentSchemaVersion;
|
|
|
|
/// <summary>Loaded behavior defs ordered by stable <c>id</c> (ordinal), matching <see cref="INpcBehaviorDefinitionRegistry.GetDefinitionsInIdOrder"/>.</summary>
|
|
[JsonPropertyName("npcBehaviors")]
|
|
public required IReadOnlyList<NpcBehaviorDefinitionJson> NpcBehaviors { get; init; }
|
|
}
|
|
|
|
/// <summary>One row in the read-only NPC behavior definition projection.</summary>
|
|
public sealed class NpcBehaviorDefinitionJson
|
|
{
|
|
[JsonPropertyName("id")]
|
|
public required string Id { get; init; }
|
|
|
|
[JsonPropertyName("displayName")]
|
|
public required string DisplayName { get; init; }
|
|
|
|
[JsonPropertyName("archetypeKind")]
|
|
public required string ArchetypeKind { get; init; }
|
|
|
|
[JsonPropertyName("maxHp")]
|
|
public required int MaxHp { get; init; }
|
|
|
|
[JsonPropertyName("aggroRadius")]
|
|
public required double AggroRadius { get; init; }
|
|
|
|
[JsonPropertyName("leashRadius")]
|
|
public required double LeashRadius { get; init; }
|
|
|
|
[JsonPropertyName("telegraphWindupSeconds")]
|
|
public required double TelegraphWindupSeconds { get; init; }
|
|
|
|
[JsonPropertyName("attackDamage")]
|
|
public required int AttackDamage { get; init; }
|
|
|
|
[JsonPropertyName("attackCooldownSeconds")]
|
|
public required double AttackCooldownSeconds { get; init; }
|
|
|
|
[JsonPropertyName("attackAbilityId")]
|
|
public required string AttackAbilityId { get; init; }
|
|
}
|