Talk:Striking Moment
Starting talk page
^Title wrong by mistake
Does anyone have information about this buff? I can´t seem to find anything anywhere. --Leonord curse (talk) 09:36, 17 November 2016 (UTC)
Combination + Psycho knife
Does it become a +800% (so x9) damage, a +1500% (so x16) damage, +1800% (so x19) damage or +2000% (so x21) damage? I thing the first or the second, but I can't test because I am an honest person and I don't have a brand of the inferno — Preceding unsigned comment added by 213.45.69.96 at 06:57, November 5, 2017 (UTC)
Correctness of the buff tooltip
Over the past year, there have been numerous edits regarding the mathematical correctness of the Striking Moment's buff tooltip:
- 22:28, 3 January 2020 (UTC)
- 09:54, 19 February 2020 (UTC)
- 17:45, 19 February 2020 (UTC)
- 11:23, 21 May 2020 (UTC)
- 11:27, 21 May 2020 (UTC)
- 11:22, 24 June 2020 (UTC)
- 13:00, 24 June 2020 (UTC)
- 13:02, 24 June 2020 (UTC)
- 13:03, 24 June 2020 (UTC)
- 13:04, 24 June 2020 (UTC)
- 13:05, 24 June 2020 (UTC)
- 13:05, 24 June 2020 (UTC)
- 16:33, 6 August 2020 (UTC)
- 16:47, 6 August 2020 (UTC)
- 04:42, 24 September 2020 (UTC)
- 12:24, 24 September 2020 (UTC)
- 20:41, 15 December 2020 (UTC)
- 20:59, 15 December 2020 (UTC)
- 06:07, 28 March 2021 (UTC)
Therefore, it would be great to establish a consensus on this page to refer to to avoid changes, removals, and re-additions in the future.
From the Desktop 1.4.2 source code, I can verify that the melee damage is multiplied by 5. It is evident in two methods, the first one being
, which is used when a regular melee weapon hits an NPC:
Terraria.Player.ItemCheck_MeleeHitNPCs
private void ItemCheck_MeleeHitNPCs(Item sItem, Rectangle itemRectangle, int originalDamage, float knockBack)
{
// [...]
int num = originalDamage;
// [...]
if (parryDamageBuff && sItem.melee)
{
num *= 5;
parryDamageBuff = false;
ClearBuff(198);
}
// [...]
}
As it can be seen, the
(which is copied to originalDamage
) is multiplied by 5 if the player has the num
and the item that struck the NPC (parryDamageBuff
) is a melee weapon. The buff is then removed from the player. Later on, the ±15% damage randomization is applied to sItem
and it is used in a call to num
, where the damage is actually applied to the NPC.
Terraria.NPC.StrikeNPC
The second method is
, which is called constantly for all projectiles, including those of melee weapons:
Terraria.Projectile.Damage
public void Damage()
{
// [...]
float num5 = 1f; // num5 is modified for certain very specific projectile types; that is irrelevant in this case
// [...]
bool flag7 = !npcProj && !trap; // flag7 is true if the projectile is not an NPC's projectile and not spawned from a trap
// [...]
int num9 = (int)((float)damage * num5);
// [...]
int num18 = // apply the ±15% damage randomization based on num9
// [...]
if (flag7 && melee && Main.player[owner].parryDamageBuff && !ProjectileID.Sets.DontApplyParryDamageBuff[type])
{
num18 *= 5;
Main.player[owner].parryDamageBuff = false;
Main.player[owner].ClearBuff(198);
}
// [...]
}
Here, the
(which is the already a bit modified base damage of the projectile) is multiplied by 5 as well, if it is a projectile that is not spawned from an NPC or a trap, deals melee damage, and is allowed to apply the Striking Moment buff, and the player has the buff. Similarly to above, the buff is then removed from the player and num18
is later used in a call to num18
.
Terraria.NPC.StrikeNPC
These are the only two locations where Striking Moment has an effect. It is clear that the attack's damage is multiplied by 5, i.e., an attack that would usually do 20 damage will do 100 damage.
Now, the tooltip claims "500% increased damage for next melee strike" – in other words: "Damage is increased by 500%". This is equivalent to: "Damage is multiplied by 6", which can be proven as follows using a very rudimentary proof of induction, sort of:
- Let [math]\displaystyle{ x }[/math] be the damage value.
- Let [math]\displaystyle{ x_0 }[/math] be the damage increased by 0%: [math]\displaystyle{ x_0 = x + (0\%*x) = x + (0*\frac{1}{100}*x) = x + (0*x) = 1*x }[/math]
- Hence: "Increase [math]\displaystyle{ x }[/math] by 0%" is equivalent to [math]\displaystyle{ 1*x }[/math].
- Let [math]\displaystyle{ x_1 }[/math] be the damage increased by 100%: [math]\displaystyle{ x_1 = x + (100\%*x) = x + (100*\frac{1}{100}*x) = x + (1*x) = 2*x }[/math]
- Hence: "Increase [math]\displaystyle{ x }[/math] by 100%" is equivalent to [math]\displaystyle{ 2*x }[/math].
- ...
- Let [math]\displaystyle{ x_5 }[/math] be the damage increased by 500%: [math]\displaystyle{ x_5 = x + (500\%*x) = x + (500*\frac{1}{100}*x) = x + (5*x) = 6*x }[/math]
- Hence: "Increase [math]\displaystyle{ x }[/math] by 500%" is equivalent to [math]\displaystyle{ 6*x }[/math].
This does not match the effect shown above, which would have to be described as [math]\displaystyle{ 5*x }[/math] – an increase by 400%.
Can this be established as the consensus or are there objections?
--Rye Greenwood (talk) 14:56, 28 March 2021 (UTC)