This commit is contained in:
Altixal committed 2023-01-29 17:26:19 +07:00
commit 9a67dbeda1
13 files changed
+75 -39

No files matched your search

+21 -6
View File
@@ -291,7 +291,14 @@ namespace CalamityMod.NPCs.Yharon
float spinPhaseVelocity = 25f;
float spinPhaseRotation = MathHelper.TwoPi * 3 / spinTime;
float increasedIdleTimeAfterBulletHell = -120f;
float increasedIdleTimeAfterBulletHell = 120f;
bool moveSlowerAfterBulletHell = NPC.ai[2] < 0f;
if (moveSlowerAfterBulletHell)
{
float reducedMovementMultiplier = MathHelper.Lerp(0.1f, 1f, (NPC.ai[2] + increasedIdleTimeAfterBulletHell) / increasedIdleTimeAfterBulletHell);
acceleration *= reducedMovementMultiplier;
velocity *= reducedMovementMultiplier;
}
float teleportPhaseTimer = 30f;
@@ -1021,7 +1028,7 @@ namespace CalamityMod.NPCs.Yharon
{
NPC.ai[0] = 6f;
NPC.ai[1] = 0f;
NPC.ai[2] = increasedIdleTimeAfterBulletHell;
NPC.ai[2] = -increasedIdleTimeAfterBulletHell;
NPC.TargetClosest();
NPC.netUpdate = true;
}
@@ -1376,7 +1383,7 @@ namespace CalamityMod.NPCs.Yharon
{
NPC.ai[0] = 13f;
NPC.ai[1] = 0f;
NPC.ai[2] = increasedIdleTimeAfterBulletHell;
NPC.ai[2] = -increasedIdleTimeAfterBulletHell;
NPC.localAI[2] = 0f;
NPC.TargetClosest();
NPC.netUpdate = true;
@@ -1696,7 +1703,15 @@ namespace CalamityMod.NPCs.Yharon
int spinPhaseTimer = secondPhasePhase == 4 ? (bossRush ? 80 : death ? 100 : 120) : (bossRush ? 120 : death ? 150 : 180);
int flareDustSpawnDivisor = spinPhaseTimer / 10;
int flareDustSpawnDivisor2 = spinPhaseTimer / 20 + (secondPhasePhase == 4 ? spinPhaseTimer / 60 : 0);
float increasedIdleTimeAfterBulletHell = -120f;
float increasedIdleTimeAfterBulletHell = 120f;
bool moveSlowerAfterBulletHell = NPC.ai[1] < 0f;
if (moveSlowerAfterBulletHell)
{
float reducedMovementMultiplier = MathHelper.Lerp(0.1f, 1f, (NPC.ai[1] + increasedIdleTimeAfterBulletHell) / increasedIdleTimeAfterBulletHell);
acceleration *= reducedMovementMultiplier;
velocity *= reducedMovementMultiplier;
}
float flareSpawnDecelerationTimer = bossRush ? 60f : death ? 75f : 90f;
int flareSpawnPhaseTimerReduction = revenge ? (int)(flareSpawnDecelerationTimer * (ai2GateValue - lifeRatio)) : 0;
@@ -2269,7 +2284,7 @@ namespace CalamityMod.NPCs.Yharon
if (NPC.ai[1] >= spinPhaseTimer)
{
NPC.ai[0] = 1f;
NPC.ai[1] = increasedIdleTimeAfterBulletHell;
NPC.ai[1] = -increasedIdleTimeAfterBulletHell;
NPC.ai[2] = 0f;
NPC.localAI[2] = 0f;
NPC.TargetClosest();
@@ -2917,7 +2932,7 @@ namespace CalamityMod.NPCs.Yharon
}
#endregion
#region On Hit Player
#region On Hit Player
public override void OnHitPlayer(Player player, int damage, bool crit)
{
if (damage > 0)
+3 -1
View File
@@ -36,7 +36,9 @@ namespace CalamityMod.Projectiles.Boss
public override void AI()
{
//Day mode by default but syncs with the boss
Lighting.AddLight(Projectile.Center, 0.9f, 0.7f, 0f);
// Day mode by default but syncs with the boss
if (CalamityGlobalNPC.holyBoss != -1)
{
if (Main.npc[CalamityGlobalNPC.holyBoss].active)
+6 -4
View File
@@ -34,11 +34,13 @@ namespace CalamityMod.Projectiles.Boss
public override void AI()
{
//Day mode by default but syncs with the boss
Lighting.AddLight(Projectile.Center, 0.45f, 0.35f, 0f);
/*
Uses maxPenetrate because it's kinda pointless for a boss projectile
and it's convenient to copypaste without having to do adjustments
If someone really feels like making a proper int for this purpose they can do it themselves - Iris
* Day mode by default but syncs with the boss
* Uses maxPenetrate because it's kinda pointless for a boss projectile
* and it's convenient to copypaste without having to do adjustments
* If someone really feels like making a proper int for this purpose they can do it themselves - Iris
*/
if (CalamityGlobalNPC.holyBoss != -1)
{
+3 -1
View File
@@ -37,7 +37,9 @@ namespace CalamityMod.Projectiles.Boss
public override void AI()
{
//Day mode by default but syncs with the boss
Lighting.AddLight(Projectile.Center, 0.45f, 0.35f, 0f);
// Day mode by default but syncs with the boss
if (CalamityGlobalNPC.holyBoss != -1)
{
if (Main.npc[CalamityGlobalNPC.holyBoss].active)
+3 -1
View File
@@ -34,7 +34,9 @@ namespace CalamityMod.Projectiles.Boss
public override void AI()
{
//Day mode by default but syncs with the boss
Lighting.AddLight(Projectile.Center, 0.3f, 0.225f, 0f);
// Day mode by default but syncs with the boss
if (CalamityGlobalNPC.holyBoss != -1)
{
if (Main.npc[CalamityGlobalNPC.holyBoss].active)
+3 -1
View File
@@ -34,7 +34,9 @@ namespace CalamityMod.Projectiles.Boss
public override void AI()
{
//Day mode by default but syncs with the boss
Lighting.AddLight(Projectile.Center, 0.3f, 0.225f, 0f);
// Day mode by default but syncs with the boss
if (CalamityGlobalNPC.holyBoss != -1)
{
if (Main.npc[CalamityGlobalNPC.holyBoss].active)
+3 -1
View File
@@ -34,7 +34,9 @@ namespace CalamityMod.Projectiles.Boss
public override void AI()
{
//Day mode by default but syncs with the boss
Lighting.AddLight(Projectile.Center, 0.35f, 0.275f, 0f);
// Day mode by default but syncs with the boss
if (CalamityGlobalNPC.holyBoss != -1)
{
if (Main.npc[CalamityGlobalNPC.holyBoss].active)
+2
View File
@@ -31,6 +31,8 @@ namespace CalamityMod.Projectiles.Boss
public override void AI()
{
Lighting.AddLight(Projectile.Center, 0f, 0.6f, 0f);
if (Projectile.ai[0] < 240f)
{
Projectile.ai[0] += 1f;
+3 -1
View File
@@ -53,7 +53,9 @@ namespace CalamityMod.Projectiles.Boss
public override void AI()
{
//Day mode by default but syncs with the boss
Lighting.AddLight(Projectile.Center, 0.45f * Projectile.Opacity, 0.35f * Projectile.Opacity, 0f);
// Day mode by default but syncs with the boss
if (CalamityGlobalNPC.holyBoss != -1)
{
if (Main.npc[CalamityGlobalNPC.holyBoss].active)
+3 -1
View File
@@ -44,7 +44,9 @@ namespace CalamityMod.Projectiles.Boss
public override void AI()
{
//Day mode by default but syncs with the boss
Lighting.AddLight(Projectile.Center, 0.45f, 0.35f, 0f);
// Day mode by default but syncs with the boss
if (CalamityGlobalNPC.holyBoss != -1)
{
if (Main.npc[CalamityGlobalNPC.holyBoss].active)
+3 -1
View File
@@ -31,7 +31,9 @@ namespace CalamityMod.Projectiles.Boss
public override void AI()
{
//Day mode by default but syncs with the boss
Lighting.AddLight(Projectile.Center, 0.3f, 0.225f, 0f);
// Day mode by default but syncs with the boss
if (CalamityGlobalNPC.holyBoss != -1)
{
if (Main.npc[CalamityGlobalNPC.holyBoss].active)
+2
View File
@@ -29,6 +29,8 @@ namespace CalamityMod.Projectiles.Boss
public override void AI()
{
Lighting.AddLight(Projectile.Center, 0.45f, 0.35f, 0f);
if (Projectile.timeLeft < 510)
Projectile.tileCollide = true;
+20 -21
View File
@@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Boss
Projectile.width = 34;
Projectile.height = 34;
Projectile.hostile = true;
Projectile.alpha = 255;
Projectile.Opacity = 0f;
Projectile.penetrate = 1;
Projectile.tileCollide = false;
Projectile.ignoreWater = true;
@@ -46,6 +46,8 @@ namespace CalamityMod.Projectiles.Boss
public override void AI()
{
Lighting.AddLight(Projectile.Center, 0.3f * Projectile.Opacity, 0.3f * Projectile.Opacity, 0.3f * Projectile.Opacity);
// Day mode by default but syncs with the boss
if (CalamityGlobalNPC.holyBoss != -1)
{
@@ -60,22 +62,19 @@ namespace CalamityMod.Projectiles.Boss
Projectile.extraUpdates = 1;
if (Projectile.timeLeft < 300)
{
Projectile.tileCollide = true;
}
Color newColor2 = Main.hslToRgb(Projectile.ai[0], 1f, 0.5f);
if (Projectile.alpha > 0)
{
Projectile.alpha -= 8;
}
if (Projectile.alpha < 0)
{
Projectile.alpha = 0;
}
if (Projectile.alpha == 0)
{
if (Projectile.Opacity < 1f)
Projectile.Opacity += 0.03f;
if (Projectile.Opacity > 1f)
Projectile.Opacity = 1f;
if (Projectile.Opacity == 1f)
Lighting.AddLight(Projectile.Center, newColor2.ToVector3() * 0.5f);
}
Projectile.velocity.X *= 0.995f;
if (Projectile.velocity.Y < 0f)
{
@@ -86,16 +85,17 @@ namespace CalamityMod.Projectiles.Boss
Projectile.velocity.Y *= 1.06f;
float fallSpeed = (CalamityWorld.revenge || (Projectile.maxPenetrate != (int)Providence.BossMode.Day)) ? 3.5f : 3f;
if (Projectile.velocity.Y > fallSpeed)
{
Projectile.velocity.Y = fallSpeed;
}
}
if (Projectile.velocity.Y > -0.5f && Projectile.localAI[1] == 0f)
{
Projectile.localAI[1] = 1f;
Projectile.velocity.Y = 0.5f;
}
Projectile.rotation = (float)Math.Atan2(Projectile.velocity.Y, Projectile.velocity.X) - 1.57f;
Projectile.rotation = (float)Math.Atan2(Projectile.velocity.Y, Projectile.velocity.X) - MathHelper.PiOver2;
for (int num979 = 0; num979 < 2; num979++)
{
if (Main.rand.NextBool(10))
@@ -109,6 +109,7 @@ namespace CalamityMod.Projectiles.Boss
dust24.velocity = value55;
}
}
for (int num980 = 0; num980 < 2; num980++)
{
if (Main.rand.NextBool(10))
@@ -122,6 +123,7 @@ namespace CalamityMod.Projectiles.Boss
dust25.velocity = value56;
}
}
if (Main.rand.NextBool(10))
{
float scaleFactor13 = 1f + Main.rand.NextFloat() * 2f;
@@ -205,10 +207,7 @@ namespace CalamityMod.Projectiles.Boss
}
}
public override Color? GetAlpha(Color lightColor)
{
return new Color(255 - Projectile.alpha, 255 - Projectile.alpha, 255 - Projectile.alpha, 0);
}
public override Color? GetAlpha(Color lightColor) => new Color(255 * Projectile.Opacity, 255 * Projectile.Opacity, 255 * Projectile.Opacity, 0);
public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit)
{