Merge pull request #1554 from CalamityTeam/misc-doze

Evil Smasher & Pigion Buffs
This commit is contained in:
CongratsIsTrash authored and GitHub committed 2026-06-29 21:45:03 -04:00
commit df3d6d4121
13 files changed
+79 -35

No files matched your search

+13 -9
View File
@@ -1,10 +1,8 @@
using System;
using CalamityMod.DataStructures;
using CalamityMod.Items.Accessories;
using Terraria;
using Terraria.Localization;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.StatBuffs
{
@@ -12,7 +10,7 @@ namespace CalamityMod.Buffs.StatBuffs
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 40,
EnemyLostRegen = 160,
SicknessDebuffScaling = 1,
HeatDebuffScaling = 1,
ColdDebuffScaling = 1,
@@ -39,7 +37,14 @@ namespace CalamityMod.Buffs.StatBuffs
.CombineWith(DebuffData.ForceModifierPositiveWithScaling(cnpc.ActiveWaterDebuffMultiplier, debuffData.WaterDebuffScaling)
.CombineWith(DebuffData.ForceModifierPositiveWithScaling(cnpc.ActiveElectricDebuffMultiplier, debuffData.ElectricDebuffScaling)
))));
totalDPS = totalScaling.ApplyTo(totalDPS);
//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);
}
@@ -53,9 +58,8 @@ namespace CalamityMod.Buffs.StatBuffs
public override void Update(Player player, ref int buffIndex)
{
player.lifeRegenTime += 2;
player.GetDamage<GenericDamageClass>() += 0.1f;
player.moveSpeed += 0.2f;
player.lifeRegenTime += 4;
player.GetDamage<GenericDamageClass>() += 0.20f;
}
public override void Update(NPC npc, ref int buffIndex)
+12 -3
View File
@@ -3560,7 +3560,7 @@ namespace CalamityMod.CalPlayer
for (int projIndex = 0; projIndex < Main.maxProjectiles; projIndex++)
{
Projectile proj = Main.projectile[projIndex];
if (proj.minionSlots <= 0f || !proj.CountsAsClass<SummonDamageClass>())
if ((proj.minionSlots <= 0f && proj.type != ModContent.ProjectileType<Pigion>()) || !proj.CountsAsClass<SummonDamageClass>())
continue;
if (proj.active && proj.owner == Player.whoAmI)
@@ -5427,7 +5427,6 @@ namespace CalamityMod.CalPlayer
(statisVoidSash ? 0.85f : 0f) +
(blueCandle ? WeightlessCandle.AccelerationBoost : 0f) +
(planarSpeedBoost > 0 ? (0.01f * planarSpeedBoost) : 0f) +
//(exaltedKillMode ? 7f : devilsDevastationKillMode ? 11f : 0) +
(hasteLevel * 0.05f);
float runSpeedMult = 1f +
@@ -5441,7 +5440,6 @@ namespace CalamityMod.CalPlayer
(CobaltSet ? CobaltArmorSetChange.SpeedBoostSetBonusPercentage * 0.01f : 0f) +
(silvaSet ? SilvaArmor.AccelerationBoost : 0f) +
(planarSpeedBoost > 0 ? (0.01f * planarSpeedBoost) : 0f) +
//(exaltedKillMode ? 0.4f : devilsDevastationKillMode ? 0.7f : 0) +
(hasteLevel * 0.05f);
if ((Player.slippy || Player.slippy2) && Player.iceSkate)
@@ -5460,6 +5458,17 @@ namespace CalamityMod.CalPlayer
else
momentumCapacitorBoost = 0f;
if (Player.HasBuff<SmashedEvil>())
{
runAccMult += 0.25f;
Player.runSlowdown *= 1.5f;
if (Player.accRunSpeed > 3)
Player.accRunSpeed += 1.1f;
if (Player.wingAccRunSpeed > 3)
Player.wingAccRunSpeed += 1.1f;
Player.maxRunSpeed += 1.1f;
}
Player.runAcceleration *= runAccMult;
Player.maxRunSpeed *= runSpeedMult;
}
+4 -1
View File
@@ -694,6 +694,10 @@ namespace CalamityMod.CalPlayer
public override void NaturalLifeRegen(ref float regen)
{
if (Player.HasBuff<SmashedEvil>())
regen *= 1.5f;
// Honey Dew and its upgrades make natural regen more powerful
if (purity)
regen *= Radiance.NaturalRegenPower;
@@ -703,7 +707,6 @@ namespace CalamityMod.CalPlayer
regen *= LivingDew.NaturalRegenPower;
else if (honeyDew)
regen *= HoneyDew.NaturalRegenPower;
// The Camper counteracts the regen loss while moving horizontally
if (camper && (Player.velocity.X != 0 && Player.grappling[0] <= 0))
{
+2 -2
View File
@@ -1849,7 +1849,7 @@ namespace CalamityMod.CalPlayer
int numOfPigs = Player.ownedProjectileCounts[ModContent.ProjectileType<Pigion>()];
if (numOfPigs < Player.Calamity().friendlyMinions)
{
int pigDamage = 7;
int pigDamage = 12;
Projectile.NewProjectileDirect(Player.GetSource_FromThis(), Player.Center, new Vector2(0, -16).RotatedByRandom(MathHelper.Pi), ModContent.ProjectileType<Pigion>(), pigDamage, 0f, Player.whoAmI, 0, numOfPigs + 1);
}
}
@@ -3644,7 +3644,7 @@ namespace CalamityMod.CalPlayer
if (purpleHazeStealthTimer > 0)
{
//this is so janky looking but it's the only way I could get it to work properly
if (!(StealthStrikeAvailable() && Player.HeldItem.DamageType == RogueDamageClass.Instance))
if (!(StealthStrikeAvailable() && Player.HeldItem.DamageType.CountsAsClass(RogueDamageClass.Instance)))
Player.GetDamage(DamageClass.Generic) += PurpleHaze.DamageBoost + ((dripPlayer.HasAlcohol(AlcoholType.PurpleHaze) && purpleHaze) ? PurpleHaze.DamageBoost : 0);
else
stealthDamage -= PurpleHaze.StealthDamageLoss + ((dripPlayer.HasAlcohol(AlcoholType.PurpleHaze) && purpleHaze) ? PurpleHaze.StealthDamageLoss : 0);
+5 -5
View File
@@ -153,7 +153,7 @@ namespace CalamityMod.CalPlayer
if (cooldown < BlackGlassBand.cooldown)
cooldown = BlackGlassBand.cooldown;
}
if (protolithBangle && item.DamageType == DamageClass.Ranged)
if (protolithBangle && item.DamageType.CountsAsClass(DamageClass.Ranged))
{
int damage = (int)Player.GetBestClassDamage().ApplyTo(ProtolithBangle.damage);
Projectile band = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType<ProtolithBangleProjectile>(), damage, -1, Player.whoAmI, target.whoAmI);
@@ -161,7 +161,7 @@ namespace CalamityMod.CalPlayer
if (cooldown < ProtolithBangle.cooldown)
cooldown = ProtolithBangle.cooldown;
}
if (batholithBangle && item.DamageType == DamageClass.Magic)
if (batholithBangle && item.DamageType.CountsAsClass(DamageClass.Magic))
{
int damage = (int)Player.GetBestClassDamage().ApplyTo(BatholithBangle.damage);
Projectile band = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType<BatholithBangleProjectile>(), damage, -1, Player.whoAmI, target.whoAmI);
@@ -368,7 +368,7 @@ namespace CalamityMod.CalPlayer
if (cooldown < BlackGlassBand.cooldown)
cooldown = BlackGlassBand.cooldown;
}
if (protolithBangle && proj.DamageType == DamageClass.Ranged)
if (protolithBangle && proj.DamageType.CountsAsClass(DamageClass.Ranged))
{
int damage = (int)Player.GetBestClassDamage().ApplyTo(ProtolithBangle.damage);
Projectile band = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType<ProtolithBangleProjectile>(), damage, -1, Player.whoAmI, target.whoAmI);
@@ -376,7 +376,7 @@ namespace CalamityMod.CalPlayer
if (cooldown < ProtolithBangle.cooldown)
cooldown = ProtolithBangle.cooldown;
}
if (batholithBangle && proj.DamageType == DamageClass.Magic)
if (batholithBangle && proj.DamageType.CountsAsClass(DamageClass.Magic))
{
int damage = (int)Player.GetBestClassDamage().ApplyTo(BatholithBangle.damage);
Projectile band = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType<BatholithBangleProjectile>(), damage, -1, Player.whoAmI, target.whoAmI);
@@ -618,7 +618,7 @@ namespace CalamityMod.CalPlayer
ProjLifesteal(target, proj, damageDone, hit.Crit);
ProjOnHit(proj, target, hit.Crit, target.IsAnEnemy(false), targetIsDummy);
NPCDebuffs(target, proj.CountsAsClass<MeleeDamageClass>(), proj.CountsAsClass<RangedDamageClass>(), proj.CountsAsClass<MagicDamageClass>(), proj.CountsAsClass<SummonDamageClass>(), proj.CountsAsClass<ThrowingDamageClass>(), proj.CountsAsClass<SummonMeleeSpeedDamageClass>(), hit.Crit, true, proj.noEnchantments);
NPCDebuffs(target, proj.CountsAsClass<MeleeDamageClass>(), proj.CountsAsClass<RangedDamageClass>(), proj.CountsAsClass<MagicDamageClass>(), proj.CountsAsClass<SummonDamageClass>(), proj.CountsAsClass<ThrowingDamageClass>(), proj.CountsAsClass<SummonMeleeSpeedDamageClass>() && /*This is for Pigion to not count as a whip*/!(proj.type == ModContent.ProjectileType<BasicBurst>() && proj.minion), hit.Crit, true, proj.noEnchantments);
// Shattered Community tracks all damage dealt with Rage Mode (ignoring dummies).
if (targetIsDummy)
+18
View File
@@ -0,0 +1,18 @@
using Terraria.ModLoader;
namespace CalamityMod
{
public class AllClassDamageClass : DamageClass
{
internal static AllClassDamageClass Instance;
public override void Load() => Instance = this;
public override void Unload() => Instance = null;
public override StatInheritanceData GetModifierInheritance(DamageClass damageClass)
{
return StatInheritanceData.Full;
}
public override bool GetEffectInheritance(DamageClass damageClass) => true;
}
}
+1 -1
View File
@@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Melee
Item.width = 64;
Item.height = 66;
Item.damage = 200;
Item.DamageType = AverageDamageClass.Instance;
Item.DamageType = AllClassDamageClass.Instance; //Allow it to proc all class on hit effects
Item.useAnimation = Item.useTime = 120;
Item.channel = true;
Item.knockBack = 6f;
@@ -1803,14 +1803,16 @@ SmashedEvil: {
Description: Increased damage, movement speed, and regeneration
ItemTooltipEnemy:
'''
All types - 20 DPS
All types - 80 DPS
Ignores enemy weaknesses and resistances
+5 damage taken
'''
ItemTooltipPlayer:
'''
Regen returns to full strength 200% faster
10% increased damage
20% increased movement speed
+2 HP/s life regen, natural regeneration is much stronger and returns much quicker
20% increased damage
Increased acceleration and deceleration
5mph increased top speed
'''
}
@@ -5,3 +5,4 @@ StealthDamageClass.DisplayName: stealth damage
TrueMeleeDamageClass.DisplayName: true melee damage
TrueMeleeNoSpeedDamageClass.DisplayName: true melee damage
VoidTagDmgType.DisplayName: void tag damage
AllClassDamageClass.DisplayName: all-class damage
@@ -598,7 +598,7 @@ TownPiggy: {
Techno: Techno
JohnPork: John Pork
Piglet: Piglet
Poogie: Poogie
Poogie: Poogie
}
Chat: {
+2 -2
View File
@@ -127,7 +127,7 @@ public class BloodBomb : ModNPC, ILocalizedModType
public override void ModifyHitByItem(Player player, Item item, ref NPC.HitModifiers modifiers)
{
if (modifiers.DamageType == TrueMeleeDamageClass.Instance)
if (modifiers.DamageType.CountsAsClass(TrueMeleeDamageClass.Instance))
{
modifiers.FinalDamage *= 1.5f;
return;
@@ -143,7 +143,7 @@ public class BloodBomb : ModNPC, ILocalizedModType
public override void ModifyHitByProjectile(Projectile projectile, ref NPC.HitModifiers modifiers)
{
if (modifiers.DamageType == TrueMeleeDamageClass.Instance)
if (modifiers.DamageType.CountsAsClass(TrueMeleeDamageClass.Instance))
{
modifiers.FinalDamage *= 1.5f;
return;
+7 -4
View File
@@ -41,6 +41,7 @@ namespace CalamityMod.Projectiles.Melee
RotateInStartup = 0;
Projectile.width = 64;
Projectile.height = 66;
Projectile.DamageType = AllClassDamageClass.Instance;
}
public override void Spawn()
@@ -61,7 +62,7 @@ namespace CalamityMod.Projectiles.Melee
if (inStartup)
{
CurrentChargeMult = timer / (float)(StartupTime-1);
Owner.velocity.X *= 0.97f;
Owner.velocity.X *= CurrentChargeMult < 1 ? 0.98f : 0.995f;
}
if (inStartup && !Owner.channel && timer > 30)
{
@@ -99,7 +100,7 @@ namespace CalamityMod.Projectiles.Melee
{
Owner.velocity *= 0.15f;
Owner.velocity -= adjustedAngle.RotatedBy(MathHelper.PiOver2) * angle.X * MathHelper.Lerp(7.5f,16f, CurrentChargeMult);
Owner.velocity -= adjustedAngle.RotatedBy(MathHelper.PiOver2) * angle.X * MathHelper.Lerp(7.5f,16f, CurrentChargeMult) * (Projectile.scale / 1.25f);
float ringRot = SwingCompletion < 0.5f ? 0 : MathHelper.PiOver2;
GeneralParticleHandler.SpawnParticle(new CustomPulse(HammerFrontPos, Vector2.Zero, Color.Red, "CalamityMod/Particles/ShatteredExplosion", Vector2.One, Main.rand.NextFloatDirection(), 0.03f, 0.04f * (2 + CurrentChargeMult), 15));
GeneralParticleHandler.SpawnParticle(new DirectionalPulseRing(HammerFrontPos, Vector2.Zero, Color.Purple, new Vector2(0.2f, 1f), ringRot, 0.2f, 0.75f * (2 + CurrentChargeMult), 30));
@@ -124,6 +125,8 @@ namespace CalamityMod.Projectiles.Melee
SoundEngine.PlaySound(SoundID.DD2_MonkStaffGroundImpact);
}
}
if (CooldownTimer == 1)
Owner.Calamity().ConsumeStealthByAttacking();
Owner.heldProj = Projectile.whoAmI;
}
@@ -186,8 +189,8 @@ namespace CalamityMod.Projectiles.Melee
SoundEngine.PlaySound(SoundID.Item69 with { Volume = 1f, LimitsArePerVariant = false, MaxInstances = 1 });
}
target.AddBuff(ModContent.BuffType<SmashedEvil>(), (int)MathHelper.Lerp(60, 900, CurrentChargeMult));
Owner.AddBuff(ModContent.BuffType<SmashedEvil>(), (int)MathHelper.Lerp(60, 900, CurrentChargeMult));
target.AddBuff(ModContent.BuffType<SmashedEvil>(), (int)MathHelper.Lerp(60, 1200, CurrentChargeMult));
Owner.AddBuff(ModContent.BuffType<SmashedEvil>(), (int)MathHelper.Lerp(60, 1200, CurrentChargeMult));
}
public override bool PreDraw(ref Color lightColor)
+7 -3
View File
@@ -41,13 +41,16 @@ namespace CalamityMod.Projectiles.Typeless
Projectile.width = 42;
Projectile.height = 28;
Projectile.friendly = true;
Projectile.DamageType = AverageDamageClass.Instance;
highestSpeed = 18;
//Allow it to proc all class on hit effects. Pigion is spawned using a fixed damage, and applies best-class damage when it spawns the burst
Projectile.DamageType = AllClassDamageClass.Instance;
Projectile.ignoreWater = true;
Projectile.tileCollide = true;
Projectile.penetrate = -1;
Projectile.timeLeft = 600;
Projectile.extraUpdates = 1;
Projectile.usesLocalNPCImmunity = true;
Projectile.minion = true; //note: costs 0 minion slots. This allows it to benefit from "minion" effects
}
public void Frames()
{
@@ -295,10 +298,11 @@ namespace CalamityMod.Projectiles.Typeless
float blastSize = 100;
float minMultiplier = 0.1f;
int hitsToMinMult = 4;
Projectile blast = Projectile.NewProjectileDirect(Owner.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType<BasicBurst>(), (int)(Projectile.damage*pigNum), -15, Owner.whoAmI, blastSize, minMultiplier, hitsToMinMult);
Projectile blast = Projectile.NewProjectileDirect(Owner.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType<BasicBurst>(), (int)(Owner.GetBestClassDamage().ApplyTo(Projectile.originalDamage*pigNum)), -15, Owner.whoAmI, blastSize, minMultiplier, hitsToMinMult);
blast.timeLeft = 5;
blast.DamageType = AverageDamageClass.Instance;
blast.DamageType = AllClassDamageClass.Instance; //Proc effects for all classes, but has no effect on the dmg itself
blast.CritChance = 100;
blast.minion = true; //note: costs 0 minion slots. This allows it to benefit from "minion" effects
}
Owner.SetScreenshake(3);