From 5d389f664bf69be25dd296cd11e5bf2bba128431 Mon Sep 17 00:00:00 2001 From: Amber Sienna Date: Fri, 17 Jan 2020 15:13:27 +0000 Subject: [PATCH] Profaned Soul is now one buff (as originally intended) --- Buffs/CalamityGlobalBuff.cs | 15 ++++++++ Buffs/Summon/GuardianDefense.cs | 36 ------------------ Buffs/Summon/GuardianHealer.png | Bin 684 -> 0 bytes Buffs/Summon/GuardianOffense.cs | 36 ------------------ Buffs/Summon/GuardianOffense.png | Bin 684 -> 0 bytes .../{GuardianHealer.cs => ProfanedBabs.cs} | 21 ++++++---- .../{GuardianDefense.png => ProfanedBabs.png} | Bin CalPlayer/CalamityPlayerMiscEffects.cs | 10 ++--- 8 files changed, 33 insertions(+), 85 deletions(-) delete mode 100644 Buffs/Summon/GuardianDefense.cs delete mode 100644 Buffs/Summon/GuardianHealer.png delete mode 100644 Buffs/Summon/GuardianOffense.cs delete mode 100644 Buffs/Summon/GuardianOffense.png rename Buffs/Summon/{GuardianHealer.cs => ProfanedBabs.cs} (54%) rename Buffs/Summon/{GuardianDefense.png => ProfanedBabs.png} (100%) diff --git a/Buffs/CalamityGlobalBuff.cs b/Buffs/CalamityGlobalBuff.cs index f9bd94077a..f643396864 100644 --- a/Buffs/CalamityGlobalBuff.cs +++ b/Buffs/CalamityGlobalBuff.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.Summon; using CalamityMod.World; using Terraria; using Terraria.ID; @@ -97,6 +98,20 @@ namespace CalamityMod.Buffs tip += ". All damage taken increased by 20%"; else if (type == BuffID.Warmth) tip += ". Immunity to the Chilled, Frozen, and Glacial State debuffs"; + else if (type == ModContent.BuffType()) + { + Player player = Main.player[Main.myPlayer]; + bool offense = player.Calamity().gOffense; + bool defense = player.Calamity().gDefense; + if (offense && defense) + { + tip = "The Profaned Babs will defend and fight for you!"; + } + else if (offense || defense) + { + tip = "The " + (offense ? "Offensive" : "Defensive") + " Duo will " + (offense ? "fight and heal for you!" : "defend and heal you!"); + } + } } } } diff --git a/Buffs/Summon/GuardianDefense.cs b/Buffs/Summon/GuardianDefense.cs deleted file mode 100644 index decca291c0..0000000000 --- a/Buffs/Summon/GuardianDefense.cs +++ /dev/null @@ -1,36 +0,0 @@ -using CalamityMod.CalPlayer; -using CalamityMod.Projectiles.Summon; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Buffs.Summon -{ - public class GuardianDefense : ModBuff - { - public override void SetDefaults() - { - DisplayName.SetDefault("Defensive Guardian"); - Description.SetDefault("The defender will protect you"); - Main.buffNoTimeDisplay[Type] = true; - Main.buffNoSave[Type] = true; - } - - public override void Update(Player player, ref int buffIndex) - { - CalamityPlayer modPlayer = player.Calamity(); - if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) - { - modPlayer.gDefense = true; - } - if (!modPlayer.gDefense) - { - player.DelBuff(buffIndex); - buffIndex--; - } - else - { - player.buffTime[buffIndex] = 18000; - } - } - } -} diff --git a/Buffs/Summon/GuardianHealer.png b/Buffs/Summon/GuardianHealer.png deleted file mode 100644 index 123f7fdefeeaff70d77949ce1b29ed9cd35d9581..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 684 zcmV;d0#p5oP)9YSsYfGs}z_8-_CXWv4cldO zfx+Q`S+^h|00Z@U9AKtAHz$ht!>`}L{4Gy^posfO<5%B!2~~ZX8d?YpxC5BFZ-IRz zUaJG96Rk|a^sOh)P<;C2?K?1kS|UUp3}nr}0%pnx3!#Xs$w-0u^N*bd(=VGL>i(6g zfoXUe7;pzjaXNpYFQ|@xk#o?GT?H*bJsDLym#z+z<~ief9PeFbz`=3l>-! zdj8`VY6uLt147gk!7hTuG0erV5YSeY0Sm3)e+o>mo~Z#*;@}IWLe;y$bfBXd-VlJL zku|sOqlUnMJD|$R8s=#*4NLv75J8XI*1gdv>Z_fXg88tJn!IKQm=E(YEH}V3we35K z8Uh3E09X{jT#6p&u(*Z!K$91e$_>5w!1S^e5E=$xX$3t^z(N*h8W=DKz_OvWoHW=I z=njGT3>LSzNee@J8g|i$OFbBZW04&a6K1DAFVB)6Ug(z`;dTT$J zk4rr)WMF9nXBrqV2UrO6fp8EfI9$|24Fry&%d8#T)|QvT81b-Hz@Z3^Q8_i0n@OM;C-?i%ttRzV488JfdO*> zuId;)?qLqBSXhe^5*IqRfcZPFoyVFMV2Vj@4-A+CaMfbC(gMuqu((GF9;B8L(IG&0 z2f%tpu=YL72e5tt%t5gHjjJR?ZxzGJewcZ%{shjR(Lgu==C}dtoDQf10PRfxBd7>j SR{#J207*qoM6N<$f&c*gu_J~6 diff --git a/Buffs/Summon/GuardianOffense.cs b/Buffs/Summon/GuardianOffense.cs deleted file mode 100644 index 0ed6a01ac6..0000000000 --- a/Buffs/Summon/GuardianOffense.cs +++ /dev/null @@ -1,36 +0,0 @@ -using CalamityMod.CalPlayer; -using CalamityMod.Projectiles.Summon; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Buffs.Summon -{ - public class GuardianOffense : ModBuff - { - public override void SetDefaults() - { - DisplayName.SetDefault("Offensive Guardian"); - Description.SetDefault("The attacker will fight for you"); - Main.buffNoTimeDisplay[Type] = true; - Main.buffNoSave[Type] = true; - } - - public override void Update(Player player, ref int buffIndex) - { - CalamityPlayer modPlayer = player.Calamity(); - if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) - { - modPlayer.gOffense = true; - } - if (!modPlayer.gOffense) - { - player.DelBuff(buffIndex); - buffIndex--; - } - else - { - player.buffTime[buffIndex] = 18000; - } - } - } -} diff --git a/Buffs/Summon/GuardianOffense.png b/Buffs/Summon/GuardianOffense.png deleted file mode 100644 index 123f7fdefeeaff70d77949ce1b29ed9cd35d9581..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 684 zcmV;d0#p5oP)9YSsYfGs}z_8-_CXWv4cldO zfx+Q`S+^h|00Z@U9AKtAHz$ht!>`}L{4Gy^posfO<5%B!2~~ZX8d?YpxC5BFZ-IRz zUaJG96Rk|a^sOh)P<;C2?K?1kS|UUp3}nr}0%pnx3!#Xs$w-0u^N*bd(=VGL>i(6g zfoXUe7;pzjaXNpYFQ|@xk#o?GT?H*bJsDLym#z+z<~ief9PeFbz`=3l>-! zdj8`VY6uLt147gk!7hTuG0erV5YSeY0Sm3)e+o>mo~Z#*;@}IWLe;y$bfBXd-VlJL zku|sOqlUnMJD|$R8s=#*4NLv75J8XI*1gdv>Z_fXg88tJn!IKQm=E(YEH}V3we35K z8Uh3E09X{jT#6p&u(*Z!K$91e$_>5w!1S^e5E=$xX$3t^z(N*h8W=DKz_OvWoHW=I z=njGT3>LSzNee@J8g|i$OFbBZW04&a6K1DAFVB)6Ug(z`;dTT$J zk4rr)WMF9nXBrqV2UrO6fp8EfI9$|24Fry&%d8#T)|QvT81b-Hz@Z3^Q8_i0n@OM;C-?i%ttRzV488JfdO*> zuId;)?qLqBSXhe^5*IqRfcZPFoyVFMV2Vj@4-A+CaMfbC(gMuqu((GF9;B8L(IG&0 z2f%tpu=YL72e5tt%t5gHjjJR?ZxzGJewcZ%{shjR(Lgu==C}dtoDQf10PRfxBd7>j SR{#J207*qoM6N<$f&c*gu_J~6 diff --git a/Buffs/Summon/GuardianHealer.cs b/Buffs/Summon/ProfanedBabs.cs similarity index 54% rename from Buffs/Summon/GuardianHealer.cs rename to Buffs/Summon/ProfanedBabs.cs index 5428e4dd98..f8e0003d44 100644 --- a/Buffs/Summon/GuardianHealer.cs +++ b/Buffs/Summon/ProfanedBabs.cs @@ -5,12 +5,12 @@ using Terraria.ModLoader; namespace CalamityMod.Buffs.Summon { - public class GuardianHealer : ModBuff + public class ProfanedBabs : ModBuff //Buff name is reference to how I refer to the guardians as my babs ~Amber { public override void SetDefaults() { - DisplayName.SetDefault("Healer Guardian"); - Description.SetDefault("The guardian will heal you"); + DisplayName.SetDefault("The Profaned Soul"); + Description.SetDefault("The healer will heal your wounds"); Main.buffNoTimeDisplay[Type] = true; Main.buffNoSave[Type] = true; } @@ -18,10 +18,6 @@ namespace CalamityMod.Buffs.Summon public override void Update(Player player, ref int buffIndex) { CalamityPlayer modPlayer = player.Calamity(); - if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) - { - modPlayer.gHealer = true; - } if (!modPlayer.gHealer) { player.DelBuff(buffIndex); @@ -31,6 +27,17 @@ namespace CalamityMod.Buffs.Summon { player.buffTime[buffIndex] = 18000; } + + bool defense = modPlayer.gDefense; + bool offense = modPlayer.gOffense; + if (offense || defense) + { + DisplayName.SetDefault("Profaned " + (offense ? "Offensive " : "Defensive ") + "Duo"); + } + else if (offense && defense) + { + DisplayName.SetDefault("Profaned Guardian Trio"); + } } } } diff --git a/Buffs/Summon/GuardianDefense.png b/Buffs/Summon/ProfanedBabs.png similarity index 100% rename from Buffs/Summon/GuardianDefense.png rename to Buffs/Summon/ProfanedBabs.png diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index e900a94d37..5e7e34fb08 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -2644,8 +2644,8 @@ namespace CalamityMod.CalPlayer { if (player.whoAmI == Main.myPlayer) { - if (player.FindBuffIndex(ModContent.BuffType()) == -1) - player.AddBuff(ModContent.BuffType(), 3600, true); + if (player.FindBuffIndex(ModContent.BuffType()) == -1) + player.AddBuff(ModContent.BuffType(), 3600, true); if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -6f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, 0f); @@ -2656,8 +2656,7 @@ namespace CalamityMod.CalPlayer if (player.maxMinions >= 10) { - if (player.FindBuffIndex(ModContent.BuffType()) == -1) - player.AddBuff(ModContent.BuffType(), 3600, true); + player.Calamity().gDefense = true; if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -3f, ModContent.ProjectileType(), (int)(baseDamage * (player.allDamage + player.minionDamage - 1f)), 1f, Main.myPlayer, 0f, 0f); @@ -2665,8 +2664,7 @@ namespace CalamityMod.CalPlayer if (modPlayer.tarraSummon || modPlayer.bloodflareSummon || modPlayer.godSlayerSummon || modPlayer.silvaSummon || modPlayer.dsSetBonus || modPlayer.omegaBlueSet || modPlayer.fearmongerSet) { - if (player.FindBuffIndex(ModContent.BuffType()) == -1) - player.AddBuff(ModContent.BuffType(), 3600, true); + player.Calamity().gOffense = true; if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(baseDamage * (player.allDamage + player.minionDamage - 1f)), 1f, Main.myPlayer, 0f, 0f);