From 58e0970ccfa027b725118e90d5c6939a72b4d4a4 Mon Sep 17 00:00:00 2001 From: Abdulmujeeb Raji Date: Tue, 12 Nov 2024 11:48:36 +0000 Subject: [PATCH] feat: coal tile --- Content/Items/Materials/Coal.cs | 18 ++++++++++ Content/Items/Materials/ExquisiteGel.cs | 2 +- Content/Items/Materials/PalishadeTissue.cs | 2 +- Content/Items/Weapons/Geltana.cs | 3 +- Content/PlanteraOverrides.cs | 1 + Content/PlanteraRecipes.cs | 1 + Content/Tiles/CoalTile.cs | 33 ++++++++++++++++++ .../{coal-tilesheet.png => CoalTile.png} | Bin Localization/en-US_Mods.continuity.hjson | 7 ++++ 9 files changed, 64 insertions(+), 3 deletions(-) create mode 100644 Content/Items/Materials/Coal.cs create mode 100644 Content/Tiles/CoalTile.cs rename Content/Tiles/{coal-tilesheet.png => CoalTile.png} (100%) diff --git a/Content/Items/Materials/Coal.cs b/Content/Items/Materials/Coal.cs new file mode 100644 index 0000000..24765be --- /dev/null +++ b/Content/Items/Materials/Coal.cs @@ -0,0 +1,18 @@ +using continuity.Content.Tiles; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Terraria.ModLoader; + +namespace continuity.Content.Items.Materials +{ + public class Coal : ModItem + { + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + } + } +} diff --git a/Content/Items/Materials/ExquisiteGel.cs b/Content/Items/Materials/ExquisiteGel.cs index fb981d4..1fc2208 100644 --- a/Content/Items/Materials/ExquisiteGel.cs +++ b/Content/Items/Materials/ExquisiteGel.cs @@ -2,7 +2,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace Continuity.Content.Items +namespace Continuity.Content.Items.Materials { public class ExquisiteGel : ModItem { diff --git a/Content/Items/Materials/PalishadeTissue.cs b/Content/Items/Materials/PalishadeTissue.cs index 073f9b6..f7dce67 100644 --- a/Content/Items/Materials/PalishadeTissue.cs +++ b/Content/Items/Materials/PalishadeTissue.cs @@ -2,7 +2,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace Continuity.Content.Items +namespace Continuity.Content.Items.Materials { public class PalishadeTissue : ModItem { diff --git a/Content/Items/Weapons/Geltana.cs b/Content/Items/Weapons/Geltana.cs index 3deb804..1341a41 100644 --- a/Content/Items/Weapons/Geltana.cs +++ b/Content/Items/Weapons/Geltana.cs @@ -1,4 +1,5 @@ using Continuity.Content.Items; +using Continuity.Content.Items.Materials; using Microsoft.Xna.Framework; using System; using System.Collections.Generic; @@ -9,7 +10,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace continuity.Content.Items +namespace continuity.Content.Items.Weapons { public class Geltana : ModItem { diff --git a/Content/PlanteraOverrides.cs b/Content/PlanteraOverrides.cs index c30202e..d1b04a6 100644 --- a/Content/PlanteraOverrides.cs +++ b/Content/PlanteraOverrides.cs @@ -5,6 +5,7 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.GameContent.ItemDropRules; using Continuity.Content.Items; +using Continuity.Content.Items.Materials; namespace Continuity.Content { diff --git a/Content/PlanteraRecipes.cs b/Content/PlanteraRecipes.cs index cf81f0a..a2690bf 100644 --- a/Content/PlanteraRecipes.cs +++ b/Content/PlanteraRecipes.cs @@ -2,6 +2,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using Continuity.Content.Items; +using Continuity.Content.Items.Materials; namespace Continuity.Content { diff --git a/Content/Tiles/CoalTile.cs b/Content/Tiles/CoalTile.cs new file mode 100644 index 0000000..b8c6d9d --- /dev/null +++ b/Content/Tiles/CoalTile.cs @@ -0,0 +1,33 @@ +using Microsoft.Xna.Framework; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Terraria; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace continuity.Content.Tiles +{ + public class CoalTile : ModTile + { + public override void SetStaticDefaults() + { + + TileID.Sets.Ore[Type] = true; + Main.tileSpelunker[Type] = true; // The tile will be affected by spelunker highlighting + Main.tileMergeDirt[Type] = true; + Main.tileSolid[Type] = true; + Main.tileBlockLight[Type] = true; + Main.tileLavaDeath[Type] = true; + + LocalizedText name = CreateMapEntryName(); + AddMapEntry(new Color(55, 51, 52), name); + + DustType = 84; + HitSound = SoundID.Tink; + } + } +} diff --git a/Content/Tiles/coal-tilesheet.png b/Content/Tiles/CoalTile.png similarity index 100% rename from Content/Tiles/coal-tilesheet.png rename to Content/Tiles/CoalTile.png diff --git a/Localization/en-US_Mods.continuity.hjson b/Localization/en-US_Mods.continuity.hjson index 3f12218..53e334d 100644 --- a/Localization/en-US_Mods.continuity.hjson +++ b/Localization/en-US_Mods.continuity.hjson @@ -21,4 +21,11 @@ Items: { ''' DisplayName: Geltana } + + Coal: { + DisplayName: Coal + Tooltip: "" + } } + +Tiles.CoalTile.MapEntry: Coal Tile