1 - Respawn timer is 3 seconds if no bosses are alive and no events are active. Respawn timer is 6 seconds if no bosses are alive and an event is active.

2 - Edited several projectile spread calculations.
3 - Fixed an SCal dart spread attack.
4 - Gave SCal smoother movement.
5 - Queen Slime AI adjustments.
6 - Skeletron Prime movement adjustments.
7 - Ceaseless Void movement adjustments.
8 - Fairies now properly fly away if you take off the Fairy Boots while they're flying near you.
This commit is contained in:
mountaindrew10 committed 2022-05-11 16:17:10 -05:00
1 parent f3f7b82657
commit d161bead1a
14 files changed
+487 -623

No files matched your search

+5 -5
View File
@@ -2582,12 +2582,12 @@ namespace CalamityMod.CalPlayer
Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType<BossRushFailureEffectThing>(), 0, 0f);
}
if (Player.respawnTimer > 300)
// Respawn the player faster if no bosses are alive
if (!areThereAnyDamnBosses)
{
if (CalamityWorld.armageddon && !areThereAnyDamnBosses)
Player.respawnTimer -= 5;
else if (Main.expertMode) // 600 normal 900 expert
Player.respawnTimer--;
int respawnTimerSet = areThereAnyDamnEvents ? 360 : 180;
if (Player.respawnTimer > respawnTimerSet)
Player.respawnTimer = respawnTimerSet;
}
}
#endregion
+3 -3
View File
@@ -38,11 +38,11 @@ namespace CalamityMod.Items.Weapons.Magic
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
int numProj = 2;
int numProj = 3;
float rotation = MathHelper.ToRadians(2);
for (int i = 0; i < numProj + 1; i++)
for (int i = 0; i < numProj; i++)
{
Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1)));
Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1)));
int proj = Projectile.NewProjectile(source, position, perturbedSpeed, type, damage, knockback, player.whoAmI);
if (proj.WithinBounds(Main.maxProjectiles))
Main.projectile[proj].Calamity().forceMagic = true;
+1 -1
View File
@@ -132,7 +132,7 @@ namespace CalamityMod.Items.Weapons.Melee
float rotation = MathHelper.ToRadians(10f);
for (int i = 0; i < numProj; i++)
{
Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1)));
Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1)));
Projectile.NewProjectile(source, position, perturbedSpeed, type, damage, knockback, player.whoAmI);
}
break;
+3 -3
View File
@@ -42,11 +42,11 @@ namespace CalamityMod.Items.Weapons.Ranged
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
int numProj = 2;
int numProj = 3;
float rotation = MathHelper.ToRadians(2);
for (int i = 0; i < numProj + 1; i++)
for (int i = 0; i < numProj; i++)
{
Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1)));
Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1)));
if (type == ProjectileID.WoodenArrowFriendly)
Projectile.NewProjectile(source, position, perturbedSpeed, ModContent.ProjectileType<BrimstoneBolt>(), damage, knockback, player.whoAmI);
+3 -3
View File
@@ -45,11 +45,11 @@ Stealth strikes throw three high speed spears");
{
if (player.Calamity().StealthStrikeAvailable())
{
int numProj = 2;
int numProj = 3;
float rotation = MathHelper.ToRadians(3);
for (int i = 0; i < numProj + 1; i++)
for (int i = 0; i < numProj; i++)
{
Vector2 perturbedSpeed = new Vector2(velocity.X - 3f, velocity.Y - 3f).RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1)));
Vector2 perturbedSpeed = new Vector2(velocity.X - 3f, velocity.Y - 3f).RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1)));
int stealth = Projectile.NewProjectile(source, position, perturbedSpeed, ModContent.ProjectileType<DuneHopperProjectile>(), Math.Max(damage / 3, 1), knockback, player.whoAmI);
if (stealth.WithinBounds(Main.maxProjectiles))
Main.projectile[stealth].Calamity().stealthStrike = true;
+20 -30
View File
@@ -4292,7 +4292,7 @@ namespace CalamityMod.NPCs
acceleration *= 2f;
}
Vector2 moveTo = new Vector2(player.Center.X - vector.X, player.Center.Y - vector.Y);
Vector2 destination = player.Center;
// Move between 8 different positions around the player, in order
float maxDistance = 320f;
@@ -4343,38 +4343,28 @@ namespace CalamityMod.NPCs
}
}
moveTo += moveToOffset;
destination += moveToOffset;
float distance = (float)Math.Sqrt(moveTo.X * moveTo.X + moveTo.Y * moveTo.Y);
// How far Ceaseless Void is from where it's supposed to be
Vector2 distanceFromDestination = destination - npc.Center;
distance = velocity / distance;
moveTo.X *= distance;
moveTo.Y *= distance;
// Inverse lerp returns the percentage of progress between A and B
float lerpValue = Utils.GetLerpValue(0f, 2400f, distanceFromDestination.Length(), true);
if (npc.velocity.X < moveTo.X)
{
npc.velocity.X += acceleration;
if (npc.velocity.X < 0f && moveTo.X > 0f)
npc.velocity.X += acceleration;
}
else if (npc.velocity.X > moveTo.X)
{
npc.velocity.X -= acceleration;
if (npc.velocity.X > 0f && moveTo.X < 0f)
npc.velocity.X -= acceleration;
}
if (npc.velocity.Y < moveTo.Y)
{
npc.velocity.Y += acceleration;
if (npc.velocity.Y < 0f && moveTo.Y > 0f)
npc.velocity.Y += acceleration;
}
else if (npc.velocity.Y > moveTo.Y)
{
npc.velocity.Y -= acceleration;
if (npc.velocity.Y > 0f && moveTo.Y < 0f)
npc.velocity.Y -= acceleration;
}
// Min velocity
float minVelocity = distanceFromDestination.Length();
float minVelocityCap = velocity;
if (minVelocity > minVelocityCap)
minVelocity = minVelocityCap;
// Max velocity
Vector2 maxVelocity = distanceFromDestination / 24f;
float maxVelocityCap = minVelocityCap * 3f;
if (maxVelocity.Length() > maxVelocityCap)
maxVelocity = distanceFromDestination.SafeNormalize(Vector2.Zero) * maxVelocityCap;
Vector2 desiredVelocity = Vector2.Lerp(distanceFromDestination.SafeNormalize(Vector2.Zero) * minVelocity, maxVelocity, lerpValue);
npc.SimpleFlyMovement(desiredVelocity, acceleration);
}
// Spawn more Dark Energies as the fight progresses
+3 -3
View File
@@ -3449,7 +3449,7 @@ namespace CalamityMod.NPCs
}
// Fairies don't run away and are immune to damage while wearing Fairy Boots.
if (npc.type >= NPCID.FairyCritterPink && npc.type <= NPCID.FairyCritterBlue && npc.ai[2] < 2f)
if (npc.type >= NPCID.FairyCritterPink && npc.type <= NPCID.FairyCritterBlue && (npc.ai[2] < 2f || npc.ai[2] == 7f))
{
npc.TargetClosest();
if (Main.player[npc.target].Calamity().fairyBoots)
@@ -3461,8 +3461,8 @@ namespace CalamityMod.NPCs
return true;
}
// Set this to 1 so that the CheckActive shit never runs and thus the faries don't randomly vanish.
npc.ai[2] = 1f;
// Set this to 7 so that they run away when the player takes off their Fairy Boots.
npc.ai[2] = 7f;
npc.lavaImmune = true;
npc.dontTakeDamage = true;
+3 -3
View File
@@ -140,11 +140,11 @@ namespace CalamityMod.NPCs.NormalNPCs
int damage = NPC.GetProjectileDamage(type);
if (CalamityWorld.death || BossRushEvent.BossRushActive)
{
int numProj = 2;
int numProj = 3;
float rotation = MathHelper.ToRadians(9);
for (int i = 0; i < numProj + 1; i++)
for (int i = 0; i < numProj; i++)
{
Vector2 perturbedSpeed = projVector.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1)));
Vector2 perturbedSpeed = projVector.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1)));
Projectile.NewProjectile(NPC.GetSource_FromAI(), npcPos, perturbedSpeed, type, damage, 0f, Main.myPlayer, 0f, 0f);
}
}
File diff suppressed because it is too large. Load diff
@@ -495,18 +495,18 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
}
else
{
int numProj = 2;
int spread = 3 + (int)Math.Round((0.5f - lifeRatio) * 10f); // 3 to 8, wider spread is harder to avoid
if (nearbyActiveTiles < 300)
spread = Main.rand.Next(3, 7) + (int)Math.Round((0.5f - lifeRatio) * 8f);
int numProj = spread / 2;
int type = ProjectileID.PoisonSeedPlantera;
int damage = npc.GetProjectileDamage(type);
float rotation = MathHelper.ToRadians(spread);
for (int i = 0; i < numProj + 1; i++)
for (int i = 0; i < numProj; i++)
{
Vector2 perturbedSpeed = new Vector2(num743, num744).RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1)));
Vector2 perturbedSpeed = new Vector2(num743, num744).RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1)));
Projectile.NewProjectile(npc.GetSource_FromAI(), vector93, perturbedSpeed, type, damage, 0f, Main.myPlayer, 0f, 0f);
}
+43 -27
View File
@@ -210,7 +210,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
if (phase2)
idleTime = malice ? 40 : death ? 60 : 80;
if (phase4)
idleTime = 0;
idleTime /= 2;
if (!(npc.ai[1] > idleTime))
break;
@@ -379,7 +379,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
if (npc.ai[2] == 3f)
{
npc.velocity.Y = -13f * speedMult;
npc.velocity.X += (malice ? 5.5f : death ? 5f : 4.5f) * npc.direction;
npc.velocity.X += (malice ? 7f : death ? 6f : 5.5f) * npc.direction;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
if (npc.timeLeft > 10)
@@ -394,14 +394,14 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
else if (npc.ai[2] == 2f)
{
npc.velocity.Y = -(malice ? 10f : death ? 8f : 6f) * speedMult;
npc.velocity.X += (malice ? 6.5f : death ? 6f : 5.5f) * npc.direction;
npc.velocity.X += (malice ? 8.5f : death ? 7.5f : 7f) * npc.direction;
npc.ai[1] = -40f;
npc.ai[2] += 1f;
}
else
{
npc.velocity.Y = -(malice ? 12f : death ? 10f : 8f) * speedMult;
npc.velocity.X += (malice ? 6f : death ? 5.5f : 5f) * npc.direction;
npc.velocity.X += (malice ? 7.5f : death ? 6.5f : 6f) * npc.direction;
npc.ai[1] = -40f;
npc.ai[2] += 1f;
}
@@ -418,9 +418,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
if ((npc.direction == 1 && npc.velocity.X < num19) || (npc.direction == -1 && npc.velocity.X > 0f - num19))
{
if ((npc.direction == -1 && npc.velocity.X < 0.1) || (npc.direction == 1 && npc.velocity.X > -0.1))
npc.velocity.X += 0.2f * npc.direction;
npc.velocity.X += (malice ? 0.5f : death ? 0.35f : 0.3f) * npc.direction;
else
npc.velocity.X *= 0.93f;
npc.velocity.X *= malice ? 0.88f : death ? 0.9f : 0.91f;
}
}
break;
@@ -449,12 +449,6 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
if (npc.velocity.Y == 0f)
{
npc.Calamity().newAI[0] = npc.ai[0];
npc.SyncExtraAI();
npc.ai[0] = 0f;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.netUpdate = true;
SoundEngine.PlaySound(SoundID.Item167, npc.Center);
if (Main.netMode != NetmodeID.MultiplayerClient)
{
@@ -465,18 +459,18 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
// Eruption of crystals in phase 3
if (npc.ai[0] == 6f && phase3)
{
float projectileVelocity = 24f;
float projectileVelocity = 12f;
type = ProjectileID.QueenSlimeMinionBlueSpike;
damage = npc.GetProjectileDamage(type);
Vector2 destination = new Vector2(npc.Center.X, npc.Center.Y - 100f) - npc.Center;
destination.Normalize();
destination *= projectileVelocity;
int numProj = 30;
int numProj = 18;
float rotation = MathHelper.ToRadians(90);
for (int i = 0; i < numProj + 1; i++)
for (int i = 0; i < numProj; i++)
{
Vector2 perturbedSpeed = destination.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1)));
Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, type, damage, 0f, Main.myPlayer);
Vector2 perturbedSpeed = destination.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1)));
Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, type, damage, 0f, Main.myPlayer, 0f, -2f);
}
}
}
@@ -488,6 +482,13 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
Main.dust[num21].velocity.Y = -5f + Main.rand.NextFloat() * -3f;
Main.dust[num21].velocity.X *= 7f;
}
npc.Calamity().newAI[0] = npc.ai[0];
npc.SyncExtraAI();
npc.ai[0] = 0f;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.netUpdate = true;
}
else if (npc.ai[1] >= num20)
{
@@ -537,8 +538,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
npc.velocity.Y = num24;
// Cascade of crystals in phase 3 or 4 while falling down
if (((npc.ai[0] == 4f && phase3) || phase4) && npc.ai[1] % 6f == 0f)
if (((npc.ai[0] == 4f && phase3) || phase4) && npc.ai[1] % 12f == 0f)
{
SoundEngine.PlaySound(SoundID.Item154, npc.Center);
if (Main.netMode != NetmodeID.MultiplayerClient)
{
Vector2 fireFrom = npc.Center;
@@ -552,7 +554,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
for (int j = 0; j < totalProjectiles; j++)
{
Vector2 projVelocity = npc.velocity.RotatedBy(radians * j + MathHelper.PiOver2);
Projectile.NewProjectile(npc.GetSource_FromAI(), fireFrom, projVelocity * 2f, type, damage, 0f, Main.myPlayer);
Projectile.NewProjectile(npc.GetSource_FromAI(), fireFrom, projVelocity, type, damage, 0f, Main.myPlayer, 0f, -1f);
}
}
}
@@ -596,7 +598,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
{
npc.velocity = center - npc.Center;
npc.velocity = npc.velocity.SafeNormalize(Vector2.Zero);
npc.velocity *= 20f;
npc.velocity *= malice ? 30f : death ? 26f : 24f;
}
else
npc.velocity.Y *= 0.95f;
@@ -629,13 +631,27 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
float projectileVelocity = death ? 12f : 10.5f;
int type = ProjectileID.QueenSlimeGelAttack;
int damage = npc.GetProjectileDamage(type);
float ai1 = phase2 ? -2f : -1f;
for (int j = 0; j < numGelProjectiles; j++)
if (phase2)
{
Vector2 spinningpoint = new Vector2(projectileVelocity, 0f);
spinningpoint = spinningpoint.RotatedBy((-j) * ((float)Math.PI * 2f) / numGelProjectiles, Vector2.Zero);
int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y, spinningpoint.X, spinningpoint.Y, type, damage, 0f, Main.myPlayer, 0f, ai1);
Main.projectile[proj].timeLeft = 900;
Vector2 destination = new Vector2(npc.Center.X, npc.Center.Y + 100f) - npc.Center;
destination.Normalize();
destination *= projectileVelocity;
float rotation = MathHelper.ToRadians(120);
for (int i = 0; i < numGelProjectiles; i++)
{
Vector2 perturbedSpeed = destination.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numGelProjectiles - 1)));
int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, type, damage, 0f, Main.myPlayer, 0f, -2f);
Main.projectile[proj].timeLeft = 900;
}
}
else
{
for (int j = 0; j < numGelProjectiles; j++)
{
Vector2 spinningpoint = new Vector2(projectileVelocity, 0f);
spinningpoint = spinningpoint.RotatedBy((-j) * ((float)Math.PI * 2f) / numGelProjectiles, Vector2.Zero);
Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y, spinningpoint.X, spinningpoint.Y, type, damage, 0f, Main.myPlayer, 0f, -1f);
}
}
}
@@ -724,7 +740,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
npc.netUpdate = true;
}
int num28 = (int)(npc.lifeMax * (phase2 ? 0.03f : 0.015f));
int num28 = (int)(npc.lifeMax * 0.04f);
if (!((npc.life + num28) < npc.localAI[0]))
return false;
@@ -1,4 +1,4 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Events;
using CalamityMod.World;
@@ -244,25 +244,12 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
Vector2 value19 = Main.player[npc.target].Center - npc.Center;
value19.Normalize();
value19 *= num502;
int numProj = 2;
float rotation = MathHelper.ToRadians(5);
if (malice)
int numProj = malice ? 5 : 3;
float rotation = MathHelper.ToRadians(malice ? 8 : 5);
for (int i = 0; i < numProj; i++)
{
rotation = MathHelper.ToRadians(8);
for (int i = 0; i < numProj; i++)
{
Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, value19.RotatedBy(-rotation * (i + 1)), type, damage, 0f, Main.myPlayer, 0f, 1f);
Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, value19.RotatedBy(+rotation * (i + 1)), type, damage, 0f, Main.myPlayer, 0f, 1f);
}
Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, value19, type, damage, 0f, Main.myPlayer, 0f, 1f);
}
else
{
for (int i = 0; i < numProj + 1; i++)
{
Vector2 perturbedSpeed = value19.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1)));
Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, perturbedSpeed, type, damage, 0f, Main.myPlayer, 0f, 1f);
}
Vector2 perturbedSpeed = value19.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1)));
Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, perturbedSpeed, type, damage, 0f, Main.myPlayer, 0f, 1f);
}
}
}
@@ -309,20 +296,20 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
acceleration *= 0.5f;
}
if (npc.position.Y > Main.player[npc.target].position.Y - 350f)
if (npc.position.Y > Main.player[npc.target].position.Y - 400f)
{
if (npc.velocity.Y > 0f)
npc.velocity.Y *= 0.98f;
npc.velocity.Y *= 0.9f;
npc.velocity.Y -= acceleration;
if (npc.velocity.Y > velocityY)
npc.velocity.Y = velocityY;
}
else if (npc.position.Y < Main.player[npc.target].position.Y - 500f)
else if (npc.position.Y < Main.player[npc.target].position.Y - 450f)
{
if (npc.velocity.Y < 0f)
npc.velocity.Y *= 0.98f;
npc.velocity.Y *= 0.9f;
npc.velocity.Y += acceleration;
@@ -330,20 +317,20 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
npc.velocity.Y = -velocityY;
}
if (npc.position.X + (npc.width / 2) > Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) + 150f)
if (npc.position.X + (npc.width / 2) > Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) + 400f)
{
if (npc.velocity.X > 0f)
npc.velocity.X *= 0.98f;
npc.velocity.X *= 0.9f;
npc.velocity.X -= acceleration;
if (npc.velocity.X > velocityX)
npc.velocity.X = velocityX;
}
if (npc.position.X + (npc.width / 2) < Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) - 150f)
if (npc.position.X + (npc.width / 2) < Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) - 400f)
{
if (npc.velocity.X < 0f)
npc.velocity.X *= 0.98f;
npc.velocity.X *= 0.9f;
npc.velocity.X += acceleration;
@@ -488,9 +475,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
{
npc.velocity.Y += 0.1f;
if (npc.velocity.Y < 0f)
npc.velocity.Y *= 0.95f;
npc.velocity.Y *= 0.9f;
npc.velocity.X *= 0.95f;
npc.velocity.X *= 0.9f;
if (npc.timeLeft > 500)
npc.timeLeft = 500;
@@ -726,7 +713,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y - 100f)
{
if (npc.velocity.Y > 0f)
npc.velocity.Y *= 0.96f;
npc.velocity.Y *= 0.9f;
npc.velocity.Y -= malice ? 0.3f : death ? 0.12f : 0.1f;
@@ -736,7 +723,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
else if (npc.position.Y < Main.npc[(int)npc.ai[1]].position.Y - 100f)
{
if (npc.velocity.Y < 0f)
npc.velocity.Y *= 0.96f;
npc.velocity.Y *= 0.9f;
npc.velocity.Y += malice ? 0.3f : death ? 0.12f : 0.1f;
@@ -747,7 +734,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
if (npc.position.X + (npc.width / 2) > Main.npc[(int)npc.ai[1]].position.X + (Main.npc[(int)npc.ai[1]].width / 2) - 180f * npc.ai[0])
{
if (npc.velocity.X > 0f)
npc.velocity.X *= 0.96f;
npc.velocity.X *= 0.9f;
npc.velocity.X -= malice ? 0.3f : death ? 0.16f : 0.14f;
@@ -757,7 +744,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
if (npc.position.X + (npc.width / 2) < Main.npc[(int)npc.ai[1]].position.X + (Main.npc[(int)npc.ai[1]].width / 2) - 180f * npc.ai[0])
{
if (npc.velocity.X < 0f)
npc.velocity.X *= 0.96f;
npc.velocity.X *= 0.9f;
npc.velocity.X += malice ? 0.3f : death ? 0.16f : 0.14f;
@@ -825,7 +812,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
Vector2 vector63 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
float num513 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) - 320f - vector63.X;
float num514 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - 160f - vector63.Y;
float num514 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - 320f - vector63.Y;
float num515 = (float)Math.Sqrt(num513 * num513 + num514 * num514);
num515 = 9f / num515;
num513 *= num515;
@@ -1026,7 +1013,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y - 150f)
{
if (npc.velocity.Y > 0f)
npc.velocity.Y *= 0.96f;
npc.velocity.Y *= 0.9f;
npc.velocity.Y -= malice ? 0.275f : death ? 0.1f : 0.08f;
@@ -1036,7 +1023,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
else if (npc.position.Y < Main.npc[(int)npc.ai[1]].position.Y - 150f)
{
if (npc.velocity.Y < 0f)
npc.velocity.Y *= 0.96f;
npc.velocity.Y *= 0.9f;
npc.velocity.Y += malice ? 0.275f : death ? 0.1f : 0.08f;
@@ -1047,7 +1034,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
if (npc.position.X + (npc.width / 2) > Main.npc[(int)npc.ai[1]].position.X + (Main.npc[(int)npc.ai[1]].width / 2) + 200f)
{
if (npc.velocity.X > 0f)
npc.velocity.X *= 0.96f;
npc.velocity.X *= 0.9f;
npc.velocity.X -= malice ? 0.275f : death ? 0.22f : 0.2f;
@@ -1057,7 +1044,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
if (npc.position.X + (npc.width / 2) < Main.npc[(int)npc.ai[1]].position.X + (Main.npc[(int)npc.ai[1]].width / 2) + 160f)
{
if (npc.velocity.X < 0f)
npc.velocity.X *= 0.96f;
npc.velocity.X *= 0.9f;
npc.velocity.X += malice ? 0.275f : death ? 0.22f : 0.2f;
@@ -1103,8 +1090,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
{
Vector2 vector61 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
float num499 = Main.npc[(int)npc.ai[1]].position.X + (Main.npc[(int)npc.ai[1]].width / 2) - vector61.X;
float num500 = Main.npc[(int)npc.ai[1]].position.Y - vector61.Y;
num500 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - 160f - vector61.Y;
float num500 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - 320f - vector61.Y;
float num501 = (float)Math.Sqrt(num499 * num499 + num500 * num500);
num501 = 9f / num501;
num499 *= num501;
@@ -1161,25 +1147,12 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
Vector2 value19 = Main.player[npc.target].Center - npc.Center;
value19.Normalize();
value19 *= num502;
int numProj = 2;
float rotation = MathHelper.ToRadians(5);
if (malice)
int numProj = malice ? 5 : 3;
float rotation = MathHelper.ToRadians(malice ? 8 : 5);
for (int i = 0; i < numProj; i++)
{
rotation = MathHelper.ToRadians(8);
for (int i = 0; i < numProj; i++)
{
Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, value19.RotatedBy(-rotation * (i + 1)), type, damage, 0f, Main.myPlayer, 0f, 1f);
Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, value19.RotatedBy(+rotation * (i + 1)), type, damage, 0f, Main.myPlayer, 0f, 1f);
}
Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, value19, type, damage, 0f, Main.myPlayer, 0f, 1f);
}
else
{
for (int i = 0; i < numProj + 1; i++)
{
Vector2 perturbedSpeed = value19.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1)));
Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, type, damage, 0f, Main.myPlayer, 0f, 1f);
}
Vector2 perturbedSpeed = value19.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1)));
Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, perturbedSpeed, type, damage, 0f, Main.myPlayer, 0f, 1f);
}
}
}
@@ -1271,7 +1244,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y)
{
if (npc.velocity.Y > 0f)
npc.velocity.Y *= 0.96f;
npc.velocity.Y *= 0.9f;
npc.velocity.Y -= malice ? 0.3f : death ? 0.12f : 0.1f;
@@ -1281,7 +1254,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
else if (npc.position.Y < Main.npc[(int)npc.ai[1]].position.Y)
{
if (npc.velocity.Y < 0f)
npc.velocity.Y *= 0.96f;
npc.velocity.Y *= 0.9f;
npc.velocity.Y += malice ? 0.3f : death ? 0.12f : 0.1f;
@@ -1292,7 +1265,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
if (npc.position.X + (npc.width / 2) > Main.npc[(int)npc.ai[1]].position.X + (Main.npc[(int)npc.ai[1]].width / 2))
{
if (npc.velocity.X > 0f)
npc.velocity.X *= 0.96f;
npc.velocity.X *= 0.9f;
npc.velocity.X -= malice ? 1f : death ? 0.55f : 0.5f;
@@ -1302,7 +1275,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
if (npc.position.X + (npc.width / 2) < Main.npc[(int)npc.ai[1]].position.X + (Main.npc[(int)npc.ai[1]].width / 2))
{
if (npc.velocity.X < 0f)
npc.velocity.X *= 0.96f;
npc.velocity.X *= 0.9f;
npc.velocity.X += malice ? 1f : death ? 0.55f : 0.5f;
@@ -1345,7 +1318,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y + 300f)
{
if (npc.velocity.Y > 0f)
npc.velocity.Y *= 0.96f;
npc.velocity.Y *= 0.9f;
npc.velocity.Y -= malice ? 0.3f : death ? 0.12f : 0.1f;
@@ -1355,7 +1328,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
else if (npc.position.Y < Main.npc[(int)npc.ai[1]].position.Y + 230f)
{
if (npc.velocity.Y < 0f)
npc.velocity.Y *= 0.96f;
npc.velocity.Y *= 0.9f;
npc.velocity.Y += malice ? 0.3f : death ? 0.12f : 0.1f;
@@ -1366,7 +1339,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
if (npc.position.X + (npc.width / 2) > Main.npc[(int)npc.ai[1]].position.X + (Main.npc[(int)npc.ai[1]].width / 2) + 250f)
{
if (npc.velocity.X > 0f)
npc.velocity.X *= 0.94f;
npc.velocity.X *= 0.9f;
npc.velocity.X -= malice ? 0.8f : death ? 0.33f : 0.3f;
@@ -1376,7 +1349,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
if (npc.position.X + (npc.width / 2) < Main.npc[(int)npc.ai[1]].position.X + (Main.npc[(int)npc.ai[1]].width / 2))
{
if (npc.velocity.X < 0f)
npc.velocity.X *= 0.94f;
npc.velocity.X *= 0.9f;
npc.velocity.X += malice ? 0.8f : death ? 0.22f : 0.2f;
@@ -1406,8 +1379,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
npc.velocity.X += 0.5f;
npc.velocity.Y -= 0.5f;
if (npc.velocity.Y < -9f)
npc.velocity.Y = -9f;
if (npc.velocity.Y < -12f)
npc.velocity.Y = -12f;
if (npc.position.Y < Main.npc[(int)npc.ai[1]].position.Y - 280f)
{
@@ -1602,7 +1575,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y)
{
if (npc.velocity.Y > 0f)
npc.velocity.Y *= 0.96f;
npc.velocity.Y *= 0.9f;
npc.velocity.Y -= malice ? 0.3f : death ? 0.12f : 0.1f;
@@ -1612,7 +1585,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
else if (npc.position.Y < Main.npc[(int)npc.ai[1]].position.Y)
{
if (npc.velocity.Y < 0f)
npc.velocity.Y *= 0.96f;
npc.velocity.Y *= 0.9f;
npc.velocity.Y += malice ? 0.3f : death ? 0.12f : 0.1f;
@@ -1623,7 +1596,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
if (npc.position.X + (npc.width / 2) > Main.npc[(int)npc.ai[1]].position.X + (Main.npc[(int)npc.ai[1]].width / 2))
{
if (npc.velocity.X > 0f)
npc.velocity.X *= 0.96f;
npc.velocity.X *= 0.9f;
npc.velocity.X -= malice ? 1.2f : death ? 0.55f : 0.5f;
@@ -1633,7 +1606,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
if (npc.position.X + (npc.width / 2) < Main.npc[(int)npc.ai[1]].position.X + (Main.npc[(int)npc.ai[1]].width / 2))
{
if (npc.velocity.X < 0f)
npc.velocity.X *= 0.96f;
npc.velocity.X *= 0.9f;
npc.velocity.X += malice ? 1.2f : death ? 0.55f : 0.5f;
@@ -1671,7 +1644,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y + 320f)
{
if (npc.velocity.Y > 0f)
npc.velocity.Y *= 0.96f;
npc.velocity.Y *= 0.9f;
npc.velocity.Y -= malice ? 0.15f : death ? 0.05f : 0.04f;
@@ -1681,7 +1654,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
else if (npc.position.Y < Main.npc[(int)npc.ai[1]].position.Y + 260f)
{
if (npc.velocity.Y < 0f)
npc.velocity.Y *= 0.96f;
npc.velocity.Y *= 0.9f;
npc.velocity.Y += malice ? 0.15f : death ? 0.05f : 0.04f;
@@ -1692,7 +1665,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
if (npc.position.X + (npc.width / 2) > Main.npc[(int)npc.ai[1]].position.X + (Main.npc[(int)npc.ai[1]].width / 2))
{
if (npc.velocity.X > 0f)
npc.velocity.X *= 0.96f;
npc.velocity.X *= 0.9f;
npc.velocity.X -= malice ? 0.8f : death ? 0.33f : 0.3f;
@@ -1702,7 +1675,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
if (npc.position.X + (npc.width / 2) < Main.npc[(int)npc.ai[1]].position.X + (Main.npc[(int)npc.ai[1]].width / 2) - 250f)
{
if (npc.velocity.X < 0f)
npc.velocity.X *= 0.96f;
npc.velocity.X *= 0.9f;
npc.velocity.X += malice ? 0.8f : death ? 0.33f : 0.3f;
@@ -1725,9 +1698,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
npc.rotation = (float)Math.Atan2(num472, num471) + MathHelper.PiOver2;
npc.velocity.X *= 0.95f;
npc.velocity.Y -= 0.3f;
if (npc.velocity.Y < -8f)
npc.velocity.Y = -8f;
npc.velocity.Y -= 0.5f;
if (npc.velocity.Y < -12f)
npc.velocity.Y = -12f;
if (npc.position.Y < Main.npc[(int)npc.ai[1]].position.Y - 200f)
{
@@ -1782,25 +1755,25 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
if (npc.velocity.X > num474)
{
if (npc.velocity.X > 0f)
npc.velocity.X *= 0.97f;
npc.velocity.X *= 0.9f;
npc.velocity.X -= acceleration;
}
if (npc.velocity.X < num474)
{
if (npc.velocity.X < 0f)
npc.velocity.X *= 0.97f;
npc.velocity.X *= 0.9f;
npc.velocity.X += acceleration;
}
if (npc.velocity.Y > num475)
{
if (npc.velocity.Y > 0f)
npc.velocity.Y *= 0.97f;
npc.velocity.Y *= 0.9f;
npc.velocity.Y -= acceleration;
}
if (npc.velocity.Y < num475)
{
if (npc.velocity.Y < 0f)
npc.velocity.Y *= 0.97f;
npc.velocity.Y *= 0.9f;
npc.velocity.Y += acceleration;
}
+70 -36
View File
@@ -317,13 +317,9 @@ namespace CalamityMod.Projectiles
break;
case ProjectileID.QueenSlimeGelAttack:
affectedByMaliceModeVelocityMultiplier = true;
projectile.penetrate = projectile.maxPenetrate = 1;
break;
case ProjectileID.QueenSlimeMinionPinkBall:
affectedByMaliceModeVelocityMultiplier = true;
projectile.penetrate = projectile.maxPenetrate = 2;
projectile.penetrate = projectile.maxPenetrate = 1;
break;
case ProjectileID.MonkStaffT2:
@@ -697,36 +693,6 @@ namespace CalamityMod.Projectiles
return false;
}
else if (projectile.type == ProjectileID.QueenSlimeGelAttack)
{
// Phase 1 and 2 projectiles do not bounce and phase 2 projectiles do not have gravity.
if (projectile.ai[1] == -2f)
{
if (projectile.alpha == 0 && Main.rand.Next(3) == 0)
{
int num70 = 4;
Color newColor = NPC.AI_121_QueenSlime_GetDustColor();
newColor.A = 150;
float num71 = 1.2f;
int num72 = 8;
bool noGravity = Main.rand.NextBool();
int num73 = Dust.NewDust(projectile.position - new Vector2(num72, num72) + projectile.velocity, projectile.width + num72 * 2, projectile.height + num72 * 2, num70, 0f, 0f, 50, newColor, num71);
Main.dust[num73].velocity *= 0.3f;
Main.dust[num73].velocity += projectile.velocity * 0.3f;
Main.dust[num73].noGravity = noGravity;
}
projectile.alpha -= 50;
if (projectile.alpha < 0)
projectile.alpha = 0;
projectile.rotation += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.05f;
return false;
}
}
else if (projectile.type == ProjectileID.Starfury)
{
if (projectile.timeLeft > 45)
@@ -1185,6 +1151,74 @@ namespace CalamityMod.Projectiles
return false;
}
else if (projectile.type == ProjectileID.QueenSlimeGelAttack)
{
// Phase 1 and 2 projectiles do not bounce and phase 2 projectiles do not have gravity.
if (projectile.ai[1] == -2f)
{
if (projectile.alpha == 0 && Main.rand.Next(3) == 0)
{
Color newColor = NPC.AI_121_QueenSlime_GetDustColor();
newColor.A = 150;
int num72 = 8;
bool noGravity = Main.rand.NextBool();
int num73 = Dust.NewDust(projectile.position - new Vector2(num72, num72) + projectile.velocity, projectile.width + num72 * 2, projectile.height + num72 * 2, 4, 0f, 0f, 50, newColor, 1.2f);
Main.dust[num73].velocity *= 0.3f;
Main.dust[num73].velocity += projectile.velocity * 0.3f;
Main.dust[num73].noGravity = noGravity;
}
projectile.alpha -= 50;
if (projectile.alpha < 0)
projectile.alpha = 0;
projectile.rotation += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.05f;
return false;
}
}
else if (projectile.type == ProjectileID.QueenSlimeMinionBlueSpike)
{
// When Queen Slime fires these they aren't as affected by gravity.
if (projectile.ai[1] < 0f)
{
if (projectile.frameCounter == 0)
{
projectile.frameCounter = 1;
projectile.frame = Main.rand.Next(3);
}
if (projectile.alpha == 0 && Main.rand.Next(3) == 0)
{
Color newColor = new Color(78, 136, 255, 150);
int num73 = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 4, 0f, 0f, 50, newColor, 1.2f);
Main.dust[num73].velocity *= 0.3f;
Main.dust[num73].velocity += projectile.velocity * 0.3f;
Main.dust[num73].noGravity = true;
}
projectile.alpha -= 50;
if (projectile.alpha < 0)
projectile.alpha = 0;
if (projectile.ai[1] == -1f)
{
if (projectile.ai[0] >= 5f)
projectile.velocity.Y += 0.05f;
else
projectile.ai[0] += 1f;
if (projectile.velocity.Y > 16f)
projectile.velocity.Y = 16f;
}
projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + MathHelper.PiOver2;
return false;
}
}
else if (projectile.type == ProjectileID.DeathLaser && projectile.ai[0] == 1f)
{
if (defDamage == 0)
@@ -1958,7 +1992,7 @@ namespace CalamityMod.Projectiles
if (projectile.hostile)
{
// These projectiles are way too fucking fast so they need to be slower
if (projectile.type == ProjectileID.QueenSlimeMinionBlueSpike || projectile.type == ProjectileID.QueenSlimeMinionPinkBall)
if ((projectile.type == ProjectileID.QueenSlimeMinionBlueSpike && projectile.ai[1] >= 0f) || projectile.type == ProjectileID.QueenSlimeMinionPinkBall)
projectile.velocity *= 0.5f;
if (CalamityPlayer.areThereAnyDamnBosses && affectedByMaliceModeVelocityMultiplier && (CalamityWorld.malice || BossRushEvent.BossRushActive))
+13 -8
View File
@@ -1,4 +1,4 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Dusts;
using Microsoft.Xna.Framework;
using Terraria;
@@ -47,15 +47,20 @@ namespace CalamityMod.Projectiles.Ranged
Projectile.alpha = 0;
}
Lighting.AddLight(Projectile.Center, 0.7f, 0f, 0f);
for (int num121 = 0; num121 < 5; num121++)
if (Projectile.localAI[0] > 2f)
{
Dust dust4 = Main.dust[Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, Projectile.velocity.X, Projectile.velocity.Y, 100, default, 1f)];
dust4.velocity = Vector2.Zero;
dust4.position -= Projectile.velocity / 5f * (float)num121;
dust4.noGravity = true;
dust4.scale = 0.8f;
dust4.noLight = true;
for (int num121 = 0; num121 < 5; num121++)
{
Dust dust4 = Main.dust[Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, Projectile.velocity.X, Projectile.velocity.Y, 100, default, 1f)];
dust4.velocity = Vector2.Zero;
dust4.position -= Projectile.velocity / 5f * (float)num121;
dust4.noGravity = true;
dust4.scale = 0.8f;
dust4.noLight = true;
}
}
else
Projectile.localAI[0] += 1f;
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)