From 136e860fca3fb14377db22cef7c84521fc4b952f Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Thu, 30 Sep 2021 15:00:04 -0500 Subject: [PATCH] 1 - Fixed Ares afterimages. --- NPCs/ExoMechs/Ares/AresBody.cs | 8 ++++---- NPCs/ExoMechs/Ares/AresGaussNuke.cs | 8 ++++---- NPCs/ExoMechs/Ares/AresLaserCannon.cs | 8 ++++---- NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs | 8 ++++---- NPCs/ExoMechs/Ares/AresTeslaCannon.cs | 8 ++++---- NPCs/TownNPCs/FAP.cs | 2 +- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/NPCs/ExoMechs/Ares/AresBody.cs b/NPCs/ExoMechs/Ares/AresBody.cs index 7f595e161e..ffe2302f0c 100644 --- a/NPCs/ExoMechs/Ares/AresBody.cs +++ b/NPCs/ExoMechs/Ares/AresBody.cs @@ -670,9 +670,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares afterimageColor = npc.GetAlpha(afterimageColor); afterimageColor *= (numAfterimages - i) / 15f; Vector2 afterimageCenter = npc.oldPos[i] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; - afterimageCenter -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; + afterimageCenter -= new Vector2(texture.Width, texture.Height) / new Vector2(maxFramesX, maxFramesY) * npc.scale / 2f; afterimageCenter += vector * npc.scale + new Vector2(0f, npc.gfxOffY); - spriteBatch.Draw(texture, afterimageCenter, npc.frame, afterimageColor, npc.rotation, vector, npc.scale, SpriteEffects.None, 0f); + spriteBatch.Draw(texture, afterimageCenter, npc.frame, afterimageColor, npc.oldRot[i], vector, npc.scale, SpriteEffects.None, 0f); } } @@ -690,9 +690,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares afterimageColor = npc.GetAlpha(afterimageColor); afterimageColor *= (numAfterimages - i) / 15f; Vector2 afterimageCenter = npc.oldPos[i] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; - afterimageCenter -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; + afterimageCenter -= new Vector2(texture.Width, texture.Height) / new Vector2(maxFramesX, maxFramesY) * npc.scale / 2f; afterimageCenter += vector * npc.scale + new Vector2(0f, npc.gfxOffY); - spriteBatch.Draw(texture, afterimageCenter, npc.frame, afterimageColor, npc.rotation, vector, npc.scale, SpriteEffects.None, 0f); + spriteBatch.Draw(texture, afterimageCenter, npc.frame, afterimageColor, npc.oldRot[i], vector, npc.scale, SpriteEffects.None, 0f); } } diff --git a/NPCs/ExoMechs/Ares/AresGaussNuke.cs b/NPCs/ExoMechs/Ares/AresGaussNuke.cs index 2811ddb8a2..c5a49b4775 100644 --- a/NPCs/ExoMechs/Ares/AresGaussNuke.cs +++ b/NPCs/ExoMechs/Ares/AresGaussNuke.cs @@ -450,9 +450,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares afterimageColor = npc.GetAlpha(afterimageColor); afterimageColor *= (numAfterimages - i) / 15f; Vector2 afterimageCenter = npc.oldPos[i] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; - afterimageCenter -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; + afterimageCenter -= new Vector2(texture.Width, texture.Height) / new Vector2(maxFramesX, maxFramesY) * npc.scale / 2f; afterimageCenter += vector * npc.scale + new Vector2(0f, npc.gfxOffY); - spriteBatch.Draw(texture, afterimageCenter, npc.frame, afterimageColor, npc.rotation, vector, npc.scale, spriteEffects, 0f); + spriteBatch.Draw(texture, afterimageCenter, npc.frame, afterimageColor, npc.oldRot[i], vector, npc.scale, spriteEffects, 0f); } } @@ -470,9 +470,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares afterimageColor = npc.GetAlpha(afterimageColor); afterimageColor *= (numAfterimages - i) / 15f; Vector2 afterimageCenter = npc.oldPos[i] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; - afterimageCenter -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; + afterimageCenter -= new Vector2(texture.Width, texture.Height) / new Vector2(maxFramesX, maxFramesY) * npc.scale / 2f; afterimageCenter += vector * npc.scale + new Vector2(0f, npc.gfxOffY); - spriteBatch.Draw(texture, afterimageCenter, npc.frame, afterimageColor, npc.rotation, vector, npc.scale, spriteEffects, 0f); + spriteBatch.Draw(texture, afterimageCenter, npc.frame, afterimageColor, npc.oldRot[i], vector, npc.scale, spriteEffects, 0f); } } diff --git a/NPCs/ExoMechs/Ares/AresLaserCannon.cs b/NPCs/ExoMechs/Ares/AresLaserCannon.cs index 4d4239b755..1c66275120 100644 --- a/NPCs/ExoMechs/Ares/AresLaserCannon.cs +++ b/NPCs/ExoMechs/Ares/AresLaserCannon.cs @@ -504,9 +504,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares afterimageColor = npc.GetAlpha(afterimageColor); afterimageColor *= (numAfterimages - i) / 15f; Vector2 afterimageCenter = npc.oldPos[i] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; - afterimageCenter -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; + afterimageCenter -= new Vector2(texture.Width, texture.Height) / new Vector2(maxFramesX, maxFramesY) * npc.scale / 2f; afterimageCenter += vector * npc.scale + new Vector2(0f, npc.gfxOffY); - spriteBatch.Draw(texture, afterimageCenter, npc.frame, afterimageColor, npc.rotation, vector, npc.scale, spriteEffects, 0f); + spriteBatch.Draw(texture, afterimageCenter, npc.frame, afterimageColor, npc.oldRot[i], vector, npc.scale, spriteEffects, 0f); } } @@ -524,9 +524,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares afterimageColor = npc.GetAlpha(afterimageColor); afterimageColor *= (numAfterimages - i) / 15f; Vector2 afterimageCenter = npc.oldPos[i] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; - afterimageCenter -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; + afterimageCenter -= new Vector2(texture.Width, texture.Height) / new Vector2(maxFramesX, maxFramesY) * npc.scale / 2f; afterimageCenter += vector * npc.scale + new Vector2(0f, npc.gfxOffY); - spriteBatch.Draw(texture, afterimageCenter, npc.frame, afterimageColor, npc.rotation, vector, npc.scale, spriteEffects, 0f); + spriteBatch.Draw(texture, afterimageCenter, npc.frame, afterimageColor, npc.oldRot[i], vector, npc.scale, spriteEffects, 0f); } } diff --git a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs index 37c2f48a42..5442652cf3 100644 --- a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs +++ b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs @@ -428,9 +428,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares afterimageColor = npc.GetAlpha(afterimageColor); afterimageColor *= (numAfterimages - i) / 15f; Vector2 afterimageCenter = npc.oldPos[i] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; - afterimageCenter -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; + afterimageCenter -= new Vector2(texture.Width, texture.Height) / new Vector2(maxFramesX, maxFramesY) * npc.scale / 2f; afterimageCenter += vector * npc.scale + new Vector2(0f, npc.gfxOffY); - spriteBatch.Draw(texture, afterimageCenter, npc.frame, afterimageColor, npc.rotation, vector, npc.scale, spriteEffects, 0f); + spriteBatch.Draw(texture, afterimageCenter, npc.frame, afterimageColor, npc.oldRot[i], vector, npc.scale, spriteEffects, 0f); } } @@ -448,9 +448,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares afterimageColor = npc.GetAlpha(afterimageColor); afterimageColor *= (numAfterimages - i) / 15f; Vector2 afterimageCenter = npc.oldPos[i] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; - afterimageCenter -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; + afterimageCenter -= new Vector2(texture.Width, texture.Height) / new Vector2(maxFramesX, maxFramesY) * npc.scale / 2f; afterimageCenter += vector * npc.scale + new Vector2(0f, npc.gfxOffY); - spriteBatch.Draw(texture, afterimageCenter, npc.frame, afterimageColor, npc.rotation, vector, npc.scale, spriteEffects, 0f); + spriteBatch.Draw(texture, afterimageCenter, npc.frame, afterimageColor, npc.oldRot[i], vector, npc.scale, spriteEffects, 0f); } } diff --git a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs index 525ee50921..b8284905c8 100644 --- a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs +++ b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs @@ -440,9 +440,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares afterimageColor = npc.GetAlpha(afterimageColor); afterimageColor *= (numAfterimages - i) / 15f; Vector2 afterimageCenter = npc.oldPos[i] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; - afterimageCenter -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; + afterimageCenter -= new Vector2(texture.Width, texture.Height) / new Vector2(maxFramesX, maxFramesY) * npc.scale / 2f; afterimageCenter += vector * npc.scale + new Vector2(0f, npc.gfxOffY); - spriteBatch.Draw(texture, afterimageCenter, npc.frame, afterimageColor, npc.rotation, vector, npc.scale, spriteEffects, 0f); + spriteBatch.Draw(texture, afterimageCenter, npc.frame, afterimageColor, npc.oldRot[i], vector, npc.scale, spriteEffects, 0f); } } @@ -460,9 +460,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares afterimageColor = npc.GetAlpha(afterimageColor); afterimageColor *= (numAfterimages - i) / 15f; Vector2 afterimageCenter = npc.oldPos[i] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; - afterimageCenter -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; + afterimageCenter -= new Vector2(texture.Width, texture.Height) / new Vector2(maxFramesX, maxFramesY) * npc.scale / 2f; afterimageCenter += vector * npc.scale + new Vector2(0f, npc.gfxOffY); - spriteBatch.Draw(texture, afterimageCenter, npc.frame, afterimageColor, npc.rotation, vector, npc.scale, spriteEffects, 0f); + spriteBatch.Draw(texture, afterimageCenter, npc.frame, afterimageColor, npc.oldRot[i], vector, npc.scale, spriteEffects, 0f); } } diff --git a/NPCs/TownNPCs/FAP.cs b/NPCs/TownNPCs/FAP.cs index b218b741b0..88c334dc00 100644 --- a/NPCs/TownNPCs/FAP.cs +++ b/NPCs/TownNPCs/FAP.cs @@ -205,7 +205,7 @@ namespace CalamityMod.NPCs.TownNPCs if (Main.player[Main.myPlayer].HasItem(ModContent.ItemType())) { dialogue.Add("So...you found my special bottle. Hope you enjoy it, I know I will."); - dialogue.Add("Be sure to dismount me once in a while, I get tired. And besides, I can't rip you off-I mean give you excellent deals you won't find anywhere else if you're riding me 24/7."); + dialogue.Add("Be sure to dismount me once in a while, I get tired. And besides, I can't rip you off-I mean offer you excellent deals you won't find anywhere else if you're riding me 24/7."); dialogue.Add("Before you ask, no, I do NOT have a heart on my butt while in human form. Don't question my transformation preferences!"); }