1 - Hive Mind net spam block prevention.
2 - Destroyer now shoots weak purple lasers from broken segments. 3 - Safe Normalize for SCal/Cirrus.
This commit is contained in:
1 parent
5366e2b626
commit
92a41babd1
4 files changed
+37
-24
No files matched your search
@@ -627,6 +627,7 @@ namespace CalamityMod
|
||||
{ new Tuple<int, int>(NPCID.TheDestroyerBody, ProjectileID.DeathLaser), new int[] { 44, 72, 116, 128, 174 } }, // 108 in non-rev master mode
|
||||
{ new Tuple<int, int>(NPCID.TheDestroyerBody, ModContent.ProjectileType<DestroyerCursedLaser>()), new int[] { 46, 76, 128, 140, 186 } },
|
||||
{ new Tuple<int, int>(NPCID.TheDestroyerBody, ModContent.ProjectileType<DestroyerElectricLaser>()), new int[] { 48, 80, 136, 152, 210 } },
|
||||
{ new Tuple<int, int>(NPCID.TheDestroyerBody, ProjectileID.EyeLaser), new int[] { 40, 68, 100, 112, 144 } },
|
||||
{ new Tuple<int, int>(NPCID.Probe, ProjectileID.PinkLaser), new int[] { 50, 88, 100, 112, 144 } }, // 132 in non-rev master mode
|
||||
|
||||
{ new Tuple<int, int>(ModContent.NPCType<BrimstoneElemental>(), ModContent.ProjectileType<BrimstoneHellfireball>()), new int[] { 80, 140, 160, 176, 234 } },
|
||||
|
||||
@@ -605,6 +605,7 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
}
|
||||
}
|
||||
NPC.netUpdate = true;
|
||||
NPC.netSpam = 0;
|
||||
}
|
||||
else if (burrowTimer < 0)
|
||||
{
|
||||
@@ -714,6 +715,7 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
rotation = MathHelper.ToRadians(Main.rand.Next(360));
|
||||
|
||||
NPC.netUpdate = true;
|
||||
NPC.netSpam = 0;
|
||||
}
|
||||
|
||||
if (!player.active || player.dead || Vector2.Distance(NPC.Center, player.Center) > 5000f)
|
||||
@@ -751,6 +753,7 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
NPC.velocity *= 2f / 255f * (reelbackFade + 2 * (int)enrageScale);
|
||||
ReelBack();
|
||||
NPC.netUpdate = true;
|
||||
NPC.netSpam = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -782,6 +785,7 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
|
||||
phase2timer = minimumDriftTime + Main.rand.Next(121);
|
||||
NPC.netUpdate = true;
|
||||
NPC.netSpam = 0;
|
||||
}
|
||||
else if (NPC.ai[1] == 0f && NPC.ai[2] == 0f)
|
||||
{
|
||||
@@ -794,6 +798,7 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
NPC.ai[1] = posX;
|
||||
NPC.ai[2] = posY;
|
||||
NPC.netUpdate = true;
|
||||
NPC.netSpam = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -834,6 +839,7 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
case 3: // Lunge
|
||||
|
||||
NPC.netUpdate = true;
|
||||
NPC.netSpam = 0;
|
||||
if (NPC.alpha > 0)
|
||||
{
|
||||
NPC.alpha -= lungeFade;
|
||||
@@ -890,6 +896,7 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
NPC.position.Y += teleportRadius;
|
||||
}
|
||||
NPC.netUpdate = true;
|
||||
NPC.netSpam = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -900,6 +907,7 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
NPC.velocity.X = MathHelper.Pi * teleportRadius / arcTime;
|
||||
NPC.velocity *= rotationDirection;
|
||||
NPC.netUpdate = true;
|
||||
NPC.netSpam = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -947,6 +955,7 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
NPC.position.X += teleportRadius * rotationDirection;
|
||||
}
|
||||
NPC.netUpdate = true;
|
||||
NPC.netSpam = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -957,6 +966,7 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
NPC.velocity.X = teleportRadius / arcTime * 3;
|
||||
NPC.velocity *= -rotationDirection;
|
||||
NPC.netUpdate = true;
|
||||
NPC.netSpam = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -995,6 +1005,7 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
phase2timer = minimumDriftTime + Main.rand.Next(121);
|
||||
state = 0;
|
||||
NPC.netUpdate = true;
|
||||
NPC.netSpam = 0;
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -1033,6 +1044,7 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
NPC.velocity *= -4f;
|
||||
ReelBack();
|
||||
NPC.netUpdate = true;
|
||||
NPC.netSpam = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -227,7 +227,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
Main.npcFrameCount[NPC.type] = 21;
|
||||
NPCID.Sets.TrailingMode[NPC.type] = 1;
|
||||
NPCID.Sets.BossBestiaryPriority.Add(Type);
|
||||
NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers(0)
|
||||
NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers()
|
||||
{
|
||||
SpriteDirection = 1
|
||||
};
|
||||
@@ -872,7 +872,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
if (bulletHellCounter2 % 90 == 0)
|
||||
{
|
||||
float bottleSpeed = 12f;
|
||||
Vector2 bottleVelocity = Vector2.Normalize(player.Center + player.velocity * 20f - NPC.Center) * bottleSpeed;
|
||||
Vector2 bottleVelocity = (player.Center + player.velocity * 20f - NPC.Center).SafeNormalize(Vector2.UnitY) * bottleSpeed;
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, bottleVelocity * uDieLul, ModContent.ProjectileType<CirrusVolatileVodkaBottle>(), 350, 0f, Main.myPlayer);
|
||||
}
|
||||
}
|
||||
@@ -967,7 +967,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
{
|
||||
Vector2 destination = player.Center;
|
||||
Vector2 distanceFromDestination = destination - NPC.Center;
|
||||
Vector2 desiredVelocity = Vector2.Normalize(distanceFromDestination - NPC.velocity) * CirrusPhotonRipperDashVelocity;
|
||||
Vector2 desiredVelocity = (distanceFromDestination - NPC.velocity).SafeNormalize(Vector2.UnitY) * CirrusPhotonRipperDashVelocity;
|
||||
|
||||
if (Vector2.Distance(NPC.Center, destination) > CirrusPhotonRipperMinDistanceFromTarget)
|
||||
NPC.SimpleFlyMovement(desiredVelocity * uDieLul, CirrusPhotonRipperDashAcceleration * uDieLul);
|
||||
@@ -1070,7 +1070,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
if (bulletHellCounter2 % 90 == 0)
|
||||
{
|
||||
float bottleSpeed = 12f;
|
||||
Vector2 bottleVelocity = Vector2.Normalize(player.Center + player.velocity * 20f - NPC.Center) * bottleSpeed;
|
||||
Vector2 bottleVelocity = (player.Center + player.velocity * 20f - NPC.Center).SafeNormalize(Vector2.UnitY) * bottleSpeed;
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, bottleVelocity * uDieLul, ModContent.ProjectileType<CirrusVolatileVodkaBottle>(), 125, 0f, Main.myPlayer);
|
||||
}
|
||||
}
|
||||
@@ -1164,7 +1164,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
{
|
||||
Vector2 destination = player.Center;
|
||||
Vector2 distanceFromDestination = destination - NPC.Center;
|
||||
Vector2 desiredVelocity = Vector2.Normalize(distanceFromDestination - NPC.velocity) * CirrusPhotonRipperDashVelocity;
|
||||
Vector2 desiredVelocity = (distanceFromDestination - NPC.velocity).SafeNormalize(Vector2.UnitY) * CirrusPhotonRipperDashVelocity;
|
||||
|
||||
if (Vector2.Distance(NPC.Center, destination) > CirrusPhotonRipperMinDistanceFromTarget)
|
||||
NPC.SimpleFlyMovement(desiredVelocity * uDieLul, CirrusPhotonRipperDashAcceleration * uDieLul);
|
||||
@@ -1186,7 +1186,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
if (bulletHellCounter2 % 90 == 0)
|
||||
{
|
||||
float bottleSpeed = 12f;
|
||||
Vector2 bottleVelocity = Vector2.Normalize(player.Center + player.velocity * 20f - NPC.Center) * bottleSpeed;
|
||||
Vector2 bottleVelocity = (player.Center + player.velocity * 20f - NPC.Center).SafeNormalize(Vector2.UnitY) * bottleSpeed;
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, bottleVelocity * uDieLul, ModContent.ProjectileType<CirrusVolatileVodkaBottle>(), 125, 0f, Main.myPlayer);
|
||||
}
|
||||
}
|
||||
@@ -1303,7 +1303,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
for (int k = 0; k < totalProjectiles; k++)
|
||||
{
|
||||
Vector2 rayVelocity = spinningPoint.RotatedBy(radians * k);
|
||||
int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(rayVelocity) * 16f, rayVelocity, ModContent.ProjectileType<Projectiles.Magic.FabRay>(), 250, 0f, Main.myPlayer);
|
||||
int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + (rayVelocity).SafeNormalize(Vector2.UnitY) * 16f, rayVelocity, ModContent.ProjectileType<Projectiles.Magic.FabRay>(), 250, 0f, Main.myPlayer);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[proj].DamageType = DamageClass.Default;
|
||||
@@ -1830,7 +1830,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
}
|
||||
|
||||
Vector2 projectileVelocity = player.Center - NPC.Center;
|
||||
projectileVelocity.Normalize();
|
||||
projectileVelocity.SafeNormalize(Vector2.UnitY);
|
||||
Vector2 projectileSpawn = NPC.Center + projectileVelocity * 8f;
|
||||
projectileVelocity *= 10f * uDieLul;
|
||||
|
||||
@@ -1930,7 +1930,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
|
||||
if (!canDespawn)
|
||||
{
|
||||
Vector2 vector = Vector2.Normalize(player.Center - NPC.Center);
|
||||
Vector2 vector = (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY);
|
||||
NPC.velocity = vector * chargeVelocity;
|
||||
|
||||
shieldRotation = NPC.velocity.ToRotation();
|
||||
@@ -1945,13 +1945,13 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
float velocity = 8;
|
||||
int type = ModContent.ProjectileType<Projectiles.Magic.FabRay>();
|
||||
int damage = (int)(NPC.damage / 3);
|
||||
Vector2 projectileVelocity = Vector2.Normalize(player.Center - NPC.Center) * velocity;
|
||||
Vector2 projectileVelocity = (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY) * velocity;
|
||||
float rotation = MathHelper.ToRadians(22);
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(2)));
|
||||
|
||||
int p = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(perturbedSpeed) * 3f, perturbedSpeed, type, damage, 0f, Main.myPlayer);
|
||||
int p = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + (perturbedSpeed).SafeNormalize(Vector2.UnitY) * 3f, perturbedSpeed, type, damage, 0f, Main.myPlayer);
|
||||
if (p.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[p].DamageType = DamageClass.Default;
|
||||
@@ -2075,7 +2075,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
Vector2 projectileVelocity = player.Center - NPC.Center;
|
||||
projectileVelocity.Normalize();
|
||||
projectileVelocity.SafeNormalize(Vector2.UnitY);
|
||||
Vector2 projectileSpawn = NPC.Center + projectileVelocity * 4f;
|
||||
projectileVelocity *= 10f * uDieLul;
|
||||
int projectileType = hellblast;
|
||||
@@ -2154,7 +2154,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
{
|
||||
SoundEngine.PlaySound(BrimstoneBigShotSound, NPC.Center);
|
||||
Vector2 projectileVelocity = player.Center - NPC.Center;
|
||||
projectileVelocity.Normalize();
|
||||
projectileVelocity.SafeNormalize(Vector2.UnitY);
|
||||
Vector2 projectileSpawn = NPC.Center + projectileVelocity * 8f;
|
||||
projectileVelocity *= 5f * uDieLul;
|
||||
int projectileType = gigablast;
|
||||
@@ -2396,7 +2396,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
}
|
||||
|
||||
Vector2 projectileVelocity = player.Center - NPC.Center;
|
||||
projectileVelocity.Normalize();
|
||||
projectileVelocity.SafeNormalize(Vector2.UnitY);
|
||||
Vector2 projectileSpawn = NPC.Center + projectileVelocity * 8f;
|
||||
projectileVelocity *= 10f * uDieLul;
|
||||
|
||||
@@ -2494,7 +2494,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
|
||||
if (!canDespawn)
|
||||
{
|
||||
Vector2 vector = Vector2.Normalize(player.Center - NPC.Center);
|
||||
Vector2 vector = (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY);
|
||||
NPC.velocity = vector * chargeVelocity;
|
||||
|
||||
shieldRotation = NPC.velocity.ToRotation();
|
||||
@@ -2612,7 +2612,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
Vector2 projectileVelocity = player.Center - NPC.Center;
|
||||
projectileVelocity.Normalize();
|
||||
projectileVelocity.SafeNormalize(Vector2.UnitY);
|
||||
Vector2 projectileSpawn = NPC.Center + projectileVelocity * 4f;
|
||||
projectileVelocity *= 10f * uDieLul;
|
||||
int projectileType = hellblast;
|
||||
@@ -2695,7 +2695,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
{
|
||||
SoundEngine.PlaySound(BrimstoneBigShotSound, NPC.Center);
|
||||
Vector2 projectileVelocity = player.Center - NPC.Center;
|
||||
projectileVelocity.Normalize();
|
||||
projectileVelocity.SafeNormalize(Vector2.UnitY);
|
||||
Vector2 projectileSpawn = NPC.Center + projectileVelocity * 8f;
|
||||
projectileVelocity *= 5f * uDieLul;
|
||||
int projectileType = gigablast;
|
||||
|
||||
@@ -267,11 +267,11 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
laserSpawnDistance = 20f;
|
||||
}
|
||||
|
||||
bool scrap = false;
|
||||
bool weakLaser = false;
|
||||
if (probeLaunched)
|
||||
{
|
||||
scrap = true;
|
||||
projectileType = ProjectileID.SaucerScrap;
|
||||
weakLaser = true;
|
||||
projectileType = ProjectileID.EyeLaser;
|
||||
laserSpawnDistance = 0f;
|
||||
}
|
||||
|
||||
@@ -279,10 +279,10 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
Vector2 projectileVelocity = (player.Center - npc.Center).SafeNormalize(Vector2.UnitY) * projectileSpeed;
|
||||
Vector2 projectileSpawn = npc.Center + projectileVelocity * laserSpawnDistance;
|
||||
|
||||
// Shoot projectile and set timeLeft if not a homing laser/metal scrap so lasers don't last for too long
|
||||
int damage = scrap ? 0 : npc.GetProjectileDamage(projectileType);
|
||||
int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), projectileSpawn, projectileVelocity, projectileType, damage, 0f, Main.myPlayer, scrap ? 0f : 1f, 0f);
|
||||
Main.projectile[proj].timeLeft = scrap ? 150 : 900;
|
||||
// Shoot projectile
|
||||
int damage = npc.GetProjectileDamage(projectileType);
|
||||
int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), projectileSpawn, projectileVelocity, projectileType, damage, 0f, Main.myPlayer, weakLaser ? 0f : 1f, 0f);
|
||||
Main.projectile[proj].timeLeft = weakLaser ? 600 : 900;
|
||||
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user