diff --git a/Buffs/DamageOverTime/Shred.cs b/Buffs/DamageOverTime/Shred.cs index 194c7e681d..2a0aa516e1 100644 --- a/Buffs/DamageOverTime/Shred.cs +++ b/Buffs/DamageOverTime/Shred.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Buffs.DamageOverTime if (applicator.miscCounter % FramesPerDamageTick == 0) { int dmg = (int)(BaseDamage * cgn.somaShredStacks * applicator.GetDamage(DamageClass.Ranged).Base); - Projectile tick = Projectile.NewProjectileDirect(target.GetSpawnSource_ForProjectile(), target.Center, Vector2.Zero, ModContent.ProjectileType(), dmg, 0f, applicator.whoAmI, target.whoAmI); + Projectile tick = Projectile.NewProjectileDirect(target.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), dmg, 0f, applicator.whoAmI, target.whoAmI); tick.DamageType = DamageClass.Ranged; // Uncommon for DirectStrikes, but it needs to be able to crit. tick.Calamity().canSupercrit = true; } diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index aabe158af0..431856da69 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -1591,7 +1591,7 @@ namespace CalamityMod.CalPlayer ItemID.NebulaPickup2, ItemID.NebulaPickup3 }); - var source = Player.GetItemSource_Misc(ItemSourceID.SetBonus_Nebula); + var source = Player.GetSource_Misc(ItemSourceID.SetBonus_Nebula); int nebulaBooster = Item.NewItem(source, target.Center, target.Size, boosterType, 1, false, 0, false, false); Main.item[nebulaBooster].velocity.Y = Main.rand.Next(-20, 1) * 0.2f; Main.item[nebulaBooster].velocity.X = Main.rand.Next(10, 31) * 0.2f * proj.direction; @@ -1607,7 +1607,7 @@ namespace CalamityMod.CalPlayer if ((target.life < target.lifeMax * 0.5) && bloodflareHeartTimer <= 0) { bloodflareHeartTimer = 300; - Item.NewItem(target.GetItemSource_Loot(), target.Hitbox, ItemID.Heart); + Item.NewItem(target.GetSource_Loot(), target.Hitbox, ItemID.Heart); } } @@ -1831,7 +1831,7 @@ namespace CalamityMod.CalPlayer if ((target.life < target.lifeMax * 0.5) && bloodflareHeartTimer <= 0) { bloodflareHeartTimer = 300; - Item.NewItem(target.GetItemSource_Loot(), target.Hitbox, ItemID.Heart); + Item.NewItem(target.GetSource_Loot(), target.Hitbox, ItemID.Heart); } } diff --git a/NPCs/Abyss/BobbitWormSegment.cs b/NPCs/Abyss/BobbitWormSegment.cs index 4ca27d9cb4..017d858680 100644 --- a/NPCs/Abyss/BobbitWormSegment.cs +++ b/NPCs/Abyss/BobbitWormSegment.cs @@ -51,7 +51,7 @@ namespace CalamityMod.NPCs.Abyss if (NPC.ai[1] == 0f) { NPC.ai[1] = 1f; - int spawnedNPC = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType(), NPC.whoAmI, 0f, 0f, 0f, 0f, 255); + int spawnedNPC = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType(), NPC.whoAmI, 0f, 0f, 0f, 0f, 255); Main.npc[spawnedNPC].ai[2] = (float)CalamityGlobalNPC.bobbitWormBottom[(int)NPC.ai[0]]; NPC.ai[2] = (float)spawnedNPC; } diff --git a/NPCs/Abyss/ChaoticPuffer.cs b/NPCs/Abyss/ChaoticPuffer.cs index a89d9c9554..10121c60ed 100644 --- a/NPCs/Abyss/ChaoticPuffer.cs +++ b/NPCs/Abyss/ChaoticPuffer.cs @@ -139,7 +139,7 @@ namespace CalamityMod.NPCs.Abyss { int damageBoom = 45; int projectileType = ModContent.ProjectileType(); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center.X, NPC.Center.Y, 0, 0, projectileType, damageBoom, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), 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 fa3651bdb0..aa66b714b9 100644 --- a/NPCs/Abyss/ColossalSquid.cs +++ b/NPCs/Abyss/ColossalSquid.cs @@ -407,7 +407,7 @@ namespace CalamityMod.NPCs.Abyss damage = 55; } SoundEngine.PlaySound(SoundID.Item, (int)NPC.position.X, (int)NPC.position.Y, 111); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center.X, NPC.Center.Y + 60, 0f, 2f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), 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 88a7edd535..a87b887ea6 100644 --- a/NPCs/Abyss/EidolonWyrmHead.cs +++ b/NPCs/Abyss/EidolonWyrmHead.cs @@ -143,16 +143,16 @@ namespace CalamityMod.NPCs.Abyss { if (num36 % 2 == 0) { - lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); } else { - lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); } } else { - lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); } Main.npc[lol].realLife = NPC.whoAmI; Main.npc[lol].ai[2] = (float)NPC.whoAmI; @@ -178,13 +178,13 @@ namespace CalamityMod.NPCs.Abyss int random = Main.rand.Next(randomAmt); if (random == 0) { - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector2, Vector2.Zero, ProjectileID.CultistBossLightningOrb, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), 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(NPC.GetSpawnSource_ForProjectile(), vector2, vector4, ProjectileID.CultistBossIceMist, damage, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vector2, vector4, ProjectileID.CultistBossIceMist, damage, 0f, Main.myPlayer, 0f, 1f); } else { diff --git a/NPCs/Abyss/GulperEelHead.cs b/NPCs/Abyss/GulperEelHead.cs index cdc39270f6..08a364ccd0 100644 --- a/NPCs/Abyss/GulperEelHead.cs +++ b/NPCs/Abyss/GulperEelHead.cs @@ -112,16 +112,16 @@ namespace CalamityMod.NPCs.Abyss { if (num36 == 0) { - lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); } else { - lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); } } else { - lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); } Main.npc[lol].realLife = NPC.whoAmI; Main.npc[lol].ai[2] = (float)NPC.whoAmI; diff --git a/NPCs/Abyss/OarfishHead.cs b/NPCs/Abyss/OarfishHead.cs index f245a676dc..35de080572 100644 --- a/NPCs/Abyss/OarfishHead.cs +++ b/NPCs/Abyss/OarfishHead.cs @@ -101,11 +101,11 @@ namespace CalamityMod.NPCs.Abyss int lol; if (num36 >= 0 && num36 < minLength) { - lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); } else { - lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); } Main.npc[lol].realLife = NPC.whoAmI; Main.npc[lol].ai[2] = (float)NPC.whoAmI; diff --git a/NPCs/Abyss/ToxicMinnow.cs b/NPCs/Abyss/ToxicMinnow.cs index cf70fd471f..39f25ba2ee 100644 --- a/NPCs/Abyss/ToxicMinnow.cs +++ b/NPCs/Abyss/ToxicMinnow.cs @@ -109,8 +109,8 @@ namespace CalamityMod.NPCs.Abyss { int projectileType = ModContent.ProjectileType(); offsetAngleBoom = startAngleBoom + deltaAngleBoom * (iBoom + iBoom * iBoom) / 2f + 32f * iBoom; - 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); - 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); + Projectile.NewProjectile(NPC.GetSource_FromAI(), valueBoom.X, valueBoom.Y, (float)(Math.Sin(offsetAngleBoom) * 6f), (float)(Math.Cos(offsetAngleBoom) * 6f), projectileType, damageBoom, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), 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/AcidRain/CragmawMire.cs b/NPCs/AcidRain/CragmawMire.cs index 477cd8379c..55e67d0be3 100644 --- a/NPCs/AcidRain/CragmawMire.cs +++ b/NPCs/AcidRain/CragmawMire.cs @@ -188,7 +188,7 @@ namespace CalamityMod.NPCs.AcidRain for (int i = 0; i < spikesPerBurst; i++) { Vector2 spikeShootVelocity = (MathHelper.TwoPi * i / spikesPerBurst + shootOffsetAngle).ToRotationVector2() * burstSpeed; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + spikeShootVelocity * 1.6f, spikeShootVelocity, ModContent.ProjectileType(), damage, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + spikeShootVelocity * 1.6f, spikeShootVelocity, ModContent.ProjectileType(), damage, 0f); } } } @@ -291,14 +291,14 @@ namespace CalamityMod.NPCs.AcidRain { int nukeDamage = DownedBossSystem.downedPolterghast ? 72 : 38; int dropletDamage = (int)(nukeDamage * 0.6f); - int explosion = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, Vector2.Zero, ModContent.ProjectileType(), nukeDamage, 0f); + int explosion = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, ModContent.ProjectileType(), nukeDamage, 0f); if (Main.projectile.IndexInRange(explosion)) Main.projectile[explosion].Bottom = NPC.Bottom + Vector2.UnitY * 4f; for (int i = 0; i < 12; i++) { Vector2 dropletVelocity = -Vector2.UnitY.RotatedByRandom(0.71f) * Main.rand.NextFloat(8f, 12f); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, dropletVelocity, ModContent.ProjectileType(), dropletDamage, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, dropletVelocity, ModContent.ProjectileType(), dropletDamage, 0f); } } } @@ -416,7 +416,7 @@ namespace CalamityMod.NPCs.AcidRain if (Main.netMode != NetmodeID.MultiplayerClient) { int laserbeamDamage = DownedBossSystem.downedPolterghast ? 120 : 40; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, -Vector2.UnitY, ModContent.ProjectileType(), laserbeamDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, -Vector2.UnitY, ModContent.ProjectileType(), laserbeamDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } @@ -429,7 +429,7 @@ namespace CalamityMod.NPCs.AcidRain public void DoBehavior_CreateVibeCheckTether() { if (Main.netMode != NetmodeID.MultiplayerClient && AttackTimer == 30f) - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, -Vector2.UnitY * 4f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, NPC.whoAmI, NPC.target); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, -Vector2.UnitY * 4f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, NPC.whoAmI, NPC.target); if (AttackTimer > CragmawVibeCheckChain.Lifetime + 30f) SelectNextAttack(); } diff --git a/NPCs/AcidRain/FlakCrab.cs b/NPCs/AcidRain/FlakCrab.cs index af6698800f..ca13dfa7ba 100644 --- a/NPCs/AcidRain/FlakCrab.cs +++ b/NPCs/AcidRain/FlakCrab.cs @@ -165,7 +165,7 @@ namespace CalamityMod.NPCs.AcidRain int damage = Main.expertMode ? DownedBossSystem.downedPolterghast ? 32 : 18 : DownedBossSystem.downedPolterghast ? 42 : 23; Vector2 spawnPosition = NPC.Top + Vector2.UnitY * 6f; Vector2 shootVelocity = (closestTargetToTop.Center - spawnPosition).SafeNormalize(Vector2.UnitY).RotatedByRandom(0.25f) * speed; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), spawnPosition, shootVelocity, ModContent.ProjectileType(), damage, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnPosition, shootVelocity, ModContent.ProjectileType(), damage, 2f); AcidShootTimer = 0; NPC.netUpdate = true; diff --git a/NPCs/AcidRain/GammaSlime.cs b/NPCs/AcidRain/GammaSlime.cs index fdf7d63da4..6642612c3e 100644 --- a/NPCs/AcidRain/GammaSlime.cs +++ b/NPCs/AcidRain/GammaSlime.cs @@ -96,7 +96,7 @@ namespace CalamityMod.NPCs.AcidRain float angle = MathHelper.TwoPi / 5f * i; if (GammaAcidShootTimer % 60f == 58f) angle += MathHelper.PiOver2; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, angle.ToRotationVector2() * 7f, ModContent.ProjectileType(), Main.expertMode ? 36 : 45, 3f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, angle.ToRotationVector2() * 7f, ModContent.ProjectileType(), Main.expertMode ? 36 : 45, 3f); } } NPC.netUpdate = true; @@ -147,7 +147,7 @@ namespace CalamityMod.NPCs.AcidRain if (Main.netMode != NetmodeID.MultiplayerClient) { SoundEngine.PlaySound(SoundID.Zombie, (int)NPC.position.X, (int)NPC.position.Y, 104); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, -Vector2.UnitY, ModContent.ProjectileType(), Main.expertMode ? 96 : 120, 4f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, -Vector2.UnitY, ModContent.ProjectileType(), Main.expertMode ? 96 : 120, 4f, Main.myPlayer, 0f, NPC.whoAmI); } NPC.netUpdate = true; } diff --git a/NPCs/AcidRain/Mauler.cs b/NPCs/AcidRain/Mauler.cs index 8fac835335..f86b61fb01 100644 --- a/NPCs/AcidRain/Mauler.cs +++ b/NPCs/AcidRain/Mauler.cs @@ -191,7 +191,7 @@ namespace CalamityMod.NPCs.AcidRain for (int i = 0; i < bubblesPerBurst; i++) { Vector2 bubbleShootVelocity = baseBubbleShootVelocity + Main.rand.NextVector2Circular(4f, 4f); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), mouthPosition, bubbleShootVelocity, bubbleShootType, bubbleDamage, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), mouthPosition, bubbleShootVelocity, bubbleShootType, bubbleDamage, 0f); } // Get launched back after firing. This only happens if in water and there's no obstacles behind. @@ -285,7 +285,7 @@ namespace CalamityMod.NPCs.AcidRain int acidDamage = NPC.GetProjectileDamage(acidShootType); Vector2 acidSpawnPosition = NPC.Center + Main.rand.NextVector2Circular(30f, 10f).RotatedBy(NPC.rotation); Vector2 acidShootVelocity = -Vector2.UnitY.RotatedByRandom(0.33f) * Main.rand.NextFloat(8f, 10.5f); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), acidSpawnPosition, acidShootVelocity, acidShootType, acidDamage, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), acidSpawnPosition, acidShootVelocity, acidShootType, acidDamage, 0f); NPC.netUpdate = true; } } diff --git a/NPCs/AcidRain/NuclearTerror.cs b/NPCs/AcidRain/NuclearTerror.cs index 6261f47ccf..b2f9257eda 100644 --- a/NPCs/AcidRain/NuclearTerror.cs +++ b/NPCs/AcidRain/NuclearTerror.cs @@ -395,14 +395,14 @@ namespace CalamityMod.NPCs.AcidRain if (Main.netMode != NetmodeID.MultiplayerClient) { float angle = (wrappedAttackTime - (AttackCycleTime - SpecialAttackTime + 20f)) % 12f / 12f * MathHelper.ToRadians(15f) - MathHelper.ToRadians(7.5f); - int bullet = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), mouthPosition, directionToShootPosition.RotatedBy(angle) * 14f, ModContent.ProjectileType(), 48, 4f); + int bullet = Projectile.NewProjectile(NPC.GetSource_FromAI(), mouthPosition, directionToShootPosition.RotatedBy(angle) * 14f, ModContent.ProjectileType(), 48, 4f); Main.projectile[bullet].localAI[0] = angle; } NPC.spriteDirection = (ShootPosition.X - NPC.Center.X < 0).ToDirectionInt(); SoundEngine.PlaySound(SoundID.NPCDeath13, mouthPosition); } if (wrappedAttackTime >= (AttackCycleTime - SpecialAttackTime + 35f) && AttackTime % 10f == 9f) - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), mouthPosition, directionToTarget * 12f, ModContent.ProjectileType(), 48, 3f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), mouthPosition, directionToTarget * 12f, ModContent.ProjectileType(), 48, 3f); break; case SpecialAttackState.ConeStreamOfBullets: if (wrappedAttackTime >= AttackCycleTime - SpecialAttackTime + 35f && AttackTime % 4f == 3f) @@ -410,8 +410,8 @@ namespace CalamityMod.NPCs.AcidRain if (Main.netMode != NetmodeID.MultiplayerClient) { float angle = MathHelper.Lerp(MathHelper.ToRadians(35f), MathHelper.ToRadians(5f), (wrappedAttackTime - (AttackCycleTime - SpecialAttackTime + 35f)) / (SpecialAttackTime + 35f)); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), mouthPosition, directionToTarget.RotatedBy(angle) * 16f, ModContent.ProjectileType(), 48, 4.5f); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), mouthPosition, directionToTarget.RotatedBy(-angle) * 16f, ModContent.ProjectileType(), 48, 4.5f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), mouthPosition, directionToTarget.RotatedBy(angle) * 16f, ModContent.ProjectileType(), 48, 4.5f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), mouthPosition, directionToTarget.RotatedBy(-angle) * 16f, ModContent.ProjectileType(), 48, 4.5f); } NPC.spriteDirection = (Target.Center.X - NPC.Center.X < 0).ToDirectionInt(); } @@ -424,7 +424,7 @@ namespace CalamityMod.NPCs.AcidRain for (int i = 0; i < 3; i++) { float angle = MathHelper.Lerp(-0.5f, 0.5f, i / 3f); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), mouthPosition, directionToShootPosition.RotatedBy(angle) * 13f, ModContent.ProjectileType(), 48, 4f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), mouthPosition, directionToShootPosition.RotatedBy(angle) * 13f, ModContent.ProjectileType(), 48, 4f); } } NPC.spriteDirection = (ShootPosition.X - NPC.Center.X < 0).ToDirectionInt(); @@ -462,7 +462,7 @@ namespace CalamityMod.NPCs.AcidRain { int type = Main.rand.NextBool(4) ? ModContent.ProjectileType() : ModContent.ProjectileType(); float angle = MathHelper.TwoPi / 16f * i; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, angle.ToRotationVector2() * Main.rand.NextFloat(4f, 11f), type, 48, 3f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, angle.ToRotationVector2() * Main.rand.NextFloat(4f, 11f), type, 48, 3f); } } for (int i = 0; i < 60; i++) diff --git a/NPCs/AcidRain/NuclearToad.cs b/NPCs/AcidRain/NuclearToad.cs index bf26b8e038..e687ff0a04 100644 --- a/NPCs/AcidRain/NuclearToad.cs +++ b/NPCs/AcidRain/NuclearToad.cs @@ -123,7 +123,7 @@ namespace CalamityMod.NPCs.AcidRain } for (int i = 0; i < 7; i++) - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, Main.rand.NextVector2CircularEdge(speed, speed), ModContent.ProjectileType(), damage, 1f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Main.rand.NextVector2CircularEdge(speed, speed), ModContent.ProjectileType(), damage, 1f); } SoundEngine.PlaySound(SoundID.DD2_KoboldExplosion, NPC.Center); NPC.life = 0; diff --git a/NPCs/AcidRain/Orthocera.cs b/NPCs/AcidRain/Orthocera.cs index 367aea5c1a..4b371e91eb 100644 --- a/NPCs/AcidRain/Orthocera.cs +++ b/NPCs/AcidRain/Orthocera.cs @@ -183,10 +183,10 @@ namespace CalamityMod.NPCs.AcidRain for (int i = 0; i < 2; i++) { float offsetAngle = MathHelper.Lerp(-0.3f, 0.3f, i / 2f); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, (spitDirection + offsetAngle).ToRotationVector2() * 10f, ModContent.ProjectileType(), damage, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, (spitDirection + offsetAngle).ToRotationVector2() * 10f, ModContent.ProjectileType(), damage, 2f); } } - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, spitDirection.ToRotationVector2() * 12f, ModContent.ProjectileType(), damage, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, spitDirection.ToRotationVector2() * 12f, ModContent.ProjectileType(), damage, 2f); } } diff --git a/NPCs/AcidRain/Trilobite.cs b/NPCs/AcidRain/Trilobite.cs index 6194f97053..4a61a84b8a 100644 --- a/NPCs/AcidRain/Trilobite.cs +++ b/NPCs/AcidRain/Trilobite.cs @@ -167,7 +167,7 @@ namespace CalamityMod.NPCs.AcidRain projDamage = (int)Math.Round(projDamage * 0.8); Vector2 spikeVelocity = -NPC.velocity.RotatedByRandom(0.18f); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + Main.rand.NextVector2Unit() * NPC.Size * 0.7f, spikeVelocity, ModContent.ProjectileType(), projDamage, 3f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Main.rand.NextVector2Unit() * NPC.Size * 0.7f, spikeVelocity, ModContent.ProjectileType(), projDamage, 3f); SpikeShootCountdown = Main.rand.Next(50, 65); NPC.netUpdate = true; } diff --git a/NPCs/AdultEidolonWyrm/EidolonWyrmBodyAltHuge.cs b/NPCs/AdultEidolonWyrm/EidolonWyrmBodyAltHuge.cs index 2d14b1cd72..93359ded03 100644 --- a/NPCs/AdultEidolonWyrm/EidolonWyrmBodyAltHuge.cs +++ b/NPCs/AdultEidolonWyrm/EidolonWyrmBodyAltHuge.cs @@ -134,7 +134,7 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm Vector2 velocity = Vector2.Normalize(destination) * fireballVelocity; int type = ProjectileID.CultistBossFireBallClone; int damage = NPC.GetProjectileDamage(type); - int proj = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, velocity, type, damage, 0f, Main.myPlayer); + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity, type, damage, 0f, Main.myPlayer); Main.projectile[proj].tileCollide = false; } } diff --git a/NPCs/AdultEidolonWyrm/EidolonWyrmBodyHuge.cs b/NPCs/AdultEidolonWyrm/EidolonWyrmBodyHuge.cs index eea728158e..c0495293b9 100644 --- a/NPCs/AdultEidolonWyrm/EidolonWyrmBodyHuge.cs +++ b/NPCs/AdultEidolonWyrm/EidolonWyrmBodyHuge.cs @@ -134,7 +134,7 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm Vector2 velocity = Vector2.Normalize(destination) * lightVelocity; int type = NPCID.AncientLight; float ai = (Main.rand.NextFloat() - 0.5f) * 0.3f * MathHelper.TwoPi / 60f; - int light = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.Center.X, (int)NPC.Center.Y, type, 0, 0f, ai, velocity.X, velocity.Y, 255); + int light = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, type, 0, 0f, ai, velocity.X, velocity.Y, 255); Main.npc[light].velocity = velocity; } } diff --git a/NPCs/AdultEidolonWyrm/EidolonWyrmHeadHuge.cs b/NPCs/AdultEidolonWyrm/EidolonWyrmHeadHuge.cs index 0435006d5e..b433eee276 100644 --- a/NPCs/AdultEidolonWyrm/EidolonWyrmHeadHuge.cs +++ b/NPCs/AdultEidolonWyrm/EidolonWyrmHeadHuge.cs @@ -222,12 +222,12 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm if (i >= 0 && i < minLength) { if (i % 2 == 0) - lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); else - lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); } else - lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); Main.npc[lol].realLife = NPC.whoAmI; Main.npc[lol].ai[2] = NPC.whoAmI; @@ -608,21 +608,21 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm Vector2 projectileVelocity = Vector2.Normalize(projectileDestination.RotatedByRandom(MathHelper.PiOver4)) * lightningVelocity; int type = ProjectileID.CultistBossLightningOrbArc; int damage = NPC.GetProjectileDamage(type); - int proj = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, projectileVelocity, type, damage, 0f, Main.myPlayer, projectileDestination.ToRotation(), ai); + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, damage, 0f, Main.myPlayer, projectileDestination.ToRotation(), ai); Main.projectile[proj].tileCollide = false; // Opposite bolt projectileDestination = targetCenterArray[i] - Main.player[whoAmIArray[i]].velocity * predictionAmt - NPC.Center; ai = Main.rand.Next(100); projectileVelocity = Vector2.Normalize(projectileDestination.RotatedByRandom(MathHelper.PiOver4)) * lightningVelocity; - proj = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, projectileVelocity, type, damage, 0f, Main.myPlayer, projectileDestination.ToRotation(), ai); + proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, damage, 0f, Main.myPlayer, projectileDestination.ToRotation(), ai); Main.projectile[proj].tileCollide = false; // Normal bolt projectileDestination = targetCenterArray[i] - NPC.Center; ai = Main.rand.Next(100); projectileVelocity = Vector2.Normalize(projectileDestination.RotatedByRandom(MathHelper.PiOver4)) * lightningVelocity; - proj = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, projectileVelocity, type, damage, 0f, Main.myPlayer, projectileDestination.ToRotation(), ai); + proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, damage, 0f, Main.myPlayer, projectileDestination.ToRotation(), ai); Main.projectile[proj].tileCollide = false; } } @@ -889,17 +889,17 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm Vector2 projectileVelocity = Vector2.Normalize(projectileDestination) * iceMistVelocity; int type = ProjectileID.CultistBossIceMist; int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, projectileVelocity, type, damage, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, damage, 0f, Main.myPlayer, 0f, 1f); // Opposite mist projectileDestination = targetCenterArray[i] - Main.player[whoAmIArray[i]].velocity * predictionAmt - NPC.Center; projectileVelocity = Vector2.Normalize(projectileDestination) * iceMistVelocity; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, projectileVelocity, type, damage, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, damage, 0f, Main.myPlayer, 0f, 1f); // Normal bolt projectileDestination = targetCenterArray[i] - NPC.Center; projectileVelocity = Vector2.Normalize(projectileDestination) * iceMistVelocity; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, projectileVelocity, type, damage, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, damage, 0f, Main.myPlayer, 0f, 1f); } } @@ -1016,7 +1016,7 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm for (int i = 0; i < ancientDoomLimit; i++) { float ai2 = i * ancientDoomDegrees; - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)(player.Center.X + (float)(Math.Sin(i * ancientDoomDegrees) * ancientDoomDistance)), (int)(player.Center.Y + (float)(Math.Cos(i * ancientDoomDegrees) * ancientDoomDistance)), + NPC.NewNPC(NPC.GetSource_FromAI(), (int)(player.Center.X + (float)(Math.Sin(i * ancientDoomDegrees) * ancientDoomDistance)), (int)(player.Center.Y + (float)(Math.Cos(i * ancientDoomDegrees) * ancientDoomDistance)), NPCID.AncientDoom, 0, NPC.whoAmI, 0f, ai2, 0f, Main.maxPlayers); } NPC.localAI[1] += 1f; @@ -1092,7 +1092,7 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm { Vector2 projectileDestination = player.Center - lightningSpawnLocation; float ai = Main.rand.Next(100); - int proj = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), lightningSpawnLocation, NPC.velocity * 0.5f, type, damage, 0f, Main.myPlayer, projectileDestination.ToRotation(), ai); + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), lightningSpawnLocation, NPC.velocity * 0.5f, type, damage, 0f, Main.myPlayer, projectileDestination.ToRotation(), ai); Main.projectile[proj].tileCollide = false; lightningSpawnLocation.Y += distanceBetweenBolts; if (i == numLightningBolts / 2) @@ -1163,7 +1163,7 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm if (canSpawn) { - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), randomX * 16 + 8, randomY * 16 + 8, ModContent.NPCType()); + NPC.NewNPC(NPC.GetSource_FromAI(), randomX * 16 + 8, randomY * 16 + 8, ModContent.NPCType()); break; } } @@ -1203,7 +1203,7 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm for (int i = 0; i < ancientDoomLimit; i++) { float ai2 = i * ancientDoomDegrees; - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)(player.Center.X + (float)(Math.Sin(i * ancientDoomDegrees) * ancientDoomDistance)), (int)(player.Center.Y + (float)(Math.Cos(i * ancientDoomDegrees) * ancientDoomDistance)), + NPC.NewNPC(NPC.GetSource_FromAI(), (int)(player.Center.X + (float)(Math.Sin(i * ancientDoomDegrees) * ancientDoomDistance)), (int)(player.Center.Y + (float)(Math.Cos(i * ancientDoomDegrees) * ancientDoomDistance)), NPCID.AncientDoom, 0, NPC.whoAmI, 0f, ai2, 0f, Main.maxPlayers); } diff --git a/NPCs/AquaticScourge/AquaticSeekerHead.cs b/NPCs/AquaticScourge/AquaticSeekerHead.cs index aa694dbf0b..34e75d4e5b 100644 --- a/NPCs/AquaticScourge/AquaticSeekerHead.cs +++ b/NPCs/AquaticScourge/AquaticSeekerHead.cs @@ -77,11 +77,11 @@ namespace CalamityMod.NPCs.AquaticScourge int lol; if (num36 >= 0 && num36 < minLength) { - lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); } else { - lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); } Main.npc[lol].realLife = NPC.whoAmI; Main.npc[lol].ai[2] = (float)NPC.whoAmI; diff --git a/NPCs/Astral/AstralProbe.cs b/NPCs/Astral/AstralProbe.cs index 085b401a38..7ef490966b 100644 --- a/NPCs/Astral/AstralProbe.cs +++ b/NPCs/Astral/AstralProbe.cs @@ -158,7 +158,7 @@ namespace CalamityMod.NPCs.Astral num8 += 6; int num9 = ProjectileID.PinkLaser; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector.X, vector.Y, num4, num5, num9, num8, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vector.X, vector.Y, num4, num5, num9, num8, 0f, Main.myPlayer, 0f, 0f); } } int num10 = (int)NPC.position.X + NPC.width / 2; diff --git a/NPCs/Astral/BigSightseer.cs b/NPCs/Astral/BigSightseer.cs index 25733f4287..9a58571e4d 100644 --- a/NPCs/Astral/BigSightseer.cs +++ b/NPCs/Astral/BigSightseer.cs @@ -114,7 +114,7 @@ namespace CalamityMod.NPCs.Astral { NPC.ai[1] = 0f; - int n = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)spawnPoint.X, (int)spawnPoint.Y, ModContent.NPCType()); + int n = NPC.NewNPC(NPC.GetSource_FromAI(), (int)spawnPoint.X, (int)spawnPoint.Y, ModContent.NPCType()); Main.npc[n].Center = spawnPoint; Main.npc[n].velocity = vector * (CalamityWorld.death ? 12f : 10f); } diff --git a/NPCs/Astral/Hive.cs b/NPCs/Astral/Hive.cs index 86fcd37cf8..21f4f4a802 100644 --- a/NPCs/Astral/Hive.cs +++ b/NPCs/Astral/Hive.cs @@ -71,7 +71,7 @@ namespace CalamityMod.NPCs.Astral NPC.ai[0] = 0; //spawn hiveling, it's ai[0] is the hive npc index. - int n = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType(), 0, NPC.whoAmI); + int n = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType(), 0, NPC.whoAmI); Main.npc[n].velocity.X = Main.rand.NextFloat(-0.4f, 0.4f); Main.npc[n].velocity.Y = Main.rand.NextFloat(-0.5f, -0.05f); } diff --git a/NPCs/Astral/Mantis.cs b/NPCs/Astral/Mantis.cs index 56e9a8a09a..09e5e086bc 100644 --- a/NPCs/Astral/Mantis.cs +++ b/NPCs/Astral/Mantis.cs @@ -131,7 +131,7 @@ namespace CalamityMod.NPCs.Astral Vector2 vector = Main.player[NPC.target].Center - NPC.Center; vector.Normalize(); int damage = DownedBossSystem.downedAstrumAureus ? 55 : 45; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + (NPC.Center.X < target.Center.X ? -14f : 14f) * Vector2.UnitX, vector * 7f, ModContent.ProjectileType(), damage, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + (NPC.Center.X < target.Center.X ? -14f : 14f) * Vector2.UnitX, vector * 7f, ModContent.ProjectileType(), damage, 0f); } } diff --git a/NPCs/AstrumAureus/AureusSpawn.cs b/NPCs/AstrumAureus/AureusSpawn.cs index 183f82d6c7..e4192c0c57 100644 --- a/NPCs/AstrumAureus/AureusSpawn.cs +++ b/NPCs/AstrumAureus/AureusSpawn.cs @@ -173,7 +173,7 @@ namespace CalamityMod.NPCs.AstrumAureus num7 *= num8; int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center.X, NPC.Center.Y, num6, num7, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y, num6, num7, type, damage, 0f, Main.myPlayer); } } } diff --git a/NPCs/BrimstoneElemental/Brimling.cs b/NPCs/BrimstoneElemental/Brimling.cs index 4ff063ce69..aadff4ceec 100644 --- a/NPCs/BrimstoneElemental/Brimling.cs +++ b/NPCs/BrimstoneElemental/Brimling.cs @@ -121,7 +121,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental num7 *= num8; int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center.X, NPC.Center.Y, num6, num7, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, Main.player[NPC.target].Center.X, Main.player[NPC.target].Center.Y); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y, num6, num7, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, Main.player[NPC.target].Center.X, Main.player[NPC.target].Center.Y); } if (vector251.Length() > 400f || !flag104) { @@ -252,7 +252,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental { int closestPlayer = Player.FindClosest(NPC.Center, 1, 1); if (Main.rand.Next(4) == 0 && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2) - Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); + Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); } } diff --git a/NPCs/Bumblebirb/Bumblefuck2.cs b/NPCs/Bumblebirb/Bumblefuck2.cs index d3b2643753..01b52a29c2 100644 --- a/NPCs/Bumblebirb/Bumblefuck2.cs +++ b/NPCs/Bumblebirb/Bumblefuck2.cs @@ -62,7 +62,7 @@ namespace CalamityMod.NPCs.Bumblebirb { int closestPlayer = Player.FindClosest(NPC.Center, 1, 1); if (Main.rand.Next(4) == 0 && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2) - Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); + Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); } } diff --git a/NPCs/Calamitas/CalamitasRun.cs b/NPCs/Calamitas/CalamitasRun.cs index 3e2f235dde..1e31a05828 100644 --- a/NPCs/Calamitas/CalamitasRun.cs +++ b/NPCs/Calamitas/CalamitasRun.cs @@ -149,7 +149,7 @@ namespace CalamityMod.NPCs.Calamitas { int heartAmt = Main.rand.Next(3) + 3; for (int i = 0; i < heartAmt; i++) - Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); + Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); } } diff --git a/NPCs/Calamitas/CalamitasRun2.cs b/NPCs/Calamitas/CalamitasRun2.cs index 8e1b113d63..371c907456 100644 --- a/NPCs/Calamitas/CalamitasRun2.cs +++ b/NPCs/Calamitas/CalamitasRun2.cs @@ -149,7 +149,7 @@ namespace CalamityMod.NPCs.Calamitas { int heartAmt = Main.rand.Next(3) + 3; for (int i = 0; i < heartAmt; i++) - Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); + Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); } } diff --git a/NPCs/Calamitas/SoulSeeker.cs b/NPCs/Calamitas/SoulSeeker.cs index 60e3a501cc..5ef6ee2a55 100644 --- a/NPCs/Calamitas/SoulSeeker.cs +++ b/NPCs/Calamitas/SoulSeeker.cs @@ -98,7 +98,7 @@ namespace CalamityMod.NPCs.Calamitas int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, velocity, type, damage, 1f, NPC.target, 1f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity, type, damage, 1f, NPC.target, 1f, 0f); } timer = 0; } @@ -156,7 +156,7 @@ namespace CalamityMod.NPCs.Calamitas { int closestPlayer = Player.FindClosest(NPC.Center, 1, 1); if (Main.rand.Next(4) == 0 && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2) - Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); + Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); } } diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index ed1019f1f2..28d0e9843a 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -145,7 +145,7 @@ namespace CalamityMod.NPCs for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vectorCenter, vector255, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), vectorCenter, vector255, type, damage, 0f, Main.myPlayer); } } else @@ -173,7 +173,7 @@ namespace CalamityMod.NPCs for (int i = 0; i < numProj; i++) { offsetAngle = startAngle + deltaAngle * i; - int proj = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vectorCenter.X, vectorCenter.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), type, damage, 0f, Main.myPlayer, 0f, 0f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), vectorCenter.X, vectorCenter.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), type, damage, 0f, Main.myPlayer, 0f, 0f); Main.projectile[proj].tileCollide = false; } } @@ -241,12 +241,12 @@ namespace CalamityMod.NPCs if (num36 >= 0 && num36 < maxLength - 1) { if (num36 % 2 == 0) - lol = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.height / 2), ModContent.NPCType(), npc.whoAmI); + lol = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.height / 2), ModContent.NPCType(), npc.whoAmI); else - lol = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.height / 2), ModContent.NPCType(), npc.whoAmI); + lol = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.height / 2), ModContent.NPCType(), npc.whoAmI); } else - lol = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.height / 2), ModContent.NPCType(), npc.whoAmI); + lol = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.height / 2), ModContent.NPCType(), npc.whoAmI); Main.npc[lol].realLife = npc.whoAmI; Main.npc[lol].ai[2] = npc.whoAmI; @@ -281,7 +281,7 @@ namespace CalamityMod.NPCs for (int i = 0; i < totalProjectiles; i++) { Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * i); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center, vector255, type, damage, 0f, Main.myPlayer, homing, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, vector255, type, damage, 0f, Main.myPlayer, homing, 0f); } if (phase3) @@ -299,7 +299,7 @@ namespace CalamityMod.NPCs if (expertMode) vector15 *= 1f + (maximumVelocityMult * (0.5f - lifeRatio) * 2f); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center, vector15, type, damage, 0f, Main.myPlayer, 0f, Main.rand.Next(-45, 1)); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, vector15, type, damage, 0f, Main.myPlayer, 0f, Main.rand.Next(-45, 1)); } } } @@ -339,7 +339,7 @@ namespace CalamityMod.NPCs vector104.X += num942 * 5f; vector104.Y += num943 * 5f; float accelerate = phase4 ? 1f : 0f; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector104.X, vector104.Y, num942, num943, type, damage, 0f, Main.myPlayer, accelerate, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector104.X, vector104.Y, num942, num943, type, damage, 0f, Main.myPlayer, accelerate, 0f); npc.netUpdate = true; } } @@ -364,7 +364,7 @@ namespace CalamityMod.NPCs vector104.X += num942 * 5f; vector104.Y += num943 * 5f; float homing = phase4 ? 1f : 0f; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector104.X, vector104.Y, num942, num943, type, damage, 0f, Main.myPlayer, homing, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector104.X, vector104.Y, num942, num943, type, damage, 0f, Main.myPlayer, homing, 0f); npc.netUpdate = true; } } @@ -897,7 +897,7 @@ namespace CalamityMod.NPCs { if (Main.netMode != NetmodeID.MultiplayerClient && NPC.CountNPCS(ModContent.NPCType()) < (death ? 1 : 2) && revenge) { - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)vectorCenter.X, (int)vectorCenter.Y, ModContent.NPCType()); + NPC.NewNPC(npc.GetSource_FromAI(), (int)vectorCenter.X, (int)vectorCenter.Y, ModContent.NPCType()); } SoundEngine.PlaySound(SoundID.Item8, vectorCenter); npc.alpha = 255; @@ -982,7 +982,7 @@ namespace CalamityMod.NPCs for (int i = 0; i < numProj; i++) { offsetAngle = startAngle + deltaAngle * i; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vectorCenter.X, vectorCenter.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 1f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), vectorCenter.X, vectorCenter.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 1f, 0f); } } @@ -1005,7 +1005,7 @@ namespace CalamityMod.NPCs vectorCenter.Y += relativeSpeedY * 3f; type = ModContent.ProjectileType(); damage = npc.GetProjectileDamage(type); - int projectileShot = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vectorCenter.X, vectorCenter.Y, relativeSpeedX, relativeSpeedY, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, player.Center.X, player.Center.Y); + int projectileShot = Projectile.NewProjectile(npc.GetSource_FromAI(), vectorCenter.X, vectorCenter.Y, relativeSpeedX, relativeSpeedY, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, player.Center.X, player.Center.Y); Main.projectile[projectileShot].timeLeft = 240; } } @@ -1060,7 +1060,7 @@ namespace CalamityMod.NPCs { float radians = j - (totalProjectiles - 1f) / 2f; Vector2 offset = velocity.RotatedBy(offsetAngle * radians); - int proj = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center + offset, vectorCenter, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 1f, 0f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + offset, vectorCenter, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 1f, 0f); Main.projectile[proj].timeLeft = 300; Main.projectile[proj].tileCollide = false; } @@ -1076,7 +1076,7 @@ namespace CalamityMod.NPCs for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians2 * k); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center, vector255, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 1f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, vector255, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 1f, 0f); } if (death) @@ -1085,7 +1085,7 @@ namespace CalamityMod.NPCs for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians2 * k); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center, vector255 * 0.75f, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 1f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, vector255 * 0.75f, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 1f, 0f); } } @@ -1171,7 +1171,7 @@ namespace CalamityMod.NPCs laserVelocity2.Normalize(); int type = ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), source, laserVelocity2, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, npc.whoAmI); + Projectile.NewProjectile(npc.GetSource_FromAI(), source, laserVelocity2, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, npc.whoAmI); } } } @@ -1204,7 +1204,7 @@ namespace CalamityMod.NPCs { if (npc.ai[1] < 150f && calamityGlobalNPC.newAI[0] == 0f) { - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), source, laserVelocity, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, npc.whoAmI); + Projectile.NewProjectile(npc.GetSource_FromAI(), source, laserVelocity, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, npc.whoAmI); calamityGlobalNPC.newAI[0] = 1f; } else @@ -1213,7 +1213,7 @@ namespace CalamityMod.NPCs { npc.localAI[0] = laserVelocity.X; npc.localAI[1] = laserVelocity.Y; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), source.X, source.Y, npc.localAI[0], npc.localAI[1], ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, npc.whoAmI); + Projectile.NewProjectile(npc.GetSource_FromAI(), source.X, source.Y, npc.localAI[0], npc.localAI[1], ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, npc.whoAmI); } } } @@ -1265,7 +1265,7 @@ namespace CalamityMod.NPCs int seekerDistance = death ? 180 : 150; for (int i = 0; i < seekerAmt; i++) { - int spawn = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(npc.Center.X + (Math.Sin(i * seekerSpread) * seekerDistance)), (int)(npc.Center.Y + (Math.Cos(i * seekerSpread) * seekerDistance)), ModContent.NPCType(), npc.whoAmI, 0, 0, 0, -1); + int spawn = NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X + (Math.Sin(i * seekerSpread) * seekerDistance)), (int)(npc.Center.Y + (Math.Cos(i * seekerSpread) * seekerDistance)), ModContent.NPCType(), npc.whoAmI, 0, 0, 0, -1); Main.npc[spawn].ai[0] = i * seekerSpread; } } @@ -1298,8 +1298,8 @@ namespace CalamityMod.NPCs } else if (calamityGlobalNPC.newAI[0] <= (float)npc.lifeMax * 0.4) { - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.Center.X, (int)npc.position.Y + npc.height, ModContent.NPCType(), npc.whoAmI); - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.Center.X, (int)npc.position.Y + npc.height, ModContent.NPCType(), npc.whoAmI); + NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.position.Y + npc.height, ModContent.NPCType(), npc.whoAmI); + NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.position.Y + npc.height, ModContent.NPCType(), npc.whoAmI); string key = "Mods.CalamityMod.CalamitasBossText2"; Color messageColor = Color.Orange; @@ -1572,17 +1572,17 @@ namespace CalamityMod.NPCs if (calamityGlobalNPC.newAI[3] <= 300f) { if (calamityGlobalNPC.newAI[3] % gigaBlastFrequency == 0f) // Blasts from top - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, projSpeed, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, projSpeed, type, damage, 0f, Main.myPlayer); } else if (calamityGlobalNPC.newAI[3] <= 600f && calamityGlobalNPC.newAI[3] > 300f) { if (calamityGlobalNPC.newAI[3] % gigaBlastFrequency == 0f) // Blasts from right - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -projSpeed, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -projSpeed, 0f, type, damage, 0f, Main.myPlayer); } else if (calamityGlobalNPC.newAI[3] > 600f) { if (calamityGlobalNPC.newAI[3] % gigaBlastFrequency == 0f) // Blasts from top - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, projSpeed, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, projSpeed, type, damage, 0f, Main.myPlayer); } } @@ -1598,22 +1598,22 @@ namespace CalamityMod.NPCs { float distance = Main.rand.NextBool() ? -1000f : 1000f; float velocity = distance == -1000f ? projSpeed : -projSpeed; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), player.position.X + distance, player.position.Y, velocity, 0f, type, damage, 0f, Main.myPlayer, 2f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), player.position.X + distance, player.position.Y, velocity, 0f, type, damage, 0f, Main.myPlayer, 2f, 0f); } if (calamityGlobalNPC.newAI[3] < 300f) // Blasts from above { - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, projSpeed, type, damage, 0f, Main.myPlayer, 2f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, projSpeed, type, damage, 0f, Main.myPlayer, 2f, 0f); } else if (calamityGlobalNPC.newAI[3] < 600f) // Blasts from left and right { - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -(projSpeed - 0.5f), 0f, type, damage, 0f, Main.myPlayer, 2f, 0f); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), projSpeed - 0.5f, 0f, type, damage, 0f, Main.myPlayer, 2f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -(projSpeed - 0.5f), 0f, type, damage, 0f, Main.myPlayer, 2f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), projSpeed - 0.5f, 0f, type, damage, 0f, Main.myPlayer, 2f, 0f); } else // Blasts from above, left, and right { - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, projSpeed - 1f, type, damage, 0f, Main.myPlayer, 2f, 0f); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -(projSpeed - 1f), 0f, type, damage, 0f, Main.myPlayer, 2f, 0f); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), projSpeed - 1f, 0f, type, damage, 0f, Main.myPlayer, 2f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, projSpeed - 1f, type, damage, 0f, Main.myPlayer, 2f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -(projSpeed - 1f), 0f, type, damage, 0f, Main.myPlayer, 2f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), projSpeed - 1f, 0f, type, damage, 0f, Main.myPlayer, 2f, 0f); } } } @@ -1734,7 +1734,7 @@ namespace CalamityMod.NPCs int damage = npc.GetProjectileDamage(type); Vector2 fireballVelocity = Vector2.Normalize(player.Center - npc.Center) * projectileVelocity; Vector2 offset = Vector2.Normalize(fireballVelocity) * 40f; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center + offset, fireballVelocity, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, player.Center.X, player.Center.Y); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + offset, fireballVelocity, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, player.Center.X, player.Center.Y); } } } @@ -1768,12 +1768,12 @@ namespace CalamityMod.NPCs { type = ModContent.ProjectileType(); damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center + offset, fireballVelocity, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, player.Center.X, player.Center.Y); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + offset, fireballVelocity, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, player.Center.X, player.Center.Y); } else { float ai0 = type == ModContent.ProjectileType() ? 1f : 0f; - int proj = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center + offset, fireballVelocity, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, ai0, 0f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + offset, fireballVelocity, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, ai0, 0f); if (type == ModContent.ProjectileType()) Main.projectile[proj].tileCollide = true; } @@ -1836,7 +1836,7 @@ namespace CalamityMod.NPCs int type = ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(type); Vector2 fireballVelocity = npc.velocity * 0.01f; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center, fireballVelocity, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 1f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, fireballVelocity, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 1f, 0f); } } @@ -2087,7 +2087,7 @@ namespace CalamityMod.NPCs num864 += npc.velocity.X * 0.5f; vector86.X -= num864; vector86.Y -= num865; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector86.X, vector86.Y, num864, num865, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector86.X, vector86.Y, num864, num865, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); } } } @@ -2368,7 +2368,7 @@ namespace CalamityMod.NPCs num864 += npc.velocity.X * 0.5f; vector86.X -= num864; vector86.Y -= num865; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector86.X, vector86.Y, num864, num865, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector86.X, vector86.Y, num864, num865, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); } } } @@ -2551,7 +2551,7 @@ namespace CalamityMod.NPCs float randomSpread = (Main.rand.NextFloat() - 0.5f) * spreadLimit; Vector2 spawnVector = new Vector2(npc.Center.X, npc.Center.Y - 80f); Vector2 destination = new Vector2(spawnVector.X + randomSpread, spawnVector.Y - 100f); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center, Vector2.Normalize(destination - npc.Center) * velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, Vector2.Normalize(destination - npc.Center) * velocity, type, damage, 0f, Main.myPlayer); } npc.netUpdate = true; @@ -2601,7 +2601,7 @@ namespace CalamityMod.NPCs num182 += Main.rand.Next(-spread, spread + 1); num180 *= num183; num182 *= num183; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer); } npc.netUpdate = true; @@ -2881,7 +2881,7 @@ namespace CalamityMod.NPCs num182 += Main.rand.Next(-spread, spread + 1); num180 *= num183; num182 *= num183; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); } npc.netUpdate = true; @@ -2973,7 +2973,7 @@ namespace CalamityMod.NPCs if (spawnFlag && Main.netMode != NetmodeID.MultiplayerClient) { - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.Center.X, (int)npc.Center.Y - 25, ModContent.NPCType()); + NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y - 25, ModContent.NPCType()); if (death) { @@ -3077,7 +3077,7 @@ namespace CalamityMod.NPCs if (spawnFlag && Main.netMode != NetmodeID.MultiplayerClient) { - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.Center.X, (int)npc.Center.Y - 25, ModContent.NPCType()); + NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y - 25, ModContent.NPCType()); if (death) { @@ -3297,7 +3297,7 @@ namespace CalamityMod.NPCs // Now that the original worm doesn't exist, startCount can be zero. // int startCount = npc.whoAmI + phase1Length + 1; int startIndexHeadOne = 1; - int headOneID = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.Center.X, (int)npc.Center.Y, npc.type, startIndexHeadOne); + int headOneID = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, npc.type, startIndexHeadOne); Main.npc[headOneID].Calamity().newAI[0] = 1f; Main.npc[headOneID].velocity = Vector2.Normalize(player.Center - Main.npc[headOneID].Center) * 16f; Main.npc[headOneID].timeLeft *= 20; @@ -3318,7 +3318,7 @@ namespace CalamityMod.NPCs // Make sure the second split worm is also contiguous. int startIndexHeadTwo = startIndexHeadOne + phase2Length + 1; - int headTwoID = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.Center.X, (int)npc.Center.Y, npc.type, startIndexHeadTwo); + int headTwoID = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, npc.type, startIndexHeadTwo); Main.npc[headTwoID].Calamity().newAI[0] = 2f; Main.npc[headTwoID].Calamity().newAI[3] = 600f; Main.npc[headTwoID].velocity = Vector2.Normalize(player.Center - Main.npc[headTwoID].Center) * 16f; @@ -3422,9 +3422,9 @@ namespace CalamityMod.NPCs { int lol; if (num36 >= 0 && num36 < maxLength - 1) - lol = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.height / 2), bodyType, npc.whoAmI); + lol = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.height / 2), bodyType, npc.whoAmI); else - lol = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.height / 2), tailType, npc.whoAmI); + lol = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.height / 2), tailType, npc.whoAmI); if (num36 % 2 == 0) Main.npc[lol].localAI[3] = 1f; @@ -3786,7 +3786,7 @@ namespace CalamityMod.NPCs int type = ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(type); float split = (splittingMines && npc.ai[0] % 3f == 0f) ? 1f : 0f; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center, velocity, type, damage, 0f, Main.myPlayer, split, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, velocity, type, damage, 0f, Main.myPlayer, split, 0f); } if (Vector2.Distance(player.Center, npc.Center) > 80f) @@ -3815,14 +3815,14 @@ namespace CalamityMod.NPCs for (int i = -1; i <= 1; i += 2) { Vector2 laserStartPos = vector104 + i * perp + Main.rand.NextVector2CircularEdge(6f, 6f); - Projectile godRay = Projectile.NewProjectileDirect(npc.GetSpawnSource_ForProjectile(), laserStartPos, laserVelocity * 1.1f, type, damage, 0f, Main.myPlayer, player.Center.X, player.Center.Y); + Projectile godRay = Projectile.NewProjectileDirect(npc.GetSource_FromAI(), laserStartPos, laserVelocity * 1.1f, type, damage, 0f, Main.myPlayer, player.Center.X, player.Center.Y); // Tell this Phased God Ray exactly which way it should be waving. godRay.localAI[1] = i * 0.5f; } } else - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector104, laserVelocity, type, damage, 0f, Main.myPlayer, player.Center.X, player.Center.Y); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector104, laserVelocity, type, damage, 0f, Main.myPlayer, player.Center.X, player.Center.Y); } } } @@ -3841,7 +3841,7 @@ namespace CalamityMod.NPCs int type = ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(type); float split = (splittingMines && npc.ai[0] % 3f == 0f) ? 1f : 0f; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center, velocity, type, damage, 0f, Main.myPlayer, split, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, velocity, type, damage, 0f, Main.myPlayer, split, 0f); } } } @@ -3930,12 +3930,12 @@ namespace CalamityMod.NPCs npc.ai[2] = 1f; for (int i = 0; i < darkEnergyAmt; i++) { - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(vector.X + (Math.Sin(i * spacing) * distance2)), (int)(vector.Y + (Math.Cos(i * spacing) * distance2)), ModContent.NPCType(), npc.whoAmI, i * spacing, 0f, 0f, 0f); - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(vector.X + (Math.Sin(i * spacing) * distance2)), (int)(vector.Y + (Math.Cos(i * spacing) * distance2)), ModContent.NPCType(), npc.whoAmI, i * spacing, 1f, 0f, 0f); - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(vector.X + (Math.Sin(i * spacing) * distance2)), (int)(vector.Y + (Math.Cos(i * spacing) * distance2)), ModContent.NPCType(), npc.whoAmI, i * spacing, 2f, 0f, 0f); + NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X + (Math.Sin(i * spacing) * distance2)), (int)(vector.Y + (Math.Cos(i * spacing) * distance2)), ModContent.NPCType(), npc.whoAmI, i * spacing, 0f, 0f, 0f); + NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X + (Math.Sin(i * spacing) * distance2)), (int)(vector.Y + (Math.Cos(i * spacing) * distance2)), ModContent.NPCType(), npc.whoAmI, i * spacing, 1f, 0f, 0f); + NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X + (Math.Sin(i * spacing) * distance2)), (int)(vector.Y + (Math.Cos(i * spacing) * distance2)), ModContent.NPCType(), npc.whoAmI, i * spacing, 2f, 0f, 0f); } - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(vector.X + (Math.Sin(0) * distance2)), (int)(vector.Y + (Math.Cos(0) * distance2)), ModContent.NPCType(), npc.whoAmI, 0f, 0.5f, 0f, 0f); - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(vector.X + (Math.Sin(0) * distance2)), (int)(vector.Y + (Math.Cos(0) * distance2)), ModContent.NPCType(), npc.whoAmI, 0f, 1.5f, 0f, 0f); + NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X + (Math.Sin(0) * distance2)), (int)(vector.Y + (Math.Cos(0) * distance2)), ModContent.NPCType(), npc.whoAmI, 0f, 0.5f, 0f, 0f); + NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X + (Math.Sin(0) * distance2)), (int)(vector.Y + (Math.Cos(0) * distance2)), ModContent.NPCType(), npc.whoAmI, 0f, 1.5f, 0f, 0f); } // If there are any Dark Energies alive, change AI and don't take damage @@ -4123,7 +4123,7 @@ namespace CalamityMod.NPCs for (int i = 0; i < numBeamPortals; i++) { float ai1 = i * degrees; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), player.Center.X + (float)(Math.Sin(i * degrees) * beamPortalDistance), player.Center.Y + (float)(Math.Cos(i * degrees) * beamPortalDistance), 0f, 0f, type, damage, 0f, player.whoAmI, ai1, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), player.Center.X + (float)(Math.Sin(i * degrees) * beamPortalDistance), player.Center.Y + (float)(Math.Cos(i * degrees) * beamPortalDistance), 0f, 0f, type, damage, 0f, player.whoAmI, ai1, 0f); } } @@ -4159,7 +4159,7 @@ namespace CalamityMod.NPCs { Vector2 spawnVector = vector + Vector2.Normalize(spinningPoint.RotatedBy(radians * i + radialOffset)) * suckDistance; Vector2 velocity = Vector2.Normalize(vector - spawnVector) * speed; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), spawnVector, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), spawnVector, velocity, type, damage, 0f, Main.myPlayer); } npc.localAI[1] += 10f; } @@ -4186,7 +4186,7 @@ namespace CalamityMod.NPCs { Vector2 spawnVector = vector + Vector2.Normalize(spinningPoint.RotatedBy(radians * i + radialOffset)) * suckDistance; Vector2 velocity = Vector2.Normalize(vector - spawnVector) * speed; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), spawnVector, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), spawnVector, velocity, type, damage, 0f, Main.myPlayer); } } } @@ -4213,7 +4213,7 @@ namespace CalamityMod.NPCs { Vector2 spawnVector = vector + Vector2.Normalize(spinningPoint.RotatedBy(radians * i + radialOffset)) * suckDistance; Vector2 velocity = Vector2.Normalize(vector - spawnVector) * speed; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), spawnVector, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), spawnVector, velocity, type, damage, 0f, Main.myPlayer); } } } @@ -4411,34 +4411,34 @@ namespace CalamityMod.NPCs { for (int i = 0; i < darkEnergyAmt; i++) { - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(vector.X + (Math.Sin(i * spacing) * distance2)), (int)(vector.Y + (Math.Cos(i * spacing) * distance2)), ModContent.NPCType(), npc.whoAmI, i * spacing, 0f, 0f, 0f); - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(vector.X + (Math.Sin(i * spacing) * distance2)), (int)(vector.Y + (Math.Cos(i * spacing) * distance2)), ModContent.NPCType(), npc.whoAmI, i * spacing, 2f, 0f, 0f); - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(vector.X + (Math.Sin(i * spacing) * distance2)), (int)(vector.Y + (Math.Cos(i * spacing) * distance2)), ModContent.NPCType(), npc.whoAmI, i * spacing, 4f, 0f, 0f); + NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X + (Math.Sin(i * spacing) * distance2)), (int)(vector.Y + (Math.Cos(i * spacing) * distance2)), ModContent.NPCType(), npc.whoAmI, i * spacing, 0f, 0f, 0f); + NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X + (Math.Sin(i * spacing) * distance2)), (int)(vector.Y + (Math.Cos(i * spacing) * distance2)), ModContent.NPCType(), npc.whoAmI, i * spacing, 2f, 0f, 0f); + NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X + (Math.Sin(i * spacing) * distance2)), (int)(vector.Y + (Math.Cos(i * spacing) * distance2)), ModContent.NPCType(), npc.whoAmI, i * spacing, 4f, 0f, 0f); } - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(vector.X + (Math.Sin(0) * distance2)), (int)(vector.Y + (Math.Cos(0) * distance2)), ModContent.NPCType(), npc.whoAmI, 0f, 1f, 0f, 0f); - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(vector.X + (Math.Sin(0) * distance2)), (int)(vector.Y + (Math.Cos(0) * distance2)), ModContent.NPCType(), npc.whoAmI, 0f, 3f, 0f, 0f); + NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X + (Math.Sin(0) * distance2)), (int)(vector.Y + (Math.Cos(0) * distance2)), ModContent.NPCType(), npc.whoAmI, 0f, 1f, 0f, 0f); + NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X + (Math.Sin(0) * distance2)), (int)(vector.Y + (Math.Cos(0) * distance2)), ModContent.NPCType(), npc.whoAmI, 0f, 3f, 0f, 0f); } else if (phase3) { for (int i = 0; i < darkEnergyAmt; i++) { - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(vector.X + (Math.Sin(i * spacing) * distance2)), (int)(vector.Y + (Math.Cos(i * spacing) * distance2)), ModContent.NPCType(), npc.whoAmI, i * spacing, 0f, 0f, 0f); - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(vector.X + (Math.Sin(i * spacing) * distance2)), (int)(vector.Y + (Math.Cos(i * spacing) * distance2)), ModContent.NPCType(), npc.whoAmI, i * spacing, 1.5f, 0f, 0f); - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(vector.X + (Math.Sin(i * spacing) * distance2)), (int)(vector.Y + (Math.Cos(i * spacing) * distance2)), ModContent.NPCType(), npc.whoAmI, i * spacing, 3f, 0f, 0f); + NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X + (Math.Sin(i * spacing) * distance2)), (int)(vector.Y + (Math.Cos(i * spacing) * distance2)), ModContent.NPCType(), npc.whoAmI, i * spacing, 0f, 0f, 0f); + NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X + (Math.Sin(i * spacing) * distance2)), (int)(vector.Y + (Math.Cos(i * spacing) * distance2)), ModContent.NPCType(), npc.whoAmI, i * spacing, 1.5f, 0f, 0f); + NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X + (Math.Sin(i * spacing) * distance2)), (int)(vector.Y + (Math.Cos(i * spacing) * distance2)), ModContent.NPCType(), npc.whoAmI, i * spacing, 3f, 0f, 0f); } - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(vector.X + (Math.Sin(0) * distance2)), (int)(vector.Y + (Math.Cos(0) * distance2)), ModContent.NPCType(), npc.whoAmI, 0f, 0.5f, 0f, 0f); - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(vector.X + (Math.Sin(0) * distance2)), (int)(vector.Y + (Math.Cos(0) * distance2)), ModContent.NPCType(), npc.whoAmI, 0f, 2f, 0f, 0f); + NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X + (Math.Sin(0) * distance2)), (int)(vector.Y + (Math.Cos(0) * distance2)), ModContent.NPCType(), npc.whoAmI, 0f, 0.5f, 0f, 0f); + NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X + (Math.Sin(0) * distance2)), (int)(vector.Y + (Math.Cos(0) * distance2)), ModContent.NPCType(), npc.whoAmI, 0f, 2f, 0f, 0f); } else { for (int i = 0; i < darkEnergyAmt; i++) { - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(vector.X + (Math.Sin(i * spacing) * distance2)), (int)(vector.Y + (Math.Cos(i * spacing) * distance2)), ModContent.NPCType(), npc.whoAmI, i * spacing, 0f, 0f, 0f); - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(vector.X + (Math.Sin(i * spacing) * distance2)), (int)(vector.Y + (Math.Cos(i * spacing) * distance2)), ModContent.NPCType(), npc.whoAmI, i * spacing, 1f, 0f, 0f); - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(vector.X + (Math.Sin(i * spacing) * distance2)), (int)(vector.Y + (Math.Cos(i * spacing) * distance2)), ModContent.NPCType(), npc.whoAmI, i * spacing, 2f, 0f, 0f); + NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X + (Math.Sin(i * spacing) * distance2)), (int)(vector.Y + (Math.Cos(i * spacing) * distance2)), ModContent.NPCType(), npc.whoAmI, i * spacing, 0f, 0f, 0f); + NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X + (Math.Sin(i * spacing) * distance2)), (int)(vector.Y + (Math.Cos(i * spacing) * distance2)), ModContent.NPCType(), npc.whoAmI, i * spacing, 1f, 0f, 0f); + NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X + (Math.Sin(i * spacing) * distance2)), (int)(vector.Y + (Math.Cos(i * spacing) * distance2)), ModContent.NPCType(), npc.whoAmI, i * spacing, 2f, 0f, 0f); } - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(vector.X + (Math.Sin(0) * distance2)), (int)(vector.Y + (Math.Cos(0) * distance2)), ModContent.NPCType(), npc.whoAmI, 0f, 1.5f, 0f, 0f); - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(vector.X + (Math.Sin(0) * distance2)), (int)(vector.Y + (Math.Cos(0) * distance2)), ModContent.NPCType(), npc.whoAmI, 0f, 2.5f, 0f, 0f); + NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X + (Math.Sin(0) * distance2)), (int)(vector.Y + (Math.Cos(0) * distance2)), ModContent.NPCType(), npc.whoAmI, 0f, 1.5f, 0f, 0f); + NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X + (Math.Sin(0) * distance2)), (int)(vector.Y + (Math.Cos(0) * distance2)), ModContent.NPCType(), npc.whoAmI, 0f, 2.5f, 0f, 0f); } // Despawn potentially hazardous projectiles when entering a new phase @@ -4776,7 +4776,7 @@ namespace CalamityMod.NPCs { Vector2 spawnVector = player.Center + Vector2.Normalize(new Vector2(0f, -featherVelocity).RotatedBy(radians * i)) * distance; Vector2 velocity = Vector2.Normalize(player.Center - spawnVector) * featherVelocity; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), spawnVector, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), spawnVector, velocity, type, damage, 0f, Main.myPlayer); } } else @@ -4785,7 +4785,7 @@ namespace CalamityMod.NPCs { Vector2 spawnVector = player.Center + Vector2.Normalize(new Vector2(0f, -featherVelocity).RotatedBy(radians * i)) * distance; Vector2 velocity = Vector2.Normalize(player.Center - spawnVector) * featherVelocity; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), spawnVector, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), spawnVector, velocity, type, damage, 0f, Main.myPlayer); } } } @@ -4826,7 +4826,7 @@ namespace CalamityMod.NPCs Vector2 spawnVector = player.Center + Vector2.Normalize(new Vector2(0f, -featherVelocity).RotatedBy(radians * i)) * distance; Vector2 velocity = Vector2.Normalize(player.Center - spawnVector) * featherVelocity; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), spawnVector, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), spawnVector, velocity, type, damage, 0f, Main.myPlayer); } else { @@ -4834,7 +4834,7 @@ namespace CalamityMod.NPCs { Vector2 spawnVector = player.Center + Vector2.Normalize(new Vector2(0f, -featherVelocity).RotatedBy(radians * i)) * distance; Vector2 velocity = Vector2.Normalize(player.Center - spawnVector) * featherVelocity; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), spawnVector, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), spawnVector, velocity, type, damage, 0f, Main.myPlayer); } } } @@ -5088,7 +5088,7 @@ namespace CalamityMod.NPCs { Vector2 vector7 = npc.Center + (MathHelper.TwoPi * Main.rand.NextFloat()).ToRotationVector2() * new Vector2(2f, 1f) * 50f * (0.6f + Main.rand.NextFloat() * 0.4f); if (Vector2.Distance(vector7, player.Center) > 150f) - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)vector7.X, (int)vector7.Y, ModContent.NPCType(), npc.whoAmI); + NPC.NewNPC(npc.GetSource_FromAI(), (int)vector7.X, (int)vector7.Y, ModContent.NPCType(), npc.whoAmI); npc.netUpdate = true; } } @@ -5125,7 +5125,7 @@ namespace CalamityMod.NPCs float ai0 = (phase3 ? 2f : 0f) + (enrageScale - 1f); if (ai0 > 3f) ai0 = 3f; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector7.X, vector7.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, ai0, npc.target + 1); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector7.X, vector7.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, ai0, npc.target + 1); npc.netUpdate = true; } } @@ -5899,7 +5899,7 @@ namespace CalamityMod.NPCs if (Main.netMode != NetmodeID.MultiplayerClient) { Vector2 vector6 = Vector2.Normalize(player.Center - vector) * (npc.width + 20) / 2f + vector; - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)vector6.X, (int)vector6.Y + 45, ModContent.NPCType()); + NPC.NewNPC(npc.GetSource_FromAI(), (int)vector6.X, (int)vector6.Y + 45, ModContent.NPCType()); } } @@ -5941,8 +5941,8 @@ namespace CalamityMod.NPCs if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] % 18f == 0f) { calamityGlobalNPC.newAI[2] += 100f; - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(vector.X + 900f), (int)(vector.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, npc.whoAmI, 0f, 255); - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(vector.X - 900f), (int)(vector.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, npc.whoAmI, 0f, 255); + NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X + 900f), (int)(vector.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, npc.whoAmI, 0f, 255); + NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X - 900f), (int)(vector.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, npc.whoAmI, 0f, 255); } } @@ -5975,8 +5975,8 @@ namespace CalamityMod.NPCs if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] % 18f == 0f) { calamityGlobalNPC.newAI[2] += 150f; - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(vector.X + 50f + calamityGlobalNPC.newAI[2]), (int)(vector.Y + 540f), ModContent.NPCType(), 0, 0f, 0f, 1f, -sharkronVelocity, 255); - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(vector.X - 50f - calamityGlobalNPC.newAI[2]), (int)(vector.Y + 540f), ModContent.NPCType(), 0, 0f, 0f, -1f, -sharkronVelocity, 255); + NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X + 50f + calamityGlobalNPC.newAI[2]), (int)(vector.Y + 540f), ModContent.NPCType(), 0, 0f, 0f, 1f, -sharkronVelocity, 255); + NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X - 50f - calamityGlobalNPC.newAI[2]), (int)(vector.Y + 540f), ModContent.NPCType(), 0, 0f, 0f, -1f, -sharkronVelocity, 255); } } @@ -6160,7 +6160,7 @@ namespace CalamityMod.NPCs Vector2 vortexSpawn = vector + npc.velocity.RotatedBy(MathHelper.PiOver2 * -npc.direction) * spinTime / MathHelper.TwoPi; if (Main.netMode != NetmodeID.MultiplayerClient) { - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vortexSpawn, Vector2.Zero, type, damage, 0f, Main.myPlayer, vortexSpawn.X, vortexSpawn.Y); + Projectile.NewProjectile(npc.GetSource_FromAI(), vortexSpawn, Vector2.Zero, type, damage, 0f, Main.myPlayer, vortexSpawn.X, vortexSpawn.Y); } } @@ -6172,7 +6172,7 @@ namespace CalamityMod.NPCs if (Main.netMode != NetmodeID.MultiplayerClient) { Vector2 vector10 = Vector2.Normalize(npc.velocity) * (npc.width + 20) / 2f + vector; - int num31 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)vector10.X, (int)vector10.Y + 45, ModContent.NPCType()); + int num31 = NPC.NewNPC(npc.GetSource_FromAI(), (int)vector10.X, (int)vector10.Y + 45, ModContent.NPCType()); Main.npc[num31].target = npc.target; Main.npc[num31].velocity = Vector2.Normalize(npc.velocity).RotatedBy(MathHelper.PiOver2 * npc.direction) * toothBallSpinToothBallVelocity; Main.npc[num31].netUpdate = true; @@ -6217,7 +6217,7 @@ namespace CalamityMod.NPCs { float velocityX = npc.direction * goreVelocityX * (Main.rand.NextFloat() + 0.5f); float velocityY = goreVelocityY * (Main.rand.NextFloat() + 0.5f); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector7.X, vector7.Y, velocityX, -velocityY, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector7.X, vector7.Y, velocityX, -velocityY, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -6228,8 +6228,8 @@ namespace CalamityMod.NPCs { calamityGlobalNPC.newAI[2] += 100f; float x = 900f - calamityGlobalNPC.newAI[2]; - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(vector.X + x), (int)(vector.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, npc.whoAmI, 0f, 255); - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(vector.X - x), (int)(vector.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, npc.whoAmI, 0f, 255); + NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X + x), (int)(vector.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, npc.whoAmI, 0f, 255); + NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X - x), (int)(vector.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, npc.whoAmI, 0f, 255); } } @@ -6262,8 +6262,8 @@ namespace CalamityMod.NPCs if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] % 18f == 0f) { calamityGlobalNPC.newAI[2] += 200f; - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(vector.X + 50f + calamityGlobalNPC.newAI[2]), (int)(vector.Y - 540f), ModContent.NPCType(), 0, 0f, 0f, 1f, sharkronVelocity, 255); - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(vector.X - 50f - calamityGlobalNPC.newAI[2]), (int)(vector.Y - 540f), ModContent.NPCType(), 0, 0f, 0f, -1f, sharkronVelocity, 255); + NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X + 50f + calamityGlobalNPC.newAI[2]), (int)(vector.Y - 540f), ModContent.NPCType(), 0, 0f, 0f, 1f, sharkronVelocity, 255); + NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X - 50f - calamityGlobalNPC.newAI[2]), (int)(vector.Y - 540f), ModContent.NPCType(), 0, 0f, 0f, -1f, sharkronVelocity, 255); } } @@ -6529,7 +6529,7 @@ namespace CalamityMod.NPCs { float velocityX = npc.direction * goreVelocityX * (Main.rand.NextFloat() + 0.5f); float velocityY = goreVelocityY * (Main.rand.NextFloat() + 0.5f); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector7.X, vector7.Y, velocityX, -velocityY, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector7.X, vector7.Y, velocityX, -velocityY, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -6540,8 +6540,8 @@ namespace CalamityMod.NPCs { calamityGlobalNPC.newAI[2] += 150f; float x = 900f - calamityGlobalNPC.newAI[2]; - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(vector.X + x), (int)(vector.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, npc.whoAmI, 0f, 255); - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(vector.X - x), (int)(vector.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, npc.whoAmI, 0f, 255); + NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X + x), (int)(vector.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, npc.whoAmI, 0f, 255); + NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X - x), (int)(vector.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, npc.whoAmI, 0f, 255); } } @@ -6571,7 +6571,7 @@ namespace CalamityMod.NPCs Vector2 vortexSpawn = vector + npc.velocity.RotatedBy(MathHelper.PiOver2 * -npc.direction) * spinTime / MathHelper.TwoPi; if (Main.netMode != NetmodeID.MultiplayerClient) { - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vortexSpawn, Vector2.Zero, type, damage, 0f, Main.myPlayer, vortexSpawn.X, vortexSpawn.Y); + Projectile.NewProjectile(npc.GetSource_FromAI(), vortexSpawn, Vector2.Zero, type, damage, 0f, Main.myPlayer, vortexSpawn.X, vortexSpawn.Y); } } @@ -6583,7 +6583,7 @@ namespace CalamityMod.NPCs if (Main.netMode != NetmodeID.MultiplayerClient) { Vector2 vector10 = Vector2.Normalize(npc.velocity) * (npc.width + 20) / 2f + vector; - int num31 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)vector10.X, (int)vector10.Y + 45, ModContent.NPCType()); + int num31 = NPC.NewNPC(npc.GetSource_FromAI(), (int)vector10.X, (int)vector10.Y + 45, ModContent.NPCType()); Main.npc[num31].target = npc.target; Main.npc[num31].velocity = Vector2.Normalize(npc.velocity).RotatedBy(MathHelper.PiOver2 * npc.direction) * toothBallSpinToothBallVelocity; Main.npc[num31].netUpdate = true; @@ -6749,11 +6749,11 @@ namespace CalamityMod.NPCs for (int i = 0; i < 3; i++) { Vector2 vector = new Vector2(0f, -3f).RotatedBy(radians * i); - int proj = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vectorCenter, vector, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 8f, 0f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), vectorCenter, vector, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 8f, 0f); Main.projectile[proj].scale = 4f; } - //Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vectorCenter.X, vectorCenter.Y, num743, num744, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 4f, 0f); + //Projectile.NewProjectile(npc.GetSource_FromAI(), vectorCenter.X, vectorCenter.Y, num743, num744, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 4f, 0f); int numProj = 4; int spread = 45; @@ -6766,7 +6766,7 @@ namespace CalamityMod.NPCs for (int i = 0; i < numProj; i++) { offsetAngle = startAngle + deltaAngle * i; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vectorCenter.X, vectorCenter.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 10f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), vectorCenter.X, vectorCenter.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 10f, 0f); } } } @@ -6868,7 +6868,7 @@ namespace CalamityMod.NPCs { float radians = j - velocityMult; Vector2 offset = velocity.RotatedBy(offsetAngle * radians, default); - int proj = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vectorCenter + offset, targetVector * (1f - (Math.Abs(radians) / half * scalar)), ModContent.ProjectileType(), damage, 0f, Main.myPlayer, -1f, 0f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), vectorCenter + offset, targetVector * (1f - (Math.Abs(radians) / half * scalar)), ModContent.ProjectileType(), damage, 0f, Main.myPlayer, -1f, 0f); } } @@ -6892,7 +6892,7 @@ namespace CalamityMod.NPCs { float radians = j - (totalProjectiles - 1f) / 2f; Vector2 offset = velocity.RotatedBy(offsetAngle * radians, default); - int proj = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vectorCenter + offset, targetVector, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, -1f, 0f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), vectorCenter + offset, targetVector, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, -1f, 0f); } } @@ -6902,7 +6902,7 @@ namespace CalamityMod.NPCs offsetAngle = 360 / totalProjectiles; for (int i = 0; i < totalProjectiles; i++) { - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vectorCenter, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 15f, i * offsetAngle); + Projectile.NewProjectile(npc.GetSource_FromAI(), vectorCenter, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 15f, i * offsetAngle); } totalProjectiles = 16; @@ -6914,7 +6914,7 @@ namespace CalamityMod.NPCs for (int i = 0; i < totalProjectiles; i++) { Vector2 vector = new Vector2(0f, -3f).RotatedBy(radians * i, default); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vectorCenter, vector, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 16f, j * velocityTimer); + Projectile.NewProjectile(npc.GetSource_FromAI(), vectorCenter, vector, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 16f, j * velocityTimer); j++; if (j % 4 == 0) @@ -6938,7 +6938,7 @@ namespace CalamityMod.NPCs for (int i = 0; i < chains; i++) { Vector2 vector = new Vector2(0f, -3f).RotatedBy(radians * i + radialOffset, default); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vectorCenter, vector, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 3f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), vectorCenter, vector, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 3f, 0f); } // Radial offset @@ -6955,8 +6955,8 @@ namespace CalamityMod.NPCs for (int i = 0; i < totalProjectiles; i++) { - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vectorCenter, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, i * offsetAngle); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vectorCenter, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 12f, i * offsetAngle); + Projectile.NewProjectile(npc.GetSource_FromAI(), vectorCenter, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, i * offsetAngle); + Projectile.NewProjectile(npc.GetSource_FromAI(), vectorCenter, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 12f, i * offsetAngle); } }*/ } @@ -7058,8 +7058,8 @@ namespace CalamityMod.NPCs for (i = 0; i < 2; i++) { offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + radialOffset * i; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), source.X, source.Y, (float)Math.Sin(offsetAngle), (float)Math.Cos(offsetAngle), ModContent.ProjectileType(), 40, 0f, Main.myPlayer, 1f, npc.whoAmI); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), source.X, source.Y, (float)-Math.Sin(offsetAngle), (float)-Math.Cos(offsetAngle), ModContent.ProjectileType(), 40, 0f, Main.myPlayer, 1f, npc.whoAmI); + Projectile.NewProjectile(npc.GetSource_FromAI(), source.X, source.Y, (float)Math.Sin(offsetAngle), (float)Math.Cos(offsetAngle), ModContent.ProjectileType(), 40, 0f, Main.myPlayer, 1f, npc.whoAmI); + Projectile.NewProjectile(npc.GetSource_FromAI(), source.X, source.Y, (float)-Math.Sin(offsetAngle), (float)-Math.Cos(offsetAngle), ModContent.ProjectileType(), 40, 0f, Main.myPlayer, 1f, npc.whoAmI); } } } @@ -7091,7 +7091,7 @@ namespace CalamityMod.NPCs { if (npc.ai[1] < 150f && calamityGlobalNPC.newAI[0] == 0f) { - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), source, laserVelocity, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, npc.whoAmI); + Projectile.NewProjectile(npc.GetSource_FromAI(), source, laserVelocity, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, npc.whoAmI); calamityGlobalNPC.newAI[0] = 1f; } else @@ -7114,8 +7114,8 @@ namespace CalamityMod.NPCs for (i = 0; i < 2; i++) { offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + radialOffset * i; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), source.X, source.Y, (float)Math.Sin(offsetAngle), (float)Math.Cos(offsetAngle), ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, npc.whoAmI); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), source.X, source.Y, (float)-Math.Sin(offsetAngle), (float)-Math.Cos(offsetAngle), ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, npc.whoAmI); + Projectile.NewProjectile(npc.GetSource_FromAI(), source.X, source.Y, (float)Math.Sin(offsetAngle), (float)Math.Cos(offsetAngle), ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, npc.whoAmI); + Projectile.NewProjectile(npc.GetSource_FromAI(), source.X, source.Y, (float)-Math.Sin(offsetAngle), (float)-Math.Cos(offsetAngle), ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, npc.whoAmI); } } } @@ -7703,7 +7703,7 @@ namespace CalamityMod.NPCs { damage = 40; } - int beam = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center.X + (npc.spriteDirection == 1 ? 25f : -25f), npc.Center.Y + (Main.player[npc.target].position.Y > npc.Center.Y ? 5f : -5f), num6, num7, ProjectileID.EyeBeam, damage, 0f, Main.myPlayer, 0f, 0f); + int beam = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X + (npc.spriteDirection == 1 ? 25f : -25f), npc.Center.Y + (Main.player[npc.target].position.Y > npc.Center.Y ? 5f : -5f), num6, num7, ProjectileID.EyeBeam, damage, 0f, Main.myPlayer, 0f, 0f); Main.projectile[beam].tileCollide = true; } } @@ -7731,7 +7731,7 @@ namespace CalamityMod.NPCs { damage = 25; } - int beam = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center.X + (npc.spriteDirection == 1 ? 10f : -10f), npc.Center.Y, num6, num7, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + int beam = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X + (npc.spriteDirection == 1 ? 10f : -10f), npc.Center.Y, num6, num7, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); } } } diff --git a/NPCs/CalamityGlobalAI.cs b/NPCs/CalamityGlobalAI.cs index 75f2095d63..b23fd91825 100644 --- a/NPCs/CalamityGlobalAI.cs +++ b/NPCs/CalamityGlobalAI.cs @@ -357,7 +357,7 @@ namespace CalamityMod.NPCs if (npcType == NPCID.MartianOfficer && npc.ai[2] == 0f && npc.localAI[0] == 0f && Main.netMode != NetmodeID.MultiplayerClient) { // If Martian Officer is ready to generate shield, generate it. - int shield = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.ForceBubble, npc.whoAmI, 0f, 0f, 0f, 0f, 255); + int shield = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.ForceBubble, npc.whoAmI, 0f, 0f, 0f, 0f, 255); npc.ai[2] = (float)(shield + 1); npc.localAI[0] = -1f; npc.netUpdate = true; @@ -545,7 +545,7 @@ namespace CalamityMod.NPCs npc.localAI[3] = 0f; Vector2 spawnPosition = npc.Center; spawnPosition += npc.velocity; - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)spawnPosition.X, (int)spawnPosition.Y, NPCID.ChaosBall); + NPC.NewNPC(npc.GetSource_FromAI(), (int)spawnPosition.X, (int)spawnPosition.Y, NPCID.ChaosBall); } } } @@ -686,7 +686,7 @@ namespace CalamityMod.NPCs { if (Main.netMode != NetmodeID.MultiplayerClient) { - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)spawnPosiion.X, (int)spawnPosiion.Y + 18, NPCID.ShadowFlameApparition, 0, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC(npc.GetSource_FromAI(), (int)spawnPosiion.X, (int)spawnPosiion.Y + 18, NPCID.ShadowFlameApparition, 0, 0f, 0f, 0f, 0f, 255); } } else if (npc.ai[2] >= 90f) @@ -877,7 +877,7 @@ namespace CalamityMod.NPCs } if (Main.netMode != NetmodeID.MultiplayerClient) { - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.Center.X + npc.spriteDirection * 45, (int)npc.Center.Y + 8, NPCID.SolarFlare, 0, 0f, 0f, 0f, 0f, npc.target); + NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X + npc.spriteDirection * 45, (int)npc.Center.Y + 8, NPCID.SolarFlare, 0, 0f, 0f, 0f, 0f, npc.target); } } return false; @@ -1182,7 +1182,7 @@ namespace CalamityMod.NPCs nailVelocity = npc.SafeDirectionTo(Main.npc[players[i]].Center, -Vector2.UnitY) * velocityMultiplier; } - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center + Vector2.UnitY * (npc.width / 4), nailVelocity, ProjectileID.Nail, (int)(npc.damage * 0.15), 1f, 255, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + Vector2.UnitY * (npc.width / 4), nailVelocity, ProjectileID.Nail, (int)(npc.damage * 0.15), 1f, 255, 0f, 0f); } } } @@ -2057,7 +2057,7 @@ namespace CalamityMod.NPCs for (int i = 0; i < 4; i++) { Vector2 randomizedVelocity = baseLaserVelocity + Utils.RandomVector2(Main.rand, -0.8f, 0.8f); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), spawnPosition, randomizedVelocity, ProjectileID.VortexLaser, damage, 1f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), spawnPosition, randomizedVelocity, ProjectileID.VortexLaser, damage, 1f, Main.myPlayer, 0f, 0f); } } } @@ -2301,7 +2301,7 @@ namespace CalamityMod.NPCs if (npc.localAI[0] > (float)Main.rand.Next(120, 240)) { npc.localAI[0] = 0f; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center, npc.SafeDirectionTo(Main.player[npc.target].Center, -Vector2.UnitY) * 10f, ProjectileID.WebSpit, 18, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, npc.SafeDirectionTo(Main.player[npc.target].Center, -Vector2.UnitY) * 10f, ProjectileID.WebSpit, 18, 0f, Main.myPlayer, 0f, 0f); } } if (npcType == NPCID.IceGolem) @@ -2323,7 +2323,7 @@ namespace CalamityMod.NPCs { npc.netUpdate = true; Vector2 velocity = npc.SafeDirectionTo(Main.player[npc.target].Center, -Vector2.UnitY) * 15; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center - Vector2.UnitY * 28 + velocity * 2f, velocity, ProjectileID.FrostBeam, 32, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center - Vector2.UnitY * 28 + velocity * 2f, velocity, ProjectileID.FrostBeam, 32, 0f, Main.myPlayer, 0f, 0f); npc.ai[2] = 0f; } } @@ -2347,7 +2347,7 @@ namespace CalamityMod.NPCs float speed = 15f; Vector2 spawnPosition = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + 12f); Vector2 velocity = Vector2.Normalize(Main.player[npc.target].Center - spawnPosition) * speed; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), spawnPosition, velocity, ProjectileID.EyeLaser, 40, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), spawnPosition, velocity, ProjectileID.EyeLaser, 40, 0f, Main.myPlayer, 0f, 0f); npc.ai[2] = 0f; } } @@ -2396,7 +2396,7 @@ namespace CalamityMod.NPCs } if (notLava && Main.tileSolid[(int)Main.tile[turretSpawnX, y].TileType] && !Collision.SolidTiles(turretSpawnX - 1, turretSpawnX + 1, y - 4, y - 1)) { - int turretIdx = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), turretSpawnX * 16 - npc.width / 2, y * 16, NPCID.MartianTurret, 0, 0f, 0f, 0f, 0f, 255); + int turretIdx = NPC.NewNPC(npc.GetSource_FromAI(), turretSpawnX * 16 - npc.width / 2, y * 16, NPCID.MartianTurret, 0, 0f, 0f, 0f, 0f, 255); Main.npc[turretIdx].position.Y = (float)(y * 16 - Main.npc[turretIdx].height); createdTurret = true; npc.netUpdate = true; @@ -2431,7 +2431,7 @@ namespace CalamityMod.NPCs if (npc.ai[2] == 20f && Main.netMode != NetmodeID.MultiplayerClient) { npc.ai[2] = (float)(-10 + Main.rand.Next(3) * -10); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center.X, npc.Center.Y + 8f, (float)(npc.direction * 8), 0f, ProjectileID.GigaZapperSpear, 25, 1f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y + 8f, (float)(npc.direction * 8), 0f, ProjectileID.GigaZapperSpear, 25, 1f, Main.myPlayer, 0f, 0f); } } } @@ -2860,28 +2860,28 @@ namespace CalamityMod.NPCs distY += (float)Main.rand.Next(-40, 41); distX *= magnitude; distY *= magnitude; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center.X, npc.Center.Y, distX, distY, projectileType, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y, distX, distY, projectileType, damage, 0f, Main.myPlayer, 0f, 0f); } } else if (npcType == NPCID.StardustSoldier) { - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), spawnPosition.X, spawnPosition.Y, distX, distY, projectileType, damage, 0f, Main.myPlayer, 0f, (float)npc.whoAmI); + Projectile.NewProjectile(npc.GetSource_FromAI(), spawnPosition.X, spawnPosition.Y, distX, distY, projectileType, damage, 0f, Main.myPlayer, 0f, (float)npc.whoAmI); } else if (npcType == NPCID.NebulaSoldier) { for (int i = 0; i < 4; i++) { - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center.X - (float)(npc.spriteDirection * 4), npc.Center.Y + 6f, (float)(-3 + 2 * i) * 0.15f, (float)(-(float)Main.rand.Next(0, 3)) * 0.2f - 0.1f, projectileType, damage, 0f, Main.myPlayer, 0f, (float)npc.whoAmI); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X - (float)(npc.spriteDirection * 4), npc.Center.Y + 6f, (float)(-3 + 2 * i) * 0.15f, (float)(-(float)Main.rand.Next(0, 3)) * 0.2f - 0.1f, projectileType, damage, 0f, Main.myPlayer, 0f, (float)npc.whoAmI); } } else if (npcType == NPCID.StardustSpiderBig) { - int idx = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.StardustSpiderSmall, npc.whoAmI, 0f, 0f, 0f, 0f, 255); + int idx = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.StardustSpiderSmall, npc.whoAmI, 0f, 0f, 0f, 0f, 255); Main.npc[idx].velocity = new Vector2(distX, -6f + distY); } else { - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), spawnPosition.X, spawnPosition.Y, distX, distY, projectileType, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), spawnPosition.X, spawnPosition.Y, distX, distY, projectileType, damage, 0f, Main.myPlayer, 0f, 0f); } } if (Math.Abs(distY) > Math.Abs(distX) * 2f) @@ -3097,7 +3097,7 @@ namespace CalamityMod.NPCs Vector2 spawnPosition = new Vector2(npc.position.X + (float)npc.width * 0.5f - (float)(npc.direction * 24), npc.position.Y + 4f); int velocityX = 3 * npc.direction; int velocityY = -5; - int num160 = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), spawnPosition.X, spawnPosition.Y, velocityX, velocityY, ProjectileID.HappyBomb, 0, 0f, Main.myPlayer, 0f, 0f); + int num160 = Projectile.NewProjectile(npc.GetSource_FromAI(), spawnPosition.X, spawnPosition.Y, velocityX, velocityY, ProjectileID.HappyBomb, 0, 0f, Main.myPlayer, 0f, 0f); Main.projectile[num160].timeLeft = 300; npc.ai[2] = 0f; } @@ -3583,7 +3583,7 @@ namespace CalamityMod.NPCs { int num8 = 22; int num9 = 84; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector.X, vector.Y, num4, num5, num9, num8, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector.X, vector.Y, num4, num5, num9, num8, 0f, Main.myPlayer, 0f, 0f); } } int arg_A81_0 = (int)npc.position.X + npc.width / 2; @@ -3732,7 +3732,7 @@ namespace CalamityMod.NPCs { if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(npc.position.X + (float)(npc.width / 2) + npc.velocity.X), (int)(npc.position.Y + (float)(npc.height / 2) + npc.velocity.Y), 112, 0, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.position.X + (float)(npc.width / 2) + npc.velocity.X), (int)(npc.position.Y + (float)(npc.height / 2) + npc.velocity.Y), 112, 0, 0f, 0f, 0f, 0f, 255); } npc.localAI[0] = 0f; } @@ -3844,7 +3844,7 @@ namespace CalamityMod.NPCs { num7 = NPCID.WyvernTail; } - int num8 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(npc.position.X + (float)(npc.width / 2)), (int)(npc.position.Y + (float)npc.height), num7, npc.whoAmI, 0f, 0f, 0f, 0f, 255); + int num8 = NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.position.X + (float)(npc.width / 2)), (int)(npc.position.Y + (float)npc.height), num7, npc.whoAmI, 0f, 0f, 0f, 0f, 255); Main.npc[num8].ai[3] = (float)npc.whoAmI; Main.npc[num8].realLife = npc.whoAmI; Main.npc[num8].ai[1] = (float)num6; @@ -3867,7 +3867,7 @@ namespace CalamityMod.NPCs { num14 = NPCID.TombCrawlerTail; } - int num15 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(npc.position.X + (float)(npc.width / 2)), (int)(npc.position.Y + (float)npc.height), num14, npc.whoAmI, 0f, 0f, 0f, 0f, 255); + int num15 = NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.position.X + (float)(npc.width / 2)), (int)(npc.position.Y + (float)npc.height), num14, npc.whoAmI, 0f, 0f, 0f, 0f, 255); Main.npc[num15].ai[3] = (float)npc.whoAmI; Main.npc[num15].realLife = npc.whoAmI; Main.npc[num15].ai[1] = (float)num12; @@ -3890,7 +3890,7 @@ namespace CalamityMod.NPCs { num23 = NPCID.SolarCrawltipedeTail; } - int num24 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(npc.position.X + (float)(npc.width / 2)), (int)(npc.position.Y + (float)npc.height), num23, npc.whoAmI, 0f, 0f, 0f, 0f, 255); + int num24 = NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.position.X + (float)(npc.width / 2)), (int)(npc.position.Y + (float)npc.height), num23, npc.whoAmI, 0f, 0f, 0f, 0f, 255); Main.npc[num24].ai[3] = (float)npc.whoAmI; Main.npc[num24].realLife = npc.whoAmI; Main.npc[num24].ai[1] = (float)num20; @@ -3935,15 +3935,15 @@ namespace CalamityMod.NPCs break; } - npc.ai[0] = (float)NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(npc.position.X + (float)(npc.width / 2)), (int)(npc.position.Y + (float)npc.height), npc.type + 1, npc.whoAmI, 0f, 0f, 0f, 0f, 255); + npc.ai[0] = (float)NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.position.X + (float)(npc.width / 2)), (int)(npc.position.Y + (float)npc.height), npc.type + 1, npc.whoAmI, 0f, 0f, 0f, 0f, 255); } else if ((isSplittingNPCBody || npc.type == NPCID.GiantWormBody || npc.type == NPCID.DevourerBody || npc.type == NPCID.BoneSerpentBody || npc.type == NPCID.LeechBody) && npc.ai[2] > 0f) { - npc.ai[0] = (float)NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(npc.position.X + (float)(npc.width / 2)), (int)(npc.position.Y + (float)npc.height), npc.type, npc.whoAmI, 0f, 0f, 0f, 0f, 255); + npc.ai[0] = (float)NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.position.X + (float)(npc.width / 2)), (int)(npc.position.Y + (float)npc.height), npc.type, npc.whoAmI, 0f, 0f, 0f, 0f, 255); } else { - npc.ai[0] = (float)NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(npc.position.X + (float)(npc.width / 2)), (int)(npc.position.Y + (float)npc.height), npc.type + 1, npc.whoAmI, 0f, 0f, 0f, 0f, 255); + npc.ai[0] = (float)NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.position.X + (float)(npc.width / 2)), (int)(npc.position.Y + (float)npc.height), npc.type + 1, npc.whoAmI, 0f, 0f, 0f, 0f, 255); } if (!isSplittingNPC) @@ -4931,7 +4931,7 @@ namespace CalamityMod.NPCs } if (flag7) { - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), (float)(num100 * 16 + 8), (float)(num101 * 16 + 8), 0f, 0f, ProjectileID.DesertDjinnCurse, 0, 1f, Main.myPlayer, (float)npc.target, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), (float)(num100 * 16 + 8), (float)(num101 * 16 + 8), 0f, 0f, ProjectileID.DesertDjinnCurse, 0, 1f, Main.myPlayer, (float)npc.target, 0f); break; } } @@ -4973,7 +4973,7 @@ namespace CalamityMod.NPCs projType = ProjectileID.LostSoulHostile; damage = 32; } - int num108 = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector13.X, vector13.Y, num103, num104, projType, damage, 0f, Main.myPlayer, 0f, 0f); + int num108 = Projectile.NewProjectile(npc.GetSource_FromAI(), vector13.X, vector13.Y, num103, num104, projType, damage, 0f, Main.myPlayer, 0f, 0f); Main.projectile[num108].timeLeft = 300; if (projType == ProjectileID.InfernoHostileBolt) { @@ -4994,11 +4994,11 @@ namespace CalamityMod.NPCs { if (npc.type == NPCID.GoblinSorcerer || npc.type == NPCID.Tim) { - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.position.X + npc.width / 2, (int)npc.position.Y - 8, NPCID.ChaosBall, 0, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.position.X + npc.width / 2, (int)npc.position.Y - 8, NPCID.ChaosBall, 0, 0f, 0f, 0f, 0f, 255); } else if (npc.type == NPCID.DarkCaster) { - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.position.X + npc.width / 2, (int)npc.position.Y - 8, NPCID.WaterSphere, 0, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.position.X + npc.width / 2, (int)npc.position.Y - 8, NPCID.WaterSphere, 0, 0f, 0f, 0f, 0f, 255); } else if (npc.type == NPCID.RuneWizard) { @@ -5012,13 +5012,13 @@ namespace CalamityMod.NPCs num111 *= num112; int num113 = 40; int num114 = ProjectileID.RuneBlast; - int num115 = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector14.X, vector14.Y, num110, num111, num114, num113, 0f, Main.myPlayer, 0f, 0f); + int num115 = Projectile.NewProjectile(npc.GetSource_FromAI(), vector14.X, vector14.Y, num110, num111, num114, num113, 0f, Main.myPlayer, 0f, 0f); Main.projectile[num115].timeLeft = 300; npc.localAI[0] = 0f; } else { - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.position.X + npc.width / 2 + npc.direction * 8, (int)npc.position.Y + 20, NPCID.BurningSphere, 0, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.position.X + npc.width / 2 + npc.direction * 8, (int)npc.position.Y + 20, NPCID.BurningSphere, 0, 0f, 0f, 0f, 0f, 255); } } } @@ -5277,7 +5277,7 @@ namespace CalamityMod.NPCs int type = ProjectileID.CursedFlameHostile; Vector2 flameVelocity = npc.SafeDirectionTo(Main.player[npc.target].Center, -Vector2.UnitY) * 12f; - int flame = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center, flameVelocity, type, damage, 0f, Main.myPlayer, 0f, 0f); + int flame = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, flameVelocity, type, damage, 0f, Main.myPlayer, 0f, 0f); Main.projectile[flame].timeLeft = 180; npc.localAI[0] = 0f; } @@ -5304,7 +5304,7 @@ namespace CalamityMod.NPCs Vector2 velocity = npc.SafeDirectionTo(Main.player[npc.target].Center - npc.Center - Vector2.UnitY * absoluteYDistance, -Vector2.UnitY) * speed; - int idx = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.FungiSpore, 0, 0f, 0f, 0f, 0f, 255); + int idx = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.FungiSpore, 0, 0f, 0f, 0f, 0f, 255); Main.npc[idx].velocity = velocity; Main.npc[idx].netUpdate = true; npc.localAI[0] = 0f; @@ -5554,7 +5554,7 @@ namespace CalamityMod.NPCs int type = ProjectileID.HarpyFeather; Vector2 featherVelocity = npc.SafeDirectionTo(Main.player[npc.target].Center) * 6f; - int feather = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center, featherVelocity, type, damage, 0f, Main.myPlayer, 0f, 0f); + int feather = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, featherVelocity, type, damage, 0f, Main.myPlayer, 0f, 0f); Main.projectile[feather].timeLeft = 300; } } @@ -5574,7 +5574,7 @@ namespace CalamityMod.NPCs int type = ProjectileID.DemonSickle; Vector2 sickleVelocity = npc.SafeDirectionTo(Main.player[npc.target].Center) * 0.2f; - int sickle = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center, sickleVelocity, type, damage, 0f, Main.myPlayer, 0f, 0f); + int sickle = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, sickleVelocity, type, damage, 0f, Main.myPlayer, 0f, 0f); Main.projectile[sickle].timeLeft = 300; } } @@ -5598,7 +5598,7 @@ namespace CalamityMod.NPCs int damage = 80; int type = ProjectileID.UnholyTridentHostile; - int trident = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), spawnPosition + tridentVelocity * 100f, tridentVelocity, type, damage, 3f, Main.myPlayer, 0f, 0f); + int trident = Projectile.NewProjectile(npc.GetSource_FromAI(), spawnPosition + tridentVelocity * 100f, tridentVelocity, type, damage, 3f, Main.myPlayer, 0f, 0f); Main.projectile[trident].timeLeft = 300; } } @@ -6133,7 +6133,7 @@ namespace CalamityMod.NPCs velocity.X += (float)Main.rand.Next(-30, 31) * 0.05f; velocity.Y += (float)Main.rand.Next(-30, 31) * 0.05f; - int sandBall = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center, velocity, projType, damage, 0f, Main.myPlayer, 0f, 0f); + int sandBall = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, velocity, projType, damage, 0f, Main.myPlayer, 0f, 0f); Main.projectile[sandBall].ai[0] = 2f; Main.projectile[sandBall].timeLeft = 300; Main.projectile[sandBall].friendly = false; @@ -6330,7 +6330,7 @@ namespace CalamityMod.NPCs for (int num1501 = 0; num1501 < 4; num1501++) { Vector2 vector255 = new Vector2(0f, -5f).RotatedBy((double)(MathHelper.PiOver2 * (float)num1501)); - int proj = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center.X, npc.Center.Y, vector255.X, vector255.Y, ProjectileID.FlamesTrap, 20, 0f, Main.myPlayer, 0f, 0f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y, vector255.X, vector255.Y, ProjectileID.FlamesTrap, 20, 0f, Main.myPlayer, 0f, 0f); Main.projectile[proj].tileCollide = false; Main.projectile[proj].friendly = false; Main.projectile[proj].trap = false; @@ -6443,7 +6443,7 @@ namespace CalamityMod.NPCs { int damage = 25; int projType = ProjectileID.PinkLaser; - int num297 = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector33.X, vector33.Y, num292, num293, projType, damage, 0f, Main.myPlayer, 0f, 0f); + int num297 = Projectile.NewProjectile(npc.GetSource_FromAI(), vector33.X, vector33.Y, num292, num293, projType, damage, 0f, Main.myPlayer, 0f, 0f); } num290 = 12; @@ -6532,7 +6532,7 @@ namespace CalamityMod.NPCs { int dmg = 45; int projType = ProjectileID.FrostBlastHostile; - int num306 = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector34.X, vector34.Y, num301, num302, projType, dmg, 0f, Main.myPlayer, 0f, 0f); + int num306 = Projectile.NewProjectile(npc.GetSource_FromAI(), vector34.X, vector34.Y, num301, num302, projType, dmg, 0f, Main.myPlayer, 0f, 0f); } num290 = 15; @@ -6589,7 +6589,7 @@ namespace CalamityMod.NPCs num310 *= num311; int dmg = 40; int projType = ProjectileID.GoldenShowerHostile; - int num314 = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector35.X, vector35.Y, num308, num310, projType, dmg, 0f, Main.myPlayer, 0f, 0f); + int num314 = Projectile.NewProjectile(npc.GetSource_FromAI(), vector35.X, vector35.Y, num308, num310, projType, dmg, 0f, Main.myPlayer, 0f, 0f); } } } @@ -7171,7 +7171,7 @@ namespace CalamityMod.NPCs { for (int k = 0; k < 3; k++) { - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center.X, npc.Center.Y, (Main.rand.NextFloat() - 0.5f) * 2f, -4f - 10f * Main.rand.NextFloat(), ProjectileID.Twinkle, 50, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y, (Main.rand.NextFloat() - 0.5f) * 2f, -4f - 10f * Main.rand.NextFloat(), ProjectileID.Twinkle, 50, 0f, Main.myPlayer, 0f, 0f); } npc.HitEffect(9999, 10.0); npc.active = false; @@ -7218,7 +7218,7 @@ namespace CalamityMod.NPCs if (npc.ai[1] == 30f && Main.netMode != NetmodeID.MultiplayerClient) { int num5 = Main.expertMode ? 35 : 50; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center.X + (float)(npc.spriteDirection * -20), npc.Center.Y, (float)(npc.spriteDirection * -7), 0f, ProjectileID.NebulaSphere, num5, 0f, Main.myPlayer, (float)npc.target, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X + (float)(npc.spriteDirection * -20), npc.Center.Y, (float)(npc.spriteDirection * -7), 0f, ProjectileID.NebulaSphere, num5, 0f, Main.myPlayer, (float)npc.target, 0f); } if (npc.ai[1] >= 60f) @@ -8294,7 +8294,7 @@ namespace CalamityMod.NPCs Vector2 velocity = Main.player[npc.target].Center - npc.Center; velocity.Normalize(); velocity *= 8f; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center, velocity, ProjectileID.WebSpit, 18, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, velocity, ProjectileID.WebSpit, 18, 0f, Main.myPlayer, 0f, 0f); } } @@ -8793,11 +8793,11 @@ namespace CalamityMod.NPCs { Vector2 rainSpawnPosition = npc.position + new Vector2(10f + Main.rand.Next(npc.width - 20), npc.height + 4f); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), rainSpawnPosition, Vector2.UnitY * 5f, ProjectileID.RainNimbus, 20, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), rainSpawnPosition, Vector2.UnitY * 5f, ProjectileID.RainNimbus, 20, 0f, Main.myPlayer, 0f, 0f); if (npc.ai[0] % 16f == 0f) { float speedX = (float)Main.rand.NextFloat(-3f, 3f) * (Main.rand.NextFloat() - 0.5f); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), rainSpawnPosition, new Vector2(speedX, 5f), ProjectileID.FrostShard, 20, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), rainSpawnPosition, new Vector2(speedX, 5f), ProjectileID.FrostShard, 20, 0f, Main.myPlayer, 0f, 0f); } } if (npc.ai[0] >= 607f) @@ -8958,7 +8958,7 @@ namespace CalamityMod.NPCs } Vector2 velocity = Vector2.Normalize(distanceVector) * 14f; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center - Vector2.UnitY * 10f, velocity, ProjectileID.MartianTurretBolt, 28, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center - Vector2.UnitY * 10f, velocity, ProjectileID.MartianTurretBolt, 28, 0f, Main.myPlayer, 0f, 0f); } return false; diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index a47fe0b123..caa735fa1e 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -4092,7 +4092,7 @@ namespace CalamityMod.NPCs NPCType() }); - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.Center.X, (int)npc.Center.Y, randomType, 0, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, randomType, 0, 0f, 0f, 0f, 0f, 255); } } @@ -4118,7 +4118,7 @@ namespace CalamityMod.NPCs int slimeAmt = Main.rand.Next(2) + 2; //2 to 3 extra for (int s = 0; s < slimeAmt; s++) { - int slime = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.Center.X, (int)(npc.position.Y + npc.height), NPCID.BlueSlime, 0, 0f, 0f, 0f, 0f, 255); + int slime = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)(npc.position.Y + npc.height), NPCID.BlueSlime, 0, 0f, 0f, 0f, 0f, 255); NPC npc2 = Main.npc[slime]; npc2.SetDefaults(NPCID.BabySlime); npc2.velocity.X = npc.velocity.X * 2f; diff --git a/NPCs/CalamityVanillaMinibossesAI.cs b/NPCs/CalamityVanillaMinibossesAI.cs index 1c85915bc3..1232e16aea 100644 --- a/NPCs/CalamityVanillaMinibossesAI.cs +++ b/NPCs/CalamityVanillaMinibossesAI.cs @@ -416,7 +416,7 @@ namespace CalamityMod.NPCs attackTimer++; if (attackTimer == eggLayTime) - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)spotToLayEgg.X, (int)spotToLayEgg.Y + 20, 478, npc.whoAmI, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC(npc.GetSource_FromAI(), (int)spotToLayEgg.X, (int)spotToLayEgg.Y + 20, 478, npc.whoAmI, 0f, 0f, 0f, 0f, 255); else if (attackTimer == eggLayTime + waitTime) { aiState = (int)MothronAIState.NewAISelection; @@ -483,7 +483,7 @@ namespace CalamityMod.NPCs num858 *= num859; num857 *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f; num858 *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector109.X, vector109.Y, num857, num858, ProjectileID.GreekFire1 + Main.rand.Next(3), 60, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector109.X, vector109.Y, num857, num858, ProjectileID.GreekFire1 + Main.rand.Next(3), 60, 0f, Main.myPlayer, 0f, 0f); } } } @@ -493,13 +493,13 @@ namespace CalamityMod.NPCs npc.TargetClosest(true); npc.ai[0] = 1f; - int num861 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(npc.position.X + (float)(npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.PumpkingBlade, npc.whoAmI, 0f, 0f, 0f, 0f, 255); + int num861 = NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.position.X + (float)(npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.PumpkingBlade, npc.whoAmI, 0f, 0f, 0f, 0f, 255); Main.npc[num861].ai[0] = -1f; Main.npc[num861].ai[1] = (float)npc.whoAmI; Main.npc[num861].target = npc.target; Main.npc[num861].netUpdate = true; - num861 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(npc.position.X + (float)(npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.PumpkingBlade, npc.whoAmI, 0f, 0f, 0f, 0f, 255); + num861 = NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.position.X + (float)(npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.PumpkingBlade, npc.whoAmI, 0f, 0f, 0f, 0f, 255); Main.npc[num861].ai[0] = 1f; Main.npc[num861].ai[1] = (float)npc.whoAmI; Main.npc[num861].ai[3] = 150f; @@ -879,7 +879,7 @@ namespace CalamityMod.NPCs num893 *= num895; num894 *= num895; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector116.X, vector116.Y, num893, num894, ProjectileID.FrostWave, 50, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector116.X, vector116.Y, num893, num894, ProjectileID.FrostWave, 50, 0f, Main.myPlayer, 0f, 0f); } } else if (npc.ai[3] < 0f) @@ -974,7 +974,7 @@ namespace CalamityMod.NPCs num902 += 3f; float speedX2 = npc.velocity.X * 0.25f; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector117.X, vector117.Y, speedX2, num902, ProjectileID.FrostShard, 44, 0f, Main.myPlayer, (float)Main.rand.Next(5), 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector117.X, vector117.Y, speedX2, num902, ProjectileID.FrostShard, 44, 0f, Main.myPlayer, (float)Main.rand.Next(5), 0f); } } } @@ -1019,7 +1019,7 @@ namespace CalamityMod.NPCs if (npc.ai[3] > (float)num908) { npc.ai[3] = 0f; - int num909 = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector118.X, vector118.Y, num904, num905, ProjectileID.FrostShard, 40, 0f, Main.myPlayer, 0f, 0f); + int num909 = Projectile.NewProjectile(npc.GetSource_FromAI(), vector118.X, vector118.Y, num904, num905, ProjectileID.FrostShard, 40, 0f, Main.myPlayer, 0f, 0f); } if (Main.netMode != NetmodeID.MultiplayerClient) diff --git a/NPCs/Crabulon/CrabShroom.cs b/NPCs/Crabulon/CrabShroom.cs index 776d1a20ad..850895943a 100644 --- a/NPCs/Crabulon/CrabShroom.cs +++ b/NPCs/Crabulon/CrabShroom.cs @@ -127,7 +127,7 @@ namespace CalamityMod.NPCs.Crabulon { int closestPlayer = Player.FindClosest(NPC.Center, 1, 1); if (Main.rand.Next(8) == 0 && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2) - Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); + Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); } } diff --git a/NPCs/Crabulon/CrabulonIdle.cs b/NPCs/Crabulon/CrabulonIdle.cs index 0bdc796471..67f89070b1 100644 --- a/NPCs/Crabulon/CrabulonIdle.cs +++ b/NPCs/Crabulon/CrabulonIdle.cs @@ -232,7 +232,7 @@ namespace CalamityMod.NPCs.Crabulon num350 *= num351; vector34.X += num349; vector34.Y += num350; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector34.X, vector34.Y, num349, num350 - 5f, type, NPC.GetProjectileDamage(type), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vector34.X, vector34.Y, num349, num350 - 5f, type, NPC.GetProjectileDamage(type), 0f, Main.myPlayer, 0f, 0f); } } } @@ -479,7 +479,7 @@ namespace CalamityMod.NPCs.Crabulon for (int x = 0; x < totalMushrooms; x++) { - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center.X + shotSpacing, NPC.Center.Y - 1000f, velocityX, 0f, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X + shotSpacing, NPC.Center.Y - 1000f, velocityX, 0f, type, damage, 0f, Main.myPlayer, 0f, 0f); shotSpacing -= shotSpacingDecrement; } @@ -495,7 +495,7 @@ namespace CalamityMod.NPCs.Crabulon { for (int x = 0; x < 20; x++) { - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center.X + shotSpacing, NPC.Center.Y - 1000f, 0f, 0f, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X + shotSpacing, NPC.Center.Y - 1000f, 0f, 0f, type, damage, 0f, Main.myPlayer, 0f, 0f); shotSpacing -= 100; } shotSpacing = 1000; @@ -600,7 +600,7 @@ namespace CalamityMod.NPCs.Crabulon int x = (int)(NPC.position.X + Main.rand.Next(NPC.width - 32)); int y = (int)(NPC.position.Y + Main.rand.Next(NPC.height - 32)); int num663 = ModContent.NPCType(); - int num664 = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), x, y, num663); + int num664 = NPC.NewNPC(NPC.GetSource_FromAI(), x, y, num663); Main.npc[num664].SetDefaults(num663); Main.npc[num664].velocity.X = Main.rand.Next(-50, 51) * 0.1f; Main.npc[num664].velocity.Y = Main.rand.Next(-50, -31) * 0.1f; diff --git a/NPCs/Crags/SoulSlurper.cs b/NPCs/Crags/SoulSlurper.cs index b0d17ef201..c1f7e3d10f 100644 --- a/NPCs/Crags/SoulSlurper.cs +++ b/NPCs/Crags/SoulSlurper.cs @@ -155,7 +155,7 @@ namespace CalamityMod.NPCs.Crags dmg = 22; } int projType = ModContent.ProjectileType(); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), source.X, source.Y, num4, num5, projType, dmg + (provy ? 30 : 0), 0f, Main.myPlayer, 1f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), 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 68b8782908..4f94bb2795 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -155,7 +155,7 @@ namespace CalamityMod.NPCs.Cryogen if (NPC.ai[2] == 0f && NPC.localAI[1] == 0f && Main.netMode != NetmodeID.MultiplayerClient && (NPC.ai[0] < 3f || BossRushEvent.BossRushActive || (death && NPC.ai[0] > 3f))) //spawn shield for phase 0 1 2, not 3 4 5 { - int num6 = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType(), NPC.whoAmI); + int num6 = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType(), NPC.whoAmI); NPC.ai[2] = num6 + 1; NPC.localAI[1] = -1f; NPC.netUpdate = true; @@ -231,7 +231,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, NPC.ai[0] * 0.5f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, NPC.ai[0] * 0.5f); } } } @@ -259,7 +259,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer); } } } @@ -314,7 +314,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer); } } } @@ -407,7 +407,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, velocity); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, velocity); } } } @@ -471,7 +471,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer); } } } @@ -531,7 +531,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, velocity); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, velocity); } } } @@ -595,7 +595,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer); } } } @@ -707,7 +707,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, velocity); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, velocity); } } } @@ -789,7 +789,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, velocity); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, velocity); } } } @@ -883,7 +883,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, 1f); } } diff --git a/NPCs/Cryogen/CryogenIce.cs b/NPCs/Cryogen/CryogenIce.cs index 47d4943aaa..94482f2567 100644 --- a/NPCs/Cryogen/CryogenIce.cs +++ b/NPCs/Cryogen/CryogenIce.cs @@ -141,7 +141,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - int proj = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector255, type, damage2, 0f, Main.myPlayer); + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, vector255, type, damage2, 0f, Main.myPlayer); Main.projectile[proj].timeLeft = 300; } } diff --git a/NPCs/DesertScourge/DesertNuisanceHead.cs b/NPCs/DesertScourge/DesertNuisanceHead.cs index a26d1eb24b..6d09d4e7ab 100644 --- a/NPCs/DesertScourge/DesertNuisanceHead.cs +++ b/NPCs/DesertScourge/DesertNuisanceHead.cs @@ -86,7 +86,7 @@ namespace CalamityMod.NPCs.DesertScourge { num4 = ModContent.NPCType(); } - int num5 = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)(NPC.position.X + (float)(NPC.width / 2)), (int)(NPC.position.Y + (float)NPC.height), num4, NPC.whoAmI, 0f, 0f, 0f, 0f, 255); + int num5 = NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.position.X + (float)(NPC.width / 2)), (int)(NPC.position.Y + (float)NPC.height), num4, NPC.whoAmI, 0f, 0f, 0f, 0f, 255); Main.npc[num5].ai[2] = (float)NPC.whoAmI; Main.npc[num5].realLife = NPC.whoAmI; Main.npc[num5].ai[1] = (float)num2; diff --git a/NPCs/DesertScourge/DesertScourgeBody.cs b/NPCs/DesertScourge/DesertScourgeBody.cs index 2b543a8ced..348b305cab 100644 --- a/NPCs/DesertScourge/DesertScourgeBody.cs +++ b/NPCs/DesertScourge/DesertScourgeBody.cs @@ -131,7 +131,7 @@ namespace CalamityMod.NPCs.DesertScourge vector104.Y += num943 * 5f; if (Main.rand.NextBool(2) || malice) { - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector104.X, vector104.Y, num942, num943, projectileType, NPC.GetProjectileDamage(projectileType), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vector104.X, vector104.Y, num942, num943, projectileType, NPC.GetProjectileDamage(projectileType), 0f, Main.myPlayer, 0f, 0f); } NPC.netUpdate = true; } diff --git a/NPCs/DesertScourge/DesertScourgeHead.cs b/NPCs/DesertScourge/DesertScourgeHead.cs index a9c1853f0f..c4273b5536 100644 --- a/NPCs/DesertScourge/DesertScourgeHead.cs +++ b/NPCs/DesertScourge/DesertScourgeHead.cs @@ -188,11 +188,11 @@ namespace CalamityMod.NPCs.DesertScourge int lol; if (num36 >= 0 && num36 < minLength) { - lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); } else { - lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); } Main.npc[lol].ai[2] = NPC.whoAmI; Main.npc[lol].realLife = NPC.whoAmI; diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index e2f850cc08..1f51b7540f 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -509,7 +509,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (Main.netMode != NetmodeID.MultiplayerClient && !hasCreatedPhase1Portal) { Vector2 portalSpawnPosition = NPC.Center + NPC.velocity.SafeNormalize(-Vector2.UnitY) * 1000f; - PortalIndex = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), portalSpawnPosition, Vector2.Zero, ModContent.ProjectileType(), 0, 0f); + PortalIndex = Projectile.NewProjectile(NPC.GetSource_FromAI(), portalSpawnPosition, Vector2.Zero, ModContent.ProjectileType(), 0, 0f); hasCreatedPhase1Portal = true; NPC.netUpdate = true; @@ -675,7 +675,7 @@ namespace CalamityMod.NPCs.DevourerofGods int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector44.X, vector44.Y, num427, num428, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vector44.X, vector44.Y, num427, num428, type, damage, 0f, Main.myPlayer); } } else if (distanceFromTarget < 250f) @@ -706,15 +706,15 @@ namespace CalamityMod.NPCs.DevourerofGods for (int x = 0; x < totalShots_Phase2; x++) { - 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); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + spawnOffset, targetPosY + shotSpacing_Phase2[0], -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - spawnOffset, targetPosY + shotSpacing_Phase2[0], laserVelocity, 0f, type, damage, 0f, Main.myPlayer); shotSpacing_Phase2[0] -= spacingVar_Phase2; } if (expertMode) { - 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); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + spawnOffset, player.Center.Y, -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - spawnOffset, player.Center.Y, laserVelocity, 0f, type, damage, 0f, Main.myPlayer); } break; @@ -724,15 +724,15 @@ namespace CalamityMod.NPCs.DevourerofGods targetPosY += 50f; for (int x = 0; x < totalShots_Phase2; x++) { - 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); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + spawnOffset, targetPosY + shotSpacing_Phase2[0], -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - spawnOffset, targetPosY + shotSpacing_Phase2[0], laserVelocity, 0f, type, damage, 0f, Main.myPlayer); shotSpacing_Phase2[0] -= spacingVar_Phase2; } if (expertMode) { - 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); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + spawnOffset, player.Center.Y, -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - spawnOffset, player.Center.Y, laserVelocity, 0f, type, damage, 0f, Main.myPlayer); } break; @@ -744,17 +744,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(NPC.GetSpawnSource_ForProjectile(), start, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), 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(NPC.GetSpawnSource_ForProjectile(), start, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), start, velocity, type, damage, 0f, Main.myPlayer); shotSpacing_Phase2[0] -= diagonalSpacingVar; } - 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); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.Center.X, targetPosY + spawnOffset, 0f, -laserVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.Center.X, targetPosY - spawnOffset, 0f, laserVelocity, type, damage, 0f, Main.myPlayer); break; @@ -762,21 +762,21 @@ namespace CalamityMod.NPCs.DevourerofGods for (int x = 0; x < totalShots_Phase2; x++) { - 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); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + spawnOffset, targetPosY + shotSpacing_Phase2[0], -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), 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(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); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + spawnOffset, targetPosY + shotSpacing_Phase2[3], -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), 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(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); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + spawnOffset, player.Center.Y, -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - spawnOffset, player.Center.Y, laserVelocity, 0f, type, damage, 0f, Main.myPlayer); break; @@ -787,17 +787,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(NPC.GetSpawnSource_ForProjectile(), start, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), 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(NPC.GetSpawnSource_ForProjectile(), start, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), start, velocity, type, damage, 0f, Main.myPlayer); shotSpacing_Phase2[0] -= diagonalSpacingVar; } - 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); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + spawnOffset, player.Center.Y, -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - spawnOffset, player.Center.Y, laserVelocity, 0f, type, damage, 0f, Main.myPlayer); break; } @@ -817,14 +817,14 @@ namespace CalamityMod.NPCs.DevourerofGods // Lower wall for (int x = 0; x < totalShots_Phase2; x++) { - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + shotSpacing_Phase2[1], player.position.Y + spawnOffset, 0f, -laserVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), 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(NPC.GetSpawnSource_ForProjectile(), player.position.X + shotSpacing_Phase2[2], player.position.Y - spawnOffset, 0f, laserVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + shotSpacing_Phase2[2], player.position.Y - spawnOffset, 0f, laserVelocity, type, damage, 0f, Main.myPlayer); shotSpacing_Phase2[2] -= spacingVar_Phase2; } @@ -1379,11 +1379,11 @@ namespace CalamityMod.NPCs.DevourerofGods int segment; if (segmentSpawn >= 0 && segmentSpawn < minLength) { - segment = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + segment = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); Main.npc[segment].ModNPC().SegmentIndex = maxLength - segmentSpawn; } else - segment = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + segment = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); Main.npc[segment].realLife = NPC.whoAmI; Main.npc[segment].ai[2] = NPC.whoAmI; @@ -1421,13 +1421,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(NPC.GetSpawnSource_ForProjectile(), start, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), start, velocity, type, damage, 0f, Main.myPlayer); shotSpacing -= spacingVar; } if (expertMode) - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + spawnOffset, player.Center.Y, -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + spawnOffset, player.Center.Y, -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); break; @@ -1438,13 +1438,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(NPC.GetSpawnSource_ForProjectile(), start, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), start, velocity, type, damage, 0f, Main.myPlayer); shotSpacing -= spacingVar; } if (expertMode) - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X - spawnOffset, player.Center.Y, laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - spawnOffset, player.Center.Y, laserVelocity, 0f, type, damage, 0f, Main.myPlayer); break; @@ -1455,19 +1455,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(NPC.GetSpawnSource_ForProjectile(), start, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), 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(NPC.GetSpawnSource_ForProjectile(), start, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), start, velocity, type, damage, 0f, Main.myPlayer); shotSpacing -= spacingVar; } if (expertMode) { - 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); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + spawnOffset, player.Center.Y, -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - spawnOffset, player.Center.Y, laserVelocity, 0f, type, damage, 0f, Main.myPlayer); } break; @@ -1482,20 +1482,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(NPC.GetSpawnSource_ForProjectile(), start, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), 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(NPC.GetSpawnSource_ForProjectile(), start, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), 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(NPC.GetSpawnSource_ForProjectile(), start, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), 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(NPC.GetSpawnSource_ForProjectile(), start, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), start, velocity, type, damage, 0f, Main.myPlayer); } shotSpacing -= spacingVar; @@ -1503,8 +1503,8 @@ namespace CalamityMod.NPCs.DevourerofGods if (expertMode) { - 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); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + spawnOffset, player.Center.Y, -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - spawnOffset, player.Center.Y, laserVelocity, 0f, type, damage, 0f, Main.myPlayer); } break; @@ -1981,7 +1981,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(NPC.GetSpawnSource_ForProjectile(), targetVector, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), targetVector, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, NPC.whoAmI); } } @@ -1992,7 +1992,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(NPC.GetSpawnSource_ForProjectile(), targetVector, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), targetVector, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, NPC.whoAmI); } Vector2 newPosition = GetRiftLocation(true); @@ -2023,7 +2023,7 @@ namespace CalamityMod.NPCs.DevourerofGods for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), newPosition, vector255, type, damage, 0f, Main.myPlayer, velocityMult, finalVelocity - finalVelocityReduction); + Projectile.NewProjectile(NPC.GetSource_FromAI(), newPosition, vector255, type, damage, 0f, Main.myPlayer, velocityMult, finalVelocity - finalVelocityReduction); } } } @@ -2123,7 +2123,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (DeathAnimationTimer == 452f) { if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f); if (Main.netMode != NetmodeID.Server) { diff --git a/NPCs/DevourerofGods/DevourerofGodsHead2.cs b/NPCs/DevourerofGods/DevourerofGodsHead2.cs index dc24c9dbad..5b8ee1267e 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead2.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead2.cs @@ -108,11 +108,11 @@ namespace CalamityMod.NPCs.DevourerofGods int segment; if (segmentSpawn >= 0 && segmentSpawn < minLength) { - segment = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + segment = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); } else { - segment = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + segment = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); } Main.npc[segment].realLife = NPC.whoAmI; Main.npc[segment].ai[2] = NPC.whoAmI; @@ -337,7 +337,7 @@ namespace CalamityMod.NPCs.DevourerofGods { int heartAmt = Main.rand.Next(3) + 3; for (int i = 0; i < heartAmt; i++) - Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); + Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); } } diff --git a/NPCs/ExoMechs/Apollo/Apollo.cs b/NPCs/ExoMechs/Apollo/Apollo.cs index 463825e8eb..23789b14c8 100644 --- a/NPCs/ExoMechs/Apollo/Apollo.cs +++ b/NPCs/ExoMechs/Apollo/Apollo.cs @@ -1006,7 +1006,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/PlasmaCasterFire"), NPC.Center); Vector2 plasmaVelocity = Vector2.Normalize(aimedVector) * projectileVelocity; Vector2 offset = Vector2.Normalize(plasmaVelocity) * 70f; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + offset, plasmaVelocity, type, damage, 0f, Main.myPlayer, player.Center.X, player.Center.Y); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, plasmaVelocity, type, damage, 0f, Main.myPlayer, player.Center.X, player.Center.Y); } } } @@ -1062,7 +1062,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.GetSpawnSource_ForProjectile(), NPC.Center + offset, rocketVelocity, type, damage, 0f, Main.myPlayer, 0f, player.Center.Y); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, rocketVelocity, type, damage, 0f, Main.myPlayer, 0f, player.Center.Y); } } @@ -1120,7 +1120,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo // Draw telegraph beams if (Main.netMode != NetmodeID.MultiplayerClient) { - int telegraph = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), chargeLocations[0], Vector2.Zero, type, 0, 0f, Main.myPlayer, 0f, NPC.whoAmI); + int telegraph = Projectile.NewProjectile(NPC.GetSource_FromAI(), chargeLocations[0], Vector2.Zero, type, 0, 0f, Main.myPlayer, 0f, NPC.whoAmI); if (Main.projectile.IndexInRange(telegraph)) { Main.projectile[telegraph].ModProjectile().ChargePositions = chargeLocations; @@ -1178,7 +1178,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo for (int k = 0; k < totalProjectiles; k++) { Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, velocity2, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity2, type, damage, 0f, Main.myPlayer); } } @@ -1291,7 +1291,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo Vector2 offset = lensDirection * 70f; if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + offset, lensDirection * 24f, ModContent.ProjectileType(), 0, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), 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 f688894e9d..b197b6083e 100644 --- a/NPCs/ExoMechs/Ares/AresBody.cs +++ b/NPCs/ExoMechs/Ares/AresBody.cs @@ -248,18 +248,18 @@ namespace CalamityMod.NPCs.ExoMechs.Ares switch (i) { case 0: - lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); break; case 1: - lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); Main.npc[lol].Calamity().newAI[1] = plasmaArmStartTimer; break; case 2: - lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); Main.npc[lol].Calamity().newAI[1] = teslaArmStartTimer; break; case 3: - lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); break; default: break; @@ -804,7 +804,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares for (int k = 0; k < totalProjectiles; k++) { Vector2 laserVelocity = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), spawnPoint + Vector2.Normalize(laserVelocity) * 17f, laserVelocity, type, 0, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnPoint + Vector2.Normalize(laserVelocity) * 17f, laserVelocity, type, 0, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } @@ -823,7 +823,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares for (int k = 0; k < totalProjectiles; k++) { Vector2 laserVelocity = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), spawnPoint + Vector2.Normalize(laserVelocity) * 35f, laserVelocity, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), 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 a7c856d3ab..d6310eb32a 100644 --- a/NPCs/ExoMechs/Ares/AresGaussNuke.cs +++ b/NPCs/ExoMechs/Ares/AresGaussNuke.cs @@ -407,7 +407,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); float offset = 40f; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + Vector2.Normalize(gaussNukeVelocity) * offset, gaussNukeVelocity, type, damage, 0f, Main.myPlayer, 0f, player.Center.Y); + Projectile.NewProjectile(NPC.GetSource_FromAI(), 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 036bc831e0..77dfd5eced 100644 --- a/NPCs/ExoMechs/Ares/AresLaserCannon.cs +++ b/NPCs/ExoMechs/Ares/AresLaserCannon.cs @@ -440,7 +440,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LaserCannon"), NPC.Center); Vector2 laserVelocity = Vector2.Normalize(player.Center - NPC.Center); Vector2 offset = laserVelocity * 70f + Vector2.UnitY * 16f; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + offset, player.Center, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, player.Center, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } @@ -476,7 +476,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares if (laserVelocity.HasNaNs()) laserVelocity = -Vector2.UnitY; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), source, laserVelocity, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), 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 d240ed40db..c6a1b479e8 100644 --- a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs +++ b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs @@ -434,9 +434,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares Vector2 offset = Vector2.Normalize(plasmaBoltVelocity) * 40f + Vector2.UnitY * 16f; if (boltsSplitLess) - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + offset, plasmaBoltVelocity, type, damage, 0f, Main.myPlayer, -1f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, plasmaBoltVelocity, type, damage, 0f, Main.myPlayer, -1f); else - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + offset, plasmaBoltVelocity, type, damage, 0f, Main.myPlayer, player.Center.X, player.Center.Y); + Projectile.NewProjectile(NPC.GetSource_FromAI(), 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 b8b8fca182..f27c986791 100644 --- a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs +++ b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs @@ -429,7 +429,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.GetSpawnSource_ForProjectile(), NPC.Center + offset, teslaOrbVelocity, type, damage, 0f, Main.myPlayer, identity); + Projectile.NewProjectile(NPC.GetSource_FromAI(), 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 2b811d4ebc..f36d96c313 100644 --- a/NPCs/ExoMechs/Artemis/Artemis.cs +++ b/NPCs/ExoMechs/Artemis/Artemis.cs @@ -719,7 +719,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis Vector2 projectileDestination = player.Center + predictionVector; Vector2 offset = laserVelocity * 70f; float setVelocityInAI = 6.5f; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + offset, projectileDestination, type, damage, 0f, Main.myPlayer, setVelocityInAI, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, projectileDestination, type, damage, 0f, Main.myPlayer, setVelocityInAI, NPC.whoAmI); } } } @@ -754,7 +754,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LaserCannon"), NPC.Center); Vector2 laserVelocity = Vector2.Normalize(aimedVector); Vector2 offset = laserVelocity * 50f; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + offset, laserVelocity, type, 0, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, laserVelocity, type, 0, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } @@ -780,7 +780,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis Vector2 offset = normalizedPerturbedSpeed * 70f; Vector2 newCenter = NPC.Center + offset; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), newCenter, newCenter + normalizedPerturbedSpeed * distanceFromTarget, type, damage, 0f, Main.myPlayer, setVelocityInAI, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), newCenter, newCenter + normalizedPerturbedSpeed * distanceFromTarget, type, damage, 0f, Main.myPlayer, setVelocityInAI, NPC.whoAmI); } } } @@ -873,7 +873,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis Vector2 offset = normalizedPerturbedSpeed * 70f; Vector2 newCenter = NPC.Center + offset; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), newCenter, newCenter + normalizedPerturbedSpeed * distanceFromTarget, type, damage, 0f, Main.myPlayer, setVelocityInAI, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), newCenter, newCenter + normalizedPerturbedSpeed * distanceFromTarget, type, damage, 0f, Main.myPlayer, setVelocityInAI, NPC.whoAmI); } } } @@ -935,7 +935,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LaserCannon"), NPC.Center); Vector2 laserVelocity = Vector2.Normalize(spinningPoint - NPC.Center); Vector2 offset = laserVelocity * 70f; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + offset, laserVelocity, type, 0, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, laserVelocity, type, 0, 0f, Main.myPlayer, 0f, NPC.whoAmI); } NPC.netUpdate = true; @@ -1002,7 +1002,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.GetSpawnSource_ForProjectile(), NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer, NPC.whoAmI); + int laser = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer, NPC.whoAmI); if (Main.projectile.IndexInRange(laser)) { Main.projectile[laser].ai[0] = NPC.whoAmI; @@ -1095,7 +1095,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis Vector2 offset = lensDirection * 70f; if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + offset, lensDirection * 24f, ModContent.ProjectileType(), 0, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), 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 c6cde42e1b..62ec39228a 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs @@ -311,7 +311,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos // Normal laser int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } @@ -381,21 +381,21 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (calamityGlobalNPC_Head.newAI[1] == (float)ThanatosHead.SecondaryPhase.Passive) { // Normal laser - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), 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.GetSpawnSource_ForProjectile(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), 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.GetSpawnSource_ForProjectile(), NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), 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.GetSpawnSource_ForProjectile(), NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), 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 960f2fe585..4481c7b8fb 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs @@ -311,7 +311,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos // Normal laser int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } @@ -381,21 +381,21 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (calamityGlobalNPC_Head.newAI[1] == (float)ThanatosHead.SecondaryPhase.Passive) { // Normal laser - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), 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.GetSpawnSource_ForProjectile(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), 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.GetSpawnSource_ForProjectile(), NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), 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.GetSpawnSource_ForProjectile(), NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), 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 dc49b7197f..ac44a2cc19 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs @@ -335,12 +335,12 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (num36 >= 0 && num36 < minLength) { if (num36 % 2 == 0) - lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); else - lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); } else - lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); Main.npc[lol].realLife = NPC.whoAmI; Main.npc[lol].ai[2] = NPC.whoAmI; @@ -856,7 +856,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos int type = ModContent.ProjectileType(); for (int b = 0; b < 6; b++) { - int beam = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, Vector2.Zero, type, 0, 0f, 255, NPC.whoAmI); + int beam = Projectile.NewProjectile(NPC.GetSource_FromAI(), 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)) @@ -867,7 +867,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos Main.projectile[beam].ai[1] = MathHelper.Lerp(-0.74f, 0.74f, smoothenedRatio); } } - int beam2 = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, Vector2.Zero, type, 0, 0f, 255, NPC.whoAmI); + int beam2 = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, type, 0, 0f, 255, NPC.whoAmI); if (Main.projectile.IndexInRange(beam2)) Main.projectile[beam2].ai[0] = NPC.whoAmI; } @@ -882,7 +882,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), 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 cadbc67a92..037d358ff4 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs @@ -311,7 +311,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos // Normal laser int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } @@ -381,21 +381,21 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (calamityGlobalNPC_Head.newAI[1] == (float)ThanatosHead.SecondaryPhase.Passive) { // Normal laser - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), 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.GetSpawnSource_ForProjectile(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), 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.GetSpawnSource_ForProjectile(), NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), 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.GetSpawnSource_ForProjectile(), NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } diff --git a/NPCs/GreatSandShark/GreatSandShark.cs b/NPCs/GreatSandShark/GreatSandShark.cs index 57c0ede0d6..8a8809fe5c 100644 --- a/NPCs/GreatSandShark/GreatSandShark.cs +++ b/NPCs/GreatSandShark/GreatSandShark.cs @@ -298,7 +298,7 @@ namespace CalamityMod.NPCs.GreatSandShark if (spawnFlag && Main.netMode != NetmodeID.MultiplayerClient) { - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.Center.X, (int)NPC.Center.Y + 50, NPCID.SandShark, 0, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y + 50, NPCID.SandShark, 0, 0f, 0f, 0f, 0f, 255); SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/GreatSandSharkRoar"), (int)NPC.position.X, (int)NPC.position.Y); } } @@ -412,7 +412,7 @@ namespace CalamityMod.NPCs.GreatSandShark } int spawnX = (int)(NPC.width / 2); for (int sand = 0; sand < 5; sand++) - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center.X + (float)Main.rand.Next(-spawnX, spawnX), NPC.Center.Y, + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X + (float)Main.rand.Next(-spawnX, spawnX), NPC.Center.Y, (float)Main.rand.Next(-3, 4), (float)Main.rand.Next(-12, -6), ModContent.ProjectileType(), 40, 0f, Main.myPlayer, 0f, 0f); } NPC.ai[2] = -30f; diff --git a/NPCs/HiveMind/DankCreeper.cs b/NPCs/HiveMind/DankCreeper.cs index 53e2bfc61d..7db20f89a8 100644 --- a/NPCs/HiveMind/DankCreeper.cs +++ b/NPCs/HiveMind/DankCreeper.cs @@ -137,14 +137,14 @@ namespace CalamityMod.NPCs.HiveMind { int closestPlayer = Player.FindClosest(NPC.Center, 1, 1); if (Main.rand.Next(4) == 0 && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2) - Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); + Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); } if ((Main.expertMode || BossRushEvent.BossRushActive) && Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer); } } } diff --git a/NPCs/HiveMind/DarkHeart.cs b/NPCs/HiveMind/DarkHeart.cs index 8ddc939627..05ecfe4903 100644 --- a/NPCs/HiveMind/DarkHeart.cs +++ b/NPCs/HiveMind/DarkHeart.cs @@ -119,7 +119,7 @@ namespace CalamityMod.NPCs.HiveMind int num1170 = (int)(NPC.position.Y + NPC.height + 4f); int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), num1169, num1170, 0f, 4f, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), num1169, num1170, 0f, 4f, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -130,7 +130,7 @@ namespace CalamityMod.NPCs.HiveMind { int closestPlayer = Player.FindClosest(NPC.Center, 1, 1); if (Main.rand.Next(4) == 0 && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2) - Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); + Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); } } diff --git a/NPCs/HiveMind/HiveBlob.cs b/NPCs/HiveMind/HiveBlob.cs index c3fe6d1199..54f43dcb96 100644 --- a/NPCs/HiveMind/HiveBlob.cs +++ b/NPCs/HiveMind/HiveBlob.cs @@ -165,7 +165,7 @@ namespace CalamityMod.NPCs.HiveMind num943 *= num944; int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector104.X, vector104.Y, num942, num943, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vector104.X, vector104.Y, num942, num943, type, damage, 0f, Main.myPlayer, 0f, 0f); NPC.netUpdate = true; } } @@ -178,7 +178,7 @@ namespace CalamityMod.NPCs.HiveMind { int closestPlayer = Player.FindClosest(NPC.Center, 1, 1); if (Main.rand.Next(4) == 0 && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2) - Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); + Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); } } diff --git a/NPCs/HiveMind/HiveBlob2.cs b/NPCs/HiveMind/HiveBlob2.cs index 34611b650a..a4f0a08186 100644 --- a/NPCs/HiveMind/HiveBlob2.cs +++ b/NPCs/HiveMind/HiveBlob2.cs @@ -146,7 +146,7 @@ namespace CalamityMod.NPCs.HiveMind num943 *= num944; int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector104.X, vector104.Y, num942, num943, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vector104.X, vector104.Y, num942, num943, type, damage, 0f, Main.myPlayer, 0f, 0f); NPC.netUpdate = true; } } @@ -159,7 +159,7 @@ namespace CalamityMod.NPCs.HiveMind { int closestPlayer = Player.FindClosest(NPC.Center, 1, 1); if (Main.rand.Next(4) == 0 && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2) - Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); + Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); } } diff --git a/NPCs/HiveMind/HiveMind.cs b/NPCs/HiveMind/HiveMind.cs index 1cbceff623..1bb7c57b5e 100644 --- a/NPCs/HiveMind/HiveMind.cs +++ b/NPCs/HiveMind/HiveMind.cs @@ -329,7 +329,7 @@ namespace CalamityMod.NPCs.HiveMind while (NPC.AnyNPCs(type) && choice < 5); if (choice < 5) - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + Main.rand.Next(NPC.width), (int)NPC.position.Y + Main.rand.Next(NPC.height), type); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + Main.rand.Next(NPC.width), (int)NPC.position.Y + Main.rand.Next(NPC.height), type); } } @@ -486,7 +486,7 @@ namespace CalamityMod.NPCs.HiveMind NPC.localAI[0] = 1f; int maxBlobs = death ? 15 : revenge ? 7 : expertMode ? 6 : 5; for (int i = 0; i < maxBlobs; i++) - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType(), NPC.whoAmI); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType(), NPC.whoAmI); } } @@ -514,7 +514,7 @@ namespace CalamityMod.NPCs.HiveMind if (NPC.CountNPCS(ModContent.NPCType()) < maxDankSpawns) type = ModContent.NPCType(); - int num664 = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), x, y, type); + int num664 = NPC.NewNPC(NPC.GetSource_FromAI(), x, y, type); Main.npc[num664].SetDefaults(type); if (Main.netMode == NetmodeID.Server && num664 < Main.maxNPCs) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num664, 0f, 0f, 0f, 0, 0, 0); @@ -886,10 +886,10 @@ namespace CalamityMod.NPCs.HiveMind if (NPC.ai[0] == 2 || NPC.ai[0] == 4) { if (expertMode && !NPC.AnyNPCs(ModContent.NPCType())) - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType()); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType()); } else if (!NPC.AnyNPCs(NPCID.EaterofSouls)) - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.Center.X, (int)NPC.Center.Y, NPCID.EaterofSouls); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, NPCID.EaterofSouls); } if (NPC.ai[0] == 6) @@ -940,7 +940,7 @@ namespace CalamityMod.NPCs.HiveMind { int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.position.X + Main.rand.Next(NPC.width), NPC.position.Y + Main.rand.Next(NPC.height), 0, 0, type, damage, 0, Main.myPlayer, 11, 0); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.position.X + Main.rand.Next(NPC.width), NPC.position.Y + Main.rand.Next(NPC.height), 0, 0, type, damage, 0, Main.myPlayer, 11, 0); } if (NPC.ai[0] == 10) diff --git a/NPCs/Leviathan/AquaticAberration.cs b/NPCs/Leviathan/AquaticAberration.cs index 4aac8cfde6..195be18c16 100644 --- a/NPCs/Leviathan/AquaticAberration.cs +++ b/NPCs/Leviathan/AquaticAberration.cs @@ -234,7 +234,7 @@ namespace CalamityMod.NPCs.Leviathan { int closestPlayer = Player.FindClosest(NPC.Center, 1, 1); if (Main.rand.Next(4) == 0 && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2) - Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); + Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); } } diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index 0cb93664fe..1005a7e048 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -353,7 +353,7 @@ namespace CalamityMod.NPCs.Leviathan num416 *= num417; vector40.X += num415 * 4f; vector40.Y += num416 * 4f; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector40.X, vector40.Y, num415, num416, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vector40.X, vector40.Y, num415, num416, type, damage, 0f, Main.myPlayer); if (soundDelay <= 0) { soundDelay = 120; @@ -394,7 +394,7 @@ namespace CalamityMod.NPCs.Leviathan { SoundEngine.PlaySound(SoundID.Zombie, (int)vector.X, (int)vector.Y, soundChoice); if (Main.netMode != NetmodeID.MultiplayerClient) - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)vector119.X, (int)vector119.Y, ModContent.NPCType()); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)vector119.X, (int)vector119.Y, ModContent.NPCType()); } if (num1060 > ((sirenAlive && !phase4) ? 1000f : 800f)) diff --git a/NPCs/Leviathan/Siren.cs b/NPCs/Leviathan/Siren.cs index 0ae2cc355e..fec3b79722 100644 --- a/NPCs/Leviathan/Siren.cs +++ b/NPCs/Leviathan/Siren.cs @@ -209,7 +209,7 @@ namespace CalamityMod.NPCs.Leviathan NPC.alpha = Utils.Clamp(NPC.alpha + 9, 0, 255); if (Main.netMode != NetmodeID.MultiplayerClient && NPC.alpha >= 255 && oldAlpha < 255) { - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f); HasBegunSummoningLeviathan = true; NPC.netUpdate = true; } @@ -230,7 +230,7 @@ namespace CalamityMod.NPCs.Leviathan { if (NPC.ai[3] == 0f && NPC.localAI[1] == 0f && Main.netMode != NetmodeID.MultiplayerClient) { - int num6 = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType(), NPC.whoAmI); + int num6 = NPC.NewNPC(NPC.GetSource_FromAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType(), NPC.whoAmI); NPC.ai[3] = num6 + 1; NPC.localAI[1] = -1f; NPC.localAI[2] += 1f; @@ -493,7 +493,7 @@ namespace CalamityMod.NPCs.Leviathan SoundEngine.PlaySound(SoundID.Item, (int)NPC.position.X, (int)NPC.position.Y, 85); if (Main.netMode != NetmodeID.MultiplayerClient) { - int spawn = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)vector119.X, (int)vector119.Y, NPCID.DetonatingBubble); + int spawn = NPC.NewNPC(NPC.GetSource_FromAI(), (int)vector119.X, (int)vector119.Y, NPCID.DetonatingBubble); Main.npc[spawn].target = NPC.target; Main.npc[spawn].velocity = player.Center - vector119; Main.npc[spawn].velocity.Normalize(); @@ -624,7 +624,7 @@ namespace CalamityMod.NPCs.Leviathan { Vector2 spawnVector = player.Center + Vector2.Normalize(new Vector2(0f, -projectileVelocity).RotatedBy(radians * i)) * projectileDistance; Vector2 projVelocity = Vector2.Normalize(player.Center - spawnVector) * projectileVelocity; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), spawnVector, projVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, projVelocity, type, damage, 0f, Main.myPlayer); } } diff --git a/NPCs/NormalNPCs/ArmoredDiggerBody.cs b/NPCs/NormalNPCs/ArmoredDiggerBody.cs index b612984295..49680f4c35 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerBody.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerBody.cs @@ -91,7 +91,7 @@ namespace CalamityMod.NPCs.NormalNPCs int num10 = ProjectileID.SaucerScrap; vector.X += num6 * 5f; vector.Y += num7 * 5f; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector.X, vector.Y, num6, num7, num10, num9, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vector.X, vector.Y, num6, num7, num10, num9, 0f, Main.myPlayer, 0f, 0f); NPC.netUpdate = true; } } diff --git a/NPCs/NormalNPCs/ArmoredDiggerHead.cs b/NPCs/NormalNPCs/ArmoredDiggerHead.cs index 6a5875b433..96f120adbc 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerHead.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerHead.cs @@ -72,7 +72,7 @@ namespace CalamityMod.NPCs.NormalNPCs { num4 = ModContent.NPCType(); } - int num5 = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)(NPC.position.X + (float)(NPC.width / 2)), (int)(NPC.position.Y + (float)NPC.height), num4, NPC.whoAmI, 0f, 0f, 0f, 0f, 255); + int num5 = NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.position.X + (float)(NPC.width / 2)), (int)(NPC.position.Y + (float)NPC.height), num4, NPC.whoAmI, 0f, 0f, 0f, 0f, 255); Main.npc[num5].ai[3] = (float)NPC.whoAmI; Main.npc[num5].realLife = NPC.whoAmI; Main.npc[num5].ai[1] = (float)num2; diff --git a/NPCs/NormalNPCs/Cnidrion.cs b/NPCs/NormalNPCs/Cnidrion.cs index 1d858a86db..79049e97a5 100644 --- a/NPCs/NormalNPCs/Cnidrion.cs +++ b/NPCs/NormalNPCs/Cnidrion.cs @@ -142,7 +142,7 @@ namespace CalamityMod.NPCs.NormalNPCs num830 *= num831; num829 *= 1f + Main.rand.Next(-10, 11) * 0.01f; num830 *= 1f + Main.rand.Next(-10, 11) * 0.01f; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector18.X, vector18.Y, num829, num830, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vector18.X, vector18.Y, num829, num830, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer); } if (NPC.ai[1] >= 120f) { @@ -167,7 +167,7 @@ namespace CalamityMod.NPCs.NormalNPCs num830 *= num831; num829 *= 1f + Main.rand.Next(-15, 16) * 0.01f; num830 *= 1f + Main.rand.Next(-15, 16) * 0.01f; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector18.X, vector18.Y, num829, num830, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vector18.X, vector18.Y, num829, num830, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer); } if (NPC.ai[1] >= 300f) { @@ -192,7 +192,7 @@ namespace CalamityMod.NPCs.NormalNPCs num845 *= num846; num844 *= 1f + Main.rand.Next(-10, 11) * 0.001f; num845 *= 1f + Main.rand.Next(-10, 11) * 0.001f; - int num848 = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector18.X, vector18.Y, num844, num845, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer); + int num848 = Projectile.NewProjectile(NPC.GetSource_FromAI(), vector18.X, vector18.Y, num844, num845, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer); } if (NPC.ai[1] >= 120f) { @@ -217,7 +217,7 @@ namespace CalamityMod.NPCs.NormalNPCs num830 *= num831; num829 *= 1f + Main.rand.Next(-5, 6) * 0.01f; num830 *= 1f + Main.rand.Next(-5, 6) * 0.01f; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector18.X, vector18.Y, num829, num830, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vector18.X, vector18.Y, num829, num830, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer); } if (NPC.ai[1] >= 240f) { diff --git a/NPCs/NormalNPCs/Eidolist.cs b/NPCs/NormalNPCs/Eidolist.cs index 090a77ed7e..4b5d0d8572 100644 --- a/NPCs/NormalNPCs/Eidolist.cs +++ b/NPCs/NormalNPCs/Eidolist.cs @@ -173,7 +173,7 @@ namespace CalamityMod.NPCs.NormalNPCs int damage = adultWyrmAlive ? (Main.expertMode ? 150 : 200) : (Main.expertMode ? 30 : 40); if (Main.rand.NextBool(2)) { - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, targetVec, ProjectileID.CultistBossLightningOrb, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetVec, ProjectileID.CultistBossLightningOrb, damage, 0f, Main.myPlayer, 0f, 0f); } else { @@ -186,7 +186,7 @@ namespace CalamityMod.NPCs.NormalNPCs for (int n = 0; n < 1; n++) { Vector2 vector4 = vec * 4f; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector4, ProjectileID.CultistBossIceMist, damage, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, vector4, ProjectileID.CultistBossIceMist, damage, 0f, Main.myPlayer, 0f, 1f); } } } diff --git a/NPCs/NormalNPCs/Horse.cs b/NPCs/NormalNPCs/Horse.cs index 82b0053676..c3b30a6af9 100644 --- a/NPCs/NormalNPCs/Horse.cs +++ b/NPCs/NormalNPCs/Horse.cs @@ -204,7 +204,7 @@ namespace CalamityMod.NPCs.NormalNPCs num182 += Main.rand.Next(-40, 41); num180 *= num183; num182 *= num183; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), value9.X, value9.Y, num180, num182, num185, num184, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), value9.X, value9.Y, num180, num182, num185, num184, 0f, Main.myPlayer, 0f, 0f); } } } diff --git a/NPCs/NormalNPCs/IceClasper.cs b/NPCs/NormalNPCs/IceClasper.cs index 40ba98ef04..c2c37de9cb 100644 --- a/NPCs/NormalNPCs/IceClasper.cs +++ b/NPCs/NormalNPCs/IceClasper.cs @@ -136,7 +136,7 @@ namespace CalamityMod.NPCs.NormalNPCs if (Collision.CanHit(NPC.position, NPC.width, NPC.height, Main.player[NPC.target].position, Main.player[NPC.target].width, Main.player[NPC.target].height)) { int num9 = ProjectileID.FrostBlastHostile; - int beam = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector.X, vector.Y, num4, num5, num9, 45, 0f, Main.myPlayer, 0f, 0f); + int beam = Projectile.NewProjectile(NPC.GetSource_FromAI(), vector.X, vector.Y, num4, num5, num9, 45, 0f, Main.myPlayer, 0f, 0f); Main.projectile[beam].timeLeft = 300; } } diff --git a/NPCs/NormalNPCs/ImpiousImmolator.cs b/NPCs/NormalNPCs/ImpiousImmolator.cs index d31772ac01..eedfa9153c 100644 --- a/NPCs/NormalNPCs/ImpiousImmolator.cs +++ b/NPCs/NormalNPCs/ImpiousImmolator.cs @@ -145,7 +145,7 @@ namespace CalamityMod.NPCs.NormalNPCs { damage = 42; } - int beam = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center.X, NPC.Center.Y, num6, num7, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + int beam = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y, num6, num7, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); Main.projectile[beam].tileCollide = true; } } diff --git a/NPCs/NormalNPCs/KingSlimeJewel.cs b/NPCs/NormalNPCs/KingSlimeJewel.cs index 4babf04b2f..32b38e2078 100644 --- a/NPCs/NormalNPCs/KingSlimeJewel.cs +++ b/NPCs/NormalNPCs/KingSlimeJewel.cs @@ -145,11 +145,11 @@ namespace CalamityMod.NPCs.NormalNPCs for (int i = 0; i < numProj + 1; i++) { Vector2 perturbedSpeed = projVector.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1))); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), npcPos, perturbedSpeed, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), npcPos, perturbedSpeed, type, damage, 0f, Main.myPlayer, 0f, 0f); } } else - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), npcPos, projVector, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), npcPos, projVector, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } diff --git a/NPCs/NormalNPCs/MantisShrimp.cs b/NPCs/NormalNPCs/MantisShrimp.cs index 79ea0e29e6..881a45578b 100644 --- a/NPCs/NormalNPCs/MantisShrimp.cs +++ b/NPCs/NormalNPCs/MantisShrimp.cs @@ -85,7 +85,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void OnHitPlayer(Player player, int damage, bool crit) { if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.Center, Vector2.Zero, ProjectileID.SolarWhipSwordExplosion, 0, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.Center, Vector2.Zero, ProjectileID.SolarWhipSwordExplosion, 0, 0f, Main.myPlayer); } public override void FindFrame(int frameHeight) diff --git a/NPCs/NormalNPCs/PhantomSpiritL.cs b/NPCs/NormalNPCs/PhantomSpiritL.cs index b65c15c654..b2e87fa0e9 100644 --- a/NPCs/NormalNPCs/PhantomSpiritL.cs +++ b/NPCs/NormalNPCs/PhantomSpiritL.cs @@ -93,7 +93,7 @@ namespace CalamityMod.NPCs.NormalNPCs num149 = num151 / num149; num147 *= num149; num148 *= num149; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector17.X, vector17.Y, num147, num148, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vector17.X, vector17.Y, num147, num148, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } diff --git a/NPCs/NormalNPCs/ProfanedEnergyBody.cs b/NPCs/NormalNPCs/ProfanedEnergyBody.cs index 0a399a6a87..14983c231f 100644 --- a/NPCs/NormalNPCs/ProfanedEnergyBody.cs +++ b/NPCs/NormalNPCs/ProfanedEnergyBody.cs @@ -49,7 +49,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.localAI[0] = 1f; for (int num723 = 0; num723 < 2; num723++) { - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType(), NPC.whoAmI, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType(), NPC.whoAmI, 0f, 0f, 0f, 0f, 255); } } } diff --git a/NPCs/NormalNPCs/ProfanedEnergyLantern.cs b/NPCs/NormalNPCs/ProfanedEnergyLantern.cs index bb05a6d658..278267eda4 100644 --- a/NPCs/NormalNPCs/ProfanedEnergyLantern.cs +++ b/NPCs/NormalNPCs/ProfanedEnergyLantern.cs @@ -167,7 +167,7 @@ namespace CalamityMod.NPCs.NormalNPCs num189 *= num191; num190 *= num191; int num9 = ModContent.ProjectileType(); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center.X, NPC.Center.Y, num189, num190, num9, 40, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y, num189, num190, num9, 40, 0f, Main.myPlayer, 0f, 0f); NPC.localAI[1] = 0f; return; } diff --git a/NPCs/NormalNPCs/ShockstormShuttle.cs b/NPCs/NormalNPCs/ShockstormShuttle.cs index 08be51236c..4998ae9a88 100644 --- a/NPCs/NormalNPCs/ShockstormShuttle.cs +++ b/NPCs/NormalNPCs/ShockstormShuttle.cs @@ -82,7 +82,7 @@ namespace CalamityMod.NPCs.NormalNPCs velocity.Y += Main.rand.Next(-20, 21); velocity.X *= targetDist; velocity.Y *= targetDist; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), npcPos, velocity, projType, projDmg, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), npcPos, velocity, projType, projDmg, 0f, Main.myPlayer, 0f, 0f); } } } diff --git a/NPCs/NormalNPCs/ThiccWaifu.cs b/NPCs/NormalNPCs/ThiccWaifu.cs index 52eaad50bb..b159385615 100644 --- a/NPCs/NormalNPCs/ThiccWaifu.cs +++ b/NPCs/NormalNPCs/ThiccWaifu.cs @@ -245,9 +245,9 @@ namespace CalamityMod.NPCs.NormalNPCs float cloudSpawnOutwardness = (AttackTimer - cloudSummonDelay) / cloudSummonRate * 50f; Vector2 spawnPosition = NPC.Top + new Vector2(cloudSpawnOutwardness, -36); - Projectile.NewProjectileDirect(NPC.GetSpawnSource_ForProjectile(), spawnPosition, Vector2.Zero, projectileType, lightningDamage, 0f, Main.myPlayer); + Projectile.NewProjectileDirect(NPC.GetSource_FromAI(), spawnPosition, Vector2.Zero, projectileType, lightningDamage, 0f, Main.myPlayer); spawnPosition = NPC.Top + new Vector2(-cloudSpawnOutwardness, -36); - Projectile.NewProjectileDirect(NPC.GetSpawnSource_ForProjectile(), spawnPosition, Vector2.Zero, projectileType, lightningDamage, 0f, Main.myPlayer); + Projectile.NewProjectileDirect(NPC.GetSource_FromAI(), spawnPosition, Vector2.Zero, projectileType, lightningDamage, 0f, Main.myPlayer); } } @@ -275,7 +275,7 @@ namespace CalamityMod.NPCs.NormalNPCs { float angle = MathHelper.TwoPi / totalTornadosToSummon * i; Vector2 spawnPosition = Target.Center + angle.ToRotationVector2() * 620f; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), spawnPosition, Vector2.Zero, projectileType, 0, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnPosition, Vector2.Zero, projectileType, 0, 0f, Main.myPlayer); } } @@ -310,7 +310,7 @@ namespace CalamityMod.NPCs.NormalNPCs { Tile tileAtPosition = CalamityUtils.ParanoidTileRetrieval(spawnPosition.X, spawnPosition.Y); if (!tileAtPosition.HasTile) - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), spawnPosition.X, spawnPosition.Y, NPCID.AngryNimbus); + NPC.NewNPC(NPC.GetSource_FromAI(), spawnPosition.X, spawnPosition.Y, NPCID.AngryNimbus); } // Create sound cloud dust at the position where the nimbus was spawned. diff --git a/NPCs/NormalNPCs/WulfrumDrone.cs b/NPCs/NormalNPCs/WulfrumDrone.cs index cb0e067461..030b373c4c 100644 --- a/NPCs/NormalNPCs/WulfrumDrone.cs +++ b/NPCs/NormalNPCs/WulfrumDrone.cs @@ -156,7 +156,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.velocity = Vector2.Lerp(NPC.velocity, NPC.SafeDirectionTo(player.Center) * 6f, 0.1f); if (Supercharged && Main.netMode != NetmodeID.MultiplayerClient && HorizontalChargeTime % 30f == 29f) - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + Vector2.UnitX * 6f * NPC.spriteDirection, NPC.SafeDirectionTo(player.Center, Vector2.UnitY) * 6f, ProjectileID.SaucerLaser, 12, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.UnitX * 6f * NPC.spriteDirection, NPC.SafeDirectionTo(player.Center, Vector2.UnitY) * 6f, ProjectileID.SaucerLaser, 12, 0f); HorizontalChargeTime++; if (HorizontalChargeTime > TotalHorizontalChargeTime) diff --git a/NPCs/NormalNPCs/WulfrumPylon.cs b/NPCs/NormalNPCs/WulfrumPylon.cs index bb761d3ded..96baac968e 100644 --- a/NPCs/NormalNPCs/WulfrumPylon.cs +++ b/NPCs/NormalNPCs/WulfrumPylon.cs @@ -98,7 +98,7 @@ namespace CalamityMod.NPCs.NormalNPCs if (tries < 500) { int npcToSpawn = Main.rand.NextBool(2) ? ModContent.NPCType() : ModContent.NPCType(); - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)spawnPosition.X, (int)spawnPosition.Y, npcToSpawn); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)spawnPosition.X, (int)spawnPosition.Y, npcToSpawn); } } Charging = true; diff --git a/NPCs/OldDuke/OldDukeSharkron.cs b/NPCs/OldDuke/OldDukeSharkron.cs index c478d06193..b60042872d 100644 --- a/NPCs/OldDuke/OldDukeSharkron.cs +++ b/NPCs/OldDuke/OldDukeSharkron.cs @@ -196,7 +196,7 @@ namespace CalamityMod.NPCs.OldDuke { int closestPlayer = Player.FindClosest(NPC.Center, 1, 1); if (Main.rand.Next(8) == 0 && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2) - Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); + Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); } } @@ -292,7 +292,7 @@ namespace CalamityMod.NPCs.OldDuke int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); for (int i = 0; i < 2; i++) - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center.X + Main.rand.Next(-spawnX, spawnX), NPC.Center.Y, + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X + Main.rand.Next(-spawnX, spawnX), NPC.Center.Y, Main.rand.Next(-3, 4), Main.rand.Next(-12, -6), type, damage, 0f, Main.myPlayer); } diff --git a/NPCs/OldDuke/OldDukeToothBall.cs b/NPCs/OldDuke/OldDukeToothBall.cs index a19b14f0f7..4ba30202ea 100644 --- a/NPCs/OldDuke/OldDukeToothBall.cs +++ b/NPCs/OldDuke/OldDukeToothBall.cs @@ -183,7 +183,7 @@ namespace CalamityMod.NPCs.OldDuke { int closestPlayer = Player.FindClosest(NPC.Center, 1, 1); if (Main.rand.Next(8) == 0 && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2) - Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); + Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); } } @@ -246,13 +246,13 @@ namespace CalamityMod.NPCs.OldDuke { float velocity = (CalamityWorld.malice || BossRushEvent.BossRushActive) ? Main.rand.Next(6, 10) : Main.rand.Next(7, 11); Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * k); - int proj = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer); + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer); Main.projectile[proj].timeLeft = 360; } type = ModContent.ProjectileType(); damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer); } return true; diff --git a/NPCs/Other/CalamitasEnchantDemon.cs b/NPCs/Other/CalamitasEnchantDemon.cs index 8e347ee2b0..396030dfb2 100644 --- a/NPCs/Other/CalamitasEnchantDemon.cs +++ b/NPCs/Other/CalamitasEnchantDemon.cs @@ -159,7 +159,7 @@ namespace CalamityMod.NPCs.Other for (int i = 0; i < 4; i++) { Vector2 shootVelocity = NPC.SafeDirectionTo(Target.Center).RotatedByRandom(0.6f) * Main.rand.NextFloat(12f, 14f); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, shootVelocity, ModContent.ProjectileType(), 0, 0f, NPC.target); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, shootVelocity, ModContent.ProjectileType(), 0, 0f, NPC.target); } } } diff --git a/NPCs/Other/DemonPortal.cs b/NPCs/Other/DemonPortal.cs index 7a67129849..2619edf51b 100644 --- a/NPCs/Other/DemonPortal.cs +++ b/NPCs/Other/DemonPortal.cs @@ -67,7 +67,7 @@ namespace CalamityMod.NPCs.Other bool friendly = NPC.life == 1; for (int i = 0; i < 6; i++) { - int demon = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, Main.rand.NextVector2CircularEdge(4f, 4f), ModContent.ProjectileType(), 17000, 0f, NPC.target); + int demon = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Main.rand.NextVector2CircularEdge(4f, 4f), ModContent.ProjectileType(), 17000, 0f, NPC.target); if (Main.projectile.IndexInRange(demon)) { Main.projectile[demon].ai[1] = Main.rand.Next(-40, 0); diff --git a/NPCs/Other/LecherousOrb.cs b/NPCs/Other/LecherousOrb.cs index c563289989..3899cac8a7 100644 --- a/NPCs/Other/LecherousOrb.cs +++ b/NPCs/Other/LecherousOrb.cs @@ -186,7 +186,7 @@ namespace CalamityMod.NPCs.Other { int heartsToGive = (int)MathHelper.Lerp(0f, 7f, Utils.GetLerpValue(45f, 540f, Time, true)); for (int i = 0; i < heartsToGive; i++) - Item.NewItem(NPC.GetItemSource_Loot(), NPC.Hitbox, ItemID.Heart); + Item.NewItem(NPC.GetSource_Loot(), NPC.Hitbox, ItemID.Heart); } public override Color? GetAlpha(Color drawColor) => Color.White * NPC.Opacity; diff --git a/NPCs/Perforator/PerforatorBodyMedium.cs b/NPCs/Perforator/PerforatorBodyMedium.cs index 9f4d982e6a..caa555416e 100644 --- a/NPCs/Perforator/PerforatorBodyMedium.cs +++ b/NPCs/Perforator/PerforatorBodyMedium.cs @@ -81,9 +81,9 @@ namespace CalamityMod.NPCs.Perforator if (NPC.ai[0] == 0f) { if (NPC.ai[2] > 0f) - NPC.ai[0] = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)(NPC.position.X + (NPC.width / 2)), (int)(NPC.position.Y + NPC.height), NPC.type, NPC.whoAmI, 0f, 0f, 0f, 0f, 255); + NPC.ai[0] = NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.position.X + (NPC.width / 2)), (int)(NPC.position.Y + NPC.height), NPC.type, NPC.whoAmI, 0f, 0f, 0f, 0f, 255); else - NPC.ai[0] = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)(NPC.position.X + (NPC.width / 2)), (int)(NPC.position.Y + NPC.height), ModContent.NPCType(), NPC.whoAmI, 0f, 0f, 0f, 0f, 255); + NPC.ai[0] = NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.position.X + (NPC.width / 2)), (int)(NPC.position.Y + NPC.height), ModContent.NPCType(), NPC.whoAmI, 0f, 0f, 0f, 0f, 255); Main.npc[(int)NPC.ai[0]].ai[1] = NPC.whoAmI; Main.npc[(int)NPC.ai[0]].ai[2] = NPC.ai[2] - 1f; @@ -199,7 +199,7 @@ namespace CalamityMod.NPCs.Perforator { int closestPlayer = Player.FindClosest(NPC.Center, 1, 1); if (Main.rand.Next(4) == 0 && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2) - Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); + Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); } } diff --git a/NPCs/Perforator/PerforatorHeadLarge.cs b/NPCs/Perforator/PerforatorHeadLarge.cs index 4e9ee09cc3..02c3479ffe 100644 --- a/NPCs/Perforator/PerforatorHeadLarge.cs +++ b/NPCs/Perforator/PerforatorHeadLarge.cs @@ -155,11 +155,11 @@ namespace CalamityMod.NPCs.Perforator int lol; if (num36 >= 0 && num36 < maxLength - 1) { - lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); } else { - lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); } if (num36 % 2 == 0) { @@ -580,7 +580,7 @@ namespace CalamityMod.NPCs.Perforator { int heartAmt = Main.rand.Next(3) + 3; for (int i = 0; i < heartAmt; i++) - Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); + Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); } } diff --git a/NPCs/Perforator/PerforatorHeadMedium.cs b/NPCs/Perforator/PerforatorHeadMedium.cs index 5803ec738a..997448ccd9 100644 --- a/NPCs/Perforator/PerforatorHeadMedium.cs +++ b/NPCs/Perforator/PerforatorHeadMedium.cs @@ -107,7 +107,7 @@ namespace CalamityMod.NPCs.Perforator { int totalSegments = death ? 14 : revenge ? 13 : expertMode ? 12 : 10; NPC.ai[2] = totalSegments; - NPC.ai[0] = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)(NPC.position.X + (NPC.width / 2)), (int)(NPC.position.Y + NPC.height), ModContent.NPCType(), NPC.whoAmI, 0f, 0f, 0f, 0f, 255); + NPC.ai[0] = NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.position.X + (NPC.width / 2)), (int)(NPC.position.Y + NPC.height), ModContent.NPCType(), NPC.whoAmI, 0f, 0f, 0f, 0f, 255); Main.npc[(int)NPC.ai[0]].ai[1] = NPC.whoAmI; Main.npc[(int)NPC.ai[0]].ai[2] = NPC.ai[2] - 1f; NPC.netUpdate = true; @@ -442,7 +442,7 @@ namespace CalamityMod.NPCs.Perforator { int closestPlayer = Player.FindClosest(NPC.Center, 1, 1); if (Main.rand.Next(4) == 0 && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2) - Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); + Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); } for (int i = 0; i < Main.maxNPCs; i++) diff --git a/NPCs/Perforator/PerforatorHeadSmall.cs b/NPCs/Perforator/PerforatorHeadSmall.cs index cdaac03666..16b906dcc1 100644 --- a/NPCs/Perforator/PerforatorHeadSmall.cs +++ b/NPCs/Perforator/PerforatorHeadSmall.cs @@ -136,11 +136,11 @@ namespace CalamityMod.NPCs.Perforator int lol; if (num36 >= 0 && num36 < maxLength - 1) { - lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); } else { - lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); } Main.npc[lol].realLife = NPC.whoAmI; Main.npc[lol].ai[2] = NPC.whoAmI; @@ -521,7 +521,7 @@ namespace CalamityMod.NPCs.Perforator { int heartAmt = Main.rand.Next(3) + 3; for (int i = 0; i < heartAmt; i++) - Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); + Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); } } diff --git a/NPCs/Perforator/PerforatorHive.cs b/NPCs/Perforator/PerforatorHive.cs index b49735147b..993dc79805 100644 --- a/NPCs/Perforator/PerforatorHive.cs +++ b/NPCs/Perforator/PerforatorHive.cs @@ -206,7 +206,7 @@ namespace CalamityMod.NPCs.Perforator large = true; wormType = ModContent.NPCType(); } - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.Center.X, (int)NPC.Center.Y, wormType, 1); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, wormType, 1); NPC.TargetClosest(); SoundEngine.PlaySound(SoundID.NPCDeath23, NPC.position); @@ -291,7 +291,7 @@ namespace CalamityMod.NPCs.Perforator if (blobVelocity.Y < 2f) blobVelocity.Y = 2f + sporeVelocityYAdd; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, blobVelocity, type, damage, 0f, Main.myPlayer, 0f, player.Center.Y); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, blobVelocity, type, damage, 0f, Main.myPlayer, 0f, player.Center.Y); } } @@ -353,7 +353,7 @@ namespace CalamityMod.NPCs.Perforator Vector2 velocity = destination + Vector2.UnitY * -maxVelocity; for (int i = 0; i < totalProjectiles + 1; i++) { - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), start, velocity, type, damage, 0f, Main.myPlayer, 0f, player.Center.Y); + Projectile.NewProjectile(NPC.GetSource_FromAI(), start, velocity, type, damage, 0f, Main.myPlayer, 0f, player.Center.Y); velocity.X += velocityAdjustment * NPC.direction; } } diff --git a/NPCs/Perforator/PerforatorTailMedium.cs b/NPCs/Perforator/PerforatorTailMedium.cs index 4e093d2bdd..4f01c9c8b9 100644 --- a/NPCs/Perforator/PerforatorTailMedium.cs +++ b/NPCs/Perforator/PerforatorTailMedium.cs @@ -190,7 +190,7 @@ namespace CalamityMod.NPCs.Perforator { int closestPlayer = Player.FindClosest(NPC.Center, 1, 1); if (Main.rand.Next(4) == 0 && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2) - Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); + Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); } } diff --git a/NPCs/PlagueEnemies/PlaguebringerShade.cs b/NPCs/PlagueEnemies/PlaguebringerShade.cs index 34244d0370..4e22ac83c1 100644 --- a/NPCs/PlagueEnemies/PlaguebringerShade.cs +++ b/NPCs/PlagueEnemies/PlaguebringerShade.cs @@ -353,7 +353,7 @@ namespace CalamityMod.NPCs.PlagueEnemies } if (NPC.CountNPCS(ModContent.NPCType()) < 3) { - int num1062 = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)vector119.X, (int)vector119.Y, num1061, 0, 0f, 0f, 0f, 0f, 255); + int num1062 = NPC.NewNPC(NPC.GetSource_FromAI(), (int)vector119.X, (int)vector119.Y, num1061, 0, 0f, 0f, 0f, 0f, 255); Main.npc[num1062].velocity.X = (float)Main.rand.Next(-200, 201) * 0.005f; Main.npc[num1062].velocity.Y = (float)Main.rand.Next(-200, 201) * 0.005f; Main.npc[num1062].localAI[0] = 60f; @@ -457,7 +457,7 @@ namespace CalamityMod.NPCs.PlagueEnemies if (Main.expertMode) damage = fireRocket ? 50 : 35; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector121.X, vector121.Y, num1071, num1072, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vector121.X, vector121.Y, num1071, num1072, type, damage, 0f, Main.myPlayer, 0f, 0f); } } if (!Collision.CanHit(new Vector2(vector121.X, vector121.Y - 30f), 1, 1, Main.player[NPC.target].position, Main.player[NPC.target].width, Main.player[NPC.target].height)) @@ -638,7 +638,7 @@ namespace CalamityMod.NPCs.PlagueEnemies { int heartAmt = Main.rand.Next(3) + 3; for (int i = 0; i < heartAmt; i++) - Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); + Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); } } diff --git a/NPCs/PlagueEnemies/PlaguedJungleSlime.cs b/NPCs/PlagueEnemies/PlaguedJungleSlime.cs index 60a502e948..4f190c9a10 100644 --- a/NPCs/PlagueEnemies/PlaguedJungleSlime.cs +++ b/NPCs/PlagueEnemies/PlaguedJungleSlime.cs @@ -75,7 +75,7 @@ namespace CalamityMod.NPCs.PlagueEnemies vector4.Y *= 1f + (float)Main.rand.Next(-50, 51) * 0.005f; vector4.Normalize(); vector4 *= 4f + (float)Main.rand.Next(-50, 51) * 0.01f; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector3.X, vector3.Y, vector4.X, vector4.Y, ModContent.ProjectileType(), 25, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vector3.X, vector3.Y, vector4.X, vector4.Y, ModContent.ProjectileType(), 25, 0f, Main.myPlayer, 0f, 0f); spikeTimer = 30f; } } @@ -96,7 +96,7 @@ namespace CalamityMod.NPCs.PlagueEnemies num14 *= num16; num15 *= num16; spikeTimer = 50f; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector3.X, vector3.Y, num14, num15, ModContent.ProjectileType(), 22, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vector3.X, vector3.Y, num14, num15, ModContent.ProjectileType(), 22, 0f, Main.myPlayer, 0f, 0f); } } } diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index a4f4c26b97..75ef1194aa 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -601,7 +601,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath if (Main.netMode != NetmodeID.MultiplayerClient) { if (expertMode && NPC.CountNPCS(ModContent.NPCType()) < 2) - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)vector119.X, (int)vector119.Y, ModContent.NPCType(), 0, 0f, 0f, 0f, challengeAmt); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)vector119.X, (int)vector119.Y, ModContent.NPCType(), 0, 0f, 0f, 0f, challengeAmt); float npcSpeed = (revenge ? 9f : 7f) + enrageScale * 2f; @@ -613,7 +613,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath num1071 *= num1073; num1072 *= num1073; - int num1062 = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)vector119.X, (int)vector119.Y, ModContent.NPCType(), 0, 0f, 0f, 0f, challengeAmt); + int num1062 = NPC.NewNPC(NPC.GetSource_FromAI(), (int)vector119.X, (int)vector119.Y, ModContent.NPCType(), 0, 0f, 0f, 0f, challengeAmt); Main.npc[num1062].velocity.X = num1071; Main.npc[num1062].velocity.Y = num1072; Main.npc[num1062].netUpdate = true; @@ -681,7 +681,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath if (Main.netMode != NetmodeID.MultiplayerClient) { if (expertMode && NPC.CountNPCS(ModContent.NPCType()) < 3) - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)vector119.X, (int)vector119.Y, ModContent.NPCType(), 0, 0f, 0f, 0f, challengeAmt); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)vector119.X, (int)vector119.Y, ModContent.NPCType(), 0, 0f, 0f, 0f, challengeAmt); float npcSpeed = (revenge ? 11f : 9f) + enrageScale * 2f; @@ -695,7 +695,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath num1071 += Main.rand.Next(-20, 21) * 0.05f; num1072 += Main.rand.Next(-20, 21) * 0.05f; - int num1062 = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)vector119.X, (int)vector119.Y, ModContent.NPCType(), 0, 0f, 0f, 0f, challengeAmt); + int num1062 = NPC.NewNPC(NPC.GetSource_FromAI(), (int)vector119.X, (int)vector119.Y, ModContent.NPCType(), 0, 0f, 0f, 0f, challengeAmt); Main.npc[num1062].velocity.X = num1071; Main.npc[num1062].velocity.Y = num1072; Main.npc[num1062].netUpdate = true; @@ -771,7 +771,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath } int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector121.X, vector121.Y, num1071, num1072, type, damage, 0f, Main.myPlayer, challengeAmt, player.position.Y); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vector121.X, vector121.Y, num1071, num1072, type, damage, 0f, Main.myPlayer, challengeAmt, player.position.Y); NPC.netUpdate = true; } @@ -859,7 +859,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath Vector2 spawn = vectorCenter; // Normal = 96, Malice = 144 spawn.X += i * (int)(spread * 1.125) - (missiles * (spread / 2)); // Normal = -96 to 93, Malice = -144 to 156 Vector2 velocity = baseVelocity.RotatedBy(MathHelper.ToRadians(-MissileAngleSpread / 2 + (MissileAngleSpread * i / missiles))); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), spawn, velocity, type, damage, 0f, Main.myPlayer, nukeBarrageChallengeAmt, player.position.Y); + Projectile.NewProjectile(NPC.GetSource_FromAI(), spawn, velocity, type, damage, 0f, Main.myPlayer, nukeBarrageChallengeAmt, player.position.Y); } } } diff --git a/NPCs/Polterghast/PhantomFuckYou.cs b/NPCs/Polterghast/PhantomFuckYou.cs index ec12ae56e8..a0f02139a8 100644 --- a/NPCs/Polterghast/PhantomFuckYou.cs +++ b/NPCs/Polterghast/PhantomFuckYou.cs @@ -98,7 +98,7 @@ namespace CalamityMod.NPCs.Polterghast int damage = NPC.GetProjectileDamage(type); float maxVelocity = 8f * tileEnrageMult; float acceleration = 1.15f + (tileEnrageMult - 1f) * 0.15f; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, direction, type, damage, 1f, NPC.target, maxVelocity, acceleration); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, direction, type, damage, 1f, NPC.target, maxVelocity, acceleration); } NPC.ai[2] = 0f; } diff --git a/NPCs/Polterghast/Polterghast.cs b/NPCs/Polterghast/Polterghast.cs index 27ac5ee3cd..30541fd6f9 100644 --- a/NPCs/Polterghast/Polterghast.cs +++ b/NPCs/Polterghast/Polterghast.cs @@ -226,10 +226,10 @@ namespace CalamityMod.NPCs.Polterghast if (NPC.localAI[0] == 0f && Main.netMode != NetmodeID.MultiplayerClient) { NPC.localAI[0] = 1f; - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType(), NPC.whoAmI, 0f, 0f, 0f, 0f, 255); - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType(), NPC.whoAmI, 0f, 0f, 0f, 0f, 255); - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType(), NPC.whoAmI, 0f, 0f, 0f, 0f, 255); - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType(), NPC.whoAmI, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType(), NPC.whoAmI, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType(), NPC.whoAmI, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType(), NPC.whoAmI, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType(), NPC.whoAmI, 0f, 0f, 0f, 0f, 255); } if (!player.ZoneDungeon && !BossRushEvent.BossRushActive && player.position.Y < Main.worldSurface * 16.0) @@ -659,7 +659,7 @@ namespace CalamityMod.NPCs.Polterghast for (int i = 0; i < baseProjectileAmt; i++) { offsetAngle = startAngle + deltaAngle * i; - int proj = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector93.X, vector93.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), type, damage, 0f, Main.myPlayer, 0f, 0f); + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), vector93.X, vector93.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), type, damage, 0f, Main.myPlayer, 0f, 0f); Main.projectile[proj].timeLeft = type == ModContent.ProjectileType() ? baseProjectileTimeLeft / 4 : baseProjectileTimeLeft; } } @@ -687,7 +687,7 @@ namespace CalamityMod.NPCs.Polterghast for (int i = 0; i < baseProjectileAmt; i++) { offsetAngle = startAngle + deltaAngle * i; - int proj = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector93.X, vector93.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), type, damage, 0f, Main.myPlayer, 0f, 0f); + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), vector93.X, vector93.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), type, damage, 0f, Main.myPlayer, 0f, 0f); Main.projectile[proj].timeLeft = baseProjectileTimeLeft / 4; } } @@ -792,7 +792,7 @@ namespace CalamityMod.NPCs.Polterghast for (int i = 0; i < numProj; i++) { offsetAngle = startAngle + deltaAngle * i; - int proj = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector93.X, vector93.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), type, damage, 0f, Main.myPlayer, 0f, 0f); + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), vector93.X, vector93.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), type, damage, 0f, Main.myPlayer, 0f, 0f); Main.projectile[proj].timeLeft = type == ModContent.ProjectileType() ? baseProjectileTimeLeft / 4 : baseProjectileTimeLeft; } } @@ -821,7 +821,7 @@ namespace CalamityMod.NPCs.Polterghast for (int i = 0; i < numProj; i++) { offsetAngle = startAngle + deltaAngle * i; - int proj = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector93.X, vector93.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), type, damage, 0f, Main.myPlayer, 0f, 0f); + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), vector93.X, vector93.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), type, damage, 0f, Main.myPlayer, 0f, 0f); Main.projectile[proj].timeLeft = baseProjectileTimeLeft / 4; } } @@ -845,13 +845,13 @@ namespace CalamityMod.NPCs.Polterghast if (Main.netMode != NetmodeID.MultiplayerClient) { - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType()); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType()); if (expertMode) { for (int I = 0; I < 3; I++) { - int spawn = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)(vector.X + (Math.Sin(I * 120) * 500)), (int)(vector.Y + (Math.Cos(I * 120) * 500)), ModContent.NPCType(), NPC.whoAmI, 0, 0, 0, -1); + int spawn = NPC.NewNPC(NPC.GetSource_FromAI(), (int)(vector.X + (Math.Sin(I * 120) * 500)), (int)(vector.Y + (Math.Cos(I * 120) * 500)), ModContent.NPCType(), NPC.whoAmI, 0, 0, 0, -1); NPC npc2 = Main.npc[spawn]; npc2.ai[0] = I * 120; } @@ -925,7 +925,7 @@ namespace CalamityMod.NPCs.Polterghast for (int i = 0; i < numProj; i++) { offsetAngle = startAngle + deltaAngle * i; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector93.X, vector93.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vector93.X, vector93.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), type, damage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -950,7 +950,7 @@ namespace CalamityMod.NPCs.Polterghast if (NPC.CountNPCS(ModContent.NPCType()) < 2 && Main.netMode != NetmodeID.MultiplayerClient && !charging && !chargePhase) { - int num762 = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType()); + int num762 = NPC.NewNPC(NPC.GetSource_FromAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType()); Main.npc[num762].velocity.X = num758; Main.npc[num762].velocity.Y = num760; Main.npc[num762].netUpdate = true; diff --git a/NPCs/Polterghast/PolterghastHook.cs b/NPCs/Polterghast/PolterghastHook.cs index 9047a8a82d..f43e7be28c 100644 --- a/NPCs/Polterghast/PolterghastHook.cs +++ b/NPCs/Polterghast/PolterghastHook.cs @@ -156,7 +156,7 @@ namespace CalamityMod.NPCs.Polterghast num149 = num151 / num149; num147 *= num149; num148 *= num149; - int proj = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector17.X, vector17.Y, num147, num148, type, damage, 0f, Main.myPlayer, 0f, 0f); + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), vector17.X, vector17.Y, num147, num148, type, damage, 0f, Main.myPlayer, 0f, 0f); } } return; diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs b/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs index cf014099e4..1d3c061cf7 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs @@ -101,8 +101,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (Main.netMode != NetmodeID.MultiplayerClient && NPC.localAI[1] == 0f) { NPC.localAI[1] = 1f; - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)vectorCenter.X, (int)vectorCenter.Y, ModContent.NPCType()); - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)vectorCenter.X, (int)vectorCenter.Y, ModContent.NPCType()); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)vectorCenter.X, (int)vectorCenter.Y, ModContent.NPCType()); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)vectorCenter.X, (int)vectorCenter.Y, ModContent.NPCType()); } bool defenderAlive = false; @@ -272,7 +272,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians { Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); Vector2 normalizedPerturbedSpeed = Vector2.Normalize(perturbedSpeed); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vectorCenter, normalizedPerturbedSpeed * NPC.velocity.Length() * 1.25f, type, damage, 0f, Main.myPlayer, 2f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vectorCenter, normalizedPerturbedSpeed * NPC.velocity.Length() * 1.25f, type, damage, 0f, Main.myPlayer, 2f, 0f); } } } @@ -354,7 +354,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians for (int i = 0; i < totalProjectiles; i++) { Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * i); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, 0f); } spearType++; diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianBoss2.cs b/NPCs/ProfanedGuardians/ProfanedGuardianBoss2.cs index 5133804c0f..ae29cf9da2 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianBoss2.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianBoss2.cs @@ -168,7 +168,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians SoundEngine.PlaySound(SoundID.Item20, NPC.position); int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, Vector2.Normalize(player.Center - NPC.Center) * NPC.velocity.Length() * 1.5f, type, damage, 0f, Main.myPlayer, 2f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Normalize(player.Center - NPC.Center) * NPC.velocity.Length() * 1.5f, type, damage, 0f, Main.myPlayer, 2f, 0f); } } @@ -246,7 +246,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians for (int i = 0; i < totalProjectiles; i++) { Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * i); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer); } } } diff --git a/NPCs/Providence/ProvSpawnDefense.cs b/NPCs/Providence/ProvSpawnDefense.cs index b7f7edb758..0a41074a67 100644 --- a/NPCs/Providence/ProvSpawnDefense.cs +++ b/NPCs/Providence/ProvSpawnDefense.cs @@ -157,7 +157,7 @@ namespace CalamityMod.NPCs.Providence { int heartAmt = Main.rand.Next(3) + 3; for (int i = 0; i < heartAmt; i++) - Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); + Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); } } diff --git a/NPCs/Providence/ProvSpawnHealer.cs b/NPCs/Providence/ProvSpawnHealer.cs index 695a8efaf4..91a2936e25 100644 --- a/NPCs/Providence/ProvSpawnHealer.cs +++ b/NPCs/Providence/ProvSpawnHealer.cs @@ -166,7 +166,7 @@ namespace CalamityMod.NPCs.Providence { int heartAmt = Main.rand.Next(3) + 3; for (int i = 0; i < heartAmt; i++) - Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); + Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); } } diff --git a/NPCs/Providence/ProvSpawnOffense.cs b/NPCs/Providence/ProvSpawnOffense.cs index 2ff63b224f..aa55951cf2 100644 --- a/NPCs/Providence/ProvSpawnOffense.cs +++ b/NPCs/Providence/ProvSpawnOffense.cs @@ -159,7 +159,7 @@ namespace CalamityMod.NPCs.Providence { int heartAmt = Main.rand.Next(3) + 3; for (int i = 0; i < heartAmt; i++) - Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); + Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); } } diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 92cb14b098..9926538dc8 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -476,7 +476,7 @@ namespace CalamityMod.NPCs.Providence for (int i = 0; i < guardianRingAmt; i++) { int type = i == 0 ? ModContent.NPCType() : i == 1 ? ModContent.NPCType() : ModContent.NPCType(); - int spawn = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)(NPC.Center.X + (Math.Sin(i * guardianSpread) * guardianDistance)), (int)(NPC.Center.Y + (Math.Cos(i * guardianSpread) * guardianDistance)), type, NPC.whoAmI, 0, 0, 0, -1); + int spawn = NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X + (Math.Sin(i * guardianSpread) * guardianDistance)), (int)(NPC.Center.Y + (Math.Cos(i * guardianSpread) * guardianDistance)), type, NPC.whoAmI, 0, 0, 0, -1); Main.npc[spawn].ai[0] = i * guardianSpread; } } @@ -733,7 +733,7 @@ namespace CalamityMod.NPCs.Providence if (spawnAnimation) { if (Main.netMode != NetmodeID.MultiplayerClient && calamityGlobalNPC.newAI[3] == 0f) - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector + new Vector2(0f, -80f), Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, biomeType, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vector + new Vector2(0f, -80f), Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, biomeType, 0f); if (calamityGlobalNPC.newAI[3] == 10f && nightTime) SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/ProvidenceHolyRay"), (int)NPC.position.X, (int)NPC.position.Y); @@ -825,7 +825,7 @@ namespace CalamityMod.NPCs.Providence num857 *= num859; num858 *= num859; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector.X, vector.Y, num857, num858, ModContent.ProjectileType(), holyBlastDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vector.X, vector.Y, num857, num858, ModContent.ProjectileType(), holyBlastDamage, 0f, Main.myPlayer, 0f, 0f); } } else if (NPC.ai[3] < 0f) @@ -875,7 +875,7 @@ namespace CalamityMod.NPCs.Providence if (nightTime) num865 *= 2f; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector113.X, vector113.Y, NPC.velocity.X * 0.25f, num865, ModContent.ProjectileType(), holyFireDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vector113.X, vector113.Y, NPC.velocity.X * 0.25f, num865, ModContent.ProjectileType(), holyFireDamage, 0f, Main.myPlayer, 0f, 0f); } } @@ -931,10 +931,10 @@ namespace CalamityMod.NPCs.Providence { projectileType = ModContent.ProjectileType(); dmgAmt = NPC.GetProjectileDamageNoScaling(projectileType); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), fireFrom, vector2, projectileType, 0, 0f, Main.myPlayer, 0f, dmgAmt); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, vector2, projectileType, 0, 0f, Main.myPlayer, 0f, dmgAmt); } else - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), fireFrom, vector2, projectileType, dmgAmt, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, vector2, projectileType, dmgAmt, 0f, Main.myPlayer); } // Radial offset @@ -966,10 +966,10 @@ namespace CalamityMod.NPCs.Providence { projectileType = ModContent.ProjectileType(); dmgAmt = NPC.GetProjectileDamageNoScaling(projectileType); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), fireFrom, vector2, projectileType, 0, 0f, Main.myPlayer, 0f, dmgAmt); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, vector2, projectileType, 0, 0f, Main.myPlayer, 0f, dmgAmt); } else - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), fireFrom, vector2, projectileType, dmgAmt, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, vector2, projectileType, dmgAmt, 0f, Main.myPlayer); } } } @@ -990,7 +990,7 @@ namespace CalamityMod.NPCs.Providence { Vector2 velocity2 = Vector2.Normalize(Main.player[t].Center - fireFrom) * cocoonProjVelocity * 1.5f; int type = ModContent.ProjectileType(); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), fireFrom, velocity2, type, holyStarDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, velocity2, type, holyStarDamage, 0f, Main.myPlayer); } } } @@ -1097,7 +1097,7 @@ namespace CalamityMod.NPCs.Providence num857 *= num859; num858 *= num859; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector.X, vector.Y, num857 * 0.1f, num858, ModContent.ProjectileType(), moltenBlastDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vector.X, vector.Y, num857 * 0.1f, num858, ModContent.ProjectileType(), moltenBlastDamage, 0f, Main.myPlayer, 0f, 0f); } } else if (NPC.ai[3] < 0f) @@ -1142,7 +1142,7 @@ namespace CalamityMod.NPCs.Providence num865 += expertMode ? 4f : 3f; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector113.X, vector113.Y, NPC.velocity.X * 0.25f, num865, ModContent.ProjectileType(), holyBombDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vector113.X, vector113.Y, NPC.velocity.X * 0.25f, num865, ModContent.ProjectileType(), holyBombDamage, 0f, Main.myPlayer, 0f, 0f); } } @@ -1191,7 +1191,7 @@ namespace CalamityMod.NPCs.Providence for (int i = 0; i < totalSpearProjectiles; i++) { Vector2 vector2 = spinningPoint.RotatedBy(radians * i) * cocoonProjVelocity; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), fireFrom, vector2, projectileType, holySpearDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, vector2, projectileType, holySpearDamage, 0f, Main.myPlayer); } if (spearRateIncrease > 1f) @@ -1205,7 +1205,7 @@ namespace CalamityMod.NPCs.Providence cocoonProjVelocity = death ? 14f : revenge ? 13f : expertMode ? 12f : 10f; Vector2 velocity2 = Vector2.Normalize(player.Center - fireFrom) * cocoonProjVelocity; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), fireFrom, velocity2, projectileType, holySpearDamage, 0f, Main.myPlayer, 1f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, velocity2, projectileType, holySpearDamage, 0f, Main.myPlayer, 1f, 0f); } } @@ -1229,7 +1229,7 @@ namespace CalamityMod.NPCs.Providence { if (NPC.ai[1] == crystalPhaseTime && Main.netMode != NetmodeID.MultiplayerClient) { - int proj = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.Center.X, player.Center.Y - 360f, 0f, 0f, ModContent.ProjectileType(), crystalDamage, 0f, player.whoAmI, lifeRatio, 0f); + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), player.Center.X, player.Center.Y - 360f, 0f, 0f, ModContent.ProjectileType(), crystalDamage, 0f, player.whoAmI, lifeRatio, 0f); if (nightTime) Main.projectile[proj].timeLeft = nightCrystalTime; @@ -1294,20 +1294,20 @@ namespace CalamityMod.NPCs.Providence // 60 degrees offset velocity = velocity.RotatedBy(-(double)num1225 * MathHelper.TwoPi / 6f); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector.X, vector.Y + 32f, velocity.X, velocity.Y, ModContent.ProjectileType(), holyLaserDamage, 0f, Main.myPlayer, num1225 * MathHelper.TwoPi / rotation, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vector.X, vector.Y + 32f, velocity.X, velocity.Y, ModContent.ProjectileType(), holyLaserDamage, 0f, Main.myPlayer, num1225 * MathHelper.TwoPi / rotation, NPC.whoAmI); // -60 degrees offset if (revenge) - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector.X, vector.Y + 32f, -velocity.X, -velocity.Y, ModContent.ProjectileType(), holyLaserDamage, 0f, Main.myPlayer, -num1225 * MathHelper.TwoPi / rotation, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vector.X, vector.Y + 32f, -velocity.X, -velocity.Y, ModContent.ProjectileType(), holyLaserDamage, 0f, Main.myPlayer, -num1225 * MathHelper.TwoPi / rotation, NPC.whoAmI); if (nightTime && lifeRatio < 0.5f) { rotation *= 0.33f; velocity = velocity.RotatedBy(-(double)num1225 * MathHelper.TwoPi / 2f); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector.X, vector.Y + 32f, velocity.X, velocity.Y, ModContent.ProjectileType(), holyLaserDamage, 0f, Main.myPlayer, num1225 * MathHelper.TwoPi / rotation, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vector.X, vector.Y + 32f, velocity.X, velocity.Y, ModContent.ProjectileType(), holyLaserDamage, 0f, Main.myPlayer, num1225 * MathHelper.TwoPi / rotation, NPC.whoAmI); if (revenge) - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector.X, vector.Y + 32f, -velocity.X, -velocity.Y, ModContent.ProjectileType(), holyLaserDamage, 0f, Main.myPlayer, -num1225 * MathHelper.TwoPi / rotation, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vector.X, vector.Y + 32f, -velocity.X, -velocity.Y, ModContent.ProjectileType(), holyLaserDamage, 0f, Main.myPlayer, -num1225 * MathHelper.TwoPi / rotation, NPC.whoAmI); } NPC.netUpdate = true; @@ -1365,7 +1365,7 @@ namespace CalamityMod.NPCs.Providence SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/ProvidenceHolyBlastImpact"), NPC.Center); SoundEngine.PlaySound(NPC.DeathSound, NPC.Center); if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f); } // Explode as an enormous holy star before dying and dropping loot. @@ -1374,9 +1374,9 @@ namespace CalamityMod.NPCs.Providence for (int i = 0; i < 80; i++) { Vector2 sparkleVelocity = Main.rand.NextVector2Circular(23f, 23f); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, sparkleVelocity, ModContent.ProjectileType(), 0, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, sparkleVelocity, ModContent.ProjectileType(), 0, 0f); } - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, 255); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, 255); } // Idly release harmless cindiers. @@ -1386,7 +1386,7 @@ namespace CalamityMod.NPCs.Providence for (int i = 0; i < 3; i++) { Vector2 shootVelocity = Main.rand.NextVector2CircularEdge(13f, 13f) * Main.rand.NextFloat(0.7f, 1.3f); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, shootVelocity, ModContent.ProjectileType(), 0, 0f, 255); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, shootVelocity, ModContent.ProjectileType(), 0, 0f, 255); } } diff --git a/NPCs/Ravager/FlamePillar.cs b/NPCs/Ravager/FlamePillar.cs index 990aa76b40..a6faf94975 100644 --- a/NPCs/Ravager/FlamePillar.cs +++ b/NPCs/Ravager/FlamePillar.cs @@ -118,7 +118,7 @@ namespace CalamityMod.NPCs.Ravager Vector2 velocity = new Vector2(speedX, speedY); int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, velocity, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); } NPC.ai[2] += 1f; NPC.localAI[0] = 0f; diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index 490dc19975..8a68603e0c 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -132,11 +132,11 @@ namespace CalamityMod.NPCs.Ravager if (NPC.localAI[0] == 0f && Main.netMode != NetmodeID.MultiplayerClient) { NPC.localAI[0] = 1f; - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.Center.X - 70, (int)NPC.Center.Y + 88, ModContent.NPCType()); - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.Center.X + 70, (int)NPC.Center.Y + 88, ModContent.NPCType()); - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.Center.X - 120, (int)NPC.Center.Y + 50, ModContent.NPCType()); - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.Center.X + 120, (int)NPC.Center.Y + 50, ModContent.NPCType()); - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.Center.X + 1, (int)NPC.Center.Y - 20, ModContent.NPCType()); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X - 70, (int)NPC.Center.Y + 88, ModContent.NPCType()); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X + 70, (int)NPC.Center.Y + 88, ModContent.NPCType()); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X - 120, (int)NPC.Center.Y + 50, ModContent.NPCType()); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X + 120, (int)NPC.Center.Y + 50, ModContent.NPCType()); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X + 1, (int)NPC.Center.Y - 20, ModContent.NPCType()); } if (NPC.target >= 0 && Main.player[NPC.target].dead) @@ -448,14 +448,14 @@ namespace CalamityMod.NPCs.Ravager if (!NPC.AnyNPCs(ModContent.NPCType())) { - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)(player.Center.X - spawnDistance * 1.25f), (int)player.Center.Y - 100, ModContent.NPCType()); - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)(player.Center.X + spawnDistance * 1.25f), (int)player.Center.Y - 100, ModContent.NPCType()); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)(player.Center.X - spawnDistance * 1.25f), (int)player.Center.Y - 100, ModContent.NPCType()); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)(player.Center.X + spawnDistance * 1.25f), (int)player.Center.Y - 100, ModContent.NPCType()); } else if (!NPC.AnyNPCs(ModContent.NPCType())) { float distanceMultiplier = finalPhase ? 2.5f : 2f; - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)player.Center.X - (int)(spawnDistance * distanceMultiplier), (int)player.Center.Y - 100, ModContent.NPCType()); - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)player.Center.X + (int)(spawnDistance * distanceMultiplier), (int)player.Center.Y - 100, ModContent.NPCType()); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)player.Center.X - (int)(spawnDistance * distanceMultiplier), (int)player.Center.Y - 100, ModContent.NPCType()); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)player.Center.X + (int)(spawnDistance * distanceMultiplier), (int)player.Center.Y - 100, ModContent.NPCType()); } } } diff --git a/NPCs/Ravager/RavagerHead.cs b/NPCs/Ravager/RavagerHead.cs index e917a0dbfa..b0117fc4ef 100644 --- a/NPCs/Ravager/RavagerHead.cs +++ b/NPCs/Ravager/RavagerHead.cs @@ -97,7 +97,7 @@ namespace CalamityMod.NPCs.Ravager { Vector2 shootFromVector = new Vector2(NPC.Center.X, NPC.Center.Y - 20f); Vector2 velocity = new Vector2(0f, -15f); - int nuke = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), shootFromVector, velocity, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, NPC.target, 0f); + int nuke = Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFromVector, velocity, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, NPC.target, 0f); Main.projectile[nuke].velocity.Y = -15f; } } diff --git a/NPCs/Ravager/RavagerHead2.cs b/NPCs/Ravager/RavagerHead2.cs index 97156b3748..ee5469920e 100644 --- a/NPCs/Ravager/RavagerHead2.cs +++ b/NPCs/Ravager/RavagerHead2.cs @@ -124,7 +124,7 @@ namespace CalamityMod.NPCs.Ravager SoundEngine.PlaySound(SoundID.Item62, NPC.position); type = ModContent.ProjectileType(); damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, Vector2.Normalize(player.Center - NPC.Center) * projectileVelocity * 0.25f, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, Main.npc[CalamityGlobalNPC.scavenger].target, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Normalize(player.Center - NPC.Center) * projectileVelocity * 0.25f, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, Main.npc[CalamityGlobalNPC.scavenger].target, 0f); } } else @@ -134,7 +134,7 @@ namespace CalamityMod.NPCs.Ravager if (Main.netMode != NetmodeID.MultiplayerClient) { SoundEngine.PlaySound(SoundID.Item33, NPC.position); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, Vector2.Normalize(player.Center - NPC.Center) * projectileVelocity, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, -1f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Normalize(player.Center - NPC.Center) * projectileVelocity, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, -1f); } } } diff --git a/NPCs/Signus/Signus.cs b/NPCs/Signus/Signus.cs index c577d4f1de..db650c4c2d 100644 --- a/NPCs/Signus/Signus.cs +++ b/NPCs/Signus/Signus.cs @@ -335,11 +335,11 @@ namespace CalamityMod.NPCs.Signus { SoundEngine.PlaySound(SoundID.Item, (int)NPC.position.X, (int)NPC.position.Y, 122); - int num660 = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)(player.position.X + 750f), (int)player.position.Y, ModContent.NPCType()); + int num660 = NPC.NewNPC(NPC.GetSource_FromAI(), (int)(player.position.X + 750f), (int)player.position.Y, ModContent.NPCType()); if (Main.netMode == NetmodeID.Server) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num660, 0f, 0f, 0f, 0, 0, 0); - int num661 = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)(player.position.X - 750f), (int)player.position.Y, ModContent.NPCType()); + int num661 = NPC.NewNPC(NPC.GetSource_FromAI(), (int)(player.position.X - 750f), (int)player.position.Y, ModContent.NPCType()); if (Main.netMode == NetmodeID.Server) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num661, 0f, 0f, 0f, 0, 0, 0); @@ -426,7 +426,7 @@ namespace CalamityMod.NPCs.Signus num1072 *= num1073; int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vectorCenter.X, vectorCenter.Y, num1071, num1072, type, damage, 0f, Main.myPlayer, 0f, NPC.target + 1); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vectorCenter.X, vectorCenter.Y, num1071, num1072, type, damage, 0f, Main.myPlayer, 0f, NPC.target + 1); } } } @@ -495,11 +495,11 @@ namespace CalamityMod.NPCs.Signus { for (int x = 0; x < 5; x++) { - int num660 = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)(player.position.X + spawnX), (int)(player.position.Y + spawnY), ModContent.NPCType()); + int num660 = NPC.NewNPC(NPC.GetSource_FromAI(), (int)(player.position.X + spawnX), (int)(player.position.Y + spawnY), ModContent.NPCType()); if (Main.netMode == NetmodeID.Server) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num660, 0f, 0f, 0f, 0, 0, 0); - int num661 = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)(player.position.X - spawnX), (int)(player.position.Y + spawnY), ModContent.NPCType()); + int num661 = NPC.NewNPC(NPC.GetSource_FromAI(), (int)(player.position.X - spawnX), (int)(player.position.Y + spawnY), ModContent.NPCType()); if (Main.netMode == NetmodeID.Server) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num661, 0f, 0f, 0f, 0, 0, 0); @@ -590,7 +590,7 @@ namespace CalamityMod.NPCs.Signus SoundEngine.PlaySound(SoundID.Item73, NPC.position); int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vectorCenter, Vector2.Zero, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vectorCenter, Vector2.Zero, type, damage, 0f, Main.myPlayer); } } diff --git a/NPCs/SlimeGod/SlimeGod.cs b/NPCs/SlimeGod/SlimeGod.cs index 9ede2ad836..b448b2e0a6 100644 --- a/NPCs/SlimeGod/SlimeGod.cs +++ b/NPCs/SlimeGod/SlimeGod.cs @@ -119,8 +119,8 @@ namespace CalamityMod.NPCs.SlimeGod { SoundEngine.PlaySound(SoundID.NPCDeath1, NPC.position); Vector2 spawnAt = vector + new Vector2(0f, NPC.height / 2f); - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)spawnAt.X - 30, (int)spawnAt.Y, ModContent.NPCType()); - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)spawnAt.X + 30, (int)spawnAt.Y, ModContent.NPCType()); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)spawnAt.X - 30, (int)spawnAt.Y, ModContent.NPCType()); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)spawnAt.X + 30, (int)spawnAt.Y, ModContent.NPCType()); NPC.active = false; NPC.netUpdate = true; return; @@ -184,7 +184,7 @@ namespace CalamityMod.NPCs.SlimeGod num182 += (float)Main.rand.Next(-spread, spread + 1); num180 *= num183; num182 *= num183; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -523,7 +523,7 @@ namespace CalamityMod.NPCs.SlimeGod int x = (int)(NPC.position.X + (float)Main.rand.Next(NPC.width - 32)); int y = (int)(NPC.position.Y + (float)Main.rand.Next(NPC.height - 32)); int num663 = ModContent.NPCType(); - int num664 = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), x, y, num663, 0, 0f, 0f, 0f, 0f, 255); + int num664 = NPC.NewNPC(NPC.GetSource_FromAI(), x, y, num663, 0, 0f, 0f, 0f, 0f, 255); Main.npc[num664].SetDefaults(num663); Main.npc[num664].velocity.X = (float)Main.rand.Next(-15, 16) * 0.1f; Main.npc[num664].velocity.Y = (float)Main.rand.Next(-30, 1) * 0.1f; diff --git a/NPCs/SlimeGod/SlimeGodCore.cs b/NPCs/SlimeGod/SlimeGodCore.cs index e1998e05fc..830a50065f 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -119,8 +119,8 @@ namespace CalamityMod.NPCs.SlimeGod if (Main.netMode != NetmodeID.MultiplayerClient && !slimesSpawned) { slimesSpawned = true; - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)vectorCenter.X, (int)vectorCenter.Y, ModContent.NPCType()); - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)vectorCenter.X, (int)vectorCenter.Y, ModContent.NPCType()); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)vectorCenter.X, (int)vectorCenter.Y, ModContent.NPCType()); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)vectorCenter.X, (int)vectorCenter.Y, ModContent.NPCType()); } // Emit dust @@ -433,7 +433,7 @@ namespace CalamityMod.NPCs.SlimeGod num183 = num179 / num183; num180 *= num183; num182 *= num183; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -471,7 +471,7 @@ namespace CalamityMod.NPCs.SlimeGod num182 += Main.rand.Next(-spread, spread + 1); num180 *= num183; num182 *= num183; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } diff --git a/NPCs/SlimeGod/SlimeGodRun.cs b/NPCs/SlimeGod/SlimeGodRun.cs index 8c5048c1ff..7a0ece7ee4 100644 --- a/NPCs/SlimeGod/SlimeGodRun.cs +++ b/NPCs/SlimeGod/SlimeGodRun.cs @@ -123,8 +123,8 @@ namespace CalamityMod.NPCs.SlimeGod { SoundEngine.PlaySound(SoundID.NPCDeath1, NPC.position); Vector2 spawnAt = vector + new Vector2(0f, NPC.height / 2f); - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)spawnAt.X - 30, (int)spawnAt.Y, ModContent.NPCType()); - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)spawnAt.X + 30, (int)spawnAt.Y, ModContent.NPCType()); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)spawnAt.X - 30, (int)spawnAt.Y, ModContent.NPCType()); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)spawnAt.X + 30, (int)spawnAt.Y, ModContent.NPCType()); NPC.active = false; NPC.netUpdate = true; return; @@ -191,7 +191,7 @@ namespace CalamityMod.NPCs.SlimeGod num182 += (float)Main.rand.Next(-10, 11); num180 *= num183; num182 *= num183; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -531,7 +531,7 @@ namespace CalamityMod.NPCs.SlimeGod { num663 = ModContent.NPCType(); } - int num664 = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), x, y, num663, 0, 0f, 0f, 0f, 0f, 255); + int num664 = NPC.NewNPC(NPC.GetSource_FromAI(), x, y, num663, 0, 0f, 0f, 0f, 0f, 255); Main.npc[num664].SetDefaults(num663); Main.npc[num664].velocity.X = (float)Main.rand.Next(-15, 16) * 0.1f; Main.npc[num664].velocity.Y = (float)Main.rand.Next(-30, 1) * 0.1f; diff --git a/NPCs/SlimeGod/SlimeGodRunSplit.cs b/NPCs/SlimeGod/SlimeGodRunSplit.cs index 8304e04d15..c730f411b7 100644 --- a/NPCs/SlimeGod/SlimeGodRunSplit.cs +++ b/NPCs/SlimeGod/SlimeGodRunSplit.cs @@ -171,7 +171,7 @@ namespace CalamityMod.NPCs.SlimeGod num183 = num179 / num183; num180 *= num183; num182 *= num183; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); } } @@ -504,7 +504,7 @@ namespace CalamityMod.NPCs.SlimeGod { num663 = ModContent.NPCType(); } - int num664 = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), x, y, num663, 0, 0f, 0f, 0f, 0f, 255); + int num664 = NPC.NewNPC(NPC.GetSource_FromAI(), x, y, num663, 0, 0f, 0f, 0f, 0f, 255); Main.npc[num664].SetDefaults(num663); Main.npc[num664].velocity.X = (float)Main.rand.Next(-15, 16) * 0.1f; Main.npc[num664].velocity.Y = (float)Main.rand.Next(-30, 1) * 0.1f; @@ -532,7 +532,7 @@ namespace CalamityMod.NPCs.SlimeGod { int heartAmt = Main.rand.Next(3) + 3; for (int i = 0; i < heartAmt; i++) - Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); + Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); } if (SlimeGodCore.LastSlimeGodStanding()) diff --git a/NPCs/SlimeGod/SlimeGodSplit.cs b/NPCs/SlimeGod/SlimeGodSplit.cs index fef15d002c..f7abbdc1eb 100644 --- a/NPCs/SlimeGod/SlimeGodSplit.cs +++ b/NPCs/SlimeGod/SlimeGodSplit.cs @@ -171,7 +171,7 @@ namespace CalamityMod.NPCs.SlimeGod num182 += (float)Main.rand.Next(-spread, spread + 1); num180 *= num183; num182 *= num183; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -501,7 +501,7 @@ namespace CalamityMod.NPCs.SlimeGod int x = (int)(NPC.position.X + (float)Main.rand.Next(NPC.width - 32)); int y = (int)(NPC.position.Y + (float)Main.rand.Next(NPC.height - 32)); int num663 = ModContent.NPCType(); - int num664 = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), x, y, num663, 0, 0f, 0f, 0f, 0f, 255); + int num664 = NPC.NewNPC(NPC.GetSource_FromAI(), x, y, num663, 0, 0f, 0f, 0f, 0f, 255); Main.npc[num664].SetDefaults(num663); Main.npc[num664].velocity.X = (float)Main.rand.Next(-15, 16) * 0.1f; Main.npc[num664].velocity.Y = (float)Main.rand.Next(-30, 1) * 0.1f; @@ -529,7 +529,7 @@ namespace CalamityMod.NPCs.SlimeGod { int heartAmt = Main.rand.Next(3) + 3; for (int i = 0; i < heartAmt; i++) - Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); + Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); } if (SlimeGodCore.LastSlimeGodStanding()) diff --git a/NPCs/SlimeGod/SlimeSpawnCorrupt.cs b/NPCs/SlimeGod/SlimeSpawnCorrupt.cs index 3939122bfa..d637eb16bf 100644 --- a/NPCs/SlimeGod/SlimeSpawnCorrupt.cs +++ b/NPCs/SlimeGod/SlimeSpawnCorrupt.cs @@ -44,7 +44,7 @@ namespace CalamityMod.NPCs.SlimeGod if (Main.netMode != NetmodeID.MultiplayerClient && NPC.life <= 0) { Vector2 spawnAt = NPC.Center + new Vector2(0f, (float)NPC.height / 2f); - NPC.NewNPC(NPC.GetItemSource_Loot(), (int)spawnAt.X, (int)spawnAt.Y, ModContent.NPCType()); + NPC.NewNPC(NPC.GetSource_Loot(), (int)spawnAt.X, (int)spawnAt.Y, ModContent.NPCType()); } for (int k = 0; k < 5; k++) { diff --git a/NPCs/SlimeGod/SlimeSpawnCorrupt2.cs b/NPCs/SlimeGod/SlimeSpawnCorrupt2.cs index 08179a2281..9153ae4be7 100644 --- a/NPCs/SlimeGod/SlimeSpawnCorrupt2.cs +++ b/NPCs/SlimeGod/SlimeSpawnCorrupt2.cs @@ -60,7 +60,7 @@ namespace CalamityMod.NPCs.SlimeGod { int closestPlayer = Player.FindClosest(NPC.Center, 1, 1); if (Main.rand.Next(8) == 0 && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2) - Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); + Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); } } diff --git a/NPCs/SlimeGod/SlimeSpawnCrimson.cs b/NPCs/SlimeGod/SlimeSpawnCrimson.cs index b08cdc1df9..71433a1de8 100644 --- a/NPCs/SlimeGod/SlimeSpawnCrimson.cs +++ b/NPCs/SlimeGod/SlimeSpawnCrimson.cs @@ -60,7 +60,7 @@ namespace CalamityMod.NPCs.SlimeGod { int closestPlayer = Player.FindClosest(NPC.Center, 1, 1); if (Main.rand.Next(8) == 0 && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2) - Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); + Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); } } diff --git a/NPCs/SlimeGod/SlimeSpawnCrimson2.cs b/NPCs/SlimeGod/SlimeSpawnCrimson2.cs index f6884b574d..846bc92031 100644 --- a/NPCs/SlimeGod/SlimeSpawnCrimson2.cs +++ b/NPCs/SlimeGod/SlimeSpawnCrimson2.cs @@ -102,7 +102,7 @@ namespace CalamityMod.NPCs.SlimeGod vector4.Y *= 1f + (float)Main.rand.Next(-50, 51) * 0.005f; vector4.Normalize(); vector4 *= 4f + (float)Main.rand.Next(-50, 51) * 0.01f; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector3.X, vector3.Y, vector4.X, vector4.Y, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vector3.X, vector3.Y, vector4.X, vector4.Y, type, damage, 0f, Main.myPlayer, 0f, 0f); spikeTimer = 30f; } } @@ -122,7 +122,7 @@ namespace CalamityMod.NPCs.SlimeGod num14 *= num16; num15 *= num16; spikeTimer = 50f; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector3.X, vector3.Y, num14, num15, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vector3.X, vector3.Y, num14, num15, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -149,7 +149,7 @@ namespace CalamityMod.NPCs.SlimeGod { int closestPlayer = Player.FindClosest(NPC.Center, 1, 1); if (Main.rand.Next(8) == 0 && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2) - Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); + Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); } } diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index 0cee945be4..06e510f7f0 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -231,9 +231,9 @@ namespace CalamityMod.NPCs.StormWeaver { int lol; if (num36 >= 0 && num36 < totalLength - 1) - lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); else - lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); Main.npc[lol].realLife = NPC.whoAmI; Main.npc[lol].ai[2] = NPC.whoAmI; @@ -262,7 +262,7 @@ namespace CalamityMod.NPCs.StormWeaver int type = ProjectileID.CultistBossLightningOrb; int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), spawnPos, Vector2.Zero, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnPos, Vector2.Zero, type, damage, 0f, Main.myPlayer); } } } @@ -473,7 +473,7 @@ namespace CalamityMod.NPCs.StormWeaver float ai = Main.rand.Next(100); int type = ProjectileID.CultistBossLightningOrbArc; int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), source, velocity, type, damage, 0f, Main.myPlayer, vector94.ToRotation(), ai); + Projectile.NewProjectile(NPC.GetSource_FromAI(), source, velocity, type, damage, 0f, Main.myPlayer, vector94.ToRotation(), ai); } } diff --git a/NPCs/SulphurousSea/AnthozoanCrab.cs b/NPCs/SulphurousSea/AnthozoanCrab.cs index e1b0ba822e..412938b1c0 100644 --- a/NPCs/SulphurousSea/AnthozoanCrab.cs +++ b/NPCs/SulphurousSea/AnthozoanCrab.cs @@ -160,7 +160,7 @@ namespace CalamityMod.NPCs.SulphurousSea Vector2 rockSpawnPosition = new Vector2(16f * -NPC.spriteDirection + NPC.Center.X, NPC.Bottom.Y - 6f); if (Main.netMode != NetmodeID.MultiplayerClient) { - boulderIndex = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), rockSpawnPosition, Vector2.Zero, ModContent.ProjectileType(), 29, 6f); + boulderIndex = Projectile.NewProjectile(NPC.GetSource_FromAI(), rockSpawnPosition, Vector2.Zero, ModContent.ProjectileType(), 29, 6f); NPC.netUpdate = true; } } diff --git a/NPCs/SulphurousSea/BelchingCoral.cs b/NPCs/SulphurousSea/BelchingCoral.cs index 7b2dda8493..05856ff2dc 100644 --- a/NPCs/SulphurousSea/BelchingCoral.cs +++ b/NPCs/SulphurousSea/BelchingCoral.cs @@ -63,7 +63,7 @@ namespace CalamityMod.NPCs.SulphurousSea if (NPC.ai[0]++ % 35f == 34f && Main.netMode != NetmodeID.MultiplayerClient) { Vector2 velocity = new Vector2(Main.rand.NextFloat(-6f, 6f), Main.rand.NextFloat(-11f, -6f)); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Top + new Vector2(0f, 6f), velocity, ModContent.ProjectileType(), 27, 3f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Top + new Vector2(0f, 6f), velocity, ModContent.ProjectileType(), 27, 3f); } } } diff --git a/NPCs/SunkenSea/GiantClam.cs b/NPCs/SunkenSea/GiantClam.cs index 38f3ddf714..de559fa0ca 100644 --- a/NPCs/SunkenSea/GiantClam.cs +++ b/NPCs/SunkenSea/GiantClam.cs @@ -168,9 +168,9 @@ namespace CalamityMod.NPCs.SunkenSea hide = false; attack = -1; NPC.defense = Main.hardMode ? 35 : 10; - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)(NPC.Center.X + 5), (int)NPC.Center.Y, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)(NPC.Center.X - 5), (int)NPC.Center.Y, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X + 5), (int)NPC.Center.Y, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X - 5), (int)NPC.Center.Y, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); } } else if (attack == 1) @@ -299,12 +299,12 @@ namespace CalamityMod.NPCs.SunkenSea num8 = speed / num8; num6 *= num8; num7 *= num8; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center.X, NPC.Center.Y, num6, num7, projectileShot, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y, num6, num7, projectileShot, damage, 0f, Main.myPlayer, 0f, 0f); for (int i = 0; i < 4; i++) { offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), value9.X, value9.Y, (float)(Math.Sin(offsetAngle) * 3f), (float)(Math.Cos(offsetAngle) * 3f), projectileShot, damage, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), value9.X, value9.Y, (float)(-Math.Sin(offsetAngle) * 3f), (float)(-Math.Cos(offsetAngle) * 3f), projectileShot, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), value9.X, value9.Y, (float)(Math.Sin(offsetAngle) * 3f), (float)(Math.Cos(offsetAngle) * 3f), projectileShot, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), value9.X, value9.Y, (float)(-Math.Sin(offsetAngle) * 3f), (float)(-Math.Cos(offsetAngle) * 3f), projectileShot, damage, 0f, Main.myPlayer, 0f, 0f); } attack = -1; NPC.ai[3] = 0f; @@ -318,7 +318,7 @@ namespace CalamityMod.NPCs.SunkenSea float shotSpacing = 750f; for (int i = 0; i < 11; i++) { - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.Center.X + shotSpacing, player.Center.Y - 750f, 0f, 8f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.Center.X + shotSpacing, player.Center.Y - 750f, 0f, 8f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); shotSpacing -= 150f; } } diff --git a/NPCs/SunkenSea/SeaSerpent1.cs b/NPCs/SunkenSea/SeaSerpent1.cs index 418f659923..d9c434e63b 100644 --- a/NPCs/SunkenSea/SeaSerpent1.cs +++ b/NPCs/SunkenSea/SeaSerpent1.cs @@ -77,19 +77,19 @@ namespace CalamityMod.NPCs.SunkenSea int lol = 0; if (segment == 0 || segment == 1 || segment == 4 || segment == 5) { - lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); } else if (segment == 2 || segment == 3 || segment == 6) { - lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); } else if (segment == 7) { - lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); } else if (segment == 8) { - lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); } Main.npc[lol].realLife = NPC.whoAmI; Main.npc[lol].ai[2] = (float)NPC.whoAmI; diff --git a/NPCs/SupremeCalamitas/BrimstoneHeart.cs b/NPCs/SupremeCalamitas/BrimstoneHeart.cs index 721fefec30..54c6420601 100644 --- a/NPCs/SupremeCalamitas/BrimstoneHeart.cs +++ b/NPCs/SupremeCalamitas/BrimstoneHeart.cs @@ -97,7 +97,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { int closestPlayer = Player.FindClosest(NPC.Center, 1, 1); if (Main.rand.Next(4) == 0 && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2) - Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); + Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); } } diff --git a/NPCs/SupremeCalamitas/SCalWormBodyWeak.cs b/NPCs/SupremeCalamitas/SCalWormBodyWeak.cs index d929c9df54..1ae1e7fe33 100644 --- a/NPCs/SupremeCalamitas/SCalWormBodyWeak.cs +++ b/NPCs/SupremeCalamitas/SCalWormBodyWeak.cs @@ -115,7 +115,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas for (int k = 0; k < totalProjectiles; k++) { Vector2 velocity = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity, type, damage, 0f, Main.myPlayer); } NPC.netUpdate = true; } @@ -163,7 +163,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas continue; Vector2 soulVelocity = -Vector2.UnitY.RotatedByRandom(0.53f) * Main.rand.NextFloat(2.5f, 4f); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, soulVelocity, ModContent.ProjectileType(), 0, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, soulVelocity, ModContent.ProjectileType(), 0, 0f); } } } diff --git a/NPCs/SupremeCalamitas/SCalWormHead.cs b/NPCs/SupremeCalamitas/SCalWormHead.cs index f344e0d2f2..ab93397a5e 100644 --- a/NPCs/SupremeCalamitas/SCalWormHead.cs +++ b/NPCs/SupremeCalamitas/SCalWormHead.cs @@ -93,23 +93,23 @@ namespace CalamityMod.NPCs.SupremeCalamitas int lol; if (i >= 0 && i < minLength && i % 2 == 1) { - lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); Main.npc[lol].localAI[0] += passedVar; passedVar += 36f; } else if (i >= 0 && i < minLength) { - lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); Main.npc[lol].localAI[3] = i; } else - lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); // Create arms. if (i >= 3 && i % 4 == 0) { NPC segment = Main.npc[lol]; - int arm = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)segment.Center.X, (int)segment.Center.Y, ModContent.NPCType(), lol); + int arm = NPC.NewNPC(NPC.GetSource_FromAI(), (int)segment.Center.X, (int)segment.Center.Y, ModContent.NPCType(), lol); if (Main.npc.IndexInRange(arm)) { Main.npc[arm].ai[0] = lol; @@ -119,7 +119,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas rotationalOffset += MathHelper.Pi / 6f; - arm = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)segment.Center.X, (int)segment.Center.Y, ModContent.NPCType(), lol); + arm = NPC.NewNPC(NPC.GetSource_FromAI(), (int)segment.Center.X, (int)segment.Center.Y, ModContent.NPCType(), lol); if (Main.npc.IndexInRange(arm)) { Main.npc[arm].ai[0] = lol; diff --git a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs index e6a011d61c..3fba03dd3e 100644 --- a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs +++ b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs @@ -136,7 +136,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); Vector2 shootVelocity = (Target.Center - EyePosition).SafeNormalize(Vector2.UnitY) * 9f; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), EyePosition, shootVelocity, type, damage, 1f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), EyePosition, shootVelocity, type, damage, 1f, Main.myPlayer); } timer = 0; NPC.netUpdate = true; @@ -153,7 +153,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { int closestPlayer = Player.FindClosest(NPC.Center, 1, 1); if (Main.rand.Next(4) == 0 && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2) - Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); + Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); } } diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index 4947c41fda..26f1656ad1 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -599,7 +599,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas // Make the town NPC spawn. if (Main.netMode != NetmodeID.MultiplayerClient) - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.Center.X, (int)NPC.Center.Y + 12, ModContent.NPCType()); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y + 12, ModContent.NPCType()); } NPC.active = false; @@ -681,22 +681,22 @@ namespace CalamityMod.NPCs.SupremeCalamitas { float distance = Main.rand.NextBool() ? -1000f : 1000f; float velocity = (distance == -1000f ? 4f : -4f) * uDieLul; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + distance, player.position.Y, velocity, 0f, ModContent.ProjectileType(), firstBulletHellblastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + distance, player.position.Y, velocity, 0f, ModContent.ProjectileType(), firstBulletHellblastDamage, 0f, Main.myPlayer); } if (bulletHellCounter2 < 300) // Blasts from above { - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 4f * uDieLul, ModContent.ProjectileType(), firstBulletHellblastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 4f * uDieLul, ModContent.ProjectileType(), firstBulletHellblastDamage, 0f, Main.myPlayer); } else if (bulletHellCounter2 < 600) // Blasts from left and right { - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, ModContent.ProjectileType(), firstBulletHellblastDamage, 0f, Main.myPlayer); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, ModContent.ProjectileType(), firstBulletHellblastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, ModContent.ProjectileType(), firstBulletHellblastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, ModContent.ProjectileType(), firstBulletHellblastDamage, 0f, Main.myPlayer); } else // Blasts from above, left, and right { - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 3f * uDieLul, ModContent.ProjectileType(), firstBulletHellblastDamage, 0f, Main.myPlayer); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3f * uDieLul, 0f, ModContent.ProjectileType(), firstBulletHellblastDamage, 0f, Main.myPlayer); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3f * uDieLul, 0f, ModContent.ProjectileType(), firstBulletHellblastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 3f * uDieLul, ModContent.ProjectileType(), firstBulletHellblastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3f * uDieLul, 0f, ModContent.ProjectileType(), firstBulletHellblastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3f * uDieLul, 0f, ModContent.ProjectileType(), firstBulletHellblastDamage, 0f, Main.myPlayer); } } } @@ -747,17 +747,17 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (bulletHellCounter2 < 1200) { if (bulletHellCounter2 % 180 == 0) // Blasts from top - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType(), gigablastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType(), gigablastDamage, 0f, Main.myPlayer); } else if (bulletHellCounter2 < 1500 && bulletHellCounter2 > 1200) { if (bulletHellCounter2 % 180 == 0) // Blasts from right - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -5f * uDieLul, 0f, ModContent.ProjectileType(), gigablastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -5f * uDieLul, 0f, ModContent.ProjectileType(), gigablastDamage, 0f, Main.myPlayer); } else if (bulletHellCounter2 > 1500) { if (bulletHellCounter2 % 180 == 0) // Blasts from top - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType(), gigablastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType(), gigablastDamage, 0f, Main.myPlayer); } bulletHellCounter += 1; if (bulletHellCounter >= baseBulletHellProjectileGateValue + 1) @@ -767,20 +767,20 @@ namespace CalamityMod.NPCs.SupremeCalamitas { float distance = Main.rand.NextBool() ? -1000f : 1000f; float velocity = (distance == -1000f ? 4f : -4f) * uDieLul; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + distance, player.position.Y, velocity, 0f, ModContent.ProjectileType(), firstBulletHellblastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + distance, player.position.Y, velocity, 0f, ModContent.ProjectileType(), firstBulletHellblastDamage, 0f, Main.myPlayer); } if (bulletHellCounter2 < 1200) // Blasts from below { - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y + 1000f, 0f, -4f * uDieLul, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y + 1000f, 0f, -4f * uDieLul, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer); } else if (bulletHellCounter2 < 1500) // Blasts from left { - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer); } else // Blasts from left and right { - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer); } } } @@ -815,10 +815,10 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.netMode != NetmodeID.MultiplayerClient) { if (bulletHellCounter2 % 180 == 0) // Blasts from top - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType(), gigablastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType(), gigablastDamage, 0f, Main.myPlayer); if (bulletHellCounter2 % 240 == 0) // Fireblasts from above - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 10f * uDieLul, ModContent.ProjectileType(), fireblastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 10f * uDieLul, ModContent.ProjectileType(), fireblastDamage, 0f, Main.myPlayer); bulletHellCounter += 1; if (bulletHellCounter >= baseBulletHellProjectileGateValue + 4) @@ -828,20 +828,20 @@ namespace CalamityMod.NPCs.SupremeCalamitas { float distance = Main.rand.NextBool() ? -1000f : 1000f; float velocity = (distance == -1000f ? 4f : -4f) * uDieLul; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + distance, player.position.Y, velocity, 0f, ModContent.ProjectileType(), firstBulletHellblastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + distance, player.position.Y, velocity, 0f, ModContent.ProjectileType(), firstBulletHellblastDamage, 0f, Main.myPlayer); } if (bulletHellCounter2 < 2100) // Blasts from above { - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 4f * uDieLul, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 4f * uDieLul, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer); } else if (bulletHellCounter2 < 2400) // Blasts from right { - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer); } else // Blasts from left and right { - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer); } } } @@ -879,17 +879,17 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.netMode != NetmodeID.MultiplayerClient) // More clustered attack { if (bulletHellCounter2 % 180 == 0) // Blasts from top - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType(), gigablastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType(), gigablastDamage, 0f, Main.myPlayer); if (bulletHellCounter2 % 240 == 0) // Fireblasts from above - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 10f * uDieLul, ModContent.ProjectileType(), fireblastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 10f * uDieLul, ModContent.ProjectileType(), fireblastDamage, 0f, Main.myPlayer); int divisor = revenge ? 225 : expertMode ? 450 : 675; // TODO -- Resprite Brimstone Monsters to be something else. WIPs posted by Iban. if (bulletHellCounter2 % divisor == 0 && expertMode) // Giant homing fireballs { - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 1f * uDieLul, ModContent.ProjectileType(), monsterDamage, 0f, Main.myPlayer, 0f, passedVar); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 1f * uDieLul, ModContent.ProjectileType(), monsterDamage, 0f, Main.myPlayer, 0f, passedVar); passedVar += 1f; } @@ -901,20 +901,20 @@ namespace CalamityMod.NPCs.SupremeCalamitas { float distance = Main.rand.NextBool() ? -1000f : 1000f; float velocity = (distance == -1000f ? 4f : -4f) * uDieLul; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + distance, player.position.Y, velocity, 0f, ModContent.ProjectileType(), firstBulletHellblastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + distance, player.position.Y, velocity, 0f, ModContent.ProjectileType(), firstBulletHellblastDamage, 0f, Main.myPlayer); } if (bulletHellCounter2 < 3000) // Blasts from below { - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y + 1000f, 0f, -4f * uDieLul, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y + 1000f, 0f, -4f * uDieLul, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer); } else if (bulletHellCounter2 < 3300) // Blasts from left { - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer); } else // Blasts from left and right { - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer); } } } @@ -952,16 +952,16 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.netMode != NetmodeID.MultiplayerClient) { if (bulletHellCounter2 % 240 == 0) // Blasts from top - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType(), gigablastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType(), gigablastDamage, 0f, Main.myPlayer); if (bulletHellCounter2 % 360 == 0) // Fireblasts from above - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 10f * uDieLul, ModContent.ProjectileType(), fireblastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 10f * uDieLul, ModContent.ProjectileType(), fireblastDamage, 0f, Main.myPlayer); if (bulletHellCounter2 % 30 == 0) // Projectiles that move in wave pattern { int random = Main.rand.Next(-500, 501); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + 1000f, player.position.Y + random, -5f * uDieLul, 0f, ModContent.ProjectileType(), waveDamage, 0f, Main.myPlayer); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X - 1000f, player.position.Y - random, 5f * uDieLul, 0f, ModContent.ProjectileType(), waveDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + random, -5f * uDieLul, 0f, ModContent.ProjectileType(), waveDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y - random, 5f * uDieLul, 0f, ModContent.ProjectileType(), waveDamage, 0f, Main.myPlayer); } bulletHellCounter += 1; @@ -972,22 +972,22 @@ namespace CalamityMod.NPCs.SupremeCalamitas { float distance = Main.rand.NextBool() ? -1000f : 1000f; float velocity = (distance == -1000f ? 4f : -4f) * uDieLul; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + distance, player.position.Y, velocity, 0f, ModContent.ProjectileType(), firstBulletHellblastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + distance, player.position.Y, velocity, 0f, ModContent.ProjectileType(), firstBulletHellblastDamage, 0f, Main.myPlayer); } if (bulletHellCounter2 < 3900) // Blasts from above { - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 4f * uDieLul, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 4f * uDieLul, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer); } else if (bulletHellCounter2 < 4200) // Blasts from left and right { - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer); } else // Blasts from above, left, and right { - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 3f * uDieLul, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 3f * uDieLul, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer); } } } @@ -1222,7 +1222,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas SoundEngine.PlaySound(SoundID.Item74, NPC.position); for (int I = 0; I < 20; I++) { - int FireEye = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)(vectorCenter.X + (Math.Sin(I * 18) * 300)), (int)(vectorCenter.Y + (Math.Cos(I * 18) * 300)), ModContent.NPCType(), NPC.whoAmI, 0, 0, 0, -1); + int FireEye = NPC.NewNPC(NPC.GetSource_FromAI(), (int)(vectorCenter.X + (Math.Sin(I * 18) * 300)), (int)(vectorCenter.Y + (Math.Cos(I * 18) * 300)), ModContent.NPCType(), NPC.whoAmI, 0, 0, 0, -1); NPC Eye = Main.npc[FireEye]; Eye.ai[0] = I * 18; Eye.ai[3] = I * 18; @@ -1478,7 +1478,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.netMode != NetmodeID.MultiplayerClient) { - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector82.X, vector82.Y, num825, num826, randomShot, fireblastDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vector82.X, vector82.Y, num825, num826, randomShot, fireblastDamage, 0f, Main.myPlayer, 0f, 0f); NPC.netUpdate = true; } } @@ -1507,7 +1507,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.netMode != NetmodeID.MultiplayerClient) { - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector82.X, vector82.Y, num825, num826, randomShot, gigablastDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vector82.X, vector82.Y, num825, num826, randomShot, gigablastDamage, 0f, Main.myPlayer, 0f, 0f); NPC.netUpdate = true; } } @@ -1542,7 +1542,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.netMode != NetmodeID.MultiplayerClient) { - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), value9.X, value9.Y, num180 + speedBoost, num182 + speedBoost, randomShot, barrageDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), value9.X, value9.Y, num180 + speedBoost, num182 + speedBoost, randomShot, barrageDamage, 0f, Main.myPlayer, 0f, 0f); NPC.netUpdate = true; } } @@ -1721,7 +1721,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas num416 *= num417; vector40.X += num415 * 2f; vector40.Y += num416 * 2f; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector40.X, vector40.Y, num415, num416, num420, hellblastDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vector40.X, vector40.Y, num415, num416, num420, hellblastDamage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -1827,7 +1827,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas num835 *= num836; vector83.X += num834 * 8f; vector83.Y += num835 * 8f; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector83.X, vector83.Y, num834, num835, num839, fireblastDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vector83.X, vector83.Y, num834, num835, num839, fireblastDamage, 0f, Main.myPlayer, 0f, 0f); } } @@ -2133,7 +2133,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.netMode != NetmodeID.MultiplayerClient) { - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector82.X, vector82.Y, num825, num826, randomShot, fireblastDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vector82.X, vector82.Y, num825, num826, randomShot, fireblastDamage, 0f, Main.myPlayer, 0f, 0f); NPC.netUpdate = true; } } @@ -2162,7 +2162,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.netMode != NetmodeID.MultiplayerClient) { - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector82.X, vector82.Y, num825, num826, randomShot, gigablastDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vector82.X, vector82.Y, num825, num826, randomShot, gigablastDamage, 0f, Main.myPlayer, 0f, 0f); NPC.netUpdate = true; } } @@ -2197,7 +2197,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.netMode != NetmodeID.MultiplayerClient) { - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), value9.X, value9.Y, num180 + speedBoost, num182 + speedBoost, randomShot, barrageDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), value9.X, value9.Y, num180 + speedBoost, num182 + speedBoost, randomShot, barrageDamage, 0f, Main.myPlayer, 0f, 0f); NPC.netUpdate = true; } } @@ -2368,7 +2368,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas num416 *= num417; vector40.X += num415 * 4f; vector40.Y += num416 * 4f; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector40.X, vector40.Y, num415, num416, num420, hellblastDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vector40.X, vector40.Y, num415, num416, num420, hellblastDamage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -2479,7 +2479,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas num835 *= num836; vector83.X += num834 * 8f; vector83.Y += num835 * 8f; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector83.X, vector83.Y, num834, num835, num839, fireblastDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vector83.X, vector83.Y, num834, num835, num839, fireblastDamage, 0f, Main.myPlayer, 0f, 0f); } } @@ -2567,10 +2567,10 @@ namespace CalamityMod.NPCs.SupremeCalamitas List hearts = new List(); for (int x = 0; x < 5; x++) { - hearts.Add(NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), spawnX + 50, tempSpawnY, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255)); + hearts.Add(NPC.NewNPC(NPC.GetSource_FromAI(), spawnX + 50, tempSpawnY, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255)); spawnX += spawnXAdd; - hearts.Add(NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), spawnX2 - 50, tempSpawnY, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255)); + hearts.Add(NPC.NewNPC(NPC.GetSource_FromAI(), spawnX2 - 50, tempSpawnY, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255)); spawnX2 -= spawnXAdd; tempSpawnY += spawnYAdd; } @@ -2741,7 +2741,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas Main.player[NPC.target].Calamity().sCalKillCount++; // Spawn the SCal NPC directly where the boss was - NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.Center.X, (int)NPC.Center.Y + 12, ModContent.NPCType()); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y + 12, ModContent.NPCType()); // Mark Supreme Calamitas as defeated DownedBossSystem.downedSCal = true; diff --git a/NPCs/SupremeCalamitas/SupremeCataclysm.cs b/NPCs/SupremeCalamitas/SupremeCataclysm.cs index d97e628b88..7ec18e56ca 100644 --- a/NPCs/SupremeCalamitas/SupremeCataclysm.cs +++ b/NPCs/SupremeCalamitas/SupremeCataclysm.cs @@ -199,7 +199,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.netMode != NetmodeID.MultiplayerClient) { Vector2 fistSpawnPosition = NPC.Center + Vector2.UnitX * -74f; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), fistSpawnPosition, Vector2.UnitX * -8f, type, damage, 0f, Main.myPlayer, 0f, PunchingFromRight.ToInt()); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fistSpawnPosition, Vector2.UnitX * -8f, type, damage, 0f, Main.myPlayer, 0f, PunchingFromRight.ToInt()); } PunchingFromRight = !PunchingFromRight; CurrentFrame = 0; @@ -226,8 +226,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas for (int i = 0; i < 8; i++) { offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center.X, NPC.Center.Y, (float)(Math.Sin(offsetAngle) * speed), (float)(Math.Cos(offsetAngle) * speed), type, damage, 0f, Main.myPlayer, 0f, 1f); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center.X, NPC.Center.Y, (float)(-Math.Sin(offsetAngle) * speed), (float)(-Math.Cos(offsetAngle) * speed), type, damage, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y, (float)(Math.Sin(offsetAngle) * speed), (float)(Math.Cos(offsetAngle) * speed), type, damage, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y, (float)(-Math.Sin(offsetAngle) * speed), (float)(-Math.Cos(offsetAngle) * speed), type, damage, 0f, Main.myPlayer, 0f, 1f); } } @@ -284,7 +284,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { int heartAmt = Main.rand.Next(3) + 3; for (int i = 0; i < heartAmt; i++) - Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); + Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); } } diff --git a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs index 78f4792f03..71b62e87e3 100644 --- a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs +++ b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs @@ -204,7 +204,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas int damage = NPC.GetProjectileDamage(type); Vector2 slashSpawnPosition = NPC.Center + Vector2.UnitX * 125f; if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), slashSpawnPosition, Vector2.UnitX * 4f, type, damage, 0f, Main.myPlayer, 0f, SlashingFromRight.ToInt()); + Projectile.NewProjectile(NPC.GetSource_FromAI(), slashSpawnPosition, Vector2.UnitX * 4f, type, damage, 0f, Main.myPlayer, 0f, SlashingFromRight.ToInt()); SlashingFromRight = !SlashingFromRight; CurrentFrame = 0; } @@ -230,8 +230,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas for (int i = 0; i < 8; i++) { offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center.X, NPC.Center.Y, (float)(Math.Sin(offsetAngle) * speed), (float)(Math.Cos(offsetAngle) * speed), type, damage, 0f, Main.myPlayer, 0f, 1f); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center.X, NPC.Center.Y, (float)(-Math.Sin(offsetAngle) * speed), (float)(-Math.Cos(offsetAngle) * speed), type, damage, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y, (float)(Math.Sin(offsetAngle) * speed), (float)(Math.Cos(offsetAngle) * speed), type, damage, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y, (float)(-Math.Sin(offsetAngle) * speed), (float)(-Math.Cos(offsetAngle) * speed), type, damage, 0f, Main.myPlayer, 0f, 1f); } } @@ -288,7 +288,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { int heartAmt = Main.rand.Next(3) + 3; for (int i = 0; i < heartAmt; i++) - Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); + Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); } } diff --git a/NPCs/TownNPCs/THIEF.cs b/NPCs/TownNPCs/THIEF.cs index 75cbbee336..0da1f0b030 100644 --- a/NPCs/TownNPCs/THIEF.cs +++ b/NPCs/TownNPCs/THIEF.cs @@ -196,13 +196,13 @@ namespace CalamityMod.NPCs.TownNPCs CalamityWorld.Reforges = 0; int[] coinCounts = Utils.CoinsSplit(CalamityWorld.MoneyStolenByBandit); if (coinCounts[0] > 0) - Item.NewItem(NPC.GetItemSource_Loot(), NPC.Hitbox, ItemID.PlatinumCoin, coinCounts[0]); + Item.NewItem(NPC.GetSource_Loot(), NPC.Hitbox, ItemID.PlatinumCoin, coinCounts[0]); if (coinCounts[1] > 0) - Item.NewItem(NPC.GetItemSource_Loot(), NPC.Hitbox, ItemID.GoldCoin, coinCounts[1]); + Item.NewItem(NPC.GetSource_Loot(), NPC.Hitbox, ItemID.GoldCoin, coinCounts[1]); if (coinCounts[2] > 0) - Item.NewItem(NPC.GetItemSource_Loot(), NPC.Hitbox, ItemID.SilverCoin, coinCounts[2]); + Item.NewItem(NPC.GetSource_Loot(), NPC.Hitbox, ItemID.SilverCoin, coinCounts[2]); if (coinCounts[3] > 0) - Item.NewItem(NPC.GetItemSource_Loot(), NPC.Hitbox, ItemID.CopperCoin, coinCounts[3]); + Item.NewItem(NPC.GetSource_Loot(), NPC.Hitbox, ItemID.CopperCoin, coinCounts[3]); CalamityWorld.MoneyStolenByBandit = 0; NPC goblinFucker = Main.npc[goblinIndex]; diff --git a/NPCs/TownNPCs/WITCH.cs b/NPCs/TownNPCs/WITCH.cs index 414e2410b9..00d9243eb3 100644 --- a/NPCs/TownNPCs/WITCH.cs +++ b/NPCs/TownNPCs/WITCH.cs @@ -144,7 +144,7 @@ namespace CalamityMod.NPCs.TownNPCs if (!Main.LocalPlayer.Calamity().GivenBrimstoneLocus) { - Item.NewItem(NPC.GetItemSource_Loot(), NPC.Hitbox, ItemType()); + Item.NewItem(NPC.GetSource_Loot(), NPC.Hitbox, ItemType()); Main.LocalPlayer.Calamity().GivenBrimstoneLocus = true; } diff --git a/NPCs/VanillaNPCOverrides/Bosses/BrainOfCthulhuAI.cs b/NPCs/VanillaNPCOverrides/Bosses/BrainOfCthulhuAI.cs index fce207243c..7a852841ed 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/BrainOfCthulhuAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/BrainOfCthulhuAI.cs @@ -59,7 +59,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses num790 += Main.rand.Next(-npc.width, npc.width); num791 += Main.rand.Next(-npc.height, npc.height); - int num792 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)num790, (int)num791, NPCID.Creeper, 0, 0f, 0f, 0f, 0f, 255); + int num792 = NPC.NewNPC(npc.GetSource_FromAI(), (int)num790, (int)num791, NPCID.Creeper, 0, 0f, 0f, 0f, 0f, 255); Main.npc[num792].velocity = new Vector2(Main.rand.Next(-30, 31) * 0.1f, Main.rand.Next(-30, 31) * 0.1f); Main.npc[num792].netUpdate = true; } diff --git a/NPCs/VanillaNPCOverrides/Bosses/CultistAI.cs b/NPCs/VanillaNPCOverrides/Bosses/CultistAI.cs index 8e6d680510..cfa683c803 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/CultistAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/CultistAI.cs @@ -443,7 +443,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses Vector2 vector = center3 + new Vector2(npc.direction * 30, 12f); Vector2 vector2 = vec * (fireballSpeed + (float)Main.rand.NextDouble() * 2f); vector2 = vector2.RotatedByRandom(0.52359879016876221); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector, vector2, ProjectileID.CultistBossFireBallClone, fireballDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector, vector2, ProjectileID.CultistBossFireBallClone, fireballDamage, 0f, Main.myPlayer); } } @@ -455,7 +455,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses Vector2 vector3 = npc.Center + new Vector2(npc.direction * 30, 12f); Vector2 vector4 = vec * iceMistSpeed; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector3, vector4, ProjectileID.CultistBossIceMist, iceMistDamage, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector3, vector4, ProjectileID.CultistBossIceMist, iceMistDamage, 0f, Main.myPlayer, 0f, 1f); } } @@ -508,7 +508,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses Vector2 vector5 = center4 + new Vector2(npc.direction * 30, 12f); Vector2 vector6 = vec2 * (fireballSpeed + (float)Main.rand.NextDouble() * 2f); vector6 = vector6.RotatedByRandom(0.52359879016876221); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector5, vector6, ProjectileID.CultistBossFireBallClone, fireballDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector5, vector6, ProjectileID.CultistBossFireBallClone, fireballDamage, 0f, Main.myPlayer); } } } @@ -526,7 +526,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses Vector2 vector7 = npc.Center + new Vector2(npc.direction * 30, 12f); Vector2 vector8 = vec2 * (fireballSpeed + (float)Main.rand.NextDouble() * 4f); vector8 = vector8.RotatedByRandom(0.52359879016876221); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector7, vector8, ProjectileID.CultistBossFireBall, fireballDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector7, vector8, ProjectileID.CultistBossFireBall, fireballDamage, 0f, Main.myPlayer); } } @@ -574,10 +574,10 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses Vector2 vector9 = center5 + new Vector2(npc.direction * 30, 12f); Vector2 vector10 = vec3 * (fireballSpeed + (float)Main.rand.NextDouble() * 2f); vector10 = vector10.RotatedByRandom(0.52359879016876221); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector9.X, vector9.Y, vector10.X, vector10.Y, ProjectileID.CultistBossFireBallClone, fireballDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector9.X, vector9.Y, vector10.X, vector10.Y, ProjectileID.CultistBossFireBallClone, fireballDamage, 0f, Main.myPlayer); } - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center.X, npc.Center.Y - 100f, 0f, 0f, ProjectileID.CultistBossLightningOrb, lightningDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y - 100f, 0f, 0f, ProjectileID.CultistBossLightningOrb, lightningDamage, 0f, Main.myPlayer); } npc.ai[1] += 1f; @@ -649,7 +649,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses Vector2 vector11 = npc.Center + spinningpoint.RotatedBy(num36 * MathHelper.TwoPi / num31 - MathHelper.PiOver2); if (num35-- > 0) { - int num37 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)vector11.X, (int)vector11.Y + npc.height / 2, NPCID.CultistBossClone, npc.whoAmI); + int num37 = NPC.NewNPC(npc.GetSource_FromAI(), (int)vector11.X, (int)vector11.Y + npc.height / 2, NPCID.CultistBossClone, npc.whoAmI); Main.npc[num37].ai[3] = npc.whoAmI; Main.npc[num37].netUpdate = true; Main.npc[num37].localAI[1] = npc.localAI[1]; @@ -663,7 +663,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses } } - npc.ai[2] = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center, Vector2.Zero, ProjectileID.CultistRitual, 0, 0f, Main.myPlayer, 0f, npc.whoAmI); + npc.ai[2] = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, Vector2.Zero, ProjectileID.CultistRitual, 0, 0f, Main.myPlayer, 0f, npc.whoAmI); npc.Center += spinningpoint.RotatedBy(num33 * MathHelper.TwoPi / num31 - MathHelper.PiOver2); npc.netUpdate = true; list6.Clear(); @@ -843,7 +843,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses Vector2 vector19 = vec4 * scaleFactor; vector19 = vector19.RotatedBy(num48 * num49 - (1.2566371f - num48) / 2f); float ai = (Main.rand.NextFloat() - 0.5f) * 0.3f * MathHelper.TwoPi / 60f; - int num50 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)vector18.X, (int)vector18.Y + 7, NPCID.AncientLight, 0, 0f, ai, vector19.X, vector19.Y, 255); + int num50 = NPC.NewNPC(npc.GetSource_FromAI(), (int)vector18.X, (int)vector18.Y + 7, NPCID.AncientLight, 0, 0f, ai, vector19.X, vector19.Y, 255); Main.npc[num50].velocity = vector19; num49++; } @@ -891,7 +891,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses for (int i = 0; i < ancientDoomLimit; i++) { float ai2 = i * 120; - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(player.Center.X + (float)(Math.Sin(i * 120) * 550)), (int)(player.Center.Y + (float)(Math.Cos(i * 120) * 550)), + NPC.NewNPC(npc.GetSource_FromAI(), (int)(player.Center.X + (float)(Math.Sin(i * 120) * 550)), (int)(player.Center.Y + (float)(Math.Cos(i * 120) * 550)), NPCID.AncientDoom, 0, npc.whoAmI, 0f, ai2, 0f, Main.maxPlayers); } } @@ -923,7 +923,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (flag7) { - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), num60 * 16 + 8, num61 * 16 + 8, NPCID.AncientDoom, 0, npc.whoAmI); + NPC.NewNPC(npc.GetSource_FromAI(), num60 * 16 + 8, num61 * 16 + 8, NPCID.AncientDoom, 0, npc.whoAmI); break; } } @@ -1176,7 +1176,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center, vector255, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, vector255, type, damage, 0f, Main.myPlayer); } } } diff --git a/NPCs/VanillaNPCOverrides/Bosses/DestroyerAI.cs b/NPCs/VanillaNPCOverrides/Bosses/DestroyerAI.cs index 00c5266eaf..fac45b8575 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/DestroyerAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/DestroyerAI.cs @@ -153,7 +153,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (j == totalSegments) type = NPCID.TheDestroyerTail; - int segment = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(npc.position.X + (npc.width / 2)), (int)(npc.position.Y + npc.height), type, npc.whoAmI); + int segment = NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.position.X + (npc.width / 2)), (int)(npc.position.Y + npc.height), type, npc.whoAmI); Main.npc[segment].ai[3] = npc.whoAmI; Main.npc[segment].realLife = npc.whoAmI; Main.npc[segment].ai[1] = index; @@ -200,7 +200,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses for (int i = 0; i < numProj; i++) { offsetAngle = startAngle + deltaAngle * i; - int proj = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vectorCenter.X, vectorCenter.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), type, damage, 0f, Main.myPlayer, 1f, 0f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), vectorCenter.X, vectorCenter.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), type, damage, 0f, Main.myPlayer, 1f, 0f); Main.projectile[proj].timeLeft = 900; } } @@ -259,7 +259,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses // Shoot projectile and set timeLeft if not a homing laser/metal scrap so lasers don't last for too long int damage = npc.GetProjectileDamage(projectileType); - int proj = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), projectileSpawn, projectileVelocity, projectileType, damage, 0f, Main.myPlayer, 1f, 0f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), projectileSpawn, projectileVelocity, projectileType, damage, 0f, Main.myPlayer, 1f, 0f); Main.projectile[proj].timeLeft = 900; npc.netUpdate = true; @@ -723,7 +723,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses velocityMultiplier = 0.8f; break; } - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector.X, vector.Y, num4 * velocityMultiplier, num5 * velocityMultiplier, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector.X, vector.Y, num4 * velocityMultiplier, num5 * velocityMultiplier, type, damage, 0f, Main.myPlayer); } npc.netUpdate = true; diff --git a/NPCs/VanillaNPCOverrides/Bosses/DukeFishronAI.cs b/NPCs/VanillaNPCOverrides/Bosses/DukeFishronAI.cs index 594efd4c17..45e05d3485 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/DukeFishronAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/DukeFishronAI.cs @@ -180,7 +180,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses calamityGlobalNPC.newAI[0] = 0f; if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector, Vector2.Zero, ProjectileID.SharknadoBolt, 0, 0f, Main.myPlayer, 1f, npc.target + 1); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector, Vector2.Zero, ProjectileID.SharknadoBolt, 0, 0f, Main.myPlayer, 1f, npc.target + 1); npc.netUpdate = true; } @@ -459,7 +459,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { Vector2 vector6 = Vector2.Normalize(player.Center - vector) * (npc.width + 20) / 2f + vector; - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)vector6.X, (int)vector6.Y + 45, NPCID.DetonatingBubble); + NPC.NewNPC(npc.GetSource_FromAI(), (int)vector6.X, (int)vector6.Y + 45, NPCID.DetonatingBubble); } } @@ -502,12 +502,12 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses float velocityY = normal ? 8f : -4f; float ai1 = normal ? 0f : -1f; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector7.X, vector7.Y, npc.direction * 3, velocityY, ProjectileID.SharknadoBolt, 0, 0f, Main.myPlayer, 0f, ai1); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector7.X, vector7.Y, -(float)npc.direction * 3, velocityY, ProjectileID.SharknadoBolt, 0, 0f, Main.myPlayer, 0f, ai1); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector7.X, vector7.Y, npc.direction * 3, velocityY, ProjectileID.SharknadoBolt, 0, 0f, Main.myPlayer, 0f, ai1); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector7.X, vector7.Y, -(float)npc.direction * 3, velocityY, ProjectileID.SharknadoBolt, 0, 0f, Main.myPlayer, 0f, ai1); velocityY = normal ? -4f : 8f; ai1 = normal ? -1f : 0f; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector7.X, vector7.Y, 0f, velocityY, ProjectileID.SharknadoBolt, 0, 0f, Main.myPlayer, 0f, ai1); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector7.X, vector7.Y, 0f, velocityY, ProjectileID.SharknadoBolt, 0, 0f, Main.myPlayer, 0f, ai1); } npc.ai[2] += 1f; @@ -708,7 +708,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { Vector2 vector10 = Vector2.Normalize(npc.velocity) * (npc.width + 20) / 2f + vector; - int num31 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)vector10.X, (int)vector10.Y + 45, NPCID.DetonatingBubble); + int num31 = NPC.NewNPC(npc.GetSource_FromAI(), (int)vector10.X, (int)vector10.Y + 45, NPCID.DetonatingBubble); Main.npc[num31].target = npc.target; Main.npc[num31].velocity = Vector2.Normalize(npc.velocity).RotatedBy(MathHelper.PiOver2 * npc.direction) * bubbleSpinBubbleVelocity; Main.npc[num31].netUpdate = true; @@ -716,7 +716,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.ai[2] % (bubbleSpinPhaseDivisor * 5) == 0f) { - int npc2 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)vector10.X, (int)vector10.Y + 45, NPCID.Sharkron2); + int npc2 = NPC.NewNPC(npc.GetSource_FromAI(), (int)vector10.X, (int)vector10.Y + 45, NPCID.Sharkron2); Main.npc[npc2].ai[1] = 89f; } } @@ -749,7 +749,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses SoundEngine.PlaySound(SoundID.Zombie, (int)vector.X, (int)vector.Y, 20, 1f, 0f); if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == sharknadoPhaseTimer - 30) - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector.X, vector.Y, 0f, 0f, ProjectileID.SharknadoBolt, 0, 0f, Main.myPlayer, 1f, npc.target + 1); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector.X, vector.Y, 0f, 0f, ProjectileID.SharknadoBolt, 0, 0f, Main.myPlayer, 1f, npc.target + 1); npc.ai[2] += 1f; if (npc.ai[2] >= sharknadoPhaseTimer) diff --git a/NPCs/VanillaNPCOverrides/Bosses/EaterOfWorldsAI.cs b/NPCs/VanillaNPCOverrides/Bosses/EaterOfWorldsAI.cs index c333018c0c..eea63b5a5f 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/EaterOfWorldsAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/EaterOfWorldsAI.cs @@ -82,7 +82,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { npc.TargetClosest(); if (Collision.CanHitLine(npc.Center, 1, 1, Main.player[npc.target].Center, 1, 1)) - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(npc.position.X + (npc.width / 2) + npc.velocity.X), (int)(npc.position.Y + (npc.height / 2) + npc.velocity.Y), NPCID.VileSpit, 0, 0f, 1f, 0f, 0f, 255); + NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.position.X + (npc.width / 2) + npc.velocity.X), (int)(npc.position.Y + (npc.height / 2) + npc.velocity.Y), NPCID.VileSpit, 0, 0f, 1f, 0f, 0f, 255); } } @@ -116,7 +116,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses vector34.Y -= num350; int type = ProjectileID.CursedFlameHostile; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector34.X, vector34.Y, num349, num350, type, npc.GetProjectileDamage(type), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector34.X, vector34.Y, num349, num350, type, npc.GetProjectileDamage(type), 0f, Main.myPlayer, 0f, 0f); } } } @@ -145,16 +145,16 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses npc.ai[2] = totalSegments; // Body spawn - npc.ai[0] = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), spawnX, spawnY, NPCID.EaterofWorldsBody, npc.whoAmI, 0f, 0f, 0f, 0f, 255); + npc.ai[0] = NPC.NewNPC(npc.GetSource_FromAI(), spawnX, spawnY, NPCID.EaterofWorldsBody, npc.whoAmI, 0f, 0f, 0f, 0f, 255); } // A body with a "length beyond this point" greater than zero just sets its next spawned segment to a freshly spawned body. else if (npc.type == NPCID.EaterofWorldsBody && npc.ai[2] > 0f) - npc.ai[0] = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), spawnX, spawnY, NPCID.EaterofWorldsBody, npc.whoAmI, 0f, 0f, 0f, 0f, 255); + npc.ai[0] = NPC.NewNPC(npc.GetSource_FromAI(), spawnX, spawnY, NPCID.EaterofWorldsBody, npc.whoAmI, 0f, 0f, 0f, 0f, 255); // If the worm stops here ("length beyond this point" is zero), then spawn a tail instead. else - npc.ai[0] = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), spawnX, spawnY, NPCID.EaterofWorldsTail, npc.whoAmI, 0f, 0f, 0f, 0f, 255); + npc.ai[0] = NPC.NewNPC(npc.GetSource_FromAI(), spawnX, spawnY, NPCID.EaterofWorldsTail, npc.whoAmI, 0f, 0f, 0f, 0f, 255); // Maintain the linked list of worm segments, and correctly set the "length beyond this point" of this segment. Main.npc[(int)npc.ai[0]].ai[1] = npc.whoAmI; diff --git a/NPCs/VanillaNPCOverrides/Bosses/EyeOfCthulhuAI.cs b/NPCs/VanillaNPCOverrides/Bosses/EyeOfCthulhuAI.cs index da3d7f941b..1343174f19 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/EyeOfCthulhuAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/EyeOfCthulhuAI.cs @@ -154,7 +154,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses Vector2 servantSpawnCenter = npc.Center + servantSpawnVelocity * 10f; if (Main.netMode != NetmodeID.MultiplayerClient && NPC.CountNPCS(NPCID.ServantofCthulhu) < 12) { - int num23 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)servantSpawnCenter.X, (int)servantSpawnCenter.Y, NPCID.ServantofCthulhu, 0, 0f, 0f, 0f, 0f, 255); + int num23 = NPC.NewNPC(npc.GetSource_FromAI(), (int)servantSpawnCenter.X, (int)servantSpawnCenter.Y, NPCID.ServantofCthulhu, 0, 0f, 0f, 0f, 0f, 255); Main.npc[num23].velocity = servantSpawnVelocity; if (Main.netMode == NetmodeID.Server && num23 < Main.maxNPCs) @@ -259,7 +259,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses Vector2 servantSpawnCenter = npc.Center + servantSpawnVelocity * 10f; if (Main.netMode != NetmodeID.MultiplayerClient) { - int num34 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)servantSpawnCenter.X, (int)servantSpawnCenter.Y, NPCID.ServantofCthulhu, 0, 0f, 0f, 0f, 0f, 255); + int num34 = NPC.NewNPC(npc.GetSource_FromAI(), (int)servantSpawnCenter.X, (int)servantSpawnCenter.Y, NPCID.ServantofCthulhu, 0, 0f, 0f, 0f, 0f, 255); Main.npc[num34].velocity.X = servantSpawnVelocity.X; Main.npc[num34].velocity.Y = servantSpawnVelocity.Y; @@ -610,7 +610,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses Vector2 servantSpawnCenter = npc.Center + servantSpawnVelocity * 10f; if (Main.netMode != NetmodeID.MultiplayerClient) { - int num34 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)servantSpawnCenter.X, (int)servantSpawnCenter.Y, NPCID.ServantofCthulhu, 0, 0f, 0f, 0f, 0f, 255); + int num34 = NPC.NewNPC(npc.GetSource_FromAI(), (int)servantSpawnCenter.X, (int)servantSpawnCenter.Y, NPCID.ServantofCthulhu, 0, 0f, 0f, 0f, 0f, 255); Main.npc[num34].velocity.X = servantSpawnVelocity.X; Main.npc[num34].velocity.Y = servantSpawnVelocity.Y; diff --git a/NPCs/VanillaNPCOverrides/Bosses/GolemAI.cs b/NPCs/VanillaNPCOverrides/Bosses/GolemAI.cs index 6ac4eaf194..3b6136d206 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/GolemAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/GolemAI.cs @@ -36,9 +36,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.localAI[0] == 0f && Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[0] = 1f; - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.Center.X - 84, (int)npc.Center.Y - 9, NPCID.GolemFistLeft); - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.Center.X + 78, (int)npc.Center.Y - 9, NPCID.GolemFistRight); - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.Center.X - 3, (int)npc.Center.Y - 57, NPCID.GolemHead); + NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X - 84, (int)npc.Center.Y - 9, NPCID.GolemFistLeft); + NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X + 78, (int)npc.Center.Y - 9, NPCID.GolemFistRight); + NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X - 3, (int)npc.Center.Y - 57, NPCID.GolemHead); } // Get a target @@ -189,7 +189,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses int damage = npc.GetProjectileDamage(type); if (Main.netMode != NetmodeID.MultiplayerClient) { - int num677 = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector82.X, vector82.Y, num674, num675, type, damage, 0f, Main.myPlayer, 0f, 0f); + int num677 = Projectile.NewProjectile(npc.GetSource_FromAI(), vector82.X, vector82.Y, num674, num675, type, damage, 0f, Main.myPlayer, 0f, 0f); Main.projectile[num677].timeLeft = 480; } } @@ -328,7 +328,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses int type = ProjectileID.Fireball; int damage = npc.GetProjectileDamage(type); - int proj = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), spawnVector, velocity, type, damage, 0f, Main.myPlayer); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), spawnVector, velocity, type, damage, 0f, Main.myPlayer); Main.projectile[proj].timeLeft = 240; } @@ -723,7 +723,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses int type = ProjectileID.Fireball; int damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector81.X, vector81.Y, num656, num657, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector81.X, vector81.Y, num656, num657, type, damage, 0f, Main.myPlayer, 0f, 0f); npc.netUpdate = true; } @@ -774,7 +774,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses int type = ProjectileID.Fireball; int damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector82.X, vector82.Y, num664, num665, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector82.X, vector82.Y, num664, num665, type, damage, 0f, Main.myPlayer, 0f, 0f); npc.netUpdate = true; } @@ -822,7 +822,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { - int num677 = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector82.X, vector82.Y, num674, num675, projType, dmg, 0f, Main.myPlayer, 0f, 0f); + int num677 = Projectile.NewProjectile(npc.GetSource_FromAI(), vector82.X, vector82.Y, num674, num675, projType, dmg, 0f, Main.myPlayer, 0f, 0f); Main.projectile[num677].timeLeft = enrage ? 480 : 300; npc.netUpdate = true; } @@ -852,7 +852,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { - int num682 = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector82.X, vector82.Y, num679, num680, projType, dmg, 0f, Main.myPlayer, 0f, 0f); + int num682 = Projectile.NewProjectile(npc.GetSource_FromAI(), vector82.X, vector82.Y, num679, num680, projType, dmg, 0f, Main.myPlayer, 0f, 0f); Main.projectile[num682].timeLeft = enrage ? 480 : 300; npc.netUpdate = true; } @@ -1136,7 +1136,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses int projectileType = phase3 ? ProjectileID.InfernoHostileBolt : ProjectileID.Fireball; int damage = npc.GetProjectileDamage(projectileType); - int proj = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector88.X, vector88.Y, num709, num710, projectileType, damage, 0f, Main.myPlayer, 0f, 0f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), vector88.X, vector88.Y, num709, num710, projectileType, damage, 0f, Main.myPlayer, 0f, 0f); if (projectileType == ProjectileID.InfernoHostileBolt) { Main.projectile[proj].timeLeft = 300; @@ -1180,7 +1180,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses int type = ProjectileID.EyeBeam; int damage = npc.GetProjectileDamage(type); - int num720 = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector89.X, vector89.Y, num717, num718, type, damage, 0f, Main.myPlayer, 0f, 0f); + int num720 = Projectile.NewProjectile(npc.GetSource_FromAI(), vector89.X, vector89.Y, num717, num718, type, damage, 0f, Main.myPlayer, 0f, 0f); Main.projectile[num720].timeLeft = enrage ? 480 : 300; } diff --git a/NPCs/VanillaNPCOverrides/Bosses/KingSlimeAI.cs b/NPCs/VanillaNPCOverrides/Bosses/KingSlimeAI.cs index 31e419866a..c43957014a 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/KingSlimeAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/KingSlimeAI.cs @@ -62,7 +62,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses } } SoundEngine.PlaySound(SoundID.Item38, (int)npc.position.X, (int)npc.position.Y); - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType()); + NPC.NewNPC(npc.GetSource_FromAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType()); } // Set up health value for spawning slimes @@ -387,7 +387,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (Main.rand.NextBool(250)) npcType = NPCID.Pinky; - int num255 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), x, y, npcType); + int num255 = NPC.NewNPC(npc.GetSource_FromAI(), x, y, npcType); Main.npc[num255].SetDefaults(npcType); Main.npc[num255].velocity.X = Main.rand.Next(-15, 16) * 0.1f; Main.npc[num255].velocity.Y = Main.rand.Next(-30, 1) * 0.1f; diff --git a/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs b/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs index 27430025bf..4ffbd6458f 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs @@ -114,7 +114,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses for (int num1156 = 0; num1156 < 2; num1156 = num + 1) { - int num1157 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.Center.X + num1156 * 800 - 400, (int)npc.Center.Y - 100, NPCID.MoonLordHand, npc.whoAmI, 0f, 0f, 0f, 0f, 255); + int num1157 = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X + num1156 * 800 - 400, (int)npc.Center.Y - 100, NPCID.MoonLordHand, npc.whoAmI, 0f, 0f, 0f, 0f, 255); Main.npc[num1157].ai[2] = num1156; Main.npc[num1157].netUpdate = true; int[] arg_381A6_0 = array5; @@ -124,7 +124,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses num = num1156; } - int num1158 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.Center.X, (int)npc.Center.Y - 400, NPCID.MoonLordHead, npc.whoAmI, 0f, 0f, 0f, 0f, 255); + int num1158 = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y - 400, NPCID.MoonLordHead, npc.whoAmI, 0f, 0f, 0f, 0f, 255); Main.npc[num1158].netUpdate = true; int[] arg_3823F_0 = array5; num = num1155; @@ -157,7 +157,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { if (Main.netMode != NetmodeID.MultiplayerClient) { - int num = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)Main.npc[(int)npc.localAI[2]].Center.X, (int)Main.npc[(int)npc.localAI[2]].Center.Y, NPCID.MoonLordFreeEye); + int num = NPC.NewNPC(npc.GetSource_FromAI(), (int)Main.npc[(int)npc.localAI[2]].Center.X, (int)Main.npc[(int)npc.localAI[2]].Center.Y, NPCID.MoonLordFreeEye); Main.npc[num].ai[3] = npc.whoAmI; Main.npc[num].netUpdate = true; } @@ -412,7 +412,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { float num1170 = (Main.rand.Next(4) < 2).ToDirectionInt() * (0.3926991f + MathHelper.PiOver4 * Main.rand.NextFloat()); Vector2 vector164 = new Vector2(0f, -Main.rand.NextFloat() * 0.5f - 0.5f).RotatedBy(num1170) * 6f; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector163.X, vector163.Y, vector164.X, vector164.Y, ProjectileID.BlowupSmokeMoonlord, 0, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector163.X, vector163.Y, vector164.X, vector164.Y, ProjectileID.BlowupSmokeMoonlord, 0, 0f, Main.myPlayer, 0f, 0f); } } @@ -777,7 +777,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses num1225 = 1f; vector200 = vector200.RotatedBy(-(double)num1225 * MathHelper.TwoPi / 6f); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center.X, npc.Center.Y, vector200.X, vector200.Y, projectileType, damage, 0f, Main.myPlayer, num1225 * MathHelper.TwoPi / calamityGlobalNPC.newAI[1], npc.whoAmI); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y, vector200.X, vector200.Y, projectileType, damage, 0f, Main.myPlayer, num1225 * MathHelper.TwoPi / calamityGlobalNPC.newAI[1], npc.whoAmI); npc.ai[2] = (vector200.ToRotation() + MathHelper.Pi + MathHelper.TwoPi) * num1225; npc.netUpdate = true; } @@ -827,7 +827,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (vector202 != Vector2.Zero) vector202.Normalize(); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector201.X, vector201.Y, vector202.X, vector202.Y, ProjectileID.MoonLeech, 0, 0f, Main.myPlayer, npc.whoAmI + 1, num1228); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector201.X, vector201.Y, vector202.X, vector202.Y, ProjectileID.MoonLeech, 0, 0f, Main.myPlayer, npc.whoAmI + 1, num1228); } } } @@ -840,7 +840,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (projectile6.active && projectile6.type == ProjectileID.MoonLeech && Main.player[(int)projectile6.ai[1]].FindBuffIndex(145) != -1) { Vector2 center21 = Main.player[npc.target].Center; - int num1230 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)center21.X, (int)center21.Y, NPCID.MoonLordLeechBlob); + int num1230 = NPC.NewNPC(npc.GetSource_FromAI(), (int)center21.X, (int)center21.Y, NPCID.MoonLordLeechBlob); Main.npc[num1230].netUpdate = true; Main.npc[num1230].ai[0] = npc.whoAmI + 1; Main.npc[num1230].ai[1] = num1229; @@ -923,7 +923,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses Vector2 vector204 = Vector2.Normalize(v4) * velocity; int type = ProjectileID.PhantasmalBolt; int damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center.X + vector203.X, npc.Center.Y + vector203.Y, vector204.X, vector204.Y, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X + vector203.X, npc.Center.Y + vector203.Y, vector204.X, vector204.Y, type, damage, 0f, Main.myPlayer, 0f, 0f); } } @@ -1159,7 +1159,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses float ai = (MathHelper.TwoPi * (float)Main.rand.NextDouble() - MathHelper.Pi) / 30f + 0.0174532924f * num1177; int type = ProjectileID.PhantasmalEye; int damage = npc.GetProjectileDamage(type); - int proj = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector169, vector170, type, damage, 0f, Main.myPlayer, 0f, ai); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), vector169, vector170, type, damage, 0f, Main.myPlayer, 0f, ai); Main.projectile[proj].timeLeft = 1200; Main.projectile[proj].Calamity().lineColor = malice ? 1 : aggressionLevel; } @@ -1284,7 +1284,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses vector173 *= 1.2f; int type = ProjectileID.PhantasmalSphere; int damage = npc.GetProjectileDamage(type); - int proj = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center.X, npc.Center.Y, vector173.X, vector173.Y, type, damage, 1f, Main.myPlayer, 0f, npc.whoAmI); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y, vector173.X, vector173.Y, type, damage, 1f, Main.myPlayer, 0f, npc.whoAmI); Main.projectile[proj].timeLeft = 1200; } @@ -1531,7 +1531,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses Vector2 vector182 = Vector2.Normalize(v) * velocity; int type = ProjectileID.PhantasmalBolt; int damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center.X + vector181.X, npc.Center.Y + vector181.Y, vector182.X, vector182.Y, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X + vector181.X, npc.Center.Y + vector181.Y, vector182.X, vector182.Y, type, damage, 0f, Main.myPlayer, 0f, 0f); } } @@ -1784,7 +1784,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses Vector2 vector215 = Vector2.Normalize(v8) * velocity; int type = ProjectileID.PhantasmalBolt; int damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center.X + vector214.X, npc.Center.Y + vector214.Y, vector215.X, vector215.Y, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X + vector214.X, npc.Center.Y + vector214.Y, vector215.X, vector215.Y, type, damage, 0f, Main.myPlayer, 0f, 0f); } } else if (npc.ai[0] == 2f || npc.ai[0] == 4f) @@ -1862,7 +1862,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses float spreadVelocity = death ? 4.5f : 4f; vector217 *= 4f; - int proj = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center.X + vector216.X, npc.Center.Y + vector216.Y, vector217.X, vector217.Y, type, 0, 0f, Main.myPlayer, 30f, npc.whoAmI); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X + vector216.X, npc.Center.Y + vector216.Y, vector217.X, vector217.Y, type, 0, 0f, Main.myPlayer, 30f, npc.whoAmI); Main.projectile[proj].timeLeft = 1200; } } @@ -2000,7 +2000,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses float ai3 = (MathHelper.TwoPi * (float)Main.rand.NextDouble() - MathHelper.Pi) / 30f + 0.0174532924f * npc.ai[2]; int type = ProjectileID.PhantasmalEye; int damage = npc.GetProjectileDamage(type); - int proj = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector219, vector220, type, damage, 0f, Main.myPlayer, 0f, ai3); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), vector219, vector220, type, damage, 0f, Main.myPlayer, 0f, ai3); Main.projectile[proj].timeLeft = 1200; } } @@ -2077,7 +2077,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses vector222 = vector222.RotatedBy(-(double)num1262 * MathHelper.TwoPi / 6f); int type = ProjectileID.PhantasmalDeathray; int damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center.X, npc.Center.Y, vector222.X, vector222.Y, type, damage, 0f, Main.myPlayer, num1262 * MathHelper.TwoPi / calamityGlobalNPC.newAI[1], npc.whoAmI); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y, vector222.X, vector222.Y, type, damage, 0f, Main.myPlayer, num1262 * MathHelper.TwoPi / calamityGlobalNPC.newAI[1], npc.whoAmI); npc.ai[2] = (vector222.ToRotation() + MathHelper.Pi + MathHelper.TwoPi) * num1262; npc.netUpdate = true; } diff --git a/NPCs/VanillaNPCOverrides/Bosses/PlanteraAI.cs b/NPCs/VanillaNPCOverrides/Bosses/PlanteraAI.cs index 43e811cb50..73a3e13f27 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/PlanteraAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/PlanteraAI.cs @@ -75,9 +75,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.localAI[0] == 0f && Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[0] = 1f; - int num729 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasHook, npc.whoAmI); - num729 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasHook, npc.whoAmI); - num729 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasHook, npc.whoAmI); + int num729 = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasHook, npc.whoAmI); + num729 = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasHook, npc.whoAmI); + num729 = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasHook, npc.whoAmI); } // Find positions of hooks @@ -273,7 +273,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses int totalTentacles = (int)(baseTentacles * tileEnrageMult); for (int i = 0; i < totalTentacles; i++) { - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasTentacle, npc.whoAmI, 0f, 0f, tentacleEnrageMult); + NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasTentacle, npc.whoAmI, 0f, 0f, tentacleEnrageMult); } } } @@ -352,7 +352,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses vector93.X += num743 * 3f; vector93.Y += num744 * 3f; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector93.X, vector93.Y, num743, num744, projectileType, damage, 0f, Main.myPlayer, 0f, projectileType == ProjectileID.ThornBall ? tileEnrageMult : 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector93.X, vector93.Y, num743, num744, projectileType, damage, 0f, Main.myPlayer, 0f, projectileType == ProjectileID.ThornBall ? tileEnrageMult : 0f); } } } @@ -377,7 +377,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses int totalTentacles = (int)(baseTentacles * tileEnrageMult); for (int i = 0; i < totalTentacles; i++) { - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasTentacle, npc.whoAmI, 0f, 0f, tentacleEnrageMult); + NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasTentacle, npc.whoAmI, 0f, 0f, tentacleEnrageMult); } } } @@ -427,7 +427,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses num758 *= num761; num760 *= num761; - int num762 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.Spore); + int num762 = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.Spore); Main.npc[num762].velocity.X = num758; Main.npc[num762].velocity.Y = num760; Main.npc[num762].dontTakeDamage = malice; @@ -486,7 +486,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses int type = ProjectileID.ThornBall; int damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector93.X, vector93.Y, num743, num744, type, damage, 0f, Main.myPlayer, 0f, tileEnrageMult); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector93.X, vector93.Y, num743, num744, type, damage, 0f, Main.myPlayer, 0f, tileEnrageMult); npc.localAI[3] = -240f; } @@ -504,7 +504,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses for (int i = 0; i < numProj + 1; i++) { Vector2 perturbedSpeed = new Vector2(num743, num744).RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1))); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector93, perturbedSpeed, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector93, perturbedSpeed, type, damage, 0f, Main.myPlayer, 0f, 0f); } npc.localAI[3] = 0f; @@ -551,7 +551,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { offsetAngle = startAngle + deltaAngle * i; float ai0 = Main.rand.Next(3); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector93.X, vector93.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), type, damage, 0f, Main.myPlayer, ai0, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector93.X, vector93.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), type, damage, 0f, Main.myPlayer, ai0, 0f); } calamityGlobalNPC.newAI[0] = 0f; @@ -611,7 +611,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses npc.ai[0] = npc.life; if (NPC.CountNPCS(NPCID.PlanterasTentacle) < maxTentacles) - NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasTentacle, npc.whoAmI, 0f, 0f, tentacleEnrageMult); + NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasTentacle, npc.whoAmI, 0f, 0f, tentacleEnrageMult); } } } diff --git a/NPCs/VanillaNPCOverrides/Bosses/QueenBeeAI.cs b/NPCs/VanillaNPCOverrides/Bosses/QueenBeeAI.cs index 3cf3be63e0..d1e30c2ed0 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/QueenBeeAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/QueenBeeAI.cs @@ -467,7 +467,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (phase3) spawnType = NPCID.Bee; - int spawn = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)vector76.X, (int)vector76.Y, spawnType); + int spawn = NPC.NewNPC(npc.GetSource_FromAI(), (int)vector76.X, (int)vector76.Y, spawnType); Main.npc[spawn].velocity = Main.player[npc.target].Center - npc.Center; Main.npc[spawn].velocity.Normalize(); Main.npc[spawn].velocity *= 5f; @@ -564,7 +564,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses num625 *= num627; num626 *= num627; int type = ProjectileID.Stinger; - int projectile = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector78.X, vector78.Y, num625, num626, type, npc.GetProjectileDamage(type), 0f, Main.myPlayer, 0f, 0f); + int projectile = Projectile.NewProjectile(npc.GetSource_FromAI(), vector78.X, vector78.Y, num625, num626, type, npc.GetProjectileDamage(type), 0f, Main.myPlayer, 0f, 0f); Main.projectile[projectile].timeLeft = 300; } } diff --git a/NPCs/VanillaNPCOverrides/Bosses/SkeletronAI.cs b/NPCs/VanillaNPCOverrides/Bosses/SkeletronAI.cs index 0497c563f0..8675173844 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/SkeletronAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/SkeletronAI.cs @@ -65,13 +65,13 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses void SpawnHands() { - int num155 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.SkeletronHand, npc.whoAmI); + int num155 = NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.SkeletronHand, npc.whoAmI); Main.npc[num155].ai[0] = -1f; Main.npc[num155].ai[1] = npc.whoAmI; Main.npc[num155].target = npc.target; Main.npc[num155].netUpdate = true; - num155 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.SkeletronHand, npc.whoAmI); + num155 = NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.SkeletronHand, npc.whoAmI); Main.npc[num155].ai[0] = 1f; Main.npc[num155].ai[1] = npc.whoAmI; Main.npc[num155].ai[3] = 150f; @@ -81,7 +81,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses // Spawn two additional hands with different attack timings if (death) { - num155 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.SkeletronHand, npc.whoAmI); + num155 = NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.SkeletronHand, npc.whoAmI); Main.npc[num155].ai[0] = -1f; Main.npc[num155].Calamity().newAI[0] = -1f; Main.npc[num155].ai[1] = npc.whoAmI; @@ -89,7 +89,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses Main.npc[num155].target = npc.target; Main.npc[num155].netUpdate = true; - num155 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.SkeletronHand, npc.whoAmI); + num155 = NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.SkeletronHand, npc.whoAmI); Main.npc[num155].ai[0] = 1f; Main.npc[num155].Calamity().newAI[0] = -1f; Main.npc[num155].ai[1] = npc.whoAmI; @@ -173,7 +173,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses for (int i = 0; i < numProj; i++) { offsetAngle = startAngle + deltaAngle * i; - int proj = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vectorCenter.X, vectorCenter.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), type, damage, 0f, Main.myPlayer, 0f, 1f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), vectorCenter.X, vectorCenter.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), type, damage, 0f, Main.myPlayer, 0f, 1f); Main.projectile[proj].timeLeft = 600; } npc.netUpdate = true; @@ -309,7 +309,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses int type = ProjectileID.Skull; int damage = npc.GetProjectileDamage(type); vector18 += vector19 * 5f; - int num168 = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector18.X, vector18.Y, num163, num164, type, damage, 0f, Main.myPlayer, -1f, 0f); + int num168 = Projectile.NewProjectile(npc.GetSource_FromAI(), vector18.X, vector18.Y, num163, num164, type, damage, 0f, Main.myPlayer, -1f, 0f); Main.projectile[num168].timeLeft = 300; npc.netUpdate = true; @@ -749,7 +749,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses int damage = 2500; int projType = ProjectileID.Skull; source += offset * 5f; - int skull = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), source, velocity, projType, damage, 0f, Main.myPlayer, -1f, 0f); + int skull = Projectile.NewProjectile(npc.GetSource_FromAI(), source, velocity, projType, damage, 0f, Main.myPlayer, -1f, 0f); Main.projectile[skull].timeLeft = 300; } } diff --git a/NPCs/VanillaNPCOverrides/Bosses/SkeletronPrimeAI.cs b/NPCs/VanillaNPCOverrides/Bosses/SkeletronPrimeAI.cs index d597ac2da1..957a7cf795 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/SkeletronPrimeAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/SkeletronPrimeAI.cs @@ -41,26 +41,26 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { npc.ai[0] = 1f; - int arm = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.PrimeCannon, npc.whoAmI); + int arm = NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.PrimeCannon, npc.whoAmI); Main.npc[arm].ai[0] = -1f; Main.npc[arm].ai[1] = npc.whoAmI; Main.npc[arm].target = npc.target; Main.npc[arm].netUpdate = true; - arm = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.PrimeSaw, npc.whoAmI); + arm = NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.PrimeSaw, npc.whoAmI); Main.npc[arm].ai[0] = 1f; Main.npc[arm].ai[1] = npc.whoAmI; Main.npc[arm].target = npc.target; Main.npc[arm].netUpdate = true; - arm = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.PrimeVice, npc.whoAmI); + arm = NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.PrimeVice, npc.whoAmI); Main.npc[arm].ai[0] = -1f; Main.npc[arm].ai[1] = npc.whoAmI; Main.npc[arm].target = npc.target; Main.npc[arm].ai[3] = 150f; Main.npc[arm].netUpdate = true; - arm = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.PrimeLaser, npc.whoAmI); + arm = NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.PrimeLaser, npc.whoAmI); Main.npc[arm].ai[0] = 1f; Main.npc[arm].ai[1] = npc.whoAmI; Main.npc[arm].target = npc.target; @@ -225,7 +225,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - int proj = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center, vector255, type, damage, 0f, Main.myPlayer); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, vector255, type, damage, 0f, Main.myPlayer); Main.projectile[proj].timeLeft = 480; } calamityGlobalNPC.newAI[3] += 1f; @@ -251,17 +251,17 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses rotation = MathHelper.ToRadians(8); for (int i = 0; i < numProj; i++) { - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center, value19.RotatedBy(-rotation * (i + 1)), type, damage, 0f, Main.myPlayer, 0f, 1f); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center, value19.RotatedBy(+rotation * (i + 1)), type, damage, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, value19.RotatedBy(-rotation * (i + 1)), type, damage, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, value19.RotatedBy(+rotation * (i + 1)), type, damage, 0f, Main.myPlayer, 0f, 1f); } - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center, value19, type, damage, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, value19, type, damage, 0f, Main.myPlayer, 0f, 1f); } else { for (int i = 0; i < numProj + 1; i++) { Vector2 perturbedSpeed = value19.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1))); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center, perturbedSpeed, type, damage, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, perturbedSpeed, type, damage, 0f, Main.myPlayer, 0f, 1f); } } } @@ -379,7 +379,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - int proj = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center, vector255, type, damage, 0f, Main.myPlayer); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, vector255, type, damage, 0f, Main.myPlayer); Main.projectile[proj].timeLeft = 480; } calamityGlobalNPC.newAI[3] += 1f; @@ -476,7 +476,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses int type = ProjectileID.Skull; vector16 += value * 5f; - int num165 = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector16.X, vector16.Y, num160, num161, type, 250, 0f, Main.myPlayer, -1f, 0f); + int num165 = Projectile.NewProjectile(npc.GetSource_FromAI(), vector16.X, vector16.Y, num160, num161, type, 250, 0f, Main.myPlayer, -1f, 0f); Main.projectile[num165].timeLeft = 300; } } @@ -555,7 +555,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses int type = ProjectileID.Skull; int damage = npc.GetProjectileDamage(type); vector16 += value * 5f; - int num165 = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector16.X, vector16.Y, num160, num161, type, damage, 0f, Main.myPlayer, -1f, 0f); + int num165 = Projectile.NewProjectile(npc.GetSource_FromAI(), vector16.X, vector16.Y, num160, num161, type, damage, 0f, Main.myPlayer, -1f, 0f); Main.projectile[num165].timeLeft = 480; Main.projectile[num165].tileCollide = false; } @@ -609,7 +609,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses int type = ProjectileID.SaucerMissile; int damage = npc.GetProjectileDamage(type); float delayBeforeHoming = malice ? 25f : 45f; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center.X + Main.rand.Next(npc.width / 2), npc.Center.Y + 4f, velocity.X, velocity.Y, type, damage, 0f, Main.myPlayer, 0f, delayBeforeHoming); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X + Main.rand.Next(npc.width / 2), npc.Center.Y + 4f, velocity.X, velocity.Y, type, damage, 0f, Main.myPlayer, 0f, delayBeforeHoming); } SoundEngine.PlaySound(SoundID.Item39, npc.Center); @@ -794,7 +794,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses num507 *= num508; vector62.X += num506 * 8f; vector62.Y += num507 * 8f; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector62.X, vector62.Y, num506, num507, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector62.X, vector62.Y, num506, num507, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -888,7 +888,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - int proj = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center, vector255, type, damage, 0f, Main.myPlayer); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, vector255, type, damage, 0f, Main.myPlayer); Main.projectile[proj].timeLeft = 480; } npc.localAI[1] += 1f; @@ -1094,7 +1094,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses num493 *= num494; vector60.X += num492 * 5f; vector60.Y += num493 * 5f; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector60.X, vector60.Y, num492, num493, type, damage, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector60.X, vector60.Y, num492, num493, type, damage, 0f, Main.myPlayer, 0f, 1f); } } } @@ -1168,17 +1168,17 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses rotation = MathHelper.ToRadians(8); for (int i = 0; i < numProj; i++) { - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center, value19.RotatedBy(-rotation * (i + 1)), type, damage, 0f, Main.myPlayer, 0f, 1f); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center, value19.RotatedBy(+rotation * (i + 1)), type, damage, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, value19.RotatedBy(-rotation * (i + 1)), type, damage, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, value19.RotatedBy(+rotation * (i + 1)), type, damage, 0f, Main.myPlayer, 0f, 1f); } - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center, value19, type, damage, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, value19, type, damage, 0f, Main.myPlayer, 0f, 1f); } else { for (int i = 0; i < numProj + 1; i++) { Vector2 perturbedSpeed = value19.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1))); - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center.X, npc.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, type, damage, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, type, damage, 0f, Main.myPlayer, 0f, 1f); } } } diff --git a/NPCs/VanillaNPCOverrides/Bosses/TwinsAI.cs b/NPCs/VanillaNPCOverrides/Bosses/TwinsAI.cs index 24ff74f755..896823f1a3 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/TwinsAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/TwinsAI.cs @@ -203,7 +203,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses num424 *= num425; vector39.X += num423 * 15f; vector39.Y += num424 * 15f; - int num428 = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector39.X, vector39.Y, num423, num424, num427, attackDamage_ForProjectiles4, 0f, Main.myPlayer); + int num428 = Projectile.NewProjectile(npc.GetSource_FromAI(), vector39.X, vector39.Y, num423, num424, num427, attackDamage_ForProjectiles4, 0f, Main.myPlayer); } return false; } @@ -303,7 +303,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses num433 *= num434; vector40.X += num432 * 15f; vector40.Y += num433 * 15f; - int num437 = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector40.X, vector40.Y, num432, num433, num436, attackDamage_ForProjectiles5, 0f, Main.myPlayer); + int num437 = Projectile.NewProjectile(npc.GetSource_FromAI(), vector40.X, vector40.Y, num432, num433, num436, attackDamage_ForProjectiles5, 0f, Main.myPlayer); } } npc.ai[2] += 1f; @@ -518,7 +518,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses vector40.X += num385 * 15f; vector40.Y += num386 * 15f; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector40.X, vector40.Y, num385, num386, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector40.X, vector40.Y, num385, num386, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -747,10 +747,10 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses vector42.Y += num402 * 15f; if (canHit) - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector42.X, vector42.Y, num401, num402, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector42.X, vector42.Y, num401, num402, type, damage, 0f, Main.myPlayer, 0f, 0f); else { - int proj = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector42.X, vector42.Y, num401, num402, type, damage, 0f, Main.myPlayer, 0f, 0f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), vector42.X, vector42.Y, num401, num402, type, damage, 0f, Main.myPlayer, 0f, 0f); Main.projectile[proj].tileCollide = false; Main.projectile[proj].timeLeft = 300; } @@ -838,10 +838,10 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses vector43.Y += num412 * 15f; if (canHit) - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector43.X, vector43.Y, num411, num412, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector43.X, vector43.Y, num411, num412, type, damage, 0f, Main.myPlayer, 0f, 0f); else { - int proj = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector43.X, vector43.Y, num411, num412, type, damage, 0f, Main.myPlayer, 0f, 0f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), vector43.X, vector43.Y, num411, num412, type, damage, 0f, Main.myPlayer, 0f, 0f); Main.projectile[proj].tileCollide = false; Main.projectile[proj].timeLeft = 300; } @@ -934,7 +934,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses vector34.X += num349; vector34.Y += num350; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector34.X, vector34.Y, num349, num350, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector34.X, vector34.Y, num349, num350, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -1239,7 +1239,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses vector44.X += num427 * 4f; vector44.Y += num428 * 4f; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector44.X, vector44.Y, num427, num428, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector44.X, vector44.Y, num427, num428, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -1503,10 +1503,10 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses vector46.Y -= num444 * 1f; if (canHit) - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector46.X, vector46.Y, num443, num444, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), vector46.X, vector46.Y, num443, num444, type, damage, 0f, Main.myPlayer, 0f, 0f); else { - int proj = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vector46.X, vector46.Y, num443, num444, type, damage, 0f, Main.myPlayer, 0f, 0f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), vector46.X, vector46.Y, num443, num444, type, damage, 0f, Main.myPlayer, 0f, 0f); Main.projectile[proj].tileCollide = false; } } @@ -1735,7 +1735,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses int type = ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(type); Vector2 projectileVelocity = Vector2.Normalize(Main.player[npc.target].Center + (!retAlive && malice ? Main.player[npc.target].velocity * 20f : Vector2.Zero) - npc.Center) * velocity; - Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), npc.Center + Vector2.Normalize(projectileVelocity) * 4f, projectileVelocity, type, damage, 0f, Main.myPlayer, 0f, retAlive ? 0f : 1f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + Vector2.Normalize(projectileVelocity) * 4f, projectileVelocity, type, damage, 0f, Main.myPlayer, 0f, retAlive ? 0f : 1f); } } diff --git a/NPCs/VanillaNPCOverrides/Bosses/WallOfFleshAI.cs b/NPCs/VanillaNPCOverrides/Bosses/WallOfFleshAI.cs index d43cf9c223..b1138d1780 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/WallOfFleshAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/WallOfFleshAI.cs @@ -77,7 +77,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { - int num331 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(npc.position.X + (npc.width / 2)), (int)(npc.position.Y + (npc.height / 2) + 20f), NPCID.LeechHead, 1); + int num331 = NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.position.X + (npc.width / 2)), (int)(npc.position.Y + (npc.height / 2) + 20f), NPCID.LeechHead, 1); Main.npc[num331].velocity.X = npc.direction * 9; if (phase2) @@ -87,7 +87,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses Vector2 projectileSpawn = npc.Center + projectileVelocity * 5f; int damage = npc.GetProjectileDamage(ProjectileID.DemonSickle); - int proj = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), projectileSpawn, projectileVelocity, ProjectileID.DemonSickle, damage, 0f, Main.myPlayer, 0f, projectileVelocity.Length() * 3f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), projectileSpawn, projectileVelocity, ProjectileID.DemonSickle, damage, 0f, Main.myPlayer, 0f, projectileVelocity.Length() * 3f); Main.projectile[proj].timeLeft = 600; Main.projectile[proj].tileCollide = false; } @@ -373,7 +373,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses } if (num348 >= 0) { - int num353 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.position.X, (int)num339, NPCID.TheHungry, npc.whoAmI, 0f, 0f, 0f, 0f, 255); + int num353 = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.position.X, (int)num339, NPCID.TheHungry, npc.whoAmI, 0f, 0f, 0f, 0f, 255); Main.npc[num353].ai[0] = num348 * 0.1f - 0.05f; } } @@ -387,12 +387,12 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses num339 = (Main.wofDrawAreaBottom + Main.wofDrawAreaTop) / 2; num339 = (num339 + Main.wofDrawAreaTop) / 2f; - int num354 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.position.X, (int)num339, NPCID.WallofFleshEye, npc.whoAmI, 0f, 0f, 0f, 0f, 255); + int num354 = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.position.X, (int)num339, NPCID.WallofFleshEye, npc.whoAmI, 0f, 0f, 0f, 0f, 255); Main.npc[num354].ai[0] = 1f; num339 = (Main.wofDrawAreaBottom + Main.wofDrawAreaTop) / 2; num339 = (num339 + Main.wofDrawAreaBottom) / 2f; - num354 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.position.X, (int)num339, NPCID.WallofFleshEye, npc.whoAmI, 0f, 0f, 0f, 0f, 255); + num354 = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.position.X, (int)num339, NPCID.WallofFleshEye, npc.whoAmI, 0f, 0f, 0f, 0f, 255); Main.npc[num354].ai[0] = -1f; num339 = (Main.wofDrawAreaBottom + Main.wofDrawAreaTop) / 2; @@ -401,7 +401,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses int num; for (int num355 = 0; num355 < 11; num355 = num + 1) { - num354 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.position.X, (int)num339, NPCID.TheHungry, npc.whoAmI, 0f, 0f, 0f, 0f, 255); + num354 = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.position.X, (int)num339, NPCID.TheHungry, npc.whoAmI, 0f, 0f, 0f, 0f, 255); Main.npc[num354].ai[0] = num355 * 0.1f - 0.05f; num = num355; } @@ -545,7 +545,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses Vector2 projectileVelocity = Vector2.Normalize(Main.player[npc.target].Center + (fireAcceleratingLasers ? Main.player[npc.target].velocity * 40f : Vector2.Zero) - npc.Center) * velocity; Vector2 projectileSpawn = npc.Center + projectileVelocity * laserSpawnDistance; - int proj = Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), projectileSpawn, projectileVelocity, projectileType, damage, 0f, Main.myPlayer, fireAcceleratingLasers ? 1f : 0f, 0f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), projectileSpawn, projectileVelocity, projectileType, damage, 0f, Main.myPlayer, fireAcceleratingLasers ? 1f : 0f, 0f); Main.projectile[proj].timeLeft = 900; if (!canHit) diff --git a/NPCs/VanillaNPCOverrides/RegularEnemies/SlimeAI.cs b/NPCs/VanillaNPCOverrides/RegularEnemies/SlimeAI.cs index 6a1127b9e4..82d2c8a635 100644 --- a/NPCs/VanillaNPCOverrides/RegularEnemies/SlimeAI.cs +++ b/NPCs/VanillaNPCOverrides/RegularEnemies/SlimeAI.cs @@ -177,7 +177,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.RegularEnemies if (Main.netMode != NetmodeID.MultiplayerClient && projectileShootCountdown <= 0f) { - var source = npc.GetSpawnSource_ForProjectile(); + var source = npc.GetSource_FromAI(); if (distanceFromTarget < 120f) { for (int i = 0; i < 5; i++) diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index 1e30aa607d..f6d83e03b0 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -342,8 +342,8 @@ namespace CalamityMod.NPCs.Yharon safeBox.Y = (int)(player.Center.Y - 10500f); safeBox.Width = malice ? 4000 : revenge ? 6000 : 7000; safeBox.Height = 21000; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.Center.X + (malice ? 2000f : revenge ? 3000f : 3500f), player.Center.Y + 100f, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.Center.X - (malice ? 2000f : revenge ? 3000f : 3500f), player.Center.Y + 100f, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.Center.X + (malice ? 2000f : revenge ? 3000f : 3500f), player.Center.Y + 100f, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.Center.X - (malice ? 2000f : revenge ? 3000f : 3500f), player.Center.Y + 100f, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer); } // Force Yharon to send a sync packet so that the arena gets sent immediately @@ -672,7 +672,7 @@ namespace CalamityMod.NPCs.Yharon { int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), fromMouth, Vector2.Zero, type, damage, 0f, Main.myPlayer, NPC.target, 1f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fromMouth, Vector2.Zero, type, damage, 0f, Main.myPlayer, NPC.target, 1f); } } @@ -709,8 +709,8 @@ namespace CalamityMod.NPCs.Yharon if (Main.netMode != NetmodeID.MultiplayerClient && NPC.ai[2] == fireTornadoPhaseTimer - 30) { - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vectorCenter.X, vectorCenter.Y, NPC.direction * 4, 8f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vectorCenter.X, vectorCenter.Y, -(float)NPC.direction * 4, 8f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vectorCenter.X, vectorCenter.Y, NPC.direction * 4, 8f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vectorCenter.X, vectorCenter.Y, -(float)NPC.direction * 4, 8f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, 0f); } NPC.ai[2] += 1f; @@ -1000,7 +1000,7 @@ namespace CalamityMod.NPCs.Yharon { Vector2 velocity2 = Vector2.Normalize(Main.player[t].Center - flareDustBulletHellSpawn) * 8f; int type = ModContent.ProjectileType(); - int proj = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), flareDustBulletHellSpawn, velocity2, type, NPC.GetProjectileDamage(ModContent.ProjectileType()), 0f, Main.myPlayer, 2f, 0f); + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), flareDustBulletHellSpawn, velocity2, type, NPC.GetProjectileDamage(ModContent.ProjectileType()), 0f, Main.myPlayer, 2f, 0f); Main.projectile[proj].extraUpdates += 1; } } @@ -1030,7 +1030,7 @@ namespace CalamityMod.NPCs.Yharon SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/YharonRoarShort"), (int)NPC.position.X, (int)NPC.position.Y); if (Main.netMode != NetmodeID.MultiplayerClient && NPC.ai[2] == fireTornadoPhaseTimer - 30) - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vectorCenter.X, vectorCenter.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, NPC.target + 1); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vectorCenter.X, vectorCenter.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, NPC.target + 1); NPC.ai[2] += 1f; if (NPC.ai[2] >= fireTornadoPhaseTimer) @@ -1099,7 +1099,7 @@ namespace CalamityMod.NPCs.Yharon projectileVelocity *= 0.1f; int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), fromMouth, projectileVelocity, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fromMouth, projectileVelocity, type, damage, 0f, Main.myPlayer, 0f, 0f); } } @@ -1362,7 +1362,7 @@ namespace CalamityMod.NPCs.Yharon { Vector2 velocity2 = Vector2.Normalize(Main.player[t].Center - flareDustBulletHellSpawn) * 8f; int type = ModContent.ProjectileType(); - int proj = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), flareDustBulletHellSpawn, velocity2, type, NPC.GetProjectileDamage(ModContent.ProjectileType()), 0f, Main.myPlayer, 2f, 0f); + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), flareDustBulletHellSpawn, velocity2, type, NPC.GetProjectileDamage(ModContent.ProjectileType()), 0f, Main.myPlayer, 2f, 0f); Main.projectile[proj].extraUpdates += 1; } } @@ -1393,7 +1393,7 @@ namespace CalamityMod.NPCs.Yharon SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/YharonRoarShort"), (int)NPC.position.X, (int)NPC.position.Y); if (Main.netMode != NetmodeID.MultiplayerClient && NPC.ai[2] == fireTornadoPhaseTimer - 30) - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vectorCenter.X, vectorCenter.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, NPC.target + 1); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vectorCenter.X, vectorCenter.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, NPC.target + 1); NPC.ai[2] += 1f; if (NPC.ai[2] >= fireTornadoPhaseTimer) @@ -1464,7 +1464,7 @@ namespace CalamityMod.NPCs.Yharon projectileVelocity *= 0.1f; int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), fromMouth, projectileVelocity, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fromMouth, projectileVelocity, type, damage, 0f, Main.myPlayer, 0f, 0f); } } @@ -1506,7 +1506,7 @@ namespace CalamityMod.NPCs.Yharon { int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), fromMouth, Vector2.Zero, type, damage, 0f, Main.myPlayer, NPC.target, 1f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fromMouth, Vector2.Zero, type, damage, 0f, Main.myPlayer, NPC.target, 1f); } } @@ -2095,7 +2095,7 @@ namespace CalamityMod.NPCs.Yharon projectileVelocity *= 0.1f; int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), position, projectileVelocity, type, damage, 0f, Main.myPlayer, 1f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), position, projectileVelocity, type, damage, 0f, Main.myPlayer, 1f, 0f); } if (Math.Abs(targetData.Center.X - vectorCenter.X) > 700f && Math.Abs(NPC.velocity.X) < chargeSpeed) @@ -2157,7 +2157,7 @@ namespace CalamityMod.NPCs.Yharon int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); if (num34 <= splittingFireballBreathTimer2 && num34 % splittingFireballBreathDivisor == 0 && Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), position, NPC.velocity, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), position, NPC.velocity, type, damage, 0f, Main.myPlayer, 0f, 0f); } if (NPC.ai[1] > splittingFireballBreathPhaseTimer - splittingFireballBreathYVelocityTimer) @@ -2226,7 +2226,7 @@ namespace CalamityMod.NPCs.Yharon { Vector2 velocity2 = Vector2.Normalize(Main.player[t].Center - flareDustBulletHellSpawn) * (projectileVelocity * 0.7f); int type = ModContent.ProjectileType(); - int proj = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), flareDustBulletHellSpawn, velocity2, type, NPC.GetProjectileDamage(ModContent.ProjectileType()), 0f, Main.myPlayer, 2f, 0f); + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), flareDustBulletHellSpawn, velocity2, type, NPC.GetProjectileDamage(ModContent.ProjectileType()), 0f, Main.myPlayer, 2f, 0f); Main.projectile[proj].extraUpdates += 1; } } @@ -2256,7 +2256,7 @@ namespace CalamityMod.NPCs.Yharon { Vector2 velocity2 = Vector2.Normalize(Main.player[t].Center - flareDustBulletHellSpawn) * 8f; int type = ModContent.ProjectileType(); - int proj = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), flareDustBulletHellSpawn, velocity2, type, NPC.GetProjectileDamage(ModContent.ProjectileType()), 0f, Main.myPlayer, 2f, 0f); + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), flareDustBulletHellSpawn, velocity2, type, NPC.GetProjectileDamage(ModContent.ProjectileType()), 0f, Main.myPlayer, 2f, 0f); Main.projectile[proj].extraUpdates += 1; } } @@ -2266,7 +2266,7 @@ namespace CalamityMod.NPCs.Yharon if (NPC.ai[1] == 210f && secondPhasePhase == 4 && useTornado) { useTornado = false; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vectorCenter, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, NPC.target + 1); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vectorCenter, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, NPC.target + 1); } } @@ -2333,7 +2333,7 @@ namespace CalamityMod.NPCs.Yharon SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/YharonRoarShort"), (int)NPC.position.X, (int)NPC.position.Y); if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vectorCenter, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, NPC.target + 1); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vectorCenter, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, NPC.target + 1); NPC.ai[0] = 1f; NPC.ai[1] = 0f; @@ -2536,7 +2536,7 @@ namespace CalamityMod.NPCs.Yharon if (i >= spaceStart && spacesMade < totalSpaces) spacesMade++; else - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), flareDustBulletHellSpawn, Vector2.Zero, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, ai0, i * offsetAngle); + Projectile.NewProjectile(NPC.GetSource_FromAI(), flareDustBulletHellSpawn, Vector2.Zero, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, ai0, i * offsetAngle); } break; @@ -2547,7 +2547,7 @@ namespace CalamityMod.NPCs.Yharon for (int i = 0; i < totalProjectiles; i++) { Vector2 vector2 = spinningPoint.RotatedBy(radians * i) * projectileVelocity; - Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), flareDustBulletHellSpawn, vector2, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 2f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), flareDustBulletHellSpawn, vector2, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 2f, 0f); } float newRadialOffset = (int)aiVariableUsed / (timer / 4) % 2f == 0f ? radialOffset : -radialOffset; @@ -2571,7 +2571,7 @@ namespace CalamityMod.NPCs.Yharon for (int i = 0; i < totalProjectiles; i++) { Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * i); - int proj = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector255, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, ai0, ai1); + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, vector255, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, ai0, ai1); Main.projectile[proj].timeLeft = timeLeft; } } diff --git a/Projectiles/Rogue/SlickCaneProjectile.cs b/Projectiles/Rogue/SlickCaneProjectile.cs index d5e75ae101..cf1be9f0aa 100644 --- a/Projectiles/Rogue/SlickCaneProjectile.cs +++ b/Projectiles/Rogue/SlickCaneProjectile.cs @@ -98,7 +98,7 @@ namespace CalamityMod.Projectiles.Rogue modifiedMoneyValue /= Main.rand.Next(3) + 1; } moneyValueToDrop -= 10000 * modifiedMoneyValue; - Item.NewItem(target.GetItemSource_Loot(), target.Hitbox, ItemID.GoldCoin, modifiedMoneyValue); + Item.NewItem(target.GetSource_Loot(), target.Hitbox, ItemID.GoldCoin, modifiedMoneyValue); } while (moneyValueToDrop > 100f) { @@ -112,7 +112,7 @@ namespace CalamityMod.Projectiles.Rogue modifiedMoneyValue /= Main.rand.Next(3) + 1; } moneyValueToDrop -= 100 * modifiedMoneyValue; - Item.NewItem(target.GetItemSource_Loot(), target.Hitbox, ItemID.SilverCoin, modifiedMoneyValue); + Item.NewItem(target.GetSource_Loot(), target.Hitbox, ItemID.SilverCoin, modifiedMoneyValue); } while (moneyValueToDrop > 0f) { @@ -130,7 +130,7 @@ namespace CalamityMod.Projectiles.Rogue modifiedMoneyValue = 1; } moneyValueToDrop -= modifiedMoneyValue; - Item.NewItem(target.GetItemSource_Loot(), target.Hitbox, ItemID.CopperCoin, modifiedMoneyValue); + Item.NewItem(target.GetSource_Loot(), target.Hitbox, ItemID.CopperCoin, modifiedMoneyValue); } } } diff --git a/Projectiles/Typeless/BossRushEndEffectThing.cs b/Projectiles/Typeless/BossRushEndEffectThing.cs index 46ea3df842..b5751f69e5 100644 --- a/Projectiles/Typeless/BossRushEndEffectThing.cs +++ b/Projectiles/Typeless/BossRushEndEffectThing.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Typeless { BossRushEvent.End(); Player p = Main.LocalPlayer; - DropHelper.DropItem(p.GetItemSource_Misc(ModContent.ItemType()), p, ModContent.ItemType()); + DropHelper.DropItem(p.GetSource_Misc(ModContent.ItemType()), p, ModContent.ItemType()); CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.BossRushTierFiveEndText", BossRushEvent.XerocTextColor); } } diff --git a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs index e4227283a3..cacbc030a9 100644 --- a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs +++ b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs @@ -56,7 +56,7 @@ namespace CalamityMod.UI.CalamitasEnchants // If an item was stored, release it back into the world. if (!CurrentlyHeldItem.IsAir) { - Main.LocalPlayer.QuickSpawnClonedItem(Main.LocalPlayer.GetItemSource_Misc(CurrentlyHeldItem.type), CurrentlyHeldItem, CurrentlyHeldItem.stack); + Main.LocalPlayer.QuickSpawnClonedItem(Main.LocalPlayer.GetSource_Misc(CurrentlyHeldItem.type), CurrentlyHeldItem, CurrentlyHeldItem.stack); CurrentlyHeldItem.TurnToAir(); } diff --git a/Utilities/DropHelper.cs b/Utilities/DropHelper.cs index fd21cd7de7..5dc2348498 100644 --- a/Utilities/DropHelper.cs +++ b/Utilities/DropHelper.cs @@ -822,7 +822,7 @@ namespace CalamityMod // If server-side, then the item must be spawned for each client individually. if (Main.netMode == NetmodeID.Server) { - int idx = Item.NewItem(npc.GetItemSource_Loot(), npc.Center, itemId, stack, true, -1); + int idx = Item.NewItem(npc.GetSource_Loot(), npc.Center, itemId, stack, true, -1); Main.timeItemSlotCannotBeReusedFor[idx] = protectionTime; for (int i = 0; i < Main.maxPlayers; ++i) if (Main.player[i].active)