Sulphur Shale
This commit is contained in:
1 parent
6054d20fde
commit
451364ab47
11 files changed
+309
No files matched your search
@@ -0,0 +1,35 @@
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Items.Placeables
|
||||
{
|
||||
public class SulphurousShale : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
SacrificeTotal = 100;
|
||||
DisplayName.SetDefault("Sulphurous Shale");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.createTile = ModContent.TileType<Tiles.Abyss.SulphurousShale>();
|
||||
Item.useStyle = ItemUseStyleID.Swing;
|
||||
Item.useTurn = true;
|
||||
Item.useAnimation = 15;
|
||||
Item.useTime = 10;
|
||||
Item.autoReuse = true;
|
||||
Item.consumable = true;
|
||||
Item.width = 16;
|
||||
Item.height = 16;
|
||||
Item.maxStack = 999;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<Walls.SulphurousShaleWall>(4).
|
||||
AddTile(TileID.WorkBenches).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 206 B |
@@ -0,0 +1,34 @@
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using WallTiles = CalamityMod.Walls;
|
||||
namespace CalamityMod.Items.Placeables.Walls
|
||||
{
|
||||
public class SulphurousShaleWall : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
SacrificeTotal = 400;
|
||||
DisplayName.SetDefault("Sulphurous Shale Wall");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.createWall = ModContent.WallType<WallTiles.SulphurousShaleWallSafe>();
|
||||
Item.useStyle = ItemUseStyleID.Swing;
|
||||
Item.useTurn = true;
|
||||
Item.useAnimation = 15;
|
||||
Item.useTime = 10;
|
||||
Item.autoReuse = true;
|
||||
Item.consumable = true;
|
||||
Item.width = 16;
|
||||
Item.height = 16;
|
||||
Item.maxStack = 999;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(4).AddTile(
|
||||
TileID.WorkBenches).AddIngredient(ModContent.ItemType<SulphurousShale>()).Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 273 B |
@@ -0,0 +1,201 @@
|
||||
//using CalamityMod.Tiles.Abyss.AbyssAmbient;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Tiles.Abyss
|
||||
{
|
||||
public class SulphurousShale : ModTile
|
||||
{
|
||||
int animationFrameWidth = 288;
|
||||
|
||||
public static readonly SoundStyle MineSound = new("CalamityMod/Sounds/Custom/AbyssGravelMine", 3);
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.tileSolid[Type] = true;
|
||||
Main.tileBlockLight[Type] = true;
|
||||
Main.tileMergeDirt[Type] = true;
|
||||
|
||||
CalamityUtils.MergeWithGeneral(Type);
|
||||
CalamityUtils.MergeWithAbyss(Type);
|
||||
|
||||
ItemDrop = ModContent.ItemType<Items.Placeables.SulphurousShale>();
|
||||
AddMapEntry(new Color(77, 60, 93));
|
||||
MineResist = 5f;
|
||||
MinPick = 65;
|
||||
HitSound = MineSound;
|
||||
DustType = 33;
|
||||
}
|
||||
|
||||
public override bool CanExplode(int i, int j)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void NumDust(int i, int j, bool fail, ref int num)
|
||||
{
|
||||
num = fail ? 1 : 3;
|
||||
}
|
||||
|
||||
public override void RandomUpdate(int i, int j)
|
||||
{
|
||||
int num8 = WorldGen.genRand.Next((int)Main.rockLayer, (int)(Main.rockLayer + (double)Main.maxTilesY * 0.143));
|
||||
int nearbyVineCount = 0;
|
||||
for (int x = i - 15; x <= i + 15; x++)
|
||||
{
|
||||
for (int y = j - 15; y <= j + 15; y++)
|
||||
{
|
||||
if (WorldGen.InWorld(x, y))
|
||||
{
|
||||
if (CalamityUtils.ParanoidTileRetrieval(x, y).HasTile &&
|
||||
CalamityUtils.ParanoidTileRetrieval(x, y).TileType == (ushort)ModContent.TileType<SulphurousVines>())
|
||||
{
|
||||
nearbyVineCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Main.tile[i, j + 1] != null && nearbyVineCount < 5 && j >= SulphurousSea.VineGrowTopLimit)
|
||||
{
|
||||
if (!Main.tile[i, j + 1].HasTile && Main.tile[i, j + 1].TileType != (ushort)ModContent.TileType<SulphurousVines>())
|
||||
{
|
||||
if (Main.tile[i, j + 1].LiquidAmount == 255 &&
|
||||
Main.tile[i, j + 1].LiquidType != LiquidID.Lava)
|
||||
{
|
||||
bool flag13 = false;
|
||||
for (int num52 = num8; num52 > num8 - 10; num52--)
|
||||
{
|
||||
if (Main.tile[i, num52].BottomSlope)
|
||||
{
|
||||
flag13 = false;
|
||||
break;
|
||||
}
|
||||
if (Main.tile[i, num52].HasTile && !Main.tile[i, num52].BottomSlope)
|
||||
{
|
||||
flag13 = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (flag13)
|
||||
{
|
||||
int num53 = i;
|
||||
int num54 = j + 1;
|
||||
Main.tile[num53, num54].TileType = (ushort)ModContent.TileType<SulphurousVines>();
|
||||
Main.tile[num53, num54].Get<TileWallWireStateData>().HasTile = true;
|
||||
WorldGen.SquareTileFrame(num53, num54, true);
|
||||
if (Main.netMode == NetmodeID.Server)
|
||||
{
|
||||
NetMessage.SendTileSquare(-1, num53, num54, 3, TileChangeType.None);
|
||||
}
|
||||
}
|
||||
Main.tile[i, j].Get<TileWallWireStateData>().Slope = SlopeType.Solid;
|
||||
Main.tile[i, j].Get<TileWallWireStateData>().IsHalfBlock = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void AnimateIndividualTile(int type, int i, int j, ref int frameXOffset, ref int frameYOffset)
|
||||
{
|
||||
int uniqueAnimationFrameX = 0;
|
||||
int xPos = i % 4;
|
||||
int yPos = j % 4;
|
||||
switch (xPos)
|
||||
{
|
||||
case 0:
|
||||
switch (yPos)
|
||||
{
|
||||
case 0:
|
||||
uniqueAnimationFrameX = 0;
|
||||
break;
|
||||
case 1:
|
||||
uniqueAnimationFrameX = 2;
|
||||
break;
|
||||
case 2:
|
||||
uniqueAnimationFrameX = 1;
|
||||
break;
|
||||
case 3:
|
||||
uniqueAnimationFrameX = 2;
|
||||
break;
|
||||
default:
|
||||
uniqueAnimationFrameX = 2;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
switch (yPos)
|
||||
{
|
||||
case 0:
|
||||
uniqueAnimationFrameX = 2;
|
||||
break;
|
||||
case 1:
|
||||
uniqueAnimationFrameX = 0;
|
||||
break;
|
||||
case 2:
|
||||
uniqueAnimationFrameX = 2;
|
||||
break;
|
||||
case 3:
|
||||
uniqueAnimationFrameX = 2;
|
||||
break;
|
||||
default:
|
||||
uniqueAnimationFrameX = 2;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
switch (yPos)
|
||||
{
|
||||
case 0:
|
||||
uniqueAnimationFrameX = 2;
|
||||
break;
|
||||
case 1:
|
||||
uniqueAnimationFrameX = 0;
|
||||
break;
|
||||
case 2:
|
||||
uniqueAnimationFrameX = 1;
|
||||
break;
|
||||
case 3:
|
||||
uniqueAnimationFrameX = 2;
|
||||
break;
|
||||
default:
|
||||
uniqueAnimationFrameX = 2;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
switch (yPos)
|
||||
{
|
||||
case 0:
|
||||
uniqueAnimationFrameX = 1;
|
||||
break;
|
||||
case 1:
|
||||
uniqueAnimationFrameX = 2;
|
||||
break;
|
||||
case 2:
|
||||
uniqueAnimationFrameX = 0;
|
||||
break;
|
||||
case 3:
|
||||
uniqueAnimationFrameX = 2;
|
||||
break;
|
||||
default:
|
||||
uniqueAnimationFrameX = 2;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
frameXOffset = uniqueAnimationFrameX * animationFrameWidth;
|
||||
}
|
||||
|
||||
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
|
||||
{
|
||||
TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType<AbyssGravel>(), false, false, false, false, resetFrame);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
@@ -335,6 +335,7 @@ namespace CalamityMod
|
||||
TileType<AstralSnow>(),
|
||||
TileType<Navystone>(),
|
||||
TileType<EutrophicSand>(),
|
||||
TileType<SulphurousShale>(),
|
||||
TileType<AbyssGravel>(),
|
||||
TileType<Voidstone>(),
|
||||
});
|
||||
@@ -448,6 +449,7 @@ namespace CalamityMod
|
||||
// Sulphurous Sea
|
||||
TileType<SulphurousSand>(),
|
||||
TileType<SulphurousSandstone>(),
|
||||
TileType<SulphurousShale>(),
|
||||
// Abyss
|
||||
TileType<AbyssGravel>(),
|
||||
TileType<Voidstone>(),
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Walls
|
||||
{
|
||||
public class SulphurousShaleWall : ModWall
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DustType = 32;
|
||||
AddMapEntry(new Color(59, 40, 63));
|
||||
}
|
||||
|
||||
public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3;
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 7.6 KiB |
@@ -0,0 +1,19 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Walls
|
||||
{
|
||||
public class SulphurousShaleWallSafe : ModWall
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.wallHouse[Type] = true;
|
||||
DustType = 32;
|
||||
ItemDrop = ModContent.ItemType<Items.Placeables.Walls.SulphurousShaleWall>();
|
||||
AddMapEntry(new Color(59, 40, 63));
|
||||
}
|
||||
|
||||
public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3;
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 7.6 KiB |
Reference in new issue
Block a user