Critical hit chance and effects - melindil/FTSE GitHub Wiki

Critical hit chance

Depending on weapon type, there may be one or two rolls to determine if a hit is a critical hit.

Primary critical hit check

The first check applies to all weapon types. The following factors apply to the critical chance:

  • Base critical hit chance, from Luck, traits (Finesse) and perks (More Critical)
  • Add weapon critical chance
  • +20 if attacker or target has Jinxed
  • Targeted shot: +5 if aiming at legs, +7 for arms, +8 for groin, +10 for head, +30 for eyes, +3 for torso
  • +2 if behind target?
  • +5 if sneak attack
  • If the attacker's skill is greater than 100, then add (skill-100) / 10
  • For living targets: add (attacker's Doctor skill - 30) / 15
  • For mechanical targets: add (attacker's Science skill - 30) / 15
  • +5 if target is prone and attacker is using a weapon with range < 3
  • Bonus from to-hit roll: If the chance to hit exceeds the to-hit roll by more than 10, then divide the difference by 10, round down, and add. Example: if chance to hit is 95%, and hit roll is 47, add (95-47) / 10 = 4 to critical chance.

If a critical hit is made, the effect is determined from the first table below. The margin of success is used in the effect calculation below.

If the roll fails, two additional checks are made:

  • If attacker has the Slayer perk, and is using Unarmed attack, automatically succeed the critical hit.
  • If attacker has Sniper perk, and is using a Long or Scoped weapon mode, then roll 0-10 against attacker's Luck stat. If the roll is lesser or equal to Luck, then automatically succeed the critical hit. (This assumes the hex patch for fixing Sniper has been applied. Without that fix, the Luck roll is always compared against 0, with only a 9% chance of succeeding.)

In either scenario, a random value from 0-99 is generated as the "margin".

Secondary critical hit check

For melee or unarmed attacks, with maximum range less than 5 hexes, and the target is not a "GunTurret" type, a second roll is made, with a different chance calculation:

  • Base critical chance + 5
  • +10 if target is prone
  • +20 if target is knocked down
  • +10 if behind target
  • Bonuses for Doctor (living) and Science (machine) as described above
  • +20 if either attacker or target has Jinxed trait
  • Add attacker's Strength multiplied by 1.5
  • Subtract target's AC
  • +30 if sneak attack
  • Bonus for aimed shot location as described above
  • Add (attacker skill - min(30,max(target unarmed skill,target melee skill))) / 3
  • +50 if attacker has Slayer perk and attack is Unarmed type
  • Multiply final chance by 1.2 for unarmed

Should a critical hit be made, the effects will be determined from the second (melee) or third (unarmed) tables below. See note below about a bug on these tables.

Should both primary and secondary critical roll checks succeed, then the critical effect logic below is run twice, once for each result. Multiple effects can be applied due to this, but each possible effect can only be applied once (example: if both effect rolls were "Wicked Hit", then the damage multiplier is only 2x, not 4x).

Critical effects roll

If a critical hit is made, another roll is performed to determine the severity of the critical hit:

  • Start with a random roll from 0 to 99

  • Roll a random number between 1 and the margin on the critical hit check. Example: if critical chance is 10%, and the critical hit roll was 3, then choose a random value from 1 to (10 - 3 = 7) and add that value to the first roll.

  • Multiply the current value by 1.2 if the attacker has the Better Criticals perk (take note that this isn't adding a constant 20 to the roll, so low outcomes are still possible)

  • If attacker has the Heavy Handed trait, reduce the roll by a random factor from 0 to the value of the roll. Example: if the above results in a critical effect value of 74, then Heavy Handed results in an actual roll randomly selected between 1 and 74.

  • Cap value to between 1 and 100 inclusive.

Critical effect types

Once the critical effect roll is completed, it is used as a lookup into a table of critical hit effects. There are three tables - one is used for the primary critical effect roll (all weapon types), and the other two are used for the secondary melee and unarmed rolls, respectively.

The following critical effects can be applied:

  • Bypasses Defenses: This sets the target's damage threshold and reduction to zero.
  • Wicked Hit: This applies a x2 damage multiplier to the hit.
  • Knockdown: Knocks the target down, forcing it to spend AP to stand or recover. Should the target have insufficient AP, subsequent attacks on the target will have accuracy and critical bonuses.
  • Injury: Injures the body part targeted in an aimed attack, or a random body part if not aimed.
  • Disarm Right/Left: Appears to be bugged. The code will check if a weapon is in the corresponding hand of the target, and will drop it, but only if a specific flag is set in the weapon entity. I have not yet found a weapon with this flag set. Because of this, this critical type is the worst outcome, since it has no more effect than a normal hit, even though it randomly returns a message of Bypass Defenses or Wicked Hit.
  • Knockout: Target is knocked unconscious. Accuracy and critical bonuses for Knockdown also apply to knockout.
  • Break Weapon: Breaks the current weapon the target is using.
  • Torn Apart: A roll (1-10) is made against the target's Luck stat. If target passes the check (its Luck is equal or higher), this effect applies a x4 damage multiplier. If the target fails the roll, select a random integer from 0-99, add 4, and set the damage multiplier to that (maximum 103x damage).
  • Multiple Effects: Roll again for critical effect, between 50 and the value of the first roll minus 5. Then roll again from 1-49. Apply both effects.

Critical effects tables

Note: There is a major bug in the critical effect determination for the secondary critical check. The code that looks up the appropriate effect, based on severity and aim location, doesn't read the tables properly, and may even read into memory beyond the tables. This has substantial effects on the probabilities of certain outcomes, the most noticeable of which is a much higher chance for a "Torn Apart" result (maximum damage multiplier) when using unarmed attack aimed at the left leg, than in any other scenario.

Primary effects table

Aim point Bypass Defenses Wicked Hit Knockdown Injure Disarm Right Disarm Left Knockout Break Weapon Torn Apart Multiple Effects
None 1-29 30-49 50-74 75-87 88-96 97-100
Torso 1-24 25-49 50-79 80-92 93-97 98-100
Head 1-24 25-49 50-62 63-77 78-95 96 97-100
Eyes 1-19 20-49 50-54 55-82 83-97 98 99-100
Right Arm 1-29 30-49 50-54 55-82 83-94 95-99 100
Left Arm 1-29 30-49 50-54 55-82 83-94 95-99 100
Groin 1-19 20-54 55-69 70-84 85-89 90 91-100
Left Leg 1-19 20-34 35-74 75-96 97-100
Right Leg 1-19 20-34 35-74 75-96 97-100

Secondary effects table for Melee Weapons (effective behavior due to bug)

Aim point Bypass Defenses Wicked Hit Knockdown Injure Disarm Right Disarm Left Knockout Break Weapon Torn Apart Multiple Effects
None 1-14 15-39 40-59 60-79 80-99 100
Torso 1-24 25-44 45-64 65-84 85-100
Head 1-19 20-39 40-59 60-79 80-99 100
Eyes 1-19 20-39 40-59 60-79 80-99 100
Right Arm 1-19 20-39 40-59 60-79 80-99 100
Left Arm 1-19 20-39 40-59 60-79 80-84 85-100
Groin 1-19 20-39 40-59 60-64 65-94 95-100
Left Leg 1-19 20-39 40-44 45-74 75-84 85-100
Right Leg 1-19 20-24 25-54 55-64 65-69 70-100

Secondary effects table for Unarmed (effective behavior due to bug)

Aim point Bypass Defenses Wicked Hit Knockdown Injure Disarm Right Disarm Left Knockout Break Weapon Torn Apart Multiple Effects
None 1-19 20-39 40-59 60-79 80-99 100
Torso 1-19 20-39 40-59 60-79 80-99 100
Head 1-19 20-39 40-59 60-79 80-99 100
Eyes 1-19 20-39 40-59 60-79 80-99 100
Right Arm 1-19 20-39 40-59 60-79 80-99 100
Left Arm 1-19 20-39 40-59 60-79 80-84 85 86-100
Groin 1-19 20-39 40-59 60-64 65 66 67-100
Left Leg 1-19 20-39 40-44 45 46 47-100
Right Leg 1-19 20-24 25 26 27-100