diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index eec684cf59..0c7fbf55f9 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -1175,6 +1175,24 @@ namespace CalamityMod.CalPlayer public int monolithAccursedShader = 0; + public int monolithBossRushShader = 0; + + public int monolithExoShader = 0; + + public int monolithLeviathanShader = 0; + + public int monolithPlagueShader = 0; + + public int monolithCryogenShader = 0; + + public int monolithAstralShader = 0; + + public int monolithDevourerBShader = 0; + + public int monolithDevourerPShader = 0; + + public int monolithYharonShader = 0; + // This may seem like a scuffed setup, but a simple bool will have ordering issues when it comes to drawing. // Until ModSceneMetrics gets implemented, this works for now. public int BrimstoneLavaFountainCounter = 0; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 6f8ae66cbe..4ad4c0dd92 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -1520,8 +1520,27 @@ namespace CalamityMod.CalPlayer ChlorophyteHealDelay--; if (monolithAccursedShader > 0) monolithAccursedShader--; + if (monolithBossRushShader > 0) + monolithBossRushShader--; + if (monolithExoShader > 0) + monolithExoShader--; + if (monolithLeviathanShader > 0) + monolithLeviathanShader--; + if (monolithCryogenShader > 0) + monolithCryogenShader--; + if (monolithDevourerBShader > 0) + monolithDevourerBShader--; + if (monolithDevourerPShader > 0) + monolithDevourerPShader--; + if (monolithYharonShader > 0) + monolithYharonShader--; + if (monolithPlagueShader > 0) + monolithPlagueShader--; + if (monolithAstralShader > 0) + monolithAstralShader--; if (BrimstoneLavaFountainCounter > 0) BrimstoneLavaFountainCounter--; + if (miningSetCooldown > 0) miningSetCooldown--; if (RustyMedallionCooldown > 0) diff --git a/CalamityMod.cs b/CalamityMod.cs index adb2b7362b..10345751a9 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -342,6 +342,7 @@ namespace CalamityMod SkyManager.Instance["CalamityMod:AstralSurface"] = new AstralSkySurface(); SkyManager.Instance["CalamityMod:AstralDesert"] = new AstralSkyDesert(); SkyManager.Instance["CalamityMod:AstralSnow"] = new AstralSkySnow(); + SkyManager.Instance["CalamityMod:MonolithAstral"] = new AstralMonolithSky(); SkyManager.Instance["CalamityMod:SulphurSea"] = new SulphurSeaSky(); SkyManager.Instance["CalamityMod:Cryogen"] = new CryogenSky(); SkyManager.Instance["CalamityMod:StormWeaverFlash"] = new StormWeaverFlashSky(); diff --git a/Items/Placeables/Furniture/Monoliths/AstralProjector.cs b/Items/Placeables/Furniture/Monoliths/AstralProjector.cs new file mode 100644 index 0000000000..f9df9d7b02 --- /dev/null +++ b/Items/Placeables/Furniture/Monoliths/AstralProjector.cs @@ -0,0 +1,49 @@ +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; + } + } + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(15). + AddTile(TileID.Anvils). + Register(); + } + } +} 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/BlueDistortedMonolith.cs b/Items/Placeables/Furniture/Monoliths/BlueDistortedMonolith.cs new file mode 100644 index 0000000000..aeffacdc72 --- /dev/null +++ b/Items/Placeables/Furniture/Monoliths/BlueDistortedMonolith.cs @@ -0,0 +1,52 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.Furniture.Monoliths; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.Furniture.Monoliths +{ + public class BlueDistortedMonolith : 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().monolithDevourerBShader = 30; + } + } + public override void UpdateVanity(Player player) + { + if (player.whoAmI == Main.myPlayer) + { + player.Calamity().monolithDevourerBShader = 30; + } + } + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(15). + AddTile(). + Register(); + } + } +} diff --git a/Items/Placeables/Furniture/Monoliths/BlueDistortedMonolith.png b/Items/Placeables/Furniture/Monoliths/BlueDistortedMonolith.png new file mode 100644 index 0000000000..d71ec7bed3 Binary files /dev/null and b/Items/Placeables/Furniture/Monoliths/BlueDistortedMonolith.png differ diff --git a/Items/Placeables/Furniture/Monoliths/BossRushMonolith.cs b/Items/Placeables/Furniture/Monoliths/BossRushMonolith.cs new file mode 100644 index 0000000000..1a60e8a7ec --- /dev/null +++ b/Items/Placeables/Furniture/Monoliths/BossRushMonolith.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 BossRushMonolith : 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().monolithBossRushShader = 30; + } + } + public override void UpdateVanity(Player player) + { + if (player.whoAmI == Main.myPlayer) + { + player.Calamity().monolithBossRushShader = 30; + } + } + } +} diff --git a/Items/Placeables/Furniture/Monoliths/BossRushMonolith.png b/Items/Placeables/Furniture/Monoliths/BossRushMonolith.png new file mode 100644 index 0000000000..d00e2fd304 Binary files /dev/null and b/Items/Placeables/Furniture/Monoliths/BossRushMonolith.png differ diff --git a/Items/Placeables/Furniture/Monoliths/DeepSeaAnchor.cs b/Items/Placeables/Furniture/Monoliths/DeepSeaAnchor.cs new file mode 100644 index 0000000000..13dce481a5 --- /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.Lime; + 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/DeepSeaAnchor.png b/Items/Placeables/Furniture/Monoliths/DeepSeaAnchor.png new file mode 100644 index 0000000000..e6b2968997 Binary files /dev/null and b/Items/Placeables/Furniture/Monoliths/DeepSeaAnchor.png differ diff --git a/Items/Placeables/Furniture/Monoliths/DraconicIncense.cs b/Items/Placeables/Furniture/Monoliths/DraconicIncense.cs new file mode 100644 index 0000000000..ab3b483412 --- /dev/null +++ b/Items/Placeables/Furniture/Monoliths/DraconicIncense.cs @@ -0,0 +1,52 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.CraftingStations; +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; + } + } + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(15). + AddTile(). + Register(); + } + } +} diff --git a/Items/Placeables/Furniture/Monoliths/DraconicIncense.png b/Items/Placeables/Furniture/Monoliths/DraconicIncense.png new file mode 100644 index 0000000000..c01bdb3522 Binary files /dev/null and b/Items/Placeables/Furniture/Monoliths/DraconicIncense.png differ diff --git a/Items/Placeables/Furniture/Monoliths/ExoObelisk.cs b/Items/Placeables/Furniture/Monoliths/ExoObelisk.cs new file mode 100644 index 0000000000..3c7352e50f --- /dev/null +++ b/Items/Placeables/Furniture/Monoliths/ExoObelisk.cs @@ -0,0 +1,52 @@ +using CalamityMod.Items.Placeables.FurnitureExo; +using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.CraftingStations; +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; + } + } + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(15). + AddTile(). + Register(); + } + } +} diff --git a/Items/Placeables/Furniture/Monoliths/ExoObelisk.png b/Items/Placeables/Furniture/Monoliths/ExoObelisk.png new file mode 100644 index 0000000000..73478f08f7 Binary files /dev/null and b/Items/Placeables/Furniture/Monoliths/ExoObelisk.png differ diff --git a/Items/Placeables/Furniture/Monoliths/FrigidMonolith.cs b/Items/Placeables/Furniture/Monoliths/FrigidMonolith.cs new file mode 100644 index 0000000000..a9f7bff28b --- /dev/null +++ b/Items/Placeables/Furniture/Monoliths/FrigidMonolith.cs @@ -0,0 +1,42 @@ +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/FrigidMonolith.png b/Items/Placeables/Furniture/Monoliths/FrigidMonolith.png new file mode 100644 index 0000000000..ede7749947 Binary files /dev/null and b/Items/Placeables/Furniture/Monoliths/FrigidMonolith.png differ diff --git a/Items/Placeables/Furniture/Monoliths/PlagueHumidifier.cs b/Items/Placeables/Furniture/Monoliths/PlagueHumidifier.cs new file mode 100644 index 0000000000..fa4da117ad --- /dev/null +++ b/Items/Placeables/Furniture/Monoliths/PlagueHumidifier.cs @@ -0,0 +1,52 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.CraftingStations; +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.Yellow; + 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; + } + } + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(15). + AddTile(TileID.MythrilAnvil). + Register(); + } + } +} diff --git a/Items/Placeables/Furniture/Monoliths/PlagueHumidifier.png b/Items/Placeables/Furniture/Monoliths/PlagueHumidifier.png new file mode 100644 index 0000000000..881c5f262e Binary files /dev/null and b/Items/Placeables/Furniture/Monoliths/PlagueHumidifier.png differ diff --git a/Items/Placeables/Furniture/Monoliths/PurpleDistortedMonolith.cs b/Items/Placeables/Furniture/Monoliths/PurpleDistortedMonolith.cs new file mode 100644 index 0000000000..a665e83478 --- /dev/null +++ b/Items/Placeables/Furniture/Monoliths/PurpleDistortedMonolith.cs @@ -0,0 +1,52 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.Furniture.Monoliths; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.Furniture.Monoliths +{ + public class PurpleDistortedMonolith : 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().monolithDevourerPShader = 30; + } + } + public override void UpdateVanity(Player player) + { + if (player.whoAmI == Main.myPlayer) + { + player.Calamity().monolithDevourerPShader = 30; + } + } + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(15). + AddTile(). + Register(); + } + } +} diff --git a/Items/Placeables/Furniture/Monoliths/PurpleDistortedMonolith.png b/Items/Placeables/Furniture/Monoliths/PurpleDistortedMonolith.png new file mode 100644 index 0000000000..d71ec7bed3 Binary files /dev/null and b/Items/Placeables/Furniture/Monoliths/PurpleDistortedMonolith.png differ diff --git a/Items/Placeables/FurnitureSacrilegious/MonolithOfTheAccursed.cs b/Items/Placeables/FurnitureSacrilegious/MonolithOfTheAccursed.cs index 78fa975c91..89edc10885 100644 --- a/Items/Placeables/FurnitureSacrilegious/MonolithOfTheAccursed.cs +++ b/Items/Placeables/FurnitureSacrilegious/MonolithOfTheAccursed.cs @@ -1,6 +1,7 @@ using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; using CalamityMod.Tiles.FurnitureSacrilegious; +using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureSacrilegious @@ -20,7 +21,23 @@ namespace CalamityMod.Items.Placeables.FurnitureSacrilegious Item.useStyle = ItemUseStyleID.Swing; Item.consumable = true; Item.createTile = ModContent.TileType(); - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); + Item.accessory = true; + Item.vanity = true; + } + public override void UpdateEquip(Player player) + { + if (player.whoAmI == Main.myPlayer) + { + player.Calamity().monolithAccursedShader = 30; + } + } + public override void UpdateVanity(Player player) + { + if (player.whoAmI == Main.myPlayer) + { + player.Calamity().monolithAccursedShader = 30; + } } public override void AddRecipes() diff --git a/Items/Rock.cs b/Items/Rock.cs index 9cb25efc5a..b74679d9e6 100644 --- a/Items/Rock.cs +++ b/Items/Rock.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles; +using CalamityMod.Items.Placeables.Furniture.Monoliths; +using CalamityMod.Tiles; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -11,6 +12,7 @@ namespace CalamityMod.Items public override void SetStaticDefaults() { Item.ResearchUnlockCount = 0; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() diff --git a/Items/TreasureBags/LeviathanBag.cs b/Items/TreasureBags/LeviathanBag.cs index 65b7d4c396..a772eed178 100644 --- a/Items/TreasureBags/LeviathanBag.cs +++ b/Items/TreasureBags/LeviathanBag.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.Placeables.Furniture.DevPaintings; +using CalamityMod.Items.Placeables.Furniture.Monoliths; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; @@ -81,6 +82,7 @@ namespace CalamityMod.Items.TreasureBags // Vanity itemLoot.Add(ModContent.ItemType(), 7); itemLoot.Add(ModContent.ItemType(), 7); + itemLoot.Add(ModContent.ItemType(), 15); itemLoot.Add(ModContent.ItemType(), ThankYouPainting.DropInt); } } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson index 2cacd00403..685ed29f5d 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson @@ -666,6 +666,51 @@ LanternCenter: { Tooltip: Lights up the night sky with celebratory lanterns } +AstralProjector: { + DisplayName: Astral Projector + Tooltip: "'Control a small portion of the Astral Infection's influence.'" +} + +BlueDistortedMonolith: { + DisplayName: Blue Distorted Monolith + Tooltip: "'Create a localized rupture in the fabric of reality.'" +} + +BossRushMonolith: { + DisplayName: Boss Rush Monolith + Tooltip: "'Bring forth the end.'" +} + +DeepSeaAnchor: { + DisplayName: Deep Sea Anchor + Tooltip: "'Dampen the air with heavy amounts of brine.'" +} + +DraconicIncense: { + DisplayName: Draconic Incense + Tooltip: "'Ignite the air with dragonfire.'" +} + +ExoObelisk: { + DisplayName: Exo Obelisk + Tooltip: "'Energize the atmosphere with exo energy.'" +} + +FrigidMonolith: { + DisplayName: Frigid Monolith + Tooltip: "'Enchant the sky with frosty auroras.'" +} + +PlagueHumidifier: { + DisplayName: Plague Humidifier + Tooltip: "'Spread light amounts of the plague through the air.'" +} + +PurpleDistortedMonolith: { + DisplayName: Purple Distorted Monolith + Tooltip: "'Create a localized rupture in the fabric of reality.'" +} + NavyPrismTorch: { DisplayName: Navy Prism Torch Tooltip: Can be placed in water diff --git a/NPCs/DevourerofGods/DoGScreenShaderData.cs b/NPCs/DevourerofGods/DoGScreenShaderData.cs index 2dd556a00a..74963b76e8 100644 --- a/NPCs/DevourerofGods/DoGScreenShaderData.cs +++ b/NPCs/DevourerofGods/DoGScreenShaderData.cs @@ -38,7 +38,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (DoGIndex == -1) { UpdateDoGIndex(); - if (DoGIndex == -1) + if (DoGIndex == -1 && Main.LocalPlayer.Calamity().monolithDevourerPShader <= 0 && Main.LocalPlayer.Calamity().monolithDevourerBShader <= 0) Filters.Scene["CalamityMod:DevourerofGodsHead"].Deactivate(); } } @@ -50,6 +50,10 @@ namespace CalamityMod.NPCs.DevourerofGods { UseTargetPosition(Main.npc[DoGIndex].Center); } + else if (Main.LocalPlayer.Calamity().monolithDevourerPShader > 0 || Main.LocalPlayer.Calamity().monolithDevourerBShader > 0) + { + UseTargetPosition(Main.LocalPlayer.Center); + } base.Apply(); } } diff --git a/NPCs/DevourerofGods/DoGSky.cs b/NPCs/DevourerofGods/DoGSky.cs index e6a5f12315..76a41b16b9 100644 --- a/NPCs/DevourerofGods/DoGSky.cs +++ b/NPCs/DevourerofGods/DoGSky.cs @@ -20,7 +20,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (DoGIndex == -1) { UpdateDoGIndex(); - if (DoGIndex == -1) + if (DoGIndex == -1 && Main.LocalPlayer.Calamity().monolithDevourerBShader <= 0 && Main.LocalPlayer.Calamity().monolithDevourerPShader <= 0) isActive = false; } @@ -75,29 +75,47 @@ namespace CalamityMod.NPCs.DevourerofGods public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth) { - if (maxDepth >= 0 && minDepth < 0 && DoGIndex != -1) + if (maxDepth >= 0 && minDepth < 0) { - if (Main.npc[DoGIndex].active) + if (DoGIndex != -1) { - float intensity = GetIntensity(); - float lifeRatio = Main.npc[DoGIndex].life / (float)Main.npc[DoGIndex].lifeMax; - double blackScreenLife_GateValue = (lifeRatio < 0.6f && Main.npc[DoGIndex].localAI[2] <= 2f) ? 0.15 : 0.75; - - float timeToReachNextColor = DevourerofGodsHead.SkyColorTransitionTime; - float phaseTimer = Main.npc[DoGIndex].Calamity().newAI[2]; - float colorChangeProgress = phaseTimer / timeToReachNextColor; - if (colorChangeProgress > 1f) - colorChangeProgress = 1f; - - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - Color regularSkyColor = (Main.npc[DoGIndex].ai[3] == 0f ? Color.Lerp(Color.Fuchsia, Color.Cyan, colorChangeProgress) : Color.Lerp(Color.Cyan, Color.Fuchsia, colorChangeProgress)) * intensity; - if (Main.npc[DoGIndex].life < Main.npc[DoGIndex].lifeMax * blackScreenLife_GateValue || death || Main.npc[DoGIndex].localAI[3] > 0f) + if (Main.npc[DoGIndex].active) { - float blackSkyTransitionProgress = death ? 1f : Main.npc[DoGIndex].localAI[3] / timeToReachNextColor; - spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle(0, 0, Main.screenWidth * 2, Main.screenHeight * 2), Color.Lerp(regularSkyColor, Color.Black * (intensity + 0.5f), blackSkyTransitionProgress)); + float intensity = GetIntensity(); + float lifeRatio = Main.npc[DoGIndex].life / (float)Main.npc[DoGIndex].lifeMax; + double blackScreenLife_GateValue = (lifeRatio < 0.6f && Main.npc[DoGIndex].localAI[2] <= 2f) ? 0.15 : 0.75; + + float timeToReachNextColor = DevourerofGodsHead.SkyColorTransitionTime; + float phaseTimer = Main.npc[DoGIndex].Calamity().newAI[2]; + float colorChangeProgress = phaseTimer / timeToReachNextColor; + if (colorChangeProgress > 1f) + colorChangeProgress = 1f; + + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + Color regularSkyColor = (Main.npc[DoGIndex].ai[3] == 0f ? Color.Lerp(Color.Fuchsia, Color.Cyan, colorChangeProgress) : Color.Lerp(Color.Cyan, Color.Fuchsia, colorChangeProgress)) * intensity; + if (Main.npc[DoGIndex].life < Main.npc[DoGIndex].lifeMax * blackScreenLife_GateValue || death || Main.npc[DoGIndex].localAI[3] > 0f) + { + float blackSkyTransitionProgress = death ? 1f : Main.npc[DoGIndex].localAI[3] / timeToReachNextColor; + spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle(0, 0, Main.screenWidth * 2, Main.screenHeight * 2), Color.Lerp(regularSkyColor, Color.Black * (intensity + 0.5f), blackSkyTransitionProgress)); + } + else + spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle(0, 0, Main.screenWidth * 2, Main.screenHeight * 2), regularSkyColor); + } + } + else + { + if (Main.LocalPlayer.Calamity().monolithDevourerBShader > 0) + { + float intensity = MathHelper.Min(MathHelper.Lerp(0, 0.5f, (float)Main.LocalPlayer.Calamity().monolithDevourerBShader / 15), 0.45f); + Color regularSkyColor = Color.Cyan; + spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle(0, 0, Main.screenWidth * 2, Main.screenHeight * 2), regularSkyColor * intensity); + } + if (Main.LocalPlayer.Calamity().monolithDevourerPShader > 0) + { + float intensity = MathHelper.Min(MathHelper.Lerp(0, 0.5f, (float)Main.LocalPlayer.Calamity().monolithDevourerPShader / 15), 0.45f); + Color regularSkyColor = Color.Fuchsia; + spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle(0, 0, Main.screenWidth * 2, Main.screenHeight * 2), regularSkyColor * intensity); } - else - spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle(0, 0, Main.screenWidth * 2, Main.screenHeight * 2), regularSkyColor); } } } diff --git a/NPCs/Leviathan/LevScreenShaderData.cs b/NPCs/Leviathan/LevScreenShaderData.cs index 2cd7258460..3552560be3 100644 --- a/NPCs/Leviathan/LevScreenShaderData.cs +++ b/NPCs/Leviathan/LevScreenShaderData.cs @@ -36,7 +36,7 @@ namespace CalamityMod.NPCs.Leviathan public override void Update(GameTime gameTime) { - if (LevIndex == -1 || BossRushEvent.BossRushActive) + if ((LevIndex == -1 && Main.LocalPlayer.Calamity().monolithLeviathanShader <= 0) || BossRushEvent.BossRushActive) { UpdateLIndex(); if (LevIndex == -1 || BossRushEvent.BossRushActive) @@ -51,6 +51,10 @@ namespace CalamityMod.NPCs.Leviathan { UseTargetPosition(Main.npc[LevIndex].Center); } + if (Main.LocalPlayer.Calamity().monolithLeviathanShader > 0) + { + UseTargetPosition(Main.LocalPlayer.Center); + } base.Apply(); } } diff --git a/NPCs/Leviathan/LevSky.cs b/NPCs/Leviathan/LevSky.cs index 5ee402bbb5..17c53ba72b 100644 --- a/NPCs/Leviathan/LevSky.cs +++ b/NPCs/Leviathan/LevSky.cs @@ -16,10 +16,10 @@ namespace CalamityMod.NPCs.Leviathan public override void Update(GameTime gameTime) { - if (LevIndex == -1 || BossRushEvent.BossRushActive) + if ((LevIndex == -1 && Main.LocalPlayer.Calamity().monolithLeviathanShader <= 0) || BossRushEvent.BossRushActive) { UpdateLIndex(); - if (LevIndex == -1 || BossRushEvent.BossRushActive) + if ((LevIndex == -1 && Main.LocalPlayer.Calamity().monolithLeviathanShader <= 0) || BossRushEvent.BossRushActive) isActive = false; } diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index 44d8979e65..ade98ce310 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -8,6 +8,7 @@ using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; using CalamityMod.Items.Placeables.Furniture.BossRelics; using CalamityMod.Items.Placeables.Furniture.DevPaintings; +using CalamityMod.Items.Placeables.Furniture.Monoliths; using CalamityMod.Items.Placeables.Furniture.Trophies; using CalamityMod.Items.TreasureBags; using CalamityMod.Items.Weapons.Magic; @@ -872,6 +873,7 @@ namespace CalamityMod.NPCs.Leviathan // Vanity normalOnly.Add(ModContent.ItemType(), 7); normalOnly.Add(ModContent.ItemType(), 7); + normalOnly.Add(ModContent.ItemType(), 15); normalOnly.Add(ModContent.ItemType(), ThankYouPainting.DropInt); // Equipment diff --git a/NPCs/PlaguebringerGoliath/PbGScreenShaderData.cs b/NPCs/PlaguebringerGoliath/PbGScreenShaderData.cs index 004be2aa36..717e8c0cc0 100644 --- a/NPCs/PlaguebringerGoliath/PbGScreenShaderData.cs +++ b/NPCs/PlaguebringerGoliath/PbGScreenShaderData.cs @@ -35,10 +35,10 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath public override void Update(GameTime gameTime) { - if (PbGIndex == -1) + if (PbGIndex == -1 && Main.LocalPlayer.Calamity().monolithPlagueShader <= 0) { UpdatePbGIndex(); - if (PbGIndex == -1) + if (PbGIndex == -1 && Main.LocalPlayer.Calamity().monolithPlagueShader <= 0) Filters.Scene["CalamityMod:PlaguebringerGoliath"].Deactivate(); } } @@ -50,6 +50,10 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { UseTargetPosition(Main.npc[PbGIndex].Center); } + if (Main.LocalPlayer.Calamity().monolithPlagueShader > 0) + { + UseTargetPosition(Main.LocalPlayer.Center); + } base.Apply(); } } diff --git a/NPCs/PlaguebringerGoliath/PbGSky.cs b/NPCs/PlaguebringerGoliath/PbGSky.cs index 7ac452626c..ada84bda25 100644 --- a/NPCs/PlaguebringerGoliath/PbGSky.cs +++ b/NPCs/PlaguebringerGoliath/PbGSky.cs @@ -16,10 +16,10 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath public override void Update(GameTime gameTime) { - if (PbGIndex == -1 || BossRushEvent.BossRushActive) + if ((PbGIndex == -1 && Main.LocalPlayer.Calamity().monolithPlagueShader <= 0) || BossRushEvent.BossRushActive) { UpdatePbGIndex(); - if (PbGIndex == -1 || BossRushEvent.BossRushActive) + if ((PbGIndex == -1 && Main.LocalPlayer.Calamity().monolithPlagueShader <= 0) || BossRushEvent.BossRushActive) isActive = false; } } diff --git a/NPCs/TownNPCs/DILF.cs b/NPCs/TownNPCs/DILF.cs index 33ccfe0397..93a834e7cb 100644 --- a/NPCs/TownNPCs/DILF.cs +++ b/NPCs/TownNPCs/DILF.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Accessories; using CalamityMod.Items.Accessories.Vanity; using CalamityMod.Items.Ammo; +using CalamityMod.Items.Placeables.Furniture.Monoliths; using CalamityMod.Items.Potions; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; @@ -157,6 +158,7 @@ namespace CalamityMod.NPCs.TownNPCs .Add(ItemID.SuperManaPotion) .Add(ModContent.ItemType()) .AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(5)) + .AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(5)) .Add(ModContent.ItemType(), Condition.PlayerCarriesItem(ModContent.ItemType())) .Add(ItemID.IceCream, Condition.HappyEnough, Condition.InSnow) .Register(); 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/Particles/PlagueHumidifierMist.cs b/Particles/PlagueHumidifierMist.cs new file mode 100644 index 0000000000..73c5b92342 --- /dev/null +++ b/Particles/PlagueHumidifierMist.cs @@ -0,0 +1,29 @@ +using System; +using Microsoft.Xna.Framework; +using Terraria; + +namespace CalamityMod.Particles +{ + public class PlagueHumidifierMist : Particle + { + public override bool SetLifetime => true; + public override int FrameVariants => 7; + + public override string Texture => "CalamityMod/Particles/PlagueHumidifierMist"; + + public PlagueHumidifierMist(Vector2 relativePosition, int lifetime, float scale, Vector2 speed) + { + Velocity = speed; + Scale = scale; + Variant = Main.rand.Next(7); + Lifetime = lifetime; + Position = relativePosition; + } + + public override void Update() + { + Color = Color.Lerp(Lighting.GetColor((Position / 16).ToPoint()), Color.Transparent, LifetimeCompletion); + } + + } +} diff --git a/Particles/PlagueHumidifierMist.png b/Particles/PlagueHumidifierMist.png new file mode 100644 index 0000000000..c1e3c611e9 Binary files /dev/null and b/Particles/PlagueHumidifierMist.png differ 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/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/Scenes/MiscScenes/AstralMonolithScene.cs b/Scenes/MiscScenes/AstralMonolithScene.cs new file mode 100644 index 0000000000..f5dd4b4ee3 --- /dev/null +++ b/Scenes/MiscScenes/AstralMonolithScene.cs @@ -0,0 +1,17 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class AstralMonolithScene : ModSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.Environment; + + public override bool IsSceneEffectActive(Player player) => Main.LocalPlayer.Calamity().monolithAstralShader > 0; + + public override void SpecialVisuals(Player player, bool isActive) + { + player.ManageSpecialBiomeVisuals("CalamityMod:Astral", isActive); + } + } +} diff --git a/Scenes/MiscScenes/MonolithDistortionScene.cs b/Scenes/MiscScenes/MonolithDistortionScene.cs new file mode 100644 index 0000000000..9396487fc8 --- /dev/null +++ b/Scenes/MiscScenes/MonolithDistortionScene.cs @@ -0,0 +1,17 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class MonolithDistortionScene : ModSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.Environment; + + public override bool IsSceneEffectActive(Player player) => Main.LocalPlayer.Calamity().monolithDevourerBShader > 0 || Main.LocalPlayer.Calamity().monolithDevourerPShader > 0; + + public override void SpecialVisuals(Player player, bool isActive) + { + player.ManageSpecialBiomeVisuals("CalamityMod:DevourerofGodsHead", isActive); + } + } +} diff --git a/Skies/AstralMonolithScreenShaderData.cs b/Skies/AstralMonolithScreenShaderData.cs new file mode 100644 index 0000000000..b497c59694 --- /dev/null +++ b/Skies/AstralMonolithScreenShaderData.cs @@ -0,0 +1,31 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.Graphics.Effects; +using Terraria.Graphics.Shaders; + +namespace CalamityMod.Skies +{ + public class AstralMonolithScreenShaderData : ScreenShaderData + { + public AstralMonolithScreenShaderData(string passName) + : base(passName) + { + } + + public override void Apply() + { + Vector3 vec = Main.ColorOfTheSkies.ToVector3(); + vec *= 0.4f; + base.UseOpacity(Math.Max(vec.X, Math.Max(vec.Y, vec.Z))); + base.Apply(); + } + + public override void Update(GameTime gameTime) + { + if (Main.LocalPlayer.Calamity().monolithAstralShader <= 0) + Filters.Scene["CalamityMod:MonolithAstral"].Deactivate(Array.Empty()); + } + } +} diff --git a/Skies/AstralMonolithSky.cs b/Skies/AstralMonolithSky.cs new file mode 100644 index 0000000000..11135236e0 --- /dev/null +++ b/Skies/AstralMonolithSky.cs @@ -0,0 +1,103 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.GameContent; +using Terraria.Graphics.Effects; +using Terraria.ID; + +namespace CalamityMod.Skies +{ + public class AstralMonolithSky : CustomSky + { + private bool skyActive; + private float opacity; + + public override void Deactivate(params object[] args) => skyActive = false; + + public override void Reset() => skyActive = false; + + public override bool IsActive() => skyActive || opacity > 0f; + + public override void Activate(Vector2 position, params object[] args) => skyActive = true; + + public override void Update(GameTime gameTime) + { + if (Main.LocalPlayer.Calamity().monolithAstralShader < 1) + skyActive = false; + + if (skyActive && opacity < 1f) + opacity += 0.02f; + else if (!skyActive && opacity > 0f) + opacity -= 0.02f; + + Opacity = opacity; + } + + public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth) + { + if (Main.LocalPlayer.Calamity().monolithAstralShader <= 0) + return; + float whateverTheFuckThisVariableIsSupposedToBe = 3.40282347E+38f; + if (maxDepth >= whateverTheFuckThisVariableIsSupposedToBe && minDepth < whateverTheFuckThisVariableIsSupposedToBe) + { + spriteBatch.Draw(CalamityMod.AstralSky, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.White * opacity); + + // Terraria's conditions. + if (Main.netMode != NetmodeID.Server) + { + int bgTop = (int)((-Main.screenPosition.Y) / (Main.worldSurface * 16.0 - 600.0) * 200.0); + float colorMult = 0.952f * opacity; + Color astralcyan = new Color(100, 183, 255); + Color purple = new Color(201, 148, 255); + Color yellow = new Color(255, 146, 73); + float width1 = Main.screenWidth / 500f; + float height1 = Main.screenHeight / 600f; + float width2 = Main.screenWidth / 600f; + float height2 = Main.screenHeight / 800f; + float width3 = Main.screenWidth / 200f; + float height3 = Main.screenHeight / 900f; + float width4 = Main.screenWidth / 1000f; + float height4 = Main.screenHeight / 200f; + for (int i = 0; i < Main.star.Length; i++) + { + Star star = Main.star[i]; + if (star == null) + continue; + + Texture2D t2D = TextureAssets.Star[star.type].Value; + Vector2 origin = new Vector2(t2D.Width * 0.5f, t2D.Height * 0.5f); + float posX = star.position.X * width1; + float posY = star.position.Y * height1; + Vector2 position = new Vector2(posX + origin.X, posY + origin.Y + bgTop); + spriteBatch.Draw(t2D, position, new Rectangle(0, 0, t2D.Width, t2D.Height), astralcyan * star.twinkle * colorMult, star.rotation, origin, (star.scale * star.twinkle) - 0.2f, SpriteEffects.None, 0f); + + origin = new Vector2(t2D.Width * 0.2f, t2D.Height * 0.2f); + posX = star.position.X * width2; + posY = star.position.Y * height2; + position = new Vector2(posX + origin.X, posY + origin.Y + bgTop); + spriteBatch.Draw(t2D, position, new Rectangle(0, 0, t2D.Width, t2D.Height), purple * star.twinkle * colorMult, star.rotation, origin, (star.scale * star.twinkle) + 0.2f, SpriteEffects.None, 0f); + + origin = new Vector2(t2D.Width * 0.8f, t2D.Height * 0.8f); + posX = star.position.X * width3; + posY = star.position.Y * height3; + position = new Vector2(posX + origin.X, posY + origin.Y + bgTop); + spriteBatch.Draw(t2D, position, new Rectangle(0, 0, t2D.Width, t2D.Height), yellow * star.twinkle * colorMult, star.rotation, origin, star.scale * star.twinkle, SpriteEffects.None, 0f); + + origin = new Vector2(t2D.Width * 0.5f, t2D.Height * 0.5f); + posX = star.position.X * width4; + posY = star.position.Y * height4; + position = new Vector2(posX + origin.X, posY + origin.Y + bgTop); + spriteBatch.Draw(t2D, position, new Rectangle(0, 0, t2D.Width, t2D.Height), Color.White * star.twinkle * colorMult, star.rotation, origin, star.scale * star.twinkle, SpriteEffects.None, 0f); + } + } + } + } + + public override Color OnTileColor(Color inColor) + { + return Color.Lerp(inColor, new Color(63, 51, 90, inColor.A), opacity); + } + + public override float GetCloudAlpha() => (1f - opacity) * 0.3f + 0.7f; + } +} diff --git a/Skies/AstralScreenShaderData.cs b/Skies/AstralScreenShaderData.cs index 027d4ff809..01d6ea0873 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 d2d96c92b6..c919a6f549 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,13 +110,15 @@ 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) opacity += 0.02f; else if (!skyActive && opacity > 0f) opacity -= 0.02f; + + Opacity = opacity; } public override float GetCloudAlpha() diff --git a/Skies/BossRushSky.cs b/Skies/BossRushSky.cs index ebad96ffda..a0e21abc62 100644 --- a/Skies/BossRushSky.cs +++ b/Skies/BossRushSky.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Skies public static bool DetermineDrawEligibility() { - bool useEffect = ((BossRushEvent.BossRushActive && BossRushEvent.StartTimer > 100) || ShouldDrawRegularly) && !Main.gameMenu; + bool useEffect = ((BossRushEvent.BossRushActive && BossRushEvent.StartTimer > 100) || ShouldDrawRegularly || Main.LocalPlayer?.Calamity()?.monolithBossRushShader > 0) && !Main.gameMenu; if (SkyManager.Instance["CalamityMod:BossRush"] != null && useEffect != SkyManager.Instance["CalamityMod:BossRush"].IsActive()) { @@ -66,7 +66,7 @@ namespace CalamityMod.Skies private float GetIntensity() { - if (ShouldDrawRegularly) + if (ShouldDrawRegularly || Main.LocalPlayer?.Calamity().monolithBossRushShader > 0) return 1f; float fadeRatio = BossRushEvent.StartTimer / (float)BossRushEvent.StartEffectTotalTime; @@ -77,7 +77,7 @@ namespace CalamityMod.Skies public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth) { - if (GetIntensity() == 0f) + if (GetIntensity() == 0f && Main.LocalPlayer?.Calamity()?.monolithBossRushShader <= 0) return; if (maxDepth >= 0 && minDepth < 0 && GetIntensity() > 0f) @@ -103,7 +103,7 @@ namespace CalamityMod.Skies Main.spriteBatch.Begin(); // Draw the Xeroc eye at the back of the sky. - if (maxDepth >= float.MaxValue && minDepth < float.MaxValue && (BossRushEvent.EndTimer < BossRushEvent.EndVisualEffectTime - 40f || ShouldDrawRegularly)) + if (maxDepth >= float.MaxValue && minDepth < float.MaxValue && (BossRushEvent.EndTimer < BossRushEvent.EndVisualEffectTime - 40f || ShouldDrawRegularly || Main.LocalPlayer?.Calamity()?.monolithBossRushShader > 0)) { Vector2 screenCenter = Main.screenPosition + new Vector2(Main.screenWidth, Main.screenHeight) * 0.5f; screenCenter += new Vector2(Main.screenWidth, Main.screenHeight) * (Main.GameViewMatrix.Zoom - Vector2.One) * 0.5f; diff --git a/Skies/CryogenSky.cs b/Skies/CryogenSky.cs index 50ba224e5a..e8d05d6677 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()) { @@ -46,10 +46,17 @@ namespace CalamityMod.Skies public override void Update(GameTime gameTime) { - if (FadeInCountdown > 0) - FadeInCountdown--; + if (!ShouldDrawRegularly && Main.LocalPlayer.Calamity().monolithCryogenShader <= 0) + { + if (FadeInCountdown > 0) + FadeInCountdown--; + } + else + { + FadeInCountdown = 1; + } - if (CryogenIndex == -1 && !ShouldDrawRegularly) + if (CryogenIndex == -1 && !ShouldDrawRegularly && Main.LocalPlayer.Calamity().monolithCryogenShader <= 0) { UpdateCryogenIndex(); if (FadeoutTimer == 0) @@ -89,7 +96,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 21d357131b..ef8f893313 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,9 @@ namespace CalamityMod.Skies public override void Deactivate(params object[] args) { } - public override bool IsActive() => CanSkyBeActive && !Main.gameMenu; + public override bool IsActive() + { + return !Main.gameMenu && (CanSkyBeActive || Main.LocalPlayer?.Calamity()?.monolithExoShader > 0); + } } } diff --git a/Systems/LightingEffectsSystem.cs b/Systems/LightingEffectsSystem.cs index a8401d8d73..679a7137dc 100644 --- a/Systems/LightingEffectsSystem.cs +++ b/Systems/LightingEffectsSystem.cs @@ -97,6 +97,12 @@ namespace CalamityMod.Systems Main.ColorOfTheSkies = Color.Lerp(Main.ColorOfTheSkies, Color.DarkGray, intensity * 0.9f); Main.ColorOfTheSkies = Color.Lerp(Main.ColorOfTheSkies, Color.Black, intensity * 0.65f); } + else if (Main.LocalPlayer?.Calamity()?.monolithAstralShader > 0) + { + float intensity = SkyManager.Instance["CalamityMod:Astral"].Opacity; + backgroundColor = Color.Lerp(backgroundColor, Color.Purple, intensity * 0.4f); + backgroundColor = Color.Lerp(backgroundColor, Color.Black, intensity * 0.75f); + } } } } diff --git a/Tiles/Furniture/Monoliths/AstralProjectorTile.cs b/Tiles/Furniture/Monoliths/AstralProjectorTile.cs new file mode 100644 index 0000000000..a13d71494f --- /dev/null +++ b/Tiles/Furniture/Monoliths/AstralProjectorTile.cs @@ -0,0 +1,147 @@ +using CalamityMod.Dusts; +using CalamityMod.Items.Placeables.Furniture.Monoliths; +using CalamityMod.NPCs.Yharon; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +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 static Texture2D Glow; + public override void SetStaticDefaults() + { + if (!Main.dedServ) + { + Glow = ModContent.Request("CalamityMod/Tiles/Furniture/Monoliths/AstralProjectorTile_Glow", AssetRequestMode.AsyncLoad).Value; + } + RegisterItemDrop(ModContent.ItemType()); + Main.tileFrameImportant[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); + TileObjectData.newTile.Height = 3; + TileObjectData.newTile.Origin = new Point16(0, 2); + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16, 18 }; + TileObjectData.newTile.LavaDeath = false; + TileObjectData.newTile.UsesCustomCanPlace = true; + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop, 2, 0); + TileObjectData.addTile(Type); + + AddMapEntry(new Color(16, 50, 64)); + + DustType = ModContent.DustType(); + AnimationFrameHeight = 56; + } + + public override void NearbyEffects(int i, int j, bool closer) + { + if (Main.tile[i, j].TileFrameY < 56) + { + 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 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 = 18; + int animate = 0; + if (tile.TileFrameY >= 56) + { + animate = Main.tileFrame[Type] * 56; + } + 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); + if (Glow != null) + 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/AstralProjectorTile.png b/Tiles/Furniture/Monoliths/AstralProjectorTile.png new file mode 100644 index 0000000000..4c5220bc9e 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..afb5b23e67 Binary files /dev/null and b/Tiles/Furniture/Monoliths/AstralProjectorTile_Glow.png differ diff --git a/Tiles/Furniture/Monoliths/BlueDistortedMonolithTile.cs b/Tiles/Furniture/Monoliths/BlueDistortedMonolithTile.cs new file mode 100644 index 0000000000..03fa351c0d --- /dev/null +++ b/Tiles/Furniture/Monoliths/BlueDistortedMonolithTile.cs @@ -0,0 +1,140 @@ +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 BlueDistortedMonolithTile : ModTile + { + public override void SetStaticDefaults() + { + RegisterItemDrop(ModContent.ItemType()); + Main.tileFrameImportant[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3); + TileObjectData.newTile.Width = 5; + TileObjectData.newTile.Height = 5; + TileObjectData.newTile.Origin = new Point16(2, 4); + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16, 16, 16, 18 }; + TileObjectData.newTile.LavaDeath = false; + TileObjectData.newTile.UsesCustomCanPlace = true; + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop, 5, 0); + TileObjectData.addTile(Type); + + AddMapEntry(new Color(50, 127, 209)); + + DustType = (int)CalamityDusts.BlueCosmilite; + AnimationFrameHeight = 92; + } + + 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().monolithDevourerBShader = 30; + } + } + + public override void AnimateTile(ref int frame, ref int frameCounter) + { + frameCounter++; + if (frameCounter >= 7.2) + { + frameCounter = 0; + if (++frame >= 6) + { + frame = 1; + } + } + } + + 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 % 5; + int y = j - Main.tile[i, j].TileFrameY / 18 % 5; + int tileXX18 = 92; + for (int l = x; l < x + 5; 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 < 5; 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 = 18; + 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); + return false; + } + } +} diff --git a/Tiles/Furniture/Monoliths/BlueDistortedMonolithTile.png b/Tiles/Furniture/Monoliths/BlueDistortedMonolithTile.png new file mode 100644 index 0000000000..6d3612ff2e Binary files /dev/null and b/Tiles/Furniture/Monoliths/BlueDistortedMonolithTile.png differ diff --git a/Tiles/Furniture/Monoliths/BossRushMonolithTile.cs b/Tiles/Furniture/Monoliths/BossRushMonolithTile.cs new file mode 100644 index 0000000000..37a929204c --- /dev/null +++ b/Tiles/Furniture/Monoliths/BossRushMonolithTile.cs @@ -0,0 +1,147 @@ +using CalamityMod.Dusts; +using CalamityMod.Items.Placeables.Furniture.Monoliths; +using CalamityMod.NPCs.Yharon; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +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 BossRushMonolithTile : ModTile + { + public static Texture2D Glow; + public override void SetStaticDefaults() + { + if (!Main.dedServ) + { + Glow = ModContent.Request("CalamityMod/Tiles/Furniture/Monoliths/BossRushMonolithTile_Glow", AssetRequestMode.AsyncLoad).Value; + } + RegisterItemDrop(ModContent.ItemType()); + Main.tileFrameImportant[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4); + TileObjectData.newTile.Width = 4; + TileObjectData.newTile.Origin = new Point16(2, 3); + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16, 16, 18 }; + TileObjectData.newTile.LavaDeath = false; + TileObjectData.newTile.UsesCustomCanPlace = true; + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop, 4, 0); + TileObjectData.addTile(Type); + + AddMapEntry(new Color(64, 8, 12)); + + DustType = (int)CalamityDusts.Brimstone; + 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().monolithBossRushShader = 30; + } + } + + public override void AnimateTile(ref int frame, ref int frameCounter) + { + frameCounter++; + if (frameCounter >= 7.2) + { + frameCounter = 0; + if (++frame >= 3) + { + frame = 0; + } + } + } + + 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 % 4; + int y = j - Main.tile[i, j].TileFrameY / 18 % 4; + int tileXX18 = 18 * 4; + for (int l = x; l < x + 4; 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 < 4; 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 = 18; + 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); + if (Glow != null) + 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/BossRushMonolithTile.png b/Tiles/Furniture/Monoliths/BossRushMonolithTile.png new file mode 100644 index 0000000000..f546e6ec43 Binary files /dev/null and b/Tiles/Furniture/Monoliths/BossRushMonolithTile.png differ diff --git a/Tiles/Furniture/Monoliths/BossRushMonolithTile_Glow.png b/Tiles/Furniture/Monoliths/BossRushMonolithTile_Glow.png new file mode 100644 index 0000000000..6dfbb80d91 Binary files /dev/null and b/Tiles/Furniture/Monoliths/BossRushMonolithTile_Glow.png differ diff --git a/Tiles/Furniture/Monoliths/DeepSeaAnchorTile.cs b/Tiles/Furniture/Monoliths/DeepSeaAnchorTile.cs new file mode 100644 index 0000000000..8d9350c6e9 --- /dev/null +++ b/Tiles/Furniture/Monoliths/DeepSeaAnchorTile.cs @@ -0,0 +1,138 @@ +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, 3); + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16, 16, 18 }; + TileObjectData.newTile.LavaDeath = false; + TileObjectData.newTile.UsesCustomCanPlace = true; + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop, 3, 0); + TileObjectData.addTile(Type); + + 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 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 = 18; + 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/DeepSeaAnchorTile.png b/Tiles/Furniture/Monoliths/DeepSeaAnchorTile.png new file mode 100644 index 0000000000..f11b3e66e5 Binary files /dev/null and b/Tiles/Furniture/Monoliths/DeepSeaAnchorTile.png differ diff --git a/Tiles/Furniture/Monoliths/DraconicIncenseTile.cs b/Tiles/Furniture/Monoliths/DraconicIncenseTile.cs new file mode 100644 index 0000000000..1537d8e7d6 --- /dev/null +++ b/Tiles/Furniture/Monoliths/DraconicIncenseTile.cs @@ -0,0 +1,145 @@ +using CalamityMod.Items.Placeables.Furniture.Monoliths; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +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 DraconicIncenseTile : ModTile + { + public static Texture2D Glow; + public override void SetStaticDefaults() + { + if (!Main.dedServ) + { + Glow = ModContent.Request("CalamityMod/Tiles/Furniture/Monoliths/DraconicIncenseTile_Glow", AssetRequestMode.AsyncLoad).Value; + } + RegisterItemDrop(ModContent.ItemType()); + Main.tileFrameImportant[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); + TileObjectData.newTile.Height = 6; + TileObjectData.newTile.Origin = new Point16(0, 5); + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16, 16, 16, 16, 18 }; + TileObjectData.newTile.LavaDeath = false; + TileObjectData.newTile.UsesCustomCanPlace = true; + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop, 2, 0); + TileObjectData.addTile(Type); + + AddMapEntry(new Color(143, 106, 41)); + + DustType = DustID.Flare; + AnimationFrameHeight = 110; + } + + public override void NearbyEffects(int i, int j, bool closer) + { + if (Main.tile[i, j].TileFrameY < 110) + { + return; + } + + Player player = Main.LocalPlayer; + if (player is null) + { + return; + } + + if (player.active) + { + Main.LocalPlayer.Calamity().monolithYharonShader = 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 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 % 6; + int tileXX18 = 110; + for (int l = x; l < x + 2; l++) + { + for (int m = y; m < y + 6; 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 < 6; 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 = 18; + int animate = 0; + if (tile.TileFrameY >= 110) + { + 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); + if (Glow != null) + 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/DraconicIncenseTile.png b/Tiles/Furniture/Monoliths/DraconicIncenseTile.png new file mode 100644 index 0000000000..f41d683c71 Binary files /dev/null and b/Tiles/Furniture/Monoliths/DraconicIncenseTile.png differ diff --git a/Tiles/Furniture/Monoliths/DraconicIncenseTile_Glow.png b/Tiles/Furniture/Monoliths/DraconicIncenseTile_Glow.png new file mode 100644 index 0000000000..08635f8d22 Binary files /dev/null and b/Tiles/Furniture/Monoliths/DraconicIncenseTile_Glow.png differ diff --git a/Tiles/Furniture/Monoliths/DraconicIncenseTile_Highlight.png b/Tiles/Furniture/Monoliths/DraconicIncenseTile_Highlight.png new file mode 100644 index 0000000000..0c4fd4884c Binary files /dev/null and b/Tiles/Furniture/Monoliths/DraconicIncenseTile_Highlight.png differ diff --git a/Tiles/Furniture/Monoliths/ExoObeliskText.png b/Tiles/Furniture/Monoliths/ExoObeliskText.png new file mode 100644 index 0000000000..374ee1df36 Binary files /dev/null and b/Tiles/Furniture/Monoliths/ExoObeliskText.png differ diff --git a/Tiles/Furniture/Monoliths/ExoObeliskTile.cs b/Tiles/Furniture/Monoliths/ExoObeliskTile.cs new file mode 100644 index 0000000000..90c6b4a01e --- /dev/null +++ b/Tiles/Furniture/Monoliths/ExoObeliskTile.cs @@ -0,0 +1,161 @@ +using CalamityMod.Dusts; +using CalamityMod.Items.Dyes; +using CalamityMod.Items.Placeables.Furniture.Monoliths; +using CalamityMod.NPCs.Yharon; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.Enums; +using Terraria.GameContent; +using Terraria.GameContent.ObjectInteractions; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.Furniture.Monoliths +{ + public class ExoObeliskTile : ModTile + { + public static Texture2D Glow; + public static Texture2D Numbers; + public override void SetStaticDefaults() + { + if (!Main.dedServ) + { + Glow = ModContent.Request("CalamityMod/Tiles/Furniture/Monoliths/ExoObeliskTile_Glow", AssetRequestMode.AsyncLoad).Value; + Numbers = ModContent.Request("CalamityMod/Tiles/Furniture/Monoliths/ExoObeliskText", AssetRequestMode.AsyncLoad).Value; + } + RegisterItemDrop(ModContent.ItemType()); + Main.tileFrameImportant[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4); + TileObjectData.newTile.Height = 5; + TileObjectData.newTile.Origin = new Point16(1, 4); + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16, 16, 16, 18 }; + TileObjectData.newTile.LavaDeath = false; + TileObjectData.newTile.UsesCustomCanPlace = true; + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop, 3, 0); + TileObjectData.addTile(Type); + + AddMapEntry(new Color(54, 54, 54)); + + 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 >= 6) + { + frameCounter = 0; + if (++frame >= 13) + { + frame = 0; + } + } + } + + 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 = 18; + 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); + if (Glow != null) + 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); + if (Numbers != null) + { + int colorIndex = (int)(Main.GlobalTimeWrappedHourly / 0.5 % CalamityUtils.ExoPalette.Length); + Color currentColor = CalamityUtils.ExoPalette[colorIndex]; + Color nextColor = CalamityUtils.ExoPalette[(colorIndex + 1) % CalamityUtils.ExoPalette.Length]; + Color exoColors = Color.Lerp(currentColor, nextColor, Main.GlobalTimeWrappedHourly % 0.5f > 1f ? 1f : Main.GlobalTimeWrappedHourly % 1f); + + Main.spriteBatch.Draw(Numbers, new Vector2(i * 16 - (int)Main.screenPosition.X, j * 16 - (int)Main.screenPosition.Y) + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY + animate, 16, height), exoColors, 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..53aa22ae4b 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..35b578e203 Binary files /dev/null and b/Tiles/Furniture/Monoliths/ExoObeliskTile_Glow.png differ diff --git a/Tiles/Furniture/Monoliths/FrigidMonolithTile.cs b/Tiles/Furniture/Monoliths/FrigidMonolithTile.cs new file mode 100644 index 0000000000..df8c715d53 --- /dev/null +++ b/Tiles/Furniture/Monoliths/FrigidMonolithTile.cs @@ -0,0 +1,138 @@ +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.Style3x4); + TileObjectData.newTile.Origin = new Point16(0, 2); + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16, 16, 18 }; + TileObjectData.newTile.LavaDeath = false; + TileObjectData.newTile.UsesCustomCanPlace = true; + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop, 3, 0); + TileObjectData.addTile(Type); + + AddMapEntry(new Color(55, 212, 230)); + + DustType = DustID.Ice; + AnimationFrameHeight = 74; + } + + public override void NearbyEffects(int i, int j, bool closer) + { + if (Main.tile[i, j].TileFrameY < 74) + { + 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 >= 6) + { + frame = 0; + } + } + } + + 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 = 74; + 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 = 18; + int animate = 0; + if (tile.TileFrameY >= 74) + { + 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/FrigidMonolithTile.png b/Tiles/Furniture/Monoliths/FrigidMonolithTile.png new file mode 100644 index 0000000000..c77d1a431f Binary files /dev/null and b/Tiles/Furniture/Monoliths/FrigidMonolithTile.png differ diff --git a/Tiles/Furniture/Monoliths/PlagueHumidifierTile.cs b/Tiles/Furniture/Monoliths/PlagueHumidifierTile.cs new file mode 100644 index 0000000000..66e5f708a2 --- /dev/null +++ b/Tiles/Furniture/Monoliths/PlagueHumidifierTile.cs @@ -0,0 +1,149 @@ +using CalamityMod.Dusts; +using CalamityMod.Items.Placeables.Furniture.Monoliths; +using CalamityMod.NPCs.Yharon; +using CalamityMod.Particles; +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 = 4; + TileObjectData.newTile.Origin = new Point16(1, 3); + 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); + + AddMapEntry(new Color(44, 150, 54)); + + DustType = (int)CalamityDusts.Plague; + AnimationFrameHeight = 74; + } + + public override void NearbyEffects(int i, int j, bool closer) + { + if (Main.tile[i, j].TileFrameY < 74) + { + return; + } + + Player player = Main.LocalPlayer; + if (player is null) + { + return; + } + + if (player.active) + { + Main.LocalPlayer.Calamity().monolithPlagueShader = 30; + } + + // Spawn mist particles at the bottom tiles + if (Main.tile[i,j +1].TileType != Type) + { + if (Main.rand.NextBool(30)) + { + GeneralParticleHandler.SpawnParticle(new PlagueHumidifierMist(new Vector2(i * 16, j * 16) + new Vector2(Main.rand.NextFloat(0, 16), Main.rand.NextFloat(16)), Main.rand.Next(40, 80), Main.rand.NextFloat(0.8f, 1.2f), Vector2.UnitX * Main.rand.NextFloat(-0.8f, 0.8f))); + } + } + } + + 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 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 = 74; + 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 = 18; + int animate = 0; + if (tile.TileFrameY >= 74) + { + 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.png b/Tiles/Furniture/Monoliths/PlagueHumidifierTile.png new file mode 100644 index 0000000000..a7e32a3f2d Binary files /dev/null and b/Tiles/Furniture/Monoliths/PlagueHumidifierTile.png differ diff --git a/Tiles/Furniture/Monoliths/PurpleDistortedMonolithTile.cs b/Tiles/Furniture/Monoliths/PurpleDistortedMonolithTile.cs new file mode 100644 index 0000000000..dcc4f4557d --- /dev/null +++ b/Tiles/Furniture/Monoliths/PurpleDistortedMonolithTile.cs @@ -0,0 +1,140 @@ +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 PurpleDistortedMonolithTile : ModTile + { + public override void SetStaticDefaults() + { + RegisterItemDrop(ModContent.ItemType()); + Main.tileFrameImportant[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3); + TileObjectData.newTile.Width = 5; + TileObjectData.newTile.Height = 5; + TileObjectData.newTile.Origin = new Point16(2, 4); + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16, 16, 16, 18 }; + TileObjectData.newTile.LavaDeath = false; + TileObjectData.newTile.UsesCustomCanPlace = true; + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop, 5, 0); + TileObjectData.addTile(Type); + + AddMapEntry(new Color(50, 127, 209)); + + DustType = (int)CalamityDusts.PurpleCosmilite; + AnimationFrameHeight = 92; + } + + public override void NearbyEffects(int i, int j, bool closer) + { + if (Main.tile[i, j].TileFrameY < 92) + { + return; + } + + Player player = Main.LocalPlayer; + if (player is null) + { + return; + } + + if (player.active) + { + Main.LocalPlayer.Calamity().monolithDevourerPShader = 30; + } + } + + public override void AnimateTile(ref int frame, ref int frameCounter) + { + frameCounter++; + if (frameCounter >= 7.2) + { + frameCounter = 0; + if (++frame >= 6) + { + frame = 1; + } + } + } + + 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 % 5; + int y = j - Main.tile[i, j].TileFrameY / 18 % 5; + int tileXX18 = 92; + for (int l = x; l < x + 5; 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 < 5; 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 = 18; + 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); + return false; + } + } +} diff --git a/Tiles/Furniture/Monoliths/PurpleDistortedMonolithTile.png b/Tiles/Furniture/Monoliths/PurpleDistortedMonolithTile.png new file mode 100644 index 0000000000..9c240370c4 Binary files /dev/null and b/Tiles/Furniture/Monoliths/PurpleDistortedMonolithTile.png differ