feat(combat): Phase L.1c wire live attack input
This commit is contained in:
parent
d1fb68f419
commit
4874d8595a
6 changed files with 367 additions and 11 deletions
|
|
@ -27,6 +27,51 @@ public enum AttackHeight
|
|||
Low = 3,
|
||||
}
|
||||
|
||||
public enum CombatAttackAction
|
||||
{
|
||||
Low,
|
||||
Medium,
|
||||
High,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retail input-facing combat decisions. The heavyweight parts of the combat
|
||||
/// system remain server authoritative; this helper only maps UI intent to the
|
||||
/// mode / attack-height values sent on the wire.
|
||||
///
|
||||
/// References:
|
||||
/// named-retail ClientCombatSystem::ToggleCombatMode (0x0056C8C0),
|
||||
/// ClientCombatSystem::SetCombatMode (0x0056BE30), and
|
||||
/// ClientCombatSystem::ExecuteAttack (0x0056BB70).
|
||||
/// Cross-check: holtburger DesiredAttackProfile::to_attack_request only emits
|
||||
/// targeted attacks for Melee and Missile modes.
|
||||
/// </summary>
|
||||
public static class CombatInputPlanner
|
||||
{
|
||||
public static CombatMode ToggleMode(
|
||||
CombatMode currentMode,
|
||||
CombatMode defaultCombatMode = CombatMode.Melee)
|
||||
{
|
||||
if ((currentMode & CombatMode.CombatCombat) != 0)
|
||||
return CombatMode.NonCombat;
|
||||
|
||||
return (defaultCombatMode & CombatMode.CombatCombat) != 0
|
||||
? defaultCombatMode
|
||||
: CombatMode.Melee;
|
||||
}
|
||||
|
||||
public static bool SupportsTargetedAttack(CombatMode mode) =>
|
||||
mode == CombatMode.Melee || mode == CombatMode.Missile;
|
||||
|
||||
public static AttackHeight HeightFor(CombatAttackAction action) => action switch
|
||||
{
|
||||
CombatAttackAction.Low => AttackHeight.Low,
|
||||
CombatAttackAction.Medium => AttackHeight.Medium,
|
||||
CombatAttackAction.High => AttackHeight.High,
|
||||
_ => AttackHeight.Medium,
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retail uses a 15-bit flags enum for attack types — weapon categories.
|
||||
/// See r02 §2 + <c>ACE.Entity.Enum.AttackType</c>.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue