fix(combat): match retail live attack feedback

Keep AttackDone control statuses out of chat, preserve dead motion across zero-velocity position updates, render the authored power meter from right to left, and retain the rotatable viewer offset during target tracking.

Co-Authored-By: Codex <codex@openai.com>
This commit is contained in:
Erik 2026-07-11 21:10:01 +02:00
parent 33cc9aa16a
commit 5276a83087
16 changed files with 231 additions and 67 deletions

View file

@ -91,23 +91,20 @@ public sealed class CombatChatTranslatorTests
}
[Fact]
public void AttackDone_NonZeroError_EmitsErrorLine()
public void AttackDone_NonZeroControlStatus_EmitsNothing()
{
var (chat, combat, _) = Setup();
combat.OnAttackDone(attackSequence: 7, weenieError: 0x1234u);
combat.OnAttackDone(attackSequence: 7, weenieError: 0x0036u);
var entry = Assert.Single(chat.Snapshot());
Assert.Equal(ChatKind.Combat, entry.Kind);
Assert.Equal(CombatLineKind.Error, entry.CombatKind);
Assert.Contains("Attack sequence finished with", entry.Text);
Assert.Contains("0x1234", entry.Text);
// Retail HandleAttackDoneEvent consumes this only as control state.
// ACE deliberately uses ActionCancelled to reset the meter and sends
// a separate WeenieError event for any player-visible failure.
Assert.Empty(chat.Snapshot());
}
[Fact]
public void AttackDone_ZeroError_EmitsNothing()
{
// Holtburger silently logs a debug-tag line; we omit since chat
// panel doesn't surface debug entries.
var (chat, combat, _) = Setup();
combat.OnAttackDone(attackSequence: 7, weenieError: 0u);

View file

@ -96,6 +96,12 @@ public sealed class WeenieErrorMessagesTests
WeenieErrorMessages.Format(0x050F, null));
}
[Theory]
[InlineData(0x0036u, "Action cancelled!")]
[InlineData(0x003Du, "You charged too far!")]
public void Format_CombatMovementErrors(uint code, string expected)
=> Assert.Equal(expected, WeenieErrorMessages.Format(code, null));
// ── unknown codes — graceful fallback preserves debug info ───────
[Fact]