From cb7834d904cc044fe7efc38aa4ac2f87df5ce33d Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Sun, 3 Apr 2022 18:12:15 -0500 Subject: [PATCH] 1 - More fixes. --- NPCs/Abyss/ChaoticPuffer.cs | 4 +- NPCs/Abyss/ColossalSquid.cs | 4 +- NPCs/Abyss/EidolonWyrmHead.cs | 4 +- NPCs/Abyss/ToxicMinnow.cs | 6 +- NPCs/Crabulon/CrabulonIdle.cs | 6 +- NPCs/Crags/SoulSlurper.cs | 10 +-- NPCs/Cryogen/Cryogen.cs | 20 ++--- NPCs/Cryogen/CryogenIce.cs | 6 +- NPCs/DesertScourge/DesertScourgeBody.cs | 8 +- NPCs/DevourerofGods/DevourerofGodsHead.cs | 88 ++++++++++---------- NPCs/ExoMechs/Apollo/Apollo.cs | 16 ++-- NPCs/ExoMechs/Ares/AresBody.cs | 10 +-- NPCs/ExoMechs/Ares/AresGaussNuke.cs | 8 +- NPCs/ExoMechs/Ares/AresLaserCannon.cs | 10 +-- NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs | 10 +-- NPCs/ExoMechs/Ares/AresTeslaCannon.cs | 8 +- NPCs/ExoMechs/Artemis/Artemis.cs | 20 ++--- NPCs/ExoMechs/Thanatos/ThanatosBody1.cs | 16 ++-- NPCs/ExoMechs/Thanatos/ThanatosBody2.cs | 16 ++-- NPCs/ExoMechs/Thanatos/ThanatosHead.cs | 12 +-- NPCs/ExoMechs/Thanatos/ThanatosTail.cs | 16 ++-- 21 files changed, 149 insertions(+), 149 deletions(-) diff --git a/NPCs/Abyss/ChaoticPuffer.cs b/NPCs/Abyss/ChaoticPuffer.cs index 04458483a4..e22931b5fd 100644 --- a/NPCs/Abyss/ChaoticPuffer.cs +++ b/NPCs/Abyss/ChaoticPuffer.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Placeables.Ores; using CalamityMod.Projectiles.Enemy; @@ -125,7 +125,7 @@ namespace CalamityMod.NPCs.Abyss { int damageBoom = 45; int projectileType = ModContent.ProjectileType(); - int boom = Projectile.NewProjectile(NPC.Center.X, NPC.Center.Y, 0, 0, projectileType, damageBoom, 0f, Main.myPlayer, 0f, 0f); + int boom = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center.X, NPC.Center.Y, 0, 0, projectileType, damageBoom, 0f, Main.myPlayer, 0f, 0f); } NPC.netUpdate = true; } diff --git a/NPCs/Abyss/ColossalSquid.cs b/NPCs/Abyss/ColossalSquid.cs index fa18d49115..15444bceaf 100644 --- a/NPCs/Abyss/ColossalSquid.cs +++ b/NPCs/Abyss/ColossalSquid.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; @@ -393,7 +393,7 @@ namespace CalamityMod.NPCs.Abyss damage = 55; } SoundEngine.PlaySound(SoundID.Item, (int)NPC.position.X, (int)NPC.position.Y, 111); - Projectile.NewProjectile(NPC.Center.X, NPC.Center.Y + 60, 0f, 2f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center.X, NPC.Center.Y + 60, 0f, 2f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); } NPC.rotation = NPC.velocity.X * 0.05f; NPC.velocity *= 0.975f; diff --git a/NPCs/Abyss/EidolonWyrmHead.cs b/NPCs/Abyss/EidolonWyrmHead.cs index 4200fda2aa..0c3b6765c2 100644 --- a/NPCs/Abyss/EidolonWyrmHead.cs +++ b/NPCs/Abyss/EidolonWyrmHead.cs @@ -162,13 +162,13 @@ namespace CalamityMod.NPCs.Abyss int random = Main.rand.Next(randomAmt); if (random == 0) { - Projectile.NewProjectile(vector2, Vector2.Zero, ProjectileID.CultistBossLightningOrb, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector2, Vector2.Zero, ProjectileID.CultistBossLightningOrb, damage, 0f, Main.myPlayer, 0f, 0f); } else if (random == 1) { Vector2 vec = (Main.player[NPC.target].Center - NPC.Center).SafeNormalize(Vector2.UnitX * NPC.direction); Vector2 vector4 = vec * (adultWyrmAlive ? 6f : 4f); - Projectile.NewProjectile(vector2, vector4, ProjectileID.CultistBossIceMist, damage, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector2, vector4, ProjectileID.CultistBossIceMist, damage, 0f, Main.myPlayer, 0f, 1f); } else { diff --git a/NPCs/Abyss/ToxicMinnow.cs b/NPCs/Abyss/ToxicMinnow.cs index ffcee8df6e..7c6a72ff45 100644 --- a/NPCs/Abyss/ToxicMinnow.cs +++ b/NPCs/Abyss/ToxicMinnow.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Projectiles.Enemy; using CalamityMod.World; @@ -89,8 +89,8 @@ namespace CalamityMod.NPCs.Abyss { int projectileType = ModContent.ProjectileType(); offsetAngleBoom = startAngleBoom + deltaAngleBoom * (iBoom + iBoom * iBoom) / 2f + 32f * iBoom; - int boom1 = Projectile.NewProjectile(valueBoom.X, valueBoom.Y, (float)(Math.Sin(offsetAngleBoom) * 6f), (float)(Math.Cos(offsetAngleBoom) * 6f), projectileType, damageBoom, 0f, Main.myPlayer, 0f, 0f); - int boom2 = Projectile.NewProjectile(valueBoom.X, valueBoom.Y, (float)(-Math.Sin(offsetAngleBoom) * 6f), (float)(-Math.Cos(offsetAngleBoom) * 6f), projectileType, damageBoom, 0f, Main.myPlayer, 0f, 0f); + int boom1 = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), valueBoom.X, valueBoom.Y, (float)(Math.Sin(offsetAngleBoom) * 6f), (float)(Math.Cos(offsetAngleBoom) * 6f), projectileType, damageBoom, 0f, Main.myPlayer, 0f, 0f); + int boom2 = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), valueBoom.X, valueBoom.Y, (float)(-Math.Sin(offsetAngleBoom) * 6f), (float)(-Math.Cos(offsetAngleBoom) * 6f), projectileType, damageBoom, 0f, Main.myPlayer, 0f, 0f); } } NPC.netUpdate = true; diff --git a/NPCs/Crabulon/CrabulonIdle.cs b/NPCs/Crabulon/CrabulonIdle.cs index 9e0ea68b32..cfd5ca0c50 100644 --- a/NPCs/Crabulon/CrabulonIdle.cs +++ b/NPCs/Crabulon/CrabulonIdle.cs @@ -212,7 +212,7 @@ namespace CalamityMod.NPCs.Crabulon num350 *= num351; vector34.X += num349; vector34.Y += num350; - Projectile.NewProjectile(vector34.X, vector34.Y, num349, num350 - 5f, type, NPC.GetProjectileDamage(type), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector34.X, vector34.Y, num349, num350 - 5f, type, NPC.GetProjectileDamage(type), 0f, Main.myPlayer, 0f, 0f); } } } @@ -459,7 +459,7 @@ namespace CalamityMod.NPCs.Crabulon for (int x = 0; x < totalMushrooms; x++) { - Projectile.NewProjectile(NPC.Center.X + shotSpacing, NPC.Center.Y - 1000f, velocityX, 0f, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center.X + shotSpacing, NPC.Center.Y - 1000f, velocityX, 0f, type, damage, 0f, Main.myPlayer, 0f, 0f); shotSpacing -= shotSpacingDecrement; } @@ -475,7 +475,7 @@ namespace CalamityMod.NPCs.Crabulon { for (int x = 0; x < 20; x++) { - Projectile.NewProjectile(NPC.Center.X + shotSpacing, NPC.Center.Y - 1000f, 0f, 0f, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center.X + shotSpacing, NPC.Center.Y - 1000f, 0f, 0f, type, damage, 0f, Main.myPlayer, 0f, 0f); shotSpacing -= 100; } shotSpacing = 1000; diff --git a/NPCs/Crags/SoulSlurper.cs b/NPCs/Crags/SoulSlurper.cs index 02749103ff..564d4d7e8b 100644 --- a/NPCs/Crags/SoulSlurper.cs +++ b/NPCs/Crags/SoulSlurper.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; @@ -24,7 +24,7 @@ namespace CalamityMod.NPCs.Crags public override void SetDefaults() { NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.npcSlots = 1f; NPC.damage = 30; NPC.width = 60; @@ -44,8 +44,8 @@ namespace CalamityMod.NPCs.Crags NPC.defense = 45; NPC.lifeMax = 2000; } - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToWater = true; @@ -154,7 +154,7 @@ namespace CalamityMod.NPCs.Crags dmg = 22; } int projType = ModContent.ProjectileType(); - Projectile.NewProjectile(source.X, source.Y, num4, num5, projType, dmg + (provy ? 30 : 0), 0f, Main.myPlayer, 1f, 0f); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), source.X, source.Y, num4, num5, projType, dmg + (provy ? 30 : 0), 0f, Main.myPlayer, 1f, 0f); } } int num10 = (int)NPC.Center.X; diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index 063e426330..8b3f763a76 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -230,7 +230,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, NPC.ai[0] * 0.5f); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, NPC.ai[0] * 0.5f); } } } @@ -258,7 +258,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.Center, vector255, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer); } } } @@ -313,7 +313,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.Center, vector255, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer); } } } @@ -406,7 +406,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, velocity); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, velocity); } } } @@ -470,7 +470,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.Center, vector255, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer); } } } @@ -530,7 +530,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, velocity); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, velocity); } } } @@ -594,7 +594,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.Center, vector255, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer); } } } @@ -706,7 +706,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, velocity); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, velocity); } } } @@ -788,7 +788,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, velocity); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, velocity); } } } @@ -882,7 +882,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, 1f); } } diff --git a/NPCs/Cryogen/CryogenIce.cs b/NPCs/Cryogen/CryogenIce.cs index 529347dbb3..8e003965c5 100644 --- a/NPCs/Cryogen/CryogenIce.cs +++ b/NPCs/Cryogen/CryogenIce.cs @@ -1,4 +1,4 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -20,7 +20,7 @@ namespace CalamityMod.NPCs.Cryogen { NPC.Calamity().canBreakPlayerDefense = true; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.canGhostHeal = false; NPC.noTileCollide = true; NPC.GetNPCDamage(); @@ -142,7 +142,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - int proj = Projectile.NewProjectile(NPC.Center, vector255, type, damage2, 0f, Main.myPlayer); + int proj = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector255, type, damage2, 0f, Main.myPlayer); Main.projectile[proj].timeLeft = 300; } } diff --git a/NPCs/DesertScourge/DesertScourgeBody.cs b/NPCs/DesertScourge/DesertScourgeBody.cs index dfd8d68e3c..0049044493 100644 --- a/NPCs/DesertScourge/DesertScourgeBody.cs +++ b/NPCs/DesertScourge/DesertScourgeBody.cs @@ -1,4 +1,4 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -27,11 +27,11 @@ namespace CalamityMod.NPCs.DesertScourge double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.boss = true; - music = CalamityMod.Instance.GetMusicFromMusicMod("DesertScourge") ?? MusicID.Boss1; + Music = CalamityMod.Instance.GetMusicFromMusicMod("DesertScourge") ?? MusicID.Boss1; NPC.behindTiles = true; NPC.noGravity = true; NPC.noTileCollide = true; @@ -130,7 +130,7 @@ namespace CalamityMod.NPCs.DesertScourge vector104.Y += num943 * 5f; if (Main.rand.NextBool(2) || malice) { - Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, projectileType, NPC.GetProjectileDamage(projectileType), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector104.X, vector104.Y, num942, num943, projectileType, NPC.GetProjectileDamage(projectileType), 0f, Main.myPlayer, 0f, 0f); } NPC.netUpdate = true; } diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index 28bf4c180c..067eff51b2 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -508,7 +508,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (Main.netMode != NetmodeID.MultiplayerClient && !hasCreatedPhase1Portal) { Vector2 portalSpawnPosition = NPC.Center + NPC.velocity.SafeNormalize(-Vector2.UnitY) * 1000f; - PortalIndex = Projectile.NewProjectile(portalSpawnPosition, Vector2.Zero, ModContent.ProjectileType(), 0, 0f); + PortalIndex = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), portalSpawnPosition, Vector2.Zero, ModContent.ProjectileType(), 0, 0f); hasCreatedPhase1Portal = true; NPC.netUpdate = true; @@ -674,7 +674,7 @@ namespace CalamityMod.NPCs.DevourerofGods int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(vector44.X, vector44.Y, num427, num428, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector44.X, vector44.Y, num427, num428, type, damage, 0f, Main.myPlayer); } } else if (distanceFromTarget < 250f) @@ -705,15 +705,15 @@ namespace CalamityMod.NPCs.DevourerofGods for (int x = 0; x < totalShots_Phase2; x++) { - Projectile.NewProjectile(player.position.X + spawnOffset, targetPosY + shotSpacing_Phase2[0], -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); - Projectile.NewProjectile(player.position.X - spawnOffset, targetPosY + shotSpacing_Phase2[0], laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + spawnOffset, targetPosY + shotSpacing_Phase2[0], -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X - spawnOffset, targetPosY + shotSpacing_Phase2[0], laserVelocity, 0f, type, damage, 0f, Main.myPlayer); shotSpacing_Phase2[0] -= spacingVar_Phase2; } if (expertMode) { - Projectile.NewProjectile(player.position.X + spawnOffset, player.Center.Y, -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); - Projectile.NewProjectile(player.position.X - spawnOffset, player.Center.Y, laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + spawnOffset, player.Center.Y, -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X - spawnOffset, player.Center.Y, laserVelocity, 0f, type, damage, 0f, Main.myPlayer); } break; @@ -723,15 +723,15 @@ namespace CalamityMod.NPCs.DevourerofGods targetPosY += 50f; for (int x = 0; x < totalShots_Phase2; x++) { - Projectile.NewProjectile(player.position.X + spawnOffset, targetPosY + shotSpacing_Phase2[0], -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); - Projectile.NewProjectile(player.position.X - spawnOffset, targetPosY + shotSpacing_Phase2[0], laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + spawnOffset, targetPosY + shotSpacing_Phase2[0], -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X - spawnOffset, targetPosY + shotSpacing_Phase2[0], laserVelocity, 0f, type, damage, 0f, Main.myPlayer); shotSpacing_Phase2[0] -= spacingVar_Phase2; } if (expertMode) { - Projectile.NewProjectile(player.position.X + spawnOffset, player.Center.Y, -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); - Projectile.NewProjectile(player.position.X - spawnOffset, player.Center.Y, laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + spawnOffset, player.Center.Y, -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X - spawnOffset, player.Center.Y, laserVelocity, 0f, type, damage, 0f, Main.myPlayer); } break; @@ -743,17 +743,17 @@ namespace CalamityMod.NPCs.DevourerofGods start = new Vector2(player.position.X + spawnOffset, targetPosY + shotSpacing_Phase2[0]); aim.Y += laserWallSpacingOffset * (x - halfTotalDiagonalShots); velocity = Vector2.Normalize(aim - start) * laserVelocity; - Projectile.NewProjectile(start, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), start, velocity, type, damage, 0f, Main.myPlayer); start = new Vector2(player.position.X - spawnOffset, targetPosY + shotSpacing_Phase2[0]); velocity = Vector2.Normalize(aim - start) * laserVelocity; - Projectile.NewProjectile(start, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), start, velocity, type, damage, 0f, Main.myPlayer); shotSpacing_Phase2[0] -= diagonalSpacingVar; } - Projectile.NewProjectile(player.Center.X, targetPosY + spawnOffset, 0f, -laserVelocity, type, damage, 0f, Main.myPlayer); - Projectile.NewProjectile(player.Center.X, targetPosY - spawnOffset, 0f, laserVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.Center.X, targetPosY + spawnOffset, 0f, -laserVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.Center.X, targetPosY - spawnOffset, 0f, laserVelocity, type, damage, 0f, Main.myPlayer); break; @@ -761,21 +761,21 @@ namespace CalamityMod.NPCs.DevourerofGods for (int x = 0; x < totalShots_Phase2; x++) { - Projectile.NewProjectile(player.position.X + spawnOffset, targetPosY + shotSpacing_Phase2[0], -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); - Projectile.NewProjectile(player.position.X - spawnOffset, targetPosY + shotSpacing_Phase2[0], laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + spawnOffset, targetPosY + shotSpacing_Phase2[0], -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X - spawnOffset, targetPosY + shotSpacing_Phase2[0], laserVelocity, 0f, type, damage, 0f, Main.myPlayer); shotSpacing_Phase2[0] -= spacingVar_Phase2; } int totalBonusLasers = totalShots_Phase2 / 2; for (int x = 0; x < totalBonusLasers; x++) { - Projectile.NewProjectile(player.position.X + spawnOffset, targetPosY + shotSpacing_Phase2[3], -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); - Projectile.NewProjectile(player.position.X - spawnOffset, targetPosY + shotSpacing_Phase2[3], laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + spawnOffset, targetPosY + shotSpacing_Phase2[3], -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X - spawnOffset, targetPosY + shotSpacing_Phase2[3], laserVelocity, 0f, type, damage, 0f, Main.myPlayer); shotSpacing_Phase2[3] -= Main.rand.NextBool(2) ? 180 : 200; } - Projectile.NewProjectile(player.position.X + spawnOffset, player.Center.Y, -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); - Projectile.NewProjectile(player.position.X - spawnOffset, player.Center.Y, laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + spawnOffset, player.Center.Y, -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X - spawnOffset, player.Center.Y, laserVelocity, 0f, type, damage, 0f, Main.myPlayer); break; @@ -786,17 +786,17 @@ namespace CalamityMod.NPCs.DevourerofGods start = new Vector2(player.position.X + shotSpacing_Phase2[0], targetPosY + spawnOffset); aim.X += laserWallSpacingOffset * (x - halfTotalDiagonalShots); velocity = Vector2.Normalize(aim - start) * laserVelocity; - Projectile.NewProjectile(start, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), start, velocity, type, damage, 0f, Main.myPlayer); start = new Vector2(player.position.X + shotSpacing_Phase2[0], targetPosY - spawnOffset); velocity = Vector2.Normalize(aim - start) * laserVelocity; - Projectile.NewProjectile(start, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), start, velocity, type, damage, 0f, Main.myPlayer); shotSpacing_Phase2[0] -= diagonalSpacingVar; } - Projectile.NewProjectile(player.position.X + spawnOffset, player.Center.Y, -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); - Projectile.NewProjectile(player.position.X - spawnOffset, player.Center.Y, laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + spawnOffset, player.Center.Y, -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X - spawnOffset, player.Center.Y, laserVelocity, 0f, type, damage, 0f, Main.myPlayer); break; } @@ -816,14 +816,14 @@ namespace CalamityMod.NPCs.DevourerofGods // Lower wall for (int x = 0; x < totalShots_Phase2; x++) { - Projectile.NewProjectile(player.position.X + shotSpacing_Phase2[1], player.position.Y + spawnOffset, 0f, -laserVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + shotSpacing_Phase2[1], player.position.Y + spawnOffset, 0f, -laserVelocity, type, damage, 0f, Main.myPlayer); shotSpacing_Phase2[1] -= spacingVar_Phase2; } // Upper wall for (int x = 0; x < totalShots_Phase2; x++) { - Projectile.NewProjectile(player.position.X + shotSpacing_Phase2[2], player.position.Y - spawnOffset, 0f, laserVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + shotSpacing_Phase2[2], player.position.Y - spawnOffset, 0f, laserVelocity, type, damage, 0f, Main.myPlayer); shotSpacing_Phase2[2] -= spacingVar_Phase2; } @@ -1420,13 +1420,13 @@ namespace CalamityMod.NPCs.DevourerofGods start = new Vector2(player.position.X + spawnOffset, player.position.Y + shotSpacing); aim.Y += laserWallSpacingOffset * (x - 3); velocity = Vector2.Normalize(aim - start) * laserVelocity; - Projectile.NewProjectile(start, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), start, velocity, type, damage, 0f, Main.myPlayer); shotSpacing -= spacingVar; } if (expertMode) - Projectile.NewProjectile(player.position.X + spawnOffset, player.Center.Y, -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + spawnOffset, player.Center.Y, -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); break; @@ -1437,13 +1437,13 @@ namespace CalamityMod.NPCs.DevourerofGods start = new Vector2(player.position.X - spawnOffset, player.position.Y + shotSpacing); aim.Y += laserWallSpacingOffset * (x - 3); velocity = Vector2.Normalize(aim - start) * laserVelocity; - Projectile.NewProjectile(start, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), start, velocity, type, damage, 0f, Main.myPlayer); shotSpacing -= spacingVar; } if (expertMode) - Projectile.NewProjectile(player.position.X - spawnOffset, player.Center.Y, laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X - spawnOffset, player.Center.Y, laserVelocity, 0f, type, damage, 0f, Main.myPlayer); break; @@ -1454,19 +1454,19 @@ namespace CalamityMod.NPCs.DevourerofGods start = new Vector2(player.position.X + spawnOffset, player.position.Y + shotSpacing); aim.Y += laserWallSpacingOffset * (x - 3); velocity = Vector2.Normalize(aim - start) * laserVelocity; - Projectile.NewProjectile(start, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), start, velocity, type, damage, 0f, Main.myPlayer); start = new Vector2(player.position.X - spawnOffset, player.position.Y + shotSpacing); velocity = Vector2.Normalize(aim - start) * laserVelocity; - Projectile.NewProjectile(start, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), start, velocity, type, damage, 0f, Main.myPlayer); shotSpacing -= spacingVar; } if (expertMode) { - Projectile.NewProjectile(player.position.X + spawnOffset, player.Center.Y, -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); - Projectile.NewProjectile(player.position.X - spawnOffset, player.Center.Y, laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + spawnOffset, player.Center.Y, -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X - spawnOffset, player.Center.Y, laserVelocity, 0f, type, damage, 0f, Main.myPlayer); } break; @@ -1481,20 +1481,20 @@ namespace CalamityMod.NPCs.DevourerofGods start = new Vector2(player.position.X + spawnOffset, player.position.Y + shotSpacing); aim.Y += laserWallSpacingOffset * (x - 3); velocity = Vector2.Normalize(aim - start) * laserVelocity; - Projectile.NewProjectile(start, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), start, velocity, type, damage, 0f, Main.myPlayer); start = new Vector2(player.position.X - spawnOffset, player.position.Y + shotSpacing); velocity = Vector2.Normalize(aim - start) * laserVelocity; - Projectile.NewProjectile(start, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), start, velocity, type, damage, 0f, Main.myPlayer); start = new Vector2(player.position.X + shotSpacing, player.position.Y + spawnOffset); aimClone.X += laserWallSpacingOffset * (x - 3); velocity = Vector2.Normalize(aimClone - start) * laserVelocity; - Projectile.NewProjectile(start, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), start, velocity, type, damage, 0f, Main.myPlayer); start = new Vector2(player.position.X + shotSpacing, player.position.Y - spawnOffset); velocity = Vector2.Normalize(aimClone - start) * laserVelocity; - Projectile.NewProjectile(start, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), start, velocity, type, damage, 0f, Main.myPlayer); } shotSpacing -= spacingVar; @@ -1502,8 +1502,8 @@ namespace CalamityMod.NPCs.DevourerofGods if (expertMode) { - Projectile.NewProjectile(player.position.X + spawnOffset, player.Center.Y, -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); - Projectile.NewProjectile(player.position.X - spawnOffset, player.Center.Y, laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + spawnOffset, player.Center.Y, -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X - spawnOffset, player.Center.Y, laserVelocity, 0f, type, damage, 0f, Main.myPlayer); } break; @@ -1980,7 +1980,7 @@ namespace CalamityMod.NPCs.DevourerofGods float distance = 640f; Vector2 targetVector = player.Center + player.velocity.SafeNormalize(Vector2.UnitX) * distance + new Vector2(Main.rand.Next(-randomRange, randomRange + 1), Main.rand.Next(-randomRange, randomRange + 1)); SoundEngine.PlaySound(SoundID.Item109, player.Center); - Projectile.NewProjectile(targetVector, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), targetVector, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, NPC.whoAmI); } } @@ -1991,7 +1991,7 @@ namespace CalamityMod.NPCs.DevourerofGods int randomRange = 48; float distance = 1080f; Vector2 targetVector = player.Center + player.velocity.SafeNormalize(Vector2.UnitX) * distance + new Vector2(Main.rand.Next(-randomRange, randomRange + 1), Main.rand.Next(-randomRange, randomRange + 1)); - Projectile.NewProjectile(targetVector, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), targetVector, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, NPC.whoAmI); } Vector2 newPosition = GetRiftLocation(true); @@ -2022,7 +2022,7 @@ namespace CalamityMod.NPCs.DevourerofGods for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(newPosition, vector255, type, damage, 0f, Main.myPlayer, velocityMult, finalVelocity - finalVelocityReduction); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), newPosition, vector255, type, damage, 0f, Main.myPlayer, velocityMult, finalVelocity - finalVelocityReduction); } } } @@ -2122,7 +2122,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (DeathAnimationTimer == 452f) { if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f); if (Main.netMode != NetmodeID.Server) { diff --git a/NPCs/ExoMechs/Apollo/Apollo.cs b/NPCs/ExoMechs/Apollo/Apollo.cs index 0ecee3ae7d..6188b35a58 100644 --- a/NPCs/ExoMechs/Apollo/Apollo.cs +++ b/NPCs/ExoMechs/Apollo/Apollo.cs @@ -1,4 +1,4 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.Items.Potions; using CalamityMod.Items.TreasureBags; using CalamityMod.NPCs.ExoMechs.Ares; @@ -138,7 +138,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.Opacity = 0f; NPC.knockBackResist = 0f; NPC.value = Item.buyPrice(15, 0, 0, 0); @@ -148,7 +148,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo NPC.DeathSound = SoundID.NPCDeath14; NPC.netAlways = true; NPC.boss = true; - music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; + Music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; bossBag = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; @@ -984,7 +984,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo SoundEngine.PlaySound(Mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/PlasmaCasterFire"), NPC.Center); Vector2 plasmaVelocity = Vector2.Normalize(aimedVector) * projectileVelocity; Vector2 offset = Vector2.Normalize(plasmaVelocity) * 70f; - Projectile.NewProjectile(NPC.Center + offset, plasmaVelocity, type, damage, 0f, Main.myPlayer, player.Center.X, player.Center.Y); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + offset, plasmaVelocity, type, damage, 0f, Main.myPlayer, player.Center.X, player.Center.Y); } } } @@ -1040,7 +1040,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo SoundEngine.PlaySound(SoundID.Item36, NPC.Center); Vector2 rocketVelocity = Vector2.Normalize(aimedVector) * projectileVelocity * 1.2f; Vector2 offset = Vector2.Normalize(rocketVelocity) * 70f; - Projectile.NewProjectile(NPC.Center + offset, rocketVelocity, type, damage, 0f, Main.myPlayer, 0f, player.Center.Y); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + offset, rocketVelocity, type, damage, 0f, Main.myPlayer, 0f, player.Center.Y); } } @@ -1098,7 +1098,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo // Draw telegraph beams if (Main.netMode != NetmodeID.MultiplayerClient) { - int telegraph = Projectile.NewProjectile(chargeLocations[0], Vector2.Zero, type, 0, 0f, Main.myPlayer, 0f, NPC.whoAmI); + int telegraph = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), chargeLocations[0], Vector2.Zero, type, 0, 0f, Main.myPlayer, 0f, NPC.whoAmI); if (Main.projectile.IndexInRange(telegraph)) { Main.projectile[telegraph].ModProjectile().ChargePositions = chargeLocations; @@ -1156,7 +1156,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo for (int k = 0; k < totalProjectiles; k++) { Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.Center, velocity2, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, velocity2, type, damage, 0f, Main.myPlayer); } } @@ -1269,7 +1269,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo Vector2 offset = lensDirection * 70f; if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.Center + offset, lensDirection * 24f, ModContent.ProjectileType(), 0, 0f); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + offset, lensDirection * 24f, ModContent.ProjectileType(), 0, 0f); } // Reset phase and variables diff --git a/NPCs/ExoMechs/Ares/AresBody.cs b/NPCs/ExoMechs/Ares/AresBody.cs index aee8112347..3f45340d5f 100644 --- a/NPCs/ExoMechs/Ares/AresBody.cs +++ b/NPCs/ExoMechs/Ares/AresBody.cs @@ -1,4 +1,4 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; @@ -149,7 +149,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.Opacity = 0f; NPC.knockBackResist = 0f; NPC.value = Item.buyPrice(15, 0, 0, 0); @@ -159,7 +159,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.DeathSound = SoundID.NPCDeath14; NPC.netAlways = true; NPC.boss = true; - music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; + Music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; bossBag = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; @@ -783,7 +783,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares for (int k = 0; k < totalProjectiles; k++) { Vector2 laserVelocity = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(spawnPoint + Vector2.Normalize(laserVelocity) * 17f, laserVelocity, type, 0, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), spawnPoint + Vector2.Normalize(laserVelocity) * 17f, laserVelocity, type, 0, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } @@ -802,7 +802,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares for (int k = 0; k < totalProjectiles; k++) { Vector2 laserVelocity = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(spawnPoint + Vector2.Normalize(laserVelocity) * 35f, laserVelocity, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), spawnPoint + Vector2.Normalize(laserVelocity) * 35f, laserVelocity, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } diff --git a/NPCs/ExoMechs/Ares/AresGaussNuke.cs b/NPCs/ExoMechs/Ares/AresGaussNuke.cs index 60d221c4d8..69fd677068 100644 --- a/NPCs/ExoMechs/Ares/AresGaussNuke.cs +++ b/NPCs/ExoMechs/Ares/AresGaussNuke.cs @@ -1,4 +1,4 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.NPCs.ExoMechs.Thanatos; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; @@ -77,7 +77,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.Opacity = 0f; NPC.knockBackResist = 0f; NPC.canGhostHeal = false; @@ -88,7 +88,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.netAlways = true; NPC.boss = true; NPC.hide = true; - music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; + Music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } @@ -405,7 +405,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); float offset = 40f; - Projectile.NewProjectile(NPC.Center + Vector2.Normalize(gaussNukeVelocity) * offset, gaussNukeVelocity, type, damage, 0f, Main.myPlayer, 0f, player.Center.Y); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + Vector2.Normalize(gaussNukeVelocity) * offset, gaussNukeVelocity, type, damage, 0f, Main.myPlayer, 0f, player.Center.Y); // Recoil NPC.velocity -= gaussNukeVelocity; diff --git a/NPCs/ExoMechs/Ares/AresLaserCannon.cs b/NPCs/ExoMechs/Ares/AresLaserCannon.cs index 7f425ee7e3..41bbaa0ddd 100644 --- a/NPCs/ExoMechs/Ares/AresLaserCannon.cs +++ b/NPCs/ExoMechs/Ares/AresLaserCannon.cs @@ -1,4 +1,4 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.NPCs.ExoMechs.Thanatos; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; @@ -75,7 +75,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.Opacity = 0f; NPC.knockBackResist = 0f; NPC.canGhostHeal = false; @@ -86,7 +86,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.netAlways = true; NPC.boss = true; NPC.hide = true; - music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; + Music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } @@ -438,7 +438,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares SoundEngine.PlaySound(Mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserCannon"), NPC.Center); Vector2 laserVelocity = Vector2.Normalize(player.Center - NPC.Center); Vector2 offset = laserVelocity * 70f + Vector2.UnitY * 16f; - Projectile.NewProjectile(NPC.Center + offset, player.Center, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + offset, player.Center, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } @@ -474,7 +474,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares if (laserVelocity.HasNaNs()) laserVelocity = -Vector2.UnitY; - Projectile.NewProjectile(source, laserVelocity, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), source, laserVelocity, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } diff --git a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs index 35a07751e1..db2e12976c 100644 --- a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs +++ b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs @@ -1,4 +1,4 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.NPCs.ExoMechs.Thanatos; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; @@ -75,7 +75,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.Opacity = 0f; NPC.knockBackResist = 0f; NPC.canGhostHeal = false; @@ -86,7 +86,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.netAlways = true; NPC.boss = true; NPC.hide = true; - music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; + Music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } @@ -432,9 +432,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares Vector2 offset = Vector2.Normalize(plasmaBoltVelocity) * 40f + Vector2.UnitY * 16f; if (boltsSplitLess) - Projectile.NewProjectile(NPC.Center + offset, plasmaBoltVelocity, type, damage, 0f, Main.myPlayer, -1f); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + offset, plasmaBoltVelocity, type, damage, 0f, Main.myPlayer, -1f); else - Projectile.NewProjectile(NPC.Center + offset, plasmaBoltVelocity, type, damage, 0f, Main.myPlayer, player.Center.X, player.Center.Y); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + offset, plasmaBoltVelocity, type, damage, 0f, Main.myPlayer, player.Center.X, player.Center.Y); } } } diff --git a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs index d57e81b5fd..0ffc36efa4 100644 --- a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs +++ b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs @@ -1,4 +1,4 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.NPCs.ExoMechs.Thanatos; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; @@ -75,7 +75,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.Opacity = 0f; NPC.knockBackResist = 0f; NPC.canGhostHeal = false; @@ -86,7 +86,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.netAlways = true; NPC.boss = true; NPC.hide = true; - music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; + Music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } @@ -427,7 +427,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares int damage = NPC.GetProjectileDamage(type); Vector2 offset = Vector2.Normalize(teslaOrbVelocity) * 40f + Vector2.UnitY * 8f; float identity = fireMoreOrbs ? -2f : calamityGlobalNPC.newAI[3] + (calamityGlobalNPC.newAI[2] - teslaOrbTelegraphDuration) / divisor; - Projectile.NewProjectile(NPC.Center + offset, teslaOrbVelocity, type, damage, 0f, Main.myPlayer, identity); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + offset, teslaOrbVelocity, type, damage, 0f, Main.myPlayer, identity); } } } diff --git a/NPCs/ExoMechs/Artemis/Artemis.cs b/NPCs/ExoMechs/Artemis/Artemis.cs index 5471c7b211..b3e34d47de 100644 --- a/NPCs/ExoMechs/Artemis/Artemis.cs +++ b/NPCs/ExoMechs/Artemis/Artemis.cs @@ -1,4 +1,4 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.NPCs.ExoMechs.Ares; using CalamityMod.NPCs.ExoMechs.Thanatos; using CalamityMod.Projectiles.Boss; @@ -150,7 +150,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.Opacity = 0f; NPC.knockBackResist = 0f; NPC.noGravity = true; @@ -159,7 +159,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis NPC.DeathSound = SoundID.NPCDeath14; NPC.netAlways = true; NPC.boss = true; - music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; + Music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } @@ -696,7 +696,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis Vector2 projectileDestination = player.Center + predictionVector; Vector2 offset = laserVelocity * 70f; float setVelocityInAI = 6.5f; - Projectile.NewProjectile(NPC.Center + offset, projectileDestination, type, damage, 0f, Main.myPlayer, setVelocityInAI, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + offset, projectileDestination, type, damage, 0f, Main.myPlayer, setVelocityInAI, NPC.whoAmI); } } } @@ -731,7 +731,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis SoundEngine.PlaySound(Mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserCannon"), NPC.Center); Vector2 laserVelocity = Vector2.Normalize(aimedVector); Vector2 offset = laserVelocity * 50f; - Projectile.NewProjectile(NPC.Center + offset, laserVelocity, type, 0, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + offset, laserVelocity, type, 0, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } @@ -757,7 +757,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis Vector2 offset = normalizedPerturbedSpeed * 70f; Vector2 newCenter = NPC.Center + offset; - Projectile.NewProjectile(newCenter, newCenter + normalizedPerturbedSpeed * distanceFromTarget, type, damage, 0f, Main.myPlayer, setVelocityInAI, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), newCenter, newCenter + normalizedPerturbedSpeed * distanceFromTarget, type, damage, 0f, Main.myPlayer, setVelocityInAI, NPC.whoAmI); } } } @@ -850,7 +850,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis Vector2 offset = normalizedPerturbedSpeed * 70f; Vector2 newCenter = NPC.Center + offset; - Projectile.NewProjectile(newCenter, newCenter + normalizedPerturbedSpeed * distanceFromTarget, type, damage, 0f, Main.myPlayer, setVelocityInAI, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), newCenter, newCenter + normalizedPerturbedSpeed * distanceFromTarget, type, damage, 0f, Main.myPlayer, setVelocityInAI, NPC.whoAmI); } } } @@ -912,7 +912,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis SoundEngine.PlaySound(Mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserCannon"), NPC.Center); Vector2 laserVelocity = Vector2.Normalize(spinningPoint - NPC.Center); Vector2 offset = laserVelocity * 70f; - Projectile.NewProjectile(NPC.Center + offset, laserVelocity, type, 0, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + offset, laserVelocity, type, 0, 0f, Main.myPlayer, 0f, NPC.whoAmI); } NPC.netUpdate = true; @@ -979,7 +979,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis int type = ModContent.ProjectileType(); SoundEngine.PlaySound(29, (int)NPC.Center.X, (int)NPC.Center.Y, 104); int damage = NPC.GetProjectileDamage(type); - int laser = Projectile.NewProjectile(NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer, NPC.whoAmI); + int laser = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer, NPC.whoAmI); if (Main.projectile.IndexInRange(laser)) { Main.projectile[laser].ai[0] = NPC.whoAmI; @@ -1072,7 +1072,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis Vector2 offset = lensDirection * 70f; if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.Center + offset, lensDirection * 24f, ModContent.ProjectileType(), 0, 0f); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + offset, lensDirection * 24f, ModContent.ProjectileType(), 0, 0f); } // Reset phase and variables diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs index b6b7dfb82f..1fdd56bdc9 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs @@ -1,4 +1,4 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; using CalamityMod.World; @@ -66,7 +66,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.Opacity = 0f; NPC.canGhostHeal = false; @@ -78,7 +78,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.dontCountMe = true; NPC.chaseable = false; NPC.boss = true; - music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; + Music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } @@ -309,7 +309,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos // Normal laser int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } @@ -379,21 +379,21 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (calamityGlobalNPC_Head.newAI[1] == (float)ThanatosHead.SecondaryPhase.Passive) { // Normal laser - Projectile.NewProjectile(NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } else { // Normal laser if (shouldGetBuffedByBerserkPhase && NPC.ai[0] % 3f == 0f) - Projectile.NewProjectile(NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); // Predictive laser Vector2 projectileDestination = targetCenterArray[i] + Main.player[whoAmIArray[i]].velocity * predictionAmt; - Projectile.NewProjectile(NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); // Opposite laser projectileDestination = targetCenterArray[i] - Main.player[whoAmIArray[i]].velocity * predictionAmt; - Projectile.NewProjectile(NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs index 5bd35b9f10..c15c546783 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs @@ -1,4 +1,4 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; using CalamityMod.World; @@ -66,7 +66,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.Opacity = 0f; NPC.canGhostHeal = false; @@ -78,7 +78,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.dontCountMe = true; NPC.chaseable = false; NPC.boss = true; - music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; + Music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } @@ -309,7 +309,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos // Normal laser int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } @@ -379,21 +379,21 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (calamityGlobalNPC_Head.newAI[1] == (float)ThanatosHead.SecondaryPhase.Passive) { // Normal laser - Projectile.NewProjectile(NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } else { // Normal laser if (shouldGetBuffedByBerserkPhase && NPC.ai[0] % 3f == 0f) - Projectile.NewProjectile(NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); // Predictive laser Vector2 projectileDestination = targetCenterArray[i] + Main.player[whoAmIArray[i]].velocity * predictionAmt; - Projectile.NewProjectile(NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); // Opposite laser projectileDestination = targetCenterArray[i] - Main.player[whoAmIArray[i]].velocity * predictionAmt; - Projectile.NewProjectile(NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs index d121c48044..71c5b8e2b8 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs @@ -1,4 +1,4 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.Items.Potions; using CalamityMod.Items.TreasureBags; using CalamityMod.NPCs.ExoMechs.Ares; @@ -128,7 +128,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.Opacity = 0f; NPC.knockBackResist = 0f; NPC.value = Item.buyPrice(15, 0, 0, 0); @@ -139,7 +139,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.netAlways = true; NPC.boss = true; NPC.chaseable = false; - music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; + Music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; bossBag = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; @@ -843,7 +843,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos int type = ModContent.ProjectileType(); for (int b = 0; b < 6; b++) { - int beam = Projectile.NewProjectile(NPC.Center, Vector2.Zero, type, 0, 0f, 255, NPC.whoAmI); + int beam = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, Vector2.Zero, type, 0, 0f, 255, NPC.whoAmI); // Determine the initial offset angle of telegraph. It will be smoothened to give a "stretch" effect. if (Main.projectile.IndexInRange(beam)) @@ -854,7 +854,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos Main.projectile[beam].ai[1] = MathHelper.Lerp(-0.74f, 0.74f, smoothenedRatio); } } - int beam2 = Projectile.NewProjectile(NPC.Center, Vector2.Zero, type, 0, 0f, 255, NPC.whoAmI); + int beam2 = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, Vector2.Zero, type, 0, 0f, 255, NPC.whoAmI); if (Main.projectile.IndexInRange(beam2)) Main.projectile[beam2].ai[0] = NPC.whoAmI; } @@ -869,7 +869,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } diff --git a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs index 5260db0b73..10c4c00726 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs @@ -1,4 +1,4 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; using CalamityMod.World; @@ -66,7 +66,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.Opacity = 0f; NPC.canGhostHeal = false; @@ -78,7 +78,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.dontCountMe = true; NPC.chaseable = false; NPC.boss = true; - music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; + Music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } @@ -309,7 +309,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos // Normal laser int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } @@ -379,21 +379,21 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (calamityGlobalNPC_Head.newAI[1] == (float)ThanatosHead.SecondaryPhase.Passive) { // Normal laser - Projectile.NewProjectile(NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } else { // Normal laser if (shouldGetBuffedByBerserkPhase && NPC.ai[0] % 3f == 0f) - Projectile.NewProjectile(NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); // Predictive laser Vector2 projectileDestination = targetCenterArray[i] + Main.player[whoAmIArray[i]].velocity * predictionAmt; - Projectile.NewProjectile(NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); // Opposite laser projectileDestination = targetCenterArray[i] - Main.player[whoAmIArray[i]].velocity * predictionAmt; - Projectile.NewProjectile(NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } }