stuff to fix later I'm not done yet
This commit is contained in:
1 parent
30890ff5c9
commit
28421ff1c1
6 files changed
+110
-8
No files matched your search
@@ -41,10 +41,10 @@ namespace CalamityMod.Items.Placeables.FurnitureSacrilegious
|
||||
AddIngredient(ModContent.ItemType<OccultPlatformItem>(), 2).
|
||||
Register();
|
||||
|
||||
/*CreateRecipe(1).
|
||||
CreateRecipe(1).
|
||||
AddIngredient(ModContent.ItemType<OccultBrickWallItem>(), 4).
|
||||
AddTile(TileID.WorkBenches).
|
||||
Register();*/
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using CalamityMod.Items.Placeables.FurnitureSacrilegious;
|
||||
using CalamityMod.Walls;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Placeables.Walls
|
||||
{
|
||||
public class OccultBrickWallItem : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Occult Brick Wall");
|
||||
SacrificeTotal = 400;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 18;
|
||||
Item.height = 18;
|
||||
Item.maxStack = 999;
|
||||
Item.useTurn = true;
|
||||
Item.autoReuse = true;
|
||||
Item.useAnimation = 15;
|
||||
Item.useTime = 7;
|
||||
Item.useStyle = ItemUseStyleID.Swing;
|
||||
Item.consumable = true;
|
||||
Item.createWall = ModContent.WallType<OccultBrickWall>();
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(4).
|
||||
AddIngredient(ModContent.ItemType<OccultBrickItem>()).
|
||||
AddTile(TileID.WorkBenches).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 55 KiB |
@@ -55,8 +55,9 @@ namespace CalamityMod.Tiles.FurnitureSacrilegious
|
||||
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
|
||||
{
|
||||
int brightness = 0;
|
||||
int seed = 1;
|
||||
int itemAmt = 0;
|
||||
int index = FindChestIndex(i, j)
|
||||
int index = FindChestIndex(i, j, ref seed);
|
||||
if (index >= 0)
|
||||
itemAmt = CountItems(Main.chest[index]);
|
||||
if (itemAmt > 0)
|
||||
@@ -64,26 +65,62 @@ namespace CalamityMod.Tiles.FurnitureSacrilegious
|
||||
|
||||
Tile tile = Main.tile[i, j];
|
||||
Texture2D texture = ModContent.Request<Texture2D>("CalamityMod/Tiles/FurnitureSacrilegious/SacrilegiousChestTileGlow").Value;
|
||||
|
||||
int x = i;
|
||||
int y = j;
|
||||
switch (seed)
|
||||
{
|
||||
case 2:
|
||||
y = j - 1;
|
||||
break;
|
||||
case 3:
|
||||
x = i - 1;
|
||||
break;
|
||||
case 4:
|
||||
x = i - 1;
|
||||
y = j - 1;
|
||||
break;
|
||||
}
|
||||
ulong seeding = Main.TileFrameSeed ^ (ulong)((long)y << 32 | (long)(uint)x);
|
||||
|
||||
int yOffset = TileObjectData.GetTileData(tile).DrawYOffset;
|
||||
Vector2 drawOffset = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange);
|
||||
Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y + yOffset) + drawOffset;
|
||||
int alpha = brightness * 14;
|
||||
Color color = new Color(alpha, 100, 100, 0);
|
||||
for (int c = 0; c < brightness; c++)
|
||||
|
||||
int alpha = 255 - brightness * 36;
|
||||
Color color = new Color(100, 80, 80, alpha);
|
||||
|
||||
int loopAmt = (brightness + 1) / 2;
|
||||
if (loopAmt > 3)
|
||||
loopAmt = 3;
|
||||
|
||||
for (int c = 0; c < loopAmt; c++)
|
||||
{
|
||||
spriteBatch.Draw(texture, drawPosition, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), color, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
|
||||
float shakeX = Utils.RandomInt(ref seeding, -10, 1) * 0.15f;
|
||||
float shakeY = Utils.RandomInt(ref seeding, -10, 1) * 0.15f;
|
||||
Vector2 shake = new Vector2(shakeX, shakeY);
|
||||
spriteBatch.Draw(texture, drawPosition + shake, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), color, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
private int FindChestIndex(int i, int j)
|
||||
private int FindChestIndex(int i, int j, ref int seed)
|
||||
{
|
||||
int index = Chest.FindChest(i, j);
|
||||
if (index < 0 && Main.tile[i, j - 1].TileType == ModContent.TileType<SacrilegiousChestTile>())
|
||||
{
|
||||
index = Chest.FindChest(i, j - 1);
|
||||
seed = 2;
|
||||
}
|
||||
if (index < 0 && Main.tile[i - 1, j].TileType == ModContent.TileType<SacrilegiousChestTile>())
|
||||
{
|
||||
index = Chest.FindChest(i - 1, j);
|
||||
seed = 3;
|
||||
}
|
||||
if (index < 0 && Main.tile[i - 1, j - 1].TileType == ModContent.TileType<SacrilegiousChestTile>())
|
||||
{
|
||||
index = Chest.FindChest(i - 1, j - 1);
|
||||
seed = 4;
|
||||
}
|
||||
return index;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Items.Placeables.Walls;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
|
||||
namespace CalamityMod.Walls
|
||||
{
|
||||
public class OccultBrickWall : ModWall
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.wallHouse[Type] = true;
|
||||
ItemDrop = ModContent.ItemType<OccultBrickWallItem>();
|
||||
HitSound = SoundID.Dig;
|
||||
AddMapEntry(new Color(111, 95, 110));
|
||||
}
|
||||
|
||||
public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3;
|
||||
|
||||
public override bool CreateDust(int i, int j, ref int type)
|
||||
{
|
||||
Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 7, 0f, 0f, 1, new Color(255, 255, 255), 1f);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 8.3 KiB |
Reference in new issue
Block a user