feat(battlenode): emit engine-resolved clan/tribe on knownList entries (M-HC-4e)

Prod always emits clan (int ClanType) + tribe (comma-joined int TribeType
string, "0" for none) on every knownList entry (battle-traffic_tk2_regular
.ndjson). Source both off the resolved engine (SessionBattleEngine.PlayedCardClan/
PlayedCardTribe -> BattleCardBase.Clan/Tribe), so skill-applied clan/tribe
changes ride the wire rather than the static card-master value. Thread through
KnownListBuilder.BuildPlayedCard + PlayActionsHandler; add clan/tribe to the
KnownCardEntry DTO (always present, non-null). Node-side only; no engine edits,
drift clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-06-07 00:11:28 -04:00
parent daaec20afb
commit 693fba5003
7 changed files with 228 additions and 21 deletions

View File

@@ -43,15 +43,27 @@ public sealed record SelectCardEntry(
/// the played card's accumulated spell-charge count read straight off the resolved engine
/// (<c>SessionBattleEngine.PlayedCardSpellboost</c>); the wire-derived spellboost bookkeeping is retired.
/// Cost already folds the discount in by construction; the count rides the entry only to stay prod-faithful
/// (prod sends the real count). attachTarget stays ""; clan/tribe remain deferred (receiver re-derives
/// them from cardId).</summary>
/// (prod sends the real count).
/// <para><c>clan</c> and <c>tribe</c> are likewise ENGINE-SOURCED (M-HC-4e) — read off the resolved card's
/// <c>BattleCardBase.Clan</c>/<c>BattleCardBase.Tribe</c> getters (via
/// <c>SessionBattleEngine.PlayedCardClan</c>/<c>PlayedCardTribe</c>), which fold in
/// any skill-applied clan/tribe CHANGE/ADD (e.g. <c>change_affiliation</c>), so the wire carries the LIVE
/// clan/tribe the engine resolved, not the static card-master value. PROD ALWAYS EMITS BOTH on every
/// knownList entry (tk2 capture <c>battle-traffic_tk2_regular.ndjson</c>, e.g.
/// <c>{idx:17,cardId:128821011,...,clan:8,tribe:"7,16",...}</c>): <c>clan</c> is the int <c>ClanType</c>
/// ordinal (present even when 0); <c>tribe</c> is the comma-joined int <c>TribeType</c> ordinals as a
/// STRING, <c>"0"</c> when the card has no tribe (== <c>ClanType/TribeType.ALL == 0</c>, never empty/omitted —
/// the client reads it via <c>item.Value.ToString()</c>, NetworkBattleReceiver.cs:2382). Both are always
/// present (non-null string for tribe), so neither is null-omitted. attachTarget stays "".</para></summary>
public sealed record KnownCardEntry(
[property: JsonPropertyName("idx")] int Idx,
[property: JsonPropertyName("cardId")] long CardId,
[property: JsonPropertyName("to")] int To,
[property: JsonPropertyName("spellboost")] int Spellboost,
[property: JsonPropertyName("attachTarget")] string AttachTarget,
[property: JsonPropertyName("cost")] int Cost);
[property: JsonPropertyName("cost")] int Cost,
[property: JsonPropertyName("clan")] int Clan,
[property: JsonPropertyName("tribe")] string Tribe);
/// <summary>Renamed <c>targetList</c> entry. <c>isSelf</c> is actor-relative and passes through
/// verbatim — no perspective flip (bullet-3 audit F2).</summary>