More changes
This commit is contained in:
1 parent
f323330328
commit
e1e5e668d5
18 files changed
+571
-632
No files matched your search
@@ -14,7 +14,7 @@ namespace CalamityMod.Items.CalamityCustomThrowingDamage
|
||||
public override void SafeSetDefaults()
|
||||
{
|
||||
item.width = 38;
|
||||
item.damage = 70;
|
||||
item.damage = 65;
|
||||
item.useAnimation = 18;
|
||||
item.useStyle = 1;
|
||||
item.useTime = 18;
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.damage = 28;
|
||||
item.damage = 24;
|
||||
item.magic = true;
|
||||
item.mana = 10;
|
||||
item.width = 46;
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.damage = 46;
|
||||
item.damage = 35;
|
||||
item.ranged = true;
|
||||
item.width = 18;
|
||||
item.height = 36;
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.damage = 28;
|
||||
item.damage = 24;
|
||||
item.magic = true;
|
||||
item.mana = 10;
|
||||
item.width = 50;
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.damage = 80;
|
||||
item.damage = 75;
|
||||
item.ranged = true;
|
||||
item.width = 58;
|
||||
item.height = 102;
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.SlimeGod
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.damage = 34;
|
||||
item.damage = 30;
|
||||
item.magic = true;
|
||||
item.mana = 15;
|
||||
item.width = 28;
|
||||
|
||||
+11
-22
@@ -8291,13 +8291,10 @@ namespace CalamityMod.NPCs
|
||||
// Set timer to new amount if a different hook is currently moving
|
||||
if (!despawn && npc.localAI[0] <= 0f && npc.ai[0] != 0f)
|
||||
{
|
||||
int num;
|
||||
for (int num763 = 0; num763 < 200; num763 = num + 1)
|
||||
for (int num763 = 0; num763 < 200; num763++)
|
||||
{
|
||||
if (num763 != npc.whoAmI && Main.npc[num763].active && Main.npc[num763].type == npc.type && (Main.npc[num763].velocity.X != 0f || Main.npc[num763].velocity.Y != 0f))
|
||||
npc.localAI[0] = (float)Main.rand.Next(60, 300);
|
||||
|
||||
num = num763;
|
||||
npc.localAI[0] = (float)Main.rand.Next(60, 301);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8305,7 +8302,7 @@ namespace CalamityMod.NPCs
|
||||
if (npc.localAI[0] <= 0f)
|
||||
{
|
||||
// Reset timer
|
||||
npc.localAI[0] = (float)Main.rand.Next(300, 600);
|
||||
npc.localAI[0] = (float)Main.rand.Next(300, 601);
|
||||
|
||||
// Pick location
|
||||
bool flag50 = false;
|
||||
@@ -10381,6 +10378,9 @@ namespace CalamityMod.NPCs
|
||||
{
|
||||
CalamityGlobalNPC calamityGlobalNPC = npc.GetGlobalNPC<CalamityGlobalNPC>(mod);
|
||||
|
||||
// Set contact damage to 0
|
||||
npc.damage = (npc.defDamage = 0);
|
||||
|
||||
// Chant sound
|
||||
if (npc.ai[0] != -1f && Main.rand.NextBool(1000))
|
||||
{
|
||||
@@ -10399,7 +10399,6 @@ namespace CalamityMod.NPCs
|
||||
// Variables
|
||||
bool isCultist = npc.type == NPCID.CultistBoss;
|
||||
bool dontTakeDamage = false;
|
||||
bool chaseable = true;
|
||||
|
||||
int iceMistDamage = 35;
|
||||
int fireballDamage = isCultist ? 30 : 25;
|
||||
@@ -10413,11 +10412,7 @@ namespace CalamityMod.NPCs
|
||||
|
||||
float iceMistSpeed = CalamityWorld.death ? 6.5f : 6f;
|
||||
|
||||
int fireballFireRate = 12 -
|
||||
(phase2 ? 2 : 0) -
|
||||
(phase3 ? 2 : 0) -
|
||||
(phase4 ? 2 : 0) -
|
||||
(phase5 ? 2 : 0);
|
||||
int fireballFireRate = 12;
|
||||
|
||||
float fireballSpeed = (CalamityWorld.death ? 7f : 6.5f) - (isCultist ? 0f : 3f);
|
||||
|
||||
@@ -10438,8 +10433,8 @@ namespace CalamityMod.NPCs
|
||||
(phase5 ? 5 : 0);
|
||||
|
||||
float timeToFinishRitual = 420f -
|
||||
(phase2 ? 120f : 0f) -
|
||||
(phase3 ? 90f : 0f) -
|
||||
(phase2 ? 90f : 0f) -
|
||||
(phase3 ? 60f : 0f) -
|
||||
(phase4 ? 30f : 0f) -
|
||||
(phase5 ? 15f : 0f);
|
||||
|
||||
@@ -10456,7 +10451,6 @@ namespace CalamityMod.NPCs
|
||||
npc.ai[0] = Main.npc[(int)npc.ai[3]].ai[0];
|
||||
npc.ai[1] = Main.npc[(int)npc.ai[3]].ai[1];
|
||||
dontTakeDamage = true;
|
||||
chaseable = false;
|
||||
}
|
||||
|
||||
// Stop spawning ritual if hit
|
||||
@@ -10562,7 +10556,6 @@ namespace CalamityMod.NPCs
|
||||
npc.localAI[2] = 0f;
|
||||
}
|
||||
dontTakeDamage = true;
|
||||
chaseable = false;
|
||||
}
|
||||
|
||||
// Phase switch
|
||||
@@ -10998,7 +10991,6 @@ namespace CalamityMod.NPCs
|
||||
if (npc.ai[1] >= 0f && npc.ai[1] < 30f)
|
||||
{
|
||||
dontTakeDamage = true;
|
||||
chaseable = false;
|
||||
float num28 = (npc.ai[1] - 0f) / 30f;
|
||||
npc.alpha = (int)(num28 * 255f);
|
||||
}
|
||||
@@ -11070,7 +11062,6 @@ namespace CalamityMod.NPCs
|
||||
list6.Clear();
|
||||
}
|
||||
dontTakeDamage = true;
|
||||
chaseable = false;
|
||||
npc.alpha = 255;
|
||||
if (isCultist)
|
||||
{
|
||||
@@ -11130,13 +11121,11 @@ namespace CalamityMod.NPCs
|
||||
else if (npc.ai[1] >= 90f && npc.ai[1] < 120f)
|
||||
{
|
||||
dontTakeDamage = true;
|
||||
chaseable = false;
|
||||
float num41 = (npc.ai[1] - 90f) / 30f;
|
||||
npc.alpha = 255 - (int)(num41 * 255f);
|
||||
}
|
||||
else if (npc.ai[1] >= 120f && npc.ai[1] < timeToFinishRitual)
|
||||
{
|
||||
chaseable = false;
|
||||
npc.alpha = 0;
|
||||
if (isCultist)
|
||||
{
|
||||
@@ -11196,7 +11185,6 @@ namespace CalamityMod.NPCs
|
||||
npc.ai[1] += 1f;
|
||||
if (npc.ai[1] >= timeToFinishRitual)
|
||||
{
|
||||
chaseable = false;
|
||||
npc.ai[0] = 0f;
|
||||
npc.ai[1] = 0f;
|
||||
npc.ai[3] += 1f;
|
||||
@@ -11389,7 +11377,7 @@ namespace CalamityMod.NPCs
|
||||
|
||||
// Take damage or not
|
||||
npc.dontTakeDamage = dontTakeDamage;
|
||||
npc.chaseable = chaseable;
|
||||
npc.chaseable = npc.ai[0] != -1f && npc.ai[0] != 5f;
|
||||
|
||||
if (ModLoader.GetMod("FargowiltasSouls") != null)
|
||||
ModLoader.GetMod("FargowiltasSouls").Call("FargoSoulsAI", npc.whoAmI);
|
||||
@@ -11399,6 +11387,7 @@ namespace CalamityMod.NPCs
|
||||
|
||||
public static bool BuffedAncientDoomAI(NPC npc, Mod mod)
|
||||
{
|
||||
npc.damage = (npc.defDamage = 0);
|
||||
float num1496 = 420f;
|
||||
float num1497 = 120f;
|
||||
int num1498 = 1;
|
||||
|
||||
@@ -690,7 +690,7 @@ namespace CalamityMod.NPCs
|
||||
npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 3.4) : (int)(npc.lifeMax * 2.3);
|
||||
npc.npcSlots = 32f;
|
||||
}
|
||||
else if (npc.type == NPCID.PlanterasHook || npc.type == NPCID.CultistBoss || npc.type == NPCID.AncientDoom)
|
||||
else if (npc.type == NPCID.PlanterasHook)
|
||||
{
|
||||
npc.damage = (npc.defDamage = 0);
|
||||
}
|
||||
|
||||
@@ -54,40 +54,46 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
public override bool PreAI()
|
||||
{
|
||||
bool expertMode = (Main.expertMode || CalamityWorld.bossRushActive);
|
||||
|
||||
if (start)
|
||||
{
|
||||
for (int num621 = 0; num621 < 5; num621++)
|
||||
{
|
||||
int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 180, 0f, 0f, 100, default, 2f);
|
||||
}
|
||||
npc.ai[1] = npc.ai[0];
|
||||
start = false;
|
||||
|
||||
for (int num621 = 0; num621 < 5; num621++)
|
||||
Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 180, 0f, 0f, 100, default, 2f);
|
||||
|
||||
npc.ai[1] = npc.ai[0];
|
||||
}
|
||||
|
||||
if (CalamityGlobalNPC.ghostBoss < 0 || !Main.npc[CalamityGlobalNPC.ghostBoss].active)
|
||||
{
|
||||
npc.active = false;
|
||||
npc.netUpdate = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
npc.TargetClosest(true);
|
||||
|
||||
Vector2 direction = Main.player[npc.target].Center - npc.Center;
|
||||
direction.Normalize();
|
||||
direction *= 9f;
|
||||
npc.rotation = direction.ToRotation();
|
||||
|
||||
timer++;
|
||||
if (CalamityWorld.death || CalamityWorld.bossRushActive)
|
||||
{
|
||||
timer++;
|
||||
}
|
||||
if (timer > 180)
|
||||
|
||||
if (timer >= 150)
|
||||
{
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
int damage = expertMode ? 58 : 70;
|
||||
Projectile.NewProjectile(npc.Center.X, npc.Center.Y, direction.X * 0.05f, direction.Y * 0.05f, mod.ProjectileType("PhantomMine"), damage, 1f, npc.target);
|
||||
}
|
||||
|
||||
timer = 0;
|
||||
}
|
||||
|
||||
Player player = Main.player[npc.target];
|
||||
double deg = (double)npc.ai[1];
|
||||
double rad = deg * (Math.PI / 180);
|
||||
@@ -100,7 +106,7 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
|
||||
public override Color? GetAlpha(Color drawColor)
|
||||
{
|
||||
return new Color(200, 200, 200, npc.alpha);
|
||||
return new Color(200, 200, 200, 0);
|
||||
}
|
||||
|
||||
public override bool CheckActive()
|
||||
|
||||
+183
-181
@@ -8,9 +8,9 @@ using CalamityMod.World;
|
||||
|
||||
namespace CalamityMod.NPCs.Polterghast
|
||||
{
|
||||
public class PolterPhantom : ModNPC
|
||||
public class PolterPhantom : ModNPC
|
||||
{
|
||||
private int despawnTimer = 600;
|
||||
private int despawnTimer = 600;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
@@ -25,24 +25,24 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
npc.height = 120;
|
||||
npc.defense = 0;
|
||||
npc.lifeMax = CalamityWorld.revenge ? 150000 : 130000;
|
||||
if (CalamityWorld.death)
|
||||
{
|
||||
npc.lifeMax = 225000;
|
||||
}
|
||||
if (CalamityWorld.bossRushActive)
|
||||
{
|
||||
npc.lifeMax = CalamityWorld.death ? 1100000 : 900000;
|
||||
}
|
||||
if (CalamityWorld.death)
|
||||
{
|
||||
npc.lifeMax = 225000;
|
||||
}
|
||||
if (CalamityWorld.bossRushActive)
|
||||
{
|
||||
npc.lifeMax = CalamityWorld.death ? 1100000 : 900000;
|
||||
}
|
||||
double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01;
|
||||
npc.lifeMax += (int)((double)npc.lifeMax * HPBoost);
|
||||
npc.knockBackResist = 0f;
|
||||
npc.aiStyle = -1; //new
|
||||
aiType = -1; //new
|
||||
npc.alpha = 255;
|
||||
aiType = -1; //new
|
||||
npc.alpha = 255;
|
||||
for (int k = 0; k < npc.buffImmune.Length; k++)
|
||||
{
|
||||
npc.buffImmune[k] = true;
|
||||
}
|
||||
}
|
||||
npc.buffImmune[BuffID.Ichor] = false;
|
||||
npc.buffImmune[BuffID.CursedInferno] = false;
|
||||
npc.buffImmune[mod.BuffType("AbyssalFlames")] = false;
|
||||
@@ -69,194 +69,196 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
{
|
||||
CalamityGlobalNPC.ghostBossClone = npc.whoAmI;
|
||||
|
||||
npc.alpha -= 5;
|
||||
if (npc.alpha < 50)
|
||||
{
|
||||
npc.alpha = 50;
|
||||
}
|
||||
if (CalamityGlobalNPC.ghostBoss < 0 || !Main.npc[CalamityGlobalNPC.ghostBoss].active)
|
||||
{
|
||||
npc.active = false;
|
||||
npc.netUpdate = true;
|
||||
return;
|
||||
}
|
||||
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.5f, 0.25f, 0.75f);
|
||||
npc.TargetClosest(true);
|
||||
Vector2 vector = npc.Center;
|
||||
if (Vector2.Distance(Main.player[npc.target].Center, vector) > 6000f)
|
||||
if (npc.alpha < 50)
|
||||
npc.alpha = 50;
|
||||
|
||||
if (CalamityGlobalNPC.ghostBoss < 0 || !Main.npc[CalamityGlobalNPC.ghostBoss].active)
|
||||
{
|
||||
npc.active = false;
|
||||
npc.netUpdate = true;
|
||||
return;
|
||||
}
|
||||
bool speedBoost1 = false;
|
||||
bool despawnBoost = false;
|
||||
if (npc.timeLeft < 1500)
|
||||
{
|
||||
|
||||
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.5f, 0.25f, 0.75f);
|
||||
|
||||
npc.TargetClosest(true);
|
||||
|
||||
Vector2 vector = npc.Center;
|
||||
|
||||
if (Vector2.Distance(Main.player[npc.target].Center, vector) > 6000f)
|
||||
npc.active = false;
|
||||
|
||||
bool speedBoost1 = false;
|
||||
bool despawnBoost = false;
|
||||
bool revenge = (CalamityWorld.revenge || CalamityWorld.bossRushActive);
|
||||
bool expertMode = (Main.expertMode || CalamityWorld.bossRushActive);
|
||||
|
||||
if (npc.timeLeft < 1500)
|
||||
npc.timeLeft = 1500;
|
||||
}
|
||||
bool revenge = (CalamityWorld.revenge || CalamityWorld.bossRushActive);
|
||||
bool expertMode = (Main.expertMode || CalamityWorld.bossRushActive);
|
||||
int[] array2 = new int[4];
|
||||
float num730 = 0f;
|
||||
float num731 = 0f;
|
||||
int num732 = 0;
|
||||
int num;
|
||||
for (int num733 = 0; num733 < 200; num733 = num + 1)
|
||||
{
|
||||
if (Main.npc[num733].active && Main.npc[num733].type == mod.NPCType("PolterghastHook"))
|
||||
{
|
||||
num730 += Main.npc[num733].Center.X;
|
||||
num731 += Main.npc[num733].Center.Y;
|
||||
array2[num732] = num733;
|
||||
num732++;
|
||||
if (num732 > 3)
|
||||
|
||||
int[] array2 = new int[4];
|
||||
float num730 = 0f;
|
||||
float num731 = 0f;
|
||||
int num732 = 0;
|
||||
int num;
|
||||
for (int num733 = 0; num733 < 200; num733 = num + 1)
|
||||
{
|
||||
if (Main.npc[num733].active && Main.npc[num733].type == mod.NPCType("PolterghastHook"))
|
||||
{
|
||||
num730 += Main.npc[num733].Center.X;
|
||||
num731 += Main.npc[num733].Center.Y;
|
||||
array2[num732] = num733;
|
||||
num732++;
|
||||
if (num732 > 3)
|
||||
break;
|
||||
}
|
||||
num = num733;
|
||||
}
|
||||
num730 /= (float)num732;
|
||||
num731 /= (float)num732;
|
||||
float num734 = 3f;
|
||||
float num735 = 0.03f;
|
||||
if (!Main.player[npc.target].ZoneDungeon && !CalamityWorld.bossRushActive && (double)Main.player[npc.target].position.Y < Main.worldSurface * 16.0)
|
||||
{
|
||||
despawnTimer--;
|
||||
if (despawnTimer <= 0)
|
||||
}
|
||||
num = num733;
|
||||
}
|
||||
num730 /= (float)num732;
|
||||
num731 /= (float)num732;
|
||||
|
||||
float num734 = 3f;
|
||||
float num735 = 0.03f;
|
||||
if (!Main.player[npc.target].ZoneDungeon && !CalamityWorld.bossRushActive && (double)Main.player[npc.target].position.Y < Main.worldSurface * 16.0)
|
||||
{
|
||||
despawnTimer--;
|
||||
if (despawnTimer <= 0)
|
||||
despawnBoost = true;
|
||||
speedBoost1 = true;
|
||||
num734 += 8f;
|
||||
num735 = 0.15f;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
speedBoost1 = true;
|
||||
num734 += 8f;
|
||||
num735 = 0.15f;
|
||||
}
|
||||
else
|
||||
despawnTimer++;
|
||||
}
|
||||
if (Main.npc[CalamityGlobalNPC.ghostBoss].ai[2] < 300f)
|
||||
{
|
||||
num734 = 18f;
|
||||
num735 = 0.12f;
|
||||
}
|
||||
if (expertMode)
|
||||
{
|
||||
num734 += revenge ? 1.5f : 1f;
|
||||
num734 *= revenge ? 1.25f : 1.1f;
|
||||
num735 += revenge ? 0.015f : 0.01f;
|
||||
num735 *= revenge ? 1.2f : 1.1f;
|
||||
}
|
||||
Vector2 vector91 = new Vector2(num730, num731);
|
||||
float num736 = Main.player[npc.target].Center.X - vector91.X;
|
||||
float num737 = Main.player[npc.target].Center.Y - vector91.Y;
|
||||
if (despawnBoost)
|
||||
{
|
||||
num737 *= -1f;
|
||||
num736 *= -1f;
|
||||
num734 += 8f;
|
||||
}
|
||||
float num738 = (float)Math.Sqrt((double)(num736 * num736 + num737 * num737));
|
||||
int num739 = 500;
|
||||
if (speedBoost1)
|
||||
|
||||
if (Main.npc[CalamityGlobalNPC.ghostBoss].ai[2] < 300f)
|
||||
{
|
||||
num734 = 18f;
|
||||
num735 = 0.12f;
|
||||
}
|
||||
|
||||
if (expertMode)
|
||||
{
|
||||
num734 += revenge ? 1.5f : 1f;
|
||||
num734 *= revenge ? 1.25f : 1.1f;
|
||||
num735 += revenge ? 0.015f : 0.01f;
|
||||
num735 *= revenge ? 1.2f : 1.1f;
|
||||
}
|
||||
|
||||
Vector2 vector91 = new Vector2(num730, num731);
|
||||
float num736 = Main.player[npc.target].Center.X - vector91.X;
|
||||
float num737 = Main.player[npc.target].Center.Y - vector91.Y;
|
||||
|
||||
if (despawnBoost)
|
||||
{
|
||||
num737 *= -1f;
|
||||
num736 *= -1f;
|
||||
num734 += 8f;
|
||||
}
|
||||
|
||||
float num738 = (float)Math.Sqrt((double)(num736 * num736 + num737 * num737));
|
||||
int num739 = 500;
|
||||
if (speedBoost1)
|
||||
num739 += 500;
|
||||
}
|
||||
if (expertMode)
|
||||
{
|
||||
if (expertMode)
|
||||
num739 += 150;
|
||||
|
||||
if (num738 >= (float)num739)
|
||||
{
|
||||
num738 = (float)num739 / num738;
|
||||
num736 *= num738;
|
||||
num737 *= num738;
|
||||
}
|
||||
if (num738 >= (float)num739)
|
||||
{
|
||||
num738 = (float)num739 / num738;
|
||||
num736 *= num738;
|
||||
num737 *= num738;
|
||||
}
|
||||
num730 += num736;
|
||||
num731 += num737;
|
||||
vector91 = new Vector2(vector.X, vector.Y);
|
||||
num736 = num730 - vector91.X;
|
||||
num737 = num731 - vector91.Y;
|
||||
num738 = (float)Math.Sqrt((double)(num736 * num736 + num737 * num737));
|
||||
if (num738 < num734)
|
||||
{
|
||||
num736 = npc.velocity.X;
|
||||
num737 = npc.velocity.Y;
|
||||
}
|
||||
else
|
||||
{
|
||||
num738 = num734 / num738;
|
||||
num736 *= num738;
|
||||
num737 *= num738;
|
||||
}
|
||||
if (npc.velocity.X < num736)
|
||||
{
|
||||
npc.velocity.X = npc.velocity.X + num735;
|
||||
if (npc.velocity.X < 0f && num736 > 0f)
|
||||
{
|
||||
npc.velocity.X = npc.velocity.X + num735 * 2f;
|
||||
}
|
||||
}
|
||||
else if (npc.velocity.X > num736)
|
||||
{
|
||||
npc.velocity.X = npc.velocity.X - num735;
|
||||
if (npc.velocity.X > 0f && num736 < 0f)
|
||||
{
|
||||
npc.velocity.X = npc.velocity.X - num735 * 2f;
|
||||
}
|
||||
}
|
||||
if (npc.velocity.Y < num737)
|
||||
{
|
||||
npc.velocity.Y = npc.velocity.Y + num735;
|
||||
if (npc.velocity.Y < 0f && num737 > 0f)
|
||||
{
|
||||
npc.velocity.Y = npc.velocity.Y + num735 * 2f;
|
||||
}
|
||||
}
|
||||
else if (npc.velocity.Y > num737)
|
||||
{
|
||||
npc.velocity.Y = npc.velocity.Y - num735;
|
||||
if (npc.velocity.Y > 0f && num737 < 0f)
|
||||
{
|
||||
npc.velocity.Y = npc.velocity.Y - num735 * 2f;
|
||||
}
|
||||
}
|
||||
Vector2 vector92 = new Vector2(vector.X, vector.Y);
|
||||
float num740 = Main.player[npc.target].Center.X - vector92.X;
|
||||
float num741 = Main.player[npc.target].Center.Y - vector92.Y;
|
||||
npc.rotation = (float)Math.Atan2((double)num741, (double)num740) + 1.57f;
|
||||
if (speedBoost1)
|
||||
{
|
||||
npc.defense = 400;
|
||||
|
||||
num730 += num736;
|
||||
num731 += num737;
|
||||
vector91 = new Vector2(vector.X, vector.Y);
|
||||
num736 = num730 - vector91.X;
|
||||
num737 = num731 - vector91.Y;
|
||||
num738 = (float)Math.Sqrt((double)(num736 * num736 + num737 * num737));
|
||||
|
||||
if (num738 < num734)
|
||||
{
|
||||
num736 = npc.velocity.X;
|
||||
num737 = npc.velocity.Y;
|
||||
}
|
||||
else
|
||||
{
|
||||
num738 = num734 / num738;
|
||||
num736 *= num738;
|
||||
num737 *= num738;
|
||||
}
|
||||
|
||||
if (npc.velocity.X < num736)
|
||||
{
|
||||
npc.velocity.X = npc.velocity.X + num735;
|
||||
if (npc.velocity.X < 0f && num736 > 0f)
|
||||
npc.velocity.X = npc.velocity.X + num735 * 2f;
|
||||
}
|
||||
else if (npc.velocity.X > num736)
|
||||
{
|
||||
npc.velocity.X = npc.velocity.X - num735;
|
||||
if (npc.velocity.X > 0f && num736 < 0f)
|
||||
npc.velocity.X = npc.velocity.X - num735 * 2f;
|
||||
}
|
||||
if (npc.velocity.Y < num737)
|
||||
{
|
||||
npc.velocity.Y = npc.velocity.Y + num735;
|
||||
if (npc.velocity.Y < 0f && num737 > 0f)
|
||||
npc.velocity.Y = npc.velocity.Y + num735 * 2f;
|
||||
}
|
||||
else if (npc.velocity.Y > num737)
|
||||
{
|
||||
npc.velocity.Y = npc.velocity.Y - num735;
|
||||
if (npc.velocity.Y > 0f && num737 < 0f)
|
||||
npc.velocity.Y = npc.velocity.Y - num735 * 2f;
|
||||
}
|
||||
|
||||
Vector2 vector92 = new Vector2(vector.X, vector.Y);
|
||||
float num740 = Main.player[npc.target].Center.X - vector92.X;
|
||||
float num741 = Main.player[npc.target].Center.Y - vector92.Y;
|
||||
npc.rotation = (float)Math.Atan2((double)num741, (double)num740) + 1.57f;
|
||||
|
||||
if (speedBoost1)
|
||||
{
|
||||
npc.defense = 400;
|
||||
npc.damage = 1200;
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.damage = expertMode ? 336 : 210;
|
||||
npc.defense = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.damage = expertMode ? 336 : 210;
|
||||
npc.defense = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Color drawColor)
|
||||
{
|
||||
return new Color(200, 150, 255, npc.alpha);
|
||||
}
|
||||
public override Color? GetAlpha(Color drawColor)
|
||||
{
|
||||
return new Color(200, 150, 255, npc.alpha);
|
||||
}
|
||||
|
||||
public override void FindFrame(int frameHeight)
|
||||
{
|
||||
npc.frameCounter += 1.0;
|
||||
if (npc.frameCounter > 6.0)
|
||||
{
|
||||
npc.frameCounter = 0.0;
|
||||
npc.frame.Y = npc.frame.Y + frameHeight;
|
||||
}
|
||||
if (npc.frame.Y > frameHeight * 3)
|
||||
{
|
||||
npc.frame.Y = 0;
|
||||
}
|
||||
}
|
||||
public override void FindFrame(int frameHeight)
|
||||
{
|
||||
npc.frameCounter += 1.0;
|
||||
if (npc.frameCounter > 6.0)
|
||||
{
|
||||
npc.frameCounter = 0.0;
|
||||
npc.frame.Y = npc.frame.Y + frameHeight;
|
||||
}
|
||||
if (npc.frame.Y > frameHeight * 3)
|
||||
{
|
||||
npc.frame.Y = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
if (CalamityWorld.revenge)
|
||||
player.AddBuff(mod.BuffType("Horror"), 180, true);
|
||||
if (CalamityWorld.revenge)
|
||||
player.AddBuff(mod.BuffType("Horror"), 180, true);
|
||||
}
|
||||
|
||||
public override bool CanHitPlayer(Player target, ref int cooldownSlot)
|
||||
|
||||
+107
-68
@@ -86,32 +86,43 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
// Emit light
|
||||
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.5f, 1.25f, 1.25f);
|
||||
|
||||
// whoAmI variable
|
||||
CalamityGlobalNPC.ghostBoss = npc.whoAmI;
|
||||
|
||||
// Detect clone
|
||||
bool cloneAlive = false;
|
||||
if (CalamityGlobalNPC.ghostBossClone != -1)
|
||||
{
|
||||
cloneAlive = Main.npc[CalamityGlobalNPC.ghostBossClone].active;
|
||||
}
|
||||
|
||||
// Variables
|
||||
Vector2 vector = npc.Center;
|
||||
bool speedBoost1 = false;
|
||||
bool despawnBoost = false;
|
||||
bool revenge = (CalamityWorld.revenge || CalamityWorld.bossRushActive);
|
||||
bool expertMode = (Main.expertMode || CalamityWorld.bossRushActive);
|
||||
bool phase2 = (double)npc.life <= (double)npc.lifeMax * 0.75; //hooks detach and fire beams
|
||||
bool phase3 = (double)npc.life <= (double)npc.lifeMax * (revenge ? 0.5 : 0.33); //hooks die and begins charging with ghosts spinning around player
|
||||
bool phase4 = (double)npc.life <= (double)npc.lifeMax * (revenge ? 0.33 : 0.2); //starts spitting ghost dudes
|
||||
bool phase5 = (double)npc.life <= (double)npc.lifeMax * (revenge ? 0.1 : 0.05); //starts moving incredibly fast
|
||||
bool phase2 = (double)npc.life < (double)npc.lifeMax * 0.75; //hooks fire beams
|
||||
bool phase3 = (double)npc.life < (double)npc.lifeMax * (revenge ? 0.5 : 0.33); //hooks stop shooting and polter begins charging with ghosts spinning around player
|
||||
bool phase4 = (double)npc.life < (double)npc.lifeMax * (revenge ? 0.33 : 0.2); //starts spitting ghost dudes
|
||||
bool phase5 = (double)npc.life < (double)npc.lifeMax * (revenge ? 0.1 : 0.05); //starts moving incredibly fast
|
||||
|
||||
// Target
|
||||
npc.TargetClosest(true);
|
||||
|
||||
// Stop rain
|
||||
CalamityMod.StopRain();
|
||||
|
||||
// Set time left
|
||||
if (npc.timeLeft < 1500)
|
||||
npc.timeLeft = 1500;
|
||||
|
||||
// Despawn
|
||||
if (Vector2.Distance(Main.player[npc.target].Center, vector) > (despawnBoost ? 1500f : 6000f))
|
||||
npc.active = false;
|
||||
|
||||
// Spawn hooks
|
||||
if (npc.localAI[0] == 0f && Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
npc.localAI[0] = 1f;
|
||||
@@ -120,6 +131,7 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
num729 = NPC.NewNPC((int)vector.X, (int)vector.Y, mod.NPCType("PolterghastHook"), npc.whoAmI, 0f, 0f, 0f, 0f, 255);
|
||||
num729 = NPC.NewNPC((int)vector.X, (int)vector.Y, mod.NPCType("PolterghastHook"), npc.whoAmI, 0f, 0f, 0f, 0f, 255);
|
||||
}
|
||||
|
||||
int[] array2 = new int[4];
|
||||
float num730 = 0f;
|
||||
float num731 = 0f;
|
||||
@@ -141,6 +153,7 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
num730 /= (float)num732;
|
||||
num731 /= (float)num732;
|
||||
|
||||
// Velocity and acceleration
|
||||
float num734 = 2.5f;
|
||||
float num735 = 0.025f;
|
||||
if (!Main.player[npc.target].ZoneDungeon && !CalamityWorld.bossRushActive && (double)Main.player[npc.target].position.Y < Main.worldSurface * 16.0)
|
||||
@@ -148,14 +161,13 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
despawnTimer--;
|
||||
if (despawnTimer <= 0)
|
||||
despawnBoost = true;
|
||||
|
||||
speedBoost1 = true;
|
||||
num734 += 2f;
|
||||
num735 += 0.025f;
|
||||
}
|
||||
else
|
||||
{
|
||||
despawnTimer++;
|
||||
}
|
||||
|
||||
if (phase2)
|
||||
{
|
||||
@@ -168,6 +180,7 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
if (cloneAlive)
|
||||
{
|
||||
boostDR = true;
|
||||
|
||||
if (npc.ai[2] >= 300f)
|
||||
{
|
||||
num734 += phase5 ? 14.5f : 8.5f;
|
||||
@@ -191,6 +204,7 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
num735 += 0.005f;
|
||||
}
|
||||
}
|
||||
|
||||
npc.ai[2] += 1f;
|
||||
if (npc.ai[2] >= 600f)
|
||||
{
|
||||
@@ -203,15 +217,17 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
boostDR = false;
|
||||
num734 += phase5 ? 18.5f : 14.5f;
|
||||
num735 += phase5 ? 0.115f : 0.085f;
|
||||
|
||||
npc.localAI[2] += 1f;
|
||||
if (npc.localAI[2] >= 600f)
|
||||
{
|
||||
npc.localAI[2] = 0f;
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
NPC.NewNPC((int)vector.X, (int)vector.Y, mod.NPCType("PolterPhantom"), 0, 0f, 0f, 0f, 0f, 255);
|
||||
}
|
||||
|
||||
Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 122);
|
||||
|
||||
for (int num621 = 0; num621 < 10; num621++)
|
||||
{
|
||||
int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f);
|
||||
@@ -246,14 +262,15 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
Vector2 vector91 = new Vector2(num730, num731);
|
||||
float num736 = Main.player[npc.target].Center.X - vector91.X;
|
||||
float num737 = Main.player[npc.target].Center.Y - vector91.Y;
|
||||
|
||||
if (despawnBoost)
|
||||
{
|
||||
num737 *= -1f;
|
||||
num736 *= -1f;
|
||||
num734 += 10f;
|
||||
}
|
||||
float num738 = (float)Math.Sqrt((double)(num736 * num736 + num737 * num737));
|
||||
|
||||
float num738 = (float)Math.Sqrt((double)(num736 * num736 + num737 * num737));
|
||||
int num739 = 500;
|
||||
if (speedBoost1)
|
||||
num739 += 250;
|
||||
@@ -266,12 +283,14 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
num736 *= num738;
|
||||
num737 *= num738;
|
||||
}
|
||||
|
||||
num730 += num736;
|
||||
num731 += num737;
|
||||
vector91 = new Vector2(vector.X, vector.Y);
|
||||
num736 = num730 - vector91.X;
|
||||
num737 = num731 - vector91.Y;
|
||||
num738 = (float)Math.Sqrt((double)(num736 * num736 + num737 * num737));
|
||||
|
||||
if (num738 < num734)
|
||||
{
|
||||
num736 = npc.velocity.X;
|
||||
@@ -326,87 +345,89 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
npc.damage = expertMode ? 240 : 150;
|
||||
npc.defense = 150;
|
||||
}
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
npc.localAI[1] += (expertMode ? 2f : 1.5f);
|
||||
npc.localAI[1] += (expertMode ? 1.5f : 1f);
|
||||
if (speedBoost1 || CalamityWorld.bossRushActive)
|
||||
npc.localAI[1] += 6f;
|
||||
npc.localAI[1] += 3f;
|
||||
|
||||
if (npc.localAI[1] >= 60f)
|
||||
if (npc.localAI[1] >= 40f)
|
||||
{
|
||||
npc.localAI[1] = 0f;
|
||||
|
||||
bool flag47 = Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height);
|
||||
if (npc.localAI[3] > 0f)
|
||||
{
|
||||
flag47 = true;
|
||||
npc.localAI[3] = 0f;
|
||||
}
|
||||
|
||||
if (flag47)
|
||||
{
|
||||
Vector2 vector93 = new Vector2(vector.X, vector.Y);
|
||||
float num742 = 6f;
|
||||
if (expertMode)
|
||||
{
|
||||
num742 = (CalamityWorld.bossRushActive ? 13f : 7f);
|
||||
}
|
||||
num742 += 1f;
|
||||
if (CalamityWorld.bossRushActive)
|
||||
num742 = 13f;
|
||||
if (speedBoost1 || npc.GetGlobalNPC<CalamityGlobalNPC>(mod).enraged || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive))
|
||||
{
|
||||
num742 *= 2f;
|
||||
}
|
||||
|
||||
Vector2 vector93 = new Vector2(vector.X, vector.Y);
|
||||
float num743 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector93.X;
|
||||
float num744 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector93.Y;
|
||||
float num745 = (float)Math.Sqrt((double)(num743 * num743 + num744 * num744));
|
||||
|
||||
num745 = num742 / num745;
|
||||
num743 *= num745;
|
||||
num744 *= num745;
|
||||
|
||||
int num746 = expertMode ? 46 : 55;
|
||||
int num747 = mod.ProjectileType("PhantomShot");
|
||||
int maxValue2 = 2;
|
||||
if (expertMode)
|
||||
{
|
||||
maxValue2 = 4;
|
||||
}
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.8 && Main.rand.Next(maxValue2) == 0)
|
||||
|
||||
if (Main.rand.NextBool(3))
|
||||
{
|
||||
num746 = expertMode ? 51 : 60;
|
||||
npc.localAI[1] = -30f;
|
||||
num747 = mod.ProjectileType("PhantomBlast");
|
||||
}
|
||||
|
||||
if (speedBoost1 || npc.GetGlobalNPC<CalamityGlobalNPC>(mod).enraged || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive))
|
||||
{
|
||||
num746 *= 2;
|
||||
}
|
||||
|
||||
vector93.X += num743 * 3f;
|
||||
vector93.Y += num744 * 3f;
|
||||
|
||||
int num748 = Projectile.NewProjectile(vector93.X, vector93.Y, num743, num744, num747, num746, 0f, Main.myPlayer, 0f, 0f);
|
||||
Main.projectile[num748].timeLeft = (num747 == mod.ProjectileType("PhantomBlast") ? 300 : 1200);
|
||||
}
|
||||
else
|
||||
{
|
||||
Vector2 vector93 = new Vector2(vector.X, vector.Y);
|
||||
float num742 = 11f;
|
||||
if (expertMode)
|
||||
{
|
||||
num742 = (CalamityWorld.bossRushActive ? 18f : 12f);
|
||||
}
|
||||
num742 += 1f;
|
||||
if (CalamityWorld.bossRushActive)
|
||||
num742 = 18f;
|
||||
if (speedBoost1 || npc.GetGlobalNPC<CalamityGlobalNPC>(mod).enraged || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive))
|
||||
{
|
||||
num742 *= 2f;
|
||||
}
|
||||
|
||||
Vector2 vector93 = new Vector2(vector.X, vector.Y);
|
||||
float num743 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector93.X;
|
||||
float num744 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector93.Y;
|
||||
float num745 = (float)Math.Sqrt((double)(num743 * num743 + num744 * num744));
|
||||
|
||||
num745 = num742 / num745;
|
||||
num743 *= num745;
|
||||
num744 *= num745;
|
||||
|
||||
int num746 = expertMode ? 51 : 60;
|
||||
int num747 = mod.ProjectileType("PhantomBlast");
|
||||
if (speedBoost1 || npc.GetGlobalNPC<CalamityGlobalNPC>(mod).enraged || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive))
|
||||
{
|
||||
num746 *= 2;
|
||||
}
|
||||
|
||||
vector93.X += num743 * 3f;
|
||||
vector93.Y += num744 * 3f;
|
||||
|
||||
int num748 = Projectile.NewProjectile(vector93.X, vector93.Y, num743, num744, num747, num746, 0f, Main.myPlayer, 0f, 0f);
|
||||
Main.projectile[num748].timeLeft = 180;
|
||||
}
|
||||
@@ -418,12 +439,15 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
if (npc.ai[0] == 0f)
|
||||
{
|
||||
npc.ai[0] += 1f;
|
||||
|
||||
Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 122);
|
||||
|
||||
Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Polt"), 1f);
|
||||
Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Polt2"), 1f);
|
||||
Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Polt3"), 1f);
|
||||
Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Polt4"), 1f);
|
||||
Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Polt5"), 1f);
|
||||
|
||||
for (int num621 = 0; num621 < 10; num621++)
|
||||
{
|
||||
int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 60, 0f, 0f, 100, default, 2f);
|
||||
@@ -444,7 +468,9 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
Main.dust[num624].velocity *= 2f;
|
||||
}
|
||||
}
|
||||
|
||||
npc.GivenName = "Necroghast";
|
||||
|
||||
if (speedBoost1 || npc.GetGlobalNPC<CalamityGlobalNPC>(mod).enraged || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive))
|
||||
{
|
||||
npc.defense = 200;
|
||||
@@ -455,87 +481,90 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
npc.damage = expertMode ? 288 : 180;
|
||||
npc.defense = 100;
|
||||
}
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
npc.localAI[1] += (expertMode ? 2f : 1.5f);
|
||||
npc.localAI[1] += (expertMode ? 1.5f : 1f);
|
||||
if (speedBoost1 || CalamityWorld.bossRushActive)
|
||||
npc.localAI[1] += 8f;
|
||||
npc.localAI[1] += 3f;
|
||||
|
||||
if (npc.localAI[1] > 50f)
|
||||
if (npc.localAI[1] >= 36f)
|
||||
{
|
||||
npc.localAI[1] = 0f;
|
||||
|
||||
bool flag47 = Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height);
|
||||
if (npc.localAI[3] > 0f)
|
||||
{
|
||||
flag47 = true;
|
||||
npc.localAI[3] = 0f;
|
||||
}
|
||||
|
||||
if (flag47)
|
||||
{
|
||||
Vector2 vector93 = new Vector2(vector.X, vector.Y);
|
||||
float num742 = 6f;
|
||||
if (expertMode)
|
||||
{
|
||||
num742 = (CalamityWorld.bossRushActive ? 13f : 7f);
|
||||
}
|
||||
num742 += 1f;
|
||||
if (CalamityWorld.bossRushActive)
|
||||
num742 = 13f;
|
||||
if (speedBoost1 || npc.GetGlobalNPC<CalamityGlobalNPC>(mod).enraged || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive))
|
||||
{
|
||||
num742 *= 2f;
|
||||
}
|
||||
|
||||
Vector2 vector93 = new Vector2(vector.X, vector.Y);
|
||||
float num743 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector93.X;
|
||||
float num744 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector93.Y;
|
||||
float num745 = (float)Math.Sqrt((double)(num743 * num743 + num744 * num744));
|
||||
|
||||
num745 = num742 / num745;
|
||||
num743 *= num745;
|
||||
num744 *= num745;
|
||||
|
||||
int num746 = expertMode ? 49 : 60;
|
||||
int num747 = mod.ProjectileType("PhantomShot2");
|
||||
int maxValue2 = 2;
|
||||
if (expertMode)
|
||||
{
|
||||
maxValue2 = 4;
|
||||
}
|
||||
if (Main.rand.Next(maxValue2) == 0)
|
||||
|
||||
if (Main.rand.NextBool(3))
|
||||
{
|
||||
num746 = expertMode ? 54 : 65;
|
||||
npc.localAI[1] = -30f;
|
||||
num747 = mod.ProjectileType("PhantomBlast2");
|
||||
}
|
||||
|
||||
if (speedBoost1 || npc.GetGlobalNPC<CalamityGlobalNPC>(mod).enraged || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive))
|
||||
{
|
||||
num746 *= 2;
|
||||
}
|
||||
|
||||
vector93.X += num743 * 3f;
|
||||
vector93.Y += num744 * 3f;
|
||||
|
||||
int num748 = Projectile.NewProjectile(vector93.X, vector93.Y, num743, num744, num747, num746, 0f, Main.myPlayer, 0f, 0f);
|
||||
Main.projectile[num748].timeLeft = (num747 == mod.ProjectileType("PhantomBlast2") ? 300 : 1200);
|
||||
}
|
||||
else
|
||||
{
|
||||
Vector2 vector93 = new Vector2(vector.X, vector.Y);
|
||||
float num742 = 11f;
|
||||
if (expertMode)
|
||||
{
|
||||
num742 = (CalamityWorld.bossRushActive ? 18f : 12f);
|
||||
}
|
||||
num742 += 1f;
|
||||
if (CalamityWorld.bossRushActive)
|
||||
num742 = 18f;
|
||||
if (speedBoost1 || npc.GetGlobalNPC<CalamityGlobalNPC>(mod).enraged || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive))
|
||||
{
|
||||
num742 *= 2f;
|
||||
}
|
||||
|
||||
Vector2 vector93 = new Vector2(vector.X, vector.Y);
|
||||
float num743 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector93.X;
|
||||
float num744 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector93.Y;
|
||||
float num745 = (float)Math.Sqrt((double)(num743 * num743 + num744 * num744));
|
||||
|
||||
num745 = num742 / num745;
|
||||
num743 *= num745;
|
||||
num744 *= num745;
|
||||
|
||||
int num746 = expertMode ? 54 : 65;
|
||||
int num747 = mod.ProjectileType("PhantomBlast2");
|
||||
|
||||
if (speedBoost1 || npc.GetGlobalNPC<CalamityGlobalNPC>(mod).enraged || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive))
|
||||
{
|
||||
num746 *= 2;
|
||||
}
|
||||
|
||||
vector93.X += num743 * 3f;
|
||||
vector93.Y += num744 * 3f;
|
||||
|
||||
int num748 = Projectile.NewProjectile(vector93.X, vector93.Y, num743, num744, num747, num746, 0f, Main.myPlayer, 0f, 0f);
|
||||
Main.projectile[num748].timeLeft = 240;
|
||||
}
|
||||
@@ -545,12 +574,15 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
else
|
||||
{
|
||||
npc.HitSound = SoundID.NPCHit36;
|
||||
|
||||
if (!spawnGhost)
|
||||
{
|
||||
spawnGhost = true;
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
NPC.NewNPC((int)vector.X, (int)vector.Y, mod.NPCType("PolterPhantom"), 0, 0f, 0f, 0f, 0f, 255);
|
||||
|
||||
for (int I = 0; I < 3; I++)
|
||||
{
|
||||
int Phantom = NPC.NewNPC((int)(Main.player[npc.target].Center.X + (Math.Sin(I * 120) * 500)),
|
||||
@@ -560,12 +592,15 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
Eye.ai[3] = I * 120;
|
||||
}
|
||||
}
|
||||
|
||||
Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 122);
|
||||
|
||||
Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Polt"), 1f);
|
||||
Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Polt2"), 1f);
|
||||
Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Polt3"), 1f);
|
||||
Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Polt4"), 1f);
|
||||
Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Polt5"), 1f);
|
||||
|
||||
for (int num621 = 0; num621 < 10; num621++)
|
||||
{
|
||||
int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 60, 0f, 0f, 100, default, 2f);
|
||||
@@ -586,7 +621,9 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
Main.dust[num624].velocity *= 2f;
|
||||
}
|
||||
}
|
||||
|
||||
npc.GivenName = "Necroplasm";
|
||||
|
||||
if (speedBoost1 || npc.GetGlobalNPC<CalamityGlobalNPC>(mod).enraged || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive))
|
||||
{
|
||||
npc.defense = 200;
|
||||
@@ -597,25 +634,28 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
npc.damage = expertMode ? 336 : 210;
|
||||
npc.defense = 0;
|
||||
}
|
||||
|
||||
if (phase4)
|
||||
{
|
||||
npc.localAI[1] += 1f;
|
||||
if (npc.localAI[1] >= 150f)
|
||||
{
|
||||
npc.localAI[1] = 0f;
|
||||
|
||||
float num757 = 8f;
|
||||
Vector2 vector94 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
float num758 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector94.X + (float)Main.rand.Next(-10, 11);
|
||||
float num759 = Math.Abs(num758 * 0.2f);
|
||||
float num760 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector94.Y + (float)Main.rand.Next(-10, 11);
|
||||
if (num760 > 0f)
|
||||
{
|
||||
num759 = 0f;
|
||||
}
|
||||
|
||||
num760 -= num759;
|
||||
float num761 = (float)Math.Sqrt((double)(num758 * num758 + num760 * num760));
|
||||
num761 = num757 / num761;
|
||||
num758 *= num761;
|
||||
num760 *= num761;
|
||||
|
||||
if (NPC.CountNPCS(mod.NPCType("PhantomSpiritL")) < (revenge ? 3 : 2) && Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
int num762 = NPC.NewNPC((int)vector.X, (int)vector.Y, mod.NPCType("PhantomSpiritL"), 0, 0f, 0f, 0f, 0f, 255);
|
||||
@@ -623,7 +663,6 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
Main.npc[num762].velocity.Y = num760;
|
||||
Main.npc[num762].netUpdate = true;
|
||||
}
|
||||
npc.localAI[1] = 0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -679,8 +718,8 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
{
|
||||
double newDamage = (damage + (int)((double)defense * 0.25));
|
||||
float protection = 0.1f + //.1
|
||||
((double)npc.life <= (double)npc.lifeMax * 0.75 ? 0.05f : 0f) + //.15
|
||||
((double)npc.life <= (double)npc.lifeMax * (CalamityWorld.revenge ? 0.5 : 0.33) ? 0.05f : 0f) + //.2
|
||||
((double)npc.life < (double)npc.lifeMax * 0.75 ? 0.05f : 0f) + //.15
|
||||
((double)npc.life < (double)npc.lifeMax * (CalamityWorld.revenge ? 0.5 : 0.33) ? 0.05f : 0f) + //.2
|
||||
(boostDR ? 0.6f : 0f); //.8
|
||||
if (npc.ichor)
|
||||
{
|
||||
@@ -708,14 +747,14 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
|
||||
public override void FindFrame(int frameHeight)
|
||||
{
|
||||
bool phase2 = (double)npc.life > (double)npc.lifeMax * (CalamityWorld.revenge ? 0.5 : 0.33);
|
||||
bool phase2 = (double)npc.life >= (double)npc.lifeMax * (CalamityWorld.revenge ? 0.5 : 0.33);
|
||||
npc.frameCounter += 1.0;
|
||||
if (npc.frameCounter > 6.0)
|
||||
{
|
||||
npc.frameCounter = 0.0;
|
||||
npc.frame.Y = npc.frame.Y + frameHeight;
|
||||
}
|
||||
if ((double)npc.life > (double)npc.lifeMax * 0.75)
|
||||
if ((double)npc.life >= (double)npc.lifeMax * 0.75)
|
||||
{
|
||||
if (npc.frame.Y > frameHeight * 3)
|
||||
{
|
||||
|
||||
+246
-338
@@ -9,10 +9,10 @@ using CalamityMod.World;
|
||||
|
||||
namespace CalamityMod.NPCs.Polterghast
|
||||
{
|
||||
public class PolterghastHook : ModNPC
|
||||
public class PolterghastHook : ModNPC
|
||||
{
|
||||
private int despawnTimer = 300;
|
||||
private bool phase2 = false;
|
||||
private int despawnTimer = 300;
|
||||
private bool phase2 = false;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
@@ -24,16 +24,12 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
{
|
||||
npc.aiStyle = -1;
|
||||
aiType = -1;
|
||||
npc.damage = 120;
|
||||
npc.damage = 0;
|
||||
npc.width = 40; //324
|
||||
npc.height = 40; //216
|
||||
npc.defense = 50;
|
||||
npc.lifeMax = CalamityWorld.revenge ? 60000 : 50000;
|
||||
if (CalamityWorld.death)
|
||||
{
|
||||
npc.lifeMax = 100000;
|
||||
}
|
||||
npc.dontTakeDamage = true;
|
||||
npc.defense = 0;
|
||||
npc.lifeMax = 50000;
|
||||
npc.dontTakeDamage = true;
|
||||
npc.noGravity = true;
|
||||
npc.noTileCollide = true;
|
||||
for (int k = 0; k < npc.buffImmune.Length; k++)
|
||||
@@ -57,334 +53,246 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.3f, 1f, 1f);
|
||||
bool expertMode = Main.expertMode;
|
||||
bool revenge = CalamityWorld.revenge;
|
||||
bool speedBoost1 = false;
|
||||
bool despawnBoost = false;
|
||||
if (CalamityGlobalNPC.ghostBoss < 0 || !Main.npc[CalamityGlobalNPC.ghostBoss].active)
|
||||
{
|
||||
npc.active = false;
|
||||
npc.netUpdate = true;
|
||||
return;
|
||||
}
|
||||
if (CalamityGlobalNPC.ghostBoss != -1 && !Main.player[Main.npc[CalamityGlobalNPC.ghostBoss].target].ZoneDungeon &&
|
||||
{
|
||||
// Emit light
|
||||
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.3f, 1f, 1f);
|
||||
|
||||
// Bools
|
||||
bool speedBoost1 = false;
|
||||
bool despawnBoost = false;
|
||||
|
||||
// Despawn if Polter is gone
|
||||
if (CalamityGlobalNPC.ghostBoss < 0 || !Main.npc[CalamityGlobalNPC.ghostBoss].active)
|
||||
{
|
||||
npc.active = false;
|
||||
npc.netUpdate = true;
|
||||
return;
|
||||
}
|
||||
|
||||
// Percent life remaining, Polter
|
||||
float lifeRatio = (float)Main.npc[CalamityGlobalNPC.ghostBoss].life / (float)Main.npc[CalamityGlobalNPC.ghostBoss].lifeMax;
|
||||
|
||||
// Despawn
|
||||
if (CalamityGlobalNPC.ghostBoss != -1 && !Main.player[Main.npc[CalamityGlobalNPC.ghostBoss].target].ZoneDungeon &&
|
||||
(double)Main.player[Main.npc[CalamityGlobalNPC.ghostBoss].target].position.Y < Main.worldSurface * 16.0 && !CalamityWorld.bossRushActive)
|
||||
{
|
||||
despawnTimer--;
|
||||
if (despawnTimer <= 0) { despawnBoost = true; }
|
||||
npc.localAI[0] -= 6f;
|
||||
speedBoost1 = true;
|
||||
}
|
||||
else { despawnTimer++; }
|
||||
if ((double)Main.npc[CalamityGlobalNPC.ghostBoss].life <= (double)Main.npc[CalamityGlobalNPC.ghostBoss].lifeMax * 0.75)
|
||||
{
|
||||
if (!phase2)
|
||||
{
|
||||
npc.damage = 0;
|
||||
phase2 = true;
|
||||
}
|
||||
npc.TargetClosest(true);
|
||||
if (Main.netMode == NetmodeID.MultiplayerClient)
|
||||
{
|
||||
if (npc.ai[0] == 0f)
|
||||
{
|
||||
npc.ai[0] = (float)((int)(npc.Center.X / 16f));
|
||||
}
|
||||
if (npc.ai[1] == 0f)
|
||||
{
|
||||
npc.ai[1] = (float)((int)(npc.Center.X / 16f));
|
||||
}
|
||||
}
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
if (npc.ai[0] == 0f || npc.ai[1] == 0f)
|
||||
{
|
||||
npc.localAI[0] = 0f;
|
||||
}
|
||||
npc.localAI[0] -= 5f;
|
||||
if (speedBoost1)
|
||||
{
|
||||
npc.localAI[0] -= 10f;
|
||||
}
|
||||
if (!despawnBoost && npc.localAI[0] <= 0f && npc.ai[0] != 0f)
|
||||
{
|
||||
int num;
|
||||
for (int num763 = 0; num763 < 200; num763 = num + 1)
|
||||
{
|
||||
if (num763 != npc.whoAmI && Main.npc[num763].active && Main.npc[num763].type == npc.type && (Main.npc[num763].velocity.X != 0f || Main.npc[num763].velocity.Y != 0f))
|
||||
{
|
||||
npc.localAI[0] = (float)Main.rand.Next(60, 300);
|
||||
}
|
||||
num = num763;
|
||||
}
|
||||
}
|
||||
if (npc.localAI[0] <= 0f)
|
||||
{
|
||||
npc.localAI[0] = (float)Main.rand.Next(300, 600);
|
||||
bool flag50 = false;
|
||||
int num764 = 0;
|
||||
while (!flag50 && num764 <= 1000)
|
||||
{
|
||||
num764++;
|
||||
int num765 = (int)(Main.player[Main.npc[CalamityGlobalNPC.ghostBoss].target].Center.X / 16f);
|
||||
int num766 = (int)(Main.player[Main.npc[CalamityGlobalNPC.ghostBoss].target].Center.Y / 16f);
|
||||
if (npc.ai[0] == 0f)
|
||||
{
|
||||
num765 = (int)((Main.player[Main.npc[CalamityGlobalNPC.ghostBoss].target].Center.X + Main.npc[CalamityGlobalNPC.ghostBoss].Center.X) / 32f);
|
||||
num766 = (int)((Main.player[Main.npc[CalamityGlobalNPC.ghostBoss].target].Center.Y + Main.npc[CalamityGlobalNPC.ghostBoss].Center.Y) / 32f);
|
||||
}
|
||||
if (despawnBoost)
|
||||
{
|
||||
num765 = (int)Main.npc[CalamityGlobalNPC.ghostBoss].position.X / 16;
|
||||
num766 = (int)(Main.npc[CalamityGlobalNPC.ghostBoss].position.Y + 400f) / 16;
|
||||
}
|
||||
int num767 = 20;
|
||||
num767 += (int)(100f * ((float)num764 / 1000f));
|
||||
int num768 = num765 + Main.rand.Next(-num767, num767 + 1);
|
||||
int num769 = num766 + Main.rand.Next(-num767, num767 + 1);
|
||||
try
|
||||
{
|
||||
if (WorldGen.SolidTile(num768, num769) || (Main.tile[num768, num769].wall > 0 && (num764 > 500 || Main.npc[CalamityGlobalNPC.ghostBoss].life < Main.npc[CalamityGlobalNPC.ghostBoss].lifeMax / 2)))
|
||||
{
|
||||
flag50 = true;
|
||||
npc.ai[0] = (float)num768;
|
||||
npc.ai[1] = (float)num769;
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (npc.ai[0] > 0f && npc.ai[1] > 0f)
|
||||
{
|
||||
float num772 = 8f;
|
||||
if (expertMode)
|
||||
{
|
||||
num772 += 1f;
|
||||
}
|
||||
if (speedBoost1)
|
||||
{
|
||||
num772 *= 2f;
|
||||
}
|
||||
if (despawnBoost)
|
||||
{
|
||||
num772 *= 2f;
|
||||
}
|
||||
Vector2 vector95 = new Vector2(npc.Center.X, npc.Center.Y);
|
||||
float num773 = npc.ai[0] * 16f - 8f - vector95.X;
|
||||
float num774 = npc.ai[1] * 16f - 8f - vector95.Y;
|
||||
float num775 = (float)Math.Sqrt((double)(num773 * num773 + num774 * num774));
|
||||
if (num775 < 12f + num772)
|
||||
{
|
||||
npc.velocity.X = num773;
|
||||
npc.velocity.Y = num774;
|
||||
}
|
||||
else
|
||||
{
|
||||
num775 = num772 / num775;
|
||||
npc.velocity.X = num773 * num775;
|
||||
npc.velocity.Y = num774 * num775;
|
||||
}
|
||||
}
|
||||
Vector2 vector102 = new Vector2(npc.Center.X, npc.Center.Y);
|
||||
float num818 = Main.player[npc.target].Center.X - vector102.X;
|
||||
float num819 = Main.player[npc.target].Center.Y - vector102.Y;
|
||||
float num820 = (float)Math.Sqrt((double)(num818 * num818 + num819 * num819));
|
||||
float num821 = 10f;
|
||||
num820 = num821 / num820;
|
||||
num818 *= num820;
|
||||
num819 *= num820;
|
||||
npc.rotation = (float)Math.Atan2((double)num819, (double)num818) + 1.57f;
|
||||
Vector2 vector17 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
float num147 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector17.X;
|
||||
float num148 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector17.Y;
|
||||
float num149 = (float)Math.Sqrt((double)(num147 * num147 + num148 * num148));
|
||||
num149 = 4f / num149;
|
||||
num147 *= num149;
|
||||
num148 *= num149;
|
||||
vector17 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
num147 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector17.X;
|
||||
num148 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector17.Y;
|
||||
num149 = (float)Math.Sqrt((double)(num147 * num147 + num148 * num148));
|
||||
if (num149 > 1200f)
|
||||
{
|
||||
npc.ai[2] = 0f;
|
||||
npc.ai[3] = 0f;
|
||||
return;
|
||||
}
|
||||
npc.ai[2] += 1f;
|
||||
if (npc.ai[3] == 0f)
|
||||
{
|
||||
if (npc.ai[2] > 120f)
|
||||
{
|
||||
npc.ai[2] = 0f;
|
||||
npc.ai[3] = 1f;
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (npc.ai[2] > 40f)
|
||||
{
|
||||
npc.ai[3] = 0f;
|
||||
}
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == 20f)
|
||||
{
|
||||
float num151 = 5f;
|
||||
int num152 = 60;
|
||||
int num153 = mod.ProjectileType("PhantomHookShot");
|
||||
num149 = num151 / num149;
|
||||
num147 *= num149;
|
||||
num148 *= num149;
|
||||
int num154 = Projectile.NewProjectile(vector17.X, vector17.Y, num147, num148, num153, num152, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (Main.netMode == NetmodeID.MultiplayerClient)
|
||||
{
|
||||
if (npc.ai[0] == 0f)
|
||||
{
|
||||
npc.ai[0] = (float)((int)(npc.Center.X / 16f));
|
||||
}
|
||||
if (npc.ai[1] == 0f)
|
||||
{
|
||||
npc.ai[1] = (float)((int)(npc.Center.X / 16f));
|
||||
}
|
||||
}
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
if (npc.ai[0] == 0f || npc.ai[1] == 0f)
|
||||
{
|
||||
npc.localAI[0] = 0f;
|
||||
}
|
||||
npc.localAI[0] -= 5f;
|
||||
if (speedBoost1)
|
||||
{
|
||||
npc.localAI[0] -= 10f;
|
||||
}
|
||||
if (!despawnBoost && npc.localAI[0] <= 0f && npc.ai[0] != 0f)
|
||||
{
|
||||
int num;
|
||||
for (int num763 = 0; num763 < 200; num763 = num + 1)
|
||||
{
|
||||
if (num763 != npc.whoAmI && Main.npc[num763].active && Main.npc[num763].type == npc.type && (Main.npc[num763].velocity.X != 0f || Main.npc[num763].velocity.Y != 0f))
|
||||
{
|
||||
npc.localAI[0] = (float)Main.rand.Next(60, 300);
|
||||
}
|
||||
num = num763;
|
||||
}
|
||||
}
|
||||
if (npc.localAI[0] <= 0f)
|
||||
{
|
||||
npc.localAI[0] = (float)Main.rand.Next(300, 600);
|
||||
bool flag50 = false;
|
||||
int num764 = 0;
|
||||
while (!flag50 && num764 <= 1000)
|
||||
{
|
||||
num764++;
|
||||
int num765 = (int)(Main.player[Main.npc[CalamityGlobalNPC.ghostBoss].target].Center.X / 16f);
|
||||
int num766 = (int)(Main.player[Main.npc[CalamityGlobalNPC.ghostBoss].target].Center.Y / 16f);
|
||||
if (npc.ai[0] == 0f)
|
||||
{
|
||||
num765 = (int)((Main.player[Main.npc[CalamityGlobalNPC.ghostBoss].target].Center.X + Main.npc[CalamityGlobalNPC.ghostBoss].Center.X) / 32f);
|
||||
num766 = (int)((Main.player[Main.npc[CalamityGlobalNPC.ghostBoss].target].Center.Y + Main.npc[CalamityGlobalNPC.ghostBoss].Center.Y) / 32f);
|
||||
}
|
||||
if (despawnBoost)
|
||||
{
|
||||
num765 = (int)Main.npc[CalamityGlobalNPC.ghostBoss].position.X / 16;
|
||||
num766 = (int)(Main.npc[CalamityGlobalNPC.ghostBoss].position.Y + 400f) / 16;
|
||||
}
|
||||
int num767 = 20;
|
||||
num767 += (int)(100f * ((float)num764 / 1000f));
|
||||
int num768 = num765 + Main.rand.Next(-num767, num767 + 1);
|
||||
int num769 = num766 + Main.rand.Next(-num767, num767 + 1);
|
||||
try
|
||||
{
|
||||
if (WorldGen.SolidTile(num768, num769) || (Main.tile[num768, num769].wall > 0 && (num764 > 500 || Main.npc[CalamityGlobalNPC.ghostBoss].life < Main.npc[CalamityGlobalNPC.ghostBoss].lifeMax / 2)))
|
||||
{
|
||||
flag50 = true;
|
||||
npc.ai[0] = (float)num768;
|
||||
npc.ai[1] = (float)num769;
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (npc.ai[0] > 0f && npc.ai[1] > 0f)
|
||||
{
|
||||
float num772 = 11f;
|
||||
if (expertMode)
|
||||
{
|
||||
num772 += 1f;
|
||||
}
|
||||
if (speedBoost1)
|
||||
{
|
||||
num772 *= 2f;
|
||||
}
|
||||
if (despawnBoost)
|
||||
{
|
||||
num772 *= 2f;
|
||||
}
|
||||
Vector2 vector95 = new Vector2(npc.Center.X, npc.Center.Y);
|
||||
float num773 = npc.ai[0] * 16f - 8f - vector95.X;
|
||||
float num774 = npc.ai[1] * 16f - 8f - vector95.Y;
|
||||
float num775 = (float)Math.Sqrt((double)(num773 * num773 + num774 * num774));
|
||||
if (num775 < 12f + num772)
|
||||
{
|
||||
npc.velocity.X = num773;
|
||||
npc.velocity.Y = num774;
|
||||
}
|
||||
else
|
||||
{
|
||||
num775 = num772 / num775;
|
||||
npc.velocity.X = num773 * num775;
|
||||
npc.velocity.Y = num774 * num775;
|
||||
}
|
||||
Vector2 vector96 = new Vector2(npc.Center.X, npc.Center.Y);
|
||||
float num776 = Main.npc[CalamityGlobalNPC.ghostBoss].Center.X - vector96.X;
|
||||
float num777 = Main.npc[CalamityGlobalNPC.ghostBoss].Center.Y - vector96.Y;
|
||||
npc.rotation = (float)Math.Atan2((double)num777, (double)num776) - 1.57f;
|
||||
}
|
||||
}
|
||||
{
|
||||
despawnTimer--;
|
||||
if (despawnTimer <= 0)
|
||||
despawnBoost = true;
|
||||
|
||||
npc.localAI[0] -= 6f;
|
||||
speedBoost1 = true;
|
||||
}
|
||||
else
|
||||
despawnTimer++;
|
||||
|
||||
// Phase 2
|
||||
if (lifeRatio < 0.75f && lifeRatio >= (CalamityWorld.revenge ? 0.5 : 0.33))
|
||||
{
|
||||
phase2 = true;
|
||||
|
||||
npc.TargetClosest(true);
|
||||
|
||||
Movement(phase2, Main.expertMode, CalamityWorld.revenge, speedBoost1, despawnBoost, lifeRatio);
|
||||
|
||||
// Fire projectiles
|
||||
Vector2 vector17 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
float num147 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector17.X;
|
||||
float num148 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector17.Y;
|
||||
float num149 = (float)Math.Sqrt((double)(num147 * num147 + num148 * num148));
|
||||
|
||||
num149 = 4f / num149;
|
||||
num147 *= num149;
|
||||
num148 *= num149;
|
||||
|
||||
if (num149 > 1200f)
|
||||
{
|
||||
npc.ai[2] = 0f;
|
||||
npc.ai[3] = 0f;
|
||||
return;
|
||||
}
|
||||
|
||||
npc.ai[2] += 1f;
|
||||
if (npc.ai[3] == 0f)
|
||||
{
|
||||
if (npc.ai[2] > 120f)
|
||||
{
|
||||
npc.ai[2] = 0f;
|
||||
npc.ai[3] = 1f;
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (npc.ai[2] > 40f)
|
||||
npc.ai[3] = 0f;
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == 20f)
|
||||
{
|
||||
float num151 = 5f;
|
||||
int num152 = 60;
|
||||
int num153 = mod.ProjectileType("PhantomHookShot");
|
||||
num149 = num151 / num149;
|
||||
num147 *= num149;
|
||||
num148 *= num149;
|
||||
Projectile.NewProjectile(vector17.X, vector17.Y, num147, num148, num153, num152, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Phase 1 or 3
|
||||
phase2 = false;
|
||||
Movement(phase2, Main.expertMode, CalamityWorld.revenge, speedBoost1, despawnBoost, lifeRatio);
|
||||
}
|
||||
|
||||
private void Movement(bool phase2, bool expertMode, bool revenge, bool speedBoost1, bool despawnBoost, float lifeRatio)
|
||||
{
|
||||
if (phase2)
|
||||
{
|
||||
Vector2 vector92 = new Vector2(npc.Center.X, npc.Center.Y);
|
||||
float num740 = Main.player[npc.target].Center.X - vector92.X;
|
||||
float num741 = Main.player[npc.target].Center.Y - vector92.Y;
|
||||
npc.rotation = (float)Math.Atan2((double)num741, (double)num740) + 1.57f;
|
||||
}
|
||||
|
||||
if (Main.netMode == NetmodeID.MultiplayerClient)
|
||||
{
|
||||
if (npc.ai[0] == 0f)
|
||||
npc.ai[0] = (float)((int)(npc.Center.X / 16f));
|
||||
if (npc.ai[1] == 0f)
|
||||
npc.ai[1] = (float)((int)(npc.Center.X / 16f));
|
||||
}
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
if (npc.ai[0] == 0f || npc.ai[1] == 0f)
|
||||
npc.localAI[0] = 0f;
|
||||
|
||||
npc.localAI[0] -= 1f + (2f * (1f - lifeRatio));
|
||||
if (speedBoost1)
|
||||
npc.localAI[0] -= 6f;
|
||||
if (CalamityWorld.death)
|
||||
npc.localAI[0] -= 0.5f;
|
||||
|
||||
if (!despawnBoost && npc.localAI[0] <= 0f && npc.ai[0] != 0f)
|
||||
{
|
||||
for (int num763 = 0; num763 < 200; num763++)
|
||||
{
|
||||
if (num763 != npc.whoAmI && Main.npc[num763].active && Main.npc[num763].type == npc.type && (Main.npc[num763].velocity.X != 0f || Main.npc[num763].velocity.Y != 0f))
|
||||
npc.localAI[0] = (float)Main.rand.Next(30, 121);
|
||||
}
|
||||
}
|
||||
|
||||
if (npc.localAI[0] <= 0f)
|
||||
{
|
||||
npc.localAI[0] = (float)Main.rand.Next(150, 301);
|
||||
bool flag50 = false;
|
||||
int num764 = 0;
|
||||
while (!flag50 && num764 <= 1000)
|
||||
{
|
||||
num764++;
|
||||
int num765 = (int)(Main.player[Main.npc[CalamityGlobalNPC.ghostBoss].target].Center.X / 16f);
|
||||
int num766 = (int)(Main.player[Main.npc[CalamityGlobalNPC.ghostBoss].target].Center.Y / 16f);
|
||||
if (npc.ai[0] == 0f)
|
||||
{
|
||||
num765 = (int)((Main.player[Main.npc[CalamityGlobalNPC.ghostBoss].target].Center.X + Main.npc[CalamityGlobalNPC.ghostBoss].Center.X) / 32f);
|
||||
num766 = (int)((Main.player[Main.npc[CalamityGlobalNPC.ghostBoss].target].Center.Y + Main.npc[CalamityGlobalNPC.ghostBoss].Center.Y) / 32f);
|
||||
}
|
||||
if (despawnBoost)
|
||||
{
|
||||
num765 = (int)Main.npc[CalamityGlobalNPC.ghostBoss].position.X / 16;
|
||||
num766 = (int)(Main.npc[CalamityGlobalNPC.ghostBoss].position.Y + 400f) / 16;
|
||||
}
|
||||
int num767 = 20;
|
||||
num767 += (int)(100f * ((float)num764 / 1000f));
|
||||
int num768 = num765 + Main.rand.Next(-num767, num767 + 1);
|
||||
int num769 = num766 + Main.rand.Next(-num767, num767 + 1);
|
||||
try
|
||||
{
|
||||
if (WorldGen.SolidTile(num768, num769) || Main.tile[num768, num769].wall > 0)
|
||||
{
|
||||
flag50 = true;
|
||||
npc.ai[0] = (float)num768;
|
||||
npc.ai[1] = (float)num769;
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (npc.ai[0] > 0f && npc.ai[1] > 0f)
|
||||
{
|
||||
float velocity = 8f + (2f * (1f - lifeRatio));
|
||||
if (expertMode)
|
||||
velocity += 1f;
|
||||
if (revenge)
|
||||
velocity += 1f;
|
||||
if (CalamityWorld.death)
|
||||
velocity += 1f;
|
||||
if (speedBoost1)
|
||||
velocity *= 2f;
|
||||
if (despawnBoost)
|
||||
velocity *= 2f;
|
||||
|
||||
Vector2 vector95 = new Vector2(npc.Center.X, npc.Center.Y);
|
||||
float num773 = npc.ai[0] * 16f - 8f - vector95.X;
|
||||
float num774 = npc.ai[1] * 16f - 8f - vector95.Y;
|
||||
float num775 = (float)Math.Sqrt((double)(num773 * num773 + num774 * num774));
|
||||
if (num775 < 12f + velocity)
|
||||
{
|
||||
npc.velocity.X = num773;
|
||||
npc.velocity.Y = num774;
|
||||
}
|
||||
else
|
||||
{
|
||||
num775 = velocity / num775;
|
||||
npc.velocity.X = num773 * num775;
|
||||
npc.velocity.Y = num774 * num775;
|
||||
}
|
||||
|
||||
if (!phase2)
|
||||
{
|
||||
Vector2 vector96 = new Vector2(npc.Center.X, npc.Center.Y);
|
||||
float num776 = Main.npc[CalamityGlobalNPC.ghostBoss].Center.X - vector96.X;
|
||||
float num777 = Main.npc[CalamityGlobalNPC.ghostBoss].Center.Y - vector96.Y;
|
||||
npc.rotation = (float)Math.Atan2((double)num777, (double)num776) - 1.57f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void FindFrame(int frameHeight)
|
||||
{
|
||||
if (phase2)
|
||||
{
|
||||
if (npc.ai[3] == 0f)
|
||||
{
|
||||
if (npc.frame.Y < 1)
|
||||
{
|
||||
npc.frameCounter += 1.0;
|
||||
if (npc.frameCounter > 4.0)
|
||||
{
|
||||
npc.frameCounter = 0.0;
|
||||
npc.frame.Y = npc.frame.Y + frameHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (npc.frame.Y > 0)
|
||||
{
|
||||
npc.frameCounter += 1.0;
|
||||
if (npc.frameCounter > 4.0)
|
||||
{
|
||||
npc.frameCounter = 0.0;
|
||||
npc.frame.Y = npc.frame.Y - frameHeight;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (npc.velocity.X == 0f && npc.velocity.Y == 0f)
|
||||
if (phase2)
|
||||
{
|
||||
if (npc.ai[3] == 0f)
|
||||
{
|
||||
if (npc.frame.Y < 1)
|
||||
{
|
||||
npc.frameCounter += 1.0;
|
||||
if (npc.frameCounter > 4.0)
|
||||
{
|
||||
npc.frameCounter = 0.0;
|
||||
npc.frame.Y = npc.frame.Y + frameHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (npc.frame.Y > 0)
|
||||
{
|
||||
npc.frameCounter += 1.0;
|
||||
if (npc.frameCounter > 4.0)
|
||||
{
|
||||
npc.frameCounter = 0.0;
|
||||
npc.frame.Y = npc.frame.Y - frameHeight;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (npc.velocity.X == 0f && npc.velocity.Y == 0f)
|
||||
{
|
||||
if (npc.frame.Y < 1)
|
||||
{
|
||||
@@ -433,7 +341,7 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
center.Y += bossCenterY;
|
||||
bossCenterX = Main.npc[CalamityGlobalNPC.ghostBoss].Center.X - center.X;
|
||||
bossCenterY = Main.npc[CalamityGlobalNPC.ghostBoss].Center.Y - center.Y;
|
||||
Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)center.X / 16, (int)(center.Y / 16f));
|
||||
Microsoft.Xna.Framework.Color color2 = new Color(100, 100, 100, 0);
|
||||
Main.spriteBatch.Draw(mod.GetTexture("NPCs/Polterghast/PolterghastChain"), new Vector2(center.X - Main.screenPosition.X, center.Y - Main.screenPosition.Y),
|
||||
new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, mod.GetTexture("NPCs/Polterghast/PolterghastChain").Width, chainWidth)), color2, rotation2,
|
||||
new Vector2((float)mod.GetTexture("NPCs/Polterghast/PolterghastChain").Width * 0.5f, (float)mod.GetTexture("NPCs/Polterghast/PolterghastChain").Height * 0.5f), 1f, SpriteEffects.None, 0f);
|
||||
@@ -455,8 +363,8 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
if (CalamityWorld.revenge)
|
||||
player.AddBuff(mod.BuffType("Horror"), 180, true);
|
||||
if (CalamityWorld.revenge)
|
||||
player.AddBuff(mod.BuffType("Horror"), 180, true);
|
||||
}
|
||||
|
||||
public override void ScaleExpertStats(int numPlayers, float bossLifeScale)
|
||||
|
||||
@@ -11,8 +11,6 @@ using Terraria.ModLoader;
|
||||
using CalamityMod.World;
|
||||
using CalamityMod.Utilities;
|
||||
|
||||
/*Possibly add in a final phase for AI 2 that is similar to Sif's final phase in Dark Souls*/
|
||||
|
||||
namespace CalamityMod.NPCs.Yharon
|
||||
{
|
||||
[AutoloadBossHead]
|
||||
|
||||
@@ -78,7 +78,6 @@ namespace CalamityMod.Projectiles.Magic
|
||||
num438 *= num440;
|
||||
num439 *= num440;
|
||||
Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("BloodBolt"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Magic
|
||||
if (projectile.localAI[1] >= 29f && projectile.owner == Main.myPlayer)
|
||||
{
|
||||
projectile.localAI[1] = 0f;
|
||||
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X * 0.35f, projectile.velocity.Y * 0.35f, mod.ProjectileType("BloodOrb"), (int)((double)projectile.damage * 0.6f), projectile.knockBack, projectile.owner, 0f, 0f);
|
||||
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X * 0.35f, projectile.velocity.Y * 0.35f, mod.ProjectileType("BloodOrb"), (int)((double)projectile.damage * 0.6), projectile.knockBack, projectile.owner, 0f, 0f);
|
||||
}
|
||||
projectile.localAI[0] += 1f;
|
||||
if (projectile.localAI[0] > 9f)
|
||||
|
||||
@@ -81,7 +81,6 @@ namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("NightBolt"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Magic
|
||||
if (projectile.localAI[1] >= 29f && projectile.owner == Main.myPlayer)
|
||||
{
|
||||
projectile.localAI[1] = 0f;
|
||||
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X * 0.35f, projectile.velocity.Y * 0.35f, mod.ProjectileType("NightOrb"), (int)((double)projectile.damage * 0.6f), projectile.knockBack, projectile.owner, 0f, 0f);
|
||||
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X * 0.35f, projectile.velocity.Y * 0.35f, mod.ProjectileType("NightOrb"), (int)((double)projectile.damage * 0.6), projectile.knockBack, projectile.owner, 0f, 0f);
|
||||
}
|
||||
projectile.localAI[0] += 1f;
|
||||
if (projectile.localAI[0] > 9f)
|
||||
|
||||
@@ -63,7 +63,6 @@ namespace CalamityMod.Projectiles.Melee
|
||||
projectile.position = projectile.Center;
|
||||
projectile.width = (projectile.height = (int)(52f * projectile.scale));
|
||||
projectile.Center = projectile.position;
|
||||
projectile.Damage();
|
||||
Main.PlaySound(SoundID.Item14, projectile.position);
|
||||
for (int num991 = 0; num991 < 4; num991 = num3 + 1)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user