Bars explicitly specify their drops
This commit is contained in:
1 parent
d645d40a36
commit
79459826e2
11 files changed
+45
-42
No files matched your search
@@ -8,6 +8,7 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Placeables
|
||||
{
|
||||
// TODO -- WHY IS THIS IN PLACEABLES. IT IS A CRAFTING MATERIAL FIRST AND FOREMOST.
|
||||
public class AstralBar : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Placeables";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Materials;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
@@ -9,7 +9,7 @@ namespace CalamityMod.Tiles
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpBar(new Color(141, 232, 246));
|
||||
this.SetUpBar(ModContent.ItemType<AerialiteBar>(), new Color(141, 232, 246));
|
||||
DustType = 187;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Dusts;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
@@ -9,7 +9,7 @@ namespace CalamityMod.Tiles
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpBar(new Color(47, 66, 90));
|
||||
this.SetUpBar(ModContent.ItemType<Items.Placeables.AstralBar>(), new Color(47, 66, 90));
|
||||
DustType = ModContent.DustType<AstralBlue>();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Items.Materials;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria.ModLoader;
|
||||
@@ -9,7 +9,7 @@ namespace CalamityMod.Tiles
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpBar(new Color(255, 227, 81));
|
||||
this.SetUpBar(ModContent.ItemType<AuricBar>(), new Color(255, 227, 81));
|
||||
DustType = ModContent.DustType<AuricBarDust>();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Items.Materials;
|
||||
|
||||
namespace CalamityMod.Tiles
|
||||
{
|
||||
// TODO -- this name is inconsistent with all other placed bars, and needs to be updated for Scoria
|
||||
public class ChaoticBarPlaced : ModTile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpBar(new Color(255, 165, 0));
|
||||
this.SetUpBar(ModContent.ItemType<ScoriaBar>(), new Color(255, 165, 0));
|
||||
DustType = 87;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Items.Materials;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria.ModLoader;
|
||||
@@ -9,7 +9,7 @@ namespace CalamityMod.Tiles
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpBar(new Color(229, 141, 246));
|
||||
this.SetUpBar(ModContent.ItemType<CosmiliteBar>(), new Color(229, 141, 246));
|
||||
DustType = ModContent.DustType<CosmiliteBarDust>();
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace CalamityMod.Tiles
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpBar(new Color(138, 43, 226));
|
||||
this.SetUpBar(ModContent.ItemType<CryonicBar>(), new Color(138, 43, 226));
|
||||
DustType = 44;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Items.Materials;
|
||||
|
||||
namespace CalamityMod.Tiles
|
||||
{
|
||||
@@ -9,7 +8,7 @@ namespace CalamityMod.Tiles
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpBar(new Color(157, 255, 0));
|
||||
this.SetUpBar(ModContent.ItemType<Items.Materials.PerennialBar>(), new Color(157, 255, 0));
|
||||
DustType = 44;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Items.Materials;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria.ModLoader;
|
||||
@@ -9,7 +9,7 @@ namespace CalamityMod.Tiles
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpBar(new Color(128, 41, 149));
|
||||
this.SetUpBar(ModContent.ItemType<ShadowspecBar>(), new Color(128, 41, 149));
|
||||
DustType = ModContent.DustType<ShadowspecBarDust>();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using CalamityMod.Dusts.Furniture;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Dusts.Furniture;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
@@ -10,7 +9,7 @@ namespace CalamityMod.Tiles
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpBar(new Color(134, 209, 102));
|
||||
this.SetUpBar(ModContent.ItemType<Items.Materials.UelibloomBar>(), new Color(134, 209, 102));
|
||||
DustType = ModContent.DustType<BloomTileLeaves>();
|
||||
}
|
||||
|
||||
|
||||
@@ -679,6 +679,32 @@ namespace CalamityMod
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Extension which initializes a ModTile to be a bar.
|
||||
/// </summary>
|
||||
/// <param name="mt">The ModTile which is being initialized.</param>
|
||||
/// <param name="itemDropID">The ID of the item this tile drops when broken.</param>
|
||||
/// <param name="mapColor">The color of the bar on the minimap.</param>
|
||||
/// <param name="lavaImmune">Whether this tile is supposed to be immune to lava. Defaults to true like vanilla bars.</param>
|
||||
internal static void SetUpBar(this ModTile mt, int itemDropID, Color mapColor, bool lavaImmune = true)
|
||||
{
|
||||
mt.RegisterItemDrop(itemDropID);
|
||||
|
||||
Main.tileShine[mt.Type] = 1100;
|
||||
Main.tileSolid[mt.Type] = true;
|
||||
Main.tileSolidTop[mt.Type] = true;
|
||||
Main.tileFrameImportant[mt.Type] = true;
|
||||
|
||||
TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1);
|
||||
TileObjectData.newTile.StyleHorizontal = true;
|
||||
TileObjectData.newTile.LavaDeath = !lavaImmune;
|
||||
TileObjectData.newTile.LavaPlacement = lavaImmune ? LiquidPlacement.Allowed : LiquidPlacement.NotAllowed;
|
||||
TileObjectData.addTile(mt.Type);
|
||||
|
||||
// Vanilla bars are labeled as "Metal Bar" on the minimap
|
||||
mt.AddMapEntry(mapColor, Language.GetText("MapObject.MetalBar"));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Extension which initializes a ModTile to be a bathtub.
|
||||
/// </summary>
|
||||
@@ -1503,29 +1529,6 @@ namespace CalamityMod
|
||||
mt.AdjTiles = new int[] { TileID.WorkBenches };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Extension which initializes a ModTile to be a bar.
|
||||
/// </summary>
|
||||
/// <param name="mt">The ModTile which is being initialized.</param>
|
||||
/// <param name="mapColor">The color of the bar on the minimap.</param>
|
||||
/// <param name="lavaImmune">Whether this tile is supposed to be immune to lava. Defaults to true like vanilla bars.</param>
|
||||
internal static void SetUpBar(this ModTile mt, Color mapColor, bool lavaImmune = true)
|
||||
{
|
||||
Main.tileShine[mt.Type] = 1100;
|
||||
Main.tileSolid[mt.Type] = true;
|
||||
Main.tileSolidTop[mt.Type] = true;
|
||||
Main.tileFrameImportant[mt.Type] = true;
|
||||
|
||||
TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1);
|
||||
TileObjectData.newTile.StyleHorizontal = true;
|
||||
TileObjectData.newTile.LavaDeath = !lavaImmune;
|
||||
TileObjectData.newTile.LavaPlacement = lavaImmune ? LiquidPlacement.Allowed : LiquidPlacement.NotAllowed;
|
||||
TileObjectData.addTile(mt.Type);
|
||||
|
||||
// Vanilla bars are labeled as "Metal Bar" on the minimap
|
||||
mt.AddMapEntry(mapColor, Language.GetText("MapObject.MetalBar"));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Extension which initializes a ModTile to be a trophy.
|
||||
/// </summary>
|
||||
|
||||
Reference in new issue
Block a user