Fallout combat

Combat in Fallout and Fallout 2 is controlled by the participating character's statistics. Whenever an enemy critter is selected to be attacked, the game's rule system takes over.
==Basic combat rules==
Combat generally begins with a surprise turn, where the initiator of combat takes an action and their target gets to respond. Regular combat rules follow.
First off, the game determines who gets to go first. This depends on each character's sequence. The rule here is simple: a higher sequence goes first.
When it is the player's turn, and the player chooses to take action, the game determines if they even have time in that turn to take action. SPECIAL uses Action Points (APs) to work this out. Each action which can be taken in combat has a particular cost in APs. If the current number of remaining APs is equal to or greater than the cost of the action, it can be carried out. A character's maximum APs are determined by Agility. Most attacks cost 5 APs by default, though with different weapons, modes of attacks and combinations of perks, this can change. Movement costs one AP per hex moved.
* Example: Joe the Raider is in a bar brawl. He wants to slug the barfly next to him. A solid punch costs 2 APs. Joe currently has 8 APs. He has more than enough APs to do what he has in mind and takes a swing.
It is not enough to decide to attack. The attack must actually connect before anything interesting happens. In essence, the target's chance of avoiding the attack is subtracted from the chance of successfully attacking. The resulting percentage is rolled against to determine whether the hit was successful. The aggressor's chance of successfully attacking is mostly due to their skill with whatever sort of weapon they're using, modified by attributes (like Strength or Agility) or perks. The target's chance of avoiding the attack is mostly due to their Armor Class, which is determined by their Agility and the armor they are wearing. Additional bonuses or penalties to the attack can apply based on other conditions such as the range at which an attack is made or the lighting conditions. 
*Example: Joe the Raider attacks a farmer. Joe has trained hard with his spear and has a total skill of 89% with melee weapons. The farmer's he's attacking is just wearing his threadbare clothing and thus only has the Armor Class afforded by his average agility: 5. It's a bright, sunny day and Joe is attacking in melee, so no other special conditions apply. Joe's chance of hitting is calculated as follows:
**89% (attacker's weapon skill) - 5% (defender's Armor Class) = 84%
*Joe has an 84% chance of successfully skewering his target. The farmer is likely toast.
Once an attack has been confirmed to be successful, damage must be determined. First, the raw damage is rolled. This is determined by the damage range of the weapon or hand to hand attack being used. Each weapon does more or less damage than any other. A slap from a 90-pound weakling hardly hurts at all, but a point-blank shot from a combat shotgun is painful. For melee and hand to hand attacks, the damage is modified by strength. Certain feats also can modify attack damage. Different types of ammunition can also have different effects on damage, depending on the Damage Modifier (DM) of the ammunition.
Once the raw damage has been determined, the target's armor comes into play again. First, the armor's Damage Threshold (DT) is applied. This is a fixed number of points of damage that is directly subtracted from the attack's damage. Next, a percentage equal to the armor's damage resistance (DR) is removed from the remaining damage, eventually modified by the Damage Resistance Modifier (DRM) of ammunition. Each armor has one Armor Class but has different DTs and DRs for different types of damage. See Damage for information on damage types.
*Example: Joe stabs a caravan guard with his spear. The weapon's base damage is 3-10. Joe's strength gets him an extra 2 points of damage. He ends up with a solid blow for 9 points of damage. The caravan guard is wearing a leather jacket. A spear stab is normal damage, so those statistics are used. Unfortunately, the frail leather jacket has 0 damage threshold, so nothing is subtracted from the damage. It does, however, have 20% damage resistance to normal. The damage of 9 undergoes a reduction of 0.2 x 9 = 1.8 rounded down to 1. Thus the guard takes 9 - 1 = 8 HP of damage and readies his sledgehammer to take a swing at Joe.
The final damage caused by a ranged weapon can be computed by the following formula:
(final damage) = (( raw damage * DM ) - DT) - RoundDown((DR + DRM) * ((raw damage * DM) - DT))) 
Where:
* Raw damage is the rolled damage into the damage range of the weapon.
* DM is the Damage Modifier of the used ammunition.
* DT is the Damage Threshold of the target's armor.
* DR is the Damage Resistance of the target's armor.
* DRM is the Damage Resistance Modifier of the used ammunition.
If the player has the Living Anatomy perk, 5 HP of damage is added after everything else.
*Example: Joe shoots a combat-armored caravan guard with his .44 magnum revolver. The armor has 5 DT and 40% DR. The gun has a base damage of 12-18. .44 magnum JHP has DM 2/1 and DRM 20. Joe rolls 14 base damage. This is doubled to 28 by the ammunition's DM. The armor's DT then subtracts 5, so 23 remains. This remainder undergoes a reduction of (40% + 20%) * 23 = 13.8, which is rounded down to 13. The guard takes 23 - 13 = 10 damage and readies his H&K CAWS to blow Joe's brains out.
Note: The Fallout 1 engine does not implement the ammo modifiers, so in that game there is no difference between JHP and AP ammo. (archived explanation thread)
Taking too much damage will typically result in death. Characters have a derived statistic called Hit Points that represent how much damage they can take before they die.
==Attack modes==
Some weapons have several different ways to attack aside from a single shot or a jab. 
First, every weapon (except burst-only weapons) allow the player to make an Aimed Shot (provided they do not have the Fast Shot trait). Aimed shots allow for aiming at a particular part of a target's body. Aiming for limbs gives a chance to cripple the limb, which has several penalties. Aiming for the groin, head, and especially eyes significantly increase the chance for a critical hit, but makes for a correspondingly more difficult shot.
Many ranged weapons will allow the player to make a Burst Shot, meaning more bullets are fired in less time. Different weapons will use more or less rounds in one burst, but the idea is generally the same: put more bullets in the air. The advantages of burst shots are that either one target can be hit for far more damage (if multiple rounds hit and especially if several rounds achieve critical hits) or hit several targets at once as bursts fire in a cone. The downside is that bursts are more expensive in both ammunition and action points and may not necessarily be worth the expenditure. A further problem is that a burst shot may hit unintended targets like party members or neutral characters. 
Some melee weapons have different attack options (jab, swing, etc) and some, like the spear, has a throw option, which gives melee weapons a bit more range.
==Hit Chance==
The following section Ranged combat is continuation of general discussion on the topic of the chance to hit in ranged combat in Fallout 1 and 2 based on player experience and knowledge. It can be hence on considered obsolete, inaccurate and plainly wrong based on reversed-engineered source code of Fallout 2. According to the code (file combat.c, function determine_to_hit_func), this is the actual generic equation for Hit Chance used in Fallout 2:
===Notes===
Only the player character (PC) can have perks and traits in Fallout 2, but all critters can use items (weapons and armors) with perks. Other notable differences are that only PC suffer Penalty for shooting in insufficient illumination (which can be negated by using weapon that has Weapon Night Sight perk) and that non-PCs have different Range Penalty calculation (simple P instead of (P-2) in both places). 
Also, the used equations mix logic (true/false) variables like RANGED and numeric variables like AC, which is non-standard in usual algebraic equations. It is purely to simplify the equations and make them less confusing to common folk while staying close to the source code; Please, substitute logic values with numeric values: 1, for true and 0, for false.
===Fallout 1===
Ammo in Fallout does not have any effect, so AMMO variable can be substituted with 0.
===Fallout Tactics===
Fallout Tactics features stances which further modify Hit Chance. It also features elevation which according to some players applies bonus to accuracy. There are likely to be other differences due to using a completely different engine, but the equation should otherwise not be changed much.
==Ranged combat [obsolete, see Hit Chance]==
Ranged Combat is first determined by the skill for the specific ranged weapons being used. The Chance to Hit is the result of the skill - 30%, with further modifiers as follows:
* Add 8% or 16% (dependent on the maximum range of the weapon) for each point of Perception - 2, natural or modified by special perks and traits like Sharpshooter or Night Person.
* Subtract 4% for each hex of distance between the aggressor and the target. 
** The above two statements are fundamentally inconsistent with the definition of Weapon Long Range.
* Subtract an additional 10% when the aggressor is more than 4 hexes away from the target and when the aggressor is "in darkness".
* Subtract a body part specific penalty when using an Aimed Shot (-0, -20, -30, -40, or -60).
* Subtract the target's Armor Class.
* For each point below the minimum Strength needed to wield the weapon, subtract 20.
Keep in mind that on a missed shot there is a slight chance to hit another nearby target. 
The formula above claims the chance to hit is as follows:
\begin{align}
H &= \text{Distance to target in hexes} \\
C &= \text{Target AC} \\
S &= \text{Part-specific Aimed Shot penalty} \\
P &= \text{Shooter Perception} \\
D &= \text{Shooter in Darkness} \\
T &= max(0,\text{Weapon minimum Strength} - \text{Shooter's Strength}) \\
\text{Chance to Hit} &= \text{Skill} - 30 - 4H + max(0,P-2)(8|16) - 10D(H>4) - C - S - 20T
\end{align}
Assuming Weapon Long Range is instead exactly correct for how distance penalties work but the above formula is otherwise correct, chance to hit is instead:
\begin{align}
L &= \text{The weapon has the Weapon Long Range perk} \\
\text{Chance to Hit} &= \text{Skill} - 30 - 4H\biggl(H \ge \bigl(2\left(L+1\right) \times max\left(0,P-2\right)\bigr)\biggr) - 10D(H>4) - C - S - 20T
\end{align}
Depending on how inaccurately worded the wiki's description of the perk is, either of the following are possible:
\begin{align}
\text{Chance to Hit} &= \text{Skill} - 30 - 4H\biggl(H > \bigl(2\left(L+1\right) \times max\left(0,P-2\right)\bigr)\biggr) - 10D(H>4) - C - S - 20T \\
\text{Chance to Hit} &= \text{Skill} - 30 - 4 \times max\bigl(0,H-2\left(L+1\right) \times max\left(0,P-2\right)\bigr) - 10D(H>4) - C - S - 20T
\end{align}
Some weapon classes also affect BTH. Shotguns, for example, raise BTH by 20% if >=4 hexes away from the target and even by 30% if >=5 hexes away from the target, while the damage done by the weapon is reduced.
Sniper Weapons like the hunting rifle can fire in the first 10 hexes away from the target with +4% to the BTH and without any distance modifiers. For example, the BTH is usually 55%. While using the hunting rifle, there is initially a +4% bonus to BTH. The target is 8 hexes away, so the BTH is still 59%. Beginning with the 11th hex of distance between the attacker and the target, each hex subtracts 4% of the BTH as usual. In the example, if instead of being 8 hexes away, the distance is 12 hexes, the BTH is reduced to 47%. 
There are also special unique weapon modifiers like +20% BTH for the 9mm Mauser because it is "extremely accurate."
==Criticals==
If an attacker is lucky, their attack may potentially cause additional effects for their target, such as crippled limbs, damaged eyesight, or even instant death. These are Critical Hits. When an aggressor makes an attack, a derived statistic called Critical Chance is checked against to see if the attack is critical. If it is, a random effect follows, which can be extra damage or more drastic outcomes.
On the flip side, there are also critical failures. If an attack backfires, (characters with the Jinxed trait are notorious for this), something disastrous may occur. The most common result is attacking the wrong target (for instance, a bystander between the aggressor and the target may be hit instead of the target). Other possible results include weapon jams, dropping weapons, weapon destruction, causing damage to oneself, and other unfortunate outcomes.
Category:Combat
Category:Fallout gameplay
Category:Fallout 2 gameplay
ru:Принципы боя Fallout
uk:Принципи бою Fallout