Sequence primary weapon replacement through the server-confirmed AutoWield transaction: return the occupied weapon to the player pack, wait for its move event, then wield the requested item. Route authoritative CombatMode property updates so peace stays peace and war adopts the new weapon stance without client-synthesized animation. Co-Authored-By: Codex <codex@openai.com>
42 lines
1.3 KiB
C#
42 lines
1.3 KiB
C#
using AcDream.Core.Combat;
|
|
|
|
namespace AcDream.Core.Net.Tests;
|
|
|
|
/// <summary>
|
|
/// Conformance pins for retail ClientCombatSystem::OnQualityChanged
|
|
/// (0x0056C1B0): player PropertyInt 40 is the authoritative combat mode.
|
|
/// </summary>
|
|
public sealed class CombatStateWiringTests
|
|
{
|
|
[Theory]
|
|
[InlineData((int)CombatMode.NonCombat)]
|
|
[InlineData((int)CombatMode.Melee)]
|
|
[InlineData((int)CombatMode.Missile)]
|
|
[InlineData((int)CombatMode.Magic)]
|
|
public void CombatModeProperty_appliesConcreteRetailMode(int value)
|
|
{
|
|
var combat = new CombatState();
|
|
|
|
Assert.True(CombatStateWiring.ApplyPlayerIntProperty(
|
|
combat,
|
|
CombatStateWiring.CombatModePropertyId,
|
|
value));
|
|
|
|
Assert.Equal((CombatMode)value, combat.CurrentMode);
|
|
}
|
|
|
|
[Theory]
|
|
[InlineData(39u, (int)CombatMode.Missile)]
|
|
[InlineData(40u, (int)CombatMode.Undef)]
|
|
[InlineData(40u, (int)CombatMode.ValidCombat)]
|
|
[InlineData(40u, 0x10)]
|
|
public void NonCombatQualityOrInvalidValue_isIgnored(uint property, int value)
|
|
{
|
|
var combat = new CombatState();
|
|
|
|
Assert.False(CombatStateWiring.ApplyPlayerIntProperty(
|
|
combat, property, value));
|
|
|
|
Assert.Equal(CombatMode.NonCombat, combat.CurrentMode);
|
|
}
|
|
}
|