diff --git a/CalPlayer/CalamityPlayerDrawEffects.cs b/CalPlayer/CalamityPlayerDrawEffects.cs index 8248d591f3..1a4cf19838 100644 --- a/CalPlayer/CalamityPlayerDrawEffects.cs +++ b/CalPlayer/CalamityPlayerDrawEffects.cs @@ -32,6 +32,7 @@ using CalamityMod.Projectiles.Magic; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using System; using System.Collections.Generic; using System.Linq; @@ -45,843 +46,16 @@ namespace CalamityMod.CalPlayer { public partial class CalamityPlayer : ModPlayer { - #region Profaned Moonlight Colors - public static readonly List MoonlightDyeDayColors = new List() - { - new Color(255, 163, 56), - new Color(235, 30, 19), - new Color(242, 48, 187), - }; - public static readonly List MoonlightDyeNightColors = new List() - { - new Color(24, 134, 198), - new Color(130, 40, 150), - new Color(40, 64, 150), - }; - - public static void DetermineMoonlightDyeColors(out Color drawColor, Color dayColor, Color nightColor) - { - int totalTime = Main.dayTime ? 54000 : 32400; - float transitionTime = 5400; - float interval = Utils.InverseLerp(0f, transitionTime, (float)Main.time, true) + Utils.InverseLerp(totalTime - transitionTime, totalTime, (float)Main.time, true); - if (Main.dayTime) - { - // Dusk. - if (Main.time >= totalTime - transitionTime) - drawColor = Color.Lerp(dayColor, nightColor, Utils.InverseLerp(totalTime - transitionTime, totalTime, (float)Main.time, true)); - // Dawn. - else if (Main.time <= transitionTime) - drawColor = Color.Lerp(nightColor, dayColor, interval); - else - drawColor = dayColor; - } - else drawColor = nightColor; - } - - public static Color GetCurrentMoonlightDyeColor(float angleOffset = 0f) - { - float interval = (float)Math.Cos(Main.GlobalTimeWrappedHourly * 0.6f + angleOffset) * 0.5f + 0.5f; - interval = MathHelper.Clamp(interval, 0f, 0.995f); - Color dayColorToUse = CalamityUtils.MulticolorLerp(interval, MoonlightDyeDayColors.ToArray()); - Color nightColorToUse = CalamityUtils.MulticolorLerp(interval, MoonlightDyeNightColors.ToArray()); - DetermineMoonlightDyeColors(out Color drawColor, dayColorToUse, nightColorToUse); - return drawColor; - } - #endregion - - #region Draw Layers - - public static readonly PlayerLayer MiscEffectsBack = new PlayerLayer("CalamityMod", "MiscEffectsBack", PlayerLayer.MiscEffectsBack, drawInfo => - { - if (drawInfo.shadow != 0f) - return; - - Player drawPlayer = drawInfo.drawPlayer; - CalamityPlayer modPlayer = drawPlayer.Calamity(); - - modPlayer.ProvidenceBurnEffectDrawer.DrawSet(drawPlayer.Bottom - Vector2.UnitY * 10f); - modPlayer.ProvidenceBurnEffectDrawer.SpawnAreaCompactness = 18f; - modPlayer.ProvidenceBurnEffectDrawer.RelativePower = 0.4f; - - if (modPlayer.sirenIce) - { - Texture2D texture = ModContent.Request("CalamityMod/ExtraTextures/IceShield"); - int drawX = (int)(drawInfo.position.X + drawPlayer.width / 2f - Main.screenPosition.X); - int drawY = (int)(drawInfo.position.Y + drawPlayer.height / 2f - Main.screenPosition.Y); - DrawData data = new DrawData(texture, new Vector2(drawX, drawY), null, Color.White, 0f, texture.Size() * 0.5f, 1f, SpriteEffects.None, 0); - Main.playerDrawData.Add(data); - } - if (modPlayer.amidiasBlessing) - { - Texture2D texture = ModContent.Request("CalamityMod/ExtraTextures/AmidiasBubble"); - int drawX = (int)(drawInfo.position.X + drawPlayer.width / 2f - Main.screenPosition.X); - int drawY = (int)(drawInfo.position.Y + drawPlayer.height / 2f - Main.screenPosition.Y); //4 - DrawData data = new DrawData(texture, new Vector2(drawX, drawY), null, Color.White, 0f, texture.Size() * 0.5f, 1f, SpriteEffects.None, 0); - Main.playerDrawData.Add(data); - } - }); - - public static readonly PlayerLayer Skin = new PlayerLayer("CalamityMod", "Skin", PlayerLayer.Skin, drawInfo => - { - Player drawPlayer = drawInfo.drawPlayer; - CalamityPlayer modPlayer = drawPlayer.Calamity(); - if (drawInfo.shadow != 0f || drawPlayer.dead) - { - return; - } - }); - - public static readonly PlayerLayer GemTechGems = new PlayerLayer("CalamityMod", "GemTechGems", PlayerLayer.Skin, drawInfo => - { - Player drawPlayer = drawInfo.drawPlayer; - CalamityPlayer modPlayer = drawPlayer.Calamity(); - if (drawInfo.shadow != 0f || drawPlayer.dead || !modPlayer.GemTechSet || drawPlayer.Calamity().andromedaState != AndromedaPlayerState.Inactive) - return; - - for (int i = 5; i >= 0; i--) - { - Texture2D gemTexture; - float pulseFactor = 1.8f; - GemTechArmorGemType gemType; - switch (i) - { - case 0: - default: - gemTexture = ModContent.Request("CalamityMod/ExtraTextures/GemTechArmor/RedGem"); - gemType = GemTechArmorGemType.Rogue; - break; - case 1: - gemTexture = ModContent.Request("CalamityMod/ExtraTextures/GemTechArmor/YellowGem"); - gemType = GemTechArmorGemType.Melee; - break; - case 2: - gemTexture = ModContent.Request("CalamityMod/ExtraTextures/GemTechArmor/GreenGem"); - gemType = GemTechArmorGemType.Ranged; - break; - case 3: - gemTexture = ModContent.Request("CalamityMod/ExtraTextures/GemTechArmor/BlueGem"); - gemType = GemTechArmorGemType.Summoner; - break; - case 4: - gemTexture = ModContent.Request("CalamityMod/ExtraTextures/GemTechArmor/PurpleGem"); - gemType = GemTechArmorGemType.Magic; - break; - case 5: - gemTexture = ModContent.Request("CalamityMod/ExtraTextures/GemTechArmor/PinkGem"); - gemType = GemTechArmorGemType.Base; - pulseFactor = 2.5f; - break; - } - - // Don't bother doing anything else if the gem is inactive. - if (!modPlayer.GemTechState.GemIsActive(gemType)) - continue; - - float drawOffsetAngle = modPlayer.GemTechState.CalculateGemOffsetAngle(gemType); - float gemOpacity = MathHelper.Lerp(0.85f, 1.05f, (float)Math.Cos(Main.GlobalTimeWrappedHourly * 2.3f) * 0.5f + 0.5f); - - // Incorporate a sinusoidal pulse into the pulse factor. - pulseFactor *= (float)Math.Cos(Main.GlobalTimeWrappedHourly * 0.61f + drawOffsetAngle); - - // Somewhat unorthodox way of creating an illusion of gems being drawn behind the player via orbiting. - // Instead of actually messing with a Z position it simply fades away when the sine of the draw - // offset angle is in the low negatives. - gemOpacity *= Utils.InverseLerp(-0.75f, -0.51f, (float)Math.Sin(drawOffsetAngle), true); - - Vector2 baseDrawPosition = modPlayer.GemTechState.CalculateGemPosition(gemType) - Main.screenPosition; - - // Draw back afterimages. - for (int j = 0; j < 5; j++) - { - Color backAfterimageColor = Main.hslToRgb((Main.GlobalTimeWrappedHourly * 0.47f + j / 5f) % 1f, 1f, 0.67f); - backAfterimageColor = Color.Lerp(backAfterimageColor, Color.White, 0.64f) * gemOpacity * 0.24f; - Vector2 drawPosition = baseDrawPosition + (MathHelper.TwoPi * j / 5f).ToRotationVector2() * pulseFactor; - DrawData gemBackDrawData = new DrawData(gemTexture, drawPosition, null, backAfterimageColor, 0f, gemTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0); - Main.playerDrawData.Add(gemBackDrawData); - } - - // Draw the main gem. - Color baseGemColor = Main.hslToRgb(Main.GlobalTimeWrappedHourly * 0.51f % 1f, 1f, 0.67f); - baseGemColor = Color.Lerp(baseGemColor, Color.White, 0.56f); - baseGemColor.A = 105; - baseGemColor *= gemOpacity; - DrawData gemDrawData = new DrawData(gemTexture, baseDrawPosition, null, baseGemColor, 0f, gemTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0); - Main.playerDrawData.Add(gemDrawData); - } - }); - - public static readonly PlayerLayer MiscEffectsFront = new PlayerLayer("CalamityMod", "MiscEffectsFront", PlayerLayer.MiscEffectsFront, drawInfo => - { - if (drawInfo.shadow != 0f) - return; - Player drawPlayer = drawInfo.drawPlayer; - Item currentlyHeldItem = drawPlayer.ActiveItem(); - - // Go through the old positions for the player. - for (int i = drawPlayer.Calamity().OldPositions.Length - 1; i > 0; i--) - { - if (drawPlayer.Calamity().OldPositions[i - 1] == Vector2.Zero) - drawPlayer.Calamity().OldPositions[i - 1] = drawPlayer.position; - drawPlayer.Calamity().OldPositions[i] = drawPlayer.Calamity().OldPositions[i - 1]; - } - drawPlayer.Calamity().OldPositions[0] = drawPlayer.position; - - // Kamei trail/afterimage effect. - if (drawPlayer.Calamity().kamiBoost) - { - List existingDrawData = Main.playerDrawData; - for (int i = 0; i < drawPlayer.Calamity().OldPositions.Length; i++) - { - float completionRatio = i / (float)drawPlayer.Calamity().OldPositions.Length; - float scale = MathHelper.Lerp(1f, 0.5f, completionRatio); - float opacity = MathHelper.Lerp(0.25f, 0.08f, completionRatio); - List afterimages = new List(); - for (int j = 0; j < existingDrawData.Count; j++) - { - var drawData = existingDrawData[j]; - drawData.position = existingDrawData[j].position - drawPlayer.position + drawPlayer.oldPosition; - drawData.color = Color.Cyan * opacity; - drawData.color.G = (byte)(drawData.color.G * 1.6); - drawData.color.B = (byte)(drawData.color.B * 1.2); - drawData.scale = new Vector2(scale); - afterimages.Add(drawData); - } - Main.playerDrawData.InsertRange(0, afterimages); - } - } - - // Cobalt set trail/afterimage effect. - if (drawPlayer.Calamity().CobaltSet) - { - List existingDrawData = Main.playerDrawData; - for (int i = 0; i < drawPlayer.Calamity().OldPositions.Length; i++) - { - float completionRatio = i / (float)drawPlayer.Calamity().OldPositions.Length; - float scale = MathHelper.Lerp(1f, 0.5f, completionRatio); - float opacity = MathHelper.Lerp(0.23f, 0.07f, completionRatio) * CobaltArmorSetChange.CalculateMovementSpeedInterpolant(drawPlayer); - List afterimages = new List(); - for (int j = 0; j < existingDrawData.Count; j++) - { - var drawData = existingDrawData[j]; - drawData.position = existingDrawData[j].position - drawPlayer.position + drawPlayer.oldPosition; - drawData.color = Color.Cyan * opacity; - drawData.color.G = (byte)(drawData.color.G * 0.87); - drawData.color.B = (byte)(drawData.color.B * 1.24); - drawData.scale = new Vector2(scale); - afterimages.Add(drawData); - } - Main.playerDrawData.InsertRange(0, afterimages); - } - } - - if (!drawPlayer.frozen && - currentlyHeldItem.type > ItemID.None && - !drawPlayer.dead && - !currentlyHeldItem.noUseGraphic && - (!drawPlayer.wet || !currentlyHeldItem.noWet)) - { - SpriteEffects drawEffects; - - if (drawPlayer.direction == 1) - drawEffects = SpriteEffects.None; - else drawEffects = SpriteEffects.FlipHorizontally; - - if (drawPlayer.gravDir != 1f) - drawEffects |= SpriteEffects.FlipVertically; - - if ((drawPlayer.itemAnimation > 0 && currentlyHeldItem.useStyle != 0) || (currentlyHeldItem.holdStyle > 0 && !drawPlayer.pulley)) - { - // Staffs. - if (currentlyHeldItem.type == ModContent.ItemType() || - currentlyHeldItem.type == ModContent.ItemType() || - currentlyHeldItem.type == ModContent.ItemType() || - currentlyHeldItem.type == ModContent.ItemType() || - (currentlyHeldItem.type == ModContent.ItemType() && currentlyHeldItem.useStyle == ItemUseStyleID.Shoot)) - { - Texture2D texture = ModContent.Request("CalamityMod/Items/Weapons/Magic/DeathhailStaffGlow"); - if (currentlyHeldItem.type == ModContent.ItemType()) - texture = ModContent.Request("CalamityMod/Items/Weapons/Magic/VesuviusGlow"); - else if (currentlyHeldItem.type == ModContent.ItemType()) - texture = ModContent.Request("CalamityMod/Items/Weapons/Magic/SoulPiercerGlow"); - else if (currentlyHeldItem.type == ModContent.ItemType()) - texture = ModContent.Request("CalamityMod/Items/Weapons/Magic/FatesRevealGlow"); - else if (currentlyHeldItem.type == ModContent.ItemType()) - texture = ModContent.Request("CalamityMod/Items/Weapons/Melee/PrismaticBreakerGlow"); - - float rotation = drawPlayer.itemRotation + MathHelper.PiOver4 * (float)drawPlayer.direction; - int xOffset = 0; - Vector2 origin = new Vector2(0f, Main.itemTexture[currentlyHeldItem.type].Height); - - if (drawPlayer.gravDir == -1f) - { - if (drawPlayer.direction == -1) - { - rotation += MathHelper.PiOver2; - origin = new Vector2(Main.itemTexture[currentlyHeldItem.type].Width, 0f); - xOffset -= Main.itemTexture[currentlyHeldItem.type].Width; - } - else - { - rotation -= MathHelper.PiOver2; - origin = Vector2.Zero; - } - } - else if (drawPlayer.direction == -1) - { - origin = new Vector2(Main.itemTexture[currentlyHeldItem.type].Width, (float)Main.itemTexture[currentlyHeldItem.type].Height); - xOffset -= Main.itemTexture[currentlyHeldItem.type].Width; - } - - DrawData data = new DrawData(texture, - new Vector2((int)(drawPlayer.itemLocation.X - Main.screenPosition.X + origin.X + xOffset), (int)(drawPlayer.itemLocation.Y - Main.screenPosition.Y)), - Main.itemTexture[currentlyHeldItem.type].Bounds, - Color.White, - rotation, - origin, - currentlyHeldItem.scale, - drawEffects, - 0); - - Main.playerDrawData.Add(data); - } - - // Bow and Book. - else if (currentlyHeldItem.type == ModContent.ItemType() || - currentlyHeldItem.type == ModContent.ItemType() || - currentlyHeldItem.type == ModContent.ItemType() || - currentlyHeldItem.type == ModContent.ItemType() || - currentlyHeldItem.type == ModContent.ItemType() || - currentlyHeldItem.type == ModContent.ItemType()) - { - Texture2D texture = ModContent.Request("CalamityMod/Items/Weapons/Ranged/DeathwindGlow"); - int offsetX = 10; - if (currentlyHeldItem.type == ModContent.ItemType()) - { - texture = ModContent.Request("CalamityMod/Items/Weapons/Magic/ApotheosisGlow"); - offsetX = 6; - } - else if (currentlyHeldItem.type == ModContent.ItemType()) - { - texture = ModContent.Request("CalamityMod/Items/Weapons/Ranged/CleansingBlazeGlow"); - offsetX = 37; - } - else if (currentlyHeldItem.type == ModContent.ItemType()) - { - texture = ModContent.Request("CalamityMod/Items/Weapons/Magic/SubsumingVortexGlow"); - offsetX = 9; - } - else if (currentlyHeldItem.type == ModContent.ItemType()) - { - texture = ModContent.Request("CalamityMod/Items/Weapons/Ranged/AuroraBlazerGlow"); - offsetX = 44; - } - else if (currentlyHeldItem.type == ModContent.ItemType()) - { - texture = ModContent.Request("CalamityMod/Items/Weapons/Ranged/AuralisGlow"); - offsetX = 62; - } - - Vector2 center = Main.itemTexture[currentlyHeldItem.type].Size() * 0.5f; - int originOffsetX = (int)center.X - offsetX; - - Vector2 origin = new Vector2(-originOffsetX, (float)(Main.itemTexture[currentlyHeldItem.type].Height / 2)); - if (drawPlayer.direction == -1) - origin = new Vector2((float)(Main.itemTexture[currentlyHeldItem.type].Width + originOffsetX), (float)(Main.itemTexture[currentlyHeldItem.type].Height / 2)); - - DrawData data = new DrawData(texture, - new Vector2((int)(drawPlayer.itemLocation.X - Main.screenPosition.X + center.X), (int)(drawPlayer.itemLocation.Y - Main.screenPosition.Y + center.Y)), - Main.itemTexture[currentlyHeldItem.type].Bounds, - Color.White, - drawPlayer.itemRotation, - origin, - currentlyHeldItem.scale, - drawEffects, - 0); - - Main.playerDrawData.Add(data); - } - - // Sword. - else if (currentlyHeldItem.type == ModContent.ItemType() || - currentlyHeldItem.type == ModContent.ItemType() || - currentlyHeldItem.type == ModContent.ItemType() || - currentlyHeldItem.type == ModContent.ItemType() || - currentlyHeldItem.type == ModContent.ItemType() || - (currentlyHeldItem.type == ModContent.ItemType() && currentlyHeldItem.useStyle == ItemUseStyleID.Swing)) - { - Texture2D texture = ModContent.Request("CalamityMod/Items/Weapons/Melee/ExcelsusGlow"); - if (currentlyHeldItem.type == ModContent.ItemType()) - texture = ModContent.Request("CalamityMod/Items/Weapons/Melee/EssenceFlayerGlow"); - else if (currentlyHeldItem.type == ModContent.ItemType()) - texture = ModContent.Request("CalamityMod/Items/Weapons/Melee/TheEnforcerGlow"); - else if (currentlyHeldItem.type == ModContent.ItemType()) - texture = ModContent.Request("CalamityMod/Items/Weapons/Melee/TerrorBladeGlow"); - else if (currentlyHeldItem.type == ModContent.ItemType()) - texture = ModContent.Request("CalamityMod/Items/Weapons/Summon/EtherealSubjugatorGlow"); - else if (currentlyHeldItem.type == ModContent.ItemType()) - texture = ModContent.Request("CalamityMod/Items/Weapons/Melee/PrismaticBreakerGlow"); - - float yOffset = drawPlayer.gravDir == -1f ? 0f : (float)Main.itemTexture[currentlyHeldItem.type].Height; - - DrawData data = new DrawData(texture, - new Vector2((int)(drawPlayer.itemLocation.X - Main.screenPosition.X), (int)(drawPlayer.itemLocation.Y - Main.screenPosition.Y)), - Main.itemTexture[currentlyHeldItem.type].Bounds, - Color.White, - drawPlayer.itemRotation, - new Vector2((float)Main.itemTexture[currentlyHeldItem.type].Width * 0.5f - (float)Main.itemTexture[currentlyHeldItem.type].Width * 0.5f * drawPlayer.direction, yOffset) + Vector2.Zero, - currentlyHeldItem.scale, - drawEffects, - 0); - - Main.playerDrawData.Add(data); - } - } - } - }); - - public static readonly PlayerLayer clAfterAll = new PlayerLayer("Calamity", "clAfterAll", PlayerLayer.MiscEffectsFront, drawInfo => - { - Player drawPlayer = drawInfo.drawPlayer; - CalamityPlayer modPlayer = drawPlayer.Calamity(); - if (drawPlayer.mount != null && (modPlayer.fab || modPlayer.crysthamyr || modPlayer.onyxExcavator)) - { - drawPlayer.mount.Draw(Main.playerDrawData, 3, drawPlayer, drawInfo.position, drawInfo.mountColor, drawInfo.spriteEffects, drawInfo.shadow); - } - }); - - public static readonly PlayerLayer Tail = new PlayerLayer("CalamityMod", "Tail", PlayerLayer.BackAcc, drawInfo => - { - Player drawPlayer = drawInfo.drawPlayer; - CalamityPlayer modPlayer = drawPlayer.Calamity(); - if (drawInfo.shadow != 0f || drawPlayer.dead) - return; - - Texture2D texture = ModContent.Request("CalamityMod/Items/Armor/FathomSwarmerArmor_Tail"); - - Rectangle frame = texture.Frame(1, 4, 0, modPlayer.tailFrame); - if (modPlayer.fathomSwarmerTail) - { - int dyeShader = drawPlayer.dye?[2].dye ?? 0; - int frameSizeY = texture.Height / 4; - int centerX = (int)(drawInfo.position.X + drawPlayer.width / 2f); - int centerY = (int)(drawInfo.position.Y + drawPlayer.height / 2f); - int drawX = (int)(drawInfo.position.X + drawPlayer.width / 2f - Main.screenPosition.X - (3 * drawPlayer.direction)); - int drawY = (int)(drawInfo.position.Y + drawPlayer.height / 2f - Main.screenPosition.Y); - DrawData tailDrawData = new DrawData(texture, new Vector2(drawX, drawY), frame, drawInfo.pantsColor, 0f, new Vector2(texture.Width / 2f, frameSizeY / 2f), 1f, drawInfo.spriteEffects, 0); - tailDrawData.shader = dyeShader; - Main.playerDrawData.Add(tailDrawData); - } - }); - - public static readonly PlayerLayer DrawRancorBookManually = new PlayerLayer("CalamityMod", "RancorBook", PlayerLayer.Arms, drawInfo => - { - Player drawPlayer = drawInfo.drawPlayer; - CalamityPlayer modPlayer = drawPlayer.Calamity(); - if (drawInfo.shadow != 0f || drawPlayer.dead) - return; - - int bookType = ModContent.ProjectileType(); - Texture2D bookTexture = Main.projectileTexture[bookType]; - Projectile book = Main.projectile[drawPlayer.heldProj]; - Rectangle frame = bookTexture.Frame(1, Main.projFrames[bookType], 0, book.frame); - Vector2 origin = frame.Size() * 0.5f; - Vector2 drawPosition = drawPlayer.Center + Vector2.UnitX * drawPlayer.direction * 8f - Main.screenPosition; - Color drawColor = book.GetAlpha(Color.White); - SpriteEffects direction = book.spriteDirection == 1f ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - DrawData bookDrawData = new DrawData(bookTexture, drawPosition, frame, drawColor, book.rotation, origin, book.scale, direction, 0); - Main.playerDrawData.Add(bookDrawData); - }); - - //I feel like having an Interface folder might be good. - public interface IExtendedHat - { - /// - /// The texture of the extension - /// - string ExtensionTexture { get; } - /// - /// Unless you are using custom drawing, mount offsets are taken into account automatically. - /// - Vector2 ExtensionSpriteOffset(PlayerDrawInfo drawInfo); - /// - ///Return true to make the extension get drawn automatically from the texture and offsets provided. Return false if you want to draw it yourself - /// - bool PreDrawExtension(PlayerDrawInfo drawInfo); - } - - public static readonly PlayerLayer HatExtension = new PlayerLayer("CalamityMod", "HatExtension", PlayerLayer.Head, drawInfo => - { - Player drawPlayer = drawInfo.drawPlayer; - if (drawInfo.shadow != 0f || drawPlayer.dead) - return; - - int headItemType = drawPlayer.armor[0].type; - if (drawPlayer.armor[10].type > ItemID.None) - headItemType = drawPlayer.armor[10].type; - - if (ModContent.GetModItem(headItemType) is IExtendedHat ExtendedHatDrawer) - { - if (ExtendedHatDrawer.PreDrawExtension(drawInfo)) - { - int dyeShader = drawPlayer.dye?[0].dye ?? 0; - - //Remember to use drawInfo.position and not drawPlayer.position, or else it will not display properly in the player selection screen. - Vector2 origin = drawInfo.headOrigin; - Vector2 headDrawPosition = drawInfo.position.Floor() + origin - Main.screenPosition; - - //Account for the hellspawns known as mounts - if (drawPlayer.mount.Active) - headDrawPosition.Y += drawPlayer.mount.HeightBoost; - - headDrawPosition += ExtendedHatDrawer.ExtensionSpriteOffset(drawInfo); - - Texture2D extraPieceTexture = ModContent.Request(ExtendedHatDrawer.ExtensionTexture); - Rectangle frame = extraPieceTexture.Frame(1, 20, 0, drawPlayer.bodyFrame.Y / drawPlayer.bodyFrame.Height); - DrawData pieceDrawData = new DrawData(extraPieceTexture, headDrawPosition, frame, drawInfo.upperArmorColor, drawPlayer.fullRotation, origin, 1f, drawInfo.spriteEffects, 0); - pieceDrawData.shader = dyeShader; - Main.playerDrawData.Add(pieceDrawData); - } - } - }); - - public static readonly PlayerLayer ForbiddenCircletSign = new PlayerLayer("CalamityMod", "ForbiddenSigil", PlayerLayer.BackAcc, drawInfo => - { - DrawData drawData = new DrawData(); - Player drawPlayer = drawInfo.drawPlayer; - CalamityPlayer modPlayer = drawPlayer.Calamity(); - if (drawInfo.shadow != 0f || drawPlayer.dead || !modPlayer.forbiddenCirclet) - return; - - SpriteEffects spriteEffects; - if (drawPlayer.direction == 1) - spriteEffects = SpriteEffects.None; - else spriteEffects = SpriteEffects.FlipHorizontally; - - if (drawPlayer.gravDir != 1f) - spriteEffects |= SpriteEffects.FlipVertically; - - int dyeShader = 0; - if (drawPlayer.dye[1] != null) - dyeShader = drawPlayer.dye[1].dye; - - Color baseColor = drawPlayer.GetImmuneAlphaPure(Lighting.GetColor((int)(drawInfo.position.X + drawPlayer.width * 0.5f) / 16, (int)(drawInfo.position.Y + drawPlayer.height * 0.5f) / 16, Color.White), drawInfo.shadow); - Color color = Color.Lerp(baseColor, Color.White, 0.7f); - Texture2D texture = Main.extraTexture[ExtrasID.ForbiddenSign]; - Texture2D glowmask = Main.glowMaskTexture[GlowMaskID.ForbiddenSign]; - float offsetY = (float)Math.Sin(drawPlayer.miscCounter / 300f * MathHelper.TwoPi) * 6f; - float sinusoidalTime = (float)Math.Cos(drawPlayer.miscCounter / 75f * MathHelper.TwoPi); - Color afterimageColor = new Color(80, 70, 40, 0) * (sinusoidalTime * 0.5f + 0.5f) * 0.8f; - float gravCheckOffset = drawPlayer.gravDir != 1f ? -20f : 20f; - - Vector2 position = new Vector2(drawInfo.position.X - drawPlayer.bodyFrame.Width / 2 + drawPlayer.width / 2, drawInfo.position.Y + drawPlayer.height - drawPlayer.bodyFrame.Height + 4f) + drawPlayer.bodyPosition; - position += new Vector2(drawPlayer.bodyFrame.Width / 2, drawPlayer.bodyFrame.Height / 2) + new Vector2(-drawPlayer.direction * 10, offsetY - gravCheckOffset); - position -= Main.screenPosition; - - // Draw the original sign- - drawData = new DrawData(texture, position, null, color, drawPlayer.bodyRotation, texture.Size() * 0.5f, 1f, spriteEffects, 0) - { - shader = dyeShader - }; - Main.playerDrawData.Add(drawData); - - // And 4 semi-transparent copies. - for (float i = 0f; i < 4f; i++) - { - float angle = MathHelper.TwoPi / 4f * i; - drawData = new DrawData(glowmask, position + angle.ToRotationVector2() * sinusoidalTime * 4f, null, afterimageColor, drawPlayer.bodyRotation, texture.Size() * 0.5f, 1f, spriteEffects, 0); - Main.playerDrawData.Add(drawData); - } - }); - - public static readonly PlayerLayer ColdDivinityOverlay = new PlayerLayer("CalamityMod", "ColdDivinity", PlayerLayer.Skin, drawInfo => - { - Player drawPlayer = drawInfo.drawPlayer; - CalamityPlayer modPlayer = drawPlayer.Calamity(); - if (modPlayer.coldDivinity) - { - Texture2D texture = ModContent.Request("CalamityMod/ExtraTextures/ColdDivinityBody"); - int drawX = (int)(drawInfo.position.X + drawPlayer.width / 2f - Main.screenPosition.X); - int drawY = (int)(drawInfo.position.Y + drawPlayer.height / 2f - Main.screenPosition.Y); - SpriteEffects spriteEffects = drawPlayer.direction != -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - DrawData data = new DrawData(texture, new Vector2(drawX, drawY), null, new Color(53, Main.DiscoG, 255) * 0.5f, 0f, texture.Size() * 0.5f, 1.15f, spriteEffects, 0); - Main.playerDrawData.Add(data); - } - }); - - public static readonly PlayerLayer ConcentratedVoidAura = new PlayerLayer("CalamityMod", "VoidAura", PlayerLayer.Skin, drawInfo => - { - Player drawPlayer = drawInfo.drawPlayer; - CalamityPlayer modPlayer = drawPlayer.Calamity(); - if (modPlayer.voidAura || modPlayer.voidAuraDamage) - { - Texture2D tex = ModContent.Request("CalamityMod/ExtraTextures/VoidConcentrationAura"); - Vector2 drawPos = drawPlayer.Center - Main.screenPosition + new Vector2(0f, drawPlayer.gfxOffY); - drawPos.Y -= 9; - SpriteEffects spriteEffects = drawPlayer.direction != -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; //intentionally inverse due to giving more space for the player model without faffing about with the specific positioning - Rectangle frame = tex.Frame(1, 4, 0, modPlayer.voidFrame); - Vector2 origin = new Vector2(tex.Width / 2f, tex.Height / 2f / 4f); - float scale = 1.75f; - - DrawData data = new DrawData(tex, drawPos, frame, Color.White * 0.4f, 0f, origin, scale, spriteEffects, 0); - Main.playerDrawData.Add(data); - } - }); - - public static readonly PlayerLayer RoverDriveShield = new PlayerLayer("CalamityMod", "RoverDrive", PlayerLayer.Skin, drawInfo => - { - Player drawPlayer = drawInfo.drawPlayer; - CalamityPlayer modPlayer = drawPlayer.Calamity(); - if (modPlayer.roverDriveTimer < 616 && modPlayer.roverDrive && !drawPlayer.dead) - { - Texture2D texture = ModContent.Request("CalamityMod/ExtraTextures/RoverAccShield"); - Vector2 drawPos = drawPlayer.Center - Main.screenPosition + new Vector2(0f, drawPlayer.gfxOffY); - Rectangle frame = texture.Frame(1, 11, 0, modPlayer.roverFrame); - Color color = Color.White * 0.625f; - Vector2 origin = new Vector2(texture.Width / 2f, texture.Height / 2f / 11f); - float scale = 1f + (float)Math.Cos(Main.GlobalTimeWrappedHourly) * 0.1f; - SpriteEffects spriteEffects = drawPlayer.direction != -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - - DrawData data = new DrawData(texture, drawPos, frame, color, 0f, origin, scale, spriteEffects, 0); - Main.playerDrawData.Add(data); - } - }); - - public static readonly PlayerLayer StratusSphereDrawing = new PlayerLayer("CalamityMod", "StratusSphereDrawing", PlayerLayer.HeldProjFront, drawInfo => - { - Player drawPlayer = drawInfo.drawPlayer; - if (drawPlayer.inventory[drawPlayer.selectedItem].type == ModContent.ItemType()) - { - SpriteEffects effect; - if (drawPlayer.direction == 1) - { - effect = SpriteEffects.None; - } - else - { - effect = SpriteEffects.FlipHorizontally; - } - if (drawPlayer.gravDir != 1f) - effect |= SpriteEffects.FlipVertically; - Vector2 itemDrawPosition = drawPlayer.Center; - Texture2D drawTexture = ModContent.Request("CalamityMod/ExtraTextures/StratusSphereHold"); - Rectangle rectangle = drawTexture.Frame(1, 4, 0, (int)(2 * Math.Sin(drawPlayer.miscCounter / 20f * MathHelper.TwoPi) + 2)); - Vector2 drawOffset = new Vector2(rectangle.Width / 2 * drawPlayer.direction, 0f); - Vector2 origin = rectangle.Size() / 2f; - Main.playerDrawData.Add(new DrawData(drawTexture, - (itemDrawPosition - Main.screenPosition + drawOffset).Floor(), - new Rectangle?(rectangle), - Color.White, - drawPlayer.itemRotation, - origin, - drawPlayer.inventory[drawPlayer.selectedItem].scale, - effect, - 0)); - drawTexture = ModContent.Request("CalamityMod/ExtraTextures/StratusSphereHoldGlow"); - Main.playerDrawData.Add(new DrawData(drawTexture, - (itemDrawPosition - Main.screenPosition + drawOffset).Floor(), - new Rectangle?(rectangle), - Color.White, - drawPlayer.itemRotation, - origin, - drawPlayer.inventory[drawPlayer.selectedItem].scale, - effect, - 0)); - } - }); - - public static readonly PlayerLayer ProfanedMoonlightDyeEffects = new PlayerLayer("CalamityMod", "ProfanedMoonlight", PlayerLayer.Body, drawInfo => - { - Player drawPlayer = drawInfo.drawPlayer; - int totalMoonlightDyes = drawPlayer.dye.Count(dyeItem => dyeItem.type == ModContent.ItemType()); - if (totalMoonlightDyes <= 0) - return; - CalamityUtils.DrawAuroras(drawPlayer, 5 + (int)MathHelper.Clamp(totalMoonlightDyes, 0f, 4f) * 2, MathHelper.Clamp(totalMoonlightDyes / 3f, 0f, 1f), GetCurrentMoonlightDyeColor()); - }); - - public static readonly PlayerLayer AuralisAuroraEffects = new PlayerLayer("CalamityMod", "AuralisAurora", PlayerLayer.Body, drawInfo => - { - Player drawPlayer = drawInfo.drawPlayer; - CalamityPlayer modPlayer = drawPlayer.Calamity(); - if (modPlayer.auralisAuroraCounter < 300 || modPlayer.auralisAuroraCooldown > 0) - return; - CalamityUtils.DrawAuroras(drawPlayer, 7, 0.4f, CalamityUtils.ColorSwap(Auralis.blueColor, Auralis.greenColor, 3f)); - }); - - public static readonly PlayerLayer AngelicAllianceAurora = new PlayerLayer("CalamityMod", "AngelicAllianceAurora", PlayerLayer.Body, drawInfo => - { - Player drawPlayer = drawInfo.drawPlayer; - CalamityPlayer modPlayer = drawPlayer.Calamity(); - if (!modPlayer.divineBless) - return; - CalamityUtils.DrawAuroras(drawPlayer, 7, 0.4f, CalamityUtils.ColorSwap(new Color(255, 163, 56), new Color(242, 48, 187), 3f)); - }); - - public static readonly PlayerLayer IbanDevRobot = new PlayerLayer("CalamityMod", "IbanDevRobot", PlayerLayer.Body, drawInfo => - { - Player drawPlayer = drawInfo.drawPlayer; - if (drawPlayer.Calamity().andromedaState == AndromedaPlayerState.Inactive) - return; - Main.playerDrawData.Clear(); - int robot = -1; - for (int i = 0; i < Main.projectile.Length; i++) - { - if (Main.projectile[i].active && - Main.projectile[i].type == ModContent.ProjectileType() && - Main.projectile[i].owner == drawPlayer.whoAmI) - { - robot = i; - break; - } - } - if (robot == -1) - { - drawPlayer.Calamity().andromedaState = AndromedaPlayerState.Inactive; - return; - } - - GiantIbanRobotOfDoom robotEntityInstance = (GiantIbanRobotOfDoom)Main.projectile[robot].modProjectile; - switch (drawPlayer.Calamity().andromedaState) - { - case AndromedaPlayerState.SpecialAttack: - Texture2D dashTexture = ModContent.Request("CalamityMod/ExtraTextures/AndromedaBolt"); - Rectangle frame = dashTexture.Frame(1, 4, 0, robotEntityInstance.RightIconCooldown / 4 % 4); - - DrawData drawData = new DrawData(dashTexture, - drawPlayer.Center + new Vector2(0f, -8f) - Main.screenPosition, - frame, - Color.White, - Main.projectile[robot].rotation, - drawPlayer.Size / 2, - 1f, - Main.projectile[robot].spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, - 1); - drawData.shader = drawPlayer.cBody; - - Main.playerDrawData.Add(drawData); - break; - case AndromedaPlayerState.LargeRobot: - Texture2D robotTexture = ModContent.Request(robotEntityInstance.Texture); - frame = new Rectangle(robotEntityInstance.FrameX * robotTexture.Width / 3, robotEntityInstance.FrameY * robotTexture.Height / 7, robotTexture.Width / 3, robotTexture.Height / 7); - - drawData = new DrawData(ModContent.Request(Main.projectile[robot].modProjectile.Texture), - Main.projectile[robot].Center + Vector2.UnitY * 6f - Main.screenPosition, - frame, - Color.White, - Main.projectile[robot].rotation, - Main.projectile[robot].Size / 2, - 1f, - Main.projectile[robot].spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, - 1); - drawData.shader = drawPlayer.cBody; - - Main.playerDrawData.Add(drawData); - break; - case AndromedaPlayerState.SmallRobot: - robotTexture = ModContent.Request("CalamityMod/Projectiles/Summon/AndromedaSmall"); - frame = new Rectangle(0, robotEntityInstance.CurrentFrame * 54, robotTexture.Width, robotTexture.Height / 21); - drawData = new DrawData(robotTexture, - drawPlayer.Center + new Vector2(drawPlayer.direction == 1 ? -24 : -10, -8f) - Main.screenPosition, - frame, - Color.White, - 0f, - drawPlayer.Size / 2, - 1f, - Main.projectile[robot].spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, - 1); - drawData.shader = drawPlayer.cBody; - - Main.playerDrawData.Add(drawData); - break; - } - }); - - public static readonly PlayerLayer DyeInvisibilityFix = new PlayerLayer("CalamityMod", "DyeInvisibilityFix", PlayerLayer.Arms, drawInfo => - { - Player drawPlayer = drawInfo.drawPlayer; - CalamityPlayer modPlayer = drawPlayer.Calamity(); - if (!drawPlayer.invis || - drawPlayer.itemAnimation > 0) - { - return; - } - for (int i = 0; i < Main.playerDrawData.Count; i++) - { - var copy = Main.playerDrawData[i]; - copy.shader = 0; // There's no other easy solution here to my knowledge since DrawData is a value type. - Main.playerDrawData[i] = copy; - } - }); - - #endregion - - #region Static Methods - public static void AddPlayerLayer(List list, PlayerLayer layer, PlayerLayer parent, bool first) - { - int insertAt = -1; - for (int m = 0; m < list.Count; m++) - { - PlayerLayer currentLayer = list[m]; - if (currentLayer.Name.Equals(parent.Name)) - { - insertAt = m; - break; - } - } - if (insertAt == -1) - list.Add(layer); - else list.Insert(first ? insertAt : insertAt + 1, layer); - } - #endregion - #region Draw Hooks - public override void ModifyDrawLayers(List list) + public override void ModifyDrawLayerOrdering(IDictionary positions) { - MiscEffectsBack.visible = true; - list.Insert(0, MiscEffectsBack); - - Skin.visible = true; - list.Insert(list.IndexOf(PlayerLayer.Skin) + 1, Skin); - - MiscEffectsFront.visible = true; - list.Add(MiscEffectsFront); - // Remove shoe drawing effects if special legs are meant to be drawn. if (CalamityLists.legOverrideList.Contains(Player.legs)) - list[list.IndexOf(PlayerLayer.ShoeAcc)].visible = false; - - if (Player.Calamity().fab || Player.Calamity().crysthamyr || Player.Calamity().onyxExcavator) - AddPlayerLayer(list, clAfterAll, list[list.Count - 1], false); - - if (Player.heldProj != -1 && Main.projectile[Player.heldProj].active && Main.projectile[Player.heldProj].type == ModContent.ProjectileType()) - list.Insert(list.IndexOf(PlayerLayer.Arms), DrawRancorBookManually); - - if (Player.Calamity().fathomSwarmerTail) - { - int skinIndex = list.IndexOf(PlayerLayer.Skin); - list.Insert(skinIndex - 1, Tail); - } - - if (Player.Calamity().forbiddenCirclet) - { - int drawTheStupidSign = list.IndexOf(PlayerLayer.Skin); - list.Insert(drawTheStupidSign, ForbiddenCircletSign); - } - - list.Add(HatExtension); - list.Add(ColdDivinityOverlay); - list.Add(ConcentratedVoidAura); - list.Add(RoverDriveShield); - list.Add(StratusSphereDrawing); - list.Add(ProfanedMoonlightDyeEffects); - list.Add(AuralisAuroraEffects); - list.Add(AngelicAllianceAurora); - list.Add(IbanDevRobot); - list.Add(DyeInvisibilityFix); - list.Add(GemTechGems); + positions.Remove(PlayerDrawLayers.Leggings); } - public override void DrawEffects(PlayerDrawInfo drawInfo, ref float r, ref float g, ref float b, ref float a, ref bool fullBright) + public override void DrawEffects(PlayerDrawSet drawInfo, ref float r, ref float g, ref float b, ref float a, ref bool fullBright) { CalamityPlayer calamityPlayer = Player.Calamity(); if (Main.myPlayer == Player.whoAmI && !Main.gameMenu && CalamityConfig.Instance.SpeedrunTimer) @@ -902,191 +76,191 @@ namespace CalamityMod.CalPlayer text = split.ToString(split.Days > 0 ? formatStrDays : formatStr); scale = 1f; yOffset += 44f; - + Texture2D texture = null; switch (calamityPlayer.lastSplitType) { // King Slime case 1: - texture = Main.npcHeadBossTexture[7]; + texture = TextureAssets.NpcHeadBoss[7].Value; break; case 2: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + texture = TextureAssets.NpcHeadBoss[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]].Value; break; // Eye of Cthulhu case 3: - texture = Main.npcHeadBossTexture[1]; + texture = TextureAssets.NpcHeadBoss[1].Value; break; case 4: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + texture = TextureAssets.NpcHeadBoss[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]].Value; break; // Eater of Worlds case 5: - texture = Main.npcHeadBossTexture[2]; + texture = TextureAssets.NpcHeadBoss[2].Value; break; // Brain of Cthulhu case 6: - texture = Main.npcHeadBossTexture[23]; + texture = TextureAssets.NpcHeadBoss[23].Value; break; case 7: - texture = ModContent.Request("CalamityMod/NPCs/HiveMind/HiveMindP2_Head_Boss"); + texture = ModContent.Request("CalamityMod/NPCs/HiveMind/HiveMindP2_Head_Boss").Value; break; case 8: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + texture = TextureAssets.NpcHeadBoss[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]].Value; break; // Queen Bee case 9: - texture = Main.npcHeadBossTexture[14]; + texture = TextureAssets.NpcHeadBoss[14].Value; break; // Skeletron case 10: - texture = Main.npcHeadBossTexture[19]; + texture = TextureAssets.NpcHeadBoss[19].Value; break; case 11: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + texture = TextureAssets.NpcHeadBoss[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]].Value; break; // Wall of Flesh case 12: - texture = Main.npcHeadBossTexture[22]; + texture = TextureAssets.NpcHeadBoss[22].Value; break; case 13: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + texture = TextureAssets.NpcHeadBoss[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]].Value; break; // The Twins case 14: - texture = Main.npcHeadBossTexture[21]; + texture = TextureAssets.NpcHeadBoss[21].Value; break; case 15: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + texture = TextureAssets.NpcHeadBoss[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]].Value; break; // The Destroyer case 16: - texture = Main.npcHeadBossTexture[25]; + texture = TextureAssets.NpcHeadBoss[25].Value; break; case 17: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + texture = TextureAssets.NpcHeadBoss[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]].Value; break; // Skeletron Prime case 18: - texture = Main.npcHeadBossTexture[18]; + texture = TextureAssets.NpcHeadBoss[18].Value; break; case 19: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + texture = TextureAssets.NpcHeadBoss[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]].Value; break; // Plantera case 20: - texture = Main.npcHeadBossTexture[12]; + texture = TextureAssets.NpcHeadBoss[12].Value; break; case 21: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + texture = TextureAssets.NpcHeadBoss[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]].Value; break; case 22: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + texture = TextureAssets.NpcHeadBoss[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]].Value; break; // Golem case 23: - texture = Main.npcHeadBossTexture[5]; + texture = TextureAssets.NpcHeadBoss[5].Value; break; case 24: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + texture = TextureAssets.NpcHeadBoss[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]].Value; break; // Duke Fishron case 25: - texture = Main.npcHeadBossTexture[4]; + texture = TextureAssets.NpcHeadBoss[4].Value; break; case 26: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + texture = TextureAssets.NpcHeadBoss[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]].Value; break; // Lunatic Cultist case 27: - texture = Main.npcHeadBossTexture[31]; + texture = TextureAssets.NpcHeadBoss[31].Value; break; case 28: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + texture = TextureAssets.NpcHeadBoss[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]].Value; break; // Moon Lord case 29: - texture = Main.npcHeadBossTexture[8]; + texture = TextureAssets.NpcHeadBoss[8].Value; break; case 30: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + texture = TextureAssets.NpcHeadBoss[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]].Value; break; case 31: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + texture = TextureAssets.NpcHeadBoss[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]].Value; break; case 32: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + texture = TextureAssets.NpcHeadBoss[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]].Value; break; case 33: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + texture = TextureAssets.NpcHeadBoss[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]].Value; break; case 34: - texture = ModContent.Request("CalamityMod/NPCs/StormWeaver/StormWeaverHeadNaked_Head_Boss"); + texture = ModContent.Request("CalamityMod/NPCs/StormWeaver/StormWeaverHeadNaked_Head_Boss").Value; break; case 35: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + texture = TextureAssets.NpcHeadBoss[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]].Value; break; case 36: - texture = ModContent.Request("CalamityMod/NPCs/Polterghast/Necroplasm_Head_Boss"); + texture = ModContent.Request("CalamityMod/NPCs/Polterghast/Necroplasm_Head_Boss").Value; break; case 37: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + texture = TextureAssets.NpcHeadBoss[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]].Value; break; case 38: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + texture = TextureAssets.NpcHeadBoss[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]].Value; break; case 39: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + texture = TextureAssets.NpcHeadBoss[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]].Value; break; case 40: - texture = ModContent.Request("CalamityMod/NPCs/SupremeCalamitas/HoodlessHeadIcon"); + texture = ModContent.Request("CalamityMod/NPCs/SupremeCalamitas/HoodlessHeadIcon").Value; break; case 41: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + texture = TextureAssets.NpcHeadBoss[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]].Value; break; case 42: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + texture = TextureAssets.NpcHeadBoss[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]].Value; break; default: @@ -1138,7 +312,7 @@ namespace CalamityMod.CalPlayer else dustDrawPosition.Y = Player.Center.Y - distanceY; dustDrawPosition.Y -= 4f; - Main.spriteBatch.Draw(Main.dustTexture, dustDrawPosition - Main.screenPosition, dust.frame, dust.color, dust.rotation, new Vector2(4f), dust.scale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(TextureAssets.Dust.Value, dustDrawPosition - Main.screenPosition, dust.frame, dust.color, dust.rotation, new Vector2(4f), dust.scale, SpriteEffects.None, 0f); dustDrawn++; } @@ -1165,12 +339,12 @@ namespace CalamityMod.CalPlayer Player.armorEffectDrawShadowSubtle = false; } - Texture2D heart3 = ModContent.Request("CalamityMod/ExtraTextures/Heart3"); - Texture2D heart4 = ModContent.Request("CalamityMod/ExtraTextures/Heart4"); - Texture2D heart5 = ModContent.Request("CalamityMod/ExtraTextures/Heart5"); - Texture2D heart6 = ModContent.Request("CalamityMod/ExtraTextures/Heart6"); - Texture2D heartOriginal = ModContent.Request("CalamityMod/ExtraTextures/HeartOriginal"); // Life fruit - Texture2D heartOriginal2 = ModContent.Request("CalamityMod/ExtraTextures/HeartOriginal2"); // Life crystal + Asset heart3 = ModContent.Request("CalamityMod/ExtraTextures/Heart3"); + Asset heart4 = ModContent.Request("CalamityMod/ExtraTextures/Heart4"); + Asset heart5 = ModContent.Request("CalamityMod/ExtraTextures/Heart5"); + Asset heart6 = ModContent.Request("CalamityMod/ExtraTextures/Heart6"); + Asset heartOriginal = ModContent.Request("CalamityMod/ExtraTextures/HeartOriginal"); // Life fruit + Asset heartOriginal2 = ModContent.Request("CalamityMod/ExtraTextures/HeartOriginal2"); // Life crystal int totalFruit = (calamityPlayer.mFruit ? 1 : 0) + @@ -1178,45 +352,34 @@ namespace CalamityMod.CalPlayer (calamityPlayer.eBerry ? 1 : 0) + (calamityPlayer.dFruit ? 1 : 0); - switch (totalFruit) + TextureAssets.Heart2 = totalFruit switch { - default: - Main.heart2Texture = heartOriginal; - break; - case 4: - Main.heart2Texture = heart6; - break; - case 3: - Main.heart2Texture = heart5; - break; - case 2: - Main.heart2Texture = heart4; - break; - case 1: - Main.heart2Texture = heart3; - break; - } - - Main.heartTexture = heartOriginal2; + 4 => heart6, + 3 => heart5, + 2 => heart4, + 1 => heart3, + _ => heartOriginal, + }; + TextureAssets.Heart = heartOriginal2; if (calamityPlayer.revivify) { if (Main.rand.NextBool(2) && drawInfo.shadow == 0f) { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), Player.width + 4, Player.height + 4, 91, Player.velocity.X * 0.2f, Player.velocity.Y * 0.2f, 100, default, 1f); + int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, 91, Player.velocity.X * 0.2f, Player.velocity.Y * 0.2f, 100, default, 1f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity.Y -= 0.5f; - Main.playerDrawDust.Add(dust); + drawInfo.DustCache.Add(dust); } } if (calamityPlayer.tRegen) { if (Main.rand.NextBool(10) && drawInfo.shadow == 0f) { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), Player.width + 4, Player.height + 4, 107, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1f); + int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, 107, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 0.75f; Main.dust[dust].velocity.Y -= 0.35f; - Main.playerDrawDust.Add(dust); + drawInfo.DustCache.Add(dust); } if (noRogueStealth) { @@ -1232,10 +395,10 @@ namespace CalamityMod.CalPlayer { if (Main.rand.NextBool(2) && drawInfo.shadow == 0f) { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), Player.width + 4, Player.height + 4, 229, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1f); + int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, 229, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 0.5f; - Main.playerDrawDust.Add(dust); + drawInfo.DustCache.Add(dust); } if (noRogueStealth) { @@ -1252,10 +415,10 @@ namespace CalamityMod.CalPlayer { if (Main.rand.NextBool(2) && drawInfo.shadow == 0f) { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), Player.width + 4, Player.height + 4, 246, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1f); + int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, 246, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 0.5f; - Main.playerDrawDust.Add(dust); + drawInfo.DustCache.Add(dust); } if (noRogueStealth) { @@ -1272,10 +435,10 @@ namespace CalamityMod.CalPlayer { if (Main.rand.NextBool(2) && drawInfo.shadow == 0f) { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), Player.width + 4, Player.height + 4, 27, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1.5f); + int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, 27, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1.5f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 0.5f; - Main.playerDrawDust.Add(dust); + drawInfo.DustCache.Add(dust); } if (noRogueStealth) { @@ -1292,10 +455,10 @@ namespace CalamityMod.CalPlayer { if (drawInfo.shadow == 0f) { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), Player.width + 4, Player.height + 4, Main.rand.NextBool(2) ? 57 : 244, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1.5f); + int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, Main.rand.NextBool(2) ? 57 : 244, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1.5f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 0.5f; - Main.playerDrawDust.Add(dust); + drawInfo.DustCache.Add(dust); } if (noRogueStealth) { @@ -1310,11 +473,11 @@ namespace CalamityMod.CalPlayer { if (Main.rand.NextBool(4) && drawInfo.shadow == 0f) { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), Player.width + 4, Player.height + 4, ModContent.DustType(), Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 3f); + int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, ModContent.DustType(), Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 3f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 1.8f; Main.dust[dust].velocity.Y -= 0.5f; - Main.playerDrawDust.Add(dust); + drawInfo.DustCache.Add(dust); } if (noRogueStealth) { @@ -1328,7 +491,7 @@ namespace CalamityMod.CalPlayer { if (Main.rand.Next(5) < 4 && drawInfo.shadow == 0f) { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), Player.width + 4, Player.height + 4, 27, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1.95f); + int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, 27, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1.95f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 0.75f; Main.dust[dust].velocity.X = Main.dust[dust].velocity.X * 0.75f; @@ -1344,7 +507,7 @@ namespace CalamityMod.CalPlayer { if (Main.rand.Next(5) < 4 && drawInfo.shadow == 0f) { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), Player.width + 4, Player.height + 4, 46, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1.95f); + int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, 46, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1.95f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 0.75f; Main.dust[dust].velocity.X = Main.dust[dust].velocity.X * 0.75f; @@ -1366,10 +529,10 @@ namespace CalamityMod.CalPlayer { if (Main.rand.NextBool(4) && drawInfo.shadow == 0f) { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), Player.width + 4, Player.height + 4, 206, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 3f); + int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, 206, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 3f); Main.dust[dust].velocity *= 1.8f; Main.dust[dust].velocity.Y -= 0.5f; - Main.playerDrawDust.Add(dust); + drawInfo.DustCache.Add(dust); } if (noRogueStealth) { @@ -1383,11 +546,11 @@ namespace CalamityMod.CalPlayer { if (Main.rand.NextBool(4) && drawInfo.shadow == 0f) { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), Player.width + 4, Player.height + 4, 173, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 3f); + int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, 173, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 3f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 1.8f; Main.dust[dust].velocity.Y -= 0.5f; - Main.playerDrawDust.Add(dust); + drawInfo.DustCache.Add(dust); } if (noRogueStealth) { @@ -1402,23 +565,23 @@ namespace CalamityMod.CalPlayer if (Main.rand.NextBool(4) && drawInfo.shadow == 0f) { int dustType = Main.rand.NextBool(2) ? ModContent.DustType() : ModContent.DustType(); - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), Player.width + 4, Player.height + 4, dustType, Player.velocity.X * 0.2f, Player.velocity.Y * 0.2f, 100, default, 0.7f); + int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, dustType, Player.velocity.X * 0.2f, Player.velocity.Y * 0.2f, 100, default, 0.7f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 1.2f; Main.dust[dust].velocity.Y -= 0.5f; Main.dust[dust].color = new Color(255, 255, 255, 0); - Main.playerDrawDust.Add(dust); + drawInfo.DustCache.Add(dust); } } if (calamityPlayer.hFlames || calamityPlayer.hInferno || calamityPlayer.banishingFire) { if (Main.rand.NextBool(4) && drawInfo.shadow == 0f) { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), Player.width + 4, Player.height + 4, ModContent.DustType(), Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 3f); + int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, ModContent.DustType(), Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 3f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 1.8f; Main.dust[dust].velocity.Y -= 0.5f; - Main.playerDrawDust.Add(dust); + drawInfo.DustCache.Add(dust); } if (noRogueStealth) { @@ -1432,22 +595,22 @@ namespace CalamityMod.CalPlayer { if (Main.rand.NextBool(calamityPlayer.dragonFire ? 6 : 12) && drawInfo.shadow == 0f) { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), Player.width + 4, Player.height + 4, (int)CalamityDusts.ProfanedFire, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 3f); + int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, (int)CalamityDusts.ProfanedFire, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 3f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 1.8f; Main.dust[dust].velocity.Y -= 0.5f; - Main.playerDrawDust.Add(dust); + drawInfo.DustCache.Add(dust); } } if (calamityPlayer.pFlames) { if (Main.rand.NextBool(4) && drawInfo.shadow == 0f) { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), Player.width + 4, Player.height + 4, 89, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 3f); + int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, 89, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 3f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 1.2f; Main.dust[dust].velocity.Y -= 0.15f; - Main.playerDrawDust.Add(dust); + drawInfo.DustCache.Add(dust); } if (noRogueStealth) { @@ -1461,11 +624,11 @@ namespace CalamityMod.CalPlayer { if (Main.rand.NextBool(4) && drawInfo.shadow == 0f) { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), Player.width + 4, Player.height + 4, 176, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 3f); + int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, 176, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 3f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 1.8f; Main.dust[dust].velocity.Y -= 0.5f; - Main.playerDrawDust.Add(dust); + drawInfo.DustCache.Add(dust); } if (noRogueStealth) { @@ -1489,7 +652,7 @@ namespace CalamityMod.CalPlayer }); if (Main.rand.NextBool(4) && drawInfo.shadow == 0f) { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), Player.width + 4, Player.height + 4, dustType, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 3f); + int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, dustType, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 3f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 1.8f; Main.dust[dust].velocity.Y -= 0.5f; @@ -1498,7 +661,7 @@ namespace CalamityMod.CalPlayer Main.dust[dust].noGravity = false; Main.dust[dust].scale *= 0.5f; } - Main.playerDrawDust.Add(dust); + drawInfo.DustCache.Add(dust); } if (noRogueStealth) { @@ -1532,11 +695,11 @@ namespace CalamityMod.CalPlayer { if (Main.rand.NextBool(6) && drawInfo.shadow == 0f) { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), Player.width + 4, Player.height + 4, 5, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 3f); + int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, 5, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 3f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 1.8f; Main.dust[dust].velocity.Y -= 0.5f; - Main.playerDrawDust.Add(dust); + drawInfo.DustCache.Add(dust); } if (noRogueStealth) { @@ -1550,11 +713,11 @@ namespace CalamityMod.CalPlayer { if (Main.rand.NextBool(6) && drawInfo.shadow == 0f) { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), Player.width + 4, Player.height + 4, 56, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 2f); + int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, 56, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 2f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 0.5f; Main.dust[dust].velocity.Y -= 0.1f; - Main.playerDrawDust.Add(dust); + drawInfo.DustCache.Add(dust); } if (noRogueStealth) { @@ -1568,11 +731,11 @@ namespace CalamityMod.CalPlayer { if (Main.rand.NextBool(6) && drawInfo.shadow == 0f) { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), Player.width + 4, Player.height + 4, 5, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 3f); + int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, 5, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 3f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 1.8f; Main.dust[dust].velocity.Y -= 0.5f; - Main.playerDrawDust.Add(dust); + drawInfo.DustCache.Add(dust); } if (noRogueStealth) { @@ -1590,18 +753,18 @@ namespace CalamityMod.CalPlayer velocity.X *= 0.66f; velocity *= Main.rand.NextFloat(1f, 2f); - int heart = Gore.NewGore(drawInfo.position + new Vector2(Main.rand.Next(Player.width + 1), Main.rand.Next(Player.height + 1)), velocity, 331, Main.rand.NextFloat(0.4f, 1.2f)); + int heart = Gore.NewGore(drawInfo.Position + new Vector2(Main.rand.Next(Player.width + 1), Main.rand.Next(Player.height + 1)), velocity, 331, Main.rand.NextFloat(0.4f, 1.2f)); Main.gore[heart].sticky = false; Main.gore[heart].velocity *= 0.4f; Main.gore[heart].velocity.Y -= 0.6f; - Main.playerDrawGore.Add(heart); + drawInfo.GoreCache.Add(heart); } } } #endregion #region Tanks/Backpacks - public override void ModifyDrawInfo(ref PlayerDrawInfo drawInfo) + public override void ModifyDrawInfo(ref PlayerDrawSet drawInfo) { if (drawInfo.shadow != 0f) return; @@ -1638,23 +801,23 @@ namespace CalamityMod.CalPlayer }; List tankTextures = new List() { - ModContent.Request("CalamityMod/ExtraTextures/Tanks/Backpack_FlurrystormCannon"), - ModContent.Request("CalamityMod/ExtraTextures/Tanks/Backpack_BlightSpewer"), - ModContent.Request("CalamityMod/ExtraTextures/Tanks/Backpack_BrimstoneFlameblaster"), - ModContent.Request("CalamityMod/ExtraTextures/Tanks/Backpack_HavocsBreath"), - ModContent.Request("CalamityMod/ExtraTextures/Tanks/Backpack_SparkSpreader"), - ModContent.Request("CalamityMod/ExtraTextures/Tanks/Backpack_HalleysInferno"), - ModContent.Request("CalamityMod/ExtraTextures/Tanks/Backpack_CleansingBlaze"), - ModContent.Request("CalamityMod/ExtraTextures/Tanks/Backpack_ElementalEruption"), - ModContent.Request("CalamityMod/ExtraTextures/Tanks/Backpack_TheEmpyrean"), - ModContent.Request("CalamityMod/ExtraTextures/Tanks/Backpack_Meowthrower"), - ModContent.Request("CalamityMod/ExtraTextures/Tanks/Backpack_OverloadedBlaster"), - ModContent.Request("CalamityMod/ExtraTextures/Tanks/Backpack_TerraFlameburster"), - ModContent.Request("CalamityMod/ExtraTextures/Tanks/Backpack_Photoviscerator"), - ModContent.Request("CalamityMod/ExtraTextures/Tanks/Backpack_Shadethrower"), - ModContent.Request("CalamityMod/ExtraTextures/Tanks/Backpack_BloodBoiler"), - ModContent.Request("CalamityMod/ExtraTextures/Tanks/Backpack_PristineFury"), - ModContent.Request("CalamityMod/ExtraTextures/Tanks/Backpack_AuroraBlazer") + ModContent.Request("CalamityMod/ExtraTextures/Tanks/Backpack_FlurrystormCannon").Value, + ModContent.Request("CalamityMod/ExtraTextures/Tanks/Backpack_BlightSpewer").Value, + ModContent.Request("CalamityMod/ExtraTextures/Tanks/Backpack_BrimstoneFlameblaster").Value, + ModContent.Request("CalamityMod/ExtraTextures/Tanks/Backpack_HavocsBreath").Value, + ModContent.Request("CalamityMod/ExtraTextures/Tanks/Backpack_SparkSpreader").Value, + ModContent.Request("CalamityMod/ExtraTextures/Tanks/Backpack_HalleysInferno").Value, + ModContent.Request("CalamityMod/ExtraTextures/Tanks/Backpack_CleansingBlaze").Value, + ModContent.Request("CalamityMod/ExtraTextures/Tanks/Backpack_ElementalEruption").Value, + ModContent.Request("CalamityMod/ExtraTextures/Tanks/Backpack_TheEmpyrean").Value, + ModContent.Request("CalamityMod/ExtraTextures/Tanks/Backpack_Meowthrower").Value, + ModContent.Request("CalamityMod/ExtraTextures/Tanks/Backpack_OverloadedBlaster").Value, + ModContent.Request("CalamityMod/ExtraTextures/Tanks/Backpack_TerraFlameburster").Value, + ModContent.Request("CalamityMod/ExtraTextures/Tanks/Backpack_Photoviscerator").Value, + ModContent.Request("CalamityMod/ExtraTextures/Tanks/Backpack_Shadethrower").Value, + ModContent.Request("CalamityMod/ExtraTextures/Tanks/Backpack_BloodBoiler").Value, + ModContent.Request("CalamityMod/ExtraTextures/Tanks/Backpack_PristineFury").Value, + ModContent.Request("CalamityMod/ExtraTextures/Tanks/Backpack_AuroraBlazer").Value }; if (tankItems.Contains(item.type) || drawPlayer.Calamity().plaguebringerCarapace) { @@ -1671,7 +834,7 @@ namespace CalamityMod.CalPlayer } } else if (drawPlayer.Calamity().plaguebringerCarapace) - thingToDraw = ModContent.Request("CalamityMod/Items/Armor/PlaguebringerCarapace_Back"); + thingToDraw = ModContent.Request("CalamityMod/Items/Armor/PlaguebringerCarapace_Back").Value; if (thingToDraw is null) return; @@ -1683,14 +846,14 @@ namespace CalamityMod.CalPlayer DrawData howDoIDrawThings = new DrawData(thingToDraw, new Vector2((int)(drawPlayer.position.X - Main.screenPosition.X + (drawPlayer.width / 2) - (9 * drawPlayer.direction)) + num25 * drawPlayer.direction, (int)(drawPlayer.position.Y - Main.screenPosition.Y + (drawPlayer.height / 2) + 2f * drawPlayer.gravDir + num24 * drawPlayer.gravDir)), new Rectangle(0, 0, thingToDraw.Width, thingToDraw.Height), - drawInfo.middleArmorColor, + drawInfo.colorArmorBody, drawPlayer.bodyRotation, new Vector2(thingToDraw.Width / 2, thingToDraw.Height / 2), 1f, spriteEffects, 0); howDoIDrawThings.shader = 0; - Main.playerDrawData.Add(howDoIDrawThings); + drawInfo.DrawDataCache.Add(howDoIDrawThings); } } } diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 5918ef0598..a1d3331bd0 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Alcohol; +using CalamityMod.Buffs.Alcohol; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.Potions; using CalamityMod.Buffs.StatBuffs; @@ -80,6 +80,15 @@ namespace CalamityMod.CalPlayer // Bool for any existing events, true if any event is active areThereAnyDamnEvents = CalamityGlobalNPC.AnyEvents(Player); + // Go through the old positions for the player. + for (int i = Player.Calamity().OldPositions.Length - 1; i > 0; i--) + { + if (OldPositions[i - 1] == Vector2.Zero) + OldPositions[i - 1] = Player.position; + OldPositions[i] = OldPositions[i - 1]; + } + OldPositions[0] = Player.position; + // Hurt the nearest NPC to the mouse if using the burning mouse. if (blazingCursorDamage) HandleBlazingMouseEffects(); diff --git a/CalPlayer/DrawLayers/AmidiasBubbleLayer.cs b/CalPlayer/DrawLayers/AmidiasBubbleLayer.cs new file mode 100644 index 0000000000..0862fb0e53 --- /dev/null +++ b/CalPlayer/DrawLayers/AmidiasBubbleLayer.cs @@ -0,0 +1,23 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.ModLoader; + +namespace CalamityMod.CalPlayer.DrawLayers +{ + public class AmidiasBubbleLayer : PlayerDrawLayer + { + public override Position GetDefaultPosition() => new AfterParent(PlayerDrawLayers.BackAcc); + + public override bool GetDefaultVisibility(PlayerDrawSet drawInfo) => drawInfo.drawPlayer.Calamity().amidiasBlessing && drawInfo.shadow == 0f; + + protected override void Draw(ref PlayerDrawSet drawInfo) + { + Texture2D texture = ModContent.Request("CalamityMod/ExtraTextures/AmidiasBubble").Value; + int drawX = (int)(drawInfo.Center.X - Main.screenPosition.X); + int drawY = (int)(drawInfo.Center.Y - Main.screenPosition.Y); + drawInfo.DrawDataCache.Add(new DrawData(texture, new Vector2(drawX, drawY), null, Color.White, 0f, texture.Size() * 0.5f, 1f, SpriteEffects.None, 0)); + } + } +} diff --git a/CalPlayer/DrawLayers/AndromedaMechLayer.cs b/CalPlayer/DrawLayers/AndromedaMechLayer.cs new file mode 100644 index 0000000000..b27adf80fd --- /dev/null +++ b/CalPlayer/DrawLayers/AndromedaMechLayer.cs @@ -0,0 +1,103 @@ +using System.Linq; +using CalamityMod.Items.Dyes; +using CalamityMod.Projectiles.Summon; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.ModLoader; + +namespace CalamityMod.CalPlayer.DrawLayers +{ + public class AndromedaMechLayer : PlayerDrawLayer + { + public override Position GetDefaultPosition() => new AfterParent(PlayerDrawLayers.EyebrellaCloud); + + public override bool GetDefaultVisibility(PlayerDrawSet drawInfo) + { + if (drawInfo.shadow != 0f) + return false; + + return drawInfo.drawPlayer.Calamity().andromedaState != AndromedaPlayerState.Inactive; + } + + protected override void Draw(ref PlayerDrawSet drawInfo) + { + Player drawPlayer = drawInfo.drawPlayer; + + // Clear all old draw data and draw the robot on top. + drawInfo.DrawDataCache.Clear(); + + int robot = -1; + int andromedaMechID = ModContent.ProjectileType(); + for (int i = 0; i < Main.projectile.Length; i++) + { + if (Main.projectile[i].active && Main.projectile[i].type == andromedaMechID && Main.projectile[i].owner == drawPlayer.whoAmI) + { + robot = i; + break; + } + } + if (robot == -1) + { + drawPlayer.Calamity().andromedaState = AndromedaPlayerState.Inactive; + return; + } + + GiantIbanRobotOfDoom robotEntityInstance = (GiantIbanRobotOfDoom)Main.projectile[robot].ModProjectile; + switch (drawPlayer.Calamity().andromedaState) + { + case AndromedaPlayerState.SpecialAttack: + Texture2D dashTexture = ModContent.Request("CalamityMod/ExtraTextures/AndromedaBolt").Value; + Rectangle frame = dashTexture.Frame(1, 4, 0, robotEntityInstance.RightIconCooldown / 4 % 4); + + DrawData drawData = new DrawData(dashTexture, + drawPlayer.Center + new Vector2(0f, -8f) - Main.screenPosition, + frame, + Color.White, + Main.projectile[robot].rotation, + drawPlayer.Size / 2, + 1f, + Main.projectile[robot].spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, + 1); + drawData.shader = drawPlayer.cBody; + + drawInfo.DrawDataCache.Add(drawData); + break; + case AndromedaPlayerState.LargeRobot: + Texture2D robotTexture = ModContent.Request(robotEntityInstance.Texture).Value; + frame = new Rectangle(robotEntityInstance.FrameX * robotTexture.Width / 3, robotEntityInstance.FrameY * robotTexture.Height / 7, robotTexture.Width / 3, robotTexture.Height / 7); + + drawData = new DrawData(ModContent.Request(Main.projectile[robot].ModProjectile.Texture).Value, + Main.projectile[robot].Center + Vector2.UnitY * 6f - Main.screenPosition, + frame, + Color.White, + Main.projectile[robot].rotation, + Main.projectile[robot].Size / 2, + 1f, + Main.projectile[robot].spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, + 1); + drawData.shader = drawPlayer.cBody; + + drawInfo.DrawDataCache.Add(drawData); + break; + case AndromedaPlayerState.SmallRobot: + robotTexture = ModContent.Request("CalamityMod/Projectiles/Summon/AndromedaSmall").Value; + frame = new Rectangle(0, robotEntityInstance.CurrentFrame * 54, robotTexture.Width, robotTexture.Height / 21); + drawData = new DrawData(robotTexture, + drawPlayer.Center + new Vector2(drawPlayer.direction == 1 ? -24 : -10, -8f) - Main.screenPosition, + frame, + Color.White, + 0f, + drawPlayer.Size / 2, + 1f, + Main.projectile[robot].spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, + 1); + drawData.shader = drawPlayer.cBody; + + drawInfo.DrawDataCache.Add(drawData); + break; + } + } + } +} diff --git a/CalPlayer/DrawLayers/AngelicAllianceAuroraLayer.cs b/CalPlayer/DrawLayers/AngelicAllianceAuroraLayer.cs new file mode 100644 index 0000000000..1b1d269801 --- /dev/null +++ b/CalPlayer/DrawLayers/AngelicAllianceAuroraLayer.cs @@ -0,0 +1,29 @@ +using System.Linq; +using CalamityMod.Items.Dyes; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ModLoader; + +namespace CalamityMod.CalPlayer.DrawLayers +{ + public class AngelicAllianceAuroraLayer : PlayerDrawLayer + { + public override Position GetDefaultPosition() => new AfterParent(PlayerDrawLayers.EyebrellaCloud); + + public override bool GetDefaultVisibility(PlayerDrawSet drawInfo) + { + if (drawInfo.shadow != 0f) + return false; + + return drawInfo.drawPlayer.Calamity().divineBless; + } + + protected override void Draw(ref PlayerDrawSet drawInfo) + { + Player drawPlayer = drawInfo.drawPlayer; + int totalMoonlightDyes = drawPlayer.dye.Count(dyeItem => dyeItem.type == ModContent.ItemType()); + drawInfo.DrawDataCache.AddRange(CalamityUtils.DrawAuroras(drawPlayer, 7, 0.4f, CalamityUtils.ColorSwap(new Color(255, 163, 56), new Color(242, 48, 187), 3f))); + } + } +} diff --git a/CalPlayer/DrawLayers/AuralisAuroraLayer.cs b/CalPlayer/DrawLayers/AuralisAuroraLayer.cs new file mode 100644 index 0000000000..4c87b3889f --- /dev/null +++ b/CalPlayer/DrawLayers/AuralisAuroraLayer.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using CalamityMod.Items.Dyes; +using CalamityMod.Items.Weapons.Ranged; +using Terraria; +using Terraria.DataStructures; +using Terraria.ModLoader; + +namespace CalamityMod.CalPlayer.DrawLayers +{ + public class AuralisAuroraLayer : PlayerDrawLayer + { + public override Position GetDefaultPosition() => new AfterParent(PlayerDrawLayers.EyebrellaCloud); + + public override bool GetDefaultVisibility(PlayerDrawSet drawInfo) + { + if (drawInfo.shadow != 0f) + return false; + + Player drawPlayer = drawInfo.drawPlayer; + return !(drawPlayer.Calamity().auralisAuroraCooldown < 300 || drawPlayer.Calamity().auralisAuroraCooldown > 0); + } + + protected override void Draw(ref PlayerDrawSet drawInfo) + { + Player drawPlayer = drawInfo.drawPlayer; + int totalMoonlightDyes = drawPlayer.dye.Count(dyeItem => dyeItem.type == ModContent.ItemType()); + drawInfo.DrawDataCache.AddRange(CalamityUtils.DrawAuroras(drawPlayer, 7, 0.4f, CalamityUtils.ColorSwap(Auralis.blueColor, Auralis.greenColor, 3f))); + } + } +} diff --git a/CalPlayer/DrawLayers/CobaltSetTrailLayer.cs b/CalPlayer/DrawLayers/CobaltSetTrailLayer.cs new file mode 100644 index 0000000000..521909c666 --- /dev/null +++ b/CalPlayer/DrawLayers/CobaltSetTrailLayer.cs @@ -0,0 +1,47 @@ +using System.Collections.Generic; +using CalamityMod.Items.VanillaArmorChanges; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ModLoader; + +namespace CalamityMod.CalPlayer.DrawLayers +{ + public class CobaltSetTrailLayer : PlayerDrawLayer + { + public override Position GetDefaultPosition() => new AfterParent(PlayerDrawLayers.EyebrellaCloud); + + public override bool GetDefaultVisibility(PlayerDrawSet drawInfo) + { + Player drawPlayer = drawInfo.drawPlayer; + if (drawInfo.shadow != 0f || drawPlayer.dead) + return false; + + return drawPlayer.Calamity().CobaltSet; + } + + protected override void Draw(ref PlayerDrawSet drawInfo) + { + Player drawPlayer = drawInfo.drawPlayer; + List existingDrawData = drawInfo.DrawDataCache; + for (int i = 0; i < drawPlayer.Calamity().OldPositions.Length; i++) + { + float completionRatio = i / (float)drawPlayer.Calamity().OldPositions.Length; + float scale = MathHelper.Lerp(1f, 0.5f, completionRatio); + float opacity = MathHelper.Lerp(0.23f, 0.07f, completionRatio) * CobaltArmorSetChange.CalculateMovementSpeedInterpolant(drawPlayer); + List afterimages = new List(); + for (int j = 0; j < existingDrawData.Count; j++) + { + var drawData = existingDrawData[j]; + drawData.position = existingDrawData[j].position - drawPlayer.position + drawPlayer.oldPosition; + drawData.color = Color.Cyan * opacity; + drawData.color.G = (byte)(drawData.color.G * 0.87); + drawData.color.B = (byte)(drawData.color.B * 1.24); + drawData.scale = new Vector2(scale); + afterimages.Add(drawData); + } + drawInfo.DrawDataCache.InsertRange(0, afterimages); + } + } + } +} diff --git a/CalPlayer/DrawLayers/ColdDivinityOverlayLayer.cs b/CalPlayer/DrawLayers/ColdDivinityOverlayLayer.cs new file mode 100644 index 0000000000..74360671d6 --- /dev/null +++ b/CalPlayer/DrawLayers/ColdDivinityOverlayLayer.cs @@ -0,0 +1,30 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.ModLoader; + +namespace CalamityMod.CalPlayer.DrawLayers +{ + public class ColdDivinityOverlayLayer : PlayerDrawLayer + { + public override Position GetDefaultPosition() => new BeforeParent(PlayerDrawLayers.Skin); + + public override bool GetDefaultVisibility(PlayerDrawSet drawInfo) + { + Player drawPlayer = drawInfo.drawPlayer; + CalamityPlayer modPlayer = drawPlayer.Calamity(); + return drawInfo.shadow == 0f && !drawPlayer.dead && modPlayer.coldDivinity; + } + + protected override void Draw(ref PlayerDrawSet drawInfo) + { + Texture2D texture = ModContent.Request("CalamityMod/ExtraTextures/ColdDivinityBody").Value; + int drawX = (int)(drawInfo.Center.X - Main.screenPosition.X); + int drawY = (int)(drawInfo.Center.Y - Main.screenPosition.Y); + Player drawPlayer = drawInfo.drawPlayer; + SpriteEffects spriteEffects = drawPlayer.direction != -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + drawInfo.DrawDataCache.Add(new DrawData(texture, new Vector2(drawX, drawY), null, new Color(53, Main.DiscoG, 255) * 0.5f, 0f, texture.Size() * 0.5f, 1.15f, spriteEffects, 0)); + } + } +} diff --git a/CalPlayer/DrawLayers/ConcentratedVoidAuraLayer.cs b/CalPlayer/DrawLayers/ConcentratedVoidAuraLayer.cs new file mode 100644 index 0000000000..dfad63ed0e --- /dev/null +++ b/CalPlayer/DrawLayers/ConcentratedVoidAuraLayer.cs @@ -0,0 +1,35 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.ModLoader; + +namespace CalamityMod.CalPlayer.DrawLayers +{ + public class ConcentratedVoidAuraLayer : PlayerDrawLayer + { + public override Position GetDefaultPosition() => new BeforeParent(PlayerDrawLayers.Skin); + + public override bool GetDefaultVisibility(PlayerDrawSet drawInfo) + { + Player drawPlayer = drawInfo.drawPlayer; + CalamityPlayer modPlayer = drawPlayer.Calamity(); + return drawInfo.shadow == 0f && !drawPlayer.dead && (modPlayer.voidAura || modPlayer.voidAuraDamage); + } + + protected override void Draw(ref PlayerDrawSet drawInfo) + { + Player drawPlayer = drawInfo.drawPlayer; + Texture2D tex = ModContent.Request("CalamityMod/ExtraTextures/VoidConcentrationAura").Value; + Vector2 drawPos = drawInfo.Center - Main.screenPosition + new Vector2(0f, drawPlayer.gfxOffY); + drawPos.Y -= 9f; + + // Intentionally inverse due to giving more space for the player model without faffing about with the specific positioning + SpriteEffects spriteEffects = drawPlayer.direction != -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + float scale = 1.75f; + Rectangle frame = tex.Frame(1, 4, 0, drawPlayer.Calamity().voidFrame); + Vector2 origin = new Vector2(tex.Width / 2f, tex.Height / 2f / 4f); + drawInfo.DrawDataCache.Add(new DrawData(tex, drawPos, frame, Color.White * 0.4f, 0f, origin, scale, spriteEffects, 0)); + } + } +} diff --git a/CalPlayer/DrawLayers/FathomSwarmerTailLayer.cs b/CalPlayer/DrawLayers/FathomSwarmerTailLayer.cs new file mode 100644 index 0000000000..f1842a1b21 --- /dev/null +++ b/CalPlayer/DrawLayers/FathomSwarmerTailLayer.cs @@ -0,0 +1,37 @@ +using System; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.ModLoader; + +namespace CalamityMod.CalPlayer.DrawLayers +{ + public class FathomSwarmerTailLayer : PlayerDrawLayer + { + public override Position GetDefaultPosition() => new BeforeParent(PlayerDrawLayers.Skin); + + public override bool GetDefaultVisibility(PlayerDrawSet drawInfo) + { + Player drawPlayer = drawInfo.drawPlayer; + CalamityPlayer modPlayer = drawPlayer.Calamity(); + return drawInfo.shadow == 0f && !drawPlayer.dead && modPlayer.fathomSwarmerTail; + } + + protected override void Draw(ref PlayerDrawSet drawInfo) + { + Texture2D texture = ModContent.Request("CalamityMod/Items/Armor/FathomSwarmerArmor_Tail").Value; + Player drawPlayer = drawInfo.drawPlayer; + Rectangle frame = texture.Frame(1, 4, 0, drawPlayer.Calamity().tailFrame); + int dyeShader = drawPlayer.dye?[2].dye ?? 0; + int frameSizeY = texture.Height / 4; + int drawX = (int)(drawInfo.Center.X - Main.screenPosition.X - (3 * drawPlayer.direction)); + int drawY = (int)(drawInfo.Center.Y - Main.screenPosition.Y); + DrawData tailDrawData = new DrawData(texture, new Vector2(drawX, drawY), frame, drawInfo.colorPants, 0f, new Vector2(texture.Width / 2f, frameSizeY / 2f), 1f, drawInfo.playerEffect, 0) + { + shader = dyeShader + }; + drawInfo.DrawDataCache.Add(tailDrawData); + } + } +} diff --git a/CalPlayer/DrawLayers/ForbiddenSignLayer.cs b/CalPlayer/DrawLayers/ForbiddenSignLayer.cs new file mode 100644 index 0000000000..0e283ad12c --- /dev/null +++ b/CalPlayer/DrawLayers/ForbiddenSignLayer.cs @@ -0,0 +1,67 @@ +using System; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.CalPlayer.DrawLayers +{ + public class ForbiddenSignLayer : PlayerDrawLayer + { + public override Position GetDefaultPosition() => new BeforeParent(PlayerDrawLayers.Skin); + + public override bool GetDefaultVisibility(PlayerDrawSet drawInfo) + { + Player drawPlayer = drawInfo.drawPlayer; + CalamityPlayer modPlayer = drawPlayer.Calamity(); + return drawInfo.shadow == 0f && !drawPlayer.dead && modPlayer.forbiddenCirclet; + } + + protected override void Draw(ref PlayerDrawSet drawInfo) + { + Player drawPlayer = drawInfo.drawPlayer; + SpriteEffects spriteEffects; + if (drawPlayer.direction == 1) + spriteEffects = SpriteEffects.None; + else spriteEffects = SpriteEffects.FlipHorizontally; + + if (drawPlayer.gravDir != 1f) + spriteEffects |= SpriteEffects.FlipVertically; + + int dyeShader = 0; + if (drawPlayer.dye[1] != null) + dyeShader = drawPlayer.dye[1].dye; + + Color baseColor = drawPlayer.GetImmuneAlphaPure(Lighting.GetColor((int)drawInfo.Center.X / 16, (int)drawInfo.Center.Y / 16, Color.White), drawInfo.shadow); + Color color = Color.Lerp(baseColor, Color.White, 0.7f); + Texture2D texture = TextureAssets.Extra[ExtrasID.ForbiddenSign].Value; + Texture2D glowmask = TextureAssets.GlowMask[GlowMaskID.ForbiddenSign].Value; + float offsetY = (float)Math.Sin(drawPlayer.miscCounter / 300f * MathHelper.TwoPi) * 6f; + float sinusoidalTime = (float)Math.Cos(drawPlayer.miscCounter / 75f * MathHelper.TwoPi); + Color afterimageColor = new Color(80, 70, 40, 0) * (sinusoidalTime * 0.5f + 0.5f) * 0.8f; + float gravCheckOffset = drawPlayer.gravDir != 1f ? -20f : 20f; + + Vector2 position = new Vector2(drawInfo.Center.X - drawPlayer.bodyFrame.Width / 2 + drawPlayer.width / 2, drawInfo.Center.Y + drawPlayer.height - drawPlayer.bodyFrame.Height + 4f) + drawPlayer.bodyPosition; + position += new Vector2(drawPlayer.bodyFrame.Width / 2, drawPlayer.bodyFrame.Height / 2) + new Vector2(-drawPlayer.direction * 10, offsetY - gravCheckOffset); + position -= Main.screenPosition + drawPlayer.Size * 0.5f; + + // Draw the original sign. + DrawData drawData = new(texture, position, null, color, drawPlayer.bodyRotation, texture.Size() * 0.5f, 1f, spriteEffects, 0) + { + shader = dyeShader + }; + drawInfo.DrawDataCache.Add(drawData); + + // Draw 4 semi-transparent copies. + for (float i = 0f; i < 4f; i++) + { + float angle = MathHelper.TwoPi / 4f * i; + drawData = new(glowmask, position + angle.ToRotationVector2() * sinusoidalTime * 4f, null, afterimageColor, drawPlayer.bodyRotation, texture.Size() * 0.5f, 1f, spriteEffects, 0); + drawInfo.DrawDataCache.Add(drawData); + } + } + } +} diff --git a/CalPlayer/DrawLayers/GemTechGemLayer.cs b/CalPlayer/DrawLayers/GemTechGemLayer.cs new file mode 100644 index 0000000000..0fff579180 --- /dev/null +++ b/CalPlayer/DrawLayers/GemTechGemLayer.cs @@ -0,0 +1,97 @@ +using System; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.ModLoader; + +namespace CalamityMod.CalPlayer.DrawLayers +{ + public class GemTechGemLayer : PlayerDrawLayer + { + public override Position GetDefaultPosition() => new AfterParent(PlayerDrawLayers.EyebrellaCloud); + + public override bool GetDefaultVisibility(PlayerDrawSet drawInfo) + { + Player drawPlayer = drawInfo.drawPlayer; + CalamityPlayer modPlayer = drawPlayer.Calamity(); + return drawInfo.shadow == 0f && !drawPlayer.dead && modPlayer.GemTechSet && drawPlayer.Calamity().andromedaState == AndromedaPlayerState.Inactive; + } + + protected override void Draw(ref PlayerDrawSet drawInfo) + { + Player drawPlayer = drawInfo.drawPlayer; + CalamityPlayer modPlayer = drawPlayer.Calamity(); + for (int i = 5; i >= 0; i--) + { + Texture2D gemTexture; + float pulseFactor = 1.8f; + GemTechArmorGemType gemType; + switch (i) + { + case 0: + default: + gemTexture = ModContent.Request("CalamityMod/ExtraTextures/GemTechArmor/RedGem").Value; + gemType = GemTechArmorGemType.Rogue; + break; + case 1: + gemTexture = ModContent.Request("CalamityMod/ExtraTextures/GemTechArmor/YellowGem").Value; + gemType = GemTechArmorGemType.Melee; + break; + case 2: + gemTexture = ModContent.Request("CalamityMod/ExtraTextures/GemTechArmor/GreenGem").Value; + gemType = GemTechArmorGemType.Ranged; + break; + case 3: + gemTexture = ModContent.Request("CalamityMod/ExtraTextures/GemTechArmor/BlueGem").Value; + gemType = GemTechArmorGemType.Summoner; + break; + case 4: + gemTexture = ModContent.Request("CalamityMod/ExtraTextures/GemTechArmor/PurpleGem").Value; + gemType = GemTechArmorGemType.Magic; + break; + case 5: + gemTexture = ModContent.Request("CalamityMod/ExtraTextures/GemTechArmor/PinkGem").Value; + gemType = GemTechArmorGemType.Base; + pulseFactor = 2.5f; + break; + } + + // Don't bother doing anything else if the gem is inactive. + if (!modPlayer.GemTechState.GemIsActive(gemType)) + continue; + + float drawOffsetAngle = modPlayer.GemTechState.CalculateGemOffsetAngle(gemType); + float gemOpacity = MathHelper.Lerp(0.85f, 1.05f, (float)Math.Cos(Main.GlobalTimeWrappedHourly * 2.3f) * 0.5f + 0.5f); + + // Incorporate a sinusoidal pulse into the pulse factor. + pulseFactor *= (float)Math.Cos(Main.GlobalTimeWrappedHourly * 0.61f + drawOffsetAngle); + + // Somewhat unorthodox way of creating an illusion of gems being drawn behind the player via orbiting. + // Instead of actually messing with a Z position it simply fades away when the sine of the draw + // offset angle is in the low negatives. + gemOpacity *= Utils.GetLerpValue(-0.75f, -0.51f, (float)Math.Sin(drawOffsetAngle), true); + + Vector2 baseDrawPosition = modPlayer.GemTechState.CalculateGemPosition(gemType) - Main.screenPosition; + + // Draw back afterimages. + for (int j = 0; j < 5; j++) + { + Color backAfterimageColor = Main.hslToRgb((Main.GlobalTimeWrappedHourly * 0.47f + j / 5f) % 1f, 1f, 0.67f); + backAfterimageColor = Color.Lerp(backAfterimageColor, Color.White, 0.64f) * gemOpacity * 0.24f; + Vector2 drawPosition = baseDrawPosition + (MathHelper.TwoPi * j / 5f).ToRotationVector2() * pulseFactor; + DrawData gemBackDrawData = new DrawData(gemTexture, drawPosition, null, backAfterimageColor, 0f, gemTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0); + drawInfo.DrawDataCache.Add(gemBackDrawData); + } + + // Draw the main gem. + Color baseGemColor = Main.hslToRgb(Main.GlobalTimeWrappedHourly * 0.51f % 1f, 1f, 0.67f); + baseGemColor = Color.Lerp(baseGemColor, Color.White, 0.56f); + baseGemColor.A = 105; + baseGemColor *= gemOpacity; + DrawData gemDrawData = new DrawData(gemTexture, baseDrawPosition, null, baseGemColor, 0f, gemTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0); + drawInfo.DrawDataCache.Add(gemDrawData); + } + } + } +} diff --git a/CalPlayer/DrawLayers/HatExtensionLayer.cs b/CalPlayer/DrawLayers/HatExtensionLayer.cs new file mode 100644 index 0000000000..1bc8e90cc8 --- /dev/null +++ b/CalPlayer/DrawLayers/HatExtensionLayer.cs @@ -0,0 +1,50 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.DataStructures; +using Terraria.ModLoader; + +namespace CalamityMod.CalPlayer.DrawLayers +{ + public class HatExtensionLayer : PlayerDrawLayer + { + public override Position GetDefaultPosition() => new AfterParent(PlayerDrawLayers.Head); + + public override bool GetDefaultVisibility(PlayerDrawSet drawInfo) => drawInfo.shadow != 0f || drawInfo.drawPlayer.dead; + + protected override void Draw(ref PlayerDrawSet drawInfo) + { + Player drawPlayer = drawInfo.drawPlayer; + int headItemType = drawPlayer.armor[0].type; + if (drawPlayer.armor[10].type > ItemID.None) + headItemType = drawPlayer.armor[10].type; + + if (ModContent.GetModItem(headItemType) is IExtendedHat extendedHatDrawer) + { + if (extendedHatDrawer.PreDrawExtension(drawInfo)) + { + int dyeShader = drawPlayer.dye?[0].dye ?? 0; + + // Remember to use drawInfo.position and not drawPlayer.position, or else it will not display properly in the player selection screen. + Vector2 origin = new Vector2(drawPlayer.legFrame.Width * 0.5f, drawPlayer.legFrame.Height * 0.4f); + Vector2 headDrawPosition = drawInfo.Center.Floor() - Main.screenPosition; + + //Account for the hellspawns known as mounts + if (drawPlayer.mount.Active) + headDrawPosition.Y += drawPlayer.mount.HeightBoost; + + headDrawPosition += extendedHatDrawer.ExtensionSpriteOffset(drawInfo); + + Texture2D extraPieceTexture = ModContent.Request(extendedHatDrawer.ExtensionTexture).Value; + Rectangle frame = extraPieceTexture.Frame(1, 20, 0, drawPlayer.bodyFrame.Y / drawPlayer.bodyFrame.Height); + DrawData pieceDrawData = new DrawData(extraPieceTexture, headDrawPosition, frame, drawInfo.colorHead, drawPlayer.fullRotation, origin, 1f, drawInfo.playerEffect, 0) + { + shader = dyeShader + }; + drawInfo.DrawDataCache.Add(pieceDrawData); + } + } + } + } +} diff --git a/CalPlayer/DrawLayers/IExtendedHat.cs b/CalPlayer/DrawLayers/IExtendedHat.cs new file mode 100644 index 0000000000..ecab4f2b3c --- /dev/null +++ b/CalPlayer/DrawLayers/IExtendedHat.cs @@ -0,0 +1,18 @@ +using Microsoft.Xna.Framework; +using Terraria.DataStructures; + +public interface IExtendedHat +{ + /// + /// The texture of the extension + /// + string ExtensionTexture { get; } + /// + /// Unless you are using custom drawing, mount offsets are taken into account automatically. + /// + Vector2 ExtensionSpriteOffset(PlayerDrawSet drawInfo); + /// + ///Return true to make the extension get drawn automatically from the texture and offsets provided. Return false if you want to draw it yourself + /// + bool PreDrawExtension(PlayerDrawSet drawInfo); +} diff --git a/CalPlayer/DrawLayers/MountsAboveOwnerLayer.cs b/CalPlayer/DrawLayers/MountsAboveOwnerLayer.cs new file mode 100644 index 0000000000..517d041ab8 --- /dev/null +++ b/CalPlayer/DrawLayers/MountsAboveOwnerLayer.cs @@ -0,0 +1,23 @@ +using Terraria; +using Terraria.DataStructures; +using Terraria.ModLoader; + +namespace CalamityMod.CalPlayer.DrawLayers +{ + public class MountsAboveOwnerLayer : PlayerDrawLayer + { + public override Position GetDefaultPosition() => new AfterParent(PlayerDrawLayers.EyebrellaCloud); + + public override bool GetDefaultVisibility(PlayerDrawSet drawInfo) + { + Player drawPlayer = drawInfo.drawPlayer; + CalamityPlayer modPlayer = drawPlayer.Calamity(); + return drawPlayer.mount != null && (modPlayer.fab || modPlayer.crysthamyr || modPlayer.onyxExcavator); + } + + protected override void Draw(ref PlayerDrawSet drawInfo) + { + drawInfo.drawPlayer.mount.Draw(drawInfo.DrawDataCache, 3, drawInfo.drawPlayer, drawInfo.Center - drawInfo.drawPlayer.Size * 0.5f, drawInfo.colorMount, drawInfo.playerEffect, drawInfo.shadow); + } + } +} diff --git a/CalPlayer/DrawLayers/ProfanedMoonlightDyeLayer.cs b/CalPlayer/DrawLayers/ProfanedMoonlightDyeLayer.cs new file mode 100644 index 0000000000..ce34b6a2a7 --- /dev/null +++ b/CalPlayer/DrawLayers/ProfanedMoonlightDyeLayer.cs @@ -0,0 +1,76 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using CalamityMod.Items.Dyes; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ModLoader; + +namespace CalamityMod.CalPlayer.DrawLayers +{ + public class ProfanedMoonlightDyeLayer : PlayerDrawLayer + { + public static readonly List MoonlightDyeDayColors = new() + { + new Color(255, 163, 56), + new Color(235, 30, 19), + new Color(242, 48, 187), + }; + + public static readonly List MoonlightDyeNightColors = new() + { + new Color(24, 134, 198), + new Color(130, 40, 150), + new Color(40, 64, 150), + }; + + public static void DetermineMoonlightDyeColors(out Color drawColor, Color dayColor, Color nightColor) + { + int totalTime = Main.dayTime ? 54000 : 32400; + float transitionTime = 5400; + float interval = Utils.GetLerpValue(0f, transitionTime, (float)Main.time, true) + Utils.GetLerpValue(totalTime - transitionTime, totalTime, (float)Main.time, true); + if (Main.dayTime) + { + // Dusk. + if (Main.time >= totalTime - transitionTime) + drawColor = Color.Lerp(dayColor, nightColor, Utils.GetLerpValue(totalTime - transitionTime, totalTime, (float)Main.time, true)); + // Dawn. + else if (Main.time <= transitionTime) + drawColor = Color.Lerp(nightColor, dayColor, interval); + else + drawColor = dayColor; + } + else drawColor = nightColor; + } + + public static Color GetCurrentMoonlightDyeColor(float angleOffset = 0f) + { + float interval = (float)Math.Cos(Main.GlobalTimeWrappedHourly * 0.6f + angleOffset) * 0.5f + 0.5f; + interval = MathHelper.Clamp(interval, 0f, 0.995f); + Color dayColorToUse = CalamityUtils.MulticolorLerp(interval, MoonlightDyeDayColors.ToArray()); + Color nightColorToUse = CalamityUtils.MulticolorLerp(interval, MoonlightDyeNightColors.ToArray()); + DetermineMoonlightDyeColors(out Color drawColor, dayColorToUse, nightColorToUse); + return drawColor; + } + + public override Position GetDefaultPosition() => new AfterParent(PlayerDrawLayers.EyebrellaCloud); + + public override bool GetDefaultVisibility(PlayerDrawSet drawInfo) + { + if (drawInfo.shadow != 0f) + return false; + + Player drawPlayer = drawInfo.drawPlayer; + int totalMoonlightDyes = drawPlayer.dye.Count(dyeItem => dyeItem.type == ModContent.ItemType()); + return totalMoonlightDyes > 0; + } + + protected override void Draw(ref PlayerDrawSet drawInfo) + { + Player drawPlayer = drawInfo.drawPlayer; + int totalMoonlightDyes = drawPlayer.dye.Count(dyeItem => dyeItem.type == ModContent.ItemType()); + drawInfo.DrawDataCache.AddRange(CalamityUtils.DrawAuroras(drawPlayer, 5 + (int)MathHelper.Clamp(totalMoonlightDyes, 0f, 4f) * 2, MathHelper.Clamp(totalMoonlightDyes / 3f, 0f, 1f), GetCurrentMoonlightDyeColor())); + } + } +} diff --git a/CalPlayer/DrawLayers/ProvidenceBurnFireLayer.cs b/CalPlayer/DrawLayers/ProvidenceBurnFireLayer.cs new file mode 100644 index 0000000000..360339515f --- /dev/null +++ b/CalPlayer/DrawLayers/ProvidenceBurnFireLayer.cs @@ -0,0 +1,27 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ModLoader; + +namespace CalamityMod.CalPlayer.DrawLayers +{ + public class ProvidenceBurnFireLayer : PlayerDrawLayer + { + public override Position GetDefaultPosition() => new AfterParent(PlayerDrawLayers.BackAcc); + + public override bool GetDefaultVisibility(PlayerDrawSet drawInfo) => drawInfo.shadow == 0f; + + protected override void Draw(ref PlayerDrawSet drawInfo) + { + if (drawInfo.shadow != 0f) + return; + + Player drawPlayer = drawInfo.drawPlayer; + CalamityPlayer modPlayer = drawPlayer.Calamity(); + + modPlayer.ProvidenceBurnEffectDrawer.DrawSet(drawPlayer.Bottom - Vector2.UnitY * 10f); + modPlayer.ProvidenceBurnEffectDrawer.SpawnAreaCompactness = 18f; + modPlayer.ProvidenceBurnEffectDrawer.RelativePower = 0.4f; + } + } +} diff --git a/CalPlayer/DrawLayers/RancorBookLayer.cs b/CalPlayer/DrawLayers/RancorBookLayer.cs new file mode 100644 index 0000000000..383aa9f969 --- /dev/null +++ b/CalPlayer/DrawLayers/RancorBookLayer.cs @@ -0,0 +1,40 @@ +using CalamityMod.Projectiles.Magic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.ModLoader; + +namespace CalamityMod.CalPlayer.DrawLayers +{ + public class RancorBookLayer : PlayerDrawLayer + { + public override Position GetDefaultPosition() => new AfterParent(PlayerDrawLayers.ArmOverItem); + + public override bool GetDefaultVisibility(PlayerDrawSet drawInfo) + { + Player drawPlayer = drawInfo.drawPlayer; + if (drawInfo.shadow != 0f || drawPlayer.dead) + return false; + + return drawPlayer.heldProj != -1 && Main.projectile[drawPlayer.heldProj].active && Main.projectile[drawPlayer.heldProj].type == ModContent.ProjectileType(); + } + + protected override void Draw(ref PlayerDrawSet drawInfo) + { + Player drawPlayer = drawInfo.drawPlayer; + + int bookType = ModContent.ProjectileType(); + Texture2D bookTexture = TextureAssets.Projectile[bookType].Value; + Projectile book = Main.projectile[drawPlayer.heldProj]; + Rectangle frame = bookTexture.Frame(1, Main.projFrames[bookType], 0, book.frame); + Vector2 origin = frame.Size() * 0.5f; + Vector2 drawPosition = drawPlayer.Center + Vector2.UnitX * drawPlayer.direction * 8f - Main.screenPosition; + Color drawColor = book.GetAlpha(Color.White); + SpriteEffects direction = book.spriteDirection == 1f ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + DrawData bookDrawData = new DrawData(bookTexture, drawPosition, frame, drawColor, book.rotation, origin, book.scale, direction, 0); + drawInfo.DrawDataCache.Add(bookDrawData); + } + } +} diff --git a/CalPlayer/DrawLayers/RoverDriveShieldLayer.cs b/CalPlayer/DrawLayers/RoverDriveShieldLayer.cs new file mode 100644 index 0000000000..7f2d481d68 --- /dev/null +++ b/CalPlayer/DrawLayers/RoverDriveShieldLayer.cs @@ -0,0 +1,35 @@ +using System; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.ModLoader; + +namespace CalamityMod.CalPlayer.DrawLayers +{ + public class RoverDriveShieldLayer : PlayerDrawLayer + { + public override Position GetDefaultPosition() => new BeforeParent(PlayerDrawLayers.Skin); + + public override bool GetDefaultVisibility(PlayerDrawSet drawInfo) + { + Player drawPlayer = drawInfo.drawPlayer; + CalamityPlayer modPlayer = drawPlayer.Calamity(); + return drawInfo.shadow == 0f && !drawPlayer.dead && modPlayer.roverDriveTimer < 616 && modPlayer.roverDrive; + } + + protected override void Draw(ref PlayerDrawSet drawInfo) + { + Player drawPlayer = drawInfo.drawPlayer; + Texture2D texture = ModContent.Request("CalamityMod/ExtraTextures/RoverAccShield").Value; + Vector2 drawPos = drawPlayer.Center - Main.screenPosition + new Vector2(0f, drawPlayer.gfxOffY); + Rectangle frame = texture.Frame(1, 11, 0, drawPlayer.Calamity().roverFrame); + Color color = Color.White * 0.625f; + Vector2 origin = new Vector2(texture.Width / 2f, texture.Height / 2f / 11f); + float scale = 1f + (float)Math.Cos(Main.GlobalTimeWrappedHourly) * 0.1f; + SpriteEffects spriteEffects = drawPlayer.direction != -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + + drawInfo.DrawDataCache.Add(new DrawData(texture, drawPos, frame, color, 0f, origin, scale, spriteEffects, 0)); + } + } +} diff --git a/CalPlayer/DrawLayers/SirenIceShieldLayer.cs b/CalPlayer/DrawLayers/SirenIceShieldLayer.cs new file mode 100644 index 0000000000..59073dc128 --- /dev/null +++ b/CalPlayer/DrawLayers/SirenIceShieldLayer.cs @@ -0,0 +1,23 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.ModLoader; + +namespace CalamityMod.CalPlayer.DrawLayers +{ + public class SirenIceShieldLayer : PlayerDrawLayer + { + public override Position GetDefaultPosition() => new AfterParent(PlayerDrawLayers.BackAcc); + + public override bool GetDefaultVisibility(PlayerDrawSet drawInfo) => drawInfo.drawPlayer.Calamity().sirenIce && drawInfo.shadow == 0f; + + protected override void Draw(ref PlayerDrawSet drawInfo) + { + Texture2D texture = ModContent.Request("CalamityMod/ExtraTextures/IceShield").Value; + int drawX = (int)(drawInfo.Center.X - Main.screenPosition.X); + int drawY = (int)(drawInfo.Center.Y - Main.screenPosition.Y); + drawInfo.DrawDataCache.Add(new DrawData(texture, new Vector2(drawX, drawY), null, Color.White, 0f, texture.Size() * 0.5f, 1f, SpriteEffects.None, 0)); + } + } +} diff --git a/CalPlayer/DrawLayers/StratusSphereOrbLayer.cs b/CalPlayer/DrawLayers/StratusSphereOrbLayer.cs new file mode 100644 index 0000000000..2e3eaa14a1 --- /dev/null +++ b/CalPlayer/DrawLayers/StratusSphereOrbLayer.cs @@ -0,0 +1,64 @@ +using System; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Projectiles.Magic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.ModLoader; + +namespace CalamityMod.CalPlayer.DrawLayers +{ + public class StratusSphereOrbLayer : PlayerDrawLayer + { + public override Position GetDefaultPosition() => new AfterParent(PlayerDrawLayers.ArmOverItem); + + public override bool GetDefaultVisibility(PlayerDrawSet drawInfo) + { + Player drawPlayer = drawInfo.drawPlayer; + if (drawInfo.shadow != 0f || drawPlayer.dead) + return false; + + return drawPlayer.ActiveItem().type == ModContent.ItemType(); + } + + protected override void Draw(ref PlayerDrawSet drawInfo) + { + Player drawPlayer = drawInfo.drawPlayer; + + SpriteEffects effect; + if (drawPlayer.direction == 1) + effect = SpriteEffects.None; + else + effect = SpriteEffects.FlipHorizontally; + if (drawPlayer.gravDir != 1f) + effect |= SpriteEffects.FlipVertically; + + Vector2 itemDrawPosition = drawPlayer.Center; + Texture2D drawTexture = ModContent.Request("CalamityMod/ExtraTextures/StratusSphereHold").Value; + Rectangle rectangle = drawTexture.Frame(1, 4, 0, (int)(Math.Sin(drawPlayer.miscCounter / 20f * MathHelper.TwoPi) * 2f + 2)); + Vector2 drawOffset = new Vector2(rectangle.Width / 2 * drawPlayer.direction, 0f); + Vector2 origin = rectangle.Size() / 2f; + drawInfo.DrawDataCache.Add(new DrawData(drawTexture, + (itemDrawPosition - Main.screenPosition + drawOffset).Floor(), + new Rectangle?(rectangle), + Color.White, + drawPlayer.itemRotation, + origin, + drawPlayer.inventory[drawPlayer.selectedItem].scale, + effect, + 0)); + drawTexture = ModContent.Request("CalamityMod/ExtraTextures/StratusSphereHoldGlow").Value; + drawInfo.DrawDataCache.Add(new DrawData(drawTexture, + (itemDrawPosition - Main.screenPosition + drawOffset).Floor(), + new Rectangle?(rectangle), + Color.White, + drawPlayer.itemRotation, + origin, + drawPlayer.inventory[drawPlayer.selectedItem].scale, + effect, + 0)); + } + } +} diff --git a/CalPlayer/DrawLayers/YanmeiKnifeTrailLayer.cs b/CalPlayer/DrawLayers/YanmeiKnifeTrailLayer.cs new file mode 100644 index 0000000000..b70d5c8184 --- /dev/null +++ b/CalPlayer/DrawLayers/YanmeiKnifeTrailLayer.cs @@ -0,0 +1,46 @@ +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ModLoader; + +namespace CalamityMod.CalPlayer.DrawLayers +{ + public class YanmeiKnifeTrail : PlayerDrawLayer + { + public override Position GetDefaultPosition() => new AfterParent(PlayerDrawLayers.EyebrellaCloud); + + public override bool GetDefaultVisibility(PlayerDrawSet drawInfo) + { + Player drawPlayer = drawInfo.drawPlayer; + if (drawInfo.shadow != 0f || drawPlayer.dead) + return false; + + return drawPlayer.Calamity().kamiBoost; + } + + protected override void Draw(ref PlayerDrawSet drawInfo) + { + Player drawPlayer = drawInfo.drawPlayer; + List existingDrawData = drawInfo.DrawDataCache; + for (int i = 0; i < drawPlayer.Calamity().OldPositions.Length; i++) + { + float completionRatio = i / (float)drawPlayer.Calamity().OldPositions.Length; + float scale = MathHelper.Lerp(1f, 0.5f, completionRatio); + float opacity = MathHelper.Lerp(0.25f, 0.08f, completionRatio); + List afterimages = new List(); + for (int j = 0; j < existingDrawData.Count; j++) + { + var drawData = existingDrawData[j]; + drawData.position = existingDrawData[j].position - drawPlayer.position + drawPlayer.oldPosition; + drawData.color = Color.Cyan * opacity; + drawData.color.G = (byte)(drawData.color.G * 1.6); + drawData.color.B = (byte)(drawData.color.B * 1.2); + drawData.scale = new Vector2(scale); + afterimages.Add(drawData); + } + drawInfo.DrawDataCache.InsertRange(0, afterimages); + } + } + } +} diff --git a/Items/Mounts/AlicornMount.cs b/Items/Mounts/AlicornMount.cs index 1f8098ad7f..1df09bcd47 100644 --- a/Items/Mounts/AlicornMount.cs +++ b/Items/Mounts/AlicornMount.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Mounts; +using CalamityMod.Buffs.Mounts; using CalamityMod.CalPlayer; using CalamityMod.NPCs.TownNPCs; using Microsoft.Xna.Framework; diff --git a/NPCs/Abyss/Bloatfish.cs b/NPCs/Abyss/Bloatfish.cs index 77da324f3f..f794164b19 100644 --- a/NPCs/Abyss/Bloatfish.cs +++ b/NPCs/Abyss/Bloatfish.cs @@ -28,13 +28,13 @@ namespace CalamityMod.NPCs.Abyss NPC.defense = 100; NPC.lifeMax = 7200; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 0, 30, 0); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0.9f; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/Abyss/BobbitWormHead.cs b/NPCs/Abyss/BobbitWormHead.cs index 81622b5e91..03c16f5a6e 100644 --- a/NPCs/Abyss/BobbitWormHead.cs +++ b/NPCs/Abyss/BobbitWormHead.cs @@ -32,13 +32,13 @@ namespace CalamityMod.NPCs.Abyss NPC.DR_NERD(0.25f); NPC.lifeMax = 6000; NPC.knockBackResist = 0f; - aiType = -1; + AIType = -1; NPC.noGravity = true; NPC.value = Item.buyPrice(0, 0, 50, 0); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/Abyss/BoxJellyfish.cs b/NPCs/Abyss/BoxJellyfish.cs index afe428783e..89359e1c0d 100644 --- a/NPCs/Abyss/BoxJellyfish.cs +++ b/NPCs/Abyss/BoxJellyfish.cs @@ -27,12 +27,12 @@ namespace CalamityMod.NPCs.Abyss NPC.lifeMax = 90; NPC.alpha = 20; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 0, 0, 80); NPC.HitSound = SoundID.NPCHit25; NPC.DeathSound = SoundID.NPCDeath28; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/Abyss/ChaoticPuffer.cs b/NPCs/Abyss/ChaoticPuffer.cs index 04458483a4..881c5b59d2 100644 --- a/NPCs/Abyss/ChaoticPuffer.cs +++ b/NPCs/Abyss/ChaoticPuffer.cs @@ -34,13 +34,13 @@ namespace CalamityMod.NPCs.Abyss NPC.defense = 50; NPC.lifeMax = 5625; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.value = Item.buyPrice(0, 0, 30, 0); NPC.HitSound = SoundID.NPCHit23; NPC.DeathSound = SoundID.NPCDeath28; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; @@ -125,7 +125,7 @@ namespace CalamityMod.NPCs.Abyss { int damageBoom = 45; int projectileType = ModContent.ProjectileType(); - int boom = Projectile.NewProjectile(NPC.Center.X, NPC.Center.Y, 0, 0, projectileType, damageBoom, 0f, Main.myPlayer, 0f, 0f); + int boom = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center.X, NPC.Center.Y, 0, 0, projectileType, damageBoom, 0f, Main.myPlayer, 0f, 0f); } NPC.netUpdate = true; } diff --git a/NPCs/Abyss/ColossalSquid.cs b/NPCs/Abyss/ColossalSquid.cs index fa18d49115..85d14311e9 100644 --- a/NPCs/Abyss/ColossalSquid.cs +++ b/NPCs/Abyss/ColossalSquid.cs @@ -37,15 +37,15 @@ namespace CalamityMod.NPCs.Abyss NPC.DR_NERD(0.05f); NPC.lifeMax = 130000; // Previously 220,000 NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.timeLeft = NPC.activeTime * 30; NPC.value = Item.buyPrice(0, 25, 0, 0); NPC.HitSound = SoundID.NPCHit20; NPC.DeathSound = SoundID.NPCDeath23; NPC.rarity = 2; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; @@ -393,7 +393,7 @@ namespace CalamityMod.NPCs.Abyss damage = 55; } SoundEngine.PlaySound(SoundID.Item, (int)NPC.position.X, (int)NPC.position.Y, 111); - Projectile.NewProjectile(NPC.Center.X, NPC.Center.Y + 60, 0f, 2f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center.X, NPC.Center.Y + 60, 0f, 2f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); } NPC.rotation = NPC.velocity.X * 0.05f; NPC.velocity *= 0.975f; diff --git a/NPCs/Abyss/Cuttlefish.cs b/NPCs/Abyss/Cuttlefish.cs index 3cbf7d08cb..f0f7502abe 100644 --- a/NPCs/Abyss/Cuttlefish.cs +++ b/NPCs/Abyss/Cuttlefish.cs @@ -28,13 +28,13 @@ namespace CalamityMod.NPCs.Abyss NPC.defense = 8; NPC.lifeMax = 110; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 0, 1, 0); NPC.HitSound = SoundID.NPCHit33; NPC.DeathSound = SoundID.NPCDeath28; NPC.knockBackResist = 0.3f; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/Abyss/DevilFish.cs b/NPCs/Abyss/DevilFish.cs index c5c72f77d3..90d4663561 100644 --- a/NPCs/Abyss/DevilFish.cs +++ b/NPCs/Abyss/DevilFish.cs @@ -35,13 +35,13 @@ namespace CalamityMod.NPCs.Abyss NPC.defense = 999999; NPC.lifeMax = 400; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 0, 10, 0); NPC.HitSound = SoundID.NPCHit4; NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0.85f; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/Abyss/DevilFishAlt.cs b/NPCs/Abyss/DevilFishAlt.cs index 64a1d04276..31441d2774 100644 --- a/NPCs/Abyss/DevilFishAlt.cs +++ b/NPCs/Abyss/DevilFishAlt.cs @@ -35,13 +35,13 @@ namespace CalamityMod.NPCs.Abyss NPC.defense = 999999; NPC.lifeMax = 400; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 0, 10, 0); NPC.HitSound = SoundID.NPCHit4; NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0.85f; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/Abyss/EidolonWyrmBody.cs b/NPCs/Abyss/EidolonWyrmBody.cs index 5d73837535..fca12f8c4e 100644 --- a/NPCs/Abyss/EidolonWyrmBody.cs +++ b/NPCs/Abyss/EidolonWyrmBody.cs @@ -21,7 +21,7 @@ namespace CalamityMod.NPCs.Abyss NPC.defense = 0; NPC.lifeMax = 160000; NPC.aiStyle = -1; //new - aiType = -1; //new + AIType = -1; //new NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.behindTiles = true; diff --git a/NPCs/Abyss/EidolonWyrmBodyAlt.cs b/NPCs/Abyss/EidolonWyrmBodyAlt.cs index e65cb9b81b..e8c60f45c2 100644 --- a/NPCs/Abyss/EidolonWyrmBodyAlt.cs +++ b/NPCs/Abyss/EidolonWyrmBodyAlt.cs @@ -21,7 +21,7 @@ namespace CalamityMod.NPCs.Abyss NPC.defense = 0; NPC.lifeMax = 160000; NPC.aiStyle = -1; //new - aiType = -1; //new + AIType = -1; //new NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.behindTiles = true; diff --git a/NPCs/Abyss/EidolonWyrmHead.cs b/NPCs/Abyss/EidolonWyrmHead.cs index 4200fda2aa..0c3b6765c2 100644 --- a/NPCs/Abyss/EidolonWyrmHead.cs +++ b/NPCs/Abyss/EidolonWyrmHead.cs @@ -162,13 +162,13 @@ namespace CalamityMod.NPCs.Abyss int random = Main.rand.Next(randomAmt); if (random == 0) { - Projectile.NewProjectile(vector2, Vector2.Zero, ProjectileID.CultistBossLightningOrb, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector2, Vector2.Zero, ProjectileID.CultistBossLightningOrb, damage, 0f, Main.myPlayer, 0f, 0f); } else if (random == 1) { Vector2 vec = (Main.player[NPC.target].Center - NPC.Center).SafeNormalize(Vector2.UnitX * NPC.direction); Vector2 vector4 = vec * (adultWyrmAlive ? 6f : 4f); - Projectile.NewProjectile(vector2, vector4, ProjectileID.CultistBossIceMist, damage, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector2, vector4, ProjectileID.CultistBossIceMist, damage, 0f, Main.myPlayer, 0f, 1f); } else { diff --git a/NPCs/Abyss/EidolonWyrmTail.cs b/NPCs/Abyss/EidolonWyrmTail.cs index a6c22c578d..bb5196b107 100644 --- a/NPCs/Abyss/EidolonWyrmTail.cs +++ b/NPCs/Abyss/EidolonWyrmTail.cs @@ -21,7 +21,7 @@ namespace CalamityMod.NPCs.Abyss NPC.defense = 0; NPC.lifeMax = 160000; NPC.aiStyle = -1; //new - aiType = -1; //new + AIType = -1; //new NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.behindTiles = true; diff --git a/NPCs/Abyss/GiantSquid.cs b/NPCs/Abyss/GiantSquid.cs index 9beb2c33c2..b3f692cf38 100644 --- a/NPCs/Abyss/GiantSquid.cs +++ b/NPCs/Abyss/GiantSquid.cs @@ -32,12 +32,12 @@ namespace CalamityMod.NPCs.Abyss NPC.defense = 18; NPC.lifeMax = 800; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 0, 15, 0); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/Abyss/GulperEelBody.cs b/NPCs/Abyss/GulperEelBody.cs index 15ace4c231..21691cb8c8 100644 --- a/NPCs/Abyss/GulperEelBody.cs +++ b/NPCs/Abyss/GulperEelBody.cs @@ -23,7 +23,7 @@ namespace CalamityMod.NPCs.Abyss NPC.defense = 30; NPC.lifeMax = 60000; NPC.aiStyle = -1; //new - aiType = -1; //new + AIType = -1; //new NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.behindTiles = true; @@ -34,8 +34,8 @@ namespace CalamityMod.NPCs.Abyss NPC.netAlways = true; NPC.dontCountMe = true; NPC.chaseable = false; - banner = ModContent.NPCType(); - bannerItem = ModContent.ItemType(); + Banner = ModContent.NPCType(); + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/Abyss/GulperEelBodyAlt.cs b/NPCs/Abyss/GulperEelBodyAlt.cs index e2a993dc72..2179eb1b97 100644 --- a/NPCs/Abyss/GulperEelBodyAlt.cs +++ b/NPCs/Abyss/GulperEelBodyAlt.cs @@ -23,7 +23,7 @@ namespace CalamityMod.NPCs.Abyss NPC.defense = 30; NPC.lifeMax = 60000; NPC.aiStyle = -1; //new - aiType = -1; //new + AIType = -1; //new NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.behindTiles = true; @@ -34,8 +34,8 @@ namespace CalamityMod.NPCs.Abyss NPC.netAlways = true; NPC.dontCountMe = true; NPC.chaseable = false; - banner = ModContent.NPCType(); - bannerItem = ModContent.ItemType(); + Banner = ModContent.NPCType(); + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/Abyss/GulperEelTail.cs b/NPCs/Abyss/GulperEelTail.cs index d9e084f8ad..d3885f6625 100644 --- a/NPCs/Abyss/GulperEelTail.cs +++ b/NPCs/Abyss/GulperEelTail.cs @@ -23,7 +23,7 @@ namespace CalamityMod.NPCs.Abyss NPC.defense = 50; NPC.lifeMax = 60000; NPC.aiStyle = -1; //new - aiType = -1; //new + AIType = -1; //new NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.behindTiles = true; @@ -34,8 +34,8 @@ namespace CalamityMod.NPCs.Abyss NPC.netAlways = true; NPC.dontCountMe = true; NPC.chaseable = false; - banner = ModContent.NPCType(); - bannerItem = ModContent.ItemType(); + Banner = ModContent.NPCType(); + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/Abyss/Laserfish.cs b/NPCs/Abyss/Laserfish.cs index effe307f6e..01ee19e89b 100644 --- a/NPCs/Abyss/Laserfish.cs +++ b/NPCs/Abyss/Laserfish.cs @@ -27,13 +27,13 @@ namespace CalamityMod.NPCs.Abyss NPC.defense = 15; NPC.lifeMax = 480; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 0, 10, 0); NPC.HitSound = SoundID.NPCHit51; NPC.DeathSound = SoundID.NPCDeath26; NPC.knockBackResist = 0.65f; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.chaseable = false; NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; diff --git a/NPCs/Abyss/LuminousCorvina.cs b/NPCs/Abyss/LuminousCorvina.cs index b601dd5e4e..a6df1d5ad0 100644 --- a/NPCs/Abyss/LuminousCorvina.cs +++ b/NPCs/Abyss/LuminousCorvina.cs @@ -35,13 +35,13 @@ namespace CalamityMod.NPCs.Abyss NPC.defense = 12; NPC.lifeMax = 800; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 0, 15, 0); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0.85f; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/Abyss/MirageJelly.cs b/NPCs/Abyss/MirageJelly.cs index 2284fee479..533684f0b8 100644 --- a/NPCs/Abyss/MirageJelly.cs +++ b/NPCs/Abyss/MirageJelly.cs @@ -34,13 +34,13 @@ namespace CalamityMod.NPCs.Abyss NPC.defense = 10; NPC.lifeMax = 6000; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.value = Item.buyPrice(0, 0, 25, 0); NPC.HitSound = SoundID.NPCHit25; NPC.DeathSound = SoundID.NPCDeath28; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = false; diff --git a/NPCs/Abyss/MorayEel.cs b/NPCs/Abyss/MorayEel.cs index b36a7b1ba6..8e242a18e5 100644 --- a/NPCs/Abyss/MorayEel.cs +++ b/NPCs/Abyss/MorayEel.cs @@ -24,13 +24,13 @@ namespace CalamityMod.NPCs.Abyss NPC.defense = 8; NPC.lifeMax = 360; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 0, 1, 0); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0.75f; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.chaseable = false; NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; diff --git a/NPCs/Abyss/OarfishBody.cs b/NPCs/Abyss/OarfishBody.cs index 2bc1510606..cbb5ae45fc 100644 --- a/NPCs/Abyss/OarfishBody.cs +++ b/NPCs/Abyss/OarfishBody.cs @@ -21,7 +21,7 @@ namespace CalamityMod.NPCs.Abyss NPC.defense = 20; NPC.lifeMax = 4000; NPC.aiStyle = -1; //new - aiType = -1; //new + AIType = -1; //new NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.behindTiles = true; @@ -32,8 +32,8 @@ namespace CalamityMod.NPCs.Abyss NPC.netAlways = true; NPC.dontCountMe = true; NPC.chaseable = false; - banner = ModContent.NPCType(); - bannerItem = ModContent.ItemType(); + Banner = ModContent.NPCType(); + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/Abyss/OarfishTail.cs b/NPCs/Abyss/OarfishTail.cs index 70a823e0f1..41813fcc6b 100644 --- a/NPCs/Abyss/OarfishTail.cs +++ b/NPCs/Abyss/OarfishTail.cs @@ -21,7 +21,7 @@ namespace CalamityMod.NPCs.Abyss NPC.defense = 30; NPC.lifeMax = 4000; NPC.aiStyle = -1; //new - aiType = -1; //new + AIType = -1; //new NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.behindTiles = true; @@ -32,8 +32,8 @@ namespace CalamityMod.NPCs.Abyss NPC.netAlways = true; NPC.dontCountMe = true; NPC.chaseable = false; - banner = ModContent.NPCType(); - bannerItem = ModContent.ItemType(); + Banner = ModContent.NPCType(); + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/Abyss/Reaper.cs b/NPCs/Abyss/Reaper.cs index 68f8abd967..ad2ceec3e2 100644 --- a/NPCs/Abyss/Reaper.cs +++ b/NPCs/Abyss/Reaper.cs @@ -39,15 +39,15 @@ namespace CalamityMod.NPCs.Abyss NPC.defense = 70; NPC.lifeMax = 100000; // Previously 190,000 NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.timeLeft = NPC.activeTime * 30; NPC.value = Item.buyPrice(0, 25, 0, 0); NPC.HitSound = SoundID.NPCHit56; NPC.DeathSound = SoundID.NPCDeath60; NPC.knockBackResist = 0f; NPC.rarity = 2; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/Abyss/ToxicMinnow.cs b/NPCs/Abyss/ToxicMinnow.cs index ffcee8df6e..704644c86a 100644 --- a/NPCs/Abyss/ToxicMinnow.cs +++ b/NPCs/Abyss/ToxicMinnow.cs @@ -30,13 +30,13 @@ namespace CalamityMod.NPCs.Abyss NPC.defense = 20; NPC.lifeMax = 240; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 0, 5, 0); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0.15f; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.chaseable = false; NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; @@ -89,8 +89,8 @@ namespace CalamityMod.NPCs.Abyss { int projectileType = ModContent.ProjectileType(); offsetAngleBoom = startAngleBoom + deltaAngleBoom * (iBoom + iBoom * iBoom) / 2f + 32f * iBoom; - int boom1 = Projectile.NewProjectile(valueBoom.X, valueBoom.Y, (float)(Math.Sin(offsetAngleBoom) * 6f), (float)(Math.Cos(offsetAngleBoom) * 6f), projectileType, damageBoom, 0f, Main.myPlayer, 0f, 0f); - int boom2 = Projectile.NewProjectile(valueBoom.X, valueBoom.Y, (float)(-Math.Sin(offsetAngleBoom) * 6f), (float)(-Math.Cos(offsetAngleBoom) * 6f), projectileType, damageBoom, 0f, Main.myPlayer, 0f, 0f); + int boom1 = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), valueBoom.X, valueBoom.Y, (float)(Math.Sin(offsetAngleBoom) * 6f), (float)(Math.Cos(offsetAngleBoom) * 6f), projectileType, damageBoom, 0f, Main.myPlayer, 0f, 0f); + int boom2 = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), valueBoom.X, valueBoom.Y, (float)(-Math.Sin(offsetAngleBoom) * 6f), (float)(-Math.Cos(offsetAngleBoom) * 6f), projectileType, damageBoom, 0f, Main.myPlayer, 0f, 0f); } } NPC.netUpdate = true; diff --git a/NPCs/Abyss/Viperfish.cs b/NPCs/Abyss/Viperfish.cs index 08da683773..015e714359 100644 --- a/NPCs/Abyss/Viperfish.cs +++ b/NPCs/Abyss/Viperfish.cs @@ -28,13 +28,13 @@ namespace CalamityMod.NPCs.Abyss NPC.defense = 10; NPC.lifeMax = 320; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 0, 5, 0); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0.85f; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.chaseable = false; NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; diff --git a/NPCs/AcidRain/AcidEel.cs b/NPCs/AcidRain/AcidEel.cs index ce168dccc4..f95fd946c3 100644 --- a/NPCs/AcidRain/AcidEel.cs +++ b/NPCs/AcidRain/AcidEel.cs @@ -51,13 +51,13 @@ namespace CalamityMod.NPCs.AcidRain NPC.value = Item.buyPrice(0, 0, 3, 32); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.lavaImmune = false; NPC.noGravity = true; NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/AcidRain/CragmawMire.cs b/NPCs/AcidRain/CragmawMire.cs index b78a050bf9..a9d55cf473 100644 --- a/NPCs/AcidRain/CragmawMire.cs +++ b/NPCs/AcidRain/CragmawMire.cs @@ -58,7 +58,7 @@ namespace CalamityMod.NPCs.AcidRain NPC.width = 68; NPC.height = 54; - NPC.aiStyle = aiType = -1; + NPC.aiStyle = AIType = -1; NPC.damage = 66; NPC.lifeMax = 4000; diff --git a/NPCs/AcidRain/FlakBaby.cs b/NPCs/AcidRain/FlakBaby.cs index fdb9db98ab..0b3d21abf1 100644 --- a/NPCs/AcidRain/FlakBaby.cs +++ b/NPCs/AcidRain/FlakBaby.cs @@ -34,8 +34,8 @@ namespace CalamityMod.NPCs.AcidRain NPC.noTileCollide = false; NPC.HitSound = SoundID.NPCHit41; NPC.DeathSound = SoundID.DD2_WitherBeastDeath; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.dontTakeDamageFromHostiles = true; NPC.catchItem = (short)ModContent.ItemType(); } diff --git a/NPCs/AcidRain/FlakCrab.cs b/NPCs/AcidRain/FlakCrab.cs index badde93094..cf1554ea18 100644 --- a/NPCs/AcidRain/FlakCrab.cs +++ b/NPCs/AcidRain/FlakCrab.cs @@ -37,7 +37,7 @@ namespace CalamityMod.NPCs.AcidRain NPC.damage = 10; NPC.lifeMax = 300; - NPC.aiStyle = aiType = -1; + NPC.aiStyle = AIType = -1; if (CalamityWorld.downedPolterghast) { @@ -52,8 +52,8 @@ namespace CalamityMod.NPCs.AcidRain NPC.noTileCollide = false; NPC.HitSound = SoundID.NPCHit41; NPC.DeathSound = SoundID.DD2_WitherBeastDeath; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/AcidRain/GammaSlime.cs b/NPCs/AcidRain/GammaSlime.cs index a1debf1d96..8fec78a15b 100644 --- a/NPCs/AcidRain/GammaSlime.cs +++ b/NPCs/AcidRain/GammaSlime.cs @@ -40,7 +40,7 @@ namespace CalamityMod.NPCs.AcidRain NPC.DR_NERD(0.15f); NPC.defense = 25; - NPC.aiStyle = aiType = -1; + NPC.aiStyle = AIType = -1; NPC.knockBackResist = 0f; animationType = NPCID.CorruptSlime; @@ -51,8 +51,8 @@ namespace CalamityMod.NPCs.AcidRain NPC.noTileCollide = false; NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/AcidRain/IrradiatedSlime.cs b/NPCs/AcidRain/IrradiatedSlime.cs index 4e09504689..4298520aaa 100644 --- a/NPCs/AcidRain/IrradiatedSlime.cs +++ b/NPCs/AcidRain/IrradiatedSlime.cs @@ -31,7 +31,7 @@ namespace CalamityMod.NPCs.AcidRain NPC.knockBackResist = 0f; animationType = NPCID.CorruptSlime; - aiType = NPCID.ToxicSludge; + AIType = NPCID.ToxicSludge; NPC.value = Item.buyPrice(0, 0, 5, 0); NPC.alpha = 50; NPC.lavaImmune = false; @@ -39,8 +39,8 @@ namespace CalamityMod.NPCs.AcidRain NPC.noTileCollide = false; NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; @@ -66,7 +66,7 @@ namespace CalamityMod.NPCs.AcidRain { NPC.TargetClosest(false); Player player = Main.player[NPC.target]; - NPC.aiStyle = aiType = -1; + NPC.aiStyle = AIType = -1; NPC.noTileCollide = NPC.noGravity = true; if (player.Top.Y < NPC.Bottom.Y) diff --git a/NPCs/AcidRain/Mauler.cs b/NPCs/AcidRain/Mauler.cs index 3331d85571..d8c7506dc4 100644 --- a/NPCs/AcidRain/Mauler.cs +++ b/NPCs/AcidRain/Mauler.cs @@ -55,14 +55,14 @@ namespace CalamityMod.NPCs.AcidRain NPC.DR_NERD(0.05f); NPC.lifeMax = 88500; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 25, 0, 0); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath60; NPC.knockBackResist = 0f; NPC.rarity = 2; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.RemoveWaterSlowness(); NPC.Calamity().canBreakPlayerDefense = true; NPC.Calamity().VulnerableToHeat = false; diff --git a/NPCs/AcidRain/NuclearTerror.cs b/NPCs/AcidRain/NuclearTerror.cs index d79ceebcdd..983c8bc1ca 100644 --- a/NPCs/AcidRain/NuclearTerror.cs +++ b/NPCs/AcidRain/NuclearTerror.cs @@ -82,7 +82,7 @@ namespace CalamityMod.NPCs.AcidRain NPC.width = 176; NPC.height = 138; - NPC.aiStyle = aiType = -1; + NPC.aiStyle = AIType = -1; NPC.lifeMax = 90000; NPC.defense = 50; diff --git a/NPCs/AcidRain/NuclearToad.cs b/NPCs/AcidRain/NuclearToad.cs index 85da12a02f..cf0688dac8 100644 --- a/NPCs/AcidRain/NuclearToad.cs +++ b/NPCs/AcidRain/NuclearToad.cs @@ -29,7 +29,7 @@ namespace CalamityMod.NPCs.AcidRain NPC.height = 34; NPC.defense = 4; - NPC.aiStyle = aiType = -1; + NPC.aiStyle = AIType = -1; NPC.damage = 15; NPC.lifeMax = 60; @@ -54,8 +54,8 @@ namespace CalamityMod.NPCs.AcidRain NPC.noTileCollide = false; NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/AcidRain/Orthocera.cs b/NPCs/AcidRain/Orthocera.cs index 2ca23fc364..2a0051dc1c 100644 --- a/NPCs/AcidRain/Orthocera.cs +++ b/NPCs/AcidRain/Orthocera.cs @@ -38,7 +38,7 @@ namespace CalamityMod.NPCs.AcidRain { NPC.width = 62; NPC.height = 34; - NPC.aiStyle = aiType = -1; + NPC.aiStyle = AIType = -1; NPC.damage = 45; NPC.lifeMax = 280; @@ -60,8 +60,8 @@ namespace CalamityMod.NPCs.AcidRain NPC.noTileCollide = false; NPC.HitSound = SoundID.NPCHit41; NPC.DeathSound = SoundID.NPCDeath13; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/AcidRain/Radiator.cs b/NPCs/AcidRain/Radiator.cs index bb01a15160..f7867a7a27 100644 --- a/NPCs/AcidRain/Radiator.cs +++ b/NPCs/AcidRain/Radiator.cs @@ -47,9 +47,9 @@ namespace CalamityMod.NPCs.AcidRain NPC.noTileCollide = false; NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - aiType = NPCID.GlowingSnail; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + AIType = NPCID.GlowingSnail; + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.catchItem = (short)ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; diff --git a/NPCs/AcidRain/Skyfin.cs b/NPCs/AcidRain/Skyfin.cs index b24dc1b6ee..5d63fb4fa7 100644 --- a/NPCs/AcidRain/Skyfin.cs +++ b/NPCs/AcidRain/Skyfin.cs @@ -28,7 +28,7 @@ namespace CalamityMod.NPCs.AcidRain { NPC.width = 46; NPC.height = 22; - NPC.aiStyle = aiType = -1; + NPC.aiStyle = AIType = -1; NPC.damage = 12; NPC.lifeMax = 70; @@ -56,8 +56,8 @@ namespace CalamityMod.NPCs.AcidRain NPC.noTileCollide = true; NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/AcidRain/SulfurousSkater.cs b/NPCs/AcidRain/SulfurousSkater.cs index 8c7cb218d3..1c6bda239c 100644 --- a/NPCs/AcidRain/SulfurousSkater.cs +++ b/NPCs/AcidRain/SulfurousSkater.cs @@ -56,10 +56,10 @@ namespace CalamityMod.NPCs.AcidRain NPC.noTileCollide = false; NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); - NPC.aiStyle = aiType = -1; + NPC.aiStyle = AIType = -1; NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/AcidRain/Trilobite.cs b/NPCs/AcidRain/Trilobite.cs index 69e98b4aae..9d55405aec 100644 --- a/NPCs/AcidRain/Trilobite.cs +++ b/NPCs/AcidRain/Trilobite.cs @@ -31,7 +31,7 @@ namespace CalamityMod.NPCs.AcidRain { NPC.width = 36; NPC.height = 38; - NPC.aiStyle = aiType = -1; + NPC.aiStyle = AIType = -1; NPC.damage = 45; NPC.lifeMax = 300; @@ -52,8 +52,8 @@ namespace CalamityMod.NPCs.AcidRain NPC.noTileCollide = false; NPC.HitSound = SoundID.NPCHit42; NPC.DeathSound = SoundID.NPCDeath27; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/AcidRain/WaterLeech.cs b/NPCs/AcidRain/WaterLeech.cs index 44f1077f34..1ac58ffad3 100644 --- a/NPCs/AcidRain/WaterLeech.cs +++ b/NPCs/AcidRain/WaterLeech.cs @@ -51,8 +51,8 @@ namespace CalamityMod.NPCs.AcidRain NPC.noTileCollide = false; NPC.HitSound = SoundID.NPCHit33; NPC.DeathSound = SoundID.NPCDeath1; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/AquaticScourge/AquaticParasite.cs b/NPCs/AquaticScourge/AquaticParasite.cs index 60b912468e..446e56f106 100644 --- a/NPCs/AquaticScourge/AquaticParasite.cs +++ b/NPCs/AquaticScourge/AquaticParasite.cs @@ -24,12 +24,12 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.defense = 5; NPC.LifeMaxNERB(Main.hardMode ? 200 : 30); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 0, 0, 60); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/AquaticScourge/AquaticSeekerBody.cs b/NPCs/AquaticScourge/AquaticSeekerBody.cs index d0413eaa8d..d7cae370d5 100644 --- a/NPCs/AquaticScourge/AquaticSeekerBody.cs +++ b/NPCs/AquaticScourge/AquaticSeekerBody.cs @@ -21,7 +21,7 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.defense = 10; NPC.lifeMax = 60; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.behindTiles = true; @@ -31,8 +31,8 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.DeathSound = SoundID.NPCDeath1; NPC.netAlways = true; NPC.dontCountMe = true; - banner = ModContent.NPCType(); - bannerItem = ModContent.ItemType(); + Banner = ModContent.NPCType(); + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/AquaticScourge/AquaticSeekerHead.cs b/NPCs/AquaticScourge/AquaticSeekerHead.cs index 1d8dca2da2..935e077bed 100644 --- a/NPCs/AquaticScourge/AquaticSeekerHead.cs +++ b/NPCs/AquaticScourge/AquaticSeekerHead.cs @@ -29,7 +29,7 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.defense = 5; NPC.lifeMax = 60; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.value = Item.buyPrice(0, 0, 0, 80); NPC.behindTiles = true; @@ -38,8 +38,8 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; NPC.netAlways = true; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/AquaticScourge/AquaticSeekerTail.cs b/NPCs/AquaticScourge/AquaticSeekerTail.cs index 08dbe6db0d..e2596d785a 100644 --- a/NPCs/AquaticScourge/AquaticSeekerTail.cs +++ b/NPCs/AquaticScourge/AquaticSeekerTail.cs @@ -21,7 +21,7 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.defense = 20; NPC.lifeMax = 60; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.behindTiles = true; @@ -31,8 +31,8 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.DeathSound = SoundID.NPCDeath1; NPC.netAlways = true; NPC.dontCountMe = true; - banner = ModContent.NPCType(); - bannerItem = ModContent.ItemType(); + Banner = ModContent.NPCType(); + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/AquaticScourge/AquaticUrchin.cs b/NPCs/AquaticScourge/AquaticUrchin.cs index 368e8bbd84..b96105550f 100644 --- a/NPCs/AquaticScourge/AquaticUrchin.cs +++ b/NPCs/AquaticScourge/AquaticUrchin.cs @@ -17,7 +17,7 @@ namespace CalamityMod.NPCs.AquaticScourge public override void SetDefaults() { NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.damage = Main.hardMode ? 50 : 25; NPC.width = 40; NPC.height = 40; @@ -28,8 +28,8 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath15; NPC.behindTiles = true; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/Astral/Aries.cs b/NPCs/Astral/Aries.cs index e1354f3d8e..0615abfa34 100644 --- a/NPCs/Astral/Aries.cs +++ b/NPCs/Astral/Aries.cs @@ -36,8 +36,8 @@ namespace CalamityMod.NPCs.Astral NPC.knockBackResist = 0.6f; NPC.value = Item.buyPrice(0, 0, 10, 0); NPC.DeathSound = Mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath"); - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); if (CalamityWorld.downedAstrageldon) { NPC.damage = 85; diff --git a/NPCs/Astral/AstralProbe.cs b/NPCs/Astral/AstralProbe.cs index d16b210ad7..2661c55b48 100644 --- a/NPCs/Astral/AstralProbe.cs +++ b/NPCs/Astral/AstralProbe.cs @@ -29,14 +29,14 @@ namespace CalamityMod.NPCs.Astral NPC.DR_NERD(0.15f); NPC.lifeMax = 50; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0.95f; NPC.value = Item.buyPrice(0, 0, 5, 0); NPC.noGravity = true; NPC.noTileCollide = true; NPC.DeathSound = SoundID.NPCDeath14; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); if (CalamityWorld.downedAstrageldon) { NPC.damage = 30; diff --git a/NPCs/Astral/AstralSlime.cs b/NPCs/Astral/AstralSlime.cs index 74ce77f897..4a6634c65f 100644 --- a/NPCs/Astral/AstralSlime.cs +++ b/NPCs/Astral/AstralSlime.cs @@ -34,8 +34,8 @@ namespace CalamityMod.NPCs.Astral NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; animationType = NPCID.BlueSlime; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); if (CalamityWorld.downedAstrageldon) { NPC.damage = 65; diff --git a/NPCs/Astral/AstralachneaGround.cs b/NPCs/Astral/AstralachneaGround.cs index 242ad887bd..4aff0b981c 100644 --- a/NPCs/Astral/AstralachneaGround.cs +++ b/NPCs/Astral/AstralachneaGround.cs @@ -44,8 +44,8 @@ namespace CalamityMod.NPCs.Astral NPC.value = Item.buyPrice(0, 0, 20, 0); NPC.timeLeft = NPC.activeTime * 2; animationType = NPCID.WallCreeper; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); if (CalamityWorld.downedAstrageldon) { NPC.damage = 90; diff --git a/NPCs/Astral/AstralachneaWall.cs b/NPCs/Astral/AstralachneaWall.cs index c00b66f536..c472d76150 100644 --- a/NPCs/Astral/AstralachneaWall.cs +++ b/NPCs/Astral/AstralachneaWall.cs @@ -45,8 +45,8 @@ namespace CalamityMod.NPCs.Astral NPC.value = Item.buyPrice(0, 0, 20, 0); NPC.timeLeft = NPC.activeTime * 2; animationType = NPCID.BlackRecluseWall; - banner = ModContent.NPCType(); - bannerItem = ModContent.ItemType(); + Banner = ModContent.NPCType(); + BannerItem = ModContent.ItemType(); if (CalamityWorld.downedAstrageldon) { NPC.damage = 90; diff --git a/NPCs/Astral/Atlas.cs b/NPCs/Astral/Atlas.cs index 0a06bdf76a..add61233c0 100644 --- a/NPCs/Astral/Atlas.cs +++ b/NPCs/Astral/Atlas.cs @@ -114,8 +114,8 @@ namespace CalamityMod.NPCs.Astral NPC.value = Item.buyPrice(0, 1, 0, 0); NPC.aiStyle = -1; NPC.DeathSound = Mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AtlasDeath"); - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); if (CalamityWorld.downedAstrageldon) { NPC.damage = 100; diff --git a/NPCs/Astral/EnchantedNightcrawler.cs b/NPCs/Astral/EnchantedNightcrawler.cs index ad6847ab54..cd8651bf3f 100644 --- a/NPCs/Astral/EnchantedNightcrawler.cs +++ b/NPCs/Astral/EnchantedNightcrawler.cs @@ -16,7 +16,7 @@ namespace CalamityMod.NPCs.Astral public override void SetDefaults() { NPC.CloneDefaults(NPCID.EnchantedNightcrawler); //ID is 484 - aiType = NPCID.EnchantedNightcrawler; + AIType = NPCID.EnchantedNightcrawler; animationType = NPCID.EnchantedNightcrawler; } diff --git a/NPCs/Astral/FusionFeeder.cs b/NPCs/Astral/FusionFeeder.cs index d70dd38616..b2358d0681 100644 --- a/NPCs/Astral/FusionFeeder.cs +++ b/NPCs/Astral/FusionFeeder.cs @@ -40,8 +40,8 @@ namespace CalamityMod.NPCs.Astral NPC.behindTiles = true; NPC.DeathSound = Mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath"); animationType = NPCID.SandShark; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); if (CalamityWorld.downedAstrageldon) { NPC.damage = 65; diff --git a/NPCs/Astral/Hadarian.cs b/NPCs/Astral/Hadarian.cs index f2a97659ad..b819596ec9 100644 --- a/NPCs/Astral/Hadarian.cs +++ b/NPCs/Astral/Hadarian.cs @@ -38,8 +38,8 @@ namespace CalamityMod.NPCs.Astral NPC.DeathSound = Mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath"); NPC.knockBackResist = 0.75f; NPC.value = Item.buyPrice(0, 0, 15, 0); - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); if (CalamityWorld.downedAstrageldon) { NPC.damage = 80; diff --git a/NPCs/Astral/Mantis.cs b/NPCs/Astral/Mantis.cs index 5ceae2de94..7e8f1493d7 100644 --- a/NPCs/Astral/Mantis.cs +++ b/NPCs/Astral/Mantis.cs @@ -40,8 +40,8 @@ namespace CalamityMod.NPCs.Astral NPC.knockBackResist = 0.2f; NPC.value = Item.buyPrice(0, 0, 15, 0); NPC.DeathSound = Mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath"); - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); if (CalamityWorld.downedAstrageldon) { NPC.damage = 85; diff --git a/NPCs/Astral/Nova.cs b/NPCs/Astral/Nova.cs index 44fd2fd1d9..fda5b019fd 100644 --- a/NPCs/Astral/Nova.cs +++ b/NPCs/Astral/Nova.cs @@ -48,8 +48,8 @@ namespace CalamityMod.NPCs.Astral NPC.knockBackResist = 0.5f; NPC.value = Item.buyPrice(0, 0, 20, 0); NPC.aiStyle = -1; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); if (CalamityWorld.downedAstrageldon) { NPC.damage = 75; diff --git a/NPCs/Astral/SmallSightseer.cs b/NPCs/Astral/SmallSightseer.cs index 4521327793..03c134b7f1 100644 --- a/NPCs/Astral/SmallSightseer.cs +++ b/NPCs/Astral/SmallSightseer.cs @@ -38,8 +38,8 @@ namespace CalamityMod.NPCs.Astral NPC.knockBackResist = 0.58f; NPC.value = Item.buyPrice(0, 0, 10, 0); NPC.aiStyle = -1; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); if (CalamityWorld.downedAstrageldon) { NPC.damage = 58; diff --git a/NPCs/Astral/StellarCulex.cs b/NPCs/Astral/StellarCulex.cs index d83f43e2f3..57b937853c 100644 --- a/NPCs/Astral/StellarCulex.cs +++ b/NPCs/Astral/StellarCulex.cs @@ -40,8 +40,8 @@ namespace CalamityMod.NPCs.Astral NPC.value = Item.buyPrice(0, 0, 10, 0); NPC.DeathSound = Mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath"); animationType = NPCID.GiantFlyingFox; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); if (CalamityWorld.downedAstrageldon) { NPC.damage = 90; diff --git a/NPCs/Astral/Twinkler.cs b/NPCs/Astral/Twinkler.cs index 87ba309888..e94909daaa 100644 --- a/NPCs/Astral/Twinkler.cs +++ b/NPCs/Astral/Twinkler.cs @@ -20,12 +20,12 @@ namespace CalamityMod.NPCs.Astral NPC.CloneDefaults(NPCID.LightningBug); //ID is 358 NPC.width = 7; NPC.height = 5; - aiType = NPCID.LightningBug; + AIType = NPCID.LightningBug; animationType = NPCID.LightningBug; NPC.catchItem = (short)ModContent.ItemType(); NPC.friendly = true; // prevents critter from getting slagged - //banner = npc.type; - //bannerItem = ModContent.ItemType(); + //Banner = npc.type; + //BannerItem = ModContent.ItemType(); } public override bool? CanBeHitByItem(Player player, Item item) => true; diff --git a/NPCs/AstrumAureus/AstrumAureus.cs b/NPCs/AstrumAureus/AstrumAureus.cs index cfb787aead..80d2c690dd 100644 --- a/NPCs/AstrumAureus/AstrumAureus.cs +++ b/NPCs/AstrumAureus/AstrumAureus.cs @@ -51,7 +51,7 @@ namespace CalamityMod.NPCs.AstrumAureus NPC.DR_NERD(0.5f); NPC.LifeMaxNERB(NPC.downedMoonlord ? 196000 : 98000, NPC.downedMoonlord ? 235200 : 117600, 740000); // 30 seconds in boss rush NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.value = Item.buyPrice(0, 60, 0, 0); NPC.boss = true; diff --git a/NPCs/AstrumAureus/AureusSpawn.cs b/NPCs/AstrumAureus/AureusSpawn.cs index 8c51528e26..91856f0b84 100644 --- a/NPCs/AstrumAureus/AureusSpawn.cs +++ b/NPCs/AstrumAureus/AureusSpawn.cs @@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.AstrumAureus { NPC.Calamity().canBreakPlayerDefense = true; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.GetNPCDamage(); NPC.width = 90; NPC.height = 60; diff --git a/NPCs/AstrumDeus/AstrumDeusBodySpectral.cs b/NPCs/AstrumDeus/AstrumDeusBodySpectral.cs index 8edceb3970..1168d98ff5 100644 --- a/NPCs/AstrumDeus/AstrumDeusBodySpectral.cs +++ b/NPCs/AstrumDeus/AstrumDeusBodySpectral.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Events; using CalamityMod.World; @@ -31,7 +31,7 @@ namespace CalamityMod.NPCs.AstrumDeus double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; if (CalamityWorld.malice || BossRushEvent.BossRushActive) diff --git a/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs b/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs index 479a920018..e5b7fe5dc6 100644 --- a/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs +++ b/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Events; using CalamityMod.Items.Accessories; @@ -45,7 +45,7 @@ namespace CalamityMod.NPCs.AstrumDeus double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; if (CalamityWorld.malice || BossRushEvent.BossRushActive) diff --git a/NPCs/AstrumDeus/AstrumDeusTailSpectral.cs b/NPCs/AstrumDeus/AstrumDeusTailSpectral.cs index 2aac9bf446..66b3bcfec8 100644 --- a/NPCs/AstrumDeus/AstrumDeusTailSpectral.cs +++ b/NPCs/AstrumDeus/AstrumDeusTailSpectral.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Events; using CalamityMod.World; @@ -31,7 +31,7 @@ namespace CalamityMod.NPCs.AstrumDeus double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; if (CalamityWorld.malice || BossRushEvent.BossRushActive) diff --git a/NPCs/BrimstoneElemental/Brimling.cs b/NPCs/BrimstoneElemental/Brimling.cs index 890743f768..10bad1ac6f 100644 --- a/NPCs/BrimstoneElemental/Brimling.cs +++ b/NPCs/BrimstoneElemental/Brimling.cs @@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental public override void SetDefaults() { NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.damage = 0; NPC.width = 60; NPC.height = 60; diff --git a/NPCs/BrimstoneElemental/BrimstoneElemental.cs b/NPCs/BrimstoneElemental/BrimstoneElemental.cs index f6ad328582..59616264f1 100644 --- a/NPCs/BrimstoneElemental/BrimstoneElemental.cs +++ b/NPCs/BrimstoneElemental/BrimstoneElemental.cs @@ -51,7 +51,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.knockBackResist = 0f; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.boss = true; NPC.noGravity = true; NPC.noTileCollide = true; diff --git a/NPCs/Bumblebirb/Bumblefuck.cs b/NPCs/Bumblebirb/Bumblefuck.cs index 3b3a951203..879ade2813 100644 --- a/NPCs/Bumblebirb/Bumblefuck.cs +++ b/NPCs/Bumblebirb/Bumblefuck.cs @@ -39,7 +39,7 @@ namespace CalamityMod.NPCs.Bumblebirb NPC.Calamity().canBreakPlayerDefense = true; NPC.npcSlots = 32f; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.GetNPCDamage(); NPC.width = 130; NPC.height = 100; diff --git a/NPCs/Bumblebirb/Bumblefuck2.cs b/NPCs/Bumblebirb/Bumblefuck2.cs index cba6f8e653..fc414b0cf5 100644 --- a/NPCs/Bumblebirb/Bumblefuck2.cs +++ b/NPCs/Bumblebirb/Bumblefuck2.cs @@ -22,7 +22,7 @@ namespace CalamityMod.NPCs.Bumblebirb { NPC.npcSlots = 1f; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.GetNPCDamage(); NPC.width = 120; NPC.height = 80; diff --git a/NPCs/Calamitas/CalamitasRun.cs b/NPCs/Calamitas/CalamitasRun.cs index 32c8a739d9..dccc8dab0c 100644 --- a/NPCs/Calamitas/CalamitasRun.cs +++ b/NPCs/Calamitas/CalamitasRun.cs @@ -46,7 +46,7 @@ namespace CalamityMod.NPCs.Calamitas double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.noGravity = true; NPC.noTileCollide = true; diff --git a/NPCs/Calamitas/CalamitasRun2.cs b/NPCs/Calamitas/CalamitasRun2.cs index f368af6ef0..9e792746d0 100644 --- a/NPCs/Calamitas/CalamitasRun2.cs +++ b/NPCs/Calamitas/CalamitasRun2.cs @@ -46,7 +46,7 @@ namespace CalamityMod.NPCs.Calamitas double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.noGravity = true; NPC.noTileCollide = true; diff --git a/NPCs/Calamitas/CalamitasRun3.cs b/NPCs/Calamitas/CalamitasRun3.cs index ec3cbede44..0c83d9dbfd 100644 --- a/NPCs/Calamitas/CalamitasRun3.cs +++ b/NPCs/Calamitas/CalamitasRun3.cs @@ -58,7 +58,7 @@ namespace CalamityMod.NPCs.Calamitas double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.boss = true; NPC.noGravity = true; diff --git a/NPCs/Calamitas/SoulSeeker.cs b/NPCs/Calamitas/SoulSeeker.cs index 38a0ca34f6..7e6f354ce9 100644 --- a/NPCs/Calamitas/SoulSeeker.cs +++ b/NPCs/Calamitas/SoulSeeker.cs @@ -26,7 +26,7 @@ namespace CalamityMod.NPCs.Calamitas public override void SetDefaults() { NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.width = 40; NPC.height = 40; NPC.noGravity = true; diff --git a/NPCs/CeaselessVoid/CeaselessVoid.cs b/NPCs/CeaselessVoid/CeaselessVoid.cs index 06b4e34bfb..027c1cd270 100644 --- a/NPCs/CeaselessVoid/CeaselessVoid.cs +++ b/NPCs/CeaselessVoid/CeaselessVoid.cs @@ -56,7 +56,7 @@ namespace CalamityMod.NPCs.CeaselessVoid double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.noGravity = true; NPC.noTileCollide = true; diff --git a/NPCs/CeaselessVoid/DarkEnergy.cs b/NPCs/CeaselessVoid/DarkEnergy.cs index 4078c6248a..0cb8526b67 100644 --- a/NPCs/CeaselessVoid/DarkEnergy.cs +++ b/NPCs/CeaselessVoid/DarkEnergy.cs @@ -30,7 +30,7 @@ namespace CalamityMod.NPCs.CeaselessVoid { NPC.Calamity().canBreakPlayerDefense = true; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.GetNPCDamage(); NPC.dontTakeDamage = true; NPC.width = 80; diff --git a/NPCs/Crabulon/CrabShroom.cs b/NPCs/Crabulon/CrabShroom.cs index 8c5c1f39a5..ce41d05317 100644 --- a/NPCs/Crabulon/CrabShroom.cs +++ b/NPCs/Crabulon/CrabShroom.cs @@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.Crabulon { NPC.lifeMax = 15000; } - aiType = -1; + AIType = -1; NPC.knockBackResist = 0.75f; NPC.noGravity = true; NPC.noTileCollide = true; diff --git a/NPCs/Crabulon/CrabulonIdle.cs b/NPCs/Crabulon/CrabulonIdle.cs index 9e0ea68b32..cfd5ca0c50 100644 --- a/NPCs/Crabulon/CrabulonIdle.cs +++ b/NPCs/Crabulon/CrabulonIdle.cs @@ -212,7 +212,7 @@ namespace CalamityMod.NPCs.Crabulon num350 *= num351; vector34.X += num349; vector34.Y += num350; - Projectile.NewProjectile(vector34.X, vector34.Y, num349, num350 - 5f, type, NPC.GetProjectileDamage(type), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector34.X, vector34.Y, num349, num350 - 5f, type, NPC.GetProjectileDamage(type), 0f, Main.myPlayer, 0f, 0f); } } } @@ -459,7 +459,7 @@ namespace CalamityMod.NPCs.Crabulon for (int x = 0; x < totalMushrooms; x++) { - Projectile.NewProjectile(NPC.Center.X + shotSpacing, NPC.Center.Y - 1000f, velocityX, 0f, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center.X + shotSpacing, NPC.Center.Y - 1000f, velocityX, 0f, type, damage, 0f, Main.myPlayer, 0f, 0f); shotSpacing -= shotSpacingDecrement; } @@ -475,7 +475,7 @@ namespace CalamityMod.NPCs.Crabulon { for (int x = 0; x < 20; x++) { - Projectile.NewProjectile(NPC.Center.X + shotSpacing, NPC.Center.Y - 1000f, 0f, 0f, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center.X + shotSpacing, NPC.Center.Y - 1000f, 0f, 0f, type, damage, 0f, Main.myPlayer, 0f, 0f); shotSpacing -= 100; } shotSpacing = 1000; diff --git a/NPCs/Crags/CalamityEye.cs b/NPCs/Crags/CalamityEye.cs index 0449d2b2c9..ccbe7877fd 100644 --- a/NPCs/Crags/CalamityEye.cs +++ b/NPCs/Crags/CalamityEye.cs @@ -36,8 +36,8 @@ namespace CalamityMod.NPCs.Crags NPC.defense = 20; NPC.lifeMax = 3000; } - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToWater = true; diff --git a/NPCs/Crags/CharredSlime.cs b/NPCs/Crags/CharredSlime.cs index a7a19fbdb3..ebfc93d424 100644 --- a/NPCs/Crags/CharredSlime.cs +++ b/NPCs/Crags/CharredSlime.cs @@ -20,7 +20,7 @@ namespace CalamityMod.NPCs.Crags public override void SetDefaults() { NPC.aiStyle = 1; - aiType = NPCID.LavaSlime; + AIType = NPCID.LavaSlime; NPC.damage = 40; NPC.width = 40; NPC.height = 30; @@ -41,8 +41,8 @@ namespace CalamityMod.NPCs.Crags NPC.defense = 20; NPC.lifeMax = 3500; } - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToWater = true; diff --git a/NPCs/Crags/CultistAssassin.cs b/NPCs/Crags/CultistAssassin.cs index 6f0f76137d..ebb31cc954 100644 --- a/NPCs/Crags/CultistAssassin.cs +++ b/NPCs/Crags/CultistAssassin.cs @@ -26,7 +26,7 @@ namespace CalamityMod.NPCs.Crags NPC.lifeMax = 80; NPC.knockBackResist = 0.5f; animationType = NPCID.ZombieXmas; - aiType = NPCID.ChaosElemental; + AIType = NPCID.ChaosElemental; NPC.value = Item.buyPrice(0, 0, 10, 0); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath50; @@ -36,8 +36,8 @@ namespace CalamityMod.NPCs.Crags NPC.defense = 30; NPC.lifeMax = 3000; } - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; diff --git a/NPCs/Crags/DespairStone.cs b/NPCs/Crags/DespairStone.cs index fb8f0df5c1..1c75cb3e31 100644 --- a/NPCs/Crags/DespairStone.cs +++ b/NPCs/Crags/DespairStone.cs @@ -18,7 +18,7 @@ namespace CalamityMod.NPCs.Crags public override void SetDefaults() { NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.damage = 40; NPC.width = 72; NPC.height = 72; @@ -37,8 +37,8 @@ namespace CalamityMod.NPCs.Crags NPC.defense = 50; NPC.lifeMax = 3000; } - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToWater = true; diff --git a/NPCs/Crags/HeatSpirit.cs b/NPCs/Crags/HeatSpirit.cs index 23f7e84b8e..bb3d62d731 100644 --- a/NPCs/Crags/HeatSpirit.cs +++ b/NPCs/Crags/HeatSpirit.cs @@ -28,8 +28,8 @@ namespace CalamityMod.NPCs.Crags NPC.value = Item.buyPrice(0, 0, 1, 0); NPC.HitSound = SoundID.NPCHit52; NPC.DeathSound = SoundID.NPCDeath55; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToWater = true; diff --git a/NPCs/Crags/Scryllar.cs b/NPCs/Crags/Scryllar.cs index 1b6a97c200..8f6f75a9bb 100644 --- a/NPCs/Crags/Scryllar.cs +++ b/NPCs/Crags/Scryllar.cs @@ -20,7 +20,7 @@ namespace CalamityMod.NPCs.Crags public override void SetDefaults() { NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.damage = 50; NPC.width = 80; NPC.height = 80; @@ -40,8 +40,8 @@ namespace CalamityMod.NPCs.Crags NPC.defense = 30; NPC.lifeMax = 2500; } - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToWater = true; diff --git a/NPCs/Crags/ScryllarRage.cs b/NPCs/Crags/ScryllarRage.cs index 3048b74110..77ce82a0b9 100644 --- a/NPCs/Crags/ScryllarRage.cs +++ b/NPCs/Crags/ScryllarRage.cs @@ -20,7 +20,7 @@ namespace CalamityMod.NPCs.Crags public override void SetDefaults() { NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.damage = 65; NPC.width = 80; NPC.height = 80; @@ -40,8 +40,8 @@ namespace CalamityMod.NPCs.Crags NPC.defense = 20; NPC.lifeMax = 1500; } - banner = ModContent.NPCType(); - bannerItem = ModContent.ItemType(); + Banner = ModContent.NPCType(); + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToWater = true; diff --git a/NPCs/Crags/SoulSlurper.cs b/NPCs/Crags/SoulSlurper.cs index 02749103ff..564d4d7e8b 100644 --- a/NPCs/Crags/SoulSlurper.cs +++ b/NPCs/Crags/SoulSlurper.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; @@ -24,7 +24,7 @@ namespace CalamityMod.NPCs.Crags public override void SetDefaults() { NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.npcSlots = 1f; NPC.damage = 30; NPC.width = 60; @@ -44,8 +44,8 @@ namespace CalamityMod.NPCs.Crags NPC.defense = 45; NPC.lifeMax = 2000; } - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToWater = true; @@ -154,7 +154,7 @@ namespace CalamityMod.NPCs.Crags dmg = 22; } int projType = ModContent.ProjectileType(); - Projectile.NewProjectile(source.X, source.Y, num4, num5, projType, dmg + (provy ? 30 : 0), 0f, Main.myPlayer, 1f, 0f); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), source.X, source.Y, num4, num5, projType, dmg + (provy ? 30 : 0), 0f, Main.myPlayer, 1f, 0f); } } int num10 = (int)NPC.Center.X; diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index 063e426330..8b3f763a76 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -230,7 +230,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, NPC.ai[0] * 0.5f); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, NPC.ai[0] * 0.5f); } } } @@ -258,7 +258,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.Center, vector255, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer); } } } @@ -313,7 +313,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.Center, vector255, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer); } } } @@ -406,7 +406,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, velocity); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, velocity); } } } @@ -470,7 +470,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.Center, vector255, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer); } } } @@ -530,7 +530,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, velocity); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, velocity); } } } @@ -594,7 +594,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.Center, vector255, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer); } } } @@ -706,7 +706,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, velocity); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, velocity); } } } @@ -788,7 +788,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, velocity); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, velocity); } } } @@ -882,7 +882,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, 1f); } } diff --git a/NPCs/Cryogen/CryogenIce.cs b/NPCs/Cryogen/CryogenIce.cs index 529347dbb3..8e003965c5 100644 --- a/NPCs/Cryogen/CryogenIce.cs +++ b/NPCs/Cryogen/CryogenIce.cs @@ -1,4 +1,4 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -20,7 +20,7 @@ namespace CalamityMod.NPCs.Cryogen { NPC.Calamity().canBreakPlayerDefense = true; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.canGhostHeal = false; NPC.noTileCollide = true; NPC.GetNPCDamage(); @@ -142,7 +142,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - int proj = Projectile.NewProjectile(NPC.Center, vector255, type, damage2, 0f, Main.myPlayer); + int proj = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, vector255, type, damage2, 0f, Main.myPlayer); Main.projectile[proj].timeLeft = 300; } } diff --git a/NPCs/DesertScourge/DesertNuisanceBody.cs b/NPCs/DesertScourge/DesertNuisanceBody.cs index 0a14955344..50b616d140 100644 --- a/NPCs/DesertScourge/DesertNuisanceBody.cs +++ b/NPCs/DesertScourge/DesertNuisanceBody.cs @@ -18,7 +18,7 @@ namespace CalamityMod.NPCs.DesertScourge NPC.defense = 4; NPC.lifeMax = BossRushEvent.BossRushActive ? 35000 : 800; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.behindTiles = true; diff --git a/NPCs/DesertScourge/DesertNuisanceTail.cs b/NPCs/DesertScourge/DesertNuisanceTail.cs index 7dfb0792cc..b4b305a267 100644 --- a/NPCs/DesertScourge/DesertNuisanceTail.cs +++ b/NPCs/DesertScourge/DesertNuisanceTail.cs @@ -18,7 +18,7 @@ namespace CalamityMod.NPCs.DesertScourge NPC.defense = 7; NPC.lifeMax = BossRushEvent.BossRushActive ? 35000 : 800; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.behindTiles = true; diff --git a/NPCs/DesertScourge/DesertScourgeBody.cs b/NPCs/DesertScourge/DesertScourgeBody.cs index dfd8d68e3c..0049044493 100644 --- a/NPCs/DesertScourge/DesertScourgeBody.cs +++ b/NPCs/DesertScourge/DesertScourgeBody.cs @@ -1,4 +1,4 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -27,11 +27,11 @@ namespace CalamityMod.NPCs.DesertScourge double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.boss = true; - music = CalamityMod.Instance.GetMusicFromMusicMod("DesertScourge") ?? MusicID.Boss1; + Music = CalamityMod.Instance.GetMusicFromMusicMod("DesertScourge") ?? MusicID.Boss1; NPC.behindTiles = true; NPC.noGravity = true; NPC.noTileCollide = true; @@ -130,7 +130,7 @@ namespace CalamityMod.NPCs.DesertScourge vector104.Y += num943 * 5f; if (Main.rand.NextBool(2) || malice) { - Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, projectileType, NPC.GetProjectileDamage(projectileType), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector104.X, vector104.Y, num942, num943, projectileType, NPC.GetProjectileDamage(projectileType), 0f, Main.myPlayer, 0f, 0f); } NPC.netUpdate = true; } diff --git a/NPCs/DesertScourge/DesertScourgeTail.cs b/NPCs/DesertScourge/DesertScourgeTail.cs index e7b259eaee..318895a8c5 100644 --- a/NPCs/DesertScourge/DesertScourgeTail.cs +++ b/NPCs/DesertScourge/DesertScourgeTail.cs @@ -25,7 +25,7 @@ namespace CalamityMod.NPCs.DesertScourge double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.boss = true; diff --git a/NPCs/DevourerofGods/DevourerofGodsBody.cs b/NPCs/DevourerofGods/DevourerofGodsBody.cs index 878ac87774..c27a58a044 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody.cs @@ -50,7 +50,7 @@ namespace CalamityMod.NPCs.DevourerofGods double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.Opacity = 0f; NPC.behindTiles = true; diff --git a/NPCs/DevourerofGods/DevourerofGodsBody2.cs b/NPCs/DevourerofGods/DevourerofGodsBody2.cs index f3773b92fa..41a0dfc30d 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody2.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody2.cs @@ -28,7 +28,7 @@ namespace CalamityMod.NPCs.DevourerofGods global.unbreakableDR = true; NPC.lifeMax = 50000; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.behindTiles = true; diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index 28bf4c180c..067eff51b2 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -508,7 +508,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (Main.netMode != NetmodeID.MultiplayerClient && !hasCreatedPhase1Portal) { Vector2 portalSpawnPosition = NPC.Center + NPC.velocity.SafeNormalize(-Vector2.UnitY) * 1000f; - PortalIndex = Projectile.NewProjectile(portalSpawnPosition, Vector2.Zero, ModContent.ProjectileType(), 0, 0f); + PortalIndex = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), portalSpawnPosition, Vector2.Zero, ModContent.ProjectileType(), 0, 0f); hasCreatedPhase1Portal = true; NPC.netUpdate = true; @@ -674,7 +674,7 @@ namespace CalamityMod.NPCs.DevourerofGods int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(vector44.X, vector44.Y, num427, num428, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), vector44.X, vector44.Y, num427, num428, type, damage, 0f, Main.myPlayer); } } else if (distanceFromTarget < 250f) @@ -705,15 +705,15 @@ namespace CalamityMod.NPCs.DevourerofGods for (int x = 0; x < totalShots_Phase2; x++) { - Projectile.NewProjectile(player.position.X + spawnOffset, targetPosY + shotSpacing_Phase2[0], -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); - Projectile.NewProjectile(player.position.X - spawnOffset, targetPosY + shotSpacing_Phase2[0], laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + spawnOffset, targetPosY + shotSpacing_Phase2[0], -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X - spawnOffset, targetPosY + shotSpacing_Phase2[0], laserVelocity, 0f, type, damage, 0f, Main.myPlayer); shotSpacing_Phase2[0] -= spacingVar_Phase2; } if (expertMode) { - Projectile.NewProjectile(player.position.X + spawnOffset, player.Center.Y, -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); - Projectile.NewProjectile(player.position.X - spawnOffset, player.Center.Y, laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + spawnOffset, player.Center.Y, -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X - spawnOffset, player.Center.Y, laserVelocity, 0f, type, damage, 0f, Main.myPlayer); } break; @@ -723,15 +723,15 @@ namespace CalamityMod.NPCs.DevourerofGods targetPosY += 50f; for (int x = 0; x < totalShots_Phase2; x++) { - Projectile.NewProjectile(player.position.X + spawnOffset, targetPosY + shotSpacing_Phase2[0], -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); - Projectile.NewProjectile(player.position.X - spawnOffset, targetPosY + shotSpacing_Phase2[0], laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + spawnOffset, targetPosY + shotSpacing_Phase2[0], -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X - spawnOffset, targetPosY + shotSpacing_Phase2[0], laserVelocity, 0f, type, damage, 0f, Main.myPlayer); shotSpacing_Phase2[0] -= spacingVar_Phase2; } if (expertMode) { - Projectile.NewProjectile(player.position.X + spawnOffset, player.Center.Y, -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); - Projectile.NewProjectile(player.position.X - spawnOffset, player.Center.Y, laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + spawnOffset, player.Center.Y, -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X - spawnOffset, player.Center.Y, laserVelocity, 0f, type, damage, 0f, Main.myPlayer); } break; @@ -743,17 +743,17 @@ namespace CalamityMod.NPCs.DevourerofGods start = new Vector2(player.position.X + spawnOffset, targetPosY + shotSpacing_Phase2[0]); aim.Y += laserWallSpacingOffset * (x - halfTotalDiagonalShots); velocity = Vector2.Normalize(aim - start) * laserVelocity; - Projectile.NewProjectile(start, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), start, velocity, type, damage, 0f, Main.myPlayer); start = new Vector2(player.position.X - spawnOffset, targetPosY + shotSpacing_Phase2[0]); velocity = Vector2.Normalize(aim - start) * laserVelocity; - Projectile.NewProjectile(start, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), start, velocity, type, damage, 0f, Main.myPlayer); shotSpacing_Phase2[0] -= diagonalSpacingVar; } - Projectile.NewProjectile(player.Center.X, targetPosY + spawnOffset, 0f, -laserVelocity, type, damage, 0f, Main.myPlayer); - Projectile.NewProjectile(player.Center.X, targetPosY - spawnOffset, 0f, laserVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.Center.X, targetPosY + spawnOffset, 0f, -laserVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.Center.X, targetPosY - spawnOffset, 0f, laserVelocity, type, damage, 0f, Main.myPlayer); break; @@ -761,21 +761,21 @@ namespace CalamityMod.NPCs.DevourerofGods for (int x = 0; x < totalShots_Phase2; x++) { - Projectile.NewProjectile(player.position.X + spawnOffset, targetPosY + shotSpacing_Phase2[0], -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); - Projectile.NewProjectile(player.position.X - spawnOffset, targetPosY + shotSpacing_Phase2[0], laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + spawnOffset, targetPosY + shotSpacing_Phase2[0], -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X - spawnOffset, targetPosY + shotSpacing_Phase2[0], laserVelocity, 0f, type, damage, 0f, Main.myPlayer); shotSpacing_Phase2[0] -= spacingVar_Phase2; } int totalBonusLasers = totalShots_Phase2 / 2; for (int x = 0; x < totalBonusLasers; x++) { - Projectile.NewProjectile(player.position.X + spawnOffset, targetPosY + shotSpacing_Phase2[3], -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); - Projectile.NewProjectile(player.position.X - spawnOffset, targetPosY + shotSpacing_Phase2[3], laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + spawnOffset, targetPosY + shotSpacing_Phase2[3], -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X - spawnOffset, targetPosY + shotSpacing_Phase2[3], laserVelocity, 0f, type, damage, 0f, Main.myPlayer); shotSpacing_Phase2[3] -= Main.rand.NextBool(2) ? 180 : 200; } - Projectile.NewProjectile(player.position.X + spawnOffset, player.Center.Y, -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); - Projectile.NewProjectile(player.position.X - spawnOffset, player.Center.Y, laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + spawnOffset, player.Center.Y, -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X - spawnOffset, player.Center.Y, laserVelocity, 0f, type, damage, 0f, Main.myPlayer); break; @@ -786,17 +786,17 @@ namespace CalamityMod.NPCs.DevourerofGods start = new Vector2(player.position.X + shotSpacing_Phase2[0], targetPosY + spawnOffset); aim.X += laserWallSpacingOffset * (x - halfTotalDiagonalShots); velocity = Vector2.Normalize(aim - start) * laserVelocity; - Projectile.NewProjectile(start, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), start, velocity, type, damage, 0f, Main.myPlayer); start = new Vector2(player.position.X + shotSpacing_Phase2[0], targetPosY - spawnOffset); velocity = Vector2.Normalize(aim - start) * laserVelocity; - Projectile.NewProjectile(start, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), start, velocity, type, damage, 0f, Main.myPlayer); shotSpacing_Phase2[0] -= diagonalSpacingVar; } - Projectile.NewProjectile(player.position.X + spawnOffset, player.Center.Y, -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); - Projectile.NewProjectile(player.position.X - spawnOffset, player.Center.Y, laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + spawnOffset, player.Center.Y, -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X - spawnOffset, player.Center.Y, laserVelocity, 0f, type, damage, 0f, Main.myPlayer); break; } @@ -816,14 +816,14 @@ namespace CalamityMod.NPCs.DevourerofGods // Lower wall for (int x = 0; x < totalShots_Phase2; x++) { - Projectile.NewProjectile(player.position.X + shotSpacing_Phase2[1], player.position.Y + spawnOffset, 0f, -laserVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + shotSpacing_Phase2[1], player.position.Y + spawnOffset, 0f, -laserVelocity, type, damage, 0f, Main.myPlayer); shotSpacing_Phase2[1] -= spacingVar_Phase2; } // Upper wall for (int x = 0; x < totalShots_Phase2; x++) { - Projectile.NewProjectile(player.position.X + shotSpacing_Phase2[2], player.position.Y - spawnOffset, 0f, laserVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + shotSpacing_Phase2[2], player.position.Y - spawnOffset, 0f, laserVelocity, type, damage, 0f, Main.myPlayer); shotSpacing_Phase2[2] -= spacingVar_Phase2; } @@ -1420,13 +1420,13 @@ namespace CalamityMod.NPCs.DevourerofGods start = new Vector2(player.position.X + spawnOffset, player.position.Y + shotSpacing); aim.Y += laserWallSpacingOffset * (x - 3); velocity = Vector2.Normalize(aim - start) * laserVelocity; - Projectile.NewProjectile(start, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), start, velocity, type, damage, 0f, Main.myPlayer); shotSpacing -= spacingVar; } if (expertMode) - Projectile.NewProjectile(player.position.X + spawnOffset, player.Center.Y, -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + spawnOffset, player.Center.Y, -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); break; @@ -1437,13 +1437,13 @@ namespace CalamityMod.NPCs.DevourerofGods start = new Vector2(player.position.X - spawnOffset, player.position.Y + shotSpacing); aim.Y += laserWallSpacingOffset * (x - 3); velocity = Vector2.Normalize(aim - start) * laserVelocity; - Projectile.NewProjectile(start, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), start, velocity, type, damage, 0f, Main.myPlayer); shotSpacing -= spacingVar; } if (expertMode) - Projectile.NewProjectile(player.position.X - spawnOffset, player.Center.Y, laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X - spawnOffset, player.Center.Y, laserVelocity, 0f, type, damage, 0f, Main.myPlayer); break; @@ -1454,19 +1454,19 @@ namespace CalamityMod.NPCs.DevourerofGods start = new Vector2(player.position.X + spawnOffset, player.position.Y + shotSpacing); aim.Y += laserWallSpacingOffset * (x - 3); velocity = Vector2.Normalize(aim - start) * laserVelocity; - Projectile.NewProjectile(start, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), start, velocity, type, damage, 0f, Main.myPlayer); start = new Vector2(player.position.X - spawnOffset, player.position.Y + shotSpacing); velocity = Vector2.Normalize(aim - start) * laserVelocity; - Projectile.NewProjectile(start, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), start, velocity, type, damage, 0f, Main.myPlayer); shotSpacing -= spacingVar; } if (expertMode) { - Projectile.NewProjectile(player.position.X + spawnOffset, player.Center.Y, -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); - Projectile.NewProjectile(player.position.X - spawnOffset, player.Center.Y, laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + spawnOffset, player.Center.Y, -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X - spawnOffset, player.Center.Y, laserVelocity, 0f, type, damage, 0f, Main.myPlayer); } break; @@ -1481,20 +1481,20 @@ namespace CalamityMod.NPCs.DevourerofGods start = new Vector2(player.position.X + spawnOffset, player.position.Y + shotSpacing); aim.Y += laserWallSpacingOffset * (x - 3); velocity = Vector2.Normalize(aim - start) * laserVelocity; - Projectile.NewProjectile(start, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), start, velocity, type, damage, 0f, Main.myPlayer); start = new Vector2(player.position.X - spawnOffset, player.position.Y + shotSpacing); velocity = Vector2.Normalize(aim - start) * laserVelocity; - Projectile.NewProjectile(start, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), start, velocity, type, damage, 0f, Main.myPlayer); start = new Vector2(player.position.X + shotSpacing, player.position.Y + spawnOffset); aimClone.X += laserWallSpacingOffset * (x - 3); velocity = Vector2.Normalize(aimClone - start) * laserVelocity; - Projectile.NewProjectile(start, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), start, velocity, type, damage, 0f, Main.myPlayer); start = new Vector2(player.position.X + shotSpacing, player.position.Y - spawnOffset); velocity = Vector2.Normalize(aimClone - start) * laserVelocity; - Projectile.NewProjectile(start, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), start, velocity, type, damage, 0f, Main.myPlayer); } shotSpacing -= spacingVar; @@ -1502,8 +1502,8 @@ namespace CalamityMod.NPCs.DevourerofGods if (expertMode) { - Projectile.NewProjectile(player.position.X + spawnOffset, player.Center.Y, -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); - Projectile.NewProjectile(player.position.X - spawnOffset, player.Center.Y, laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X + spawnOffset, player.Center.Y, -laserVelocity, 0f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), player.position.X - spawnOffset, player.Center.Y, laserVelocity, 0f, type, damage, 0f, Main.myPlayer); } break; @@ -1980,7 +1980,7 @@ namespace CalamityMod.NPCs.DevourerofGods float distance = 640f; Vector2 targetVector = player.Center + player.velocity.SafeNormalize(Vector2.UnitX) * distance + new Vector2(Main.rand.Next(-randomRange, randomRange + 1), Main.rand.Next(-randomRange, randomRange + 1)); SoundEngine.PlaySound(SoundID.Item109, player.Center); - Projectile.NewProjectile(targetVector, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), targetVector, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, NPC.whoAmI); } } @@ -1991,7 +1991,7 @@ namespace CalamityMod.NPCs.DevourerofGods int randomRange = 48; float distance = 1080f; Vector2 targetVector = player.Center + player.velocity.SafeNormalize(Vector2.UnitX) * distance + new Vector2(Main.rand.Next(-randomRange, randomRange + 1), Main.rand.Next(-randomRange, randomRange + 1)); - Projectile.NewProjectile(targetVector, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), targetVector, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, NPC.whoAmI); } Vector2 newPosition = GetRiftLocation(true); @@ -2022,7 +2022,7 @@ namespace CalamityMod.NPCs.DevourerofGods for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(newPosition, vector255, type, damage, 0f, Main.myPlayer, velocityMult, finalVelocity - finalVelocityReduction); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), newPosition, vector255, type, damage, 0f, Main.myPlayer, velocityMult, finalVelocity - finalVelocityReduction); } } } @@ -2122,7 +2122,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (DeathAnimationTimer == 452f) { if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f); if (Main.netMode != NetmodeID.Server) { diff --git a/NPCs/DevourerofGods/DevourerofGodsTail.cs b/NPCs/DevourerofGods/DevourerofGodsTail.cs index ef2af00a3f..9064888895 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTail.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTail.cs @@ -57,7 +57,7 @@ namespace CalamityMod.NPCs.DevourerofGods double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.Opacity = 0f; NPC.behindTiles = true; diff --git a/NPCs/DevourerofGods/DevourerofGodsTail2.cs b/NPCs/DevourerofGods/DevourerofGodsTail2.cs index 14bd5f2083..26d9cecb22 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTail2.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTail2.cs @@ -25,7 +25,7 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.defense = 70; NPC.lifeMax = 50000; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.behindTiles = true; diff --git a/NPCs/DraedonLabThings/RepairUnitCritter.cs b/NPCs/DraedonLabThings/RepairUnitCritter.cs index a55ed02c91..a0babfe397 100644 --- a/NPCs/DraedonLabThings/RepairUnitCritter.cs +++ b/NPCs/DraedonLabThings/RepairUnitCritter.cs @@ -54,7 +54,7 @@ namespace CalamityMod.NPCs.DraedonLabThings public override void SetDefaults() { NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.damage = 0; NPC.width = 20; NPC.height = 22; diff --git a/NPCs/ExoMechs/Apollo/Apollo.cs b/NPCs/ExoMechs/Apollo/Apollo.cs index 0ecee3ae7d..6188b35a58 100644 --- a/NPCs/ExoMechs/Apollo/Apollo.cs +++ b/NPCs/ExoMechs/Apollo/Apollo.cs @@ -1,4 +1,4 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.Items.Potions; using CalamityMod.Items.TreasureBags; using CalamityMod.NPCs.ExoMechs.Ares; @@ -138,7 +138,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.Opacity = 0f; NPC.knockBackResist = 0f; NPC.value = Item.buyPrice(15, 0, 0, 0); @@ -148,7 +148,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo NPC.DeathSound = SoundID.NPCDeath14; NPC.netAlways = true; NPC.boss = true; - music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; + Music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; bossBag = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; @@ -984,7 +984,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo SoundEngine.PlaySound(Mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/PlasmaCasterFire"), NPC.Center); Vector2 plasmaVelocity = Vector2.Normalize(aimedVector) * projectileVelocity; Vector2 offset = Vector2.Normalize(plasmaVelocity) * 70f; - Projectile.NewProjectile(NPC.Center + offset, plasmaVelocity, type, damage, 0f, Main.myPlayer, player.Center.X, player.Center.Y); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + offset, plasmaVelocity, type, damage, 0f, Main.myPlayer, player.Center.X, player.Center.Y); } } } @@ -1040,7 +1040,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo SoundEngine.PlaySound(SoundID.Item36, NPC.Center); Vector2 rocketVelocity = Vector2.Normalize(aimedVector) * projectileVelocity * 1.2f; Vector2 offset = Vector2.Normalize(rocketVelocity) * 70f; - Projectile.NewProjectile(NPC.Center + offset, rocketVelocity, type, damage, 0f, Main.myPlayer, 0f, player.Center.Y); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + offset, rocketVelocity, type, damage, 0f, Main.myPlayer, 0f, player.Center.Y); } } @@ -1098,7 +1098,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo // Draw telegraph beams if (Main.netMode != NetmodeID.MultiplayerClient) { - int telegraph = Projectile.NewProjectile(chargeLocations[0], Vector2.Zero, type, 0, 0f, Main.myPlayer, 0f, NPC.whoAmI); + int telegraph = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), chargeLocations[0], Vector2.Zero, type, 0, 0f, Main.myPlayer, 0f, NPC.whoAmI); if (Main.projectile.IndexInRange(telegraph)) { Main.projectile[telegraph].ModProjectile().ChargePositions = chargeLocations; @@ -1156,7 +1156,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo for (int k = 0; k < totalProjectiles; k++) { Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.Center, velocity2, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, velocity2, type, damage, 0f, Main.myPlayer); } } @@ -1269,7 +1269,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo Vector2 offset = lensDirection * 70f; if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.Center + offset, lensDirection * 24f, ModContent.ProjectileType(), 0, 0f); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + offset, lensDirection * 24f, ModContent.ProjectileType(), 0, 0f); } // Reset phase and variables diff --git a/NPCs/ExoMechs/Ares/AresBody.cs b/NPCs/ExoMechs/Ares/AresBody.cs index aee8112347..3f45340d5f 100644 --- a/NPCs/ExoMechs/Ares/AresBody.cs +++ b/NPCs/ExoMechs/Ares/AresBody.cs @@ -1,4 +1,4 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; @@ -149,7 +149,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.Opacity = 0f; NPC.knockBackResist = 0f; NPC.value = Item.buyPrice(15, 0, 0, 0); @@ -159,7 +159,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.DeathSound = SoundID.NPCDeath14; NPC.netAlways = true; NPC.boss = true; - music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; + Music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; bossBag = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; @@ -783,7 +783,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares for (int k = 0; k < totalProjectiles; k++) { Vector2 laserVelocity = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(spawnPoint + Vector2.Normalize(laserVelocity) * 17f, laserVelocity, type, 0, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), spawnPoint + Vector2.Normalize(laserVelocity) * 17f, laserVelocity, type, 0, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } @@ -802,7 +802,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares for (int k = 0; k < totalProjectiles; k++) { Vector2 laserVelocity = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(spawnPoint + Vector2.Normalize(laserVelocity) * 35f, laserVelocity, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), spawnPoint + Vector2.Normalize(laserVelocity) * 35f, laserVelocity, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } diff --git a/NPCs/ExoMechs/Ares/AresGaussNuke.cs b/NPCs/ExoMechs/Ares/AresGaussNuke.cs index 60d221c4d8..69fd677068 100644 --- a/NPCs/ExoMechs/Ares/AresGaussNuke.cs +++ b/NPCs/ExoMechs/Ares/AresGaussNuke.cs @@ -1,4 +1,4 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.NPCs.ExoMechs.Thanatos; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; @@ -77,7 +77,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.Opacity = 0f; NPC.knockBackResist = 0f; NPC.canGhostHeal = false; @@ -88,7 +88,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.netAlways = true; NPC.boss = true; NPC.hide = true; - music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; + Music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } @@ -405,7 +405,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); float offset = 40f; - Projectile.NewProjectile(NPC.Center + Vector2.Normalize(gaussNukeVelocity) * offset, gaussNukeVelocity, type, damage, 0f, Main.myPlayer, 0f, player.Center.Y); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + Vector2.Normalize(gaussNukeVelocity) * offset, gaussNukeVelocity, type, damage, 0f, Main.myPlayer, 0f, player.Center.Y); // Recoil NPC.velocity -= gaussNukeVelocity; diff --git a/NPCs/ExoMechs/Ares/AresLaserCannon.cs b/NPCs/ExoMechs/Ares/AresLaserCannon.cs index 7f425ee7e3..41bbaa0ddd 100644 --- a/NPCs/ExoMechs/Ares/AresLaserCannon.cs +++ b/NPCs/ExoMechs/Ares/AresLaserCannon.cs @@ -1,4 +1,4 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.NPCs.ExoMechs.Thanatos; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; @@ -75,7 +75,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.Opacity = 0f; NPC.knockBackResist = 0f; NPC.canGhostHeal = false; @@ -86,7 +86,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.netAlways = true; NPC.boss = true; NPC.hide = true; - music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; + Music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } @@ -438,7 +438,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares SoundEngine.PlaySound(Mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserCannon"), NPC.Center); Vector2 laserVelocity = Vector2.Normalize(player.Center - NPC.Center); Vector2 offset = laserVelocity * 70f + Vector2.UnitY * 16f; - Projectile.NewProjectile(NPC.Center + offset, player.Center, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + offset, player.Center, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } @@ -474,7 +474,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares if (laserVelocity.HasNaNs()) laserVelocity = -Vector2.UnitY; - Projectile.NewProjectile(source, laserVelocity, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), source, laserVelocity, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } diff --git a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs index 35a07751e1..db2e12976c 100644 --- a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs +++ b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs @@ -1,4 +1,4 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.NPCs.ExoMechs.Thanatos; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; @@ -75,7 +75,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.Opacity = 0f; NPC.knockBackResist = 0f; NPC.canGhostHeal = false; @@ -86,7 +86,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.netAlways = true; NPC.boss = true; NPC.hide = true; - music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; + Music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } @@ -432,9 +432,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares Vector2 offset = Vector2.Normalize(plasmaBoltVelocity) * 40f + Vector2.UnitY * 16f; if (boltsSplitLess) - Projectile.NewProjectile(NPC.Center + offset, plasmaBoltVelocity, type, damage, 0f, Main.myPlayer, -1f); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + offset, plasmaBoltVelocity, type, damage, 0f, Main.myPlayer, -1f); else - Projectile.NewProjectile(NPC.Center + offset, plasmaBoltVelocity, type, damage, 0f, Main.myPlayer, player.Center.X, player.Center.Y); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + offset, plasmaBoltVelocity, type, damage, 0f, Main.myPlayer, player.Center.X, player.Center.Y); } } } diff --git a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs index d57e81b5fd..0ffc36efa4 100644 --- a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs +++ b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs @@ -1,4 +1,4 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.NPCs.ExoMechs.Thanatos; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; @@ -75,7 +75,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.Opacity = 0f; NPC.knockBackResist = 0f; NPC.canGhostHeal = false; @@ -86,7 +86,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.netAlways = true; NPC.boss = true; NPC.hide = true; - music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; + Music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } @@ -427,7 +427,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares int damage = NPC.GetProjectileDamage(type); Vector2 offset = Vector2.Normalize(teslaOrbVelocity) * 40f + Vector2.UnitY * 8f; float identity = fireMoreOrbs ? -2f : calamityGlobalNPC.newAI[3] + (calamityGlobalNPC.newAI[2] - teslaOrbTelegraphDuration) / divisor; - Projectile.NewProjectile(NPC.Center + offset, teslaOrbVelocity, type, damage, 0f, Main.myPlayer, identity); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + offset, teslaOrbVelocity, type, damage, 0f, Main.myPlayer, identity); } } } diff --git a/NPCs/ExoMechs/Artemis/Artemis.cs b/NPCs/ExoMechs/Artemis/Artemis.cs index 5471c7b211..b3e34d47de 100644 --- a/NPCs/ExoMechs/Artemis/Artemis.cs +++ b/NPCs/ExoMechs/Artemis/Artemis.cs @@ -1,4 +1,4 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.NPCs.ExoMechs.Ares; using CalamityMod.NPCs.ExoMechs.Thanatos; using CalamityMod.Projectiles.Boss; @@ -150,7 +150,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.Opacity = 0f; NPC.knockBackResist = 0f; NPC.noGravity = true; @@ -159,7 +159,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis NPC.DeathSound = SoundID.NPCDeath14; NPC.netAlways = true; NPC.boss = true; - music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; + Music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } @@ -696,7 +696,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis Vector2 projectileDestination = player.Center + predictionVector; Vector2 offset = laserVelocity * 70f; float setVelocityInAI = 6.5f; - Projectile.NewProjectile(NPC.Center + offset, projectileDestination, type, damage, 0f, Main.myPlayer, setVelocityInAI, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + offset, projectileDestination, type, damage, 0f, Main.myPlayer, setVelocityInAI, NPC.whoAmI); } } } @@ -731,7 +731,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis SoundEngine.PlaySound(Mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserCannon"), NPC.Center); Vector2 laserVelocity = Vector2.Normalize(aimedVector); Vector2 offset = laserVelocity * 50f; - Projectile.NewProjectile(NPC.Center + offset, laserVelocity, type, 0, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + offset, laserVelocity, type, 0, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } @@ -757,7 +757,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis Vector2 offset = normalizedPerturbedSpeed * 70f; Vector2 newCenter = NPC.Center + offset; - Projectile.NewProjectile(newCenter, newCenter + normalizedPerturbedSpeed * distanceFromTarget, type, damage, 0f, Main.myPlayer, setVelocityInAI, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), newCenter, newCenter + normalizedPerturbedSpeed * distanceFromTarget, type, damage, 0f, Main.myPlayer, setVelocityInAI, NPC.whoAmI); } } } @@ -850,7 +850,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis Vector2 offset = normalizedPerturbedSpeed * 70f; Vector2 newCenter = NPC.Center + offset; - Projectile.NewProjectile(newCenter, newCenter + normalizedPerturbedSpeed * distanceFromTarget, type, damage, 0f, Main.myPlayer, setVelocityInAI, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), newCenter, newCenter + normalizedPerturbedSpeed * distanceFromTarget, type, damage, 0f, Main.myPlayer, setVelocityInAI, NPC.whoAmI); } } } @@ -912,7 +912,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis SoundEngine.PlaySound(Mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserCannon"), NPC.Center); Vector2 laserVelocity = Vector2.Normalize(spinningPoint - NPC.Center); Vector2 offset = laserVelocity * 70f; - Projectile.NewProjectile(NPC.Center + offset, laserVelocity, type, 0, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + offset, laserVelocity, type, 0, 0f, Main.myPlayer, 0f, NPC.whoAmI); } NPC.netUpdate = true; @@ -979,7 +979,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis int type = ModContent.ProjectileType(); SoundEngine.PlaySound(29, (int)NPC.Center.X, (int)NPC.Center.Y, 104); int damage = NPC.GetProjectileDamage(type); - int laser = Projectile.NewProjectile(NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer, NPC.whoAmI); + int laser = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer, NPC.whoAmI); if (Main.projectile.IndexInRange(laser)) { Main.projectile[laser].ai[0] = NPC.whoAmI; @@ -1072,7 +1072,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis Vector2 offset = lensDirection * 70f; if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.Center + offset, lensDirection * 24f, ModContent.ProjectileType(), 0, 0f); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + offset, lensDirection * 24f, ModContent.ProjectileType(), 0, 0f); } // Reset phase and variables diff --git a/NPCs/ExoMechs/Draedon.cs b/NPCs/ExoMechs/Draedon.cs index 10038d8d92..20735beae8 100644 --- a/NPCs/ExoMechs/Draedon.cs +++ b/NPCs/ExoMechs/Draedon.cs @@ -80,7 +80,7 @@ namespace CalamityMod.NPCs.ExoMechs NPC.noGravity = true; NPC.noTileCollide = true; NPC.dontTakeDamage = true; - NPC.aiStyle = aiType = -1; + NPC.aiStyle = AIType = -1; NPC.knockBackResist = 0f; NPC.DeathSound = SoundID.NPCDeath14; NPC.Calamity().DoesNotGenerateRage = true; diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs index b6b7dfb82f..1fdd56bdc9 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs @@ -1,4 +1,4 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; using CalamityMod.World; @@ -66,7 +66,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.Opacity = 0f; NPC.canGhostHeal = false; @@ -78,7 +78,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.dontCountMe = true; NPC.chaseable = false; NPC.boss = true; - music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; + Music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } @@ -309,7 +309,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos // Normal laser int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } @@ -379,21 +379,21 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (calamityGlobalNPC_Head.newAI[1] == (float)ThanatosHead.SecondaryPhase.Passive) { // Normal laser - Projectile.NewProjectile(NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } else { // Normal laser if (shouldGetBuffedByBerserkPhase && NPC.ai[0] % 3f == 0f) - Projectile.NewProjectile(NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); // Predictive laser Vector2 projectileDestination = targetCenterArray[i] + Main.player[whoAmIArray[i]].velocity * predictionAmt; - Projectile.NewProjectile(NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); // Opposite laser projectileDestination = targetCenterArray[i] - Main.player[whoAmIArray[i]].velocity * predictionAmt; - Projectile.NewProjectile(NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs index 5bd35b9f10..c15c546783 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs @@ -1,4 +1,4 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; using CalamityMod.World; @@ -66,7 +66,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.Opacity = 0f; NPC.canGhostHeal = false; @@ -78,7 +78,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.dontCountMe = true; NPC.chaseable = false; NPC.boss = true; - music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; + Music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } @@ -309,7 +309,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos // Normal laser int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } @@ -379,21 +379,21 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (calamityGlobalNPC_Head.newAI[1] == (float)ThanatosHead.SecondaryPhase.Passive) { // Normal laser - Projectile.NewProjectile(NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } else { // Normal laser if (shouldGetBuffedByBerserkPhase && NPC.ai[0] % 3f == 0f) - Projectile.NewProjectile(NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); // Predictive laser Vector2 projectileDestination = targetCenterArray[i] + Main.player[whoAmIArray[i]].velocity * predictionAmt; - Projectile.NewProjectile(NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); // Opposite laser projectileDestination = targetCenterArray[i] - Main.player[whoAmIArray[i]].velocity * predictionAmt; - Projectile.NewProjectile(NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs index d121c48044..71c5b8e2b8 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs @@ -1,4 +1,4 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.Items.Potions; using CalamityMod.Items.TreasureBags; using CalamityMod.NPCs.ExoMechs.Ares; @@ -128,7 +128,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.Opacity = 0f; NPC.knockBackResist = 0f; NPC.value = Item.buyPrice(15, 0, 0, 0); @@ -139,7 +139,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.netAlways = true; NPC.boss = true; NPC.chaseable = false; - music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; + Music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; bossBag = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; @@ -843,7 +843,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos int type = ModContent.ProjectileType(); for (int b = 0; b < 6; b++) { - int beam = Projectile.NewProjectile(NPC.Center, Vector2.Zero, type, 0, 0f, 255, NPC.whoAmI); + int beam = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, Vector2.Zero, type, 0, 0f, 255, NPC.whoAmI); // Determine the initial offset angle of telegraph. It will be smoothened to give a "stretch" effect. if (Main.projectile.IndexInRange(beam)) @@ -854,7 +854,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos Main.projectile[beam].ai[1] = MathHelper.Lerp(-0.74f, 0.74f, smoothenedRatio); } } - int beam2 = Projectile.NewProjectile(NPC.Center, Vector2.Zero, type, 0, 0f, 255, NPC.whoAmI); + int beam2 = Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, Vector2.Zero, type, 0, 0f, 255, NPC.whoAmI); if (Main.projectile.IndexInRange(beam2)) Main.projectile[beam2].ai[0] = NPC.whoAmI; } @@ -869,7 +869,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } diff --git a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs index 5260db0b73..10c4c00726 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs @@ -1,4 +1,4 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; using CalamityMod.World; @@ -66,7 +66,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.Opacity = 0f; NPC.canGhostHeal = false; @@ -78,7 +78,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.dontCountMe = true; NPC.chaseable = false; NPC.boss = true; - music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; + Music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } @@ -309,7 +309,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos // Normal laser int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } @@ -379,21 +379,21 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (calamityGlobalNPC_Head.newAI[1] == (float)ThanatosHead.SecondaryPhase.Passive) { // Normal laser - Projectile.NewProjectile(NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } else { // Normal laser if (shouldGetBuffedByBerserkPhase && NPC.ai[0] % 3f == 0f) - Projectile.NewProjectile(NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); // Predictive laser Vector2 projectileDestination = targetCenterArray[i] + Main.player[whoAmIArray[i]].velocity * predictionAmt; - Projectile.NewProjectile(NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); // Opposite laser projectileDestination = targetCenterArray[i] - Main.player[whoAmIArray[i]].velocity * predictionAmt; - Projectile.NewProjectile(NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } diff --git a/NPCs/GreatSandShark/GreatSandShark.cs b/NPCs/GreatSandShark/GreatSandShark.cs index 8d73f2f452..388ed2ce6c 100644 --- a/NPCs/GreatSandShark/GreatSandShark.cs +++ b/NPCs/GreatSandShark/GreatSandShark.cs @@ -36,7 +36,7 @@ namespace CalamityMod.NPCs.GreatSandShark NPC.DR_NERD(0.25f); NPC.LifeMaxNERB(9200, 11000); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.value = Item.buyPrice(0, 5, 0, 0); NPCID.Sets.TrailCacheLength[NPC.type] = 8; @@ -46,8 +46,8 @@ namespace CalamityMod.NPCs.GreatSandShark NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; NPC.timeLeft = NPC.activeTime * 30; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToWater = true; diff --git a/NPCs/HiveMind/DankCreeper.cs b/NPCs/HiveMind/DankCreeper.cs index 416c3a6b0e..fd7c37344a 100644 --- a/NPCs/HiveMind/DankCreeper.cs +++ b/NPCs/HiveMind/DankCreeper.cs @@ -29,7 +29,7 @@ namespace CalamityMod.NPCs.HiveMind NPC.lifeMax = 2000; } NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = BossRushEvent.BossRushActive ? 0f : 0.3f; NPC.noGravity = true; NPC.noTileCollide = true; diff --git a/NPCs/HiveMind/DarkHeart.cs b/NPCs/HiveMind/DarkHeart.cs index a57f26945d..a36db761f7 100644 --- a/NPCs/HiveMind/DarkHeart.cs +++ b/NPCs/HiveMind/DarkHeart.cs @@ -29,7 +29,7 @@ namespace CalamityMod.NPCs.HiveMind NPC.lifeMax = 1800; } NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = BossRushEvent.BossRushActive ? 0f : 0.4f; NPC.noGravity = true; NPC.canGhostHeal = false; diff --git a/NPCs/HiveMind/HiveBlob.cs b/NPCs/HiveMind/HiveBlob.cs index 0a42da357c..73d52cdd28 100644 --- a/NPCs/HiveMind/HiveBlob.cs +++ b/NPCs/HiveMind/HiveBlob.cs @@ -29,7 +29,7 @@ namespace CalamityMod.NPCs.HiveMind NPC.lifeMax = 1300; } NPC.knockBackResist = 0f; - aiType = -1; + AIType = -1; NPC.noGravity = true; NPC.noTileCollide = true; NPC.canGhostHeal = false; diff --git a/NPCs/HiveMind/HiveBlob2.cs b/NPCs/HiveMind/HiveBlob2.cs index 729c6e7e36..73ce26b9a5 100644 --- a/NPCs/HiveMind/HiveBlob2.cs +++ b/NPCs/HiveMind/HiveBlob2.cs @@ -29,7 +29,7 @@ namespace CalamityMod.NPCs.HiveMind NPC.lifeMax = 1300; } NPC.knockBackResist = 0f; - aiType = -1; + AIType = -1; NPC.noGravity = true; NPC.noTileCollide = true; NPC.canGhostHeal = false; diff --git a/NPCs/HiveMind/HiveCyst.cs b/NPCs/HiveMind/HiveCyst.cs index c787ae3ced..5ff2c444f7 100644 --- a/NPCs/HiveMind/HiveCyst.cs +++ b/NPCs/HiveMind/HiveCyst.cs @@ -18,7 +18,7 @@ namespace CalamityMod.NPCs.HiveMind { NPC.npcSlots = 0f; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.damage = 0; NPC.width = 30; //324 NPC.height = 30; //216 diff --git a/NPCs/HiveMind/HiveMind.cs b/NPCs/HiveMind/HiveMind.cs index 607009bdff..e8e580d6fc 100644 --- a/NPCs/HiveMind/HiveMind.cs +++ b/NPCs/HiveMind/HiveMind.cs @@ -100,7 +100,7 @@ namespace CalamityMod.NPCs.HiveMind double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.value = Item.buyPrice(0, 15, 0, 0); NPC.boss = true; diff --git a/NPCs/Leviathan/AquaticAberration.cs b/NPCs/Leviathan/AquaticAberration.cs index 5d874ecb86..04cf396b25 100644 --- a/NPCs/Leviathan/AquaticAberration.cs +++ b/NPCs/Leviathan/AquaticAberration.cs @@ -34,11 +34,11 @@ namespace CalamityMod.NPCs.Leviathan NPC.noGravity = true; NPC.noTileCollide = true; NPC.canGhostHeal = false; - aiType = -1; + AIType = -1; NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index 137e819767..359557643a 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Events; using CalamityMod.Items.Accessories; @@ -55,7 +55,7 @@ namespace CalamityMod.NPCs.Leviathan NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.knockBackResist = 0f; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.Opacity = 0f; NPC.value = Item.buyPrice(0, 60, 0, 0); NPC.HitSound = SoundID.NPCHit56; diff --git a/NPCs/Leviathan/LeviathanStart.cs b/NPCs/Leviathan/LeviathanStart.cs index de3b91de60..55b7af16c1 100644 --- a/NPCs/Leviathan/LeviathanStart.cs +++ b/NPCs/Leviathan/LeviathanStart.cs @@ -20,7 +20,7 @@ namespace CalamityMod.NPCs.Leviathan public override void SetDefaults() { NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.damage = 0; NPC.width = 100; NPC.height = 100; diff --git a/NPCs/Leviathan/Siren.cs b/NPCs/Leviathan/Siren.cs index c0621e2507..1a418482bc 100644 --- a/NPCs/Leviathan/Siren.cs +++ b/NPCs/Leviathan/Siren.cs @@ -1,4 +1,4 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.Items.Placeables.Furniture.Trophies; using CalamityMod.Items.TreasureBags; using CalamityMod.Projectiles.Boss; @@ -54,7 +54,7 @@ namespace CalamityMod.NPCs.Leviathan NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.knockBackResist = 0f; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.boss = true; NPC.value = Item.buyPrice(0, 60, 0, 0); NPC.noGravity = true; diff --git a/NPCs/Leviathan/SirenIce.cs b/NPCs/Leviathan/SirenIce.cs index 37b70ddff1..dd170998ee 100644 --- a/NPCs/Leviathan/SirenIce.cs +++ b/NPCs/Leviathan/SirenIce.cs @@ -17,7 +17,7 @@ namespace CalamityMod.NPCs.Leviathan public override void SetDefaults() { NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.canGhostHeal = false; NPC.noTileCollide = true; NPC.GetNPCDamage(); diff --git a/NPCs/NormalNPCs/AeroSlime.cs b/NPCs/NormalNPCs/AeroSlime.cs index 4fd59dfb36..20984f75b2 100644 --- a/NPCs/NormalNPCs/AeroSlime.cs +++ b/NPCs/NormalNPCs/AeroSlime.cs @@ -31,8 +31,8 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.noTileCollide = false; NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; } diff --git a/NPCs/NormalNPCs/AngryDog.cs b/NPCs/NormalNPCs/AngryDog.cs index d598963576..0c2e6cd203 100644 --- a/NPCs/NormalNPCs/AngryDog.cs +++ b/NPCs/NormalNPCs/AngryDog.cs @@ -34,12 +34,12 @@ namespace CalamityMod.NPCs.NormalNPCs } NPC.knockBackResist = 0.3f; animationType = NPCID.Hellhound; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 0, 3, 0); NPC.HitSound = Mod.GetLegacySoundSlot(SoundType.NPCHit, "Sounds/NPCHit/AngryDogHit"); NPC.DeathSound = SoundID.NPCDeath5; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.coldDamage = true; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = false; diff --git a/NPCs/NormalNPCs/ArmoredDiggerBody.cs b/NPCs/NormalNPCs/ArmoredDiggerBody.cs index f05c92e985..1db89516c1 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerBody.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerBody.cs @@ -24,7 +24,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.lifeMax = 20000; NPC.knockBackResist = 0f; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.behindTiles = true; NPC.noGravity = true; NPC.noTileCollide = true; @@ -32,8 +32,8 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.DeathSound = SoundID.NPCDeath14; NPC.netAlways = true; NPC.dontCountMe = true; - banner = ModContent.NPCType(); - bannerItem = ModContent.ItemType(); + Banner = ModContent.NPCType(); + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } diff --git a/NPCs/NormalNPCs/ArmoredDiggerHead.cs b/NPCs/NormalNPCs/ArmoredDiggerHead.cs index 26bf4ec190..c8540973dd 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerHead.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerHead.cs @@ -32,7 +32,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.lifeMax = 20000; NPC.knockBackResist = 0f; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 5, 0, 0); NPC.behindTiles = true; NPC.noGravity = true; @@ -40,8 +40,8 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.HitSound = SoundID.NPCHit4; NPC.DeathSound = SoundID.NPCDeath14; NPC.netAlways = true; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } diff --git a/NPCs/NormalNPCs/ArmoredDiggerTail.cs b/NPCs/NormalNPCs/ArmoredDiggerTail.cs index c400b6cb69..3a0d893663 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerTail.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerTail.cs @@ -24,7 +24,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.lifeMax = 20000; NPC.knockBackResist = 0f; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.behindTiles = true; NPC.noGravity = true; NPC.noTileCollide = true; @@ -32,8 +32,8 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.DeathSound = SoundID.NPCDeath14; NPC.netAlways = true; NPC.dontCountMe = true; - banner = ModContent.NPCType(); - bannerItem = ModContent.ItemType(); + Banner = ModContent.NPCType(); + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } diff --git a/NPCs/NormalNPCs/BlightedEye.cs b/NPCs/NormalNPCs/BlightedEye.cs index 6a7eb13690..114be8074b 100644 --- a/NPCs/NormalNPCs/BlightedEye.cs +++ b/NPCs/NormalNPCs/BlightedEye.cs @@ -16,7 +16,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetDefaults() { NPC.aiStyle = 2; - aiType = NPCID.TheHungryII; + AIType = NPCID.TheHungryII; NPC.damage = 32; NPC.width = 30; NPC.height = 32; @@ -27,8 +27,8 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.value = Item.buyPrice(0, 0, 2, 0); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; diff --git a/NPCs/NormalNPCs/BloomSlime.cs b/NPCs/NormalNPCs/BloomSlime.cs index f9ad60b15c..f80ce022cd 100644 --- a/NPCs/NormalNPCs/BloomSlime.cs +++ b/NPCs/NormalNPCs/BloomSlime.cs @@ -18,7 +18,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetDefaults() { NPC.aiStyle = 1; - aiType = NPCID.ToxicSludge; + AIType = NPCID.ToxicSludge; NPC.damage = 80; NPC.width = 40; NPC.height = 30; @@ -33,8 +33,8 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.noTileCollide = false; NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; } diff --git a/NPCs/NormalNPCs/Bohldohr.cs b/NPCs/NormalNPCs/Bohldohr.cs index 36d3b1dda0..cbc8763722 100644 --- a/NPCs/NormalNPCs/Bohldohr.cs +++ b/NPCs/NormalNPCs/Bohldohr.cs @@ -16,7 +16,7 @@ namespace CalamityMod.NPCs.NormalNPCs { NPC.Calamity().canBreakPlayerDefense = true; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.damage = 80; NPC.width = 40; NPC.height = 40; @@ -27,8 +27,8 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.HitSound = SoundID.NPCHit7; NPC.DeathSound = SoundID.NPCDeath35; NPC.behindTiles = true; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; } diff --git a/NPCs/NormalNPCs/Cnidrion.cs b/NPCs/NormalNPCs/Cnidrion.cs index 861630f12a..d133289304 100644 --- a/NPCs/NormalNPCs/Cnidrion.cs +++ b/NPCs/NormalNPCs/Cnidrion.cs @@ -31,13 +31,13 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.DR_NERD(0.05f); NPC.lifeMax = 280; NPC.knockBackResist = 0.05f; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 0, 25, 0); NPC.HitSound = SoundID.NPCHit12; NPC.DeathSound = SoundID.NPCDeath18; NPC.rarity = 2; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToWater = true; diff --git a/NPCs/NormalNPCs/CosmicElemental.cs b/NPCs/NormalNPCs/CosmicElemental.cs index fb795f426b..3e42cb770e 100644 --- a/NPCs/NormalNPCs/CosmicElemental.cs +++ b/NPCs/NormalNPCs/CosmicElemental.cs @@ -27,8 +27,8 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.value = Item.buyPrice(0, 0, 3, 0); NPC.HitSound = SoundID.NPCHit7; NPC.DeathSound = SoundID.NPCDeath6; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; } diff --git a/NPCs/NormalNPCs/CrawlerAmber.cs b/NPCs/NormalNPCs/CrawlerAmber.cs index 4013e7ae56..42927c95a0 100644 --- a/NPCs/NormalNPCs/CrawlerAmber.cs +++ b/NPCs/NormalNPCs/CrawlerAmber.cs @@ -20,7 +20,7 @@ namespace CalamityMod.NPCs.NormalNPCs { NPC.npcSlots = 0.3f; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.damage = 25; NPC.width = 44; NPC.height = 34; @@ -30,8 +30,8 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.value = Item.buyPrice(0, 0, 0, 80); NPC.HitSound = SoundID.NPCHit33; NPC.DeathSound = SoundID.NPCDeath36; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToWater = true; diff --git a/NPCs/NormalNPCs/CrawlerAmethyst.cs b/NPCs/NormalNPCs/CrawlerAmethyst.cs index bbf29bd731..cf898facc5 100644 --- a/NPCs/NormalNPCs/CrawlerAmethyst.cs +++ b/NPCs/NormalNPCs/CrawlerAmethyst.cs @@ -26,12 +26,12 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.defense = 4; NPC.lifeMax = 60; NPC.knockBackResist = 0.75f; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 0, 0, 30); NPC.HitSound = SoundID.NPCHit33; NPC.DeathSound = SoundID.NPCDeath36; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; diff --git a/NPCs/NormalNPCs/CrawlerCrystal.cs b/NPCs/NormalNPCs/CrawlerCrystal.cs index ff30e625ef..6b9f213d95 100644 --- a/NPCs/NormalNPCs/CrawlerCrystal.cs +++ b/NPCs/NormalNPCs/CrawlerCrystal.cs @@ -27,12 +27,12 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.defense = 12; NPC.lifeMax = 300; NPC.knockBackResist = 0.15f; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 0, 5, 0); NPC.HitSound = SoundID.NPCHit33; NPC.DeathSound = SoundID.NPCDeath36; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; diff --git a/NPCs/NormalNPCs/CrawlerDiamond.cs b/NPCs/NormalNPCs/CrawlerDiamond.cs index 4a7348b856..a9a637e64e 100644 --- a/NPCs/NormalNPCs/CrawlerDiamond.cs +++ b/NPCs/NormalNPCs/CrawlerDiamond.cs @@ -26,12 +26,12 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.defense = 8; NPC.lifeMax = 150; NPC.knockBackResist = 0.35f; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 0, 2, 0); NPC.HitSound = SoundID.NPCHit33; NPC.DeathSound = SoundID.NPCDeath36; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; diff --git a/NPCs/NormalNPCs/CrawlerEmerald.cs b/NPCs/NormalNPCs/CrawlerEmerald.cs index db6d909c76..e0d73c00c4 100644 --- a/NPCs/NormalNPCs/CrawlerEmerald.cs +++ b/NPCs/NormalNPCs/CrawlerEmerald.cs @@ -26,12 +26,12 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.defense = 6; NPC.lifeMax = 105; NPC.knockBackResist = 0.55f; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 0, 1, 0); NPC.HitSound = SoundID.NPCHit33; NPC.DeathSound = SoundID.NPCDeath36; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; diff --git a/NPCs/NormalNPCs/CrawlerRuby.cs b/NPCs/NormalNPCs/CrawlerRuby.cs index 0e7e6deebb..c15d1961c5 100644 --- a/NPCs/NormalNPCs/CrawlerRuby.cs +++ b/NPCs/NormalNPCs/CrawlerRuby.cs @@ -26,12 +26,12 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.defense = 8; NPC.lifeMax = 135; NPC.knockBackResist = 0.45f; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 0, 1, 0); NPC.HitSound = SoundID.NPCHit33; NPC.DeathSound = SoundID.NPCDeath36; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; diff --git a/NPCs/NormalNPCs/CrawlerSapphire.cs b/NPCs/NormalNPCs/CrawlerSapphire.cs index 53ce5f7feb..928aeb061a 100644 --- a/NPCs/NormalNPCs/CrawlerSapphire.cs +++ b/NPCs/NormalNPCs/CrawlerSapphire.cs @@ -26,12 +26,12 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.defense = 6; NPC.lifeMax = 90; NPC.knockBackResist = 0.65f; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 0, 1, 0); NPC.HitSound = SoundID.NPCHit33; NPC.DeathSound = SoundID.NPCDeath36; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; diff --git a/NPCs/NormalNPCs/CrawlerTopaz.cs b/NPCs/NormalNPCs/CrawlerTopaz.cs index 2d1b7b94fa..3a35fc3178 100644 --- a/NPCs/NormalNPCs/CrawlerTopaz.cs +++ b/NPCs/NormalNPCs/CrawlerTopaz.cs @@ -26,12 +26,12 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.defense = 4; NPC.lifeMax = 45; NPC.knockBackResist = 0.85f; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 0, 0, 30); NPC.HitSound = SoundID.NPCHit33; NPC.DeathSound = SoundID.NPCDeath36; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; diff --git a/NPCs/NormalNPCs/CrimulanBlightSlime.cs b/NPCs/NormalNPCs/CrimulanBlightSlime.cs index ec2e193681..1a38921686 100644 --- a/NPCs/NormalNPCs/CrimulanBlightSlime.cs +++ b/NPCs/NormalNPCs/CrimulanBlightSlime.cs @@ -16,7 +16,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetDefaults() { NPC.aiStyle = 1; - aiType = NPCID.DungeonSlime; + AIType = NPCID.DungeonSlime; NPC.damage = 30; NPC.width = 60; NPC.height = 42; @@ -31,8 +31,8 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.noTileCollide = false; NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; } diff --git a/NPCs/NormalNPCs/CryoSlime.cs b/NPCs/NormalNPCs/CryoSlime.cs index c30334b759..264bb0eae8 100644 --- a/NPCs/NormalNPCs/CryoSlime.cs +++ b/NPCs/NormalNPCs/CryoSlime.cs @@ -17,7 +17,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetDefaults() { NPC.aiStyle = 1; - aiType = NPCID.DungeonSlime; + AIType = NPCID.DungeonSlime; NPC.damage = 30; NPC.width = 40; NPC.height = 30; @@ -32,8 +32,8 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.noTileCollide = false; NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = false; NPC.Calamity().VulnerableToSickness = false; diff --git a/NPCs/NormalNPCs/Cryocore.cs b/NPCs/NormalNPCs/Cryocore.cs index 8110603e0f..23188a5c28 100644 --- a/NPCs/NormalNPCs/Cryocore.cs +++ b/NPCs/NormalNPCs/Cryocore.cs @@ -23,7 +23,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.defense = 6; NPC.lifeMax = 220; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 0, 3, 50); NPC.knockBackResist = 0.75f; NPC.noGravity = true; diff --git a/NPCs/NormalNPCs/Cryocore2.cs b/NPCs/NormalNPCs/Cryocore2.cs index 17856687d4..ee82037faf 100644 --- a/NPCs/NormalNPCs/Cryocore2.cs +++ b/NPCs/NormalNPCs/Cryocore2.cs @@ -23,7 +23,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.defense = 10; NPC.lifeMax = 300; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 0, 5, 0); NPC.knockBackResist = 0.5f; NPC.noGravity = true; diff --git a/NPCs/NormalNPCs/Cryon.cs b/NPCs/NormalNPCs/Cryon.cs index 06f7792637..29195603db 100644 --- a/NPCs/NormalNPCs/Cryon.cs +++ b/NPCs/NormalNPCs/Cryon.cs @@ -18,7 +18,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetDefaults() { NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.damage = 42; NPC.width = 50; NPC.height = 64; @@ -29,8 +29,8 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.value = Item.buyPrice(0, 0, 5, 0); NPC.HitSound = SoundID.NPCHit5; NPC.DeathSound = SoundID.NPCDeath7; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.coldDamage = true; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = false; diff --git a/NPCs/NormalNPCs/EbonianBlightSlime.cs b/NPCs/NormalNPCs/EbonianBlightSlime.cs index 872a3f423a..37faaa2cb1 100644 --- a/NPCs/NormalNPCs/EbonianBlightSlime.cs +++ b/NPCs/NormalNPCs/EbonianBlightSlime.cs @@ -16,7 +16,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetDefaults() { NPC.aiStyle = 1; - aiType = NPCID.DungeonSlime; + AIType = NPCID.DungeonSlime; NPC.damage = 30; NPC.width = 60; NPC.height = 42; @@ -31,8 +31,8 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.noTileCollide = false; NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; } diff --git a/NPCs/NormalNPCs/Eidolist.cs b/NPCs/NormalNPCs/Eidolist.cs index caf20786a8..dcf7b915e9 100644 --- a/NPCs/NormalNPCs/Eidolist.cs +++ b/NPCs/NormalNPCs/Eidolist.cs @@ -25,7 +25,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetDefaults() { NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.damage = 0; NPC.width = 60; NPC.height = 80; @@ -38,8 +38,8 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.HitSound = SoundID.NPCHit13; NPC.DeathSound = Mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/EidolistDeath"); NPC.timeLeft = NPC.activeTime * 2; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs b/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs index 7e18cd5ef6..5e652bda2d 100644 --- a/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs +++ b/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs @@ -21,7 +21,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetDefaults() { NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.damage = Main.hardMode ? 100 : 30; NPC.width = 36; NPC.height = 32; @@ -31,8 +31,8 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.value = Item.buyPrice(0, 0, 1, 0); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/NormalNPCs/Frogfish.cs b/NPCs/NormalNPCs/Frogfish.cs index 238011723a..8b3e559d84 100644 --- a/NPCs/NormalNPCs/Frogfish.cs +++ b/NPCs/NormalNPCs/Frogfish.cs @@ -23,13 +23,13 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.defense = 10; NPC.lifeMax = 80; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 0, 0, 80); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0.5f; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.chaseable = false; NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; diff --git a/NPCs/NormalNPCs/Horse.cs b/NPCs/NormalNPCs/Horse.cs index a6cc8b8fb7..909ce36f23 100644 --- a/NPCs/NormalNPCs/Horse.cs +++ b/NPCs/NormalNPCs/Horse.cs @@ -31,7 +31,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.DR_NERD(0.1f); NPC.lifeMax = 3800; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.value = Item.buyPrice(0, 1, 50, 0); NPC.dontTakeDamage = true; @@ -39,8 +39,8 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.noTileCollide = true; NPC.HitSound = SoundID.NPCHit4; NPC.rarity = 2; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; } diff --git a/NPCs/NormalNPCs/IceClasper.cs b/NPCs/NormalNPCs/IceClasper.cs index dfae9dc332..c3e1efa9c3 100644 --- a/NPCs/NormalNPCs/IceClasper.cs +++ b/NPCs/NormalNPCs/IceClasper.cs @@ -29,14 +29,14 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.lifeMax = 600; NPC.knockBackResist = 0.35f; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 0, 25, 0); NPC.HitSound = SoundID.NPCHit5; NPC.DeathSound = SoundID.NPCDeath7; NPC.coldDamage = true; NPC.rarity = 2; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.coldDamage = true; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = false; diff --git a/NPCs/NormalNPCs/ImpiousImmolator.cs b/NPCs/NormalNPCs/ImpiousImmolator.cs index e195ad10e3..d308fbbd9f 100644 --- a/NPCs/NormalNPCs/ImpiousImmolator.cs +++ b/NPCs/NormalNPCs/ImpiousImmolator.cs @@ -32,13 +32,13 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.defense = 30; NPC.lifeMax = 5775; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 0, 50, 0); NPC.HitSound = SoundID.NPCHit5; NPC.DeathSound = SoundID.NPCDeath7; NPC.knockBackResist = 0.2f; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = false; diff --git a/NPCs/NormalNPCs/KingSlimeJewel.cs b/NPCs/NormalNPCs/KingSlimeJewel.cs index 3e80a19f1e..23b8afda54 100644 --- a/NPCs/NormalNPCs/KingSlimeJewel.cs +++ b/NPCs/NormalNPCs/KingSlimeJewel.cs @@ -19,7 +19,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetDefaults() { NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.damage = 0; NPC.width = 22; NPC.height = 22; diff --git a/NPCs/NormalNPCs/MantisShrimp.cs b/NPCs/NormalNPCs/MantisShrimp.cs index 6d1fa39fc7..a3c02b9c61 100644 --- a/NPCs/NormalNPCs/MantisShrimp.cs +++ b/NPCs/NormalNPCs/MantisShrimp.cs @@ -25,12 +25,12 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.DR_NERD(0.1f); NPC.lifeMax = 30; NPC.aiStyle = 3; - aiType = NPCID.Crab; + AIType = NPCID.Crab; NPC.value = Item.buyPrice(0, 0, 1, 0); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/NormalNPCs/OverloadedSoldier.cs b/NPCs/NormalNPCs/OverloadedSoldier.cs index ae91c07717..75ef587e3c 100644 --- a/NPCs/NormalNPCs/OverloadedSoldier.cs +++ b/NPCs/NormalNPCs/OverloadedSoldier.cs @@ -22,7 +22,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetDefaults() { NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.damage = NPC.downedMoonlord ? 84 : 42; NPC.width = 18; NPC.height = 40; @@ -33,8 +33,8 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.value = Item.buyPrice(0, 0, 2, 0); NPC.HitSound = SoundID.NPCHit2; NPC.DeathSound = SoundID.NPCDeath2; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; } diff --git a/NPCs/NormalNPCs/Parasea.cs b/NPCs/NormalNPCs/Parasea.cs index ceaac688e2..dff68d0eb8 100644 --- a/NPCs/NormalNPCs/Parasea.cs +++ b/NPCs/NormalNPCs/Parasea.cs @@ -19,7 +19,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetDefaults() { NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.noGravity = true; NPC.damage = 50; NPC.width = NPC.height = 30; @@ -29,8 +29,8 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.value = Item.buyPrice(0, 0, 6, 0); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/NormalNPCs/PerennialSlime.cs b/NPCs/NormalNPCs/PerennialSlime.cs index b5036e5da4..d407588155 100644 --- a/NPCs/NormalNPCs/PerennialSlime.cs +++ b/NPCs/NormalNPCs/PerennialSlime.cs @@ -16,7 +16,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetDefaults() { NPC.aiStyle = 1; - aiType = NPCID.ToxicSludge; + AIType = NPCID.ToxicSludge; NPC.damage = 35; NPC.width = 40; NPC.height = 30; @@ -31,8 +31,8 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.noTileCollide = false; NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; } diff --git a/NPCs/NormalNPCs/PhantomDebris.cs b/NPCs/NormalNPCs/PhantomDebris.cs index c31424c2a3..2d7a84e130 100644 --- a/NPCs/NormalNPCs/PhantomDebris.cs +++ b/NPCs/NormalNPCs/PhantomDebris.cs @@ -28,13 +28,13 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.DR_NERD(0.1f); NPC.lifeMax = NPC.downedMoonlord ? 1200 : 120; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.value = Item.buyPrice(0, 0, 2, 0); NPC.HitSound = SoundID.NPCHit2; NPC.DeathSound = SoundID.NPCDeath36; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; } diff --git a/NPCs/NormalNPCs/PhantomSpirit.cs b/NPCs/NormalNPCs/PhantomSpirit.cs index ffaf005d0a..5b5aa1c543 100644 --- a/NPCs/NormalNPCs/PhantomSpirit.cs +++ b/NPCs/NormalNPCs/PhantomSpirit.cs @@ -26,14 +26,14 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.lifeMax = 1000; NPC.knockBackResist = 0.1f; animationType = NPCID.DungeonSpirit; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 0, 20, 0); NPC.HitSound = SoundID.NPCHit36; NPC.DeathSound = SoundID.NPCDeath39; NPC.noGravity = true; NPC.noTileCollide = true; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; } diff --git a/NPCs/NormalNPCs/PhantomSpiritL.cs b/NPCs/NormalNPCs/PhantomSpiritL.cs index dbc486cc5f..8328c9b46f 100644 --- a/NPCs/NormalNPCs/PhantomSpiritL.cs +++ b/NPCs/NormalNPCs/PhantomSpiritL.cs @@ -30,14 +30,14 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.defense = 30; NPC.lifeMax = 3000; NPC.knockBackResist = 0f; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 0, 60, 0); NPC.HitSound = SoundID.NPCHit36; NPC.DeathSound = SoundID.NPCDeath39; NPC.noGravity = true; NPC.noTileCollide = true; - banner = ModContent.NPCType(); - bannerItem = ModContent.ItemType(); + Banner = ModContent.NPCType(); + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; } diff --git a/NPCs/NormalNPCs/PhantomSpiritM.cs b/NPCs/NormalNPCs/PhantomSpiritM.cs index 068d8a4a57..732faec45c 100644 --- a/NPCs/NormalNPCs/PhantomSpiritM.cs +++ b/NPCs/NormalNPCs/PhantomSpiritM.cs @@ -26,14 +26,14 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.defense = 25; NPC.lifeMax = 2000; NPC.knockBackResist = 0.1f; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 0, 40, 0); NPC.HitSound = SoundID.NPCHit36; NPC.DeathSound = SoundID.NPCDeath39; NPC.noGravity = true; NPC.noTileCollide = true; - banner = ModContent.NPCType(); - bannerItem = ModContent.ItemType(); + Banner = ModContent.NPCType(); + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; } diff --git a/NPCs/NormalNPCs/PhantomSpiritS.cs b/NPCs/NormalNPCs/PhantomSpiritS.cs index cbe75c34cf..256ffa4085 100644 --- a/NPCs/NormalNPCs/PhantomSpiritS.cs +++ b/NPCs/NormalNPCs/PhantomSpiritS.cs @@ -25,14 +25,14 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.defense = 20; NPC.lifeMax = 1500; NPC.knockBackResist = 0.1f; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 0, 30, 0); NPC.HitSound = SoundID.NPCHit36; NPC.DeathSound = SoundID.NPCDeath39; NPC.noGravity = true; NPC.noTileCollide = true; - banner = ModContent.NPCType(); - bannerItem = ModContent.ItemType(); + Banner = ModContent.NPCType(); + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; } diff --git a/NPCs/NormalNPCs/Piggy.cs b/NPCs/NormalNPCs/Piggy.cs index 64788a55d3..b828bf9e08 100644 --- a/NPCs/NormalNPCs/Piggy.cs +++ b/NPCs/NormalNPCs/Piggy.cs @@ -23,13 +23,13 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.height = 26; NPC.lifeMax = 2000; NPC.aiStyle = 7; - aiType = NPCID.Squirrel; + AIType = NPCID.Squirrel; NPC.knockBackResist = 0.99f; NPC.value = Item.buyPrice(0, 2, 0, 0); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.catchItem = (short)ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; diff --git a/NPCs/NormalNPCs/ProfanedEnergyBody.cs b/NPCs/NormalNPCs/ProfanedEnergyBody.cs index 29b204c97e..40ba1f51f7 100644 --- a/NPCs/NormalNPCs/ProfanedEnergyBody.cs +++ b/NPCs/NormalNPCs/ProfanedEnergyBody.cs @@ -24,14 +24,14 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.DR_NERD(0.1f); NPC.lifeMax = 4500; NPC.knockBackResist = 0f; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 0, 50, 0); NPC.lavaImmune = true; NPC.noGravity = true; NPC.HitSound = SoundID.NPCHit52; NPC.DeathSound = SoundID.NPCDeath55; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = false; diff --git a/NPCs/NormalNPCs/ProfanedEnergyLantern.cs b/NPCs/NormalNPCs/ProfanedEnergyLantern.cs index 7fd333b95b..df585a9b19 100644 --- a/NPCs/NormalNPCs/ProfanedEnergyLantern.cs +++ b/NPCs/NormalNPCs/ProfanedEnergyLantern.cs @@ -25,7 +25,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 30; NPC.height = 30; NPC.lifeMax = 1; - aiType = -1; + AIType = -1; NPC.lavaImmune = true; NPC.noGravity = true; NPC.noTileCollide = true; diff --git a/NPCs/NormalNPCs/Rotdog.cs b/NPCs/NormalNPCs/Rotdog.cs index f6589fc727..5f6d66b05f 100644 --- a/NPCs/NormalNPCs/Rotdog.cs +++ b/NPCs/NormalNPCs/Rotdog.cs @@ -23,12 +23,12 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.lifeMax = 60; NPC.knockBackResist = 0.3f; animationType = NPCID.Hellhound; - aiType = NPCID.Wolf; + AIType = NPCID.Wolf; NPC.value = Item.buyPrice(0, 0, 2, 0); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath5; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; diff --git a/NPCs/NormalNPCs/SandTortoise.cs b/NPCs/NormalNPCs/SandTortoise.cs index cb608cff17..1caffec8a4 100644 --- a/NPCs/NormalNPCs/SandTortoise.cs +++ b/NPCs/NormalNPCs/SandTortoise.cs @@ -29,8 +29,8 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.HitSound = SoundID.NPCHit24; NPC.DeathSound = SoundID.NPCDeath27; NPC.noGravity = false; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToWater = true; diff --git a/NPCs/NormalNPCs/ScornEater.cs b/NPCs/NormalNPCs/ScornEater.cs index 02ca0ae911..36a68062b8 100644 --- a/NPCs/NormalNPCs/ScornEater.cs +++ b/NPCs/NormalNPCs/ScornEater.cs @@ -29,12 +29,12 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.DR_NERD(0.05f); NPC.lifeMax = 9000; NPC.knockBackResist = 0f; - aiType = -1; + AIType = -1; NPC.lavaImmune = true; NPC.value = Item.buyPrice(0, 0, 50, 0); NPC.DeathSound = Mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/ScornDeath"); - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = false; diff --git a/NPCs/NormalNPCs/SeaUrchin.cs b/NPCs/NormalNPCs/SeaUrchin.cs index 7bb8224c07..109706555f 100644 --- a/NPCs/NormalNPCs/SeaUrchin.cs +++ b/NPCs/NormalNPCs/SeaUrchin.cs @@ -16,7 +16,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetDefaults() { NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.damage = 20; NPC.width = 40; NPC.height = 40; @@ -27,8 +27,8 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath15; NPC.behindTiles = true; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/NormalNPCs/ShockstormShuttle.cs b/NPCs/NormalNPCs/ShockstormShuttle.cs index e1dddcfcd6..8f304871e7 100644 --- a/NPCs/NormalNPCs/ShockstormShuttle.cs +++ b/NPCs/NormalNPCs/ShockstormShuttle.cs @@ -27,15 +27,15 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.DR_NERD(0.15f); NPC.lifeMax = 150; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.value = Item.buyPrice(0, 0, 5, 0); NPC.HitSound = SoundID.NPCHit4; NPC.DeathSound = SoundID.NPCDeath14; NPC.noGravity = true; NPC.noTileCollide = true; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } diff --git a/NPCs/NormalNPCs/StormlionCharger.cs b/NPCs/NormalNPCs/StormlionCharger.cs index a40760e2c5..7333dc12ad 100644 --- a/NPCs/NormalNPCs/StormlionCharger.cs +++ b/NPCs/NormalNPCs/StormlionCharger.cs @@ -27,8 +27,8 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.value = Item.buyPrice(0, 0, 2, 0); NPC.HitSound = SoundID.NPCHit31; NPC.DeathSound = SoundID.NPCDeath34; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = false; diff --git a/NPCs/NormalNPCs/SunBat.cs b/NPCs/NormalNPCs/SunBat.cs index 358f05461d..f00d699ea0 100644 --- a/NPCs/NormalNPCs/SunBat.cs +++ b/NPCs/NormalNPCs/SunBat.cs @@ -18,7 +18,7 @@ namespace CalamityMod.NPCs.NormalNPCs { NPC.lavaImmune = true; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.damage = 35; NPC.width = 26; NPC.height = 20; @@ -28,8 +28,8 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.value = Item.buyPrice(0, 0, 5, 0); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath4; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; diff --git a/NPCs/NormalNPCs/Sunskater.cs b/NPCs/NormalNPCs/Sunskater.cs index bbbd3e47e8..2ae5fb33bc 100644 --- a/NPCs/NormalNPCs/Sunskater.cs +++ b/NPCs/NormalNPCs/Sunskater.cs @@ -29,13 +29,13 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.defense = 4; NPC.lifeMax = 100; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 0, 5, 0); NPC.HitSound = SoundID.NPCHit50; NPC.DeathSound = Mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/Sunskater"); NPC.knockBackResist = 0.7f; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; diff --git a/NPCs/NormalNPCs/ThiccWaifu.cs b/NPCs/NormalNPCs/ThiccWaifu.cs index c5818c5123..6f35248cd6 100644 --- a/NPCs/NormalNPCs/ThiccWaifu.cs +++ b/NPCs/NormalNPCs/ThiccWaifu.cs @@ -63,8 +63,8 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.noGravity = true; NPC.noTileCollide = true; NPC.rarity = 2; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = false; diff --git a/NPCs/NormalNPCs/WildBumblefuck.cs b/NPCs/NormalNPCs/WildBumblefuck.cs index 47581b9621..4fcdfb2619 100644 --- a/NPCs/NormalNPCs/WildBumblefuck.cs +++ b/NPCs/NormalNPCs/WildBumblefuck.cs @@ -22,7 +22,7 @@ namespace CalamityMod.NPCs.NormalNPCs { NPC.npcSlots = 1f; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.damage = 90; NPC.width = 120; NPC.height = 80; diff --git a/NPCs/NormalNPCs/WulfrumDrone.cs b/NPCs/NormalNPCs/WulfrumDrone.cs index 93b7f4e317..9a0f2ce323 100644 --- a/NPCs/NormalNPCs/WulfrumDrone.cs +++ b/NPCs/NormalNPCs/WulfrumDrone.cs @@ -53,7 +53,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetDefaults() { - aiType = -1; + AIType = -1; NPC.aiStyle = -1; NPC.damage = 16; NPC.width = 32; @@ -66,8 +66,8 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.noTileCollide = true; NPC.HitSound = SoundID.NPCHit4; NPC.DeathSound = SoundID.NPCDeath14; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } diff --git a/NPCs/NormalNPCs/WulfrumGyrator.cs b/NPCs/NormalNPCs/WulfrumGyrator.cs index d33247d5c7..5642e63d92 100644 --- a/NPCs/NormalNPCs/WulfrumGyrator.cs +++ b/NPCs/NormalNPCs/WulfrumGyrator.cs @@ -40,7 +40,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetDefaults() { - aiType = -1; + AIType = -1; NPC.aiStyle = -1; NPC.damage = 15; NPC.width = 40; @@ -51,8 +51,8 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.value = Item.buyPrice(0, 0, 1, 15); NPC.HitSound = SoundID.NPCHit4; NPC.DeathSound = SoundID.NPCDeath14; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } diff --git a/NPCs/NormalNPCs/WulfrumHovercraft.cs b/NPCs/NormalNPCs/WulfrumHovercraft.cs index 2ccd9ff999..337e4f8d66 100644 --- a/NPCs/NormalNPCs/WulfrumHovercraft.cs +++ b/NPCs/NormalNPCs/WulfrumHovercraft.cs @@ -61,7 +61,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetDefaults() { - aiType = -1; + AIType = -1; NPC.aiStyle = -1; NPC.damage = 15; NPC.width = 40; @@ -73,8 +73,8 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.DeathSound = SoundID.NPCDeath14; NPC.noGravity = true; NPC.noTileCollide = true; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } diff --git a/NPCs/NormalNPCs/WulfrumPylon.cs b/NPCs/NormalNPCs/WulfrumPylon.cs index 5084209d69..43571bbfef 100644 --- a/NPCs/NormalNPCs/WulfrumPylon.cs +++ b/NPCs/NormalNPCs/WulfrumPylon.cs @@ -38,7 +38,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetDefaults() { - aiType = -1; + AIType = -1; NPC.aiStyle = -1; NPC.damage = 0; NPC.width = 44; @@ -51,8 +51,8 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.noTileCollide = false; NPC.HitSound = SoundID.NPCHit4; NPC.DeathSound = SoundID.NPCDeath14; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } diff --git a/NPCs/NormalNPCs/WulfrumRover.cs b/NPCs/NormalNPCs/WulfrumRover.cs index 653828ec1a..0bed9d1c2c 100644 --- a/NPCs/NormalNPCs/WulfrumRover.cs +++ b/NPCs/NormalNPCs/WulfrumRover.cs @@ -39,7 +39,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetDefaults() { - aiType = -1; + AIType = -1; NPC.aiStyle = -1; NPC.damage = 10; NPC.width = 40; @@ -50,8 +50,8 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.value = Item.buyPrice(0, 0, 1, 15); NPC.HitSound = SoundID.NPCHit4; NPC.DeathSound = SoundID.NPCDeath14; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } diff --git a/NPCs/OldDuke/OldDuke.cs b/NPCs/OldDuke/OldDuke.cs index 2641e9bc34..ce4b284b09 100644 --- a/NPCs/OldDuke/OldDuke.cs +++ b/NPCs/OldDuke/OldDuke.cs @@ -38,7 +38,7 @@ namespace CalamityMod.NPCs.OldDuke NPC.width = 150; NPC.height = 100; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.GetNPCDamage(); NPC.defense = 90; NPC.DR_NERD(0.5f, null, null, null, true); diff --git a/NPCs/OldDuke/OldDukeSharkron.cs b/NPCs/OldDuke/OldDukeSharkron.cs index 0ac27a0ad5..2296569bc1 100644 --- a/NPCs/OldDuke/OldDukeSharkron.cs +++ b/NPCs/OldDuke/OldDukeSharkron.cs @@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.OldDuke { NPC.Calamity().canBreakPlayerDefense = true; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.width = 44; NPC.height = 44; NPC.GetNPCDamage(); diff --git a/NPCs/OldDuke/OldDukeToothBall.cs b/NPCs/OldDuke/OldDukeToothBall.cs index 40ce367360..3cba50513d 100644 --- a/NPCs/OldDuke/OldDukeToothBall.cs +++ b/NPCs/OldDuke/OldDukeToothBall.cs @@ -25,7 +25,7 @@ namespace CalamityMod.NPCs.OldDuke { NPC.Calamity().canBreakPlayerDefense = true; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.GetNPCDamage(); NPC.width = 40; NPC.height = 40; diff --git a/NPCs/Perforator/PerforatorBodyLarge.cs b/NPCs/Perforator/PerforatorBodyLarge.cs index 3e15e96e7c..9a0c6780a5 100644 --- a/NPCs/Perforator/PerforatorBodyLarge.cs +++ b/NPCs/Perforator/PerforatorBodyLarge.cs @@ -26,7 +26,7 @@ namespace CalamityMod.NPCs.Perforator double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.behindTiles = true; diff --git a/NPCs/Perforator/PerforatorBodyMedium.cs b/NPCs/Perforator/PerforatorBodyMedium.cs index b18efe7942..9ebd7966ae 100644 --- a/NPCs/Perforator/PerforatorBodyMedium.cs +++ b/NPCs/Perforator/PerforatorBodyMedium.cs @@ -28,7 +28,7 @@ namespace CalamityMod.NPCs.Perforator double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.behindTiles = true; diff --git a/NPCs/Perforator/PerforatorBodySmall.cs b/NPCs/Perforator/PerforatorBodySmall.cs index 363a61700f..b27ce9abfc 100644 --- a/NPCs/Perforator/PerforatorBodySmall.cs +++ b/NPCs/Perforator/PerforatorBodySmall.cs @@ -26,7 +26,7 @@ namespace CalamityMod.NPCs.Perforator double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.behindTiles = true; diff --git a/NPCs/Perforator/PerforatorCyst.cs b/NPCs/Perforator/PerforatorCyst.cs index 9a5437dee6..d06884246f 100644 --- a/NPCs/Perforator/PerforatorCyst.cs +++ b/NPCs/Perforator/PerforatorCyst.cs @@ -19,7 +19,7 @@ namespace CalamityMod.NPCs.Perforator { NPC.npcSlots = 0.1f; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.damage = 0; NPC.width = 30; //324 NPC.height = 26; //216 diff --git a/NPCs/Perforator/PerforatorHeadLarge.cs b/NPCs/Perforator/PerforatorHeadLarge.cs index 88b3db29ad..62986985bb 100644 --- a/NPCs/Perforator/PerforatorHeadLarge.cs +++ b/NPCs/Perforator/PerforatorHeadLarge.cs @@ -35,7 +35,7 @@ namespace CalamityMod.NPCs.Perforator double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.behindTiles = true; diff --git a/NPCs/Perforator/PerforatorHeadMedium.cs b/NPCs/Perforator/PerforatorHeadMedium.cs index 4ff77daaf0..676543ccd0 100644 --- a/NPCs/Perforator/PerforatorHeadMedium.cs +++ b/NPCs/Perforator/PerforatorHeadMedium.cs @@ -31,7 +31,7 @@ namespace CalamityMod.NPCs.Perforator double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.behindTiles = true; diff --git a/NPCs/Perforator/PerforatorHeadSmall.cs b/NPCs/Perforator/PerforatorHeadSmall.cs index 6eb6c4ca32..844f414823 100644 --- a/NPCs/Perforator/PerforatorHeadSmall.cs +++ b/NPCs/Perforator/PerforatorHeadSmall.cs @@ -35,7 +35,7 @@ namespace CalamityMod.NPCs.Perforator double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.behindTiles = true; diff --git a/NPCs/Perforator/PerforatorHive.cs b/NPCs/Perforator/PerforatorHive.cs index f74af00074..4b5c96651b 100644 --- a/NPCs/Perforator/PerforatorHive.cs +++ b/NPCs/Perforator/PerforatorHive.cs @@ -52,7 +52,7 @@ namespace CalamityMod.NPCs.Perforator double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.value = Item.buyPrice(0, 15, 0, 0); NPC.boss = true; diff --git a/NPCs/Perforator/PerforatorTailLarge.cs b/NPCs/Perforator/PerforatorTailLarge.cs index 277a118e79..33cf7576ff 100644 --- a/NPCs/Perforator/PerforatorTailLarge.cs +++ b/NPCs/Perforator/PerforatorTailLarge.cs @@ -26,7 +26,7 @@ namespace CalamityMod.NPCs.Perforator double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.behindTiles = true; diff --git a/NPCs/Perforator/PerforatorTailMedium.cs b/NPCs/Perforator/PerforatorTailMedium.cs index 5d20bfc1b5..b452ee03f9 100644 --- a/NPCs/Perforator/PerforatorTailMedium.cs +++ b/NPCs/Perforator/PerforatorTailMedium.cs @@ -28,7 +28,7 @@ namespace CalamityMod.NPCs.Perforator double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.behindTiles = true; diff --git a/NPCs/Perforator/PerforatorTailSmall.cs b/NPCs/Perforator/PerforatorTailSmall.cs index 69625ea1ae..3e0fccfb59 100644 --- a/NPCs/Perforator/PerforatorTailSmall.cs +++ b/NPCs/Perforator/PerforatorTailSmall.cs @@ -26,7 +26,7 @@ namespace CalamityMod.NPCs.Perforator double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.behindTiles = true; diff --git a/NPCs/PlagueEnemies/PlagueBee.cs b/NPCs/PlagueEnemies/PlagueBee.cs index eb4b2e2d79..f63b82f64f 100644 --- a/NPCs/PlagueEnemies/PlagueBee.cs +++ b/NPCs/PlagueEnemies/PlagueBee.cs @@ -29,15 +29,15 @@ namespace CalamityMod.NPCs.PlagueEnemies NPC.scale = 0.5f; NPC.lifeMax = 200; NPC.aiStyle = 5; - aiType = NPCID.Bee; + AIType = NPCID.Bee; NPC.knockBackResist = 0f; animationType = NPCID.Bee; NPC.value = Item.buyPrice(0, 0, 5, 0); NPC.HitSound = SoundID.NPCHit4; NPC.noGravity = true; NPC.noTileCollide = false; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } diff --git a/NPCs/PlagueEnemies/PlagueBeeLarge.cs b/NPCs/PlagueEnemies/PlagueBeeLarge.cs index 27a6ac4a52..8fe0b8ed01 100644 --- a/NPCs/PlagueEnemies/PlagueBeeLarge.cs +++ b/NPCs/PlagueEnemies/PlagueBeeLarge.cs @@ -29,15 +29,15 @@ namespace CalamityMod.NPCs.PlagueEnemies NPC.scale = 0.75f; NPC.lifeMax = 300; NPC.aiStyle = 5; - aiType = NPCID.Bee; + AIType = NPCID.Bee; NPC.knockBackResist = 0f; animationType = NPCID.Bee; NPC.value = Item.buyPrice(0, 0, 10, 0); NPC.HitSound = SoundID.NPCHit4; NPC.noGravity = true; NPC.noTileCollide = false; - banner = ModContent.NPCType(); - bannerItem = ModContent.ItemType(); + Banner = ModContent.NPCType(); + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } diff --git a/NPCs/PlagueEnemies/PlaguebringerShade.cs b/NPCs/PlagueEnemies/PlaguebringerShade.cs index 11909e42c5..b5f5ab15c0 100644 --- a/NPCs/PlagueEnemies/PlaguebringerShade.cs +++ b/NPCs/PlagueEnemies/PlaguebringerShade.cs @@ -38,14 +38,14 @@ namespace CalamityMod.NPCs.PlagueEnemies NPC.value = Item.buyPrice(0, 1, 50, 0); NPC.knockBackResist = 0f; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; animationType = NPCID.QueenBee; NPC.noGravity = true; NPC.noTileCollide = true; NPC.HitSound = SoundID.NPCHit4; NPC.DeathSound = SoundID.NPCDeath14; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } diff --git a/NPCs/PlagueEnemies/PlaguedDerpling.cs b/NPCs/PlagueEnemies/PlaguedDerpling.cs index 50403b8de4..4d40fab275 100644 --- a/NPCs/PlagueEnemies/PlaguedDerpling.cs +++ b/NPCs/PlagueEnemies/PlaguedDerpling.cs @@ -24,7 +24,7 @@ namespace CalamityMod.NPCs.PlagueEnemies { NPC.noGravity = true; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.damage = 60; NPC.width = 58; NPC.height = 44; @@ -33,8 +33,8 @@ namespace CalamityMod.NPCs.PlagueEnemies NPC.knockBackResist = 0f; NPC.value = Item.buyPrice(0, 0, 10, 0); NPC.HitSound = SoundID.NPCHit22; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = false; diff --git a/NPCs/PlagueEnemies/PlaguedFlyingFox.cs b/NPCs/PlagueEnemies/PlaguedFlyingFox.cs index 89d76d7e09..ddb674e852 100644 --- a/NPCs/PlagueEnemies/PlaguedFlyingFox.cs +++ b/NPCs/PlagueEnemies/PlaguedFlyingFox.cs @@ -21,7 +21,7 @@ namespace CalamityMod.NPCs.PlagueEnemies { NPC.npcSlots = 0.5f; NPC.aiStyle = 14; - aiType = NPCID.GiantFlyingFox; + AIType = NPCID.GiantFlyingFox; animationType = NPCID.GiantFlyingFox; NPC.damage = 55; NPC.width = 38; @@ -31,8 +31,8 @@ namespace CalamityMod.NPCs.PlagueEnemies NPC.knockBackResist = 0f; NPC.value = Item.buyPrice(0, 0, 10, 0); NPC.HitSound = SoundID.NPCHit1; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = false; diff --git a/NPCs/PlagueEnemies/PlaguedJungleSlime.cs b/NPCs/PlagueEnemies/PlaguedJungleSlime.cs index 794cb5cdca..29362443c8 100644 --- a/NPCs/PlagueEnemies/PlaguedJungleSlime.cs +++ b/NPCs/PlagueEnemies/PlaguedJungleSlime.cs @@ -38,8 +38,8 @@ namespace CalamityMod.NPCs.PlagueEnemies NPC.noGravity = false; NPC.noTileCollide = false; NPC.HitSound = SoundID.NPCHit1; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; } diff --git a/NPCs/PlagueEnemies/PlaguedTortoise.cs b/NPCs/PlagueEnemies/PlaguedTortoise.cs index 738adc1a31..0991646389 100644 --- a/NPCs/PlagueEnemies/PlaguedTortoise.cs +++ b/NPCs/PlagueEnemies/PlaguedTortoise.cs @@ -31,8 +31,8 @@ namespace CalamityMod.NPCs.PlagueEnemies NPC.value = Item.buyPrice(0, 0, 20, 0); NPC.HitSound = SoundID.NPCHit24; NPC.noGravity = false; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = false; diff --git a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs index 261430eb9d..8812668a24 100644 --- a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs +++ b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs @@ -30,7 +30,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath NPC.defense = 20; NPC.lifeMax = BossRushEvent.BossRushActive ? 5000 : 500; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.HitSound = SoundID.NPCHit4; NPC.DeathSound = SoundID.NPCDeath14; diff --git a/NPCs/PlaguebringerGoliath/PlagueMine.cs b/NPCs/PlaguebringerGoliath/PlagueMine.cs index d7212c968c..dd3e2e8bff 100644 --- a/NPCs/PlaguebringerGoliath/PlagueMine.cs +++ b/NPCs/PlaguebringerGoliath/PlagueMine.cs @@ -28,7 +28,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath NPC.defense = 20; NPC.lifeMax = BossRushEvent.BossRushActive ? 10000 : 1000; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.noGravity = true; NPC.noTileCollide = true; diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index d7b02fb755..3b4800fde0 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Events; @@ -63,7 +63,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.knockBackResist = 0f; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.boss = true; NPC.value = Item.buyPrice(0, 75, 0, 0); NPC.noGravity = true; diff --git a/NPCs/Polterghast/PhantomFuckYou.cs b/NPCs/Polterghast/PhantomFuckYou.cs index b06a34cd1d..ecd6c5148a 100644 --- a/NPCs/Polterghast/PhantomFuckYou.cs +++ b/NPCs/Polterghast/PhantomFuckYou.cs @@ -24,7 +24,7 @@ namespace CalamityMod.NPCs.Polterghast public override void SetDefaults() { NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.width = 30; NPC.height = 30; NPC.defense = 45; diff --git a/NPCs/Polterghast/PolterPhantom.cs b/NPCs/Polterghast/PolterPhantom.cs index 30f44dd8bc..0f9de61f5d 100644 --- a/NPCs/Polterghast/PolterPhantom.cs +++ b/NPCs/Polterghast/PolterPhantom.cs @@ -38,7 +38,7 @@ namespace CalamityMod.NPCs.Polterghast NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.knockBackResist = 0f; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.Opacity = 0f; NPC.noGravity = true; NPC.noTileCollide = true; diff --git a/NPCs/Polterghast/Polterghast.cs b/NPCs/Polterghast/Polterghast.cs index b798bc22a9..285ccd8b3a 100644 --- a/NPCs/Polterghast/Polterghast.cs +++ b/NPCs/Polterghast/Polterghast.cs @@ -67,7 +67,7 @@ namespace CalamityMod.NPCs.Polterghast NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.knockBackResist = 0f; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(3, 50, 0, 0); NPC.boss = true; NPC.noGravity = true; diff --git a/NPCs/Polterghast/PolterghastHook.cs b/NPCs/Polterghast/PolterghastHook.cs index 234d9b33be..6107ca4277 100644 --- a/NPCs/Polterghast/PolterghastHook.cs +++ b/NPCs/Polterghast/PolterghastHook.cs @@ -25,7 +25,7 @@ namespace CalamityMod.NPCs.Polterghast public override void SetDefaults() { NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.damage = 0; NPC.width = 40; NPC.height = 40; diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs b/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs index 35c054f671..5319dbc052 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs @@ -50,7 +50,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians NPC.knockBackResist = 0f; NPC.noGravity = true; NPC.noTileCollide = true; - aiType = -1; + AIType = -1; NPC.boss = true; music = CalamityMod.Instance.GetMusicFromMusicMod("Guardians") ?? MusicID.Boss1; NPC.value = Item.buyPrice(1, 0, 0, 0); diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianBoss2.cs b/NPCs/ProfanedGuardians/ProfanedGuardianBoss2.cs index cd138fcb5e..787fe3db81 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianBoss2.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianBoss2.cs @@ -45,7 +45,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians NPC.noGravity = true; NPC.noTileCollide = true; NPC.canGhostHeal = false; - aiType = -1; + AIType = -1; NPC.HitSound = SoundID.NPCHit52; NPC.DeathSound = SoundID.NPCDeath55; NPC.Calamity().VulnerableToHeat = false; diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianBoss3.cs b/NPCs/ProfanedGuardians/ProfanedGuardianBoss3.cs index 09b060d3e7..bd3e78d70a 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianBoss3.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianBoss3.cs @@ -41,7 +41,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians NPC.noGravity = true; NPC.noTileCollide = true; NPC.canGhostHeal = false; - aiType = -1; + AIType = -1; NPC.HitSound = SoundID.NPCHit52; NPC.DeathSound = SoundID.NPCDeath55; NPC.Calamity().VulnerableToHeat = false; diff --git a/NPCs/Providence/ProvSpawnDefense.cs b/NPCs/Providence/ProvSpawnDefense.cs index 99d0d6f22e..786d623053 100644 --- a/NPCs/Providence/ProvSpawnDefense.cs +++ b/NPCs/Providence/ProvSpawnDefense.cs @@ -42,7 +42,7 @@ namespace CalamityMod.NPCs.Providence NPC.knockBackResist = 0f; NPC.noGravity = true; NPC.noTileCollide = true; - aiType = -1; + AIType = -1; NPC.HitSound = SoundID.NPCHit52; NPC.DeathSound = SoundID.NPCDeath55; NPC.Calamity().VulnerableToHeat = false; diff --git a/NPCs/Providence/ProvSpawnHealer.cs b/NPCs/Providence/ProvSpawnHealer.cs index 7fa768a695..1f23aba61c 100644 --- a/NPCs/Providence/ProvSpawnHealer.cs +++ b/NPCs/Providence/ProvSpawnHealer.cs @@ -41,7 +41,7 @@ namespace CalamityMod.NPCs.Providence NPC.knockBackResist = 0f; NPC.noGravity = true; NPC.noTileCollide = true; - aiType = -1; + AIType = -1; NPC.HitSound = SoundID.NPCHit52; NPC.DeathSound = SoundID.NPCDeath55; NPC.Calamity().VulnerableToHeat = false; diff --git a/NPCs/Providence/ProvSpawnOffense.cs b/NPCs/Providence/ProvSpawnOffense.cs index 38daf8ba81..49c0632c66 100644 --- a/NPCs/Providence/ProvSpawnOffense.cs +++ b/NPCs/Providence/ProvSpawnOffense.cs @@ -42,7 +42,7 @@ namespace CalamityMod.NPCs.Providence NPC.knockBackResist = 0f; NPC.noGravity = true; NPC.noTileCollide = true; - aiType = -1; + AIType = -1; NPC.HitSound = SoundID.NPCHit52; NPC.DeathSound = SoundID.NPCDeath55; NPC.Calamity().VulnerableToHeat = false; diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 7c0799d950..7e63246f11 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -96,7 +96,7 @@ namespace CalamityMod.NPCs.Providence NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.knockBackResist = 0f; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(3, 0, 0, 0); NPC.boss = true; NPC.Opacity = 0f; diff --git a/NPCs/Ravager/FlamePillar.cs b/NPCs/Ravager/FlamePillar.cs index 5618507b25..ccbd5791fc 100644 --- a/NPCs/Ravager/FlamePillar.cs +++ b/NPCs/Ravager/FlamePillar.cs @@ -29,7 +29,7 @@ namespace CalamityMod.NPCs.Ravager NPC.lifeMax = CalamityWorld.downedProvidence ? 14000 : 3500; NPC.alpha = 255; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.HitSound = SoundID.NPCHit41; NPC.DeathSound = SoundID.NPCDeath14; diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index 6c10ea1218..21e482e5ce 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -57,7 +57,7 @@ namespace CalamityMod.NPCs.Ravager double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.knockBackResist = 0f; - aiType = -1; + AIType = -1; NPC.boss = true; NPC.netAlways = true; NPC.alpha = 255; diff --git a/NPCs/Ravager/RavagerClawLeft.cs b/NPCs/Ravager/RavagerClawLeft.cs index 64ec322860..e83046dfec 100644 --- a/NPCs/Ravager/RavagerClawLeft.cs +++ b/NPCs/Ravager/RavagerClawLeft.cs @@ -29,7 +29,7 @@ namespace CalamityMod.NPCs.Ravager NPC.DR_NERD(0.15f); NPC.lifeMax = 12788; NPC.knockBackResist = 0f; - aiType = -1; + AIType = -1; NPC.noGravity = true; NPC.canGhostHeal = false; NPC.alpha = 255; diff --git a/NPCs/Ravager/RavagerClawRight.cs b/NPCs/Ravager/RavagerClawRight.cs index 61b0430380..fb43e2842a 100644 --- a/NPCs/Ravager/RavagerClawRight.cs +++ b/NPCs/Ravager/RavagerClawRight.cs @@ -29,7 +29,7 @@ namespace CalamityMod.NPCs.Ravager NPC.DR_NERD(0.15f); NPC.lifeMax = 12788; NPC.knockBackResist = 0f; - aiType = -1; + AIType = -1; NPC.netAlways = true; NPC.noGravity = true; NPC.canGhostHeal = false; diff --git a/NPCs/Ravager/RavagerHead.cs b/NPCs/Ravager/RavagerHead.cs index 94ee0c5cf4..4a6d939298 100644 --- a/NPCs/Ravager/RavagerHead.cs +++ b/NPCs/Ravager/RavagerHead.cs @@ -26,7 +26,7 @@ namespace CalamityMod.NPCs.Ravager NPC.DR_NERD(0.15f); NPC.lifeMax = 19182; NPC.knockBackResist = 0f; - aiType = -1; + AIType = -1; NPC.netAlways = true; NPC.noGravity = true; NPC.canGhostHeal = false; diff --git a/NPCs/Ravager/RavagerHead2.cs b/NPCs/Ravager/RavagerHead2.cs index b078ed722d..9bedb1d648 100644 --- a/NPCs/Ravager/RavagerHead2.cs +++ b/NPCs/Ravager/RavagerHead2.cs @@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.Ravager NPC.DR_NERD(0.15f); NPC.lifeMax = 9591; NPC.knockBackResist = 0f; - aiType = -1; + AIType = -1; NPC.netAlways = true; NPC.noGravity = true; NPC.canGhostHeal = false; diff --git a/NPCs/Ravager/RavagerLegLeft.cs b/NPCs/Ravager/RavagerLegLeft.cs index 4c4ff9a1d6..103194d4c8 100644 --- a/NPCs/Ravager/RavagerLegLeft.cs +++ b/NPCs/Ravager/RavagerLegLeft.cs @@ -24,7 +24,7 @@ namespace CalamityMod.NPCs.Ravager NPC.DR_NERD(0.15f); NPC.lifeMax = 12788; NPC.knockBackResist = 0f; - aiType = -1; + AIType = -1; NPC.netAlways = true; NPC.noGravity = true; NPC.canGhostHeal = false; diff --git a/NPCs/Ravager/RavagerLegRight.cs b/NPCs/Ravager/RavagerLegRight.cs index 0172efcb66..45e2d4882b 100644 --- a/NPCs/Ravager/RavagerLegRight.cs +++ b/NPCs/Ravager/RavagerLegRight.cs @@ -24,7 +24,7 @@ namespace CalamityMod.NPCs.Ravager NPC.DR_NERD(0.15f); NPC.lifeMax = 12788; NPC.knockBackResist = 0f; - aiType = -1; + AIType = -1; NPC.netAlways = true; NPC.noGravity = true; NPC.canGhostHeal = false; diff --git a/NPCs/Ravager/RockPillar.cs b/NPCs/Ravager/RockPillar.cs index e792b1c754..086e692be4 100644 --- a/NPCs/Ravager/RockPillar.cs +++ b/NPCs/Ravager/RockPillar.cs @@ -29,7 +29,7 @@ namespace CalamityMod.NPCs.Ravager NPC.lifeMax = CalamityWorld.downedProvidence ? 20000 : 5000; NPC.alpha = 255; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.HitSound = SoundID.NPCHit41; NPC.DeathSound = SoundID.NPCDeath14; diff --git a/NPCs/Signus/CosmicLantern.cs b/NPCs/Signus/CosmicLantern.cs index c6dfafec4c..c2d97e5558 100644 --- a/NPCs/Signus/CosmicLantern.cs +++ b/NPCs/Signus/CosmicLantern.cs @@ -20,7 +20,7 @@ namespace CalamityMod.NPCs.Signus public override void SetDefaults() { NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.GetNPCDamage(); NPC.width = 25; NPC.height = 25; diff --git a/NPCs/Signus/Signus.cs b/NPCs/Signus/Signus.cs index 4792b1a0f7..8aff8859f7 100644 --- a/NPCs/Signus/Signus.cs +++ b/NPCs/Signus/Signus.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Events; using CalamityMod.Items.Accessories; @@ -62,7 +62,7 @@ namespace CalamityMod.NPCs.Signus NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.knockBackResist = 0f; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.boss = true; NPC.noGravity = true; NPC.noTileCollide = true; diff --git a/NPCs/Signus/SignusBomb.cs b/NPCs/Signus/SignusBomb.cs index 77c8367887..d09ac61eb8 100644 --- a/NPCs/Signus/SignusBomb.cs +++ b/NPCs/Signus/SignusBomb.cs @@ -28,7 +28,7 @@ namespace CalamityMod.NPCs.Signus NPC.height = 30; NPC.lifeMax = 4800; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.noGravity = true; NPC.noTileCollide = true; diff --git a/NPCs/SlimeGod/SlimeGod.cs b/NPCs/SlimeGod/SlimeGod.cs index 567ab9ed87..d080acfa2c 100644 --- a/NPCs/SlimeGod/SlimeGod.cs +++ b/NPCs/SlimeGod/SlimeGod.cs @@ -35,7 +35,7 @@ namespace CalamityMod.NPCs.SlimeGod double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; animationType = NPCID.KingSlime; NPC.value = 0f; diff --git a/NPCs/SlimeGod/SlimeGodCore.cs b/NPCs/SlimeGod/SlimeGodCore.cs index f811688b50..d6c7919e62 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -48,7 +48,7 @@ namespace CalamityMod.NPCs.SlimeGod NPCID.Sets.TrailCacheLength[NPC.type] = 8; NPCID.Sets.TrailingMode[NPC.type] = 1; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.value = Item.buyPrice(0, 25, 0, 0); NPC.Opacity = 0.8f; diff --git a/NPCs/SlimeGod/SlimeGodRun.cs b/NPCs/SlimeGod/SlimeGodRun.cs index 0442928ff6..536c0e64a5 100644 --- a/NPCs/SlimeGod/SlimeGodRun.cs +++ b/NPCs/SlimeGod/SlimeGodRun.cs @@ -45,7 +45,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.DeathSound = SoundID.NPCDeath1; music = CalamityMod.Instance.GetMusicFromMusicMod("SlimeGod") ?? MusicID.Boss1; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; bossBag = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; diff --git a/NPCs/SlimeGod/SlimeGodRunSplit.cs b/NPCs/SlimeGod/SlimeGodRunSplit.cs index 624e48fe32..508fa4f4a6 100644 --- a/NPCs/SlimeGod/SlimeGodRunSplit.cs +++ b/NPCs/SlimeGod/SlimeGodRunSplit.cs @@ -44,7 +44,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.DeathSound = SoundID.NPCDeath1; music = CalamityMod.Instance.GetMusicFromMusicMod("SlimeGod") ?? MusicID.Boss1; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; bossBag = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; diff --git a/NPCs/SlimeGod/SlimeGodSplit.cs b/NPCs/SlimeGod/SlimeGodSplit.cs index db7e0a0073..bd8774cf45 100644 --- a/NPCs/SlimeGod/SlimeGodSplit.cs +++ b/NPCs/SlimeGod/SlimeGodSplit.cs @@ -34,7 +34,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.scale = 0.8f; NPC.defense = 8; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; animationType = NPCID.KingSlime; NPC.value = Item.buyPrice(0, 1, 0, 0); diff --git a/NPCs/StormWeaver/StormWeaverBody.cs b/NPCs/StormWeaver/StormWeaverBody.cs index 47d4e2e5ed..9b70710b90 100644 --- a/NPCs/StormWeaver/StormWeaverBody.cs +++ b/NPCs/StormWeaver/StormWeaverBody.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using CalamityMod.Events; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -49,7 +49,7 @@ namespace CalamityMod.NPCs.StormWeaver double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.behindTiles = true; diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index 63017884a2..4f3da0fb02 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using CalamityMod.Events; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; @@ -87,7 +87,7 @@ namespace CalamityMod.NPCs.StormWeaver double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.boss = true; NPC.alpha = 255; diff --git a/NPCs/StormWeaver/StormWeaverTail.cs b/NPCs/StormWeaver/StormWeaverTail.cs index ee2f75f275..ed7e59580e 100644 --- a/NPCs/StormWeaver/StormWeaverTail.cs +++ b/NPCs/StormWeaver/StormWeaverTail.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using CalamityMod.Events; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -47,7 +47,7 @@ namespace CalamityMod.NPCs.StormWeaver double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.behindTiles = true; diff --git a/NPCs/SulphurousSea/AnthozoanCrab.cs b/NPCs/SulphurousSea/AnthozoanCrab.cs index 33ec6334d8..f55cd96c5b 100644 --- a/NPCs/SulphurousSea/AnthozoanCrab.cs +++ b/NPCs/SulphurousSea/AnthozoanCrab.cs @@ -30,13 +30,13 @@ namespace CalamityMod.NPCs.SulphurousSea NPC.height = 42; NPC.defense = 22; NPC.lifeMax = 920; - NPC.aiStyle = aiType = -1; + NPC.aiStyle = AIType = -1; NPC.value = Item.buyPrice(0, 0, 1, 0); NPC.HitSound = SoundID.NPCHit38; NPC.DeathSound = SoundID.NPCDeath46; NPC.knockBackResist = 0.04f; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/SulphurousSea/BelchingCoral.cs b/NPCs/SulphurousSea/BelchingCoral.cs index 33cd8bfb5c..845faaee51 100644 --- a/NPCs/SulphurousSea/BelchingCoral.cs +++ b/NPCs/SulphurousSea/BelchingCoral.cs @@ -29,13 +29,13 @@ namespace CalamityMod.NPCs.SulphurousSea NPC.height = 42; NPC.defense = 25; NPC.lifeMax = 1000; - NPC.aiStyle = aiType = -1; + NPC.aiStyle = AIType = -1; NPC.value = Item.buyPrice(0, 0, 3, 50); NPC.HitSound = SoundID.NPCHit42; NPC.DeathSound = SoundID.NPCDeath5; NPC.knockBackResist = 0f; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/SulphurousSea/Catfish.cs b/NPCs/SulphurousSea/Catfish.cs index befa626ec5..cff4b797ae 100644 --- a/NPCs/SulphurousSea/Catfish.cs +++ b/NPCs/SulphurousSea/Catfish.cs @@ -24,13 +24,13 @@ namespace CalamityMod.NPCs.SulphurousSea NPC.defense = 12; NPC.lifeMax = 120; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 0, 1, 0); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath40; NPC.knockBackResist = 0.8f; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.chaseable = false; NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; diff --git a/NPCs/SulphurousSea/Flounder.cs b/NPCs/SulphurousSea/Flounder.cs index f9e9f08290..f15485f092 100644 --- a/NPCs/SulphurousSea/Flounder.cs +++ b/NPCs/SulphurousSea/Flounder.cs @@ -24,13 +24,13 @@ namespace CalamityMod.NPCs.SulphurousSea NPC.defense = 15; NPC.lifeMax = 40; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 0, 0, 80); NPC.HitSound = SoundID.NPCHit50; NPC.DeathSound = SoundID.NPCDeath53; NPC.knockBackResist = 0.35f; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.chaseable = false; NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; diff --git a/NPCs/SulphurousSea/Gnasher.cs b/NPCs/SulphurousSea/Gnasher.cs index 514cf7544e..7904b68226 100644 --- a/NPCs/SulphurousSea/Gnasher.cs +++ b/NPCs/SulphurousSea/Gnasher.cs @@ -26,12 +26,12 @@ namespace CalamityMod.NPCs.SulphurousSea NPC.lifeMax = 35; NPC.knockBackResist = 0.25f; NPC.aiStyle = 3; - aiType = 67; + AIType = 67; NPC.value = Item.buyPrice(0, 0, 0, 60); NPC.HitSound = SoundID.NPCHit50; NPC.DeathSound = SoundID.NPCDeath54; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/SulphurousSea/MicrobialCluster.cs b/NPCs/SulphurousSea/MicrobialCluster.cs index 7d12f48fd6..4504bffd03 100644 --- a/NPCs/SulphurousSea/MicrobialCluster.cs +++ b/NPCs/SulphurousSea/MicrobialCluster.cs @@ -22,7 +22,7 @@ namespace CalamityMod.NPCs.SulphurousSea NPC.width = 24; NPC.height = 24; NPC.lifeMax = 5; - NPC.aiStyle = aiType = -1; + NPC.aiStyle = AIType = -1; NPC.noTileCollide = false; NPC.noGravity = true; NPC.HitSound = SoundID.NPCHit1; diff --git a/NPCs/SulphurousSea/Trasher.cs b/NPCs/SulphurousSea/Trasher.cs index a933316e9d..a68d39ba68 100644 --- a/NPCs/SulphurousSea/Trasher.cs +++ b/NPCs/SulphurousSea/Trasher.cs @@ -31,13 +31,13 @@ namespace CalamityMod.NPCs.SulphurousSea NPC.defense = 22; NPC.lifeMax = 200; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 0, 3, 0); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath5; NPC.knockBackResist = 0f; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/SunkenSea/BlindedAngler.cs b/NPCs/SunkenSea/BlindedAngler.cs index 08180f1077..6d3f2140f3 100644 --- a/NPCs/SunkenSea/BlindedAngler.cs +++ b/NPCs/SunkenSea/BlindedAngler.cs @@ -27,13 +27,13 @@ namespace CalamityMod.NPCs.SunkenSea NPC.DR_NERD(0.2f); NPC.lifeMax = 750; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.value = Item.buyPrice(0, 0, 40, 0); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0.1f; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.chaseable = false; NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; diff --git a/NPCs/SunkenSea/Clam.cs b/NPCs/SunkenSea/Clam.cs index 9e2f2f9ce3..a79c2ab201 100644 --- a/NPCs/SunkenSea/Clam.cs +++ b/NPCs/SunkenSea/Clam.cs @@ -32,12 +32,12 @@ namespace CalamityMod.NPCs.SunkenSea NPC.lifeMax *= 2; } NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.value = Main.hardMode ? Item.buyPrice(0, 0, 10, 0) : Item.buyPrice(0, 0, 1, 0); NPC.HitSound = SoundID.NPCHit4; NPC.knockBackResist = 0.05f; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/SunkenSea/EutrophicRay.cs b/NPCs/SunkenSea/EutrophicRay.cs index cdb838f438..5a29b76d1b 100644 --- a/NPCs/SunkenSea/EutrophicRay.cs +++ b/NPCs/SunkenSea/EutrophicRay.cs @@ -28,13 +28,13 @@ namespace CalamityMod.NPCs.SunkenSea NPC.DR_NERD(0.05f); NPC.lifeMax = Main.hardMode ? 500 : 150; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.value = Main.hardMode ? Item.buyPrice(0, 0, 50, 0) : Item.buyPrice(0, 0, 5, 0); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath55; NPC.knockBackResist = 0f; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/SunkenSea/GhostBell.cs b/NPCs/SunkenSea/GhostBell.cs index fc78ac1045..55d9bbe824 100644 --- a/NPCs/SunkenSea/GhostBell.cs +++ b/NPCs/SunkenSea/GhostBell.cs @@ -24,7 +24,7 @@ namespace CalamityMod.NPCs.SunkenSea { NPC.noGravity = true; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.damage = Main.hardMode ? 75 : 25; NPC.width = 54; NPC.height = 76; @@ -35,8 +35,8 @@ namespace CalamityMod.NPCs.SunkenSea NPC.value = Main.hardMode ? Item.buyPrice(0, 0, 20, 0) : Item.buyPrice(0, 0, 2, 0); NPC.HitSound = SoundID.NPCHit25; NPC.DeathSound = SoundID.NPCDeath28; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = false; diff --git a/NPCs/SunkenSea/GhostBellSmall.cs b/NPCs/SunkenSea/GhostBellSmall.cs index da6cd4cad8..2cc165db19 100644 --- a/NPCs/SunkenSea/GhostBellSmall.cs +++ b/NPCs/SunkenSea/GhostBellSmall.cs @@ -26,7 +26,7 @@ namespace CalamityMod.NPCs.SunkenSea NPC.noGravity = true; NPC.chaseable = false; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.damage = 0; NPC.width = 28; NPC.height = 36; @@ -36,8 +36,8 @@ namespace CalamityMod.NPCs.SunkenSea NPC.alpha = 100; NPC.HitSound = SoundID.NPCHit25; NPC.DeathSound = SoundID.NPCDeath28; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.catchItem = (short)ModContent.ItemType(); } diff --git a/NPCs/SunkenSea/GiantClam.cs b/NPCs/SunkenSea/GiantClam.cs index e0a1ce1f2a..9df418ff78 100644 --- a/NPCs/SunkenSea/GiantClam.cs +++ b/NPCs/SunkenSea/GiantClam.cs @@ -48,13 +48,13 @@ namespace CalamityMod.NPCs.SunkenSea NPC.DR_NERD(0.3f); NPC.lifeMax = Main.hardMode ? 7500 : 1250; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.value = Main.hardMode ? Item.buyPrice(0, 8, 0, 0) : Item.buyPrice(0, 1, 0, 0); NPC.HitSound = SoundID.NPCHit4; NPC.knockBackResist = 0f; NPC.rarity = 2; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/SunkenSea/PrismTurtle.cs b/NPCs/SunkenSea/PrismTurtle.cs index 69a470086d..a473b3c44f 100644 --- a/NPCs/SunkenSea/PrismTurtle.cs +++ b/NPCs/SunkenSea/PrismTurtle.cs @@ -27,13 +27,13 @@ namespace CalamityMod.NPCs.SunkenSea NPC.DR_NERD(0.25f); NPC.lifeMax = Main.hardMode ? 1000 : 350; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.value = Main.hardMode ? Item.buyPrice(0, 0, 50, 0) : Item.buyPrice(0, 0, 5, 0); NPC.HitSound = SoundID.NPCHit24; NPC.DeathSound = SoundID.NPCDeath27; NPC.knockBackResist = 0.15f; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.chaseable = false; NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; diff --git a/NPCs/SunkenSea/SeaFloaty.cs b/NPCs/SunkenSea/SeaFloaty.cs index 34ab338131..5f1a02caba 100644 --- a/NPCs/SunkenSea/SeaFloaty.cs +++ b/NPCs/SunkenSea/SeaFloaty.cs @@ -19,7 +19,7 @@ namespace CalamityMod.NPCs.SunkenSea { NPC.npcSlots = 0.5f; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.damage = 5; NPC.width = 72; NPC.height = 22; @@ -29,8 +29,8 @@ namespace CalamityMod.NPCs.SunkenSea NPC.value = Item.buyPrice(0, 0, 0, 50); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); } public override void SendExtraAI(BinaryWriter writer) diff --git a/NPCs/SunkenSea/SeaMinnow.cs b/NPCs/SunkenSea/SeaMinnow.cs index f1b93b7e21..e04915b9f3 100644 --- a/NPCs/SunkenSea/SeaMinnow.cs +++ b/NPCs/SunkenSea/SeaMinnow.cs @@ -25,11 +25,11 @@ namespace CalamityMod.NPCs.SunkenSea NPC.defense = 0; NPC.lifeMax = 5; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.chaseable = false; NPC.catchItem = (short)ModContent.ItemType(); } diff --git a/NPCs/SunkenSea/SeaSerpent1.cs b/NPCs/SunkenSea/SeaSerpent1.cs index 41681ecddd..fa6f5c1329 100644 --- a/NPCs/SunkenSea/SeaSerpent1.cs +++ b/NPCs/SunkenSea/SeaSerpent1.cs @@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.SunkenSea NPC.defense = 10; NPC.lifeMax = 3000; NPC.aiStyle = -1; - aiType = -1; + AIType = -1; NPC.knockBackResist = 0f; NPC.value = Item.buyPrice(0, 0, 20, 0); NPC.behindTiles = true; @@ -36,8 +36,8 @@ namespace CalamityMod.NPCs.SunkenSea NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; NPC.netAlways = true; - banner = NPC.type; - bannerItem = ModContent.ItemType(); + Banner = NPC.type; + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/SunkenSea/SeaSerpent2.cs b/NPCs/SunkenSea/SeaSerpent2.cs index 3e942d0f88..505a9baaa6 100644 --- a/NPCs/SunkenSea/SeaSerpent2.cs +++ b/NPCs/SunkenSea/SeaSerpent2.cs @@ -23,7 +23,7 @@ namespace CalamityMod.NPCs.SunkenSea NPC.defense = 20; NPC.lifeMax = 3000; NPC.aiStyle = -1; //new - aiType = -1; //new + AIType = -1; //new NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.behindTiles = true; @@ -34,8 +34,8 @@ namespace CalamityMod.NPCs.SunkenSea NPC.netAlways = true; NPC.dontCountMe = true; NPC.chaseable = false; - banner = ModContent.NPCType(); - bannerItem = ModContent.ItemType(); + Banner = ModContent.NPCType(); + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/SunkenSea/SeaSerpent3.cs b/NPCs/SunkenSea/SeaSerpent3.cs index 20a2469208..fa8b22907b 100644 --- a/NPCs/SunkenSea/SeaSerpent3.cs +++ b/NPCs/SunkenSea/SeaSerpent3.cs @@ -20,7 +20,7 @@ namespace CalamityMod.NPCs.SunkenSea NPC.defense = 20; NPC.lifeMax = 3000; NPC.aiStyle = -1; //new - aiType = -1; //new + AIType = -1; //new NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.behindTiles = true; @@ -31,8 +31,8 @@ namespace CalamityMod.NPCs.SunkenSea NPC.netAlways = true; NPC.dontCountMe = true; NPC.chaseable = false; - banner = ModContent.NPCType(); - bannerItem = ModContent.ItemType(); + Banner = ModContent.NPCType(); + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/SunkenSea/SeaSerpent4.cs b/NPCs/SunkenSea/SeaSerpent4.cs index 96a9d74410..0cd2e72502 100644 --- a/NPCs/SunkenSea/SeaSerpent4.cs +++ b/NPCs/SunkenSea/SeaSerpent4.cs @@ -20,7 +20,7 @@ namespace CalamityMod.NPCs.SunkenSea NPC.defense = 20; NPC.lifeMax = 3000; NPC.aiStyle = -1; //new - aiType = -1; //new + AIType = -1; //new NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.behindTiles = true; @@ -31,8 +31,8 @@ namespace CalamityMod.NPCs.SunkenSea NPC.netAlways = true; NPC.dontCountMe = true; NPC.chaseable = false; - banner = ModContent.NPCType(); - bannerItem = ModContent.ItemType(); + Banner = ModContent.NPCType(); + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/SunkenSea/SeaSerpent5.cs b/NPCs/SunkenSea/SeaSerpent5.cs index 2eb54b27f2..5a4863cbf7 100644 --- a/NPCs/SunkenSea/SeaSerpent5.cs +++ b/NPCs/SunkenSea/SeaSerpent5.cs @@ -20,7 +20,7 @@ namespace CalamityMod.NPCs.SunkenSea NPC.defense = 30; NPC.lifeMax = 3000; NPC.aiStyle = -1; //new - aiType = -1; //new + AIType = -1; //new NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.behindTiles = true; @@ -31,8 +31,8 @@ namespace CalamityMod.NPCs.SunkenSea NPC.netAlways = true; NPC.dontCountMe = true; NPC.chaseable = false; - banner = ModContent.NPCType(); - bannerItem = ModContent.ItemType(); + Banner = ModContent.NPCType(); + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; diff --git a/Utilities/DrawingUtils.cs b/Utilities/DrawingUtils.cs index ea570af915..e69fa76ff8 100644 --- a/Utilities/DrawingUtils.cs +++ b/Utilities/DrawingUtils.cs @@ -1,11 +1,13 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Graphics; using System; +using System.Collections.Generic; using System.Reflection; using System.Text; using Terraria; using Terraria.DataStructures; +using Terraria.GameContent; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -40,7 +42,7 @@ namespace CalamityMod public static void DrawAfterimagesCentered(Projectile proj, int mode, Color lightColor, int typeOneIncrement = 1, Texture2D texture = null, bool drawCentered = true) { if (texture is null) - texture = Main.projectileTexture[proj.type]; + texture = TextureAssets.Projectile[proj.type].Value; int frameHeight = texture.Height / Main.projFrames[proj.type]; int frameY = frameHeight * proj.frame; @@ -130,7 +132,7 @@ namespace CalamityMod public static void DrawAfterimagesFromEdge(Projectile proj, int mode, Color lightColor, Texture2D texture = null) { if (texture is null) - texture = Main.projectileTexture[proj.type]; + texture = TextureAssets.Projectile[proj.type].Value; int frameHeight = texture.Height / Main.projFrames[proj.type]; int frameY = frameHeight * proj.frame; @@ -252,7 +254,7 @@ namespace CalamityMod start -= Main.screenPosition; end -= Main.screenPosition; - Texture2D line = ModContent.Request("InfernumMode/ExtraTextures/Line"); + Texture2D line = ModContent.Request("InfernumMode/ExtraTextures/Line").Value; float rotation = (end - start).ToRotation(); Vector2 scale = new Vector2(Vector2.Distance(start, end) / line.Width, width); @@ -310,6 +312,7 @@ namespace CalamityMod if (!projectile.bobber || item.holdStyle <= 0) return false; + Texture2D fishingLineTexture = TextureAssets.FishingLine.Value; float originX = player.MountedCenter.X; float originY = player.MountedCenter.Y; originY += player.gfxOffY; @@ -409,7 +412,7 @@ namespace CalamityMod Color lineColor = Lighting.GetColor((int)mountedCenter.X / 16, (int)mountedCenter.Y / 16, poleColor); float rotation = lineOrigin.ToRotation() - MathHelper.PiOver2; - Main.spriteBatch.Draw(Main.fishingLineTexture, new Vector2(mountedCenter.X - Main.screenPosition.X + Main.fishingLineTexture.Width * 0.5f, mountedCenter.Y - Main.screenPosition.Y + Main.fishingLineTexture.Height * 0.5f), new Rectangle?(new Rectangle(0, 0, Main.fishingLineTexture.Width, (int)height)), lineColor, rotation, new Vector2(Main.fishingLineTexture.Width * 0.5f, 0f), 1f, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(fishingLineTexture, new Vector2(mountedCenter.X - Main.screenPosition.X + fishingLineTexture.Width * 0.5f, mountedCenter.Y - Main.screenPosition.Y + fishingLineTexture.Height * 0.5f), new Rectangle(0, 0, fishingLineTexture.Width, (int)height), lineColor, rotation, new Vector2(fishingLineTexture.Width * 0.5f, 0f), 1f, SpriteEffects.None, 0f); } return false; } @@ -505,7 +508,7 @@ namespace CalamityMod public static string ColorMessage(string msg, Color color) { StringBuilder sb; - if (!msg.Contains("\n")) + if (!msg.Contains('\n')) { sb = new StringBuilder(msg.Length + 12); sb.Append("[c/").Append(color.Hex3()).Append(':').Append(msg).Append(']'); @@ -575,19 +578,19 @@ namespace CalamityMod public static void EnterShaderRegion(this SpriteBatch spriteBatch, BlendState newBlendState = null) { spriteBatch.End(); - spriteBatch.Begin(SpriteSortMode.Immediate, newBlendState ?? BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.instance.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + spriteBatch.Begin(SpriteSortMode.Immediate, newBlendState ?? BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); } public static void ExitShaderRegion(this SpriteBatch spriteBatch) { spriteBatch.End(); - spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.instance.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); } - public static void DrawAuroras(Player player, float auroraCount, float opacity, Color color) + public static IEnumerable DrawAuroras(Player player, float auroraCount, float opacity, Color color) { float time = Main.GlobalTimeWrappedHourly % 3f / 3f; - Texture2D auroraTexture = ModContent.Request("CalamityMod/ExtraTextures/AuroraTexture"); + Texture2D auroraTexture = ModContent.Request("CalamityMod/ExtraTextures/AuroraTexture").Value; for (int i = 0; i < auroraCount; i++) { float incrementOffsetAngle = MathHelper.TwoPi * i / auroraCount; @@ -595,7 +598,7 @@ namespace CalamityMod float yOffset = (float)Math.Sin(time * MathHelper.TwoPi + incrementOffsetAngle * 2f + MathHelper.ToRadians(60f)) * 6f; float rotation = (float)Math.Sin(incrementOffsetAngle) * MathHelper.Pi / 12f; Vector2 offset = new Vector2(xOffset, yOffset - 14f); - DrawData drawData = new DrawData(auroraTexture, + yield return new DrawData(auroraTexture, player.Top + offset - Main.screenPosition, null, color * opacity, @@ -604,7 +607,6 @@ namespace CalamityMod 0.135f, SpriteEffects.None, 1); - Main.playerDrawData.Add(drawData); } } } diff --git a/Utilities/TileEntityUtils.cs b/Utilities/TileEntityUtils.cs index 5211a51e17..23d93698c1 100644 --- a/Utilities/TileEntityUtils.cs +++ b/Utilities/TileEntityUtils.cs @@ -5,9 +5,9 @@ using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; using Terraria.UI.Chat; -using static Terraria.ModLoader.ModContent; using Terraria.Audio; using Terraria.GameContent; +using static Terraria.ModLoader.ModContent; namespace CalamityMod { @@ -16,7 +16,7 @@ namespace CalamityMod /// /// A hitbox that should approximately represent the tip of the mouse cursor. Used for UI stuff. /// - public static Rectangle MouseHitbox => new Rectangle((int)Main.MouseWorld.X, (int)Main.MouseWorld.Y, 2, 2); + public static Rectangle MouseHitbox => new((int)Main.MouseWorld.X, (int)Main.MouseWorld.Y, 2, 2); /// /// Finds the Calamity tile entity that is associated with the tile at the given world coordinates (i, j).