diff --git a/Items/Placeables/Furniture/Monoliths/AstralProjector.cs b/Items/Placeables/Furniture/Monoliths/AstralProjector.cs new file mode 100644 index 0000000000..636c1e464f --- /dev/null +++ b/Items/Placeables/Furniture/Monoliths/AstralProjector.cs @@ -0,0 +1,43 @@ +using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.Monoliths; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.Furniture.Monoliths +{ + public class AstralProjector : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.width = 24; + Item.height = 28; + Item.maxStack = 9999; + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + Item.consumable = true; + Item.createTile = ModContent.TileType(); + Item.rare = ItemRarityID.LightRed; + Item.accessory = true; + Item.vanity = true; + } + + public override void UpdateEquip(Player player) + { + if (player.whoAmI == Main.myPlayer) + { + player.Calamity().monolithAstralShader = 30; + } + } + public override void UpdateVanity(Player player) + { + if (player.whoAmI == Main.myPlayer) + { + player.Calamity().monolithAstralShader = 30; + } + } + } +} diff --git a/Items/Placeables/Furniture/Monoliths/AstralProjector.png b/Items/Placeables/Furniture/Monoliths/AstralProjector.png new file mode 100644 index 0000000000..fddbd284a2 Binary files /dev/null and b/Items/Placeables/Furniture/Monoliths/AstralProjector.png differ diff --git a/Items/Placeables/Furniture/Monoliths/DeepSeaAnchor.cs b/Items/Placeables/Furniture/Monoliths/DeepSeaAnchor.cs new file mode 100644 index 0000000000..cd4574d869 --- /dev/null +++ b/Items/Placeables/Furniture/Monoliths/DeepSeaAnchor.cs @@ -0,0 +1,43 @@ +using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.Monoliths; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.Furniture.Monoliths +{ + public class DeepSeaAnchor : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.width = 24; + Item.height = 28; + Item.maxStack = 9999; + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + Item.consumable = true; + Item.createTile = ModContent.TileType(); + Item.rare = ItemRarityID.Yellow; + Item.accessory = true; + Item.vanity = true; + } + + public override void UpdateEquip(Player player) + { + if (player.whoAmI == Main.myPlayer) + { + player.Calamity().monolithLeviathanShader = 30; + } + } + public override void UpdateVanity(Player player) + { + if (player.whoAmI == Main.myPlayer) + { + player.Calamity().monolithLeviathanShader = 30; + } + } + } +} diff --git a/Items/Placeables/Furniture/Monoliths/DraconicIncense.cs b/Items/Placeables/Furniture/Monoliths/DraconicIncense.cs new file mode 100644 index 0000000000..299bcd39b3 --- /dev/null +++ b/Items/Placeables/Furniture/Monoliths/DraconicIncense.cs @@ -0,0 +1,43 @@ +using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.Monoliths; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.Furniture.Monoliths +{ + public class DraconicIncense : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.width = 24; + Item.height = 28; + Item.maxStack = 9999; + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + Item.consumable = true; + //Item.createTile = ModContent.TileType(); + Item.rare = ModContent.RarityType(); + Item.accessory = true; + Item.vanity = true; + } + + public override void UpdateEquip(Player player) + { + if (player.whoAmI == Main.myPlayer) + { + player.Calamity().monolithYharonShader = 30; + } + } + public override void UpdateVanity(Player player) + { + if (player.whoAmI == Main.myPlayer) + { + player.Calamity().monolithYharonShader = 30; + } + } + } +} diff --git a/Items/Placeables/Furniture/Monoliths/ExoObelisk.cs b/Items/Placeables/Furniture/Monoliths/ExoObelisk.cs new file mode 100644 index 0000000000..a0ffcb1585 --- /dev/null +++ b/Items/Placeables/Furniture/Monoliths/ExoObelisk.cs @@ -0,0 +1,43 @@ +using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.Monoliths; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.Furniture.Monoliths +{ + public class ExoObelisk : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.width = 24; + Item.height = 28; + Item.maxStack = 9999; + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + Item.consumable = true; + Item.createTile = ModContent.TileType(); + Item.rare = ModContent.RarityType(); + Item.accessory = true; + Item.vanity = true; + } + + public override void UpdateEquip(Player player) + { + if (player.whoAmI == Main.myPlayer) + { + player.Calamity().monolithExoShader = 30; + } + } + public override void UpdateVanity(Player player) + { + if (player.whoAmI == Main.myPlayer) + { + player.Calamity().monolithExoShader = 30; + } + } + } +} diff --git a/Items/Placeables/Furniture/Monoliths/FrigidMonolith.cs b/Items/Placeables/Furniture/Monoliths/FrigidMonolith.cs new file mode 100644 index 0000000000..2409b88a54 --- /dev/null +++ b/Items/Placeables/Furniture/Monoliths/FrigidMonolith.cs @@ -0,0 +1,43 @@ +using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.Monoliths; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.Furniture.Monoliths +{ + public class FrigidMonolith : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.width = 24; + Item.height = 28; + Item.maxStack = 9999; + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + Item.consumable = true; + Item.createTile = ModContent.TileType(); + Item.rare = ItemRarityID.Pink; + Item.accessory = true; + Item.vanity = true; + } + + public override void UpdateEquip(Player player) + { + if (player.whoAmI == Main.myPlayer) + { + player.Calamity().monolithCryogenShader = 30; + } + } + public override void UpdateVanity(Player player) + { + if (player.whoAmI == Main.myPlayer) + { + player.Calamity().monolithCryogenShader = 30; + } + } + } +} diff --git a/Items/Placeables/Furniture/Monoliths/PlagueHumidifier.cs b/Items/Placeables/Furniture/Monoliths/PlagueHumidifier.cs new file mode 100644 index 0000000000..61973cf756 --- /dev/null +++ b/Items/Placeables/Furniture/Monoliths/PlagueHumidifier.cs @@ -0,0 +1,43 @@ +using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.Monoliths; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.Furniture.Monoliths +{ + public class PlagueHumidifier : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.width = 24; + Item.height = 28; + Item.maxStack = 9999; + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + Item.consumable = true; + Item.createTile = ModContent.TileType(); + Item.rare = ItemRarityID.LightRed; + Item.accessory = true; + Item.vanity = true; + } + + public override void UpdateEquip(Player player) + { + if (player.whoAmI == Main.myPlayer) + { + player.Calamity().monolithPlagueShader = 30; + } + } + public override void UpdateVanity(Player player) + { + if (player.whoAmI == Main.myPlayer) + { + player.Calamity().monolithPlagueShader = 30; + } + } + } +} diff --git a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson index 7c0d56b0c3..cf534cf107 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson @@ -661,7 +661,6 @@ BossRushMonolith: { Tooltip: "" } - NavyPrismTorch: { DisplayName: Navy Prism Torch Tooltip: Can be placed in water @@ -3523,4 +3522,34 @@ WaterTurret: { Shoots high-speed water blasts at nearby enemies Cannot attack while a boss is alive ''' -} \ No newline at end of file +} + +AstralProjector: { + DisplayName: Astral Projector + Tooltip: "" +} + +DeepSeaAnchor: { + DisplayName: Deep Sea Anchor + Tooltip: "" +} + +DraconicIncense: { + DisplayName: Draconic Incense + Tooltip: "" +} + +ExoObelisk: { + DisplayName: Exo Obelisk + Tooltip: "" +} + +FrigidMonolith: { + DisplayName: Frigid Monolith + Tooltip: "" +} + +PlagueHumidifier: { + DisplayName: Plague Humidifier + Tooltip: "" +} diff --git a/NPCs/Yharon/YScreenShader.cs b/NPCs/Yharon/YScreenShader.cs index 5676c17ffe..af5d55aaed 100644 --- a/NPCs/Yharon/YScreenShader.cs +++ b/NPCs/Yharon/YScreenShader.cs @@ -36,10 +36,10 @@ namespace CalamityMod.NPCs.Yharon public override void Update(GameTime gameTime) { - if (YIndex == -1 || BossRushEvent.BossRushActive) + if ((YIndex == -1 && Main.LocalPlayer.Calamity().monolithYharonShader <= 0) || BossRushEvent.BossRushActive) { UpdateYIndex(); - if (YIndex == -1 || BossRushEvent.BossRushActive) + if ((YIndex == -1 && Main.LocalPlayer.Calamity().monolithYharonShader <= 0) || BossRushEvent.BossRushActive) Filters.Scene["CalamityMod:Yharon"].Deactivate(); } } @@ -51,6 +51,10 @@ namespace CalamityMod.NPCs.Yharon { UseTargetPosition(Main.npc[YIndex].Center); } + if (Main.LocalPlayer.Calamity().monolithYharonShader > 0) + { + UseTargetPosition(Main.LocalPlayer.Center); + } base.Apply(); } } diff --git a/NPCs/Yharon/YSky.cs b/NPCs/Yharon/YSky.cs index 8af8610893..bb673e8253 100644 --- a/NPCs/Yharon/YSky.cs +++ b/NPCs/Yharon/YSky.cs @@ -16,10 +16,10 @@ namespace CalamityMod.NPCs.Yharon public override void Update(GameTime gameTime) { - if (YIndex == -1 || BossRushEvent.BossRushActive) + if ((YIndex == -1 && Main.LocalPlayer.Calamity().monolithYharonShader <= 0) || BossRushEvent.BossRushActive) { UpdateYIndex(); - if (YIndex == -1 || BossRushEvent.BossRushActive) + if ((YIndex == -1 && Main.LocalPlayer.Calamity().monolithYharonShader <= 0) || BossRushEvent.BossRushActive) isActive = false; } @@ -56,7 +56,7 @@ namespace CalamityMod.NPCs.Yharon private bool UpdateYIndex() { int YType = ModContent.NPCType(); - if (YIndex >= 0 && Main.npc[YIndex].active && Main.npc[YIndex].type == YType) + if ((YIndex >= 0 && Main.npc[YIndex].active && Main.npc[YIndex].type == YType) || Main.LocalPlayer.Calamity().monolithYharonShader > 0) { return true; } diff --git a/Scenes/BossBackgroundScenes/CryogenBackgroundScene.cs b/Scenes/BossBackgroundScenes/CryogenBackgroundScene.cs index 154d7b51a5..816a2bfccc 100644 --- a/Scenes/BossBackgroundScenes/CryogenBackgroundScene.cs +++ b/Scenes/BossBackgroundScenes/CryogenBackgroundScene.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Systems public override bool IsSceneEffectActive(Player player) { CryogenSky.UpdateDrawEligibility(); - bool result = NPC.AnyNPCs(ModContent.NPCType()) || CryogenSky.ShouldDrawRegularly; + bool result = NPC.AnyNPCs(ModContent.NPCType()) || CryogenSky.ShouldDrawRegularly || Main.LocalPlayer.Calamity().monolithCryogenShader > 0; CryogenSky.UpdateDrawEligibility(); return result; } diff --git a/Scenes/BossBackgroundScenes/DoGBackgroundScene.cs b/Scenes/BossBackgroundScenes/DoGBackgroundScene.cs index 3530af36a3..cbda99495e 100644 --- a/Scenes/BossBackgroundScenes/DoGBackgroundScene.cs +++ b/Scenes/BossBackgroundScenes/DoGBackgroundScene.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Systems { public override SceneEffectPriority Priority => SceneEffectPriority.BossHigh; - public override bool IsSceneEffectActive(Player player) => NPC.AnyNPCs(ModContent.NPCType()); + public override bool IsSceneEffectActive(Player player) => NPC.AnyNPCs(ModContent.NPCType()) || Main.LocalPlayer.Calamity().monolithDevourerShader > 0; public override void SpecialVisuals(Player player, bool isActive) { diff --git a/Scenes/BossBackgroundScenes/ExoMechBackgroundScene.cs b/Scenes/BossBackgroundScenes/ExoMechBackgroundScene.cs index 75d82e6d47..25a8d10ca0 100644 --- a/Scenes/BossBackgroundScenes/ExoMechBackgroundScene.cs +++ b/Scenes/BossBackgroundScenes/ExoMechBackgroundScene.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Systems { public override SceneEffectPriority Priority => SceneEffectPriority.BossHigh; - public override bool IsSceneEffectActive(Player player) => ExoMechsSky.CanSkyBeActive; + public override bool IsSceneEffectActive(Player player) => ExoMechsSky.CanSkyBeActive || player.Calamity().monolithExoShader > 0; public override void SpecialVisuals(Player player, bool isActive) { diff --git a/Scenes/BossBackgroundScenes/LeviathanBackgroundScene.cs b/Scenes/BossBackgroundScenes/LeviathanBackgroundScene.cs index eb6a2bca2b..b34b8c377c 100644 --- a/Scenes/BossBackgroundScenes/LeviathanBackgroundScene.cs +++ b/Scenes/BossBackgroundScenes/LeviathanBackgroundScene.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Systems { public override SceneEffectPriority Priority => SceneEffectPriority.BossMedium; - public override bool IsSceneEffectActive(Player player) => Main.zenithWorld ? NPC.AnyNPCs(ModContent.NPCType()) : NPC.AnyNPCs(ModContent.NPCType()); + public override bool IsSceneEffectActive(Player player) => (Main.zenithWorld ? NPC.AnyNPCs(ModContent.NPCType()) : NPC.AnyNPCs(ModContent.NPCType())) || Main.LocalPlayer.Calamity().monolithLeviathanShader > 0; public override void SpecialVisuals(Player player, bool isActive) { diff --git a/Scenes/BossBackgroundScenes/PBGBackgroundScene.cs b/Scenes/BossBackgroundScenes/PBGBackgroundScene.cs index a5d3a052d5..67b7e344b9 100644 --- a/Scenes/BossBackgroundScenes/PBGBackgroundScene.cs +++ b/Scenes/BossBackgroundScenes/PBGBackgroundScene.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Systems { public override SceneEffectPriority Priority => SceneEffectPriority.BossMedium; - public override bool IsSceneEffectActive(Player player) => NPC.AnyNPCs(ModContent.NPCType()); + public override bool IsSceneEffectActive(Player player) => NPC.AnyNPCs(ModContent.NPCType()) || Main.LocalPlayer.Calamity().monolithPlagueShader > 0; public override void SpecialVisuals(Player player, bool isActive) { diff --git a/Scenes/BossBackgroundScenes/YharonBackgroundScene.cs b/Scenes/BossBackgroundScenes/YharonBackgroundScene.cs index 35fae70b65..eaef34cd89 100644 --- a/Scenes/BossBackgroundScenes/YharonBackgroundScene.cs +++ b/Scenes/BossBackgroundScenes/YharonBackgroundScene.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Systems { public override SceneEffectPriority Priority => SceneEffectPriority.BossHigh; - public override bool IsSceneEffectActive(Player player) => NPC.AnyNPCs(ModContent.NPCType()); + public override bool IsSceneEffectActive(Player player) => NPC.AnyNPCs(ModContent.NPCType()) || Main.LocalPlayer.Calamity().monolithYharonShader > 0; public override void SpecialVisuals(Player player, bool isActive) { diff --git a/Skies/AstralScreenShaderData.cs b/Skies/AstralScreenShaderData.cs index 56a7581868..eceb8edf20 100644 --- a/Skies/AstralScreenShaderData.cs +++ b/Skies/AstralScreenShaderData.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Skies public override void Update(GameTime gameTime) { - if (!Main.LocalPlayer.Calamity().ZoneAstral || Main.gameMenu) + if ((!Main.LocalPlayer.Calamity().ZoneAstral && Main.LocalPlayer.Calamity().monolithAstralShader <= 0) || Main.gameMenu) Filters.Scene["CalamityMod:Astral"].Deactivate(Array.Empty()); } } diff --git a/Skies/AstralSky.cs b/Skies/AstralSky.cs index accc6752b0..f4dbb8e679 100644 --- a/Skies/AstralSky.cs +++ b/Skies/AstralSky.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Skies public override void Deactivate(params object[] args) { - skyActive = Main.LocalPlayer.Calamity().ZoneAstral && !Main.LocalPlayer.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950; + skyActive = (Main.LocalPlayer.Calamity().ZoneAstral && !Main.LocalPlayer.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950) || Main.LocalPlayer.Calamity().monolithAstralShader > 0; } public override void Reset() @@ -110,7 +110,7 @@ namespace CalamityMod.Skies public override void Update(GameTime gameTime) { - if (!Main.LocalPlayer.Calamity().ZoneAstral || Main.gameMenu) + if ((!Main.LocalPlayer.Calamity().ZoneAstral && Main.LocalPlayer.Calamity().monolithAstralShader <= 0) || Main.gameMenu) skyActive = false; if (skyActive && opacity < 1f) diff --git a/Skies/CryogenSky.cs b/Skies/CryogenSky.cs index 1bbd055d07..e84b93e956 100644 --- a/Skies/CryogenSky.cs +++ b/Skies/CryogenSky.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Skies public static void UpdateDrawEligibility() { - bool useEffect = (NPC.AnyNPCs(ModContent.NPCType()) || ShouldDrawRegularly) && !Main.gameMenu; + bool useEffect = (NPC.AnyNPCs(ModContent.NPCType()) || ShouldDrawRegularly || Main.LocalPlayer.Calamity().monolithCryogenShader > 0) && !Main.gameMenu; if (SkyManager.Instance["CalamityMod:Cryogen"] != null && useEffect != SkyManager.Instance["CalamityMod:Cryogen"].IsActive()) { @@ -49,7 +49,7 @@ namespace CalamityMod.Skies if (FadeInCountdown > 0) FadeInCountdown--; - if (CryogenIndex == -1 && !ShouldDrawRegularly) + if (CryogenIndex == -1 && !ShouldDrawRegularly && Main.LocalPlayer.Calamity().monolithCryogenShader <= 0) { UpdateCryogenIndex(); if (FadeoutTimer == 0) @@ -89,7 +89,7 @@ namespace CalamityMod.Skies public float CalculateAuroraStrength() { - if (ShouldDrawRegularly) + if (ShouldDrawRegularly || Main.LocalPlayer.Calamity().monolithCryogenShader > 0) return 1f; return 1f - GetCryogenLifeRatio(); diff --git a/Skies/ExoMechsScreenShaderData.cs b/Skies/ExoMechsScreenShaderData.cs index 8ec6136bb8..c40ca177c1 100644 --- a/Skies/ExoMechsScreenShaderData.cs +++ b/Skies/ExoMechsScreenShaderData.cs @@ -19,13 +19,15 @@ namespace CalamityMod.Skies { if (CalamityGlobalNPC.draedon != -1 && Draedon.ExoMechIsPresent) UseTargetPosition(Main.npc[CalamityGlobalNPC.draedon].Center); + if (Main.LocalPlayer.Calamity().monolithExoShader > 0) + UseTargetPosition(Main.LocalPlayer.Center); base.Apply(); } public override void Update(GameTime gameTime) { - if (!ExoMechsSky.CanSkyBeActive) + if (!ExoMechsSky.CanSkyBeActive && Main.LocalPlayer.Calamity().monolithExoShader <= 0) Filters.Scene["CalamityMod:ExoMechs"].Deactivate(Array.Empty()); } } diff --git a/Skies/ExoMechsSky.cs b/Skies/ExoMechsSky.cs index 31cdddfc44..b957504e3b 100644 --- a/Skies/ExoMechsSky.cs +++ b/Skies/ExoMechsSky.cs @@ -53,8 +53,10 @@ namespace CalamityMod.Skies if (CalamityGlobalNPC.draedonExoMechWorm != -1 && Main.npc[CalamityGlobalNPC.draedonExoMechWorm].active) combinedLifeRatio += Main.npc[CalamityGlobalNPC.draedonExoMechWorm].life / (float)Main.npc[CalamityGlobalNPC.draedonExoMechWorm].lifeMax; - - return (float)Math.Pow(1f - combinedLifeRatio / 3f, 2D); + if (combinedLifeRatio > 0) + return (float)Math.Pow(1f - combinedLifeRatio / 3f, 2D); + else + return MathHelper.Lerp(1f, 0f, Main.LocalPlayer.Calamity().monolithExoShader / 30); } } @@ -91,7 +93,7 @@ namespace CalamityMod.Skies public override void Update(GameTime gameTime) { - if (!CanSkyBeActive) + if (!CanSkyBeActive && Main.LocalPlayer?.Calamity()?.monolithExoShader <= 0) { LightningIntensity = 0f; BackgroundIntensity = MathHelper.Clamp(BackgroundIntensity - 0.08f, 0f, 1f); @@ -130,7 +132,7 @@ namespace CalamityMod.Skies public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth) { - if (!CanSkyBeActive) + if (!CanSkyBeActive && Main.LocalPlayer?.Calamity()?.monolithExoShader <= 0) return; if (maxDepth >= float.MaxValue) @@ -188,6 +190,6 @@ namespace CalamityMod.Skies public override void Deactivate(params object[] args) { } - public override bool IsActive() => CanSkyBeActive && !Main.gameMenu; + public override bool IsActive() => (CanSkyBeActive || Main.LocalPlayer?.Calamity()?.monolithExoShader > 0) && !Main.gameMenu; } } diff --git a/Tiles/Furniture/Monoliths/AstralProjectorTile.cs b/Tiles/Furniture/Monoliths/AstralProjectorTile.cs new file mode 100644 index 0000000000..0d7afd5458 --- /dev/null +++ b/Tiles/Furniture/Monoliths/AstralProjectorTile.cs @@ -0,0 +1,145 @@ +using CalamityMod.Dusts; +using CalamityMod.Items.Placeables.Furniture.Monoliths; +using CalamityMod.NPCs.Yharon; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.Enums; +using Terraria.GameContent; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.Furniture.Monoliths +{ + public class AstralProjectorTile : ModTile + { + public override void SetStaticDefaults() + { + RegisterItemDrop(ModContent.ItemType()); + Main.tileFrameImportant[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); + TileObjectData.newTile.Height = 3; + TileObjectData.newTile.Origin = new Point16(0, 1); + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16, 16 }; + TileObjectData.newTile.LavaDeath = false; + TileObjectData.newTile.UsesCustomCanPlace = true; + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop, 2, 0); + TileObjectData.addTile(Type); + + TileID.Sets.HasOutlines[Type] = true; + AddMapEntry(new Color(92, 24, 31)); + + DustType = ModContent.DustType(); + AnimationFrameHeight = 54; + } + + public override void NearbyEffects(int i, int j, bool closer) + { + if (Main.tile[i, j].TileFrameY < 54) + { + return; + } + + Player player = Main.LocalPlayer; + if (player is null) + { + return; + } + + if (player.active) + { + Main.LocalPlayer.Calamity().monolithAstralShader = 30; + } + } + + public override void AnimateTile(ref int frame, ref int frameCounter) + { + frameCounter++; + if (frameCounter >= 7.2) + { + frameCounter = 0; + if (++frame >= 9) + { + frame = 0; + } + } + } + + + public override void AnimateIndividualTile(int type, int i, int j, ref int frameXOffset, ref int frameYOffset) + { + } + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); + } + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + + public override bool RightClick(int i, int j) + { + HitWire(i, j); + SoundEngine.PlaySound(SoundID.Mech, new Vector2(i * 16, j * 16)); + return true; + } + + public override void HitWire(int i, int j) + { + int x = i - Main.tile[i, j].TileFrameX / 18 % 2; + int y = j - Main.tile[i, j].TileFrameY / 18 % 3; + int tileXX18 = 54; + for (int l = x; l < x + 2; l++) + { + for (int m = y; m < y + 3; m++) + { + if (Main.tile[l, m].HasTile && Main.tile[l, m].TileType == Type) + { + if (Main.tile[l, m].TileFrameY < tileXX18) + Main.tile[l, m].TileFrameY += (short)(tileXX18); + else + Main.tile[l, m].TileFrameY -= (short)(tileXX18); + } + } + } + if (Wiring.running) + { + for (int o = 0; o < 2; o++) + { + for (int p = 0; p < 3; p++) + { + Wiring.SkipWire(x + 0, x + p); + } + } + } + NetMessage.SendTileSquare(-1, x, y + 1, 3); + } + + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) + { + Tile tile = Main.tile[i, j]; + Texture2D texture; + texture = TextureAssets.Tile[Type].Value; + Vector2 zero = new(Main.offScreenRange, Main.offScreenRange); + if (Main.drawToScreen) + { + zero = Vector2.Zero; + } + int height = 16; + int animate = 0; + if (tile.TileFrameY >= 54) + { + animate = Main.tileFrame[Type] * AnimationFrameHeight; + } + Main.spriteBatch.Draw(texture, new Vector2(i * 16 - (int)Main.screenPosition.X, j * 16 - (int)Main.screenPosition.Y) + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY + animate, 16, height), Lighting.GetColor(i, j), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + return false; + } + } +} diff --git a/Tiles/Furniture/Monoliths/AstralProjectorTile.png b/Tiles/Furniture/Monoliths/AstralProjectorTile.png new file mode 100644 index 0000000000..2787737032 Binary files /dev/null and b/Tiles/Furniture/Monoliths/AstralProjectorTile.png differ diff --git a/Tiles/Furniture/Monoliths/AstralProjectorTile_Glow.png b/Tiles/Furniture/Monoliths/AstralProjectorTile_Glow.png new file mode 100644 index 0000000000..87a4d2136b Binary files /dev/null and b/Tiles/Furniture/Monoliths/AstralProjectorTile_Glow.png differ diff --git a/Tiles/Furniture/Monoliths/AstralProjectorTile_Highlight.png b/Tiles/Furniture/Monoliths/AstralProjectorTile_Highlight.png new file mode 100644 index 0000000000..ff169dbf30 Binary files /dev/null and b/Tiles/Furniture/Monoliths/AstralProjectorTile_Highlight.png differ diff --git a/Tiles/Furniture/Monoliths/DeepSeaAnchorTile.cs b/Tiles/Furniture/Monoliths/DeepSeaAnchorTile.cs new file mode 100644 index 0000000000..e5dae3c26e --- /dev/null +++ b/Tiles/Furniture/Monoliths/DeepSeaAnchorTile.cs @@ -0,0 +1,144 @@ +using CalamityMod.Dusts; +using CalamityMod.Items.Placeables.Furniture.Monoliths; +using CalamityMod.NPCs.Yharon; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.Enums; +using Terraria.GameContent; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.Furniture.Monoliths +{ + public class DeepSeaAnchorTile : ModTile + { + public override void SetStaticDefaults() + { + RegisterItemDrop(ModContent.ItemType()); + Main.tileFrameImportant[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4); + TileObjectData.newTile.Origin = new Point16(0, 1); + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16, 16, 16 }; + TileObjectData.newTile.LavaDeath = false; + TileObjectData.newTile.UsesCustomCanPlace = true; + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop, 3, 0); + TileObjectData.addTile(Type); + + TileID.Sets.HasOutlines[Type] = true; + AddMapEntry(new Color(92, 24, 31)); + + DustType = DustID.Water; + AnimationFrameHeight = 72; + } + + public override void NearbyEffects(int i, int j, bool closer) + { + if (Main.tile[i, j].TileFrameY < 72) + { + return; + } + + Player player = Main.LocalPlayer; + if (player is null) + { + return; + } + + if (player.active) + { + Main.LocalPlayer.Calamity().monolithLeviathanShader = 30; + } + } + + public override void AnimateTile(ref int frame, ref int frameCounter) + { + frameCounter++; + if (frameCounter >= 7.2) + { + frameCounter = 0; + if (++frame >= 6) + { + frame = 0; + } + } + } + + + public override void AnimateIndividualTile(int type, int i, int j, ref int frameXOffset, ref int frameYOffset) + { + } + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); + } + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + + public override bool RightClick(int i, int j) + { + HitWire(i, j); + SoundEngine.PlaySound(SoundID.Mech, new Vector2(i * 16, j * 16)); + return true; + } + + public override void HitWire(int i, int j) + { + int x = i - Main.tile[i, j].TileFrameX / 18 % 3; + int y = j - Main.tile[i, j].TileFrameY / 18 % 4; + int tileXX18 = 18 * 4; + for (int l = x; l < x + 3; l++) + { + for (int m = y; m < y + 4; m++) + { + if (Main.tile[l, m].HasTile && Main.tile[l, m].TileType == Type) + { + if (Main.tile[l, m].TileFrameY < tileXX18) + Main.tile[l, m].TileFrameY += (short)(tileXX18); + else + Main.tile[l, m].TileFrameY -= (short)(tileXX18); + } + } + } + if (Wiring.running) + { + for (int o = 0; o < 3; o++) + { + for (int p = 0; p < 4; p++) + { + Wiring.SkipWire(x + 0, x + p); + } + } + } + NetMessage.SendTileSquare(-1, x, y + 1, 3); + } + + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) + { + Tile tile = Main.tile[i, j]; + Texture2D texture; + texture = TextureAssets.Tile[Type].Value; + Vector2 zero = new(Main.offScreenRange, Main.offScreenRange); + if (Main.drawToScreen) + { + zero = Vector2.Zero; + } + int height = 16; + int animate = 0; + if (tile.TileFrameY >= 72) + { + animate = Main.tileFrame[Type] * AnimationFrameHeight; + } + Main.spriteBatch.Draw(texture, new Vector2(i * 16 - (int)Main.screenPosition.X, j * 16 - (int)Main.screenPosition.Y) + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY + animate, 16, height), Lighting.GetColor(i, j), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + return false; + } + } +} diff --git a/Tiles/Furniture/Monoliths/AtlanteanMonolithTile.png b/Tiles/Furniture/Monoliths/DeepSeaAnchorTile.png similarity index 100% rename from Tiles/Furniture/Monoliths/AtlanteanMonolithTile.png rename to Tiles/Furniture/Monoliths/DeepSeaAnchorTile.png diff --git a/Tiles/Furniture/Monoliths/AtlanteanMonolithTile_Highlight.png b/Tiles/Furniture/Monoliths/DeepSeaAnchorTile_Highlight.png similarity index 100% rename from Tiles/Furniture/Monoliths/AtlanteanMonolithTile_Highlight.png rename to Tiles/Furniture/Monoliths/DeepSeaAnchorTile_Highlight.png diff --git a/Tiles/Furniture/Monoliths/DraedonObeliskTile.png b/Tiles/Furniture/Monoliths/DraedonObeliskTile.png deleted file mode 100644 index c84ce66878..0000000000 Binary files a/Tiles/Furniture/Monoliths/DraedonObeliskTile.png and /dev/null differ diff --git a/Tiles/Furniture/Monoliths/DraedonObeliskTile_Glow.png b/Tiles/Furniture/Monoliths/DraedonObeliskTile_Glow.png deleted file mode 100644 index d820053656..0000000000 Binary files a/Tiles/Furniture/Monoliths/DraedonObeliskTile_Glow.png and /dev/null differ diff --git a/Tiles/Furniture/Monoliths/DraedonObeliskTile_Highlight.png b/Tiles/Furniture/Monoliths/DraedonObeliskTile_Highlight.png deleted file mode 100644 index b1b025ef3e..0000000000 Binary files a/Tiles/Furniture/Monoliths/DraedonObeliskTile_Highlight.png and /dev/null differ diff --git a/Tiles/Furniture/Monoliths/DraedonObeliskText.png b/Tiles/Furniture/Monoliths/ExoObeliskText.png similarity index 100% rename from Tiles/Furniture/Monoliths/DraedonObeliskText.png rename to Tiles/Furniture/Monoliths/ExoObeliskText.png diff --git a/Tiles/Furniture/Monoliths/ExoObeliskTile.cs b/Tiles/Furniture/Monoliths/ExoObeliskTile.cs new file mode 100644 index 0000000000..8f778580b6 --- /dev/null +++ b/Tiles/Furniture/Monoliths/ExoObeliskTile.cs @@ -0,0 +1,151 @@ +using CalamityMod.Dusts; +using CalamityMod.Items.Placeables.Furniture.Monoliths; +using CalamityMod.NPCs.Yharon; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.Enums; +using Terraria.GameContent; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.Furniture.Monoliths +{ + public class ExoObeliskTile : ModTile + { + public static Texture2D Glow; + public override void SetStaticDefaults() + { + if (!Main.dedServ) + { + Glow = ModContent.Request("CalamityMod/Tiles/Furniture/Monoliths/ExoObeliskTile_Glow").Value; + } + RegisterItemDrop(ModContent.ItemType()); + Main.tileFrameImportant[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4); + TileObjectData.newTile.Height = 5; + TileObjectData.newTile.Origin = new Point16(0, 1); + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16, 16, 16, 16 }; + TileObjectData.newTile.LavaDeath = false; + TileObjectData.newTile.UsesCustomCanPlace = true; + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop, 3, 0); + TileObjectData.addTile(Type); + + TileID.Sets.HasOutlines[Type] = true; + AddMapEntry(new Color(92, 24, 31)); + + DustType = DustID.TerraBlade; + AnimationFrameHeight = 90; + } + + public override void NearbyEffects(int i, int j, bool closer) + { + if (Main.tile[i, j].TileFrameY < 90) + { + return; + } + + Player player = Main.LocalPlayer; + if (player is null) + { + return; + } + + if (player.active) + { + Main.LocalPlayer.Calamity().monolithExoShader = 30; + } + } + + public override void AnimateTile(ref int frame, ref int frameCounter) + { + frameCounter++; + if (frameCounter >= 7.2) + { + frameCounter = 0; + if (++frame >= 2) + { + frame = 0; + } + } + } + + + public override void AnimateIndividualTile(int type, int i, int j, ref int frameXOffset, ref int frameYOffset) + { + } + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); + } + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + + public override bool RightClick(int i, int j) + { + HitWire(i, j); + SoundEngine.PlaySound(SoundID.Mech, new Vector2(i * 16, j * 16)); + return true; + } + + public override void HitWire(int i, int j) + { + int x = i - Main.tile[i, j].TileFrameX / 18 % 3; + int y = j - Main.tile[i, j].TileFrameY / 18 % 5; + int tileXX18 = 92; + for (int l = x; l < x + 3; l++) + { + for (int m = y; m < y + 5; m++) + { + if (Main.tile[l, m].HasTile && Main.tile[l, m].TileType == Type) + { + if (Main.tile[l, m].TileFrameY < tileXX18) + Main.tile[l, m].TileFrameY += (short)(tileXX18); + else + Main.tile[l, m].TileFrameY -= (short)(tileXX18); + } + } + } + if (Wiring.running) + { + for (int o = 0; o < 3; o++) + { + for (int p = 0; p < 5; p++) + { + Wiring.SkipWire(x + 0, x + p); + } + } + } + NetMessage.SendTileSquare(-1, x, y + 1, 3); + } + + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) + { + Tile tile = Main.tile[i, j]; + Texture2D texture; + texture = TextureAssets.Tile[Type].Value; + Vector2 zero = new(Main.offScreenRange, Main.offScreenRange); + if (Main.drawToScreen) + { + zero = Vector2.Zero; + } + int height = 16; + int animate = 0; + if (tile.TileFrameY >= 92) + { + animate = Main.tileFrame[Type] * 92; + } + Main.spriteBatch.Draw(texture, new Vector2(i * 16 - (int)Main.screenPosition.X, j * 16 - (int)Main.screenPosition.Y) + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY + animate, 16, height), Lighting.GetColor(i, j), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(Glow, new Vector2(i * 16 - (int)Main.screenPosition.X, j * 16 - (int)Main.screenPosition.Y) + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY + animate, 16, height), Color.White, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + return false; + } + } +} diff --git a/Tiles/Furniture/Monoliths/ExoObeliskTile.png b/Tiles/Furniture/Monoliths/ExoObeliskTile.png new file mode 100644 index 0000000000..f3b7db2dfa Binary files /dev/null and b/Tiles/Furniture/Monoliths/ExoObeliskTile.png differ diff --git a/Tiles/Furniture/Monoliths/ExoObeliskTile_Glow.png b/Tiles/Furniture/Monoliths/ExoObeliskTile_Glow.png new file mode 100644 index 0000000000..b507437b2e Binary files /dev/null and b/Tiles/Furniture/Monoliths/ExoObeliskTile_Glow.png differ diff --git a/Tiles/Furniture/Monoliths/ExoObeliskTile_Highlight.png b/Tiles/Furniture/Monoliths/ExoObeliskTile_Highlight.png new file mode 100644 index 0000000000..61062b6f26 Binary files /dev/null and b/Tiles/Furniture/Monoliths/ExoObeliskTile_Highlight.png differ diff --git a/Tiles/Furniture/Monoliths/FrigidMonolithTile.cs b/Tiles/Furniture/Monoliths/FrigidMonolithTile.cs new file mode 100644 index 0000000000..ea2885a341 --- /dev/null +++ b/Tiles/Furniture/Monoliths/FrigidMonolithTile.cs @@ -0,0 +1,145 @@ +using CalamityMod.Dusts; +using CalamityMod.Items.Placeables.Furniture.Monoliths; +using CalamityMod.NPCs.Yharon; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.Enums; +using Terraria.GameContent; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.Furniture.Monoliths +{ + public class FrigidMonolithTile : ModTile + { + public override void SetStaticDefaults() + { + RegisterItemDrop(ModContent.ItemType()); + Main.tileFrameImportant[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); + TileObjectData.newTile.Height = 3; + TileObjectData.newTile.Origin = new Point16(0, 1); + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16, 16 }; + TileObjectData.newTile.LavaDeath = false; + TileObjectData.newTile.UsesCustomCanPlace = true; + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop, 2, 0); + TileObjectData.addTile(Type); + + TileID.Sets.HasOutlines[Type] = true; + AddMapEntry(new Color(92, 24, 31)); + + DustType = ModContent.DustType(); + AnimationFrameHeight = 52; + } + + public override void NearbyEffects(int i, int j, bool closer) + { + if (Main.tile[i, j].TileFrameY < 52) + { + return; + } + + Player player = Main.LocalPlayer; + if (player is null) + { + return; + } + + if (player.active) + { + Main.LocalPlayer.Calamity().monolithCryogenShader = 30; + } + } + + public override void AnimateTile(ref int frame, ref int frameCounter) + { + frameCounter++; + if (frameCounter >= 7.2) + { + frameCounter = 0; + if (++frame >= 9) + { + frame = 0; + } + } + } + + + public override void AnimateIndividualTile(int type, int i, int j, ref int frameXOffset, ref int frameYOffset) + { + } + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); + } + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + + public override bool RightClick(int i, int j) + { + HitWire(i, j); + SoundEngine.PlaySound(SoundID.Mech, new Vector2(i * 16, j * 16)); + return true; + } + + public override void HitWire(int i, int j) + { + int x = i - Main.tile[i, j].TileFrameX / 18 % 2; + int y = j - Main.tile[i, j].TileFrameY / 18 % 3; + int tileXX18 = 18 * 3; + for (int l = x; l < x + 2; l++) + { + for (int m = y; m < y + 3; m++) + { + if (Main.tile[l, m].HasTile && Main.tile[l, m].TileType == Type) + { + if (Main.tile[l, m].TileFrameY < tileXX18) + Main.tile[l, m].TileFrameY += (short)(tileXX18); + else + Main.tile[l, m].TileFrameY -= (short)(tileXX18); + } + } + } + if (Wiring.running) + { + for (int o = 0; o < 2; o++) + { + for (int p = 0; p < 3; p++) + { + Wiring.SkipWire(x + 0, x + p); + } + } + } + NetMessage.SendTileSquare(-1, x, y + 1, 3); + } + + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) + { + Tile tile = Main.tile[i, j]; + Texture2D texture; + texture = TextureAssets.Tile[Type].Value; + Vector2 zero = new(Main.offScreenRange, Main.offScreenRange); + if (Main.drawToScreen) + { + zero = Vector2.Zero; + } + int height = 16; + int animate = 0; + if (tile.TileFrameY >= 52) + { + animate = Main.tileFrame[Type] * AnimationFrameHeight; + } + Main.spriteBatch.Draw(texture, new Vector2(i * 16 - (int)Main.screenPosition.X, j * 16 - (int)Main.screenPosition.Y) + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY + animate, 16, height), Lighting.GetColor(i, j), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + return false; + } + } +} diff --git a/Tiles/Furniture/Monoliths/PlagueHumidifierTile.cs b/Tiles/Furniture/Monoliths/PlagueHumidifierTile.cs new file mode 100644 index 0000000000..e60b22b526 --- /dev/null +++ b/Tiles/Furniture/Monoliths/PlagueHumidifierTile.cs @@ -0,0 +1,145 @@ +using CalamityMod.Dusts; +using CalamityMod.Items.Placeables.Furniture.Monoliths; +using CalamityMod.NPCs.Yharon; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.Enums; +using Terraria.GameContent; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.Furniture.Monoliths +{ + public class PlagueHumidifierTile : ModTile + { + public override void SetStaticDefaults() + { + RegisterItemDrop(ModContent.ItemType()); + Main.tileFrameImportant[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); + TileObjectData.newTile.Height = 3; + TileObjectData.newTile.Origin = new Point16(0, 1); + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16, 16, 16 }; + TileObjectData.newTile.LavaDeath = false; + TileObjectData.newTile.UsesCustomCanPlace = true; + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop, 2, 0); + TileObjectData.addTile(Type); + + TileID.Sets.HasOutlines[Type] = true; + AddMapEntry(new Color(92, 24, 31)); + + DustType = (int)CalamityDusts.Plague; + AnimationFrameHeight = 72; + } + + public override void NearbyEffects(int i, int j, bool closer) + { + if (Main.tile[i, j].TileFrameY < 72) + { + return; + } + + Player player = Main.LocalPlayer; + if (player is null) + { + return; + } + + if (player.active) + { + Main.LocalPlayer.Calamity().monolithPlagueShader = 30; + } + } + + public override void AnimateTile(ref int frame, ref int frameCounter) + { + frameCounter++; + if (frameCounter >= 7.2) + { + frameCounter = 0; + if (++frame >= 4) + { + frame = 0; + } + } + } + + + public override void AnimateIndividualTile(int type, int i, int j, ref int frameXOffset, ref int frameYOffset) + { + } + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); + } + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + + public override bool RightClick(int i, int j) + { + HitWire(i, j); + SoundEngine.PlaySound(SoundID.Mech, new Vector2(i * 16, j * 16)); + return true; + } + + public override void HitWire(int i, int j) + { + int x = i - Main.tile[i, j].TileFrameX / 18 % 2; + int y = j - Main.tile[i, j].TileFrameY / 18 % 4; + int tileXX18 = 18 * 4; + for (int l = x; l < x + 2; l++) + { + for (int m = y; m < y + 4; m++) + { + if (Main.tile[l, m].HasTile && Main.tile[l, m].TileType == Type) + { + if (Main.tile[l, m].TileFrameY < tileXX18) + Main.tile[l, m].TileFrameY += (short)(tileXX18); + else + Main.tile[l, m].TileFrameY -= (short)(tileXX18); + } + } + } + if (Wiring.running) + { + for (int o = 0; o < 2; o++) + { + for (int p = 0; p < 4; p++) + { + Wiring.SkipWire(x + 0, x + p); + } + } + } + NetMessage.SendTileSquare(-1, x, y + 1, 3); + } + + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) + { + Tile tile = Main.tile[i, j]; + Texture2D texture; + texture = TextureAssets.Tile[Type].Value; + Vector2 zero = new(Main.offScreenRange, Main.offScreenRange); + if (Main.drawToScreen) + { + zero = Vector2.Zero; + } + int height = 16; + int animate = 0; + if (tile.TileFrameY >= 72) + { + animate = Main.tileFrame[Type] * AnimationFrameHeight; + } + Main.spriteBatch.Draw(texture, new Vector2(i * 16 - (int)Main.screenPosition.X, j * 16 - (int)Main.screenPosition.Y) + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY + animate, 16, height), Lighting.GetColor(i, j), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + return false; + } + } +} diff --git a/Tiles/Furniture/Monoliths/PlagueHumidifier.png b/Tiles/Furniture/Monoliths/PlagueHumidifierTile.png similarity index 100% rename from Tiles/Furniture/Monoliths/PlagueHumidifier.png rename to Tiles/Furniture/Monoliths/PlagueHumidifierTile.png diff --git a/Tiles/Furniture/Monoliths/PlagueHumidifier_Highlight.png b/Tiles/Furniture/Monoliths/PlagueHumidifierTile_Highlight.png similarity index 100% rename from Tiles/Furniture/Monoliths/PlagueHumidifier_Highlight.png rename to Tiles/Furniture/Monoliths/PlagueHumidifierTile_Highlight.png