diff --git a/Buffs/Pets/PlaguebringerBabBuff.cs b/Buffs/Pets/PlaguebringerBabBuff.cs new file mode 100644 index 0000000000..0aca49804d --- /dev/null +++ b/Buffs/Pets/PlaguebringerBabBuff.cs @@ -0,0 +1,29 @@ +using CalamityMod.Projectiles.Pets; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.Pets +{ + public class PlaguebringerBabBuff : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Plaguebringer Bab"); + Description.SetDefault("The baby plaguebringer sees you as the queen"); + Main.buffNoTimeDisplay[Type] = true; + Main.vanityPet[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) + { + player.buffTime[buffIndex] = 18000; + player.Calamity().plaguebringerBab = true; + bool petProjectileNotSpawned = player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0; + if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer) + { + int bee = Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, ModContent.ProjectileType(), 0, 0f, player.whoAmI, 0f, 0f); + Main.projectile[bee].frame = 2; + } + } + } +} diff --git a/Buffs/Pets/PlaguebringerBabBuff.png b/Buffs/Pets/PlaguebringerBabBuff.png new file mode 100644 index 0000000000..e0e864ceef Binary files /dev/null and b/Buffs/Pets/PlaguebringerBabBuff.png differ diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 5d7ec9e9e5..412896b08d 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -240,6 +240,7 @@ namespace CalamityMod.CalPlayer public bool perfmini = false; public bool akato = false; public bool leviPet = false; + public bool plaguebringerBab = false; public bool rotomPet = false; public bool sparks = false; public bool sirenPet = false; @@ -1248,6 +1249,7 @@ namespace CalamityMod.CalPlayer perfmini = false; akato = false; leviPet = false; + plaguebringerBab = false; rotomPet = false; sparks = false; sirenPet = false; diff --git a/CalamityMod.cs b/CalamityMod.cs index fcd0409641..3767ea38be 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -1234,7 +1234,8 @@ namespace CalamityMod ItemID.ChristmasTreeSword, ItemID.MonkStaffT1, ItemID.InfernoFork, - ItemID.VenomStaff + ItemID.VenomStaff, + ItemID.Frostbrand }; fiftyDamageBuffList = new List() diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index f49370be1c..894bd95359 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -104,7 +104,7 @@ namespace CalamityMod.Items item.damage = (int)(item.damage * 1.25); else if (CalamityMod.twentyDamageBuffList?.Contains(item.type) ?? false) item.damage = (int)(item.damage * 1.2); - else if (item.type == ItemID.Frostbrand || item.type == ItemID.MagnetSphere) + else if (item.type == ItemID.MagnetSphere) item.damage = (int)(item.damage * 1.1); else if (item.type == ItemID.Razorpine) item.damage = (int)(item.damage * 0.95); diff --git a/Items/Materials/CloakingGland.png b/Items/Materials/CloakingGland.png index a495200ecf..f1fdb89f2b 100644 Binary files a/Items/Materials/CloakingGland.png and b/Items/Materials/CloakingGland.png differ diff --git a/Items/Pets/PlagueCaller.cs b/Items/Pets/PlagueCaller.cs new file mode 100644 index 0000000000..0c7955ac0c --- /dev/null +++ b/Items/Pets/PlagueCaller.cs @@ -0,0 +1,33 @@ +using CalamityMod.Buffs.Pets; +using CalamityMod.Projectiles.Pets; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Pets +{ + public class PlagueCaller : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Plague Caller"); + Tooltip.SetDefault("Summons a baby Plaguebringer pet"); + } + + public override void SetDefaults() + { + item.CloneDefaults(ItemID.ZephyrFish); + item.shoot = ModContent.ProjectileType(); + item.buffType = ModContent.BuffType(); + item.rare = 7; + } + + public override void UseStyle(Player player) + { + if (player.whoAmI == Main.myPlayer && player.itemTime == 0) + { + player.AddBuff(item.buffType, 3600, true); + } + } + } +} diff --git a/Items/Pets/PlagueCaller.png b/Items/Pets/PlagueCaller.png new file mode 100644 index 0000000000..ea774e07d9 Binary files /dev/null and b/Items/Pets/PlagueCaller.png differ diff --git a/Items/Potions/AnechoicCoating.png b/Items/Potions/AnechoicCoating.png index e243b145ff..5b139333de 100644 Binary files a/Items/Potions/AnechoicCoating.png and b/Items/Potions/AnechoicCoating.png differ diff --git a/Items/Potions/SunkenStew.png b/Items/Potions/SunkenStew.png index df5da8ec18..0c2828d09a 100644 Binary files a/Items/Potions/SunkenStew.png and b/Items/Potions/SunkenStew.png differ diff --git a/Items/SummonItems/Abomination.cs b/Items/SummonItems/Abomination.cs index bdc3b05178..a5b323bdcc 100644 --- a/Items/SummonItems/Abomination.cs +++ b/Items/SummonItems/Abomination.cs @@ -12,7 +12,8 @@ namespace CalamityMod.Items.SummonItems { DisplayName.SetDefault("Abombination"); Tooltip.SetDefault("Calls in the airborne jungle abomination\n" + - "Summons the Plaguebringer Goliath"); + "Summons the Plaguebringer Goliath\n" + + "The boss enrages in the open air of the surface"); } public override void SetDefaults() diff --git a/Items/SummonItems/CharredIdol.cs b/Items/SummonItems/CharredIdol.cs index 3f46bbe4be..ca285a18c9 100644 --- a/Items/SummonItems/CharredIdol.cs +++ b/Items/SummonItems/CharredIdol.cs @@ -13,7 +13,8 @@ namespace CalamityMod.Items.SummonItems { DisplayName.SetDefault("Charred Idol"); Tooltip.SetDefault("Use in the Brimstone Crag at your own risk\n" + - "Summons the Brimstone Elemental"); + "Summons the Brimstone Elemental\n" + + "The boss enrages outside of her home in the crags"); } public override void SetDefaults() diff --git a/Items/SummonItems/CryoKey.cs b/Items/SummonItems/CryoKey.cs index 98633f4b7b..aef427480c 100644 --- a/Items/SummonItems/CryoKey.cs +++ b/Items/SummonItems/CryoKey.cs @@ -11,7 +11,8 @@ namespace CalamityMod.Items.SummonItems public override void SetStaticDefaults() { DisplayName.SetDefault("Cryo Key"); - Tooltip.SetDefault("Summons Cryogen"); + Tooltip.SetDefault("Summons Cryogen\n" + + "The boss enrages outside of the snowy tundra"); } public override void SetDefaults() diff --git a/Items/TreasureBags/PlaguebringerGoliathBag.cs b/Items/TreasureBags/PlaguebringerGoliathBag.cs index 5c4791d587..7fc7c68c57 100644 --- a/Items/TreasureBags/PlaguebringerGoliathBag.cs +++ b/Items/TreasureBags/PlaguebringerGoliathBag.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.Materials; +using CalamityMod.Items.Pets; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; @@ -66,6 +67,7 @@ namespace CalamityMod.Items.TreasureBags // Vanity DropHelper.DropItemChance(player, ModContent.ItemType(), 7); + DropHelper.DropItemChance(player, ModContent.ItemType(), 10); } } } diff --git a/Items/Weapons/Magic/Effervescence.png b/Items/Weapons/Magic/Effervescence.png index 70af7dc56a..3534b6e9f8 100644 Binary files a/Items/Weapons/Magic/Effervescence.png and b/Items/Weapons/Magic/Effervescence.png differ diff --git a/Items/Weapons/Magic/MagnaCannon.png b/Items/Weapons/Magic/MagnaCannon.png index 16ff1da64a..8a600aea83 100644 Binary files a/Items/Weapons/Magic/MagnaCannon.png and b/Items/Weapons/Magic/MagnaCannon.png differ diff --git a/Items/Weapons/Magic/WintersFury.cs b/Items/Weapons/Magic/WintersFury.cs index 9a6bc0d765..f3fa5abbe4 100644 --- a/Items/Weapons/Magic/WintersFury.cs +++ b/Items/Weapons/Magic/WintersFury.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Magic } public override void SetDefaults() { - item.damage = 50; + item.damage = 75; item.magic = true; item.mana = 7; item.width = 28; @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Magic item.scale = 0.9f; item.autoReuse = true; item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 12f; + item.shootSpeed = 15f; } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Melee/AbsoluteZero.cs b/Items/Weapons/Melee/AbsoluteZero.cs index 00dbfe67db..a30e6f597f 100644 --- a/Items/Weapons/Melee/AbsoluteZero.cs +++ b/Items/Weapons/Melee/AbsoluteZero.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Melee } public override void SetDefaults() { - item.damage = 90; + item.damage = 120; item.melee = true; item.width = 58; item.height = 58; diff --git a/Items/Weapons/Melee/StormSaber.cs b/Items/Weapons/Melee/StormSaber.cs index ebe427f352..d0611d7bcc 100644 --- a/Items/Weapons/Melee/StormSaber.cs +++ b/Items/Weapons/Melee/StormSaber.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 58; - item.damage = 50; + item.damage = 75; item.melee = true; item.useAnimation = 23; item.useTime = 23; diff --git a/Items/Weapons/Melee/TemporalFloeSword.cs b/Items/Weapons/Melee/TemporalFloeSword.cs index adc4b54eb6..e9af5c160b 100644 --- a/Items/Weapons/Melee/TemporalFloeSword.cs +++ b/Items/Weapons/Melee/TemporalFloeSword.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.width = 50; + item.width = 52; item.damage = 85; item.melee = true; item.useAnimation = 16; @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Melee item.knockBack = 6; item.UseSound = SoundID.Item1; item.autoReuse = true; - item.height = 58; + item.height = 60; item.value = Item.buyPrice(0, 80, 0, 0); item.rare = 8; item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Melee/TemporalFloeSword.png b/Items/Weapons/Melee/TemporalFloeSword.png index b9f372dd53..390feedc12 100644 Binary files a/Items/Weapons/Melee/TemporalFloeSword.png and b/Items/Weapons/Melee/TemporalFloeSword.png differ diff --git a/Items/Weapons/Melee/TrueCausticEdge.cs b/Items/Weapons/Melee/TrueCausticEdge.cs index 7be9f192e0..17d20b4a2f 100644 --- a/Items/Weapons/Melee/TrueCausticEdge.cs +++ b/Items/Weapons/Melee/TrueCausticEdge.cs @@ -12,13 +12,14 @@ namespace CalamityMod.Items.Weapons.Melee { DisplayName.SetDefault("True Caustic Edge"); Tooltip.SetDefault("Fires a bouncing caustic beam\n" + + "Bounces increase the beam's damage\n" + "Inflicts on fire, poison, and venom"); } public override void SetDefaults() { item.width = 64; - item.damage = 75; + item.damage = 100; item.melee = true; item.useAnimation = 28; item.useStyle = 1; @@ -36,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Melee public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, (int)(damage * 0.8), knockBack, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, (int)(damage * 0.75), knockBack, player.whoAmI, 0f, 0f); return false; } diff --git a/Items/Weapons/Ranged/EternalBlizzard.cs b/Items/Weapons/Ranged/EternalBlizzard.cs index 170bc2f08d..478b90f080 100644 --- a/Items/Weapons/Ranged/EternalBlizzard.cs +++ b/Items/Weapons/Ranged/EternalBlizzard.cs @@ -15,12 +15,12 @@ namespace CalamityMod.Items.Weapons.Ranged } public override void SetDefaults() { - item.damage = 60; + item.damage = 80; item.ranged = true; item.width = 42; item.height = 62; - item.useTime = 20; - item.useAnimation = 20; + item.useTime = 18; + item.useAnimation = 18; item.useStyle = 5; item.useTurn = false; item.noMelee = true; @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Ranged { float SpeedX = speedX + (float)Main.rand.Next(-10, 11) * 0.05f; float SpeedY = speedY + (float)Main.rand.Next(-10, 11) * 0.05f; - int index = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType(), (int)(damage * 0.5f), knockBack, player.whoAmI, 0f, 0f); + int index = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType(), (int)(damage * 0.75f), knockBack, player.whoAmI, 0f, 0f); Main.projectile[index].noDropItem = true; return true; diff --git a/Items/Weapons/Ranged/FlarewingBow.cs b/Items/Weapons/Ranged/FlarewingBow.cs index d5e8fbf5a4..be2afe56c7 100644 --- a/Items/Weapons/Ranged/FlarewingBow.cs +++ b/Items/Weapons/Ranged/FlarewingBow.cs @@ -18,12 +18,12 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 20; + item.damage = 15; item.ranged = true; item.width = 20; item.height = 62; - item.useTime = 29; - item.useAnimation = 29; + item.useTime = 30; + item.useAnimation = 30; item.useStyle = 5; item.noMelee = true; item.knockBack = 1.5f; @@ -55,7 +55,7 @@ namespace CalamityMod.Items.Weapons.Ranged } if (type == ProjectileID.WoodenArrowFriendly) { - int num123 = Projectile.NewProjectile(vector2.X + value9.X, vector2.Y + value9.Y, speedX, speedY, ModContent.ProjectileType(), (int)(damage * 1.25), knockBack, player.whoAmI, 0f, 0f); + int num123 = Projectile.NewProjectile(vector2.X + value9.X, vector2.Y + value9.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); Main.projectile[num123].noDropItem = true; } else diff --git a/Items/Weapons/Summon/ResurrectionButterfly.cs b/Items/Weapons/Summon/ResurrectionButterfly.cs index f80680587e..01342a29ad 100644 --- a/Items/Weapons/Summon/ResurrectionButterfly.cs +++ b/Items/Weapons/Summon/ResurrectionButterfly.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { - item.damage = 76; + item.damage = 65; item.mana = 10; item.width = 46; item.height = 46; diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 824d932ddc..1e6b0ade2e 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -369,7 +369,7 @@ namespace CalamityMod int type = NPCType(); int summon = ItemType(); List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.GreaterHealingPotion }; - List collection = new List() { ItemType(), ItemType(), ItemType() }; + List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Use an [i:{summon}] in the Jungle Biome"; string despawn = CalamityUtils.ColorMessage("HOSTILE SPECIMENS TERMINATED. INITIATE RECALL TO HOME BASE.", new Color(0x00, 0xFF, 0x00)); string bossLogTex = "CalamityMod/NPCs/PlaguebringerGoliath/PlaguebringerGoliath_BossChecklist"; diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index dc166ee2d5..79795cb5a9 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -3374,6 +3374,52 @@ namespace CalamityMod.NPCs if (npc.townNPC && projectile.hostile) damage *= 2; + if (!projectile.npcProj && !projectile.trap) + { + if (ShouldAffectNPC(npc) && Main.rand.NextBool(15) && !CalamityPlayer.areThereAnyDamnBosses) + { + if (modPlayer.eGauntlet && projectile.melee) + { + damage = npc.lifeMax * 3; + } + + if (modPlayer.eTalisman && projectile.magic) + { + damage = npc.lifeMax * 3; + } + + if (modPlayer.nanotech && projectile.Calamity().rogue) + { + damage = npc.lifeMax * 3; + } + + if (modPlayer.eQuiver && projectile.ranged) + { + damage = npc.lifeMax * 3; + } + + if (modPlayer.nucleogenesis) + { + if ((projectile.minion || projectile.sentry || ProjectileID.Sets.MinionShot[projectile.type] || ProjectileID.Sets.SentryShot[projectile.type] || CalamityMod.projectileMinionList.Contains(projectile.type)) && ShouldAffectNPC(npc) && Main.rand.NextBool(15)) + { + damage = npc.lifeMax * 3; + } + } + } + + if (projectile.ranged && modPlayer.plagueReaper && pFlames > 0) + { + damage = (int)(damage * 1.1); + } + } + + NPCResists(npc, projectile, damage); + } + + #region NPC Resists + private void NPCResists(NPC npc, Projectile projectile, int damage) + { + Player player = Main.player[projectile.owner]; if (AstrumDeusIDs.Contains(npc.type)) { if (projectile.type == ModContent.ProjectileType() || ProjectileID.Sets.StardustDragon[projectile.type]) @@ -3407,22 +3453,22 @@ namespace CalamityMod.NPCs { if (projectile.type == ModContent.ProjectileType()) { - damage = (int)((double)damage * 0.9); + damage = (int)(damage * 0.9); } else if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) { if (projectile.penetrate == -1) projectile.penetrate = projectile.Calamity().stealthStrike ? 6 : 9; - damage = (int)((double)damage * 0.75); + damage = (int)(damage * 0.75); } else if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) { - damage = (int)((double)damage * 0.5); + damage = (int)(damage * 0.5); } if (projectile.penetrate == -1 && !projectile.minion) { - damage = (int)((double)damage * 0.2); + damage = (int)(damage * 0.2); } else if (projectile.penetrate > 1) { @@ -3441,7 +3487,7 @@ namespace CalamityMod.NPCs } else if (projectile.type == ModContent.ProjectileType()) { - damage /= 3; + damage = (int)(damage * 0.5); } else if (projectile.type == ModContent.ProjectileType()) { @@ -3449,12 +3495,14 @@ namespace CalamityMod.NPCs } else if (projectile.type == ModContent.ProjectileType()) { + if (projectile.penetrate == -1) + projectile.penetrate = 1; damage = (int)(damage * 0.1); } else if (projectile.type == ModContent.ProjectileType()) { if (projectile.penetrate == -1) - projectile.penetrate = 3; + projectile.penetrate = 2; damage = (int)(damage * 0.1); } } @@ -3470,13 +3518,15 @@ namespace CalamityMod.NPCs } else if (projectile.type == ModContent.ProjectileType()) { - damage = (int)(damage * 0.1); + if (projectile.penetrate == -1) + projectile.penetrate = 1; + damage = (int)(damage * 0.05); } else if (projectile.type == ModContent.ProjectileType()) { if (projectile.penetrate == -1) - projectile.penetrate = 3; - damage = (int)(damage * 0.1); + projectile.penetrate = 2; + damage = (int)(damage * 0.05); } } else if (EaterofWorldsIDs.Contains(npc.type) || npc.type == NPCID.Creeper) @@ -3520,70 +3570,29 @@ namespace CalamityMod.NPCs damage = (int)(damage * 0.8); } } - - if (!projectile.npcProj && !projectile.trap) + else if (npc.type == NPCID.CultistBoss) { - if (modPlayer.eGauntlet) - { - if (projectile.melee && ShouldAffectNPC(npc) && Main.rand.NextBool(15)) - { - if (!CalamityPlayer.areThereAnyDamnBosses) - { - damage = npc.lifeMax * 3; - } - } - } - - if (modPlayer.eTalisman) - { - if (projectile.magic && ShouldAffectNPC(npc) && Main.rand.NextBool(15)) - { - if (!CalamityPlayer.areThereAnyDamnBosses) - { - damage = npc.lifeMax * 3; - } - } - } - - if (modPlayer.nanotech) - { - if (projectile.Calamity().rogue && ShouldAffectNPC(npc) && Main.rand.NextBool(15)) - { - if (!CalamityPlayer.areThereAnyDamnBosses) - { - damage = npc.lifeMax * 3; - } - } - } - - if (modPlayer.eQuiver) - { - if (projectile.ranged && ShouldAffectNPC(npc) && Main.rand.NextBool(15)) - { - if (!CalamityPlayer.areThereAnyDamnBosses) - { - damage = npc.lifeMax * 3; - } - } - } - - if (modPlayer.nucleogenesis) - { - if ((projectile.minion || projectile.sentry || ProjectileID.Sets.MinionShot[projectile.type] || ProjectileID.Sets.SentryShot[projectile.type] || CalamityMod.projectileMinionList.Contains(projectile.type)) && ShouldAffectNPC(npc) && Main.rand.NextBool(15)) - { - if (!CalamityPlayer.areThereAnyDamnBosses) - { - damage = npc.lifeMax * 3; - } - } - } - - if (projectile.ranged && modPlayer.plagueReaper && pFlames > 0) - { - damage = (int)(damage * 1.1); + if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) + { + damage = (int)(damage * 0.75); } } - } + else if (npc.type == NPCID.DukeFishron) + { + if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) + { + damage = (int)(damage * 1.2); + } + } + else if (npc.type == ModContent.NPCType()) + { + if (projectile.type == ModContent.ProjectileType()) + { + damage = (int)(damage * 1.5); + } + } + } + #endregion #endregion #region On Hit By Item diff --git a/NPCs/HiveMind/HiveMindP2.cs b/NPCs/HiveMind/HiveMindP2.cs index 264e8b273d..ebe7dfa5b5 100644 --- a/NPCs/HiveMind/HiveMindP2.cs +++ b/NPCs/HiveMind/HiveMindP2.cs @@ -144,6 +144,7 @@ namespace CalamityMod.NPCs.HiveMind writer.Write(reelCount); writer.Write(counter); writer.Write(initialised); + writer.Write(npc.dontTakeDamage); } public override void ReceiveExtraAI(BinaryReader reader) @@ -158,6 +159,7 @@ namespace CalamityMod.NPCs.HiveMind reelCount = reader.ReadInt32(); counter = reader.ReadInt32(); initialised = reader.ReadBoolean(); + npc.dontTakeDamage = reader.ReadBoolean(); } public override void FindFrame(int frameHeight) @@ -304,7 +306,7 @@ namespace CalamityMod.NPCs.HiveMind Player player = Main.player[npc.target]; - npc.defense = (player.ZoneCorrupt || CalamityWorld.bossRushActive) ? 5 : 9999; + npc.dontTakeDamage = (player.ZoneCorrupt || CalamityWorld.bossRushActive) ? false : true; CalamityGlobalNPC.hiveMind = npc.whoAmI; diff --git a/NPCs/Perforator/PerforatorCyst.png b/NPCs/Perforator/PerforatorCyst.png index 8a619c8c2c..718dddd872 100644 Binary files a/NPCs/Perforator/PerforatorCyst.png and b/NPCs/Perforator/PerforatorCyst.png differ diff --git a/NPCs/Perforator/PerforatorCystGlow.png b/NPCs/Perforator/PerforatorCystGlow.png index 7950336fbe..1d107bc654 100644 Binary files a/NPCs/Perforator/PerforatorCystGlow.png and b/NPCs/Perforator/PerforatorCystGlow.png differ diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index c77dcea0b6..5c5f9c4319 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -4,6 +4,7 @@ using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; using CalamityMod.Items.Materials; +using CalamityMod.Items.Pets; using CalamityMod.Items.Placeables.Furniture.Trophies; using CalamityMod.Items.TreasureBags; using CalamityMod.Items.Weapons.Magic; @@ -1152,6 +1153,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath // Vanity DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); + DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); } // Mark PBG as dead diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs b/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs index 9b7964516c..68b5ca4ec2 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs @@ -1,6 +1,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; +using CalamityMod.Items.Pets; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Projectiles.Boss; using CalamityMod.World; @@ -676,6 +677,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { DropHelper.DropItem(npc, ModContent.ItemType(), 8, 12); DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); + DropHelper.DropItemChance(npc, ModContent.ItemType(), 50); //no, this isn't getting boosted by Defiled. Rover, I don't care. PBG also drops it } public override void OnHitPlayer(Player player, int damage, bool crit) diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs b/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs index 1eb1f0ca80..46750e0443 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; using CalamityMod.Items.SummonItems; @@ -23,6 +24,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians { private int spearType = 0; private int dustTimer = 3; + private int immuneTimer = 300; public override void SetStaticDefaults() { @@ -80,6 +82,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians { writer.Write(spearType); writer.Write(dustTimer); + writer.Write(immuneTimer); writer.Write(npc.dontTakeDamage); } @@ -87,6 +90,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians { spearType = reader.ReadInt32(); dustTimer = reader.ReadInt32(); + immuneTimer = reader.ReadInt32(); npc.dontTakeDamage = reader.ReadBoolean(); } @@ -149,10 +153,21 @@ namespace CalamityMod.NPCs.ProfanedGuardians bool expertMode = Main.expertMode || CalamityWorld.bossRushActive; bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive; bool death = CalamityWorld.death || CalamityWorld.bossRushActive; - npc.defense = (isHoly || isHell || CalamityWorld.bossRushActive) ? 50 : 99999; + + // Become immune over time if target isn't in hell or hallow + if (!isHoly && !isHell && !CalamityWorld.bossRushActive) + { + if (immuneTimer > 0) + immuneTimer--; + } + else + immuneTimer = 300; + + // Take damage or not + npc.dontTakeDamage = immuneTimer <= 0; bool flag100 = false; - for (int num569 = 0; num569 < 200; num569++) + for (int num569 = 0; num569 < Main.maxNPCs; num569++) { if ((Main.npc[num569].active && Main.npc[num569].type == ModContent.NPCType()) || (Main.npc[num569].active && Main.npc[num569].type == ModContent.NPCType())) { @@ -184,7 +199,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians { if (Main.rand.Next(3) < num1009) { - int num1012 = Dust.NewDust(vectorCenter - new Vector2((float)num1010), num1010 * 2, num1010 * 2, 244, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default, 1.5f); + int num1012 = Dust.NewDust(vectorCenter - new Vector2((float)num1010), num1010 * 2, num1010 * 2, (int)CalamityDusts.ProfanedFire, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default, 1.5f); Main.dust[num1012].noGravity = true; Main.dust[num1012].velocity *= 0.2f; Main.dust[num1012].fadeIn = 1f; @@ -465,7 +480,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -475,7 +490,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossA4"), 1f); for (int k = 0; k < 50; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianBoss2.cs b/NPCs/ProfanedGuardians/ProfanedGuardianBoss2.cs index aff6819d3d..c3a52b7001 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianBoss2.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianBoss2.cs @@ -1,10 +1,12 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; +using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -15,6 +17,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians [AutoloadBossHead] public class ProfanedGuardianBoss2 : ModNPC { + private int immuneTimer = 300; public override void SetStaticDefaults() { DisplayName.SetDefault("Profaned Guardian"); @@ -67,6 +70,18 @@ namespace CalamityMod.NPCs.ProfanedGuardians npc.DeathSound = SoundID.NPCDeath55; } + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(immuneTimer); + writer.Write(npc.dontTakeDamage); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + immuneTimer = reader.ReadInt32(); + npc.dontTakeDamage = reader.ReadBoolean(); + } + public override void FindFrame(int frameHeight) { npc.frameCounter += 0.15f; @@ -85,7 +100,19 @@ namespace CalamityMod.NPCs.ProfanedGuardians bool expertMode = Main.expertMode; bool isHoly = player.ZoneHoly; bool isHell = player.ZoneUnderworldHeight; - npc.defense = (isHoly || isHell || CalamityWorld.bossRushActive) ? 40 : 99999; + + // Become immune over time if target isn't in hell or hallow + if (!isHoly && !isHell && !CalamityWorld.bossRushActive) + { + if (immuneTimer > 0) + immuneTimer--; + } + else + immuneTimer = 300; + + // Take damage or not + npc.dontTakeDamage = immuneTimer <= 0; + Vector2 vectorCenter = npc.Center; if (Math.Sign(npc.velocity.X) != 0) @@ -102,7 +129,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians int dustType = Main.rand.Next(2); if (dustType == 0) { - dustType = 244; + dustType = (int)CalamityDusts.ProfanedFire; } else { @@ -279,7 +306,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -288,7 +315,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossT3"), 1f); for (int k = 0; k < 50; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianBoss3.cs b/NPCs/ProfanedGuardians/ProfanedGuardianBoss3.cs index ef9c4efbf2..4a0af28aab 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianBoss3.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianBoss3.cs @@ -1,10 +1,12 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; +using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -15,6 +17,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians [AutoloadBossHead] public class ProfanedGuardianBoss3 : ModNPC { + private int immuneTimer = 300; public override void SetStaticDefaults() { DisplayName.SetDefault("Profaned Guardian"); @@ -67,6 +70,18 @@ namespace CalamityMod.NPCs.ProfanedGuardians npc.DeathSound = SoundID.NPCDeath55; } + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(immuneTimer); + writer.Write(npc.dontTakeDamage); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + immuneTimer = reader.ReadInt32(); + npc.dontTakeDamage = reader.ReadBoolean(); + } + public override void FindFrame(int frameHeight) { npc.frameCounter += 0.15f; @@ -85,7 +100,19 @@ namespace CalamityMod.NPCs.ProfanedGuardians bool expertMode = Main.expertMode; bool isHoly = player.ZoneHoly; bool isHell = player.ZoneUnderworldHeight; - npc.defense = (isHoly || isHell || CalamityWorld.bossRushActive) ? 40 : 99999; + + // Become immune over time if target isn't in hell or hallow + if (!isHoly && !isHell && !CalamityWorld.bossRushActive) + { + if (immuneTimer > 0) + immuneTimer--; + } + else + immuneTimer = 300; + + // Take damage or not + npc.dontTakeDamage = immuneTimer <= 0; + Vector2 vectorCenter = npc.Center; if (Math.Sign(npc.velocity.X) != 0) @@ -102,7 +129,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians int dustType = Main.rand.Next(2); if (dustType == 0) { - dustType = 244; + dustType = (int)CalamityDusts.ProfanedFire; } else { @@ -289,7 +316,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -300,7 +327,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossH5"), 1f); for (int k = 0; k < 50; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index da9905e00d..5b9901d5fb 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using CalamityMod.Items.Accessories; using CalamityMod.Items.Accessories.Wings; using CalamityMod.Items.Armor.Vanity; @@ -829,7 +830,7 @@ namespace CalamityMod.NPCs.Providence for (int num621 = 0; num621 < 40; num621++) { int num622 = Dust.NewDust(new Vector2(player2.position.X, player2.position.Y), - player2.width, player2.height, 244, 0f, 0f, 100, default, 2f); + player2.width, player2.height, (int)CalamityDusts.ProfanedFire, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -841,11 +842,11 @@ namespace CalamityMod.NPCs.Providence for (int num623 = 0; num623 < 60; num623++) { int num624 = Dust.NewDust(new Vector2(player2.position.X, player2.position.Y), - player2.width, player2.height, 244, 0f, 0f, 100, default, 3f); + player2.width, player2.height, (int)CalamityDusts.ProfanedFire, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; num624 = Dust.NewDust(new Vector2(player2.position.X, player2.position.Y), - player2.width, player2.height, 244, 0f, 0f, 100, default, 2f); + player2.width, player2.height, (int)CalamityDusts.ProfanedFire, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } @@ -1058,7 +1059,7 @@ namespace CalamityMod.NPCs.Providence for (int num1221 = 0; num1221 < 1 + num1220; num1221++) { - int num1222 = 244; + int num1222 = (int)CalamityDusts.ProfanedFire; float num1223 = 1.2f; if (num1221 % 2 == 1) num1223 = 2.8f; @@ -1446,7 +1447,7 @@ namespace CalamityMod.NPCs.Providence Main.PlaySound(mod.GetLegacySoundSlot(SoundType.NPCHit, "Sounds/NPCHit/ProvidenceHurt"), npc.Center); } for (int k = 0; k < 15; k++) - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); if (npc.life <= 0) { @@ -1463,7 +1464,7 @@ namespace CalamityMod.NPCs.Providence npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 60; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 244, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.ProfanedFire, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -1473,10 +1474,10 @@ namespace CalamityMod.NPCs.Providence } for (int num623 = 0; num623 < 90; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 244, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.ProfanedFire, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 244, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.ProfanedFire, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 88a215e748..7d1729f025 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -2025,7 +2025,7 @@ namespace CalamityMod.Projectiles } } - public static void FloatingPetAI(Projectile projectile, bool lightPet = false, bool faceRight = false, float tiltFloat = 0.05f) + public static void FloatingPetAI(Projectile projectile, bool faceRight, float tiltFloat, bool lightPet = false) { Player player = Main.player[projectile.owner]; diff --git a/Projectiles/Magic/Shadowbolt.cs b/Projectiles/Magic/Shadowbolt.cs index 2c65ceacaa..d5a6231820 100644 --- a/Projectiles/Magic/Shadowbolt.cs +++ b/Projectiles/Magic/Shadowbolt.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Magic public override bool OnTileCollide(Vector2 oldVelocity) { - projectile.damage = (int)((double)projectile.damage * 1.25); + projectile.damage = (int)(projectile.damage * 1.25); projectile.penetrate--; if (projectile.penetrate <= 0) { diff --git a/Projectiles/Melee/ProfanedSwordProj.cs b/Projectiles/Melee/ProfanedSwordProj.cs index 9443705e41..05009bac76 100644 --- a/Projectiles/Melee/ProfanedSwordProj.cs +++ b/Projectiles/Melee/ProfanedSwordProj.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Melee projectile.width = 10; projectile.height = 10; projectile.friendly = true; - projectile.penetrate = 4; + projectile.penetrate = -1; projectile.aiStyle = 113; projectile.timeLeft = 600; aiType = ProjectileID.BoneJavelin; @@ -61,9 +61,6 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (CalamityGlobalNPC.AquaticScourgeIDs.Contains(target.type) || CalamityGlobalNPC.DestroyerIDs.Contains(target.type)) - projectile.penetrate--; - target.immune[projectile.owner] = 6; target.AddBuff(ModContent.BuffType(), 180); if (Main.myPlayer == projectile.owner) diff --git a/Projectiles/Melee/TrueCausticEdgeProjectile.cs b/Projectiles/Melee/TrueCausticEdgeProjectile.cs index d3bb36cf18..83236c5fcc 100644 --- a/Projectiles/Melee/TrueCausticEdgeProjectile.cs +++ b/Projectiles/Melee/TrueCausticEdgeProjectile.cs @@ -24,6 +24,8 @@ namespace CalamityMod.Projectiles.Melee projectile.melee = true; projectile.penetrate = 3; projectile.timeLeft = 600; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; } public override void AI() @@ -47,6 +49,7 @@ namespace CalamityMod.Projectiles.Melee public override bool OnTileCollide(Vector2 oldVelocity) { + projectile.damage = (int)(projectile.damage * 1.25); projectile.penetrate--; if (projectile.penetrate <= 0) { diff --git a/Projectiles/Pets/Akato.cs b/Projectiles/Pets/Akato.cs index bbc27fef0d..b227a33df5 100644 --- a/Projectiles/Pets/Akato.cs +++ b/Projectiles/Pets/Akato.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Pets { projectile.timeLeft = 2; } - CalamityGlobalProjectile.FloatingPetAI(projectile, false, true, 0.02f); + CalamityGlobalProjectile.FloatingPetAI(projectile, true, 0.02f); projectile.frameCounter++; if (projectile.frameCounter > 6) { diff --git a/Projectiles/Pets/BabyGhostBell.cs b/Projectiles/Pets/BabyGhostBell.cs index 354b9a6fba..2a910b4098 100644 --- a/Projectiles/Pets/BabyGhostBell.cs +++ b/Projectiles/Pets/BabyGhostBell.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Pets { Lighting.AddLight(projectile.Center, 0.1f, 0.3f, 0.5f); } - CalamityGlobalProjectile.FloatingPetAI(projectile, true); + CalamityGlobalProjectile.FloatingPetAI(projectile, false, 0.05f, true); projectile.frameCounter++; if (projectile.frameCounter > 6) { diff --git a/Projectiles/Pets/LeviPet.cs b/Projectiles/Pets/LeviPet.cs index f03fd56142..8f9997870d 100644 --- a/Projectiles/Pets/LeviPet.cs +++ b/Projectiles/Pets/LeviPet.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Pets { projectile.timeLeft = 2; } - CalamityGlobalProjectile.FloatingPetAI(projectile); + CalamityGlobalProjectile.FloatingPetAI(projectile, false, 0.05f); projectile.frameCounter++; if (projectile.frameCounter > 6) { diff --git a/Projectiles/Pets/PerforaMini.cs b/Projectiles/Pets/PerforaMini.cs index 5ae4e84fe2..4ad38762ff 100644 --- a/Projectiles/Pets/PerforaMini.cs +++ b/Projectiles/Pets/PerforaMini.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Pets projectile.timeLeft = 2; } - CalamityGlobalProjectile.FloatingPetAI(projectile, false, true, 0.1f); + CalamityGlobalProjectile.FloatingPetAI(projectile, true, 0.1f); //Dust if (Main.rand.NextBool(50)) diff --git a/Projectiles/Pets/PlaguebringerBab.cs b/Projectiles/Pets/PlaguebringerBab.cs new file mode 100644 index 0000000000..761c84eb71 --- /dev/null +++ b/Projectiles/Pets/PlaguebringerBab.cs @@ -0,0 +1,57 @@ +using CalamityMod.CalPlayer; +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Pets +{ + public class PlaguebringerBab : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Plaguebringer Bab"); + Main.projFrames[projectile.type] = 4; + Main.projPet[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.netImportant = true; + projectile.width = 30; + projectile.height = 30; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.timeLeft *= 5; + } + + public override void AI() + { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); + if (!player.active) + { + projectile.active = false; + return; + } + if (player.dead) + { + modPlayer.plaguebringerBab = false; + } + if (modPlayer.plaguebringerBab) + { + projectile.timeLeft = 2; + } + CalamityGlobalProjectile.FloatingPetAI(projectile, false, 0.05f); + projectile.frameCounter++; + if (projectile.frameCounter > 6) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame >= 4) + { + projectile.frame = 2; + } + } + } +} diff --git a/Projectiles/Pets/PlaguebringerBab.png b/Projectiles/Pets/PlaguebringerBab.png new file mode 100644 index 0000000000..9103613fa4 Binary files /dev/null and b/Projectiles/Pets/PlaguebringerBab.png differ diff --git a/Projectiles/Pets/RotomPet.cs b/Projectiles/Pets/RotomPet.cs index 5487bb6c0a..c4ac1c447d 100644 --- a/Projectiles/Pets/RotomPet.cs +++ b/Projectiles/Pets/RotomPet.cs @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Pets dust += 1f; } - CalamityGlobalProjectile.FloatingPetAI(projectile, false, true); + CalamityGlobalProjectile.FloatingPetAI(projectile, true, 0.05f); projectile.frameCounter++; if (projectile.frameCounter > 6) diff --git a/Projectiles/Pets/SCalPet.cs b/Projectiles/Pets/SCalPet.cs index c07951af96..7e28c16543 100644 --- a/Projectiles/Pets/SCalPet.cs +++ b/Projectiles/Pets/SCalPet.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Pets { projectile.timeLeft = 2; } - CalamityGlobalProjectile.FloatingPetAI(projectile); + CalamityGlobalProjectile.FloatingPetAI(projectile, false, 0.05f); projectile.frameCounter++; if (projectile.frameCounter > 6) { diff --git a/Projectiles/Pets/ThirdSage.cs b/Projectiles/Pets/ThirdSage.cs index 948daea09c..d0f5594cd8 100644 --- a/Projectiles/Pets/ThirdSage.cs +++ b/Projectiles/Pets/ThirdSage.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Pets { projectile.timeLeft = 2; } - CalamityGlobalProjectile.FloatingPetAI(projectile, false, true, 0.1f); + CalamityGlobalProjectile.FloatingPetAI(projectile, true, 0.1f); //Animation projectile.frameCounter++; if (projectile.frameCounter > 6) diff --git a/Projectiles/Ranged/IcyBulletProj.cs b/Projectiles/Ranged/IcyBulletProj.cs index 6e827d57d6..27041bf026 100644 --- a/Projectiles/Ranged/IcyBulletProj.cs +++ b/Projectiles/Ranged/IcyBulletProj.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.penetrate = 3; projectile.extraUpdates = 1; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 10; + projectile.localNPCHitCooldown = 20; projectile.coldDamage = true; } @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Ranged } if (projectile.owner == Main.myPlayer) { - for (int index = 0; index < 2; ++index) + for (int index = 0; index < Main.rand.Next(1,3); ++index) //1 to 2 { float SpeedX = -projectile.velocity.X * Main.rand.Next(40, 70) * 0.01f + Main.rand.Next(-20, 21) * 0.4f; float SpeedY = -projectile.velocity.Y * Main.rand.Next(40, 70) * 0.01f + Main.rand.Next(-20, 21) * 0.4f; diff --git a/Projectiles/Summon/PinkButterfly.cs b/Projectiles/Summon/PinkButterfly.cs index 284e186e20..befeee5326 100644 --- a/Projectiles/Summon/PinkButterfly.cs +++ b/Projectiles/Summon/PinkButterfly.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Summon player.MinionDamage()); projectile.damage = damage2; } - if ((double)Math.Abs(projectile.velocity.X) > 0.2) + if (Math.Abs(projectile.velocity.X) > 0.2f) { projectile.spriteDirection = -projectile.direction; } @@ -75,8 +75,8 @@ namespace CalamityMod.Projectiles.Summon projectile.frame = 0; } Lighting.AddLight(projectile.Center, 0.3f, 0.2f, 0.3f); - float num633 = 700f; - float num634 = 1100f; + float num633 = 1200f; + float num634 = 1500f; float num635 = 2400f; float num636 = 150f; bool flag64 = projectile.type == ModContent.ProjectileType(); diff --git a/Projectiles/Summon/PurpleButterfly.cs b/Projectiles/Summon/PurpleButterfly.cs index 6cfd527b16..fd26f604bf 100644 --- a/Projectiles/Summon/PurpleButterfly.cs +++ b/Projectiles/Summon/PurpleButterfly.cs @@ -77,9 +77,9 @@ namespace CalamityMod.Projectiles.Summon projectile.frame = 0; } Lighting.AddLight(projectile.Center, 0.3f, 0f, 0.5f); - float num633 = 800f; - float num634 = 1000f; - float num635 = 1600f; + float num633 = 1200f; + float num634 = 1500f; + float num635 = 2400f; float num636 = 150f; bool flag64 = projectile.type == ModContent.ProjectileType(); player.AddBuff(ModContent.BuffType(), 3600); @@ -280,12 +280,6 @@ namespace CalamityMod.Projectiles.Summon return false; } - public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - if (target.type == NPCID.CultistBoss) - damage = (int)(damage * 0.75); - } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.immune[projectile.owner] = 6; diff --git a/Projectiles/Summon/SakuraBullet.cs b/Projectiles/Summon/SakuraBullet.cs index f70a4a4eca..d218b4b6c3 100644 --- a/Projectiles/Summon/SakuraBullet.cs +++ b/Projectiles/Summon/SakuraBullet.cs @@ -96,12 +96,6 @@ namespace CalamityMod.Projectiles.Summon Main.dust[num458].velocity += projectile.velocity * 0.1f; } - public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - if (target.type == NPCID.CultistBoss) - damage = (int)(damage * 0.75); - } - public override void Kill(int timeLeft) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 25);