1 - More error fixes.
This commit is contained in:
1 parent
990472a409
commit
cd02fde95a
153 files changed
+767
-767
No files matched your search
@@ -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<DirectStrike>(), dmg, 0f, applicator.whoAmI, target.whoAmI);
|
||||
Projectile tick = Projectile.NewProjectileDirect(target.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), 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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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<BobbitWormHead>(), NPC.whoAmI, 0f, 0f, 0f, 0f, 255);
|
||||
int spawnedNPC = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType<BobbitWormHead>(), NPC.whoAmI, 0f, 0f, 0f, 0f, 255);
|
||||
Main.npc[spawnedNPC].ai[2] = (float)CalamityGlobalNPC.bobbitWormBottom[(int)NPC.ai[0]];
|
||||
NPC.ai[2] = (float)spawnedNPC;
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ namespace CalamityMod.NPCs.Abyss
|
||||
{
|
||||
int damageBoom = 45;
|
||||
int projectileType = ModContent.ProjectileType<PufferExplosion>();
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -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<InkBombHostile>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y + 60, 0f, 2f, ModContent.ProjectileType<InkBombHostile>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
NPC.rotation = NPC.velocity.X * 0.05f;
|
||||
NPC.velocity *= 0.975f;
|
||||
|
||||
@@ -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<EidolonWyrmBody>(), NPC.whoAmI);
|
||||
lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<EidolonWyrmBody>(), NPC.whoAmI);
|
||||
}
|
||||
else
|
||||
{
|
||||
lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<EidolonWyrmBodyAlt>(), NPC.whoAmI);
|
||||
lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<EidolonWyrmBodyAlt>(), NPC.whoAmI);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<EidolonWyrmTail>(), NPC.whoAmI);
|
||||
lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<EidolonWyrmTail>(), 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
|
||||
{
|
||||
|
||||
@@ -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<GulperEelBody>(), NPC.whoAmI);
|
||||
lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<GulperEelBody>(), NPC.whoAmI);
|
||||
}
|
||||
else
|
||||
{
|
||||
lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<GulperEelBodyAlt>(), NPC.whoAmI);
|
||||
lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<GulperEelBodyAlt>(), NPC.whoAmI);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<GulperEelTail>(), NPC.whoAmI);
|
||||
lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<GulperEelTail>(), NPC.whoAmI);
|
||||
}
|
||||
Main.npc[lol].realLife = NPC.whoAmI;
|
||||
Main.npc[lol].ai[2] = (float)NPC.whoAmI;
|
||||
|
||||
@@ -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<OarfishBody>(), NPC.whoAmI);
|
||||
lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<OarfishBody>(), NPC.whoAmI);
|
||||
}
|
||||
else
|
||||
{
|
||||
lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<OarfishTail>(), NPC.whoAmI);
|
||||
lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<OarfishTail>(), NPC.whoAmI);
|
||||
}
|
||||
Main.npc[lol].realLife = NPC.whoAmI;
|
||||
Main.npc[lol].ai[2] = (float)NPC.whoAmI;
|
||||
|
||||
@@ -109,8 +109,8 @@ namespace CalamityMod.NPCs.Abyss
|
||||
{
|
||||
int projectileType = ModContent.ProjectileType<ToxicMinnowCloud>();
|
||||
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;
|
||||
|
||||
@@ -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<CragmawSpike>(), damage, 0f);
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + spikeShootVelocity * 1.6f, spikeShootVelocity, ModContent.ProjectileType<CragmawSpike>(), 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<CragmawExplosion>(), nukeDamage, 0f);
|
||||
int explosion = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, ModContent.ProjectileType<CragmawExplosion>(), 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<CragmawAcidDrop>(), dropletDamage, 0f);
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, dropletVelocity, ModContent.ProjectileType<CragmawAcidDrop>(), 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<CragmawBeam>(), laserbeamDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI);
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, -Vector2.UnitY, ModContent.ProjectileType<CragmawBeam>(), 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<CragmawVibeCheckChain>(), 0, 0f, Main.myPlayer, NPC.whoAmI, NPC.target);
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, -Vector2.UnitY * 4f, ModContent.ProjectileType<CragmawVibeCheckChain>(), 0, 0f, Main.myPlayer, NPC.whoAmI, NPC.target);
|
||||
if (AttackTimer > CragmawVibeCheckChain.Lifetime + 30f)
|
||||
SelectNextAttack();
|
||||
}
|
||||
|
||||
@@ -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<FlakAcid>(), damage, 2f);
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnPosition, shootVelocity, ModContent.ProjectileType<FlakAcid>(), damage, 2f);
|
||||
|
||||
AcidShootTimer = 0;
|
||||
NPC.netUpdate = true;
|
||||
|
||||
@@ -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<GammaAcid>(), Main.expertMode ? 36 : 45, 3f);
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, angle.ToRotationVector2() * 7f, ModContent.ProjectileType<GammaAcid>(), 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<GammaBeam>(), Main.expertMode ? 96 : 120, 4f, Main.myPlayer, 0f, NPC.whoAmI);
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, -Vector2.UnitY, ModContent.ProjectileType<GammaBeam>(), Main.expertMode ? 96 : 120, 4f, Main.myPlayer, 0f, NPC.whoAmI);
|
||||
}
|
||||
NPC.netUpdate = true;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<NuclearBulletLarge>(), 48, 4f);
|
||||
int bullet = Projectile.NewProjectile(NPC.GetSource_FromAI(), mouthPosition, directionToShootPosition.RotatedBy(angle) * 14f, ModContent.ProjectileType<NuclearBulletLarge>(), 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<NuclearBulletLarge>(), 48, 3f);
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), mouthPosition, directionToTarget * 12f, ModContent.ProjectileType<NuclearBulletLarge>(), 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<NuclearBulletLarge>(), 48, 4.5f);
|
||||
Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), mouthPosition, directionToTarget.RotatedBy(-angle) * 16f, ModContent.ProjectileType<NuclearBulletLarge>(), 48, 4.5f);
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), mouthPosition, directionToTarget.RotatedBy(angle) * 16f, ModContent.ProjectileType<NuclearBulletLarge>(), 48, 4.5f);
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), mouthPosition, directionToTarget.RotatedBy(-angle) * 16f, ModContent.ProjectileType<NuclearBulletLarge>(), 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<NuclearBulletMedium>(), 48, 4f);
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), mouthPosition, directionToShootPosition.RotatedBy(angle) * 13f, ModContent.ProjectileType<NuclearBulletMedium>(), 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<SulphuricAcidMist>() : ModContent.ProjectileType<NuclearBulletLarge>();
|
||||
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++)
|
||||
|
||||
@@ -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<NuclearToadGoo>(), damage, 1f);
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Main.rand.NextVector2CircularEdge(speed, speed), ModContent.ProjectileType<NuclearToadGoo>(), damage, 1f);
|
||||
}
|
||||
SoundEngine.PlaySound(SoundID.DD2_KoboldExplosion, NPC.Center);
|
||||
NPC.life = 0;
|
||||
|
||||
@@ -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<OrthoceraStream>(), damage, 2f);
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, (spitDirection + offsetAngle).ToRotationVector2() * 10f, ModContent.ProjectileType<OrthoceraStream>(), damage, 2f);
|
||||
}
|
||||
}
|
||||
Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, spitDirection.ToRotationVector2() * 12f, ModContent.ProjectileType<OrthoceraStream>(), damage, 2f);
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, spitDirection.ToRotationVector2() * 12f, ModContent.ProjectileType<OrthoceraStream>(), damage, 2f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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<TrilobiteSpike>(), projDamage, 3f);
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Main.rand.NextVector2Unit() * NPC.Size * 0.7f, spikeVelocity, ModContent.ProjectileType<TrilobiteSpike>(), projDamage, 3f);
|
||||
SpikeShootCountdown = Main.rand.Next(50, 65);
|
||||
NPC.netUpdate = true;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<EidolonWyrmBodyHuge>(), NPC.whoAmI);
|
||||
lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<EidolonWyrmBodyHuge>(), NPC.whoAmI);
|
||||
else
|
||||
lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<EidolonWyrmBodyAltHuge>(), NPC.whoAmI);
|
||||
lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<EidolonWyrmBodyAltHuge>(), NPC.whoAmI);
|
||||
}
|
||||
else
|
||||
lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<EidolonWyrmTailHuge>(), NPC.whoAmI);
|
||||
lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<EidolonWyrmTailHuge>(), 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<Eidolist>());
|
||||
NPC.NewNPC(NPC.GetSource_FromAI(), randomX * 16 + 8, randomY * 16 + 8, ModContent.NPCType<Eidolist>());
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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<AquaticSeekerBody>(), NPC.whoAmI);
|
||||
lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<AquaticSeekerBody>(), NPC.whoAmI);
|
||||
}
|
||||
else
|
||||
{
|
||||
lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<AquaticSeekerTail>(), NPC.whoAmI);
|
||||
lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<AquaticSeekerTail>(), NPC.whoAmI);
|
||||
}
|
||||
Main.npc[lol].realLife = NPC.whoAmI;
|
||||
Main.npc[lol].ai[2] = (float)NPC.whoAmI;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<AstralSeekerSpit>());
|
||||
int n = NPC.NewNPC(NPC.GetSource_FromAI(), (int)spawnPoint.X, (int)spawnPoint.Y, ModContent.NPCType<AstralSeekerSpit>());
|
||||
Main.npc[n].Center = spawnPoint;
|
||||
Main.npc[n].velocity = vector * (CalamityWorld.death ? 12f : 10f);
|
||||
}
|
||||
|
||||
+1
-1
@@ -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<Hiveling>(), 0, NPC.whoAmI);
|
||||
int n = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType<Hiveling>(), 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);
|
||||
}
|
||||
|
||||
@@ -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<MantisRing>(), damage, 0f);
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + (NPC.Center.X < target.Center.X ? -14f : 14f) * Vector2.UnitX, vector * 7f, ModContent.ProjectileType<MantisRing>(), damage, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ namespace CalamityMod.NPCs.AstrumAureus
|
||||
num7 *= num8;
|
||||
int type = ModContent.ProjectileType<AstralFlame>();
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental
|
||||
num7 *= num8;
|
||||
int type = ModContent.ProjectileType<BrimstoneHellfireball>();
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace CalamityMod.NPCs.Calamitas
|
||||
|
||||
int type = ModContent.ProjectileType<BrimstoneBarrage>();
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+114
-114
@@ -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<AquaticScourgeBodyAlt>(), npc.whoAmI);
|
||||
lol = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.height / 2), ModContent.NPCType<AquaticScourgeBodyAlt>(), npc.whoAmI);
|
||||
else
|
||||
lol = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.height / 2), ModContent.NPCType<AquaticScourgeBody>(), npc.whoAmI);
|
||||
lol = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.height / 2), ModContent.NPCType<AquaticScourgeBody>(), npc.whoAmI);
|
||||
}
|
||||
else
|
||||
lol = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.height / 2), ModContent.NPCType<AquaticScourgeTail>(), npc.whoAmI);
|
||||
lol = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.height / 2), ModContent.NPCType<AquaticScourgeTail>(), 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<Brimling>()) < (death ? 1 : 2) && revenge)
|
||||
{
|
||||
NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)vectorCenter.X, (int)vectorCenter.Y, ModContent.NPCType<Brimling>());
|
||||
NPC.NewNPC(npc.GetSource_FromAI(), (int)vectorCenter.X, (int)vectorCenter.Y, ModContent.NPCType<Brimling>());
|
||||
}
|
||||
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<BrimstoneHellfireball>();
|
||||
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<BrimstoneRay>();
|
||||
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<BrimstoneTargetRay>(), 0, 0f, Main.myPlayer, 0f, npc.whoAmI);
|
||||
Projectile.NewProjectile(npc.GetSource_FromAI(), source, laserVelocity, ModContent.ProjectileType<BrimstoneTargetRay>(), 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<BrimstoneTargetRay>(), 0, 0f, Main.myPlayer, 1f, npc.whoAmI);
|
||||
Projectile.NewProjectile(npc.GetSource_FromAI(), source.X, source.Y, npc.localAI[0], npc.localAI[1], ModContent.ProjectileType<BrimstoneTargetRay>(), 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<SoulSeeker>(), 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<SoulSeeker>(), 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<CalamitasRun>(), npc.whoAmI);
|
||||
NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.Center.X, (int)npc.position.Y + npc.height, ModContent.NPCType<CalamitasRun2>(), npc.whoAmI);
|
||||
NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.position.Y + npc.height, ModContent.NPCType<CalamitasRun>(), npc.whoAmI);
|
||||
NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.position.Y + npc.height, ModContent.NPCType<CalamitasRun2>(), 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<BrimstoneHellfireball>();
|
||||
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<BrimstoneHellblast>() ? 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<BrimstoneHellfireball>())
|
||||
Main.projectile[proj].tileCollide = true;
|
||||
}
|
||||
@@ -1836,7 +1836,7 @@ namespace CalamityMod.NPCs
|
||||
int type = ModContent.ProjectileType<BrimstoneHellblast>();
|
||||
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<AureusSpawn>());
|
||||
NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y - 25, ModContent.NPCType<AureusSpawn>());
|
||||
|
||||
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<AureusSpawn>());
|
||||
NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y - 25, ModContent.NPCType<AureusSpawn>());
|
||||
|
||||
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<DeusMine>();
|
||||
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<DeusMine>();
|
||||
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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<DarkEnergy>(), 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<Bumblefuck2>(), npc.whoAmI);
|
||||
NPC.NewNPC(npc.GetSource_FromAI(), (int)vector7.X, (int)vector7.Y, ModContent.NPCType<Bumblefuck2>(), 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<BirbAuraFlare>(), 0, 0f, Main.myPlayer, ai0, npc.target + 1);
|
||||
Projectile.NewProjectile(npc.GetSource_FromAI(), vector7.X, vector7.Y, 0f, 0f, ModContent.ProjectileType<BirbAuraFlare>(), 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<OldDukeToothBall>());
|
||||
NPC.NewNPC(npc.GetSource_FromAI(), (int)vector6.X, (int)vector6.Y + 45, ModContent.NPCType<OldDukeToothBall>());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<OldDukeSharkron>(), 0, 0f, 0f, npc.whoAmI, 0f, 255);
|
||||
NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(vector.X - 900f), (int)(vector.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType<OldDukeSharkron>(), 0, 0f, 0f, npc.whoAmI, 0f, 255);
|
||||
NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X + 900f), (int)(vector.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType<OldDukeSharkron>(), 0, 0f, 0f, npc.whoAmI, 0f, 255);
|
||||
NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X - 900f), (int)(vector.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType<OldDukeSharkron>(), 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<OldDukeSharkron>(), 0, 0f, 0f, 1f, -sharkronVelocity, 255);
|
||||
NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(vector.X - 50f - calamityGlobalNPC.newAI[2]), (int)(vector.Y + 540f), ModContent.NPCType<OldDukeSharkron>(), 0, 0f, 0f, -1f, -sharkronVelocity, 255);
|
||||
NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X + 50f + calamityGlobalNPC.newAI[2]), (int)(vector.Y + 540f), ModContent.NPCType<OldDukeSharkron>(), 0, 0f, 0f, 1f, -sharkronVelocity, 255);
|
||||
NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X - 50f - calamityGlobalNPC.newAI[2]), (int)(vector.Y + 540f), ModContent.NPCType<OldDukeSharkron>(), 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<OldDukeToothBall>());
|
||||
int num31 = NPC.NewNPC(npc.GetSource_FromAI(), (int)vector10.X, (int)vector10.Y + 45, ModContent.NPCType<OldDukeToothBall>());
|
||||
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<OldDukeSharkron>(), 0, 0f, 0f, npc.whoAmI, 0f, 255);
|
||||
NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(vector.X - x), (int)(vector.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType<OldDukeSharkron>(), 0, 0f, 0f, npc.whoAmI, 0f, 255);
|
||||
NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X + x), (int)(vector.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType<OldDukeSharkron>(), 0, 0f, 0f, npc.whoAmI, 0f, 255);
|
||||
NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X - x), (int)(vector.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType<OldDukeSharkron>(), 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<OldDukeSharkron>(), 0, 0f, 0f, 1f, sharkronVelocity, 255);
|
||||
NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(vector.X - 50f - calamityGlobalNPC.newAI[2]), (int)(vector.Y - 540f), ModContent.NPCType<OldDukeSharkron>(), 0, 0f, 0f, -1f, sharkronVelocity, 255);
|
||||
NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X + 50f + calamityGlobalNPC.newAI[2]), (int)(vector.Y - 540f), ModContent.NPCType<OldDukeSharkron>(), 0, 0f, 0f, 1f, sharkronVelocity, 255);
|
||||
NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X - 50f - calamityGlobalNPC.newAI[2]), (int)(vector.Y - 540f), ModContent.NPCType<OldDukeSharkron>(), 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<OldDukeSharkron>(), 0, 0f, 0f, npc.whoAmI, 0f, 255);
|
||||
NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(vector.X - x), (int)(vector.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType<OldDukeSharkron>(), 0, 0f, 0f, npc.whoAmI, 0f, 255);
|
||||
NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X + x), (int)(vector.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType<OldDukeSharkron>(), 0, 0f, 0f, npc.whoAmI, 0f, 255);
|
||||
NPC.NewNPC(npc.GetSource_FromAI(), (int)(vector.X - x), (int)(vector.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType<OldDukeSharkron>(), 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<OldDukeToothBall>());
|
||||
int num31 = NPC.NewNPC(npc.GetSource_FromAI(), (int)vector10.X, (int)vector10.Y + 45, ModContent.NPCType<OldDukeToothBall>());
|
||||
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<DarkOrb>(), damage, 0f, Main.myPlayer, 8f, 0f);
|
||||
int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), vectorCenter, vector, ModContent.ProjectileType<DarkOrb>(), damage, 0f, Main.myPlayer, 8f, 0f);
|
||||
Main.projectile[proj].scale = 4f;
|
||||
}
|
||||
|
||||
//Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vectorCenter.X, vectorCenter.Y, num743, num744, ModContent.ProjectileType<DarkOrb>(), damage, 0f, Main.myPlayer, 4f, 0f);
|
||||
//Projectile.NewProjectile(npc.GetSource_FromAI(), vectorCenter.X, vectorCenter.Y, num743, num744, ModContent.ProjectileType<DarkOrb>(), 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<DarkOrb>(), 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<DarkOrb>(), 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<DarkOrb>(), damage, 0f, Main.myPlayer, -1f, 0f);
|
||||
int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), vectorCenter + offset, targetVector * (1f - (Math.Abs(radians) / half * scalar)), ModContent.ProjectileType<DarkOrb>(), 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<DarkOrb>(), damage, 0f, Main.myPlayer, -1f, 0f);
|
||||
int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), vectorCenter + offset, targetVector, ModContent.ProjectileType<DarkOrb>(), 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<DarkOrb>(), damage, 0f, Main.myPlayer, 15f, i * offsetAngle);
|
||||
Projectile.NewProjectile(npc.GetSource_FromAI(), vectorCenter, Vector2.Zero, ModContent.ProjectileType<DarkOrb>(), 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<DarkOrb>(), damage, 0f, Main.myPlayer, 16f, j * velocityTimer);
|
||||
Projectile.NewProjectile(npc.GetSource_FromAI(), vectorCenter, vector, ModContent.ProjectileType<DarkOrb>(), 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<DarkOrb>(), damage, 0f, Main.myPlayer, 3f, 0f);
|
||||
Projectile.NewProjectile(npc.GetSource_FromAI(), vectorCenter, vector, ModContent.ProjectileType<DarkOrb>(), 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<DarkOrb>(), damage, 0f, Main.myPlayer, 0f, i * offsetAngle);
|
||||
Projectile.NewProjectile(npc.GetSpawnSource_ForProjectile(), vectorCenter, Vector2.Zero, ModContent.ProjectileType<DarkOrb>(), damage, 0f, Main.myPlayer, 12f, i * offsetAngle);
|
||||
Projectile.NewProjectile(npc.GetSource_FromAI(), vectorCenter, Vector2.Zero, ModContent.ProjectileType<DarkOrb>(), damage, 0f, Main.myPlayer, 0f, i * offsetAngle);
|
||||
Projectile.NewProjectile(npc.GetSource_FromAI(), vectorCenter, Vector2.Zero, ModContent.ProjectileType<DarkOrb>(), 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<BrimstoneRay>(), 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<BrimstoneRay>(), 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<BrimstoneRay>(), 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<BrimstoneRay>(), 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<BrimstoneTargetRay>(), 0, 0f, Main.myPlayer, 0f, npc.whoAmI);
|
||||
Projectile.NewProjectile(npc.GetSource_FromAI(), source, laserVelocity, ModContent.ProjectileType<BrimstoneTargetRay>(), 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<BrimstoneTargetRay>(), 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<BrimstoneTargetRay>(), 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<BrimstoneTargetRay>(), 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<BrimstoneTargetRay>(), 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<SulphuricAcidMist>(), 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<SulphuricAcidMist>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+47
-47
@@ -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;
|
||||
|
||||
@@ -4092,7 +4092,7 @@ namespace CalamityMod.NPCs
|
||||
NPCType<PhantomSpiritL>()
|
||||
});
|
||||
|
||||
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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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<CrabShroom>();
|
||||
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;
|
||||
|
||||
@@ -155,7 +155,7 @@ namespace CalamityMod.NPCs.Crags
|
||||
dmg = 22;
|
||||
}
|
||||
int projType = ModContent.ProjectileType<BrimstoneBarrage>();
|
||||
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;
|
||||
|
||||
+11
-11
@@ -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<CryogenIce>(), NPC.whoAmI);
|
||||
int num6 = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType<CryogenIce>(), 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace CalamityMod.NPCs.DesertScourge
|
||||
{
|
||||
num4 = ModContent.NPCType<DesertNuisanceTail>();
|
||||
}
|
||||
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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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<DesertScourgeBody>(), NPC.whoAmI);
|
||||
lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<DesertScourgeBody>(), NPC.whoAmI);
|
||||
}
|
||||
else
|
||||
{
|
||||
lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<DesertScourgeTail>(), NPC.whoAmI);
|
||||
lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<DesertScourgeTail>(), NPC.whoAmI);
|
||||
}
|
||||
Main.npc[lol].ai[2] = NPC.whoAmI;
|
||||
Main.npc[lol].realLife = NPC.whoAmI;
|
||||
|
||||
@@ -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<DoGP1EndPortal>(), 0, 0f);
|
||||
PortalIndex = Projectile.NewProjectile(NPC.GetSource_FromAI(), portalSpawnPosition, Vector2.Zero, ModContent.ProjectileType<DoGP1EndPortal>(), 0, 0f);
|
||||
|
||||
hasCreatedPhase1Portal = true;
|
||||
NPC.netUpdate = true;
|
||||
@@ -675,7 +675,7 @@ namespace CalamityMod.NPCs.DevourerofGods
|
||||
|
||||
int type = ModContent.ProjectileType<DoGFire>();
|
||||
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<DevourerofGodsBody>(), NPC.whoAmI);
|
||||
segment = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<DevourerofGodsBody>(), NPC.whoAmI);
|
||||
Main.npc[segment].ModNPC<DevourerofGodsBody>().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<DevourerofGodsTail>(), NPC.whoAmI);
|
||||
segment = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<DevourerofGodsTail>(), 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<DoGTeleportRift>(), 0, 0f, Main.myPlayer, NPC.whoAmI);
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), targetVector, Vector2.Zero, ModContent.ProjectileType<DoGTeleportRift>(), 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<DoGTeleportRift>(), 0, 0f, Main.myPlayer, NPC.whoAmI);
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), targetVector, Vector2.Zero, ModContent.ProjectileType<DoGTeleportRift>(), 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<DoGDeathBoom>(), 0, 0f);
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, ModContent.ProjectileType<DoGDeathBoom>(), 0, 0f);
|
||||
|
||||
if (Main.netMode != NetmodeID.Server)
|
||||
{
|
||||
|
||||
@@ -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<DevourerofGodsBody2>(), NPC.whoAmI);
|
||||
segment = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<DevourerofGodsBody2>(), NPC.whoAmI);
|
||||
}
|
||||
else
|
||||
{
|
||||
segment = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<DevourerofGodsTail2>(), NPC.whoAmI);
|
||||
segment = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<DevourerofGodsTail2>(), 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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<ApolloChargeTelegraph>().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<BrokenApolloLens>(), 0, 0f);
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, lensDirection * 24f, ModContent.ProjectileType<BrokenApolloLens>(), 0, 0f);
|
||||
}
|
||||
|
||||
// Reset phase and variables
|
||||
|
||||
@@ -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<AresLaserCannon>(), NPC.whoAmI);
|
||||
lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<AresLaserCannon>(), 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<AresPlasmaFlamethrower>(), NPC.whoAmI);
|
||||
lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<AresPlasmaFlamethrower>(), 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<AresTeslaCannon>(), NPC.whoAmI);
|
||||
lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<AresTeslaCannon>(), 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<AresGaussNuke>(), NPC.whoAmI);
|
||||
lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<AresGaussNuke>(), 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -407,7 +407,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
|
||||
int type = ModContent.ProjectileType<AresGaussNukeProjectile>();
|
||||
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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<ArtemisLaserBeamStart>();
|
||||
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<BrokenArtemisLens>(), 0, 0f);
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, lensDirection * 24f, ModContent.ProjectileType<BrokenArtemisLens>(), 0, 0f);
|
||||
}
|
||||
|
||||
// Reset phase and variables
|
||||
|
||||
@@ -311,7 +311,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
// Normal laser
|
||||
int type = ModContent.ProjectileType<ThanatosLaser>();
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -311,7 +311,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
// Normal laser
|
||||
int type = ModContent.ProjectileType<ThanatosLaser>();
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<ThanatosBody1>(), NPC.whoAmI);
|
||||
lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<ThanatosBody1>(), NPC.whoAmI);
|
||||
else
|
||||
lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<ThanatosBody2>(), NPC.whoAmI);
|
||||
lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<ThanatosBody2>(), NPC.whoAmI);
|
||||
}
|
||||
else
|
||||
lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<ThanatosTail>(), NPC.whoAmI);
|
||||
lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<ThanatosTail>(), 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<ThanatosBeamTelegraph>();
|
||||
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<ThanatosBeamStart>();
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -311,7 +311,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
// Normal laser
|
||||
int type = ModContent.ProjectileType<ThanatosLaser>();
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<GreatSandBlast>(), 40, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
NPC.ai[2] = -30f;
|
||||
|
||||
@@ -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<ShadeNimbusHostile>();
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
int num1170 = (int)(NPC.position.Y + NPC.height + 4f);
|
||||
int type = ModContent.ProjectileType<ShaderainHostile>();
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -165,7 +165,7 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
num943 *= num944;
|
||||
int type = ModContent.ProjectileType<VileClot>();
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
num943 *= num944;
|
||||
int type = ModContent.ProjectileType<VileClot>();
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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<HiveBlob>(), NPC.whoAmI);
|
||||
NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType<HiveBlob>(), NPC.whoAmI);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -514,7 +514,7 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
if (NPC.CountNPCS(ModContent.NPCType<DankCreeper>()) < maxDankSpawns)
|
||||
type = ModContent.NPCType<DankCreeper>();
|
||||
|
||||
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<DarkHeart>()))
|
||||
NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType<DarkHeart>());
|
||||
NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType<DarkHeart>());
|
||||
}
|
||||
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<ShadeNimbusHostile>();
|
||||
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)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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<AquaticAberration>());
|
||||
NPC.NewNPC(NPC.GetSource_FromAI(), (int)vector119.X, (int)vector119.Y, ModContent.NPCType<AquaticAberration>());
|
||||
}
|
||||
|
||||
if (num1060 > ((sirenAlive && !phase4) ? 1000f : 800f))
|
||||
|
||||
@@ -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<LeviathanSpawner>(), 0, 0f);
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, ModContent.ProjectileType<LeviathanSpawner>(), 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<SirenIce>(), NPC.whoAmI);
|
||||
int num6 = NPC.NewNPC(NPC.GetSource_FromAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType<SirenIce>(), 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
{
|
||||
num4 = ModContent.NPCType<ArmoredDiggerTail>();
|
||||
}
|
||||
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;
|
||||
|
||||
@@ -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<HorsWaterBlast>(), projectileDamage, 0f, Main.myPlayer);
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), vector18.X, vector18.Y, num829, num830, ModContent.ProjectileType<HorsWaterBlast>(), 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<HorsWaterBlast>(), projectileDamage, 0f, Main.myPlayer);
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), vector18.X, vector18.Y, num829, num830, ModContent.ProjectileType<HorsWaterBlast>(), 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<HorsWaterBlast>(), projectileDamage, 0f, Main.myPlayer);
|
||||
int num848 = Projectile.NewProjectile(NPC.GetSource_FromAI(), vector18.X, vector18.Y, num844, num845, ModContent.ProjectileType<HorsWaterBlast>(), 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<HorsWaterBlast>(), projectileDamage, 0f, Main.myPlayer);
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), vector18.X, vector18.Y, num829, num830, ModContent.ProjectileType<HorsWaterBlast>(), projectileDamage, 0f, Main.myPlayer);
|
||||
}
|
||||
if (NPC.ai[1] >= 240f)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<FlameBurstHostile>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
int beam = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y, num6, num7, ModContent.ProjectileType<FlameBurstHostile>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Main.projectile[beam].tileCollide = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<ProfanedEnergyLantern>(), NPC.whoAmI, 0f, 0f, 0f, 0f, 255);
|
||||
NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType<ProfanedEnergyLantern>(), NPC.whoAmI, 0f, 0f, 0f, 0f, 255);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
num189 *= num191;
|
||||
num190 *= num191;
|
||||
int num9 = ModContent.ProjectileType<HolyBomb>();
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
if (tries < 500)
|
||||
{
|
||||
int npcToSpawn = Main.rand.NextBool(2) ? ModContent.NPCType<WulfrumDrone>() : ModContent.NPCType<WulfrumHovercraft>();
|
||||
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;
|
||||
|
||||
@@ -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<OldDukeGore>();
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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<SandPoisonCloudOldDuke>();
|
||||
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;
|
||||
|
||||
@@ -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<DemonHeal>(), 0, 0f, NPC.target);
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, shootVelocity, ModContent.ProjectileType<DemonHeal>(), 0, 0f, NPC.target);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<SuicideBomberDemon>(), 17000, 0f, NPC.target);
|
||||
int demon = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Main.rand.NextVector2CircularEdge(4f, 4f), ModContent.ProjectileType<SuicideBomberDemon>(), 17000, 0f, NPC.target);
|
||||
if (Main.projectile.IndexInRange(demon))
|
||||
{
|
||||
Main.projectile[demon].ai[1] = Main.rand.Next(-40, 0);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<PerforatorTailMedium>(), 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<PerforatorTailMedium>(), 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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<PerforatorBodyLarge>(), NPC.whoAmI);
|
||||
lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<PerforatorBodyLarge>(), NPC.whoAmI);
|
||||
}
|
||||
else
|
||||
{
|
||||
lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<PerforatorTailLarge>(), NPC.whoAmI);
|
||||
lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<PerforatorTailLarge>(), 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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<PerforatorBodyMedium>(), 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<PerforatorBodyMedium>(), 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++)
|
||||
|
||||
@@ -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<PerforatorBodySmall>(), NPC.whoAmI);
|
||||
lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<PerforatorBodySmall>(), NPC.whoAmI);
|
||||
}
|
||||
else
|
||||
{
|
||||
lol = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<PerforatorTailSmall>(), NPC.whoAmI);
|
||||
lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType<PerforatorTailSmall>(), 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -206,7 +206,7 @@ namespace CalamityMod.NPCs.Perforator
|
||||
large = true;
|
||||
wormType = ModContent.NPCType<PerforatorHeadLarge>();
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -353,7 +353,7 @@ namespace CalamityMod.NPCs.PlagueEnemies
|
||||
}
|
||||
if (NPC.CountNPCS(ModContent.NPCType<PlagueBee>()) < 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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<PlagueStingerGoliathV2>(), 25, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), vector3.X, vector3.Y, vector4.X, vector4.Y, ModContent.ProjectileType<PlagueStingerGoliathV2>(), 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<PlagueStingerGoliathV2>(), 22, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), vector3.X, vector3.Y, num14, num15, ModContent.ProjectileType<PlagueStingerGoliathV2>(), 22, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -601,7 +601,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
if (expertMode && NPC.CountNPCS(ModContent.NPCType<PlagueMine>()) < 2)
|
||||
NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)vector119.X, (int)vector119.Y, ModContent.NPCType<PlagueMine>(), 0, 0f, 0f, 0f, challengeAmt);
|
||||
NPC.NewNPC(NPC.GetSource_FromAI(), (int)vector119.X, (int)vector119.Y, ModContent.NPCType<PlagueMine>(), 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<PlagueHomingMissile>(), 0, 0f, 0f, 0f, challengeAmt);
|
||||
int num1062 = NPC.NewNPC(NPC.GetSource_FromAI(), (int)vector119.X, (int)vector119.Y, ModContent.NPCType<PlagueHomingMissile>(), 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<PlagueMine>()) < 3)
|
||||
NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)vector119.X, (int)vector119.Y, ModContent.NPCType<PlagueMine>(), 0, 0f, 0f, 0f, challengeAmt);
|
||||
NPC.NewNPC(NPC.GetSource_FromAI(), (int)vector119.X, (int)vector119.Y, ModContent.NPCType<PlagueMine>(), 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<PlagueHomingMissile>(), 0, 0f, 0f, 0f, challengeAmt);
|
||||
int num1062 = NPC.NewNPC(NPC.GetSource_FromAI(), (int)vector119.X, (int)vector119.Y, ModContent.NPCType<PlagueHomingMissile>(), 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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<PolterghastHook>(), NPC.whoAmI, 0f, 0f, 0f, 0f, 255);
|
||||
NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType<PolterghastHook>(), NPC.whoAmI, 0f, 0f, 0f, 0f, 255);
|
||||
NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType<PolterghastHook>(), NPC.whoAmI, 0f, 0f, 0f, 0f, 255);
|
||||
NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType<PolterghastHook>(), NPC.whoAmI, 0f, 0f, 0f, 0f, 255);
|
||||
NPC.NewNPC(NPC.GetSource_FromAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType<PolterghastHook>(), NPC.whoAmI, 0f, 0f, 0f, 0f, 255);
|
||||
NPC.NewNPC(NPC.GetSource_FromAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType<PolterghastHook>(), NPC.whoAmI, 0f, 0f, 0f, 0f, 255);
|
||||
NPC.NewNPC(NPC.GetSource_FromAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType<PolterghastHook>(), NPC.whoAmI, 0f, 0f, 0f, 0f, 255);
|
||||
NPC.NewNPC(NPC.GetSource_FromAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType<PolterghastHook>(), 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<PhantomBlast>() ? 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<PhantomBlast2>() ? 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<PolterPhantom>());
|
||||
NPC.NewNPC(NPC.GetSource_FromAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType<PolterPhantom>());
|
||||
|
||||
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<PhantomFuckYou>(), 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<PhantomFuckYou>(), 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<PhantomSpiritL>()) < 2 && Main.netMode != NetmodeID.MultiplayerClient && !charging && !chargePhase)
|
||||
{
|
||||
int num762 = NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType<PhantomSpiritL>());
|
||||
int num762 = NPC.NewNPC(NPC.GetSource_FromAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType<PhantomSpiritL>());
|
||||
Main.npc[num762].velocity.X = num758;
|
||||
Main.npc[num762].velocity.Y = num760;
|
||||
Main.npc[num762].netUpdate = true;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<ProfanedGuardianBoss2>());
|
||||
NPC.NewNPC(NPC.GetSpawnSourceForNPCFromNPCAI(), (int)vectorCenter.X, (int)vectorCenter.Y, ModContent.NPCType<ProfanedGuardianBoss3>());
|
||||
NPC.NewNPC(NPC.GetSource_FromAI(), (int)vectorCenter.X, (int)vectorCenter.Y, ModContent.NPCType<ProfanedGuardianBoss2>());
|
||||
NPC.NewNPC(NPC.GetSource_FromAI(), (int)vectorCenter.X, (int)vectorCenter.Y, ModContent.NPCType<ProfanedGuardianBoss3>());
|
||||
}
|
||||
|
||||
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++;
|
||||
|
||||
@@ -168,7 +168,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
SoundEngine.PlaySound(SoundID.Item20, NPC.position);
|
||||
int type = ModContent.ProjectileType<FlareDust>();
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loaded 100 of 153 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user