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 123f7fdefe..0000000000 Binary files a/Buffs/Summon/GuardianHealer.png and /dev/null differ 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 123f7fdefe..0000000000 Binary files a/Buffs/Summon/GuardianOffense.png and /dev/null differ 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);