diff --git a/NPCs/DraedonLabThings/RepairUnitCritter.cs b/NPCs/DraedonLabThings/RepairUnitCritter.cs index a742120ae1..a06d7b90a8 100644 --- a/NPCs/DraedonLabThings/RepairUnitCritter.cs +++ b/NPCs/DraedonLabThings/RepairUnitCritter.cs @@ -4,6 +4,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.DraedonLabThings public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) { - Texture2D critterTexture = Main.npcTexture[NPC.type]; + Texture2D critterTexture = TextureAssets.Npc[NPC.type].Value; Texture2D glowmask = ModContent.Request("CalamityMod/NPCs/DraedonLabThings/RepairUnitCritterGlowmask").Value; Vector2 drawPosition = NPC.Center - Main.screenPosition + Vector2.UnitY * NPC.gfxOffY; SpriteEffects direction = NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; diff --git a/NPCs/ExoMechs/Apollo/Apollo.cs b/NPCs/ExoMechs/Apollo/Apollo.cs index d9f7d7b29b..c5b1bd07ed 100644 --- a/NPCs/ExoMechs/Apollo/Apollo.cs +++ b/NPCs/ExoMechs/Apollo/Apollo.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.Graphics.Shaders; @@ -1449,7 +1450,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/ScarletDevilStreak").Value); int numAfterimages = ChargeComboFlash > 0f ? 0 : 5; - Texture2D texture = Main.npcTexture[NPC.type]; + Texture2D texture = TextureAssets.Npc[NPC.type].Value; Rectangle frame = new Rectangle(NPC.width * frameX, NPC.height * frameY, NPC.width, NPC.height); Vector2 origin = NPC.Size * 0.5f; Vector2 center = NPC.Center - Main.screenPosition; diff --git a/NPCs/ExoMechs/Ares/AresBody.cs b/NPCs/ExoMechs/Ares/AresBody.cs index 8ad3055ce9..6731ffff38 100644 --- a/NPCs/ExoMechs/Ares/AresBody.cs +++ b/NPCs/ExoMechs/Ares/AresBody.cs @@ -21,6 +21,7 @@ using System; using System.Collections.Generic; using System.IO; using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; @@ -987,7 +988,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares if (plasmaArm != -1) DrawArm(spriteBatch, Main.npc[plasmaArm].Center, armGlowmaskColor, armProperties[3].Item1, armProperties[3].Item2); - Texture2D texture = Main.npcTexture[NPC.type]; + Texture2D texture = TextureAssets.Npc[NPC.type].Value; Rectangle frame = new Rectangle(NPC.width * frameX, NPC.height * frameY, NPC.width, NPC.height); Vector2 vector = new Vector2(NPC.width / 2, NPC.height / 2); int numAfterimages = 5; diff --git a/NPCs/ExoMechs/Ares/AresGaussNuke.cs b/NPCs/ExoMechs/Ares/AresGaussNuke.cs index d618257530..33c38160b4 100644 --- a/NPCs/ExoMechs/Ares/AresGaussNuke.cs +++ b/NPCs/ExoMechs/Ares/AresGaussNuke.cs @@ -8,6 +8,7 @@ using Microsoft.Xna.Framework.Graphics; using System; using System.IO; using Terraria; +using Terraria.GameContent; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -522,7 +523,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture = Main.npcTexture[NPC.type]; + Texture2D texture = TextureAssets.Npc[NPC.type].Value; Rectangle frame = new Rectangle(NPC.width * frameX, NPC.height * frameY, NPC.width, NPC.height); Vector2 vector = new Vector2(NPC.width / 2, NPC.height / 2); Color afterimageBaseColor = Main.npc[(int)NPC.ai[2]].localAI[1] == (float)AresBody.Enraged.Yes ? Color.Red : Color.White; diff --git a/NPCs/ExoMechs/Ares/AresLaserCannon.cs b/NPCs/ExoMechs/Ares/AresLaserCannon.cs index 6d8cd0e3c5..fdf38b4b42 100644 --- a/NPCs/ExoMechs/Ares/AresLaserCannon.cs +++ b/NPCs/ExoMechs/Ares/AresLaserCannon.cs @@ -8,6 +8,7 @@ using Microsoft.Xna.Framework.Graphics; using System; using System.IO; using Terraria; +using Terraria.GameContent; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -565,7 +566,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture = Main.npcTexture[NPC.type]; + Texture2D texture = TextureAssets.Npc[NPC.type].Value; Rectangle frame = new Rectangle(NPC.width * frameX, NPC.height * frameY, NPC.width, NPC.height); Vector2 vector = new Vector2(NPC.width / 2, NPC.height / 2); Color afterimageBaseColor = Main.npc[(int)NPC.ai[2]].localAI[1] == (float)AresBody.Enraged.Yes ? Color.Red : Color.White; diff --git a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs index 612f0b9b4d..6c4069282d 100644 --- a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs +++ b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs @@ -8,6 +8,7 @@ using Microsoft.Xna.Framework.Graphics; using System; using System.IO; using Terraria; +using Terraria.GameContent; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -521,7 +522,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture = Main.npcTexture[NPC.type]; + Texture2D texture = TextureAssets.Npc[NPC.type].Value; Rectangle frame = new Rectangle(NPC.width * frameX, NPC.height * frameY, NPC.width, NPC.height); Vector2 vector = new Vector2(NPC.width / 2, NPC.height / 2); Color afterimageBaseColor = Main.npc[(int)NPC.ai[2]].localAI[1] == (float)AresBody.Enraged.Yes ? Color.Red : Color.White; diff --git a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs index 4d635de373..9017c0f5bf 100644 --- a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs +++ b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs @@ -8,6 +8,7 @@ using Microsoft.Xna.Framework.Graphics; using System; using System.IO; using Terraria; +using Terraria.GameContent; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -515,7 +516,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture = Main.npcTexture[NPC.type]; + Texture2D texture = TextureAssets.Npc[NPC.type].Value; Rectangle frame = new Rectangle(NPC.width * frameX, NPC.height * frameY, NPC.width, NPC.height); Vector2 vector = new Vector2(NPC.width / 2, NPC.height / 2); Color afterimageBaseColor = Main.npc[(int)NPC.ai[2]].localAI[1] == (float)AresBody.Enraged.Yes ? Color.Red : Color.White; diff --git a/NPCs/ExoMechs/Artemis/Artemis.cs b/NPCs/ExoMechs/Artemis/Artemis.cs index 09c55f97b5..8ab14949c8 100644 --- a/NPCs/ExoMechs/Artemis/Artemis.cs +++ b/NPCs/ExoMechs/Artemis/Artemis.cs @@ -10,6 +10,7 @@ using System; using System.Collections.Generic; using System.IO; using Terraria; +using Terraria.GameContent; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -1255,7 +1256,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/ScarletDevilStreak").Value); int numAfterimages = ChargeFlash > 0f ? 0 : 5; - Texture2D texture = Main.npcTexture[NPC.type]; + Texture2D texture = TextureAssets.Npc[NPC.type].Value; Rectangle frame = new Rectangle(NPC.width * frameX, NPC.height * frameY, NPC.width, NPC.height); Vector2 origin = NPC.Size * 0.5f; Vector2 center = NPC.Center - Main.screenPosition; diff --git a/NPCs/ExoMechs/Draedon.cs b/NPCs/ExoMechs/Draedon.cs index 36fd5db548..aea9ed4e58 100644 --- a/NPCs/ExoMechs/Draedon.cs +++ b/NPCs/ExoMechs/Draedon.cs @@ -6,6 +6,7 @@ using Microsoft.Xna.Framework.Graphics; using System; using System.IO; using Terraria; +using Terraria.GameContent; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -623,7 +624,7 @@ namespace CalamityMod.NPCs.ExoMechs { spriteBatch.EnterShaderRegion(); - Texture2D texture = Main.npcTexture[NPC.type]; + Texture2D texture = TextureAssets.Npc[NPC.type].Value; Texture2D glowmask = ModContent.Request("CalamityMod/NPCs/ExoMechs/DraedonGlowmask").Value; Rectangle frame = NPC.frame; diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs index 1521074e64..23a4bb217e 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody1.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; @@ -595,8 +596,8 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture = Main.npcTexture[NPC.type]; - Vector2 vector = new Vector2(Main.npcTexture[NPC.type].Width / 2, Main.npcTexture[NPC.type].Height / Main.npcFrameCount[NPC.type] / 2); + Texture2D texture = TextureAssets.Npc[NPC.type].Value; + Vector2 vector = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2); Vector2 center = NPC.Center - Main.screenPosition; center -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs index 46b7abdd03..29a394c2ce 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody2.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; @@ -596,8 +597,8 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture = Main.npcTexture[NPC.type]; - Vector2 vector = new Vector2(Main.npcTexture[NPC.type].Width / 2, Main.npcTexture[NPC.type].Height / Main.npcFrameCount[NPC.type] / 2); + Texture2D texture = TextureAssets.Npc[NPC.type].Value; + Vector2 vector = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2); Vector2 center = NPC.Center - Main.screenPosition; center -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs index 40402fa0b2..af49361cb4 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.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 CalamityMod.Skies; @@ -1024,8 +1025,8 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture = Main.npcTexture[NPC.type]; - Vector2 vector = new Vector2(Main.npcTexture[NPC.type].Width / 2, Main.npcTexture[NPC.type].Height / Main.npcFrameCount[NPC.type] / 2); + Texture2D texture = TextureAssets.Npc[NPC.type].Value; + Vector2 vector = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2); Vector2 center = NPC.Center - Main.screenPosition; center -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; diff --git a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs index d1c3e5e768..c11c7e6f13 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosTail.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; @@ -596,8 +597,8 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture = Main.npcTexture[NPC.type]; - Vector2 vector = new Vector2(Main.npcTexture[NPC.type].Width / 2, Main.npcTexture[NPC.type].Height / Main.npcFrameCount[NPC.type] / 2); + Texture2D texture = TextureAssets.Npc[NPC.type].Value; + Vector2 vector = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2); Vector2 center = NPC.Center - Main.screenPosition; center -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; diff --git a/NPCs/GreatSandShark/GreatSandShark.cs b/NPCs/GreatSandShark/GreatSandShark.cs index ff05b146ec..1adb0e43fd 100644 --- a/NPCs/GreatSandShark/GreatSandShark.cs +++ b/NPCs/GreatSandShark/GreatSandShark.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; @@ -531,8 +532,8 @@ namespace CalamityMod.NPCs.GreatSandShark } Color color24 = NPC.GetAlpha(drawColor); Color color25 = Lighting.GetColor((int)((double)NPC.position.X + (double)NPC.width * 0.5) / 16, (int)(((double)NPC.position.Y + (double)NPC.height * 0.5) / 16.0)); - Texture2D texture2D3 = Main.npcTexture[NPC.type]; - int num156 = Main.npcTexture[NPC.type].Height / Main.npcFrameCount[NPC.type]; + Texture2D texture2D3 = TextureAssets.Npc[NPC.type].Value; + int num156 = TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type]; int y3 = num156 * (int)NPC.frameCounter; Rectangle rectangle = new Rectangle(0, y3, texture2D3.Width, num156); Vector2 origin2 = rectangle.Size() / 2f;