From 3f15c42994e87874b786f676924ad41f86f84bfb Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Tue, 27 Feb 2024 20:57:49 -0800 Subject: [PATCH] basic tiles --- .../Furniture/Monoliths/AstralProjector.cs | 43 +++++ .../Furniture/Monoliths/AstralProjector.png | Bin 0 -> 598 bytes .../Furniture/Monoliths/DeepSeaAnchor.cs | 43 +++++ .../Furniture/Monoliths/DraconicIncense.cs | 43 +++++ .../Furniture/Monoliths/ExoObelisk.cs | 43 +++++ .../Furniture/Monoliths/FrigidMonolith.cs | 43 +++++ .../Furniture/Monoliths/PlagueHumidifier.cs | 43 +++++ .../Mods.CalamityMod.Items.Placeables.hjson | 33 +++- NPCs/Yharon/YScreenShader.cs | 8 +- NPCs/Yharon/YSky.cs | 6 +- .../CryogenBackgroundScene.cs | 2 +- .../DoGBackgroundScene.cs | 2 +- .../ExoMechBackgroundScene.cs | 2 +- .../LeviathanBackgroundScene.cs | 2 +- .../PBGBackgroundScene.cs | 2 +- .../YharonBackgroundScene.cs | 2 +- Skies/AstralScreenShaderData.cs | 2 +- Skies/AstralSky.cs | 4 +- Skies/CryogenSky.cs | 6 +- Skies/ExoMechsScreenShaderData.cs | 4 +- Skies/ExoMechsSky.cs | 12 +- .../Monoliths/AstralProjectorTile.cs | 145 +++++++++++++++++ .../Monoliths/AstralProjectorTile.png | Bin 0 -> 4916 bytes .../Monoliths/AstralProjectorTile_Glow.png | Bin 0 -> 2084 bytes .../AstralProjectorTile_Highlight.png | Bin 0 -> 1132 bytes .../Furniture/Monoliths/DeepSeaAnchorTile.cs | 144 +++++++++++++++++ ...MonolithTile.png => DeepSeaAnchorTile.png} | Bin ...ht.png => DeepSeaAnchorTile_Highlight.png} | Bin .../Monoliths/DraedonObeliskTile.png | Bin 2121 -> 0 bytes .../Monoliths/DraedonObeliskTile_Glow.png | Bin 314 -> 0 bytes .../DraedonObeliskTile_Highlight.png | Bin 452 -> 0 bytes ...edonObeliskText.png => ExoObeliskText.png} | Bin Tiles/Furniture/Monoliths/ExoObeliskTile.cs | 151 ++++++++++++++++++ Tiles/Furniture/Monoliths/ExoObeliskTile.png | Bin 0 -> 947 bytes .../Monoliths/ExoObeliskTile_Glow.png | Bin 0 -> 321 bytes .../Monoliths/ExoObeliskTile_Highlight.png | Bin 0 -> 463 bytes .../Furniture/Monoliths/FrigidMonolithTile.cs | 145 +++++++++++++++++ .../Monoliths/PlagueHumidifierTile.cs | 145 +++++++++++++++++ ...umidifier.png => PlagueHumidifierTile.png} | Bin ...png => PlagueHumidifierTile_Highlight.png} | Bin 40 files changed, 1050 insertions(+), 25 deletions(-) create mode 100644 Items/Placeables/Furniture/Monoliths/AstralProjector.cs create mode 100644 Items/Placeables/Furniture/Monoliths/AstralProjector.png create mode 100644 Items/Placeables/Furniture/Monoliths/DeepSeaAnchor.cs create mode 100644 Items/Placeables/Furniture/Monoliths/DraconicIncense.cs create mode 100644 Items/Placeables/Furniture/Monoliths/ExoObelisk.cs create mode 100644 Items/Placeables/Furniture/Monoliths/FrigidMonolith.cs create mode 100644 Items/Placeables/Furniture/Monoliths/PlagueHumidifier.cs create mode 100644 Tiles/Furniture/Monoliths/AstralProjectorTile.cs create mode 100644 Tiles/Furniture/Monoliths/AstralProjectorTile.png create mode 100644 Tiles/Furniture/Monoliths/AstralProjectorTile_Glow.png create mode 100644 Tiles/Furniture/Monoliths/AstralProjectorTile_Highlight.png create mode 100644 Tiles/Furniture/Monoliths/DeepSeaAnchorTile.cs rename Tiles/Furniture/Monoliths/{AtlanteanMonolithTile.png => DeepSeaAnchorTile.png} (100%) rename Tiles/Furniture/Monoliths/{AtlanteanMonolithTile_Highlight.png => DeepSeaAnchorTile_Highlight.png} (100%) delete mode 100644 Tiles/Furniture/Monoliths/DraedonObeliskTile.png delete mode 100644 Tiles/Furniture/Monoliths/DraedonObeliskTile_Glow.png delete mode 100644 Tiles/Furniture/Monoliths/DraedonObeliskTile_Highlight.png rename Tiles/Furniture/Monoliths/{DraedonObeliskText.png => ExoObeliskText.png} (100%) create mode 100644 Tiles/Furniture/Monoliths/ExoObeliskTile.cs create mode 100644 Tiles/Furniture/Monoliths/ExoObeliskTile.png create mode 100644 Tiles/Furniture/Monoliths/ExoObeliskTile_Glow.png create mode 100644 Tiles/Furniture/Monoliths/ExoObeliskTile_Highlight.png create mode 100644 Tiles/Furniture/Monoliths/FrigidMonolithTile.cs create mode 100644 Tiles/Furniture/Monoliths/PlagueHumidifierTile.cs rename Tiles/Furniture/Monoliths/{PlagueHumidifier.png => PlagueHumidifierTile.png} (100%) rename Tiles/Furniture/Monoliths/{PlagueHumidifier_Highlight.png => PlagueHumidifierTile_Highlight.png} (100%) 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 0000000000000000000000000000000000000000..fddbd284a2f76b72f753a78c5b0f4f64c3b05519 GIT binary patch literal 598 zcmV-c0;&CpP)Px$_DMuRR7i=vl|4utK^TUg_3z*y9x4O_ViL6R1b;XK7C9?Zgaj?q38x@f+C>yu zMX{8KjSv+C3&F+^kYEweA}JJt!d`O-;uUgm$O#(ckhPc{&KYml#+|p?+3$z1`g?+4istB@!cN zpg7-JUk@y3ZE6jSCq5(*{luAse+Ew_^q(v!>!lY(Wj*kI11L>Zf}|2RM^HS^0;TC_ ze-~2{b?0n~v-&Y6U%Uli>UUO23!k95@r?yAzdG##Ofn0=9}>W05?%RU*8nWmbmH{^ zK=w6yn=1GIsw!erQ=)>(2Gw<_X$f3&-g*apy=9KS}3$9mWZw5iu<{w*?oV zx8pMae~*6#Hqi5;k(lN60Ze|$|8K9$CP;@;g@SN)(DxF6_)c1hOXpJI6U4g27hCvu zb%7 literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..2787737032a78ae7a55648ebd843e4685f24f527 GIT binary patch literal 4916 zcma)=c{r4B+sE(8gUZ$~6@^q1#!hwyr7*UbAz5QE4aRP=k4hwCsWD`m5@TN?OBhRt zEK!psyHXg8gfUr$cY2=V`Rn~X@AKZraUI|5xc|F9=lA-a=XJ;5FgN5mdgdqq06fM< z239P+2mptK4|A|~#5!(&mVg4S46gtc1Hx1QI6h=-pb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I$m-6zV0-QugH1@g8RP}0%RC!u>m@tE362H$~R zrJ@|c#yT$6dJw7+HK73-dH^!dq{z z_j6{FoQ4{1?#QW?VMU`S^-)keM$hS;Y_ZbLCfKFI-d1|@i-(P+~NzN+gbv)memN4P9Qgl`ImZ>OMgfOY%o= z6G8k4cGMP%1&gR~g!u>S1FsftIJeg~|FZ}EzmQa#3?Ce_ce|0yed6>n*3T|pcUxl* bGcy3p+8<`EKMw_l|0BlN%nd58+`j)mpKYfK literal 0 HcmV?d00001 diff --git a/Tiles/Furniture/Monoliths/AstralProjectorTile_Glow.png b/Tiles/Furniture/Monoliths/AstralProjectorTile_Glow.png new file mode 100644 index 0000000000000000000000000000000000000000..87a4d2136be54ab95f51cfdb14568ac5f62371d0 GIT binary patch literal 2084 zcmZWqdsNcd7G|nJd=;6G!p8(@R+=`9<=n_jz_*fF;hQYYXUdeAB4SfgV&X-0jhzvJO272&DAV5o>cUHc!g3ru&}P6m~jX zQCq+HG{yE1^Avbngyu{AW^IIBfKCkD)AOa_ZPr0kLk@P=Vbj8knIv$8yXi%{EfpFx z$bhF;h&b}%OAD3G4+7cYsNp=TWdV77m@=t2+PX$TDWv3>kAe}@@?9tz0(WlyYXw(< zY&`3kPAq2~;`iYmr6 zpHeBmv38eE_oYsYZ_-Pc0$Eq202(N)x9 z%%=3!e2M?zsKi)46Re|zsHf=0&QZKje#>T1KQs-BzEre6NKTN?_5{B4JAiui`G&pTqO zYuaX~Bwvkg#ugHm+LDOL^p-&R`~0SZVISvG2Nv{$4iq{UpTQ821+u_XB;}oG2V`up zJcT)9do{|csp^^P&`KZB6u0LLh8Ee{IwJ9DAVK zC@}wawcd#b6}w#xT!-wgO@52>#a+x;^_0Bd3*Ms2b?k6r1~kvE=D%w+@HjpS;U_eniE2&5 zaJd%6#F30g>EZL$qTSgRCgW9Na9((q|L>XAqDbRsv!A&3*Tj>H5#FI_h(y^t6lu;A z8EgU#`anG&#bL~epxshGjPqxp{5HKm{JNb7ri@{yu`hZ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CCckQ0@*G)UCZuVB) z4AK9+I!?{L?C6f~yE0F3hBj{tX&;u|FMoae`TMoZ)l9RWpH);h zSw8jm?%&S4&#^fBWxTIDU!HIOrQF%i<9~Fl@4LIp|IJu-)c@&^*AwhQtJn9J-F+V( zXBemBm-Rj}?)z#l`GBc*-&ox4FJI^79U8UjQqa_CtG0wJU8()); + 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 c84ce66878aa7cad36e46abc02c6b084e1031a32..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2121 zcmaJ@c~sKb9{-U(Davp(^|`j;623IIm*$d^rqqPEluhQ6S!OnnOQ?gXQ;``*5XEvq z2rc(CwIVar(Nrw8)W`@lOAsx=j8RfF9(9`Y=Dm66{c-R2dp`HOe7@hioSTJ4`Dj86 zApihqB7MCARMJ5;mR4)1W@%BBjY@zL0(=la-GK2l0IXI+dU*yV(U)xaI%$DCzx5H1FHrhA2*iLjQ-0T%;g}qW^?TxMH({^?yB{ODI+LWo8 z@{cQO)gQ+jCV*wd5FzrGWKUV9S_bcfvP!Si`tn|=PWSC(0hnw8?RW&g_GaY8nGITA z!LYm%Agam8J44(m55y|CHNn7VNqso5iEFO~)YkR~yOy<>8H(pD=%8^91&UX!%w#^> zPxmaSV7cKS_q>9y*d3qH(Ot_iFxuz_YJcv#5oj7#1CAE|Qc7d?}`GrYzMYqn;yMfo6xI;YrWseC)kgP{z~Qd@64usk!78Tv$x;8GcuQ=n&2)flmF5bTFeJDsvvY?O5hL zRKflbR*~!t_7LsWwkX{pRR75Hp}zNQPTBjoy;eJ)R%^QuY7ws+ATeT6i(s6?1U4~} z{4g=L7|~H;gX8poXLZl~KyB?o%=H({moT*pym_i>8s#kz-F0JS#Y@y`1mi2%aE+AYsOY-sA z#$t8y%OGnUh74dH7#P_HVlaOHWX1dG?8n_aYI@w7990pUGir@#cI|N98xn$9oGc2o z!$I=vn8mR*VZ^4Inzb2uj3sSg_RG90+P|>;{$VqcaYYVWv;A>zCMa2fO%$ zbD$ab^zg%mmUr);fWri%+7bq_1mT(fI-7cr)uOy{cb$$&$ry>%`EsCR*#Z4!^2Qy} zBz+$(@w1DQ9mFF%oS`3`!s~xZFK%7$VNT;(HQ__}uR&ANxF;20furuF+qaaLn=Z0{Pa(KY>(Y|*c8_k_7O1X^x7(@8`y6z{HsoR*$buKrEf=Pv8V zff>oHYiu~MhGSp3sBD|2$I?y9|sEkctJ!oHE5RGE2@5j59+OL)ZgsFP|L zMEx;qM6=BiY8G5O)MoZH*?6}BVEiLgm$^JTgi2Zc=|IHH26*V6K}w_L;16!j7n{%C zKSa%!rPs!+WT(i>@7$-W-l{3tjv|&;I03gm2syo?FDxo3j(a22lqxT<&Py+jJX%rD z+FGA8PnwpR5K2b^?vgzRB7CA*thQP*+{`PV5>G5Ns9#1c1|6TZ49cDgwXhez_G!*O zH$GtBJp8KCveA^(elBxs);uZgF^V}WRBJUp89r~uiZ<^HP;QI2sTqcpF-waeI`49E0 zt;*ofZgkk!*W`bowknzh7Fquh>W^G1r|-+h94`MA{EN@`oGK=&TmR>v|DWpjvi_@p zujs!C;EJTkc-*}GSQ?oYCckFWDv)g7%~R~{a^k8QeT+qi?X)Wd#)k;3t3Zh#dlfZ* z@dUOl_zREgeWUh8_x=jN3Ad~RYR?>sk->PVQ94Y&?tw)jn&W6j>B}W19PjUvtXrNa zvgpN7?1y%`ucqRaitgRe_W0xjXP1JLvbTxbQE87b-RY diff --git a/Tiles/Furniture/Monoliths/DraedonObeliskTile_Glow.png b/Tiles/Furniture/Monoliths/DraedonObeliskTile_Glow.png deleted file mode 100644 index d82005365668a221ba0024ba99e99bbfb6ab533d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 314 zcmeAS@N?(olHy`uVBq!ia0vp^CP4g)gBeKPbeSRxq!^2X+?^QKos)S9^9T5ZxO%4UvYYxc^TVD0|33i5j772pffQ>=kYDhBAYk~tjV~A|z**oC zSpo6(zw=4;Lk&i5>WvtDKLo=>3#hx>9KCHTRPdv9|vjzBsxc>R`2gq!5E_nx}m`Z~Dg8wr--EQCo4nJ@ErzW#^d=b zQh)|pdb&78Fuj^@HDhj&mH>p8o)0!tcBJ<>Weoow9{12tPzU;h(?jXB k*Sz0Plh1zE%e`&?=#uWj?RsnH0z;O;)78&qol`;+0F+z1_5c6? 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 0000000000000000000000000000000000000000..f3b7db2dfa8fc9ee071d7c574615f3ce91c9ec0d GIT binary patch literal 947 zcmV;k15EshP)00001b5ch_0Itp) z=>Px#1ZP1_K>z@;j|==^1poj5Fi=cXMF0Q*b9{?XS!W&~As`(v|Ns9pI6s=CuEEUF zNoBe@E^|JW>1puX|NrnsSbzWk0M+76t^fc45Oh*bQ~&?}|NsC0|NsC0|NsC00N^8C z82|tP32;bRa{vGi!vFvd!vV){sAK>D0`N&hK~!i%?U?Phn;;NH)mYNrw)*~WTek$s+IVCaetVCOJolk6r}i9R6}BS9YjrG`!ODGred{&$;NFJ_N$(V;4R8 zE0l)%eh=#V3hhC;vP0)jLnG10fm4G3Ee39cR^r;s4dBYFSPAY zta*z?+FCX`1o<7Dr3!gn8hXAyVs8obU9~VDJxdmOd32UT+RD!hGv!dO>`=Iky-JVU z*XKbPee9w~e}&Qzn<5SIf?c6Blq)-Q{zQb3Sh7?o4e0~#7^Fvl9nxzpgYQFhOXr^j zv0V2dmTW1MFDu00N7M6dGj!JMT@$+Qbz<;Z3(L|xFiB882&WlJOB98I1u2eXt&mDh zDqhuE*len`uqA=)vKG#42#gT5C0X!=wjGK!Z?Q;Q%SMMFzk{<>A+JkA&(}xnErDt+ z%ns$s4u#v;tMs^ieIA6-$1ZyGS11j!Dbf%x*cD1cxw1p&PecfbB};|UkUsE^L3#w( zA-&cz_&!9pbpBZo%XJ@O$(BO-vO)}gG(F!oLubw2HKFTXCkC&zuq@33lLY01aGIgC zL{TVMkm5+z3aQkj;?=peu-}vZOyd7=E$k4)%^!ub7RcX8V3bP|Wi1oLAqJMxFr=Vi z&=OMQJ0RzPhQYZ2t(JE|NM_1f!h{^Ig=Iltgn&r|VZo=U5-8TZ#UgDj8@+~_<{#A+ VYejzfvbCQl)1vN0ZNjYUM8r z^*-c1?sekQTrzMwFj~HRpJ4Athkg2MT_(?+c=g39Y^IcE z_^EzReD?liit4TJ^A~Rxd?9^Ng8#|yOI{{7B_n&+{kopf6aP8#&PEBI%HKd&GkCiC KxvXk&mSPO&AH?qkYXwc@(cdY@N~O@7m&wU;1OBOz`%DHgc*&YuAeqrBI zQDGtKKYzj3*0cLIi2K(j$*7fWf3(v7|AE7`wV!!4r2AjJQ&G7xOD6Sk;N7_`6()W< zx5cuiF0Rp8wR`de0WCMnq=)i#dQA~BAiiqLGS`itPoLg;L*P*PG9jnn#rOC3SNvjG ztDp0&b#KKh;l~CWcZ>Sh{$iJV_j-1|!_A72a&^Up*PcM^IkLDg>E^b8)iO_$L6)@y z7@iX3{{Nv^@W`V8AYVt(M7L{heB8RDZ36p@rwYuH`unf;$Yu46+QiNJZ;l4fmuT<2 zySC!hW%~~W@%L+(PaRvl%bJsOtC~B+9=TrO)7x63o@&T=9{ ppTfB?Gw{uyPer()); + 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