Combat Mechanics

Purpose: AI-readable reference for Structs combat. Consolidates formulas, requirements, outcomes, and edge cases.


Combat Actions

Action Message Description
Attack struct-attack Direct struct-to-struct combat
Defend struct-defense-set Set struct to defense mode (blocking)
Raid planet-raid-complete Planet assault; steals unrefined ore

Damage Formulas

Multi-Shot Damage

damage = sum(successful_shots) - damageReduction
if damage >= health then health = 0
else health = health - damage
Variable Description
weaponShots Number of shots per attack
weaponShotSuccessRate Per-shot success (Numerator/Denominator)
weaponDamage Damage per successful shot
damageReduction Defense reduction
health Target current health

Algorithm: For each shot, IsSuccessful(weaponShotSuccessRate); if true, add weaponDamage. Apply damageReduction to total. Cap at target health.

Evasion

if weaponControl == guided then successRate = guidedDefensiveSuccessRate
else successRate = unguidedDefensiveSuccessRate
canEvade = IsSuccessful(successRate) if successRate.Numerator != 0

Recoil Damage

Attacker takes damage after firing: health = health - weaponRecoilDamage.

Post-Destruction Damage

If health == 0 and postDestructionDamage > 0, damage applies to surrounding structs.

Blocking

if defender exists and defender.operatingAmbit == attacker.operatingAmbit then
  canBlock = IsSuccessful(defender.blockingSuccessRate)

Requires: defender assigned, defender online, same ambit as target.

Counter-Attack

Scenario Damage
Same ambit counterAttackDamage (full)
Different ambit counterAttackDamage / 2

Planetary Defense Cannon

damage = planetaryShieldBase + sum(defenseCannon.damage for each cannon on planet)

Requirements

Requirement Attack Raid
Player online
Sufficient power
Sufficient charge
Fleet away
Command Ship online
Proof-of-work

Outcomes

Outcome Description
victory Attacker/raider wins
defeat Defender wins
attackerRetreated Attacker withdrew

Edge Cases


See Also