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; } /*