More worm bs
This commit is contained in:
1 parent
47125bb22b
commit
2b60a13b94
7 files changed
+47
-119
No files matched your search
@@ -38,8 +38,8 @@ namespace CalamityMod.NPCs.DesertScourge
|
||||
public override void SetDefaults()
|
||||
{
|
||||
NPC.GetNPCDamage();
|
||||
NPC.width = 92;
|
||||
NPC.height = 92;
|
||||
NPC.width = 88;
|
||||
NPC.height = 88;
|
||||
|
||||
NPC.defense = 4;
|
||||
if (Main.getGoodWorld)
|
||||
@@ -195,44 +195,20 @@ namespace CalamityMod.NPCs.DesertScourge
|
||||
if (Main.player[NPC.target].dead)
|
||||
NPC.TargetClosest(false);
|
||||
|
||||
Vector2 segmentTilePos = NPC.Center;
|
||||
float playerXPos = Main.player[NPC.target].Center.X;
|
||||
float playerYPos = Main.player[NPC.target].Center.Y;
|
||||
playerXPos = (float)((int)(playerXPos / 16f) * 16);
|
||||
playerYPos = (float)((int)(playerYPos / 16f) * 16);
|
||||
segmentTilePos.X = (float)((int)(segmentTilePos.X / 16f) * 16);
|
||||
segmentTilePos.Y = (float)((int)(segmentTilePos.Y / 16f) * 16);
|
||||
playerXPos -= segmentTilePos.X;
|
||||
playerYPos -= segmentTilePos.Y;
|
||||
float playerDistance = (float)System.Math.Sqrt((double)(playerXPos * playerXPos + playerYPos * playerYPos));
|
||||
if (NPC.ai[1] > 0f && NPC.ai[1] < (float)Main.npc.Length)
|
||||
NPC aheadSegment = Main.npc[(int)NPC.ai[1]];
|
||||
Vector2 directionToNextSegment = aheadSegment.Center - NPC.Center;
|
||||
if (aheadSegment.rotation != NPC.rotation)
|
||||
{
|
||||
try
|
||||
{
|
||||
segmentTilePos = NPC.Center;
|
||||
playerXPos = Main.npc[(int)NPC.ai[1]].Center.X - segmentTilePos.X;
|
||||
playerYPos = Main.npc[(int)NPC.ai[1]].Center.Y - segmentTilePos.Y;
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
NPC.rotation = (float)System.Math.Atan2((double)playerYPos, (double)playerXPos) + MathHelper.PiOver2;
|
||||
playerDistance = (float)System.Math.Sqrt((double)(playerXPos * playerXPos + playerYPos * playerYPos));
|
||||
|
||||
int segmentOffset = 72;
|
||||
playerDistance = (playerDistance - segmentOffset) / playerDistance;
|
||||
playerXPos *= playerDistance;
|
||||
playerYPos *= playerDistance;
|
||||
NPC.velocity = Vector2.Zero;
|
||||
NPC.position.X = NPC.position.X + playerXPos;
|
||||
NPC.position.Y = NPC.position.Y + playerYPos;
|
||||
|
||||
if (playerXPos < 0f)
|
||||
NPC.spriteDirection = 1;
|
||||
else if (playerXPos > 0f)
|
||||
NPC.spriteDirection = -1;
|
||||
directionToNextSegment = directionToNextSegment.RotatedBy(MathHelper.WrapAngle(aheadSegment.rotation - NPC.rotation) * 0.08f);
|
||||
directionToNextSegment = directionToNextSegment.MoveTowards((aheadSegment.rotation - NPC.rotation).ToRotationVector2(), 1f);
|
||||
}
|
||||
|
||||
// Decide segment offset stuff.
|
||||
int segmentOffset = 66;
|
||||
NPC.rotation = directionToNextSegment.ToRotation() + MathHelper.PiOver2;
|
||||
NPC.Center = aheadSegment.Center - directionToNextSegment.SafeNormalize(Vector2.Zero) * NPC.scale * segmentOffset;
|
||||
NPC.spriteDirection = (directionToNextSegment.X > 0).ToDirectionInt();
|
||||
|
||||
// Calculate contact damage based on velocity
|
||||
float maxChaseSpeed = Main.zenithWorld ? DesertNuisanceHead.SegmentVelocity_ZenithSeed :
|
||||
Main.getGoodWorld ? DesertNuisanceHead.SegmentVelocity_GoodWorld :
|
||||
|
||||
@@ -38,8 +38,8 @@ namespace CalamityMod.NPCs.DesertScourge
|
||||
public override void SetDefaults()
|
||||
{
|
||||
NPC.GetNPCDamage();
|
||||
NPC.width = 76;
|
||||
NPC.height = 76;
|
||||
NPC.width = 78;
|
||||
NPC.height = 78;
|
||||
|
||||
NPC.defense = 4;
|
||||
if (Main.getGoodWorld)
|
||||
@@ -195,44 +195,20 @@ namespace CalamityMod.NPCs.DesertScourge
|
||||
if (Main.player[NPC.target].dead)
|
||||
NPC.TargetClosest(false);
|
||||
|
||||
Vector2 segmentTilePos = NPC.Center;
|
||||
float playerXPos = Main.player[NPC.target].Center.X;
|
||||
float playerYPos = Main.player[NPC.target].Center.Y;
|
||||
playerXPos = (float)((int)(playerXPos / 16f) * 16);
|
||||
playerYPos = (float)((int)(playerYPos / 16f) * 16);
|
||||
segmentTilePos.X = (float)((int)(segmentTilePos.X / 16f) * 16);
|
||||
segmentTilePos.Y = (float)((int)(segmentTilePos.Y / 16f) * 16);
|
||||
playerXPos -= segmentTilePos.X;
|
||||
playerYPos -= segmentTilePos.Y;
|
||||
float playerDistance = (float)System.Math.Sqrt((double)(playerXPos * playerXPos + playerYPos * playerYPos));
|
||||
if (NPC.ai[1] > 0f && NPC.ai[1] < (float)Main.npc.Length)
|
||||
NPC aheadSegment = Main.npc[(int)NPC.ai[1]];
|
||||
Vector2 directionToNextSegment = aheadSegment.Center - NPC.Center;
|
||||
if (aheadSegment.rotation != NPC.rotation)
|
||||
{
|
||||
try
|
||||
{
|
||||
segmentTilePos = NPC.Center;
|
||||
playerXPos = Main.npc[(int)NPC.ai[1]].Center.X - segmentTilePos.X;
|
||||
playerYPos = Main.npc[(int)NPC.ai[1]].Center.Y - segmentTilePos.Y;
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
NPC.rotation = (float)System.Math.Atan2((double)playerYPos, (double)playerXPos) + MathHelper.PiOver2;
|
||||
playerDistance = (float)System.Math.Sqrt((double)(playerXPos * playerXPos + playerYPos * playerYPos));
|
||||
|
||||
int segmentOffset = 60;
|
||||
playerDistance = (playerDistance - segmentOffset) / playerDistance;
|
||||
playerXPos *= playerDistance;
|
||||
playerYPos *= playerDistance;
|
||||
NPC.velocity = Vector2.Zero;
|
||||
NPC.position.X = NPC.position.X + playerXPos;
|
||||
NPC.position.Y = NPC.position.Y + playerYPos;
|
||||
|
||||
if (playerXPos < 0f)
|
||||
NPC.spriteDirection = 1;
|
||||
else if (playerXPos > 0f)
|
||||
NPC.spriteDirection = -1;
|
||||
directionToNextSegment = directionToNextSegment.RotatedBy(MathHelper.WrapAngle(aheadSegment.rotation - NPC.rotation) * 0.08f);
|
||||
directionToNextSegment = directionToNextSegment.MoveTowards((aheadSegment.rotation - NPC.rotation).ToRotationVector2(), 1f);
|
||||
}
|
||||
|
||||
// Decide segment offset stuff.
|
||||
int segmentOffset = 58;
|
||||
NPC.rotation = directionToNextSegment.ToRotation() + MathHelper.PiOver2;
|
||||
NPC.Center = aheadSegment.Center - directionToNextSegment.SafeNormalize(Vector2.Zero) * NPC.scale * segmentOffset;
|
||||
NPC.spriteDirection = (directionToNextSegment.X > 0).ToDirectionInt();
|
||||
|
||||
// Calculate contact damage based on velocity
|
||||
float maxChaseSpeed = Main.zenithWorld ? DesertNuisanceHeadYoung.SegmentVelocity_ZenithSeed :
|
||||
Main.getGoodWorld ? DesertNuisanceHeadYoung.SegmentVelocity_GoodWorld :
|
||||
|
||||
@@ -57,8 +57,8 @@ namespace CalamityMod.NPCs.DesertScourge
|
||||
if (Main.getGoodWorld)
|
||||
NPC.defense += 18;
|
||||
|
||||
NPC.width = 92;
|
||||
NPC.height = 92;
|
||||
NPC.width = 88;
|
||||
NPC.height = 88;
|
||||
NPC.lifeMax = BossRushEvent.BossRushActive ? 35000 : (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 4000 : 1300;
|
||||
double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01;
|
||||
NPC.lifeMax += (int)(NPC.lifeMax * HPBoost);
|
||||
|
||||
@@ -57,8 +57,8 @@ namespace CalamityMod.NPCs.DesertScourge
|
||||
if (Main.getGoodWorld)
|
||||
NPC.defense += 18;
|
||||
|
||||
NPC.width = 76;
|
||||
NPC.height = 76;
|
||||
NPC.width = 78;
|
||||
NPC.height = 78;
|
||||
NPC.lifeMax = BossRushEvent.BossRushActive ? 35000 : (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 4000 : 1300;
|
||||
double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01;
|
||||
NPC.lifeMax += (int)(NPC.lifeMax * HPBoost);
|
||||
|
||||
@@ -20,8 +20,8 @@ namespace CalamityMod.NPCs.DesertScourge
|
||||
public override void SetDefaults()
|
||||
{
|
||||
NPC.GetNPCDamage();
|
||||
NPC.width = 92;
|
||||
NPC.height = 92;
|
||||
NPC.width = 88;
|
||||
NPC.height = 88;
|
||||
|
||||
NPC.defense = 7;
|
||||
if (Main.getGoodWorld)
|
||||
@@ -124,7 +124,7 @@ namespace CalamityMod.NPCs.DesertScourge
|
||||
NPC.rotation = (float)System.Math.Atan2((double)playerYPos, (double)playerXPos) + MathHelper.PiOver2;
|
||||
playerDistance = (float)System.Math.Sqrt((double)(playerXPos * playerXPos + playerYPos * playerYPos));
|
||||
|
||||
int segmentOffset = 72;
|
||||
int segmentOffset = 66;
|
||||
playerDistance = (playerDistance - segmentOffset) / playerDistance;
|
||||
playerXPos *= playerDistance;
|
||||
playerYPos *= playerDistance;
|
||||
|
||||
@@ -20,8 +20,8 @@ namespace CalamityMod.NPCs.DesertScourge
|
||||
public override void SetDefaults()
|
||||
{
|
||||
NPC.GetNPCDamage();
|
||||
NPC.width = 76;
|
||||
NPC.height = 76;
|
||||
NPC.width = 78;
|
||||
NPC.height = 78;
|
||||
|
||||
NPC.defense = 7;
|
||||
if (Main.getGoodWorld)
|
||||
@@ -124,7 +124,7 @@ namespace CalamityMod.NPCs.DesertScourge
|
||||
NPC.rotation = (float)System.Math.Atan2((double)playerYPos, (double)playerXPos) + MathHelper.PiOver2;
|
||||
playerDistance = (float)System.Math.Sqrt((double)(playerXPos * playerXPos + playerYPos * playerYPos));
|
||||
|
||||
int segmentOffset = 60;
|
||||
int segmentOffset = 58;
|
||||
playerDistance = (playerDistance - segmentOffset) / playerDistance;
|
||||
playerXPos *= playerDistance;
|
||||
playerYPos *= playerDistance;
|
||||
|
||||
@@ -205,44 +205,20 @@ namespace CalamityMod.NPCs.DesertScourge
|
||||
if (Main.player[NPC.target].dead)
|
||||
NPC.TargetClosest(false);
|
||||
|
||||
Vector2 segmentTilePos = NPC.Center;
|
||||
float playerXPos = Main.player[NPC.target].Center.X;
|
||||
float playerYPos = Main.player[NPC.target].Center.Y;
|
||||
playerXPos = (float)((int)(playerXPos / 16f) * 16);
|
||||
playerYPos = (float)((int)(playerYPos / 16f) * 16);
|
||||
segmentTilePos.X = (float)((int)(segmentTilePos.X / 16f) * 16);
|
||||
segmentTilePos.Y = (float)((int)(segmentTilePos.Y / 16f) * 16);
|
||||
playerXPos -= segmentTilePos.X;
|
||||
playerYPos -= segmentTilePos.Y;
|
||||
float playerDistance = (float)Math.Sqrt((double)(playerXPos * playerXPos + playerYPos * playerYPos));
|
||||
if (NPC.ai[1] > 0f && NPC.ai[1] < (float)Main.npc.Length)
|
||||
NPC aheadSegment = Main.npc[(int)NPC.ai[1]];
|
||||
Vector2 directionToNextSegment = aheadSegment.Center - NPC.Center;
|
||||
if (aheadSegment.rotation != NPC.rotation)
|
||||
{
|
||||
try
|
||||
{
|
||||
segmentTilePos = NPC.Center;
|
||||
playerXPos = Main.npc[(int)NPC.ai[1]].Center.X - segmentTilePos.X;
|
||||
playerYPos = Main.npc[(int)NPC.ai[1]].Center.Y - segmentTilePos.Y;
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
NPC.rotation = (float)Math.Atan2((double)playerYPos, (double)playerXPos) + MathHelper.PiOver2;
|
||||
playerDistance = (float)Math.Sqrt((double)(playerXPos * playerXPos + playerYPos * playerYPos));
|
||||
|
||||
int segmentOffset = 74;
|
||||
playerDistance = (playerDistance - segmentOffset) / playerDistance;
|
||||
playerXPos *= playerDistance;
|
||||
playerYPos *= playerDistance;
|
||||
NPC.velocity = Vector2.Zero;
|
||||
NPC.position.X = NPC.position.X + playerXPos;
|
||||
NPC.position.Y = NPC.position.Y + playerYPos;
|
||||
|
||||
if (playerXPos < 0f)
|
||||
NPC.spriteDirection = 1;
|
||||
else if (playerXPos > 0f)
|
||||
NPC.spriteDirection = -1;
|
||||
directionToNextSegment = directionToNextSegment.RotatedBy(MathHelper.WrapAngle(aheadSegment.rotation - NPC.rotation) * 0.08f);
|
||||
directionToNextSegment = directionToNextSegment.MoveTowards((aheadSegment.rotation - NPC.rotation).ToRotationVector2(), 1f);
|
||||
}
|
||||
|
||||
// Decide segment offset stuff.
|
||||
int segmentOffset = 74;
|
||||
NPC.rotation = directionToNextSegment.ToRotation() + MathHelper.PiOver2;
|
||||
NPC.Center = aheadSegment.Center - directionToNextSegment.SafeNormalize(Vector2.Zero) * NPC.scale * segmentOffset;
|
||||
NPC.spriteDirection = (directionToNextSegment.X > 0).ToDirectionInt();
|
||||
|
||||
NPC head = Main.npc[(int)NPC.ai[2]];
|
||||
float burrowTimeGateValue = (CalamityWorld.death || BossRushEvent.BossRushActive) ? DesertScourgeHead.BurrowTimeGateValue_Death : DesertScourgeHead.BurrowTimeGateValue;
|
||||
bool burrow = head.Calamity().newAI[0] >= burrowTimeGateValue;
|
||||
|
||||
Reference in new issue
Block a user