From 977e7cb0bfaaa428f70b7ee858e0a30435ce69da Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Tue, 5 Apr 2022 21:02:50 -0500 Subject: [PATCH] 1 - Texture fixes. --- NPCs/Abyss/ChaoticPuffer.cs | 3 ++- NPCs/Abyss/ColossalSquid.cs | 3 ++- NPCs/Abyss/Cuttlefish.cs | 3 ++- NPCs/Abyss/DevilFish.cs | 3 ++- NPCs/Abyss/DevilFishAlt.cs | 3 ++- NPCs/Abyss/EidolonWyrmBody.cs | 3 ++- NPCs/Abyss/EidolonWyrmBodyAlt.cs | 3 ++- NPCs/Abyss/EidolonWyrmHead.cs | 3 ++- NPCs/Abyss/EidolonWyrmTail.cs | 3 ++- NPCs/Abyss/GiantSquid.cs | 3 ++- NPCs/Abyss/GulperEelBody.cs | 3 ++- NPCs/Abyss/GulperEelBodyAlt.cs | 3 ++- NPCs/Abyss/GulperEelHead.cs | 3 ++- NPCs/Abyss/GulperEelTail.cs | 3 ++- NPCs/Abyss/Laserfish.cs | 3 ++- NPCs/Abyss/LuminousCorvina.cs | 3 ++- NPCs/Abyss/MirageJelly.cs | 3 ++- NPCs/Abyss/ToxicMinnow.cs | 3 ++- NPCs/Abyss/Viperfish.cs | 3 ++- NPCs/Yharon/Yharon.cs | 3 ++- 20 files changed, 40 insertions(+), 20 deletions(-) diff --git a/NPCs/Abyss/ChaoticPuffer.cs b/NPCs/Abyss/ChaoticPuffer.cs index 715750b64e..8dcc1e2388 100644 --- a/NPCs/Abyss/ChaoticPuffer.cs +++ b/NPCs/Abyss/ChaoticPuffer.cs @@ -5,6 +5,7 @@ using CalamityMod.Projectiles.Enemy; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; @@ -139,7 +140,7 @@ namespace CalamityMod.NPCs.Abyss spriteEffects = SpriteEffects.FlipHorizontally; } Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y); - Vector2 vector11 = new Vector2((float)(Main.npcTexture[NPC.type].Width / 2), (float)(Main.npcTexture[NPC.type].Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 vector11 = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.Request("CalamityMod/NPCs/Abyss/ChaoticPufferGlow").Value.Width, (float)(ModContent.Request("CalamityMod/NPCs/Abyss/ChaoticPufferGlow").Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f; vector += vector11 * 1f + new Vector2(0f, 4f + NPC.gfxOffY); diff --git a/NPCs/Abyss/ColossalSquid.cs b/NPCs/Abyss/ColossalSquid.cs index 3bc1ecddb0..70ebf5d1e1 100644 --- a/NPCs/Abyss/ColossalSquid.cs +++ b/NPCs/Abyss/ColossalSquid.cs @@ -10,6 +10,7 @@ using Microsoft.Xna.Framework.Graphics; using System; using System.IO; using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; @@ -512,7 +513,7 @@ namespace CalamityMod.NPCs.Abyss { spriteEffects |= SpriteEffects.FlipVertically; } - Main.spriteBatch.Draw(Main.npcTexture[NPC.type], + Main.spriteBatch.Draw(TextureAssets.Npc[NPC.type].Value, new Vector2((float)(player.direction * 4), player.gfxOffY) + ((player.gravDir == 1f) ? player.Top : player.Bottom) - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(NPC.frame), NPC.GetAlpha(color), NPC.rotation, NPC.frame.Size() / 2f, NPC.scale, spriteEffects, 0f); } diff --git a/NPCs/Abyss/Cuttlefish.cs b/NPCs/Abyss/Cuttlefish.cs index fbeda18858..11f99b7a29 100644 --- a/NPCs/Abyss/Cuttlefish.cs +++ b/NPCs/Abyss/Cuttlefish.cs @@ -5,6 +5,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -358,7 +359,7 @@ namespace CalamityMod.NPCs.Abyss spriteEffects = SpriteEffects.FlipHorizontally; } Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y); - Vector2 vector11 = new Vector2((float)(Main.npcTexture[NPC.type].Width / 2), (float)(Main.npcTexture[NPC.type].Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 vector11 = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.Request("CalamityMod/NPCs/Abyss/CuttlefishGlow").Value.Width, (float)(ModContent.Request("CalamityMod/NPCs/Abyss/CuttlefishGlow").Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f; vector += vector11 * 1f + new Vector2(0f, 4f + NPC.gfxOffY); diff --git a/NPCs/Abyss/DevilFish.cs b/NPCs/Abyss/DevilFish.cs index 580d8efff0..ec23fe245b 100644 --- a/NPCs/Abyss/DevilFish.cs +++ b/NPCs/Abyss/DevilFish.cs @@ -8,6 +8,7 @@ using Microsoft.Xna.Framework.Graphics; using System; using System.IO; using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; @@ -274,7 +275,7 @@ namespace CalamityMod.NPCs.Abyss spriteEffects = SpriteEffects.FlipHorizontally; } Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y); - Vector2 vector11 = new Vector2((float)(Main.npcTexture[NPC.type].Width / 2), (float)(Main.npcTexture[NPC.type].Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 vector11 = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.Request("CalamityMod/NPCs/Abyss/DevilFishGlow").Value.Width, (float)(ModContent.Request("CalamityMod/NPCs/Abyss/DevilFishGlow").Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f; vector += vector11 * 1f + new Vector2(0f, 4f + NPC.gfxOffY); diff --git a/NPCs/Abyss/DevilFishAlt.cs b/NPCs/Abyss/DevilFishAlt.cs index 2d986f4a7c..61a7358ea3 100644 --- a/NPCs/Abyss/DevilFishAlt.cs +++ b/NPCs/Abyss/DevilFishAlt.cs @@ -8,6 +8,7 @@ using Microsoft.Xna.Framework.Graphics; using System; using System.IO; using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; @@ -274,7 +275,7 @@ namespace CalamityMod.NPCs.Abyss spriteEffects = SpriteEffects.FlipHorizontally; } Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y); - Vector2 vector11 = new Vector2((float)(Main.npcTexture[NPC.type].Width / 2), (float)(Main.npcTexture[NPC.type].Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 vector11 = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.Request("CalamityMod/NPCs/Abyss/DevilFishGlowAlt").Value.Width, (float)(ModContent.Request("CalamityMod/NPCs/Abyss/DevilFishGlowAlt").Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f; vector += vector11 * 1f + new Vector2(0f, 4f + NPC.gfxOffY); diff --git a/NPCs/Abyss/EidolonWyrmBody.cs b/NPCs/Abyss/EidolonWyrmBody.cs index 5ddbe1ad02..4ebe8983c6 100644 --- a/NPCs/Abyss/EidolonWyrmBody.cs +++ b/NPCs/Abyss/EidolonWyrmBody.cs @@ -1,6 +1,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -124,7 +125,7 @@ namespace CalamityMod.NPCs.Abyss spriteEffects = SpriteEffects.FlipHorizontally; } Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y); - Vector2 vector11 = new Vector2((float)(Main.npcTexture[NPC.type].Width / 2), (float)(Main.npcTexture[NPC.type].Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 vector11 = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.Request("CalamityMod/NPCs/Abyss/EidolonWyrmBodyGlow").Value.Width, (float)(ModContent.Request("CalamityMod/NPCs/Abyss/EidolonWyrmBodyGlow").Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f; vector += vector11 * 1f + new Vector2(0f, 4f + NPC.gfxOffY); diff --git a/NPCs/Abyss/EidolonWyrmBodyAlt.cs b/NPCs/Abyss/EidolonWyrmBodyAlt.cs index 132eb9ece9..08a16edce5 100644 --- a/NPCs/Abyss/EidolonWyrmBodyAlt.cs +++ b/NPCs/Abyss/EidolonWyrmBodyAlt.cs @@ -1,6 +1,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -124,7 +125,7 @@ namespace CalamityMod.NPCs.Abyss spriteEffects = SpriteEffects.FlipHorizontally; } Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y); - Vector2 vector11 = new Vector2((float)(Main.npcTexture[NPC.type].Width / 2), (float)(Main.npcTexture[NPC.type].Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 vector11 = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.Request("CalamityMod/NPCs/Abyss/EidolonWyrmBodyAltGlow").Value.Width, (float)(ModContent.Request("CalamityMod/NPCs/Abyss/EidolonWyrmBodyAltGlow").Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f; vector += vector11 * 1f + new Vector2(0f, 4f + NPC.gfxOffY); diff --git a/NPCs/Abyss/EidolonWyrmHead.cs b/NPCs/Abyss/EidolonWyrmHead.cs index 844636f98a..dae4fdcf6b 100644 --- a/NPCs/Abyss/EidolonWyrmHead.cs +++ b/NPCs/Abyss/EidolonWyrmHead.cs @@ -10,6 +10,7 @@ using Microsoft.Xna.Framework.Graphics; using System; using System.IO; using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; @@ -458,7 +459,7 @@ namespace CalamityMod.NPCs.Abyss spriteEffects = SpriteEffects.FlipHorizontally; } Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y); - Vector2 vector11 = new Vector2((float)(Main.npcTexture[NPC.type].Width / 2), (float)(Main.npcTexture[NPC.type].Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 vector11 = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.Request("CalamityMod/NPCs/Abyss/EidolonWyrmHeadGlow").Value.Width, (float)(ModContent.Request("CalamityMod/NPCs/Abyss/EidolonWyrmHeadGlow").Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f; vector += vector11 * 1f + new Vector2(0f, 4f + NPC.gfxOffY); diff --git a/NPCs/Abyss/EidolonWyrmTail.cs b/NPCs/Abyss/EidolonWyrmTail.cs index ce1f9868fe..65c362e30b 100644 --- a/NPCs/Abyss/EidolonWyrmTail.cs +++ b/NPCs/Abyss/EidolonWyrmTail.cs @@ -1,6 +1,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -124,7 +125,7 @@ namespace CalamityMod.NPCs.Abyss spriteEffects = SpriteEffects.FlipHorizontally; } Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y); - Vector2 vector11 = new Vector2((float)(Main.npcTexture[NPC.type].Width / 2), (float)(Main.npcTexture[NPC.type].Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 vector11 = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.Request("CalamityMod/NPCs/Abyss/EidolonWyrmTailGlow").Value.Width, (float)(ModContent.Request("CalamityMod/NPCs/Abyss/EidolonWyrmTailGlow").Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f; vector += vector11 * 1f + new Vector2(0f, 4f + NPC.gfxOffY); diff --git a/NPCs/Abyss/GiantSquid.cs b/NPCs/Abyss/GiantSquid.cs index be31fd9462..de68f5fe48 100644 --- a/NPCs/Abyss/GiantSquid.cs +++ b/NPCs/Abyss/GiantSquid.cs @@ -8,6 +8,7 @@ using Microsoft.Xna.Framework.Graphics; using System; using System.IO; using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -219,7 +220,7 @@ namespace CalamityMod.NPCs.Abyss spriteEffects = SpriteEffects.FlipHorizontally; } Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y); - Vector2 vector11 = new Vector2((float)(Main.npcTexture[NPC.type].Width / 2), (float)(Main.npcTexture[NPC.type].Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 vector11 = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.Request("CalamityMod/NPCs/Abyss/GiantSquidGlow").Value.Width, (float)(ModContent.Request("CalamityMod/NPCs/Abyss/GiantSquidGlow").Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f; vector += vector11 * 1f + new Vector2(0f, 4f + NPC.gfxOffY); diff --git a/NPCs/Abyss/GulperEelBody.cs b/NPCs/Abyss/GulperEelBody.cs index e0d0d629f4..ffe88d527d 100644 --- a/NPCs/Abyss/GulperEelBody.cs +++ b/NPCs/Abyss/GulperEelBody.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Placeables.Banners; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -129,7 +130,7 @@ namespace CalamityMod.NPCs.Abyss spriteEffects = SpriteEffects.FlipHorizontally; } Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y); - Vector2 vector11 = new Vector2((float)(Main.npcTexture[NPC.type].Width / 2), (float)(Main.npcTexture[NPC.type].Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 vector11 = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.Request("CalamityMod/NPCs/Abyss/GulperEelBodyGlow").Value.Width, (float)(ModContent.Request("CalamityMod/NPCs/Abyss/GulperEelBodyGlow").Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f; vector += vector11 * 1f + new Vector2(0f, 4f + NPC.gfxOffY); diff --git a/NPCs/Abyss/GulperEelBodyAlt.cs b/NPCs/Abyss/GulperEelBodyAlt.cs index 91c7a56f2d..198b813ffc 100644 --- a/NPCs/Abyss/GulperEelBodyAlt.cs +++ b/NPCs/Abyss/GulperEelBodyAlt.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Placeables.Banners; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -129,7 +130,7 @@ namespace CalamityMod.NPCs.Abyss spriteEffects = SpriteEffects.FlipHorizontally; } Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y); - Vector2 vector11 = new Vector2((float)(Main.npcTexture[NPC.type].Width / 2), (float)(Main.npcTexture[NPC.type].Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 vector11 = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.Request("CalamityMod/NPCs/Abyss/GulperEelBodyAltGlow").Value.Width, (float)(ModContent.Request("CalamityMod/NPCs/Abyss/GulperEelBodyAltGlow").Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f; vector += vector11 * 1f + new Vector2(0f, 4f + NPC.gfxOffY); diff --git a/NPCs/Abyss/GulperEelHead.cs b/NPCs/Abyss/GulperEelHead.cs index 61582372a8..562975159f 100644 --- a/NPCs/Abyss/GulperEelHead.cs +++ b/NPCs/Abyss/GulperEelHead.cs @@ -7,6 +7,7 @@ using Microsoft.Xna.Framework.Graphics; using System; using System.IO; using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -313,7 +314,7 @@ namespace CalamityMod.NPCs.Abyss spriteEffects = SpriteEffects.FlipHorizontally; } Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y); - Vector2 vector11 = new Vector2((float)(Main.npcTexture[NPC.type].Width / 2), (float)(Main.npcTexture[NPC.type].Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 vector11 = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.Request("CalamityMod/NPCs/Abyss/GulperEelHeadGlow").Value.Width, (float)(ModContent.Request("CalamityMod/NPCs/Abyss/GulperEelHeadGlow").Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f; vector += vector11 * 1f + new Vector2(0f, 4f + NPC.gfxOffY); diff --git a/NPCs/Abyss/GulperEelTail.cs b/NPCs/Abyss/GulperEelTail.cs index 2149170a6f..95457edf96 100644 --- a/NPCs/Abyss/GulperEelTail.cs +++ b/NPCs/Abyss/GulperEelTail.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Placeables.Banners; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -129,7 +130,7 @@ namespace CalamityMod.NPCs.Abyss spriteEffects = SpriteEffects.FlipHorizontally; } Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y); - Vector2 vector11 = new Vector2((float)(Main.npcTexture[NPC.type].Width / 2), (float)(Main.npcTexture[NPC.type].Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 vector11 = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.Request("CalamityMod/NPCs/Abyss/GulperEelTailGlow").Value.Width, (float)(ModContent.Request("CalamityMod/NPCs/Abyss/GulperEelTailGlow").Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f; vector += vector11 * 1f + new Vector2(0f, 4f + NPC.gfxOffY); diff --git a/NPCs/Abyss/Laserfish.cs b/NPCs/Abyss/Laserfish.cs index 4b1794b12d..9a04c92849 100644 --- a/NPCs/Abyss/Laserfish.cs +++ b/NPCs/Abyss/Laserfish.cs @@ -5,6 +5,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.IO; using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -89,7 +90,7 @@ namespace CalamityMod.NPCs.Abyss spriteEffects = SpriteEffects.FlipHorizontally; } Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y); - Vector2 vector11 = new Vector2((float)(Main.npcTexture[NPC.type].Width / 2), (float)(Main.npcTexture[NPC.type].Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 vector11 = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.Request("CalamityMod/NPCs/Abyss/LaserfishGlow").Value.Width, (float)(ModContent.Request("CalamityMod/NPCs/Abyss/LaserfishGlow").Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f; vector += vector11 * 1f + new Vector2(0f, 4f + NPC.gfxOffY); diff --git a/NPCs/Abyss/LuminousCorvina.cs b/NPCs/Abyss/LuminousCorvina.cs index a117568ed1..c325b8440b 100644 --- a/NPCs/Abyss/LuminousCorvina.cs +++ b/NPCs/Abyss/LuminousCorvina.cs @@ -9,6 +9,7 @@ using Microsoft.Xna.Framework.Graphics; using System; using System.IO; using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; @@ -263,7 +264,7 @@ namespace CalamityMod.NPCs.Abyss spriteEffects = SpriteEffects.FlipHorizontally; } Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y); - Vector2 vector11 = new Vector2((float)(Main.npcTexture[NPC.type].Width / 2), (float)(Main.npcTexture[NPC.type].Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 vector11 = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.Request("CalamityMod/NPCs/Abyss/LuminousCorvinaGlow").Value.Width, (float)(ModContent.Request("CalamityMod/NPCs/Abyss/LuminousCorvinaGlow").Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f; vector += vector11 * 1f + new Vector2(0f, 4f + NPC.gfxOffY); diff --git a/NPCs/Abyss/MirageJelly.cs b/NPCs/Abyss/MirageJelly.cs index 8b8355ab2b..86cc8e73b9 100644 --- a/NPCs/Abyss/MirageJelly.cs +++ b/NPCs/Abyss/MirageJelly.cs @@ -7,6 +7,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.IO; using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -175,7 +176,7 @@ namespace CalamityMod.NPCs.Abyss spriteEffects = SpriteEffects.FlipHorizontally; } Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y); - Vector2 vector11 = new Vector2((float)(Main.npcTexture[NPC.type].Width / 2), (float)(Main.npcTexture[NPC.type].Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 vector11 = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.Request("CalamityMod/NPCs/Abyss/MirageJellyGlow").Value.Width, (float)(ModContent.Request("CalamityMod/NPCs/Abyss/MirageJellyGlow").Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f; vector += vector11 * 1f + new Vector2(0f, 4f + NPC.gfxOffY); diff --git a/NPCs/Abyss/ToxicMinnow.cs b/NPCs/Abyss/ToxicMinnow.cs index 4c2042fc5d..5a6c9d4884 100644 --- a/NPCs/Abyss/ToxicMinnow.cs +++ b/NPCs/Abyss/ToxicMinnow.cs @@ -7,6 +7,7 @@ using Microsoft.Xna.Framework.Graphics; using System; using System.IO; using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; @@ -105,7 +106,7 @@ namespace CalamityMod.NPCs.Abyss spriteEffects = SpriteEffects.FlipHorizontally; } Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y); - Vector2 vector11 = new Vector2((float)(Main.npcTexture[NPC.type].Width / 2), (float)(Main.npcTexture[NPC.type].Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 vector11 = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.Request("CalamityMod/NPCs/Abyss/ToxicMinnowGlow").Value.Width, (float)(ModContent.Request("CalamityMod/NPCs/Abyss/ToxicMinnowGlow").Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f; vector += vector11 * 1f + new Vector2(0f, 4f + NPC.gfxOffY); diff --git a/NPCs/Abyss/Viperfish.cs b/NPCs/Abyss/Viperfish.cs index 51e223e1cb..636e9d2052 100644 --- a/NPCs/Abyss/Viperfish.cs +++ b/NPCs/Abyss/Viperfish.cs @@ -6,6 +6,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.IO; using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -87,7 +88,7 @@ namespace CalamityMod.NPCs.Abyss spriteEffects = SpriteEffects.FlipHorizontally; } Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y); - Vector2 vector11 = new Vector2((float)(Main.npcTexture[NPC.type].Width / 2), (float)(Main.npcTexture[NPC.type].Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 vector11 = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)ModContent.Request("CalamityMod/NPCs/Abyss/ViperfishGlow").Value.Width, (float)(ModContent.Request("CalamityMod/NPCs/Abyss/ViperfishGlow").Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f; vector += vector11 * 1f + new Vector2(0f, 4f + NPC.gfxOffY); diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index dbf9d6aad8..309c721aff 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -26,6 +26,7 @@ using System; using System.Collections.Generic; using System.IO; using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; @@ -2579,7 +2580,7 @@ namespace CalamityMod.NPCs.Yharon if (NPC.spriteDirection == 1) spriteEffects = ai2 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - Texture2D texture = Main.npcTexture[NPC.type]; + Texture2D texture = TextureAssets.Npc[NPC.type].Value; Vector2 vector11 = new Vector2(texture.Width / 2, texture.Height / Main.npcFrameCount[NPC.type] / 2); Color color = lightColor; Color invincibleColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, 0);