Melee Combat

Melee weapons can only hit adjacent targets, and can only be used one at a time. Activate a melee weapon and bump (move) into a target to attack it. Other options are to left-click on the target itself, or in that target's general direction. You can also force a melee attack, generally only necessary to use a melee weapon on terrain or a machine, by holding Ctrl-Shift while moving in a certain direction. (Note to vi-key users: Forcing a melee attack this way using vi-keys is not possible because the commands overlap with part swapping, use 'f' to enter targeting mode instead.)

## Hit Chance

Melee attacks use the same hit chance calculations as ranged combat, with a few exceptions:

* Base hit% is 70
* No range modifier
* No heat modifiers
* Utility modifiers use those applicable to melee combat

## Momentum

All melee weapons benefit from greater momentum in the direction of the attack. Moving multiple consecutive spaces in a row prior to an attack adds additional momentum, up to a maximum of 3. Current momentum is displayed as a number at the end of the HUD's movement data readout.

The damage bonus on a successful melee hit is +1~40% for non-piercing weapons, or +2~80% for piercing weapons, calculated as: ([momentum] \* [speed%] / 1200) \* 40). For piercing attacks the multiplier is 80 instead of 40. Speed% is current speed as a percentage of average speed, 100. Thus the more momentum and speed with which you attack, the greater the damage. Your status page shows the damage bonus taking current momentum into account. Note that while some utilities help increase momentum, the maximum bonus damage for a given weapon type cannot be exceeded.

Stopping, performing a non-movement action, or otherwise moving in a direction that does not match the current momentum resets your momentum to 0, except when moving diagonally in the same general direction (e.g. turning from southeast to south). The latter case instead reduces total momentum by 1. Also note that technically any melee attack can take advantage of previously accumulated momentum, regardless of direction. For example, approaching the southern side of a target from the east and attacking northward while passing below it will apply whatever momentum value is displayed in the HUD.

## Sneak Attacks

Melee attacking an enemy that has not yet noticed you gives a base hit chance of 120%, and a +100% damage bonus which stacks with any momentum bonus. Sneak attacks work on any non-fleeing neutral targets as well, since they don't expect you'll suddenly attack them!

## Multi-Wielding

Although only one primary melee weapon can be active at a time, other attached but inactive melee weapons have a chance to carry out "follow-up attacks" alongside the primary weapon. In Tactical HUD mode, that chance is shown next to each applicable melee weapon. Follow-up attacks are more likely when the primary weapon is slower than a given backup melee weapon. The chance may also be affected by supporting utilities.

Multiple follow-up attacks by different melee weapons are possible in the same action. Each weapon is checked separately, and once confirmed any follow-up attack has a +10% to hit the target. Each weapon incurs no additional time cost to attack aside from modifying the total attack time by half of their time delay (whether positive or negative). Momentum bonuses that apply to the primary weapon all apply to follow-up attacks as well. The benefits of all actuators also apply to every follow-up attack. If the target is destroyed by an earlier attack, any remaining follow-up attacks will switch to another target in range if there is one.

Datajacks cannot be involved in follow-up attacks, and these attacks are only applicable against robot targets.

## Ramming

As a last resort, Cogmind can ram other robots to damage and/or push them out of the way. Damage is a random amount from 0 to (((10 + [mass]) / 5) + 1) \* ([speed%] / 100) \* [momentum], where speed% is current speed as a percentage of average speed (100) and effective momentum is a combination of both Cogmind and the target's momentum. However, the damage per attack is capped at 100 before the roll. Smashing into a robot headed straight for you can deal some serious damage, though there are serious negative consequences to go with this unarmed attack, and half as much damage is inflicted on Cogmind as well. Ramming increases the salvage potential of the target (by 3 for each hit), and also enables the collection of a small random amount of matter per collision.

Ramming with active treads or legs always avoids self-damage and destabilization. Treads have a per-tread chance to instantly crush targets of medium size and below which have no more than 50 remaining core integrity. Crushed robots have their salvage modified by -20. Legs have a 20% chance per leg to kick the target out of the way. (Not applicable against huge targets.)

The time cost to ram is the greater (slower) of 100 and your current move speed.

It is also possible to ram non-robot targets including walls and machines by using the "force melee attack" command (Ctrl-Shift + Movement Keys, or Ctrl-Shift+LMB) without any active melee weapons. Ramming of this type uses the same damage formula as above, but the results are always maximized, and therefore you can know in advance whether the damage will be sufficient to destroy the target. The expected result will be indicated via the usual collision warning when you attempt to ram. Note that ramming a solid object is much more dangerous than ramming a robot, and Cogmind not only takes the same amount of damage that is inflicted on the target, but also suffers other negative side effects as well. The type of propulsion does not affect the results, beyond the indirect effects of carrying capacity and speed.