1 - Living Dew doesn't require Bee Wax so that it can actually be used on Queen Bee.

2 - Bloodstone Cores only require 1 blood orb each instead of 2.
3 - Made Cnidrion projectile damage the same for each of its attacks.
4 - Improved more boss player targeting code.
5 - Destroyer fires lasers on a non-random timer like Astrum Deus.
6 - Martian Saucer Core hitbox is now twice the size.
7 - Wizard sells Magnet Sphere post-Golem.
This commit is contained in:
Andrew Marheine committed 2020-12-17 17:08:28 -06:00
1 parent 4592754ab1
commit ad027e5d6e
8 files changed
+470 -299

No files matched your search

-1
View File
@@ -39,7 +39,6 @@ namespace CalamityMod.Items.Accessories
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.Vine, 2);
recipe.AddIngredient(ModContent.ItemType<MurkyPaste>(), 5);
recipe.AddIngredient(ItemID.BeeWax, 10);
recipe.AddIngredient(ItemID.Bezoar);
recipe.AddTile(TileID.Anvils);
recipe.SetResult(this);
+1 -1
View File
@@ -25,7 +25,7 @@ namespace CalamityMod.Items.Materials
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModContent.ItemType<Bloodstone>(), 5);
recipe.AddIngredient(ModContent.ItemType<BloodOrb>(), 2);
recipe.AddIngredient(ModContent.ItemType<BloodOrb>());
recipe.AddIngredient(ModContent.ItemType<Phantoplasm>());
recipe.AddTile(TileID.AdamantiteForge);
recipe.SetResult(this, 2);
+105 -62
View File
@@ -72,8 +72,12 @@ namespace CalamityMod.NPCs
npc.realLife = (int)npc.ai[3];
// Get a target
if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active)
npc.TargetClosest(true);
if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active)
npc.TargetClosest();
// Despawn safety, make sure to target another player if the current player target is too far away
if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles)
npc.TargetClosest();
Player player = Main.player[npc.target];
@@ -151,10 +155,10 @@ namespace CalamityMod.NPCs
// Reset and charge at target
if (calamityGlobalNPC.newAI[3] >= ai3 + 120f)
{
npc.TargetClosest(true);
calamityGlobalNPC.newAI[3] = 0f;
float chargeVelocity = (BossRushEvent.BossRushActive ? 24f : death ? 16f : 12f) + 3f * enrageScale;
npc.velocity = Vector2.Normalize(player.Center - npc.Center) * chargeVelocity;
npc.TargetClosest();
}
}
else
@@ -257,7 +261,7 @@ namespace CalamityMod.NPCs
if (npc.localAI[0] >= Main.rand.Next(700, 10001))
{
npc.localAI[0] = 0f;
npc.TargetClosest(true);
npc.TargetClosest();
if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height))
{
Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 17);
@@ -284,7 +288,7 @@ namespace CalamityMod.NPCs
if (npc.localAI[0] >= Main.rand.Next(700, 10001))
{
npc.localAI[0] = 0f;
npc.TargetClosest(true);
npc.TargetClosest();
if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height))
{
Vector2 vector104 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + (npc.height / 2));
@@ -578,8 +582,12 @@ namespace CalamityMod.NPCs
Vector2 vectorCenter = npc.Center;
// Get a target
if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active)
npc.TargetClosest(true);
if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active)
npc.TargetClosest();
// Despawn safety, make sure to target another player if the current player target is too far away
if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles)
npc.TargetClosest();
Player player = Main.player[npc.target];
@@ -719,7 +727,7 @@ namespace CalamityMod.NPCs
npc.localAI[1] += 1f;
if (npc.localAI[1] >= (BossRushEvent.BossRushActive ? 90f : death ? 150f : 180f))
{
npc.TargetClosest(true);
npc.TargetClosest();
npc.localAI[1] = 0f;
int timer = 0;
int playerPosX;
@@ -937,7 +945,7 @@ namespace CalamityMod.NPCs
if (npc.ai[1] >= divisor * 10f)
{
npc.TargetClosest(true);
npc.TargetClosest();
npc.ai[0] = -1f;
npc.ai[1] = 3f;
npc.ai[2] = 0f;
@@ -1013,7 +1021,7 @@ namespace CalamityMod.NPCs
npc.ai[1] += 1f;
if (npc.ai[1] >= (death ? 240f : 300f))
{
npc.TargetClosest(true);
npc.TargetClosest();
npc.ai[0] = -1f;
npc.ai[1] = 4f;
npc.ai[2] = 0f;
@@ -1050,7 +1058,7 @@ namespace CalamityMod.NPCs
npc.ai[1] += 1f;
if (npc.ai[1] >= 240f)
{
npc.TargetClosest(true);
npc.TargetClosest();
npc.ai[2] += 1f;
npc.localAI[0] = 0f;
npc.localAI[1] = 0f;
@@ -1253,8 +1261,12 @@ namespace CalamityMod.NPCs
}
// Get a target
if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active)
npc.TargetClosest(true);
if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active)
npc.TargetClosest();
// Despawn safety, make sure to target another player if the current player target is too far away
if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles)
npc.TargetClosest();
// Target variable
Player player = Main.player[npc.target];
@@ -1406,7 +1418,7 @@ namespace CalamityMod.NPCs
{
npc.ai[1] = 1f;
npc.ai[2] = 0f;
npc.TargetClosest(true);
npc.TargetClosest();
npc.netUpdate = true;
}
@@ -1622,7 +1634,7 @@ namespace CalamityMod.NPCs
{
npc.ai[1] = phase2 && !brotherAlive && lifeRatio < 0.7f && revenge ? 4f : 0f;
npc.ai[2] = 0f;
npc.TargetClosest(true);
npc.TargetClosest();
npc.netUpdate = true;
}
}
@@ -1664,8 +1676,8 @@ namespace CalamityMod.NPCs
{
npc.ai[3] += 1f;
npc.ai[2] = 0f;
npc.target = 255;
npc.rotation = num803;
npc.TargetClosest();
npc.netUpdate = true;
if (npc.ai[3] >= 2f)
{
@@ -1741,7 +1753,7 @@ namespace CalamityMod.NPCs
npc.ai[2] += 1f;
if (npc.ai[2] >= 45f)
{
npc.TargetClosest(true);
npc.TargetClosest();
npc.ai[1] = 2f;
npc.ai[2] = 0f;
npc.netUpdate = true;
@@ -1768,8 +1780,13 @@ namespace CalamityMod.NPCs
bool expertMode = Main.expertMode || BossRushEvent.BossRushActive;
bool provy = CalamityWorld.downedProvidence && !BossRushEvent.BossRushActive;
if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active)
npc.TargetClosest(true);
// Get a target
if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active)
npc.TargetClosest();
// Despawn safety, make sure to target another player if the current player target is too far away
if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles)
npc.TargetClosest();
Player player = Main.player[npc.target];
@@ -1919,7 +1936,7 @@ namespace CalamityMod.NPCs
npc.ai[2] += (calamityGlobalNPC.enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && BossRushEvent.BossRushActive)) ? 2f : 1f;
if (npc.ai[2] >= (240f - (death ? 120f * (1f - lifeRatio) : 0f)))
{
npc.TargetClosest(true);
npc.TargetClosest();
npc.ai[1] = 1f;
npc.ai[2] = 0f;
npc.target = 255;
@@ -2027,6 +2044,7 @@ namespace CalamityMod.NPCs
npc.ai[2] = 0f;
npc.target = 255;
npc.rotation = num842;
npc.TargetClosest();
if (npc.ai[3] >= 3f)
{
npc.ai[1] = 0f;
@@ -2058,8 +2076,13 @@ namespace CalamityMod.NPCs
bool expertMode = Main.expertMode || BossRushEvent.BossRushActive;
bool provy = CalamityWorld.downedProvidence && !BossRushEvent.BossRushActive;
if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active)
npc.TargetClosest(true);
// Get a target
if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active)
npc.TargetClosest();
// Despawn safety, make sure to target another player if the current player target is too far away
if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles)
npc.TargetClosest();
Player player = Main.player[npc.target];
@@ -2209,7 +2232,7 @@ namespace CalamityMod.NPCs
npc.ai[2] += (calamityGlobalNPC.enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && BossRushEvent.BossRushActive)) ? 2f : 1f;
if (npc.ai[2] >= (180f - (death ? 90f * (1f - lifeRatio) : 0f)))
{
npc.TargetClosest(true);
npc.TargetClosest();
npc.ai[1] = 1f;
npc.ai[2] = 0f;
npc.target = 255;
@@ -2315,7 +2338,7 @@ namespace CalamityMod.NPCs
{
npc.ai[3] += 1f;
npc.ai[2] = 0f;
npc.target = 255;
npc.TargetClosest();
npc.rotation = num842;
if (npc.ai[3] >= 4f)
{
@@ -2359,8 +2382,12 @@ namespace CalamityMod.NPCs
enrageScale = 0f;
// Get a target
if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active)
npc.TargetClosest(true);
if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active)
npc.TargetClosest();
// Despawn safety, make sure to target another player if the current player target is too far away
if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles)
npc.TargetClosest();
Player player = Main.player[npc.target];
@@ -2512,7 +2539,7 @@ namespace CalamityMod.NPCs
npc.noTileCollide = true;
// Set AI to next phase (Walk) and reset other AI
npc.TargetClosest(true);
npc.TargetClosest();
npc.ai[0] = 2f;
npc.ai[1] = 0f;
npc.netUpdate = true;
@@ -2593,7 +2620,7 @@ namespace CalamityMod.NPCs
npc.noTileCollide = false;
// Set AI to next phase (Jump) and reset other AI
npc.TargetClosest(true);
npc.TargetClosest();
npc.ai[0] = 3f;
npc.ai[1] = 0f;
npc.netUpdate = true;
@@ -2671,7 +2698,7 @@ namespace CalamityMod.NPCs
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/LegStomp"), (int)npc.position.X, (int)npc.position.Y);
// Stomp and jump again, if stomped twice then reset and set AI to next phase (Teleport or Idle)
npc.TargetClosest(true);
npc.TargetClosest();
npc.ai[2] += 1f;
float maxStompAmt = death ? 2f : 3f;
if (npc.ai[2] >= maxStompAmt)
@@ -2807,7 +2834,7 @@ namespace CalamityMod.NPCs
NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y - 25, ModContent.NPCType<AureusSpawn>());
// Reset localAI and find a teleport destination
npc.TargetClosest(true);
npc.TargetClosest();
npc.localAI[1] = 0f;
int num1249 = 0;
int num1250;
@@ -2976,14 +3003,18 @@ namespace CalamityMod.NPCs
calamityGlobalNPC.newAI[1] += 1f;
// Get a target
if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active)
npc.TargetClosest(true);
if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active)
npc.TargetClosest();
Player player = Main.player[npc.target];
bool increaseSpeed = Vector2.Distance(player.Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles;
bool increaseSpeedMore = Vector2.Distance(player.Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance350Tiles;
// Despawn safety, make sure to target another player if the current player target is too far away
if (increaseSpeedMore && head)
npc.TargetClosest();
// Inflict Extreme Gravity to nearby players
if (revenge)
{
@@ -3385,9 +3416,7 @@ namespace CalamityMod.NPCs
if (!flag2)
{
npc.TargetClosest(true);
npc.velocity.Y += 0.15f;
if (npc.velocity.Y > fallSpeed)
npc.velocity.Y = fallSpeed;
@@ -3566,7 +3595,7 @@ namespace CalamityMod.NPCs
{
if (npc.localAI[0] % divisor == 0f && npc.ai[0] % 2f == 0f)
{
npc.TargetClosest(true);
npc.TargetClosest();
if (Vector2.Distance(player.Center, npc.Center) > 80f)
{
Main.PlaySound(SoundID.Item12, npc.Center);
@@ -3668,7 +3697,12 @@ namespace CalamityMod.NPCs
Vector2 vector = npc.Center;
// Get a target
npc.TargetClosest(true);
if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active)
npc.TargetClosest();
// Despawn safety, make sure to target another player if the current player target is too far away
if (Vector2.Distance(Main.player[npc.target].Center, vector) > CalamityGlobalNPC.CatchUpDistance200Tiles)
npc.TargetClosest();
Player player = Main.player[npc.target];
@@ -3812,6 +3846,7 @@ namespace CalamityMod.NPCs
if (calamityGlobalNPC.newAI[1] >= 600f * projectileFireRateMultiplier)
{
npc.TargetClosest();
calamityGlobalNPC.newAI[1] = 0f;
if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height))
{
@@ -3948,8 +3983,12 @@ namespace CalamityMod.NPCs
npc.Calamity().canBreakPlayerDefense = false;
// Get a target
if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active)
npc.TargetClosest(true);
if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active)
npc.TargetClosest();
// Despawn safety, make sure to target another player if the current player target is too far away
if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles)
npc.TargetClosest();
Player player = Main.player[npc.target];
@@ -4167,7 +4206,7 @@ namespace CalamityMod.NPCs
value51.Y -= 200f;
if (value51.Length() > 2800f)
{
npc.TargetClosest(true);
npc.TargetClosest();
npc.ai[0] = 1f;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
@@ -4203,7 +4242,7 @@ namespace CalamityMod.NPCs
if (npc.localAI[0] >= (phase3 ? 7 : 9) && canHit)
{
npc.TargetClosest(true);
npc.TargetClosest();
npc.ai[0] = 5f;
npc.localAI[0] = 0f;
@@ -4227,7 +4266,7 @@ namespace CalamityMod.NPCs
if (num1307 == 0 && canHit && npc.localAI[3] == 0f)
{
npc.TargetClosest(true);
npc.TargetClosest();
npc.ai[0] = 2f;
// Decrease enraged attacks by 1
@@ -4239,7 +4278,7 @@ namespace CalamityMod.NPCs
}
else if (num1307 == 1)
{
npc.TargetClosest(true);
npc.TargetClosest();
npc.ai[0] = 3f;
// Decrease enraged attacks by 1
@@ -4266,7 +4305,7 @@ namespace CalamityMod.NPCs
}
else if (NPC.CountNPCS(ModContent.NPCType<Bumblefuck2>()) < maxBirbs && npc.localAI[3] == 0f)
{
npc.TargetClosest(true);
npc.TargetClosest();
npc.ai[0] = 4f;
// Birb will do at least 2 different attacks before entering this phase again
@@ -4310,7 +4349,7 @@ namespace CalamityMod.NPCs
Vector2 value52 = player.Center - npc.Center;
if (value52.Length() < 800f && !Collision.SolidCollision(npc.position, npc.width, npc.height))
{
npc.TargetClosest(true);
npc.TargetClosest();
npc.ai[0] = 0f;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
@@ -4335,7 +4374,7 @@ namespace CalamityMod.NPCs
{
if (npc.target < 0 || !player.active || player.dead)
{
npc.TargetClosest(true);
npc.TargetClosest();
npc.ai[0] = 0f;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
@@ -4383,7 +4422,7 @@ namespace CalamityMod.NPCs
npc.ai[1] += 1f;
if (npc.ai[1] >= 120f || !Collision.CanHit(npc.Center, 1, 1, player.Center, 1, 1))
{
npc.TargetClosest(true);
npc.TargetClosest();
npc.ai[0] = 0f;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
@@ -4481,7 +4520,7 @@ namespace CalamityMod.NPCs
{
if (!Collision.SolidCollision(npc.position, npc.width, npc.height))
{
npc.TargetClosest(true);
npc.TargetClosest();
npc.ai[0] = 0f;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
@@ -4489,7 +4528,7 @@ namespace CalamityMod.NPCs
}
else if (Math.Abs(npc.Center.X - player.Center.X) > chargeDistance + 200f)
{
npc.TargetClosest(true);
npc.TargetClosest();
npc.ai[0] = 1f;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
@@ -4567,6 +4606,7 @@ namespace CalamityMod.NPCs
npc.ai[0] = 0f;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.TargetClosest();
}
}
@@ -4716,21 +4756,24 @@ namespace CalamityMod.NPCs
int num16 = 75;
Vector2 vector = npc.Center;
Player player = Main.player[npc.target];
// Get target
if (npc.target < 0 || npc.target == 255 || player.dead || !player.active)
{
npc.TargetClosest(true);
npc.TargetClosest();
player = Main.player[npc.target];
npc.netUpdate = true;
}
// Despawn safety, make sure to target another player if the current player target is too far away
if (Vector2.Distance(player.Center, vector) > CalamityGlobalNPC.CatchUpDistance200Tiles)
npc.TargetClosest();
// Despawn
if (player.dead || Vector2.Distance(player.Center, vector) > 8800f)
{
npc.TargetClosest(true);
npc.TargetClosest();
npc.velocity.Y -= 0.4f;
@@ -5064,7 +5107,7 @@ namespace CalamityMod.NPCs
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.ai[3] += 2f;
npc.TargetClosest(true);
npc.TargetClosest();
npc.netUpdate = true;
}
}
@@ -5112,7 +5155,7 @@ namespace CalamityMod.NPCs
npc.ai[0] = 0f;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.TargetClosest(true);
npc.TargetClosest();
npc.netUpdate = true;
}
}
@@ -5146,7 +5189,7 @@ namespace CalamityMod.NPCs
npc.ai[0] = 0f;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.TargetClosest(true);
npc.TargetClosest();
npc.netUpdate = true;
}
}
@@ -5182,7 +5225,7 @@ namespace CalamityMod.NPCs
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.ai[3] = 0f;
npc.TargetClosest(true);
npc.TargetClosest();
npc.netUpdate = true;
}
}
@@ -5336,7 +5379,7 @@ namespace CalamityMod.NPCs
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.ai[3] += 2f;
npc.TargetClosest(true);
npc.TargetClosest();
npc.netUpdate = true;
}
}
@@ -5385,7 +5428,7 @@ namespace CalamityMod.NPCs
npc.ai[0] = 5f;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.TargetClosest(true);
npc.TargetClosest();
npc.netUpdate = true;
}
}
@@ -5435,7 +5478,7 @@ namespace CalamityMod.NPCs
npc.ai[0] = 5f;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.TargetClosest(true);
npc.TargetClosest();
npc.netUpdate = true;
}
}
@@ -5471,7 +5514,7 @@ namespace CalamityMod.NPCs
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.ai[3] = 0f;
npc.TargetClosest(true);
npc.TargetClosest();
npc.netUpdate = true;
}
}
@@ -5637,7 +5680,7 @@ namespace CalamityMod.NPCs
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.ai[3] += 2f;
npc.TargetClosest(true);
npc.TargetClosest();
npc.netUpdate = true;
}
}
@@ -5753,7 +5796,7 @@ namespace CalamityMod.NPCs
npc.ai[0] = 10f;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.TargetClosest(true);
npc.TargetClosest();
npc.netUpdate = true;
}
}
@@ -5802,7 +5845,7 @@ namespace CalamityMod.NPCs
npc.ai[0] = 10f;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.TargetClosest(true);
npc.TargetClosest();
npc.netUpdate = true;
}
}
+299 -165
View File
File diff suppressed because it is too large. Load diff
+41 -52
View File
@@ -1230,6 +1230,13 @@ namespace CalamityMod.NPCs
npc.damage = 0;
}
// Make Core hitbox bigger
if (npc.type == NPCID.MartianSaucerCore)
{
npc.width *= 2;
npc.height *= 2;
}
if (npc.type == NPCID.CultistBoss)
{
npc.lifeMax = (int)(npc.lifeMax * (CalamityWorld.revenge ? 2 : 1.2));
@@ -3751,7 +3758,7 @@ namespace CalamityMod.NPCs
{
if (npc.type == NPCID.SkeletronPrime)
{
npc.frameCounter = 0.0;
npc.frameCounter = 0D;
}
}
}
@@ -4260,7 +4267,7 @@ namespace CalamityMod.NPCs
if (CalamityWorld.revenge || BossRushEvent.BossRushActive)
{
if (npc.type == NPCID.SkeletronPrime)
if (npc.type == NPCID.SkeletronPrime || DestroyerIDs.Contains(npc.type))
{
return false;
}
@@ -4321,50 +4328,8 @@ namespace CalamityMod.NPCs
{
if (CalamityWorld.revenge || BossRushEvent.BossRushActive)
{
if (npc.type == NPCID.GolemHeadFree || npc.type == NPCID.GolemHead)
{
Texture2D npcTexture = Main.npcTexture[npc.type];
int frameHeight = npcTexture.Height / Main.npcFrameCount[npc.type];
SpriteEffects spriteEffects = SpriteEffects.None;
if (npc.spriteDirection == 1)
spriteEffects = SpriteEffects.FlipHorizontally;
if (npc.type == NPCID.GolemHead)
{
if (npc.ai[0] == 0f)
{
if (npc.localAI[0] == 1f)
npc.frame.Y = frameHeight;
else
npc.frame.Y = 0;
}
else if (npc.ai[0] == 1f)
{
if (npc.localAI[0] == 1f)
npc.frame.Y = frameHeight;
else
npc.frame.Y = 0;
if (npc.localAI[1] == -1f)
npc.frame.Y += frameHeight * 4;
if (npc.localAI[1] == 1f)
npc.frame.Y += frameHeight * 2;
}
}
else
{
if (npc.localAI[0] == 1f)
npc.frame.Y = frameHeight;
else
npc.frame.Y = 0;
}
spriteBatch.Draw(npcTexture, npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), npc.frame, npc.GetAlpha(drawColor), npc.rotation, npc.frame.Size() / 2, npc.scale, spriteEffects, 0);
}
// His afterimages I can't get to work, so fuck it
else if (npc.type == NPCID.SkeletronPrime)
// His afterimages I can't get to work, so fuck it
if (npc.type == NPCID.SkeletronPrime)
{
Texture2D npcTexture = Main.npcTexture[npc.type];
int frameHeight = npcTexture.Height / Main.npcFrameCount[npc.type];
@@ -4405,24 +4370,48 @@ namespace CalamityMod.NPCs
if (npc.spriteDirection == 1)
spriteEffects = SpriteEffects.FlipHorizontally;
spriteBatch.Draw(npcTexture, npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), npc.frame, npc.GetAlpha(drawColor), npc.rotation, npc.frame.Size() / 2, npc.scale, spriteEffects, 0);
spriteBatch.Draw(npcTexture, npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), npc.frame, npc.GetAlpha(drawColor), npc.rotation, npc.frame.Size() / 2, npc.scale, spriteEffects, 0f);
spriteBatch.Draw(Main.BoneEyesTexture, npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY),
npc.frame, new Color(200, 200, 200, 0), npc.rotation, npc.frame.Size() / 2, npc.scale, spriteEffects, 0);
npc.frame, new Color(200, 200, 200, 0), npc.rotation, npc.frame.Size() / 2, npc.scale, spriteEffects, 0f);
}
else if (DestroyerIDs.Contains(npc.type))
{
if (drawColor != Color.Black && npc.ai[2] == 0f && ((newAI[3] >= 900f && npc.life / (float)npc.lifeMax < 0.5f) || (newAI[1] < 600f && newAI[1] > 60f)))
if (drawColor != Color.Black)
{
Texture2D npcTexture = Main.npcTexture[npc.type];
int frameHeight = npcTexture.Height / Main.npcFrameCount[npc.type];
Vector2 halfSize = npc.frame.Size() / 2;
SpriteEffects spriteEffects = SpriteEffects.None;
if (npc.spriteDirection == 1)
spriteEffects = SpriteEffects.FlipHorizontally;
for (int i = 0; i < 3; i++)
if (npc.type == NPCID.TheDestroyerBody)
{
spriteBatch.Draw(Main.destTexture[npc.type - NPCID.TheDestroyer], npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), npc.frame,
new Color(0, 0, 255, 0) * (1f - npc.alpha / 255f), npc.rotation, halfSize, npc.scale, spriteEffects, 0f);
if (npc.ai[2] == 0f)
npc.frame.Y = 0;
else
npc.frame.Y = frameHeight;
}
// Draw segments
spriteBatch.Draw(npcTexture, npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY),
npc.frame, npc.GetAlpha(drawColor), npc.rotation, halfSize, npc.scale, spriteEffects, 0f);
// Draw lights
if (npc.ai[2] == 0f)
{
if ((newAI[3] >= 900f && npc.life / (float)npc.lifeMax < 0.5f) || (newAI[1] < 600f && newAI[1] > 60f))
{
spriteBatch.Draw(Main.destTexture[npc.type - NPCID.TheDestroyer], npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), npc.frame,
new Color(50, 50, 255, 0) * (1f - npc.alpha / 255f), npc.rotation, halfSize, npc.scale, spriteEffects, 0f);
}
else
{
spriteBatch.Draw(Main.destTexture[npc.type - NPCID.TheDestroyer], npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), npc.frame,
new Color(255, 255, 255, 0) * (1f - npc.alpha / 255f), npc.rotation, halfSize, npc.scale, spriteEffects, 0f);
}
}
}
}
+1 -1
View File
@@ -134,7 +134,6 @@ namespace CalamityMod.NPCs
};
#endregion
#region Town NPC Names
public static void ResetTownNPCNameBools(NPC npc, Mod mod)
{
@@ -1270,6 +1269,7 @@ namespace CalamityMod.NPCs
SetShopItem(ref shop, ref nextSlot, ItemID.SpectreStaff, NPC.downedGolemBoss, Item.buyPrice(0, 25));
SetShopItem(ref shop, ref nextSlot, ItemID.InfernoFork, NPC.downedGolemBoss, Item.buyPrice(0, 25));
SetShopItem(ref shop, ref nextSlot, ItemID.ShadowbeamStaff, NPC.downedGolemBoss, Item.buyPrice(0, 25));
SetShopItem(ref shop, ref nextSlot, ItemID.MagnetSphere, NPC.downedGolemBoss, Item.buyPrice(0, 25));
SetShopItem(ref shop, ref nextSlot, ItemID.CelestialSigil, NPC.downedMoonlord && CalamityConfig.Instance.SellVanillaSummons, Item.buyPrice(3));
SetShopItem(ref shop, ref nextSlot, ItemType<ProfanedShard>(), CalamityWorld.downedGuardians, Item.buyPrice(5));
}
+6 -5
View File
@@ -66,7 +66,8 @@ namespace CalamityMod.NPCs.NormalNPCs
npc.TargetClosest(true);
bool flag51 = false;
int offsetX = 80;
if (npc.life < npc.lifeMax * 0.33 || (CalamityWorld.death && npc.life < npc.lifeMax * 0.6))
int projectileDamage = expertMode ? 9 : 12;
if (npc.life < npc.lifeMax * 0.33 || (CalamityWorld.death && npc.life < npc.lifeMax * 0.6))
{
num823 = 2f;
}
@@ -120,7 +121,7 @@ namespace CalamityMod.NPCs.NormalNPCs
num830 *= num831;
num829 *= 1f + Main.rand.Next(-10, 11) * 0.01f;
num830 *= 1f + Main.rand.Next(-10, 11) * 0.01f;
Projectile.NewProjectile(vector18.X, vector18.Y, num829, num830, ModContent.ProjectileType<HorsWaterBlast>(), expertMode ? 8 : 11, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(vector18.X, vector18.Y, num829, num830, ModContent.ProjectileType<HorsWaterBlast>(), projectileDamage, 0f, Main.myPlayer);
}
if (npc.ai[1] >= 120f)
{
@@ -145,7 +146,7 @@ namespace CalamityMod.NPCs.NormalNPCs
num830 *= num831;
num829 *= 1f + Main.rand.Next(-15, 16) * 0.01f;
num830 *= 1f + Main.rand.Next(-15, 16) * 0.01f;
Projectile.NewProjectile(vector18.X, vector18.Y, num829, num830, ModContent.ProjectileType<HorsWaterBlast>(), expertMode ? 9 : 12, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(vector18.X, vector18.Y, num829, num830, ModContent.ProjectileType<HorsWaterBlast>(), projectileDamage, 0f, Main.myPlayer);
}
if (npc.ai[1] >= 300f)
{
@@ -170,7 +171,7 @@ namespace CalamityMod.NPCs.NormalNPCs
num845 *= num846;
num844 *= 1f + Main.rand.Next(-10, 11) * 0.001f;
num845 *= 1f + Main.rand.Next(-10, 11) * 0.001f;
int num848 = Projectile.NewProjectile(vector18.X, vector18.Y, num844, num845, ModContent.ProjectileType<HorsWaterBlast>(), expertMode ? 11 : 14, 0f, Main.myPlayer, 0f, 0f);
int num848 = Projectile.NewProjectile(vector18.X, vector18.Y, num844, num845, ModContent.ProjectileType<HorsWaterBlast>(), projectileDamage, 0f, Main.myPlayer);
}
if (npc.ai[1] >= 120f)
{
@@ -195,7 +196,7 @@ namespace CalamityMod.NPCs.NormalNPCs
num830 *= num831;
num829 *= 1f + Main.rand.Next(-5, 6) * 0.01f;
num830 *= 1f + Main.rand.Next(-5, 6) * 0.01f;
int num833 = Projectile.NewProjectile(vector18.X, vector18.Y, num829, num830, ModContent.ProjectileType<HorsWaterBlast>(), expertMode ? 13 : 17, 0f, Main.myPlayer, 0f, 0f);
int num833 = Projectile.NewProjectile(vector18.X, vector18.Y, num829, num830, ModContent.ProjectileType<HorsWaterBlast>(), projectileDamage, 0f, Main.myPlayer);
}
if (npc.ai[1] >= 240f)
{
+17 -12
View File
@@ -155,13 +155,18 @@ namespace CalamityMod.NPCs.Providence
// Rotation
npc.rotation = npc.velocity.X * 0.004f;
// Target
if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active)
npc.TargetClosest(true);
Vector2 vector = npc.Center;
// Get a target
if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active)
npc.TargetClosest();
// Despawn safety, make sure to target another player if the current player target is too far away
if (Vector2.Distance(Main.player[npc.target].Center, vector) > CalamityGlobalNPC.CatchUpDistance200Tiles)
npc.TargetClosest();
// Target variable and boss center
Player player = Main.player[npc.target];
Vector2 vector = npc.Center;
// Target's current biome
bool isHoly = player.ZoneHoly;
@@ -777,7 +782,7 @@ namespace CalamityMod.NPCs.Providence
if (npc.ai[1] >= phaseTime)
{
AIState = (int)Phase.PhaseChange;
npc.TargetClosest(true);
npc.TargetClosest();
}
break;
@@ -822,7 +827,7 @@ namespace CalamityMod.NPCs.Providence
if (npc.ai[1] >= phaseTime)
{
AIState = (int)Phase.PhaseChange;
npc.TargetClosest(true);
npc.TargetClosest();
}
break;
@@ -977,7 +982,7 @@ namespace CalamityMod.NPCs.Providence
text = false;
AIState = (int)Phase.PhaseChange;
npc.localAI[2] = attackDelayAfterCocoon;
npc.TargetClosest(true);
npc.TargetClosest();
}
break;
@@ -1034,7 +1039,7 @@ namespace CalamityMod.NPCs.Providence
if (npc.ai[1] >= phaseTime)
{
AIState = (int)Phase.PhaseChange;
npc.TargetClosest(true);
npc.TargetClosest();
}
break;
@@ -1079,7 +1084,7 @@ namespace CalamityMod.NPCs.Providence
if (npc.ai[1] >= phaseTime)
{
AIState = (int)Phase.PhaseChange;
npc.TargetClosest(true);
npc.TargetClosest();
}
break;
@@ -1143,7 +1148,7 @@ namespace CalamityMod.NPCs.Providence
{
AIState = (int)Phase.PhaseChange;
npc.localAI[2] = attackDelayAfterCocoon;
npc.TargetClosest(true);
npc.TargetClosest();
}
break;
@@ -1167,7 +1172,7 @@ namespace CalamityMod.NPCs.Providence
if (npc.ai[1] >= crystalPhaseTime + nightCrystalTime || !nightTime)
{
AIState = (int)Phase.PhaseChange;
npc.TargetClosest(true);
npc.TargetClosest();
}
}
@@ -1248,7 +1253,7 @@ namespace CalamityMod.NPCs.Providence
if (npc.ai[1] >= (revenge ? 235f : 315f))
{
AIState = (int)Phase.PhaseChange;
npc.TargetClosest(true);
npc.TargetClosest();
}
break;