basic tiles
No files matched your search
@@ -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 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 598 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.Yellow;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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 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.LightRed;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -661,7 +661,6 @@ BossRushMonolith: {
|
||||
Tooltip: ""
|
||||
}
|
||||
|
||||
|
||||
NavyPrismTorch: {
|
||||
DisplayName: Navy Prism Torch
|
||||
Tooltip: Can be placed in water
|
||||
@@ -3523,4 +3522,34 @@ WaterTurret: {
|
||||
Shoots high-speed water blasts at nearby enemies
|
||||
Cannot attack while a boss is alive
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
AstralProjector: {
|
||||
DisplayName: Astral Projector
|
||||
Tooltip: ""
|
||||
}
|
||||
|
||||
DeepSeaAnchor: {
|
||||
DisplayName: Deep Sea Anchor
|
||||
Tooltip: ""
|
||||
}
|
||||
|
||||
DraconicIncense: {
|
||||
DisplayName: Draconic Incense
|
||||
Tooltip: ""
|
||||
}
|
||||
|
||||
ExoObelisk: {
|
||||
DisplayName: Exo Obelisk
|
||||
Tooltip: ""
|
||||
}
|
||||
|
||||
FrigidMonolith: {
|
||||
DisplayName: Frigid Monolith
|
||||
Tooltip: ""
|
||||
}
|
||||
|
||||
PlagueHumidifier: {
|
||||
DisplayName: Plague Humidifier
|
||||
Tooltip: ""
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace CalamityMod.Systems
|
||||
{
|
||||
public override SceneEffectPriority Priority => SceneEffectPriority.BossHigh;
|
||||
|
||||
public override bool IsSceneEffectActive(Player player) => NPC.AnyNPCs(ModContent.NPCType<DevourerofGodsHead>());
|
||||
public override bool IsSceneEffectActive(Player player) => NPC.AnyNPCs(ModContent.NPCType<DevourerofGodsHead>()) || Main.LocalPlayer.Calamity().monolithDevourerShader > 0;
|
||||
|
||||
public override void SpecialVisuals(Player player, bool isActive)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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,7 +110,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)
|
||||
skyActive = false;
|
||||
|
||||
if (skyActive && opacity < 1f)
|
||||
|
||||
@@ -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())
|
||||
{
|
||||
@@ -49,7 +49,7 @@ namespace CalamityMod.Skies
|
||||
if (FadeInCountdown > 0)
|
||||
FadeInCountdown--;
|
||||
|
||||
if (CryogenIndex == -1 && !ShouldDrawRegularly)
|
||||
if (CryogenIndex == -1 && !ShouldDrawRegularly && Main.LocalPlayer.Calamity().monolithCryogenShader <= 0)
|
||||
{
|
||||
UpdateCryogenIndex();
|
||||
if (FadeoutTimer == 0)
|
||||
@@ -89,7 +89,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,6 @@ namespace CalamityMod.Skies
|
||||
|
||||
public override void Deactivate(params object[] args) { }
|
||||
|
||||
public override bool IsActive() => CanSkyBeActive && !Main.gameMenu;
|
||||
public override bool IsActive() => (CanSkyBeActive || Main.LocalPlayer?.Calamity()?.monolithExoShader > 0) && !Main.gameMenu;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
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 AstralProjectorTile : ModTile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
RegisterItemDrop(ModContent.ItemType<AstralProjector>());
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX);
|
||||
TileObjectData.newTile.Height = 3;
|
||||
TileObjectData.newTile.Origin = new Point16(0, 1);
|
||||
TileObjectData.newTile.CoordinateHeights = new[] { 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);
|
||||
|
||||
TileID.Sets.HasOutlines[Type] = true;
|
||||
AddMapEntry(new Color(92, 24, 31));
|
||||
|
||||
DustType = ModContent.DustType<AstralOrange>();
|
||||
AnimationFrameHeight = 54;
|
||||
}
|
||||
|
||||
public override void NearbyEffects(int i, int j, bool closer)
|
||||
{
|
||||
if (Main.tile[i, j].TileFrameY < 54)
|
||||
{
|
||||
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 AnimateIndividualTile(int type, int i, int j, ref int frameXOffset, ref int frameYOffset)
|
||||
{
|
||||
}
|
||||
|
||||
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 = 16;
|
||||
int animate = 0;
|
||||
if (tile.TileFrameY >= 54)
|
||||
{
|
||||
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.8 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,144 @@
|
||||
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, 1);
|
||||
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, 3, 0);
|
||||
TileObjectData.addTile(Type);
|
||||
|
||||
TileID.Sets.HasOutlines[Type] = true;
|
||||
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 AnimateIndividualTile(int type, int i, int j, ref int frameXOffset, ref int frameYOffset)
|
||||
{
|
||||
}
|
||||
|
||||
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 = 16;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 314 B |
|
Before Width: | Height: | Size: 452 B |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
@@ -0,0 +1,151 @@
|
||||
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 ExoObeliskTile : ModTile
|
||||
{
|
||||
public static Texture2D Glow;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
if (!Main.dedServ)
|
||||
{
|
||||
Glow = ModContent.Request<Texture2D>("CalamityMod/Tiles/Furniture/Monoliths/ExoObeliskTile_Glow").Value;
|
||||
}
|
||||
RegisterItemDrop(ModContent.ItemType<ExoObelisk>());
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4);
|
||||
TileObjectData.newTile.Height = 5;
|
||||
TileObjectData.newTile.Origin = new Point16(0, 1);
|
||||
TileObjectData.newTile.CoordinateHeights = new[] { 16, 16, 16, 16, 16 };
|
||||
TileObjectData.newTile.LavaDeath = false;
|
||||
TileObjectData.newTile.UsesCustomCanPlace = true;
|
||||
TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop, 3, 0);
|
||||
TileObjectData.addTile(Type);
|
||||
|
||||
TileID.Sets.HasOutlines[Type] = true;
|
||||
AddMapEntry(new Color(92, 24, 31));
|
||||
|
||||
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 >= 7.2)
|
||||
{
|
||||
frameCounter = 0;
|
||||
if (++frame >= 2)
|
||||
{
|
||||
frame = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override void AnimateIndividualTile(int type, int i, int j, ref int frameXOffset, ref int frameYOffset)
|
||||
{
|
||||
}
|
||||
|
||||
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 = 16;
|
||||
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);
|
||||
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: 947 B |
|
After Width: | Height: | Size: 321 B |
|
After Width: | Height: | Size: 463 B |
@@ -0,0 +1,145 @@
|
||||
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.Style2xX);
|
||||
TileObjectData.newTile.Height = 3;
|
||||
TileObjectData.newTile.Origin = new Point16(0, 1);
|
||||
TileObjectData.newTile.CoordinateHeights = new[] { 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);
|
||||
|
||||
TileID.Sets.HasOutlines[Type] = true;
|
||||
AddMapEntry(new Color(92, 24, 31));
|
||||
|
||||
DustType = ModContent.DustType<AstralOrange>();
|
||||
AnimationFrameHeight = 52;
|
||||
}
|
||||
|
||||
public override void NearbyEffects(int i, int j, bool closer)
|
||||
{
|
||||
if (Main.tile[i, j].TileFrameY < 52)
|
||||
{
|
||||
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 >= 9)
|
||||
{
|
||||
frame = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override void AnimateIndividualTile(int type, int i, int j, ref int frameXOffset, ref int frameYOffset)
|
||||
{
|
||||
}
|
||||
|
||||
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 % 2;
|
||||
int y = j - Main.tile[i, j].TileFrameY / 18 % 3;
|
||||
int tileXX18 = 18 * 3;
|
||||
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 = 16;
|
||||
int animate = 0;
|
||||
if (tile.TileFrameY >= 52)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
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 PlagueHumidifierTile : ModTile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
RegisterItemDrop(ModContent.ItemType<PlagueHumidifier>());
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX);
|
||||
TileObjectData.newTile.Height = 3;
|
||||
TileObjectData.newTile.Origin = new Point16(0, 1);
|
||||
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);
|
||||
|
||||
TileID.Sets.HasOutlines[Type] = true;
|
||||
AddMapEntry(new Color(92, 24, 31));
|
||||
|
||||
DustType = (int)CalamityDusts.Plague;
|
||||
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().monolithPlagueShader = 30;
|
||||
}
|
||||
}
|
||||
|
||||
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 AnimateIndividualTile(int type, int i, int j, ref int frameXOffset, ref int frameYOffset)
|
||||
{
|
||||
}
|
||||
|
||||
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 = 18 * 4;
|
||||
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 = 16;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |