feat(chat): Campaign CH slice CH1 — retail LogTextType color table

Retail colors chat lines by the 34-value wire LogTextType (ACE's
ChatMessageType), NOT by acdream's synthetic 9-value ChatKind. The old
ChatWindowController.RetailChatColor(ChatKind) collapsed distinct retail
colors onto one bucket per ChatKind — e.g. every Channel line rendered
colorLightBlue (Magic's slot) when retail's actual palette spans five
different colors across the Turbine rooms and legacy allegiance family.

Ports ChatInterface::BuildChatColorLookupTable @0x004F31C0 verbatim
(RetailChatColorTable, all 34 RGBA floats read from the PDB-paired
binary's .data section) and threads a new ChatEntry.LogTextType field
through every ingestion site to the correct retail wire value:
HearSpeech/Tell pass the wire chatType through verbatim; Emote/SoulEmote
hard-code 0x0C; the Tell self-echo hard-codes 0x04; legacy ChatChannel
broadcasts derive their type from the channel bit via the new
LegacyChannelChatType helper (ported from the decompiled
Handle_Communication__ChannelBroadcast dispatch, hear vs. own-send);
TurbineChat rooms map through TurbineChatDisplayNames.LogTextType;
CombatChatTranslator's hit/miss/evade lines map to ACE's CombatSelf/
CombatEnemy per Player_Combat.cs; kill/death lines use retail's
decompiled 0x00 Default (not a combat color). ChatWindowController's
transcript now folds LogTextType through RetailChatColorTable with
retail's exact "out-of-range keeps the previous line's color" carry
rule; ChatPanel's combat highlighting sources the same table.

Corrects HearSpeech.cs's doc-comment ChatType legend (4 of 6 entries
were wrong). Adds register row AP-175 for the pre-existing (unchanged)
Popup-renders-in-chat divergence and updates AP-39's stale per-ChatKind
description. Narrows ISSUES #139 — its chat-colors half is done.

Retail renders no chat timestamp prefix path exists in acdream today,
so the "timestamp is always colorGrey 0x0C" rule has nothing to attach
to; noted here per the research doc rather than left silent.

Research: docs/research/2026-08-09-chat-retail-color-table.md
Full Release suite: 11,833 passed / 4 skipped / 0 failed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Erik 2026-08-09 15:23:31 +02:00
parent 8df35d1e18
commit 172c6f9aa3
26 changed files with 1360 additions and 85 deletions

View file

@ -115,7 +115,11 @@ public sealed class CombatChatTranslator : IDisposable
// grows that field, append " Critical hit." here.
"",
FormatAttackConditionsSuffix(0));
_chat.OnCombatLine(line, CombatLineKind.Info);
// Combat_Self (0x16): retail squelch-checks the attacker's OWN
// outgoing-hit notification against ChatMessageType.CombatSelf —
// references/ACE/Source/ACE.Server/WorldObjects/Player_Combat.cs:162-163
// (GameEventAttackerNotification, "You hit X...").
_chat.OnCombatLine(line, CombatLineKind.Info, logTextType: 0x16u);
}
private void HandleDamageTaken(CombatState.DamageIncoming e)
@ -138,21 +142,33 @@ public sealed class CombatChatTranslator : IDisposable
sb.Append('.');
if (e.Critical) sb.Append(" Critical hit.");
sb.Append(FormatAttackConditionsSuffix(0));
_chat.OnCombatLine(sb.ToString(), CombatLineKind.Warning);
// Combat_Enemy (0x15): retail squelch-checks the defender's
// incoming-hit notification against ChatMessageType.CombatEnemy —
// references/ACE/Source/ACE.Server/WorldObjects/Player_Combat.cs:541
// (GameEventDefenderNotification, "X hit you...").
_chat.OnCombatLine(sb.ToString(), CombatLineKind.Warning, logTextType: 0x15u);
}
private void HandleMissedOutgoing(string defenderName)
{
// chat.rs:286-291 — EvasionAttackerNotification:
// "{} evaded your attack."
_chat.OnCombatLine($"{defenderName} evaded your attack.", CombatLineKind.Info);
// Combat_Self (0x16): this is about the LOCAL PLAYER'S OWN attack
// missing — retail squelch-checks GameEventEvasionAttackerNotification
// against CombatSelf, same family as the hit-dealt line above —
// references/ACE/Source/ACE.Server/WorldObjects/Player_Combat.cs:150.
_chat.OnCombatLine($"{defenderName} evaded your attack.", CombatLineKind.Info, logTextType: 0x16u);
}
private void HandleEvadedIncoming(string attackerName)
{
// chat.rs:292-297 — EvasionDefenderNotification:
// "You evaded {}'s attack."
_chat.OnCombatLine($"You evaded {attackerName}'s attack.", CombatLineKind.Info);
// Combat_Enemy (0x15): this is about an ENEMY'S attack (that the
// local player evaded) — retail squelch-checks
// GameEventEvasionDefenderNotification against CombatEnemy —
// references/ACE/Source/ACE.Server/WorldObjects/Player_Combat.cs:345.
_chat.OnCombatLine($"You evaded {attackerName}'s attack.", CombatLineKind.Info, logTextType: 0x15u);
}
private void HandleKillLanded(string victimName, uint victimGuid)
@ -164,7 +180,12 @@ public sealed class CombatChatTranslator : IDisposable
// synthesize a minimal "You killed Foo." line here. The
// detailed sentence (used by retail) arrives separately via
// ChatLog.OnPlayerKilled and is rendered as ChatKind.System.
_chat.OnCombatLine($"You killed {victimName}.", CombatLineKind.Info);
// LogTextType 0x00 Default: retail's own kill/death notification
// handler (VictimNotification 0x01AC + KillerNotification 0x01AD,
// both via ClientCombatSystem::HandleKillerNotificationEvent
// @0x0056C410) calls AddTextToScroll(..., 0, 1, 0) — see
// ChatLog.OnPlayerKilled's identical citation.
_chat.OnCombatLine($"You killed {victimName}.", CombatLineKind.Info, logTextType: 0x00u);
}
// ── Formatters (ported VERBATIM from chat.rs:561-595) ───────────────────