rewrote placeable bar code. They now are called Metal Bar on the minimap
This commit is contained in:
1 parent
071a9a621a
commit
4a4e252399
10 files changed
+39
-274
No files matched your search
@@ -2,7 +2,6 @@ using CalamityMod.Items.Materials;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ObjectData;
|
||||
|
||||
namespace CalamityMod.Tiles
|
||||
{
|
||||
@@ -10,45 +9,15 @@ namespace CalamityMod.Tiles
|
||||
{
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Main.tileShine[Type] = 1000;
|
||||
Main.tileSolid[Type] = true;
|
||||
Main.tileSolidTop[Type] = true;
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
|
||||
TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1);
|
||||
TileObjectData.newTile.StyleHorizontal = true;
|
||||
TileObjectData.newTile.LavaDeath = false;
|
||||
TileObjectData.addTile(Type);
|
||||
|
||||
this.SetUpBar(new Color(141, 232, 246));
|
||||
dustType = 187;
|
||||
drop = ModContent.ItemType<AerialiteBar>();
|
||||
|
||||
AddMapEntry(new Color(141, 232, 246));
|
||||
}
|
||||
|
||||
public override bool CreateDust(int i, int j, ref int type)
|
||||
{
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
type = 187;
|
||||
}
|
||||
else
|
||||
{
|
||||
type = 16;
|
||||
}
|
||||
type = Main.rand.NextBool() ? 187 : 16;
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
|
||||
{
|
||||
WorldGen.Check1x1(i, j, Type);
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void PlaceInWorld(int i, int j, Item item)
|
||||
{
|
||||
Main.tile[i, j].frameX = 0;
|
||||
Main.tile[i, j].frameY = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-33
@@ -2,7 +2,6 @@ using CalamityMod.Dusts;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ObjectData;
|
||||
|
||||
namespace CalamityMod.Tiles
|
||||
{
|
||||
@@ -10,45 +9,15 @@ namespace CalamityMod.Tiles
|
||||
{
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Main.tileShine[Type] = 1000;
|
||||
Main.tileSolid[Type] = true;
|
||||
Main.tileSolidTop[Type] = true;
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
|
||||
TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1);
|
||||
TileObjectData.newTile.StyleHorizontal = true;
|
||||
TileObjectData.newTile.LavaDeath = false;
|
||||
TileObjectData.addTile(Type);
|
||||
|
||||
this.SetUpBar(new Color(47, 66, 90));
|
||||
dustType = ModContent.DustType<AstralBlue>();
|
||||
drop = ModContent.ItemType<Items.Placeables.AstralBar>();
|
||||
|
||||
AddMapEntry(new Color(47, 66, 90));
|
||||
}
|
||||
|
||||
public override bool CreateDust(int i, int j, ref int type)
|
||||
{
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
type = ModContent.DustType<AstralOrange>();
|
||||
}
|
||||
else
|
||||
{
|
||||
type = ModContent.DustType<AstralBlue>();
|
||||
}
|
||||
type = Main.rand.NextBool() ? ModContent.DustType<AstralOrange>() : ModContent.DustType<AstralBlue>();
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
|
||||
{
|
||||
WorldGen.Check1x1(i, j, Type);
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void PlaceInWorld(int i, int j, Item item)
|
||||
{
|
||||
Main.tile[i, j].frameX = 0;
|
||||
Main.tile[i, j].frameY = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-25
@@ -3,7 +3,6 @@ using CalamityMod.Items.Materials;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ObjectData;
|
||||
|
||||
namespace CalamityMod.Tiles
|
||||
{
|
||||
@@ -11,20 +10,9 @@ namespace CalamityMod.Tiles
|
||||
{
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Main.tileShine[Type] = 1000;
|
||||
Main.tileSolid[Type] = true;
|
||||
Main.tileSolidTop[Type] = true;
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
|
||||
TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1);
|
||||
TileObjectData.newTile.StyleHorizontal = true;
|
||||
TileObjectData.newTile.LavaDeath = false;
|
||||
TileObjectData.addTile(Type);
|
||||
|
||||
this.SetUpBar(new Color(255, 227, 81));
|
||||
dustType = ModContent.DustType<AuricBarDust>();
|
||||
drop = ModContent.ItemType<AuricBar>();
|
||||
|
||||
AddMapEntry(new Color(255, 227, 81));
|
||||
}
|
||||
|
||||
public override bool CreateDust(int i, int j, ref int type)
|
||||
@@ -32,17 +20,5 @@ namespace CalamityMod.Tiles
|
||||
type = ModContent.DustType<AuricBarDust>();
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
|
||||
{
|
||||
WorldGen.Check1x1(i, j, Type);
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void PlaceInWorld(int i, int j, Item item)
|
||||
{
|
||||
Main.tile[i, j].frameX = 0;
|
||||
Main.tile[i, j].frameY = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ObjectData;
|
||||
using CalamityMod.Items.Materials;
|
||||
|
||||
namespace CalamityMod.Tiles
|
||||
@@ -10,45 +9,15 @@ namespace CalamityMod.Tiles
|
||||
{
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Main.tileShine[Type] = 1000;
|
||||
Main.tileSolid[Type] = true;
|
||||
Main.tileSolidTop[Type] = true;
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
|
||||
TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1);
|
||||
TileObjectData.newTile.StyleHorizontal = true;
|
||||
TileObjectData.newTile.LavaDeath = false;
|
||||
TileObjectData.addTile(Type);
|
||||
|
||||
this.SetUpBar(new Color(255, 165, 0));
|
||||
dustType = 87;
|
||||
drop = ModContent.ItemType<CruptixBar>();
|
||||
|
||||
AddMapEntry(new Color(255, 165, 0)); //Orange
|
||||
}
|
||||
|
||||
public override bool CreateDust(int i, int j, ref int type)
|
||||
{
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
type = 87;
|
||||
}
|
||||
else
|
||||
{
|
||||
type = 6;
|
||||
}
|
||||
type = Main.rand.NextBool() ? 87 : 6;
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
|
||||
{
|
||||
WorldGen.Check1x1(i, j, Type);
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void PlaceInWorld(int i, int j, Item item)
|
||||
{
|
||||
Main.tile[i, j].frameX = 0;
|
||||
Main.tile[i, j].frameY = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,6 @@ using CalamityMod.Items.Materials;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ObjectData;
|
||||
|
||||
namespace CalamityMod.Tiles
|
||||
{
|
||||
@@ -11,20 +10,9 @@ namespace CalamityMod.Tiles
|
||||
{
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Main.tileShine[Type] = 1000;
|
||||
Main.tileSolid[Type] = true;
|
||||
Main.tileSolidTop[Type] = true;
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
|
||||
TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1);
|
||||
TileObjectData.newTile.StyleHorizontal = true;
|
||||
TileObjectData.newTile.LavaDeath = false;
|
||||
TileObjectData.addTile(Type);
|
||||
|
||||
this.SetUpBar(new Color(229, 141, 246));
|
||||
dustType = ModContent.DustType<CosmiliteBarDust>();
|
||||
drop = ModContent.ItemType<CosmiliteBar>();
|
||||
|
||||
AddMapEntry(new Color(229, 141, 246));
|
||||
}
|
||||
|
||||
public override bool CreateDust(int i, int j, ref int type)
|
||||
@@ -32,17 +20,5 @@ namespace CalamityMod.Tiles
|
||||
type = ModContent.DustType<CosmiliteBarDust>();
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
|
||||
{
|
||||
WorldGen.Check1x1(i, j, Type);
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void PlaceInWorld(int i, int j, Item item)
|
||||
{
|
||||
Main.tile[i, j].frameX = 0;
|
||||
Main.tile[i, j].frameY = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-33
@@ -2,7 +2,6 @@ using CalamityMod.Items.Materials;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ObjectData;
|
||||
|
||||
namespace CalamityMod.Tiles
|
||||
{
|
||||
@@ -10,45 +9,15 @@ namespace CalamityMod.Tiles
|
||||
{
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Main.tileShine[Type] = 1000;
|
||||
Main.tileSolid[Type] = true;
|
||||
Main.tileSolidTop[Type] = true;
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
|
||||
TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1);
|
||||
TileObjectData.newTile.StyleHorizontal = true;
|
||||
TileObjectData.newTile.LavaDeath = false;
|
||||
TileObjectData.addTile(Type);
|
||||
|
||||
this.SetUpBar(new Color(138, 43, 226));
|
||||
dustType = 44;
|
||||
drop = ModContent.ItemType<VerstaltiteBar>();
|
||||
|
||||
AddMapEntry(new Color(138, 43, 226)); //blue violet
|
||||
}
|
||||
|
||||
public override bool CreateDust(int i, int j, ref int type)
|
||||
{
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
type = 56;
|
||||
}
|
||||
else
|
||||
{
|
||||
type = 73;
|
||||
}
|
||||
type = Main.rand.NextBool() ? 56 : 73;
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
|
||||
{
|
||||
WorldGen.Check1x1(i, j, Type);
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void PlaceInWorld(int i, int j, Item item)
|
||||
{
|
||||
Main.tile[i, j].frameX = 0;
|
||||
Main.tile[i, j].frameY = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-33
@@ -1,7 +1,6 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ObjectData;
|
||||
using CalamityMod.Items.Materials;
|
||||
|
||||
namespace CalamityMod.Tiles
|
||||
@@ -10,45 +9,15 @@ namespace CalamityMod.Tiles
|
||||
{
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Main.tileShine[Type] = 1000;
|
||||
Main.tileSolid[Type] = true;
|
||||
Main.tileSolidTop[Type] = true;
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
|
||||
TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1);
|
||||
TileObjectData.newTile.StyleHorizontal = true;
|
||||
TileObjectData.newTile.LavaDeath = false;
|
||||
TileObjectData.addTile(Type);
|
||||
|
||||
this.SetUpBar(new Color(157, 255, 0));
|
||||
dustType = 44;
|
||||
drop = ModContent.ItemType<DraedonBar>();
|
||||
|
||||
AddMapEntry(new Color(157, 255, 0)); //chart reuse
|
||||
}
|
||||
|
||||
public override bool CreateDust(int i, int j, ref int type)
|
||||
{
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
type = 44;
|
||||
}
|
||||
else
|
||||
{
|
||||
type = 157;
|
||||
}
|
||||
type = Main.rand.NextBool() ? 44 : 157;
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
|
||||
{
|
||||
WorldGen.Check1x1(i, j, Type);
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void PlaceInWorld(int i, int j, Item item)
|
||||
{
|
||||
Main.tile[i, j].frameX = 0;
|
||||
Main.tile[i, j].frameY = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,6 @@ using CalamityMod.Items.Materials;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ObjectData;
|
||||
|
||||
namespace CalamityMod.Tiles
|
||||
{
|
||||
@@ -11,20 +10,9 @@ namespace CalamityMod.Tiles
|
||||
{
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Main.tileShine[Type] = 1000;
|
||||
Main.tileSolid[Type] = true;
|
||||
Main.tileSolidTop[Type] = true;
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
|
||||
TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1);
|
||||
TileObjectData.newTile.StyleHorizontal = true;
|
||||
TileObjectData.newTile.LavaDeath = false;
|
||||
TileObjectData.addTile(Type);
|
||||
|
||||
this.SetUpBar(new Color(128, 41, 149));
|
||||
dustType = ModContent.DustType<ShadowspecBarDust>();
|
||||
drop = ModContent.ItemType<ShadowspecBar>();
|
||||
|
||||
AddMapEntry(new Color(128, 41, 149));
|
||||
}
|
||||
|
||||
public override bool CreateDust(int i, int j, ref int type)
|
||||
@@ -32,17 +20,5 @@ namespace CalamityMod.Tiles
|
||||
type = ModContent.DustType<ShadowspecBarDust>();
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
|
||||
{
|
||||
WorldGen.Check1x1(i, j, Type);
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void PlaceInWorld(int i, int j, Item item)
|
||||
{
|
||||
Main.tile[i, j].frameX = 0;
|
||||
Main.tile[i, j].frameY = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-33
@@ -3,7 +3,6 @@ using CalamityMod.Items.Materials;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ObjectData;
|
||||
|
||||
namespace CalamityMod.Tiles
|
||||
{
|
||||
@@ -11,45 +10,15 @@ namespace CalamityMod.Tiles
|
||||
{
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Main.tileShine[Type] = 1000;
|
||||
Main.tileSolid[Type] = true;
|
||||
Main.tileSolidTop[Type] = true;
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
|
||||
TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1);
|
||||
TileObjectData.newTile.StyleHorizontal = true;
|
||||
TileObjectData.newTile.LavaDeath = false;
|
||||
TileObjectData.addTile(Type);
|
||||
|
||||
this.SetUpBar(new Color(134, 209, 102));
|
||||
dustType = ModContent.DustType<BloomTileLeaves>();
|
||||
drop = ModContent.ItemType<UeliaceBar>();
|
||||
|
||||
AddMapEntry(new Color(134, 209, 102));
|
||||
}
|
||||
|
||||
public override bool CreateDust(int i, int j, ref int type)
|
||||
{
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
type = ModContent.DustType<BloomTileLeaves>();
|
||||
}
|
||||
else
|
||||
{
|
||||
type = ModContent.DustType<BloomTileGold>();
|
||||
}
|
||||
type = Main.rand.NextBool() ? ModContent.DustType<BloomTileLeaves>() : ModContent.DustType<BloomTileGold>();
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
|
||||
{
|
||||
WorldGen.Check1x1(i, j, Type);
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void PlaceInWorld(int i, int j, Item item)
|
||||
{
|
||||
Main.tile[i, j].frameX = 0;
|
||||
Main.tile[i, j].frameY = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
@@ -1129,5 +1130,27 @@ namespace CalamityMod
|
||||
TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop, 2, 0);
|
||||
TileObjectData.addTile(mt.Type);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Extension which initializes a ModTile to be a bed.
|
||||
/// </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.addTile(mt.Type);
|
||||
|
||||
// Vanilla bars are labeled as "Metal Bar" on the minimap
|
||||
mt.AddMapEntry(mapColor, Language.GetText("MapObject.MetalBar"));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user