diff --git a/Buffs/DamageOverTime/CrimsonFlux.cs b/Buffs/DamageOverTime/VermillionFlux.cs similarity index 100% rename from Buffs/DamageOverTime/CrimsonFlux.cs rename to Buffs/DamageOverTime/VermillionFlux.cs diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index d200bbec49..8da22e7631 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -784,13 +784,6 @@ namespace CalamityMod.CalPlayer // The amount of damage that will be dealt is yet to be determined. // - if (transformer) - { - if (npc.type == NPCID.BlueJellyfish || npc.type == NPCID.PinkJellyfish || npc.type == NPCID.GreenJellyfish || npc.type == NPCID.FungoFish || - npc.type == NPCID.BloodJelly || npc.type == ModContent.NPCType() || npc.type == ModContent.NPCType() || npc.type == ModContent.NPCType()) - contactDamageReduction += 0.5; - } - // Can't have any cooldowns here because dodges grrrrr.... if (fleshTotem && !Player.HasCooldown(Cooldowns.FleshTotem.ID) && TotalEnergyShielding <= 0) contactDamageReduction += 0.5; @@ -1044,8 +1037,7 @@ namespace CalamityMod.CalPlayer if (transformer) { - if (proj.type == ProjectileID.MartianTurretBolt || proj.type == ProjectileID.GigaZapperSpear || proj.type == ProjectileID.CultistBossLightningOrbArc || proj.type == ProjectileID.VortexLightning || proj.type == ModContent.ProjectileType() || - proj.type == ProjectileID.BulletSnowman || proj.type == ProjectileID.BulletDeadeye || proj.type == ProjectileID.SniperBullet || proj.type == ProjectileID.VortexLaser) + if (proj.type == ProjectileID.BulletSnowman || proj.type == ProjectileID.BulletDeadeye || proj.type == ProjectileID.SniperBullet) projectileDamageReduction += 0.5; } @@ -2483,7 +2475,7 @@ namespace CalamityMod.CalPlayer if (Player.whoAmI == Main.myPlayer) { - for (int i = 0; i < 4; i++) + for (int i = 0; i < (transformer ? 5 : 4); i++) { offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; int spark1 = Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), sDamage, 1.25f, Player.whoAmI, 0f, 0f); @@ -2492,11 +2484,23 @@ namespace CalamityMod.CalPlayer { Main.projectile[spark1].timeLeft = 120; Main.projectile[spark1].DamageType = DamageClass.Generic; + if (transformer) + { + Main.projectile[spark1].timeLeft = 240; + Main.projectile[spark1].extraUpdates = 1; + Main.projectile[spark1].penetrate = 10; + } } if (spark2.WithinBounds(Main.maxProjectiles)) { Main.projectile[spark2].timeLeft = 120; Main.projectile[spark2].DamageType = DamageClass.Generic; + if (transformer) + { + Main.projectile[spark2].timeLeft = 240; + Main.projectile[spark2].extraUpdates = 1; + Main.projectile[spark2].penetrate = 10; + } } } } diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 4da98a113f..a35a3d65ef 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -693,7 +693,7 @@ namespace CalamityMod.CalPlayer if (tile.TileType == auricOreID) { Player.Hurt(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AuricRejection").Format(Player.name)), auricRejectionDamage, 0); - Player.AddBuff(BuffID.Electrified, 300); + Player.AddBuff(ModContent.BuffType(), 120); } SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/ExoMechs/TeslaShoot1")); } @@ -970,9 +970,6 @@ namespace CalamityMod.CalPlayer { holyInfernoFadeIntensity = MathHelper.Clamp(holyInfernoFadeIntensity - 0.01f, 0f, 1f); } - // Transformer immunity to Electrified - if (transformer) - Player.buffImmune[BuffID.Electrified] = true; // Reduce breath meter while in icy water instead of chilling bool canBreath = (aquaticHeart && NPC.downedBoss3) || Player.gills || Player.merman; @@ -3385,34 +3382,9 @@ namespace CalamityMod.CalPlayer { if (Player.whoAmI == Main.myPlayer) { - // Reduce the buffTime of Electrified. - bool reduceElectrifiedDuration = false; - for (int l = 0; l < Player.MaxBuffs; l++) - { - if (Player.buffType[l] == ModContent.BuffType()) - { - if (Player.buffTime[l] >= 5) - reduceElectrifiedDuration = true; - } - } - - if (reduceElectrifiedDuration) - { - for (int l = 0; l < Player.MaxBuffs; l++) - { - if (Player.buffType[l] == BuffID.Electrified) - { - if (Player.buffTime[l] > 2) - { - Player.buffTime[l]--; - break; - } - } - } - } - + bool check = true; // Summon the aura (this check is here to prevent out of bounds errors). - if (reduceElectrifiedDuration) + if (check) { // https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list var source = Player.GetSource_Buff(Player.FindBuffIndex(ModContent.BuffType())); diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 42a6b1c2af..fcbc5f20cc 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -130,6 +130,10 @@ namespace CalamityMod.CalPlayer target.AddBuff(BuffType(), 120); break; + case ItemID.InfluxWaver: + target.AddBuff(BuffID.Electrified, 300); + break; + case ItemID.BeeKeeper: case ItemID.BladeofGrass: target.AddBuff(BuffID.Poisoned, 240); @@ -262,6 +266,18 @@ namespace CalamityMod.CalPlayer target.AddBuff(BuffID.OnFire3, 180); break; + case ProjectileID.InfluxWaver: + case ProjectileID.UFOLaser: + case ProjectileID.Electrosphere: + target.AddBuff(BuffID.Electrified, 180); + break; + + case ProjectileID.ThunderSpear: + case ProjectileID.ThunderSpearShot: + case ProjectileID.ThunderStaffShot: + target.AddBuff(BuffType(), 90); + break; + case ProjectileID.GolemFist: target.AddBuff(BuffType(), 180); break; @@ -1249,7 +1265,7 @@ namespace CalamityMod.CalPlayer //20% chance for Voltaic Jelly if (Main.rand.NextBool(starTaintedGenerator ? 1 : 5)) { - target.AddBuff(BuffID.Electrified, 60); + target.AddBuff(ModContent.BuffType(), 60); } } diff --git a/Items/Accessories/DynamoStemCells.cs b/Items/Accessories/DynamoStemCells.cs index 6d5188e971..b661c98217 100644 --- a/Items/Accessories/DynamoStemCells.cs +++ b/Items/Accessories/DynamoStemCells.cs @@ -35,7 +35,6 @@ namespace CalamityMod.Items.Accessories player.Calamity().MiniSwarmers = true; player.GetDamage() += 0.1f; player.moveSpeed += 0.1f; - player.Calamity().eleResist = true; } public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) diff --git a/Items/Accessories/Nucleogenesis.cs b/Items/Accessories/Nucleogenesis.cs index 19a5c50e6f..385be00e8d 100644 --- a/Items/Accessories/Nucleogenesis.cs +++ b/Items/Accessories/Nucleogenesis.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Accessories modPlayer.nucleogenesis = true; modPlayer.shadowMinions = true; //shadowflame modPlayer.holyMinions = true; //holy flames - modPlayer.voltaicJelly = true; //electrified + modPlayer.voltaicJelly = true; //static discharge modPlayer.starTaintedGenerator = true; //astral infection and irradiated player.GetKnockback() += 3f; player.GetDamage() += 0.15f; diff --git a/Items/Accessories/TheTransformer.cs b/Items/Accessories/TheTransformer.cs index d5df8d20d1..6504109afd 100644 --- a/Items/Accessories/TheTransformer.cs +++ b/Items/Accessories/TheTransformer.cs @@ -32,6 +32,7 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); modPlayer.transformer = true; modPlayer.aSpark = true; + player.Calamity().eleResist = true; } public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 5726d7ac9a..2e27e6c33c 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -601,7 +601,7 @@ DynamoStemCells: { ''' 10% increased ranged damage and movement speed Ranged weapons fire a powerful mini swarmer every 3 seconds - Reduces the damage of the Dragonfire and Electrified debuff + Reduces the damage you take from the Dragonfire debuff ''' } @@ -984,7 +984,7 @@ JellyChargedBattery: { Tooltip: ''' +1 max minions and 7% summon damage - Minion attacks spawn orbs of energy and inflict Electrified + Minion attacks spawn orbs of energy and inflict Static Discharge ''' } @@ -1873,7 +1873,7 @@ TheTransformer: { ''' Multiplies all electricity-based debuff damage by 1.5 Taking damage releases a blast of sparks - Immunity to Electrified and you resist all electrical projectile and enemy damage + Reduces the damage you take from all electric debuffs Enemy bullets do half damage to you and are reflected back at the enemy for 800% their original damage ''' } @@ -1955,7 +1955,7 @@ VoltaicJelly: { Tooltip: ''' +1 max minions - Minion attacks inflict Electrified + Minion attacks inflict Static Discharge ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson index 0c7a8a0250..df72ce62e3 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson @@ -160,7 +160,6 @@ TeslaPotion: { ''' Summons an aura of electricity that electrifies and slows enemies Aura damage is reduced on bosses - Reduces the duration of the Electrified debuff ''' } diff --git a/NPCs/Bumblebirb/Bumblefuck.cs b/NPCs/Bumblebirb/Bumblefuck.cs index e88ddfb475..cfd3910d02 100644 --- a/NPCs/Bumblebirb/Bumblefuck.cs +++ b/NPCs/Bumblebirb/Bumblefuck.cs @@ -1,5 +1,6 @@ using System; using System.IO; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Events; using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; @@ -456,7 +457,11 @@ namespace CalamityMod.NPCs.Bumblebirb // Lore npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedDragonfolly, ModContent.ItemType(), desc: DropHelper.FirstKillText); } - + public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) + { + if (hurtInfo.Damage > 0) + target.AddBuff(ModContent.BuffType(), 120, true); + } public override void OnKill() { CalamityGlobalNPC.SetNewBossJustDowned(NPC); diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 8503756469..ad30a39547 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -972,14 +972,14 @@ namespace CalamityMod.NPCs // Vermillion Flux if (vermillionFlux > 0) { - int baseVermillionFluxDoTValue = (int)(75 * (npc.velocity.X == 0 ? 1 : 4) * electricityDamageMult); // 300 on moving targets + int baseVermillionFluxDoTValue = (int)(100 * (npc.velocity.X == 0 ? 1 : 4) * electricityDamageMult); // 400 on moving targets ApplyDPSDebuff(baseVermillionFluxDoTValue, baseVermillionFluxDoTValue / 40, ref npc.lifeRegen, ref damage); } // Auric Rebuke if (auricRebuke > 0) { - int baseAuricRebukeDoTValue = (int)(175 * (npc.velocity.X == 0 ? 1 : 4) * electricityDamageMult); // 700 on moving targets + int baseAuricRebukeDoTValue = (int)(200 * (npc.velocity.X == 0 ? 1 : 4) * electricityDamageMult); // 800 on moving targets ApplyDPSDebuff(baseAuricRebukeDoTValue, baseAuricRebukeDoTValue / 70, ref npc.lifeRegen, ref damage); } @@ -1114,8 +1114,8 @@ namespace CalamityMod.NPCs // Electrified if (electrified > 0) { - int baseElectrifiedDoTValue = (int)(5 * (npc.velocity.X == 0 ? 1 : 4) * electricityDamageMult); - ApplyDPSDebuff(baseElectrifiedDoTValue, baseElectrifiedDoTValue / 5, ref npc.lifeRegen, ref damage); + int baseElectrifiedDoTValue = (int)(21 * (npc.velocity.X == 0 ? 1 : 4) * electricityDamageMult); // 84 on moving targets + ApplyDPSDebuff(baseElectrifiedDoTValue, baseElectrifiedDoTValue / 22, ref npc.lifeRegen, ref damage); } // Crush Depth @@ -5268,7 +5268,7 @@ namespace CalamityMod.NPCs if (tile.TileType == auricOreID) { npc.SimpleStrikeNPC((int)(npc.lifeMax * 0.2f), 0); - npc.AddBuff(BuffID.Electrified, 300); + npc.AddBuff(ModContent.BuffType(), 120); } SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/ExoMechs/TeslaShoot1"), npc.Center); break; diff --git a/NPCs/NormalNPCs/Stormlion.cs b/NPCs/NormalNPCs/Stormlion.cs index 38ddf7e5c5..0026459784 100644 --- a/NPCs/NormalNPCs/Stormlion.cs +++ b/NPCs/NormalNPCs/Stormlion.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Summon; using Terraria; @@ -109,7 +110,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(BuffID.Electrified, 30, true); + target.AddBuff(ModContent.BuffType(), 90, true); } public override void ModifyNPCLoot(NPCLoot npcLoot) diff --git a/NPCs/NormalNPCs/ThiccWaifu.cs b/NPCs/NormalNPCs/ThiccWaifu.cs index f0c7452571..7350d5cef0 100644 --- a/NPCs/NormalNPCs/ThiccWaifu.cs +++ b/NPCs/NormalNPCs/ThiccWaifu.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; @@ -464,7 +465,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(BuffID.Electrified, 180, true); + target.AddBuff(ModContent.BuffType(), 180, true); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/SunkenSea/GhostBell.cs b/NPCs/SunkenSea/GhostBell.cs index 0022e332fd..e0d4eee778 100644 --- a/NPCs/SunkenSea/GhostBell.cs +++ b/NPCs/SunkenSea/GhostBell.cs @@ -1,5 +1,6 @@ using System.IO; using CalamityMod.BiomeManagers; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Accessories; using CalamityMod.Items.Placeables.Banners; using Microsoft.Xna.Framework; @@ -174,7 +175,7 @@ namespace CalamityMod.NPCs.SunkenSea public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(BuffID.Electrified, 120, true); + target.AddBuff(ModContent.BuffType(), 120, true); } public override void HitEffect(NPC.HitInfo hit) diff --git a/Projectiles/Boss/DestroyerElectricLaser.cs b/Projectiles/Boss/DestroyerElectricLaser.cs index ecf9ffdfbd..75ff1f1ed5 100644 --- a/Projectiles/Boss/DestroyerElectricLaser.cs +++ b/Projectiles/Boss/DestroyerElectricLaser.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -59,7 +60,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(BuffID.Electrified, 60); + target.AddBuff(ModContent.BuffType(), 90); } } } diff --git a/Projectiles/Boss/RedLightning.cs b/Projectiles/Boss/RedLightning.cs index ce86806f2b..b16281511c 100644 --- a/Projectiles/Boss/RedLightning.cs +++ b/Projectiles/Boss/RedLightning.cs @@ -1,5 +1,6 @@ using System; using System.IO; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -174,7 +175,7 @@ IL_25092: if (info.Damage <= 0) return; - target.AddBuff(BuffID.Electrified, 120); + target.AddBuff(ModContent.BuffType(), 90); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Boss/RedLightningFeather.cs b/Projectiles/Boss/RedLightningFeather.cs index b1177cb551..d11b3fe2b4 100644 --- a/Projectiles/Boss/RedLightningFeather.cs +++ b/Projectiles/Boss/RedLightningFeather.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -128,7 +129,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0 || Projectile.Opacity != 1f) return; - target.AddBuff(BuffID.Electrified, 60); + target.AddBuff(ModContent.BuffType(), 40); } } } diff --git a/Projectiles/DraedonsArsenal/TaserHook.cs b/Projectiles/DraedonsArsenal/TaserHook.cs index 07c71d3c9e..616840533a 100644 --- a/Projectiles/DraedonsArsenal/TaserHook.cs +++ b/Projectiles/DraedonsArsenal/TaserHook.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Buffs.DamageOverTime; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; @@ -118,7 +119,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(BuffID.Electrified, 120); + target.AddBuff(ModContent.BuffType(), 180); if (AIState == TaserAIState.Firing) { diff --git a/Projectiles/DraedonsArsenal/VoltageStream.cs b/Projectiles/DraedonsArsenal/VoltageStream.cs index b5025c525a..486c6edd18 100644 --- a/Projectiles/DraedonsArsenal/VoltageStream.cs +++ b/Projectiles/DraedonsArsenal/VoltageStream.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -91,7 +92,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal dust.velocity *= 2.1f; dust.noGravity = true; } - Target.AddBuff(BuffID.Electrified, 180); + Target.AddBuff(ModContent.BuffType(), 180); Projectile.Kill(); } Time++; diff --git a/Projectiles/Magic/LightningArc.cs b/Projectiles/Magic/LightningArc.cs index 667902b6c8..8fd23fa151 100644 --- a/Projectiles/Magic/LightningArc.cs +++ b/Projectiles/Magic/LightningArc.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -157,7 +158,7 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(BuffID.Electrified, 120); + target.AddBuff(ModContent.BuffType(), 120); } } } diff --git a/Projectiles/Magic/RougeSlashLarge.cs b/Projectiles/Magic/RougeSlashLarge.cs index 135719035b..008c535d98 100644 --- a/Projectiles/Magic/RougeSlashLarge.cs +++ b/Projectiles/Magic/RougeSlashLarge.cs @@ -3,6 +3,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Buffs.DamageOverTime; namespace CalamityMod.Projectiles.Magic { @@ -58,7 +59,11 @@ namespace CalamityMod.Projectiles.Magic } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Projectile.velocity *= 0.25f; + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + Projectile.velocity *= 0.25f; + target.AddBuff(ModContent.BuffType(), 120); + } public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Magic/RougeSlashMedium.cs b/Projectiles/Magic/RougeSlashMedium.cs index 76c9ccf14d..69ac3a213d 100644 --- a/Projectiles/Magic/RougeSlashMedium.cs +++ b/Projectiles/Magic/RougeSlashMedium.cs @@ -3,6 +3,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Buffs.DamageOverTime; namespace CalamityMod.Projectiles.Magic { @@ -58,7 +59,11 @@ namespace CalamityMod.Projectiles.Magic } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Projectile.velocity *= 0.25f; + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + Projectile.velocity *= 0.25f; + target.AddBuff(ModContent.BuffType(), 120); + } public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Magic/RougeSlashSmall.cs b/Projectiles/Magic/RougeSlashSmall.cs index 9e595d029b..558ea6a65d 100644 --- a/Projectiles/Magic/RougeSlashSmall.cs +++ b/Projectiles/Magic/RougeSlashSmall.cs @@ -3,6 +3,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Buffs.DamageOverTime; namespace CalamityMod.Projectiles.Magic { @@ -58,7 +59,11 @@ namespace CalamityMod.Projectiles.Magic } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Projectile.velocity *= 0.25f; + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + Projectile.velocity *= 0.25f; + target.AddBuff(ModContent.BuffType(), 120); + } public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Magic/VoidVortexProj.cs b/Projectiles/Magic/VoidVortexProj.cs index d0ba7f2205..e855c2f25c 100644 --- a/Projectiles/Magic/VoidVortexProj.cs +++ b/Projectiles/Magic/VoidVortexProj.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Particles; using CalamityMod.Projectiles.Ranged; @@ -171,7 +172,7 @@ namespace CalamityMod.Projectiles.Magic } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(BuffID.Electrified, 180); + target.AddBuff(ModContent.BuffType(), 180); if (hit.Damage > 1 && Projectile.ai[2] == 3) Projectile.Kill(); } diff --git a/Projectiles/Melee/Spark.cs b/Projectiles/Melee/Spark.cs index a9d5e316f1..682e49ad7d 100644 --- a/Projectiles/Melee/Spark.cs +++ b/Projectiles/Melee/Spark.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Buffs.DamageOverTime; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -21,6 +22,10 @@ namespace CalamityMod.Projectiles.Melee Projectile.localNPCHitCooldown = 15; Projectile.DamageType = DamageClass.Melee; } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(ModContent.BuffType(), 120); + } public override void AI() { diff --git a/Projectiles/Melee/Spears/GildedProboscisProj.cs b/Projectiles/Melee/Spears/GildedProboscisProj.cs index 3650ecb000..30691c8d7c 100644 --- a/Projectiles/Melee/Spears/GildedProboscisProj.cs +++ b/Projectiles/Melee/Spears/GildedProboscisProj.cs @@ -6,6 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; +using CalamityMod.Buffs.DamageOverTime; namespace CalamityMod.Projectiles.Melee.Spears { @@ -42,6 +43,8 @@ namespace CalamityMod.Projectiles.Melee.Spears public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { + target.AddBuff(ModContent.BuffType(), 240); + int heal = (int)Math.Round(hit.Damage * 0.01); if (heal > BalancingConstants.LifeStealCap) heal = BalancingConstants.LifeStealCap; diff --git a/Projectiles/Ranged/AuricBullet.cs b/Projectiles/Ranged/AuricBullet.cs index c67e285ea7..8077c6dad4 100644 --- a/Projectiles/Ranged/AuricBullet.cs +++ b/Projectiles/Ranged/AuricBullet.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -75,7 +76,7 @@ namespace CalamityMod.Projectiles.Ranged } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(BuffID.Electrified, 300); + target.AddBuff(ModContent.BuffType(), 240); SoundEngine.PlaySound(HitSound with { PitchVariance = 0.15f }, Projectile.Center); GenericSparkle sparker = new GenericSparkle(Projectile.Center, Vector2.Zero, Color.Gold, Color.Cyan, Main.rand.NextFloat(1.8f, 2.5f), 5, Main.rand.NextFloat(-0.01f, 0.01f), 1.68f); GeneralParticleHandler.SpawnParticle(sparker); diff --git a/Projectiles/Ranged/Bolt.cs b/Projectiles/Ranged/Bolt.cs index 97bff2bfa2..b0ced754ed 100644 --- a/Projectiles/Ranged/Bolt.cs +++ b/Projectiles/Ranged/Bolt.cs @@ -1,5 +1,7 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Buffs.DamageOverTime; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; @@ -23,7 +25,10 @@ namespace CalamityMod.Projectiles.Ranged Projectile.ignoreWater = true; Projectile.DamageType = DamageClass.Ranged; Projectile.alpha = 255; - Projectile.penetrate = 1; + Projectile.penetrate = 4; + Projectile.extraUpdates = 2; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; Projectile.timeLeft = 600; } @@ -58,7 +63,10 @@ namespace CalamityMod.Projectiles.Ranged } return new Color(255, 255, 255, 100); } - + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(BuffID.Electrified, 90); + } public override bool PreDraw(ref Color lightColor) { CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); diff --git a/Projectiles/Ranged/MiniatureFolly.cs b/Projectiles/Ranged/MiniatureFolly.cs index de31a813ef..fef7dd96fd 100644 --- a/Projectiles/Ranged/MiniatureFolly.cs +++ b/Projectiles/Ranged/MiniatureFolly.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Buffs.DamageOverTime; +using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -35,6 +36,7 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { + target.AddBuff(ModContent.BuffType(), 90); SoundEngine.PlaySound(SoundID.NPCHit51, Projectile.Center); } diff --git a/Projectiles/Rogue/BlunderBoosterLightning.cs b/Projectiles/Rogue/BlunderBoosterLightning.cs index 322fa2d5f9..e8b00af4b1 100644 --- a/Projectiles/Rogue/BlunderBoosterLightning.cs +++ b/Projectiles/Rogue/BlunderBoosterLightning.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -88,12 +89,12 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(BuffID.Electrified, 180); + target.AddBuff(ModContent.BuffType(), 90); } public override void OnHitPlayer(Player target, Player.HurtInfo info) { - target.AddBuff(BuffID.Electrified, 180); + target.AddBuff(ModContent.BuffType(), 90); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Rogue/GacruxianHome.cs b/Projectiles/Rogue/GacruxianHome.cs index 20e01c8cc4..2c0a70a70d 100644 --- a/Projectiles/Rogue/GacruxianHome.cs +++ b/Projectiles/Rogue/GacruxianHome.cs @@ -1,4 +1,5 @@ -using CalamityMod.Dusts; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Terraria; @@ -42,9 +43,9 @@ namespace CalamityMod.Projectiles.Rogue CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 250f, 12f, 20f); } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Electrified, 120); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.Electrified, 120); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); public override void OnKill(int timeLeft) { diff --git a/Projectiles/Rogue/ShockTeslaAura.cs b/Projectiles/Rogue/ShockTeslaAura.cs index edb5baa131..5cc90dbf22 100644 --- a/Projectiles/Rogue/ShockTeslaAura.cs +++ b/Projectiles/Rogue/ShockTeslaAura.cs @@ -1,4 +1,5 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.NPCs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -91,7 +92,7 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(BuffID.Electrified, 180); + target.AddBuff(ModContent.BuffType(), 60); target.AddBuff(ModContent.BuffType(), 60); if (target.knockBackResist <= 0f) @@ -109,7 +110,7 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitPlayer(Player target, Player.HurtInfo info) { - target.AddBuff(BuffID.Electrified, 180); + target.AddBuff(ModContent.BuffType(), 60); target.AddBuff(ModContent.BuffType(), 60); } diff --git a/Projectiles/Rogue/StormfrontLightning.cs b/Projectiles/Rogue/StormfrontLightning.cs index 4325f21435..00b1816ea2 100644 --- a/Projectiles/Rogue/StormfrontLightning.cs +++ b/Projectiles/Rogue/StormfrontLightning.cs @@ -166,14 +166,14 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { SoundEngine.PlaySound(SoundID.Item93, Projectile.position); - target.AddBuff(BuffID.Electrified, 150); + target.AddBuff(ModContent.BuffType(), 150); Sparks(); } public override void OnHitPlayer(Player target, Player.HurtInfo info) { SoundEngine.PlaySound(SoundID.Item93, Projectile.position); - target.AddBuff(BuffID.Electrified, 150); + target.AddBuff(ModContent.BuffType(), 150); Sparks(); } diff --git a/Projectiles/Rogue/StormfrontRazorProjectile.cs b/Projectiles/Rogue/StormfrontRazorProjectile.cs index ccd38d4eef..3a9dc47f28 100644 --- a/Projectiles/Rogue/StormfrontRazorProjectile.cs +++ b/Projectiles/Rogue/StormfrontRazorProjectile.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Items.Weapons.Rogue; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -62,7 +63,7 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(BuffID.Electrified, 45); + target.AddBuff(ModContent.BuffType(), 45); if (Main.rand.NextBool(10)) { int d = Dust.NewDust(Projectile.Center, Projectile.width, Projectile.height, DustID.Electric, 0f, 0f, 100, new Color(Main.rand.Next(20, 100), 204, 250), 1f); @@ -94,7 +95,7 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitPlayer(Player target, Player.HurtInfo info) { - target.AddBuff(BuffID.Electrified, 45); + target.AddBuff(ModContent.BuffType(), 45); if (Main.rand.NextBool(10)) { int d = Dust.NewDust(Projectile.Center, Projectile.width, Projectile.height, DustID.Electric, 0f, 0f, 100, new Color(Main.rand.Next(20, 100), 204, 250), 1f); diff --git a/Projectiles/Summon/EnergyOrb.cs b/Projectiles/Summon/EnergyOrb.cs index f31dba1688..5648b09315 100644 --- a/Projectiles/Summon/EnergyOrb.cs +++ b/Projectiles/Summon/EnergyOrb.cs @@ -1,4 +1,5 @@ -using Terraria; +using CalamityMod.Buffs.DamageOverTime; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -36,6 +37,6 @@ namespace CalamityMod.Projectiles.Summon Projectile.velocity = (Projectile.velocity * 20f + Projectile.SafeDirectionTo(potentialTarget.Center) * 10f) / 21f; } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Electrified, 120); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 90); } } diff --git a/Projectiles/Typeless/BlunderBoosterAura.cs b/Projectiles/Typeless/BlunderBoosterAura.cs index bea43f6362..95e5b9008b 100644 --- a/Projectiles/Typeless/BlunderBoosterAura.cs +++ b/Projectiles/Typeless/BlunderBoosterAura.cs @@ -1,4 +1,5 @@ -using CalamityMod.NPCs; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.NPCs; using CalamityMod.NPCs.AcidRain; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -66,7 +67,7 @@ namespace CalamityMod.Projectiles.Typeless public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(BuffID.Electrified, 180); + target.AddBuff(ModContent.BuffType(), 180); if (target.knockBackResist <= 0f) return; @@ -81,7 +82,7 @@ namespace CalamityMod.Projectiles.Typeless } } - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.Electrified, 180); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 180); public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Typeless/TeslaAura.cs b/Projectiles/Typeless/TeslaAura.cs index 547f4c5a17..64b1ae6879 100644 --- a/Projectiles/Typeless/TeslaAura.cs +++ b/Projectiles/Typeless/TeslaAura.cs @@ -1,4 +1,5 @@ -using CalamityMod.Buffs.Potions; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.Potions; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.NPCs; using CalamityMod.NPCs.AcidRain; @@ -69,7 +70,7 @@ namespace CalamityMod.Projectiles.Typeless public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(BuffID.Electrified, 180); + target.AddBuff(ModContent.BuffType(), 90); target.AddBuff(ModContent.BuffType(), 6); if (target.knockBackResist <= 0f) @@ -87,7 +88,7 @@ namespace CalamityMod.Projectiles.Typeless public override void OnHitPlayer(Player target, Player.HurtInfo info) { - target.AddBuff(BuffID.Electrified, 180); + target.AddBuff(ModContent.BuffType(), 90); target.AddBuff(ModContent.BuffType(), 6); } diff --git a/Utilities/NPCDebuffs.cs b/Utilities/NPCDebuffs.cs index c66dbc74d2..70742cd268 100644 --- a/Utilities/NPCDebuffs.cs +++ b/Utilities/NPCDebuffs.cs @@ -242,9 +242,9 @@ namespace CalamityMod { ModContent.NPCType(), immuneToEverything }, { ModContent.NPCType(), immuneToEverything }, - { ModContent.NPCType(), new(GeneralImmunityStatus.None, new int[] { BuffID.Electrified }) }, - { ModContent.NPCType(), new(GeneralImmunityStatus.None, new int[] { BuffID.Electrified }) }, - { ModContent.NPCType(), new(GeneralImmunityStatus.None, new int[] { BuffID.Electrified }) }, + { ModContent.NPCType(), new(GeneralImmunityStatus.None, new int[] { BuffID.Electrified, ModContent.BuffType() }) }, + { ModContent.NPCType(), new(GeneralImmunityStatus.None, new int[] { BuffID.Electrified, ModContent.BuffType() }) }, + { ModContent.NPCType(), new(GeneralImmunityStatus.None, new int[] { BuffID.Electrified, ModContent.BuffType() }) }, { ModContent.NPCType(), new(GeneralImmunityStatus.None, new int[] { ModContent.BuffType() }) }, { ModContent.NPCType(), immuneToEverything }, @@ -402,7 +402,7 @@ namespace CalamityMod { ModContent.NPCType(), new(GeneralImmunityStatus.None, new int[] { BuffID.Poisoned, BuffID.Venom }) }, { ModContent.NPCType(), new(GeneralImmunityStatus.None, new int[] { BuffID.Poisoned, BuffID.Venom }) }, - { ModContent.NPCType(), new(GeneralImmunityStatus.None, new int[] { BuffID.Electrified }) }, + { ModContent.NPCType(), new(GeneralImmunityStatus.None, new int[] { BuffID.Electrified, ModContent.BuffType() }) }, { ModContent.NPCType(), slime }, { ModContent.NPCType(), slime },