Knockback

From Terraria Wiki
Revision as of 13:08, 26 May 2022 by Rye Greenwood (talk | contribs) (ce, reword, moved listing of weapon knockback values to new section (not sure if it is really needed, there is the list of weapons after all, but it definitely doesn't belong in the intro in my opinion; also feel free to improve the section name), -notoc (unnecessary, page isn't particularly short), {{gameText}}, -noGravity sentence (just physics stuff for flying/swimming enemies), -History section (the one entry is a change to an enemy, not the knockback mechanic), new References section)
Jump to navigation Jump to search

Knockback is a basic mechanism in Terraria whereby players and enemies are repelled in the opposite direction of an attack. Most weapons and environment objects that cause damage also cause knockback, to varying degrees. Some enemies are immune to knockback, particularly bosses and other enemies that travel through blocks, like worms and Man Eaters. Some enemies also have varying degrees of knockback resistance.

The player can become immune to knockback by equipping the Cobalt Shield, Paladin's Shield, or any of their upgrades, or by grappling on any surface using any hook. (Desktop, Console and Mobile versions) Wearing the full Gladiator armor set also grants the player knockback immunity.

Player-inflicted knockback can be increased by various modifiers, the Titan Glove accessory and its upgrades, the Titan Potion, and the Shroomite and Vortex armors'(Desktop, Console and Mobile versions) stealth effects. Critical hits increase the inflicted knockback by 40%. Enemies that are afflicted with Cursed Inferno receive 10% more knockback.

Knockback values

Value In-game text
0 No knockback
≤ 1.5 Extremely weak knockback
≤ 3 Very weak knockback
≤ 4 Weak knockback
≤ 6 Average knockback
≤ 7 Strong knockback
≤ 9 Very strong knockback
≤ 11 Extremely strong knockback
> 11 Insane knockback

Formula

The following steps are taken when an enemy is struck with a weapon that inflicts knockback.[1]

First, calculating knockback resistance:

knockBack = knockBack * (1 - enemyKnockbackResist)

Then multiplying knockback by 110% if the target is suffering from Cursed Inferno:

if cursedInferno then knockBack = knockBack * 1.1

Then applying cap to it if needed:[2]

if knockBack > 8.0 then knockBack = 8 + (knockBack - 8.0) * 0.9
if knockBack > 10.0 then knockBack = 10 + (knockBack - 10.0) * 0.8
if knockBack > 12.0 then knockBack = 12 + (knockBack - 12.0) * 0.7
if knockBack > 14.0 then knockBack = 14 + (knockBack - 14.0) * 0.6
if knockBack > 16.0 then knockBack = 16

Then multiplying knockback by 140% if it is a critical hit:

if isCrit then knockBack = knockBack * 1.4

Finally, the computed knockback value is converted to velocity. There are differing multipliers depending on whether the hit is more than 10% / 15% of the enemy's maximum health, and there is a special 1.5× multiplier to vertical velocity for Snow Flinxes.

Immune enemies

Other:

Weapons inflicting the most knockback

The most player-caused/inflicted knockback comes from the Slap Hand, which has a knockback value of 20. This is followed immediately by the Shadow Jousting Lance(Desktop, Console and Mobile versions) with a knockback value of 14, then by the Hallowed Jousting Lance(Desktop, Console and Mobile versions) and Tonbogiri(Old-gen console and 3DS versions) with a knockback value of 13, the regular Jousting Lance(Desktop, Console and Mobile versions) and Golem Fist with a knockback value of 12, and the Thorns Potion, which retaliates with 10 knockback when its effect triggers.

The knockback values of all weapons can be seen at the list of weapons. Remember that knockback is capped at 16 (22.4 for critical hits), after calculating the enemy's knockback resistance.

References

  1. Information taken from the Desktop version Desktop 1.4.3.6 source code, method StrikeNPC() in Terraria.NPC.cs. There may be inaccuracies, as the current Desktop version Desktop version is 1.4.4.9.
  2. This is written properly, it follows the steps in order so that a Slap Hand against a target that is not alight with Cursed Inferno and does not critically hit ends up at 14.9168 knockback, having been reduced 4 times, barring other enemy-specific modifiers.