Merge: YuH's Calamity Monoliths
No files matched your search
@@ -1175,6 +1175,24 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
public int monolithAccursedShader = 0;
|
||||
|
||||
public int monolithBossRushShader = 0;
|
||||
|
||||
public int monolithExoShader = 0;
|
||||
|
||||
public int monolithLeviathanShader = 0;
|
||||
|
||||
public int monolithPlagueShader = 0;
|
||||
|
||||
public int monolithCryogenShader = 0;
|
||||
|
||||
public int monolithAstralShader = 0;
|
||||
|
||||
public int monolithDevourerBShader = 0;
|
||||
|
||||
public int monolithDevourerPShader = 0;
|
||||
|
||||
public int monolithYharonShader = 0;
|
||||
|
||||
// This may seem like a scuffed setup, but a simple bool will have ordering issues when it comes to drawing.
|
||||
// Until ModSceneMetrics gets implemented, this works for now.
|
||||
public int BrimstoneLavaFountainCounter = 0;
|
||||
|
||||
@@ -1520,8 +1520,27 @@ namespace CalamityMod.CalPlayer
|
||||
ChlorophyteHealDelay--;
|
||||
if (monolithAccursedShader > 0)
|
||||
monolithAccursedShader--;
|
||||
if (monolithBossRushShader > 0)
|
||||
monolithBossRushShader--;
|
||||
if (monolithExoShader > 0)
|
||||
monolithExoShader--;
|
||||
if (monolithLeviathanShader > 0)
|
||||
monolithLeviathanShader--;
|
||||
if (monolithCryogenShader > 0)
|
||||
monolithCryogenShader--;
|
||||
if (monolithDevourerBShader > 0)
|
||||
monolithDevourerBShader--;
|
||||
if (monolithDevourerPShader > 0)
|
||||
monolithDevourerPShader--;
|
||||
if (monolithYharonShader > 0)
|
||||
monolithYharonShader--;
|
||||
if (monolithPlagueShader > 0)
|
||||
monolithPlagueShader--;
|
||||
if (monolithAstralShader > 0)
|
||||
monolithAstralShader--;
|
||||
if (BrimstoneLavaFountainCounter > 0)
|
||||
BrimstoneLavaFountainCounter--;
|
||||
|
||||
if (miningSetCooldown > 0)
|
||||
miningSetCooldown--;
|
||||
if (RustyMedallionCooldown > 0)
|
||||
|
||||
@@ -342,6 +342,7 @@ namespace CalamityMod
|
||||
SkyManager.Instance["CalamityMod:AstralSurface"] = new AstralSkySurface();
|
||||
SkyManager.Instance["CalamityMod:AstralDesert"] = new AstralSkyDesert();
|
||||
SkyManager.Instance["CalamityMod:AstralSnow"] = new AstralSkySnow();
|
||||
SkyManager.Instance["CalamityMod:MonolithAstral"] = new AstralMonolithSky();
|
||||
SkyManager.Instance["CalamityMod:SulphurSea"] = new SulphurSeaSky();
|
||||
SkyManager.Instance["CalamityMod:Cryogen"] = new CryogenSky();
|
||||
SkyManager.Instance["CalamityMod:StormWeaverFlash"] = new StormWeaverFlashSky();
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
using CalamityMod.Tiles.Furniture.Monoliths;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Items.Placeables.Furniture.Monoliths
|
||||
{
|
||||
public class AstralProjector : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Placeables";
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 24;
|
||||
Item.height = 28;
|
||||
Item.maxStack = 9999;
|
||||
Item.useTurn = true;
|
||||
Item.autoReuse = true;
|
||||
Item.useAnimation = 15;
|
||||
Item.useTime = 10;
|
||||
Item.useStyle = ItemUseStyleID.Swing;
|
||||
Item.consumable = true;
|
||||
Item.createTile = ModContent.TileType<AstralProjectorTile>();
|
||||
Item.rare = ItemRarityID.LightRed;
|
||||
Item.accessory = true;
|
||||
Item.vanity = true;
|
||||
}
|
||||
|
||||
public override void UpdateEquip(Player player)
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
player.Calamity().monolithAstralShader = 30;
|
||||
}
|
||||
}
|
||||
public override void UpdateVanity(Player player)
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
player.Calamity().monolithAstralShader = 30;
|
||||
}
|
||||
}
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<AstralMonolith>(15).
|
||||
AddTile(TileID.Anvils).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 598 B |
@@ -0,0 +1,52 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Rarities;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using CalamityMod.Tiles.Furniture.Monoliths;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Items.Placeables.Furniture.Monoliths
|
||||
{
|
||||
public class BlueDistortedMonolith : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Placeables";
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 24;
|
||||
Item.height = 28;
|
||||
Item.maxStack = 9999;
|
||||
Item.useTurn = true;
|
||||
Item.autoReuse = true;
|
||||
Item.useAnimation = 15;
|
||||
Item.useTime = 10;
|
||||
Item.useStyle = ItemUseStyleID.Swing;
|
||||
Item.consumable = true;
|
||||
Item.createTile = ModContent.TileType<BlueDistortedMonolithTile>();
|
||||
Item.rare = ModContent.RarityType<DarkBlue>();
|
||||
Item.accessory = true;
|
||||
Item.vanity = true;
|
||||
}
|
||||
|
||||
public override void UpdateEquip(Player player)
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
player.Calamity().monolithDevourerBShader = 30;
|
||||
}
|
||||
}
|
||||
public override void UpdateVanity(Player player)
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
player.Calamity().monolithDevourerBShader = 30;
|
||||
}
|
||||
}
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<CosmiliteBar>(15).
|
||||
AddTile<CosmicAnvil>().
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 391 B |
@@ -0,0 +1,43 @@
|
||||
using CalamityMod.Rarities;
|
||||
using CalamityMod.Tiles.Furniture.Monoliths;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Items.Placeables.Furniture.Monoliths
|
||||
{
|
||||
public class BossRushMonolith : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Placeables";
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 24;
|
||||
Item.height = 28;
|
||||
Item.maxStack = 9999;
|
||||
Item.useTurn = true;
|
||||
Item.autoReuse = true;
|
||||
Item.useAnimation = 15;
|
||||
Item.useTime = 10;
|
||||
Item.useStyle = ItemUseStyleID.Swing;
|
||||
Item.consumable = true;
|
||||
Item.createTile = ModContent.TileType<BossRushMonolithTile>();
|
||||
Item.rare = ModContent.RarityType<HotPink>();
|
||||
Item.accessory = true;
|
||||
Item.vanity = true;
|
||||
}
|
||||
|
||||
public override void UpdateEquip(Player player)
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
player.Calamity().monolithBossRushShader = 30;
|
||||
}
|
||||
}
|
||||
public override void UpdateVanity(Player player)
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
player.Calamity().monolithBossRushShader = 30;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 500 B |
@@ -0,0 +1,43 @@
|
||||
using CalamityMod.Rarities;
|
||||
using CalamityMod.Tiles.Furniture.Monoliths;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Items.Placeables.Furniture.Monoliths
|
||||
{
|
||||
public class DeepSeaAnchor : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Placeables";
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 24;
|
||||
Item.height = 28;
|
||||
Item.maxStack = 9999;
|
||||
Item.useTurn = true;
|
||||
Item.autoReuse = true;
|
||||
Item.useAnimation = 15;
|
||||
Item.useTime = 10;
|
||||
Item.useStyle = ItemUseStyleID.Swing;
|
||||
Item.consumable = true;
|
||||
Item.createTile = ModContent.TileType<DeepSeaAnchorTile>();
|
||||
Item.rare = ItemRarityID.Lime;
|
||||
Item.accessory = true;
|
||||
Item.vanity = true;
|
||||
}
|
||||
|
||||
public override void UpdateEquip(Player player)
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
player.Calamity().monolithLeviathanShader = 30;
|
||||
}
|
||||
}
|
||||
public override void UpdateVanity(Player player)
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
player.Calamity().monolithLeviathanShader = 30;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 660 B |
@@ -0,0 +1,52 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Rarities;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using CalamityMod.Tiles.Furniture.Monoliths;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Items.Placeables.Furniture.Monoliths
|
||||
{
|
||||
public class DraconicIncense : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Placeables";
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 24;
|
||||
Item.height = 28;
|
||||
Item.maxStack = 9999;
|
||||
Item.useTurn = true;
|
||||
Item.autoReuse = true;
|
||||
Item.useAnimation = 15;
|
||||
Item.useTime = 10;
|
||||
Item.useStyle = ItemUseStyleID.Swing;
|
||||
Item.consumable = true;
|
||||
Item.createTile = ModContent.TileType<DraconicIncenseTile>();
|
||||
Item.rare = ModContent.RarityType<Violet>();
|
||||
Item.accessory = true;
|
||||
Item.vanity = true;
|
||||
}
|
||||
|
||||
public override void UpdateEquip(Player player)
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
player.Calamity().monolithYharonShader = 30;
|
||||
}
|
||||
}
|
||||
public override void UpdateVanity(Player player)
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
player.Calamity().monolithYharonShader = 30;
|
||||
}
|
||||
}
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<YharonSoulFragment>(15).
|
||||
AddTile<CosmicAnvil>().
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 647 B |
@@ -0,0 +1,52 @@
|
||||
using CalamityMod.Items.Placeables.FurnitureExo;
|
||||
using CalamityMod.Rarities;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using CalamityMod.Tiles.Furniture.Monoliths;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Items.Placeables.Furniture.Monoliths
|
||||
{
|
||||
public class ExoObelisk : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Placeables";
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 24;
|
||||
Item.height = 28;
|
||||
Item.maxStack = 9999;
|
||||
Item.useTurn = true;
|
||||
Item.autoReuse = true;
|
||||
Item.useAnimation = 15;
|
||||
Item.useTime = 10;
|
||||
Item.useStyle = ItemUseStyleID.Swing;
|
||||
Item.consumable = true;
|
||||
Item.createTile = ModContent.TileType<ExoObeliskTile>();
|
||||
Item.rare = ModContent.RarityType<Violet>();
|
||||
Item.accessory = true;
|
||||
Item.vanity = true;
|
||||
}
|
||||
|
||||
public override void UpdateEquip(Player player)
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
player.Calamity().monolithExoShader = 30;
|
||||
}
|
||||
}
|
||||
public override void UpdateVanity(Player player)
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
player.Calamity().monolithExoShader = 30;
|
||||
}
|
||||
}
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<ExoPlating>(15).
|
||||
AddTile<DraedonsForge>().
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 603 B |
@@ -0,0 +1,42 @@
|
||||
using CalamityMod.Tiles.Furniture.Monoliths;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Items.Placeables.Furniture.Monoliths
|
||||
{
|
||||
public class FrigidMonolith : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Placeables";
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 24;
|
||||
Item.height = 28;
|
||||
Item.maxStack = 9999;
|
||||
Item.useTurn = true;
|
||||
Item.autoReuse = true;
|
||||
Item.useAnimation = 15;
|
||||
Item.useTime = 10;
|
||||
Item.useStyle = ItemUseStyleID.Swing;
|
||||
Item.consumable = true;
|
||||
Item.createTile = ModContent.TileType<FrigidMonolithTile>();
|
||||
Item.rare = ItemRarityID.Pink;
|
||||
Item.accessory = true;
|
||||
Item.vanity = true;
|
||||
}
|
||||
|
||||
public override void UpdateEquip(Player player)
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
player.Calamity().monolithCryogenShader = 30;
|
||||
}
|
||||
}
|
||||
public override void UpdateVanity(Player player)
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
player.Calamity().monolithCryogenShader = 30;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 589 B |
@@ -0,0 +1,52 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Rarities;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using CalamityMod.Tiles.Furniture.Monoliths;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Items.Placeables.Furniture.Monoliths
|
||||
{
|
||||
public class PlagueHumidifier : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Placeables";
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 24;
|
||||
Item.height = 28;
|
||||
Item.maxStack = 9999;
|
||||
Item.useTurn = true;
|
||||
Item.autoReuse = true;
|
||||
Item.useAnimation = 15;
|
||||
Item.useTime = 10;
|
||||
Item.useStyle = ItemUseStyleID.Swing;
|
||||
Item.consumable = true;
|
||||
Item.createTile = ModContent.TileType<PlagueHumidifierTile>();
|
||||
Item.rare = ItemRarityID.Yellow;
|
||||
Item.accessory = true;
|
||||
Item.vanity = true;
|
||||
}
|
||||
|
||||
public override void UpdateEquip(Player player)
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
player.Calamity().monolithPlagueShader = 30;
|
||||
}
|
||||
}
|
||||
public override void UpdateVanity(Player player)
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
player.Calamity().monolithPlagueShader = 30;
|
||||
}
|
||||
}
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<InfectedArmorPlating>(15).
|
||||
AddTile(TileID.MythrilAnvil).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 727 B |
@@ -0,0 +1,52 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Rarities;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using CalamityMod.Tiles.Furniture.Monoliths;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Items.Placeables.Furniture.Monoliths
|
||||
{
|
||||
public class PurpleDistortedMonolith : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Placeables";
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 24;
|
||||
Item.height = 28;
|
||||
Item.maxStack = 9999;
|
||||
Item.useTurn = true;
|
||||
Item.autoReuse = true;
|
||||
Item.useAnimation = 15;
|
||||
Item.useTime = 10;
|
||||
Item.useStyle = ItemUseStyleID.Swing;
|
||||
Item.consumable = true;
|
||||
Item.createTile = ModContent.TileType<PurpleDistortedMonolithTile>();
|
||||
Item.rare = ModContent.RarityType<DarkBlue>();
|
||||
Item.accessory = true;
|
||||
Item.vanity = true;
|
||||
}
|
||||
|
||||
public override void UpdateEquip(Player player)
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
player.Calamity().monolithDevourerPShader = 30;
|
||||
}
|
||||
}
|
||||
public override void UpdateVanity(Player player)
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
player.Calamity().monolithDevourerPShader = 30;
|
||||
}
|
||||
}
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<CosmiliteBar>(15).
|
||||
AddTile<CosmicAnvil>().
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 391 B |
@@ -1,6 +1,7 @@
|
||||
using CalamityMod.Rarities;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using CalamityMod.Tiles.FurnitureSacrilegious;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Items.Placeables.FurnitureSacrilegious
|
||||
@@ -20,7 +21,23 @@ namespace CalamityMod.Items.Placeables.FurnitureSacrilegious
|
||||
Item.useStyle = ItemUseStyleID.Swing;
|
||||
Item.consumable = true;
|
||||
Item.createTile = ModContent.TileType<MonolithOfTheAccursedTile>();
|
||||
Item.rare = ModContent.RarityType<Violet>();
|
||||
Item.rare = ModContent.RarityType<Violet>();
|
||||
Item.accessory = true;
|
||||
Item.vanity = true;
|
||||
}
|
||||
public override void UpdateEquip(Player player)
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
player.Calamity().monolithAccursedShader = 30;
|
||||
}
|
||||
}
|
||||
public override void UpdateVanity(Player player)
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
player.Calamity().monolithAccursedShader = 30;
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.Tiles;
|
||||
using CalamityMod.Items.Placeables.Furniture.Monoliths;
|
||||
using CalamityMod.Tiles;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -11,6 +12,7 @@ namespace CalamityMod.Items
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 0;
|
||||
ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType<BossRushMonolith>();
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Armor.Vanity;
|
||||
using CalamityMod.Items.Placeables.Furniture.DevPaintings;
|
||||
using CalamityMod.Items.Placeables.Furniture.Monoliths;
|
||||
using CalamityMod.Items.Weapons.Magic;
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.Items.Weapons.Ranged;
|
||||
@@ -81,6 +82,7 @@ namespace CalamityMod.Items.TreasureBags
|
||||
// Vanity
|
||||
itemLoot.Add(ModContent.ItemType<AnahitaMask>(), 7);
|
||||
itemLoot.Add(ModContent.ItemType<LeviathanMask>(), 7);
|
||||
itemLoot.Add(ModContent.ItemType<DeepSeaAnchor>(), 15);
|
||||
itemLoot.Add(ModContent.ItemType<ThankYouPainting>(), ThankYouPainting.DropInt);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -666,6 +666,51 @@ LanternCenter: {
|
||||
Tooltip: Lights up the night sky with celebratory lanterns
|
||||
}
|
||||
|
||||
AstralProjector: {
|
||||
DisplayName: Astral Projector
|
||||
Tooltip: "'Control a small portion of the Astral Infection's influence.'"
|
||||
}
|
||||
|
||||
BlueDistortedMonolith: {
|
||||
DisplayName: Blue Distorted Monolith
|
||||
Tooltip: "'Create a localized rupture in the fabric of reality.'"
|
||||
}
|
||||
|
||||
BossRushMonolith: {
|
||||
DisplayName: Boss Rush Monolith
|
||||
Tooltip: "'Bring forth the end.'"
|
||||
}
|
||||
|
||||
DeepSeaAnchor: {
|
||||
DisplayName: Deep Sea Anchor
|
||||
Tooltip: "'Dampen the air with heavy amounts of brine.'"
|
||||
}
|
||||
|
||||
DraconicIncense: {
|
||||
DisplayName: Draconic Incense
|
||||
Tooltip: "'Ignite the air with dragonfire.'"
|
||||
}
|
||||
|
||||
ExoObelisk: {
|
||||
DisplayName: Exo Obelisk
|
||||
Tooltip: "'Energize the atmosphere with exo energy.'"
|
||||
}
|
||||
|
||||
FrigidMonolith: {
|
||||
DisplayName: Frigid Monolith
|
||||
Tooltip: "'Enchant the sky with frosty auroras.'"
|
||||
}
|
||||
|
||||
PlagueHumidifier: {
|
||||
DisplayName: Plague Humidifier
|
||||
Tooltip: "'Spread light amounts of the plague through the air.'"
|
||||
}
|
||||
|
||||
PurpleDistortedMonolith: {
|
||||
DisplayName: Purple Distorted Monolith
|
||||
Tooltip: "'Create a localized rupture in the fabric of reality.'"
|
||||
}
|
||||
|
||||
NavyPrismTorch: {
|
||||
DisplayName: Navy Prism Torch
|
||||
Tooltip: Can be placed in water
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace CalamityMod.NPCs.DevourerofGods
|
||||
if (DoGIndex == -1)
|
||||
{
|
||||
UpdateDoGIndex();
|
||||
if (DoGIndex == -1)
|
||||
if (DoGIndex == -1 && Main.LocalPlayer.Calamity().monolithDevourerPShader <= 0 && Main.LocalPlayer.Calamity().monolithDevourerBShader <= 0)
|
||||
Filters.Scene["CalamityMod:DevourerofGodsHead"].Deactivate();
|
||||
}
|
||||
}
|
||||
@@ -50,6 +50,10 @@ namespace CalamityMod.NPCs.DevourerofGods
|
||||
{
|
||||
UseTargetPosition(Main.npc[DoGIndex].Center);
|
||||
}
|
||||
else if (Main.LocalPlayer.Calamity().monolithDevourerPShader > 0 || Main.LocalPlayer.Calamity().monolithDevourerBShader > 0)
|
||||
{
|
||||
UseTargetPosition(Main.LocalPlayer.Center);
|
||||
}
|
||||
base.Apply();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace CalamityMod.NPCs.DevourerofGods
|
||||
if (DoGIndex == -1)
|
||||
{
|
||||
UpdateDoGIndex();
|
||||
if (DoGIndex == -1)
|
||||
if (DoGIndex == -1 && Main.LocalPlayer.Calamity().monolithDevourerBShader <= 0 && Main.LocalPlayer.Calamity().monolithDevourerPShader <= 0)
|
||||
isActive = false;
|
||||
}
|
||||
|
||||
@@ -75,29 +75,47 @@ namespace CalamityMod.NPCs.DevourerofGods
|
||||
|
||||
public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth)
|
||||
{
|
||||
if (maxDepth >= 0 && minDepth < 0 && DoGIndex != -1)
|
||||
if (maxDepth >= 0 && minDepth < 0)
|
||||
{
|
||||
if (Main.npc[DoGIndex].active)
|
||||
if (DoGIndex != -1)
|
||||
{
|
||||
float intensity = GetIntensity();
|
||||
float lifeRatio = Main.npc[DoGIndex].life / (float)Main.npc[DoGIndex].lifeMax;
|
||||
double blackScreenLife_GateValue = (lifeRatio < 0.6f && Main.npc[DoGIndex].localAI[2] <= 2f) ? 0.15 : 0.75;
|
||||
|
||||
float timeToReachNextColor = DevourerofGodsHead.SkyColorTransitionTime;
|
||||
float phaseTimer = Main.npc[DoGIndex].Calamity().newAI[2];
|
||||
float colorChangeProgress = phaseTimer / timeToReachNextColor;
|
||||
if (colorChangeProgress > 1f)
|
||||
colorChangeProgress = 1f;
|
||||
|
||||
bool death = CalamityWorld.death || BossRushEvent.BossRushActive;
|
||||
Color regularSkyColor = (Main.npc[DoGIndex].ai[3] == 0f ? Color.Lerp(Color.Fuchsia, Color.Cyan, colorChangeProgress) : Color.Lerp(Color.Cyan, Color.Fuchsia, colorChangeProgress)) * intensity;
|
||||
if (Main.npc[DoGIndex].life < Main.npc[DoGIndex].lifeMax * blackScreenLife_GateValue || death || Main.npc[DoGIndex].localAI[3] > 0f)
|
||||
if (Main.npc[DoGIndex].active)
|
||||
{
|
||||
float blackSkyTransitionProgress = death ? 1f : Main.npc[DoGIndex].localAI[3] / timeToReachNextColor;
|
||||
spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle(0, 0, Main.screenWidth * 2, Main.screenHeight * 2), Color.Lerp(regularSkyColor, Color.Black * (intensity + 0.5f), blackSkyTransitionProgress));
|
||||
float intensity = GetIntensity();
|
||||
float lifeRatio = Main.npc[DoGIndex].life / (float)Main.npc[DoGIndex].lifeMax;
|
||||
double blackScreenLife_GateValue = (lifeRatio < 0.6f && Main.npc[DoGIndex].localAI[2] <= 2f) ? 0.15 : 0.75;
|
||||
|
||||
float timeToReachNextColor = DevourerofGodsHead.SkyColorTransitionTime;
|
||||
float phaseTimer = Main.npc[DoGIndex].Calamity().newAI[2];
|
||||
float colorChangeProgress = phaseTimer / timeToReachNextColor;
|
||||
if (colorChangeProgress > 1f)
|
||||
colorChangeProgress = 1f;
|
||||
|
||||
bool death = CalamityWorld.death || BossRushEvent.BossRushActive;
|
||||
Color regularSkyColor = (Main.npc[DoGIndex].ai[3] == 0f ? Color.Lerp(Color.Fuchsia, Color.Cyan, colorChangeProgress) : Color.Lerp(Color.Cyan, Color.Fuchsia, colorChangeProgress)) * intensity;
|
||||
if (Main.npc[DoGIndex].life < Main.npc[DoGIndex].lifeMax * blackScreenLife_GateValue || death || Main.npc[DoGIndex].localAI[3] > 0f)
|
||||
{
|
||||
float blackSkyTransitionProgress = death ? 1f : Main.npc[DoGIndex].localAI[3] / timeToReachNextColor;
|
||||
spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle(0, 0, Main.screenWidth * 2, Main.screenHeight * 2), Color.Lerp(regularSkyColor, Color.Black * (intensity + 0.5f), blackSkyTransitionProgress));
|
||||
}
|
||||
else
|
||||
spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle(0, 0, Main.screenWidth * 2, Main.screenHeight * 2), regularSkyColor);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Main.LocalPlayer.Calamity().monolithDevourerBShader > 0)
|
||||
{
|
||||
float intensity = MathHelper.Min(MathHelper.Lerp(0, 0.5f, (float)Main.LocalPlayer.Calamity().monolithDevourerBShader / 15), 0.45f);
|
||||
Color regularSkyColor = Color.Cyan;
|
||||
spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle(0, 0, Main.screenWidth * 2, Main.screenHeight * 2), regularSkyColor * intensity);
|
||||
}
|
||||
if (Main.LocalPlayer.Calamity().monolithDevourerPShader > 0)
|
||||
{
|
||||
float intensity = MathHelper.Min(MathHelper.Lerp(0, 0.5f, (float)Main.LocalPlayer.Calamity().monolithDevourerPShader / 15), 0.45f);
|
||||
Color regularSkyColor = Color.Fuchsia;
|
||||
spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle(0, 0, Main.screenWidth * 2, Main.screenHeight * 2), regularSkyColor * intensity);
|
||||
}
|
||||
else
|
||||
spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle(0, 0, Main.screenWidth * 2, Main.screenHeight * 2), regularSkyColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace CalamityMod.NPCs.Leviathan
|
||||
|
||||
public override void Update(GameTime gameTime)
|
||||
{
|
||||
if (LevIndex == -1 || BossRushEvent.BossRushActive)
|
||||
if ((LevIndex == -1 && Main.LocalPlayer.Calamity().monolithLeviathanShader <= 0) || BossRushEvent.BossRushActive)
|
||||
{
|
||||
UpdateLIndex();
|
||||
if (LevIndex == -1 || BossRushEvent.BossRushActive)
|
||||
@@ -51,6 +51,10 @@ namespace CalamityMod.NPCs.Leviathan
|
||||
{
|
||||
UseTargetPosition(Main.npc[LevIndex].Center);
|
||||
}
|
||||
if (Main.LocalPlayer.Calamity().monolithLeviathanShader > 0)
|
||||
{
|
||||
UseTargetPosition(Main.LocalPlayer.Center);
|
||||
}
|
||||
base.Apply();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,10 +16,10 @@ namespace CalamityMod.NPCs.Leviathan
|
||||
|
||||
public override void Update(GameTime gameTime)
|
||||
{
|
||||
if (LevIndex == -1 || BossRushEvent.BossRushActive)
|
||||
if ((LevIndex == -1 && Main.LocalPlayer.Calamity().monolithLeviathanShader <= 0) || BossRushEvent.BossRushActive)
|
||||
{
|
||||
UpdateLIndex();
|
||||
if (LevIndex == -1 || BossRushEvent.BossRushActive)
|
||||
if ((LevIndex == -1 && Main.LocalPlayer.Calamity().monolithLeviathanShader <= 0) || BossRushEvent.BossRushActive)
|
||||
isActive = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ using CalamityMod.Items.Armor.Vanity;
|
||||
using CalamityMod.Items.LoreItems;
|
||||
using CalamityMod.Items.Placeables.Furniture.BossRelics;
|
||||
using CalamityMod.Items.Placeables.Furniture.DevPaintings;
|
||||
using CalamityMod.Items.Placeables.Furniture.Monoliths;
|
||||
using CalamityMod.Items.Placeables.Furniture.Trophies;
|
||||
using CalamityMod.Items.TreasureBags;
|
||||
using CalamityMod.Items.Weapons.Magic;
|
||||
@@ -872,6 +873,7 @@ namespace CalamityMod.NPCs.Leviathan
|
||||
// Vanity
|
||||
normalOnly.Add(ModContent.ItemType<LeviathanMask>(), 7);
|
||||
normalOnly.Add(ModContent.ItemType<AnahitaMask>(), 7);
|
||||
normalOnly.Add(ModContent.ItemType<DeepSeaAnchor>(), 15);
|
||||
normalOnly.Add(ModContent.ItemType<ThankYouPainting>(), ThankYouPainting.DropInt);
|
||||
|
||||
// Equipment
|
||||
|
||||
@@ -35,10 +35,10 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
|
||||
|
||||
public override void Update(GameTime gameTime)
|
||||
{
|
||||
if (PbGIndex == -1)
|
||||
if (PbGIndex == -1 && Main.LocalPlayer.Calamity().monolithPlagueShader <= 0)
|
||||
{
|
||||
UpdatePbGIndex();
|
||||
if (PbGIndex == -1)
|
||||
if (PbGIndex == -1 && Main.LocalPlayer.Calamity().monolithPlagueShader <= 0)
|
||||
Filters.Scene["CalamityMod:PlaguebringerGoliath"].Deactivate();
|
||||
}
|
||||
}
|
||||
@@ -50,6 +50,10 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
|
||||
{
|
||||
UseTargetPosition(Main.npc[PbGIndex].Center);
|
||||
}
|
||||
if (Main.LocalPlayer.Calamity().monolithPlagueShader > 0)
|
||||
{
|
||||
UseTargetPosition(Main.LocalPlayer.Center);
|
||||
}
|
||||
base.Apply();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,10 +16,10 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
|
||||
|
||||
public override void Update(GameTime gameTime)
|
||||
{
|
||||
if (PbGIndex == -1 || BossRushEvent.BossRushActive)
|
||||
if ((PbGIndex == -1 && Main.LocalPlayer.Calamity().monolithPlagueShader <= 0) || BossRushEvent.BossRushActive)
|
||||
{
|
||||
UpdatePbGIndex();
|
||||
if (PbGIndex == -1 || BossRushEvent.BossRushActive)
|
||||
if ((PbGIndex == -1 && Main.LocalPlayer.Calamity().monolithPlagueShader <= 0) || BossRushEvent.BossRushActive)
|
||||
isActive = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Accessories.Vanity;
|
||||
using CalamityMod.Items.Ammo;
|
||||
using CalamityMod.Items.Placeables.Furniture.Monoliths;
|
||||
using CalamityMod.Items.Potions;
|
||||
using CalamityMod.Items.Weapons.Magic;
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
@@ -157,6 +158,7 @@ namespace CalamityMod.NPCs.TownNPCs
|
||||
.Add(ItemID.SuperManaPotion)
|
||||
.Add(ModContent.ItemType<DeliciousMeat>())
|
||||
.AddWithCustomValue(ModContent.ItemType<Popo>(), Item.buyPrice(5))
|
||||
.AddWithCustomValue(ModContent.ItemType<FrigidMonolith>(), Item.buyPrice(5))
|
||||
.Add(ModContent.ItemType<BloodRune>(), Condition.PlayerCarriesItem(ModContent.ItemType<IceBarrage>()))
|
||||
.Add(ItemID.IceCream, Condition.HappyEnough, Condition.InSnow)
|
||||
.Register();
|
||||
|
||||
@@ -36,10 +36,10 @@ namespace CalamityMod.NPCs.Yharon
|
||||
|
||||
public override void Update(GameTime gameTime)
|
||||
{
|
||||
if (YIndex == -1 || BossRushEvent.BossRushActive)
|
||||
if ((YIndex == -1 && Main.LocalPlayer.Calamity().monolithYharonShader <= 0) || BossRushEvent.BossRushActive)
|
||||
{
|
||||
UpdateYIndex();
|
||||
if (YIndex == -1 || BossRushEvent.BossRushActive)
|
||||
if ((YIndex == -1 && Main.LocalPlayer.Calamity().monolithYharonShader <= 0) || BossRushEvent.BossRushActive)
|
||||
Filters.Scene["CalamityMod:Yharon"].Deactivate();
|
||||
}
|
||||
}
|
||||
@@ -51,6 +51,10 @@ namespace CalamityMod.NPCs.Yharon
|
||||
{
|
||||
UseTargetPosition(Main.npc[YIndex].Center);
|
||||
}
|
||||
if (Main.LocalPlayer.Calamity().monolithYharonShader > 0)
|
||||
{
|
||||
UseTargetPosition(Main.LocalPlayer.Center);
|
||||
}
|
||||
base.Apply();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,10 +16,10 @@ namespace CalamityMod.NPCs.Yharon
|
||||
|
||||
public override void Update(GameTime gameTime)
|
||||
{
|
||||
if (YIndex == -1 || BossRushEvent.BossRushActive)
|
||||
if ((YIndex == -1 && Main.LocalPlayer.Calamity().monolithYharonShader <= 0) || BossRushEvent.BossRushActive)
|
||||
{
|
||||
UpdateYIndex();
|
||||
if (YIndex == -1 || BossRushEvent.BossRushActive)
|
||||
if ((YIndex == -1 && Main.LocalPlayer.Calamity().monolithYharonShader <= 0) || BossRushEvent.BossRushActive)
|
||||
isActive = false;
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace CalamityMod.NPCs.Yharon
|
||||
private bool UpdateYIndex()
|
||||
{
|
||||
int YType = ModContent.NPCType<Yharon>();
|
||||
if (YIndex >= 0 && Main.npc[YIndex].active && Main.npc[YIndex].type == YType)
|
||||
if ((YIndex >= 0 && Main.npc[YIndex].active && Main.npc[YIndex].type == YType) || Main.LocalPlayer.Calamity().monolithYharonShader > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
|
||||
namespace CalamityMod.Particles
|
||||
{
|
||||
public class PlagueHumidifierMist : Particle
|
||||
{
|
||||
public override bool SetLifetime => true;
|
||||
public override int FrameVariants => 7;
|
||||
|
||||
public override string Texture => "CalamityMod/Particles/PlagueHumidifierMist";
|
||||
|
||||
public PlagueHumidifierMist(Vector2 relativePosition, int lifetime, float scale, Vector2 speed)
|
||||
{
|
||||
Velocity = speed;
|
||||
Scale = scale;
|
||||
Variant = Main.rand.Next(7);
|
||||
Lifetime = lifetime;
|
||||
Position = relativePosition;
|
||||
}
|
||||
|
||||
public override void Update()
|
||||
{
|
||||
Color = Color.Lerp(Lighting.GetColor((Position / 16).ToPoint()), Color.Transparent, LifetimeCompletion);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@@ -13,7 +13,7 @@ namespace CalamityMod.Systems
|
||||
public override bool IsSceneEffectActive(Player player)
|
||||
{
|
||||
CryogenSky.UpdateDrawEligibility();
|
||||
bool result = NPC.AnyNPCs(ModContent.NPCType<Cryogen>()) || CryogenSky.ShouldDrawRegularly;
|
||||
bool result = NPC.AnyNPCs(ModContent.NPCType<Cryogen>()) || CryogenSky.ShouldDrawRegularly || Main.LocalPlayer.Calamity().monolithCryogenShader > 0;
|
||||
CryogenSky.UpdateDrawEligibility();
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace CalamityMod.Systems
|
||||
{
|
||||
public override SceneEffectPriority Priority => SceneEffectPriority.BossHigh;
|
||||
|
||||
public override bool IsSceneEffectActive(Player player) => ExoMechsSky.CanSkyBeActive;
|
||||
public override bool IsSceneEffectActive(Player player) => ExoMechsSky.CanSkyBeActive || player.Calamity().monolithExoShader > 0;
|
||||
|
||||
public override void SpecialVisuals(Player player, bool isActive)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace CalamityMod.Systems
|
||||
{
|
||||
public override SceneEffectPriority Priority => SceneEffectPriority.BossMedium;
|
||||
|
||||
public override bool IsSceneEffectActive(Player player) => Main.zenithWorld ? NPC.AnyNPCs(ModContent.NPCType<Anahita>()) : NPC.AnyNPCs(ModContent.NPCType<Leviathan>());
|
||||
public override bool IsSceneEffectActive(Player player) => (Main.zenithWorld ? NPC.AnyNPCs(ModContent.NPCType<Anahita>()) : NPC.AnyNPCs(ModContent.NPCType<Leviathan>())) || Main.LocalPlayer.Calamity().monolithLeviathanShader > 0;
|
||||
|
||||
public override void SpecialVisuals(Player player, bool isActive)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace CalamityMod.Systems
|
||||
{
|
||||
public override SceneEffectPriority Priority => SceneEffectPriority.BossMedium;
|
||||
|
||||
public override bool IsSceneEffectActive(Player player) => NPC.AnyNPCs(ModContent.NPCType<PlaguebringerGoliath>());
|
||||
public override bool IsSceneEffectActive(Player player) => NPC.AnyNPCs(ModContent.NPCType<PlaguebringerGoliath>()) || Main.LocalPlayer.Calamity().monolithPlagueShader > 0;
|
||||
|
||||
public override void SpecialVisuals(Player player, bool isActive)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace CalamityMod.Systems
|
||||
{
|
||||
public override SceneEffectPriority Priority => SceneEffectPriority.BossHigh;
|
||||
|
||||
public override bool IsSceneEffectActive(Player player) => NPC.AnyNPCs(ModContent.NPCType<Yharon>());
|
||||
public override bool IsSceneEffectActive(Player player) => NPC.AnyNPCs(ModContent.NPCType<Yharon>()) || Main.LocalPlayer.Calamity().monolithYharonShader > 0;
|
||||
|
||||
public override void SpecialVisuals(Player player, bool isActive)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Systems
|
||||
{
|
||||
public class AstralMonolithScene : ModSceneEffect
|
||||
{
|
||||
public override SceneEffectPriority Priority => SceneEffectPriority.Environment;
|
||||
|
||||
public override bool IsSceneEffectActive(Player player) => Main.LocalPlayer.Calamity().monolithAstralShader > 0;
|
||||
|
||||
public override void SpecialVisuals(Player player, bool isActive)
|
||||
{
|
||||
player.ManageSpecialBiomeVisuals("CalamityMod:Astral", isActive);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Systems
|
||||
{
|
||||
public class MonolithDistortionScene : ModSceneEffect
|
||||
{
|
||||
public override SceneEffectPriority Priority => SceneEffectPriority.Environment;
|
||||
|
||||
public override bool IsSceneEffectActive(Player player) => Main.LocalPlayer.Calamity().monolithDevourerBShader > 0 || Main.LocalPlayer.Calamity().monolithDevourerPShader > 0;
|
||||
|
||||
public override void SpecialVisuals(Player player, bool isActive)
|
||||
{
|
||||
player.ManageSpecialBiomeVisuals("CalamityMod:DevourerofGodsHead", isActive);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.Graphics.Effects;
|
||||
using Terraria.Graphics.Shaders;
|
||||
|
||||
namespace CalamityMod.Skies
|
||||
{
|
||||
public class AstralMonolithScreenShaderData : ScreenShaderData
|
||||
{
|
||||
public AstralMonolithScreenShaderData(string passName)
|
||||
: base(passName)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Apply()
|
||||
{
|
||||
Vector3 vec = Main.ColorOfTheSkies.ToVector3();
|
||||
vec *= 0.4f;
|
||||
base.UseOpacity(Math.Max(vec.X, Math.Max(vec.Y, vec.Z)));
|
||||
base.Apply();
|
||||
}
|
||||
|
||||
public override void Update(GameTime gameTime)
|
||||
{
|
||||
if (Main.LocalPlayer.Calamity().monolithAstralShader <= 0)
|
||||
Filters.Scene["CalamityMod:MonolithAstral"].Deactivate(Array.Empty<object>());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.Graphics.Effects;
|
||||
using Terraria.ID;
|
||||
|
||||
namespace CalamityMod.Skies
|
||||
{
|
||||
public class AstralMonolithSky : CustomSky
|
||||
{
|
||||
private bool skyActive;
|
||||
private float opacity;
|
||||
|
||||
public override void Deactivate(params object[] args) => skyActive = false;
|
||||
|
||||
public override void Reset() => skyActive = false;
|
||||
|
||||
public override bool IsActive() => skyActive || opacity > 0f;
|
||||
|
||||
public override void Activate(Vector2 position, params object[] args) => skyActive = true;
|
||||
|
||||
public override void Update(GameTime gameTime)
|
||||
{
|
||||
if (Main.LocalPlayer.Calamity().monolithAstralShader < 1)
|
||||
skyActive = false;
|
||||
|
||||
if (skyActive && opacity < 1f)
|
||||
opacity += 0.02f;
|
||||
else if (!skyActive && opacity > 0f)
|
||||
opacity -= 0.02f;
|
||||
|
||||
Opacity = opacity;
|
||||
}
|
||||
|
||||
public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth)
|
||||
{
|
||||
if (Main.LocalPlayer.Calamity().monolithAstralShader <= 0)
|
||||
return;
|
||||
float whateverTheFuckThisVariableIsSupposedToBe = 3.40282347E+38f;
|
||||
if (maxDepth >= whateverTheFuckThisVariableIsSupposedToBe && minDepth < whateverTheFuckThisVariableIsSupposedToBe)
|
||||
{
|
||||
spriteBatch.Draw(CalamityMod.AstralSky, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.White * opacity);
|
||||
|
||||
// Terraria's conditions.
|
||||
if (Main.netMode != NetmodeID.Server)
|
||||
{
|
||||
int bgTop = (int)((-Main.screenPosition.Y) / (Main.worldSurface * 16.0 - 600.0) * 200.0);
|
||||
float colorMult = 0.952f * opacity;
|
||||
Color astralcyan = new Color(100, 183, 255);
|
||||
Color purple = new Color(201, 148, 255);
|
||||
Color yellow = new Color(255, 146, 73);
|
||||
float width1 = Main.screenWidth / 500f;
|
||||
float height1 = Main.screenHeight / 600f;
|
||||
float width2 = Main.screenWidth / 600f;
|
||||
float height2 = Main.screenHeight / 800f;
|
||||
float width3 = Main.screenWidth / 200f;
|
||||
float height3 = Main.screenHeight / 900f;
|
||||
float width4 = Main.screenWidth / 1000f;
|
||||
float height4 = Main.screenHeight / 200f;
|
||||
for (int i = 0; i < Main.star.Length; i++)
|
||||
{
|
||||
Star star = Main.star[i];
|
||||
if (star == null)
|
||||
continue;
|
||||
|
||||
Texture2D t2D = TextureAssets.Star[star.type].Value;
|
||||
Vector2 origin = new Vector2(t2D.Width * 0.5f, t2D.Height * 0.5f);
|
||||
float posX = star.position.X * width1;
|
||||
float posY = star.position.Y * height1;
|
||||
Vector2 position = new Vector2(posX + origin.X, posY + origin.Y + bgTop);
|
||||
spriteBatch.Draw(t2D, position, new Rectangle(0, 0, t2D.Width, t2D.Height), astralcyan * star.twinkle * colorMult, star.rotation, origin, (star.scale * star.twinkle) - 0.2f, SpriteEffects.None, 0f);
|
||||
|
||||
origin = new Vector2(t2D.Width * 0.2f, t2D.Height * 0.2f);
|
||||
posX = star.position.X * width2;
|
||||
posY = star.position.Y * height2;
|
||||
position = new Vector2(posX + origin.X, posY + origin.Y + bgTop);
|
||||
spriteBatch.Draw(t2D, position, new Rectangle(0, 0, t2D.Width, t2D.Height), purple * star.twinkle * colorMult, star.rotation, origin, (star.scale * star.twinkle) + 0.2f, SpriteEffects.None, 0f);
|
||||
|
||||
origin = new Vector2(t2D.Width * 0.8f, t2D.Height * 0.8f);
|
||||
posX = star.position.X * width3;
|
||||
posY = star.position.Y * height3;
|
||||
position = new Vector2(posX + origin.X, posY + origin.Y + bgTop);
|
||||
spriteBatch.Draw(t2D, position, new Rectangle(0, 0, t2D.Width, t2D.Height), yellow * star.twinkle * colorMult, star.rotation, origin, star.scale * star.twinkle, SpriteEffects.None, 0f);
|
||||
|
||||
origin = new Vector2(t2D.Width * 0.5f, t2D.Height * 0.5f);
|
||||
posX = star.position.X * width4;
|
||||
posY = star.position.Y * height4;
|
||||
position = new Vector2(posX + origin.X, posY + origin.Y + bgTop);
|
||||
spriteBatch.Draw(t2D, position, new Rectangle(0, 0, t2D.Width, t2D.Height), Color.White * star.twinkle * colorMult, star.rotation, origin, star.scale * star.twinkle, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override Color OnTileColor(Color inColor)
|
||||
{
|
||||
return Color.Lerp(inColor, new Color(63, 51, 90, inColor.A), opacity);
|
||||
}
|
||||
|
||||
public override float GetCloudAlpha() => (1f - opacity) * 0.3f + 0.7f;
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@ namespace CalamityMod.Skies
|
||||
|
||||
public override void Update(GameTime gameTime)
|
||||
{
|
||||
if (!Main.LocalPlayer.Calamity().ZoneAstral || Main.gameMenu)
|
||||
if ((!Main.LocalPlayer.Calamity().ZoneAstral && Main.LocalPlayer.Calamity().monolithAstralShader <= 0) || Main.gameMenu)
|
||||
Filters.Scene["CalamityMod:Astral"].Deactivate(Array.Empty<object>());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace CalamityMod.Skies
|
||||
|
||||
public override void Deactivate(params object[] args)
|
||||
{
|
||||
skyActive = Main.LocalPlayer.Calamity().ZoneAstral && !Main.LocalPlayer.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950;
|
||||
skyActive = (Main.LocalPlayer.Calamity().ZoneAstral && !Main.LocalPlayer.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950) || Main.LocalPlayer.Calamity().monolithAstralShader > 0;
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
@@ -110,13 +110,15 @@ namespace CalamityMod.Skies
|
||||
|
||||
public override void Update(GameTime gameTime)
|
||||
{
|
||||
if (!Main.LocalPlayer.Calamity().ZoneAstral || Main.gameMenu)
|
||||
if ((!Main.LocalPlayer.Calamity().ZoneAstral && Main.LocalPlayer.Calamity().monolithAstralShader <= 0) || Main.gameMenu)
|
||||
skyActive = false;
|
||||
|
||||
if (skyActive && opacity < 1f)
|
||||
opacity += 0.02f;
|
||||
else if (!skyActive && opacity > 0f)
|
||||
opacity -= 0.02f;
|
||||
|
||||
Opacity = opacity;
|
||||
}
|
||||
|
||||
public override float GetCloudAlpha()
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace CalamityMod.Skies
|
||||
|
||||
public static bool DetermineDrawEligibility()
|
||||
{
|
||||
bool useEffect = ((BossRushEvent.BossRushActive && BossRushEvent.StartTimer > 100) || ShouldDrawRegularly) && !Main.gameMenu;
|
||||
bool useEffect = ((BossRushEvent.BossRushActive && BossRushEvent.StartTimer > 100) || ShouldDrawRegularly || Main.LocalPlayer?.Calamity()?.monolithBossRushShader > 0) && !Main.gameMenu;
|
||||
|
||||
if (SkyManager.Instance["CalamityMod:BossRush"] != null && useEffect != SkyManager.Instance["CalamityMod:BossRush"].IsActive())
|
||||
{
|
||||
@@ -66,7 +66,7 @@ namespace CalamityMod.Skies
|
||||
|
||||
private float GetIntensity()
|
||||
{
|
||||
if (ShouldDrawRegularly)
|
||||
if (ShouldDrawRegularly || Main.LocalPlayer?.Calamity().monolithBossRushShader > 0)
|
||||
return 1f;
|
||||
|
||||
float fadeRatio = BossRushEvent.StartTimer / (float)BossRushEvent.StartEffectTotalTime;
|
||||
@@ -77,7 +77,7 @@ namespace CalamityMod.Skies
|
||||
|
||||
public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth)
|
||||
{
|
||||
if (GetIntensity() == 0f)
|
||||
if (GetIntensity() == 0f && Main.LocalPlayer?.Calamity()?.monolithBossRushShader <= 0)
|
||||
return;
|
||||
|
||||
if (maxDepth >= 0 && minDepth < 0 && GetIntensity() > 0f)
|
||||
@@ -103,7 +103,7 @@ namespace CalamityMod.Skies
|
||||
Main.spriteBatch.Begin();
|
||||
|
||||
// Draw the Xeroc eye at the back of the sky.
|
||||
if (maxDepth >= float.MaxValue && minDepth < float.MaxValue && (BossRushEvent.EndTimer < BossRushEvent.EndVisualEffectTime - 40f || ShouldDrawRegularly))
|
||||
if (maxDepth >= float.MaxValue && minDepth < float.MaxValue && (BossRushEvent.EndTimer < BossRushEvent.EndVisualEffectTime - 40f || ShouldDrawRegularly || Main.LocalPlayer?.Calamity()?.monolithBossRushShader > 0))
|
||||
{
|
||||
Vector2 screenCenter = Main.screenPosition + new Vector2(Main.screenWidth, Main.screenHeight) * 0.5f;
|
||||
screenCenter += new Vector2(Main.screenWidth, Main.screenHeight) * (Main.GameViewMatrix.Zoom - Vector2.One) * 0.5f;
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace CalamityMod.Skies
|
||||
|
||||
public static void UpdateDrawEligibility()
|
||||
{
|
||||
bool useEffect = (NPC.AnyNPCs(ModContent.NPCType<Cryogen>()) || ShouldDrawRegularly) && !Main.gameMenu;
|
||||
bool useEffect = (NPC.AnyNPCs(ModContent.NPCType<Cryogen>()) || ShouldDrawRegularly || Main.LocalPlayer.Calamity().monolithCryogenShader > 0) && !Main.gameMenu;
|
||||
|
||||
if (SkyManager.Instance["CalamityMod:Cryogen"] != null && useEffect != SkyManager.Instance["CalamityMod:Cryogen"].IsActive())
|
||||
{
|
||||
@@ -46,10 +46,17 @@ namespace CalamityMod.Skies
|
||||
|
||||
public override void Update(GameTime gameTime)
|
||||
{
|
||||
if (FadeInCountdown > 0)
|
||||
FadeInCountdown--;
|
||||
if (!ShouldDrawRegularly && Main.LocalPlayer.Calamity().monolithCryogenShader <= 0)
|
||||
{
|
||||
if (FadeInCountdown > 0)
|
||||
FadeInCountdown--;
|
||||
}
|
||||
else
|
||||
{
|
||||
FadeInCountdown = 1;
|
||||
}
|
||||
|
||||
if (CryogenIndex == -1 && !ShouldDrawRegularly)
|
||||
if (CryogenIndex == -1 && !ShouldDrawRegularly && Main.LocalPlayer.Calamity().monolithCryogenShader <= 0)
|
||||
{
|
||||
UpdateCryogenIndex();
|
||||
if (FadeoutTimer == 0)
|
||||
@@ -89,7 +96,7 @@ namespace CalamityMod.Skies
|
||||
|
||||
public float CalculateAuroraStrength()
|
||||
{
|
||||
if (ShouldDrawRegularly)
|
||||
if (ShouldDrawRegularly || Main.LocalPlayer.Calamity().monolithCryogenShader > 0)
|
||||
return 1f;
|
||||
|
||||
return 1f - GetCryogenLifeRatio();
|
||||
|
||||
@@ -19,13 +19,15 @@ namespace CalamityMod.Skies
|
||||
{
|
||||
if (CalamityGlobalNPC.draedon != -1 && Draedon.ExoMechIsPresent)
|
||||
UseTargetPosition(Main.npc[CalamityGlobalNPC.draedon].Center);
|
||||
if (Main.LocalPlayer.Calamity().monolithExoShader > 0)
|
||||
UseTargetPosition(Main.LocalPlayer.Center);
|
||||
|
||||
base.Apply();
|
||||
}
|
||||
|
||||
public override void Update(GameTime gameTime)
|
||||
{
|
||||
if (!ExoMechsSky.CanSkyBeActive)
|
||||
if (!ExoMechsSky.CanSkyBeActive && Main.LocalPlayer.Calamity().monolithExoShader <= 0)
|
||||
Filters.Scene["CalamityMod:ExoMechs"].Deactivate(Array.Empty<object>());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,8 +53,10 @@ namespace CalamityMod.Skies
|
||||
|
||||
if (CalamityGlobalNPC.draedonExoMechWorm != -1 && Main.npc[CalamityGlobalNPC.draedonExoMechWorm].active)
|
||||
combinedLifeRatio += Main.npc[CalamityGlobalNPC.draedonExoMechWorm].life / (float)Main.npc[CalamityGlobalNPC.draedonExoMechWorm].lifeMax;
|
||||
|
||||
return (float)Math.Pow(1f - combinedLifeRatio / 3f, 2D);
|
||||
if (combinedLifeRatio > 0)
|
||||
return (float)Math.Pow(1f - combinedLifeRatio / 3f, 2D);
|
||||
else
|
||||
return MathHelper.Lerp(1f, 0f, Main.LocalPlayer.Calamity().monolithExoShader / 30);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,7 +93,7 @@ namespace CalamityMod.Skies
|
||||
|
||||
public override void Update(GameTime gameTime)
|
||||
{
|
||||
if (!CanSkyBeActive)
|
||||
if (!CanSkyBeActive && Main.LocalPlayer?.Calamity()?.monolithExoShader <= 0)
|
||||
{
|
||||
LightningIntensity = 0f;
|
||||
BackgroundIntensity = MathHelper.Clamp(BackgroundIntensity - 0.08f, 0f, 1f);
|
||||
@@ -130,7 +132,7 @@ namespace CalamityMod.Skies
|
||||
|
||||
public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth)
|
||||
{
|
||||
if (!CanSkyBeActive)
|
||||
if (!CanSkyBeActive && Main.LocalPlayer?.Calamity()?.monolithExoShader <= 0)
|
||||
return;
|
||||
|
||||
if (maxDepth >= float.MaxValue)
|
||||
@@ -188,6 +190,9 @@ namespace CalamityMod.Skies
|
||||
|
||||
public override void Deactivate(params object[] args) { }
|
||||
|
||||
public override bool IsActive() => CanSkyBeActive && !Main.gameMenu;
|
||||
public override bool IsActive()
|
||||
{
|
||||
return !Main.gameMenu && (CanSkyBeActive || Main.LocalPlayer?.Calamity()?.monolithExoShader > 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -97,6 +97,12 @@ namespace CalamityMod.Systems
|
||||
Main.ColorOfTheSkies = Color.Lerp(Main.ColorOfTheSkies, Color.DarkGray, intensity * 0.9f);
|
||||
Main.ColorOfTheSkies = Color.Lerp(Main.ColorOfTheSkies, Color.Black, intensity * 0.65f);
|
||||
}
|
||||
else if (Main.LocalPlayer?.Calamity()?.monolithAstralShader > 0)
|
||||
{
|
||||
float intensity = SkyManager.Instance["CalamityMod:Astral"].Opacity;
|
||||
backgroundColor = Color.Lerp(backgroundColor, Color.Purple, intensity * 0.4f);
|
||||
backgroundColor = Color.Lerp(backgroundColor, Color.Black, intensity * 0.75f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,147 @@
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Items.Placeables.Furniture.Monoliths;
|
||||
using CalamityMod.NPCs.Yharon;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.Enums;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.GameContent.ObjectInteractions;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ObjectData;
|
||||
|
||||
namespace CalamityMod.Tiles.Furniture.Monoliths
|
||||
{
|
||||
public class AstralProjectorTile : ModTile
|
||||
{
|
||||
public static Texture2D Glow;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
if (!Main.dedServ)
|
||||
{
|
||||
Glow = ModContent.Request<Texture2D>("CalamityMod/Tiles/Furniture/Monoliths/AstralProjectorTile_Glow", AssetRequestMode.AsyncLoad).Value;
|
||||
}
|
||||
RegisterItemDrop(ModContent.ItemType<AstralProjector>());
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX);
|
||||
TileObjectData.newTile.Height = 3;
|
||||
TileObjectData.newTile.Origin = new Point16(0, 2);
|
||||
TileObjectData.newTile.CoordinateHeights = new[] { 16, 16, 18 };
|
||||
TileObjectData.newTile.LavaDeath = false;
|
||||
TileObjectData.newTile.UsesCustomCanPlace = true;
|
||||
TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop, 2, 0);
|
||||
TileObjectData.addTile(Type);
|
||||
|
||||
AddMapEntry(new Color(16, 50, 64));
|
||||
|
||||
DustType = ModContent.DustType<AstralOrange>();
|
||||
AnimationFrameHeight = 56;
|
||||
}
|
||||
|
||||
public override void NearbyEffects(int i, int j, bool closer)
|
||||
{
|
||||
if (Main.tile[i, j].TileFrameY < 56)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Player player = Main.LocalPlayer;
|
||||
if (player is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.active)
|
||||
{
|
||||
Main.LocalPlayer.Calamity().monolithAstralShader = 30;
|
||||
}
|
||||
}
|
||||
|
||||
public override void AnimateTile(ref int frame, ref int frameCounter)
|
||||
{
|
||||
frameCounter++;
|
||||
if (frameCounter >= 7.2)
|
||||
{
|
||||
frameCounter = 0;
|
||||
if (++frame >= 9)
|
||||
{
|
||||
frame = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void MouseOver(int i, int j)
|
||||
{
|
||||
Player player = Main.LocalPlayer;
|
||||
player.noThrow = 2;
|
||||
player.cursorItemIconEnabled = true;
|
||||
player.cursorItemIconID = ModContent.ItemType<AstralProjector>();
|
||||
}
|
||||
|
||||
public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true;
|
||||
|
||||
public override bool RightClick(int i, int j)
|
||||
{
|
||||
HitWire(i, j);
|
||||
SoundEngine.PlaySound(SoundID.Mech, new Vector2(i * 16, j * 16));
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void HitWire(int i, int j)
|
||||
{
|
||||
int x = i - Main.tile[i, j].TileFrameX / 18 % 2;
|
||||
int y = j - Main.tile[i, j].TileFrameY / 18 % 3;
|
||||
int tileXX18 = 54;
|
||||
for (int l = x; l < x + 2; l++)
|
||||
{
|
||||
for (int m = y; m < y + 3; m++)
|
||||
{
|
||||
if (Main.tile[l, m].HasTile && Main.tile[l, m].TileType == Type)
|
||||
{
|
||||
if (Main.tile[l, m].TileFrameY < tileXX18)
|
||||
Main.tile[l, m].TileFrameY += (short)(tileXX18);
|
||||
else
|
||||
Main.tile[l, m].TileFrameY -= (short)(tileXX18);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Wiring.running)
|
||||
{
|
||||
for (int o = 0; o < 2; o++)
|
||||
{
|
||||
for (int p = 0; p < 3; p++)
|
||||
{
|
||||
Wiring.SkipWire(x + 0, x + p);
|
||||
}
|
||||
}
|
||||
}
|
||||
NetMessage.SendTileSquare(-1, x, y + 1, 3);
|
||||
}
|
||||
|
||||
public override bool PreDraw(int i, int j, SpriteBatch spriteBatch)
|
||||
{
|
||||
Tile tile = Main.tile[i, j];
|
||||
Texture2D texture;
|
||||
texture = TextureAssets.Tile[Type].Value;
|
||||
Vector2 zero = new(Main.offScreenRange, Main.offScreenRange);
|
||||
if (Main.drawToScreen)
|
||||
{
|
||||
zero = Vector2.Zero;
|
||||
}
|
||||
int height = 18;
|
||||
int animate = 0;
|
||||
if (tile.TileFrameY >= 56)
|
||||
{
|
||||
animate = Main.tileFrame[Type] * 56;
|
||||
}
|
||||
Main.spriteBatch.Draw(texture, new Vector2(i * 16 - (int)Main.screenPosition.X, j * 16 - (int)Main.screenPosition.Y) + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY + animate, 16, height), Lighting.GetColor(i, j), 0f, default(Vector2), 1f, SpriteEffects.None, 0f);
|
||||
if (Glow != null)
|
||||
Main.spriteBatch.Draw(Glow, new Vector2(i * 16 - (int)Main.screenPosition.X, j * 16 - (int)Main.screenPosition.Y) + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY + animate, 16, height), Color.White, 0f, default(Vector2), 1f, SpriteEffects.None, 0f);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1,140 @@
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Items.Placeables.Furniture.Monoliths;
|
||||
using CalamityMod.NPCs.Yharon;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.Enums;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.GameContent.ObjectInteractions;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ObjectData;
|
||||
|
||||
namespace CalamityMod.Tiles.Furniture.Monoliths
|
||||
{
|
||||
public class BlueDistortedMonolithTile : ModTile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
RegisterItemDrop(ModContent.ItemType<BlueDistortedMonolith>());
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3);
|
||||
TileObjectData.newTile.Width = 5;
|
||||
TileObjectData.newTile.Height = 5;
|
||||
TileObjectData.newTile.Origin = new Point16(2, 4);
|
||||
TileObjectData.newTile.CoordinateHeights = new[] { 16, 16, 16, 16, 18 };
|
||||
TileObjectData.newTile.LavaDeath = false;
|
||||
TileObjectData.newTile.UsesCustomCanPlace = true;
|
||||
TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop, 5, 0);
|
||||
TileObjectData.addTile(Type);
|
||||
|
||||
AddMapEntry(new Color(50, 127, 209));
|
||||
|
||||
DustType = (int)CalamityDusts.BlueCosmilite;
|
||||
AnimationFrameHeight = 92;
|
||||
}
|
||||
|
||||
public override void NearbyEffects(int i, int j, bool closer)
|
||||
{
|
||||
if (Main.tile[i, j].TileFrameY < 90)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Player player = Main.LocalPlayer;
|
||||
if (player is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.active)
|
||||
{
|
||||
Main.LocalPlayer.Calamity().monolithDevourerBShader = 30;
|
||||
}
|
||||
}
|
||||
|
||||
public override void AnimateTile(ref int frame, ref int frameCounter)
|
||||
{
|
||||
frameCounter++;
|
||||
if (frameCounter >= 7.2)
|
||||
{
|
||||
frameCounter = 0;
|
||||
if (++frame >= 6)
|
||||
{
|
||||
frame = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void MouseOver(int i, int j)
|
||||
{
|
||||
Player player = Main.LocalPlayer;
|
||||
player.noThrow = 2;
|
||||
player.cursorItemIconEnabled = true;
|
||||
player.cursorItemIconID = ModContent.ItemType<BlueDistortedMonolith>();
|
||||
}
|
||||
|
||||
public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true;
|
||||
|
||||
public override bool RightClick(int i, int j)
|
||||
{
|
||||
HitWire(i, j);
|
||||
SoundEngine.PlaySound(SoundID.Mech, new Vector2(i * 16, j * 16));
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void HitWire(int i, int j)
|
||||
{
|
||||
int x = i - Main.tile[i, j].TileFrameX / 18 % 5;
|
||||
int y = j - Main.tile[i, j].TileFrameY / 18 % 5;
|
||||
int tileXX18 = 92;
|
||||
for (int l = x; l < x + 5; l++)
|
||||
{
|
||||
for (int m = y; m < y + 5; m++)
|
||||
{
|
||||
if (Main.tile[l, m].HasTile && Main.tile[l, m].TileType == Type)
|
||||
{
|
||||
if (Main.tile[l, m].TileFrameY < tileXX18)
|
||||
Main.tile[l, m].TileFrameY += (short)(tileXX18);
|
||||
else
|
||||
Main.tile[l, m].TileFrameY -= (short)(tileXX18);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Wiring.running)
|
||||
{
|
||||
for (int o = 0; o < 5; o++)
|
||||
{
|
||||
for (int p = 0; p < 5; p++)
|
||||
{
|
||||
Wiring.SkipWire(x + 0, x + p);
|
||||
}
|
||||
}
|
||||
}
|
||||
NetMessage.SendTileSquare(-1, x, y + 1, 3);
|
||||
}
|
||||
|
||||
public override bool PreDraw(int i, int j, SpriteBatch spriteBatch)
|
||||
{
|
||||
Tile tile = Main.tile[i, j];
|
||||
Texture2D texture;
|
||||
texture = TextureAssets.Tile[Type].Value;
|
||||
Vector2 zero = new(Main.offScreenRange, Main.offScreenRange);
|
||||
if (Main.drawToScreen)
|
||||
{
|
||||
zero = Vector2.Zero;
|
||||
}
|
||||
int height = 18;
|
||||
int animate = 0;
|
||||
if (tile.TileFrameY >= 92)
|
||||
{
|
||||
animate = Main.tileFrame[Type] * 92;
|
||||
}
|
||||
Main.spriteBatch.Draw(texture, new Vector2(i * 16 - (int)Main.screenPosition.X, j * 16 - (int)Main.screenPosition.Y) + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY + animate, 16, height), Lighting.GetColor(i, j), 0f, default(Vector2), 1f, SpriteEffects.None, 0f);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 3.9 KiB |
@@ -0,0 +1,147 @@
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Items.Placeables.Furniture.Monoliths;
|
||||
using CalamityMod.NPCs.Yharon;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.Enums;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.GameContent.ObjectInteractions;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ObjectData;
|
||||
|
||||
namespace CalamityMod.Tiles.Furniture.Monoliths
|
||||
{
|
||||
public class BossRushMonolithTile : ModTile
|
||||
{
|
||||
public static Texture2D Glow;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
if (!Main.dedServ)
|
||||
{
|
||||
Glow = ModContent.Request<Texture2D>("CalamityMod/Tiles/Furniture/Monoliths/BossRushMonolithTile_Glow", AssetRequestMode.AsyncLoad).Value;
|
||||
}
|
||||
RegisterItemDrop(ModContent.ItemType<BossRushMonolith>());
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4);
|
||||
TileObjectData.newTile.Width = 4;
|
||||
TileObjectData.newTile.Origin = new Point16(2, 3);
|
||||
TileObjectData.newTile.CoordinateHeights = new[] { 16, 16, 16, 18 };
|
||||
TileObjectData.newTile.LavaDeath = false;
|
||||
TileObjectData.newTile.UsesCustomCanPlace = true;
|
||||
TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop, 4, 0);
|
||||
TileObjectData.addTile(Type);
|
||||
|
||||
AddMapEntry(new Color(64, 8, 12));
|
||||
|
||||
DustType = (int)CalamityDusts.Brimstone;
|
||||
AnimationFrameHeight = 72;
|
||||
}
|
||||
|
||||
public override void NearbyEffects(int i, int j, bool closer)
|
||||
{
|
||||
if (Main.tile[i, j].TileFrameY < 72)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Player player = Main.LocalPlayer;
|
||||
if (player is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.active)
|
||||
{
|
||||
Main.LocalPlayer.Calamity().monolithBossRushShader = 30;
|
||||
}
|
||||
}
|
||||
|
||||
public override void AnimateTile(ref int frame, ref int frameCounter)
|
||||
{
|
||||
frameCounter++;
|
||||
if (frameCounter >= 7.2)
|
||||
{
|
||||
frameCounter = 0;
|
||||
if (++frame >= 3)
|
||||
{
|
||||
frame = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void MouseOver(int i, int j)
|
||||
{
|
||||
Player player = Main.LocalPlayer;
|
||||
player.noThrow = 2;
|
||||
player.cursorItemIconEnabled = true;
|
||||
player.cursorItemIconID = ModContent.ItemType<BossRushMonolith>();
|
||||
}
|
||||
|
||||
public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true;
|
||||
|
||||
public override bool RightClick(int i, int j)
|
||||
{
|
||||
HitWire(i, j);
|
||||
SoundEngine.PlaySound(SoundID.Mech, new Vector2(i * 16, j * 16));
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void HitWire(int i, int j)
|
||||
{
|
||||
int x = i - Main.tile[i, j].TileFrameX / 18 % 4;
|
||||
int y = j - Main.tile[i, j].TileFrameY / 18 % 4;
|
||||
int tileXX18 = 18 * 4;
|
||||
for (int l = x; l < x + 4; l++)
|
||||
{
|
||||
for (int m = y; m < y + 4; m++)
|
||||
{
|
||||
if (Main.tile[l, m].HasTile && Main.tile[l, m].TileType == Type)
|
||||
{
|
||||
if (Main.tile[l, m].TileFrameY < tileXX18)
|
||||
Main.tile[l, m].TileFrameY += (short)(tileXX18);
|
||||
else
|
||||
Main.tile[l, m].TileFrameY -= (short)(tileXX18);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Wiring.running)
|
||||
{
|
||||
for (int o = 0; o < 4; o++)
|
||||
{
|
||||
for (int p = 0; p < 4; p++)
|
||||
{
|
||||
Wiring.SkipWire(x + 0, x + p);
|
||||
}
|
||||
}
|
||||
}
|
||||
NetMessage.SendTileSquare(-1, x, y + 1, 3);
|
||||
}
|
||||
|
||||
public override bool PreDraw(int i, int j, SpriteBatch spriteBatch)
|
||||
{
|
||||
Tile tile = Main.tile[i, j];
|
||||
Texture2D texture;
|
||||
texture = TextureAssets.Tile[Type].Value;
|
||||
Vector2 zero = new(Main.offScreenRange, Main.offScreenRange);
|
||||
if (Main.drawToScreen)
|
||||
{
|
||||
zero = Vector2.Zero;
|
||||
}
|
||||
int height = 18;
|
||||
int animate = 0;
|
||||
if (tile.TileFrameY >= 72)
|
||||
{
|
||||
animate = Main.tileFrame[Type] * AnimationFrameHeight;
|
||||
}
|
||||
Main.spriteBatch.Draw(texture, new Vector2(i * 16 - (int)Main.screenPosition.X, j * 16 - (int)Main.screenPosition.Y) + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY + animate, 16, height), Lighting.GetColor(i, j), 0f, default(Vector2), 1f, SpriteEffects.None, 0f);
|
||||
if (Glow != null)
|
||||
Main.spriteBatch.Draw(Glow, new Vector2(i * 16 - (int)Main.screenPosition.X, j * 16 - (int)Main.screenPosition.Y) + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY + animate, 16, height), Color.White, 0f, default(Vector2), 1f, SpriteEffects.None, 0f);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
@@ -0,0 +1,138 @@
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Items.Placeables.Furniture.Monoliths;
|
||||
using CalamityMod.NPCs.Yharon;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.Enums;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.GameContent.ObjectInteractions;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ObjectData;
|
||||
|
||||
namespace CalamityMod.Tiles.Furniture.Monoliths
|
||||
{
|
||||
public class DeepSeaAnchorTile : ModTile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
RegisterItemDrop(ModContent.ItemType<DeepSeaAnchor>());
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4);
|
||||
TileObjectData.newTile.Origin = new Point16(0, 3);
|
||||
TileObjectData.newTile.CoordinateHeights = new[] { 16, 16, 16, 18 };
|
||||
TileObjectData.newTile.LavaDeath = false;
|
||||
TileObjectData.newTile.UsesCustomCanPlace = true;
|
||||
TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop, 3, 0);
|
||||
TileObjectData.addTile(Type);
|
||||
|
||||
AddMapEntry(new Color(92, 24, 31));
|
||||
|
||||
DustType = DustID.Water;
|
||||
AnimationFrameHeight = 72;
|
||||
}
|
||||
|
||||
public override void NearbyEffects(int i, int j, bool closer)
|
||||
{
|
||||
if (Main.tile[i, j].TileFrameY < 72)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Player player = Main.LocalPlayer;
|
||||
if (player is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.active)
|
||||
{
|
||||
Main.LocalPlayer.Calamity().monolithLeviathanShader = 30;
|
||||
}
|
||||
}
|
||||
|
||||
public override void AnimateTile(ref int frame, ref int frameCounter)
|
||||
{
|
||||
frameCounter++;
|
||||
if (frameCounter >= 7.2)
|
||||
{
|
||||
frameCounter = 0;
|
||||
if (++frame >= 6)
|
||||
{
|
||||
frame = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void MouseOver(int i, int j)
|
||||
{
|
||||
Player player = Main.LocalPlayer;
|
||||
player.noThrow = 2;
|
||||
player.cursorItemIconEnabled = true;
|
||||
player.cursorItemIconID = ModContent.ItemType<DeepSeaAnchor>();
|
||||
}
|
||||
|
||||
public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true;
|
||||
|
||||
public override bool RightClick(int i, int j)
|
||||
{
|
||||
HitWire(i, j);
|
||||
SoundEngine.PlaySound(SoundID.Mech, new Vector2(i * 16, j * 16));
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void HitWire(int i, int j)
|
||||
{
|
||||
int x = i - Main.tile[i, j].TileFrameX / 18 % 3;
|
||||
int y = j - Main.tile[i, j].TileFrameY / 18 % 4;
|
||||
int tileXX18 = 18 * 4;
|
||||
for (int l = x; l < x + 3; l++)
|
||||
{
|
||||
for (int m = y; m < y + 4; m++)
|
||||
{
|
||||
if (Main.tile[l, m].HasTile && Main.tile[l, m].TileType == Type)
|
||||
{
|
||||
if (Main.tile[l, m].TileFrameY < tileXX18)
|
||||
Main.tile[l, m].TileFrameY += (short)(tileXX18);
|
||||
else
|
||||
Main.tile[l, m].TileFrameY -= (short)(tileXX18);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Wiring.running)
|
||||
{
|
||||
for (int o = 0; o < 3; o++)
|
||||
{
|
||||
for (int p = 0; p < 4; p++)
|
||||
{
|
||||
Wiring.SkipWire(x + 0, x + p);
|
||||
}
|
||||
}
|
||||
}
|
||||
NetMessage.SendTileSquare(-1, x, y + 1, 3);
|
||||
}
|
||||
|
||||
public override bool PreDraw(int i, int j, SpriteBatch spriteBatch)
|
||||
{
|
||||
Tile tile = Main.tile[i, j];
|
||||
Texture2D texture;
|
||||
texture = TextureAssets.Tile[Type].Value;
|
||||
Vector2 zero = new(Main.offScreenRange, Main.offScreenRange);
|
||||
if (Main.drawToScreen)
|
||||
{
|
||||
zero = Vector2.Zero;
|
||||
}
|
||||
int height = 18;
|
||||
int animate = 0;
|
||||
if (tile.TileFrameY >= 72)
|
||||
{
|
||||
animate = Main.tileFrame[Type] * AnimationFrameHeight;
|
||||
}
|
||||
Main.spriteBatch.Draw(texture, new Vector2(i * 16 - (int)Main.screenPosition.X, j * 16 - (int)Main.screenPosition.Y) + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY + animate, 16, height), Lighting.GetColor(i, j), 0f, default(Vector2), 1f, SpriteEffects.None, 0f);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 4.5 KiB |
@@ -0,0 +1,145 @@
|
||||
using CalamityMod.Items.Placeables.Furniture.Monoliths;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.Enums;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.GameContent.ObjectInteractions;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ObjectData;
|
||||
|
||||
namespace CalamityMod.Tiles.Furniture.Monoliths
|
||||
{
|
||||
public class DraconicIncenseTile : ModTile
|
||||
{
|
||||
public static Texture2D Glow;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
if (!Main.dedServ)
|
||||
{
|
||||
Glow = ModContent.Request<Texture2D>("CalamityMod/Tiles/Furniture/Monoliths/DraconicIncenseTile_Glow", AssetRequestMode.AsyncLoad).Value;
|
||||
}
|
||||
RegisterItemDrop(ModContent.ItemType<DraconicIncense>());
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX);
|
||||
TileObjectData.newTile.Height = 6;
|
||||
TileObjectData.newTile.Origin = new Point16(0, 5);
|
||||
TileObjectData.newTile.CoordinateHeights = new[] { 16, 16, 16, 16, 16, 18 };
|
||||
TileObjectData.newTile.LavaDeath = false;
|
||||
TileObjectData.newTile.UsesCustomCanPlace = true;
|
||||
TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop, 2, 0);
|
||||
TileObjectData.addTile(Type);
|
||||
|
||||
AddMapEntry(new Color(143, 106, 41));
|
||||
|
||||
DustType = DustID.Flare;
|
||||
AnimationFrameHeight = 110;
|
||||
}
|
||||
|
||||
public override void NearbyEffects(int i, int j, bool closer)
|
||||
{
|
||||
if (Main.tile[i, j].TileFrameY < 110)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Player player = Main.LocalPlayer;
|
||||
if (player is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.active)
|
||||
{
|
||||
Main.LocalPlayer.Calamity().monolithYharonShader = 30;
|
||||
}
|
||||
}
|
||||
|
||||
public override void AnimateTile(ref int frame, ref int frameCounter)
|
||||
{
|
||||
frameCounter++;
|
||||
if (frameCounter >= 7.2)
|
||||
{
|
||||
frameCounter = 0;
|
||||
if (++frame >= 6)
|
||||
{
|
||||
frame = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void MouseOver(int i, int j)
|
||||
{
|
||||
Player player = Main.LocalPlayer;
|
||||
player.noThrow = 2;
|
||||
player.cursorItemIconEnabled = true;
|
||||
player.cursorItemIconID = ModContent.ItemType<DraconicIncense>();
|
||||
}
|
||||
|
||||
public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true;
|
||||
|
||||
public override bool RightClick(int i, int j)
|
||||
{
|
||||
HitWire(i, j);
|
||||
SoundEngine.PlaySound(SoundID.Mech, new Vector2(i * 16, j * 16));
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void HitWire(int i, int j)
|
||||
{
|
||||
int x = i - Main.tile[i, j].TileFrameX / 18 % 2;
|
||||
int y = j - Main.tile[i, j].TileFrameY / 18 % 6;
|
||||
int tileXX18 = 110;
|
||||
for (int l = x; l < x + 2; l++)
|
||||
{
|
||||
for (int m = y; m < y + 6; m++)
|
||||
{
|
||||
if (Main.tile[l, m].HasTile && Main.tile[l, m].TileType == Type)
|
||||
{
|
||||
if (Main.tile[l, m].TileFrameY < tileXX18)
|
||||
Main.tile[l, m].TileFrameY += (short)(tileXX18);
|
||||
else
|
||||
Main.tile[l, m].TileFrameY -= (short)(tileXX18);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Wiring.running)
|
||||
{
|
||||
for (int o = 0; o < 2; o++)
|
||||
{
|
||||
for (int p = 0; p < 6; p++)
|
||||
{
|
||||
Wiring.SkipWire(x + 0, x + p);
|
||||
}
|
||||
}
|
||||
}
|
||||
NetMessage.SendTileSquare(-1, x, y + 1, 3);
|
||||
}
|
||||
|
||||
public override bool PreDraw(int i, int j, SpriteBatch spriteBatch)
|
||||
{
|
||||
Tile tile = Main.tile[i, j];
|
||||
Texture2D texture;
|
||||
texture = TextureAssets.Tile[Type].Value;
|
||||
Vector2 zero = new(Main.offScreenRange, Main.offScreenRange);
|
||||
if (Main.drawToScreen)
|
||||
{
|
||||
zero = Vector2.Zero;
|
||||
}
|
||||
int height = 18;
|
||||
int animate = 0;
|
||||
if (tile.TileFrameY >= 110)
|
||||
{
|
||||
animate = Main.tileFrame[Type] * AnimationFrameHeight;
|
||||
}
|
||||
Main.spriteBatch.Draw(texture, new Vector2(i * 16 - (int)Main.screenPosition.X, j * 16 - (int)Main.screenPosition.Y) + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY + animate, 16, height), Lighting.GetColor(i, j), 0f, default(Vector2), 1f, SpriteEffects.None, 0f);
|
||||
if (Glow != null)
|
||||
Main.spriteBatch.Draw(Glow, new Vector2(i * 16 - (int)Main.screenPosition.X, j * 16 - (int)Main.screenPosition.Y) + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY + animate, 16, height), Color.White, 0f, default(Vector2), 1f, SpriteEffects.None, 0f);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 855 B |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
@@ -0,0 +1,161 @@
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Items.Dyes;
|
||||
using CalamityMod.Items.Placeables.Furniture.Monoliths;
|
||||
using CalamityMod.NPCs.Yharon;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.Enums;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.GameContent.ObjectInteractions;
|
||||
using Terraria.Graphics.Shaders;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ObjectData;
|
||||
|
||||
namespace CalamityMod.Tiles.Furniture.Monoliths
|
||||
{
|
||||
public class ExoObeliskTile : ModTile
|
||||
{
|
||||
public static Texture2D Glow;
|
||||
public static Texture2D Numbers;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
if (!Main.dedServ)
|
||||
{
|
||||
Glow = ModContent.Request<Texture2D>("CalamityMod/Tiles/Furniture/Monoliths/ExoObeliskTile_Glow", AssetRequestMode.AsyncLoad).Value;
|
||||
Numbers = ModContent.Request<Texture2D>("CalamityMod/Tiles/Furniture/Monoliths/ExoObeliskText", AssetRequestMode.AsyncLoad).Value;
|
||||
}
|
||||
RegisterItemDrop(ModContent.ItemType<ExoObelisk>());
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4);
|
||||
TileObjectData.newTile.Height = 5;
|
||||
TileObjectData.newTile.Origin = new Point16(1, 4);
|
||||
TileObjectData.newTile.CoordinateHeights = new[] { 16, 16, 16, 16, 18 };
|
||||
TileObjectData.newTile.LavaDeath = false;
|
||||
TileObjectData.newTile.UsesCustomCanPlace = true;
|
||||
TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop, 3, 0);
|
||||
TileObjectData.addTile(Type);
|
||||
|
||||
AddMapEntry(new Color(54, 54, 54));
|
||||
|
||||
DustType = DustID.TerraBlade;
|
||||
AnimationFrameHeight = 90;
|
||||
}
|
||||
|
||||
public override void NearbyEffects(int i, int j, bool closer)
|
||||
{
|
||||
if (Main.tile[i, j].TileFrameY < 90)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Player player = Main.LocalPlayer;
|
||||
if (player is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.active)
|
||||
{
|
||||
Main.LocalPlayer.Calamity().monolithExoShader = 30;
|
||||
}
|
||||
}
|
||||
|
||||
public override void AnimateTile(ref int frame, ref int frameCounter)
|
||||
{
|
||||
frameCounter++;
|
||||
if (frameCounter >= 6)
|
||||
{
|
||||
frameCounter = 0;
|
||||
if (++frame >= 13)
|
||||
{
|
||||
frame = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void MouseOver(int i, int j)
|
||||
{
|
||||
Player player = Main.LocalPlayer;
|
||||
player.noThrow = 2;
|
||||
player.cursorItemIconEnabled = true;
|
||||
player.cursorItemIconID = ModContent.ItemType<ExoObelisk>();
|
||||
}
|
||||
|
||||
public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true;
|
||||
|
||||
public override bool RightClick(int i, int j)
|
||||
{
|
||||
HitWire(i, j);
|
||||
SoundEngine.PlaySound(SoundID.Mech, new Vector2(i * 16, j * 16));
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void HitWire(int i, int j)
|
||||
{
|
||||
int x = i - Main.tile[i, j].TileFrameX / 18 % 3;
|
||||
int y = j - Main.tile[i, j].TileFrameY / 18 % 5;
|
||||
int tileXX18 = 92;
|
||||
for (int l = x; l < x + 3; l++)
|
||||
{
|
||||
for (int m = y; m < y + 5; m++)
|
||||
{
|
||||
if (Main.tile[l, m].HasTile && Main.tile[l, m].TileType == Type)
|
||||
{
|
||||
if (Main.tile[l, m].TileFrameY < tileXX18)
|
||||
Main.tile[l, m].TileFrameY += (short)(tileXX18);
|
||||
else
|
||||
Main.tile[l, m].TileFrameY -= (short)(tileXX18);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Wiring.running)
|
||||
{
|
||||
for (int o = 0; o < 3; o++)
|
||||
{
|
||||
for (int p = 0; p < 5; p++)
|
||||
{
|
||||
Wiring.SkipWire(x + 0, x + p);
|
||||
}
|
||||
}
|
||||
}
|
||||
NetMessage.SendTileSquare(-1, x, y + 1, 3);
|
||||
}
|
||||
|
||||
public override bool PreDraw(int i, int j, SpriteBatch spriteBatch)
|
||||
{
|
||||
Tile tile = Main.tile[i, j];
|
||||
Texture2D texture;
|
||||
texture = TextureAssets.Tile[Type].Value;
|
||||
Vector2 zero = new(Main.offScreenRange, Main.offScreenRange);
|
||||
if (Main.drawToScreen)
|
||||
{
|
||||
zero = Vector2.Zero;
|
||||
}
|
||||
int height = 18;
|
||||
int animate = 0;
|
||||
if (tile.TileFrameY >= 92)
|
||||
{
|
||||
animate = Main.tileFrame[Type] * 92;
|
||||
}
|
||||
Main.spriteBatch.Draw(texture, new Vector2(i * 16 - (int)Main.screenPosition.X, j * 16 - (int)Main.screenPosition.Y) + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY + animate, 16, height), Lighting.GetColor(i, j), 0f, default(Vector2), 1f, SpriteEffects.None, 0f);
|
||||
if (Glow != null)
|
||||
Main.spriteBatch.Draw(Glow, new Vector2(i * 16 - (int)Main.screenPosition.X, j * 16 - (int)Main.screenPosition.Y) + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY + animate, 16, height), Color.White, 0f, default(Vector2), 1f, SpriteEffects.None, 0f);
|
||||
if (Numbers != null)
|
||||
{
|
||||
int colorIndex = (int)(Main.GlobalTimeWrappedHourly / 0.5 % CalamityUtils.ExoPalette.Length);
|
||||
Color currentColor = CalamityUtils.ExoPalette[colorIndex];
|
||||
Color nextColor = CalamityUtils.ExoPalette[(colorIndex + 1) % CalamityUtils.ExoPalette.Length];
|
||||
Color exoColors = Color.Lerp(currentColor, nextColor, Main.GlobalTimeWrappedHourly % 0.5f > 1f ? 1f : Main.GlobalTimeWrappedHourly % 1f);
|
||||
|
||||
Main.spriteBatch.Draw(Numbers, new Vector2(i * 16 - (int)Main.screenPosition.X, j * 16 - (int)Main.screenPosition.Y) + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY + animate, 16, height), exoColors, 0f, default(Vector2), 1f, SpriteEffects.None, 0f);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 792 B |
@@ -0,0 +1,138 @@
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Items.Placeables.Furniture.Monoliths;
|
||||
using CalamityMod.NPCs.Yharon;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.Enums;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.GameContent.ObjectInteractions;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ObjectData;
|
||||
|
||||
namespace CalamityMod.Tiles.Furniture.Monoliths
|
||||
{
|
||||
public class FrigidMonolithTile : ModTile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
RegisterItemDrop(ModContent.ItemType<FrigidMonolith>());
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4);
|
||||
TileObjectData.newTile.Origin = new Point16(0, 2);
|
||||
TileObjectData.newTile.CoordinateHeights = new[] { 16, 16, 16, 18 };
|
||||
TileObjectData.newTile.LavaDeath = false;
|
||||
TileObjectData.newTile.UsesCustomCanPlace = true;
|
||||
TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop, 3, 0);
|
||||
TileObjectData.addTile(Type);
|
||||
|
||||
AddMapEntry(new Color(55, 212, 230));
|
||||
|
||||
DustType = DustID.Ice;
|
||||
AnimationFrameHeight = 74;
|
||||
}
|
||||
|
||||
public override void NearbyEffects(int i, int j, bool closer)
|
||||
{
|
||||
if (Main.tile[i, j].TileFrameY < 74)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Player player = Main.LocalPlayer;
|
||||
if (player is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.active)
|
||||
{
|
||||
Main.LocalPlayer.Calamity().monolithCryogenShader = 30;
|
||||
}
|
||||
}
|
||||
|
||||
public override void AnimateTile(ref int frame, ref int frameCounter)
|
||||
{
|
||||
frameCounter++;
|
||||
if (frameCounter >= 7.2)
|
||||
{
|
||||
frameCounter = 0;
|
||||
if (++frame >= 6)
|
||||
{
|
||||
frame = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void MouseOver(int i, int j)
|
||||
{
|
||||
Player player = Main.LocalPlayer;
|
||||
player.noThrow = 2;
|
||||
player.cursorItemIconEnabled = true;
|
||||
player.cursorItemIconID = ModContent.ItemType<FrigidMonolith>();
|
||||
}
|
||||
|
||||
public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true;
|
||||
|
||||
public override bool RightClick(int i, int j)
|
||||
{
|
||||
HitWire(i, j);
|
||||
SoundEngine.PlaySound(SoundID.Mech, new Vector2(i * 16, j * 16));
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void HitWire(int i, int j)
|
||||
{
|
||||
int x = i - Main.tile[i, j].TileFrameX / 18 % 3;
|
||||
int y = j - Main.tile[i, j].TileFrameY / 18 % 4;
|
||||
int tileXX18 = 74;
|
||||
for (int l = x; l < x + 3; l++)
|
||||
{
|
||||
for (int m = y; m < y + 4; m++)
|
||||
{
|
||||
if (Main.tile[l, m].HasTile && Main.tile[l, m].TileType == Type)
|
||||
{
|
||||
if (Main.tile[l, m].TileFrameY < tileXX18)
|
||||
Main.tile[l, m].TileFrameY += (short)(tileXX18);
|
||||
else
|
||||
Main.tile[l, m].TileFrameY -= (short)(tileXX18);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Wiring.running)
|
||||
{
|
||||
for (int o = 0; o < 3; o++)
|
||||
{
|
||||
for (int p = 0; p < 4; p++)
|
||||
{
|
||||
Wiring.SkipWire(x + 0, x + p);
|
||||
}
|
||||
}
|
||||
}
|
||||
NetMessage.SendTileSquare(-1, x, y + 1, 3);
|
||||
}
|
||||
|
||||
public override bool PreDraw(int i, int j, SpriteBatch spriteBatch)
|
||||
{
|
||||
Tile tile = Main.tile[i, j];
|
||||
Texture2D texture;
|
||||
texture = TextureAssets.Tile[Type].Value;
|
||||
Vector2 zero = new(Main.offScreenRange, Main.offScreenRange);
|
||||
if (Main.drawToScreen)
|
||||
{
|
||||
zero = Vector2.Zero;
|
||||
}
|
||||
int height = 18;
|
||||
int animate = 0;
|
||||
if (tile.TileFrameY >= 74)
|
||||
{
|
||||
animate = Main.tileFrame[Type] * AnimationFrameHeight;
|
||||
}
|
||||
Main.spriteBatch.Draw(texture, new Vector2(i * 16 - (int)Main.screenPosition.X, j * 16 - (int)Main.screenPosition.Y) + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY + animate, 16, height), Lighting.GetColor(i, j), 0f, default(Vector2), 1f, SpriteEffects.None, 0f);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 5.7 KiB |
@@ -0,0 +1,149 @@
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Items.Placeables.Furniture.Monoliths;
|
||||
using CalamityMod.NPCs.Yharon;
|
||||
using CalamityMod.Particles;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.Enums;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.GameContent.ObjectInteractions;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ObjectData;
|
||||
|
||||
namespace CalamityMod.Tiles.Furniture.Monoliths
|
||||
{
|
||||
public class PlagueHumidifierTile : ModTile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
RegisterItemDrop(ModContent.ItemType<PlagueHumidifier>());
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX);
|
||||
TileObjectData.newTile.Height = 4;
|
||||
TileObjectData.newTile.Origin = new Point16(1, 3);
|
||||
TileObjectData.newTile.CoordinateHeights = new[] { 16, 16, 16, 16 };
|
||||
TileObjectData.newTile.LavaDeath = false;
|
||||
TileObjectData.newTile.UsesCustomCanPlace = true;
|
||||
TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop, 2, 0);
|
||||
TileObjectData.addTile(Type);
|
||||
|
||||
AddMapEntry(new Color(44, 150, 54));
|
||||
|
||||
DustType = (int)CalamityDusts.Plague;
|
||||
AnimationFrameHeight = 74;
|
||||
}
|
||||
|
||||
public override void NearbyEffects(int i, int j, bool closer)
|
||||
{
|
||||
if (Main.tile[i, j].TileFrameY < 74)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Player player = Main.LocalPlayer;
|
||||
if (player is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.active)
|
||||
{
|
||||
Main.LocalPlayer.Calamity().monolithPlagueShader = 30;
|
||||
}
|
||||
|
||||
// Spawn mist particles at the bottom tiles
|
||||
if (Main.tile[i,j +1].TileType != Type)
|
||||
{
|
||||
if (Main.rand.NextBool(30))
|
||||
{
|
||||
GeneralParticleHandler.SpawnParticle(new PlagueHumidifierMist(new Vector2(i * 16, j * 16) + new Vector2(Main.rand.NextFloat(0, 16), Main.rand.NextFloat(16)), Main.rand.Next(40, 80), Main.rand.NextFloat(0.8f, 1.2f), Vector2.UnitX * Main.rand.NextFloat(-0.8f, 0.8f)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void AnimateTile(ref int frame, ref int frameCounter)
|
||||
{
|
||||
frameCounter++;
|
||||
if (frameCounter >= 7.2)
|
||||
{
|
||||
frameCounter = 0;
|
||||
if (++frame >= 4)
|
||||
{
|
||||
frame = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void MouseOver(int i, int j)
|
||||
{
|
||||
Player player = Main.LocalPlayer;
|
||||
player.noThrow = 2;
|
||||
player.cursorItemIconEnabled = true;
|
||||
player.cursorItemIconID = ModContent.ItemType<PlagueHumidifier>();
|
||||
}
|
||||
|
||||
public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true;
|
||||
|
||||
public override bool RightClick(int i, int j)
|
||||
{
|
||||
HitWire(i, j);
|
||||
SoundEngine.PlaySound(SoundID.Mech, new Vector2(i * 16, j * 16));
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void HitWire(int i, int j)
|
||||
{
|
||||
int x = i - Main.tile[i, j].TileFrameX / 18 % 2;
|
||||
int y = j - Main.tile[i, j].TileFrameY / 18 % 4;
|
||||
int tileXX18 = 74;
|
||||
for (int l = x; l < x + 2; l++)
|
||||
{
|
||||
for (int m = y; m < y + 4; m++)
|
||||
{
|
||||
if (Main.tile[l, m].HasTile && Main.tile[l, m].TileType == Type)
|
||||
{
|
||||
if (Main.tile[l, m].TileFrameY < tileXX18)
|
||||
Main.tile[l, m].TileFrameY += (short)(tileXX18);
|
||||
else
|
||||
Main.tile[l, m].TileFrameY -= (short)(tileXX18);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Wiring.running)
|
||||
{
|
||||
for (int o = 0; o < 2; o++)
|
||||
{
|
||||
for (int p = 0; p < 4; p++)
|
||||
{
|
||||
Wiring.SkipWire(x + 0, x + p);
|
||||
}
|
||||
}
|
||||
}
|
||||
NetMessage.SendTileSquare(-1, x, y + 1, 3);
|
||||
}
|
||||
|
||||
public override bool PreDraw(int i, int j, SpriteBatch spriteBatch)
|
||||
{
|
||||
Tile tile = Main.tile[i, j];
|
||||
Texture2D texture;
|
||||
texture = TextureAssets.Tile[Type].Value;
|
||||
Vector2 zero = new(Main.offScreenRange, Main.offScreenRange);
|
||||
if (Main.drawToScreen)
|
||||
{
|
||||
zero = Vector2.Zero;
|
||||
}
|
||||
int height = 18;
|
||||
int animate = 0;
|
||||
if (tile.TileFrameY >= 74)
|
||||
{
|
||||
animate = Main.tileFrame[Type] * AnimationFrameHeight;
|
||||
}
|
||||
Main.spriteBatch.Draw(texture, new Vector2(i * 16 - (int)Main.screenPosition.X, j * 16 - (int)Main.screenPosition.Y) + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY + animate, 16, height), Lighting.GetColor(i, j), 0f, default(Vector2), 1f, SpriteEffects.None, 0f);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 2.9 KiB |
@@ -0,0 +1,140 @@
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Items.Placeables.Furniture.Monoliths;
|
||||
using CalamityMod.NPCs.Yharon;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.Enums;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.GameContent.ObjectInteractions;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ObjectData;
|
||||
|
||||
namespace CalamityMod.Tiles.Furniture.Monoliths
|
||||
{
|
||||
public class PurpleDistortedMonolithTile : ModTile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
RegisterItemDrop(ModContent.ItemType<PurpleDistortedMonolith>());
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3);
|
||||
TileObjectData.newTile.Width = 5;
|
||||
TileObjectData.newTile.Height = 5;
|
||||
TileObjectData.newTile.Origin = new Point16(2, 4);
|
||||
TileObjectData.newTile.CoordinateHeights = new[] { 16, 16, 16, 16, 18 };
|
||||
TileObjectData.newTile.LavaDeath = false;
|
||||
TileObjectData.newTile.UsesCustomCanPlace = true;
|
||||
TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop, 5, 0);
|
||||
TileObjectData.addTile(Type);
|
||||
|
||||
AddMapEntry(new Color(50, 127, 209));
|
||||
|
||||
DustType = (int)CalamityDusts.PurpleCosmilite;
|
||||
AnimationFrameHeight = 92;
|
||||
}
|
||||
|
||||
public override void NearbyEffects(int i, int j, bool closer)
|
||||
{
|
||||
if (Main.tile[i, j].TileFrameY < 92)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Player player = Main.LocalPlayer;
|
||||
if (player is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.active)
|
||||
{
|
||||
Main.LocalPlayer.Calamity().monolithDevourerPShader = 30;
|
||||
}
|
||||
}
|
||||
|
||||
public override void AnimateTile(ref int frame, ref int frameCounter)
|
||||
{
|
||||
frameCounter++;
|
||||
if (frameCounter >= 7.2)
|
||||
{
|
||||
frameCounter = 0;
|
||||
if (++frame >= 6)
|
||||
{
|
||||
frame = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void MouseOver(int i, int j)
|
||||
{
|
||||
Player player = Main.LocalPlayer;
|
||||
player.noThrow = 2;
|
||||
player.cursorItemIconEnabled = true;
|
||||
player.cursorItemIconID = ModContent.ItemType<PurpleDistortedMonolith>();
|
||||
}
|
||||
|
||||
public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true;
|
||||
|
||||
public override bool RightClick(int i, int j)
|
||||
{
|
||||
HitWire(i, j);
|
||||
SoundEngine.PlaySound(SoundID.Mech, new Vector2(i * 16, j * 16));
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void HitWire(int i, int j)
|
||||
{
|
||||
int x = i - Main.tile[i, j].TileFrameX / 18 % 5;
|
||||
int y = j - Main.tile[i, j].TileFrameY / 18 % 5;
|
||||
int tileXX18 = 92;
|
||||
for (int l = x; l < x + 5; l++)
|
||||
{
|
||||
for (int m = y; m < y + 5; m++)
|
||||
{
|
||||
if (Main.tile[l, m].HasTile && Main.tile[l, m].TileType == Type)
|
||||
{
|
||||
if (Main.tile[l, m].TileFrameY < tileXX18)
|
||||
Main.tile[l, m].TileFrameY += (short)(tileXX18);
|
||||
else
|
||||
Main.tile[l, m].TileFrameY -= (short)(tileXX18);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Wiring.running)
|
||||
{
|
||||
for (int o = 0; o < 5; o++)
|
||||
{
|
||||
for (int p = 0; p < 5; p++)
|
||||
{
|
||||
Wiring.SkipWire(x + 0, x + p);
|
||||
}
|
||||
}
|
||||
}
|
||||
NetMessage.SendTileSquare(-1, x, y + 1, 3);
|
||||
}
|
||||
|
||||
public override bool PreDraw(int i, int j, SpriteBatch spriteBatch)
|
||||
{
|
||||
Tile tile = Main.tile[i, j];
|
||||
Texture2D texture;
|
||||
texture = TextureAssets.Tile[Type].Value;
|
||||
Vector2 zero = new(Main.offScreenRange, Main.offScreenRange);
|
||||
if (Main.drawToScreen)
|
||||
{
|
||||
zero = Vector2.Zero;
|
||||
}
|
||||
int height = 18;
|
||||
int animate = 0;
|
||||
if (tile.TileFrameY >= 92)
|
||||
{
|
||||
animate = Main.tileFrame[Type] * 92;
|
||||
}
|
||||
Main.spriteBatch.Draw(texture, new Vector2(i * 16 - (int)Main.screenPosition.X, j * 16 - (int)Main.screenPosition.Y) + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY + animate, 16, height), Lighting.GetColor(i, j), 0f, default(Vector2), 1f, SpriteEffects.None, 0f);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 3.9 KiB |