Issue with implementing vanilla damage buffs

orangepecan

Terrarian
Working on a mod to combine vanilla potions. Having issues with implementation of ranged damage bonuses.

Long story short, the implementation of my archery + wrath combo works correctly with a minor rounding error. With archery + wrath and no other bonuses, the Tsunami does the expected 64 damage. However, when I apply the combination of the combination, the Tsunami now does 68 damage. The same thing happens with rocket and bullet weapons. I initially thought the problem was the use of DamageClass.Generic (my thought was does this apply extra damage to ranged AND each subset of ranged?) for the Wrath potion buff but my Wrath combination works correctly.

EDIT: Nevermind, now it works. I don't know what happened but I may have forgot to rebuild my mod before testing it again.

I have another issue now and that is the vanilla archery + wrath potions are a bit stronger than my archer + damage combinations. With a full Vortex armor, the Tsunami does 82 damage with my ultimate combination and 85 damage with the vanilla archery + wrath buffs. The more damage bonuses from other sources that are stacked, the bigger the difference becomes. This is only happening with bows specifically. Magic damage, which has it's own multiplier from Magic Power potion, works as expected.

EDIT2: Figured it out. The correct code is player.arrowDamage *= 1.1f;

Here's the code:

Archer Combination:

Code:
public override void Update(Player player, ref int buffIndex)
{
    player.ammoPotion = true;
    player.archery = true;
    player.arrowDamage += 0.1f;

    player.buffImmune[BuffID.AmmoReservation] = true;
    player.buffImmune[BuffID.Archery] = true;
}

Wrath Combination:

Code:
public override void Update(Player player, ref int buffIndex)
{
    player.GetDamage(DamageClass.Generic) += 0.1f;
    player.GetCritChance(DamageClass.Generic) += 10;

    player.thorns += 1.0f;

    player.buffImmune[BuffID.Rage] = true;
    player.buffImmune[BuffID.Wrath] = true;
    player.buffImmune[BuffID.Thorns] = true;
}

All Damage Combination:

Code:
public override void Update(Player player, ref int buffIndex)
{
    player.GetDamage(DamageClass.Generic) += 0.1f;
    player.GetCritChance(DamageClass.Generic) += 10;

    player.thorns += 1.0f;

    player.ammoPotion = true;
    player.archery = true;
    player.arrowDamage += 0.1f;

    player.GetDamage(DamageClass.Magic) += 0.2f;
    player.manaRegenBuff = true;
    player.maxMinions++;

    player.buffImmune[BuffID.MagicPower] = true;
    player.buffImmune[BuffID.ManaRegeneration] = true;
    player.buffImmune[BuffID.Summoning] = true;
    player.buffImmune[BuffID.AmmoReservation] = true;
    player.buffImmune[BuffID.Archery] = true;
    player.buffImmune[BuffID.Rage] = true;
    player.buffImmune[BuffID.Wrath] = true;
    player.buffImmune[BuffID.Thorns] = true;
    player.buffImmune[ModContent.BuffType<Buffs.BelligerentsBrew>()] = true;
    player.buffImmune[ModContent.BuffType<Buffs.ConjurersBrew>()] = true;
    player.buffImmune[ModContent.BuffType<Buffs.SharpshootersBrew>()] = true;
}
 
Last edited:
Back
Top Bottom