From 3cd2991cff91e422e94df0c0befcbc9e88b7fb9b Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 6 Feb 2020 15:42:13 -0500 Subject: [PATCH] Tesla Potion unique debuff (Galvanic Corrosion) --- Buffs/Potions/TeslaBuff.cs | 9 ------- Buffs/StatDebuffs/TeslaFreeze.cs | 32 ++++++++++++++++++++++++ Buffs/StatDebuffs/TeslaFreeze.png | Bin 0 -> 580 bytes CalPlayer/CalamityPlayer.cs | 3 +++ CalPlayer/CalamityPlayerMiscEffects.cs | 2 +- NPCs/CalamityGlobalNPC.cs | 2 +- NPCs/Perforator/PerforatorBodyLarge.cs | 2 +- NPCs/Perforator/PerforatorBodyMedium.cs | 2 +- NPCs/Perforator/PerforatorBodySmall.cs | 2 +- NPCs/Perforator/PerforatorHeadLarge.cs | 2 +- NPCs/Perforator/PerforatorHeadMedium.cs | 2 +- NPCs/Perforator/PerforatorHeadSmall.cs | 2 +- NPCs/Perforator/PerforatorTailLarge.cs | 2 +- NPCs/Perforator/PerforatorTailMedium.cs | 2 +- NPCs/Perforator/PerforatorTailSmall.cs | 2 +- NPCs/SlimeGod/SlimeGod.cs | 2 +- NPCs/SlimeGod/SlimeGodRun.cs | 2 +- NPCs/SlimeGod/SlimeGodRunSplit.cs | 2 +- NPCs/SlimeGod/SlimeGodSplit.cs | 2 +- Projectiles/Typeless/TeslaAura.cs | 4 +-- 20 files changed, 52 insertions(+), 26 deletions(-) create mode 100644 Buffs/StatDebuffs/TeslaFreeze.cs create mode 100644 Buffs/StatDebuffs/TeslaFreeze.png diff --git a/Buffs/Potions/TeslaBuff.cs b/Buffs/Potions/TeslaBuff.cs index 4f8fc7fc39..3aabc48ec8 100644 --- a/Buffs/Potions/TeslaBuff.cs +++ b/Buffs/Potions/TeslaBuff.cs @@ -1,5 +1,4 @@ using CalamityMod.CalPlayer; -using CalamityMod.Projectiles.Typeless; using Terraria; using Terraria.ModLoader; @@ -17,14 +16,6 @@ namespace CalamityMod.Buffs.Potions longerExpertDebuff = false; } - public override void Update(NPC npc, ref int buffIndex) - { - if (npc.Calamity().tesla < npc.buffTime[buffIndex]) - npc.Calamity().tesla = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; - } - public override void Update(Player player, ref int buffIndex) { player.Calamity().tesla = true; diff --git a/Buffs/StatDebuffs/TeslaFreeze.cs b/Buffs/StatDebuffs/TeslaFreeze.cs new file mode 100644 index 0000000000..f270835445 --- /dev/null +++ b/Buffs/StatDebuffs/TeslaFreeze.cs @@ -0,0 +1,32 @@ +using CalamityMod.CalPlayer; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.StatDebuffs +{ + public class TeslaFreeze : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Galvanic Corrosion"); + Description.SetDefault("Your limbs have begun to corrode"); + Main.debuff[Type] = true; + Main.pvpBuff[Type] = true; + Main.buffNoSave[Type] = false; + longerExpertDebuff = false; + } + + public override void Update(NPC npc, ref int buffIndex) + { + if (npc.Calamity().tesla < npc.buffTime[buffIndex]) + npc.Calamity().tesla = npc.buffTime[buffIndex]; + npc.DelBuff(buffIndex); + buffIndex--; + } + + public override void Update(Player player, ref int buffIndex) + { + player.Calamity().teslaFreeze = true; + } + } +} diff --git a/Buffs/StatDebuffs/TeslaFreeze.png b/Buffs/StatDebuffs/TeslaFreeze.png new file mode 100644 index 0000000000000000000000000000000000000000..97136a54fe21e81e4901441dbce3c9b850b4bd5c GIT binary patch literal 580 zcmV-K0=xZ*P)Px${z*hZR9J=Om%nRMQ545NX+#8Qr>|G=DeiX+LrT z?tNh3>TpvIn#iv^RRD&rPZ{=4zk831Vn!CuSoWkqC-Hso+uHGd;0mkP4*FJBq39HJqkc~<|gnT znM2AR0)E|4q|e0Zxv(?Ic>nI_FQfh4P~Tki+9j4R1C76oBy;P!Vc^(*9q$5bx2p_g StS9FH0000()] = true; npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; + npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[BuffID.Webbed] = true; npc.buffImmune[BuffID.Slow] = true; diff --git a/NPCs/Perforator/PerforatorBodyLarge.cs b/NPCs/Perforator/PerforatorBodyLarge.cs index e4fa230413..a2890701ab 100644 --- a/NPCs/Perforator/PerforatorBodyLarge.cs +++ b/NPCs/Perforator/PerforatorBodyLarge.cs @@ -36,7 +36,7 @@ namespace CalamityMod.NPCs.Perforator npc.alpha = 255; npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; + npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[BuffID.Slow] = true; npc.buffImmune[BuffID.Webbed] = true; diff --git a/NPCs/Perforator/PerforatorBodyMedium.cs b/NPCs/Perforator/PerforatorBodyMedium.cs index 22692952ee..ecf810eab6 100644 --- a/NPCs/Perforator/PerforatorBodyMedium.cs +++ b/NPCs/Perforator/PerforatorBodyMedium.cs @@ -35,7 +35,7 @@ namespace CalamityMod.NPCs.Perforator npc.alpha = 255; npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; + npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[BuffID.Slow] = true; npc.buffImmune[BuffID.Webbed] = true; diff --git a/NPCs/Perforator/PerforatorBodySmall.cs b/NPCs/Perforator/PerforatorBodySmall.cs index 8388c04689..287ec24538 100644 --- a/NPCs/Perforator/PerforatorBodySmall.cs +++ b/NPCs/Perforator/PerforatorBodySmall.cs @@ -35,7 +35,7 @@ namespace CalamityMod.NPCs.Perforator npc.alpha = 255; npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; + npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[BuffID.Slow] = true; npc.buffImmune[BuffID.Webbed] = true; diff --git a/NPCs/Perforator/PerforatorHeadLarge.cs b/NPCs/Perforator/PerforatorHeadLarge.cs index a9c2fed07d..a43e22cbf0 100644 --- a/NPCs/Perforator/PerforatorHeadLarge.cs +++ b/NPCs/Perforator/PerforatorHeadLarge.cs @@ -43,7 +43,7 @@ namespace CalamityMod.NPCs.Perforator npc.alpha = 255; npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; + npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[BuffID.Slow] = true; npc.buffImmune[BuffID.Webbed] = true; diff --git a/NPCs/Perforator/PerforatorHeadMedium.cs b/NPCs/Perforator/PerforatorHeadMedium.cs index 698abcf2f5..1dfb836800 100644 --- a/NPCs/Perforator/PerforatorHeadMedium.cs +++ b/NPCs/Perforator/PerforatorHeadMedium.cs @@ -43,7 +43,7 @@ namespace CalamityMod.NPCs.Perforator npc.alpha = 255; npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; + npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[BuffID.Slow] = true; npc.buffImmune[BuffID.Webbed] = true; diff --git a/NPCs/Perforator/PerforatorHeadSmall.cs b/NPCs/Perforator/PerforatorHeadSmall.cs index 3919728f3c..2bfc752721 100644 --- a/NPCs/Perforator/PerforatorHeadSmall.cs +++ b/NPCs/Perforator/PerforatorHeadSmall.cs @@ -41,7 +41,7 @@ namespace CalamityMod.NPCs.Perforator npc.alpha = 255; npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; + npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[BuffID.Slow] = true; npc.buffImmune[BuffID.Webbed] = true; diff --git a/NPCs/Perforator/PerforatorTailLarge.cs b/NPCs/Perforator/PerforatorTailLarge.cs index 5ba6d3c066..d3f2a7c6e9 100644 --- a/NPCs/Perforator/PerforatorTailLarge.cs +++ b/NPCs/Perforator/PerforatorTailLarge.cs @@ -33,7 +33,7 @@ namespace CalamityMod.NPCs.Perforator npc.alpha = 255; npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; + npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[BuffID.Slow] = true; npc.buffImmune[BuffID.Webbed] = true; diff --git a/NPCs/Perforator/PerforatorTailMedium.cs b/NPCs/Perforator/PerforatorTailMedium.cs index 8ea59a6afa..453593479d 100644 --- a/NPCs/Perforator/PerforatorTailMedium.cs +++ b/NPCs/Perforator/PerforatorTailMedium.cs @@ -33,7 +33,7 @@ namespace CalamityMod.NPCs.Perforator npc.alpha = 255; npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; + npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[BuffID.Slow] = true; npc.buffImmune[BuffID.Webbed] = true; diff --git a/NPCs/Perforator/PerforatorTailSmall.cs b/NPCs/Perforator/PerforatorTailSmall.cs index c1e70e23e9..060195eef4 100644 --- a/NPCs/Perforator/PerforatorTailSmall.cs +++ b/NPCs/Perforator/PerforatorTailSmall.cs @@ -34,7 +34,7 @@ namespace CalamityMod.NPCs.Perforator npc.alpha = 255; npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; + npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[BuffID.Slow] = true; npc.buffImmune[BuffID.Webbed] = true; diff --git a/NPCs/SlimeGod/SlimeGod.cs b/NPCs/SlimeGod/SlimeGod.cs index 51f96924b2..8243862f25 100644 --- a/NPCs/SlimeGod/SlimeGod.cs +++ b/NPCs/SlimeGod/SlimeGod.cs @@ -37,7 +37,7 @@ namespace CalamityMod.NPCs.SlimeGod aiType = -1; npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; + npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[BuffID.Slow] = true; npc.buffImmune[BuffID.Webbed] = true; diff --git a/NPCs/SlimeGod/SlimeGodRun.cs b/NPCs/SlimeGod/SlimeGodRun.cs index 3a9be0dd81..4259316407 100644 --- a/NPCs/SlimeGod/SlimeGodRun.cs +++ b/NPCs/SlimeGod/SlimeGodRun.cs @@ -37,7 +37,7 @@ namespace CalamityMod.NPCs.SlimeGod animationType = 50; npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; + npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[BuffID.Slow] = true; npc.buffImmune[BuffID.Webbed] = true; diff --git a/NPCs/SlimeGod/SlimeGodRunSplit.cs b/NPCs/SlimeGod/SlimeGodRunSplit.cs index 00d7c2dd3c..138317c8f2 100644 --- a/NPCs/SlimeGod/SlimeGodRunSplit.cs +++ b/NPCs/SlimeGod/SlimeGodRunSplit.cs @@ -36,7 +36,7 @@ namespace CalamityMod.NPCs.SlimeGod npc.knockBackResist = 0f; npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; + npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[BuffID.Slow] = true; npc.buffImmune[BuffID.Webbed] = true; diff --git a/NPCs/SlimeGod/SlimeGodSplit.cs b/NPCs/SlimeGod/SlimeGodSplit.cs index 22a8a52f0f..5d00865195 100644 --- a/NPCs/SlimeGod/SlimeGodSplit.cs +++ b/NPCs/SlimeGod/SlimeGodSplit.cs @@ -38,7 +38,7 @@ namespace CalamityMod.NPCs.SlimeGod npc.knockBackResist = 0f; npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; + npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[BuffID.Slow] = true; npc.buffImmune[BuffID.Webbed] = true; diff --git a/Projectiles/Typeless/TeslaAura.cs b/Projectiles/Typeless/TeslaAura.cs index 2af729e8a6..9dc35e4990 100644 --- a/Projectiles/Typeless/TeslaAura.cs +++ b/Projectiles/Typeless/TeslaAura.cs @@ -1,6 +1,6 @@ using CalamityMod.CalPlayer; using CalamityMod.NPCs; -using CalamityMod.Buffs.Potions; +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.Typeless } target.AddBuff(BuffID.Electrified, 300); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); } public override void OnHitPvp(Player target, int damage, bool crit)