diff --git a/Items/Placeables/AstralMonolith.cs b/Items/Placeables/AstralMonolith.cs index b14a67e7db..5dd8e14d3c 100644 --- a/Items/Placeables/AstralMonolith.cs +++ b/Items/Placeables/AstralMonolith.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Placeables.Walls; +using CalamityMod.Items.Placeables.FurnitureAstral; using Terraria.ID; using Terraria.ModLoader; // If you are using c# 6, you can use: "using static Terraria.Localization.GameCulture;" which would mean you could just write "DisplayName.AddTranslation(German, "");" @@ -31,6 +32,10 @@ namespace CalamityMod.Items.Placeables recipe.SetResult(this, 1); recipe.AddTile(TileID.WorkBenches); recipe.AddRecipe(); + recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 2); + recipe.SetResult(this, 1); + recipe.AddRecipe(); } } } diff --git a/Items/Placeables/AstralMonolith.png b/Items/Placeables/AstralMonolith.png index a255617632..c7cbbe64da 100644 Binary files a/Items/Placeables/AstralMonolith.png and b/Items/Placeables/AstralMonolith.png differ diff --git a/Items/Placeables/Furniture/CraftingStations/MonolithCrafting.cs b/Items/Placeables/Furniture/CraftingStations/MonolithCrafting.cs new file mode 100644 index 0000000000..67bcd25083 --- /dev/null +++ b/Items/Placeables/Furniture/CraftingStations/MonolithCrafting.cs @@ -0,0 +1,36 @@ +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.Furniture.CraftingStations +{ + public class MonolithCrafting : ModItem + { + public override void SetStaticDefaults() + { + Tooltip.SetDefault("Used for special crafting"); + } + + public override void SetDefaults() + { + item.SetNameOverride("Monolith Amalgam"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 20); + recipe.SetResult(this, 1); + recipe.AddTile(TileID.WorkBenches); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/Furniture/CraftingStations/MonolithCrafting.png b/Items/Placeables/Furniture/CraftingStations/MonolithCrafting.png new file mode 100644 index 0000000000..25cd884c28 Binary files /dev/null and b/Items/Placeables/Furniture/CraftingStations/MonolithCrafting.png differ diff --git a/Items/Placeables/FurnitureAstral/MonolithBathtub.cs b/Items/Placeables/FurnitureAstral/MonolithBathtub.cs new file mode 100644 index 0000000000..e916e7378a --- /dev/null +++ b/Items/Placeables/FurnitureAstral/MonolithBathtub.cs @@ -0,0 +1,35 @@ +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureAstral +{ + public class MonolithBathtub : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Monolith Bathtub"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 14); + recipe.SetResult(this, 1); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAstral/MonolithBathtub.png b/Items/Placeables/FurnitureAstral/MonolithBathtub.png new file mode 100644 index 0000000000..e8dac5d933 Binary files /dev/null and b/Items/Placeables/FurnitureAstral/MonolithBathtub.png differ diff --git a/Items/Placeables/FurnitureAstral/MonolithBed.cs b/Items/Placeables/FurnitureAstral/MonolithBed.cs new file mode 100644 index 0000000000..e69224b23c --- /dev/null +++ b/Items/Placeables/FurnitureAstral/MonolithBed.cs @@ -0,0 +1,37 @@ +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureAstral +{ + public class MonolithBed : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Monolith Bed"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 15); + recipe.AddIngredient(ItemID.Silk, 5); + recipe.SetResult(this, 1); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAstral/MonolithBed.png b/Items/Placeables/FurnitureAstral/MonolithBed.png new file mode 100644 index 0000000000..92b738f8c2 Binary files /dev/null and b/Items/Placeables/FurnitureAstral/MonolithBed.png differ diff --git a/Items/Placeables/FurnitureAstral/MonolithBench.cs b/Items/Placeables/FurnitureAstral/MonolithBench.cs new file mode 100644 index 0000000000..0f00d8d229 --- /dev/null +++ b/Items/Placeables/FurnitureAstral/MonolithBench.cs @@ -0,0 +1,37 @@ +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureAstral +{ + public class MonolithBench : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Monolith Bench"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ItemID.Silk, 2); + recipe.SetResult(this, 1); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAstral/MonolithBench.png b/Items/Placeables/FurnitureAstral/MonolithBench.png new file mode 100644 index 0000000000..5564fe54a6 Binary files /dev/null and b/Items/Placeables/FurnitureAstral/MonolithBench.png differ diff --git a/Items/Placeables/FurnitureAstral/MonolithBookcase.cs b/Items/Placeables/FurnitureAstral/MonolithBookcase.cs new file mode 100644 index 0000000000..495b50f999 --- /dev/null +++ b/Items/Placeables/FurnitureAstral/MonolithBookcase.cs @@ -0,0 +1,37 @@ +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureAstral +{ + public class MonolithBookcase : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Monolith Bookcase"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 20); + recipe.AddIngredient(ItemID.Book, 10); + recipe.SetResult(this, 1); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAstral/MonolithBookcase.png b/Items/Placeables/FurnitureAstral/MonolithBookcase.png new file mode 100644 index 0000000000..fc073b5702 Binary files /dev/null and b/Items/Placeables/FurnitureAstral/MonolithBookcase.png differ diff --git a/Items/Placeables/FurnitureAstral/MonolithCandelabra.cs b/Items/Placeables/FurnitureAstral/MonolithCandelabra.cs new file mode 100644 index 0000000000..12cd6e5f91 --- /dev/null +++ b/Items/Placeables/FurnitureAstral/MonolithCandelabra.cs @@ -0,0 +1,37 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureAstral +{ + public class MonolithCandelabra : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Monolith Candelabra"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 15); + recipe.AddIngredient(ModContent.ItemType(), 3); + recipe.SetResult(this, 1); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAstral/MonolithCandelabra.png b/Items/Placeables/FurnitureAstral/MonolithCandelabra.png new file mode 100644 index 0000000000..e2d022d4d9 Binary files /dev/null and b/Items/Placeables/FurnitureAstral/MonolithCandelabra.png differ diff --git a/Items/Placeables/FurnitureAstral/MonolithCandle.cs b/Items/Placeables/FurnitureAstral/MonolithCandle.cs new file mode 100644 index 0000000000..81754d7a3c --- /dev/null +++ b/Items/Placeables/FurnitureAstral/MonolithCandle.cs @@ -0,0 +1,37 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureAstral +{ + public class MonolithCandle : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Monolith Candle"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 12); + recipe.AddIngredient(ModContent.ItemType(), 1); + recipe.SetResult(this, 1); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAstral/MonolithCandle.png b/Items/Placeables/FurnitureAstral/MonolithCandle.png new file mode 100644 index 0000000000..266e03da71 Binary files /dev/null and b/Items/Placeables/FurnitureAstral/MonolithCandle.png differ diff --git a/Items/Placeables/FurnitureAstral/MonolithChair.cs b/Items/Placeables/FurnitureAstral/MonolithChair.cs new file mode 100644 index 0000000000..4ac35d7c1a --- /dev/null +++ b/Items/Placeables/FurnitureAstral/MonolithChair.cs @@ -0,0 +1,35 @@ +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureAstral +{ + public class MonolithChair : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Monolith Chair"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 4); + recipe.SetResult(this, 1); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAstral/MonolithChair.png b/Items/Placeables/FurnitureAstral/MonolithChair.png new file mode 100644 index 0000000000..5c5a2e5ed5 Binary files /dev/null and b/Items/Placeables/FurnitureAstral/MonolithChair.png differ diff --git a/Items/Placeables/FurnitureAstral/MonolithChandelier.cs b/Items/Placeables/FurnitureAstral/MonolithChandelier.cs new file mode 100644 index 0000000000..d547d50deb --- /dev/null +++ b/Items/Placeables/FurnitureAstral/MonolithChandelier.cs @@ -0,0 +1,37 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureAstral +{ + public class MonolithChandelier : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Monolith Chandelier"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 12); + recipe.AddIngredient(ModContent.ItemType(), 4); + recipe.SetResult(this, 1); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAstral/MonolithChandelier.png b/Items/Placeables/FurnitureAstral/MonolithChandelier.png new file mode 100644 index 0000000000..329e5c87cf Binary files /dev/null and b/Items/Placeables/FurnitureAstral/MonolithChandelier.png differ diff --git a/Items/Placeables/FurnitureAstral/MonolithChest.cs b/Items/Placeables/FurnitureAstral/MonolithChest.cs new file mode 100644 index 0000000000..dce7c35bbf --- /dev/null +++ b/Items/Placeables/FurnitureAstral/MonolithChest.cs @@ -0,0 +1,38 @@ +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ModLoader; +using Terraria.ID; +namespace CalamityMod.Items.Placeables.FurnitureAstral +{ + public class MonolithChest : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Monolith Chest"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 8); + recipe.AddIngredient(ItemID.IronBar, 2); + recipe.anyIronBar = true; + recipe.SetResult(this, 1); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAstral/MonolithChest.png b/Items/Placeables/FurnitureAstral/MonolithChest.png new file mode 100644 index 0000000000..1e52409c99 Binary files /dev/null and b/Items/Placeables/FurnitureAstral/MonolithChest.png differ diff --git a/Items/Placeables/FurnitureAstral/MonolithClock.cs b/Items/Placeables/FurnitureAstral/MonolithClock.cs new file mode 100644 index 0000000000..f6008200ce --- /dev/null +++ b/Items/Placeables/FurnitureAstral/MonolithClock.cs @@ -0,0 +1,39 @@ +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureAstral +{ + public class MonolithClock : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Monolith Clock"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ItemID.IronBar, 3); + recipe.anyIronBar = true; + recipe.AddIngredient(ItemID.Glass, 6); + recipe.SetResult(this, 1); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAstral/MonolithClock.png b/Items/Placeables/FurnitureAstral/MonolithClock.png new file mode 100644 index 0000000000..7cef3dc4ca Binary files /dev/null and b/Items/Placeables/FurnitureAstral/MonolithClock.png differ diff --git a/Items/Placeables/FurnitureAstral/MonolithDoor.cs b/Items/Placeables/FurnitureAstral/MonolithDoor.cs new file mode 100644 index 0000000000..e2b82a59b0 --- /dev/null +++ b/Items/Placeables/FurnitureAstral/MonolithDoor.cs @@ -0,0 +1,35 @@ +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureAstral +{ + public class MonolithDoor : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Monolith Door"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 6); + recipe.SetResult(this, 1); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAstral/MonolithDoor.png b/Items/Placeables/FurnitureAstral/MonolithDoor.png new file mode 100644 index 0000000000..e98c372b2d Binary files /dev/null and b/Items/Placeables/FurnitureAstral/MonolithDoor.png differ diff --git a/Items/Placeables/FurnitureAstral/MonolithDresser.cs b/Items/Placeables/FurnitureAstral/MonolithDresser.cs new file mode 100644 index 0000000000..3659f98789 --- /dev/null +++ b/Items/Placeables/FurnitureAstral/MonolithDresser.cs @@ -0,0 +1,35 @@ +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureAstral +{ + public class MonolithDresser : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Monolith Dresser"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 16); + recipe.SetResult(this, 1); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAstral/MonolithDresser.png b/Items/Placeables/FurnitureAstral/MonolithDresser.png new file mode 100644 index 0000000000..1a222259d1 Binary files /dev/null and b/Items/Placeables/FurnitureAstral/MonolithDresser.png differ diff --git a/Items/Placeables/FurnitureAstral/MonolithLamp.cs b/Items/Placeables/FurnitureAstral/MonolithLamp.cs new file mode 100644 index 0000000000..95cf03c958 --- /dev/null +++ b/Items/Placeables/FurnitureAstral/MonolithLamp.cs @@ -0,0 +1,37 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureAstral +{ + public class MonolithLamp : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Monolith Lamp"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 9); + recipe.AddIngredient(ModContent.ItemType(), 1); + recipe.SetResult(this, 1); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAstral/MonolithLamp.png b/Items/Placeables/FurnitureAstral/MonolithLamp.png new file mode 100644 index 0000000000..0ab33ad210 Binary files /dev/null and b/Items/Placeables/FurnitureAstral/MonolithLamp.png differ diff --git a/Items/Placeables/FurnitureAstral/MonolithLantern.cs b/Items/Placeables/FurnitureAstral/MonolithLantern.cs new file mode 100644 index 0000000000..70f1a8ddf1 --- /dev/null +++ b/Items/Placeables/FurnitureAstral/MonolithLantern.cs @@ -0,0 +1,37 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureAstral +{ + public class MonolithLantern : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Monolith Lantern"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 18); + recipe.AddIngredient(ModContent.ItemType(), 1); + recipe.SetResult(this, 1); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAstral/MonolithLantern.png b/Items/Placeables/FurnitureAstral/MonolithLantern.png new file mode 100644 index 0000000000..df85248de9 Binary files /dev/null and b/Items/Placeables/FurnitureAstral/MonolithLantern.png differ diff --git a/Items/Placeables/FurnitureAstral/MonolithPiano.cs b/Items/Placeables/FurnitureAstral/MonolithPiano.cs new file mode 100644 index 0000000000..b26724d4eb --- /dev/null +++ b/Items/Placeables/FurnitureAstral/MonolithPiano.cs @@ -0,0 +1,38 @@ +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureAstral +{ + public class MonolithPiano : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Monolith Piano"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 15); + recipe.AddIngredient(ItemID.Bone, 4); + recipe.AddIngredient(ItemID.Book); + recipe.SetResult(this, 1); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAstral/MonolithPiano.png b/Items/Placeables/FurnitureAstral/MonolithPiano.png new file mode 100644 index 0000000000..efafb67dae Binary files /dev/null and b/Items/Placeables/FurnitureAstral/MonolithPiano.png differ diff --git a/Items/Placeables/FurnitureAstral/MonolithPlatform.cs b/Items/Placeables/FurnitureAstral/MonolithPlatform.cs new file mode 100644 index 0000000000..9d6a007785 --- /dev/null +++ b/Items/Placeables/FurnitureAstral/MonolithPlatform.cs @@ -0,0 +1,34 @@ + +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureAstral +{ + public class MonolithPlatform : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Monolith Platform"); + item.width = 8; + item.height = 10; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); + recipe.SetResult(this, 2); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAstral/MonolithPlatform.png b/Items/Placeables/FurnitureAstral/MonolithPlatform.png new file mode 100644 index 0000000000..4847fe5c92 Binary files /dev/null and b/Items/Placeables/FurnitureAstral/MonolithPlatform.png differ diff --git a/Items/Placeables/FurnitureAstral/MonolithSink.cs b/Items/Placeables/FurnitureAstral/MonolithSink.cs new file mode 100644 index 0000000000..8b733ac0e3 --- /dev/null +++ b/Items/Placeables/FurnitureAstral/MonolithSink.cs @@ -0,0 +1,38 @@ +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureAstral +{ + public class MonolithSink : ModItem + { + public override void SetStaticDefaults() + { + Tooltip.SetDefault("Counts as a water source"); + } + + public override void SetDefaults() + { + item.SetNameOverride("Monolith Sink"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 6); + recipe.AddIngredient(ItemID.WaterBucket); + recipe.SetResult(this, 1); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAstral/MonolithSink.png b/Items/Placeables/FurnitureAstral/MonolithSink.png new file mode 100644 index 0000000000..14955fbd04 Binary files /dev/null and b/Items/Placeables/FurnitureAstral/MonolithSink.png differ diff --git a/Items/Placeables/FurnitureAstral/MonolithTable.cs b/Items/Placeables/FurnitureAstral/MonolithTable.cs new file mode 100644 index 0000000000..1c9897a822 --- /dev/null +++ b/Items/Placeables/FurnitureAstral/MonolithTable.cs @@ -0,0 +1,35 @@ +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureAstral +{ + public class MonolithTable : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Monolith Table"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 8); + recipe.SetResult(this, 1); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAstral/MonolithTable.png b/Items/Placeables/FurnitureAstral/MonolithTable.png new file mode 100644 index 0000000000..a5ef7b8b4b Binary files /dev/null and b/Items/Placeables/FurnitureAstral/MonolithTable.png differ diff --git a/Items/Placeables/FurnitureAstral/MonolithWorkBench.cs b/Items/Placeables/FurnitureAstral/MonolithWorkBench.cs new file mode 100644 index 0000000000..568f7b6570 --- /dev/null +++ b/Items/Placeables/FurnitureAstral/MonolithWorkBench.cs @@ -0,0 +1,35 @@ +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureAstral +{ + public class MonolithWorkBench : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Monolith Work Bench"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.SetResult(this, 1); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAstral/MonolithWorkBench.png b/Items/Placeables/FurnitureAstral/MonolithWorkBench.png new file mode 100644 index 0000000000..de40af2cb4 Binary files /dev/null and b/Items/Placeables/FurnitureAstral/MonolithWorkBench.png differ diff --git a/Items/Placeables/Walls/AstralMonolithWall.png b/Items/Placeables/Walls/AstralMonolithWall.png index 93e310a8b4..6670f56b3c 100644 Binary files a/Items/Placeables/Walls/AstralMonolithWall.png and b/Items/Placeables/Walls/AstralMonolithWall.png differ diff --git a/Tiles/Astral/AstralMonolith.cs b/Tiles/Astral/AstralMonolith.cs index d545c6d9ef..718b189222 100644 --- a/Tiles/Astral/AstralMonolith.cs +++ b/Tiles/Astral/AstralMonolith.cs @@ -10,6 +10,9 @@ namespace CalamityMod.Tiles.Astral { public class AstralMonolith : ModTile { + private static int sheetWidth = 216; + private static int sheetHeight = 72; + public override void SetDefaults() { Main.tileSolid[Type] = true; @@ -24,9 +27,7 @@ namespace CalamityMod.Tiles.Astral drop = ModContent.ItemType(); AddMapEntry(new Color(45, 36, 63)); - animationFrameHeight = 270; } - int animationFrameWidth = 288; public override bool CreateDust(int i, int j, ref int type) { @@ -38,43 +39,94 @@ namespace CalamityMod.Tiles.Astral { int xPos = i % 4; int yPos = j % 4; - frameXOffset = xPos * animationFrameWidth; - frameYOffset = yPos * animationFrameHeight; + + if ((xPos == 0 && yPos == 2) || (xPos == 1 && yPos == 3) || (xPos == 3 && yPos == 1)) + Main.tile[i, j].frameNumber(Main.tile[i, j - 1].frameNumber()); + else if (xPos == 2 && yPos == 2) + Main.tile[i, j].frameNumber(Main.tile[i - 1, j].frameNumber()); + else if (xPos == 2 && yPos == 3) + Main.tile[i, j].frameNumber(Main.tile[i - 1, j - 1].frameNumber()); + + GetDrawSpecifics(i, j, ref xPos, ref yPos); + + frameXOffset = xPos * sheetWidth; + frameYOffset = yPos * sheetHeight; } public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { - int xPos = Main.tile[i, j].frameX; - int yPos = Main.tile[i, j].frameY; + Tile tile = Main.tile[i, j]; + int xOffset = i % 4; int yOffset = j % 4; - xOffset *= 288; - yOffset *= 270; + + GetDrawSpecifics(i, j, ref xOffset, ref yOffset); + + xOffset *= sheetWidth; + yOffset *= sheetHeight; + + int xPos = tile.frameX; + int yPos = tile.frameY; xPos += xOffset; yPos += yOffset; Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/Astral/AstralMonolithGlow"); Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; Color drawColour = GetDrawColour(i, j, new Color(50, 50, 50, 50)); - Tile trackTile = Main.tile[i, j]; - Texture2D texture3 = glowmask; - double num6 = Main.time * 0.08; - if (!trackTile.halfBrick() && trackTile.slope() == 0) + if (!tile.halfBrick() && tile.slope() == 0) { - Main.spriteBatch.Draw(texture3, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); } - else if (trackTile.halfBrick()) + else if (tile.halfBrick()) { - Main.spriteBatch.Draw(texture3, drawOffset + new Vector2(0f, 8f), new Rectangle?(new Rectangle(xPos, yPos, 18, 8)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(glowmask, drawOffset + new Vector2(0f, 8f), new Rectangle?(new Rectangle(xPos, yPos, 18, 8)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); } } public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); + TileFraming.CompactFraming(i, j, resetFrame); return false; } + private void GetDrawSpecifics(int i, int j, ref int xPos, ref int yPos) + { + Tile tile = Main.tile[i, j]; + // Make sure the features work as intended + if (tile.frameNumber() == 1) + { + if (xPos == 0 && (yPos == 1 || yPos == 2)) + yPos += 3; + else if ((xPos == 1 || xPos == 2) && (yPos == 2 || yPos == 3)) + yPos += 2; + else if (xPos == 3 && (yPos == 0 || yPos == 1)) + yPos += 4; + } + else if (tile.frameNumber() == 2) + { + if (xPos == 1 && yPos == 0) + { + xPos = 0; + yPos = 6; + } + else if (xPos == 2 && yPos == 1) + { + xPos = 1; + yPos = 6; + } + else if (xPos == 1 && yPos == 3) + { + xPos = 2; + yPos = 6; + } + else if (xPos == 3 && yPos == 3) + { + xPos = 3; + yPos = 6; + } + } + } + private Color GetDrawColour(int i, int j, Color colour) { int colType = Main.tile[i, j].color(); diff --git a/Tiles/Astral/AstralMonolith.png b/Tiles/Astral/AstralMonolith.png index 744b285b19..91eca58eb7 100644 Binary files a/Tiles/Astral/AstralMonolith.png and b/Tiles/Astral/AstralMonolith.png differ diff --git a/Tiles/Astral/AstralMonolithGlow.png b/Tiles/Astral/AstralMonolithGlow.png index 198e82058a..e63d6a068e 100644 Binary files a/Tiles/Astral/AstralMonolithGlow.png and b/Tiles/Astral/AstralMonolithGlow.png differ diff --git a/Tiles/Furniture/CraftingStations/MonolithCrafting.cs b/Tiles/Furniture/CraftingStations/MonolithCrafting.cs new file mode 100644 index 0000000000..561dd67105 --- /dev/null +++ b/Tiles/Furniture/CraftingStations/MonolithCrafting.cs @@ -0,0 +1,62 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.Furniture.CraftingStations +{ + class MonolithCrafting : ModTile + { + public override void SetDefaults() + { + this.SetUpBookcase(solidTop: false); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Monolith Amalgam"); + AddMapEntry(new Color(191, 142, 111), name); + animationFrameHeight = 54; + adjTiles = new int[] { TileID.Bookcases }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, ModContent.DustType(), 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + int xPos = Main.tile[i, j].frameX; + int yPos = Main.tile[i, j].frameY; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/Furniture/CraftingStations/MonolithCraftingGlow"); + Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; + Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + + private Color GetDrawColour(int i, int j, Color colour) + { + int colType = Main.tile[i, j].color(); + Color paintCol = WorldGen.paintColor(colType); + if (colType >= 13 && colType <= 24) + { + colour.R = (byte)(paintCol.R / 255f * colour.R); + colour.G = (byte)(paintCol.G / 255f * colour.G); + colour.B = (byte)(paintCol.B / 255f * colour.B); + } + return colour; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + } +} diff --git a/Tiles/Furniture/CraftingStations/MonolithCrafting.png b/Tiles/Furniture/CraftingStations/MonolithCrafting.png new file mode 100644 index 0000000000..3f906ca19f Binary files /dev/null and b/Tiles/Furniture/CraftingStations/MonolithCrafting.png differ diff --git a/Tiles/Furniture/CraftingStations/MonolithCraftingGlow.png b/Tiles/Furniture/CraftingStations/MonolithCraftingGlow.png new file mode 100644 index 0000000000..db424e65fa Binary files /dev/null and b/Tiles/Furniture/CraftingStations/MonolithCraftingGlow.png differ diff --git a/Tiles/FurnitureAstral/MonolithBathtub.cs b/Tiles/FurnitureAstral/MonolithBathtub.cs new file mode 100644 index 0000000000..a4a9b46754 --- /dev/null +++ b/Tiles/FurnitureAstral/MonolithBathtub.cs @@ -0,0 +1,59 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; +namespace CalamityMod.Tiles.FurnitureAstral +{ + class MonolithBathtub : ModTile + { + public override void SetDefaults() + { + this.SetUpBathtub(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Monolith Bathtub"); + AddMapEntry(new Color(191, 142, 111), name); + animationFrameHeight = 54; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, ModContent.DustType(), 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + int xPos = Main.tile[i, j].frameX; + int yPos = Main.tile[i, j].frameY; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/FurnitureAstral/MonolithBathtubGlow"); + Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; + Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + + private Color GetDrawColour(int i, int j, Color colour) + { + int colType = Main.tile[i, j].color(); + Color paintCol = WorldGen.paintColor(colType); + if (colType >= 13 && colType <= 24) + { + colour.R = (byte)(paintCol.R / 255f * colour.R); + colour.G = (byte)(paintCol.G / 255f * colour.G); + colour.B = (byte)(paintCol.B / 255f * colour.B); + } + return colour; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + } +} diff --git a/Tiles/FurnitureAstral/MonolithBathtub.png b/Tiles/FurnitureAstral/MonolithBathtub.png new file mode 100644 index 0000000000..89bfe5469d Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithBathtub.png differ diff --git a/Tiles/FurnitureAstral/MonolithBathtubGlow.png b/Tiles/FurnitureAstral/MonolithBathtubGlow.png new file mode 100644 index 0000000000..81bc71acb9 Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithBathtubGlow.png differ diff --git a/Tiles/FurnitureAstral/MonolithBed.cs b/Tiles/FurnitureAstral/MonolithBed.cs new file mode 100644 index 0000000000..be49ef4965 --- /dev/null +++ b/Tiles/FurnitureAstral/MonolithBed.cs @@ -0,0 +1,81 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureAstral +{ + public class MonolithBed : ModTile + { + public override void SetDefaults() + { + this.SetUpBed(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Monolith Bed"); + AddMapEntry(new Color(191, 142, 111), name); + disableSmartCursor = true; + adjTiles = new int[] { TileID.Beds }; + bed = true; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, ModContent.DustType(), 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + int xPos = Main.tile[i, j].frameX; + int yPos = Main.tile[i, j].frameY; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/FurnitureAstral/MonolithBedGlow"); + Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; + Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + + private Color GetDrawColour(int i, int j, Color colour) + { + int colType = Main.tile[i, j].color(); + Color paintCol = WorldGen.paintColor(colType); + if (colType >= 13 && colType <= 24) + { + colour.R = (byte)(paintCol.R / 255f * colour.R); + colour.G = (byte)(paintCol.G / 255f * colour.G); + colour.B = (byte)(paintCol.B / 255f * colour.B); + } + return colour; + } + + public override bool HasSmartInteract() + { + return true; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 64, 32, ModContent.ItemType()); + } + + public override bool NewRightClick(int i, int j) + { + return CalamityUtils.BedRightClick(i, j); + } + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.showItemIcon = true; + player.showItemIcon2 = ModContent.ItemType(); + } + } +} diff --git a/Tiles/FurnitureAstral/MonolithBed.png b/Tiles/FurnitureAstral/MonolithBed.png new file mode 100644 index 0000000000..c78fdb7e00 Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithBed.png differ diff --git a/Tiles/FurnitureAstral/MonolithBedGlow.png b/Tiles/FurnitureAstral/MonolithBedGlow.png new file mode 100644 index 0000000000..798c78e786 Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithBedGlow.png differ diff --git a/Tiles/FurnitureAstral/MonolithBed_Highlight.png b/Tiles/FurnitureAstral/MonolithBed_Highlight.png new file mode 100644 index 0000000000..b27d7d23c7 Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithBed_Highlight.png differ diff --git a/Tiles/FurnitureAstral/MonolithBench.cs b/Tiles/FurnitureAstral/MonolithBench.cs new file mode 100644 index 0000000000..586fd2ea6a --- /dev/null +++ b/Tiles/FurnitureAstral/MonolithBench.cs @@ -0,0 +1,58 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; +namespace CalamityMod.Tiles.FurnitureAstral +{ + class MonolithBench : ModTile + { + public override void SetDefaults() + { + this.SetUpSofa(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Monolith Bench"); + AddMapEntry(new Color(191, 142, 111), name); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, ModContent.DustType(), 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + int xPos = Main.tile[i, j].frameX; + int yPos = Main.tile[i, j].frameY; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/FurnitureAstral/MonolithBenchGlow"); + Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; + Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + + private Color GetDrawColour(int i, int j, Color colour) + { + int colType = Main.tile[i, j].color(); + Color paintCol = WorldGen.paintColor(colType); + if (colType >= 13 && colType <= 24) + { + colour.R = (byte)(paintCol.R / 255f * colour.R); + colour.G = (byte)(paintCol.G / 255f * colour.G); + colour.B = (byte)(paintCol.B / 255f * colour.B); + } + return colour; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + } +} diff --git a/Tiles/FurnitureAstral/MonolithBench.png b/Tiles/FurnitureAstral/MonolithBench.png new file mode 100644 index 0000000000..8957798d6d Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithBench.png differ diff --git a/Tiles/FurnitureAstral/MonolithBenchGlow.png b/Tiles/FurnitureAstral/MonolithBenchGlow.png new file mode 100644 index 0000000000..d29c98dccf Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithBenchGlow.png differ diff --git a/Tiles/FurnitureAstral/MonolithBookcase.cs b/Tiles/FurnitureAstral/MonolithBookcase.cs new file mode 100644 index 0000000000..55327887eb --- /dev/null +++ b/Tiles/FurnitureAstral/MonolithBookcase.cs @@ -0,0 +1,62 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureAstral +{ + class MonolithBookcase : ModTile + { + public override void SetDefaults() + { + this.SetUpBookcase(solidTop: false); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Monolith Bookcase"); + AddMapEntry(new Color(191, 142, 111), name); + animationFrameHeight = 54; + adjTiles = new int[] { TileID.Bookcases }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, ModContent.DustType(), 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + int xPos = Main.tile[i, j].frameX; + int yPos = Main.tile[i, j].frameY; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/FurnitureAstral/MonolithBookcaseGlow"); + Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; + Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + + private Color GetDrawColour(int i, int j, Color colour) + { + int colType = Main.tile[i, j].color(); + Color paintCol = WorldGen.paintColor(colType); + if (colType >= 13 && colType <= 24) + { + colour.R = (byte)(paintCol.R / 255f * colour.R); + colour.G = (byte)(paintCol.G / 255f * colour.G); + colour.B = (byte)(paintCol.B / 255f * colour.B); + } + return colour; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + } +} diff --git a/Tiles/FurnitureAstral/MonolithBookcase.png b/Tiles/FurnitureAstral/MonolithBookcase.png new file mode 100644 index 0000000000..0ec69d1b93 Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithBookcase.png differ diff --git a/Tiles/FurnitureAstral/MonolithBookcaseGlow.png b/Tiles/FurnitureAstral/MonolithBookcaseGlow.png new file mode 100644 index 0000000000..2fee60fd35 Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithBookcaseGlow.png differ diff --git a/Tiles/FurnitureAstral/MonolithCandelabra.cs b/Tiles/FurnitureAstral/MonolithCandelabra.cs new file mode 100644 index 0000000000..e28d629eed --- /dev/null +++ b/Tiles/FurnitureAstral/MonolithCandelabra.cs @@ -0,0 +1,86 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureAstral +{ + class MonolithCandelabra : ModTile + { + public override void SetDefaults() + { + this.SetUpCandelabra(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Monolith Candelabra"); + AddMapEntry(new Color(191, 142, 111), name); + disableSmartCursor = true; + adjTiles = new int[] { TileID.Torches }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, ModContent.DustType(), 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + int xPos = Main.tile[i, j].frameX; + int yPos = Main.tile[i, j].frameY; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/FurnitureAstral/MonolithCandelabraGlow"); + Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; + Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + + Texture2D glowmaskBright = ModContent.GetTexture("CalamityMod/Tiles/FurnitureAstral/MonolithCandelabraFlame"); + Main.spriteBatch.Draw(glowmaskBright, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), Color.White, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + + private Color GetDrawColour(int i, int j, Color colour) + { + int colType = Main.tile[i, j].color(); + Color paintCol = WorldGen.paintColor(colType); + if (colType >= 13 && colType <= 24) + { + colour.R = (byte)(paintCol.R / 255f * colour.R); + colour.G = (byte)(paintCol.G / 255f * colour.G); + colour.B = (byte)(paintCol.B / 255f * colour.B); + } + return colour; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].frameX < 18) + { + r = 0.8f; + g = 0.9f; + b = 1f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 16, ModContent.ItemType()); + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 2, 2); + } + } +} diff --git a/Tiles/FurnitureAstral/MonolithCandelabra.png b/Tiles/FurnitureAstral/MonolithCandelabra.png new file mode 100644 index 0000000000..a4f612305f Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithCandelabra.png differ diff --git a/Tiles/FurnitureAstral/MonolithCandelabraFlame.png b/Tiles/FurnitureAstral/MonolithCandelabraFlame.png new file mode 100644 index 0000000000..d8c8285e59 Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithCandelabraFlame.png differ diff --git a/Tiles/FurnitureAstral/MonolithCandelabraGlow.png b/Tiles/FurnitureAstral/MonolithCandelabraGlow.png new file mode 100644 index 0000000000..0a0fc42e3d Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithCandelabraGlow.png differ diff --git a/Tiles/FurnitureAstral/MonolithCandle.cs b/Tiles/FurnitureAstral/MonolithCandle.cs new file mode 100644 index 0000000000..a433c62e33 --- /dev/null +++ b/Tiles/FurnitureAstral/MonolithCandle.cs @@ -0,0 +1,82 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureAstral +{ + class MonolithCandle : ModTile + { + public override void SetDefaults() + { + this.SetUpCandle(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Monolith Candle"); + AddMapEntry(new Color(191, 142, 111), name); + disableSmartCursor = true; + adjTiles = new int[] { TileID.Torches }; + drop = ModContent.ItemType(); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, ModContent.DustType(), 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + int xPos = Main.tile[i, j].frameX; + int yPos = Main.tile[i, j].frameY; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/FurnitureAstral/MonolithCandleGlow"); + Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; + Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + + Texture2D glowmaskBright = ModContent.GetTexture("CalamityMod/Tiles/FurnitureAstral/MonolithCandleFlame"); + Main.spriteBatch.Draw(glowmaskBright, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), Color.White, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + + private Color GetDrawColour(int i, int j, Color colour) + { + int colType = Main.tile[i, j].color(); + Color paintCol = WorldGen.paintColor(colType); + if (colType >= 13 && colType <= 24) + { + colour.R = (byte)(paintCol.R / 255f * colour.R); + colour.G = (byte)(paintCol.G / 255f * colour.G); + colour.B = (byte)(paintCol.B / 255f * colour.B); + } + return colour; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].frameX < 18) + { + r = 0.8f; + g = 0.9f; + b = 1f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 1, 1); + } + } +} diff --git a/Tiles/FurnitureAstral/MonolithCandle.png b/Tiles/FurnitureAstral/MonolithCandle.png new file mode 100644 index 0000000000..52d8efc30c Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithCandle.png differ diff --git a/Tiles/FurnitureAstral/MonolithCandleFlame.png b/Tiles/FurnitureAstral/MonolithCandleFlame.png new file mode 100644 index 0000000000..a750a73942 Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithCandleFlame.png differ diff --git a/Tiles/FurnitureAstral/MonolithCandleGlow.png b/Tiles/FurnitureAstral/MonolithCandleGlow.png new file mode 100644 index 0000000000..b4c85f5287 Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithCandleGlow.png differ diff --git a/Tiles/FurnitureAstral/MonolithChair.cs b/Tiles/FurnitureAstral/MonolithChair.cs new file mode 100644 index 0000000000..cb6efe832e --- /dev/null +++ b/Tiles/FurnitureAstral/MonolithChair.cs @@ -0,0 +1,62 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureAstral +{ + public class MonolithChair : ModTile + { + public override void SetDefaults() + { + this.SetUpChair(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Monolith Chair"); + AddMapEntry(new Color(191, 142, 111), name); + disableSmartCursor = true; + adjTiles = new int[] { TileID.Chairs }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, ModContent.DustType(), 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + int xPos = Main.tile[i, j].frameX; + int yPos = Main.tile[i, j].frameY; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/FurnitureAstral/MonolithChairGlow"); + Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; + Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + + private Color GetDrawColour(int i, int j, Color colour) + { + int colType = Main.tile[i, j].color(); + Color paintCol = WorldGen.paintColor(colType); + if (colType >= 13 && colType <= 24) + { + colour.R = (byte)(paintCol.R / 255f * colour.R); + colour.G = (byte)(paintCol.G / 255f * colour.G); + colour.B = (byte)(paintCol.B / 255f * colour.B); + } + return colour; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + } +} diff --git a/Tiles/FurnitureAstral/MonolithChair.png b/Tiles/FurnitureAstral/MonolithChair.png new file mode 100644 index 0000000000..a8066e11b3 Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithChair.png differ diff --git a/Tiles/FurnitureAstral/MonolithChairGlow.png b/Tiles/FurnitureAstral/MonolithChairGlow.png new file mode 100644 index 0000000000..a92063693f Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithChairGlow.png differ diff --git a/Tiles/FurnitureAstral/MonolithChandelier.cs b/Tiles/FurnitureAstral/MonolithChandelier.cs new file mode 100644 index 0000000000..8c6b2832f1 --- /dev/null +++ b/Tiles/FurnitureAstral/MonolithChandelier.cs @@ -0,0 +1,85 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureAstral +{ + public class MonolithChandelier : ModTile + { + public override void SetDefaults() + { + this.SetUpChandelier(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Monolith Chandelier"); + AddMapEntry(new Color(191, 142, 111), name); + adjTiles = new int[] { TileID.Torches }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, ModContent.DustType(), 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + int xPos = Main.tile[i, j].frameX; + int yPos = Main.tile[i, j].frameY; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/FurnitureAstral/MonolithChandelierGlow"); + Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; + Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + + Texture2D glowmaskBright = ModContent.GetTexture("CalamityMod/Tiles/FurnitureAstral/MonolithChandelierFlame"); + Main.spriteBatch.Draw(glowmaskBright, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), Color.White, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + + private Color GetDrawColour(int i, int j, Color colour) + { + int colType = Main.tile[i, j].color(); + Color paintCol = WorldGen.paintColor(colType); + if (colType >= 13 && colType <= 24) + { + colour.R = (byte)(paintCol.R / 255f * colour.R); + colour.G = (byte)(paintCol.G / 255f * colour.G); + colour.B = (byte)(paintCol.B / 255f * colour.B); + } + return colour; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].frameX < 18) + { + r = 0.8f; + g = 0.9f; + b = 1f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 48, 48, ModContent.ItemType()); + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 3, 3); + } + } +} diff --git a/Tiles/FurnitureAstral/MonolithChandelier.png b/Tiles/FurnitureAstral/MonolithChandelier.png new file mode 100644 index 0000000000..4cfc1f26b6 Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithChandelier.png differ diff --git a/Tiles/FurnitureAstral/MonolithChandelierFlame.png b/Tiles/FurnitureAstral/MonolithChandelierFlame.png new file mode 100644 index 0000000000..2061b9f21b Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithChandelierFlame.png differ diff --git a/Tiles/FurnitureAstral/MonolithChandelierGlow.png b/Tiles/FurnitureAstral/MonolithChandelierGlow.png new file mode 100644 index 0000000000..1784d6b220 Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithChandelierGlow.png differ diff --git a/Tiles/FurnitureAstral/MonolithChest.cs b/Tiles/FurnitureAstral/MonolithChest.cs new file mode 100644 index 0000000000..ce698812ab --- /dev/null +++ b/Tiles/FurnitureAstral/MonolithChest.cs @@ -0,0 +1,135 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureAstral +{ + public class MonolithChest : ModTile + { + public override void SetDefaults() + { + this.SetUpChest(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Monolith Chest"); + AddMapEntry(new Color(191, 142, 111), name, MapChestName); + disableSmartCursor = true; + adjTiles = new int[] { TileID.Containers }; + chest = "Monolith Chest"; + chestDrop = ModContent.ItemType(); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, ModContent.DustType(), 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + int xPos = Main.tile[i, j].frameX; + int yPos = Main.tile[i, j].frameY; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/FurnitureAstral/MonolithChestGlow"); + Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; + Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + + private Color GetDrawColour(int i, int j, Color colour) + { + int colType = Main.tile[i, j].color(); + Color paintCol = WorldGen.paintColor(colType); + if (colType >= 13 && colType <= 24) + { + colour.R = (byte)(paintCol.R / 255f * colour.R); + colour.G = (byte)(paintCol.G / 255f * colour.G); + colour.B = (byte)(paintCol.B / 255f * colour.B); + } + return colour; + } + + public override bool HasSmartInteract() + { + return true; + } + + public string MapChestName(string name, int i, int j) + { + int left = i; + int top = j; + Tile tile = Main.tile[i, j]; + if (tile.frameX % 36 != 0) + { + left--; + } + if (tile.frameY != 0) + { + top--; + } + int chest = Chest.FindChest(left, top); + if (Main.chest[chest].name == "") + { + return name; + } + else + { + return name + ": " + Main.chest[chest].name; + } + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 32, 32, chestDrop); + Chest.DestroyChest(i, j); + } + + public override bool NewRightClick(int i, int j) + { + // Glowmask animation & custom sound + Player player = Main.LocalPlayer; + Tile tile = Main.tile[i, j]; + Main.mouseRightRelease = false; + int left = i; + int top = j; + if (tile.frameX % 36 != 0) + { + left--; + } + if (tile.frameY != 0) + { + top--; + } + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int chest = Chest.FindChest(left, top); + if (chest >= 0) + { + if (player.chest < 0) + { + Main.PlaySound(4, Style: 22, volumeScale: 0.5f); + } + } + } + + return CalamityUtils.ChestRightClick(i, j); + } + + public override void MouseOver(int i, int j) + { + CalamityUtils.ChestMouseOver("Monolith Chest", i, j); + } + + public override void MouseOverFar(int i, int j) + { + CalamityUtils.ChestMouseFar("Monolith Chest", i, j); + } + } +} diff --git a/Tiles/FurnitureAstral/MonolithChest.png b/Tiles/FurnitureAstral/MonolithChest.png new file mode 100644 index 0000000000..7681ff35f2 Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithChest.png differ diff --git a/Tiles/FurnitureAstral/MonolithChestGlow.png b/Tiles/FurnitureAstral/MonolithChestGlow.png new file mode 100644 index 0000000000..3b85c5e149 Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithChestGlow.png differ diff --git a/Tiles/FurnitureAstral/MonolithChest_Highlight.png b/Tiles/FurnitureAstral/MonolithChest_Highlight.png new file mode 100644 index 0000000000..534e456f18 Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithChest_Highlight.png differ diff --git a/Tiles/FurnitureAstral/MonolithClock.cs b/Tiles/FurnitureAstral/MonolithClock.cs new file mode 100644 index 0000000000..101bffb878 --- /dev/null +++ b/Tiles/FurnitureAstral/MonolithClock.cs @@ -0,0 +1,79 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureAstral +{ + public class MonolithClock : ModTile + { + public override void SetDefaults() + { + this.SetUpClock(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Monolith Clock"); + AddMapEntry(new Color(191, 142, 111), name); + adjTiles = new int[] { TileID.GrandfatherClocks }; + } + + public override bool HasSmartInteract() + { + return true; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, ModContent.DustType(), 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + int xPos = Main.tile[i, j].frameX; + int yPos = Main.tile[i, j].frameY; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/FurnitureAstral/MonolithClockGlow"); + Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; + Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + + private Color GetDrawColour(int i, int j, Color colour) + { + int colType = Main.tile[i, j].color(); + Color paintCol = WorldGen.paintColor(colType); + if (colType >= 13 && colType <= 24) + { + colour.R = (byte)(paintCol.R / 255f * colour.R); + colour.G = (byte)(paintCol.G / 255f * colour.G); + colour.B = (byte)(paintCol.B / 255f * colour.B); + } + return colour; + } + + public override bool NewRightClick(int x, int y) + { + return CalamityUtils.ClockRightClick(); + } + + public override void NearbyEffects(int i, int j, bool closer) + { + if (closer) + { + Main.clock = true; + } + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 48, 32, ModContent.ItemType()); + } + } +} diff --git a/Tiles/FurnitureAstral/MonolithClock.png b/Tiles/FurnitureAstral/MonolithClock.png new file mode 100644 index 0000000000..213139b714 Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithClock.png differ diff --git a/Tiles/FurnitureAstral/MonolithClockGlow.png b/Tiles/FurnitureAstral/MonolithClockGlow.png new file mode 100644 index 0000000000..b445ad1401 Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithClockGlow.png differ diff --git a/Tiles/FurnitureAstral/MonolithClock_Highlight.png b/Tiles/FurnitureAstral/MonolithClock_Highlight.png new file mode 100644 index 0000000000..1b8f71591e Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithClock_Highlight.png differ diff --git a/Tiles/FurnitureAstral/MonolithDoorClosed.cs b/Tiles/FurnitureAstral/MonolithDoorClosed.cs new file mode 100644 index 0000000000..d4578c36dc --- /dev/null +++ b/Tiles/FurnitureAstral/MonolithDoorClosed.cs @@ -0,0 +1,76 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureAstral +{ + public class MonolithDoorClosed : ModTile + { + public override void SetDefaults() + { + this.SetUpDoorClosed(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Monolith Door"); + AddMapEntry(new Color(191, 142, 111), name); + disableSmartCursor = true; + adjTiles = new int[] { TileID.ClosedDoor }; + openDoorID = ModContent.TileType(); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, ModContent.DustType(), 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + int xPos = Main.tile[i, j].frameX; + int yPos = Main.tile[i, j].frameY; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/FurnitureAstral/MonolithDoorClosedGlow"); + Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; + Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + + private Color GetDrawColour(int i, int j, Color colour) + { + int colType = Main.tile[i, j].color(); + Color paintCol = WorldGen.paintColor(colType); + if (colType >= 13 && colType <= 24) + { + colour.R = (byte)(paintCol.R / 255f * colour.R); + colour.G = (byte)(paintCol.G / 255f * colour.G); + colour.B = (byte)(paintCol.B / 255f * colour.B); + } + return colour; + } + + public override bool HasSmartInteract() + { + return true; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 48, ModContent.ItemType()); + } + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.showItemIcon = true; + player.showItemIcon2 = ModContent.ItemType(); + } + } +} diff --git a/Tiles/FurnitureAstral/MonolithDoorClosed.png b/Tiles/FurnitureAstral/MonolithDoorClosed.png new file mode 100644 index 0000000000..b206e4b9f0 Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithDoorClosed.png differ diff --git a/Tiles/FurnitureAstral/MonolithDoorClosedGlow.png b/Tiles/FurnitureAstral/MonolithDoorClosedGlow.png new file mode 100644 index 0000000000..c69ed66407 Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithDoorClosedGlow.png differ diff --git a/Tiles/FurnitureAstral/MonolithDoorClosed_Highlight.png b/Tiles/FurnitureAstral/MonolithDoorClosed_Highlight.png new file mode 100644 index 0000000000..8158e57371 Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithDoorClosed_Highlight.png differ diff --git a/Tiles/FurnitureAstral/MonolithDoorOpen.cs b/Tiles/FurnitureAstral/MonolithDoorOpen.cs new file mode 100644 index 0000000000..3eca8a2faa --- /dev/null +++ b/Tiles/FurnitureAstral/MonolithDoorOpen.cs @@ -0,0 +1,76 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureAstral +{ + public class MonolithDoorOpen : ModTile + { + public override void SetDefaults() + { + this.SetUpDoorOpen(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Monolith Door"); + AddMapEntry(new Color(191, 142, 111), name); + disableSmartCursor = true; + adjTiles = new int[] { TileID.OpenDoor }; + closeDoorID = ModContent.TileType(); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, ModContent.DustType(), 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + int xPos = Main.tile[i, j].frameX; + int yPos = Main.tile[i, j].frameY; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/FurnitureAstral/MonolithDoorOpenGlow"); + Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; + Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + + private Color GetDrawColour(int i, int j, Color colour) + { + int colType = Main.tile[i, j].color(); + Color paintCol = WorldGen.paintColor(colType); + if (colType >= 13 && colType <= 24) + { + colour.R = (byte)(paintCol.R / 255f * colour.R); + colour.G = (byte)(paintCol.G / 255f * colour.G); + colour.B = (byte)(paintCol.B / 255f * colour.B); + } + return colour; + } + + public override bool HasSmartInteract() + { + return true; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 32, 48, ModContent.ItemType()); + } + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.showItemIcon = true; + player.showItemIcon2 = ModContent.ItemType(); + } + } +} diff --git a/Tiles/FurnitureAstral/MonolithDoorOpen.png b/Tiles/FurnitureAstral/MonolithDoorOpen.png new file mode 100644 index 0000000000..535eb53974 Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithDoorOpen.png differ diff --git a/Tiles/FurnitureAstral/MonolithDoorOpenGlow.png b/Tiles/FurnitureAstral/MonolithDoorOpenGlow.png new file mode 100644 index 0000000000..825f5b724b Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithDoorOpenGlow.png differ diff --git a/Tiles/FurnitureAstral/MonolithDoorOpen_Highlight.png b/Tiles/FurnitureAstral/MonolithDoorOpen_Highlight.png new file mode 100644 index 0000000000..efc608a2c8 Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithDoorOpen_Highlight.png differ diff --git a/Tiles/FurnitureAstral/MonolithDresser.cs b/Tiles/FurnitureAstral/MonolithDresser.cs new file mode 100644 index 0000000000..d28ef307f0 --- /dev/null +++ b/Tiles/FurnitureAstral/MonolithDresser.cs @@ -0,0 +1,85 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureAstral +{ + public class MonolithDresser : ModTile + { + public override void SetDefaults() + { + this.SetUpDresser(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Monolith Dresser"); + AddMapEntry(new Color(191, 142, 111), name); + disableSmartCursor = true; + adjTiles = new int[] { TileID.Dressers }; + dresser = "Monolith Dresser"; + dresserDrop = ModContent.ItemType(); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, ModContent.DustType(), 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + int xPos = Main.tile[i, j].frameX; + int yPos = Main.tile[i, j].frameY; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/FurnitureAstral/MonolithDresserGlow"); + Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; + Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + + private Color GetDrawColour(int i, int j, Color colour) + { + int colType = Main.tile[i, j].color(); + Color paintCol = WorldGen.paintColor(colType); + if (colType >= 13 && colType <= 24) + { + colour.R = (byte)(paintCol.R / 255f * colour.R); + colour.G = (byte)(paintCol.G / 255f * colour.G); + colour.B = (byte)(paintCol.B / 255f * colour.B); + } + return colour; + } + + public override bool HasSmartInteract() + { + return true; + } + + public override bool NewRightClick(int i, int j) + { + return CalamityUtils.DresserRightClick(); + } + + public override void MouseOverFar(int i, int j) + { + CalamityUtils.DresserMouseFar(chest); + } + + public override void MouseOver(int i, int j) + { + CalamityUtils.DresserMouseOver(chest); + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 48, 32, dresserDrop); + Chest.DestroyChest(i, j); + } + } +} diff --git a/Tiles/FurnitureAstral/MonolithDresser.png b/Tiles/FurnitureAstral/MonolithDresser.png new file mode 100644 index 0000000000..e113526154 Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithDresser.png differ diff --git a/Tiles/FurnitureAstral/MonolithDresserGlow.png b/Tiles/FurnitureAstral/MonolithDresserGlow.png new file mode 100644 index 0000000000..40a9f37171 Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithDresserGlow.png differ diff --git a/Tiles/FurnitureAstral/MonolithDresser_Highlight.png b/Tiles/FurnitureAstral/MonolithDresser_Highlight.png new file mode 100644 index 0000000000..180fe4aec5 Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithDresser_Highlight.png differ diff --git a/Tiles/FurnitureAstral/MonolithLamp.cs b/Tiles/FurnitureAstral/MonolithLamp.cs new file mode 100644 index 0000000000..e94fc1d05c --- /dev/null +++ b/Tiles/FurnitureAstral/MonolithLamp.cs @@ -0,0 +1,87 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureAstral +{ + class MonolithLamp : ModTile + { + public override void SetDefaults() + { + this.SetUpLamp(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Monolith Lamp"); + AddMapEntry(new Color(191, 142, 111), name); + + disableSmartCursor = true; + adjTiles = new int[] { TileID.Torches }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, ModContent.DustType(), 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + int xPos = Main.tile[i, j].frameX; + int yPos = Main.tile[i, j].frameY; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/FurnitureAstral/MonolithLampGlow"); + Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; + Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + + Texture2D glowmaskBright = ModContent.GetTexture("CalamityMod/Tiles/FurnitureAstral/MonolithLampFlame"); + Main.spriteBatch.Draw(glowmaskBright, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), Color.White, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + + private Color GetDrawColour(int i, int j, Color colour) + { + int colType = Main.tile[i, j].color(); + Color paintCol = WorldGen.paintColor(colType); + if (colType >= 13 && colType <= 24) + { + colour.R = (byte)(paintCol.R / 255f * colour.R); + colour.G = (byte)(paintCol.G / 255f * colour.G); + colour.B = (byte)(paintCol.B / 255f * colour.B); + } + return colour; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].frameX < 18) + { + r = 0.8f; + g = 0.9f; + b = 1f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 1, 3); + } + } +} diff --git a/Tiles/FurnitureAstral/MonolithLamp.png b/Tiles/FurnitureAstral/MonolithLamp.png new file mode 100644 index 0000000000..adfb90826a Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithLamp.png differ diff --git a/Tiles/FurnitureAstral/MonolithLampFlame.png b/Tiles/FurnitureAstral/MonolithLampFlame.png new file mode 100644 index 0000000000..b02dffba1a Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithLampFlame.png differ diff --git a/Tiles/FurnitureAstral/MonolithLampGlow.png b/Tiles/FurnitureAstral/MonolithLampGlow.png new file mode 100644 index 0000000000..553d30214a Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithLampGlow.png differ diff --git a/Tiles/FurnitureAstral/MonolithLantern.cs b/Tiles/FurnitureAstral/MonolithLantern.cs new file mode 100644 index 0000000000..289de970f5 --- /dev/null +++ b/Tiles/FurnitureAstral/MonolithLantern.cs @@ -0,0 +1,87 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureAstral +{ + class MonolithLantern : ModTile + { + public override void SetDefaults() + { + this.SetUpLantern(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Monolith Lantern"); + AddMapEntry(new Color(191, 142, 111), name); + + disableSmartCursor = true; + adjTiles = new int[] { TileID.Torches }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, ModContent.DustType(), 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + int xPos = Main.tile[i, j].frameX; + int yPos = Main.tile[i, j].frameY; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/FurnitureAstral/MonolithLanternGlow"); + Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; + Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + + Texture2D glowmaskBright = ModContent.GetTexture("CalamityMod/Tiles/FurnitureAstral/MonolithLanternFlame"); + Main.spriteBatch.Draw(glowmaskBright, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), Color.White, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + + private Color GetDrawColour(int i, int j, Color colour) + { + int colType = Main.tile[i, j].color(); + Color paintCol = WorldGen.paintColor(colType); + if (colType >= 13 && colType <= 24) + { + colour.R = (byte)(paintCol.R / 255f * colour.R); + colour.G = (byte)(paintCol.G / 255f * colour.G); + colour.B = (byte)(paintCol.B / 255f * colour.B); + } + return colour; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].frameX < 18) + { + r = 0.8f; + g = 0.9f; + b = 1f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 1, 2); + } + } +} diff --git a/Tiles/FurnitureAstral/MonolithLantern.png b/Tiles/FurnitureAstral/MonolithLantern.png new file mode 100644 index 0000000000..eff6759195 Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithLantern.png differ diff --git a/Tiles/FurnitureAstral/MonolithLanternFlame.png b/Tiles/FurnitureAstral/MonolithLanternFlame.png new file mode 100644 index 0000000000..c145c61865 Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithLanternFlame.png differ diff --git a/Tiles/FurnitureAstral/MonolithLanternGlow.png b/Tiles/FurnitureAstral/MonolithLanternGlow.png new file mode 100644 index 0000000000..dc9283298a Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithLanternGlow.png differ diff --git a/Tiles/FurnitureAstral/MonolithPiano.cs b/Tiles/FurnitureAstral/MonolithPiano.cs new file mode 100644 index 0000000000..08c644fd57 --- /dev/null +++ b/Tiles/FurnitureAstral/MonolithPiano.cs @@ -0,0 +1,59 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; +namespace CalamityMod.Tiles.FurnitureAstral +{ + class MonolithPiano : ModTile + { + public override void SetDefaults() + { + this.SetUpPiano(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Monolith Piano"); + AddMapEntry(new Color(191, 142, 111), name); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 1, 0f, 0f, 1, new Color(125, 94, 128), 1f); + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, ModContent.DustType(), 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + int xPos = Main.tile[i, j].frameX; + int yPos = Main.tile[i, j].frameY; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/FurnitureAstral/MonolithPianoGlow"); + Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; + Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + + private Color GetDrawColour(int i, int j, Color colour) + { + int colType = Main.tile[i, j].color(); + Color paintCol = WorldGen.paintColor(colType); + if (colType >= 13 && colType <= 24) + { + colour.R = (byte)(paintCol.R / 255f * colour.R); + colour.G = (byte)(paintCol.G / 255f * colour.G); + colour.B = (byte)(paintCol.B / 255f * colour.B); + } + return colour; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + } +} diff --git a/Tiles/FurnitureAstral/MonolithPiano.png b/Tiles/FurnitureAstral/MonolithPiano.png new file mode 100644 index 0000000000..5dfcbe9206 Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithPiano.png differ diff --git a/Tiles/FurnitureAstral/MonolithPianoGlow.png b/Tiles/FurnitureAstral/MonolithPianoGlow.png new file mode 100644 index 0000000000..6a8d04dbea Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithPianoGlow.png differ diff --git a/Tiles/FurnitureAstral/MonolithPlatform.cs b/Tiles/FurnitureAstral/MonolithPlatform.cs new file mode 100644 index 0000000000..61fc144349 --- /dev/null +++ b/Tiles/FurnitureAstral/MonolithPlatform.cs @@ -0,0 +1,37 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureAstral +{ + public class MonolithPlatform : ModTile + { + public override void SetDefaults() + { + this.SetUpPlatform(); + AddMapEntry(new Color(191, 142, 111)); + drop = ModContent.ItemType(); + disableSmartCursor = true; + adjTiles = new int[] { TileID.Platforms }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, ModContent.DustType(), 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void PostSetDefaults() + { + Main.tileNoSunLight[Type] = false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureAstral/MonolithPlatform.png b/Tiles/FurnitureAstral/MonolithPlatform.png new file mode 100644 index 0000000000..9df7b1018c Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithPlatform.png differ diff --git a/Tiles/FurnitureAstral/MonolithSink.cs b/Tiles/FurnitureAstral/MonolithSink.cs new file mode 100644 index 0000000000..e2189dadf1 --- /dev/null +++ b/Tiles/FurnitureAstral/MonolithSink.cs @@ -0,0 +1,61 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureAstral +{ + class MonolithSink : ModTile + { + public override void SetDefaults() + { + this.SetUpSink(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Monolith Sink"); + AddMapEntry(new Color(191, 142, 111), name); + adjTiles = new int[] { TileID.Sinks }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, ModContent.DustType(), 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + int xPos = Main.tile[i, j].frameX; + int yPos = Main.tile[i, j].frameY; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/FurnitureAstral/MonolithSinkGlow"); + Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; + Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + + private Color GetDrawColour(int i, int j, Color colour) + { + int colType = Main.tile[i, j].color(); + Color paintCol = WorldGen.paintColor(colType); + if (colType >= 13 && colType <= 24) + { + colour.R = (byte)(paintCol.R / 255f * colour.R); + colour.G = (byte)(paintCol.G / 255f * colour.G); + colour.B = (byte)(paintCol.B / 255f * colour.B); + } + return colour; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + } +} diff --git a/Tiles/FurnitureAstral/MonolithSink.png b/Tiles/FurnitureAstral/MonolithSink.png new file mode 100644 index 0000000000..6bc314ae5a Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithSink.png differ diff --git a/Tiles/FurnitureAstral/MonolithSinkGlow.png b/Tiles/FurnitureAstral/MonolithSinkGlow.png new file mode 100644 index 0000000000..f2f56fd923 Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithSinkGlow.png differ diff --git a/Tiles/FurnitureAstral/MonolithTable.cs b/Tiles/FurnitureAstral/MonolithTable.cs new file mode 100644 index 0000000000..228d4f58a7 --- /dev/null +++ b/Tiles/FurnitureAstral/MonolithTable.cs @@ -0,0 +1,61 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureAstral +{ + class MonolithTable : ModTile + { + public override void SetDefaults() + { + this.SetUpTable(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Monolith Table"); + AddMapEntry(new Color(191, 142, 111), name); + adjTiles = new int[] { TileID.Tables }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, ModContent.DustType(), 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + int xPos = Main.tile[i, j].frameX; + int yPos = Main.tile[i, j].frameY; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/FurnitureAstral/MonolithTableGlow"); + Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; + Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + + private Color GetDrawColour(int i, int j, Color colour) + { + int colType = Main.tile[i, j].color(); + Color paintCol = WorldGen.paintColor(colType); + if (colType >= 13 && colType <= 24) + { + colour.R = (byte)(paintCol.R / 255f * colour.R); + colour.G = (byte)(paintCol.G / 255f * colour.G); + colour.B = (byte)(paintCol.B / 255f * colour.B); + } + return colour; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + } +} diff --git a/Tiles/FurnitureAstral/MonolithTable.png b/Tiles/FurnitureAstral/MonolithTable.png new file mode 100644 index 0000000000..8f6e1a9ead Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithTable.png differ diff --git a/Tiles/FurnitureAstral/MonolithTableGlow.png b/Tiles/FurnitureAstral/MonolithTableGlow.png new file mode 100644 index 0000000000..4da7711f2d Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithTableGlow.png differ diff --git a/Tiles/FurnitureAstral/MonolithTypeA.png b/Tiles/FurnitureAstral/MonolithTypeA.png new file mode 100644 index 0000000000..e2d32607d3 Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithTypeA.png differ diff --git a/Tiles/FurnitureAstral/MonolithTypeAGlow.png b/Tiles/FurnitureAstral/MonolithTypeAGlow.png new file mode 100644 index 0000000000..250b58a6bc Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithTypeAGlow.png differ diff --git a/Tiles/FurnitureAstral/MonolithWorkBench.png b/Tiles/FurnitureAstral/MonolithWorkBench.png new file mode 100644 index 0000000000..22d20c18e3 Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithWorkBench.png differ diff --git a/Tiles/FurnitureAstral/MonolithWorkBenchGlow.png b/Tiles/FurnitureAstral/MonolithWorkBenchGlow.png new file mode 100644 index 0000000000..50c4400bf2 Binary files /dev/null and b/Tiles/FurnitureAstral/MonolithWorkBenchGlow.png differ diff --git a/Tiles/FurnitureAstral/MonolithWorkbench.cs b/Tiles/FurnitureAstral/MonolithWorkbench.cs new file mode 100644 index 0000000000..10957c40de --- /dev/null +++ b/Tiles/FurnitureAstral/MonolithWorkbench.cs @@ -0,0 +1,62 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureAstral +{ + public class MonolithWorkBench : ModTile + { + public override void SetDefaults() + { + this.SetUpWorkBench(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Monolith Work Bench"); + AddMapEntry(new Color(191, 142, 111), name); + disableSmartCursor = true; + adjTiles = new int[] { TileID.WorkBenches }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, ModContent.DustType(), 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + int xPos = Main.tile[i, j].frameX; + int yPos = Main.tile[i, j].frameY; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/FurnitureAstral/MonolithWorkBenchGlow"); + Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; + Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + + private Color GetDrawColour(int i, int j, Color colour) + { + int colType = Main.tile[i, j].color(); + Color paintCol = WorldGen.paintColor(colType); + if (colType >= 13 && colType <= 24) + { + colour.R = (byte)(paintCol.R / 255f * colour.R); + colour.G = (byte)(paintCol.G / 255f * colour.G); + colour.B = (byte)(paintCol.B / 255f * colour.B); + } + return colour; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 32, 16, ModContent.ItemType()); + } + } +} diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index 2cba89e05a..f52e0b4ffe 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -1314,12 +1314,13 @@ namespace CalamityMod /// /// The ModTile which is being initialized. /// Whether this tile is supposed to be immune to lava. Defaults to false. - internal static void SetUpBookcase(this ModTile mt, bool lavaImmune = false) + /// Whether this tile is supposed to have a solid top. Defaults to true. + internal static void SetUpBookcase(this ModTile mt, bool lavaImmune = false, bool solidTop = true) { - Main.tileSolidTop[mt.Type] = true; + Main.tileSolidTop[mt.Type] = solidTop; Main.tileLighted[mt.Type] = true; Main.tileFrameImportant[mt.Type] = true; - Main.tileTable[mt.Type] = true; + Main.tileTable[mt.Type] = solidTop; Main.tileLavaDeath[mt.Type] = !lavaImmune; Main.tileWaterDeath[mt.Type] = false; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4); diff --git a/Utilities/TileFraming.cs b/Utilities/TileFraming.cs index 55c2475b29..0e25329b94 100644 --- a/Utilities/TileFraming.cs +++ b/Utilities/TileFraming.cs @@ -73,7 +73,6 @@ namespace CalamityMod tileMergeTypes[ModContent.TileType()][ModContent.TileType()] = true; tileMergeTypes[ModContent.TileType()][ModContent.TileType()] = true; tileMergeTypes[ModContent.TileType()][ModContent.TileType()] = true; - tileMergeTypes[ModContent.TileType()][ModContent.TileType()] = true; tileMergeTypes[ModContent.TileType()][ModContent.TileType()] = true; tileMergeTypes[ModContent.TileType()][ModContent.TileType()] = true; tileMergeTypes[ModContent.TileType()][ModContent.TileType()] = true; @@ -112,6 +111,46 @@ namespace CalamityMod return mergeTile.active() && (mergeTile.type == myTile.type || Main.tileMerge[myTile.type][mergeTile.type]); } + private static void GetAdjacentTiles(int x, int y, out bool up, out bool down, out bool left, out bool right, out bool upLeft, out bool upRight, out bool downLeft, out bool downRight) + { + // These all get null checked in the GetMerge function + Tile tile = Main.tile[x, y]; + Tile north = Main.tile[x, y - 1]; + Tile south = Main.tile[x, y + 1]; + Tile west = Main.tile[x - 1, y]; + Tile east = Main.tile[x + 1, y]; + Tile southwest = Main.tile[x - 1, y + 1]; + Tile southeast = Main.tile[x + 1, y + 1]; + Tile northwest = Main.tile[x - 1, y - 1]; + Tile northeast = Main.tile[x + 1, y - 1]; + + left = false; + right = false; + up = false; + down = false; + upLeft = false; + upRight = false; + downLeft = false; + downRight = false; + + if (GetMerge(tile, north) && (north.slope() == 0 || north.slope() == 1 || north.slope() == 2)) + up = true; + if (GetMerge(tile, south) && (south.slope() == 0 || south.slope() == 3 || south.slope() == 4)) + down = true; + if (GetMerge(tile, west) && (west.slope() == 0 || west.slope() == 2 || west.slope() == 4)) + left = true; + if (GetMerge(tile, east) && (east.slope() == 0 || east.slope() == 1 || east.slope() == 3)) + right = true; + if (GetMerge(tile, north) && GetMerge(tile, west) && GetMerge(tile, northwest) && (northwest.slope() == 0 || northwest.slope() == 2) && (north.slope() == 0 || north.slope() == 1 || north.slope() == 3) && (west.slope() == 0 || west.slope() == 3 || west.slope() == 4)) + upLeft = true; + if (GetMerge(tile, north) && GetMerge(tile, east) && GetMerge(tile, northeast) && (northeast.slope() == 0 || northeast.slope() == 1) && (north.slope() == 0 || north.slope() == 2 || north.slope() == 4) && (east.slope() == 0 || east.slope() == 3 || east.slope() == 4)) + upRight = true; + if (GetMerge(tile, south) && GetMerge(tile, west) && GetMerge(tile, southwest) && !southwest.halfBrick() && (southwest.slope() == 0 || southwest.slope() == 4) && (south.slope() == 0 || south.slope() == 1 || south.slope() == 3) && (west.slope() == 0 || west.slope() == 1 || west.slope() == 2)) + downLeft = true; + if (GetMerge(tile, south) && GetMerge(tile, east) && GetMerge(tile, southeast) && !southeast.halfBrick() && (southeast.slope() == 0 || southeast.slope() == 3) && (south.slope() == 0 || south.slope() == 2 || south.slope() == 4) && (east.slope() == 0 || east.slope() == 1 || east.slope() == 2)) + downRight = true; + } + private static void SetFrameAt(int x, int y, int frameX, int frameY) { Tile tile = Main.tile[x, y]; @@ -292,41 +331,7 @@ namespace CalamityMod return true; } - // these all get null checked in the GetMerge function - Tile north = Main.tile[x, y - 1]; - Tile south = Main.tile[x, y + 1]; - Tile west = Main.tile[x - 1, y]; - Tile east = Main.tile[x + 1, y]; - Tile southwest = Main.tile[x - 1, y + 1]; - Tile southeast = Main.tile[x + 1, y + 1]; - Tile northwest = Main.tile[x - 1, y - 1]; - Tile northeast = Main.tile[x + 1, y - 1]; - - bool left = false; - bool right = false; - bool up = false; - bool down = false; - bool upLeft = false; - bool upRight = false; - bool downLeft = false; - bool downRight = false; - - if (GetMerge(tile, north) && (north.slope() == 0 || north.slope() == 1 || north.slope() == 2)) - up = true; - if (GetMerge(tile, south) && (south.slope() == 0 || south.slope() == 3 || south.slope() == 4)) - down = true; - if (GetMerge(tile, west) && (west.slope() == 0 || west.slope() == 2 || west.slope() == 4)) - left = true; - if (GetMerge(tile, east) && (east.slope() == 0 || east.slope() == 1 || east.slope() == 3)) - right = true; - if (GetMerge(tile, north) && GetMerge(tile, west) && GetMerge(tile, northwest) && (northwest.slope() == 0 || northwest.slope() == 2) && (north.slope() == 0 || north.slope() == 1 || north.slope() == 3) && (west.slope() == 0 || west.slope() == 3 || west.slope() == 4)) - upLeft = true; - if (GetMerge(tile, north) && GetMerge(tile, east) && GetMerge(tile, northeast) && (northeast.slope() == 0 || northeast.slope() == 1) && (north.slope() == 0 || north.slope() == 2 || north.slope() == 4) && (east.slope() == 0 || east.slope() == 3 || east.slope() == 4)) - upRight = true; - if (GetMerge(tile, south) && GetMerge(tile, west) && GetMerge(tile, southwest) && !southwest.halfBrick() && (southwest.slope() == 0 || southwest.slope() == 4) && (south.slope() == 0 || south.slope() == 1 || south.slope() == 3) && (west.slope() == 0 || west.slope() == 1 || west.slope() == 2)) - downLeft = true; - if (GetMerge(tile, south) && GetMerge(tile, east) && GetMerge(tile, southeast) && !southeast.halfBrick() && (southeast.slope() == 0 || southeast.slope() == 3) && (south.slope() == 0 || south.slope() == 2 || south.slope() == 4) && (east.slope() == 0 || east.slope() == 1 || east.slope() == 2)) - downRight = true; + GetAdjacentTiles(x, y, out bool up, out bool down, out bool left, out bool right, out bool upLeft, out bool upRight, out bool downLeft, out bool downRight); // Reset the tile's random frame style if the frame is being reset. int randomFrame; @@ -574,41 +579,7 @@ namespace CalamityMod return true; } - // these all get null checked in the GetMerge function - Tile north = Main.tile[x, y - 1]; - Tile south = Main.tile[x, y + 1]; - Tile west = Main.tile[x - 1, y]; - Tile east = Main.tile[x + 1, y]; - Tile southwest = Main.tile[x - 1, y + 1]; - Tile southeast = Main.tile[x + 1, y + 1]; - Tile northwest = Main.tile[x - 1, y - 1]; - Tile northeast = Main.tile[x + 1, y - 1]; - - bool left = false; - bool right = false; - bool up = false; - bool down = false; - bool upLeft = false; - bool upRight = false; - bool downLeft = false; - bool downRight = false; - - if (GetMerge(tile, north) && (north.slope() == 0 || north.slope() == 1 || north.slope() == 2)) - up = true; - if (GetMerge(tile, south) && (south.slope() == 0 || south.slope() == 3 || south.slope() == 4)) - down = true; - if (GetMerge(tile, west) && (west.slope() == 0 || west.slope() == 2 || west.slope() == 4)) - left = true; - if (GetMerge(tile, east) && (east.slope() == 0 || east.slope() == 1 || east.slope() == 3)) - right = true; - if (GetMerge(tile, north) && GetMerge(tile, west) && GetMerge(tile, northwest) && (northwest.slope() == 0 || northwest.slope() == 2) && (north.slope() == 0 || north.slope() == 1 || north.slope() == 3) && (west.slope() == 0 || west.slope() == 3 || west.slope() == 4)) - upLeft = true; - if (GetMerge(tile, north) && GetMerge(tile, east) && GetMerge(tile, northeast) && (northeast.slope() == 0 || northeast.slope() == 1) && (north.slope() == 0 || north.slope() == 2 || north.slope() == 4) && (east.slope() == 0 || east.slope() == 3 || east.slope() == 4)) - upRight = true; - if (GetMerge(tile, south) && GetMerge(tile, west) && GetMerge(tile, southwest) && !southwest.halfBrick() && (southwest.slope() == 0 || southwest.slope() == 4) && (south.slope() == 0 || south.slope() == 1 || south.slope() == 3) && (west.slope() == 0 || west.slope() == 1 || west.slope() == 2)) - downLeft = true; - if (GetMerge(tile, south) && GetMerge(tile, east) && GetMerge(tile, southeast) && !southeast.halfBrick() && (southeast.slope() == 0 || southeast.slope() == 3) && (south.slope() == 0 || south.slope() == 2 || south.slope() == 4) && (east.slope() == 0 || east.slope() == 1 || east.slope() == 2)) - downRight = true; + GetAdjacentTiles(x, y, out bool up, out bool down, out bool left, out bool right, out bool upLeft, out bool upRight, out bool downLeft, out bool downRight); // Reset the tile's random frame style if the frame is being reset. int randomFrame; @@ -840,6 +811,360 @@ namespace CalamityMod return true; } + + internal static void CompactFraming(int x, int y, bool resetFrame = true) + { + if (x < 0 || x >= Main.maxTilesX) + return; + if (y < 0 || y >= Main.maxTilesY) + return; + Tile tile = Main.tile[x, y]; + if (tile is null) + return; + + if (tile.slope() > 0 && TileID.Sets.HasSlopeFrames[tile.type]) + { + return; + } + + // Reset the tile's random frame style if the frame is being reset. + int randomFrame; + if (resetFrame) + { + randomFrame = WorldGen.genRand.Next(3); + Main.tile[x, y].frameNumber((byte)randomFrame); + } + else + { + randomFrame = Main.tile[x, y].frameNumber(); + } + + GetAdjacentTiles(x, y, out bool up, out bool down, out bool left, out bool right, out bool upLeft, out bool upRight, out bool downLeft, out bool downRight); + + #region Middle State + if (up && down && left && right && upLeft && upRight && downLeft && downRight) + { + tile.frameX = 18; + tile.frameY = 18; + return; + } + #endregion + + #region Single State + if (!up && !down && !left && !right) + { + tile.frameX = 54; + tile.frameY = 54; + return; + } + #endregion + + #region Edges + if (!up && down && left && right && downLeft && downRight) + { + tile.frameX = 18; + tile.frameY = 0; + return; + } + if (up && down && !left && right && upRight && downRight) + { + tile.frameX = 0; + tile.frameY = 18; + return; + } + if (up && !down && left && right && upLeft && upRight) + { + tile.frameX = 18; + tile.frameY = 36; + return; + } + if (up && down && left && !right && upLeft && downLeft) + { + tile.frameX = 36; + tile.frameY = 18; + return; + } + #endregion + + #region Edge Corners + if (!up && down && !left && right && downRight) + { + tile.frameX = 0; + tile.frameY = 0; + return; + } + if (!up && down && left && !right && downLeft) + { + tile.frameX = 36; + tile.frameY = 0; + return; + } + if (up && !down && !left && right && upRight) + { + tile.frameX = 0; + tile.frameY = 36; + return; + } + if (up && !down && left && !right && upLeft) + { + tile.frameX = 36; + tile.frameY = 36; + return; + } + #endregion + + #region I States + if (up && down && !left && !right) + { + tile.frameX = 54; + tile.frameY = 18; + return; + } + if (!up && !down && left && right) + { + tile.frameX = 18; + tile.frameY = 54; + return; + } + #endregion + + #region I End States + if (!up && down && !left && !right) + { + tile.frameX = 54; + tile.frameY = 0; + return; + } + if (up && !down && !left && !right) + { + tile.frameX = 54; + tile.frameY = 36; + return; + } + if (!up && !down && !left && right) + { + tile.frameX = 0; + tile.frameY = 54; + return; + } + if (!up && !down && left && !right) + { + tile.frameX = 36; + tile.frameY = 54; + return; + } + #endregion + + #region L States + if (!up && down && !left && right && !downRight) + { + tile.frameX = 72; + tile.frameY = 0; + return; + } + if (!up && down && left && !right && !downLeft) + { + tile.frameX = 108; + tile.frameY = 0; + return; + } + if (up && !down && !left && right && !upRight) + { + tile.frameX = 72; + tile.frameY = 36; + return; + } + if (up && !down && left && !right && !upLeft) + { + tile.frameX = 108; + tile.frameY = 36; + return; + } + #endregion + + #region T States + if (!up && down && left && right && !downLeft && !downRight) + { + tile.frameX = 90; + tile.frameY = 0; + return; + } + if (up && !down && left && right && !upLeft && !upRight) + { + tile.frameX = 90; + tile.frameY = 36; + return; + } + if (up && down && !left && right && !downRight && !upRight) + { + tile.frameX = 72; + tile.frameY = 18; + return; + } + if (up && down && left && !right && !downLeft && !upLeft) + { + tile.frameX = 108; + tile.frameY = 18; + return; + } + #endregion + + #region X State + if (up && down && left && right && !downLeft && !downRight && !upLeft && !upRight) + { + tile.frameX = 90; + tile.frameY = 18; + return; + } + #endregion + + #region Inner Corner x1 + if (up && down && left && right && !downLeft && downRight && upLeft && upRight) + { + tile.frameX = 144; + tile.frameY = 36; + return; + } + if (up && down && left && right && downLeft && !downRight && upLeft && upRight) + { + tile.frameX = 126; + tile.frameY = 36; + return; + } + if (up && down && left && right && downLeft && downRight && !upLeft && upRight) + { + tile.frameX = 144; + tile.frameY = 54; + return; + } + if (up && down && left && right && downLeft && downRight && upLeft && !upRight) + { + tile.frameX = 126; + tile.frameY = 54; + return; + } + #endregion + + #region Inner Corner x2 (same side) + if (up && down && left && right && !downLeft && !downRight && upLeft && upRight) + { + tile.frameX = 198; + tile.frameY = 18; + return; + } + if (up && down && left && right && downLeft && downRight && !upLeft && !upRight) + { + tile.frameX = 198; + tile.frameY = 18; + return; + } + if (up && down && left && right && !downLeft && downRight && !upLeft && upRight) + { + tile.frameX = 198; + tile.frameY = 36; + return; + } + if (up && down && left && right && downLeft && !downRight && upLeft && !upRight) + { + tile.frameX = 198; + tile.frameY = 54; + return; + } + #endregion + + #region Inner Corner x2 (opposite corners) + if (up && down && left && right && !downLeft && downRight && upLeft && !upRight) + { + tile.frameX = 108; + tile.frameY = 54; + return; + } + if (up && down && left && right && downLeft && !downRight && !upLeft && upRight) + { + tile.frameX = 90; + tile.frameY = 54; + return; + } + #endregion + + #region Inner Corner x3 + if (up && down && left && right && !downLeft && !downRight && !upLeft && upRight) + { + tile.frameX = 126; + tile.frameY = 18; + return; + } + if (up && down && left && right && !downLeft && downRight && !upLeft && !upRight) + { + tile.frameX = 126; + tile.frameY = 0; + return; + } + if (up && down && left && right && !downLeft && !downRight && upLeft && !upRight) + { + tile.frameX = 144; + tile.frameY = 18; + return; + } + if (up && down && left && right && downLeft && !downRight && !upLeft && !upRight) + { + tile.frameX = 144; + tile.frameY = 0; + return; + } + #endregion + + #region Corner and Side + if (!up && down && left && right && !downLeft && downRight && !upLeft && !upRight) + { + tile.frameX = 180; + tile.frameY = 0; + return; + } + if (!up && down && left && right && downLeft && !downRight && !upLeft && !upRight) + { + tile.frameX = 162; + tile.frameY = 0; + return; + } + if (up && !down && left && right && !downLeft && !downRight && !upLeft && upRight) + { + tile.frameX = 180; + tile.frameY = 18; + return; + } + if (up && !down && left && right && !downLeft && !downRight && upLeft && !upRight) + { + tile.frameX = 162; + tile.frameY = 18; + return; + } + if (up && down && !left && right && !downLeft && !downRight && !upLeft && upRight) + { + tile.frameX = 162; + tile.frameY = 36; + return; + } + if (up && down && !left && right && !downLeft && downRight && !upLeft && !upRight) + { + tile.frameX = 162; + tile.frameY = 54; + return; + } + if (up && down && left && !right && !downLeft && !downRight && upLeft && !upRight) + { + tile.frameX = 180; + tile.frameY = 36; + return; + } + if (up && down && left && !right && downLeft && !downRight && !upLeft && !upRight) + { + tile.frameX = 180; + tile.frameY = 54; + return; + } + #endregion + } #endregion #region Generic Custom Framing Code diff --git a/Walls/AstralMonolithWall.png b/Walls/AstralMonolithWall.png index 1cada57dcb..853840e816 100644 Binary files a/Walls/AstralMonolithWall.png and b/Walls/AstralMonolithWall.png differ