b451f83174
Captures the pre-Godot-port state of the codebase. This is the rollback anchor for the Godot port (M0 of theriapolis-rpg-implementation-plan-godot-port.md). All Phase 0 through Phase 6.5 work is included; Phase 7 is in flight. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
38 lines
1.2 KiB
C#
38 lines
1.2 KiB
C#
using System.Text.Json.Serialization;
|
|
|
|
namespace Theriapolis.Core.Data;
|
|
|
|
/// <summary>
|
|
/// Loot table — list of weighted drop entries rolled when an NPC with
|
|
/// matching <see cref="NpcTemplateDef.LootTable"/> id falls in combat.
|
|
/// Each drop entry rolls independently against its <see cref="LootDrop.Chance"/>;
|
|
/// successful drops contribute (qty_min..qty_max) of the item.
|
|
///
|
|
/// Phase 5 M6 keeps this stingy by design — most level-1 fights net 1-3
|
|
/// items at most, never enough to obsolete the starting kit.
|
|
/// </summary>
|
|
public sealed record LootTableDef
|
|
{
|
|
[JsonPropertyName("id")]
|
|
public string Id { get; init; } = "";
|
|
|
|
[JsonPropertyName("drops")]
|
|
public LootDrop[] Drops { get; init; } = System.Array.Empty<LootDrop>();
|
|
}
|
|
|
|
public sealed record LootDrop
|
|
{
|
|
[JsonPropertyName("item_id")]
|
|
public string ItemId { get; init; } = "";
|
|
|
|
[JsonPropertyName("qty_min")]
|
|
public int QtyMin { get; init; } = 1;
|
|
|
|
[JsonPropertyName("qty_max")]
|
|
public int QtyMax { get; init; } = 1;
|
|
|
|
/// <summary>0..1 probability this drop fires. Independent of other drops in the table.</summary>
|
|
[JsonPropertyName("chance")]
|
|
public float Chance { get; init; } = 1.0f;
|
|
}
|