Files
CalamityModPublic/Buffs/StatBuffs/SmashedEvil.cs
T
Doze-Zoze 399502ef98 Evil Smasher & Pigion Buffs
- Added All-Class Damage Type
  - Procs all class effects and scales with all class damages, as compared to Average, which only gets half of non-generic boosts. Meant to be used very sparingly, on places where damage scaling like this won't cause issues because the damage itself is very weak.
  - Can be applied to projectiles that are spawned scaling with BestClass to keep best-class scaling but allow all-class effects to proc
- Evil Smasher Balancing
  - 15 -> 20 second smashed evil
  - 0.97x -> 0.98x speed per frame, 0.995x if fully charged
  - does All-Class instead of Average dmg
  - Projectile does All-Class instead of True Melee dmg
- Smashed Evil Buffs
  - +10 -> 20% dmg
  - 20 -> 80 DPS, but ignores weakness and resistance (net-neutral on double weak, buff on single weak, nerf on triple weak)
  - +20% move speed -> +5mph max horizontal speed, increased accel & decel
- Pigion Balancing
  - 7 -> 12 damage
  - Now scales with best class damage
  - Now deals All-Class damage
  - Now counts as a Minion for various effects
2026-06-25 21:26:05 -05:00

70 lines
3.0 KiB
C#

using System;
using CalamityMod.DataStructures;
using CalamityMod.Systems.Collections;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.StatBuffs
{
public class SmashedEvil : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 160,
SicknessDebuffScaling = 1,
HeatDebuffScaling = 1,
ColdDebuffScaling = 1,
ElectricDebuffScaling = 1,
WaterDebuffScaling = 1,
NPCLifeRegenMethod = SmashedEvilNPCRegen
};
public static void SmashedEvilNPCRegen(NPC npc, int buffType, ref int buffIndex, ref int damage)
{
var cnpc = npc.Calamity();
float totalDPS = debuffData.EnemyLostRegen;
var heat = cnpc.ActiveHeatDebuffMultiplier;
var cold = cnpc.ActiveColdDebuffMultiplier;
var sick = cnpc.ActiveSicknessDebuffMultiplier;
var elec = cnpc.ActiveElectricDebuffMultiplier;
var water = cnpc.ActiveWaterDebuffMultiplier;
StatModifier totalScaling =
DebuffData.ForceModifierPositiveWithScaling(cnpc.ActiveHeatDebuffMultiplier, debuffData.HeatDebuffScaling)
.CombineWith(DebuffData.ForceModifierPositiveWithScaling(cnpc.ActiveColdDebuffMultiplier, debuffData.ColdDebuffScaling)
.CombineWith(DebuffData.ForceModifierPositiveWithScaling(cnpc.ActiveSicknessDebuffMultiplier, debuffData.SicknessDebuffScaling)
.CombineWith(DebuffData.ForceModifierPositiveWithScaling(cnpc.ActiveWaterDebuffMultiplier, debuffData.WaterDebuffScaling)
.CombineWith(DebuffData.ForceModifierPositiveWithScaling(cnpc.ActiveElectricDebuffMultiplier, debuffData.ElectricDebuffScaling)
))));
//Smashed Evil ignores Mult boosters for now to ignore weakness/resist. Once those systems are changed, return to using totalScaling instead of this mess.
StatModifier finalScaling = new();
finalScaling += totalScaling.Additive - 1;
finalScaling.Base = totalScaling.Base;
finalScaling.Flat = totalScaling.Flat;
totalDPS = finalScaling.ApplyTo(totalDPS);
var totalDPSAdjusted = totalDPS - debuffData.EnemyVanillaRegenToCancelOut;
npc.Calamity().ApplyDPSDebuff((int)(totalDPSAdjusted), (int)Math.Max(totalDPS * debuffData.MultiplierDamageTickSize, debuffData.MinimumDamageTickSize), ref npc.lifeRegen, ref damage);
}
public override void SetStaticDefaults()
{
Main.debuff[Type] = false;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
{
player.lifeRegenTime += 4;
player.GetDamage<GenericDamageClass>() += 0.20f;
}
public override void Update(NPC npc, ref int buffIndex)
{
}
}
}