1 - A few more NPC drawing fixes.
This commit is contained in:
1 parent
c395c31ed3
commit
486e224b87
17 files changed
+72
-72
No files matched your search
@@ -84,7 +84,7 @@ namespace CalamityMod.NPCs.Signus
|
||||
CalamityAI.DungeonSpiritAI(NPC, Mod, playerDistNormMult, 0f, true);
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (NPC.spriteDirection == 1)
|
||||
@@ -100,21 +100,21 @@ namespace CalamityMod.NPCs.Signus
|
||||
{
|
||||
for (int num155 = 1; num155 < num153; num155 += 2)
|
||||
{
|
||||
Color color38 = lightColor;
|
||||
Color color38 = drawColor;
|
||||
color38 = Color.Lerp(color38, color36, amount9);
|
||||
color38 = NPC.GetAlpha(color38);
|
||||
color38 *= (float)(num153 - num155) / 15f;
|
||||
Vector2 vector41 = NPC.oldPos[num155] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - Main.screenPosition;
|
||||
Vector2 vector41 = NPC.oldPos[num155] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos;
|
||||
vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f;
|
||||
vector41 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector41, NPC.frame, color38, NPC.rotation, vector11, NPC.scale, spriteEffects, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
Vector2 vector43 = NPC.Center - Main.screenPosition;
|
||||
Vector2 vector43 = NPC.Center - screenPos;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f;
|
||||
vector43 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, NPC.frame, NPC.GetAlpha(lightColor), NPC.rotation, vector11, NPC.scale, spriteEffects, 0f);
|
||||
spriteBatch.Draw(texture2D15, vector43, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, vector11, NPC.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.Request<Texture2D>("CalamityMod/NPCs/Signus/CosmicLanternGlow").Value;
|
||||
Color color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f);
|
||||
@@ -127,7 +127,7 @@ namespace CalamityMod.NPCs.Signus
|
||||
color41 = Color.Lerp(color41, color36, amount9);
|
||||
color41 = NPC.GetAlpha(color41);
|
||||
color41 *= (float)(num153 - num163) / 15f;
|
||||
Vector2 vector44 = NPC.oldPos[num163] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - Main.screenPosition;
|
||||
Vector2 vector44 = NPC.oldPos[num163] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos;
|
||||
vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f;
|
||||
vector44 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector44, NPC.frame, color41, NPC.rotation, vector11, NPC.scale, spriteEffects, 0f);
|
||||
|
||||
@@ -660,7 +660,7 @@ namespace CalamityMod.NPCs.Signus
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor)
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
|
||||
{
|
||||
Texture2D NPCTexture = TextureAssets.Npc[NPC.type].Value;
|
||||
Texture2D glowMaskTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/Signus/SignusGlow").Value;
|
||||
@@ -710,14 +710,14 @@ namespace CalamityMod.NPCs.Signus
|
||||
color38 = Color.Lerp(color38, color36, amount9);
|
||||
color38 = NPC.GetAlpha(color38);
|
||||
color38 *= (num153 - num155) / 15f;
|
||||
Vector2 vector41 = NPC.oldPos[num155] + new Vector2(NPC.width, NPC.height) / 2f - Main.screenPosition;
|
||||
Vector2 vector41 = NPC.oldPos[num155] + new Vector2(NPC.width, NPC.height) / 2f - screenPos;
|
||||
vector41 -= new Vector2(NPCTexture.Width, NPCTexture.Height / frameCount) * scale / 2f;
|
||||
vector41 += vector11 * scale + new Vector2(0f, 4f + offsetY);
|
||||
spriteBatch.Draw(NPCTexture, vector41, new Rectangle?(frame), color38, rotation, vector11, scale, spriteEffects, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
Vector2 vector43 = NPC.Center - Main.screenPosition;
|
||||
Vector2 vector43 = NPC.Center - screenPos;
|
||||
vector43 -= new Vector2(NPCTexture.Width, NPCTexture.Height / frameCount) * scale / 2f;
|
||||
vector43 += vector11 * scale + new Vector2(0f, 4f + offsetY);
|
||||
spriteBatch.Draw(NPCTexture, vector43, new Rectangle?(frame), NPC.GetAlpha(drawColor), rotation, vector11, scale, spriteEffects, 0f);
|
||||
@@ -732,7 +732,7 @@ namespace CalamityMod.NPCs.Signus
|
||||
color41 = Color.Lerp(color41, color36, amount9);
|
||||
color41 = NPC.GetAlpha(color41);
|
||||
color41 *= (num153 - num163) / 15f;
|
||||
Vector2 vector44 = NPC.oldPos[num163] + new Vector2(NPC.width, NPC.height) / 2f - Main.screenPosition;
|
||||
Vector2 vector44 = NPC.oldPos[num163] + new Vector2(NPC.width, NPC.height) / 2f - screenPos;
|
||||
vector44 -= new Vector2(glowMaskTexture.Width, glowMaskTexture.Height / frameCount) * scale / 2f;
|
||||
vector44 += vector11 * scale + new Vector2(0f, 4f + offsetY);
|
||||
spriteBatch.Draw(glowMaskTexture, vector44, new Rectangle?(frame), color41, rotation, vector11, scale, spriteEffects, 0f);
|
||||
|
||||
@@ -161,7 +161,7 @@ namespace CalamityMod.NPCs.Signus
|
||||
return new Color(200, Main.DiscoG, 255, 0);
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
|
||||
{
|
||||
if (NPC.Calamity().newAI[0] >= 45f)
|
||||
return false;
|
||||
@@ -180,21 +180,21 @@ namespace CalamityMod.NPCs.Signus
|
||||
{
|
||||
for (int num155 = 1; num155 < num153; num155 += 2)
|
||||
{
|
||||
Color color38 = lightColor;
|
||||
Color color38 = drawColor;
|
||||
color38 = Color.Lerp(color38, color36, amount9);
|
||||
color38 = NPC.GetAlpha(color38);
|
||||
color38 *= (num153 - num155) / 15f;
|
||||
Vector2 vector41 = NPC.oldPos[num155] + new Vector2(NPC.width, NPC.height) / 2f - Main.screenPosition;
|
||||
Vector2 vector41 = NPC.oldPos[num155] + new Vector2(NPC.width, NPC.height) / 2f - screenPos;
|
||||
vector41 -= new Vector2(texture2D15.Width, texture2D15.Height) * NPC.scale / 2f;
|
||||
vector41 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector41, NPC.frame, color38, NPC.rotation, vector11, NPC.scale, spriteEffects, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
Vector2 vector43 = NPC.Center - Main.screenPosition;
|
||||
Vector2 vector43 = NPC.Center - screenPos;
|
||||
vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * NPC.scale / 2f;
|
||||
vector43 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, NPC.frame, NPC.GetAlpha(lightColor), NPC.rotation, vector11, NPC.scale, spriteEffects, 0f);
|
||||
spriteBatch.Draw(texture2D15, vector43, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, vector11, NPC.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -529,7 +529,7 @@ namespace CalamityMod.NPCs.SlimeGod
|
||||
NPC.rotation = NPC.velocity.X * 0.1f;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor)
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (NPC.spriteDirection == 1)
|
||||
@@ -548,7 +548,7 @@ namespace CalamityMod.NPCs.SlimeGod
|
||||
int num159 = 1;
|
||||
float num160 = 0f;
|
||||
int num161 = num159;
|
||||
spriteBatch.Draw(texture2D3, NPC.Center - Main.screenPosition + new Vector2(0, NPC.gfxOffY), NPC.frame, color24, NPC.rotation, NPC.frame.Size() / 2, NPC.scale, spriteEffects, 0);
|
||||
spriteBatch.Draw(texture2D3, NPC.Center - screenPos + new Vector2(0, NPC.gfxOffY), NPC.frame, color24, NPC.rotation, NPC.frame.Size() / 2, NPC.scale, spriteEffects, 0);
|
||||
while (((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157)) && CalamityConfig.Instance.Afterimages)
|
||||
{
|
||||
Color color26 = NPC.GetAlpha(color25);
|
||||
@@ -567,7 +567,7 @@ namespace CalamityMod.NPCs.SlimeGod
|
||||
color26 *= num164 / ((float)NPCID.Sets.TrailCacheLength[NPC.type] * 1.5f);
|
||||
Vector2 value4 = NPC.oldPos[num161];
|
||||
float num165 = NPC.rotation;
|
||||
Main.spriteBatch.Draw(texture2D3, value4 + NPC.Size / 2f - Main.screenPosition + new Vector2(0, NPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), color26, num165 + NPC.rotation * num160 * (float)(num161 - 1) * -(float)spriteEffects.HasFlag(SpriteEffects.FlipHorizontally).ToDirectionInt(), origin2, NPC.scale, spriteEffects, 0f);
|
||||
Main.spriteBatch.Draw(texture2D3, value4 + NPC.Size / 2f - screenPos + new Vector2(0, NPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), color26, num165 + NPC.rotation * num160 * (float)(num161 - 1) * -(float)spriteEffects.HasFlag(SpriteEffects.FlipHorizontally).ToDirectionInt(), origin2, NPC.scale, spriteEffects, 0f);
|
||||
goto IL_6881;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -210,7 +210,7 @@ namespace CalamityMod.NPCs.StormWeaver
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (NPC.spriteDirection == 1)
|
||||
@@ -227,7 +227,7 @@ namespace CalamityMod.NPCs.StormWeaver
|
||||
{
|
||||
for (int num155 = 1; num155 < num153; num155 += 2)
|
||||
{
|
||||
Color color38 = lightColor;
|
||||
Color color38 = drawColor;
|
||||
|
||||
if (CalamityWorld.revenge || BossRushEvent.BossRushActive)
|
||||
{
|
||||
@@ -240,17 +240,17 @@ namespace CalamityMod.NPCs.StormWeaver
|
||||
color38 = Color.Lerp(color38, color36, amount9);
|
||||
color38 = NPC.GetAlpha(color38);
|
||||
color38 *= (num153 - num155) / 15f;
|
||||
Vector2 vector41 = NPC.oldPos[num155] + new Vector2(NPC.width, NPC.height) / 2f - Main.screenPosition;
|
||||
Vector2 vector41 = NPC.oldPos[num155] + new Vector2(NPC.width, NPC.height) / 2f - screenPos;
|
||||
vector41 -= new Vector2(texture2D15.Width, texture2D15.Height) * NPC.scale / 2f;
|
||||
vector41 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector41, NPC.frame, color38, NPC.rotation, vector11, NPC.scale, spriteEffects, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
Vector2 vector43 = NPC.Center - Main.screenPosition;
|
||||
Vector2 vector43 = NPC.Center - screenPos;
|
||||
vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * NPC.scale / 2f;
|
||||
vector43 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY);
|
||||
Color color = NPC.GetAlpha(lightColor);
|
||||
Color color = NPC.GetAlpha(drawColor);
|
||||
|
||||
if (CalamityWorld.revenge || BossRushEvent.BossRushActive)
|
||||
{
|
||||
|
||||
@@ -611,7 +611,7 @@ namespace CalamityMod.NPCs.StormWeaver
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (NPC.spriteDirection == 1)
|
||||
@@ -628,7 +628,7 @@ namespace CalamityMod.NPCs.StormWeaver
|
||||
{
|
||||
for (int num155 = 1; num155 < num153; num155 += 2)
|
||||
{
|
||||
Color color38 = lightColor;
|
||||
Color color38 = drawColor;
|
||||
|
||||
if (CalamityWorld.revenge || BossRushEvent.BossRushActive)
|
||||
{
|
||||
@@ -641,17 +641,17 @@ namespace CalamityMod.NPCs.StormWeaver
|
||||
color38 = Color.Lerp(color38, color36, amount9);
|
||||
color38 = NPC.GetAlpha(color38);
|
||||
color38 *= (num153 - num155) / 15f;
|
||||
Vector2 vector41 = NPC.oldPos[num155] + new Vector2(NPC.width, NPC.height) / 2f - Main.screenPosition;
|
||||
Vector2 vector41 = NPC.oldPos[num155] + new Vector2(NPC.width, NPC.height) / 2f - screenPos;
|
||||
vector41 -= new Vector2(texture2D15.Width, texture2D15.Height) * NPC.scale / 2f;
|
||||
vector41 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector41, NPC.frame, color38, NPC.rotation, vector11, NPC.scale, spriteEffects, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
Vector2 vector43 = NPC.Center - Main.screenPosition;
|
||||
Vector2 vector43 = NPC.Center - screenPos;
|
||||
vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * NPC.scale / 2f;
|
||||
vector43 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY);
|
||||
Color color = NPC.GetAlpha(lightColor);
|
||||
Color color = NPC.GetAlpha(drawColor);
|
||||
|
||||
if (CalamityWorld.revenge || BossRushEvent.BossRushActive)
|
||||
{
|
||||
|
||||
@@ -220,7 +220,7 @@ namespace CalamityMod.NPCs.StormWeaver
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (NPC.spriteDirection == 1)
|
||||
@@ -237,7 +237,7 @@ namespace CalamityMod.NPCs.StormWeaver
|
||||
{
|
||||
for (int num155 = 1; num155 < num153; num155 += 2)
|
||||
{
|
||||
Color color38 = lightColor;
|
||||
Color color38 = drawColor;
|
||||
|
||||
if (CalamityWorld.revenge || BossRushEvent.BossRushActive)
|
||||
{
|
||||
@@ -250,17 +250,17 @@ namespace CalamityMod.NPCs.StormWeaver
|
||||
color38 = Color.Lerp(color38, color36, amount9);
|
||||
color38 = NPC.GetAlpha(color38);
|
||||
color38 *= (num153 - num155) / 15f;
|
||||
Vector2 vector41 = NPC.oldPos[num155] + new Vector2(NPC.width, NPC.height) / 2f - Main.screenPosition;
|
||||
Vector2 vector41 = NPC.oldPos[num155] + new Vector2(NPC.width, NPC.height) / 2f - screenPos;
|
||||
vector41 -= new Vector2(texture2D15.Width, texture2D15.Height) * NPC.scale / 2f;
|
||||
vector41 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector41, NPC.frame, color38, NPC.rotation, vector11, NPC.scale, spriteEffects, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
Vector2 vector43 = NPC.Center - Main.screenPosition;
|
||||
Vector2 vector43 = NPC.Center - screenPos;
|
||||
vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * NPC.scale / 2f;
|
||||
vector43 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY);
|
||||
Color color = NPC.GetAlpha(lightColor);
|
||||
Color color = NPC.GetAlpha(drawColor);
|
||||
|
||||
if (CalamityWorld.revenge || BossRushEvent.BossRushActive)
|
||||
{
|
||||
|
||||
@@ -105,7 +105,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
NPC.frame.Y = frame * frameHeight;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor)
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
|
||||
{
|
||||
if (ChainDrawer is null)
|
||||
ChainDrawer = new PrimitiveTrail(PrimitiveWidthFunction, PrimitiveColorFunction);
|
||||
@@ -116,7 +116,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
NPC.Center,
|
||||
ChainEndpoints[i] + NPC.DirectionTo(ChainEndpoints[i]) * 25f
|
||||
};
|
||||
ChainDrawer.Draw(points, -Main.screenPosition, 40);
|
||||
ChainDrawer.Draw(points, -screenPos, 40);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -170,17 +170,17 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
Limbs[1].Center = Limbs[0].Center + offsetFromSegment * 0.5f + (NPC.Center - Limbs[0].Center).SafeNormalize(Vector2.UnitY) * 84f;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor_Unused)
|
||||
{
|
||||
Texture2D armTexture = TextureAssets.Npc[NPC.type].Value;
|
||||
Texture2D foreArmTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/SupremeCalamitas/SCalWormForeArm").Value;
|
||||
Texture2D handTexture = ModContent.Request<Texture2D>("CalamityMod/NPCs/SupremeCalamitas/SCalWormHand").Value;
|
||||
|
||||
Vector2 forearmDrawPosition = Limbs[0].Center - Main.screenPosition;
|
||||
Vector2 forearmDrawPosition = Limbs[0].Center - screenPos;
|
||||
Color drawColor = Lighting.GetColor((int)(Limbs[0].Center.X / 16), (int)(Limbs[0].Center.Y / 16));
|
||||
spriteBatch.Draw(foreArmTexture, forearmDrawPosition, null, drawColor, Limbs[0].Rotation + MathHelper.PiOver2, foreArmTexture.Size() * 0.5f, NPC.scale, SpriteEffects.None, 0f);
|
||||
|
||||
Vector2 armDrawPosition = Limbs[1].Center - Main.screenPosition;
|
||||
Vector2 armDrawPosition = Limbs[1].Center - screenPos;
|
||||
drawColor = Lighting.GetColor((int)(Limbs[1].Center.X / 16), (int)(Limbs[1].Center.Y / 16));
|
||||
spriteBatch.Draw(armTexture, armDrawPosition, null, drawColor, Limbs[1].Rotation + MathHelper.PiOver2, armTexture.Size() * new Vector2(0.5f, 0f), NPC.scale, SpriteEffects.FlipVertically, 0f);
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (NPC.spriteDirection == 1)
|
||||
@@ -139,10 +139,10 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
Texture2D texture2D15 = NPC.localAI[3] / 2f % 2f == 0f ? ModContent.Request<Texture2D>("CalamityMod/NPCs/SupremeCalamitas/SCalWormBodyAlt").Value : TextureAssets.Npc[NPC.type].Value;
|
||||
Vector2 vector11 = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / 2));
|
||||
|
||||
Vector2 vector43 = NPC.Center - Main.screenPosition;
|
||||
Vector2 vector43 = NPC.Center - screenPos;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * NPC.scale / 2f;
|
||||
vector43 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, NPC.frame, NPC.GetAlpha(lightColor), NPC.rotation, vector11, NPC.scale, spriteEffects, 0f);
|
||||
spriteBatch.Draw(texture2D15, vector43, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, vector11, NPC.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -289,7 +289,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X) + MathHelper.PiOver2;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (NPC.spriteDirection == 1)
|
||||
@@ -298,10 +298,10 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value;
|
||||
Vector2 vector11 = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / 2));
|
||||
|
||||
Vector2 vector43 = NPC.Center - Main.screenPosition;
|
||||
Vector2 vector43 = NPC.Center - screenPos;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * NPC.scale / 2f;
|
||||
vector43 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, NPC.frame, NPC.GetAlpha(lightColor), NPC.rotation, vector11, NPC.scale, spriteEffects, 0f);
|
||||
spriteBatch.Draw(texture2D15, vector43, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, vector11, NPC.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (NPC.spriteDirection == 1)
|
||||
@@ -158,10 +158,10 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value;
|
||||
Vector2 vector11 = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / 2));
|
||||
|
||||
Vector2 vector43 = NPC.Center - Main.screenPosition;
|
||||
Vector2 vector43 = NPC.Center - screenPos;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * NPC.scale / 2f;
|
||||
vector43 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, NPC.frame, NPC.GetAlpha(lightColor), NPC.rotation, vector11, NPC.scale, spriteEffects, 0f);
|
||||
spriteBatch.Draw(texture2D15, vector43, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, vector11, NPC.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
|
||||
public override bool CheckActive() => false;
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (NPC.spriteDirection == 1)
|
||||
@@ -195,21 +195,21 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
{
|
||||
for (int num155 = 1; num155 < num153; num155 += 2)
|
||||
{
|
||||
Color color38 = lightColor;
|
||||
Color color38 = drawColor;
|
||||
color38 = Color.Lerp(color38, color36, amount9);
|
||||
color38 = NPC.GetAlpha(color38);
|
||||
color38 *= (float)(num153 - num155) / 15f;
|
||||
Vector2 vector41 = NPC.oldPos[num155] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - Main.screenPosition;
|
||||
Vector2 vector41 = NPC.oldPos[num155] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos;
|
||||
vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f;
|
||||
vector41 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector41, NPC.frame, color38, NPC.rotation, vector11, NPC.scale, spriteEffects, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
Vector2 vector43 = NPC.Center - Main.screenPosition;
|
||||
Vector2 vector43 = NPC.Center - screenPos;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f;
|
||||
vector43 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, NPC.frame, NPC.GetAlpha(lightColor), NPC.rotation, vector11, NPC.scale, spriteEffects, 0f);
|
||||
spriteBatch.Draw(texture2D15, vector43, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, vector11, NPC.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.Request<Texture2D>("CalamityMod/NPCs/SupremeCalamitas/SoulSeekerSupremeGlow").Value;
|
||||
Color color37 = Color.Lerp(Color.White, Color.Red, 0.5f);
|
||||
@@ -221,7 +221,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
Color color41 = color37;
|
||||
color41 = Color.Lerp(color41, color36, amount9);
|
||||
color41 *= (float)(num153 - num163) / 15f;
|
||||
Vector2 vector44 = NPC.oldPos[num163] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - Main.screenPosition;
|
||||
Vector2 vector44 = NPC.oldPos[num163] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos;
|
||||
vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f;
|
||||
vector44 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector44, NPC.frame, color41, NPC.rotation, vector11, NPC.scale, spriteEffects, 0f);
|
||||
|
||||
@@ -2845,7 +2845,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
return null;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (NPC.spriteDirection == 1)
|
||||
@@ -2864,11 +2864,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
{
|
||||
for (int num155 = 1; num155 < num153; num155 += 2)
|
||||
{
|
||||
Color color38 = lightColor;
|
||||
Color color38 = drawColor;
|
||||
color38 = Color.Lerp(color38, color36, amount9);
|
||||
color38 = NPC.GetAlpha(color38);
|
||||
color38 *= (num153 - num155) / 15f;
|
||||
Vector2 vector41 = NPC.oldPos[num155] + new Vector2(NPC.width, NPC.height) / 2f - Main.screenPosition;
|
||||
Vector2 vector41 = NPC.oldPos[num155] + new Vector2(NPC.width, NPC.height) / 2f - screenPos;
|
||||
vector41 -= new Vector2(texture2D15.Width / 2f, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f;
|
||||
vector41 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector41, frame, color38, NPC.rotation, vector11, NPC.scale, spriteEffects, 0f);
|
||||
@@ -2876,7 +2876,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
}
|
||||
|
||||
bool inPhase2 = NPC.ai[0] >= 3f && NPC.life > NPC.lifeMax * 0.01;
|
||||
Vector2 vector43 = NPC.Center - Main.screenPosition;
|
||||
Vector2 vector43 = NPC.Center - screenPos;
|
||||
vector43 -= new Vector2(texture2D15.Width / 2f, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f;
|
||||
vector43 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY);
|
||||
|
||||
@@ -2895,7 +2895,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
spriteBatch.Draw(texture2D15, vector43 + rotationalDrawOffset, frame, auraColor, NPC.rotation, vector11, NPC.scale * 1.1f, spriteEffects, 0f);
|
||||
}
|
||||
}
|
||||
spriteBatch.Draw(texture2D15, vector43, frame, NPC.GetAlpha(lightColor), NPC.rotation, vector11, NPC.scale, spriteEffects, 0f);
|
||||
spriteBatch.Draw(texture2D15, vector43, frame, NPC.GetAlpha(drawColor), NPC.rotation, vector11, NPC.scale, spriteEffects, 0f);
|
||||
|
||||
DrawForcefield(spriteBatch);
|
||||
DrawShield(spriteBatch);
|
||||
|
||||
@@ -212,7 +212,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (NPC.spriteDirection == 1)
|
||||
@@ -226,14 +226,14 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
{
|
||||
for (int i = 1; i < afterimageCount; i += 2)
|
||||
{
|
||||
Color afterimageColor = NPC.GetAlpha(Color.Lerp(lightColor, Color.White, 0.5f)) * ((afterimageCount - i) / 15f);
|
||||
Vector2 drawPosition = NPC.oldPos[i] + NPC.Size * 0.5f - Main.screenPosition;
|
||||
Color afterimageColor = NPC.GetAlpha(Color.Lerp(drawColor, Color.White, 0.5f)) * ((afterimageCount - i) / 15f);
|
||||
Vector2 drawPosition = NPC.oldPos[i] + NPC.Size * 0.5f - screenPos;
|
||||
spriteBatch.Draw(texture, drawPosition, NPC.frame, afterimageColor, NPC.rotation, origin, NPC.scale, spriteEffects, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
Vector2 mainDrawPosition = NPC.Center - Main.screenPosition;
|
||||
spriteBatch.Draw(texture, mainDrawPosition, NPC.frame, NPC.GetAlpha(lightColor), NPC.rotation, origin, NPC.scale, spriteEffects, 0f);
|
||||
Vector2 mainDrawPosition = NPC.Center - screenPos;
|
||||
spriteBatch.Draw(texture, mainDrawPosition, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, origin, NPC.scale, spriteEffects, 0f);
|
||||
|
||||
texture = ModContent.Request<Texture2D>("CalamityMod/NPCs/SupremeCalamitas/SupremeCataclysmGlow").Value;
|
||||
Color baseGlowmaskColor = Color.Lerp(Color.White, Color.Red, 0.5f);
|
||||
@@ -243,7 +243,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
for (int i = 1; i < afterimageCount; i++)
|
||||
{
|
||||
Color afterimageColor = Color.Lerp(baseGlowmaskColor, Color.White, 0.5f) * ((afterimageCount - i) / 15f);
|
||||
Vector2 drawPosition = NPC.oldPos[i] + NPC.Size * 0.5f - Main.screenPosition;
|
||||
Vector2 drawPosition = NPC.oldPos[i] + NPC.Size * 0.5f - screenPos;
|
||||
spriteBatch.Draw(texture, drawPosition, NPC.frame, afterimageColor, NPC.rotation, origin, NPC.scale, spriteEffects, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (NPC.spriteDirection == 1)
|
||||
@@ -230,14 +230,14 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
{
|
||||
for (int i = 1; i < afterimageCount; i += 2)
|
||||
{
|
||||
Color afterimageColor = NPC.GetAlpha(Color.Lerp(lightColor, Color.White, 0.5f)) * ((afterimageCount - i) / 15f);
|
||||
Vector2 drawPosition = NPC.oldPos[i] + NPC.Size * 0.5f - Main.screenPosition;
|
||||
Color afterimageColor = NPC.GetAlpha(Color.Lerp(drawColor, Color.White, 0.5f)) * ((afterimageCount - i) / 15f);
|
||||
Vector2 drawPosition = NPC.oldPos[i] + NPC.Size * 0.5f - screenPos;
|
||||
spriteBatch.Draw(texture, drawPosition, NPC.frame, afterimageColor, NPC.rotation, origin, NPC.scale, spriteEffects, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
Vector2 mainDrawPosition = NPC.Center - Main.screenPosition;
|
||||
spriteBatch.Draw(texture, mainDrawPosition, NPC.frame, NPC.GetAlpha(lightColor), NPC.rotation, origin, NPC.scale, spriteEffects, 0f);
|
||||
Vector2 mainDrawPosition = NPC.Center - screenPos;
|
||||
spriteBatch.Draw(texture, mainDrawPosition, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, origin, NPC.scale, spriteEffects, 0f);
|
||||
|
||||
texture = ModContent.Request<Texture2D>("CalamityMod/NPCs/SupremeCalamitas/SupremeCatastropheGlow").Value;
|
||||
Color baseGlowmaskColor = Color.Lerp(Color.White, Color.Cyan, 0.35f);
|
||||
@@ -247,7 +247,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
for (int i = 1; i < afterimageCount; i++)
|
||||
{
|
||||
Color afterimageColor = Color.Lerp(baseGlowmaskColor, Color.White, 0.5f) * ((afterimageCount - i) / 15f);
|
||||
Vector2 drawPosition = NPC.oldPos[i] + NPC.Size * 0.5f - Main.screenPosition;
|
||||
Vector2 drawPosition = NPC.oldPos[i] + NPC.Size * 0.5f - screenPos;
|
||||
spriteBatch.Draw(texture, drawPosition, NPC.frame, afterimageColor, NPC.rotation, origin, NPC.scale, spriteEffects, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -216,10 +216,10 @@ namespace CalamityMod.NPCs.TownNPCs
|
||||
return "Sorry, I got nothing. Perhaps you could reforge something and come back later...";
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor)
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
|
||||
{
|
||||
var something = NPC.direction == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally;
|
||||
spriteBatch.Draw(ModContent.Request<Texture2D>("CalamityMod/NPCs/TownNPCs/THIEF" + (BirthdayParty.PartyIsUp ? "Alt" : "")).Value, NPC.Center - Main.screenPosition + new Vector2(0, NPC.gfxOffY) - new Vector2(0f, 6f), NPC.frame, drawColor, NPC.rotation, NPC.frame.Size() / 2, NPC.scale, something, 0);
|
||||
spriteBatch.Draw(ModContent.Request<Texture2D>("CalamityMod/NPCs/TownNPCs/THIEF" + (BirthdayParty.PartyIsUp ? "Alt" : "")).Value, NPC.Center - screenPos + new Vector2(0, NPC.gfxOffY) - new Vector2(0f, 6f), NPC.frame, drawColor, NPC.rotation, NPC.frame.Size() / 2, NPC.scale, something, 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user