diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 130c695930..26762303ef 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -1175,6 +1175,10 @@ namespace CalamityMod.CalPlayer public Vector2 FireDrawerPosition; public int monolithAccursedShader = 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; #endregion Draw Effects #region Draedon Summoning diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index c38a5ded33..e969f0e30c 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -1520,6 +1520,8 @@ namespace CalamityMod.CalPlayer ChlorophyteHealDelay--; if (monolithAccursedShader > 0) monolithAccursedShader--; + if (BrimstoneLavaFountainCounter > 0) + BrimstoneLavaFountainCounter--; if (miningSetCooldown > 0) miningSetCooldown--; if (RustyMedallionCooldown > 0) diff --git a/Items/Placeables/Furniture/Fountains/AbyssFountainItem.cs b/Items/Placeables/Furniture/Fountains/AbyssFountainItem.cs index f82970c580..3521c048f1 100644 --- a/Items/Placeables/Furniture/Fountains/AbyssFountainItem.cs +++ b/Items/Placeables/Furniture/Fountains/AbyssFountainItem.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Fountains Item.useStyle = ItemUseStyleID.Swing; Item.consumable = true; Item.value = Item.buyPrice(0, 4, 0, 0); - Item.rare = ItemRarityID.White; + Item.rare = ItemRarityID.Blue; Item.createTile = ModContent.TileType(); } } diff --git a/Items/Placeables/Furniture/Fountains/AstralFountainItem.cs b/Items/Placeables/Furniture/Fountains/AstralFountainItem.cs index e983b7b2f4..1ea7b38bb6 100644 --- a/Items/Placeables/Furniture/Fountains/AstralFountainItem.cs +++ b/Items/Placeables/Furniture/Fountains/AstralFountainItem.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Fountains Item.useStyle = ItemUseStyleID.Swing; Item.consumable = true; Item.value = Item.buyPrice(0, 4, 0, 0); - Item.rare = ItemRarityID.White; + Item.rare = ItemRarityID.Blue; Item.createTile = ModContent.TileType(); } } diff --git a/Items/Placeables/Furniture/Fountains/BrimstoneLavaFountainItem.cs b/Items/Placeables/Furniture/Fountains/BrimstoneLavaFountainItem.cs new file mode 100644 index 0000000000..7f2295a155 --- /dev/null +++ b/Items/Placeables/Furniture/Fountains/BrimstoneLavaFountainItem.cs @@ -0,0 +1,27 @@ +using CalamityMod.Tiles.Furniture.Fountains; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Furniture.Fountains +{ + public class BrimstoneLavaFountainItem : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.width = 22; + Item.height = 42; + Item.maxStack = 9999; + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + Item.consumable = true; + Item.value = Item.buyPrice(0, 4, 0, 0); + Item.rare = ItemRarityID.Blue; + Item.createTile = ModContent.TileType(); + } + } +} diff --git a/Items/Placeables/Furniture/Fountains/BrimstoneLavaFountainItem.png b/Items/Placeables/Furniture/Fountains/BrimstoneLavaFountainItem.png new file mode 100644 index 0000000000..6e5bbcab48 Binary files /dev/null and b/Items/Placeables/Furniture/Fountains/BrimstoneLavaFountainItem.png differ diff --git a/Items/Placeables/Furniture/Fountains/SulphurousFountainItem.cs b/Items/Placeables/Furniture/Fountains/SulphurousFountainItem.cs index 6894fc2018..082c262a4c 100644 --- a/Items/Placeables/Furniture/Fountains/SulphurousFountainItem.cs +++ b/Items/Placeables/Furniture/Fountains/SulphurousFountainItem.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Fountains Item.useStyle = ItemUseStyleID.Swing; Item.consumable = true; Item.value = Item.buyPrice(0, 4, 0, 0); - Item.rare = ItemRarityID.White; + Item.rare = ItemRarityID.Blue; Item.createTile = ModContent.TileType(); } } diff --git a/Items/Placeables/Furniture/Fountains/SunkenSeaFountain.cs b/Items/Placeables/Furniture/Fountains/SunkenSeaFountain.cs index 459a6c98d6..b3c1b023f1 100644 --- a/Items/Placeables/Furniture/Fountains/SunkenSeaFountain.cs +++ b/Items/Placeables/Furniture/Fountains/SunkenSeaFountain.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Fountains Item.useStyle = ItemUseStyleID.Swing; Item.consumable = true; Item.value = Item.buyPrice(0, 4, 0, 0); - Item.rare = ItemRarityID.White; + Item.rare = ItemRarityID.Blue; Item.createTile = ModContent.TileType(); } } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson index c7df946292..330e1005fc 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson @@ -641,6 +641,11 @@ AstralFountainItem: { Tooltip: "" } +BrimstoneLavaFountainItem: { + DisplayName: Brimstone Lava Fountain + Tooltip: "" +} + SulphurousFountainItem: { DisplayName: Sulphuric Water Fountain Tooltip: "" diff --git a/Localization/en-US/Mods.CalamityMod.Tiles.hjson b/Localization/en-US/Mods.CalamityMod.Tiles.hjson index 5a7ad68da1..b0ecb2d5e2 100644 --- a/Localization/en-US/Mods.CalamityMod.Tiles.hjson +++ b/Localization/en-US/Mods.CalamityMod.Tiles.hjson @@ -8,6 +8,7 @@ Stalactite: Stalactite PirateCrate: Abandoned Crate // Basic Calamity Furniture Basin: Basin +LavaFountain: Lava Fountain PipeOrgan: Pipe Organ Sconce: Sconce // Draedon Lab Furniture diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index 4efd5a9980..db99850501 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -1194,8 +1194,9 @@ namespace CalamityMod.NPCs { shop.Add(ItemType()) .Add(ItemType()) - .Add(ItemType(), Condition.Hardmode) - .Add(ItemType(), Condition.Hardmode) + .Add(ItemType()) + .Add(ItemType()) + .Add(ItemType()) .AddWithCustomValue(ItemID.ButterflyDust, Item.buyPrice(gold: 10), Condition.DownedGolem) .AddWithCustomValue(ItemID.FriedEgg, Item.buyPrice(gold: 2, silver: 50), Condition.HappyEnough); } diff --git a/Tiles/Furniture/Fountains/BrimstoneLavaFountainTile.cs b/Tiles/Furniture/Fountains/BrimstoneLavaFountainTile.cs new file mode 100644 index 0000000000..6222f06535 --- /dev/null +++ b/Tiles/Furniture/Fountains/BrimstoneLavaFountainTile.cs @@ -0,0 +1,69 @@ +using CalamityMod.Items.Placeables.Furniture.Fountains; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.Furniture.Fountains +{ + public class BrimstoneLavaFountainTile : ModTile + { + public override void SetStaticDefaults() => this.SetUpFountain(ModContent.ItemType(), new Color(251, 136, 130), true); + + public override void NearbyEffects(int i, int j, bool closer) + { + Player player = Main.LocalPlayer; + if (player is null || Main.dedServ) + return; + + if (Main.tile[i, j].TileFrameX >= 36) + player.Calamity().BrimstoneLavaFountainCounter = 5; + } + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Stone, 0f, 0f, 1, new Color(119, 102, 255), 1f); + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Lava, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void AnimateTile(ref int frame, ref int frameCounter) + { + frameCounter++; + if (frameCounter >= 6) + { + frame = (frame + 1) % 6; + frameCounter = 0; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 2, 4); + } + + public override bool RightClick(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 2, 4); + SoundEngine.PlaySound(SoundID.Mech, new Vector2(i * 16, j * 16)); + return true; + } + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); + } + } +} diff --git a/Tiles/Furniture/Fountains/BrimstoneLavaFountainTile.png b/Tiles/Furniture/Fountains/BrimstoneLavaFountainTile.png new file mode 100644 index 0000000000..666b7cd742 Binary files /dev/null and b/Tiles/Furniture/Fountains/BrimstoneLavaFountainTile.png differ diff --git a/Tiles/Furniture/Fountains/BrimstoneLavaFountainTile_Highlight.png b/Tiles/Furniture/Fountains/BrimstoneLavaFountainTile_Highlight.png new file mode 100644 index 0000000000..32314cd9c7 Binary files /dev/null and b/Tiles/Furniture/Fountains/BrimstoneLavaFountainTile_Highlight.png differ diff --git a/Utilities/FurnitureSetupUtils.cs b/Utilities/FurnitureSetupUtils.cs index ffc769bd1c..78a2fe683f 100644 --- a/Utilities/FurnitureSetupUtils.cs +++ b/Utilities/FurnitureSetupUtils.cs @@ -1179,7 +1179,8 @@ namespace CalamityMod /// The ModTile which is being initialized. /// The ID of the item this tile drops when broken. /// The map color of the tile. - internal static void SetUpFountain(this ModTile mt, int itemDropID, Color mapColor) + /// Whether or not the type of fountain is lava. + internal static void SetUpFountain(this ModTile mt, int itemDropID, Color mapColor, bool lava = false) { mt.RegisterItemDrop(itemDropID); @@ -1203,7 +1204,7 @@ namespace CalamityMod TileObjectData.newTile.StyleLineSkip = 2; TileObjectData.addTile(mt.Type); - mt.AddMapEntry(mapColor, Language.GetText("MapObject.WaterFountain")); + mt.AddMapEntry(mapColor, lava ? CalamityUtils.GetText("Tiles.LavaFountain") : Language.GetText("MapObject.WaterFountain")); mt.AnimationFrameHeight = 72; } diff --git a/Waters/CragsLavaStyle.cs b/Waters/CragsLavaStyle.cs index 86c150e699..6ffe68bed0 100644 --- a/Waters/CragsLavaStyle.cs +++ b/Waters/CragsLavaStyle.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Waters public override string SlopeTexturePath => LavaTexturePath + "_Slope"; - public override bool ChooseLavaStyle() => Main.LocalPlayer.Calamity().ZoneCalamity; + public override bool ChooseLavaStyle() => Main.LocalPlayer.Calamity().ZoneCalamity || Main.LocalPlayer.Calamity().BrimstoneLavaFountainCounter > 0; public override int ChooseWaterfallStyle() => ModContent.Find("CalamityMod/CragsLavaflow").Slot;