diff --git a/Buffs/StatBuffs/SmashedEvil.cs b/Buffs/StatBuffs/SmashedEvil.cs index 57f5c2ac60..2a67a162d9 100644 --- a/Buffs/StatBuffs/SmashedEvil.cs +++ b/Buffs/StatBuffs/SmashedEvil.cs @@ -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() += 0.1f; - player.moveSpeed += 0.2f; + player.lifeRegenTime += 4; + player.GetDamage() += 0.20f; } public override void Update(NPC npc, ref int buffIndex) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index da94a934fc..76ca7d151f 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -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()) + if ((proj.minionSlots <= 0f && proj.type != ModContent.ProjectileType()) || !proj.CountsAsClass()) 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()) + { + 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; } diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 67a2d10505..efdca23cf9 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -694,6 +694,10 @@ namespace CalamityMod.CalPlayer public override void NaturalLifeRegen(ref float regen) { + + if (Player.HasBuff()) + 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)) { diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index cb171220f8..384e65a136 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -1849,7 +1849,7 @@ namespace CalamityMod.CalPlayer int numOfPigs = Player.ownedProjectileCounts[ModContent.ProjectileType()]; 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(), 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); diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 979cee740d..f80ed26df4 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -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(), 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(), 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(), 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(), 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(), proj.CountsAsClass(), proj.CountsAsClass(), proj.CountsAsClass(), proj.CountsAsClass(), proj.CountsAsClass(), hit.Crit, true, proj.noEnchantments); + NPCDebuffs(target, proj.CountsAsClass(), proj.CountsAsClass(), proj.CountsAsClass(), proj.CountsAsClass(), proj.CountsAsClass(), proj.CountsAsClass() && /*This is for Pigion to not count as a whip*/!(proj.type == ModContent.ProjectileType() && proj.minion), hit.Crit, true, proj.noEnchantments); // Shattered Community tracks all damage dealt with Rage Mode (ignoring dummies). if (targetIsDummy) diff --git a/DamageClasses/AllClassDamageClass.cs b/DamageClasses/AllClassDamageClass.cs new file mode 100644 index 0000000000..04cfc318c7 --- /dev/null +++ b/DamageClasses/AllClassDamageClass.cs @@ -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; + } +} diff --git a/Items/Weapons/Melee/EvilSmasher.cs b/Items/Weapons/Melee/EvilSmasher.cs index 596829a8c7..75b084b8bc 100644 --- a/Items/Weapons/Melee/EvilSmasher.cs +++ b/Items/Weapons/Melee/EvilSmasher.cs @@ -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; diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index f2d16988af..d45fe6dbc5 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -1803,14 +1803,16 @@ SmashedEvil: { Description: Increased damage, movement speed, and regeneration ItemTooltipEnemy: ''' - All types - 20 DPS + All types - 80 DPS + Ignores enemy weakness and resistances +5 damage taken ''' ItemTooltipPlayer: ''' - Regen returns to full strength 200% faster - 10% increased damage - 20% increased movement speed + Natural regeneration is much stronger and returns much quicker + 15% increased damage + Increased acceleration and deceleration + 5mph increased top speed ''' } diff --git a/Localization/en-US/Mods.CalamityMod.DamageClasses.hjson b/Localization/en-US/Mods.CalamityMod.DamageClasses.hjson index 4b00ee161b..e91a8731b3 100644 --- a/Localization/en-US/Mods.CalamityMod.DamageClasses.hjson +++ b/Localization/en-US/Mods.CalamityMod.DamageClasses.hjson @@ -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 diff --git a/Localization/en-US/Mods.CalamityMod.NPCs.hjson b/Localization/en-US/Mods.CalamityMod.NPCs.hjson index 9c0835999f..e21ebc6a6a 100644 --- a/Localization/en-US/Mods.CalamityMod.NPCs.hjson +++ b/Localization/en-US/Mods.CalamityMod.NPCs.hjson @@ -598,7 +598,7 @@ TownPiggy: { Techno: Techno JohnPork: John Pork Piglet: Piglet - Poogie: Poogie + Poogie: Poogie } Chat: { diff --git a/Projectiles/Boss/BrainOfCthulhu/BloodBomb.cs b/Projectiles/Boss/BrainOfCthulhu/BloodBomb.cs index 9caa3a9e92..cdcfeee813 100644 --- a/Projectiles/Boss/BrainOfCthulhu/BloodBomb.cs +++ b/Projectiles/Boss/BrainOfCthulhu/BloodBomb.cs @@ -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; diff --git a/Projectiles/Melee/EvilSmasherProjectile.cs b/Projectiles/Melee/EvilSmasherProjectile.cs index d7708dd214..958db0e7f4 100644 --- a/Projectiles/Melee/EvilSmasherProjectile.cs +++ b/Projectiles/Melee/EvilSmasherProjectile.cs @@ -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(), (int)MathHelper.Lerp(60, 900, CurrentChargeMult)); - Owner.AddBuff(ModContent.BuffType(), (int)MathHelper.Lerp(60, 900, CurrentChargeMult)); + target.AddBuff(ModContent.BuffType(), (int)MathHelper.Lerp(60, 1200, CurrentChargeMult)); + Owner.AddBuff(ModContent.BuffType(), (int)MathHelper.Lerp(60, 1200, CurrentChargeMult)); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Typeless/Pigion.cs b/Projectiles/Typeless/Pigion.cs index 50ccb93c4f..f2863be666 100644 --- a/Projectiles/Typeless/Pigion.cs +++ b/Projectiles/Typeless/Pigion.cs @@ -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(), (int)(Projectile.damage*pigNum), -15, Owner.whoAmI, blastSize, minMultiplier, hitsToMinMult); + Projectile blast = Projectile.NewProjectileDirect(Owner.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (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);