From f4e9fa4a12e83233bcd22c06bf22a307dd10fc84 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Tue, 5 Apr 2022 20:03:14 -0500 Subject: [PATCH 1/4] Minor tile/old recipe fixes --- CustomRecipes/SchematicRecipe.cs | 36 +++++++++---------- Gores/AstralWaterDroplet.cs | 17 --------- ILEditing/ILChangesLoading.cs | 14 ++++---- ILEditing/MechanicILChanges.cs | 3 +- ILEditing/VanillaBugfixingILChanges.cs | 5 ++- Items/DraedonMisc/EncryptedSchematicHell.cs | 9 ++++- Items/DraedonMisc/EncryptedSchematicIce.cs | 9 ++++- Items/DraedonMisc/EncryptedSchematicJungle.cs | 9 ++++- .../EncryptedSchematicPlanetoid.cs | 9 ++++- .../EncryptedSchematicSunkenSea.cs | 12 +++++-- Localization/CalamityLocalization.cs | 6 ++++ Tiles/Furniture/ChaosCandle.cs | 7 ++-- .../CraftingStations/AncientAltar.cs | 6 ++-- .../Furniture/CraftingStations/AshenAltar.cs | 4 +-- Tiles/Furniture/TranquilityCandle.cs | 7 ++-- Tiles/FurnitureAshen/AshenBasin.cs | 6 ++-- Tiles/UelibloomBrick.cs | 21 ++++++----- 17 files changed, 107 insertions(+), 73 deletions(-) diff --git a/CustomRecipes/SchematicRecipe.cs b/CustomRecipes/SchematicRecipe.cs index 269cc22f16..fde405b6b7 100644 --- a/CustomRecipes/SchematicRecipe.cs +++ b/CustomRecipes/SchematicRecipe.cs @@ -1,33 +1,33 @@ -using CalamityMod.World; -using Terraria.ModLoader; +using System; +using Terraria; +using Terraria.Localization; namespace CalamityMod.CustomRecipes { - public class SchematicRecipe : ModRecipe + public static class SchematicRecipe { - public string SchematicName; - public SchematicRecipe(Mod mod, string schematicName) : base(mod) => SchematicName = schematicName; - - public override bool RecipeAvailable() + // TODO -- Use an enumeration instead of strings in the switch cases. + public static NetworkText ConstructRecipeCondition(string schematicName, out Predicate condition) { - // Allow old worlds to craft the new schematics; They don't exist in old worlds - if (!CalamityWorld.IsWorldAfterDraedonUpdate) - return true; - - switch (SchematicName) + switch (schematicName) { case "Sunken Sea": - return RecipeUnlockHandler.HasFoundSunkenSeaSchematic; + default: + condition = r => RecipeUnlockHandler.HasFoundSunkenSeaSchematic; + return NetworkText.FromKey($"Mods.Calamity.SunkenSeaSchematicRecipeCondition"); case "Planetoid": - return RecipeUnlockHandler.HasFoundPlanetoidSchematic; + condition = r => RecipeUnlockHandler.HasFoundPlanetoidSchematic; + return NetworkText.FromKey($"Mods.Calamity.PlanetoidSchematicRecipeCondition"); case "Jungle": - return RecipeUnlockHandler.HasFoundJungleSchematic; + condition = r => RecipeUnlockHandler.HasFoundJungleSchematic; + return NetworkText.FromKey($"Mods.Calamity.JungleSchematicRecipeCondition"); case "Hell": - return RecipeUnlockHandler.HasFoundHellSchematic; + condition = r => RecipeUnlockHandler.HasFoundHellSchematic; + return NetworkText.FromKey($"Mods.Calamity.UnderworldSchematicRecipeCondition"); case "Ice": - return RecipeUnlockHandler.HasFoundIceSchematic; + condition = r => RecipeUnlockHandler.HasFoundIceSchematic; + return NetworkText.FromKey($"Mods.Calamity.IceSchematicRecipeCondition"); } - return false; } } } diff --git a/Gores/AstralWaterDroplet.cs b/Gores/AstralWaterDroplet.cs index e1b59d3e36..1b59f3055e 100644 --- a/Gores/AstralWaterDroplet.cs +++ b/Gores/AstralWaterDroplet.cs @@ -18,24 +18,7 @@ namespace CalamityMod.Gores gore.behindTiles = true; gore.timeLeft = Gore.goreTime * 3; } - public override bool DrawBehind(Gore gore) - { - Main.instance.LoadGore(gore.type); - int num = Main.goreTexture[gore.type].Height / (int)gore.numFrames; - - Color alpha = gore.GetAlpha(Lighting.GetColor((int)((double)gore.position.X + (double)Main.goreTexture[gore.type].Width * 0.5) / 16, (int)(((double)gore.position.Y + (double)num * 0.5) / 16.0))); - - Main.spriteBatch.Draw( - Main.goreTexture[gore.type], - new Vector2(gore.position.X - Main.screenPosition.X + (float)(Main.goreTexture[gore.type].Width / 2), gore.position.Y - Main.screenPosition.Y + (float)(num / 2) - 2f), - new Rectangle(0, num * (int)gore.frame, Main.goreTexture[gore.type].Width, num), - alpha, gore.rotation, - new Vector2((float)(Main.goreTexture[gore.type].Width / 2), (float)(num / 2)), - gore.scale, SpriteEffects.None, 0f); - - return false; - } public override bool Update(Gore gore) { if ((double)gore.position.Y < Main.worldSurface * 16.0 + 8.0) diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index d276b29fc4..50e0949d28 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -1,4 +1,4 @@ -using CalamityMod.Tiles.DraedonStructures; +using CalamityMod.Tiles.DraedonStructures; using CalamityMod.Tiles.FurnitureExo; using System; using System.Collections.Generic; @@ -42,7 +42,7 @@ namespace CalamityMod.ILEditing On.Terraria.Wiring.Teleport += DisableTeleporters; // only applies in boss rush IL.Terraria.Main.DrawInterface_40_InteractItemIcon += MakeMouseHoverItemsSupportAnimations; On.Terraria.Item.AffixName += IncorporateEnchantmentInAffix; - On.Terraria.Projectile.NewProjectile_float_float_float_float_int_int_float_int_float_float += IncorporateMinionExplodingCountdown; + On.Terraria.Projectile.NewProjectile_IEntitySource_float_float_float_float_int_int_float_int_float_float += IncorporateMinionExplodingCountdown; On.Terraria.Main.DrawCursor += UseCoolFireCursorEffect; IL.Terraria.Player.QuickHeal += ApplyManaBurnIfNeeded; IL.Terraria.Player.QuickMana += ApplyManaBurnIfNeeded; @@ -60,7 +60,7 @@ namespace CalamityMod.ILEditing // Damage and health balance IL.Terraria.Main.DamageVar += AdjustDamageVariance; - IL.Terraria.NPC.scaleStats += RemoveExpertHardmodeScaling; + IL.Terraria.NPC.ScaleStats += RemoveExpertHardmodeScaling; IL.Terraria.Projectile.AI_001 += AdjustChlorophyteBullets; // Movement speed balance @@ -91,7 +91,7 @@ namespace CalamityMod.ILEditing IL.Terraria.Main.UpdateTime += BloodMoonsRequire200MaxLife; // Fix vanilla bugs exposed by Calamity mechanics - On.Terraria.Main.InitLifeBytes += BossRushLifeBytes; + // On.Terraria.Main.InitLifeBytes += BossRushLifeBytes; IL.Terraria.NPC.NPCLoot += FixSplittingWormBannerDrops; // IL.Terraria.Main.DoUpdate += FixProjectileUpdatePriorityProblems; } @@ -116,7 +116,7 @@ namespace CalamityMod.ILEditing On.Terraria.Wiring.Teleport -= DisableTeleporters; IL.Terraria.Main.DrawInterface_40_InteractItemIcon -= MakeMouseHoverItemsSupportAnimations; On.Terraria.Item.AffixName -= IncorporateEnchantmentInAffix; - On.Terraria.Projectile.NewProjectile_float_float_float_float_int_int_float_int_float_float -= IncorporateMinionExplodingCountdown; + On.Terraria.Projectile.NewProjectile_IEntitySource_float_float_float_float_int_int_float_int_float_float -= IncorporateMinionExplodingCountdown; On.Terraria.Main.DrawCursor -= UseCoolFireCursorEffect; IL.Terraria.Player.QuickHeal -= ApplyManaBurnIfNeeded; IL.Terraria.Player.QuickMana -= ApplyManaBurnIfNeeded; @@ -134,7 +134,7 @@ namespace CalamityMod.ILEditing // Damage and health balance IL.Terraria.Main.DamageVar -= AdjustDamageVariance; - IL.Terraria.NPC.scaleStats -= RemoveExpertHardmodeScaling; + IL.Terraria.NPC.ScaleStats -= RemoveExpertHardmodeScaling; IL.Terraria.Projectile.AI_001 -= AdjustChlorophyteBullets; // Movement speed balance @@ -165,7 +165,7 @@ namespace CalamityMod.ILEditing IL.Terraria.Main.UpdateTime -= BloodMoonsRequire200MaxLife; // Fix vanilla bugs exposed by Calamity mechanics - On.Terraria.Main.InitLifeBytes -= BossRushLifeBytes; + // On.Terraria.Main.InitLifeBytes -= BossRushLifeBytes; IL.Terraria.NPC.NPCLoot -= FixSplittingWormBannerDrops; // IL.Terraria.Main.DoUpdate -= FixProjectileUpdatePriorityProblems; } diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index 9adc72b165..05342bb557 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -14,6 +14,7 @@ using Mono.Cecil.Cil; using MonoMod.Cil; using System; using Terraria; +using Terraria.DataStructures; using Terraria.GameContent.Liquid; using Terraria.GameInput; using Terraria.Graphics; @@ -294,7 +295,7 @@ namespace CalamityMod.ILEditing #endregion Incorporate Enchantments in Item Names #region Hellbound Enchantment Projectile Creation Effects - private static int IncorporateMinionExplodingCountdown(On.Terraria.Projectile.orig_NewProjectile_float_float_float_float_int_int_float_int_float_float orig, float x, float y, float xSpeed, float ySpeed, int type, int damage, float knockback, int owner, float ai0, float ai1) + private static int IncorporateMinionExplodingCountdown(On.Terraria.Projectile.orig_NewProjectile_IEntitySource_float_float_float_float_int_int_float_int_float_float orig, IEntitySource spawnSource, float x, float y, float xSpeed, float ySpeed, int type, int damage, float knockback, int owner, float ai0, float ai1) { // This is unfortunately not something that can be done via SetDefaults since owner is set // after that method is called. Doing it directly when the projectile is spawned appears to be the only reasonable way. diff --git a/ILEditing/VanillaBugfixingILChanges.cs b/ILEditing/VanillaBugfixingILChanges.cs index 483327f35b..0582ea3c24 100644 --- a/ILEditing/VanillaBugfixingILChanges.cs +++ b/ILEditing/VanillaBugfixingILChanges.cs @@ -1,4 +1,4 @@ -using CalamityMod.NPCs; +using CalamityMod.NPCs; using Microsoft.Xna.Framework; using Mono.Cecil.Cil; using MonoMod.Cil; @@ -81,6 +81,7 @@ namespace CalamityMod.ILEditing public static List OrderedProjectiles = new List(); + /* #region Fixing NPC HP Sync Byte Counts in Boss Rush // CONTEXT FOR FIX: When NPCs sync they have a pre-determined amount of bytes that are used to store HP/Max NPC information in packets for efficiency. // However, this may not always coincide with the true HP of the NPC when it's created if it has more HP than the allocated bytes can sufficiently store, which can @@ -88,6 +89,7 @@ namespace CalamityMod.ILEditing // To give an example, the Ancient Visions in the culst fight have a few thousand HP to work with, placing it in the 2-life-bytes category, and thusly allowing HP values // of up to 2^15 - 1 (32767). However, in Boss Rush, as of writing this, it has 50000 HP. In order to mitigate this, it must be placed in the 4-byte category, which allows // values up to the integer limit. + // NOTE -- This mechanic appears to have been removed in 1.4. private static void BossRushLifeBytes(On.Terraria.Main.orig_InitLifeBytes orig) { orig(); @@ -95,6 +97,7 @@ namespace CalamityMod.ILEditing Main.npcLifeBytes[npcType] = 4; } #endregion Fixing NPC HP Sync Byte Counts in Boss Rush + */ #region Fixing Splitting Worm Banner Spam in Deathmode // CONTEXT FOR FIX: In Death Mode, normal worms are capable of splitting similarly to the Eater of Worlds. This, as expected, comes with problems with loot dropping, as you can kill multiple diff --git a/Items/DraedonMisc/EncryptedSchematicHell.cs b/Items/DraedonMisc/EncryptedSchematicHell.cs index 71f866dc34..1fef20810e 100644 --- a/Items/DraedonMisc/EncryptedSchematicHell.cs +++ b/Items/DraedonMisc/EncryptedSchematicHell.cs @@ -1,3 +1,4 @@ +using System; using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using Terraria; @@ -34,7 +35,13 @@ namespace CalamityMod.Items.DraedonMisc public override void AddRecipes() { - CreateRecipe(1).AddIngredient(ModContent.ItemType(), 10).AddIngredient(ModContent.ItemType(), 10).AddIngredient(ItemID.Glass, 50).AddTile(TileID.Anvils).Register(); + CreateRecipe(1). + AddIngredient(ModContent.ItemType(), 10). + AddIngredient(ModContent.ItemType(), 10). + AddIngredient(ItemID.Glass, 50). + AddCondition(SchematicRecipe.ConstructRecipeCondition("Hell", out Predicate condition), condition). + AddTile(TileID.Anvils). + Register(); } } } diff --git a/Items/DraedonMisc/EncryptedSchematicIce.cs b/Items/DraedonMisc/EncryptedSchematicIce.cs index 486209fe2e..8576d2fc05 100644 --- a/Items/DraedonMisc/EncryptedSchematicIce.cs +++ b/Items/DraedonMisc/EncryptedSchematicIce.cs @@ -1,3 +1,4 @@ +using System; using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using Terraria; @@ -34,7 +35,13 @@ namespace CalamityMod.Items.DraedonMisc public override void AddRecipes() { - CreateRecipe(1).AddIngredient(ModContent.ItemType(), 10).AddIngredient(ModContent.ItemType(), 10).AddIngredient(ItemID.Glass, 50).AddTile(TileID.Anvils).Register(); + CreateRecipe(1). + AddIngredient(ModContent.ItemType(), 10). + AddIngredient(ModContent.ItemType(), 10). + AddIngredient(ItemID.Glass, 50). + AddCondition(SchematicRecipe.ConstructRecipeCondition("Ice", out Predicate condition), condition). + AddTile(TileID.Anvils). + Register(); } } } diff --git a/Items/DraedonMisc/EncryptedSchematicJungle.cs b/Items/DraedonMisc/EncryptedSchematicJungle.cs index 37de82aec1..f8a47276b2 100644 --- a/Items/DraedonMisc/EncryptedSchematicJungle.cs +++ b/Items/DraedonMisc/EncryptedSchematicJungle.cs @@ -1,3 +1,4 @@ +using System; using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using Terraria; @@ -34,7 +35,13 @@ namespace CalamityMod.Items.DraedonMisc public override void AddRecipes() { - CreateRecipe(1).AddIngredient(ModContent.ItemType(), 10).AddIngredient(ModContent.ItemType(), 10).AddIngredient(ItemID.Glass, 50).AddTile(TileID.Anvils).Register(); + CreateRecipe(1). + AddIngredient(ModContent.ItemType(), 10). + AddIngredient(ModContent.ItemType(), 10). + AddIngredient(ItemID.Glass, 50). + AddCondition(SchematicRecipe.ConstructRecipeCondition("Jungle", out Predicate condition), condition). + AddTile(TileID.Anvils). + Register(); } } } diff --git a/Items/DraedonMisc/EncryptedSchematicPlanetoid.cs b/Items/DraedonMisc/EncryptedSchematicPlanetoid.cs index 5ea2494a54..05afb79ee2 100644 --- a/Items/DraedonMisc/EncryptedSchematicPlanetoid.cs +++ b/Items/DraedonMisc/EncryptedSchematicPlanetoid.cs @@ -1,3 +1,4 @@ +using System; using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using Terraria; @@ -34,7 +35,13 @@ namespace CalamityMod.Items.DraedonMisc public override void AddRecipes() { - CreateRecipe(1).AddIngredient(ModContent.ItemType(), 10).AddIngredient(ModContent.ItemType(), 10).AddIngredient(ItemID.Glass, 50).AddTile(TileID.Anvils).Register(); + CreateRecipe(1). + AddIngredient(ModContent.ItemType(), 10). + AddIngredient(ModContent.ItemType(), 10). + AddIngredient(ItemID.Glass, 50). + AddCondition(SchematicRecipe.ConstructRecipeCondition("Planetoid", out Predicate condition), condition). + AddTile(TileID.Anvils). + Register(); } } } diff --git a/Items/DraedonMisc/EncryptedSchematicSunkenSea.cs b/Items/DraedonMisc/EncryptedSchematicSunkenSea.cs index d88e0ed585..04d78e15cb 100644 --- a/Items/DraedonMisc/EncryptedSchematicSunkenSea.cs +++ b/Items/DraedonMisc/EncryptedSchematicSunkenSea.cs @@ -1,4 +1,4 @@ -using CalamityMod.CustomRecipes; +using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; @@ -14,7 +14,7 @@ namespace CalamityMod.Items.DraedonMisc Tooltip.SetDefault("Finely detailed diagrams of numerous devices and weaponry dance across the holographic screen.\n" + "The weaponry I supply to the workers of the laboratories is weak. Hardly suited for battle.\n" + "However, they suffice for self defense against any lab mechanisms or creations which may have gone rogue.\n" + - "Addendum: For those who think themselves powerful, search the upper bounds of this planet’s atmosphere for a structure similar to that of the Sunken Seas.\n" + + "Addendum: For those who think themselves powerful, search the upper bounds of this planet’s atmosphere for a structure similar to that of the Sunken Seas.\n" + "I will know by the end if you are worthy of battling my creations.\n" + "Picking up this item or holding it in your inventory permanently unlocks new recipes"); } @@ -43,7 +43,13 @@ namespace CalamityMod.Items.DraedonMisc // Recipe exists for posierity. public override void AddRecipes() { - CreateRecipe(1).AddIngredient(ModContent.ItemType(), 10).AddIngredient(ModContent.ItemType(), 10).AddIngredient(ItemID.Glass, 50).AddTile(TileID.Anvils).Register(); + CreateRecipe(1). + AddIngredient(ModContent.ItemType(), 10). + AddIngredient(ModContent.ItemType(), 10). + AddIngredient(ItemID.Glass, 50). + AddCondition(SchematicRecipe.ConstructRecipeCondition("Sunken Sea", out Predicate condition), condition). + AddTile(TileID.Anvils). + Register(); } } } diff --git a/Localization/CalamityLocalization.cs b/Localization/CalamityLocalization.cs index 691f6a9266..ef23b4e97f 100644 --- a/Localization/CalamityLocalization.cs +++ b/Localization/CalamityLocalization.cs @@ -208,6 +208,12 @@ namespace CalamityMod.Localization new [] { "Tier3ArsenalRecipeCondition", "Decrypt a schematic from the lab deep within the jungle" }, new [] { "Tier4ArsenalRecipeCondition", "Decrypt a schematic from the lab near the edges of the underworld" }, new [] { "Tier5ArsenalRecipeCondition", "Decrypt a schematic from the lab deep within the frozen caverns" }, + + new [] { "SunkenSeaSchematicRecipeCondition", "Place a schematic from the lab near the Sunken Sea in your inventory at least once" }, + new [] { "PlanetoidSchematicRecipeCondition", "Place a schematic from the lab in the large planetoid in your inventory at least once" }, + new [] { "JungleSchematicRecipeCondition", "Place a schematic from the lab deep within the jungle in your inventory at least once" }, + new [] { "UnderworldSchematicRecipeCondition", "Place a schematic from the lab near the edges of the underworld in your inventory at least once" }, + new [] { "IceSchematicRecipeCondition", "Place a schematic from the lab within the frozen caverns in your inventory at least once" }, }; } diff --git a/Tiles/Furniture/ChaosCandle.cs b/Tiles/Furniture/ChaosCandle.cs index aebc2a1ddc..5f98703f6f 100644 --- a/Tiles/Furniture/ChaosCandle.cs +++ b/Tiles/Furniture/ChaosCandle.cs @@ -1,7 +1,8 @@ -using CalamityMod.Buffs.Placeables; +using CalamityMod.Buffs.Placeables; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -57,7 +58,7 @@ namespace CalamityMod.Tiles.Furniture CalamityUtils.LightHitWire(Type, i, j, 1, 1); } - public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref Color drawColor, ref int nextSpecialDrawIndex) + public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData) { if (Main.tile[i, j].TileFrameX < 18) CalamityUtils.DrawFlameSparks(235, 5, i, j); @@ -65,7 +66,7 @@ namespace CalamityMod.Tiles.Furniture public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { - CalamityUtils.DrawFlameEffect(ModContent.Request("CalamityMod/Tiles/Furniture/ChaosCandleFlame"), i, j); + CalamityUtils.DrawFlameEffect(ModContent.Request("CalamityMod/Tiles/Furniture/ChaosCandleFlame").Value, i, j); } public override bool RightClick(int i, int j) diff --git a/Tiles/Furniture/CraftingStations/AncientAltar.cs b/Tiles/Furniture/CraftingStations/AncientAltar.cs index 40cf417381..e2c29417e1 100644 --- a/Tiles/Furniture/CraftingStations/AncientAltar.cs +++ b/Tiles/Furniture/CraftingStations/AncientAltar.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.DataStructures; @@ -64,10 +64,10 @@ namespace CalamityMod.Tiles.Furniture.CraftingStations public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { - CalamityUtils.DrawStaticFlameEffect(ModContent.Request("CalamityMod/Tiles/Furniture/CraftingStations/AncientAltarFlame"), i, j, offsetY: animationFrame * animationFrameHeight); + CalamityUtils.DrawStaticFlameEffect(ModContent.Request("CalamityMod/Tiles/Furniture/CraftingStations/AncientAltarFlame").Value, i, j, offsetY: animationFrame * animationFrameHeight); } - public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref Color drawColor, ref int nextSpecialDrawIndex) + public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData) { Tile tile = Main.tile[i, j]; if (tile.TileFrameX == 18 && tile.TileFrameY == 18) diff --git a/Tiles/Furniture/CraftingStations/AshenAltar.cs b/Tiles/Furniture/CraftingStations/AshenAltar.cs index de2bda8e06..1631a2eea2 100644 --- a/Tiles/Furniture/CraftingStations/AshenAltar.cs +++ b/Tiles/Furniture/CraftingStations/AshenAltar.cs @@ -64,10 +64,10 @@ namespace CalamityMod.Tiles.Furniture.CraftingStations public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { - CalamityUtils.DrawStaticFlameEffect(ModContent.Request("CalamityMod/Tiles/Furniture/CraftingStations/AshenAltarFlame"), i, j, offsetY: animationFrame * animationFrameHeight); + CalamityUtils.DrawStaticFlameEffect(ModContent.Request("CalamityMod/Tiles/Furniture/CraftingStations/AshenAltarFlame").Value, i, j, offsetY: animationFrame * animationFrameHeight); } - public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref Color drawColor, ref int nextSpecialDrawIndex) + public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData) { Tile tile = Main.tile[i, j]; if (tile.TileFrameX == 18 && tile.TileFrameY == 18) diff --git a/Tiles/Furniture/TranquilityCandle.cs b/Tiles/Furniture/TranquilityCandle.cs index 363e5780e8..52b5fdd193 100644 --- a/Tiles/Furniture/TranquilityCandle.cs +++ b/Tiles/Furniture/TranquilityCandle.cs @@ -1,7 +1,8 @@ -using CalamityMod.Buffs.Placeables; +using CalamityMod.Buffs.Placeables; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -57,7 +58,7 @@ namespace CalamityMod.Tiles.Furniture CalamityUtils.LightHitWire(Type, i, j, 1, 1); } - public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref Color drawColor, ref int nextSpecialDrawIndex) + public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData) { if (Main.tile[i, j].TileFrameX < 18) CalamityUtils.DrawFlameSparks(62, 5, i, j); @@ -65,7 +66,7 @@ namespace CalamityMod.Tiles.Furniture public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { - CalamityUtils.DrawFlameEffect(ModContent.Request("CalamityMod/Tiles/Furniture/TranquilityCandleFlame"), i, j); + CalamityUtils.DrawFlameEffect(ModContent.Request("CalamityMod/Tiles/Furniture/TranquilityCandleFlame").Value, i, j); } public override bool RightClick(int i, int j) diff --git a/Tiles/FurnitureAshen/AshenBasin.cs b/Tiles/FurnitureAshen/AshenBasin.cs index 1f0a31e3a9..8879d4b8a6 100644 --- a/Tiles/FurnitureAshen/AshenBasin.cs +++ b/Tiles/FurnitureAshen/AshenBasin.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.DataStructures; @@ -74,10 +74,10 @@ namespace CalamityMod.Tiles.FurnitureAshen public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { - CalamityUtils.DrawStaticFlameEffect(ModContent.Request("CalamityMod/Tiles/FurnitureAshen/AshenBasinFlame"), i, j, offsetY: animationFrame * animationFrameHeight); + CalamityUtils.DrawStaticFlameEffect(ModContent.Request("CalamityMod/Tiles/FurnitureAshen/AshenBasinFlame").Value, i, j, offsetY: animationFrame * AnimationFrameHeight); } - public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref Color drawColor, ref int nextSpecialDrawIndex) + public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData) { Tile tile = Main.tile[i, j]; if (tile.TileFrameY == 18 && tile.TileFrameX < 54) diff --git a/Tiles/UelibloomBrick.cs b/Tiles/UelibloomBrick.cs index c0841f7d79..5aaa13d7ed 100644 --- a/Tiles/UelibloomBrick.cs +++ b/Tiles/UelibloomBrick.cs @@ -1,10 +1,11 @@ - + using CalamityMod.Dusts.Furniture; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; using Terraria.ID; +using Terraria.DataStructures; namespace CalamityMod.Tiles { @@ -35,6 +36,9 @@ namespace CalamityMod.Tiles return false; } + // TODO -- Fix the drapes from these. This uses specialized drawing hooks which appear to currently be private in 1.4. + // This may require either gross reflection or contacting TML developers to make the necessary information for this public again. + /* public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref Color drawColor, ref int nextSpecialDrawIndex) { if ((Main.tile[i - 1, j - 1].TileType != Type || Main.tile[i, j - 1].TileType != Type || Main.tile[i + 1, j - 1].TileType != Type || @@ -47,22 +51,23 @@ namespace CalamityMod.Tiles } } - public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) - { - return TileFraming.BrimstoneFraming(i, j, resetFrame); - } - public override void SpecialDraw(int i, int j, SpriteBatch spriteBatch) { Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; Color drawColour = GetDrawColour(i, j); - Texture2D leaves = ModContent.Request("CalamityMod/Tiles/UelibloomBrick_Leaves"); + Texture2D leaves = ModContent.Request("CalamityMod/Tiles/UelibloomBrick_Leaves").Value; DrawExtraTop(i, j, leaves, drawOffset, drawColour); DrawExtraWallEnds(i, j, leaves, drawOffset, drawColour); DrawExtraDrapes(i, j, leaves, drawOffset, drawColour); } + */ + + public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) + { + return TileFraming.BrimstoneFraming(i, j, resetFrame); + } #region 'Extra Drapes' Drawing private void DrawExtraTop(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) @@ -234,7 +239,7 @@ namespace CalamityMod.Tiles private int GetExtraVariant(int i, int j) { - return Main.tile[i, j].frameNumber() * extraFrameWidth; + return Main.tile[i, j].TileFrameNumber * extraFrameWidth; } /* From d3685a86e1afbfbabbfd6be82919d9cf35832650 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Tue, 5 Apr 2022 20:07:06 -0500 Subject: [PATCH 2/4] Updated variable names for hover effects --- Projectiles/Pets/DannyDevitoPet.cs | 4 +- Tiles/Astral/AstralBeacon.cs | 12 +-- .../AgedLaboratoryDoorClosed.cs | 4 +- .../AgedLaboratoryDoorOpen.cs | 4 +- .../DraedonStructures/LaboratoryDoorClosed.cs | 4 +- Tiles/DraedonStructures/LaboratoryDoorOpen.cs | 4 +- Tiles/Furniture/ChaosCandle.cs | 4 +- .../Furniture/Fountains/AbyssFountainTile.cs | 6 +- .../Furniture/Fountains/AstralFountainTile.cs | 4 +- .../Fountains/SulphurousFountainTile.cs | 4 +- .../Fountains/SunkenSeaFountainTile.cs | 4 +- Tiles/Furniture/SCalAltar.cs | 12 +-- Tiles/Furniture/TranquilityCandle.cs | 4 +- Tiles/FurnitureAbyss/AbyssBed.cs | 4 +- Tiles/FurnitureAbyss/AbyssCandle.cs | 4 +- Tiles/FurnitureAbyss/AbyssDoorClosed.cs | 4 +- Tiles/FurnitureAbyss/AbyssDoorOpen.cs | 4 +- Tiles/FurnitureAbyss/AbyssTorch.cs | 4 +- Tiles/FurnitureAcidwood/AcidwoodBedTile.cs | 4 +- Tiles/FurnitureAcidwood/AcidwoodCandleTile.cs | 4 +- Tiles/FurnitureAcidwood/AcidwoodDoorClosed.cs | 4 +- Tiles/FurnitureAcidwood/AcidwoodDoorOpen.cs | 4 +- Tiles/FurnitureAncient/AncientBed.cs | 4 +- Tiles/FurnitureAncient/AncientDoorClosed.cs | 4 +- Tiles/FurnitureAncient/AncientDoorOpen.cs | 4 +- Tiles/FurnitureAshen/AshenBed.cs | 4 +- Tiles/FurnitureAshen/AshenCandle.cs | 4 +- Tiles/FurnitureAshen/AshenDoorClosed.cs | 4 +- Tiles/FurnitureAshen/AshenDoorOpen.cs | 4 +- Tiles/FurnitureAstral/MonolithBed.cs | 4 +- Tiles/FurnitureAstral/MonolithCandle.cs | 4 +- Tiles/FurnitureAstral/MonolithDoorClosed.cs | 4 +- Tiles/FurnitureAstral/MonolithDoorOpen.cs | 4 +- Tiles/FurnitureBotanic/BotanicBed.cs | 4 +- Tiles/FurnitureBotanic/BotanicCandle.cs | 4 +- Tiles/FurnitureBotanic/BotanicDoorClosed.cs | 4 +- Tiles/FurnitureBotanic/BotanicDoorOpen.cs | 4 +- Tiles/FurnitureCosmilite/CosmiliteBed.cs | 4 +- Tiles/FurnitureCosmilite/CosmiliteCandle.cs | 4 +- .../FurnitureCosmilite/CosmiliteDoorClosed.cs | 4 +- Tiles/FurnitureCosmilite/CosmiliteDoorOpen.cs | 4 +- Tiles/FurnitureEutrophic/EutrophicBed.cs | 4 +- Tiles/FurnitureEutrophic/EutrophicCandle.cs | 4 +- .../FurnitureEutrophic/EutrophicDoorClosed.cs | 4 +- Tiles/FurnitureEutrophic/EutrophicDoorOpen.cs | 4 +- Tiles/FurnitureExo/ExoBedTile.cs | 4 +- Tiles/FurnitureExo/ExoCandleTile.cs | 4 +- Tiles/FurnitureExo/ExoDoorClosed.cs | 4 +- Tiles/FurnitureExo/ExoDoorOpen.cs | 4 +- Tiles/FurnitureOccult/OccultBed.cs | 4 +- Tiles/FurnitureOccult/OccultCandle.cs | 4 +- Tiles/FurnitureOccult/OccultDoorClosed.cs | 4 +- Tiles/FurnitureOccult/OccultDoorOpen.cs | 4 +- .../FurniturePlaguedPlate/PlaguedPlateBed.cs | 4 +- .../PlaguedPlateCandle.cs | 4 +- .../PlaguedPlateDoorClosed.cs | 4 +- .../PlaguedPlateDoorOpen.cs | 4 +- Tiles/FurnitureProfaned/ProfanedBed.cs | 4 +- Tiles/FurnitureProfaned/ProfanedCandle.cs | 4 +- Tiles/FurnitureProfaned/ProfanedDoorClosed.cs | 4 +- Tiles/FurnitureProfaned/ProfanedDoorOpen.cs | 4 +- Tiles/FurnitureSilva/SilvaBed.cs | 4 +- Tiles/FurnitureSilva/SilvaCandle.cs | 4 +- Tiles/FurnitureSilva/SilvaDoorClosed.cs | 4 +- Tiles/FurnitureSilva/SilvaDoorOpen.cs | 4 +- Tiles/FurnitureStatigel/StatigelBed.cs | 4 +- Tiles/FurnitureStatigel/StatigelCandle.cs | 4 +- Tiles/FurnitureStatigel/StatigelDoorClosed.cs | 4 +- Tiles/FurnitureStatigel/StatigelDoorOpen.cs | 4 +- Tiles/FurnitureStratus/StratusBed.cs | 4 +- Tiles/FurnitureStratus/StratusCandle.cs | 4 +- Tiles/FurnitureStratus/StratusDoorClosed.cs | 4 +- Tiles/FurnitureStratus/StratusDoorOpen.cs | 4 +- Tiles/FurnitureVoid/VoidBed.cs | 4 +- Tiles/FurnitureVoid/VoidCandle.cs | 4 +- Tiles/FurnitureVoid/VoidDoorClosed.cs | 4 +- Tiles/FurnitureVoid/VoidDoorOpen.cs | 4 +- Utilities/FurnitureSetupUtils.cs | 82 +++++++++---------- 78 files changed, 204 insertions(+), 204 deletions(-) diff --git a/Projectiles/Pets/DannyDevitoPet.cs b/Projectiles/Pets/DannyDevitoPet.cs index b20b5ffbb0..0f3e553fac 100644 --- a/Projectiles/Pets/DannyDevitoPet.cs +++ b/Projectiles/Pets/DannyDevitoPet.cs @@ -262,8 +262,8 @@ namespace CalamityMod.Projectiles.Pets if (num345 >= num347 - lastTileRangeX && num345 <= num347 + lastTileRangeX + 1 && num346 >= num348 - lastTileRangeY && num346 <= num348 + lastTileRangeY + 1) { Main.player[projectile.owner].noThrow = 2; - Main.player[projectile.owner].showItemIcon = true; - Main.player[projectile.owner].showItemIcon2 = 3213; + Main.player[projectile.owner].cursorItemIconEnabled = true; + Main.player[projectile.owner].cursorItemIconID = 3213; if (PlayerInput.UsingGamepad) { Main.player[projectile.owner].GamepadEnableGrappleCooldown(); diff --git a/Tiles/Astral/AstralBeacon.cs b/Tiles/Astral/AstralBeacon.cs index fb6acb4355..63c0858241 100644 --- a/Tiles/Astral/AstralBeacon.cs +++ b/Tiles/Astral/AstralBeacon.cs @@ -85,20 +85,20 @@ namespace CalamityMod.Tiles.Astral public override void MouseOver(int i, int j) { - Main.LocalPlayer.showItemIcon2 = ModContent.ItemType(); + Main.LocalPlayer.cursorItemIconID = ModContent.ItemType(); if (Main.LocalPlayer.HasItem(ModContent.ItemType())) - Main.LocalPlayer.showItemIcon2 = ModContent.ItemType(); + Main.LocalPlayer.cursorItemIconID = ModContent.ItemType(); Main.LocalPlayer.noThrow = 2; - Main.LocalPlayer.showItemIcon = true; + Main.LocalPlayer.cursorItemIconEnabled = true; } public override void MouseOverFar(int i, int j) { - Main.LocalPlayer.showItemIcon2 = ModContent.ItemType(); + Main.LocalPlayer.cursorItemIconID = ModContent.ItemType(); if (Main.LocalPlayer.HasItem(ModContent.ItemType())) - Main.LocalPlayer.showItemIcon2 = ModContent.ItemType(); + Main.LocalPlayer.cursorItemIconID = ModContent.ItemType(); Main.LocalPlayer.noThrow = 2; - Main.LocalPlayer.showItemIcon = true; + Main.LocalPlayer.cursorItemIconEnabled = true; } } } diff --git a/Tiles/DraedonStructures/AgedLaboratoryDoorClosed.cs b/Tiles/DraedonStructures/AgedLaboratoryDoorClosed.cs index 2133045823..be840aad64 100644 --- a/Tiles/DraedonStructures/AgedLaboratoryDoorClosed.cs +++ b/Tiles/DraedonStructures/AgedLaboratoryDoorClosed.cs @@ -65,8 +65,8 @@ namespace CalamityMod.Tiles.DraedonStructures { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/DraedonStructures/AgedLaboratoryDoorOpen.cs b/Tiles/DraedonStructures/AgedLaboratoryDoorOpen.cs index 2e1d4f0881..22dc623166 100644 --- a/Tiles/DraedonStructures/AgedLaboratoryDoorOpen.cs +++ b/Tiles/DraedonStructures/AgedLaboratoryDoorOpen.cs @@ -65,8 +65,8 @@ namespace CalamityMod.Tiles.DraedonStructures { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/DraedonStructures/LaboratoryDoorClosed.cs b/Tiles/DraedonStructures/LaboratoryDoorClosed.cs index 62195b86f6..038fb1b5b7 100644 --- a/Tiles/DraedonStructures/LaboratoryDoorClosed.cs +++ b/Tiles/DraedonStructures/LaboratoryDoorClosed.cs @@ -65,8 +65,8 @@ namespace CalamityMod.Tiles.DraedonStructures { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/DraedonStructures/LaboratoryDoorOpen.cs b/Tiles/DraedonStructures/LaboratoryDoorOpen.cs index fb18ed7b93..ac3ec7507f 100644 --- a/Tiles/DraedonStructures/LaboratoryDoorOpen.cs +++ b/Tiles/DraedonStructures/LaboratoryDoorOpen.cs @@ -65,8 +65,8 @@ namespace CalamityMod.Tiles.DraedonStructures { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/Furniture/ChaosCandle.cs b/Tiles/Furniture/ChaosCandle.cs index 5f98703f6f..7e1b3053b3 100644 --- a/Tiles/Furniture/ChaosCandle.cs +++ b/Tiles/Furniture/ChaosCandle.cs @@ -24,8 +24,8 @@ namespace CalamityMod.Tiles.Furniture { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } public override void NearbyEffects(int i, int j, bool closer) diff --git a/Tiles/Furniture/Fountains/AbyssFountainTile.cs b/Tiles/Furniture/Fountains/AbyssFountainTile.cs index b0e9ba9909..68fad39057 100644 --- a/Tiles/Furniture/Fountains/AbyssFountainTile.cs +++ b/Tiles/Furniture/Fountains/AbyssFountainTile.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Furniture.Fountains; +using CalamityMod.Items.Placeables.Furniture.Fountains; using Microsoft.Xna.Framework; using System.Linq; using Terraria; @@ -73,8 +73,8 @@ namespace CalamityMod.Tiles.Furniture.Fountains { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/Furniture/Fountains/AstralFountainTile.cs b/Tiles/Furniture/Fountains/AstralFountainTile.cs index c44f0b27ca..6684076fda 100644 --- a/Tiles/Furniture/Fountains/AstralFountainTile.cs +++ b/Tiles/Furniture/Fountains/AstralFountainTile.cs @@ -74,8 +74,8 @@ namespace CalamityMod.Tiles.Furniture.Fountains { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/Furniture/Fountains/SulphurousFountainTile.cs b/Tiles/Furniture/Fountains/SulphurousFountainTile.cs index f84ed963a8..da1c1cad5c 100644 --- a/Tiles/Furniture/Fountains/SulphurousFountainTile.cs +++ b/Tiles/Furniture/Fountains/SulphurousFountainTile.cs @@ -73,8 +73,8 @@ namespace CalamityMod.Tiles.Furniture.Fountains { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/Furniture/Fountains/SunkenSeaFountainTile.cs b/Tiles/Furniture/Fountains/SunkenSeaFountainTile.cs index 7c23b0734c..b4198049f6 100644 --- a/Tiles/Furniture/Fountains/SunkenSeaFountainTile.cs +++ b/Tiles/Furniture/Fountains/SunkenSeaFountainTile.cs @@ -73,8 +73,8 @@ namespace CalamityMod.Tiles.Furniture.Fountains { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/Furniture/SCalAltar.cs b/Tiles/Furniture/SCalAltar.cs index 0f610db3ba..710f25f591 100644 --- a/Tiles/Furniture/SCalAltar.cs +++ b/Tiles/Furniture/SCalAltar.cs @@ -90,23 +90,23 @@ namespace CalamityMod.Tiles.Furniture public override void MouseOver(int i, int j) { if (Main.LocalPlayer.HasItem(ModContent.ItemType())) - Main.LocalPlayer.showItemIcon2 = ModContent.ItemType(); + Main.LocalPlayer.cursorItemIconID = ModContent.ItemType(); else - Main.LocalPlayer.showItemIcon2 = ModContent.ItemType(); + Main.LocalPlayer.cursorItemIconID = ModContent.ItemType(); Main.LocalPlayer.noThrow = 2; - Main.LocalPlayer.showItemIcon = true; + Main.LocalPlayer.cursorItemIconEnabled = true; } public override void MouseOverFar(int i, int j) { if (Main.LocalPlayer.HasItem(ModContent.ItemType())) - Main.LocalPlayer.showItemIcon2 = ModContent.ItemType(); + Main.LocalPlayer.cursorItemIconID = ModContent.ItemType(); else - Main.LocalPlayer.showItemIcon2 = ModContent.ItemType(); + Main.LocalPlayer.cursorItemIconID = ModContent.ItemType(); Main.LocalPlayer.noThrow = 2; - Main.LocalPlayer.showItemIcon = true; + Main.LocalPlayer.cursorItemIconEnabled = true; } } } diff --git a/Tiles/Furniture/TranquilityCandle.cs b/Tiles/Furniture/TranquilityCandle.cs index 52b5fdd193..2f43040c90 100644 --- a/Tiles/Furniture/TranquilityCandle.cs +++ b/Tiles/Furniture/TranquilityCandle.cs @@ -24,8 +24,8 @@ namespace CalamityMod.Tiles.Furniture { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } public override void NearbyEffects(int i, int j, bool closer) diff --git a/Tiles/FurnitureAbyss/AbyssBed.cs b/Tiles/FurnitureAbyss/AbyssBed.cs index da16e41d9c..a7c2cb12d0 100644 --- a/Tiles/FurnitureAbyss/AbyssBed.cs +++ b/Tiles/FurnitureAbyss/AbyssBed.cs @@ -47,8 +47,8 @@ namespace CalamityMod.Tiles.FurnitureAbyss { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureAbyss/AbyssCandle.cs b/Tiles/FurnitureAbyss/AbyssCandle.cs index a3c6303c5d..cd3ef40359 100644 --- a/Tiles/FurnitureAbyss/AbyssCandle.cs +++ b/Tiles/FurnitureAbyss/AbyssCandle.cs @@ -55,8 +55,8 @@ namespace CalamityMod.Tiles.FurnitureAbyss { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } public override bool RightClick(int i, int j) diff --git a/Tiles/FurnitureAbyss/AbyssDoorClosed.cs b/Tiles/FurnitureAbyss/AbyssDoorClosed.cs index a55519ddbd..e22b2482ce 100644 --- a/Tiles/FurnitureAbyss/AbyssDoorClosed.cs +++ b/Tiles/FurnitureAbyss/AbyssDoorClosed.cs @@ -41,8 +41,8 @@ namespace CalamityMod.Tiles.FurnitureAbyss { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureAbyss/AbyssDoorOpen.cs b/Tiles/FurnitureAbyss/AbyssDoorOpen.cs index 4263e6bda3..183e7454f1 100644 --- a/Tiles/FurnitureAbyss/AbyssDoorOpen.cs +++ b/Tiles/FurnitureAbyss/AbyssDoorOpen.cs @@ -41,8 +41,8 @@ namespace CalamityMod.Tiles.FurnitureAbyss { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureAbyss/AbyssTorch.cs b/Tiles/FurnitureAbyss/AbyssTorch.cs index c5447632da..ab98c09294 100644 --- a/Tiles/FurnitureAbyss/AbyssTorch.cs +++ b/Tiles/FurnitureAbyss/AbyssTorch.cs @@ -36,8 +36,8 @@ namespace CalamityMod.Tiles.FurnitureAbyss { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) diff --git a/Tiles/FurnitureAcidwood/AcidwoodBedTile.cs b/Tiles/FurnitureAcidwood/AcidwoodBedTile.cs index 05fce179d0..338595bdbc 100644 --- a/Tiles/FurnitureAcidwood/AcidwoodBedTile.cs +++ b/Tiles/FurnitureAcidwood/AcidwoodBedTile.cs @@ -45,8 +45,8 @@ namespace CalamityMod.Tiles.FurnitureAcidwood { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureAcidwood/AcidwoodCandleTile.cs b/Tiles/FurnitureAcidwood/AcidwoodCandleTile.cs index e351855b4c..ecab400252 100644 --- a/Tiles/FurnitureAcidwood/AcidwoodCandleTile.cs +++ b/Tiles/FurnitureAcidwood/AcidwoodCandleTile.cs @@ -56,8 +56,8 @@ namespace CalamityMod.Tiles.FurnitureAcidwood { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } public override bool RightClick(int i, int j) diff --git a/Tiles/FurnitureAcidwood/AcidwoodDoorClosed.cs b/Tiles/FurnitureAcidwood/AcidwoodDoorClosed.cs index 2e2d9bba55..72e346e957 100644 --- a/Tiles/FurnitureAcidwood/AcidwoodDoorClosed.cs +++ b/Tiles/FurnitureAcidwood/AcidwoodDoorClosed.cs @@ -42,8 +42,8 @@ namespace CalamityMod.Tiles.FurnitureAcidwood { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureAcidwood/AcidwoodDoorOpen.cs b/Tiles/FurnitureAcidwood/AcidwoodDoorOpen.cs index d69b49300e..1c2470323d 100644 --- a/Tiles/FurnitureAcidwood/AcidwoodDoorOpen.cs +++ b/Tiles/FurnitureAcidwood/AcidwoodDoorOpen.cs @@ -42,8 +42,8 @@ namespace CalamityMod.Tiles.FurnitureAcidwood { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureAncient/AncientBed.cs b/Tiles/FurnitureAncient/AncientBed.cs index ca0d085890..53e148c366 100644 --- a/Tiles/FurnitureAncient/AncientBed.cs +++ b/Tiles/FurnitureAncient/AncientBed.cs @@ -48,8 +48,8 @@ namespace CalamityMod.Tiles.FurnitureAncient { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureAncient/AncientDoorClosed.cs b/Tiles/FurnitureAncient/AncientDoorClosed.cs index 78bd49d121..92f68def85 100644 --- a/Tiles/FurnitureAncient/AncientDoorClosed.cs +++ b/Tiles/FurnitureAncient/AncientDoorClosed.cs @@ -42,8 +42,8 @@ namespace CalamityMod.Tiles.FurnitureAncient { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureAncient/AncientDoorOpen.cs b/Tiles/FurnitureAncient/AncientDoorOpen.cs index 15faf1b4f1..7bcb715b80 100644 --- a/Tiles/FurnitureAncient/AncientDoorOpen.cs +++ b/Tiles/FurnitureAncient/AncientDoorOpen.cs @@ -42,8 +42,8 @@ namespace CalamityMod.Tiles.FurnitureAncient { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureAshen/AshenBed.cs b/Tiles/FurnitureAshen/AshenBed.cs index e34c347d2b..39b0d578d7 100644 --- a/Tiles/FurnitureAshen/AshenBed.cs +++ b/Tiles/FurnitureAshen/AshenBed.cs @@ -48,8 +48,8 @@ namespace CalamityMod.Tiles.FurnitureAshen { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureAshen/AshenCandle.cs b/Tiles/FurnitureAshen/AshenCandle.cs index aeea564c97..4784c32c51 100644 --- a/Tiles/FurnitureAshen/AshenCandle.cs +++ b/Tiles/FurnitureAshen/AshenCandle.cs @@ -56,8 +56,8 @@ namespace CalamityMod.Tiles.FurnitureAshen { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } public override bool RightClick(int i, int j) diff --git a/Tiles/FurnitureAshen/AshenDoorClosed.cs b/Tiles/FurnitureAshen/AshenDoorClosed.cs index 7331aa0a8a..c11a3e0bdf 100644 --- a/Tiles/FurnitureAshen/AshenDoorClosed.cs +++ b/Tiles/FurnitureAshen/AshenDoorClosed.cs @@ -43,8 +43,8 @@ namespace CalamityMod.Tiles.FurnitureAshen { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureAshen/AshenDoorOpen.cs b/Tiles/FurnitureAshen/AshenDoorOpen.cs index 359849ff1c..960e0ddec7 100644 --- a/Tiles/FurnitureAshen/AshenDoorOpen.cs +++ b/Tiles/FurnitureAshen/AshenDoorOpen.cs @@ -43,8 +43,8 @@ namespace CalamityMod.Tiles.FurnitureAshen { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureAstral/MonolithBed.cs b/Tiles/FurnitureAstral/MonolithBed.cs index 593290ccdb..6750e60b1c 100644 --- a/Tiles/FurnitureAstral/MonolithBed.cs +++ b/Tiles/FurnitureAstral/MonolithBed.cs @@ -73,8 +73,8 @@ namespace CalamityMod.Tiles.FurnitureAstral { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureAstral/MonolithCandle.cs b/Tiles/FurnitureAstral/MonolithCandle.cs index 7cc9e31c1b..594ac35656 100644 --- a/Tiles/FurnitureAstral/MonolithCandle.cs +++ b/Tiles/FurnitureAstral/MonolithCandle.cs @@ -83,8 +83,8 @@ namespace CalamityMod.Tiles.FurnitureAstral { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } public override bool RightClick(int i, int j) diff --git a/Tiles/FurnitureAstral/MonolithDoorClosed.cs b/Tiles/FurnitureAstral/MonolithDoorClosed.cs index 1ab4ad764f..5dd93d28c8 100644 --- a/Tiles/FurnitureAstral/MonolithDoorClosed.cs +++ b/Tiles/FurnitureAstral/MonolithDoorClosed.cs @@ -67,8 +67,8 @@ namespace CalamityMod.Tiles.FurnitureAstral { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureAstral/MonolithDoorOpen.cs b/Tiles/FurnitureAstral/MonolithDoorOpen.cs index c44f4db68a..063f68baa2 100644 --- a/Tiles/FurnitureAstral/MonolithDoorOpen.cs +++ b/Tiles/FurnitureAstral/MonolithDoorOpen.cs @@ -67,8 +67,8 @@ namespace CalamityMod.Tiles.FurnitureAstral { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureBotanic/BotanicBed.cs b/Tiles/FurnitureBotanic/BotanicBed.cs index 6389ab16bd..76d192f5ab 100644 --- a/Tiles/FurnitureBotanic/BotanicBed.cs +++ b/Tiles/FurnitureBotanic/BotanicBed.cs @@ -49,8 +49,8 @@ namespace CalamityMod.Tiles.FurnitureBotanic { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureBotanic/BotanicCandle.cs b/Tiles/FurnitureBotanic/BotanicCandle.cs index 4ebb20bd76..5398f0933b 100644 --- a/Tiles/FurnitureBotanic/BotanicCandle.cs +++ b/Tiles/FurnitureBotanic/BotanicCandle.cs @@ -56,8 +56,8 @@ namespace CalamityMod.Tiles.FurnitureBotanic { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } public override bool RightClick(int i, int j) diff --git a/Tiles/FurnitureBotanic/BotanicDoorClosed.cs b/Tiles/FurnitureBotanic/BotanicDoorClosed.cs index 8976253371..ee6b23bef9 100644 --- a/Tiles/FurnitureBotanic/BotanicDoorClosed.cs +++ b/Tiles/FurnitureBotanic/BotanicDoorClosed.cs @@ -43,8 +43,8 @@ namespace CalamityMod.Tiles.FurnitureBotanic { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureBotanic/BotanicDoorOpen.cs b/Tiles/FurnitureBotanic/BotanicDoorOpen.cs index 495c72534e..365ca27100 100644 --- a/Tiles/FurnitureBotanic/BotanicDoorOpen.cs +++ b/Tiles/FurnitureBotanic/BotanicDoorOpen.cs @@ -43,8 +43,8 @@ namespace CalamityMod.Tiles.FurnitureBotanic { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureCosmilite/CosmiliteBed.cs b/Tiles/FurnitureCosmilite/CosmiliteBed.cs index 73a545ec09..27098e7e50 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteBed.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteBed.cs @@ -48,8 +48,8 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureCosmilite/CosmiliteCandle.cs b/Tiles/FurnitureCosmilite/CosmiliteCandle.cs index 142f8caa6e..43cad5a84b 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteCandle.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteCandle.cs @@ -55,8 +55,8 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } public override bool RightClick(int i, int j) diff --git a/Tiles/FurnitureCosmilite/CosmiliteDoorClosed.cs b/Tiles/FurnitureCosmilite/CosmiliteDoorClosed.cs index fb7bbbc08c..9a512540f2 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteDoorClosed.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteDoorClosed.cs @@ -42,8 +42,8 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureCosmilite/CosmiliteDoorOpen.cs b/Tiles/FurnitureCosmilite/CosmiliteDoorOpen.cs index 49ff25655d..5924901078 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteDoorOpen.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteDoorOpen.cs @@ -42,8 +42,8 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureEutrophic/EutrophicBed.cs b/Tiles/FurnitureEutrophic/EutrophicBed.cs index 98a0c9aebc..f6d02c3deb 100644 --- a/Tiles/FurnitureEutrophic/EutrophicBed.cs +++ b/Tiles/FurnitureEutrophic/EutrophicBed.cs @@ -47,8 +47,8 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureEutrophic/EutrophicCandle.cs b/Tiles/FurnitureEutrophic/EutrophicCandle.cs index 317d848ea2..582f992b6d 100644 --- a/Tiles/FurnitureEutrophic/EutrophicCandle.cs +++ b/Tiles/FurnitureEutrophic/EutrophicCandle.cs @@ -54,8 +54,8 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } public override bool RightClick(int i, int j) diff --git a/Tiles/FurnitureEutrophic/EutrophicDoorClosed.cs b/Tiles/FurnitureEutrophic/EutrophicDoorClosed.cs index 2cf1f5d87e..9dc7fb0e58 100644 --- a/Tiles/FurnitureEutrophic/EutrophicDoorClosed.cs +++ b/Tiles/FurnitureEutrophic/EutrophicDoorClosed.cs @@ -41,8 +41,8 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureEutrophic/EutrophicDoorOpen.cs b/Tiles/FurnitureEutrophic/EutrophicDoorOpen.cs index c378333878..a00e13f4f0 100644 --- a/Tiles/FurnitureEutrophic/EutrophicDoorOpen.cs +++ b/Tiles/FurnitureEutrophic/EutrophicDoorOpen.cs @@ -41,8 +41,8 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureExo/ExoBedTile.cs b/Tiles/FurnitureExo/ExoBedTile.cs index 9bafa01211..1f22acee5a 100644 --- a/Tiles/FurnitureExo/ExoBedTile.cs +++ b/Tiles/FurnitureExo/ExoBedTile.cs @@ -48,8 +48,8 @@ namespace CalamityMod.Tiles.FurnitureExo { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } public override void PostDraw(int i, int j, SpriteBatch spriteBatch) diff --git a/Tiles/FurnitureExo/ExoCandleTile.cs b/Tiles/FurnitureExo/ExoCandleTile.cs index f9b45aa00e..8b291fabe8 100644 --- a/Tiles/FurnitureExo/ExoCandleTile.cs +++ b/Tiles/FurnitureExo/ExoCandleTile.cs @@ -58,8 +58,8 @@ namespace CalamityMod.Tiles.FurnitureExo { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } public override bool RightClick(int i, int j) diff --git a/Tiles/FurnitureExo/ExoDoorClosed.cs b/Tiles/FurnitureExo/ExoDoorClosed.cs index 400f6db8ba..c3edb12194 100644 --- a/Tiles/FurnitureExo/ExoDoorClosed.cs +++ b/Tiles/FurnitureExo/ExoDoorClosed.cs @@ -65,8 +65,8 @@ namespace CalamityMod.Tiles.FurnitureExo { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureExo/ExoDoorOpen.cs b/Tiles/FurnitureExo/ExoDoorOpen.cs index d00fb5e05b..52d92f0e9f 100644 --- a/Tiles/FurnitureExo/ExoDoorOpen.cs +++ b/Tiles/FurnitureExo/ExoDoorOpen.cs @@ -65,8 +65,8 @@ namespace CalamityMod.Tiles.FurnitureExo { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureOccult/OccultBed.cs b/Tiles/FurnitureOccult/OccultBed.cs index d9fabee2b9..6a0931fb9b 100644 --- a/Tiles/FurnitureOccult/OccultBed.cs +++ b/Tiles/FurnitureOccult/OccultBed.cs @@ -49,8 +49,8 @@ namespace CalamityMod.Tiles.FurnitureOccult { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureOccult/OccultCandle.cs b/Tiles/FurnitureOccult/OccultCandle.cs index 1d44cb08f7..131aeaaa50 100644 --- a/Tiles/FurnitureOccult/OccultCandle.cs +++ b/Tiles/FurnitureOccult/OccultCandle.cs @@ -56,8 +56,8 @@ namespace CalamityMod.Tiles.FurnitureOccult { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } public override bool RightClick(int i, int j) diff --git a/Tiles/FurnitureOccult/OccultDoorClosed.cs b/Tiles/FurnitureOccult/OccultDoorClosed.cs index bb7f1ef063..3fe20e8634 100644 --- a/Tiles/FurnitureOccult/OccultDoorClosed.cs +++ b/Tiles/FurnitureOccult/OccultDoorClosed.cs @@ -43,8 +43,8 @@ namespace CalamityMod.Tiles.FurnitureOccult { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureOccult/OccultDoorOpen.cs b/Tiles/FurnitureOccult/OccultDoorOpen.cs index fe640cc40f..7c41525036 100644 --- a/Tiles/FurnitureOccult/OccultDoorOpen.cs +++ b/Tiles/FurnitureOccult/OccultDoorOpen.cs @@ -43,8 +43,8 @@ namespace CalamityMod.Tiles.FurnitureOccult { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateBed.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateBed.cs index dfa441da15..d4474332af 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateBed.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateBed.cs @@ -72,8 +72,8 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateCandle.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateCandle.cs index c99f27b014..f51f193c1d 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateCandle.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateCandle.cs @@ -54,8 +54,8 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } public override bool RightClick(int i, int j) diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateDoorClosed.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateDoorClosed.cs index d345ccd6ec..1423dd1e38 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateDoorClosed.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateDoorClosed.cs @@ -41,8 +41,8 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateDoorOpen.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateDoorOpen.cs index 7205eff8ab..83da385e3b 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateDoorOpen.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateDoorOpen.cs @@ -40,8 +40,8 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureProfaned/ProfanedBed.cs b/Tiles/FurnitureProfaned/ProfanedBed.cs index 5f2451bc52..b6812841d2 100644 --- a/Tiles/FurnitureProfaned/ProfanedBed.cs +++ b/Tiles/FurnitureProfaned/ProfanedBed.cs @@ -49,8 +49,8 @@ namespace CalamityMod.Tiles.FurnitureProfaned { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureProfaned/ProfanedCandle.cs b/Tiles/FurnitureProfaned/ProfanedCandle.cs index 0627156e0c..3f276ac6b1 100644 --- a/Tiles/FurnitureProfaned/ProfanedCandle.cs +++ b/Tiles/FurnitureProfaned/ProfanedCandle.cs @@ -57,8 +57,8 @@ namespace CalamityMod.Tiles.FurnitureProfaned { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } public override bool RightClick(int i, int j) diff --git a/Tiles/FurnitureProfaned/ProfanedDoorClosed.cs b/Tiles/FurnitureProfaned/ProfanedDoorClosed.cs index 5732798a30..45df7dbc92 100644 --- a/Tiles/FurnitureProfaned/ProfanedDoorClosed.cs +++ b/Tiles/FurnitureProfaned/ProfanedDoorClosed.cs @@ -43,8 +43,8 @@ namespace CalamityMod.Tiles.FurnitureProfaned { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureProfaned/ProfanedDoorOpen.cs b/Tiles/FurnitureProfaned/ProfanedDoorOpen.cs index 581d6b93d0..26c193c706 100644 --- a/Tiles/FurnitureProfaned/ProfanedDoorOpen.cs +++ b/Tiles/FurnitureProfaned/ProfanedDoorOpen.cs @@ -43,8 +43,8 @@ namespace CalamityMod.Tiles.FurnitureProfaned { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureSilva/SilvaBed.cs b/Tiles/FurnitureSilva/SilvaBed.cs index 124d5fb9c1..5f67c9131e 100644 --- a/Tiles/FurnitureSilva/SilvaBed.cs +++ b/Tiles/FurnitureSilva/SilvaBed.cs @@ -49,8 +49,8 @@ namespace CalamityMod.Tiles.FurnitureSilva { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureSilva/SilvaCandle.cs b/Tiles/FurnitureSilva/SilvaCandle.cs index bed975595c..6437285ae5 100644 --- a/Tiles/FurnitureSilva/SilvaCandle.cs +++ b/Tiles/FurnitureSilva/SilvaCandle.cs @@ -56,8 +56,8 @@ namespace CalamityMod.Tiles.FurnitureSilva { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } public override bool RightClick(int i, int j) diff --git a/Tiles/FurnitureSilva/SilvaDoorClosed.cs b/Tiles/FurnitureSilva/SilvaDoorClosed.cs index c010a9f1bf..721f5ec0eb 100644 --- a/Tiles/FurnitureSilva/SilvaDoorClosed.cs +++ b/Tiles/FurnitureSilva/SilvaDoorClosed.cs @@ -43,8 +43,8 @@ namespace CalamityMod.Tiles.FurnitureSilva { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureSilva/SilvaDoorOpen.cs b/Tiles/FurnitureSilva/SilvaDoorOpen.cs index db4bf0679f..8d8f6fee71 100644 --- a/Tiles/FurnitureSilva/SilvaDoorOpen.cs +++ b/Tiles/FurnitureSilva/SilvaDoorOpen.cs @@ -43,8 +43,8 @@ namespace CalamityMod.Tiles.FurnitureSilva { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureStatigel/StatigelBed.cs b/Tiles/FurnitureStatigel/StatigelBed.cs index c81a00254c..7e3570a220 100644 --- a/Tiles/FurnitureStatigel/StatigelBed.cs +++ b/Tiles/FurnitureStatigel/StatigelBed.cs @@ -47,8 +47,8 @@ namespace CalamityMod.Tiles.FurnitureStatigel { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureStatigel/StatigelCandle.cs b/Tiles/FurnitureStatigel/StatigelCandle.cs index 9491acb68e..fc4d4467b6 100644 --- a/Tiles/FurnitureStatigel/StatigelCandle.cs +++ b/Tiles/FurnitureStatigel/StatigelCandle.cs @@ -55,8 +55,8 @@ namespace CalamityMod.Tiles.FurnitureStatigel { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } public override bool RightClick(int i, int j) diff --git a/Tiles/FurnitureStatigel/StatigelDoorClosed.cs b/Tiles/FurnitureStatigel/StatigelDoorClosed.cs index 0e0bd169cf..2216ee42d6 100644 --- a/Tiles/FurnitureStatigel/StatigelDoorClosed.cs +++ b/Tiles/FurnitureStatigel/StatigelDoorClosed.cs @@ -41,8 +41,8 @@ namespace CalamityMod.Tiles.FurnitureStatigel { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureStatigel/StatigelDoorOpen.cs b/Tiles/FurnitureStatigel/StatigelDoorOpen.cs index 5ca4d32e12..36bbfffe72 100644 --- a/Tiles/FurnitureStatigel/StatigelDoorOpen.cs +++ b/Tiles/FurnitureStatigel/StatigelDoorOpen.cs @@ -41,8 +41,8 @@ namespace CalamityMod.Tiles.FurnitureStatigel { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureStratus/StratusBed.cs b/Tiles/FurnitureStratus/StratusBed.cs index b8bc05b909..4a7435ee62 100644 --- a/Tiles/FurnitureStratus/StratusBed.cs +++ b/Tiles/FurnitureStratus/StratusBed.cs @@ -48,8 +48,8 @@ namespace CalamityMod.Tiles.FurnitureStratus { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureStratus/StratusCandle.cs b/Tiles/FurnitureStratus/StratusCandle.cs index cb8d8e15ca..85c4796527 100644 --- a/Tiles/FurnitureStratus/StratusCandle.cs +++ b/Tiles/FurnitureStratus/StratusCandle.cs @@ -56,8 +56,8 @@ namespace CalamityMod.Tiles.FurnitureStratus { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } public override bool RightClick(int i, int j) diff --git a/Tiles/FurnitureStratus/StratusDoorClosed.cs b/Tiles/FurnitureStratus/StratusDoorClosed.cs index da940fa1ac..51fef24788 100644 --- a/Tiles/FurnitureStratus/StratusDoorClosed.cs +++ b/Tiles/FurnitureStratus/StratusDoorClosed.cs @@ -42,8 +42,8 @@ namespace CalamityMod.Tiles.FurnitureStratus { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureStratus/StratusDoorOpen.cs b/Tiles/FurnitureStratus/StratusDoorOpen.cs index d6cab197a7..72df9f0c51 100644 --- a/Tiles/FurnitureStratus/StratusDoorOpen.cs +++ b/Tiles/FurnitureStratus/StratusDoorOpen.cs @@ -42,8 +42,8 @@ namespace CalamityMod.Tiles.FurnitureStratus { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureVoid/VoidBed.cs b/Tiles/FurnitureVoid/VoidBed.cs index 6302db764a..b9c1f7c9c1 100644 --- a/Tiles/FurnitureVoid/VoidBed.cs +++ b/Tiles/FurnitureVoid/VoidBed.cs @@ -47,8 +47,8 @@ namespace CalamityMod.Tiles.FurnitureVoid { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureVoid/VoidCandle.cs b/Tiles/FurnitureVoid/VoidCandle.cs index 017c3db7e0..cc9b445abb 100644 --- a/Tiles/FurnitureVoid/VoidCandle.cs +++ b/Tiles/FurnitureVoid/VoidCandle.cs @@ -54,8 +54,8 @@ namespace CalamityMod.Tiles.FurnitureVoid { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } public override bool RightClick(int i, int j) diff --git a/Tiles/FurnitureVoid/VoidDoorClosed.cs b/Tiles/FurnitureVoid/VoidDoorClosed.cs index a819c7520d..3b6f16c518 100644 --- a/Tiles/FurnitureVoid/VoidDoorClosed.cs +++ b/Tiles/FurnitureVoid/VoidDoorClosed.cs @@ -41,8 +41,8 @@ namespace CalamityMod.Tiles.FurnitureVoid { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureVoid/VoidDoorOpen.cs b/Tiles/FurnitureVoid/VoidDoorOpen.cs index 04cc2a697d..eed0cbac48 100644 --- a/Tiles/FurnitureVoid/VoidDoorOpen.cs +++ b/Tiles/FurnitureVoid/VoidDoorOpen.cs @@ -41,8 +41,8 @@ namespace CalamityMod.Tiles.FurnitureVoid { Player player = Main.LocalPlayer; player.noThrow = 2; - player.showItemIcon = true; - player.showItemIcon2 = ModContent.ItemType(); + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Utilities/FurnitureSetupUtils.cs b/Utilities/FurnitureSetupUtils.cs index 0a4093a9b2..47f86c8da2 100644 --- a/Utilities/FurnitureSetupUtils.cs +++ b/Utilities/FurnitureSetupUtils.cs @@ -140,32 +140,32 @@ namespace CalamityMod top--; } int chest = Chest.FindChest(left, top); - player.showItemIcon2 = -1; + player.cursorItemIconID = -1; if (chest < 0) { - player.showItemIconText = Language.GetTextValue("LegacyChestType.0"); + player.cursorItemIconText = Language.GetTextValue("LegacyChestType.0"); } else { - player.showItemIconText = Main.chest[chest].name.Length > 0 ? Main.chest[chest].name : chestName; - if (player.showItemIconText == chestName) + player.cursorItemIconText = Main.chest[chest].name.Length > 0 ? Main.chest[chest].name : chestName; + if (player.cursorItemIconText == chestName) { - player.showItemIcon2 = ItemType(); - player.showItemIconText = ""; + player.cursorItemIconID = ItemType(); + player.cursorItemIconText = ""; } } player.noThrow = 2; - player.showItemIcon = true; + player.cursorItemIconEnabled = true; } public static void ChestMouseFar(string name, int i, int j) where T : ModItem { ChestMouseOver(name, i, j); Player player = Main.LocalPlayer; - if (player.showItemIconText == "") + if (player.cursorItemIconText == "") { - player.showItemIcon = false; - player.showItemIcon2 = 0; + player.cursorItemIconEnabled = false; + player.cursorItemIconID = 0; } } @@ -324,33 +324,33 @@ namespace CalamityMod top--; } int chestIndex = Chest.FindChest(left, top); - player.showItemIcon2 = -1; + player.cursorItemIconID = -1; if (chestIndex < 0) { - player.showItemIconText = Language.GetTextValue("LegacyDresserType.0"); + player.cursorItemIconText = Language.GetTextValue("LegacyDresserType.0"); } else { if (Main.chest[chestIndex].name != "") { - player.showItemIconText = Main.chest[chestIndex].name; + player.cursorItemIconText = Main.chest[chestIndex].name; } else { - player.showItemIconText = chestName; + player.cursorItemIconText = chestName; } - if (player.showItemIconText == chestName) + if (player.cursorItemIconText == chestName) { - player.showItemIcon2 = ItemType(); - player.showItemIconText = ""; + player.cursorItemIconID = ItemType(); + player.cursorItemIconText = ""; } } player.noThrow = 2; - player.showItemIcon = true; - if (player.showItemIconText == "") + player.cursorItemIconEnabled = true; + if (player.cursorItemIconText == "") { - player.showItemIcon = false; - player.showItemIcon2 = 0; + player.cursorItemIconEnabled = false; + player.cursorItemIconID = 0; } } @@ -366,32 +366,32 @@ namespace CalamityMod top--; } int chestIndex = Chest.FindChest(left, top); - player.showItemIcon2 = -1; + player.cursorItemIconID = -1; if (chestIndex < 0) { - player.showItemIconText = Language.GetTextValue("LegacyDresserType.0"); + player.cursorItemIconText = Language.GetTextValue("LegacyDresserType.0"); } else { if (Main.chest[chestIndex].name != "") { - player.showItemIconText = Main.chest[chestIndex].name; + player.cursorItemIconText = Main.chest[chestIndex].name; } else { - player.showItemIconText = chestName; + player.cursorItemIconText = chestName; } - if (player.showItemIconText == chestName) + if (player.cursorItemIconText == chestName) { - player.showItemIcon2 = ItemType(); - player.showItemIconText = ""; + player.cursorItemIconID = ItemType(); + player.cursorItemIconText = ""; } } player.noThrow = 2; - player.showItemIcon = true; + player.cursorItemIconEnabled = true; if (Main.tile[Player.tileTargetX, Player.tileTargetY].TileFrameY > 0) { - player.showItemIcon2 = ItemID.FamiliarShirt; + player.cursorItemIconID = ItemID.FamiliarShirt; } } @@ -506,24 +506,24 @@ namespace CalamityMod top--; } int chest = Chest.FindChest(left, top); - player.showItemIcon2 = -1; + player.cursorItemIconID = -1; if (chest < 0) { - player.showItemIconText = Language.GetTextValue("LegacyChestType.0"); + player.cursorItemIconText = Language.GetTextValue("LegacyChestType.0"); } else { - player.showItemIconText = Main.chest[chest].name.Length > 0 ? Main.chest[chest].name : chestName; - if (player.showItemIconText == chestName) + player.cursorItemIconText = Main.chest[chest].name.Length > 0 ? Main.chest[chest].name : chestName; + if (player.cursorItemIconText == chestName) { - player.showItemIcon2 = ItemType(); + player.cursorItemIconID = ItemType(); if (Main.tile[left, top].TileFrameX / 36 == 1) - player.showItemIcon2 = ItemType(); - player.showItemIconText = ""; + player.cursorItemIconID = ItemType(); + player.cursorItemIconText = ""; } } player.noThrow = 2; - player.showItemIcon = true; + player.cursorItemIconEnabled = true; } public static void LockedChestMouseOverFar(string chestName, int i, int j) @@ -531,10 +531,10 @@ namespace CalamityMod { LockedChestMouseOver(chestName, i, j); Player player = Main.LocalPlayer; - if (player.showItemIconText == "") + if (player.cursorItemIconText == "") { - player.showItemIcon = false; - player.showItemIcon2 = 0; + player.cursorItemIconEnabled = false; + player.cursorItemIconID = 0; } } From d5239b806c14793f5df0961664d2a173b57d74e2 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Tue, 5 Apr 2022 20:22:34 -0500 Subject: [PATCH 3/4] Cleaned out CalamityGlobalTile --- Tiles/CalamityGlobalTile.cs | 117 +++++++++++++++++------------------- 1 file changed, 56 insertions(+), 61 deletions(-) diff --git a/Tiles/CalamityGlobalTile.cs b/Tiles/CalamityGlobalTile.cs index 4b14d3e0c0..a1de6cab3d 100644 --- a/Tiles/CalamityGlobalTile.cs +++ b/Tiles/CalamityGlobalTile.cs @@ -1,4 +1,4 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.Items.Potions; using CalamityMod.Items.TreasureBags; using CalamityMod.Items.Weapons.Melee; @@ -17,6 +17,7 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; using Terraria; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -24,7 +25,7 @@ namespace CalamityMod.Tiles { public class CalamityGlobalTile : GlobalTile { - public static IList WaterStyles => (IList)typeof(WaterStyleLoader).GetField("waterStyles", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null); + public static IList WaterStyles => (IList)typeof(WaterStylesLoader).GetField("waterStyles", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null); public static ushort[] PlantTypes = new ushort[] { @@ -36,22 +37,22 @@ namespace CalamityMod.Tiles TileID.JunglePlants2, TileID.HallowedPlants, TileID.HallowedPlants2, - TileID.FleshWeeds, + TileID.CrimsonPlants, (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; - public static List GrowthTiles = new List + public static List GrowthTiles = new List() { - (ushort)ModContent.TileType(), - (ushort)ModContent.TileType(), - (ushort)ModContent.TileType() + ModContent.TileType(), + ModContent.TileType(), + ModContent.TileType() }; public override void SetStaticDefaults() { Main.tileSpelunker[TileID.LunarOre] = true; - Main.tileValue[TileID.LunarOre] = 900; + Main.tileOreFinderPriority[TileID.LunarOre] = 900; } public override bool PreHitWire(int i, int j, int type) @@ -94,32 +95,28 @@ namespace CalamityMod.Tiles int frameY = tile.TileFrameY; // Search down the cactus to find out whether the block it is planted in is Astral Sand. - bool astralCactus = false; - if (!Main.canDrawColorTile(i, j)) - { - int xTile = i; - if (frameX == 36) // Cactus segment which splits left - xTile--; - if (frameX == 54) // Cactus segment which splits right - xTile++; - if (frameX == 108) // Cactus segment which splits both directions - xTile += (frameY == 18) ? -1 : 1; + int xTile = i; + if (frameX == 36) // Cactus segment which splits left + xTile--; + if (frameX == 54) // Cactus segment which splits right + xTile++; + if (frameX == 108) // Cactus segment which splits both directions + xTile += (frameY == 18) ? -1 : 1; - int yTile = j; - bool slidingDownCactus = Main.tile[xTile, yTile] != null && Main.tile[xTile, yTile].TileType == TileID.Cactus && Main.tile[xTile, yTile].HasTile; - while (!Main.tile[xTile, yTile].HasTile || !Main.tileSolid[Main.tile[xTile, yTile].TileType] || !slidingDownCactus) + int yTile = j; + bool slidingDownCactus = Main.tile[xTile, yTile] != null && Main.tile[xTile, yTile].TileType == TileID.Cactus && Main.tile[xTile, yTile].HasTile; + while (!Main.tile[xTile, yTile].HasTile || !Main.tileSolid[Main.tile[xTile, yTile].TileType] || !slidingDownCactus) + { + if (Main.tile[xTile, yTile].TileType == TileID.Cactus && Main.tile[xTile, yTile].HasTile) { - if (Main.tile[xTile, yTile].TileType == TileID.Cactus && Main.tile[xTile, yTile].HasTile) - { - slidingDownCactus = true; - } - yTile++; - // Cacti are assumed to be no more than 20 blocks tall. - if (yTile > i + 20) - break; + slidingDownCactus = true; } - astralCactus = Main.tile[xTile, yTile].TileType == (ushort)ModContent.TileType(); + yTile++; + // Cacti are assumed to be no more than 20 blocks tall. + if (yTile > i + 20) + break; } + bool astralCactus = Main.tile[xTile, yTile].TileType == (ushort)ModContent.TileType(); // If it is actually astral cactus, then draw its glowmask. if (astralCactus) @@ -134,20 +131,18 @@ namespace CalamityMod.Tiles public override void KillTile(int i, int j, int type, ref bool fail, ref bool effectOnly, ref bool noItem) { Tile tile = Main.tile[i, j]; - if (tile is null) - return; // Helper function to shatter crystals attached to neighboring solid tiles. - void CheckShatterCrystal(int xPos, int yPos) + static void CheckShatterCrystal(int xPos, int yPos) { if (xPos < 0 || xPos >= Main.maxTilesX || yPos < 0 || yPos >= Main.maxTilesY) return; Tile t = Main.tile[xPos, yPos]; - if (t != null && t.HasTile && (t.TileType == ModContent.TileType() || (t.TileType == ModContent.TileType() && DownedBossSystem.downedDesertScourge))) + if (t.HasTile && (t.TileType == ModContent.TileType() || (t.TileType == ModContent.TileType() && DownedBossSystem.downedDesertScourge))) { WorldGen.KillTile(xPos, yPos, false, false, false); if (!Main.tile[xPos, yPos].HasTile && Main.netMode != NetmodeID.SinglePlayer) - NetMessage.SendData(MessageID.TileChange, -1, -1, null, 0, xPos, yPos, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.TileManipulation, -1, -1, null, 0, xPos, yPos, 0f, 0, 0, 0); } } @@ -180,22 +175,22 @@ namespace CalamityMod.Tiles { if (type == ModContent.TileType()) { - Item.NewItem(i * 16, j * 16, 16, 16, ModContent.ItemType()); + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ModContent.ItemType()); for (int k = 0; k < Main.rand.Next(1, 2 + 1); k++) { - Gore.NewGore(new Vector2(i, j) * 16, Main.rand.NextVector2CircularEdge(3f, 3f), Mod.GetGoreSlot("Gores/SulphSeaGen/AbyssPotGore1")); - Gore.NewGore(new Vector2(i, j) * 16, Main.rand.NextVector2CircularEdge(3f, 3f), Mod.GetGoreSlot("Gores/SulphSeaGen/AbyssPotGore2")); + Gore.NewGore(new Vector2(i, j) * 16, Main.rand.NextVector2CircularEdge(3f, 3f), Mod.Find("Gores/SulphSeaGen/AbyssPotGore1").Type); + Gore.NewGore(new Vector2(i, j) * 16, Main.rand.NextVector2CircularEdge(3f, 3f), Mod.Find("Gores/SulphSeaGen/AbyssPotGore2").Type); } } else if (type == ModContent.TileType()) { - Item.NewItem(i * 16, j * 16, 16, 16, ModContent.ItemType()); + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ModContent.ItemType()); for (int k = 0; k < Main.rand.Next(1, 2 + 1); k++) { - Gore.NewGore(new Vector2(i, j) * 16, Main.rand.NextVector2CircularEdge(3f, 3f), Mod.GetGoreSlot("Gores/SulphSeaGen/SulphPotGore1")); - Gore.NewGore(new Vector2(i, j) * 16, Main.rand.NextVector2CircularEdge(3f, 3f), Mod.GetGoreSlot("Gores/SulphSeaGen/SulphPotGore2")); + Gore.NewGore(new Vector2(i, j) * 16, Main.rand.NextVector2CircularEdge(3f, 3f), Mod.Find("Gores/SulphSeaGen/SulphPotGore1").Type); + Gore.NewGore(new Vector2(i, j) * 16, Main.rand.NextVector2CircularEdge(3f, 3f), Mod.Find("Gores/SulphSeaGen/SulphPotGore2").Type); } } else if (type == TileID.DemonAltar && Main.hardMode) @@ -209,11 +204,11 @@ namespace CalamityMod.Tiles { pos.X += Main.rand.NextFloat(-32f, 32f); pos.Y += Main.rand.NextFloat(-32f, 32f); - Item.NewItem(pos, ItemID.SoulofNight); + Item.NewItem(new EntitySource_TileBreak(i, j), pos, ItemID.SoulofNight); } } if (WorldGen.altarCount % 3 == 0 && WorldGen.altarCount > 1) - Item.NewItem(pos, ModContent.ItemType()); + Item.NewItem(new EntitySource_TileBreak(i, j), pos, ModContent.ItemType()); } } @@ -283,7 +278,7 @@ namespace CalamityMod.Tiles ItemID.LifeforcePotion, ItemID.InfernoPotion }); - Item.NewItem(i * 16, j * 16, 16, 16, potionType, 1, false, 0, false, false); + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, potionType, 1, false, 0, false, false); } else { @@ -295,20 +290,20 @@ namespace CalamityMod.Tiles { sglowstickAmt += Main.rand.Next(1, 7); } - Item.NewItem(i * 16, j * 16, 16, 16, ItemID.SpelunkerGlowstick, sglowstickAmt, false, 0, false, false); + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ItemID.SpelunkerGlowstick, sglowstickAmt, false, 0, false, false); } else if (lootType == 1) //hellfire arrows { int arrowAmt = Main.rand.Next(10, 21); - Item.NewItem(i * 16, j * 16, 16, 16, ItemID.HellfireArrow, arrowAmt, false, 0, false, false); + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ItemID.HellfireArrow, arrowAmt, false, 0, false, false); } else if (lootType == 2) //stew { - Item.NewItem(i * 16, j * 16, 16, 16, ModContent.ItemType(), 1, false, 0, false, false); + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ModContent.ItemType(), 1, false, 0, false, false); } else if (lootType == 3) //sticky dynamite { - Item.NewItem(i * 16, j * 16, 16, 16, ItemID.StickyDynamite, 1, false, 0, false, false); + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ItemID.StickyDynamite, 1, false, 0, false, false); } else //money { @@ -327,7 +322,7 @@ namespace CalamityMod.Tiles ptCoinAmt /= Main.rand.Next(3) + 1; } num13 -= (float)(1000000 * ptCoinAmt); - Item.NewItem(i * 16, j * 16, 16, 16, ItemID.PlatinumCoin, ptCoinAmt, false, 0, false, false); + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ItemID.PlatinumCoin, ptCoinAmt, false, 0, false, false); } else if (num13 > 10000f) { @@ -341,7 +336,7 @@ namespace CalamityMod.Tiles auCoinAmt /= Main.rand.Next(3) + 1; } num13 -= (float)(10000 * auCoinAmt); - Item.NewItem(i * 16, j * 16, 16, 16, ItemID.GoldCoin, auCoinAmt, false, 0, false, false); + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ItemID.GoldCoin, auCoinAmt, false, 0, false, false); } else if (num13 > 100f) { @@ -355,7 +350,7 @@ namespace CalamityMod.Tiles agCoinAmt /= Main.rand.Next(3) + 1; } num13 -= (float)(100 * agCoinAmt); - Item.NewItem(i * 16, j * 16, 16, 16, ItemID.SilverCoin, agCoinAmt, false, 0, false, false); + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ItemID.SilverCoin, agCoinAmt, false, 0, false, false); } else { @@ -373,7 +368,7 @@ namespace CalamityMod.Tiles cuCoinAmt = 1; } num13 -= (float)cuCoinAmt; - Item.NewItem(i * 16, j * 16, 16, 16, ItemID.CopperCoin, cuCoinAmt, false, 0, false, false); + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ItemID.CopperCoin, cuCoinAmt, false, 0, false, false); } } } @@ -402,7 +397,7 @@ namespace CalamityMod.Tiles ItemID.LifeforcePotion, ItemID.InfernoPotion }); - Item.NewItem(i * 16, j * 16, 16, 16, potionType, 1, false, 0, false, false); + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, potionType, 1, false, 0, false, false); } else { @@ -414,21 +409,21 @@ namespace CalamityMod.Tiles { glowstickAmt += Main.rand.Next(1, 7); } - Item.NewItem(i * 16, j * 16, 16, 16, ItemID.Glowstick, glowstickAmt, false, 0, false, false); + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ItemID.Glowstick, glowstickAmt, false, 0, false, false); } else if (lootType == 1) //jesters arrows { int jArrowAmt = Main.rand.Next(10, 21); - Item.NewItem(i * 16, j * 16, 16, 16, ItemID.JestersArrow, jArrowAmt, false, 0, false, false); + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ItemID.JestersArrow, jArrowAmt, false, 0, false, false); } else if (lootType == 2) //potion { - Item.NewItem(i * 16, j * 16, 16, 16, ItemID.HealingPotion, 1, false, 0, false, false); + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ItemID.HealingPotion, 1, false, 0, false, false); } else if (lootType == 3) //bomb { int bombAmt = Main.rand.Next(5, 9); - Item.NewItem(i * 16, j * 16, 16, 16, ItemID.Bomb, bombAmt, false, 0, false, false); + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ItemID.Bomb, bombAmt, false, 0, false, false); } else //money { @@ -447,7 +442,7 @@ namespace CalamityMod.Tiles ptCoinAmt /= Main.rand.Next(3) + 1; } num13 -= (float)(1000000 * ptCoinAmt); - Item.NewItem(i * 16, j * 16, 16, 16, ItemID.PlatinumCoin, ptCoinAmt, false, 0, false, false); + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ItemID.PlatinumCoin, ptCoinAmt, false, 0, false, false); } else if (num13 > 10000f) { @@ -461,7 +456,7 @@ namespace CalamityMod.Tiles auCoinAmt /= Main.rand.Next(3) + 1; } num13 -= (float)(10000 * auCoinAmt); - Item.NewItem(i * 16, j * 16, 16, 16, ItemID.GoldCoin, auCoinAmt, false, 0, false, false); + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ItemID.GoldCoin, auCoinAmt, false, 0, false, false); } else if (num13 > 100f) { @@ -475,7 +470,7 @@ namespace CalamityMod.Tiles agCoinAmt /= Main.rand.Next(3) + 1; } num13 -= (float)(100 * agCoinAmt); - Item.NewItem(i * 16, j * 16, 16, 16, ItemID.SilverCoin, agCoinAmt, false, 0, false, false); + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ItemID.SilverCoin, agCoinAmt, false, 0, false, false); } else { @@ -493,7 +488,7 @@ namespace CalamityMod.Tiles cuCoinAmt = 1; } num13 -= (float)cuCoinAmt; - Item.NewItem(i * 16, j * 16, 16, 16, ItemID.CopperCoin, cuCoinAmt, false, 0, false, false); + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ItemID.CopperCoin, cuCoinAmt, false, 0, false, false); } } } From 9b33a4e406c20f6af44f7ee87dfe31f8a704de58 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Tue, 5 Apr 2022 20:55:57 -0500 Subject: [PATCH 4/4] Cleaned out CalamityGlobalNPC --- CalPlayer/CalamityPlayer.cs | 1 + CalamityMod.cs | 25 --- NPCs/CalamityGlobalNPC.cs | 190 +++++++++++----------- Systems/DoGPhase2TransitionMusicSystem.cs | 15 ++ 4 files changed, 108 insertions(+), 123 deletions(-) create mode 100644 Systems/DoGPhase2TransitionMusicSystem.cs diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index cbee76058b..003d60b2b3 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -2690,6 +2690,7 @@ namespace CalamityMod.CalPlayer if (Main.snowTiles > 300) Player.ZoneSnow = true; } + public override Texture2D GetMapBackgroundImage() { if (ZoneSulphur) diff --git a/CalamityMod.cs b/CalamityMod.cs index 6f33279276..fd6eb231a0 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -752,31 +752,6 @@ namespace CalamityMod // This function returns an available Calamity Music Mod track, or null if the Calamity Music Mod is not available. public int? GetMusicFromMusicMod(string songFilename) => MusicAvailable ? MusicLoader.GetMusicSlot(musicMod, "Sounds/Music/" + songFilename) : null; - public override void UpdateMusic(ref int music, ref MusicPriority priority) - { - if (Main.musicVolume != 0) - { - if (Main.myPlayer != -1 && !Main.gameMenu && Main.LocalPlayer.active) - { - Player p = Main.LocalPlayer; - if (CalamityWorld.DoGSecondStageCountdown <= 530 && CalamityWorld.DoGSecondStageCountdown > 50) // 8 seconds before DoG returns - { - music = GetMusicFromMusicMod("DevourerOfGodsP2") ?? MusicID.LunarBoss; - priority = MusicPriority.BossMedium; - } - - // This section handles boss rush music. However, at the time of PR-ing the boss rush visuals branch not all - // of the boss rush themes have been completed. As such, the custom music is intentionally omitted for the time being. - /* - if (BossRushEvent.BossRushActive && BossRushEvent.StartTimer >= BossRushEvent.StartEffectTotalTime) - { - music = BossRushEvent.MusicToPlay; - priority = MusicPriority.BossHigh; - } - */ - } - } - } #endregion #region Mod Support diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 607a00affa..8cde7eda06 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -63,6 +63,8 @@ using CalamityMod.NPCs.ExoMechs; using CalamityMod.NPCs.VanillaNPCOverrides.Bosses; using CalamityMod.NPCs.VanillaNPCOverrides.RegularEnemies; using CalamityMod.Balancing; +using Terraria.GameContent; +using CalamityMod.Systems; namespace CalamityMod.NPCs { @@ -380,7 +382,7 @@ namespace CalamityMod.NPCs #region Life Regen public override void UpdateLifeRegen(NPC npc, ref int damage) { - if (npc.damage > 0 && !npc.boss && !npc.friendly && !npc.dontTakeDamage && CalamityWorld.sulphurTiles > 30 && + if (npc.damage > 0 && !npc.boss && !npc.friendly && !npc.dontTakeDamage && BiomeTileCounterSystem.SulphurTiles > 30 && !npc.buffImmune[BuffID.Poisoned] && !npc.buffImmune[BuffType()]) { if (npc.wet) @@ -462,15 +464,15 @@ namespace CalamityMod.NPCs Item heldItem = Main.player[owner].ActiveItem(); int totalDamage = (int)(150 * Main.player[owner].GetDamage(DamageClass.Summon)); bool forbidden = Main.player[owner].head == ArmorIDs.Head.AncientBattleArmor && Main.player[owner].body == ArmorIDs.Body.AncientBattleArmor && Main.player[owner].legs == ArmorIDs.Legs.AncientBattleArmor; - bool reducedNerf = Main.player[owner].Calamity().fearmongerSet || (forbidden && heldItem.magic); + bool reducedNerf = Main.player[owner].Calamity().fearmongerSet || (forbidden && heldItem.CountsAsClass()); double summonNerfMult = reducedNerf ? 0.75 : 0.5; if (!Main.player[owner].Calamity().profanedCrystalBuffs) { if (heldItem.type > ItemID.None) { - if (!heldItem.summon && - (heldItem.melee || heldItem.ranged || heldItem.magic || heldItem.Calamity().rogue) && + if (!heldItem.CountsAsClass() && + (heldItem.CountsAsClass() || heldItem.CountsAsClass() || heldItem.CountsAsClass() || heldItem.Calamity().rogue) && heldItem.hammer == 0 && heldItem.pick == 0 && heldItem.axe == 0 && heldItem.useStyle != 0 && !heldItem.accessory && heldItem.ammo == AmmoID.None) { @@ -2203,7 +2205,7 @@ namespace CalamityMod.NPCs public static void DrawGlowmask(NPC npc, SpriteBatch spriteBatch, Texture2D texture = null, bool invertedDirection = false, Vector2 offset = default) { if (texture is null) - texture = Main.npcTexture[npc.type]; + texture = TextureAssets.Npc[npc.type].Value; SpriteEffects effects = npc.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; if (invertedDirection) effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; @@ -2244,7 +2246,7 @@ namespace CalamityMod.NPCs endingColor.A = 0; Color drawColor = npc.GetAlpha(startingColor); - Texture2D npcTexture = texture ?? Main.npcTexture[npc.type]; + Texture2D npcTexture = texture ?? TextureAssets.Npc[npc.type].Value; Vector2 origin = npc.Size * 0.5f; int afterimageCounter = 1; while (afterimageCounter < NPCID.Sets.TrailCacheLength[npc.type] && CalamityConfig.Instance.Afterimages) @@ -2272,9 +2274,9 @@ namespace CalamityMod.NPCs if (Main.netMode == NetmodeID.SinglePlayer || numPlayers <= 1) return; - bool countsAsBoss = npc.boss || NPCID.Sets.TechnicallyABoss[npc.type]; + bool countsAsBoss = npc.boss || NPCID.Sets.ShouldBeCountedAsBoss[npc.type]; bool scalesLikeBoss = countsAsBoss || CalamityLists.bossHPScaleList.Contains(npc.type); - bool isCalamityNPC = npc.modNPC != null && npc.modNPC.Mod == CalamityMod.Instance; + bool isCalamityNPC = npc.ModNPC != null && npc.ModNPC.Mod == CalamityMod.Instance; // All bosses, NPCs that are supposed to scale like bosses, and Calamity NPCs follow these rules. if (scalesLikeBoss || isCalamityNPC) @@ -2374,7 +2376,7 @@ namespace CalamityMod.NPCs effectiveDefense = 0; // Apply vanilla-style defense before DR, using Calamity's reduced defense. - damage = Main.CalculateDamage((int)damage, effectiveDefense); + damage = Main.CalculateDamageNPCsTake((int)damage, effectiveDefense); // DR applies after vanilla defense. damage = ApplyDR(npc, damage, yellowCandleDamage); @@ -2403,7 +2405,7 @@ namespace CalamityMod.NPCs // Cancel out vanilla defense math by reversing the calculation vanilla is about to perform. // While roundabout, this is safer than returning false to stop vanilla damage calculations entirely. // Other mods will probably expect the vanilla code to run and may compensate for it themselves. - damage = Main.CalculateDamage((int)damage, -defense); + damage = Main.CalculateDamageNPCsTake((int)damage, -defense); return true; } @@ -3900,7 +3902,7 @@ namespace CalamityMod.NPCs npc.type == NPCType() || npc.type == NPCType() || CalamityLists.AresIDs.Contains(npc.type) || npc.type == NPCType()) { double damageMult = CalamityLists.ThanatosIDs.Contains(npc.type) ? 0.35 : 0.5; - if (item.melee && item.type != ItemType() && item.type != ItemType()) + if (item.CountsAsClass() && item.type != ItemType() && item.type != ItemType()) damage = (int)(damage * damageMult); } } @@ -4866,7 +4868,7 @@ namespace CalamityMod.NPCs return null; } - public override bool PreDraw(NPC npc, SpriteBatch spriteBatch, Color drawColor) + public override bool PreDraw(NPC npc, SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { if (npc.type != NPCID.BrainofCthulhu && (npc.type != NPCID.DukeFishron || npc.ai[0] <= 9f) && npc.active) { @@ -4876,123 +4878,123 @@ namespace CalamityMod.NPCs // Damage over time debuffs if (aFlames > 0) - buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/AbyssalFlames")); + buffTextureList.Add(Request("CalamityMod/Buffs/DamageOverTime/AbyssalFlames").Value); if (astralInfection > 0) - buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/AstralInfectionDebuff")); + buffTextureList.Add(Request("CalamityMod/Buffs/DamageOverTime/AstralInfectionDebuff").Value); if (bFlames > 0) - buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/BrimstoneFlames")); + buffTextureList.Add(Request("CalamityMod/Buffs/DamageOverTime/BrimstoneFlames").Value); if (bBlood > 0) - buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/BurningBlood")); + buffTextureList.Add(Request("CalamityMod/Buffs/DamageOverTime/BurningBlood").Value); if (cDepth > 0) - buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/CrushDepth")); + buffTextureList.Add(Request("CalamityMod/Buffs/DamageOverTime/CrushDepth").Value); if (dFlames > 0) - buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/DemonFlames")); + buffTextureList.Add(Request("CalamityMod/Buffs/DamageOverTime/DemonFlames").Value); if (gsInferno > 0) - buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/GodSlayerInferno")); + buffTextureList.Add(Request("CalamityMod/Buffs/DamageOverTime/GodSlayerInferno").Value); if (hFlames > 0) - buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/HolyFlames")); + buffTextureList.Add(Request("CalamityMod/Buffs/DamageOverTime/HolyFlames").Value); if (nightwither > 0) - buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/Nightwither")); + buffTextureList.Add(Request("CalamityMod/Buffs/DamageOverTime/Nightwither").Value); if (pFlames > 0) - buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/Plague")); + buffTextureList.Add(Request("CalamityMod/Buffs/DamageOverTime/Plague").Value); if (shellfishVore > 0) - buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/ShellfishEating")); + buffTextureList.Add(Request("CalamityMod/Buffs/DamageOverTime/ShellfishEating").Value); if (somaShredStacks > 0) - buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/Shred")); + buffTextureList.Add(Request("CalamityMod/Buffs/DamageOverTime/Shred").Value); if (clamDebuff > 0) - buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/SnapClamDebuff")); + buffTextureList.Add(Request("CalamityMod/Buffs/DamageOverTime/SnapClamDebuff").Value); if (sulphurPoison > 0) - buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/SulphuricPoisoning")); + buffTextureList.Add(Request("CalamityMod/Buffs/DamageOverTime/SulphuricPoisoning").Value); if (sagePoisonTime > 0) - buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/SagePoison")); + buffTextureList.Add(Request("CalamityMod/Buffs/DamageOverTime/SagePoison").Value); if (vaporfied > 0) - buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/Vaporfied")); + buffTextureList.Add(Request("CalamityMod/Buffs/DamageOverTime/Vaporfied").Value); // Stat debuffs if (aCrunch > 0) - buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/ArmorCrunch")); + buffTextureList.Add(Request("CalamityMod/Buffs/StatDebuffs/ArmorCrunch").Value); if (enraged > 0) - buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/Enraged")); + buffTextureList.Add(Request("CalamityMod/Buffs/StatDebuffs/Enraged").Value); if (eutrophication > 0) - buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/Eutrophication")); + buffTextureList.Add(Request("CalamityMod/Buffs/StatDebuffs/Eutrophication").Value); if (eFreeze > 0) - buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/ExoFreeze")); + buffTextureList.Add(Request("CalamityMod/Buffs/StatDebuffs/ExoFreeze").Value); if (gState > 0) - buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/GlacialState")); + buffTextureList.Add(Request("CalamityMod/Buffs/StatDebuffs/GlacialState").Value); if (irradiated > 0) - buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/Irradiated")); + buffTextureList.Add(Request("CalamityMod/Buffs/StatDebuffs/Irradiated").Value); if (kamiFlu > 0) - buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/KamiDebuff")); + buffTextureList.Add(Request("CalamityMod/Buffs/StatDebuffs/KamiDebuff").Value); if (marked > 0) - buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/MarkedforDeath")); + buffTextureList.Add(Request("CalamityMod/Buffs/StatDebuffs/MarkedforDeath").Value); if (pearlAura > 0) - buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/PearlAura")); + buffTextureList.Add(Request("CalamityMod/Buffs/StatDebuffs/PearlAura").Value); if (relicOfResilienceWeakness > 0) - buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/ProfanedWeakness")); + buffTextureList.Add(Request("CalamityMod/Buffs/StatDebuffs/ProfanedWeakness").Value); if (tSad > 0) - buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/TemporalSadness")); + buffTextureList.Add(Request("CalamityMod/Buffs/StatDebuffs/TemporalSadness").Value); if (tesla > 0) - buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/TeslaFreeze")); + buffTextureList.Add(Request("CalamityMod/Buffs/StatDebuffs/TeslaFreeze").Value); if (timeSlow > 0) - buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/TimeSlow")); + buffTextureList.Add(Request("CalamityMod/Buffs/StatDebuffs/TimeSlow").Value); if (wCleave > 0) - buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/WarCleave")); + buffTextureList.Add(Request("CalamityMod/Buffs/StatDebuffs/WarCleave").Value); if (wDeath > 0) - buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/WhisperingDeath")); + buffTextureList.Add(Request("CalamityMod/Buffs/StatDebuffs/WhisperingDeath").Value); if (wither > 0) - buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/WitherDebuff")); + buffTextureList.Add(Request("CalamityMod/Buffs/StatDebuffs/WitherDebuff").Value); // Vanilla damage over time debuffs if (electrified > 0) - buffTextureList.Add(Main.buffTexture[BuffID.Electrified]); + buffTextureList.Add(TextureAssets.Buff[BuffID.Electrified].Value); if (npc.onFire) - buffTextureList.Add(Main.buffTexture[BuffID.OnFire]); + buffTextureList.Add(TextureAssets.Buff[BuffID.OnFire].Value); if (npc.poisoned) - buffTextureList.Add(Main.buffTexture[BuffID.Poisoned]); + buffTextureList.Add(TextureAssets.Buff[BuffID.Poisoned].Value); if (npc.onFire2) - buffTextureList.Add(Main.buffTexture[BuffID.CursedInferno]); + buffTextureList.Add(TextureAssets.Buff[BuffID.CursedInferno].Value); if (npc.onFrostBurn) - buffTextureList.Add(Main.buffTexture[BuffID.Frostburn]); + buffTextureList.Add(TextureAssets.Buff[BuffID.Frostburn].Value); if (npc.venom) - buffTextureList.Add(Main.buffTexture[BuffID.Venom]); + buffTextureList.Add(TextureAssets.Buff[BuffID.Venom].Value); if (npc.shadowFlame) - buffTextureList.Add(Main.buffTexture[BuffID.ShadowFlame]); + buffTextureList.Add(TextureAssets.Buff[BuffID.ShadowFlame].Value); if (npc.oiled) - buffTextureList.Add(Main.buffTexture[BuffID.Oiled]); + buffTextureList.Add(TextureAssets.Buff[BuffID.Oiled].Value); if (npc.javelined) - buffTextureList.Add(Main.buffTexture[BuffID.BoneJavelin]); + buffTextureList.Add(TextureAssets.Buff[BuffID.BoneJavelin].Value); if (npc.daybreak) - buffTextureList.Add(Main.buffTexture[BuffID.Daybreak]); + buffTextureList.Add(TextureAssets.Buff[BuffID.Daybreak].Value); if (npc.celled) - buffTextureList.Add(Main.buffTexture[BuffID.StardustMinionBleed]); + buffTextureList.Add(TextureAssets.Buff[BuffID.StardustMinionBleed].Value); if (npc.dryadBane) - buffTextureList.Add(Main.buffTexture[BuffID.DryadsWardDebuff]); + buffTextureList.Add(TextureAssets.Buff[BuffID.DryadsWardDebuff].Value); if (npc.dryadWard) - buffTextureList.Add(Main.buffTexture[BuffID.DryadsWard]); + buffTextureList.Add(TextureAssets.Buff[BuffID.DryadsWard].Value); if (npc.soulDrain && npc.realLife == -1) - buffTextureList.Add(Main.buffTexture[BuffID.SoulDrain]); + buffTextureList.Add(TextureAssets.Buff[BuffID.SoulDrain].Value); // Vanilla stat debuffs if (npc.confused) - buffTextureList.Add(Main.buffTexture[BuffID.Confused]); + buffTextureList.Add(TextureAssets.Buff[BuffID.Confused].Value); if (npc.ichor) - buffTextureList.Add(Main.buffTexture[BuffID.Ichor]); + buffTextureList.Add(TextureAssets.Buff[BuffID.Ichor].Value); if (slowed > 0) - buffTextureList.Add(Main.buffTexture[BuffID.Slow]); + buffTextureList.Add(TextureAssets.Buff[BuffID.Slow].Value); if (webbed > 0) - buffTextureList.Add(Main.buffTexture[BuffID.Webbed]); + buffTextureList.Add(TextureAssets.Buff[BuffID.Webbed].Value); if (npc.midas) - buffTextureList.Add(Main.buffTexture[BuffID.Midas]); + buffTextureList.Add(TextureAssets.Buff[BuffID.Midas].Value); if (npc.loveStruck) - buffTextureList.Add(Main.buffTexture[BuffID.Lovestruck]); + buffTextureList.Add(TextureAssets.Buff[BuffID.Lovestruck].Value); if (npc.stinky) - buffTextureList.Add(Main.buffTexture[BuffID.Stinky]); + buffTextureList.Add(TextureAssets.Buff[BuffID.Stinky].Value); if (npc.betsysCurse) - buffTextureList.Add(Main.buffTexture[BuffID.BetsysCurse]); + buffTextureList.Add(TextureAssets.Buff[BuffID.BetsysCurse].Value); if (npc.dripping) - buffTextureList.Add(Main.buffTexture[BuffID.Wet]); + buffTextureList.Add(TextureAssets.Buff[BuffID.Wet].Value); if (npc.drippingSlime) - buffTextureList.Add(Main.buffTexture[BuffID.Slimed]); + buffTextureList.Add(TextureAssets.Buff[BuffID.Slimed].Value); // Total amount of elements in the buff list int buffTextureListLength = buffTextureList.Count; @@ -5008,14 +5010,11 @@ namespace CalamityMod.NPCs float drawPosX = totalLength >= 80f ? 40f : (float)(totalLength / 2); // The height of a single frame of the npc - float npcHeight = (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2) * npc.scale; + float npcHeight = (float)(TextureAssets.Npc[npc.type].Value.Height / Main.npcFrameCount[npc.type] / 2) * npc.scale; // Offset the debuff display based on the npc's graphical offset, and 16 units, to create some space between the sprite and the display float drawPosY = npcHeight + npc.gfxOffY + 16f; - // The position where the display is drawn - Vector2 drawPos = npc.Center - Main.screenPosition; - // Iterate through the buff texture list for (int i = 0; i < buffTextureList.Count; i++) { @@ -5033,7 +5032,7 @@ namespace CalamityMod.NPCs // Draw the display var tex = buffTextureList.ElementAt(i); - spriteBatch.Draw(tex, drawPos - new Vector2(drawPosX, drawPosY + additionalYOffset), null, Color.White, 0f, default, 0.5f, SpriteEffects.None, 0f); + spriteBatch.Draw(tex, npc.Center - screenPos - new Vector2(drawPosX, drawPosY + additionalYOffset), null, Color.White, 0f, default, 0.5f, SpriteEffects.None, 0f); // TODO -- Show number of Shred stacks (how?) } @@ -5051,19 +5050,19 @@ namespace CalamityMod.NPCs if (npc.type == NPCID.GolemHeadFree) { // Draw the head as usual. - Texture2D golemHeadTexture = Main.npcTexture[npc.type]; - Vector2 headDrawPosition = npc.Center + Vector2.UnitY * npc.gfxOffY - Main.screenPosition; + Texture2D golemHeadTexture = TextureAssets.Npc[npc.type].Value; + Vector2 headDrawPosition = npc.Center - screenPos; spriteBatch.Draw(golemHeadTexture, headDrawPosition, npc.frame, npc.GetAlpha(drawColor), 0f, npc.frame.Size() * 0.5f, npc.scale, SpriteEffects.None, 0f); // Draw the eyes. The way vanilla handles this is hardcoded bullshit that cannot handle different hitboxes and thus requires rewriting. Color eyeColor = new Color(Main.mouseTextColor, Main.mouseTextColor, Main.mouseTextColor, 0); Vector2 eyesDrawPosition = headDrawPosition - npc.scale * new Vector2(1f, 12f); - Rectangle eyesFrame = new Rectangle(0, 0, Main.golemTexture[1].Width, Main.golemTexture[1].Height / 2); - spriteBatch.Draw(Main.golemTexture[1], eyesDrawPosition, eyesFrame, eyeColor, 0f, eyesFrame.Size() * 0.5f, npc.scale, SpriteEffects.None, 0f); + Rectangle eyesFrame = new Rectangle(0, 0, TextureAssets.Golem[1].Value.Width, TextureAssets.Golem[1].Value.Height / 2); + spriteBatch.Draw(TextureAssets.Golem[1].Value, eyesDrawPosition, eyesFrame, eyeColor, 0f, eyesFrame.Size() * 0.5f, npc.scale, SpriteEffects.None, 0f); return false; } - if (Main.LocalPlayer.Calamity().trippy) + if (Main.LocalPlayer.Calamity().trippy && !npc.IsABestiaryIconDummy) { SpriteEffects spriteEffects = SpriteEffects.None; if (npc.spriteDirection == 1) @@ -5072,7 +5071,7 @@ namespace CalamityMod.NPCs } float num66 = 0f; - Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2); + Vector2 vector11 = new Vector2(TextureAssets.Npc[npc.type].Value.Width / 2, TextureAssets.Npc[npc.type].Value.Height / Main.npcFrameCount[npc.type] / 2); Color color9 = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, 0); Color alpha15 = npc.GetAlpha(color9); float num212 = 0.99f; @@ -5108,7 +5107,7 @@ namespace CalamityMod.NPCs position9.Y -= npc.height / 2; - Main.spriteBatch.Draw(Main.npcTexture[npc.type], new Vector2(position9.X - Main.screenPosition.X + npc.width / 2 - Main.npcTexture[npc.type].Width * npc.scale / 2f + vector11.X * npc.scale, position9.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + vector11.Y * npc.scale + num66 + npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(npc.frame), alpha15, npc.rotation, vector11, npc.scale, spriteEffects, 0f); + Main.spriteBatch.Draw(TextureAssets.Npc[npc.type].Value, new Vector2(position9.X - screenPos.X + npc.width / 2 - TextureAssets.Npc[npc.type].Value.Width * npc.scale / 2f + vector11.X * npc.scale, position9.Y - screenPos.Y + npc.height - TextureAssets.Npc[npc.type].Value.Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + vector11.Y * npc.scale + num66 + npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(npc.frame), alpha15, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } else @@ -5144,27 +5143,27 @@ namespace CalamityMod.NPCs Filters.Scene["CrystalDestructionColor"].GetShader().UseIntensity((float)Math.Sin(animationTime * MathHelper.Pi) * 0.4f); } - Vector2 drawPosition = npc.Center - Main.screenPosition + Vector2.UnitY * 60f; + Vector2 drawPosition = npc.Center - screenPos + Vector2.UnitY * 60f; for (int i = 0; i < 4; i++) { float intensity = MathHelper.Clamp(animationTime * 2f - i / 3f, 0f, 1f); - Vector2 origin = new Vector2(Main.magicPixel.Width / 2f, Main.magicPixel.Height); + Vector2 origin = new Vector2(TextureAssets.MagicPixel.Value.Width / 2f, TextureAssets.MagicPixel.Value.Height); Vector2 scale = new Vector2((float)Math.Sqrt(intensity) * 50f, intensity * 4f); Color beamColor = new Color(0.4f, 0.17f, 0.4f, 0f) * (intensity * (1f - MathHelper.Clamp((animationTime - 0.8f) / 0.2f, 0f, 1f))) * 0.5f; - spriteBatch.Draw(Main.magicPixel, drawPosition, null, beamColor, 0f, origin, scale, SpriteEffects.None, 0f); + spriteBatch.Draw(TextureAssets.MagicPixel.Value, drawPosition, null, beamColor, 0f, origin, scale, SpriteEffects.None, 0f); } } return true; } - public override void PostDraw(NPC npc, SpriteBatch spriteBatch, Color drawColor) + public override void PostDraw(NPC npc, SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { if (CalamityWorld.revenge || BossRushEvent.BossRushActive) { // His afterimages I can't get to work, so fuck it if (npc.type == NPCID.SkeletronPrime) { - Texture2D npcTexture = Main.npcTexture[npc.type]; + Texture2D npcTexture = TextureAssets.Npc[npc.type].Value; int frameHeight = npcTexture.Height / Main.npcFrameCount[npc.type]; npc.frame.Y = (int)newAI[3]; @@ -5203,16 +5202,16 @@ namespace CalamityMod.NPCs if (npc.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - spriteBatch.Draw(npcTexture, npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), npc.frame, npc.GetAlpha(drawColor), npc.rotation, npc.frame.Size() / 2, npc.scale, spriteEffects, 0f); + spriteBatch.Draw(npcTexture, npc.Center - screenPos + new Vector2(0, npc.gfxOffY), npc.frame, npc.GetAlpha(drawColor), npc.rotation, npc.frame.Size() / 2, npc.scale, spriteEffects, 0f); - spriteBatch.Draw(Main.BoneEyesTexture, npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), + spriteBatch.Draw(TextureAssets.BoneEyes.Value, npc.Center - screenPos + new Vector2(0, npc.gfxOffY), npc.frame, new Color(200, 200, 200, 0), npc.rotation, npc.frame.Size() / 2, npc.scale, spriteEffects, 0f); } else if (CalamityLists.DestroyerIDs.Contains(npc.type)) { if (drawColor != Color.Black) { - Texture2D npcTexture = Main.npcTexture[npc.type]; + Texture2D npcTexture = TextureAssets.Npc[npc.type].Value; int frameHeight = npcTexture.Height / Main.npcFrameCount[npc.type]; Vector2 halfSize = npc.frame.Size() / 2; @@ -5229,7 +5228,7 @@ namespace CalamityMod.NPCs } // Draw segments - spriteBatch.Draw(npcTexture, npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), + spriteBatch.Draw(npcTexture, npc.Center - screenPos + new Vector2(0, npc.gfxOffY), npc.frame, npc.GetAlpha(drawColor), npc.rotation, halfSize, npc.scale, spriteEffects, 0f); // Draw lights @@ -5237,12 +5236,12 @@ namespace CalamityMod.NPCs { if ((newAI[3] >= 900f && npc.life / (float)npc.lifeMax < 0.5f) || (newAI[1] < 600f && newAI[1] > 60f)) { - spriteBatch.Draw(Main.destTexture[npc.type - NPCID.TheDestroyer], npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), npc.frame, + spriteBatch.Draw(TextureAssets.Dest[npc.type - NPCID.TheDestroyer].Value, npc.Center - screenPos + new Vector2(0, npc.gfxOffY), npc.frame, new Color(50, 50, 255, 0) * (1f - npc.alpha / 255f), npc.rotation, halfSize, npc.scale, spriteEffects, 0f); } else { - spriteBatch.Draw(Main.destTexture[npc.type - NPCID.TheDestroyer], npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), npc.frame, + spriteBatch.Draw(TextureAssets.Dest[npc.type - NPCID.TheDestroyer].Value, npc.Center - screenPos + new Vector2(0, npc.gfxOffY), npc.frame, new Color(255, 255, 255, 0) * (1f - npc.alpha / 255f), npc.rotation, halfSize, npc.scale, spriteEffects, 0f); } } @@ -5561,7 +5560,7 @@ namespace CalamityMod.NPCs { if (plr == Main.myPlayer && projectile.ai[0] == 0f) { - for (int item = 0; item < Main.maxInventory; item++) + for (int item = 0; item < Main.InventorySlotsTotal; item++) { if (player.inventory[item].type == baitType) { @@ -5603,7 +5602,7 @@ namespace CalamityMod.NPCs if (proj is null) return; - int oldDuke = NPC.NewNPC((int)proj.Center.X, (int)proj.Center.Y + 100, NPCType()); + int oldDuke = NPC.NewNPC(NPC.GetBossSpawnSource(player.whoAmI), (int)proj.Center.X, (int)proj.Center.Y + 100, NPCType()); CalamityUtils.BossAwakenMessage(oldDuke); } else @@ -5995,11 +5994,6 @@ namespace CalamityMod.NPCs { for (int j = y - 1; j <= y + 1; j++) { - if (Main.tile[i, j] is null) - { - return; - } - if (Main.tile[i, j].WallType > 0) { flag = true; diff --git a/Systems/DoGPhase2TransitionMusicSystem.cs b/Systems/DoGPhase2TransitionMusicSystem.cs new file mode 100644 index 0000000000..e2a87499b0 --- /dev/null +++ b/Systems/DoGPhase2TransitionMusicSystem.cs @@ -0,0 +1,15 @@ +using CalamityMod.World; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class DoGPhase2TransitionMusicSystem : ModSceneEffect + { + public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("DevourerOfGodsP2") ?? MusicID.LunarBoss; + public override SceneEffectPriority Priority => SceneEffectPriority.BossMedium; + + public override bool IsSceneEffectActive(Player player) => CalamityWorld.DoGSecondStageCountdown <= 530 && CalamityWorld.DoGSecondStageCountdown > 50; + } +}