Combat

## Volley

When attacking, all active weapons in range of the target are fired at once. Firing a single weapon takes twice as long as a standard action, and subsequent weapons fired in the same volley will take less and less extra time, hence firing more weapons at once is always more time efficient. See the HUD's volley analysis readout to check the actual time required to fire the currently active weapons (which may be further modified by individual weapon delays), as well as the total resource cost of the volley.

Although the full resource cost of the intended volley must be available before firing, energy and matter costs for each weapon are not deducted until that weapon actually fires. All weapons immediately begin generating heat as soon as the volley begins, but for volleys that will require two or more turns, the heat produced is averaged over the total number of turns required to fire.

```
Targeting ==

```

Targeting is actually tested on a finer grid than is visible onscreen. Each map space is divided into a 9x9 grid of squares, and as robot sizes vary (S/M/L), they may take up more or fewer of these squares. This has several implications, e.g. you may be able to hit a larger target before it has completely rounded a corner, while smaller targets may require a more direct line-of-sight. It also means that smaller targets are actually easier to shoot around than larger ones. As long as the targeting line is green Cogmind has a clear LOF to the target, even if it looks like it passes through another robot or obstacle.

```
Hit Chance ==

```

Many factors affect the chance to hit a target. The chance shown in the scan readout takes into account all factors except those which affect individual weapons in the volley. Per-weapon chances are instead shown in the parts list next to their respective weapons once firing mode is activated and the cursor is highlighting a target.

Base hit chance before any modification is 60%.

Volley Modifiers:

* +3%/cell if range < 6
* +20%/30% if attacker in standard/high siege mode (non-melee only)
* +attacker utility bonuses
* +10% if attacker didn't move for the last 2 actions
* +3% of defender heat (if heat positive)
* +10%/+30% for large/huge targets
* +10% if defender immobile
* +5% w/robot analysis data
* -1~15% if defender moved last action, where faster = harder to hit
* -5~15% if defender running on legs (not overweight)
	+ (5% evasion for each level of momentum)
* -10% if attacker moved last action (ignored in melee combat)
* -5~15% if attacker running on legs (ranged attacks only)
	+ (5% for each level of momentum)
* -3% of attacker heat (if heat positive)
* -10%/-30% for small/tiny targets
* -10%/-5% if target is flying/hovering (and not overweight or in stasis)
* -20% for each robot obstructing line of fire
* -5% against Cogmind by robots for which have analysis data
* -defender utility bonuses

Weapon-specific Modifiers:

* +utility bonuses
* -recoil (from other weapons)

After all modifiers are applied, regardless of the final value hit chance is capped at 95% (or 100% for melee attacks). Similarly, there is always at least a 10% chance to hit a target. The cap is not applied to the per-weapon chances shown in the parts list in order to let you know how much surplus hit chance is available.

Sometimes the log will claim you "missed" a target, then destroyed it. That's because you got lucky and the random miss trajectory still hit the target! This is more likely to happen with closer, larger targets as per the mechanics described in the targeting section above.

Note that anything caught in an explosion radius is always hit--explosions automatically damage everything in each space they traverse, be it walls, items, or robots.

Volley modifiers reordered by type for comparative reference:

* +3%/cell if range < 6

* +10%/+30% for large/huge targets
* -10%/-30% for small/tiny targets

* +3% of defender heat (if heat positive)
* -3% of attacker heat (if heat positive)

* +20%/30% if attacker in standard/high siege mode (non-melee only)
* +attacker utility bonuses
* -defender utility bonuses

* +10% if defender immobile
* +10% if attacker didn't move for the last 2 actions
* -10% if attacker moved last action (ignored in melee combat)
* -1~15% if defender moved last action, where faster = harder to hit
* -10%/-5% if target is flying/hovering (and not overweight or in stasis)
* -5~15% if defender running on legs (not overweight)
	+ (5% evasion for each level of momentum)
* -5~15% if attacker running on legs (ranged attacks only)
* &(5% for each level of momentum)
* -20% for each robot obstructing line of fire

* +5% w/robot analysis data
* -5% against Cogmind by robots for which have analysis data

## Guided Weapons

Guided weapon behavior and operation are different from other weapons. Their projectiles follow a set path designated by a number of waypoints, and will always hit their target, but may not be fired as part of a volley. While a guided weapon is active, only that weapon will fire. Left-click or press Enter to set each waypoint, and use right-clicks or Escape to cancel a waypoint. When ready to fire, put the cursor over the final target and press 'f'. Players preferring pure mouse control and attempting to target an empty space or space out of view can also click on the last waypoint to fire, or assign all waypoints up to the weapon's limit then click on a final target direction.

## Coverage/Exposure

Each part has a "coverage" rating which determines its likeliness to be hit by an incoming attack. Values are relative, so attacks are weighted towards hitting parts with higher coverage. Robot cores also have their own "exposure" rating which determines their likeliness to be hit; this value is considered along with part coverage when determining whether an attack will strike the core. The exact chance of a core/part to be hit is shown in parenthesis after its exposure/coverage on the relevant info screen. You can also press 'c' to have the main HUD's parts list display a visualization of relative coverage, i.e. longer bars represent a greater chance for a given part to be hit.

Some examples of how coverage determines hit locations will help understand how that stat actually works.

Example 1: Cogmind's core has an exposure of 100. Say you equip only one part, a weapon which also has a coverage of 100. Their total value is 200 (100+100), so if you are hit by a projectile, each one has a 50% (100/200) chance to be hit.

Example 2: You have the following parts attached:

* Ion Engine (60)
* Light Treads (80)
* Light Treads (80)
* Medium Laser (100)
* Light Assault Rifle (100)

With your core (100), the total is 520, so the chance to hit each location is:

* Ion Engine: 60/520=11.5%
* Light Treads: 80/520=15.4% (each)
* Medium Laser: 100/520=19.2%
* Light Assault Rifle: 100/520=19.2%
* Core: 100/520=19.2%

Enemy robots work the same way, so the more parts you blow off, the more likely you are to hit and destroy their core. Armor plating has a very high coverage, so it's more likely to be hit, while tiny utilities such as embedded processors have very low coverage, so you can expect them to last much longer (unless you have little or nothing else covering you). As you progress, your core will become more and more protected by attached parts, because you'll have many more of them, but by that time there are other dangers such as system corruption.

## Damage Overflow

When a part is destroyed by damage that exceeds its remaining integrity, the surplus damage is then applied directly to the core or another part as chosen by standard coverage/exposure rules. No additional defenses are applied against that damage. Exceptions: There is no damage overflow if the destroyed part itself is armor, and overflow damage always targets armor first if there is any. Critical strikes that outright destroy a part can still cause overflow if their original damage amount exceeded the part's integrity anyway. Damage overflow is caused by all weapons except those of the "gun" type, and can overflow through multiple destroyed parts if there is sufficient damage.

## Secondary Targeting

If a volley including only "gun"-type weapons destroys a target robot, any and all remaining guns in that volley will lock onto another target, prioritizing the most easily hit armed and active hostile currently in range. This mechanic is also called "gunslinging."

## Salvage

How much of a robot remains to salvage when it is destroyed depends on the value of its cumulative "salvage modifier" which reflects everything that happened to it before that point. This internal value is initially set to zero, and each projectile that impacts the robot will contribute its own weapon-based salvage modifier to the total. Some weapons lower the value (most notably ballistic cannons), others have no meaningful effect on it (most guns), while certain types may even raise it, ultimately increasing the likelihood of retrieving useful salvage.

When a robot is destroyed, it leaves an amount of matter equivalent to its salvage potential (usually a random range you can see on its info page), modified directly by the salvage modifier. This means a large enough negative salvage modifier, e.g. from explosives or repeated cannon hits, has the potential to reduce the amount of salvageable matter to zero. A positive salvage modifier can never increase the resulting matter by more than the upper limit of a robot's salvage potential.

The chance for the robot's parts to survive, checked individually for each part, is ([percent\_remaining\_integrity / 2] + [salvage\_modifier]), thus more damaged parts are more likely to be destroyed completely along with the robot. But even if that check succeeds, there are still two more possible factors that may prevent a given part from dropping. If the robot was overheating, parts can be melted, the chance of which is ([heat - max\_integrity] / 4), so again less likely to affect large parts (though still possible, especially at very high heat levels). If the robot was corrupted, parts can be "fried," the chance of which is [system\_corruption - max\_integrity]; by the numbers, this will generally only affect small electronic components like processors, and sometimes devices. Each salvageable part left by a corrupted robot also has a corruption% chance to itself be corrupted, specifically by a random amount from 1 to (10\*[corruption]/100), and when attached will increase Cogmind's system corruption by the same value as well as possibly cause another side effect.

Note that robots built by a fabricator do not leave salvageable parts. Also, anything in a robot's inventory (not attached) is always dropped to the ground, regardless of salvage modifiers or other factors.

## Spotting

Even when you can see a hostile robot, they will not always notice you immediately. They can only register a target on their own turn, so if you are moving very quickly you can potentially pass into and beyond their field of view before they even have time to react. Sometimes when quickly rounding a corner and spotting an enemy, there is still time to duck back without being seen. That said, if you pass in and out of a hostile robot's field of view before they react, they may still take some notice and decide to investigate whatever they think they saw. Different AIs have a different chance to take notice, with those robots designed for surveillance, for example, being much more likely to investigate a potential passing target.

Another possibility to be aware of: while your own sight range is normally similar to that of other robots (approximately 16 spaces), if you enhance your visual sensors you can spot robots from afar before entering their field of vision. Likewise, hostiles with their own sensors may spot you before you can see them.

To know whether a robot has actually spotted you or not, there are two useful indicators. The first, directly on the map itself, is the sudden glow of their background when they spot you for the first time (also may display as a flashing '!' depending on other UI settings). After that initial sighting you can still refer to the scan window, which displays a red exclamation mark for any hostile robots aware of your presence.

Note that sight range is also reduced when line of sight passes through machines, making it possible in certain environments to get closer to hostiles before being spotted. Cloaking utilities also reduce the range at which enemies can spot you.

## Attack Resolution

With so many mechanics playing into an attack, especially later in the game when there are numerous active parts involved at once, min-maxers looking to optimize their build may want a clearer understanding of the order in which all elements of an attack are carried out. This manual already covered hit chances above, but there are many more steps to what happens once an attack hits a robot. Below is an ordered list detailing that entire process, which applies to both ranged and melee combat. Note that you most likely DO NOT need to know this stuff, but it may help answer a few specific questions min-maxers have about prioritization.

1. Check if the attack is a non-damaging special case such as Datajacks, Stasis Beams, Tearclaws, etc., and handle that before quitting early.

2. Calculate base damage, a random value selected from the weapon's damage range and multiplied by applicable modifiers for overloading, momentum, and melee sneak attacks, in that order. Potential damage range modified by Melee Analysis Suites, Kinecellerators, and Force Boosters here.

3. Apply robot analysis damage modifier, if applicable (+10%).

4. Apply link\_complan hack damage modifier, if applicable (+25%).

5. Apply Particle Charger damage modifier, if applicable.

6. Reduce damage by resistances.

7. Apply salvage modifiers from the weapon and any Salvage Targeting Computers.

8. Determine whether the attack caused a critical hit.

9. Split damage into a random number of chunks if an explosion, usually 1~3. The process from here is repeated for each chunk.

10. Store the current damage value as [originalDamage] for later.

11. Apply the first and only first defense applicable from the following list: phase wall, 75% personal shield (VFP etc), Force Field, Shield Generator, stasis bubble, active Stasis Trap, Remote Shield, 50% remote shield (Energy Mantle etc.), Hardlight Generator.

12. Store the current damage value as [damageForHeatTransfer] for later.

13. Choose target part (or core) based on coverage, where an Armor Analysis Suite first applies its chance to bypass all armor, if applicable, then available Core Analyzers increase core exposure, before finally testing individual target chances normally.

14. Cancel critical strike intent if that target has applicable part shielding, or if not applicable to target.

15. If targeting core, apply damage and, if robot survives, check for core disruption if applicable.

16. If targeting a power source with an EM weapon, check for a chain reaction due to spectrum.

17. If not a core hit or chain reaction, prepare to apply damage to target part. If the part is Phase Armor or have an active Phase Redirector, first reduce the damage by their effect(s) and store the amount of reduction as [transferredCoreDamage] for later, then if part is Powered Armor reduce damage in exchange for energy (if available), or if part is treads currently in siege mode reduce damage appropriately. If part not destroyed then also check for EM disruption if applicable.

18. If part destroyed by damage, record any excess damage as overflow. If outright destroyed by a critical hit but damage exceeded part's integrity anyway, any excess damage is still recorded as overflow.

19. If part was not armor and the attack was via cannon, launcher, or melee, transfer remaining damage to another random target (forcing to a random armor if any exists). Continue transferring through additional parts if destroyed (and didn't hit armor).

20. If part not destroyed, check whether heat transfer melts it instead.

21. Apply [transferredCoreDamage] directly to the core if applicable, with no further modifiers.

22. Apply damage type side effects:

* Thermal weapons attempt to transfer ([damageForHeatTransfer] / [originalDamage])% of the maximum heat transfer rating, and also check for possible robot meltdown (the effect of which might be delayed until the robot's next turn).

* Kinetic damage may cause knockback.

* The amount of EM corruption is based on [originalDamage].

* Impact damage may cause knockback, and applies corruption for each part destroyed.