diff --git a/Items/Accessories/MutatedTruffle.cs b/Items/Accessories/MutatedTruffle.cs index 1ed626eccc..d605292c76 100644 --- a/Items/Accessories/MutatedTruffle.cs +++ b/Items/Accessories/MutatedTruffle.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Accessories modPlayer.miniOldDuke = true; if (player.whoAmI == Main.myPlayer) { - const int damage = 2000; + const int damage = 1750; if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { Projectile.NewProjectile(player.Center, Vector2.Zero, diff --git a/Items/Weapons/Magic/AcidGun.cs b/Items/Weapons/Magic/AcidGun.cs index c6289c58ac..90591e1f9d 100644 --- a/Items/Weapons/Magic/AcidGun.cs +++ b/Items/Weapons/Magic/AcidGun.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 20; + item.damage = 14; item.magic = true; item.mana = 9; item.width = 48; diff --git a/Items/Weapons/Magic/Eternity.cs b/Items/Weapons/Magic/Eternity.cs index 0dc96923a5..be91cb12dc 100644 --- a/Items/Weapons/Magic/Eternity.cs +++ b/Items/Weapons/Magic/Eternity.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Magic { public class Eternity : ModItem { - public const int BaseDamage = 4770; + public const int BaseDamage = 7777; public const int ExplosionDamage = 50000; public const int MaxHomers = 40; public const int dustID = 16; diff --git a/Items/Weapons/Magic/Miasma.cs b/Items/Weapons/Magic/Miasma.cs index fdbfc32794..f82f82d2f0 100644 --- a/Items/Weapons/Magic/Miasma.cs +++ b/Items/Weapons/Magic/Miasma.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 123; + item.damage = 78; item.magic = true; item.mana = 16; item.width = 50; diff --git a/Items/Weapons/Magic/VitriolicViper.cs b/Items/Weapons/Magic/VitriolicViper.cs index 1eff8574b4..8870676bdf 100644 --- a/Items/Weapons/Magic/VitriolicViper.cs +++ b/Items/Weapons/Magic/VitriolicViper.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 90; + item.damage = 47; item.magic = true; item.mana = 15; item.width = 60; diff --git a/Items/Weapons/Melee/Basher.cs b/Items/Weapons/Melee/Basher.cs index 090b39816d..0570277584 100644 --- a/Items/Weapons/Melee/Basher.cs +++ b/Items/Weapons/Melee/Basher.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Melee { item.width = 30; item.height = 52; - item.damage = 22; + item.damage = 17; item.melee = true; item.useAnimation = item.useTime = 26; item.useStyle = ItemUseStyleID.SwingThrow; diff --git a/Items/Weapons/Ranged/Toxibow.cs b/Items/Weapons/Ranged/Toxibow.cs index a405ca513e..3dd7444c46 100644 --- a/Items/Weapons/Ranged/Toxibow.cs +++ b/Items/Weapons/Ranged/Toxibow.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 12; + item.damage = 9; item.ranged = true; item.width = 20; item.height = 54; diff --git a/Items/Weapons/Summon/CausticCroakerStaff.cs b/Items/Weapons/Summon/CausticCroakerStaff.cs index d1fcf1fd54..d8f1a68e22 100644 --- a/Items/Weapons/Summon/CausticCroakerStaff.cs +++ b/Items/Weapons/Summon/CausticCroakerStaff.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { - item.damage = 20; + item.damage = 17; item.mana = 10; item.width = 10; item.height = 32; diff --git a/Items/Weapons/Summon/CorvidHarbringerStaff.cs b/Items/Weapons/Summon/CorvidHarbringerStaff.cs index 00d8efe8f4..66cf896919 100644 --- a/Items/Weapons/Summon/CorvidHarbringerStaff.cs +++ b/Items/Weapons/Summon/CorvidHarbringerStaff.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Summon item.UseSound = SoundID.DD2_BetsyFlyingCircleAttack; item.summon = true; item.mana = 11; - item.damage = 456; + item.damage = 200; item.knockBack = 2f; item.autoReuse = true; item.useTime = item.useAnimation = 36; diff --git a/Items/Weapons/Summon/DazzlingStabberStaff.cs b/Items/Weapons/Summon/DazzlingStabberStaff.cs index 2b47d99d2a..a9de6fa95a 100644 --- a/Items/Weapons/Summon/DazzlingStabberStaff.cs +++ b/Items/Weapons/Summon/DazzlingStabberStaff.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Summon item.UseSound = SoundID.DD2_DarkMageHealImpact; item.summon = true; item.mana = 12; - item.damage = 111; + item.damage = 51; item.knockBack = 2f; item.autoReuse = true; item.useTime = item.useAnimation = 21; diff --git a/Items/Weapons/Summon/DragonbloodDisgorger.cs b/Items/Weapons/Summon/DragonbloodDisgorger.cs index 31a81446bb..c62ab72828 100644 --- a/Items/Weapons/Summon/DragonbloodDisgorger.cs +++ b/Items/Weapons/Summon/DragonbloodDisgorger.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { - item.damage = 300; + item.damage = 276; item.mana = 30; item.width = 64; item.height = 62; diff --git a/Items/Weapons/Summon/EndoHydraStaff.cs b/Items/Weapons/Summon/EndoHydraStaff.cs index f6eefe1b04..fec291fa6d 100644 --- a/Items/Weapons/Summon/EndoHydraStaff.cs +++ b/Items/Weapons/Summon/EndoHydraStaff.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Summon item.UseSound = SoundID.Item60; item.summon = true; item.mana = 25; - item.damage = 2563; + item.damage = 1450; item.knockBack = 3f; item.autoReuse = true; item.useTime = item.useAnimation = 36; diff --git a/Items/Weapons/Summon/FuelCellBundle.cs b/Items/Weapons/Summon/FuelCellBundle.cs index 76204b8f27..a4ae6ab025 100644 --- a/Items/Weapons/Summon/FuelCellBundle.cs +++ b/Items/Weapons/Summon/FuelCellBundle.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { item.mana = 10; - item.damage = 50; + item.damage = 44; item.useStyle = ItemUseStyleID.SwingThrow; item.width = 32; item.height = 32; diff --git a/Items/Weapons/Summon/RadiantResolution.cs b/Items/Weapons/Summon/RadiantResolution.cs index 0e063a6a4e..0909331196 100644 --- a/Items/Weapons/Summon/RadiantResolution.cs +++ b/Items/Weapons/Summon/RadiantResolution.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Summon item.summon = true; item.mana = 100; - item.damage = 666; + item.damage = 720; item.knockBack = 3f; item.autoReuse = true; item.useTime = item.useAnimation = 36; diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index ff0cc8b189..a29aa9f10b 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -7,6 +7,7 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Buffs.Potions; using CalamityMod.CalPlayer; using CalamityMod.Dusts; +using CalamityMod.Events; using CalamityMod.Items.Accessories; using CalamityMod.Items.Ammo; using CalamityMod.Items.Materials; @@ -56,6 +57,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using System.Collections.Generic; +using System.Linq; using Terraria; using Terraria.ID; using Terraria.Localization; @@ -3666,6 +3668,12 @@ namespace CalamityMod.NPCs { spawnRate = (int)(spawnRate * 0.7); maxSpawns = (int)(maxSpawns * 1.2f); + + if (player.Calamity().ZoneSulphur && !player.Calamity().ZoneAbyss && CalamityWorld.rainingAcid) + { + spawnRate = 23; + maxSpawns = 20; + } } } else if (player.Calamity().ZoneAbyss) @@ -3794,6 +3802,14 @@ namespace CalamityMod.NPCs { pool[0] = 0f; } + if (spawnInfo.player.Calamity().ZoneSulphur && !spawnInfo.player.Calamity().ZoneAbyss && CalamityWorld.rainingAcid) + { + pool.Clear(); + foreach (int enemy in AcidRainEvent.PossibleEnemies.Select(enemyType => enemyType.Item1)) + { + pool.Add(enemy, 1f); + } + } } #endregion diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index 5c92d6e53f..924c75378f 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.CalPlayer; +using CalamityMod.Events; using CalamityMod.Items; using CalamityMod.Items.Accessories; using CalamityMod.Items.DifficultyItems; @@ -32,6 +33,7 @@ using CalamityMod.NPCs.StormWeaver; using CalamityMod.Tiles.Ores; using CalamityMod.World; using Microsoft.Xna.Framework; +using System.Linq; using Terraria; using Terraria.ID; using Terraria.Localization; @@ -755,6 +757,7 @@ namespace CalamityMod.NPCs if (CalamityWorld.armageddon) ArmageddonLoot(npc); + AcidRainProgression(npc); CheckBossSpawn(npc); ArmorSetLoot(npc); RareLoot(npc); @@ -1579,6 +1582,17 @@ namespace CalamityMod.NPCs } #endregion + #region Acid Rain + private void AcidRainProgression(NPC npc) + { + if (AcidRainEvent.PossibleEnemies.Select(enemy => enemy.Item1).Contains(npc.type) && CalamityWorld.rainingAcid) + { + Main.invasionSize -= AcidRainEvent.PossibleEnemies.Find(enemy => enemy.Item1 == npc.type).Item2; + } + AcidRainEvent.UpdateInvasion(); + } + #endregion + #region Common Loot private void CommonLoot(NPC npc) { diff --git a/Projectiles/Magic/EternityBook.cs b/Projectiles/Magic/EternityBook.cs index 39ed20b136..2eb7bb14ca 100644 --- a/Projectiles/Magic/EternityBook.cs +++ b/Projectiles/Magic/EternityBook.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Magic projectile.ai[0]++; if (projectile.ai[0] == 1f) { - NPC target = projectile.Center.ClosestNPCAt(4400f); + NPC target = projectile.Center.ClosestNPCAt(4400f, true); if (target != null) { diff --git a/Projectiles/Magic/EternityHex.cs b/Projectiles/Magic/EternityHex.cs index d760974a89..690b44b3ec 100644 --- a/Projectiles/Magic/EternityHex.cs +++ b/Projectiles/Magic/EternityHex.cs @@ -24,6 +24,7 @@ namespace CalamityMod.Projectiles.Magic projectile.tileCollide = false; projectile.timeLeft = int.MaxValue; //Killed manually projectile.extraUpdates = extraUpdateCount; + projectile.alpha = 255; } public override void AI() { @@ -38,9 +39,35 @@ namespace CalamityMod.Projectiles.Magic if (!target.active) { - DeathDust(); - projectile.Kill(); - return; + NPC potentialNPC = projectile.Center.ClosestNPCAt(4400f, true); + if (potentialNPC != null) + { + projectile.ai[0] = potentialNPC.whoAmI; + target = Main.npc[(int)projectile.ai[0]]; + for (int i = 0; i < Main.projectile.Length; i++) + { + Projectile proj = Main.projectile[i]; + if ((proj.whoAmI == projectile.whoAmI || + proj.type == ModContent.ProjectileType()) && + proj.active && proj.owner == projectile.owner) + { + if (proj.type == ModContent.ProjectileType()) + proj.ai[0] = projectile.ai[0]; + for (int j = 0; j < 44; j++) + { + Dust dust = Dust.NewDustPerfect(proj.Center, Eternity.dustID, newColor: new Color(245, 112, 218)); + dust.velocity = Utils.NextVector2Unit(Main.rand) * Main.rand.NextFloat(2f, 6f); + dust.noGravity = true; + } + } + } + } + else + { + DeathDust(); + projectile.Kill(); + return; + } } if (projectile.localAI[1] >= Main.projectile.Length || projectile.localAI[0] < 0) diff --git a/Projectiles/Magic/MiasmaGas.cs b/Projectiles/Magic/MiasmaGas.cs index b1e7b012fd..18cde801de 100644 --- a/Projectiles/Magic/MiasmaGas.cs +++ b/Projectiles/Magic/MiasmaGas.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Magic projectile.timeLeft = 600; projectile.penetrate = 10; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 3; + projectile.localNPCHitCooldown = 7; projectile.magic = true; } diff --git a/Projectiles/Magic/VitriolicViperFang.cs b/Projectiles/Magic/VitriolicViperFang.cs index a68265f43e..84d21e24f6 100644 --- a/Projectiles/Magic/VitriolicViperFang.cs +++ b/Projectiles/Magic/VitriolicViperFang.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Magic projectile.penetrate = 4; projectile.timeLeft = 300; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 5; + projectile.localNPCHitCooldown = 6; } public override void AI() diff --git a/Projectiles/Magic/VitriolicViperSpit.cs b/Projectiles/Magic/VitriolicViperSpit.cs index b69c9fa2bc..a267716701 100644 --- a/Projectiles/Magic/VitriolicViperSpit.cs +++ b/Projectiles/Magic/VitriolicViperSpit.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Projectiles.Magic projectile.penetrate = 1; projectile.timeLeft = 300; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 6; + projectile.localNPCHitCooldown = 8; } public override void AI() diff --git a/Projectiles/Rogue/ToxicantTwisterProjectile.cs b/Projectiles/Rogue/ToxicantTwisterProjectile.cs index d6a0533f7d..a1a85be682 100644 --- a/Projectiles/Rogue/ToxicantTwisterProjectile.cs +++ b/Projectiles/Rogue/ToxicantTwisterProjectile.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Rogue { if (projectile.Calamity().stealthStrike) { - if (projectile.timeLeft % 18f == 0f) + if (projectile.timeLeft % 25f == 0f) { for (int i = 0; i < 2; i++) { diff --git a/Projectiles/Summon/IgneousBlade.cs b/Projectiles/Summon/IgneousBlade.cs index 4c1ad5ba09..74cd54deb3 100644 --- a/Projectiles/Summon/IgneousBlade.cs +++ b/Projectiles/Summon/IgneousBlade.cs @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Summon { Vector2 spawnPosition = target.Center - new Vector2(0f, 550f).RotatedByRandom(MathHelper.ToRadians(8f)); Projectile.NewProjectile(spawnPosition, Vector2.Normalize(target.Center - spawnPosition) * 24f, ModContent.ProjectileType(), - projectile.damage, projectile.knockBack, projectile.owner); + (int)(projectile.damage * 0.666), projectile.knockBack, projectile.owner); } for (int i = 0; i < Main.rand.Next(28, 41); i++) { diff --git a/Projectiles/Summon/OldDukeHeadCorpse.cs b/Projectiles/Summon/OldDukeHeadCorpse.cs index d22db8cf4f..ef269b7f5f 100644 --- a/Projectiles/Summon/OldDukeHeadCorpse.cs +++ b/Projectiles/Summon/OldDukeHeadCorpse.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Summon float angle = (float)Math.Atan(Math.Abs(target.Center.X - projectile.Center.X) / 450f); angle *= Math.Sign(target.Center.X - projectile.Center.X); Projectile.NewProjectile(projectile.Top + Vector2.UnitY * 7f, - new Vector2(0f, -Main.rand.NextFloat(14f, 23f)).RotatedBy(angle), + new Vector2(0f, -Main.rand.NextFloat(21f, 30.5f)).RotatedBy(angle), ModContent.ProjectileType(), projectile.damage, 5f, projectile.owner); } diff --git a/Projectiles/Summon/PlaguebringerMK2.cs b/Projectiles/Summon/PlaguebringerMK2.cs index 35e71fec58..b634d60803 100644 --- a/Projectiles/Summon/PlaguebringerMK2.cs +++ b/Projectiles/Summon/PlaguebringerMK2.cs @@ -78,19 +78,19 @@ namespace CalamityMod.Projectiles.Summon Vector2 velocity = projectile.DirectionTo(destination) * projectile.Distance(destination) / 36f; projectile.velocity = velocity; } - int timeNeeded = (int)MathHelper.Lerp(60f, 10f, MathHelper.Clamp(projectile.localAI[1] / 320f, 0f, 1f)); + int timeNeeded = (int)MathHelper.Lerp(60f, 18f, MathHelper.Clamp(projectile.localAI[1] / 320f, 0f, 1f)); if (projectile.ai[0] >= timeNeeded) { Projectile.NewProjectile(projectile.Center, projectile.DirectionTo(potentialTarget.Center) * 14f, ModContent.ProjectileType(), - projectile.damage / 2, + (int)(projectile.damage / 0.3), 3f, projectile.owner); Projectile.NewProjectile(projectile.Center, projectile.DirectionTo(potentialTarget.Center) * 11.5f, ModContent.ProjectileType(), - projectile.damage / 2, + (int)(projectile.damage / 0.3), 3f, projectile.owner); projectile.ai[0] = 0; @@ -116,6 +116,8 @@ namespace CalamityMod.Projectiles.Summon } Vector2 velocity = distanceToDestination.SafeNormalize(projectile.direction * Vector2.UnitX) * speed; projectile.velocity = (projectile.velocity * 20f + velocity) / 21f; + if (distance > 2250f) + projectile.Center = player.Center; } else { diff --git a/Projectiles/Summon/SkeletalDragonMother.cs b/Projectiles/Summon/SkeletalDragonMother.cs index e63817584b..9c81b9aac4 100644 --- a/Projectiles/Summon/SkeletalDragonMother.cs +++ b/Projectiles/Summon/SkeletalDragonMother.cs @@ -115,6 +115,18 @@ namespace CalamityMod.Projectiles.Summon { projectile.ai[1] = 0f; projectile.velocity = (projectile.velocity * 24f + projectile.DirectionTo(player.Center) * 13f) / 25f; + if (projectile.Distance(player.Center) > 3250f) + { + projectile.Center = player.Center; + for (int i = 0; i < Main.projectile.Length; i++) + { + if (Main.projectile[i].active && Main.projectile[i].owner == projectile.owner && + Main.projectile[i].type == ModContent.ProjectileType()) + { + Main.projectile[i].Center = player.Center; + } + } + } } projectile.direction = projectile.spriteDirection = (projectile.velocity.X > 0).ToDirectionInt(); diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index 99ebfccb94..2e997d081f 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -155,7 +155,7 @@ namespace CalamityMod { for (int index = 0; index < Main.npc.Length; index++) { - if (Main.npc[index].CanBeChasedBy(null, false) && Collision.CanHit(origin, 1, 1, Main.npc[index].Center, 1, 1)) + if (Main.npc[index].CanBeChasedBy(null, false)) { if (Vector2.Distance(origin, Main.npc[index].Center) < distance) {