diff --git a/Buffs/StatBuffs/KamiBuff.cs b/Buffs/StatBuffs/KamiBuff.cs index 308e8075fb..c13e4f3af0 100644 --- a/Buffs/StatBuffs/KamiBuff.cs +++ b/Buffs/StatBuffs/KamiBuff.cs @@ -20,6 +20,8 @@ namespace CalamityMod.Buffs.StatBuffs public override void Update(Player player, ref int buffIndex) { player.Calamity().kamiBoost = true; + if (player.buffTime[buffIndex] == 1) + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YanmeiKnifeExpire"), player.Center); } } } diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 8bddb5ed51..2497e1f6f8 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -109,6 +109,8 @@ namespace CalamityMod.CalPlayer public int evilSmasherBoost = 0; public int hellbornBoost = 0; public float animusBoost = 1f; + public int searedPanCounter = 0; + public int searedPanTimer = 0; public int potionTimer = 0; public bool noWings = false; public bool blockAllDashes = false; @@ -2516,6 +2518,8 @@ namespace CalamityMod.CalPlayer evilSmasherBoost = 0; hellbornBoost = 0; animusBoost = 1f; + searedPanCounter = 0; + searedPanTimer = 0; potionTimer = 0; bloodflareCoreLostDefense = 0; persecutedEnchantSummonTimer = 0; @@ -9512,20 +9516,25 @@ namespace CalamityMod.CalPlayer stealthAcceleration = 1f; // Reset acceleration when you attack float lossReductionRatio = flatStealthLossReduction / (rogueStealthMax * 100f); + float remainingStealth = rogueStealthMax * lossReductionRatio; + float stealthToLose = rogueStealthMax - remainingStealth; + // You cannot lose less than one stealth point. + if (stealthToLose < 0.01f) + stealthToLose = 0.01f; if (stealthStrikeHalfCost) { - rogueStealth -= 0.5f * rogueStealthMax - lossReductionRatio; + rogueStealth -= 0.5f * stealthToLose; if (rogueStealth <= 0f) rogueStealth = 0f; } else if (stealthStrike75Cost) { - rogueStealth -= 0.75f * rogueStealthMax - lossReductionRatio; + rogueStealth -= 0.75f * stealthToLose; if (rogueStealth <= 0f) rogueStealth = 0f; } else - rogueStealth = lossReductionRatio; + rogueStealth = remainingStealth; } #endregion diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 39118dbff6..95181b2af5 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -22,6 +22,7 @@ using CalamityMod.Items.Potions; using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; using CalamityMod.NPCs; using CalamityMod.NPCs.AcidRain; @@ -2820,12 +2821,28 @@ namespace CalamityMod.CalPlayer if (player.ActiveItem().type != ModContent.ItemType()) modPlayer.planarSpeedBoost = 0; } - if (modPlayer.brimlashBusterBoost) { - if (player.ActiveItem().type != ModContent.ItemType() && player.ActiveItem().type != ModContent.ItemType()) + if (player.ActiveItem().type != ModContent.ItemType()) modPlayer.brimlashBusterBoost = false; } + if (modPlayer.evilSmasherBoost > 0) + { + if (player.ActiveItem().type != ModContent.ItemType()) + modPlayer.evilSmasherBoost = 0; + } + if (modPlayer.searedPanCounter > 0) + { + if (player.ActiveItem().type != ModContent.ItemType()) + { + modPlayer.searedPanCounter = 0; + modPlayer.searedPanTimer = 0; + } + else if (modPlayer.searedPanTimer < SearedPan.ConsecutiveHitOpening) + modPlayer.searedPanTimer++; + else + modPlayer.searedPanCounter = 0; + } if (modPlayer.animusBoost > 1f) { if (player.ActiveItem().type != ModContent.ItemType()) diff --git a/Effects/CalamityShaders.cs b/Effects/CalamityShaders.cs index 87f39b619a..7fa74f1cc4 100644 --- a/Effects/CalamityShaders.cs +++ b/Effects/CalamityShaders.cs @@ -24,6 +24,7 @@ namespace CalamityMod.Effects public static Effect ImpFlameTrailShader; public static Effect SCalShieldShader; public static Effect RancorMagicCircleShader; + public static Effect DoGDisintegrationShader; public static Effect BaseFusableParticleEdgeShader; public static Effect AdditiveFusableParticleEdgeShader; @@ -51,6 +52,7 @@ namespace CalamityMod.Effects ImpFlameTrailShader = CalamityMod.Instance.GetEffect("Effects/ImpFlameTrail"); SCalShieldShader = CalamityMod.Instance.GetEffect("Effects/SupremeShieldShader"); RancorMagicCircleShader = CalamityMod.Instance.GetEffect("Effects/RancorMagicCircle"); + DoGDisintegrationShader = CalamityMod.Instance.GetEffect("Effects/DoGDisintegration"); BaseFusableParticleEdgeShader = CalamityMod.Instance.GetEffect("Effects/ParticleFusion/BaseFusableParticleEdgeShader"); AdditiveFusableParticleEdgeShader = CalamityMod.Instance.GetEffect("Effects/ParticleFusion/AdditiveFusableParticleEdgeShader"); @@ -76,6 +78,7 @@ namespace CalamityMod.Effects GameShaders.Misc["CalamityMod:ImpFlameTrail"] = new MiscShaderData(new Ref(ImpFlameTrailShader), "TrailPass"); GameShaders.Misc["CalamityMod:SupremeShield"] = new MiscShaderData(new Ref(SCalShieldShader), "ShieldPass"); GameShaders.Misc["CalamityMod:RancorMagicCircle"] = new MiscShaderData(new Ref(RancorMagicCircleShader), "ShieldPass"); + GameShaders.Misc["CalamityMod:DoGDisintegration"] = new MiscShaderData(new Ref(DoGDisintegrationShader), "DisintegrationPass"); GameShaders.Misc["CalamityMod:BaseFusableParticleEdge"] = new MiscShaderData(new Ref(BaseFusableParticleEdgeShader), "ParticlePass"); GameShaders.Misc["CalamityMod:AdditiveFusableParticleEdge"] = new MiscShaderData(new Ref(AdditiveFusableParticleEdgeShader), "ParticlePass"); diff --git a/Effects/DoGDisintegration.fx b/Effects/DoGDisintegration.fx new file mode 100644 index 0000000000..f3aa4829c5 --- /dev/null +++ b/Effects/DoGDisintegration.fx @@ -0,0 +1,45 @@ +sampler uImage0 : register(s0); +sampler uImage1 : register(s1); +float3 uColor; +float3 uSecondaryColor; +float uOpacity : register(C0); +float uSaturation; +float uRotation; +float uTime; +float4 uSourceRect; +float2 uWorldPosition; +float uDirection; +float3 uLightSource; +float2 uImageSize0; +float2 uImageSize1; + +// This shader is largely based on code used for ExampleMod's cool death animation thing; it is suprisingly useful for this use case. +float4 PixelShaderFunction(float2 coords : TEXCOORD0) : COLOR0 +{ + float4 color = tex2D(uImage0, coords); + if (!any(color)) + return color; + + float fade = pow(saturate(1 - uOpacity), 0.7); + float4 color1 = tex2D(uImage1, float2(coords.x, frac(coords.y + uSaturation * 0.11)) * 0.3); + + float readRed = fade * 1.05; + + if (color1.r > readRed) + { + color.rgba = 0; + } + else if (color1.b > fade) + { + color = float4(1, 105.0 / 255, 180.0 / 255, 1); + } + return color; +} + +technique Technique1 +{ + pass DisintegrationPass + { + PixelShader = compile ps_2_0 PixelShaderFunction(); + } +} \ No newline at end of file diff --git a/Effects/DoGDisintegration.xnb b/Effects/DoGDisintegration.xnb new file mode 100644 index 0000000000..74ece6cc70 Binary files /dev/null and b/Effects/DoGDisintegration.xnb differ diff --git a/ILEditing/ILChanges.cs b/ILEditing/ILChanges.cs index ada7a28c23..c401754ec7 100644 --- a/ILEditing/ILChanges.cs +++ b/ILEditing/ILChanges.cs @@ -8,6 +8,7 @@ using CalamityMod.NPCs.Ravager; using CalamityMod.Particles; using CalamityMod.Projectiles; using CalamityMod.Tiles.DraedonStructures; +using CalamityMod.Tiles.FurnitureExo; using CalamityMod.Waters; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -101,6 +102,8 @@ namespace CalamityMod.ILEditing private static int labDoorClosed = -1; private static int aLabDoorOpen = -1; private static int aLabDoorClosed = -1; + private static int exoDoorOpen = -1; + private static int exoDoorClosed = -1; #region Load / Unload /// @@ -112,11 +115,13 @@ namespace CalamityMod.ILEditing var updateTime = typeof(Main).GetMethod("UpdateTime_SpawnTownNPCs", BindingFlags.Static | BindingFlags.NonPublic); VanillaSpawnTownNPCs = Delegate.CreateDelegate(typeof(Action), updateTime) as Action; - // Cache the four lab door tile types for efficiency. + // Cache the six lab door tile types for efficiency. labDoorOpen = ModContent.TileType(); labDoorClosed = ModContent.TileType(); aLabDoorOpen = ModContent.TileType(); aLabDoorClosed = ModContent.TileType(); + exoDoorOpen = ModContent.TileType(); + exoDoorClosed = ModContent.TileType(); // Mechanics / features On.Terraria.NPC.ApplyTileCollision += AllowTriggeredFallthrough; @@ -189,7 +194,7 @@ namespace CalamityMod.ILEditing internal static void Unload() { VanillaSpawnTownNPCs = null; - labDoorOpen = labDoorClosed = aLabDoorOpen = aLabDoorClosed = -1; + labDoorOpen = labDoorClosed = aLabDoorOpen = aLabDoorClosed = exoDoorClosed = exoDoorOpen = -1; // Mechanics / features On.Terraria.NPC.ApplyTileCollision -= AllowTriggeredFallthrough; @@ -449,6 +454,8 @@ namespace CalamityMod.ILEditing return OpenLabDoor(tile, i, j, labDoorOpen); else if (tile.type == aLabDoorClosed) return OpenLabDoor(tile, i, j, aLabDoorOpen); + else if (tile.type == exoDoorClosed) + return OpenLabDoor(tile, i, j, exoDoorOpen); // If it's anything else, let vanilla and/or TML handle it. return orig(i, j, direction); @@ -466,6 +473,8 @@ namespace CalamityMod.ILEditing return CloseLabDoor(tile, i, j, labDoorClosed); else if (tile.type == aLabDoorOpen) return CloseLabDoor(tile, i, j, aLabDoorClosed); + else if (tile.type == exoDoorOpen) + return CloseLabDoor(tile, i, j, exoDoorClosed); // If it's anything else, let vanilla and/or TML handle it. return orig(i, j, forced); diff --git a/Items/Accessories/CoinofDeceit.cs b/Items/Accessories/CoinofDeceit.cs index 5b2c245624..634ba85c28 100644 --- a/Items/Accessories/CoinofDeceit.cs +++ b/Items/Accessories/CoinofDeceit.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Armor/Vanity/CalamityHood.cs b/Items/Armor/Vanity/CalamityHood.cs new file mode 100644 index 0000000000..1f1a28f7c1 --- /dev/null +++ b/Items/Armor/Vanity/CalamityHood.cs @@ -0,0 +1,27 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Armor.Vanity +{ + [AutoloadEquip(EquipType.Head)] + public class CalamityHood : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hood of Calamity"); + } + + public override void SetDefaults() + { + item.width = 26; + item.height = 24; + item.rare = ItemRarityID.Lime; + item.vanity = true; + item.Calamity().donorItem = true; + item.value = Item.sellPrice(gold: 2); + } + + public override bool DrawHead() => false; + } +} diff --git a/Items/Armor/Vanity/CalamityHood.png b/Items/Armor/Vanity/CalamityHood.png new file mode 100644 index 0000000000..f6aceb2325 Binary files /dev/null and b/Items/Armor/Vanity/CalamityHood.png differ diff --git a/Items/Armor/Vanity/CalamityHood_Head.png b/Items/Armor/Vanity/CalamityHood_Head.png new file mode 100644 index 0000000000..e2e6d41084 Binary files /dev/null and b/Items/Armor/Vanity/CalamityHood_Head.png differ diff --git a/Items/Armor/Vanity/CalamityRobes.cs b/Items/Armor/Vanity/CalamityRobes.cs new file mode 100644 index 0000000000..48234d602d --- /dev/null +++ b/Items/Armor/Vanity/CalamityRobes.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Armor.Vanity +{ + [AutoloadEquip(EquipType.Body)] + public class CalamityRobes : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Robes of Calamity"); + } + + public override void SetDefaults() + { + item.width = 26; + item.height = 20; + item.rare = ItemRarityID.Lime; + item.vanity = true; + item.Calamity().donorItem = true; + item.value = Item.sellPrice(gold: 2); + } + } +} diff --git a/Items/Armor/Vanity/CalamityRobes.png b/Items/Armor/Vanity/CalamityRobes.png new file mode 100644 index 0000000000..b6a359895b Binary files /dev/null and b/Items/Armor/Vanity/CalamityRobes.png differ diff --git a/Items/Armor/Vanity/CalamityRobes_Arms.png b/Items/Armor/Vanity/CalamityRobes_Arms.png new file mode 100644 index 0000000000..2959e29230 Binary files /dev/null and b/Items/Armor/Vanity/CalamityRobes_Arms.png differ diff --git a/Items/Armor/Vanity/CalamityRobes_Body.png b/Items/Armor/Vanity/CalamityRobes_Body.png new file mode 100644 index 0000000000..5b594f0a1d Binary files /dev/null and b/Items/Armor/Vanity/CalamityRobes_Body.png differ diff --git a/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs b/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs index a2d34352c4..e31af3efac 100644 --- a/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs +++ b/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs @@ -26,7 +26,7 @@ The life regen boost is stronger if below 75% health { item.width = 44; item.height = 36; - item.maxStack = 999; + item.maxStack = 30; item.useTurn = true; item.value = Item.sellPrice(gold: 5); item.rare = ItemRarityID.Purple; diff --git a/Items/Fishing/SulphurCatches/AbyssalCrate.cs b/Items/Fishing/SulphurCatches/AbyssalCrate.cs index c6745cf562..d0f3985d50 100644 --- a/Items/Fishing/SulphurCatches/AbyssalCrate.cs +++ b/Items/Fishing/SulphurCatches/AbyssalCrate.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Accessories; using CalamityMod.Items.Pets; +using CalamityMod.Items.Placeables; using CalamityMod.Items.Potions; using CalamityMod.Items.Tools.ClimateChange; using CalamityMod.Items.Weapons.Magic; @@ -14,7 +15,6 @@ using Terraria.ID; using Terraria.ModLoader; using CrateTile = CalamityMod.Tiles.Abyss.AbyssalCrateTile; -using CalamityMod.Items.Placeables; namespace CalamityMod.Items.Fishing.SulphurCatches { diff --git a/Items/Materials/Acidwood.cs b/Items/Materials/Acidwood.cs deleted file mode 100644 index a897376db9..0000000000 --- a/Items/Materials/Acidwood.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Terraria.ModLoader; - -namespace CalamityMod.Items.Materials -{ - public class Acidwood : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Acidwood"); - } - - public override void SetDefaults() - { - item.width = 26; - item.height = 22; - item.maxStack = 999; - item.value = 0; - } - } -} diff --git a/Items/Materials/ExoPrism.cs b/Items/Materials/ExoPrism.cs index 640a5fb3ec..a94dc738a2 100644 --- a/Items/Materials/ExoPrism.cs +++ b/Items/Materials/ExoPrism.cs @@ -1,3 +1,4 @@ +using CalamityMod.Items.Placeables.FurnitureExo; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -58,5 +59,13 @@ namespace CalamityMod.Items.Materials exoShine.noGravity = true; } } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 2); + recipe.SetResult(this); + recipe.AddRecipe(); + } } } diff --git a/Items/Placeables/Acidwood.cs b/Items/Placeables/Acidwood.cs new file mode 100644 index 0000000000..02433713a9 --- /dev/null +++ b/Items/Placeables/Acidwood.cs @@ -0,0 +1,37 @@ +using CalamityMod.Items.Placeables.FurnitureAcidwood; +using CalamityMod.Tiles.Abyss; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables +{ + public class Acidwood : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Acidwood"); + } + + public override void SetDefaults() + { + item.width = 26; + item.height = 22; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 2); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Materials/Acidwood.png b/Items/Placeables/Acidwood.png similarity index 100% rename from Items/Materials/Acidwood.png rename to Items/Placeables/Acidwood.png diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodBathtub.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodBathtub.cs new file mode 100644 index 0000000000..05012b4408 --- /dev/null +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodBathtub.cs @@ -0,0 +1,36 @@ +using CalamityMod.Tiles.FurnitureAcidwood; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureAcidwood +{ + public class AcidwoodBathtub : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Acidwood Bathtub"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 14); + recipe.SetResult(this); + recipe.AddTile(TileID.Sawmill); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodBathtub.png b/Items/Placeables/FurnitureAcidwood/AcidwoodBathtub.png new file mode 100644 index 0000000000..916a85932d Binary files /dev/null and b/Items/Placeables/FurnitureAcidwood/AcidwoodBathtub.png differ diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodBed.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodBed.cs new file mode 100644 index 0000000000..90217fe60b --- /dev/null +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodBed.cs @@ -0,0 +1,37 @@ +using CalamityMod.Tiles.FurnitureAcidwood; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureAcidwood +{ + public class AcidwoodBed : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Acidwood Bed"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 15); + recipe.AddIngredient(ItemID.Silk, 5); + recipe.SetResult(this); + recipe.AddTile(TileID.Sawmill); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodBed.png b/Items/Placeables/FurnitureAcidwood/AcidwoodBed.png new file mode 100644 index 0000000000..908498cab8 Binary files /dev/null and b/Items/Placeables/FurnitureAcidwood/AcidwoodBed.png differ diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodBench.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodBench.cs new file mode 100644 index 0000000000..2697958daa --- /dev/null +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodBench.cs @@ -0,0 +1,36 @@ +using CalamityMod.Tiles.FurnitureAcidwood; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureAcidwood +{ + public class AcidwoodBench : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Acidwood Bench"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 8); + recipe.SetResult(this); + recipe.AddTile(TileID.Sawmill); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodBench.png b/Items/Placeables/FurnitureAcidwood/AcidwoodBench.png new file mode 100644 index 0000000000..1e7e029e1c Binary files /dev/null and b/Items/Placeables/FurnitureAcidwood/AcidwoodBench.png differ diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodBookcase.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodBookcase.cs new file mode 100644 index 0000000000..119daa6840 --- /dev/null +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodBookcase.cs @@ -0,0 +1,37 @@ +using CalamityMod.Tiles.FurnitureAcidwood; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureAcidwood +{ + public class AcidwoodBookcase : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Acidwood Bookcase"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 20); + recipe.AddIngredient(ItemID.Book, 10); + recipe.SetResult(this); + recipe.AddTile(TileID.Sawmill); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodBookcase.png b/Items/Placeables/FurnitureAcidwood/AcidwoodBookcase.png new file mode 100644 index 0000000000..b14161c5af Binary files /dev/null and b/Items/Placeables/FurnitureAcidwood/AcidwoodBookcase.png differ diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodCandelabra.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodCandelabra.cs new file mode 100644 index 0000000000..fad204ae18 --- /dev/null +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodCandelabra.cs @@ -0,0 +1,37 @@ +using CalamityMod.Tiles.FurnitureAcidwood; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureAcidwood +{ + public class AcidwoodCandelabra : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Acidwood Candelabra"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ItemID.Torch, 3); + recipe.SetResult(this); + recipe.AddTile(TileID.WorkBenches); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodCandelabra.png b/Items/Placeables/FurnitureAcidwood/AcidwoodCandelabra.png new file mode 100644 index 0000000000..a829ae4872 Binary files /dev/null and b/Items/Placeables/FurnitureAcidwood/AcidwoodCandelabra.png differ diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodCandle.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodCandle.cs new file mode 100644 index 0000000000..d8237f350c --- /dev/null +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodCandle.cs @@ -0,0 +1,37 @@ +using CalamityMod.Tiles.FurnitureAcidwood; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureAcidwood +{ + public class AcidwoodCandle : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Acidwood Candle"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 4); + recipe.AddIngredient(ItemID.Torch); + recipe.SetResult(this); + recipe.AddTile(TileID.WorkBenches); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodCandle.png b/Items/Placeables/FurnitureAcidwood/AcidwoodCandle.png new file mode 100644 index 0000000000..ec296ce9ca Binary files /dev/null and b/Items/Placeables/FurnitureAcidwood/AcidwoodCandle.png differ diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodChair.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodChair.cs new file mode 100644 index 0000000000..5d546eaac6 --- /dev/null +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodChair.cs @@ -0,0 +1,36 @@ +using CalamityMod.Tiles.FurnitureAcidwood; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureAcidwood +{ + public class AcidwoodChair : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Acidwood Chair"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 4); + recipe.SetResult(this); + recipe.AddTile(TileID.WorkBenches); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodChair.png b/Items/Placeables/FurnitureAcidwood/AcidwoodChair.png new file mode 100644 index 0000000000..0f16aa98ac Binary files /dev/null and b/Items/Placeables/FurnitureAcidwood/AcidwoodChair.png differ diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodChandelier.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodChandelier.cs new file mode 100644 index 0000000000..79d8fc44b9 --- /dev/null +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodChandelier.cs @@ -0,0 +1,38 @@ +using CalamityMod.Tiles.FurnitureAcidwood; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureAcidwood +{ + public class AcidwoodChandelier : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Acidwood Chandelier"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 4); + recipe.AddIngredient(ItemID.Torch, 4); + recipe.AddIngredient(ItemID.Chain); + recipe.SetResult(this); + recipe.AddTile(TileID.Anvils); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodChandelier.png b/Items/Placeables/FurnitureAcidwood/AcidwoodChandelier.png new file mode 100644 index 0000000000..3c1b823e70 Binary files /dev/null and b/Items/Placeables/FurnitureAcidwood/AcidwoodChandelier.png differ diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodChest.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodChest.cs new file mode 100644 index 0000000000..1d168991d3 --- /dev/null +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodChest.cs @@ -0,0 +1,38 @@ +using CalamityMod.Tiles.FurnitureAcidwood; +using Terraria.ModLoader; +using Terraria.ID; +namespace CalamityMod.Items.Placeables.FurnitureAcidwood +{ + public class AcidwoodChest : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Acidwood Chest"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 8); + recipe.AddIngredient(ItemID.IronBar, 2); + recipe.anyIronBar = true; + recipe.SetResult(this); + recipe.AddTile(TileID.WorkBenches); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodChest.png b/Items/Placeables/FurnitureAcidwood/AcidwoodChest.png new file mode 100644 index 0000000000..d9ec8f7738 Binary files /dev/null and b/Items/Placeables/FurnitureAcidwood/AcidwoodChest.png differ diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodClock.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodClock.cs new file mode 100644 index 0000000000..82e5c63f11 --- /dev/null +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodClock.cs @@ -0,0 +1,39 @@ +using CalamityMod.Tiles.FurnitureAcidwood; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureAcidwood +{ + public class AcidwoodClock : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Acidwood Clock"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.IronBar, 3); + recipe.anyIronBar = true; + recipe.AddIngredient(ItemID.Glass, 6); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.SetResult(this); + recipe.AddTile(TileID.Sawmill); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodClock.png b/Items/Placeables/FurnitureAcidwood/AcidwoodClock.png new file mode 100644 index 0000000000..d59b065140 Binary files /dev/null and b/Items/Placeables/FurnitureAcidwood/AcidwoodClock.png differ diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodDoor.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodDoor.cs new file mode 100644 index 0000000000..1a9bcbb6d1 --- /dev/null +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodDoor.cs @@ -0,0 +1,36 @@ +using CalamityMod.Tiles.FurnitureAcidwood; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureAcidwood +{ + public class AcidwoodDoor : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Acidwood Door"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 6); + recipe.SetResult(this); + recipe.AddTile(TileID.WorkBenches); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodDoor.png b/Items/Placeables/FurnitureAcidwood/AcidwoodDoor.png new file mode 100644 index 0000000000..3cf58c7e32 Binary files /dev/null and b/Items/Placeables/FurnitureAcidwood/AcidwoodDoor.png differ diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodDresser.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodDresser.cs new file mode 100644 index 0000000000..d17c73a437 --- /dev/null +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodDresser.cs @@ -0,0 +1,36 @@ +using CalamityMod.Tiles.FurnitureAcidwood; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureAcidwood +{ + public class AcidwoodDresser : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Acidwood Dresser"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 16); + recipe.SetResult(this); + recipe.AddTile(TileID.Sawmill); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodDresser.png b/Items/Placeables/FurnitureAcidwood/AcidwoodDresser.png new file mode 100644 index 0000000000..42ffd1118e Binary files /dev/null and b/Items/Placeables/FurnitureAcidwood/AcidwoodDresser.png differ diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodLamp.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodLamp.cs new file mode 100644 index 0000000000..baacf6c62d --- /dev/null +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodLamp.cs @@ -0,0 +1,37 @@ +using CalamityMod.Tiles.FurnitureAcidwood; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureAcidwood +{ + public class AcidwoodLamp : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Acidwood Lamp"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 3); + recipe.AddIngredient(ItemID.Torch); + recipe.SetResult(this); + recipe.AddTile(TileID.WorkBenches); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodLamp.png b/Items/Placeables/FurnitureAcidwood/AcidwoodLamp.png new file mode 100644 index 0000000000..91daa9848b Binary files /dev/null and b/Items/Placeables/FurnitureAcidwood/AcidwoodLamp.png differ diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodLantern.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodLantern.cs new file mode 100644 index 0000000000..ffc9a0f05a --- /dev/null +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodLantern.cs @@ -0,0 +1,37 @@ +using CalamityMod.Tiles.FurnitureAcidwood; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureAcidwood +{ + public class AcidwoodLantern : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Acidwood Lantern"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 6); + recipe.AddIngredient(ItemID.Torch); + recipe.SetResult(this); + recipe.AddTile(TileID.WorkBenches); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodLantern.png b/Items/Placeables/FurnitureAcidwood/AcidwoodLantern.png new file mode 100644 index 0000000000..53d9583bb8 Binary files /dev/null and b/Items/Placeables/FurnitureAcidwood/AcidwoodLantern.png differ diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodPiano.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodPiano.cs new file mode 100644 index 0000000000..4e1dfb90de --- /dev/null +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodPiano.cs @@ -0,0 +1,38 @@ +using CalamityMod.Tiles.FurnitureAcidwood; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureAcidwood +{ + public class AcidwoodPiano : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Acidwood Piano"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Bone, 4); + recipe.AddIngredient(ModContent.ItemType(), 15); + recipe.AddIngredient(ItemID.Book); + recipe.SetResult(this); + recipe.AddTile(TileID.Sawmill); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodPiano.png b/Items/Placeables/FurnitureAcidwood/AcidwoodPiano.png new file mode 100644 index 0000000000..424ffc4425 Binary files /dev/null and b/Items/Placeables/FurnitureAcidwood/AcidwoodPiano.png differ diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodPlatform.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodPlatform.cs new file mode 100644 index 0000000000..31d2a18a6e --- /dev/null +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodPlatform.cs @@ -0,0 +1,36 @@ +using CalamityMod.Tiles.FurnitureAcidwood; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureAcidwood +{ + public class AcidwoodPlatform : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Acidwood Platform"); + item.width = 8; + item.height = 10; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); + recipe.SetResult(this, 2); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodPlatform.png b/Items/Placeables/FurnitureAcidwood/AcidwoodPlatform.png new file mode 100644 index 0000000000..55fbbaf2b9 Binary files /dev/null and b/Items/Placeables/FurnitureAcidwood/AcidwoodPlatform.png differ diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodSink.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodSink.cs new file mode 100644 index 0000000000..75e6f084d4 --- /dev/null +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodSink.cs @@ -0,0 +1,38 @@ +using CalamityMod.Tiles.FurnitureAcidwood; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureAcidwood +{ + public class AcidwoodSink : ModItem + { + public override void SetStaticDefaults() + { + Tooltip.SetDefault("Counts as a water source"); + } + + public override void SetDefaults() + { + item.SetNameOverride("Acidwood Sink"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 6); + recipe.AddIngredient(ItemID.WaterBucket); + recipe.SetResult(this); + recipe.AddTile(TileID.WorkBenches); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodSink.png b/Items/Placeables/FurnitureAcidwood/AcidwoodSink.png new file mode 100644 index 0000000000..99ced356b3 Binary files /dev/null and b/Items/Placeables/FurnitureAcidwood/AcidwoodSink.png differ diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodTable.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodTable.cs new file mode 100644 index 0000000000..f126456a9d --- /dev/null +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodTable.cs @@ -0,0 +1,36 @@ +using CalamityMod.Tiles.FurnitureAcidwood; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureAcidwood +{ + public class AcidwoodTable : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Acidwood Table"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 8); + recipe.SetResult(this); + recipe.AddTile(TileID.WorkBenches); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodTable.png b/Items/Placeables/FurnitureAcidwood/AcidwoodTable.png new file mode 100644 index 0000000000..ba0c836746 Binary files /dev/null and b/Items/Placeables/FurnitureAcidwood/AcidwoodTable.png differ diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodWorkbench.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodWorkbench.cs new file mode 100644 index 0000000000..c17a1cb6b8 --- /dev/null +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodWorkbench.cs @@ -0,0 +1,35 @@ +using CalamityMod.Tiles.FurnitureAcidwood; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureAcidwood +{ + public class AcidwoodWorkbench : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Acidwood Work Bench"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodWorkbench.png b/Items/Placeables/FurnitureAcidwood/AcidwoodWorkbench.png new file mode 100644 index 0000000000..79fca15272 Binary files /dev/null and b/Items/Placeables/FurnitureAcidwood/AcidwoodWorkbench.png differ diff --git a/Items/Placeables/FurnitureExo/ExoBathtub.cs b/Items/Placeables/FurnitureExo/ExoBathtub.cs new file mode 100644 index 0000000000..9cbf504b6b --- /dev/null +++ b/Items/Placeables/FurnitureExo/ExoBathtub.cs @@ -0,0 +1,39 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureExo; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureExo +{ + public class ExoBathtub : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Exo Bathtub"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + item.Calamity().customRarity = CalamityRarity.Violet; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 14); + recipe.SetResult(this); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureExo/ExoBathtub.png b/Items/Placeables/FurnitureExo/ExoBathtub.png new file mode 100644 index 0000000000..6880d45600 Binary files /dev/null and b/Items/Placeables/FurnitureExo/ExoBathtub.png differ diff --git a/Items/Placeables/FurnitureExo/ExoBed.cs b/Items/Placeables/FurnitureExo/ExoBed.cs new file mode 100644 index 0000000000..fd3aba5632 --- /dev/null +++ b/Items/Placeables/FurnitureExo/ExoBed.cs @@ -0,0 +1,40 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureExo; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureExo +{ + public class ExoBed : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Exo Bed"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + item.Calamity().customRarity = CalamityRarity.Violet; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 15); + recipe.AddIngredient(ItemID.Silk, 5); + recipe.SetResult(this); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureExo/ExoBed.png b/Items/Placeables/FurnitureExo/ExoBed.png new file mode 100644 index 0000000000..92c8b28d4c Binary files /dev/null and b/Items/Placeables/FurnitureExo/ExoBed.png differ diff --git a/Items/Placeables/FurnitureExo/ExoBookcase.cs b/Items/Placeables/FurnitureExo/ExoBookcase.cs new file mode 100644 index 0000000000..83ed2e24e1 --- /dev/null +++ b/Items/Placeables/FurnitureExo/ExoBookcase.cs @@ -0,0 +1,40 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureExo; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureExo +{ + public class ExoBookcase : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Exo Bookcase"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + item.Calamity().customRarity = CalamityRarity.Violet; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 20); + recipe.AddIngredient(ItemID.Book, 10); + recipe.SetResult(this); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureExo/ExoBookcase.png b/Items/Placeables/FurnitureExo/ExoBookcase.png new file mode 100644 index 0000000000..60e501c2ee Binary files /dev/null and b/Items/Placeables/FurnitureExo/ExoBookcase.png differ diff --git a/Items/Placeables/FurnitureExo/ExoCandelabra.cs b/Items/Placeables/FurnitureExo/ExoCandelabra.cs new file mode 100644 index 0000000000..8a903ead0b --- /dev/null +++ b/Items/Placeables/FurnitureExo/ExoCandelabra.cs @@ -0,0 +1,41 @@ +using CalamityMod.Items.DraedonMisc; +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureExo; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureExo +{ + public class ExoCandelabra : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Exo Candelabra"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + item.Calamity().customRarity = CalamityRarity.Violet; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ModContent.ItemType(), 3); + recipe.SetResult(this); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureExo/ExoCandelabra.png b/Items/Placeables/FurnitureExo/ExoCandelabra.png new file mode 100644 index 0000000000..77f5931b60 Binary files /dev/null and b/Items/Placeables/FurnitureExo/ExoCandelabra.png differ diff --git a/Items/Placeables/FurnitureExo/ExoCandle.cs b/Items/Placeables/FurnitureExo/ExoCandle.cs new file mode 100644 index 0000000000..2be22e83e9 --- /dev/null +++ b/Items/Placeables/FurnitureExo/ExoCandle.cs @@ -0,0 +1,41 @@ +using CalamityMod.Items.DraedonMisc; +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureExo; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureExo +{ + public class ExoCandle : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Exo Candle"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + item.Calamity().customRarity = CalamityRarity.Violet; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 4); + recipe.AddIngredient(ModContent.ItemType()); + recipe.SetResult(this); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureExo/ExoCandle.png b/Items/Placeables/FurnitureExo/ExoCandle.png new file mode 100644 index 0000000000..ecb21a80bb Binary files /dev/null and b/Items/Placeables/FurnitureExo/ExoCandle.png differ diff --git a/Items/Placeables/FurnitureExo/ExoChair.cs b/Items/Placeables/FurnitureExo/ExoChair.cs new file mode 100644 index 0000000000..84b73748e8 --- /dev/null +++ b/Items/Placeables/FurnitureExo/ExoChair.cs @@ -0,0 +1,39 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureExo; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureExo +{ + public class ExoChair : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Exo Chair"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + item.Calamity().customRarity = CalamityRarity.Violet; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 4); + recipe.SetResult(this); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureExo/ExoChair.png b/Items/Placeables/FurnitureExo/ExoChair.png new file mode 100644 index 0000000000..d05a9068f1 Binary files /dev/null and b/Items/Placeables/FurnitureExo/ExoChair.png differ diff --git a/Items/Placeables/FurnitureExo/ExoChandelier.cs b/Items/Placeables/FurnitureExo/ExoChandelier.cs new file mode 100644 index 0000000000..3e527167e8 --- /dev/null +++ b/Items/Placeables/FurnitureExo/ExoChandelier.cs @@ -0,0 +1,42 @@ +using CalamityMod.Items.DraedonMisc; +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureExo; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureExo +{ + public class ExoChandelier : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Exo Chandelier"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + item.Calamity().customRarity = CalamityRarity.Violet; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 4); + recipe.AddIngredient(ModContent.ItemType(), 4); + recipe.AddIngredient(ItemID.Chain); + recipe.SetResult(this); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureExo/ExoChandelier.png b/Items/Placeables/FurnitureExo/ExoChandelier.png new file mode 100644 index 0000000000..0922aa2f53 Binary files /dev/null and b/Items/Placeables/FurnitureExo/ExoChandelier.png differ diff --git a/Items/Placeables/FurnitureExo/ExoChest.cs b/Items/Placeables/FurnitureExo/ExoChest.cs new file mode 100644 index 0000000000..28770801a5 --- /dev/null +++ b/Items/Placeables/FurnitureExo/ExoChest.cs @@ -0,0 +1,40 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations;using CalamityMod.Tiles.FurnitureExo; +using Terraria.ModLoader; +using Terraria.ID; +namespace CalamityMod.Items.Placeables.FurnitureExo +{ + public class ExoChest : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Exo Chest"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + item.Calamity().customRarity = CalamityRarity.Violet; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 8); + recipe.AddIngredient(ItemID.IronBar, 2); + recipe.anyIronBar = true; + recipe.SetResult(this); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureExo/ExoChest.png b/Items/Placeables/FurnitureExo/ExoChest.png new file mode 100644 index 0000000000..cc2af1c875 Binary files /dev/null and b/Items/Placeables/FurnitureExo/ExoChest.png differ diff --git a/Items/Placeables/FurnitureExo/ExoClock.cs b/Items/Placeables/FurnitureExo/ExoClock.cs new file mode 100644 index 0000000000..59a9c267fd --- /dev/null +++ b/Items/Placeables/FurnitureExo/ExoClock.cs @@ -0,0 +1,42 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureExo; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureExo +{ + public class ExoClock : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Exo Clock"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + item.Calamity().customRarity = CalamityRarity.Violet; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.IronBar, 3); + recipe.anyIronBar = true; + recipe.AddIngredient(ItemID.Glass, 6); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.SetResult(this); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureExo/ExoClock.png b/Items/Placeables/FurnitureExo/ExoClock.png new file mode 100644 index 0000000000..e8da79bf33 Binary files /dev/null and b/Items/Placeables/FurnitureExo/ExoClock.png differ diff --git a/Items/Placeables/FurnitureExo/ExoConsole.cs b/Items/Placeables/FurnitureExo/ExoConsole.cs new file mode 100644 index 0000000000..749b9d701a --- /dev/null +++ b/Items/Placeables/FurnitureExo/ExoConsole.cs @@ -0,0 +1,41 @@ +using CalamityMod.Items.DraedonMisc; +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureExo; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureExo +{ + public class ExoConsole : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Exo Console"); + } + + public override void SetDefaults() + { + item.width = 12; + item.height = 12; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + item.Calamity().customRarity = CalamityRarity.Violet; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ModContent.ItemType(), 8); + recipe.SetResult(this); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureExo/ExoConsole.png b/Items/Placeables/FurnitureExo/ExoConsole.png new file mode 100644 index 0000000000..ddba757b24 Binary files /dev/null and b/Items/Placeables/FurnitureExo/ExoConsole.png differ diff --git a/Items/Placeables/FurnitureExo/ExoDisplay.cs b/Items/Placeables/FurnitureExo/ExoDisplay.cs new file mode 100644 index 0000000000..ac788d82bb --- /dev/null +++ b/Items/Placeables/FurnitureExo/ExoDisplay.cs @@ -0,0 +1,41 @@ +using CalamityMod.Items.DraedonMisc; +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureExo; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureExo +{ + public class ExoDisplay : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Exo Display"); + } + + public override void SetDefaults() + { + item.width = 12; + item.height = 12; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + item.Calamity().customRarity = CalamityRarity.Violet; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 15); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.SetResult(this); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureExo/ExoDisplay.png b/Items/Placeables/FurnitureExo/ExoDisplay.png new file mode 100644 index 0000000000..b6d5240a50 Binary files /dev/null and b/Items/Placeables/FurnitureExo/ExoDisplay.png differ diff --git a/Items/Placeables/FurnitureExo/ExoDoor.cs b/Items/Placeables/FurnitureExo/ExoDoor.cs new file mode 100644 index 0000000000..352d0679bf --- /dev/null +++ b/Items/Placeables/FurnitureExo/ExoDoor.cs @@ -0,0 +1,39 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureExo; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureExo +{ + public class ExoDoor : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Exo Door"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + item.Calamity().customRarity = CalamityRarity.Violet; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 8); + recipe.SetResult(this); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureExo/ExoDoor.png b/Items/Placeables/FurnitureExo/ExoDoor.png new file mode 100644 index 0000000000..f3ac108f31 Binary files /dev/null and b/Items/Placeables/FurnitureExo/ExoDoor.png differ diff --git a/Items/Placeables/FurnitureExo/ExoDresser.cs b/Items/Placeables/FurnitureExo/ExoDresser.cs new file mode 100644 index 0000000000..9d49b8de15 --- /dev/null +++ b/Items/Placeables/FurnitureExo/ExoDresser.cs @@ -0,0 +1,39 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureExo; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureExo +{ + public class ExoDresser : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Exo Dresser"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + item.Calamity().customRarity = CalamityRarity.Violet; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 16); + recipe.SetResult(this); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureExo/ExoDresser.png b/Items/Placeables/FurnitureExo/ExoDresser.png new file mode 100644 index 0000000000..de5f16b0e8 Binary files /dev/null and b/Items/Placeables/FurnitureExo/ExoDresser.png differ diff --git a/Items/Placeables/FurnitureExo/ExoKeyboard.cs b/Items/Placeables/FurnitureExo/ExoKeyboard.cs new file mode 100644 index 0000000000..d89ef829bf --- /dev/null +++ b/Items/Placeables/FurnitureExo/ExoKeyboard.cs @@ -0,0 +1,41 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureExo; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureExo +{ + public class ExoKeyboard : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Exo Keyboard"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + item.Calamity().customRarity = CalamityRarity.Violet; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Bone, 4); + recipe.AddIngredient(ModContent.ItemType(), 15); + recipe.AddIngredient(ItemID.Book); + recipe.SetResult(this); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureExo/ExoKeyboard.png b/Items/Placeables/FurnitureExo/ExoKeyboard.png new file mode 100644 index 0000000000..e229c36220 Binary files /dev/null and b/Items/Placeables/FurnitureExo/ExoKeyboard.png differ diff --git a/Items/Placeables/FurnitureExo/ExoLamp.cs b/Items/Placeables/FurnitureExo/ExoLamp.cs new file mode 100644 index 0000000000..d6cef4c3dd --- /dev/null +++ b/Items/Placeables/FurnitureExo/ExoLamp.cs @@ -0,0 +1,41 @@ +using CalamityMod.Items.DraedonMisc; +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureExo; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureExo +{ + public class ExoLamp : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Exo Lamp"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + item.Calamity().customRarity = CalamityRarity.Violet; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 3); + recipe.AddIngredient(ModContent.ItemType()); + recipe.SetResult(this); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureExo/ExoLamp.png b/Items/Placeables/FurnitureExo/ExoLamp.png new file mode 100644 index 0000000000..ce7fa784e5 Binary files /dev/null and b/Items/Placeables/FurnitureExo/ExoLamp.png differ diff --git a/Items/Placeables/FurnitureExo/ExoLantern.cs b/Items/Placeables/FurnitureExo/ExoLantern.cs new file mode 100644 index 0000000000..afd5145745 --- /dev/null +++ b/Items/Placeables/FurnitureExo/ExoLantern.cs @@ -0,0 +1,41 @@ +using CalamityMod.Items.DraedonMisc; +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureExo; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureExo +{ + public class ExoLantern : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Exo Lantern"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + item.Calamity().customRarity = CalamityRarity.Violet; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 6); + recipe.AddIngredient(ModContent.ItemType()); + recipe.SetResult(this); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureExo/ExoLantern.png b/Items/Placeables/FurnitureExo/ExoLantern.png new file mode 100644 index 0000000000..7e0ae420cc Binary files /dev/null and b/Items/Placeables/FurnitureExo/ExoLantern.png differ diff --git a/Items/Placeables/FurnitureExo/ExoPlatform.cs b/Items/Placeables/FurnitureExo/ExoPlatform.cs new file mode 100644 index 0000000000..6224121e90 --- /dev/null +++ b/Items/Placeables/FurnitureExo/ExoPlatform.cs @@ -0,0 +1,38 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.FurnitureExo; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureExo +{ + public class ExoPlatform : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Exo Platform"); + item.width = 8; + item.height = 10; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + item.Calamity().customRarity = CalamityRarity.Violet; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); + recipe.SetResult(this, 2); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureExo/ExoPlatform.png b/Items/Placeables/FurnitureExo/ExoPlatform.png new file mode 100644 index 0000000000..41d9e247d6 Binary files /dev/null and b/Items/Placeables/FurnitureExo/ExoPlatform.png differ diff --git a/Items/Placeables/FurnitureExo/ExoScreen.cs b/Items/Placeables/FurnitureExo/ExoScreen.cs new file mode 100644 index 0000000000..01bc744f99 --- /dev/null +++ b/Items/Placeables/FurnitureExo/ExoScreen.cs @@ -0,0 +1,41 @@ +using CalamityMod.Items.DraedonMisc; +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureExo; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureExo +{ + public class ExoScreen : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Exo Screen"); + } + + public override void SetDefaults() + { + item.width = 12; + item.height = 12; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + item.Calamity().customRarity = CalamityRarity.Violet; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ModContent.ItemType(), 3); + recipe.SetResult(this); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureExo/ExoScreen.png b/Items/Placeables/FurnitureExo/ExoScreen.png new file mode 100644 index 0000000000..955ee5904c Binary files /dev/null and b/Items/Placeables/FurnitureExo/ExoScreen.png differ diff --git a/Items/Placeables/FurnitureExo/ExoServer.cs b/Items/Placeables/FurnitureExo/ExoServer.cs new file mode 100644 index 0000000000..595a654aa7 --- /dev/null +++ b/Items/Placeables/FurnitureExo/ExoServer.cs @@ -0,0 +1,41 @@ +using CalamityMod.Items.DraedonMisc; +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureExo; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureExo +{ + public class ExoServer : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Exo Server"); + } + + public override void SetDefaults() + { + item.width = 12; + item.height = 12; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + item.Calamity().customRarity = CalamityRarity.Violet; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 12); + recipe.AddIngredient(ModContent.ItemType(), 15); + recipe.SetResult(this); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureExo/ExoServer.png b/Items/Placeables/FurnitureExo/ExoServer.png new file mode 100644 index 0000000000..a986b2e5d9 Binary files /dev/null and b/Items/Placeables/FurnitureExo/ExoServer.png differ diff --git a/Items/Placeables/FurnitureExo/ExoSink.cs b/Items/Placeables/FurnitureExo/ExoSink.cs new file mode 100644 index 0000000000..8cb55a20c4 --- /dev/null +++ b/Items/Placeables/FurnitureExo/ExoSink.cs @@ -0,0 +1,41 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureExo; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureExo +{ + public class ExoSink : ModItem + { + public override void SetStaticDefaults() + { + Tooltip.SetDefault("Counts as a water source"); + } + + public override void SetDefaults() + { + item.SetNameOverride("Exo Sink"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + item.Calamity().customRarity = CalamityRarity.Violet; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 6); + recipe.AddIngredient(ItemID.WaterBucket); + recipe.SetResult(this); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureExo/ExoSink.png b/Items/Placeables/FurnitureExo/ExoSink.png new file mode 100644 index 0000000000..5f37f7b14d Binary files /dev/null and b/Items/Placeables/FurnitureExo/ExoSink.png differ diff --git a/Items/Placeables/FurnitureExo/ExoSofa.cs b/Items/Placeables/FurnitureExo/ExoSofa.cs new file mode 100644 index 0000000000..833c2c2152 --- /dev/null +++ b/Items/Placeables/FurnitureExo/ExoSofa.cs @@ -0,0 +1,40 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureExo; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureExo +{ + public class ExoSofa : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Exo Sofa"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + item.Calamity().customRarity = CalamityRarity.Violet; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ItemID.Silk, 2); + recipe.SetResult(this); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureExo/ExoSofa.png b/Items/Placeables/FurnitureExo/ExoSofa.png new file mode 100644 index 0000000000..30e755394b Binary files /dev/null and b/Items/Placeables/FurnitureExo/ExoSofa.png differ diff --git a/Items/Placeables/FurnitureExo/ExoTable.cs b/Items/Placeables/FurnitureExo/ExoTable.cs new file mode 100644 index 0000000000..9e4611b22f --- /dev/null +++ b/Items/Placeables/FurnitureExo/ExoTable.cs @@ -0,0 +1,39 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureExo; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureExo +{ + public class ExoTable : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Exo Table"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + item.Calamity().customRarity = CalamityRarity.Violet; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 8); + recipe.SetResult(this); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureExo/ExoTable.png b/Items/Placeables/FurnitureExo/ExoTable.png new file mode 100644 index 0000000000..ea809bee82 Binary files /dev/null and b/Items/Placeables/FurnitureExo/ExoTable.png differ diff --git a/Items/Placeables/FurnitureExo/ExoTerminal.cs b/Items/Placeables/FurnitureExo/ExoTerminal.cs new file mode 100644 index 0000000000..f6841523c8 --- /dev/null +++ b/Items/Placeables/FurnitureExo/ExoTerminal.cs @@ -0,0 +1,41 @@ +using CalamityMod.Items.DraedonMisc; +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureExo; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureExo +{ + public class ExoTerminal : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Exo Terminal"); + } + + public override void SetDefaults() + { + item.width = 12; + item.height = 12; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + item.Calamity().customRarity = CalamityRarity.Violet; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 15); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.SetResult(this); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureExo/ExoTerminal.png b/Items/Placeables/FurnitureExo/ExoTerminal.png new file mode 100644 index 0000000000..c3740552ed Binary files /dev/null and b/Items/Placeables/FurnitureExo/ExoTerminal.png differ diff --git a/Items/Placeables/FurnitureExo/ExoToilet.cs b/Items/Placeables/FurnitureExo/ExoToilet.cs new file mode 100644 index 0000000000..9c56e69d62 --- /dev/null +++ b/Items/Placeables/FurnitureExo/ExoToilet.cs @@ -0,0 +1,39 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureExo; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureExo +{ + public class ExoToilet : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Exo Toilet"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + item.Calamity().customRarity = CalamityRarity.Violet; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 6); + recipe.SetResult(this); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureExo/ExoToilet.png b/Items/Placeables/FurnitureExo/ExoToilet.png new file mode 100644 index 0000000000..75f0cfa781 Binary files /dev/null and b/Items/Placeables/FurnitureExo/ExoToilet.png differ diff --git a/Items/Placeables/FurnitureExo/ExoWorkbench.cs b/Items/Placeables/FurnitureExo/ExoWorkbench.cs new file mode 100644 index 0000000000..2933cd25cd --- /dev/null +++ b/Items/Placeables/FurnitureExo/ExoWorkbench.cs @@ -0,0 +1,37 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.FurnitureExo; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureExo +{ + public class ExoWorkbench : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.SetNameOverride("Exo Work Bench"); + item.width = 28; + item.height = 20; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.createTile = ModContent.TileType(); + item.Calamity().customRarity = CalamityRarity.Violet; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Placeables/FurnitureExo/ExoWorkbench.png b/Items/Placeables/FurnitureExo/ExoWorkbench.png new file mode 100644 index 0000000000..e952fe07e1 Binary files /dev/null and b/Items/Placeables/FurnitureExo/ExoWorkbench.png differ diff --git a/Items/Potions/AstralInjection.cs b/Items/Potions/AstralInjection.cs index 2dbb36cc2a..7151cf823e 100644 --- a/Items/Potions/AstralInjection.cs +++ b/Items/Potions/AstralInjection.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Potions item.width = 28; item.height = 18; item.useTurn = true; - item.maxStack = 999; + item.maxStack = 30; item.rare = ItemRarityID.Orange; item.useAnimation = 17; item.useTime = 17; @@ -52,9 +52,11 @@ namespace CalamityMod.Items.Potions recipe.AddIngredient(ItemID.BottledWater, 4); recipe.AddIngredient(ModContent.ItemType(), 4); recipe.AddIngredient(ModContent.ItemType()); + recipe.alchemy = true; recipe.AddTile(TileID.AlchemyTable); recipe.SetResult(this, 4); recipe.AddRecipe(); + // Blood orb recipes don't get the alchemy table effect recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.BottledWater, 4); recipe.AddIngredient(ModContent.ItemType(), 5); diff --git a/Items/Potions/BoundingPotion.cs b/Items/Potions/BoundingPotion.cs index e2a87ed16a..ed2499a722 100644 --- a/Items/Potions/BoundingPotion.cs +++ b/Items/Potions/BoundingPotion.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Potions item.width = 28; item.height = 18; item.useTurn = true; - item.maxStack = 999; + item.maxStack = 30; item.rare = ItemRarityID.Orange; item.useAnimation = 17; item.useTime = 17; diff --git a/Items/Potions/CadencePotion.cs b/Items/Potions/CadencePotion.cs index 312bfe6117..3350700ec9 100644 --- a/Items/Potions/CadencePotion.cs +++ b/Items/Potions/CadencePotion.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Potions item.width = 28; item.height = 38; item.useTurn = true; - item.maxStack = 999; + item.maxStack = 30; item.rare = ItemRarityID.Orange; item.useAnimation = 17; item.useTime = 17; diff --git a/Items/Potions/CalamitasBrew.cs b/Items/Potions/CalamitasBrew.cs index c21e608c30..b2ecc8e99a 100644 --- a/Items/Potions/CalamitasBrew.cs +++ b/Items/Potions/CalamitasBrew.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Potions item.width = 30; item.height = 30; item.useTurn = true; - item.maxStack = 999; + item.maxStack = 30; item.rare = ItemRarityID.Orange; item.useAnimation = 17; item.useTime = 17; diff --git a/Items/Potions/CalciumPotion.cs b/Items/Potions/CalciumPotion.cs index 6283bdef61..6f884a547e 100644 --- a/Items/Potions/CalciumPotion.cs +++ b/Items/Potions/CalciumPotion.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Potions item.width = 28; item.height = 18; item.useTurn = true; - item.maxStack = 999; + item.maxStack = 30; item.rare = ItemRarityID.Orange; item.useAnimation = 17; item.useTime = 17; diff --git a/Items/Potions/CeaselessHungerPotion.cs b/Items/Potions/CeaselessHungerPotion.cs index d03ca1cb07..aacd4abf5c 100644 --- a/Items/Potions/CeaselessHungerPotion.cs +++ b/Items/Potions/CeaselessHungerPotion.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Potions item.width = 28; item.height = 18; item.useTurn = true; - item.maxStack = 999; + item.maxStack = 30; item.rare = ItemRarityID.Orange; item.useAnimation = 17; item.useTime = 17; @@ -38,8 +38,10 @@ namespace CalamityMod.Items.Potions recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.AlchemyTable); + recipe.alchemy = true; recipe.SetResult(this, 4); recipe.AddRecipe(); + // Blood orb recipes don't get the Alchemy table effect recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.BottledWater, 4); recipe.AddIngredient(ModContent.ItemType(), 20); diff --git a/Items/Potions/CrumblingPotion.cs b/Items/Potions/CrumblingPotion.cs index bd5bccdbea..1156f8160f 100644 --- a/Items/Potions/CrumblingPotion.cs +++ b/Items/Potions/CrumblingPotion.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Potions item.width = 28; item.height = 18; item.useTurn = true; - item.maxStack = 999; + item.maxStack = 30; item.rare = ItemRarityID.Orange; item.useAnimation = 17; item.useTime = 17; @@ -39,8 +39,10 @@ namespace CalamityMod.Items.Potions recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.AlchemyTable); + recipe.alchemy = true; recipe.SetResult(this, 5); recipe.AddRecipe(); + // Blood Orb recipes don't get the Alchemy Table effect recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.BottledWater); recipe.AddIngredient(ModContent.ItemType(), 20); diff --git a/Items/Potions/DraconicElixir.cs b/Items/Potions/DraconicElixir.cs index e1bf89dabc..2a87dfaa3c 100644 --- a/Items/Potions/DraconicElixir.cs +++ b/Items/Potions/DraconicElixir.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Potions item.width = 28; item.height = 18; item.useTurn = true; - item.maxStack = 999; + item.maxStack = 30; item.rare = ItemRarityID.Orange; item.useAnimation = 17; item.useTime = 17; @@ -44,8 +44,10 @@ namespace CalamityMod.Items.Potions recipe.AddIngredient(ItemID.Moonglow); recipe.AddIngredient(ItemID.Fireblossom); recipe.AddTile(TileID.AlchemyTable); + recipe.alchemy = true; recipe.SetResult(this); recipe.AddRecipe(); + // Blood orb recipes don't get the Alchemy Table effect recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.BottledWater); recipe.AddIngredient(ModContent.ItemType(), 50); diff --git a/Items/Potions/GravityNormalizerPotion.cs b/Items/Potions/GravityNormalizerPotion.cs index 1c85032f36..85cfcf8183 100644 --- a/Items/Potions/GravityNormalizerPotion.cs +++ b/Items/Potions/GravityNormalizerPotion.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Potions item.width = 28; item.height = 18; item.useTurn = true; - item.maxStack = 999; + item.maxStack = 30; item.rare = ItemRarityID.Orange; item.useAnimation = 17; item.useTime = 17; @@ -39,8 +39,10 @@ namespace CalamityMod.Items.Potions recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.AlchemyTable); + recipe.alchemy = true; recipe.SetResult(this); recipe.AddRecipe(); + // Blood orb recipes don't get the Alchemy Table effect recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.BottledWater); recipe.AddIngredient(ModContent.ItemType(), 10); diff --git a/Items/Potions/HolyWrathPotion.cs b/Items/Potions/HolyWrathPotion.cs index b477b84ca7..211120ea06 100644 --- a/Items/Potions/HolyWrathPotion.cs +++ b/Items/Potions/HolyWrathPotion.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Potions item.width = 28; item.height = 18; item.useTurn = true; - item.maxStack = 999; + item.maxStack = 30; item.rare = ItemRarityID.Orange; item.useAnimation = 17; item.useTime = 17; @@ -40,8 +40,10 @@ namespace CalamityMod.Items.Potions recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.AlchemyTable); + recipe.alchemy = true; recipe.SetResult(this); recipe.AddRecipe(); + // Blood orb recipes don't get the alchemy table effect recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.BottledWater); recipe.AddIngredient(ModContent.ItemType(), 40); diff --git a/Items/Potions/OmegaHealingPotion.cs b/Items/Potions/OmegaHealingPotion.cs index ed3e582b53..cbd90029dc 100644 --- a/Items/Potions/OmegaHealingPotion.cs +++ b/Items/Potions/OmegaHealingPotion.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Potions item.width = 28; item.height = 18; item.useTurn = true; - item.maxStack = 999; + item.maxStack = 30; item.healLife = 300; item.useAnimation = 17; item.useTime = 17; diff --git a/Items/Potions/PenumbraPotion.cs b/Items/Potions/PenumbraPotion.cs index f0d60906d7..150d4184ff 100644 --- a/Items/Potions/PenumbraPotion.cs +++ b/Items/Potions/PenumbraPotion.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Potions item.width = 26; item.height = 30; item.useTurn = true; - item.maxStack = 999; + item.maxStack = 30; item.rare = ItemRarityID.Orange; item.useAnimation = 17; item.useTime = 17; @@ -40,8 +40,10 @@ namespace CalamityMod.Items.Potions recipe.AddIngredient(ModContent.ItemType(), 3); recipe.AddIngredient(ItemID.LunarTabletFragment); recipe.AddTile(TileID.AlchemyTable); + recipe.alchemy = true; recipe.SetResult(this); recipe.AddRecipe(); + // Blood orb recipes don't get the Alchemy Table effect recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.BottledWater); recipe.AddIngredient(ModContent.ItemType(), 30); diff --git a/Items/Potions/PhotosynthesisPotion.cs b/Items/Potions/PhotosynthesisPotion.cs index 02475a648e..577d29142e 100644 --- a/Items/Potions/PhotosynthesisPotion.cs +++ b/Items/Potions/PhotosynthesisPotion.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Potions item.width = 28; item.height = 18; item.useTurn = true; - item.maxStack = 999; + item.maxStack = 30; item.rare = ItemRarityID.Orange; item.useAnimation = 17; item.useTime = 17; @@ -40,8 +40,10 @@ namespace CalamityMod.Items.Potions recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.AlchemyTable); + recipe.alchemy = true; recipe.SetResult(this); recipe.AddRecipe(); + // Blood orb recipes don't get the alchemy table effect recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.BottledWater); recipe.AddIngredient(ModContent.ItemType(), 40); diff --git a/Items/Potions/PotionofOmniscience.cs b/Items/Potions/PotionofOmniscience.cs index f164c8d12a..15cb46fae3 100644 --- a/Items/Potions/PotionofOmniscience.cs +++ b/Items/Potions/PotionofOmniscience.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Potions item.width = 28; item.height = 18; item.useTurn = true; - item.maxStack = 999; + item.maxStack = 30; item.rare = ItemRarityID.Orange; item.useAnimation = 17; item.useTime = 17; diff --git a/Items/Potions/ProfanedRagePotion.cs b/Items/Potions/ProfanedRagePotion.cs index 4433276eba..7d3360c149 100644 --- a/Items/Potions/ProfanedRagePotion.cs +++ b/Items/Potions/ProfanedRagePotion.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Potions item.width = 34; item.height = 42; item.useTurn = true; - item.maxStack = 999; + item.maxStack = 30; item.rare = ItemRarityID.Orange; item.useAnimation = 17; item.useTime = 17; @@ -39,8 +39,10 @@ namespace CalamityMod.Items.Potions recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.AlchemyTable); + recipe.alchemy = true; recipe.SetResult(this); recipe.AddRecipe(); + // Blood orb recipe = no alchemy table effect recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.BottledWater); recipe.AddIngredient(ModContent.ItemType(), 40); diff --git a/Items/Potions/PurifiedJam.cs b/Items/Potions/PurifiedJam.cs index da903bc65b..43e31781eb 100644 --- a/Items/Potions/PurifiedJam.cs +++ b/Items/Potions/PurifiedJam.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Potions item.width = 28; item.height = 18; item.useTurn = true; - item.maxStack = 999; + item.maxStack = 30; item.rare = ItemRarityID.Orange; item.useAnimation = 17; item.useTime = 17; diff --git a/Items/Potions/RevivifyPotion.cs b/Items/Potions/RevivifyPotion.cs index 3a3d844998..b3399a05f4 100644 --- a/Items/Potions/RevivifyPotion.cs +++ b/Items/Potions/RevivifyPotion.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Potions item.width = 28; item.height = 36; item.useTurn = true; - item.maxStack = 999; + item.maxStack = 30; item.rare = ItemRarityID.Orange; item.useAnimation = 17; item.useTime = 17; @@ -41,8 +41,10 @@ namespace CalamityMod.Items.Potions recipe.AddIngredient(ModContent.ItemType(), 3); recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.AlchemyTable); + recipe.alchemy = true; recipe.SetResult(this, 5); recipe.AddRecipe(); + // Blood orb recipes no alch table effect recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.HolyWater, 5); recipe.AddIngredient(ModContent.ItemType(), 100); diff --git a/Items/Potions/ShadowPotion.cs b/Items/Potions/ShadowPotion.cs index 91b6e5e6eb..a78f407bd7 100644 --- a/Items/Potions/ShadowPotion.cs +++ b/Items/Potions/ShadowPotion.cs @@ -41,8 +41,10 @@ namespace CalamityMod.Items.Potions recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ItemID.InvisibilityPotion); recipe.AddTile(TileID.AlchemyTable); + recipe.alchemy = true; recipe.SetResult(this, 2); recipe.AddRecipe(); + // blood orb recipes no alch table effect recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ItemID.InvisibilityPotion); diff --git a/Items/Potions/ShatteringPotion.cs b/Items/Potions/ShatteringPotion.cs index 8261560f18..2309d666f4 100644 --- a/Items/Potions/ShatteringPotion.cs +++ b/Items/Potions/ShatteringPotion.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Potions item.width = 28; item.height = 18; item.useTurn = true; - item.maxStack = 999; + item.maxStack = 30; item.rare = ItemRarityID.Orange; item.useAnimation = 17; item.useTime = 17; @@ -39,8 +39,10 @@ namespace CalamityMod.Items.Potions recipe.AddIngredient(ModContent.ItemType(), 2); recipe.AddIngredient(ItemID.BeetleHusk); recipe.AddTile(TileID.AlchemyTable); + recipe.alchemy = true; recipe.SetResult(this); recipe.AddRecipe(); + // Blood Orb recipes don't get the alchemy table effect recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.BottledWater); recipe.AddIngredient(ModContent.ItemType(), 30); diff --git a/Items/Potions/SoaringPotion.cs b/Items/Potions/SoaringPotion.cs index 5f6712d1ea..0616fb9945 100644 --- a/Items/Potions/SoaringPotion.cs +++ b/Items/Potions/SoaringPotion.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Potions item.width = 28; item.height = 18; item.useTurn = true; - item.maxStack = 999; + item.maxStack = 30; item.rare = ItemRarityID.Orange; item.useAnimation = 17; item.useTime = 17; @@ -41,8 +41,10 @@ namespace CalamityMod.Items.Potions recipe.AddIngredient(ItemID.SoulofFlight); recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.AlchemyTable); + recipe.alchemy = true; recipe.SetResult(this); recipe.AddRecipe(); + // Blood orb recipes don't get the alchemy table effect recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.BottledWater); recipe.AddIngredient(ModContent.ItemType(), 30); diff --git a/Items/Potions/SupremeHealingPotion.cs b/Items/Potions/SupremeHealingPotion.cs index 043b6118e6..fd67792cbf 100644 --- a/Items/Potions/SupremeHealingPotion.cs +++ b/Items/Potions/SupremeHealingPotion.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Potions item.width = 28; item.height = 18; item.useTurn = true; - item.maxStack = 999; + item.maxStack = 30; item.healLife = 250; item.useAnimation = 17; item.useTime = 17; diff --git a/Items/Potions/TeslaPotion.cs b/Items/Potions/TeslaPotion.cs index d10c643226..ae57131f20 100644 --- a/Items/Potions/TeslaPotion.cs +++ b/Items/Potions/TeslaPotion.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Potions item.width = 24; item.height = 26; item.useTurn = true; - item.maxStack = 999; + item.maxStack = 30; item.rare = ItemRarityID.Orange; item.useAnimation = 17; item.useTime = 17; diff --git a/Items/Potions/TitanScalePotion.cs b/Items/Potions/TitanScalePotion.cs index 824cd57dde..ebfdde0f64 100644 --- a/Items/Potions/TitanScalePotion.cs +++ b/Items/Potions/TitanScalePotion.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Potions item.width = 24; item.height = 34; item.useTurn = true; - item.maxStack = 999; + item.maxStack = 30; item.rare = ItemRarityID.Orange; item.useAnimation = 17; item.useTime = 17; @@ -40,8 +40,10 @@ namespace CalamityMod.Items.Potions recipe.AddIngredient(ItemID.BeetleHusk); recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.AlchemyTable); + recipe.alchemy = true; recipe.SetResult(this, 4); recipe.AddRecipe(); + // Alch table effect not on blood orb recipes recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.BottledWater, 4); recipe.AddIngredient(ModContent.ItemType(), 40); diff --git a/Items/Potions/TriumphPotion.cs b/Items/Potions/TriumphPotion.cs index 9888a82ed0..11af93e497 100644 --- a/Items/Potions/TriumphPotion.cs +++ b/Items/Potions/TriumphPotion.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Potions item.width = 28; item.height = 18; item.useTurn = true; - item.maxStack = 999; + item.maxStack = 30; item.rare = ItemRarityID.Orange; item.useAnimation = 17; item.useTime = 17; diff --git a/Items/Potions/YharimsStimulants.cs b/Items/Potions/YharimsStimulants.cs index d80b43e8cf..9b781426df 100644 --- a/Items/Potions/YharimsStimulants.cs +++ b/Items/Potions/YharimsStimulants.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Potions item.width = 28; item.height = 18; item.useTurn = true; - item.maxStack = 999; + item.maxStack = 30; item.rare = ItemRarityID.Orange; item.useAnimation = 17; item.useTime = 17; diff --git a/Items/Potions/ZenPotion.cs b/Items/Potions/ZenPotion.cs index 02d6a706b9..df91b32972 100644 --- a/Items/Potions/ZenPotion.cs +++ b/Items/Potions/ZenPotion.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Potions item.width = 28; item.height = 18; item.useTurn = true; - item.maxStack = 999; + item.maxStack = 30; item.rare = ItemRarityID.Orange; item.useAnimation = 17; item.useTime = 17; diff --git a/Items/Potions/ZergPotion.cs b/Items/Potions/ZergPotion.cs index daf5d6b0c2..8fd63b9f3b 100644 --- a/Items/Potions/ZergPotion.cs +++ b/Items/Potions/ZergPotion.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Potions item.width = 28; item.height = 18; item.useTurn = true; - item.maxStack = 999; + item.maxStack = 30; item.rare = ItemRarityID.Orange; item.useAnimation = 17; item.useTime = 17; diff --git a/Items/TreasureBags/CalamitasBag.cs b/Items/TreasureBags/CalamitasBag.cs index a4a3a9dc54..3784b188d6 100644 --- a/Items/TreasureBags/CalamitasBag.cs +++ b/Items/TreasureBags/CalamitasBag.cs @@ -64,6 +64,11 @@ namespace CalamityMod.Items.TreasureBags // Vanity DropHelper.DropItemChance(player, ModContent.ItemType(), 7); + if (Main.rand.NextBool(10)) + { + DropHelper.DropItem(player, ModContent.ItemType()); + DropHelper.DropItem(player, ModContent.ItemType()); + } } } } diff --git a/Items/TreasureBags/HiveMindBag.cs b/Items/TreasureBags/HiveMindBag.cs index 893eb675ae..9019f02574 100644 --- a/Items/TreasureBags/HiveMindBag.cs +++ b/Items/TreasureBags/HiveMindBag.cs @@ -46,6 +46,7 @@ namespace CalamityMod.Items.TreasureBags DropHelper.DropItem(player, ItemID.DemoniteBar, 9, 14); DropHelper.DropItem(player, ItemID.RottenChunk, 10, 20); DropHelper.DropItemCondition(player, ItemID.CursedFlame, Main.hardMode, 15, 30); + DropHelper.DropItem(player, ItemID.CorruptSeeds, 2, 4); // Weapons float w = DropHelper.BagWeaponDropRateFloat; diff --git a/Items/TreasureBags/PerforatorBag.cs b/Items/TreasureBags/PerforatorBag.cs index 40f29b93b5..fae71de909 100644 --- a/Items/TreasureBags/PerforatorBag.cs +++ b/Items/TreasureBags/PerforatorBag.cs @@ -46,6 +46,7 @@ namespace CalamityMod.Items.TreasureBags DropHelper.DropItem(player, ItemID.CrimtaneBar, 9, 14); DropHelper.DropItem(player, ItemID.Vertebrae, 10, 20); DropHelper.DropItemCondition(player, ItemID.Ichor, Main.hardMode, 15, 30); + DropHelper.DropItem(player, ItemID.CrimsonSeeds, 2, 4); // Weapons float w = DropHelper.BagWeaponDropRateFloat; diff --git a/Items/Weapons/Magic/AcidGun.cs b/Items/Weapons/Magic/AcidGun.cs index e3d7ebb7b9..704b4e2512 100644 --- a/Items/Weapons/Magic/AcidGun.cs +++ b/Items/Weapons/Magic/AcidGun.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables; using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; diff --git a/Items/Weapons/Magic/GloriousEnd.cs b/Items/Weapons/Magic/GloriousEnd.cs new file mode 100644 index 0000000000..dcf5f84c50 --- /dev/null +++ b/Items/Weapons/Magic/GloriousEnd.cs @@ -0,0 +1,45 @@ +using CalamityMod.Projectiles.Magic; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Magic +{ + public class GloriousEnd : ModItem + { + public static int PlayerExplosionDmgMin = 50; + public static int PlayerExplosionDmgMax = 60; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Glorious End"); + Tooltip.SetDefault("Casts a meteor star for the player to ride in the direction of the cursor\n" + + "The meteor star explodes after hitting an enemy, crashing into a wall, or after 6 seconds\n" + + "This explosion hurts both enemies and the player\n" + + "Releasing the cursor before the star explodes will cause it to explode prematurely for less damage\n" + + "Mounts are disabled while this weapon is in use"); + } + + public override void SetDefaults() + { + item.damage = 120; + item.knockBack = 10f; + item.useTime = item.useAnimation = 30; + item.mana = 20; + item.magic = true; + item.channel = true; + item.shootSpeed = 7f; + item.shoot = ModContent.ProjectileType(); + + item.width = 30; + item.height = 58; + item.useStyle = ItemUseStyleID.SwingThrow; + item.noMelee = true; + item.UseSound = SoundID.Item9; + item.value = Item.buyPrice(0, 36, 0, 0); + item.rare = ItemRarityID.Pink; + item.Calamity().donorItem = true; + } + + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; + } +} diff --git a/Items/Weapons/Magic/GloriousEnd.png b/Items/Weapons/Magic/GloriousEnd.png new file mode 100644 index 0000000000..757809353e Binary files /dev/null and b/Items/Weapons/Magic/GloriousEnd.png differ diff --git a/Items/Weapons/Magic/StardustStaff.cs b/Items/Weapons/Magic/StardustStaff.cs index 5936bd5feb..ac30bb4936 100644 --- a/Items/Weapons/Magic/StardustStaff.cs +++ b/Items/Weapons/Magic/StardustStaff.cs @@ -35,35 +35,30 @@ namespace CalamityMod.Items.Weapons.Magic item.autoReuse = true; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 12f; + item.Calamity().challengeDrop = true; } - public override Vector2? HoldoutOrigin() - { - return new Vector2(15, 15); - } + public override Vector2? HoldoutOrigin() => new Vector2(15, 15); public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - int i = Main.myPlayer; float num72 = item.shootSpeed; - int num73 = item.damage; - float num74 = item.knockBack; float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - int num130 = 6; + int stardustAmt = 6; if (Main.rand.NextBool(3)) { - num130++; + stardustAmt++; } if (Main.rand.NextBool(4)) { - num130++; + stardustAmt++; } if (Main.rand.NextBool(5)) { - num130++; + stardustAmt++; } if (Main.rand.NextBool(3)) { @@ -75,15 +70,15 @@ namespace CalamityMod.Items.Weapons.Magic num133 *= num80; float x2 = vector2.X; float y2 = vector2.Y; - Projectile.NewProjectile(x2, y2, num132, num133, ModContent.ProjectileType(), num73, num74, i, 0f, 1f); + Projectile.NewProjectile(x2, y2, num132, num133, ModContent.ProjectileType(), damage, knockBack, player.whoAmI); } else { - for (int num131 = 0; num131 < num130; num131++) + for (int i = 0; i < stardustAmt; i++) { float num132 = num78; float num133 = num79; - float num134 = 0.05f * (float)num131; + float num134 = 0.05f * (float)i; num132 += (float)Main.rand.Next(-155, 156) * num134; num133 += (float)Main.rand.Next(-155, 156) * num134; num80 = (float)Math.Sqrt((double)(num132 * num132 + num133 * num133)); @@ -92,7 +87,7 @@ namespace CalamityMod.Items.Weapons.Magic num133 *= num80; float x2 = vector2.X; float y2 = vector2.Y; - Projectile.NewProjectile(x2, y2, num132, num133, ModContent.ProjectileType(), num73, num74, i, 0f, 0f); + Projectile.NewProjectile(x2, y2, num132, num133, ModContent.ProjectileType(), damage, knockBack, player.whoAmI); } } return false; diff --git a/Items/Weapons/Magic/TacticiansTrumpCard.cs b/Items/Weapons/Magic/TacticiansTrumpCard.cs new file mode 100644 index 0000000000..833d9b57ac --- /dev/null +++ b/Items/Weapons/Magic/TacticiansTrumpCard.cs @@ -0,0 +1,79 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Magic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Magic +{ + public class TacticiansTrumpCard : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Tactician's Trump Card"); + Tooltip.SetDefault("Faint memories of a Princess from the future cross your mind...\n" + + "Fires a sword beam that electrifies enemies on hit"); + } + + public override void SetDefaults() + { + item.width = 74; + item.height = 70; + item.damage = 201; + item.knockBack = 7f; + item.magic = true; + item.useAnimation = item.useTime = 12; + item.mana = 20; + item.useTurn = true; + item.autoReuse = true; + item.shootSpeed = 12f; + item.shoot = ModContent.ProjectileType(); + item.useStyle = ItemUseStyleID.SwingThrow; + item.UseSound = SoundID.Item1; + item.value = CalamityGlobalItem.Rarity12BuyPrice; + item.rare = ItemRarityID.Purple; + item.Calamity().customRarity = CalamityRarity.Turquoise; + } + + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.NextBool(3)) + { + int dustType = Main.rand.NextBool() ? 132 : 264; + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, dustType); + Main.dust[dust].noGravity = true; + } + } + + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) => target.AddBuff(BuffID.Electrified, 300); + + public override void OnHitPvp(Player player, Player target, int damage, bool crit) => target.AddBuff(BuffID.Electrified, 300); + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.CopperShortsword); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddTile(TileID.LunarCraftingStation); + recipe.SetResult(this); + recipe.AddRecipe(); + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.TinShortsword); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddTile(TileID.LunarCraftingStation); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Weapons/Magic/TacticiansTrumpCard.png b/Items/Weapons/Magic/TacticiansTrumpCard.png new file mode 100644 index 0000000000..c80afc33a1 Binary files /dev/null and b/Items/Weapons/Magic/TacticiansTrumpCard.png differ diff --git a/Items/Weapons/Melee/Basher.cs b/Items/Weapons/Melee/Basher.cs index 39c8dcff84..e018d99f9e 100644 --- a/Items/Weapons/Melee/Basher.cs +++ b/Items/Weapons/Melee/Basher.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Weapons/Ranged/Toxibow.cs b/Items/Weapons/Ranged/Toxibow.cs index d01476ce31..d7831fa196 100644 --- a/Items/Weapons/Ranged/Toxibow.cs +++ b/Items/Weapons/Ranged/Toxibow.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; diff --git a/Items/Weapons/Ranged/UniversalGenesis.cs b/Items/Weapons/Ranged/UniversalGenesis.cs new file mode 100644 index 0000000000..7ea2d38229 --- /dev/null +++ b/Items/Weapons/Ranged/UniversalGenesis.cs @@ -0,0 +1,121 @@ +using CalamityMod.Items.Accessories; +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Ranged; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Ranged +{ + public class UniversalGenesis : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Universal Genesis"); + Tooltip.SetDefault("Seeing the cosmos makes you realize how insignificant we are\n" + + "Fires a spread of bullets from the gun and a spread of stars above the cursor\n" + + "Converts musket balls into starcaller shots that summon additional stars on enemy hits\n" + + "50% chance to not consume ammo"); + } + + public override void SetDefaults() + { + item.damage = 111; + item.ranged = true; + item.useTime = item.useAnimation = 17; + item.knockBack = 6.5f; + item.useAmmo = AmmoID.Bullet; + item.shoot = ProjectileID.Bullet; + item.shootSpeed = 20f; + item.autoReuse = true; + item.Calamity().canFirePointBlankShots = true; + + item.width = 158; + item.height = 60; + item.noMelee = true; + item.UseSound = SoundID.Item38; + item.useStyle = ItemUseStyleID.HoldingOut; + item.value = CalamityGlobalItem.Rarity14BuyPrice; + item.Calamity().customRarity = CalamityRarity.DarkBlue; + item.Calamity().donorItem = true; + } + + public override Vector2? HoldoutOffset() => new Vector2(-50f, -8f); + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + Vector2 shootVelocity = new Vector2(speedX, speedY); + Vector2 shootDirection = shootVelocity.SafeNormalize(Vector2.UnitX * player.direction); + Vector2 gunTip = position + shootDirection * item.scale * 100f; + gunTip.Y -= 10f; + float tightness = 1f; + if (type == ProjectileID.Bullet) + type = ModContent.ProjectileType(); + for (float i = -tightness * 5f; i <= tightness * 5f; i += tightness * 2f) + { + Vector2 perturbedSpeed = shootVelocity.RotatedBy(MathHelper.ToRadians(i)); + Projectile.NewProjectile(gunTip, perturbedSpeed, type, damage, knockBack, player.whoAmI); + } + + // Stars from above + float speed = item.shootSpeed; + Vector2 spawnPos = player.RotatedRelativePoint(player.MountedCenter, true); + int starAmt = 6; + int starDmg = (int)(damage * 0.7); + for (int i = 0; i < starAmt; i++) + { + spawnPos = new Vector2(player.Center.X + (Main.rand.Next(201) * -(float)player.direction) + (Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); + spawnPos.X = (spawnPos.X + player.Center.X) / 2f + Main.rand.Next(-200, 201); + spawnPos.Y -= 100 + i; + float xDist = Main.mouseX + Main.screenPosition.X - spawnPos.X; + float yDist = Main.mouseY + Main.screenPosition.Y - spawnPos.Y; + if (yDist < 0f) + { + yDist *= -1f; + } + if (yDist < 20f) + { + yDist = 20f; + } + float travelDist = (float)Math.Sqrt(xDist * xDist + yDist * yDist); + travelDist = speed / travelDist; + xDist *= travelDist; + yDist *= travelDist; + float xVel = xDist + Main.rand.NextFloat(-0.6f, 0.6f); + float yVel = yDist + Main.rand.NextFloat(-0.6f, 0.6f); + int star = Projectile.NewProjectile(spawnPos.X, spawnPos.Y, xVel, yVel, ModContent.ProjectileType(), starDmg, knockBack, player.whoAmI, i); + Main.projectile[star].extraUpdates = 2; + Main.projectile[star].localNPCHitCooldown = 30; + } + return false; + } + + public override bool ConsumeAmmo(Player player) => Main.rand.NextBool(); + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ItemID.StarCloak, 3); // and that's how you know it's a donor item + recipe.AddIngredient(ModContent.ItemType(), 2); + recipe.AddIngredient(ModContent.ItemType(), 8); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddTile(ModContent.TileType()); + recipe.SetResult(this); + recipe.AddRecipe(); + // but why + recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ItemID.StarCloak, 3); // and that's how you know it's a donor item + recipe.AddIngredient(ModContent.ItemType(), 2); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddTile(ModContent.TileType()); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Weapons/Ranged/UniversalGenesis.png b/Items/Weapons/Ranged/UniversalGenesis.png new file mode 100644 index 0000000000..922c2d447a Binary files /dev/null and b/Items/Weapons/Ranged/UniversalGenesis.png differ diff --git a/Items/Weapons/Rogue/SearedPan.cs b/Items/Weapons/Rogue/SearedPan.cs new file mode 100644 index 0000000000..281bee2dd7 --- /dev/null +++ b/Items/Weapons/Rogue/SearedPan.cs @@ -0,0 +1,72 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Rogue; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Rogue +{ + public class SearedPan : RogueWeapon + { + // Attacks must be within 40 frames of each other to count as "consecutive" hits + public static int ConsecutiveHitOpening = 40; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Seared Pan"); + Tooltip.SetDefault("dAMaGe iS rAthEr cOnSisTeNT\n" + + "Fires a frying pan at high velocity\n" + + "Enemy hits summon fireballs that linger around the target\n" + + "Landing three consecutive hits grants full stealth\n" + + "Stealth strikes explode into golden sparks and after hitting an enemy,\n" + + "cause all fireballs to aggressively home in on their target"); + } + + public override void SafeSetDefaults() + { + item.width = 60; + item.height = 36; + item.damage = 999; + item.Calamity().rogue = true; + item.knockBack = 10f; + item.noMelee = true; + item.noUseGraphic = true; + item.useStyle = ItemUseStyleID.SwingThrow; + item.useTime = item.useAnimation = 24; + item.reuseDelay = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.value = CalamityGlobalItem.Rarity15BuyPrice; + item.Calamity().customRarity = CalamityRarity.Violet; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 15f; + item.Calamity().donorItem = true; + } + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + int pan = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + if (player.Calamity().StealthStrikeAvailable() && pan.WithinBounds(Main.maxProjectiles)) + { + Main.projectile[pan].Calamity().stealthStrike = true; + Main.projectile[pan].extraUpdates++; + } + return false; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ItemID.Bacon, 4); + recipe.AddIngredient(ItemID.LifeCrystal); + recipe.AddIngredient(ItemID.ManaCrystal); + recipe.AddIngredient(ItemID.Bone, 92); + recipe.AddTile(ModContent.TileType()); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Weapons/Rogue/SearedPan.png b/Items/Weapons/Rogue/SearedPan.png new file mode 100644 index 0000000000..b5bef1d2cc Binary files /dev/null and b/Items/Weapons/Rogue/SearedPan.png differ diff --git a/Items/Weapons/Summon/CausticCroakerStaff.cs b/Items/Weapons/Summon/CausticCroakerStaff.cs index 8814674728..c8b9a24d81 100644 --- a/Items/Weapons/Summon/CausticCroakerStaff.cs +++ b/Items/Weapons/Summon/CausticCroakerStaff.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; diff --git a/Items/Weapons/Summon/ResurrectionButterfly.cs b/Items/Weapons/Summon/ResurrectionButterfly.cs index d801fab9be..99394c1985 100644 --- a/Items/Weapons/Summon/ResurrectionButterfly.cs +++ b/Items/Weapons/Summon/ResurrectionButterfly.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.Weapons.Summon { DisplayName.SetDefault("Resurrection Butterfly"); Tooltip.SetDefault("Remembering the melancholy of human existence\n" + - "Even ghosts stray from the path of righteousness"); + "Even ghosts stray from the path of righteousness\n" + + "Summons a pair of butterflies to fight for you"); } public override void SetDefaults() diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 4df85f44f2..20aa9d4c3d 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -291,7 +291,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("HiveMind", out float order); int type = NPCType(); int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemID.DemoniteBar, ItemID.RottenChunk, ItemID.CursedFlame, ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.LesserHealingPotion }; + List loot = new List() { ItemType(), ItemType(), ItemID.DemoniteBar, ItemID.RottenChunk, ItemID.CorruptSeeds, ItemID.CursedFlame, ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.LesserHealingPotion }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Kill a Cyst in the Corruption or use a [i:{summon}] in the Corruption"; string despawn = CalamityUtils.ColorMessage("The corrupted colony began searching for a new breeding ground.", new Color(0x94, 0x00, 0xD3)); @@ -303,7 +303,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("Perforators", out float order); int type = NPCType(); int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemID.CrimtaneBar, ItemID.Vertebrae, ItemID.Ichor, ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.LesserHealingPotion }; + List loot = new List() { ItemType(), ItemType(), ItemID.CrimtaneBar, ItemID.Vertebrae, ItemID.CrimsonSeeds, ItemID.Ichor, ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.LesserHealingPotion }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Kill a Cyst in the Crimson or use a [i:{summon}] in the Crimson"; string despawn = CalamityUtils.ColorMessage("The parasitic hive began searching for a new host.", new Color(0xDC, 0x14, 0x3C)); @@ -366,7 +366,7 @@ namespace CalamityMod int type = NPCType(); int summon = ItemType(); List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.BrokenHeroSword, ItemID.GreaterHealingPotion }; - List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; + List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Use an [i:{summon}] at Night"; string despawn = CalamityUtils.ColorMessage("If you wanted a fight, you should've came more prepared.", new Color(0xFF, 0xA5, 0x00)); AddBoss(bossChecklist, calamity, "Calamitas", order, type, DownedCalamitas, summon, loot, collection, instructions, despawn); @@ -898,6 +898,7 @@ namespace CalamityMod RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); diff --git a/NPCs/Astral/Nova.cs b/NPCs/Astral/Nova.cs index 51d013c589..d4b34f52a8 100644 --- a/NPCs/Astral/Nova.cs +++ b/NPCs/Astral/Nova.cs @@ -2,6 +2,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -282,6 +283,7 @@ namespace CalamityMod.NPCs.Astral DropHelper.DropItem(npc, ModContent.ItemType(), 2, 3); DropHelper.DropItemCondition(npc, ModContent.ItemType(), Main.expertMode); DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedAstrageldon, 7, 1, 1); + DropHelper.DropItemChance(npc, ModContent.ItemType(), 7, 1, 1); } } } diff --git a/NPCs/Calamitas/CalamitasRun3.cs b/NPCs/Calamitas/CalamitasRun3.cs index 42da6c8aaa..0538cd8e56 100644 --- a/NPCs/Calamitas/CalamitasRun3.cs +++ b/NPCs/Calamitas/CalamitasRun3.cs @@ -186,6 +186,11 @@ namespace CalamityMod.NPCs.Calamitas // Vanity DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); + if (Main.rand.NextBool(10)) + { + DropHelper.DropItem(npc, ModContent.ItemType()); + DropHelper.DropItem(npc, ModContent.ItemType()); + } } // Abyss awakens after killing Calamitas diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 5816d8c829..592b2ee755 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -4185,7 +4185,7 @@ namespace CalamityMod.NPCs WeightedRandom pool = new WeightedRandom(); pool.Add(NPCID.None, 0f); - pool.Add(NPCType(), 0.5f); + pool.Add(NPCType(), 0.2f); int typeToSpawn = pool.Get(); if (typeToSpawn != NPCID.None) diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index b195d5558d..53a6633931 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -39,6 +39,7 @@ namespace CalamityMod.NPCs "Heniek", // <@!363404700445442050> (Kazurgundu#3791) "Fire", // <@!354362326947856384> (fire#0692) "Barney Calhoun", // <@!634462901431697410> (Potato Power#6578) + "XiaoEn0426", // <@!440448864772816896> (XiaoEn0426#9157) }; private const int ClothierVanillaNames = 25; private static readonly string[] ClothierNames = diff --git a/NPCs/DevourerofGods/DevourerofGodsBody.cs b/NPCs/DevourerofGods/DevourerofGodsBody.cs index 45eefac785..0fcab80288 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody.cs @@ -7,6 +7,7 @@ using Microsoft.Xna.Framework.Graphics; using System; using System.IO; using Terraria; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -27,6 +28,7 @@ namespace CalamityMod.NPCs.DevourerofGods private int invinceTime = 360; private bool setAlpha = false; private bool phase2Started = false; + public int SegmentIndex; public override void SetStaticDefaults() { @@ -85,6 +87,7 @@ namespace CalamityMod.NPCs.DevourerofGods writer.Write(npc.dontTakeDamage); writer.Write(setAlpha); writer.Write(npc.alpha); + writer.Write(SegmentIndex); } public override void ReceiveExtraAI(BinaryReader reader) @@ -94,6 +97,7 @@ namespace CalamityMod.NPCs.DevourerofGods npc.dontTakeDamage = reader.ReadBoolean(); setAlpha = reader.ReadBoolean(); npc.alpha = reader.ReadInt32(); + SegmentIndex = reader.ReadInt32(); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) @@ -252,6 +256,16 @@ namespace CalamityMod.NPCs.DevourerofGods public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { + float disintegrationFactor = Main.npc[npc.realLife].ModNPC().DeathAnimationTimer / 640f; + if (disintegrationFactor > 0f) + { + spriteBatch.EnterShaderRegion(); + GameShaders.Misc["CalamityMod:DoGDisintegration"].UseOpacity(disintegrationFactor); + GameShaders.Misc["CalamityMod:DoGDisintegration"].UseSaturation(npc.whoAmI); + GameShaders.Misc["CalamityMod:DoGDisintegration"].UseImage("Images/Misc/Perlin"); + GameShaders.Misc["CalamityMod:DoGDisintegration"].Apply(); + } + SpriteEffects spriteEffects = SpriteEffects.None; if (npc.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; @@ -281,6 +295,9 @@ namespace CalamityMod.NPCs.DevourerofGods spriteBatch.Draw(texture2D15, vector43, npc.frame, color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } + if (disintegrationFactor > 0f) + spriteBatch.ExitShaderRegion(); + return false; } @@ -307,8 +324,29 @@ namespace CalamityMod.NPCs.DevourerofGods } public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) + { + if ((damage * (crit ? 2D : 1D)) >= npc.life) + { + if (npc.realLife >= 0 && !Main.npc[npc.realLife].ModNPC().Dying) + { + damage = 0D; + npc.dontTakeDamage = true; + Main.npc[npc.realLife].ModNPC().Dying = true; + Main.npc[npc.realLife].life = 1; + Main.npc[npc.realLife].dontTakeDamage = true; + Main.npc[npc.realLife].active = true; + Main.npc[npc.realLife].netUpdate = true; + } + return false; + } + return !CalamityUtils.AntiButcher(npc, ref damage, 0.5f); + } + + public override bool CheckDead() { - return !CalamityUtils.AntiButcher(npc, ref damage, 0.5f); + if (npc.realLife >= 0) + Main.npc[npc.realLife].checkDead(); + return base.CheckDead(); } public override bool CheckActive() diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index b8778168ae..3a038a3b89 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -22,8 +22,11 @@ using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; +using System.Collections.Generic; using System.IO; using Terraria; +using Terraria.GameContent.Events; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -119,6 +122,11 @@ namespace CalamityMod.NPCs.DevourerofGods private int preventBullshitHitsAtStartofFinalPhaseTimer = 0; private const float alphaGateValue = 669f; + // Death animation variables + public bool Dying; + public int DeathAnimationTimer; + public int DestroyedSegmentCount; + public override void SetStaticDefaults() { DisplayName.SetDefault("The Devourer of Gods"); @@ -195,6 +203,11 @@ namespace CalamityMod.NPCs.DevourerofGods writer.Write(preventBullshitHitsAtStartofFinalPhaseTimer); writer.Write(teleportTimer); writer.Write(npc.alpha); + + // Death animation syncs + writer.Write(Dying); + writer.Write(DeathAnimationTimer); + writer.Write(DestroyedSegmentCount); } public override void ReceiveExtraAI(BinaryReader reader) @@ -225,6 +238,11 @@ namespace CalamityMod.NPCs.DevourerofGods preventBullshitHitsAtStartofFinalPhaseTimer = reader.ReadInt32(); teleportTimer = reader.ReadInt32(); npc.alpha = reader.ReadInt32(); + + // Death animation syncs + Dying = reader.ReadBoolean(); + DeathAnimationTimer = reader.ReadInt32(); + DestroyedSegmentCount = reader.ReadInt32(); } public override void AI() @@ -410,8 +428,8 @@ namespace CalamityMod.NPCs.DevourerofGods // Phase 2 else { - // Immunity after teleport - npc.dontTakeDamage = postTeleportTimer > 0 || preventBullshitHitsAtStartofFinalPhaseTimer > 0; + // Immunity after teleport and when dying + npc.dontTakeDamage = postTeleportTimer > 0 || preventBullshitHitsAtStartofFinalPhaseTimer > 0 || Dying; // Teleport if (teleportTimer >= 0) @@ -421,6 +439,14 @@ namespace CalamityMod.NPCs.DevourerofGods Teleport(player, malice, death, revenge, expertMode, phase5); } + // Do the death animation once killed. + if (Dying) + { + teleportTimer = 0; + DoDeathAnimation(); + return; + } + // Laser walls if (phase4 && !phase6 && postTeleportTimer <= 0) { @@ -1320,7 +1346,10 @@ namespace CalamityMod.NPCs.DevourerofGods { int segment; if (segmentSpawn >= 0 && segmentSpawn < minLength) + { segment = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.height / 2), ModContent.NPCType(), npc.whoAmI); + Main.npc[segment].ModNPC().SegmentIndex = maxLength - segmentSpawn; + } else segment = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.height / 2), ModContent.NPCType(), npc.whoAmI); @@ -2039,6 +2068,115 @@ namespace CalamityMod.NPCs.DevourerofGods Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/DevourerAttack"), player.Center); } + public void DoDeathAnimation() + { + // Play a sound at the start. + if (DeathAnimationTimer == 1f) + { + var soundInstance = Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/DevourerAttack"), npc.Center); + if (soundInstance != null) + soundInstance.Volume = MathHelper.Clamp(soundInstance.Volume * 1.6f, 0f, 1f); + } + + // Close the health bar, fade in, and stop doing contact damage. + npc.Calamity().CanHaveBossHealthBar = false; + npc.Opacity = MathHelper.Clamp(npc.Opacity + 0.1f, 0f, 1f); + npc.dontTakeDamage = true; + npc.damage = 0; + + void destroySegment(int index, ref int destroyedSegments) + { + if (Main.rand.NextBool(5)) + Main.PlaySound(SoundID.Item94, npc.Center); + + List segments = new List() + { + ModContent.NPCType(), + ModContent.NPCType() + }; + for (int i = 0; i < Main.maxNPCs; i++) + { + if (segments.Contains(Main.npc[i].type) && Main.npc[i].active && + (Main.npc[i].type == segments[1] || Main.npc[i].ModNPC().SegmentIndex == index)) + { + for (int j = 0; j < 20; j++) + { + Dust cosmicBurst = Dust.NewDustPerfect(Main.npc[i].Center + Main.rand.NextVector2Circular(25f, 25f), 234); + cosmicBurst.scale = 1.7f; + cosmicBurst.velocity = Main.rand.NextVector2Circular(9f, 9f); + cosmicBurst.noGravity = true; + } + + Main.npc[i].life = 0; + Main.npc[i].HitEffect(); + Main.npc[i].active = false; + Main.npc[i].netUpdate = true; + destroyedSegments++; + break; + } + } + } + + // Slow down but maintain a specific direction. + float idealSpeed = MathHelper.Lerp(8.4f, 4f, Utils.InverseLerp(15f, 210f, DeathAnimationTimer, true)); + if (npc.velocity.Length() != idealSpeed) + npc.velocity = npc.velocity.SafeNormalize(Vector2.UnitY) * MathHelper.Lerp(npc.velocity.Length(), idealSpeed, 0.08f); + + // Stay within the world. + if (npc.Center.X < 300f || npc.Center.X > Main.maxTilesX * 16f - 300f) + npc.velocity.X *= -1f; + if (npc.Center.Y < 300f || npc.Center.Y > Main.maxTilesY * 16f - 300f) + npc.velocity.Y *= -1f; + + if (DeathAnimationTimer >= 120f && DeathAnimationTimer < 370f && DeathAnimationTimer % 3f == 0f) + { + int segmentToDestroy = (int)(Utils.InverseLerp(120f, 370f, DeathAnimationTimer, true) * 60f); + destroySegment(segmentToDestroy, ref DestroyedSegmentCount); + } + + if (DeathAnimationTimer == 452f) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + Projectile.NewProjectile(npc.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f); + + if (Main.netMode != NetmodeID.Server) + { + var soundInstance = Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/DevourerAttack"), npc.Center); + if (soundInstance != null) + soundInstance.Volume = MathHelper.Clamp(soundInstance.Volume * 1.6f, 0f, 1f); + + for (int i = 0; i < 3; i++) + { + soundInstance = Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/TeslaCannonFire"), npc.Center); + if (soundInstance != null) + { + soundInstance.Pitch = -MathHelper.Lerp(0.1f, 0.4f, i / 3f); + soundInstance.Volume = MathHelper.Clamp(soundInstance.Volume * 1.4f, 0f, 1f); + } + } + } + } + + if (DeathAnimationTimer >= 410f && DeathAnimationTimer < 470f && DeathAnimationTimer % 2f == 0f) + { + int segmentToDestroy = (int)(Utils.InverseLerp(410f, 470f, DeathAnimationTimer, true) * 10f) + 60; + destroySegment(segmentToDestroy, ref DeathAnimationTimer); + } + + float light = Utils.InverseLerp(430f, 465f, DeathAnimationTimer, true); + MoonlordDeathDrama.RequestLight(light, Main.LocalPlayer.Center); + + if (DeathAnimationTimer >= 485f) + { + npc.life = 0; + npc.HitEffect(); + npc.NPCLoot(); + npc.active = false; + npc.netUpdate = true; + } + DeathAnimationTimer++; + } + private Vector2 GetRiftLocation(bool spawnDust) { for (int i = 0; i < Main.maxProjectiles; i++) @@ -2057,6 +2195,16 @@ namespace CalamityMod.NPCs.DevourerofGods public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { + float disintegrationFactor = DeathAnimationTimer / 800f; + if (disintegrationFactor > 0f) + { + spriteBatch.EnterShaderRegion(); + GameShaders.Misc["CalamityMod:DoGDisintegration"].UseOpacity(disintegrationFactor); + GameShaders.Misc["CalamityMod:DoGDisintegration"].UseSaturation(npc.whoAmI); + GameShaders.Misc["CalamityMod:DoGDisintegration"].UseImage("Images/Misc/Perlin"); + GameShaders.Misc["CalamityMod:DoGDisintegration"].Apply(); + } + SpriteEffects spriteEffects = SpriteEffects.None; if (npc.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; @@ -2083,6 +2231,9 @@ namespace CalamityMod.NPCs.DevourerofGods spriteBatch.Draw(texture2D15, vector43, npc.frame, color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } + if (disintegrationFactor > 0f) + spriteBatch.ExitShaderRegion(); + return false; } @@ -2203,8 +2354,16 @@ namespace CalamityMod.NPCs.DevourerofGods Color messageColor = Color.Cyan; CalamityUtils.DisplayLocalizedText(key, messageColor); return false; - } - return true; + } + + if (!Dying && (damage * (crit ? 2D : 1D)) >= npc.life) + { + damage = 0D; + CheckDead(); + return false; + } + + return true; } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) @@ -2218,7 +2377,20 @@ namespace CalamityMod.NPCs.DevourerofGods return false; } - public override void HitEffect(int hitDirection, double damage) + public override bool CheckDead() + { + if (!Dying) + { + Dying = true; + npc.life = 1; + npc.dontTakeDamage = true; + npc.active = true; + npc.netUpdate = true; + } + return false; + } + + public override void HitEffect(int hitDirection, double damage) { if (npc.soundDelay == 0) { diff --git a/NPCs/DevourerofGods/DevourerofGodsTail.cs b/NPCs/DevourerofGods/DevourerofGodsTail.cs index 4435280af8..f6c7443b18 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTail.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTail.cs @@ -6,6 +6,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.IO; using Terraria; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -269,6 +270,16 @@ namespace CalamityMod.NPCs.DevourerofGods public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { + float disintegrationFactor = Main.npc[npc.realLife].ModNPC().DeathAnimationTimer / 640f; + if (disintegrationFactor > 0f) + { + spriteBatch.EnterShaderRegion(); + GameShaders.Misc["CalamityMod:DoGDisintegration"].UseOpacity(disintegrationFactor); + GameShaders.Misc["CalamityMod:DoGDisintegration"].UseSaturation(npc.whoAmI); + GameShaders.Misc["CalamityMod:DoGDisintegration"].UseImage("Images/Misc/Perlin"); + GameShaders.Misc["CalamityMod:DoGDisintegration"].Apply(); + } + SpriteEffects spriteEffects = SpriteEffects.None; if (npc.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; @@ -295,6 +306,8 @@ namespace CalamityMod.NPCs.DevourerofGods spriteBatch.Draw(texture2D15, vector43, npc.frame, color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } + if (disintegrationFactor > 0f) + spriteBatch.ExitShaderRegion(); return false; } @@ -360,10 +373,29 @@ namespace CalamityMod.NPCs.DevourerofGods public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) { + if ((damage * (crit ? 2D : 1D)) >= npc.life) + { + if (npc.realLife >= 0 && !Main.npc[npc.realLife].ModNPC().Dying) + { + damage = 0D; + npc.dontTakeDamage = true; + Main.npc[npc.realLife].ModNPC().Dying = true; + Main.npc[npc.realLife].life = 1; + Main.npc[npc.realLife].dontTakeDamage = true; + Main.npc[npc.realLife].active = true; + Main.npc[npc.realLife].netUpdate = true; + } + return false; + } return !CalamityUtils.AntiButcher(npc, ref damage, 0.5f); - } + } - public override bool CheckActive() + public override bool CheckDead() + { + return base.CheckDead(); + } + + public override bool CheckActive() { return false; } diff --git a/NPCs/DraedonLabThings/RepairUnitCritter.cs b/NPCs/DraedonLabThings/RepairUnitCritter.cs index b57e959ef0..39d7b1717b 100644 --- a/NPCs/DraedonLabThings/RepairUnitCritter.cs +++ b/NPCs/DraedonLabThings/RepairUnitCritter.cs @@ -83,6 +83,10 @@ namespace CalamityMod.NPCs.DraedonLabThings PreviousStuckPosition = reader.ReadVector2(); } + public override bool? CanBeHitByItem(Player player, Item item) => true; + + public override bool? CanBeHitByProjectile(Projectile projectile) => true; + public override void AI() { if (!Initialized) diff --git a/NPCs/HiveMind/HiveMind.cs b/NPCs/HiveMind/HiveMind.cs index 451d7369cf..fbeb664a26 100644 --- a/NPCs/HiveMind/HiveMind.cs +++ b/NPCs/HiveMind/HiveMind.cs @@ -1111,6 +1111,7 @@ namespace CalamityMod.NPCs.HiveMind DropHelper.DropItemSpray(npc, ItemID.RottenChunk, 9, 15, 3); if (Main.hardMode) DropHelper.DropItemSpray(npc, ItemID.CursedFlame, 10, 20, 2); + DropHelper.DropItem(npc, ItemID.CorruptSeeds, 2, 4); // Weapons float w = DropHelper.NormalWeaponDropRateFloat; diff --git a/NPCs/Perforator/PerforatorHive.cs b/NPCs/Perforator/PerforatorHive.cs index 5c35bf3aaa..24cd78b67f 100644 --- a/NPCs/Perforator/PerforatorHive.cs +++ b/NPCs/Perforator/PerforatorHive.cs @@ -488,6 +488,7 @@ namespace CalamityMod.NPCs.Perforator DropHelper.DropItemSpray(npc, ItemID.Vertebrae, 3, 9); if (Main.hardMode) DropHelper.DropItemSpray(npc, ItemID.Ichor, 10, 20, 2); + DropHelper.DropItem(npc, ItemID.CrimsonSeeds, 2, 4); // Weapons float w = DropHelper.NormalWeaponDropRateFloat; diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 7d2f6796d8..969aafd628 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -69,6 +69,8 @@ namespace CalamityMod.NPCs.Providence private int healTimer = 0; internal bool challenge = Main.expertMode/* && Main.netMode == NetmodeID.SinglePlayer*/; //Used to determine if Profaned Soul Crystal should drop, couldn't figure out mp mems always dropping it so challenge is singleplayer only. internal bool hasTakenDaytimeDamage = false; + public bool Dying = false; + public int DeathAnimationTimer; public static float normalDR = 0.3f; public static float cocoonDR = 0.9f; @@ -121,6 +123,8 @@ namespace CalamityMod.NPCs.Providence writer.Write(npc.chaseable); writer.Write(npc.canGhostHeal); writer.Write(npc.localAI[2]); + writer.Write(Dying); + writer.Write(DeathAnimationTimer); for (int i = 0; i < 4; i++) writer.Write(npc.Calamity().newAI[i]); } @@ -139,6 +143,8 @@ namespace CalamityMod.NPCs.Providence npc.chaseable = reader.ReadBoolean(); npc.canGhostHeal = reader.ReadBoolean(); npc.localAI[2] = reader.ReadSingle(); + Dying = reader.ReadBoolean(); + DeathAnimationTimer = reader.ReadInt32(); for (int i = 0; i < 4; i++) npc.Calamity().newAI[i] = reader.ReadSingle(); } @@ -348,7 +354,14 @@ namespace CalamityMod.NPCs.Providence // Take damage or not bool biomeEnraged = biomeEnrageTimer <= 0 || malice; - npc.dontTakeDamage = biomeEnraged && !malice; + npc.dontTakeDamage = (biomeEnraged && !malice) || Dying; + + // Do the death animation once killed. + if (Dying) + { + DoDeathAnimation(); + return; + } // Heal if (healerAlive) @@ -1273,6 +1286,84 @@ namespace CalamityMod.NPCs.Providence } } + public void DoDeathAnimation() + { + AIState = (int)Phase.HolyFire; + useDefenseFrames = false; + DeathAnimationTimer++; + + // Slow down to a halt and define rotation based off of that. + npc.velocity *= 0.9f; + npc.rotation = npc.velocity.X * 0.004f; + + // Play an animation sound immediately. Also delete various projectiles. + if (DeathAnimationTimer == 1f) + { + if (Main.netMode != NetmodeID.Server && Main.LocalPlayer.WithinRange(npc.Center, 4800f)) + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ProvidenceDeathAnimation").WithVolume(1.65f), Main.LocalPlayer.Center); + + DespawnSpecificProjectiles(); + + int laserType = ModContent.ProjectileType(); + for (int i = 0; i < Main.maxProjectiles; i++) + { + if (!Main.projectile[i].active || Main.projectile[i].type != laserType) + continue; + Main.projectile[i].Kill(); + } + } + + // Begin fading out before the exploding sun animation happens. + if (DeathAnimationTimer >= 370f) + npc.Opacity *= 0.97f; + + // Create an explosive wave shortly after the death animation begins. + // The temporal offset coincides with the point at which the crystal shatter sound happens in the + // above defeat scene sound. + if (DeathAnimationTimer == 92f) + { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ProvidenceHolyBlastImpact"), npc.Center); + Main.PlaySound(npc.DeathSound, npc.Center); + if (Main.netMode != NetmodeID.MultiplayerClient) + Projectile.NewProjectile(npc.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f); + } + + // Explode as an enormous holy star before dying and dropping loot. + if (Main.netMode != NetmodeID.MultiplayerClient && DeathAnimationTimer == 310f) + { + for (int i = 0; i < 80; i++) + { + Vector2 sparkleVelocity = Main.rand.NextVector2Circular(23f, 23f); + Projectile.NewProjectile(npc.Center, sparkleVelocity, ModContent.ProjectileType(), 0, 0f); + } + Projectile.NewProjectile(npc.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, 255); + } + + // Idly release harmless cindiers. + int shootRate = (int)MathHelper.Lerp(12f, 5f, Utils.InverseLerp(0f, 250f, DeathAnimationTimer, true)); + if (DeathAnimationTimer % shootRate == shootRate - 1f) + { + for (int i = 0; i < 3; i++) + { + Vector2 shootVelocity = Main.rand.NextVector2CircularEdge(13f, 13f) * Main.rand.NextFloat(0.7f, 1.3f); + Projectile.NewProjectile(npc.Center, shootVelocity, ModContent.ProjectileType(), 0, 0f, 255); + } + } + + // Do periodic syncs. + if (Main.netMode == NetmodeID.Server && DeathAnimationTimer % 45f == 44f) + npc.netUpdate = true; + + // Die and create drops after the star is gone. + if (DeathAnimationTimer >= 345f) + { + npc.active = false; + npc.HitEffect(); + npc.NPCLoot(); + npc.netUpdate = true; + } + } + public float CalculateBurnIntensity() { float distanceToTarget = Vector2.Distance(Main.player[npc.target].Center, npc.Center); @@ -1444,126 +1535,157 @@ namespace CalamityMod.NPCs.Providence public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - bool malice = CalamityWorld.malice; - bool nightTime = !Main.dayTime || malice; + void drawProvidenceInstance(Vector2 drawOffset, Color? colorOverride) + { + bool malice = CalamityWorld.malice; + bool nightTime = !Main.dayTime || malice; - string baseTextureString = "CalamityMod/NPCs/Providence/"; - string baseGlowTextureString = baseTextureString + "Glowmasks/"; + string baseTextureString = "CalamityMod/NPCs/Providence/"; + string baseGlowTextureString = baseTextureString + "Glowmasks/"; - string getTextureString = baseTextureString + "Providence"; - string getTextureGlowString = baseGlowTextureString + "ProvidenceGlow"; - string getTextureGlow2String = baseGlowTextureString + "ProvidenceGlow2"; + string getTextureString = baseTextureString + "Providence"; + string getTextureGlowString = baseGlowTextureString + "ProvidenceGlow"; + string getTextureGlow2String = baseGlowTextureString + "ProvidenceGlow2"; - if (AIState == (int)Phase.FlameCocoon || AIState == (int)Phase.SpearCocoon) - { - if (!useDefenseFrames) + if (AIState == (int)Phase.FlameCocoon || AIState == (int)Phase.SpearCocoon) { - getTextureString = baseTextureString + "ProvidenceDefense"; - getTextureGlowString = baseGlowTextureString + "ProvidenceDefenseGlow"; - getTextureGlow2String = baseGlowTextureString + "ProvidenceDefenseGlow2"; + if (!useDefenseFrames) + { + getTextureString = baseTextureString + "ProvidenceDefense"; + getTextureGlowString = baseGlowTextureString + "ProvidenceDefenseGlow"; + getTextureGlow2String = baseGlowTextureString + "ProvidenceDefenseGlow2"; + } + else + { + getTextureString = baseTextureString + "ProvidenceDefenseAlt"; + getTextureGlowString = baseGlowTextureString + "ProvidenceDefenseAltGlow"; + getTextureGlow2String = baseGlowTextureString + "ProvidenceDefenseAltGlow2"; + } } else { - getTextureString = baseTextureString + "ProvidenceDefenseAlt"; - getTextureGlowString = baseGlowTextureString + "ProvidenceDefenseAltGlow"; - getTextureGlow2String = baseGlowTextureString + "ProvidenceDefenseAltGlow2"; + if (frameUsed == 0) + { + getTextureGlowString = baseGlowTextureString + "ProvidenceGlow"; + getTextureGlow2String = baseGlowTextureString + "ProvidenceGlow2"; + } + else if (frameUsed == 1) + { + getTextureString = baseTextureString + "ProvidenceAlt"; + getTextureGlowString = baseGlowTextureString + "ProvidenceAltGlow"; + getTextureGlow2String = baseGlowTextureString + "ProvidenceAltGlow2"; + } + else if (frameUsed == 2) + { + getTextureString = baseTextureString + "ProvidenceAttack"; + getTextureGlowString = baseGlowTextureString + "ProvidenceAttackGlow"; + getTextureGlow2String = baseGlowTextureString + "ProvidenceAttackGlow2"; + } + else + { + getTextureString = baseTextureString + "ProvidenceAttackAlt"; + getTextureGlowString = baseGlowTextureString + "ProvidenceAttackAltGlow"; + getTextureGlow2String = baseGlowTextureString + "ProvidenceAttackAltGlow2"; + } } - } - else - { - if (frameUsed == 0) - { - getTextureGlowString = baseGlowTextureString + "ProvidenceGlow"; - getTextureGlow2String = baseGlowTextureString + "ProvidenceGlow2"; - } - else if (frameUsed == 1) - { - getTextureString = baseTextureString + "ProvidenceAlt"; - getTextureGlowString = baseGlowTextureString + "ProvidenceAltGlow"; - getTextureGlow2String = baseGlowTextureString + "ProvidenceAltGlow2"; - } - else if (frameUsed == 2) - { - getTextureString = baseTextureString + "ProvidenceAttack"; - getTextureGlowString = baseGlowTextureString + "ProvidenceAttackGlow"; - getTextureGlow2String = baseGlowTextureString + "ProvidenceAttackGlow2"; - } - else - { - getTextureString = baseTextureString + "ProvidenceAttackAlt"; - getTextureGlowString = baseGlowTextureString + "ProvidenceAttackAltGlow"; - getTextureGlow2String = baseGlowTextureString + "ProvidenceAttackAltGlow2"; - } - } - if (nightTime) - { - getTextureString += "Night"; - getTextureGlowString += "Night"; - getTextureGlow2String += "Night"; + if (nightTime) + { + getTextureString += "Night"; + getTextureGlowString += "Night"; + getTextureGlow2String += "Night"; + } + + Texture2D texture = ModContent.GetTexture(getTextureString); + Texture2D textureGlow = ModContent.GetTexture(getTextureGlowString); + Texture2D textureGlow2 = ModContent.GetTexture(getTextureGlow2String); + + SpriteEffects spriteEffects = SpriteEffects.None; + if (npc.spriteDirection == 1) + spriteEffects = SpriteEffects.FlipHorizontally; + + Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2); + Color color36 = Color.White; + float amount9 = 0.5f; + int num153 = 5; + + if (CalamityConfig.Instance.Afterimages) + { + for (int num155 = 1; num155 < num153; num155 += 2) + { + Color color38 = lightColor; + color38 = Color.Lerp(color38, color36, amount9); + color38 = npc.GetAlpha(color38); + color38 *= (num153 - num155) / 15f; + if (colorOverride != null) + color38 = colorOverride.Value; + + Vector2 vector41 = npc.oldPos[num155] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; + vector41 -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; + vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY) + drawOffset; + spriteBatch.Draw(texture, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); + } + } + + Vector2 vector43 = npc.Center - Main.screenPosition; + vector43 -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; + vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY) + drawOffset; + spriteBatch.Draw(texture, vector43, npc.frame, colorOverride ?? npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); + + Color color37 = Color.Lerp(Color.White, nightTime ? Color.Cyan : Color.Yellow, 0.5f) * npc.Opacity; + Color color42 = Color.Lerp(Color.White, nightTime ? Color.BlueViolet : Color.Violet, 0.5f) * npc.Opacity; + if (colorOverride != null) + { + color37 = colorOverride.Value; + color42 = colorOverride.Value; + } + + if (CalamityConfig.Instance.Afterimages) + { + for (int num163 = 1; num163 < num153; num163++) + { + Color color41 = color37; + color41 = Color.Lerp(color41, color36, amount9); + color41 = npc.GetAlpha(color41); + color41 *= (num153 - num163) / 15f; + if (colorOverride != null) + color41 = colorOverride.Value; + + Vector2 vector44 = npc.oldPos[num163] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; + vector44 -= new Vector2(textureGlow.Width, textureGlow.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; + vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY) + drawOffset; + spriteBatch.Draw(textureGlow, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); + + Color color43 = color42; + color43 = Color.Lerp(color43, color36, amount9); + color43 = npc.GetAlpha(color43); + color43 *= (num153 - num163) / 15f; + if (colorOverride != null) + color43 = colorOverride.Value; + spriteBatch.Draw(textureGlow2, vector44, npc.frame, color43, npc.rotation, vector11, npc.scale, spriteEffects, 0f); + } + } + + spriteBatch.Draw(textureGlow, vector43, npc.frame, color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f); + + spriteBatch.Draw(textureGlow2, vector43, npc.frame, color42, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } - Texture2D texture = ModContent.GetTexture(getTextureString); - Texture2D textureGlow = ModContent.GetTexture(getTextureGlowString); - Texture2D textureGlow2 = ModContent.GetTexture(getTextureGlow2String); - - SpriteEffects spriteEffects = SpriteEffects.None; - if (npc.spriteDirection == 1) - spriteEffects = SpriteEffects.FlipHorizontally; - - Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2); - Color color36 = Color.White; - float amount9 = 0.5f; - int num153 = 5; - - if (CalamityConfig.Instance.Afterimages) + float burnIntensity = Utils.InverseLerp(0f, 45f, DeathAnimationTimer, true); + int totalProvidencesToDraw = (int)MathHelper.Lerp(1f, 30f, burnIntensity); + for (int i = 0; i < totalProvidencesToDraw; i++) { - for (int num155 = 1; num155 < num153; num155 += 2) - { - Color color38 = lightColor; - color38 = Color.Lerp(color38, color36, amount9); - color38 = npc.GetAlpha(color38); - color38 *= (num153 - num155) / 15f; - Vector2 vector41 = npc.oldPos[num155] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; - vector41 -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector41 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); - spriteBatch.Draw(texture, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); - } + float offsetAngle = MathHelper.TwoPi * i * 2f / totalProvidencesToDraw; + float drawOffsetFactor = (float)Math.Sin(offsetAngle * 6f + Main.GlobalTime * MathHelper.Pi); + drawOffsetFactor *= (float)Math.Pow(burnIntensity, 3f) * 50f; + + Vector2 drawOffset = offsetAngle.ToRotationVector2() * drawOffsetFactor; + Color baseColor = Color.White * (MathHelper.Lerp(0.4f, 0.8f, burnIntensity) / totalProvidencesToDraw * 1.5f); + baseColor.A = 0; + + baseColor = Color.Lerp(Color.White, baseColor, burnIntensity); + drawProvidenceInstance(drawOffset, totalProvidencesToDraw == 1 ? null : (Color?)baseColor); } - - Vector2 vector43 = npc.Center - Main.screenPosition; - vector43 -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); - spriteBatch.Draw(texture, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); - - Color color37 = Color.Lerp(Color.White, nightTime ? Color.Cyan : Color.Yellow, 0.5f) * npc.Opacity; - Color color42 = Color.Lerp(Color.White, nightTime ? Color.BlueViolet : Color.Violet, 0.5f) * npc.Opacity; - - if (CalamityConfig.Instance.Afterimages) - { - for (int num163 = 1; num163 < num153; num163++) - { - Color color41 = color37; - color41 = Color.Lerp(color41, color36, amount9); - color41 = npc.GetAlpha(color41); - color41 *= (num153 - num163) / 15f; - Vector2 vector44 = npc.oldPos[num163] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; - vector44 -= new Vector2(textureGlow.Width, textureGlow.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; - vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); - spriteBatch.Draw(textureGlow, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); - - Color color43 = color42; - color43 = Color.Lerp(color43, color36, amount9); - color43 = npc.GetAlpha(color43); - color43 *= (num153 - num163) / 15f; - spriteBatch.Draw(textureGlow2, vector44, npc.frame, color43, npc.rotation, vector11, npc.scale, spriteEffects, 0f); - } - } - - spriteBatch.Draw(textureGlow, vector43, npc.frame, color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f); - - spriteBatch.Draw(textureGlow2, vector43, npc.frame, color42, npc.rotation, vector11, npc.scale, spriteEffects, 0f); - return false; } @@ -1573,7 +1695,7 @@ namespace CalamityMod.NPCs.Providence { if (!useDefenseFrames) { - npc.frameCounter += 1.0; + npc.frameCounter += Dying ? 0.25 : 1.0; if (npc.frameCounter > 8.0) { npc.frame.Y = npc.frame.Y + frameHeight; @@ -1587,7 +1709,7 @@ namespace CalamityMod.NPCs.Providence } else { - npc.frameCounter += 1.0; + npc.frameCounter += Dying ? 0.25 : 1.0; if (npc.frameCounter > 8.0) { npc.frame.Y = npc.frame.Y + frameHeight; @@ -1602,7 +1724,7 @@ namespace CalamityMod.NPCs.Providence if (useDefenseFrames) useDefenseFrames = false; - npc.frameCounter += 1.0; + npc.frameCounter += Dying ? 0.25 : 1.0; if (npc.frameCounter > (npc.Calamity().newAI[3] < 180f ? 8.0 : 5.0)) { npc.frameCounter = 0.0; @@ -1717,11 +1839,36 @@ namespace CalamityMod.NPCs.Providence netMessage.Send(); } } + } + + public override bool CheckDead() + { + if (!Dying) + { + Dying = true; + npc.life = 1; + npc.dontTakeDamage = true; + npc.active = true; + npc.netUpdate = true; + } + return false; + } + + public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) + { + if (!Dying && (damage * (crit ? 2D : 1D)) >= npc.life) + { + damage = 0D; + CheckDead(); + return false; + } + + return base.StrikeNPC(ref damage, defense, ref knockback, hitDirection, ref crit); } public override void HitEffect(int hitDirection, double damage) { - if (npc.soundDelay == 0) + if (npc.soundDelay == 0 && !Dying) { npc.soundDelay = 8; Main.PlaySound(mod.GetLegacySoundSlot(SoundType.NPCHit, "Sounds/NPCHit/ProvidenceHurt"), npc.Center); diff --git a/Projectiles/Boss/DoGDeathBoom.cs b/Projectiles/Boss/DoGDeathBoom.cs new file mode 100644 index 0000000000..4eb291ebcb --- /dev/null +++ b/Projectiles/Boss/DoGDeathBoom.cs @@ -0,0 +1,36 @@ +using CalamityMod.Projectiles.BaseProjectiles; +using Microsoft.Xna.Framework; +using Terraria; + +namespace CalamityMod.Projectiles.Boss +{ + public class DoGDeathBoom : BaseMassiveExplosionProjectile + { + public override int Lifetime => 180; + public override bool UsesScreenshake => true; + public override float GetScreenshakePower(float pulseCompletionRatio) => CalamityUtils.Convert01To010(pulseCompletionRatio) * 28f; + public override Color GetCurrentExplosionColor(float pulseCompletionRatio) + { + return Color.Lerp(Color.Cyan, Color.Fuchsia, MathHelper.Clamp(pulseCompletionRatio * 1.75f, 0f, 1f)); + } + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public override void SetStaticDefaults() => DisplayName.SetDefault("Cosmic Explosion"); + + public override void SetDefaults() + { + projectile.width = projectile.height = 2; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.penetrate = -1; + projectile.timeLeft = Lifetime; + cooldownSlot = 1; + } + + public override void PostAI() + { + MaxRadius = 4200f; + Lighting.AddLight(projectile.Center, 0.1f, 0.1f, 0.1f); + } + } +} diff --git a/Projectiles/Boss/DyingSun.cs b/Projectiles/Boss/DyingSun.cs new file mode 100644 index 0000000000..5636990498 --- /dev/null +++ b/Projectiles/Boss/DyingSun.cs @@ -0,0 +1,76 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.Collections.Generic; +using Terraria; +using Terraria.Graphics.Shaders; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Boss +{ + public class DyingSun : ModProjectile + { + public PrimitiveTrail FireDrawer; + public ref float Time => ref projectile.ai[0]; + public ref float Radius => ref projectile.ai[1]; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public override void SetStaticDefaults() => DisplayName.SetDefault("Dying Sun"); + + public override void SetDefaults() + { + projectile.width = 164; + projectile.height = 164; + projectile.tileCollide = false; + projectile.penetrate = -1; + projectile.timeLeft = 100; + projectile.MaxUpdates = 2; + projectile.scale = 1f; + } + + public override void AI() + { + projectile.scale += 0.08f; + Radius = projectile.scale * 42f; + projectile.Opacity = Utils.InverseLerp(8f, 42f, projectile.timeLeft, true); + + Time++; + } + + public float SunWidthFunction(float completionRatio) => Radius * projectile.scale * (float)Math.Sin(MathHelper.Pi * completionRatio); + + public Color SunColorFunction(float completionRatio) + { + Color sunColor = Main.dayTime ? Color.Yellow : Color.Cyan; + return Color.Lerp(sunColor, Color.White, (float)Math.Sin(MathHelper.Pi * completionRatio) * 0.5f + 0.3f) * projectile.Opacity; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + if (FireDrawer is null) + FireDrawer = new PrimitiveTrail(SunWidthFunction, SunColorFunction, null, GameShaders.Misc["CalamityMod:Flame"]); + + GameShaders.Misc["CalamityMod:Flame"].UseSaturation(0.45f); + GameShaders.Misc["CalamityMod:Flame"].UseImage("Images/Misc/Perlin"); + + List rotationPoints = new List(); + List drawPoints = new List(); + + for (float offsetAngle = -MathHelper.PiOver2; offsetAngle <= MathHelper.PiOver2; offsetAngle += MathHelper.Pi / 80f) + { + rotationPoints.Clear(); + drawPoints.Clear(); + + float adjustedAngle = offsetAngle + MathHelper.Pi * -0.2f; + Vector2 offsetDirection = adjustedAngle.ToRotationVector2(); + for (int i = 0; i < 16; i++) + { + rotationPoints.Add(adjustedAngle); + drawPoints.Add(Vector2.Lerp(projectile.Center - offsetDirection * Radius / 2f, projectile.Center + offsetDirection * Radius / 2f, i / 16f)); + } + + FireDrawer.Draw(drawPoints, -Main.screenPosition, 24); + } + return false; + } + } +} diff --git a/Projectiles/Boss/HolyExplosionBoom.cs b/Projectiles/Boss/HolyExplosionBoom.cs new file mode 100644 index 0000000000..004f649224 --- /dev/null +++ b/Projectiles/Boss/HolyExplosionBoom.cs @@ -0,0 +1,37 @@ +using CalamityMod.Projectiles.BaseProjectiles; +using Microsoft.Xna.Framework; +using Terraria; + +namespace CalamityMod.Projectiles.Boss +{ + public class HolyExplosionBoom : BaseMassiveExplosionProjectile + { + public override int Lifetime => 60; + public override bool UsesScreenshake => true; + public override float GetScreenshakePower(float pulseCompletionRatio) => CalamityUtils.Convert01To010(pulseCompletionRatio) * 16f; + public override Color GetCurrentExplosionColor(float pulseCompletionRatio) + { + Color explosionColor = Main.dayTime ? Color.Orange : Color.BlueViolet; + return Color.Lerp(explosionColor * 1.6f, Color.White, MathHelper.Clamp(pulseCompletionRatio * 2.2f, 0f, 1f)); + } + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public override void SetStaticDefaults() => DisplayName.SetDefault("Holy Explosion"); + + public override void SetDefaults() + { + projectile.width = projectile.height = 2; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.penetrate = -1; + projectile.timeLeft = Lifetime; + cooldownSlot = 1; + } + + public override void PostAI() + { + MaxRadius = 3000f; + Lighting.AddLight(projectile.Center, 0.1f, 0.1f, 0.1f); + } + } +} diff --git a/Projectiles/Boss/MajesticSparkle.cs b/Projectiles/Boss/MajesticSparkle.cs new file mode 100644 index 0000000000..ba14dd1797 --- /dev/null +++ b/Projectiles/Boss/MajesticSparkle.cs @@ -0,0 +1,80 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Boss +{ + public class MajesticSparkle : ModProjectile + { + public ref float Time => ref projectile.ai[0]; + public ref float ColorSpectrumHue => ref projectile.ai[1]; + public const int Lifetime = 90; + public const int FadeinTime = 18; + public const int FadeoutTime = 18; + public override string Texture => "CalamityMod/Projectiles/StarProj"; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Majestic Sparkle"); + } + + public override void SetDefaults() + { + projectile.width = 72; + projectile.height = 72; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.timeLeft = Lifetime; + projectile.scale = 0.001f; + } + + public override void AI() + { + if (Time == 1f) + { + projectile.scale = Main.rand.NextFloat(0.3f, 0.75f); + CalamityGlobalProjectile.ExpandHitboxBy(projectile, (int)(projectile.scale * 72f)); + + ColorSpectrumHue = Main.rand.NextFloat(0f, 0.9999f); + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; + projectile.netUpdate = true; + } + + projectile.velocity *= 0.96f; + projectile.rotation = projectile.rotation.AngleLerp(MathHelper.PiOver2, 0.085f); + + // Go 33% across the color spectrum throughout the sparkle's lifetime instead of using a static color. + ColorSpectrumHue = (ColorSpectrumHue + 0.333f / Lifetime) % 0.999f; + + projectile.Opacity = Utils.InverseLerp(0f, FadeinTime, Time, true) * Utils.InverseLerp(Lifetime, Lifetime - FadeoutTime, Time, true); + projectile.velocity = projectile.velocity.RotatedBy(Math.Sin(Time / 30f) * 0.0125f); + + Time++; + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D sparkleTexture = ModContent.GetTexture(Texture); + + Vector2 drawPosition = projectile.Center - Main.screenPosition + Vector2.UnitY * projectile.gfxOffY; + Color sparkleColor = Main.hslToRgb(ColorSpectrumHue, 1f, 0.5f) * projectile.Opacity * 0.5f; + sparkleColor.A = 0; + + sparkleColor *= MathHelper.Lerp(1f, 1.5f, Utils.InverseLerp(Lifetime * 0.5f - 15f, Lifetime * 0.5f + 15f, Time, true)); + + Color orthogonalSparkleColor = Color.Lerp(sparkleColor, Color.White, 0.5f) * 0.5f; + + Vector2 origin = sparkleTexture.Size() * 0.5f; + + Vector2 sparkleScale = new Vector2(0.3f, 1f) * projectile.Opacity * projectile.scale; + Vector2 orthogonalsparkleScale = new Vector2(0.3f, 2f) * projectile.Opacity * projectile.scale; + + spriteBatch.Draw(sparkleTexture, drawPosition, null, sparkleColor, MathHelper.PiOver2 + projectile.rotation, origin, orthogonalsparkleScale, SpriteEffects.None, 0f); + spriteBatch.Draw(sparkleTexture, drawPosition, null,sparkleColor, projectile.rotation, origin, sparkleScale, SpriteEffects.None, 0f); + spriteBatch.Draw(sparkleTexture, drawPosition, null, orthogonalSparkleColor, MathHelper.PiOver2 + projectile.rotation, origin, orthogonalsparkleScale * 0.6f, SpriteEffects.None, 0f); + spriteBatch.Draw(sparkleTexture, drawPosition, null, orthogonalSparkleColor, projectile.rotation, origin, sparkleScale * 0.6f, SpriteEffects.None, 0f); + return false; + } + } +} diff --git a/Projectiles/Boss/SwirlingFire.cs b/Projectiles/Boss/SwirlingFire.cs new file mode 100644 index 0000000000..0978ac2b30 --- /dev/null +++ b/Projectiles/Boss/SwirlingFire.cs @@ -0,0 +1,45 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Boss +{ + public class SwirlingFire : ModProjectile + { + public ref float AngularTurnSpeed => ref projectile.ai[0]; + public ref float Time => ref projectile.ai[1]; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Fire"); + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 10; + projectile.hostile = true; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.alpha = 255; + projectile.penetrate = -1; + projectile.timeLeft = 180; + cooldownSlot = 1; + } + + public override void AI() + { + Vector2 fireVelocity = (Time / 6f).ToRotationVector2() * Main.rand.NextFloat(1.7f, 2.2f); + Dust fire = Dust.NewDustPerfect(projectile.Center + Main.rand.NextVector2Circular(3f, 3f), Main.dayTime ? 6 : 267); + fire.velocity = fireVelocity.RotatedBy(MathHelper.PiOver2); + fire.scale = Main.rand.NextFloat(1.3f, 1.45f); + fire.noGravity = true; + if (!Main.dayTime) + fire.color = Color.Lerp(Color.Cyan, Color.BlueViolet, Main.rand.NextFloat()); + + Dust.CloneDust(fire).velocity = fireVelocity.RotatedBy(-MathHelper.PiOver2); + + projectile.velocity = projectile.velocity.RotatedBy(AngularTurnSpeed); + Time++; + } + } +} diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index bea3e96955..b94e45bcc7 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -903,7 +903,7 @@ namespace CalamityMod.Projectiles return false; } - else if (projectile.type == ProjectileID.CultistBossLightningOrbArc) + else if (projectile.type == ProjectileID.CultistBossLightningOrbArc && !projectile.friendly) { projectile.frameCounter++; if (projectile.velocity == Vector2.Zero) diff --git a/Projectiles/Magic/MeteorStar.cs b/Projectiles/Magic/MeteorStar.cs new file mode 100644 index 0000000000..5ac309276a --- /dev/null +++ b/Projectiles/Magic/MeteorStar.cs @@ -0,0 +1,213 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Magic +{ + public class MeteorStar : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Meteor Star"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + Main.projFrames[projectile.type] = 3; + } + + public override void SetDefaults() + { + projectile.width = 42; + projectile.height = 34; + projectile.friendly = true; + projectile.magic = true; + projectile.timeLeft = 361; + } + + public override void AI() + { + Player player = Main.player[projectile.owner]; + bool flippedGravity = player.gravDir == -1f; + + projectile.frameCounter++; + if (projectile.frameCounter > 6) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame >= Main.projFrames[projectile.type]) + { + projectile.frame = 0; + } + + Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0.15f / 255f); + + bool explodingSoon = projectile.timeLeft <= 120; + if (projectile.soundDelay <= 0) + { + projectile.soundDelay = 30 + Main.rand.Next(40); + if (explodingSoon) + projectile.soundDelay -= 30; + if (Main.rand.NextBool(10) || explodingSoon) + { + Main.PlaySound(SoundID.Item9, projectile.Center); + } + } + if (Main.rand.NextBool(20) || explodingSoon && Main.rand.NextBool(3)) + { + int idx = Gore.NewGore(projectile.Center, projectile.velocity * 0.2f, Main.rand.Next(16, 18), 1f); + Main.gore[idx].velocity *= 0.66f; + Main.gore[idx].velocity += projectile.velocity * 0.3f; + } + if (explodingSoon) + { + for (int i = 0; i < 3; i++) + { + int smoke = Dust.NewDust(projectile.position, projectile.width, projectile.height, DustID.Smoke, 0f, 0f, 100, default, 2f); + Dust dust = Main.dust[smoke]; + dust.velocity *= 0.3f; + dust.position.X = projectile.Center.X + 4f + Main.rand.NextFloat(-6f, 6f); + dust.position.Y = projectile.Center.Y + Main.rand.NextFloat(-6f, 6f); + dust.noGravity = true; + } + } + + if (Main.myPlayer == projectile.owner) + { + if (player.channel) + { + float speed = 14f; + float mouseDistX = (float)Main.mouseX + Main.screenPosition.X - projectile.Center.X; + float mouseDistY = (float)Main.mouseY + Main.screenPosition.Y - projectile.Center.Y; + if (player.gravDir == -1f) + { + mouseDistY = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - projectile.Center.Y; + } + Vector2 mouseVec = new Vector2(mouseDistX, mouseDistY); + float mouseDist = mouseVec.Length(); + if (mouseDist > speed) + { + mouseDist = speed / mouseDist; + mouseVec.X *= mouseDist; + mouseVec.Y *= mouseDist; + int mouseSpeedX = (int)(mouseVec.X * 1000f); + int projSpeedX = (int)(projectile.velocity.X * 1000f); + int mouseSpeedY = (int)(mouseVec.Y * 1000f); + int projSpeedY = (int)(projectile.velocity.Y * 1000f); + if (mouseSpeedX != projSpeedX || mouseSpeedY != projSpeedY) + { + projectile.netUpdate = true; + } + projectile.velocity.X = mouseVec.X; + projectile.velocity.Y = mouseVec.Y; + } + else + { + int mouseSpeedX = (int)(mouseVec.X * 1000f); + int projSpeedX = (int)(projectile.velocity.X * 1000f); + int mouseSpeedY = (int)(mouseVec.Y * 1000f); + int projSpeedY = (int)(projectile.velocity.Y * 1000f); + if (mouseSpeedX != projSpeedX || mouseSpeedY != projSpeedY) + { + projectile.netUpdate = true; + } + projectile.velocity.X = mouseVec.X; + projectile.velocity.Y = mouseVec.Y; + } + player.direction = (projectile.velocity.X > 0).ToDirectionInt(); + player.velocity = projectile.velocity; + if (projectile.velocity.Y > 16f) + { + projectile.velocity.Y = 16f; + player.velocity.Y = 16f; + } + if (player.mount != null) + { + player.mount.Dismount(player); + } + if (!flippedGravity) + player.Bottom = projectile.Center; + else + player.Top = projectile.Center; + } + else + { + Explode(true); + } + } + + projectile.tileCollide = projectile.velocity != Vector2.Zero && ++projectile.ai[0] >= 5f; + + // Die immediately if the owner of this projectile is clipping into tiles because of its movement. + if (Collision.SolidCollision(player.position, player.width, player.height) && projectile.velocity != Vector2.Zero) + { + player.velocity.Y = 0f; + Explode(); + } + + if (projectile.timeLeft <= 1) + Explode(); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) => Explode(); + + public override void OnHitPvp(Player target, int damage, bool crit) => Explode(); + + public override bool OnTileCollide(Vector2 oldVelocity) + { + Explode(); + return base.OnTileCollide(oldVelocity); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityUtils.DrawAfterimagesCentered(projectile, ProjectileID.Sets.TrailingMode[projectile.type], lightColor, 1); + + // Draw the main texture in fullbright + Texture2D texture = Main.projectileTexture[projectile.type]; + + int frameHeight = texture.Height / Main.projFrames[projectile.type]; + int frameY = frameHeight * projectile.frame; + float scale = projectile.scale; + float rotation = projectile.rotation; + + Rectangle rectangle = new Rectangle(0, frameY, texture.Width, frameHeight); + Vector2 origin = rectangle.Size() / 2f; + + SpriteEffects spriteEffects = SpriteEffects.None; + if (projectile.spriteDirection == -1) + spriteEffects = SpriteEffects.FlipHorizontally; + Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), rectangle, Color.White, rotation, origin, scale, spriteEffects, 0f); + return false; + } + + private void Explode(bool reducedDmg = false) + { + CalamityGlobalProjectile.ExpandHitboxBy(projectile, 64); + Main.PlaySound(SoundID.Item14, projectile.Center); + Vector2 spawnPos = projectile.Center; + spawnPos.Y -= 70f; + if (reducedDmg) + projectile.damage /= 6; + Projectile.NewProjectile(spawnPos, Vector2.Zero, ModContent.ProjectileType(), projectile.damage * 3, projectile.knockBack * 3f, projectile.owner, reducedDmg.ToInt()); + + for (int i = 0; i < 10; i++) + { + int idx = Dust.NewDust(projectile.position, projectile.width, projectile.height, DustID.Smoke, 0f, 0f, 100, default, 1.2f); + Main.dust[idx].velocity *= 3f; + if (Main.rand.NextBool(2)) + { + Main.dust[idx].scale = 0.5f; + Main.dust[idx].fadeIn = 1f + Main.rand.Next(10) * 0.1f; + } + } + for (int i = 0; i < 5; i++) + { + Gore.NewGore(projectile.position, projectile.velocity * 0.05f, Main.rand.Next(16, 18), 1f); + } + projectile.Kill(); + } + } +} diff --git a/Projectiles/Magic/MeteorStar.png b/Projectiles/Magic/MeteorStar.png new file mode 100644 index 0000000000..68446c0493 Binary files /dev/null and b/Projectiles/Magic/MeteorStar.png differ diff --git a/Projectiles/Magic/MeteorStarExplosion.cs b/Projectiles/Magic/MeteorStarExplosion.cs new file mode 100644 index 0000000000..e365fd996f --- /dev/null +++ b/Projectiles/Magic/MeteorStarExplosion.cs @@ -0,0 +1,60 @@ +using CalamityMod.Items.Weapons.Magic; +using Terraria; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Magic +{ + public class MeteorStarExplosion : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Explosion"); + Main.projFrames[projectile.type] = 7; + } + + public override void SetDefaults() + { + projectile.width = 84; + projectile.height = 152; + projectile.friendly = true; + projectile.magic = true; + projectile.penetrate = -1; + projectile.timeLeft = Main.projFrames[projectile.type] * 5; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 35; + projectile.tileCollide = false; + projectile.hostile = true; + } + + public override void AI() + { + if (projectile.timeLeft % 5f == 4f) + projectile.frame++; + } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + damage = Main.rand.Next(GloriousEnd.PlayerExplosionDmgMin, GloriousEnd.PlayerExplosionDmgMax + 1); + if (Main.expertMode) + damage /= 2; + if (projectile.ai[0] == 1f) + damage /= 2; + } + + public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + { + if (target.townNPC) + { + damage = Main.rand.Next(GloriousEnd.PlayerExplosionDmgMin, GloriousEnd.PlayerExplosionDmgMax + 1); + if (Main.expertMode) + damage /= 2; + if (projectile.ai[0] == 1f) + damage /= 2; + } + } + + public override void OnHitPlayer(Player target, int damage, bool crit) + { + target.GiveIFrames(target.longInvince ? 100 : 60, true); + } + } +} diff --git a/Projectiles/Magic/MeteorStarExplosion.png b/Projectiles/Magic/MeteorStarExplosion.png new file mode 100644 index 0000000000..7740b1ff36 Binary files /dev/null and b/Projectiles/Magic/MeteorStarExplosion.png differ diff --git a/Projectiles/Magic/TacticiansElectricBoom.cs b/Projectiles/Magic/TacticiansElectricBoom.cs new file mode 100644 index 0000000000..49beb260d3 --- /dev/null +++ b/Projectiles/Magic/TacticiansElectricBoom.cs @@ -0,0 +1,73 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Magic +{ + public class TacticiansElectricBoom : ModProjectile + { + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + private const float radius = 50f; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Electric Explosion"); + } + + public override void SetDefaults() + { + projectile.width = 100; + projectile.height = 100; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.timeLeft = 10; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = -1; + projectile.magic = true; + } + + public override void AI() + { + if (projectile.timeLeft >= 8) + { + for (int i = 0; i < 30; i++) + { + int dustType = Main.rand.NextBool() ? 132 : 264; + + Vector2 dustVelocity = new Vector2(Main.rand.NextFloat(-1, 1), Main.rand.NextFloat(-1, 1)); + dustVelocity.Normalize(); + dustVelocity *= 6; + + int dust = Dust.NewDust(projectile.Center, 1, 1, dustType, dustVelocity.X, dustVelocity.Y, 0, default, 0.75f); + Main.dust[dust].noGravity = true; + } + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) => target.AddBuff(BuffID.Electrified, 180); + + public override void OnHitPvp(Player target, int damage, bool crit) => target.AddBuff(BuffID.Electrified, 180); + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + float dist1 = Vector2.Distance(projectile.Center, targetHitbox.TopLeft()); + float dist2 = Vector2.Distance(projectile.Center, targetHitbox.TopRight()); + float dist3 = Vector2.Distance(projectile.Center, targetHitbox.BottomLeft()); + float dist4 = Vector2.Distance(projectile.Center, targetHitbox.BottomRight()); + + float minDist = dist1; + if (dist2 < minDist) + minDist = dist2; + if (dist3 < minDist) + minDist = dist3; + if (dist4 < minDist) + minDist = dist4; + + return minDist <= radius; + } + } +} diff --git a/Projectiles/Magic/TacticiansTrumpCardProj.cs b/Projectiles/Magic/TacticiansTrumpCardProj.cs new file mode 100644 index 0000000000..0664b8a1c0 --- /dev/null +++ b/Projectiles/Magic/TacticiansTrumpCardProj.cs @@ -0,0 +1,67 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Magic +{ + public class TacticiansTrumpCardProj : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Beam"); + } + + public override void SetDefaults() + { + projectile.width = 20; + projectile.height = 20; + projectile.aiStyle = 27; + projectile.friendly = true; + projectile.magic = true; + projectile.penetrate = 3; + projectile.timeLeft = 300; + aiType = ProjectileID.LightBeam; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.37f / 255f, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0.47f / 255f); + if (Main.rand.NextBool(5)) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 132, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); + } + projectile.rotation = projectile.velocity.ToRotation(); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + if (projectile.timeLeft > 295) + return false; + + Texture2D tex = Main.projectileTexture[projectile.type]; + spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + return false; + } + + public override void Kill(int timeLeft) + { + for (int k = 0; k < 5; k++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 132, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), projectile.damage / 2, 0f, projectile.owner); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), projectile.damage / 2, 0f, projectile.owner); + } + } +} diff --git a/Projectiles/Magic/TacticiansTrumpCardProj.png b/Projectiles/Magic/TacticiansTrumpCardProj.png new file mode 100644 index 0000000000..7b1d834f59 Binary files /dev/null and b/Projectiles/Magic/TacticiansTrumpCardProj.png differ diff --git a/Projectiles/Melee/LightningThing.cs b/Projectiles/Melee/LightningThing.cs index 1a7c2b29b9..5684463aef 100644 --- a/Projectiles/Melee/LightningThing.cs +++ b/Projectiles/Melee/LightningThing.cs @@ -32,9 +32,13 @@ namespace CalamityMod.Projectiles.Melee MathHelper.PiOver2, Main.rand.Next(100)); if (idx.WithinBounds(Main.maxProjectiles)) { - Main.projectile[idx].Calamity().forceMelee = true; Main.projectile[idx].usesLocalNPCImmunity = true; Main.projectile[idx].localNPCHitCooldown = GaelsGreatsword.ImmunityFrames; + // In death mode (and under a few other select conditions), the lightning has a PreAI return false in global projectile + // So forceMelee won't work unless the projectile is friendly (because a friendly exception was added) + Main.projectile[idx].friendly = true; + Main.projectile[idx].hostile = false; + Main.projectile[idx].Calamity().forceMelee = true; } } } diff --git a/Projectiles/Ranged/UniversalGenesisStar.cs b/Projectiles/Ranged/UniversalGenesisStar.cs new file mode 100644 index 0000000000..9f71f18506 --- /dev/null +++ b/Projectiles/Ranged/UniversalGenesisStar.cs @@ -0,0 +1,117 @@ +using CalamityMod.Buffs.DamageOverTime; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Ranged +{ + public class UniversalGenesisStar : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Star"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 6; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.width = 22; + projectile.height = 20; + projectile.friendly = true; + projectile.ranged = true; + projectile.alpha = 50; + projectile.tileCollide = false; + projectile.penetrate = 5; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + } + + public override void AI() + { + if (projectile.soundDelay == 0 && projectile.ai[0] == 0f) + { + projectile.soundDelay = 20 + Main.rand.Next(40); + if (Main.rand.NextBool(5)) + { + Main.PlaySound(SoundID.Item9, projectile.position); + } + } + projectile.alpha -= 15; + int alphaMin = 150; + if (projectile.Center.Y >= projectile.ai[1]) + { + alphaMin = 0; + } + if (projectile.alpha < alphaMin) + { + projectile.alpha = alphaMin; + } + projectile.rotation += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.01f * projectile.direction; + if (Main.rand.NextBool(48)) + { + int idx = Gore.NewGore(projectile.Center, projectile.velocity * 0.2f, 16, 1f); + Main.gore[idx].velocity *= 0.66f; + Main.gore[idx].velocity += projectile.velocity * 0.3f; + } + if (projectile.ai[1] == 1f) + { + projectile.light = 0.9f; + if (Main.rand.NextBool(10)) + { + Dust.NewDust(projectile.position, projectile.width, projectile.height, 173, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default, 1.2f); + } + if (Main.rand.NextBool(20)) + { + Gore.NewGore(projectile.position, new Vector2(projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f), Main.rand.Next(16, 18), 1f); + } + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 300); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 300); + } + + public override Color? GetAlpha(Color lightColor) + { + return new Color(200, 200, 200, projectile.alpha); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityUtils.DrawAfterimagesCentered(projectile, ProjectileID.Sets.TrailingMode[projectile.type], lightColor, 1); + return false; + } + + public override void Kill(int timeLeft) + { + projectile.position += projectile.Size; + projectile.width = 50; + projectile.height = 50; + projectile.position -= projectile.Size; + for (int i = 0; i < 5; i++) + { + int idx = Dust.NewDust(projectile.position, projectile.width, projectile.height, 16, 0f, 0f, 100, default, 1.2f); + Main.dust[idx].velocity *= 3f; + if (Main.rand.NextBool(2)) + { + Main.dust[idx].scale = 0.5f; + Main.dust[idx].fadeIn = 1f + Main.rand.Next(10) * 0.1f; + } + } + for (int i = 0; i < 3; i++) + { + Gore.NewGore(projectile.position, projectile.velocity * 0.05f, Main.rand.Next(16, 18), 1f); + } + } + } +} diff --git a/Projectiles/Ranged/UniversalGenesisStar.png b/Projectiles/Ranged/UniversalGenesisStar.png new file mode 100644 index 0000000000..9baa14e020 Binary files /dev/null and b/Projectiles/Ranged/UniversalGenesisStar.png differ diff --git a/Projectiles/Ranged/UniversalGenesisStarcaller.cs b/Projectiles/Ranged/UniversalGenesisStarcaller.cs new file mode 100644 index 0000000000..40465852ec --- /dev/null +++ b/Projectiles/Ranged/UniversalGenesisStarcaller.cs @@ -0,0 +1,134 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Ranged +{ + public class UniversalGenesisStarcaller : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Starcaller Shot"); + Main.projFrames[projectile.type] = 4; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 6; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.width = 18; + projectile.height = 18; + projectile.aiStyle = 1; + projectile.friendly = true; + projectile.ranged = true; + projectile.timeLeft = 600; + projectile.extraUpdates = 1; + aiType = ProjectileID.Bullet; + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, 0.23f, 0.19f, 0.25f); + + projectile.localAI[0] += 1f; + if (projectile.localAI[0] > 4f) + { + if (Main.rand.NextBool(2)) + { + int idx = Dust.NewDust(projectile.position, 1, 1, 173, 0f, 0f, 0, default, 0.5f); + Main.dust[idx].alpha = projectile.alpha; + Main.dust[idx].velocity *= 0f; + Main.dust[idx].noGravity = true; + } + } + + projectile.rotation = projectile.velocity.ToRotation(); + + projectile.frameCounter++; + if (projectile.frameCounter > 3) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame >= Main.projFrames[projectile.type]) + { + projectile.frame = 0; + } + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); + Main.PlaySound(SoundID.Item11.WithPitchVariance(0.05f), projectile.Center); + return true; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityUtils.DrawAfterimagesFromEdge(projectile, 0, lightColor); + return false; + } + + // This projectile is always fullbright. + public override Color? GetAlpha(Color lightColor) => new Color(1f, 1f, 1f, 0f); + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.Frostburn, 600); + SpawnStars(); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Frostburn, 600); + } + + private void SpawnStars() + { + // The patron said 10 blocks, but 10 blocks is like nothing... I'm sure they won't mind. + int maxDistance = 480; // 30 blocks + bool bossFound = false; + int life = 0; + Vector2 targetVec = projectile.Center; + for (int i = 0; i < Main.maxNPCs; i++) + { + NPC npc = Main.npc[i]; + if (bossFound && !npc.IsABoss()) + continue; + if (npc.CanBeChasedBy(projectile, false)) + { + float extraDist = (npc.width / 2) + (npc.height / 2); + //Calculate distance between target and the projectile to know if it's too far or not + float targetDist = Vector2.Distance(npc.Center, projectile.Center); + if (targetDist < (maxDistance + extraDist) && (npc.IsABoss() || npc.life > life)) + { + if (npc.IsABoss()) + bossFound = true; + life = npc.life; + targetVec = npc.Center; + } + } + } + for (int n = 0; n < 2; n++) + { + Projectile star = CalamityUtils.ProjectileRain(targetVec, 400f, 100f, 500f, 800f, 29f, ModContent.ProjectileType(), projectile.damage * 2, projectile.knockBack * 2f, projectile.owner); + star.ai[0] = n; + } + } + + public override void Kill(int timeLeft) + { + for (int k = 0; k < 5; k++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 173, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); + } + for (int g = 0; g < 3; g++) + { + Gore.NewGore(projectile.position, new Vector2(projectile.velocity.X * 0.05f, projectile.velocity.Y * 0.05f), Main.rand.Next(16, 18), 1f); + } + } + } +} diff --git a/Projectiles/Ranged/UniversalGenesisStarcaller.png b/Projectiles/Ranged/UniversalGenesisStarcaller.png new file mode 100644 index 0000000000..4702c21ed2 Binary files /dev/null and b/Projectiles/Ranged/UniversalGenesisStarcaller.png differ diff --git a/Projectiles/Rogue/NiceCock.cs b/Projectiles/Rogue/NiceCock.cs new file mode 100644 index 0000000000..5af688e8e4 --- /dev/null +++ b/Projectiles/Rogue/NiceCock.cs @@ -0,0 +1,146 @@ +using Microsoft.Xna.Framework; +using System; +using System.IO; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Rogue +{ + // The file name is a specific request from the patron + public class NiceCock : ModProjectile + { + public bool homing = false; + private bool initialized = false; + private Color[] colors = new Color[] + { + new Color(255, 0, 0, 50), //Red + new Color(255, 128, 0, 50), //Orange + new Color(255, 255, 0, 50), //Yellow + new Color(128, 255, 0, 50), //Lime + new Color(0, 255, 0, 50), //Green + new Color(0, 255, 128, 50), //Turquoise + new Color(0, 255, 255, 50), //Cyan + new Color(0, 128, 255, 50), //Light Blue + new Color(0, 0, 255, 50), //Blue + new Color(128, 0, 255, 50), //Purple + new Color(255, 0, 255, 50), //Fuschia + new Color(255, 0, 128, 50) //Hot Pink + }; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Flame"); + Main.projFrames[projectile.type] = 5; + } + + public override void SetDefaults() + { + projectile.width = 44; + projectile.height = 70; + projectile.friendly = true; + projectile.tileCollide = false; + projectile.Calamity().rogue = true; + projectile.timeLeft = 300; + projectile.alpha = 255; + } + + public override void SendExtraAI(BinaryWriter writer) => writer.Write(homing); + + public override void ReceiveExtraAI(BinaryReader reader) => homing = reader.ReadBoolean(); + + public override bool? CanHitNPC(NPC target) + { + // Do not deal damage before fully opaque + if (projectile.alpha >= 10) + return false; + int index = (int)projectile.ai[1]; + if (Main.npc[index] is null || !Main.npc[index].active || Main.npc[index].life < 0) + return false; + // Do not deal damage to any NPC that isn't the specified target + if (index != target.whoAmI) + return false; + return null; + } + + public override void AI() + { + projectile.alpha -= 5; + + if (!initialized) + { + // Pick a random frame to start on + projectile.frame = Main.rand.Next(Main.projFrames[projectile.type]); + initialized = true; + } + + projectile.frameCounter++; + if (projectile.frameCounter > 8) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame >= Main.projFrames[projectile.type]) + projectile.frame = 0; + + int index = (int)projectile.ai[1]; + + // If the target doesn't exist or is dead, spontaneously combust + if (Main.npc[index] is null || !Main.npc[index].active || Main.npc[index].life < 0) + projectile.Kill(); + + NPC target = Main.npc[index]; + + if (homing) + { + // Home in on the target + Vector2 moveDirection = projectile.SafeDirectionTo(target.Center, Vector2.UnitY); + projectile.velocity = (projectile.velocity * 20f + moveDirection * 15f) / 21f; + } + else + { + // Circle around the target counter-clockwise at 4 radians per frame + float height = target.getRect().Height; + float width = target.getRect().Width; + float circleDist = MathHelper.Min((height > width ? height : width) * 3f, (Main.LogicCheckScreenWidth * Main.LogicCheckScreenHeight) / 2); + if (circleDist > Main.LogicCheckScreenWidth / 3) + circleDist = Main.LogicCheckScreenWidth / 3; + projectile.Center = target.Center + projectile.ai[0].ToRotationVector2() * circleDist; + projectile.ai[0] -= MathHelper.ToRadians(4f); + } + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(SoundID.Item74, projectile.Center); + // Explode for double damage + CalamityGlobalProjectile.ExpandHitboxBy(projectile, 50); + projectile.maxPenetrate = projectile.penetrate = -1; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + projectile.damage *= 2; + projectile.Damage(); + + // Create into some rainbow-colored dust when dead + for (int d = 0; d < 5; d++) + { + int idx = Dust.NewDust(projectile.position, projectile.width, projectile.height, 267, 0f, 0f, 150, Main.rand.Next(colors), 2f); + Main.dust[idx].velocity *= 3f; + Main.dust[idx].noGravity = true; + if (Main.rand.NextBool(2)) + { + Main.dust[idx].scale = 0.5f; + Main.dust[idx].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } + } + for (int d = 0; d < 8; d++) + { + int idx = Dust.NewDust(projectile.position, projectile.width, projectile.height, 267, 0f, 0f, 150, Main.rand.Next(colors), 3f); + Main.dust[idx].noGravity = true; + Main.dust[idx].velocity *= 5f; + idx = Dust.NewDust(projectile.position, projectile.width, projectile.height, 267, 0f, 0f, 150, Main.rand.Next(colors), 2f); + Main.dust[idx].velocity *= 2f; + Main.dust[idx].noGravity = true; + } + } + } +} diff --git a/Projectiles/Rogue/NiceCock.png b/Projectiles/Rogue/NiceCock.png new file mode 100644 index 0000000000..8881462c5c Binary files /dev/null and b/Projectiles/Rogue/NiceCock.png differ diff --git a/Projectiles/Rogue/PanSpark.cs b/Projectiles/Rogue/PanSpark.cs new file mode 100644 index 0000000000..ef5d3f5ff0 --- /dev/null +++ b/Projectiles/Rogue/PanSpark.cs @@ -0,0 +1,149 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class PanSpark : ModProjectile + { + private bool initialized = false; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Spark"); + Main.projFrames[projectile.type] = 3; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 2; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.width = 14; + projectile.height = 14; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.timeLeft = 120; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = -1; + projectile.Calamity().rogue = true; + projectile.ignoreWater = true; + } + + public override void AI() + { + //make it face the way it's going + if (projectile.ai[1] > 0f) + { + projectile.rotation = -projectile.velocity.X * 0.05f + MathHelper.PiOver2; + } + else + { + projectile.rotation = projectile.velocity.ToRotation(); + } + projectile.ai[1]--; + + //frames + if (!initialized) + { + initialized = true; + projectile.frame = Main.rand.Next(Main.projFrames[projectile.type]); + } + projectile.frameCounter++; + if (projectile.frameCounter > 6) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame >= Main.projFrames[projectile.type]) + { + projectile.frame = 0; + } + + //movement + if (projectile.velocity.X != projectile.velocity.X) + { + projectile.velocity.X *= -0.1f; + } + if (projectile.velocity.X != projectile.velocity.X) + { + projectile.velocity.X *= -0.5f; + } + if (projectile.velocity.Y != projectile.velocity.Y && projectile.velocity.Y > 1f) + { + projectile.velocity.Y *= -0.5f; + } + projectile.ai[0] += 1f; + if (projectile.ai[0] > 5f) + { + projectile.ai[0] = 5f; + if (projectile.velocity.Y == 0f && projectile.velocity.X != 0f) + { + projectile.velocity.X *= 0.97f; + if (projectile.velocity.X > -0.01f && projectile.velocity.X < 0.01f) + { + projectile.velocity.X = 0f; + projectile.netUpdate = true; + } + } + projectile.velocity.Y += 0.2f; + } + if (projectile.velocity.Y < 0.25f && projectile.velocity.Y > 0.15f) + { + projectile.velocity.X *= 0.8f; + } + if (projectile.velocity.Y > 16f) + { + projectile.velocity.Y = 16f; + } + + //dust + if (Main.rand.NextBool(4)) + { + int fire = Dust.NewDust(projectile.position, projectile.width, projectile.height, DustID.Fire, 0f, 0f, 100, default, 1f); + Dust dust = Main.dust[fire]; + dust.position.X -= 2f; + dust.position.Y += 2f; + dust.scale += (float)Main.rand.Next(50) * 0.01f; + dust.noGravity = true; + dust.velocity.Y -= 2f; + } + if (Main.rand.NextBool(10)) + { + int fire = Dust.NewDust(projectile.position, projectile.width, projectile.height, DustID.Fire, 0f, 0f, 100, default, 1f); + Dust dust = Main.dust[fire]; + dust.position.X -= 2f; + dust.position.Y += 2f; + dust.scale += 0.3f + (float)Main.rand.Next(50) * 0.01f; + dust.noGravity = true; + dust.velocity *= 0.1f; + } + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + projectile.ai[1] = 10f; + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.OnFire, 120); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.OnFire, 120); + } + + public override Color? GetAlpha(Color lightColor) => new Color(255, 230, 130); + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityUtils.DrawAfterimagesCentered(projectile, ProjectileID.Sets.TrailingMode[projectile.type], lightColor, 1); + return false; + } + } +} diff --git a/Projectiles/Rogue/PanSpark.png b/Projectiles/Rogue/PanSpark.png new file mode 100644 index 0000000000..c74b2ed1a7 Binary files /dev/null and b/Projectiles/Rogue/PanSpark.png differ diff --git a/Projectiles/Rogue/SearedPanProjectile.cs b/Projectiles/Rogue/SearedPanProjectile.cs new file mode 100644 index 0000000000..5ef76ad7d8 --- /dev/null +++ b/Projectiles/Rogue/SearedPanProjectile.cs @@ -0,0 +1,170 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.CalPlayer; +using CalamityMod.NPCs.NormalNPCs; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Rogue +{ + public class SearedPanProjectile : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Pan"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 6; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 20; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.timeLeft = 420; + projectile.Calamity().rogue = true; + projectile.extraUpdates = 2; + } + + public override void AI() + { + if (Main.rand.NextBool(5)) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 5, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); + } + projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt(); + projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == 1 ? 0f : MathHelper.Pi); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 300); + // Don't increment the Seared Pan counter when hitting dummies + bool dummy = target.type != NPCID.TargetDummy && target.type != ModContent.NPCType(); + OnHitEffects(target.whoAmI, target.life, dummy); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + Player player = Main.player[projectile.owner]; + target.AddBuff(BuffID.Bleeding, 300); + target.AddBuff(ModContent.BuffType(), 300); + OnHitEffects(-1, target.statLife, true); + } + + private void OnHitEffects(int targetIndex, int health, bool specialEffects) + { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); + + // Increment the seared pan counter and refill stealth after three consecutive hits + // See CalamityPlayerMiscEffects.cs for code that resets the counter after 40 frames + modPlayer.searedPanTimer = 0; + if (!projectile.Calamity().stealthStrike && specialEffects) + modPlayer.searedPanCounter++; + if (modPlayer.searedPanCounter >= 3 && !projectile.Calamity().stealthStrike && specialEffects) + { + modPlayer.searedPanCounter = 0; + modPlayer.rogueStealth = modPlayer.rogueStealthMax; + } + + // Stealth strikes spawn six golden sparks on hit + if (projectile.Calamity().stealthStrike) + { + modPlayer.searedPanCounter = 0; + for (int t = 0; t < 6; t++) + { + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.3), 0f, projectile.owner); + } + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/SearedPanSmash"), (int)projectile.position.X, (int)projectile.position.Y); + // Stealth strikes also cause any fireballs to home in on their targets + FireballStuff(true); + } + else if (targetIndex != -1 && health > 0) + { + // Summon three fireballs to circle the hit enemy + int projType = ModContent.ProjectileType(); + for (int t = 0; t < 3; t++) + { + Projectile.NewProjectile(projectile.Center, Vector2.Zero, projType, (int)(projectile.damage * 0.3), 0f, projectile.owner, 0f, targetIndex); + } + int fireballCount = 0; + // Count how many fireballs exist already around the given target + for (int i = 0; i < Main.maxProjectiles; i++) + { + // Keep the loop as short as possible + if (!Main.projectile[i].active || Main.projectile[i].owner != projectile.owner || !Main.projectile[i].Calamity().rogue || targetIndex != (int)Main.projectile[i].ai[1]) + continue; + if (Main.projectile[i].type == projType) + { + if ((Main.projectile[i].modProjectile as NiceCock).homing) + continue; + fireballCount++; + } + } + // Adjust the angle of the existing fireballs around a target + float angleVariance = MathHelper.TwoPi / fireballCount; + float angle = 0f; + for (int i = 0; i < Main.maxProjectiles; i++) + { + if (!Main.projectile[i].active || Main.projectile[i].owner != projectile.owner || !Main.projectile[i].Calamity().rogue || targetIndex != (int)Main.projectile[i].ai[1]) + continue; + if (Main.projectile[i].type == projType) + { + if ((Main.projectile[i].modProjectile as NiceCock).homing) + continue; + Main.projectile[i].ai[0] = angle; + Main.projectile[i].netUpdate = true; + angle += angleVariance; + } + } + } + } + + private void FireballStuff(bool activate) + { + if (projectile.owner == Main.myPlayer) + { + for (int i = 0; i < Main.maxProjectiles; i++) + { + if (!Main.projectile[i].active || Main.projectile[i].owner != projectile.owner) + continue; + if (Main.projectile[i].type == ModContent.ProjectileType()) + { + if (!activate) + Main.projectile[i].Kill(); + else + { + (Main.projectile[i].modProjectile as NiceCock).homing = true; + Main.projectile[i].extraUpdates += 2; + } + } + } + } + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + // Kill all fireballs if you miss a stealth strike + if (projectile.Calamity().stealthStrike) + FireballStuff(false); + return true; + } + + public override Color? GetAlpha(Color lightColor) + { + // Stealth strikes are golden colored + if (projectile.Calamity().stealthStrike) + return new Color(255, 222, 0); + return null; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityUtils.DrawAfterimagesCentered(projectile, ProjectileID.Sets.TrailingMode[projectile.type], lightColor, 1); + return false; + } + } +} diff --git a/Projectiles/Rogue/SearedPanProjectile.png b/Projectiles/Rogue/SearedPanProjectile.png new file mode 100644 index 0000000000..559b586cb8 Binary files /dev/null and b/Projectiles/Rogue/SearedPanProjectile.png differ diff --git a/Projectiles/Rogue/TotalMeltdown.cs b/Projectiles/Rogue/TotalMeltdown.cs index 8ddf1cc711..d1dca2b04a 100644 --- a/Projectiles/Rogue/TotalMeltdown.cs +++ b/Projectiles/Rogue/TotalMeltdown.cs @@ -8,7 +8,6 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { DisplayName.SetDefault("Explosion"); - ProjectileID.Sets.MinionShot[projectile.type] = true; Main.projFrames[projectile.type] = 13; } diff --git a/Projectiles/Summon/ColdDivinityPointyThing.cs b/Projectiles/Summon/ColdDivinityPointyThing.cs index 74ecd0efd6..a5754a4c60 100644 --- a/Projectiles/Summon/ColdDivinityPointyThing.cs +++ b/Projectiles/Summon/ColdDivinityPointyThing.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Summon writer.Write(circling); writer.Write(circlingPlayer); writer.Write((double)floatyDistance); - writer.Write(target == null ? -1 : target.whoAmI); + writer.Write(target is null ? -1 : target.whoAmI); } public override void ReceiveExtraAI(BinaryReader reader) { @@ -114,18 +114,21 @@ namespace CalamityMod.Projectiles.Summon else if (projectile.ai[1] >= 2f && projectile.timeLeft > 900) { target = CalamityUtils.MinionHoming(projectile.Center, 1000f, Main.player[projectile.owner]); - projectile.timeLeft = 669; - projectile.ai[1]++; - circlingPlayer = false; - float height = target.getRect().Height; - float width = target.getRect().Width; - floatyDistance = MathHelper.Min((height > width ? height : width) * 3f, (Main.LogicCheckScreenWidth * Main.LogicCheckScreenHeight) / 2); - if (floatyDistance > Main.LogicCheckScreenWidth / 3) - floatyDistance = Main.LogicCheckScreenWidth / 3; - projectile.penetrate = -1; - projectile.usesIDStaticNPCImmunity = true; - projectile.idStaticNPCHitCooldown = 4; - projectile.netUpdate = true; + if (target != null) + { + projectile.timeLeft = 669; + projectile.ai[1]++; + circlingPlayer = false; + float height = target.getRect().Height; + float width = target.getRect().Width; + floatyDistance = MathHelper.Min((height > width ? height : width) * 3f, (Main.LogicCheckScreenWidth * Main.LogicCheckScreenHeight) / 2); + if (floatyDistance > Main.LogicCheckScreenWidth / 3) + floatyDistance = Main.LogicCheckScreenWidth / 3; + projectile.penetrate = -1; + projectile.usesIDStaticNPCImmunity = true; + projectile.idStaticNPCHitCooldown = 4; + projectile.netUpdate = true; + } } if (circlingPlayer) { diff --git a/Projectiles/Typeless/YanmeisKnifeSlash.cs b/Projectiles/Typeless/YanmeisKnifeSlash.cs index 8aca33f7b1..37562a31de 100644 --- a/Projectiles/Typeless/YanmeisKnifeSlash.cs +++ b/Projectiles/Typeless/YanmeisKnifeSlash.cs @@ -126,7 +126,11 @@ namespace CalamityMod.Projectiles.Typeless dust.noGravity = true; } } - Main.PlaySound(SoundID.Zombie, Main.player[projectile.owner].Center, 104); + if (projectile.ai[0] == 0f) + { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/YanmeiKnifeHit"), (int)projectile.position.X, (int)projectile.position.Y); + projectile.ai[0] = 1f; + } Main.player[projectile.owner].AddBuff(ModContent.BuffType(), 600); } public override Color? GetAlpha(Color lightColor) => new Color(0, 215, 0, 0); diff --git a/Sounds/Custom/ProvidenceDeathAnimation.cs b/Sounds/Custom/ProvidenceDeathAnimation.cs new file mode 100644 index 0000000000..2ec634a95f --- /dev/null +++ b/Sounds/Custom/ProvidenceDeathAnimation.cs @@ -0,0 +1,18 @@ +using Microsoft.Xna.Framework.Audio; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Sounds.Custom +{ + public class ProvidenceDeathAnimation : ModSound + { + public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) + { + soundInstance = sound.CreateInstance(); + soundInstance.Volume = volume; + soundInstance.Pan = pan; + Main.PlaySoundInstance(soundInstance); + return soundInstance; + } + } +} diff --git a/Sounds/Custom/ProvidenceDeathAnimation.ogg b/Sounds/Custom/ProvidenceDeathAnimation.ogg new file mode 100644 index 0000000000..25a6466c5f Binary files /dev/null and b/Sounds/Custom/ProvidenceDeathAnimation.ogg differ diff --git a/Sounds/Custom/YanmeiKnifeExpire.cs b/Sounds/Custom/YanmeiKnifeExpire.cs new file mode 100644 index 0000000000..6e3a51a6c6 --- /dev/null +++ b/Sounds/Custom/YanmeiKnifeExpire.cs @@ -0,0 +1,18 @@ +using Microsoft.Xna.Framework.Audio; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Sounds.Custom +{ + public class YanmeiKnifeExpire : ModSound + { + public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) + { + soundInstance = sound.CreateInstance(); + soundInstance.Volume = volume; + soundInstance.Pan = pan; + Main.PlaySoundInstance(soundInstance); + return soundInstance; + } + } +} diff --git a/Sounds/Custom/YanmeiKnifeExpire.ogg b/Sounds/Custom/YanmeiKnifeExpire.ogg new file mode 100644 index 0000000000..43f93869d1 Binary files /dev/null and b/Sounds/Custom/YanmeiKnifeExpire.ogg differ diff --git a/Sounds/Item/SearedPanSmash.cs b/Sounds/Item/SearedPanSmash.cs new file mode 100644 index 0000000000..f888fa825c --- /dev/null +++ b/Sounds/Item/SearedPanSmash.cs @@ -0,0 +1,18 @@ +using Microsoft.Xna.Framework.Audio; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Sounds.Item +{ + public class SearedPanSmash : ModSound + { + public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) + { + soundInstance = sound.CreateInstance(); + soundInstance.Volume = volume; + soundInstance.Pan = pan; + Main.PlaySoundInstance(soundInstance); + return soundInstance; + } + } +} diff --git a/Sounds/Item/SearedPanSmash.ogg b/Sounds/Item/SearedPanSmash.ogg new file mode 100644 index 0000000000..c39b602f29 Binary files /dev/null and b/Sounds/Item/SearedPanSmash.ogg differ diff --git a/Sounds/Item/YanmeiKnifeHit.cs b/Sounds/Item/YanmeiKnifeHit.cs new file mode 100644 index 0000000000..4a61dc7f72 --- /dev/null +++ b/Sounds/Item/YanmeiKnifeHit.cs @@ -0,0 +1,18 @@ +using Microsoft.Xna.Framework.Audio; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Sounds.Item +{ + public class YanmeiKnifeHit : ModSound + { + public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) + { + soundInstance = sound.CreateInstance(); + soundInstance.Volume = volume; + soundInstance.Pan = pan; + Main.PlaySoundInstance(soundInstance); + return soundInstance; + } + } +} diff --git a/Sounds/Item/YanmeiKnifeHit.ogg b/Sounds/Item/YanmeiKnifeHit.ogg new file mode 100644 index 0000000000..37abc0dcf8 Binary files /dev/null and b/Sounds/Item/YanmeiKnifeHit.ogg differ diff --git a/Tiles/Abyss/AcidWoodTree.cs b/Tiles/Abyss/AcidWoodTree.cs index cbbd85d45e..619ef91a07 100644 --- a/Tiles/Abyss/AcidWoodTree.cs +++ b/Tiles/Abyss/AcidWoodTree.cs @@ -1,5 +1,5 @@ using CalamityMod.Dusts; -using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables; using Microsoft.Xna.Framework.Graphics; using Terraria.ModLoader; namespace CalamityMod.Tiles.Abyss diff --git a/Tiles/Abyss/AcidwoodTile.cs b/Tiles/Abyss/AcidwoodTile.cs new file mode 100644 index 0000000000..a82d90d8c7 --- /dev/null +++ b/Tiles/Abyss/AcidwoodTile.cs @@ -0,0 +1,40 @@ +using CalamityMod.Items.Placeables; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.Abyss +{ + public class AcidwoodTile : ModTile + { + public override void SetDefaults() + { + Main.tileSolid[Type] = true; + Main.tileMergeDirt[Type] = false; + Main.tileBlockLight[Type] = true; + + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeDecorativeTiles(Type); + + drop = ModContent.ItemType(); + soundType = SoundID.Dig; + AddMapEntry(new Color(218, 169, 97)); + animationFrameHeight = 270; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 7, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void AnimateIndividualTile(int type, int i, int j, ref int frameXOffset, ref int frameYOffset) + { + int xPos = i % 6; + int yPos = j % 3; + frameXOffset = xPos * 288; + frameYOffset = yPos * animationFrameHeight; + } + } +} diff --git a/Tiles/Abyss/AcidwoodTile.png b/Tiles/Abyss/AcidwoodTile.png new file mode 100644 index 0000000000..c4c92df604 Binary files /dev/null and b/Tiles/Abyss/AcidwoodTile.png differ diff --git a/Tiles/Abyss/HardenedSulphurousSandstone.cs b/Tiles/Abyss/HardenedSulphurousSandstone.cs index 5009eeb8b5..1be7d6246a 100644 --- a/Tiles/Abyss/HardenedSulphurousSandstone.cs +++ b/Tiles/Abyss/HardenedSulphurousSandstone.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Tiles.Abyss bool flag13 = false; for (int num52 = num8; num52 > num8 - 10; num52--) { - if (Main.tile[i, num52].bottomSlope()) + if (CalamityUtils.ParanoidTileRetrieval(i, num52).bottomSlope()) { flag13 = false; break; diff --git a/Tiles/FurnitureAcidwood/AcidwoodBathTile.cs b/Tiles/FurnitureAcidwood/AcidwoodBathTile.cs new file mode 100644 index 0000000000..3ce993499d --- /dev/null +++ b/Tiles/FurnitureAcidwood/AcidwoodBathTile.cs @@ -0,0 +1,34 @@ +using CalamityMod.Items.Placeables.FurnitureAcidwood; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; +namespace CalamityMod.Tiles.FurnitureAcidwood +{ + public class AcidwoodBathTile : ModTile + { + public override void SetDefaults() + { + this.SetUpBathtub(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Acidwood Bathtub"); + AddMapEntry(new Color(191, 142, 111), name); + animationFrameHeight = 54; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 7, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + } +} diff --git a/Tiles/FurnitureAcidwood/AcidwoodBathTile.png b/Tiles/FurnitureAcidwood/AcidwoodBathTile.png new file mode 100644 index 0000000000..4b39b969eb Binary files /dev/null and b/Tiles/FurnitureAcidwood/AcidwoodBathTile.png differ diff --git a/Tiles/FurnitureAcidwood/AcidwoodBedTile.cs b/Tiles/FurnitureAcidwood/AcidwoodBedTile.cs new file mode 100644 index 0000000000..37acea5009 --- /dev/null +++ b/Tiles/FurnitureAcidwood/AcidwoodBedTile.cs @@ -0,0 +1,50 @@ +using CalamityMod.Items.Placeables.FurnitureAcidwood; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureAcidwood +{ + public class AcidwoodBedTile : ModTile + { + public override void SetDefaults() + { + this.SetUpBed(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Acidwood Bed"); + AddMapEntry(new Color(191, 142, 111), name); + disableSmartCursor = true; + adjTiles = new int[] { TileID.Beds }; + bed = true; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 7, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override bool HasSmartInteract() => true; + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 64, 32, ModContent.ItemType()); + } + + public override bool NewRightClick(int i, int j) => CalamityUtils.BedRightClick(i, j); + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.showItemIcon = true; + player.showItemIcon2 = ModContent.ItemType(); + } + } +} diff --git a/Tiles/FurnitureAcidwood/AcidwoodBedTile.png b/Tiles/FurnitureAcidwood/AcidwoodBedTile.png new file mode 100644 index 0000000000..0c8419f4e1 Binary files /dev/null and b/Tiles/FurnitureAcidwood/AcidwoodBedTile.png differ diff --git a/Tiles/FurnitureAcidwood/AcidwoodBedTile_Highlight.png b/Tiles/FurnitureAcidwood/AcidwoodBedTile_Highlight.png new file mode 100644 index 0000000000..e02a65f429 Binary files /dev/null and b/Tiles/FurnitureAcidwood/AcidwoodBedTile_Highlight.png differ diff --git a/Tiles/FurnitureAcidwood/AcidwoodBenchTile.cs b/Tiles/FurnitureAcidwood/AcidwoodBenchTile.cs new file mode 100644 index 0000000000..b29bab7da2 --- /dev/null +++ b/Tiles/FurnitureAcidwood/AcidwoodBenchTile.cs @@ -0,0 +1,33 @@ +using CalamityMod.Items.Placeables.FurnitureAcidwood; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; +namespace CalamityMod.Tiles.FurnitureAcidwood +{ + public class AcidwoodBenchTile : ModTile + { + public override void SetDefaults() + { + this.SetUpSofa(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Acidwood Bench"); + AddMapEntry(new Color(191, 142, 111), name); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 7, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + } +} diff --git a/Tiles/FurnitureAcidwood/AcidwoodBenchTile.png b/Tiles/FurnitureAcidwood/AcidwoodBenchTile.png new file mode 100644 index 0000000000..edefd14e33 Binary files /dev/null and b/Tiles/FurnitureAcidwood/AcidwoodBenchTile.png differ diff --git a/Tiles/FurnitureAcidwood/AcidwoodBookcaseTile.cs b/Tiles/FurnitureAcidwood/AcidwoodBookcaseTile.cs new file mode 100644 index 0000000000..a0ce59b56f --- /dev/null +++ b/Tiles/FurnitureAcidwood/AcidwoodBookcaseTile.cs @@ -0,0 +1,37 @@ +using CalamityMod.Items.Placeables.FurnitureAcidwood; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureAcidwood +{ + public class AcidwoodBookcaseTile : ModTile + { + public override void SetDefaults() + { + this.SetUpBookcase(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Acidwood Bookcase"); + AddMapEntry(new Color(191, 142, 111), name); + animationFrameHeight = 54; + adjTiles = new int[] { TileID.Bookcases }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 7, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + } +} diff --git a/Tiles/FurnitureAcidwood/AcidwoodBookcaseTile.png b/Tiles/FurnitureAcidwood/AcidwoodBookcaseTile.png new file mode 100644 index 0000000000..e1efe018ee Binary files /dev/null and b/Tiles/FurnitureAcidwood/AcidwoodBookcaseTile.png differ diff --git a/Tiles/FurnitureAcidwood/AcidwoodCandelabraTile.cs b/Tiles/FurnitureAcidwood/AcidwoodCandelabraTile.cs new file mode 100644 index 0000000000..aa9dbe32b4 --- /dev/null +++ b/Tiles/FurnitureAcidwood/AcidwoodCandelabraTile.cs @@ -0,0 +1,64 @@ +using CalamityMod.Items.Placeables.FurnitureAcidwood; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureAcidwood +{ + public class AcidwoodCandelabraTile : ModTile + { + public override void SetDefaults() + { + this.SetUpCandelabra(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Acidwood Candelabra"); + AddMapEntry(new Color(191, 142, 111), name); + disableSmartCursor = true; + adjTiles = new int[] { TileID.Torches }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 7, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].frameX < 18) + { + r = 0.8f; + g = 0.9f; + b = 1f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 16, ModContent.ItemType()); + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 2, 2); + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + CalamityUtils.DrawFlameEffect(ModContent.GetTexture("CalamityMod/Tiles/FurnitureAcidwood/AcidwoodCandelabraTileFlame"), i, j); + } + } +} diff --git a/Tiles/FurnitureAcidwood/AcidwoodCandelabraTile.png b/Tiles/FurnitureAcidwood/AcidwoodCandelabraTile.png new file mode 100644 index 0000000000..7c04a759bc Binary files /dev/null and b/Tiles/FurnitureAcidwood/AcidwoodCandelabraTile.png differ diff --git a/Tiles/FurnitureAcidwood/AcidwoodCandelabraTileFlame.png b/Tiles/FurnitureAcidwood/AcidwoodCandelabraTileFlame.png new file mode 100644 index 0000000000..216ca78866 Binary files /dev/null and b/Tiles/FurnitureAcidwood/AcidwoodCandelabraTileFlame.png differ diff --git a/Tiles/FurnitureAcidwood/AcidwoodCandleTile.cs b/Tiles/FurnitureAcidwood/AcidwoodCandleTile.cs new file mode 100644 index 0000000000..ea5bb5de36 --- /dev/null +++ b/Tiles/FurnitureAcidwood/AcidwoodCandleTile.cs @@ -0,0 +1,74 @@ +using CalamityMod.Items.Placeables.FurnitureAcidwood; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureAcidwood +{ + public class AcidwoodCandleTile : ModTile + { + public override void SetDefaults() + { + this.SetUpCandle(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Acidwood Candle"); + AddMapEntry(new Color(191, 142, 111), name); + disableSmartCursor = true; + adjTiles = new int[] { TileID.Torches }; + drop = ModContent.ItemType(); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 7, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].frameX < 18) + { + r = 0.8f; + g = 0.9f; + b = 1f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 1, 1); + } + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.showItemIcon = true; + player.showItemIcon2 = ModContent.ItemType(); + } + + public override bool NewRightClick(int i, int j) + { + CalamityUtils.RightClickBreak(i, j); + return true; + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + CalamityUtils.DrawFlameEffect(ModContent.GetTexture("CalamityMod/Tiles/FurnitureAcidwood/AcidwoodCandleTileFlame"), i, j); + } + } +} diff --git a/Tiles/FurnitureAcidwood/AcidwoodCandleTile.png b/Tiles/FurnitureAcidwood/AcidwoodCandleTile.png new file mode 100644 index 0000000000..e686b0dd6a Binary files /dev/null and b/Tiles/FurnitureAcidwood/AcidwoodCandleTile.png differ diff --git a/Tiles/FurnitureAcidwood/AcidwoodCandleTileFlame.png b/Tiles/FurnitureAcidwood/AcidwoodCandleTileFlame.png new file mode 100644 index 0000000000..232bcae79a Binary files /dev/null and b/Tiles/FurnitureAcidwood/AcidwoodCandleTileFlame.png differ diff --git a/Tiles/FurnitureAcidwood/AcidwoodChairTile.cs b/Tiles/FurnitureAcidwood/AcidwoodChairTile.cs new file mode 100644 index 0000000000..fdcc56ebbe --- /dev/null +++ b/Tiles/FurnitureAcidwood/AcidwoodChairTile.cs @@ -0,0 +1,60 @@ +using CalamityMod.Items.Placeables.FurnitureAcidwood; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.Enums; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.FurnitureAcidwood +{ + public class AcidwoodChairTile : ModTile + { + public override void SetDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileLavaDeath[Type] = true; + Main.tileWaterDeath[Type] = false; + TileObjectData.newTile.Width = 2; + TileObjectData.newTile.Height = 2; + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 18 }; + TileObjectData.newTile.CoordinateWidth = 16; + TileObjectData.newTile.CoordinatePadding = 2; + TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.Origin = new Point16(1, 1); + TileObjectData.newTile.UsesCustomCanPlace = true; + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop, 2, 0); + TileObjectData.newTile.LavaDeath = true; + TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); + TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; + TileObjectData.addAlternate(1); + TileObjectData.addTile(Type); + + AddToArray(ref TileID.Sets.RoomNeeds.CountsAsChair); + + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Acidwood Chair"); + AddMapEntry(new Color(191, 142, 111), name); + disableSmartCursor = true; + adjTiles = new int[] { TileID.Chairs }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 7, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + } +} diff --git a/Tiles/FurnitureAcidwood/AcidwoodChairTile.png b/Tiles/FurnitureAcidwood/AcidwoodChairTile.png new file mode 100644 index 0000000000..4893c219c9 Binary files /dev/null and b/Tiles/FurnitureAcidwood/AcidwoodChairTile.png differ diff --git a/Tiles/FurnitureAcidwood/AcidwoodChandelierTile.cs b/Tiles/FurnitureAcidwood/AcidwoodChandelierTile.cs new file mode 100644 index 0000000000..91d96ab0e1 --- /dev/null +++ b/Tiles/FurnitureAcidwood/AcidwoodChandelierTile.cs @@ -0,0 +1,63 @@ +using CalamityMod.Items.Placeables.FurnitureAcidwood; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureAcidwood +{ + public class AcidwoodChandelierTile : ModTile + { + public override void SetDefaults() + { + this.SetUpChandelier(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Acidwood Chandelier"); + AddMapEntry(new Color(191, 142, 111), name); + adjTiles = new int[] { TileID.Torches }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 7, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].frameX < 18) + { + r = 0.8f; + g = 0.9f; + b = 1f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 48, 48, ModContent.ItemType()); + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 3, 3); + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + CalamityUtils.DrawFlameEffect(ModContent.GetTexture("CalamityMod/Tiles/FurnitureAcidwood/AcidwoodChandelierTileFlame"), i, j); + } + } +} diff --git a/Tiles/FurnitureAcidwood/AcidwoodChandelierTile.png b/Tiles/FurnitureAcidwood/AcidwoodChandelierTile.png new file mode 100644 index 0000000000..edda9f9341 Binary files /dev/null and b/Tiles/FurnitureAcidwood/AcidwoodChandelierTile.png differ diff --git a/Tiles/FurnitureAcidwood/AcidwoodChandelierTileFlame.png b/Tiles/FurnitureAcidwood/AcidwoodChandelierTileFlame.png new file mode 100644 index 0000000000..2a1db6cdce Binary files /dev/null and b/Tiles/FurnitureAcidwood/AcidwoodChandelierTileFlame.png differ diff --git a/Tiles/FurnitureAcidwood/AcidwoodChestTile.cs b/Tiles/FurnitureAcidwood/AcidwoodChestTile.cs new file mode 100644 index 0000000000..8e86ccdcd5 --- /dev/null +++ b/Tiles/FurnitureAcidwood/AcidwoodChestTile.cs @@ -0,0 +1,50 @@ +using CalamityMod.Items.Placeables.FurnitureAcidwood; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureAcidwood +{ + public class AcidwoodChestTile : ModTile + { + public override void SetDefaults() + { + this.SetUpChest(true); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Acidwood Chest"); + AddMapEntry(new Color(191, 142, 111), name, MapChestName); + disableSmartCursor = true; + adjTiles = new int[] { TileID.Containers }; + chest = "Acidwood Chest"; + chestDrop = ModContent.ItemType(); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 7, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override bool HasSmartInteract() => true; + + public string MapChestName(string name, int i, int j) => CalamityUtils.GetMapChestName(name, i, j); + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 32, 32, chestDrop); + Chest.DestroyChest(i, j); + } + + public override bool NewRightClick(int i, int j) => CalamityUtils.ChestRightClick(i, j); + + public override void MouseOver(int i, int j) => CalamityUtils.ChestMouseOver("Acidwood Chest", i, j); + + public override void MouseOverFar(int i, int j) => CalamityUtils.ChestMouseFar("Acidwood Chest", i, j); + } +} diff --git a/Tiles/FurnitureAcidwood/AcidwoodChestTile.png b/Tiles/FurnitureAcidwood/AcidwoodChestTile.png new file mode 100644 index 0000000000..e1e120b302 Binary files /dev/null and b/Tiles/FurnitureAcidwood/AcidwoodChestTile.png differ diff --git a/Tiles/FurnitureAcidwood/AcidwoodChestTile_Highlight.png b/Tiles/FurnitureAcidwood/AcidwoodChestTile_Highlight.png new file mode 100644 index 0000000000..03675cf7aa Binary files /dev/null and b/Tiles/FurnitureAcidwood/AcidwoodChestTile_Highlight.png differ diff --git a/Tiles/FurnitureAcidwood/AcidwoodClockTile.cs b/Tiles/FurnitureAcidwood/AcidwoodClockTile.cs new file mode 100644 index 0000000000..35e8daf978 --- /dev/null +++ b/Tiles/FurnitureAcidwood/AcidwoodClockTile.cs @@ -0,0 +1,48 @@ +using CalamityMod.Items.Placeables.FurnitureAcidwood; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureAcidwood +{ + public class AcidwoodClockTile : ModTile + { + public override void SetDefaults() + { + this.SetUpClock(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Acidwood Clock"); + AddMapEntry(new Color(191, 142, 111), name); + adjTiles = new int[] { TileID.GrandfatherClocks }; + } + + public override bool HasSmartInteract() => true; + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 7, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override bool NewRightClick(int x, int y) => CalamityUtils.ClockRightClick(); + + public override void NearbyEffects(int i, int j, bool closer) + { + if (closer) + { + Main.clock = true; + } + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 48, 32, ModContent.ItemType()); + } + } +} diff --git a/Tiles/FurnitureAcidwood/AcidwoodClockTile.png b/Tiles/FurnitureAcidwood/AcidwoodClockTile.png new file mode 100644 index 0000000000..8f444e840b Binary files /dev/null and b/Tiles/FurnitureAcidwood/AcidwoodClockTile.png differ diff --git a/Tiles/FurnitureAcidwood/AcidwoodClockTile_Highlight.png b/Tiles/FurnitureAcidwood/AcidwoodClockTile_Highlight.png new file mode 100644 index 0000000000..32be046f66 Binary files /dev/null and b/Tiles/FurnitureAcidwood/AcidwoodClockTile_Highlight.png differ diff --git a/Tiles/FurnitureAcidwood/AcidwoodDoorClosed.cs b/Tiles/FurnitureAcidwood/AcidwoodDoorClosed.cs new file mode 100644 index 0000000000..2f6c3e4d94 --- /dev/null +++ b/Tiles/FurnitureAcidwood/AcidwoodDoorClosed.cs @@ -0,0 +1,48 @@ +using CalamityMod.Items.Placeables.FurnitureAcidwood; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureAcidwood +{ + public class AcidwoodDoorClosed : ModTile + { + public override void SetDefaults() + { + this.SetUpDoorClosed(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Acidwood Door"); + AddMapEntry(new Color(191, 142, 111), name); + disableSmartCursor = true; + adjTiles = new int[] { TileID.ClosedDoor }; + openDoorID = ModContent.TileType(); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 7, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override bool HasSmartInteract() => true; + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 48, ModContent.ItemType()); + } + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.showItemIcon = true; + player.showItemIcon2 = ModContent.ItemType(); + } + } +} diff --git a/Tiles/FurnitureAcidwood/AcidwoodDoorClosed.png b/Tiles/FurnitureAcidwood/AcidwoodDoorClosed.png new file mode 100644 index 0000000000..8038ff2215 Binary files /dev/null and b/Tiles/FurnitureAcidwood/AcidwoodDoorClosed.png differ diff --git a/Tiles/FurnitureAcidwood/AcidwoodDoorClosed_Highlight.png b/Tiles/FurnitureAcidwood/AcidwoodDoorClosed_Highlight.png new file mode 100644 index 0000000000..1d211a537d Binary files /dev/null and b/Tiles/FurnitureAcidwood/AcidwoodDoorClosed_Highlight.png differ diff --git a/Tiles/FurnitureAcidwood/AcidwoodDoorOpen.cs b/Tiles/FurnitureAcidwood/AcidwoodDoorOpen.cs new file mode 100644 index 0000000000..f1fa68aa19 --- /dev/null +++ b/Tiles/FurnitureAcidwood/AcidwoodDoorOpen.cs @@ -0,0 +1,48 @@ +using CalamityMod.Items.Placeables.FurnitureAcidwood; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureAcidwood +{ + public class AcidwoodDoorOpen : ModTile + { + public override void SetDefaults() + { + this.SetUpDoorOpen(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Acidwood Door"); + AddMapEntry(new Color(191, 142, 111), name); + disableSmartCursor = true; + adjTiles = new int[] { TileID.OpenDoor }; + closeDoorID = ModContent.TileType(); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 7, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override bool HasSmartInteract() => true; + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 32, 48, ModContent.ItemType()); + } + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.showItemIcon = true; + player.showItemIcon2 = ModContent.ItemType(); + } + } +} diff --git a/Tiles/FurnitureAcidwood/AcidwoodDoorOpen.png b/Tiles/FurnitureAcidwood/AcidwoodDoorOpen.png new file mode 100644 index 0000000000..da3051002a Binary files /dev/null and b/Tiles/FurnitureAcidwood/AcidwoodDoorOpen.png differ diff --git a/Tiles/FurnitureAcidwood/AcidwoodDoorOpen_Highlight.png b/Tiles/FurnitureAcidwood/AcidwoodDoorOpen_Highlight.png new file mode 100644 index 0000000000..9855517e95 Binary files /dev/null and b/Tiles/FurnitureAcidwood/AcidwoodDoorOpen_Highlight.png differ diff --git a/Tiles/FurnitureAcidwood/AcidwoodDresserTile.cs b/Tiles/FurnitureAcidwood/AcidwoodDresserTile.cs new file mode 100644 index 0000000000..041f82b753 --- /dev/null +++ b/Tiles/FurnitureAcidwood/AcidwoodDresserTile.cs @@ -0,0 +1,48 @@ +using CalamityMod.Items.Placeables.FurnitureAcidwood; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureAcidwood +{ + public class AcidwoodDresserTile : ModTile + { + public override void SetDefaults() + { + this.SetUpDresser(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Acidwood Dresser"); + AddMapEntry(new Color(191, 142, 111), name); + disableSmartCursor = true; + adjTiles = new int[] { TileID.Dressers }; + dresser = "Acidwood Dresser"; + dresserDrop = ModContent.ItemType(); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 7, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override bool HasSmartInteract() => true; + + public override bool NewRightClick(int i, int j) => CalamityUtils.DresserRightClick(); + + public override void MouseOverFar(int i, int j) => CalamityUtils.DresserMouseFar(chest); + + public override void MouseOver(int i, int j) => CalamityUtils.DresserMouseOver(chest); + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 48, 32, dresserDrop); + Chest.DestroyChest(i, j); + } + } +} diff --git a/Tiles/FurnitureAcidwood/AcidwoodDresserTile.png b/Tiles/FurnitureAcidwood/AcidwoodDresserTile.png new file mode 100644 index 0000000000..b0c5f9dc81 Binary files /dev/null and b/Tiles/FurnitureAcidwood/AcidwoodDresserTile.png differ diff --git a/Tiles/FurnitureAcidwood/AcidwoodDresserTile_Highlight.png b/Tiles/FurnitureAcidwood/AcidwoodDresserTile_Highlight.png new file mode 100644 index 0000000000..89dba0d2f3 Binary files /dev/null and b/Tiles/FurnitureAcidwood/AcidwoodDresserTile_Highlight.png differ diff --git a/Tiles/FurnitureAcidwood/AcidwoodLampTile.cs b/Tiles/FurnitureAcidwood/AcidwoodLampTile.cs new file mode 100644 index 0000000000..75d6e885a7 --- /dev/null +++ b/Tiles/FurnitureAcidwood/AcidwoodLampTile.cs @@ -0,0 +1,65 @@ +using CalamityMod.Items.Placeables.FurnitureAcidwood; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureAcidwood +{ + public class AcidwoodLampTile : ModTile + { + public override void SetDefaults() + { + this.SetUpLamp(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Acidwood Lamp"); + AddMapEntry(new Color(191, 142, 111), name); + + disableSmartCursor = true; + adjTiles = new int[] { TileID.Torches }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 7, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].frameX < 18) + { + r = 0.8f; + g = 0.9f; + b = 1f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 1, 3); + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + CalamityUtils.DrawFlameEffect(ModContent.GetTexture("CalamityMod/Tiles/FurnitureAcidwood/AcidwoodLampTileFlame"), i, j); + } + } +} diff --git a/Tiles/FurnitureAcidwood/AcidwoodLampTile.png b/Tiles/FurnitureAcidwood/AcidwoodLampTile.png new file mode 100644 index 0000000000..4fecc716b5 Binary files /dev/null and b/Tiles/FurnitureAcidwood/AcidwoodLampTile.png differ diff --git a/Tiles/FurnitureAcidwood/AcidwoodLampTileFlame.png b/Tiles/FurnitureAcidwood/AcidwoodLampTileFlame.png new file mode 100644 index 0000000000..e2cba5e10b Binary files /dev/null and b/Tiles/FurnitureAcidwood/AcidwoodLampTileFlame.png differ diff --git a/Tiles/FurnitureAcidwood/AcidwoodLanternTile.cs b/Tiles/FurnitureAcidwood/AcidwoodLanternTile.cs new file mode 100644 index 0000000000..72bf3be1e9 --- /dev/null +++ b/Tiles/FurnitureAcidwood/AcidwoodLanternTile.cs @@ -0,0 +1,65 @@ +using CalamityMod.Items.Placeables.FurnitureAcidwood; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureAcidwood +{ + public class AcidwoodLanternTile : ModTile + { + public override void SetDefaults() + { + this.SetUpLantern(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Acidwood Lantern"); + AddMapEntry(new Color(191, 142, 111), name); + + disableSmartCursor = true; + adjTiles = new int[] { TileID.Torches }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 7, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].frameX < 18) + { + r = 0.8f; + g = 0.9f; + b = 1f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 1, 2); + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + CalamityUtils.DrawFlameEffect(ModContent.GetTexture("CalamityMod/Tiles/FurnitureAcidwood/AcidwoodLanternTileFlame"), i, j); + } + } +} diff --git a/Tiles/FurnitureAcidwood/AcidwoodLanternTile.png b/Tiles/FurnitureAcidwood/AcidwoodLanternTile.png new file mode 100644 index 0000000000..3e4de03174 Binary files /dev/null and b/Tiles/FurnitureAcidwood/AcidwoodLanternTile.png differ diff --git a/Tiles/FurnitureAcidwood/AcidwoodLanternTileFlame.png b/Tiles/FurnitureAcidwood/AcidwoodLanternTileFlame.png new file mode 100644 index 0000000000..a1382ef677 Binary files /dev/null and b/Tiles/FurnitureAcidwood/AcidwoodLanternTileFlame.png differ diff --git a/Tiles/FurnitureAcidwood/AcidwoodPianoTile.cs b/Tiles/FurnitureAcidwood/AcidwoodPianoTile.cs new file mode 100644 index 0000000000..c7219cd6a8 --- /dev/null +++ b/Tiles/FurnitureAcidwood/AcidwoodPianoTile.cs @@ -0,0 +1,33 @@ +using CalamityMod.Items.Placeables.FurnitureAcidwood; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; +namespace CalamityMod.Tiles.FurnitureAcidwood +{ + public class AcidwoodPianoTile : ModTile + { + public override void SetDefaults() + { + this.SetUpPiano(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Acidwood Piano"); + AddMapEntry(new Color(191, 142, 111), name); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 7, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + } +} diff --git a/Tiles/FurnitureAcidwood/AcidwoodPianoTile.png b/Tiles/FurnitureAcidwood/AcidwoodPianoTile.png new file mode 100644 index 0000000000..ce12343fda Binary files /dev/null and b/Tiles/FurnitureAcidwood/AcidwoodPianoTile.png differ diff --git a/Tiles/FurnitureAcidwood/AcidwoodPlatformTile.cs b/Tiles/FurnitureAcidwood/AcidwoodPlatformTile.cs new file mode 100644 index 0000000000..6880fb3b64 --- /dev/null +++ b/Tiles/FurnitureAcidwood/AcidwoodPlatformTile.cs @@ -0,0 +1,36 @@ +using CalamityMod.Items.Placeables.FurnitureAcidwood; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureAcidwood +{ + public class AcidwoodPlatformTile : ModTile + { + public override void SetDefaults() + { + this.SetUpPlatform(); + AddMapEntry(new Color(218, 169, 97)); + drop = ModContent.ItemType(); + disableSmartCursor = true; + adjTiles = new int[] { TileID.Platforms }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 7, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void PostSetDefaults() + { + Main.tileNoSunLight[Type] = false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureAcidwood/AcidwoodPlatformTile.png b/Tiles/FurnitureAcidwood/AcidwoodPlatformTile.png new file mode 100644 index 0000000000..b863863bd9 Binary files /dev/null and b/Tiles/FurnitureAcidwood/AcidwoodPlatformTile.png differ diff --git a/Tiles/FurnitureAcidwood/AcidwoodSinkTile.cs b/Tiles/FurnitureAcidwood/AcidwoodSinkTile.cs new file mode 100644 index 0000000000..f0e8d236c8 --- /dev/null +++ b/Tiles/FurnitureAcidwood/AcidwoodSinkTile.cs @@ -0,0 +1,36 @@ +using CalamityMod.Items.Placeables.FurnitureAcidwood; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureAcidwood +{ + public class AcidwoodSinkTile : ModTile + { + public override void SetDefaults() + { + this.SetUpSink(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Acidwood Sink"); + AddMapEntry(new Color(191, 142, 111), name); + adjTiles = new int[] { TileID.Sinks }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 7, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + } +} diff --git a/Tiles/FurnitureAcidwood/AcidwoodSinkTile.png b/Tiles/FurnitureAcidwood/AcidwoodSinkTile.png new file mode 100644 index 0000000000..c45607e7b1 Binary files /dev/null and b/Tiles/FurnitureAcidwood/AcidwoodSinkTile.png differ diff --git a/Tiles/FurnitureAcidwood/AcidwoodTableTile.cs b/Tiles/FurnitureAcidwood/AcidwoodTableTile.cs new file mode 100644 index 0000000000..db6527918b --- /dev/null +++ b/Tiles/FurnitureAcidwood/AcidwoodTableTile.cs @@ -0,0 +1,36 @@ +using CalamityMod.Items.Placeables.FurnitureAcidwood; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureAcidwood +{ + public class AcidwoodTableTile : ModTile + { + public override void SetDefaults() + { + this.SetUpTable(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Acidwood Table"); + AddMapEntry(new Color(191, 142, 111), name); + adjTiles = new int[] { TileID.Tables }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 7, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + } +} diff --git a/Tiles/FurnitureAcidwood/AcidwoodTableTile.png b/Tiles/FurnitureAcidwood/AcidwoodTableTile.png new file mode 100644 index 0000000000..2fddf80f1a Binary files /dev/null and b/Tiles/FurnitureAcidwood/AcidwoodTableTile.png differ diff --git a/Tiles/FurnitureAcidwood/AcidwoodWorkbenchTile.cs b/Tiles/FurnitureAcidwood/AcidwoodWorkbenchTile.cs new file mode 100644 index 0000000000..dd3ed05e5c --- /dev/null +++ b/Tiles/FurnitureAcidwood/AcidwoodWorkbenchTile.cs @@ -0,0 +1,37 @@ +using CalamityMod.Items.Placeables.FurnitureAcidwood; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureAcidwood +{ + public class AcidwoodWorkbenchTile : ModTile + { + public override void SetDefaults() + { + this.SetUpWorkBench(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Acidwood Work Bench"); + AddMapEntry(new Color(191, 142, 111), name); + disableSmartCursor = true; + adjTiles = new int[] { TileID.WorkBenches }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 7, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 32, 16, ModContent.ItemType()); + } + } +} diff --git a/Tiles/FurnitureAcidwood/AcidwoodWorkbenchTile.png b/Tiles/FurnitureAcidwood/AcidwoodWorkbenchTile.png new file mode 100644 index 0000000000..40cae9e105 Binary files /dev/null and b/Tiles/FurnitureAcidwood/AcidwoodWorkbenchTile.png differ diff --git a/Tiles/FurnitureExo/ExoBathtubGlow.png b/Tiles/FurnitureExo/ExoBathtubGlow.png new file mode 100644 index 0000000000..7a76ebb237 Binary files /dev/null and b/Tiles/FurnitureExo/ExoBathtubGlow.png differ diff --git a/Tiles/FurnitureExo/ExoBathtubTile.cs b/Tiles/FurnitureExo/ExoBathtubTile.cs new file mode 100644 index 0000000000..ecb469eb93 --- /dev/null +++ b/Tiles/FurnitureExo/ExoBathtubTile.cs @@ -0,0 +1,52 @@ +using CalamityMod.Items.Placeables.FurnitureExo; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; +namespace CalamityMod.Tiles.FurnitureExo +{ + public class ExoBathtubTile : ModTile + { + public override void SetDefaults() + { + this.SetUpBathtub(true); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Exo Bathtub"); + AddMapEntry(new Color(71, 95, 114), name); + animationFrameHeight = 54; + } + + public override bool CanExplode(int i, int j) => false; + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 107, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + int xFrameOffset = Main.tile[i, j].frameX; + int yFrameOffset = Main.tile[i, j].frameY; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/FurnitureExo/ExoBathtubGlow"); + Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffest; + Color drawColour = Color.White; + Tile trackTile = Main.tile[i, j]; + if (!trackTile.halfBrick() && trackTile.slope() == 0) + spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else if (trackTile.halfBrick()) + spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } +} diff --git a/Tiles/FurnitureExo/ExoBathtubTile.png b/Tiles/FurnitureExo/ExoBathtubTile.png new file mode 100644 index 0000000000..ec78bde295 Binary files /dev/null and b/Tiles/FurnitureExo/ExoBathtubTile.png differ diff --git a/Tiles/FurnitureExo/ExoBedGlow.png b/Tiles/FurnitureExo/ExoBedGlow.png new file mode 100644 index 0000000000..c6ef561b0a Binary files /dev/null and b/Tiles/FurnitureExo/ExoBedGlow.png differ diff --git a/Tiles/FurnitureExo/ExoBedTile.cs b/Tiles/FurnitureExo/ExoBedTile.cs new file mode 100644 index 0000000000..f9c3fbb5c0 --- /dev/null +++ b/Tiles/FurnitureExo/ExoBedTile.cs @@ -0,0 +1,68 @@ +using CalamityMod.Items.Placeables.FurnitureExo; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureExo +{ + public class ExoBedTile : ModTile + { + public override void SetDefaults() + { + this.SetUpBed(true); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Exo Bed"); + AddMapEntry(new Color(71, 95, 114), name); + disableSmartCursor = true; + adjTiles = new int[] { TileID.Beds }; + bed = true; + } + + public override bool CanExplode(int i, int j) => false; + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 107, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override bool HasSmartInteract() => true; + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 64, 32, ModContent.ItemType()); + } + + public override bool NewRightClick(int i, int j) => CalamityUtils.BedRightClick(i, j); + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.showItemIcon = true; + player.showItemIcon2 = ModContent.ItemType(); + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + int xFrameOffset = Main.tile[i, j].frameX; + int yFrameOffset = Main.tile[i, j].frameY; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/FurnitureExo/ExoBedGlow"); + Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffest; + Color drawColour = Color.White; + Tile trackTile = Main.tile[i, j]; + if (!trackTile.halfBrick() && trackTile.slope() == 0) + spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else if (trackTile.halfBrick()) + spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } +} diff --git a/Tiles/FurnitureExo/ExoBedTile.png b/Tiles/FurnitureExo/ExoBedTile.png new file mode 100644 index 0000000000..b29783f4eb Binary files /dev/null and b/Tiles/FurnitureExo/ExoBedTile.png differ diff --git a/Tiles/FurnitureExo/ExoBedTile_Highlight.png b/Tiles/FurnitureExo/ExoBedTile_Highlight.png new file mode 100644 index 0000000000..810aeb4683 Binary files /dev/null and b/Tiles/FurnitureExo/ExoBedTile_Highlight.png differ diff --git a/Tiles/FurnitureExo/ExoBookcaseGlow.png b/Tiles/FurnitureExo/ExoBookcaseGlow.png new file mode 100644 index 0000000000..1567bc231e Binary files /dev/null and b/Tiles/FurnitureExo/ExoBookcaseGlow.png differ diff --git a/Tiles/FurnitureExo/ExoBookcaseTile.cs b/Tiles/FurnitureExo/ExoBookcaseTile.cs new file mode 100644 index 0000000000..aad051ff72 --- /dev/null +++ b/Tiles/FurnitureExo/ExoBookcaseTile.cs @@ -0,0 +1,55 @@ +using CalamityMod.Items.Placeables.FurnitureExo; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureExo +{ + public class ExoBookcaseTile : ModTile + { + public override void SetDefaults() + { + this.SetUpBookcase(true); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Exo Bookcase"); + AddMapEntry(new Color(71, 95, 114), name); + animationFrameHeight = 54; + adjTiles = new int[] { TileID.Bookcases }; + } + + public override bool CanExplode(int i, int j) => false; + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 107, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + int xFrameOffset = Main.tile[i, j].frameX; + int yFrameOffset = Main.tile[i, j].frameY; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/FurnitureExo/ExoBookcaseGlow"); + Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffest; + Color drawColour = Color.White; + Tile trackTile = Main.tile[i, j]; + if (!trackTile.halfBrick() && trackTile.slope() == 0) + spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else if (trackTile.halfBrick()) + spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } +} diff --git a/Tiles/FurnitureExo/ExoBookcaseTile.png b/Tiles/FurnitureExo/ExoBookcaseTile.png new file mode 100644 index 0000000000..be57c2806b Binary files /dev/null and b/Tiles/FurnitureExo/ExoBookcaseTile.png differ diff --git a/Tiles/FurnitureExo/ExoCandelabraTile.cs b/Tiles/FurnitureExo/ExoCandelabraTile.cs new file mode 100644 index 0000000000..c2dc5f1029 --- /dev/null +++ b/Tiles/FurnitureExo/ExoCandelabraTile.cs @@ -0,0 +1,66 @@ +using CalamityMod.Items.Placeables.FurnitureExo; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureExo +{ + public class ExoCandelabraTile : ModTile + { + public override void SetDefaults() + { + this.SetUpCandelabra(true); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Exo Candelabra"); + AddMapEntry(new Color(71, 95, 114), name); + disableSmartCursor = true; + adjTiles = new int[] { TileID.Torches }; + } + + public override bool CanExplode(int i, int j) => false; + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 107, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].frameX < 18) + { + r = 0.8f; + g = 0.9f; + b = 1f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 16, ModContent.ItemType()); + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 2, 2); + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + CalamityUtils.DrawFlameEffect(ModContent.GetTexture("CalamityMod/Tiles/FurnitureExo/ExoCandelabraTileFlame"), i, j); + } + } +} diff --git a/Tiles/FurnitureExo/ExoCandelabraTile.png b/Tiles/FurnitureExo/ExoCandelabraTile.png new file mode 100644 index 0000000000..ebb64b2aa3 Binary files /dev/null and b/Tiles/FurnitureExo/ExoCandelabraTile.png differ diff --git a/Tiles/FurnitureExo/ExoCandelabraTileFlame.png b/Tiles/FurnitureExo/ExoCandelabraTileFlame.png new file mode 100644 index 0000000000..f1b3ce3352 Binary files /dev/null and b/Tiles/FurnitureExo/ExoCandelabraTileFlame.png differ diff --git a/Tiles/FurnitureExo/ExoCandleTile.cs b/Tiles/FurnitureExo/ExoCandleTile.cs new file mode 100644 index 0000000000..cc5251b02c --- /dev/null +++ b/Tiles/FurnitureExo/ExoCandleTile.cs @@ -0,0 +1,76 @@ +using CalamityMod.Items.Placeables.FurnitureExo; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureExo +{ + public class ExoCandleTile : ModTile + { + public override void SetDefaults() + { + this.SetUpCandle(true); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Exo Candle"); + AddMapEntry(new Color(71, 95, 114), name); + disableSmartCursor = true; + adjTiles = new int[] { TileID.Torches }; + drop = ModContent.ItemType(); + } + + public override bool CanExplode(int i, int j) => false; + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 7, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].frameX < 18) + { + r = 0.8f; + g = 0.9f; + b = 1f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 1, 1); + } + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.showItemIcon = true; + player.showItemIcon2 = ModContent.ItemType(); + } + + public override bool NewRightClick(int i, int j) + { + CalamityUtils.RightClickBreak(i, j); + return true; + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + CalamityUtils.DrawFlameEffect(ModContent.GetTexture("CalamityMod/Tiles/FurnitureExo/ExoCandleTileFlame"), i, j); + } + } +} diff --git a/Tiles/FurnitureExo/ExoCandleTile.png b/Tiles/FurnitureExo/ExoCandleTile.png new file mode 100644 index 0000000000..008a2ade7b Binary files /dev/null and b/Tiles/FurnitureExo/ExoCandleTile.png differ diff --git a/Tiles/FurnitureExo/ExoCandleTileFlame.png b/Tiles/FurnitureExo/ExoCandleTileFlame.png new file mode 100644 index 0000000000..5e510fccc1 Binary files /dev/null and b/Tiles/FurnitureExo/ExoCandleTileFlame.png differ diff --git a/Tiles/FurnitureExo/ExoChairGlow.png b/Tiles/FurnitureExo/ExoChairGlow.png new file mode 100644 index 0000000000..19ca25ccf5 Binary files /dev/null and b/Tiles/FurnitureExo/ExoChairGlow.png differ diff --git a/Tiles/FurnitureExo/ExoChairTile.cs b/Tiles/FurnitureExo/ExoChairTile.cs new file mode 100644 index 0000000000..f5e3c4e4cf --- /dev/null +++ b/Tiles/FurnitureExo/ExoChairTile.cs @@ -0,0 +1,78 @@ +using CalamityMod.Items.Placeables.FurnitureExo; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.Enums; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.FurnitureExo +{ + public class ExoChairTile : ModTile + { + public override void SetDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileLavaDeath[Type] = false; + Main.tileWaterDeath[Type] = false; + TileObjectData.newTile.Width = 2; + TileObjectData.newTile.Height = 2; + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 18 }; + TileObjectData.newTile.CoordinateWidth = 16; + TileObjectData.newTile.CoordinatePadding = 2; + TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.Origin = new Point16(1, 1); + TileObjectData.newTile.UsesCustomCanPlace = true; + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop, 2, 0); + TileObjectData.newTile.LavaDeath = false; + TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); + TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; + TileObjectData.addAlternate(1); + TileObjectData.addTile(Type); + + AddToArray(ref TileID.Sets.RoomNeeds.CountsAsChair); + + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Exo Chair"); + AddMapEntry(new Color(71, 95, 114), name); + disableSmartCursor = true; + adjTiles = new int[] { TileID.Chairs }; + } + + public override bool CanExplode(int i, int j) => false; + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 107, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + int xFrameOffset = Main.tile[i, j].frameX; + int yFrameOffset = Main.tile[i, j].frameY; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/FurnitureExo/ExoChairGlow"); + Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffest; + Color drawColour = Color.White; + Tile trackTile = Main.tile[i, j]; + if (!trackTile.halfBrick() && trackTile.slope() == 0) + spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else if (trackTile.halfBrick()) + spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } +} diff --git a/Tiles/FurnitureExo/ExoChairTile.png b/Tiles/FurnitureExo/ExoChairTile.png new file mode 100644 index 0000000000..5f5ac80c1b Binary files /dev/null and b/Tiles/FurnitureExo/ExoChairTile.png differ diff --git a/Tiles/FurnitureExo/ExoChandelierTile.cs b/Tiles/FurnitureExo/ExoChandelierTile.cs new file mode 100644 index 0000000000..70e133d3fe --- /dev/null +++ b/Tiles/FurnitureExo/ExoChandelierTile.cs @@ -0,0 +1,65 @@ +using CalamityMod.Items.Placeables.FurnitureExo; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureExo +{ + public class ExoChandelierTile : ModTile + { + public override void SetDefaults() + { + this.SetUpChandelier(true); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Exo Chandelier"); + AddMapEntry(new Color(71, 95, 114), name); + adjTiles = new int[] { TileID.Torches }; + } + + public override bool CanExplode(int i, int j) => false; + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 107, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].frameX < 18) + { + r = 0.8f; + g = 0.9f; + b = 1f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 48, 48, ModContent.ItemType()); + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 3, 3); + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + CalamityUtils.DrawFlameEffect(ModContent.GetTexture("CalamityMod/Tiles/FurnitureExo/ExoChandelierTileFlame"), i, j); + } + } +} diff --git a/Tiles/FurnitureExo/ExoChandelierTile.png b/Tiles/FurnitureExo/ExoChandelierTile.png new file mode 100644 index 0000000000..21175ee434 Binary files /dev/null and b/Tiles/FurnitureExo/ExoChandelierTile.png differ diff --git a/Tiles/FurnitureExo/ExoChandelierTileFlame.png b/Tiles/FurnitureExo/ExoChandelierTileFlame.png new file mode 100644 index 0000000000..22ed6baaee Binary files /dev/null and b/Tiles/FurnitureExo/ExoChandelierTileFlame.png differ diff --git a/Tiles/FurnitureExo/ExoChestGlow.png b/Tiles/FurnitureExo/ExoChestGlow.png new file mode 100644 index 0000000000..814b24cd78 Binary files /dev/null and b/Tiles/FurnitureExo/ExoChestGlow.png differ diff --git a/Tiles/FurnitureExo/ExoChestTile.cs b/Tiles/FurnitureExo/ExoChestTile.cs new file mode 100644 index 0000000000..d89a111903 --- /dev/null +++ b/Tiles/FurnitureExo/ExoChestTile.cs @@ -0,0 +1,65 @@ +using CalamityMod.Items.Placeables.FurnitureExo; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.FurnitureExo +{ + public class ExoChestTile : ModTile + { + public override void SetDefaults() + { + this.SetUpChest(true); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Exo Chest"); + AddMapEntry(new Color(71, 95, 114), name, MapChestName); + disableSmartCursor = true; + adjTiles = new int[] { TileID.Containers }; + chest = "Exo Chest"; + chestDrop = ModContent.ItemType(); + } + + public override bool CanExplode(int i, int j) => false; + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 107, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override bool HasSmartInteract() => true; + + public string MapChestName(string name, int i, int j) => CalamityUtils.GetMapChestName(name, i, j); + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 32, 32, chestDrop); + Chest.DestroyChest(i, j); + } + + public override bool NewRightClick(int i, int j) => CalamityUtils.ChestRightClick(i, j); + + public override void MouseOver(int i, int j) => CalamityUtils.ChestMouseOver("Exo Chest", i, j); + + public override void MouseOverFar(int i, int j) => CalamityUtils.ChestMouseFar("Exo Chest", i, j); + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + Tile tile = Main.tile[i, j]; + int yOffset = TileObjectData.GetTileData(tile).DrawYOffset; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/FurnitureExo/ExoChestGlow"); + Vector2 drawOffset = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - (int)Main.screenPosition.X / 2f, j * 16 - (int)Main.screenPosition.Y + yOffset) + drawOffset; + Color drawColour = Color.White; + Main.spriteBatch.Draw(glowmask, drawPosition, new Rectangle(tile.frameX, tile.frameY, 16, 16), drawColour, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + } + } +} diff --git a/Tiles/FurnitureExo/ExoChestTile.png b/Tiles/FurnitureExo/ExoChestTile.png new file mode 100644 index 0000000000..3e0f84d278 Binary files /dev/null and b/Tiles/FurnitureExo/ExoChestTile.png differ diff --git a/Tiles/FurnitureExo/ExoChestTile_Highlight.png b/Tiles/FurnitureExo/ExoChestTile_Highlight.png new file mode 100644 index 0000000000..a5b9f5163f Binary files /dev/null and b/Tiles/FurnitureExo/ExoChestTile_Highlight.png differ diff --git a/Tiles/FurnitureExo/ExoClockGlow.png b/Tiles/FurnitureExo/ExoClockGlow.png new file mode 100644 index 0000000000..b239427723 Binary files /dev/null and b/Tiles/FurnitureExo/ExoClockGlow.png differ diff --git a/Tiles/FurnitureExo/ExoClockTile.cs b/Tiles/FurnitureExo/ExoClockTile.cs new file mode 100644 index 0000000000..2ce967da0f --- /dev/null +++ b/Tiles/FurnitureExo/ExoClockTile.cs @@ -0,0 +1,66 @@ +using CalamityMod.Items.Placeables.FurnitureExo; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureExo +{ + public class ExoClockTile : ModTile + { + public override void SetDefaults() + { + this.SetUpClock(true); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Exo Clock"); + AddMapEntry(new Color(71, 95, 114), name); + adjTiles = new int[] { TileID.GrandfatherClocks }; + } + + public override bool CanExplode(int i, int j) => false; + + public override bool HasSmartInteract() => true; + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 107, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override bool NewRightClick(int x, int y) => CalamityUtils.ClockRightClick(); + + public override void NearbyEffects(int i, int j, bool closer) + { + if (closer) + { + Main.clock = true; + } + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 48, 32, ModContent.ItemType()); + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + int xFrameOffset = Main.tile[i, j].frameX; + int yFrameOffset = Main.tile[i, j].frameY; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/FurnitureExo/ExoClockGlow"); + Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffest; + Color drawColour = Color.White; + Tile trackTile = Main.tile[i, j]; + if (!trackTile.halfBrick() && trackTile.slope() == 0) + spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else if (trackTile.halfBrick()) + spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } +} diff --git a/Tiles/FurnitureExo/ExoClockTile.png b/Tiles/FurnitureExo/ExoClockTile.png new file mode 100644 index 0000000000..630d753796 Binary files /dev/null and b/Tiles/FurnitureExo/ExoClockTile.png differ diff --git a/Tiles/FurnitureExo/ExoClockTile_Highlight.png b/Tiles/FurnitureExo/ExoClockTile_Highlight.png new file mode 100644 index 0000000000..6a6bcec5ae Binary files /dev/null and b/Tiles/FurnitureExo/ExoClockTile_Highlight.png differ diff --git a/Tiles/FurnitureExo/ExoConsoleGlow.png b/Tiles/FurnitureExo/ExoConsoleGlow.png new file mode 100644 index 0000000000..d82832d8f2 Binary files /dev/null and b/Tiles/FurnitureExo/ExoConsoleGlow.png differ diff --git a/Tiles/FurnitureExo/ExoConsoleTile.cs b/Tiles/FurnitureExo/ExoConsoleTile.cs new file mode 100644 index 0000000000..dc9f67175f --- /dev/null +++ b/Tiles/FurnitureExo/ExoConsoleTile.cs @@ -0,0 +1,73 @@ +using CalamityMod.Items.Placeables.FurnitureExo; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Enums; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.FurnitureExo +{ + public class ExoConsoleTile : ModTile + { + public override void SetDefaults() + { + Main.tileLighted[Type] = true; + Main.tileFrameImportant[Type] = true; + Main.tileNoAttach[Type] = true; + Main.tileLavaDeath[Type] = false; + Main.tileWaterDeath[Type] = false; + TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); + TileObjectData.newTile.Height = 3; + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16, 16 }; + TileObjectData.newTile.StyleWrapLimit = 2; + TileObjectData.newTile.StyleMultiplier = 2; + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.LavaDeath = false; + + TileObjectData.newTile.Direction = TileObjectDirection.PlaceRight; + + TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); + TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceLeft; + TileObjectData.addAlternate(1); + TileObjectData.addTile(Type); + + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Console"); + AddMapEntry(new Color(71, 95, 114), name); + } + + public override bool CanExplode(int i, int j) => false; + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 107); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 32, 32, ModContent.ItemType()); + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + int xFrameOffset = Main.tile[i, j].frameX; + int yFrameOffset = Main.tile[i, j].frameY; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/FurnitureExo/ExoConsoleGlow"); + Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffest; + Color drawColour = Color.White; + Tile trackTile = Main.tile[i, j]; + if (!trackTile.halfBrick() && trackTile.slope() == 0) + spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else if (trackTile.halfBrick()) + spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } +} diff --git a/Tiles/FurnitureExo/ExoConsoleTile.png b/Tiles/FurnitureExo/ExoConsoleTile.png new file mode 100644 index 0000000000..496a325628 Binary files /dev/null and b/Tiles/FurnitureExo/ExoConsoleTile.png differ diff --git a/Tiles/FurnitureExo/ExoDisplayGlow.png b/Tiles/FurnitureExo/ExoDisplayGlow.png new file mode 100644 index 0000000000..6601afcc59 Binary files /dev/null and b/Tiles/FurnitureExo/ExoDisplayGlow.png differ diff --git a/Tiles/FurnitureExo/ExoDisplayTile.cs b/Tiles/FurnitureExo/ExoDisplayTile.cs new file mode 100644 index 0000000000..4f4acb2c2c --- /dev/null +++ b/Tiles/FurnitureExo/ExoDisplayTile.cs @@ -0,0 +1,77 @@ +using CalamityMod.Items.Placeables.FurnitureExo; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.Enums; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.FurnitureExo +{ + public class ExoDisplayTile : ModTile + { + public override void SetDefaults() + { + Main.tileLighted[Type] = true; + Main.tileFrameImportant[Type] = true; + Main.tileNoAttach[Type] = true; + Main.tileLavaDeath[Type] = false; + Main.tileWaterDeath[Type] = false; + TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); + TileObjectData.newTile.Width = 4; + TileObjectData.newTile.Height = 3; + TileObjectData.newTile.Origin = new Point16(0, 2); + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16 }; + TileObjectData.newTile.StyleWrapLimit = 2; + TileObjectData.newTile.StyleMultiplier = 2; + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.LavaDeath = false; + + TileObjectData.newTile.Direction = TileObjectDirection.PlaceRight; + + TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); + TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceLeft; + TileObjectData.addAlternate(1); + + TileObjectData.addTile(Type); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Display"); + AddMapEntry(new Color(71, 95, 114), name); + } + + public override bool CanExplode(int i, int j) => false; + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 107); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 32, 32, ModContent.ItemType()); + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + int xFrameOffset = Main.tile[i, j].frameX; + int yFrameOffset = Main.tile[i, j].frameY; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/FurnitureExo/ExoDisplayGlow"); + Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffest; + Color drawColour = Color.White; + Tile trackTile = Main.tile[i, j]; + if (!trackTile.halfBrick() && trackTile.slope() == 0) + spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else if (trackTile.halfBrick()) + spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } +} diff --git a/Tiles/FurnitureExo/ExoDisplayTile.png b/Tiles/FurnitureExo/ExoDisplayTile.png new file mode 100644 index 0000000000..17e23553f1 Binary files /dev/null and b/Tiles/FurnitureExo/ExoDisplayTile.png differ diff --git a/Tiles/FurnitureExo/ExoDoorClosed.cs b/Tiles/FurnitureExo/ExoDoorClosed.cs new file mode 100644 index 0000000000..fb114d2858 --- /dev/null +++ b/Tiles/FurnitureExo/ExoDoorClosed.cs @@ -0,0 +1,72 @@ +using CalamityMod.ILEditing; +using CalamityMod.Items.Placeables.FurnitureExo; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.Enums; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.FurnitureExo +{ + public class ExoDoorClosed : ModTile + { + public override void SetDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileBlockLight[Type] = true; + Main.tileSolid[Type] = true; + Main.tileNoAttach[Type] = true; + Main.tileLavaDeath[Type] = false; + Main.tileWaterDeath[Type] = false; + TileID.Sets.NotReallySolid[Type] = true; + TileID.Sets.DrawsWalls[Type] = true; + TileID.Sets.HasOutlines[Type] = true; + TileObjectData.newTile.Width = 1; + TileObjectData.newTile.Height = 4; + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16, 16 }; + TileObjectData.newTile.CoordinateWidth = 16; + TileObjectData.newTile.CoordinatePadding = 2; + TileObjectData.newTile.Origin = new Point16(0, 3); + TileObjectData.newTile.AnchorTop = new AnchorData(AnchorType.SolidTile, TileObjectData.newTile.Width, 0); + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, TileObjectData.newTile.Width, 0); + TileObjectData.newTile.UsesCustomCanPlace = true; + TileObjectData.newTile.LavaDeath = false; + TileObjectData.addTile(Type); + AddToArray(ref TileID.Sets.RoomNeeds.CountsAsDoor); + + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Exo Door"); + AddMapEntry(new Color(71, 95, 114), name); + disableSmartCursor = true; + adjTiles = new int[] { TileID.ClosedDoor }; + dustType = 8; + openDoorID = ModContent.TileType(); + } + + public override bool Slope(int i, int j) => false; + + public override bool CanExplode(int i, int j) => false; + + public override bool HasSmartInteract() => true; + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 48, ModContent.ItemType()); + } + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.showItemIcon = true; + player.showItemIcon2 = ModContent.ItemType(); + } + } +} diff --git a/Tiles/FurnitureExo/ExoDoorClosed.png b/Tiles/FurnitureExo/ExoDoorClosed.png new file mode 100644 index 0000000000..5a601f37d5 Binary files /dev/null and b/Tiles/FurnitureExo/ExoDoorClosed.png differ diff --git a/Tiles/FurnitureExo/ExoDoorClosed_Highlight.png b/Tiles/FurnitureExo/ExoDoorClosed_Highlight.png new file mode 100644 index 0000000000..d736021ddf Binary files /dev/null and b/Tiles/FurnitureExo/ExoDoorClosed_Highlight.png differ diff --git a/Tiles/FurnitureExo/ExoDoorOpen.cs b/Tiles/FurnitureExo/ExoDoorOpen.cs new file mode 100644 index 0000000000..e5dfc7d81a --- /dev/null +++ b/Tiles/FurnitureExo/ExoDoorOpen.cs @@ -0,0 +1,72 @@ +using CalamityMod.ILEditing; +using CalamityMod.Items.Placeables.FurnitureExo; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.Enums; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.FurnitureExo +{ + public class ExoDoorOpen : ModTile + { + public override void SetDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileBlockLight[Type] = true; + Main.tileSolid[Type] = false; + Main.tileNoAttach[Type] = true; + Main.tileLavaDeath[Type] = false; + Main.tileWaterDeath[Type] = false; + TileID.Sets.NotReallySolid[Type] = true; + TileID.Sets.DrawsWalls[Type] = true; + TileID.Sets.HasOutlines[Type] = true; + TileObjectData.newTile.Width = 1; + TileObjectData.newTile.Height = 4; + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16, 16 }; + TileObjectData.newTile.CoordinateWidth = 16; + TileObjectData.newTile.CoordinatePadding = 2; + TileObjectData.newTile.Origin = new Point16(0, 3); + TileObjectData.newTile.AnchorTop = new AnchorData(AnchorType.SolidTile, TileObjectData.newTile.Width, 0); + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, TileObjectData.newTile.Width, 0); + TileObjectData.newTile.UsesCustomCanPlace = true; + TileObjectData.newTile.LavaDeath = false; + TileObjectData.addTile(Type); + AddToArray(ref TileID.Sets.RoomNeeds.CountsAsDoor); + + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Exo Door"); + AddMapEntry(new Color(71, 95, 114), name); + disableSmartCursor = true; + adjTiles = new int[] { TileID.OpenDoor }; + dustType = 8; + closeDoorID = ModContent.TileType(); + } + + public override bool Slope(int i, int j) => false; + + public override bool CanExplode(int i, int j) => false; + + public override bool HasSmartInteract() => true; + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 48, ModContent.ItemType()); + } + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.showItemIcon = true; + player.showItemIcon2 = ModContent.ItemType(); + } + } +} diff --git a/Tiles/FurnitureExo/ExoDoorOpen.png b/Tiles/FurnitureExo/ExoDoorOpen.png new file mode 100644 index 0000000000..b763dbb35f Binary files /dev/null and b/Tiles/FurnitureExo/ExoDoorOpen.png differ diff --git a/Tiles/FurnitureExo/ExoDoorOpen_Highlight.png b/Tiles/FurnitureExo/ExoDoorOpen_Highlight.png new file mode 100644 index 0000000000..3073ae5603 Binary files /dev/null and b/Tiles/FurnitureExo/ExoDoorOpen_Highlight.png differ diff --git a/Tiles/FurnitureExo/ExoDresserGlow.png b/Tiles/FurnitureExo/ExoDresserGlow.png new file mode 100644 index 0000000000..8651f8caa6 Binary files /dev/null and b/Tiles/FurnitureExo/ExoDresserGlow.png differ diff --git a/Tiles/FurnitureExo/ExoDresserTile.cs b/Tiles/FurnitureExo/ExoDresserTile.cs new file mode 100644 index 0000000000..b240fc4898 --- /dev/null +++ b/Tiles/FurnitureExo/ExoDresserTile.cs @@ -0,0 +1,66 @@ +using CalamityMod.Items.Placeables.FurnitureExo; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureExo +{ + public class ExoDresserTile : ModTile + { + public override void SetDefaults() + { + this.SetUpDresser(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Exo Dresser"); + AddMapEntry(new Color(71, 95, 114), name); + disableSmartCursor = true; + adjTiles = new int[] { TileID.Dressers }; + dresser = "Exo Dresser"; + dresserDrop = ModContent.ItemType(); + } + + public override bool CanExplode(int i, int j) => false; + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 107, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override bool HasSmartInteract() => true; + + public override bool NewRightClick(int i, int j) => CalamityUtils.DresserRightClick(); + + public override void MouseOverFar(int i, int j) => CalamityUtils.DresserMouseFar(chest); + + public override void MouseOver(int i, int j) => CalamityUtils.DresserMouseOver(chest); + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 48, 32, dresserDrop); + Chest.DestroyChest(i, j); + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + int xFrameOffset = Main.tile[i, j].frameX; + int yFrameOffset = Main.tile[i, j].frameY; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/FurnitureExo/ExoDresserGlow"); + Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffest; + Color drawColour = Color.White; + Tile trackTile = Main.tile[i, j]; + if (!trackTile.halfBrick() && trackTile.slope() == 0) + spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else if (trackTile.halfBrick()) + spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } +} diff --git a/Tiles/FurnitureExo/ExoDresserTile.png b/Tiles/FurnitureExo/ExoDresserTile.png new file mode 100644 index 0000000000..be84fac841 Binary files /dev/null and b/Tiles/FurnitureExo/ExoDresserTile.png differ diff --git a/Tiles/FurnitureExo/ExoDresserTile_Highlight.png b/Tiles/FurnitureExo/ExoDresserTile_Highlight.png new file mode 100644 index 0000000000..f89d23234f Binary files /dev/null and b/Tiles/FurnitureExo/ExoDresserTile_Highlight.png differ diff --git a/Tiles/FurnitureExo/ExoKeyboardGlow.png b/Tiles/FurnitureExo/ExoKeyboardGlow.png new file mode 100644 index 0000000000..ecdad6a559 Binary files /dev/null and b/Tiles/FurnitureExo/ExoKeyboardGlow.png differ diff --git a/Tiles/FurnitureExo/ExoKeyboardTile.cs b/Tiles/FurnitureExo/ExoKeyboardTile.cs new file mode 100644 index 0000000000..7a1cefc00f --- /dev/null +++ b/Tiles/FurnitureExo/ExoKeyboardTile.cs @@ -0,0 +1,51 @@ +using CalamityMod.Items.Placeables.FurnitureExo; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; +namespace CalamityMod.Tiles.FurnitureExo +{ + public class ExoKeyboardTile : ModTile + { + public override void SetDefaults() + { + this.SetUpPiano(true); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Exo Keyboard"); + AddMapEntry(new Color(71, 95, 114), name); + } + + public override bool CanExplode(int i, int j) => false; + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 107, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + int xFrameOffset = Main.tile[i, j].frameX; + int yFrameOffset = Main.tile[i, j].frameY; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/FurnitureExo/ExoKeyboardGlow"); + Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffest; + Color drawColour = Color.White; + Tile trackTile = Main.tile[i, j]; + if (!trackTile.halfBrick() && trackTile.slope() == 0) + spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else if (trackTile.halfBrick()) + spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } +} diff --git a/Tiles/FurnitureExo/ExoKeyboardTile.png b/Tiles/FurnitureExo/ExoKeyboardTile.png new file mode 100644 index 0000000000..ca759a1dfc Binary files /dev/null and b/Tiles/FurnitureExo/ExoKeyboardTile.png differ diff --git a/Tiles/FurnitureExo/ExoLampTile.cs b/Tiles/FurnitureExo/ExoLampTile.cs new file mode 100644 index 0000000000..bce9eb5b7f --- /dev/null +++ b/Tiles/FurnitureExo/ExoLampTile.cs @@ -0,0 +1,67 @@ +using CalamityMod.Items.Placeables.FurnitureExo; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureExo +{ + public class ExoLampTile : ModTile + { + public override void SetDefaults() + { + this.SetUpLamp(true); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Exo Lamp"); + AddMapEntry(new Color(71, 95, 114), name); + + disableSmartCursor = true; + adjTiles = new int[] { TileID.Torches }; + } + + public override bool CanExplode(int i, int j) => false; + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 107, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].frameX < 18) + { + r = 0.8f; + g = 0.9f; + b = 1f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 1, 3); + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + CalamityUtils.DrawFlameEffect(ModContent.GetTexture("CalamityMod/Tiles/FurnitureExo/ExoLampTileFlame"), i, j); + } + } +} diff --git a/Tiles/FurnitureExo/ExoLampTile.png b/Tiles/FurnitureExo/ExoLampTile.png new file mode 100644 index 0000000000..73dd121efb Binary files /dev/null and b/Tiles/FurnitureExo/ExoLampTile.png differ diff --git a/Tiles/FurnitureExo/ExoLampTileFlame.png b/Tiles/FurnitureExo/ExoLampTileFlame.png new file mode 100644 index 0000000000..dad4034aba Binary files /dev/null and b/Tiles/FurnitureExo/ExoLampTileFlame.png differ diff --git a/Tiles/FurnitureExo/ExoLanternTile.cs b/Tiles/FurnitureExo/ExoLanternTile.cs new file mode 100644 index 0000000000..dec5d0be97 --- /dev/null +++ b/Tiles/FurnitureExo/ExoLanternTile.cs @@ -0,0 +1,67 @@ +using CalamityMod.Items.Placeables.FurnitureExo; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureExo +{ + public class ExoLanternTile : ModTile + { + public override void SetDefaults() + { + this.SetUpLantern(true); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Exo Lantern"); + AddMapEntry(new Color(71, 95, 114), name); + + disableSmartCursor = true; + adjTiles = new int[] { TileID.Torches }; + } + + public override bool CanExplode(int i, int j) => false; + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 107, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].frameX < 18) + { + r = 0.8f; + g = 0.9f; + b = 1f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 1, 2); + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + CalamityUtils.DrawFlameEffect(ModContent.GetTexture("CalamityMod/Tiles/FurnitureExo/ExoLanternTileFlame"), i, j); + } + } +} diff --git a/Tiles/FurnitureExo/ExoLanternTile.png b/Tiles/FurnitureExo/ExoLanternTile.png new file mode 100644 index 0000000000..256f73c129 Binary files /dev/null and b/Tiles/FurnitureExo/ExoLanternTile.png differ diff --git a/Tiles/FurnitureExo/ExoLanternTileFlame.png b/Tiles/FurnitureExo/ExoLanternTileFlame.png new file mode 100644 index 0000000000..a362f845a9 Binary files /dev/null and b/Tiles/FurnitureExo/ExoLanternTileFlame.png differ diff --git a/Tiles/FurnitureExo/ExoPlatformTile.cs b/Tiles/FurnitureExo/ExoPlatformTile.cs new file mode 100644 index 0000000000..3f5bbd0a8a --- /dev/null +++ b/Tiles/FurnitureExo/ExoPlatformTile.cs @@ -0,0 +1,38 @@ +using CalamityMod.Items.Placeables.FurnitureExo; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureExo +{ + public class ExoPlatformTile : ModTile + { + public override void SetDefaults() + { + this.SetUpPlatform(true); + AddMapEntry(new Color(52, 67, 78)); + drop = ModContent.ItemType(); + disableSmartCursor = true; + adjTiles = new int[] { TileID.Platforms }; + } + + public override bool CanExplode(int i, int j) => false; + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 107, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void PostSetDefaults() + { + Main.tileNoSunLight[Type] = false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureExo/ExoPlatformTile.png b/Tiles/FurnitureExo/ExoPlatformTile.png new file mode 100644 index 0000000000..db011f0f77 Binary files /dev/null and b/Tiles/FurnitureExo/ExoPlatformTile.png differ diff --git a/Tiles/FurnitureExo/ExoScreenGlow.png b/Tiles/FurnitureExo/ExoScreenGlow.png new file mode 100644 index 0000000000..becab18f31 Binary files /dev/null and b/Tiles/FurnitureExo/ExoScreenGlow.png differ diff --git a/Tiles/FurnitureExo/ExoScreenTile.cs b/Tiles/FurnitureExo/ExoScreenTile.cs new file mode 100644 index 0000000000..47427862a1 --- /dev/null +++ b/Tiles/FurnitureExo/ExoScreenTile.cs @@ -0,0 +1,102 @@ +using CalamityMod.Items.Placeables.FurnitureExo; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Enums; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.FurnitureExo +{ + public class ExoScreenTile : ModTile + { + public override void SetDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileLavaDeath[Type] = false; + TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3Wall); + TileObjectData.newTile.Height = 2; + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16 }; + TileObjectData.newTile.LavaDeath = false; + TileObjectData.addTile(Type); + + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Screen"); + AddMapEntry(new Color(71, 95, 114), name); + dustType = 8; + animationFrameHeight = 36; + } + + public override void AnimateTile(ref int frame, ref int frameCounter) + { + int frameAmt = 4; + frameCounter++; + // Switch screens every 3 seconds + if (frameCounter >= 180) + { + // Switches to a randomized screen + frame = (frame + Main.rand.Next(1, frameAmt)) % frameAmt; + frameCounter = 0; + } + } + + public override void AnimateIndividualTile(int type, int i, int j, ref int frameXOffset, ref int frameYOffset) + { + int frameX = Main.tile[i, j].frameX; + int frameY = Main.tile[i, j].frameY; + int frameAmt = 4; + + // Tweak the frame drawn so tiles next to each other are off-sync and look much more interesting. + int xLength = 18; + int xTiles = 3; + frameX %= (xLength * xTiles); + i -= frameX / xLength; + + int yLength = 18; + int yTiles = 2; + frameY %= (yLength * yTiles); + j -= frameY / yLength; + + int uniqueAnimationFrame = Main.tileFrame[Type] + j; + if (i % 2 == 0) + uniqueAnimationFrame += 5; + if (i % 3 == 0) + uniqueAnimationFrame += 5; + if (i % 4 == 0) + uniqueAnimationFrame += 5; + if (j % 2 == 0) + uniqueAnimationFrame += 5; + if (j % 3 == 0) + uniqueAnimationFrame += 5; + if (j % 4 == 0) + uniqueAnimationFrame += 5; + + uniqueAnimationFrame %= frameAmt; + + frameYOffset = uniqueAnimationFrame * animationFrameHeight; + } + + public override bool CanExplode(int i, int j) => false; + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + Tile tile = Main.tile[i, j]; + int yOffset = TileObjectData.GetTileData(tile).DrawYOffset; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/FurnitureExo/ExoScreenGlow"); + Vector2 drawOffset = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - (int)Main.screenPosition.X / 2f, j * 16 - (int)Main.screenPosition.Y + yOffset) + drawOffset; + Color drawColour = Color.White; + Main.spriteBatch.Draw(glowmask, drawPosition, new Rectangle(tile.frameX, tile.frameY, 16, 16), drawColour, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + } + } +} diff --git a/Tiles/FurnitureExo/ExoScreenTile.png b/Tiles/FurnitureExo/ExoScreenTile.png new file mode 100644 index 0000000000..c6be8811a1 Binary files /dev/null and b/Tiles/FurnitureExo/ExoScreenTile.png differ diff --git a/Tiles/FurnitureExo/ExoServerGlow.png b/Tiles/FurnitureExo/ExoServerGlow.png new file mode 100644 index 0000000000..5f883c43ab Binary files /dev/null and b/Tiles/FurnitureExo/ExoServerGlow.png differ diff --git a/Tiles/FurnitureExo/ExoServerTile.cs b/Tiles/FurnitureExo/ExoServerTile.cs new file mode 100644 index 0000000000..1288c4da7a --- /dev/null +++ b/Tiles/FurnitureExo/ExoServerTile.cs @@ -0,0 +1,73 @@ +using CalamityMod.Items.Placeables.FurnitureExo; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Enums; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.FurnitureExo +{ + public class ExoServerTile : ModTile + { + public override void SetDefaults() + { + Main.tileLighted[Type] = true; + Main.tileFrameImportant[Type] = true; + Main.tileNoAttach[Type] = true; + Main.tileLavaDeath[Type] = false; + Main.tileWaterDeath[Type] = false; + TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); + TileObjectData.newTile.Height = 4; + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16, 16, 16 }; + TileObjectData.newTile.StyleWrapLimit = 2; + TileObjectData.newTile.StyleMultiplier = 2; + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.LavaDeath = false; + + TileObjectData.newTile.Direction = TileObjectDirection.PlaceRight; + + TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); + TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceLeft; + TileObjectData.addAlternate(1); + + TileObjectData.addTile(Type); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Server"); + AddMapEntry(new Color(71, 95, 114), name); + } + + public override bool CanExplode(int i, int j) => false; + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 107); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 32, 32, ModContent.ItemType()); + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + int xFrameOffset = Main.tile[i, j].frameX; + int yFrameOffset = Main.tile[i, j].frameY; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/FurnitureExo/ExoServerGlow"); + Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffest; + Color drawColour = Color.White; + Tile trackTile = Main.tile[i, j]; + if (!trackTile.halfBrick() && trackTile.slope() == 0) + spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else if (trackTile.halfBrick()) + spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } +} diff --git a/Tiles/FurnitureExo/ExoServerTile.png b/Tiles/FurnitureExo/ExoServerTile.png new file mode 100644 index 0000000000..b4f66e3235 Binary files /dev/null and b/Tiles/FurnitureExo/ExoServerTile.png differ diff --git a/Tiles/FurnitureExo/ExoSinkGlow.png b/Tiles/FurnitureExo/ExoSinkGlow.png new file mode 100644 index 0000000000..cfbab88767 Binary files /dev/null and b/Tiles/FurnitureExo/ExoSinkGlow.png differ diff --git a/Tiles/FurnitureExo/ExoSinkTile.cs b/Tiles/FurnitureExo/ExoSinkTile.cs new file mode 100644 index 0000000000..e76a51638a --- /dev/null +++ b/Tiles/FurnitureExo/ExoSinkTile.cs @@ -0,0 +1,54 @@ +using CalamityMod.Items.Placeables.FurnitureExo; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureExo +{ + public class ExoSinkTile : ModTile + { + public override void SetDefaults() + { + this.SetUpSink(true); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Exo Sink"); + AddMapEntry(new Color(71, 95, 114), name); + adjTiles = new int[] { TileID.Sinks }; + } + + public override bool CanExplode(int i, int j) => false; + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 107, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + int xFrameOffset = Main.tile[i, j].frameX; + int yFrameOffset = Main.tile[i, j].frameY; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/FurnitureExo/ExoSinkGlow"); + Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffest; + Color drawColour = Color.White; + Tile trackTile = Main.tile[i, j]; + if (!trackTile.halfBrick() && trackTile.slope() == 0) + spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else if (trackTile.halfBrick()) + spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } +} diff --git a/Tiles/FurnitureExo/ExoSinkTile.png b/Tiles/FurnitureExo/ExoSinkTile.png new file mode 100644 index 0000000000..30e638ebdd Binary files /dev/null and b/Tiles/FurnitureExo/ExoSinkTile.png differ diff --git a/Tiles/FurnitureExo/ExoSofaGlow.png b/Tiles/FurnitureExo/ExoSofaGlow.png new file mode 100644 index 0000000000..5117199a77 Binary files /dev/null and b/Tiles/FurnitureExo/ExoSofaGlow.png differ diff --git a/Tiles/FurnitureExo/ExoSofaTile.cs b/Tiles/FurnitureExo/ExoSofaTile.cs new file mode 100644 index 0000000000..e32720d9f5 --- /dev/null +++ b/Tiles/FurnitureExo/ExoSofaTile.cs @@ -0,0 +1,51 @@ +using CalamityMod.Items.Placeables.FurnitureExo; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; +namespace CalamityMod.Tiles.FurnitureExo +{ + public class ExoSofaTile : ModTile + { + public override void SetDefaults() + { + this.SetUpSofa(true); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Exo Sofa"); + AddMapEntry(new Color(71, 95, 114), name); + } + + public override bool CanExplode(int i, int j) => false; + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 107, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + int xFrameOffset = Main.tile[i, j].frameX; + int yFrameOffset = Main.tile[i, j].frameY; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/FurnitureExo/ExoSofaGlow"); + Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffest; + Color drawColour = Color.White; + Tile trackTile = Main.tile[i, j]; + if (!trackTile.halfBrick() && trackTile.slope() == 0) + spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else if (trackTile.halfBrick()) + spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } +} diff --git a/Tiles/FurnitureExo/ExoSofaTile.png b/Tiles/FurnitureExo/ExoSofaTile.png new file mode 100644 index 0000000000..64899efa3f Binary files /dev/null and b/Tiles/FurnitureExo/ExoSofaTile.png differ diff --git a/Tiles/FurnitureExo/ExoTableGlow.png b/Tiles/FurnitureExo/ExoTableGlow.png new file mode 100644 index 0000000000..f6d577d6ba Binary files /dev/null and b/Tiles/FurnitureExo/ExoTableGlow.png differ diff --git a/Tiles/FurnitureExo/ExoTableTile.cs b/Tiles/FurnitureExo/ExoTableTile.cs new file mode 100644 index 0000000000..adb4c05d26 --- /dev/null +++ b/Tiles/FurnitureExo/ExoTableTile.cs @@ -0,0 +1,54 @@ +using CalamityMod.Items.Placeables.FurnitureExo; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureExo +{ + public class ExoTableTile : ModTile + { + public override void SetDefaults() + { + this.SetUpTable(true); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Exo Table"); + AddMapEntry(new Color(71, 95, 114), name); + adjTiles = new int[] { TileID.Tables }; + } + + public override bool CanExplode(int i, int j) => false; + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 107, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + int xFrameOffset = Main.tile[i, j].frameX; + int yFrameOffset = Main.tile[i, j].frameY; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/FurnitureExo/ExoTableGlow"); + Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffest; + Color drawColour = Color.White; + Tile trackTile = Main.tile[i, j]; + if (!trackTile.halfBrick() && trackTile.slope() == 0) + spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else if (trackTile.halfBrick()) + spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } +} diff --git a/Tiles/FurnitureExo/ExoTableTile.png b/Tiles/FurnitureExo/ExoTableTile.png new file mode 100644 index 0000000000..e71aa373ed Binary files /dev/null and b/Tiles/FurnitureExo/ExoTableTile.png differ diff --git a/Tiles/FurnitureExo/ExoTerminalGlow.png b/Tiles/FurnitureExo/ExoTerminalGlow.png new file mode 100644 index 0000000000..71e182cd06 Binary files /dev/null and b/Tiles/FurnitureExo/ExoTerminalGlow.png differ diff --git a/Tiles/FurnitureExo/ExoTerminalTile.cs b/Tiles/FurnitureExo/ExoTerminalTile.cs new file mode 100644 index 0000000000..834d5642c0 --- /dev/null +++ b/Tiles/FurnitureExo/ExoTerminalTile.cs @@ -0,0 +1,77 @@ +using CalamityMod.Items.Placeables.FurnitureExo; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.Enums; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.FurnitureExo +{ + public class ExoTerminalTile : ModTile + { + public override void SetDefaults() + { + Main.tileLighted[Type] = true; + Main.tileFrameImportant[Type] = true; + Main.tileNoAttach[Type] = true; + Main.tileLavaDeath[Type] = false; + Main.tileWaterDeath[Type] = false; + TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); + TileObjectData.newTile.Width = 4; + TileObjectData.newTile.Height = 3; + TileObjectData.newTile.Origin = new Point16(0, 2); + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16 }; + TileObjectData.newTile.StyleWrapLimit = 2; + TileObjectData.newTile.StyleMultiplier = 2; + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.LavaDeath = false; + + TileObjectData.newTile.Direction = TileObjectDirection.PlaceRight; + + TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); + TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceLeft; + TileObjectData.addAlternate(1); + + TileObjectData.addTile(Type); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Terminal"); + AddMapEntry(new Color(71, 95, 114), name); + } + + public override bool CanExplode(int i, int j) => false; + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 107); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 32, 32, ModContent.ItemType()); + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + int xFrameOffset = Main.tile[i, j].frameX; + int yFrameOffset = Main.tile[i, j].frameY; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/FurnitureExo/ExoTerminalGlow"); + Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffest; + Color drawColour = Color.White; + Tile trackTile = Main.tile[i, j]; + if (!trackTile.halfBrick() && trackTile.slope() == 0) + spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else if (trackTile.halfBrick()) + spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } +} diff --git a/Tiles/FurnitureExo/ExoTerminalTile.png b/Tiles/FurnitureExo/ExoTerminalTile.png new file mode 100644 index 0000000000..a37e1f71b2 Binary files /dev/null and b/Tiles/FurnitureExo/ExoTerminalTile.png differ diff --git a/Tiles/FurnitureExo/ExoToiletGlow.png b/Tiles/FurnitureExo/ExoToiletGlow.png new file mode 100644 index 0000000000..88d7def15a Binary files /dev/null and b/Tiles/FurnitureExo/ExoToiletGlow.png differ diff --git a/Tiles/FurnitureExo/ExoToiletTile.cs b/Tiles/FurnitureExo/ExoToiletTile.cs new file mode 100644 index 0000000000..a828e8873a --- /dev/null +++ b/Tiles/FurnitureExo/ExoToiletTile.cs @@ -0,0 +1,79 @@ +using CalamityMod.Items.Placeables.FurnitureExo; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.Enums; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.FurnitureExo +{ + public class ExoToiletTile : ModTile + { + public override void SetDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileLavaDeath[Type] = false; + Main.tileWaterDeath[Type] = false; + TileObjectData.newTile.Width = 2; + TileObjectData.newTile.Height = 2; + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 18 }; + TileObjectData.newTile.CoordinateWidth = 16; + TileObjectData.newTile.CoordinatePadding = 2; + TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.Origin = new Point16(1, 1); + TileObjectData.newTile.UsesCustomCanPlace = true; + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop, 2, 0); + TileObjectData.newTile.LavaDeath = false; + TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); + TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; + TileObjectData.addAlternate(1); + TileObjectData.addTile(Type); + + // Toilets count as Chairs + AddToArray(ref TileID.Sets.RoomNeeds.CountsAsChair); + + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Exo Toilet"); + AddMapEntry(new Color(71, 95, 114), name); + disableSmartCursor = true; + adjTiles = new int[] { TileID.Chairs }; + } + + public override bool CanExplode(int i, int j) => false; + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 107, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + int xFrameOffset = Main.tile[i, j].frameX; + int yFrameOffset = Main.tile[i, j].frameY; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/FurnitureExo/ExoToiletGlow"); + Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffest; + Color drawColour = Color.White; + Tile trackTile = Main.tile[i, j]; + if (!trackTile.halfBrick() && trackTile.slope() == 0) + spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else if (trackTile.halfBrick()) + spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } +} diff --git a/Tiles/FurnitureExo/ExoToiletTile.png b/Tiles/FurnitureExo/ExoToiletTile.png new file mode 100644 index 0000000000..45bb4b7d59 Binary files /dev/null and b/Tiles/FurnitureExo/ExoToiletTile.png differ diff --git a/Tiles/FurnitureExo/ExoWorkbenchGlow.png b/Tiles/FurnitureExo/ExoWorkbenchGlow.png new file mode 100644 index 0000000000..88acea1aa5 Binary files /dev/null and b/Tiles/FurnitureExo/ExoWorkbenchGlow.png differ diff --git a/Tiles/FurnitureExo/ExoWorkbenchTile.cs b/Tiles/FurnitureExo/ExoWorkbenchTile.cs new file mode 100644 index 0000000000..7cee703de9 --- /dev/null +++ b/Tiles/FurnitureExo/ExoWorkbenchTile.cs @@ -0,0 +1,55 @@ +using CalamityMod.Items.Placeables.FurnitureExo; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureExo +{ + public class ExoWorkbenchTile : ModTile + { + public override void SetDefaults() + { + this.SetUpWorkBench(true); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Exo Work Bench"); + AddMapEntry(new Color(71, 95, 114), name); + disableSmartCursor = true; + adjTiles = new int[] { TileID.WorkBenches }; + } + + public override bool CanExplode(int i, int j) => false; + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 107, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 32, 16, ModContent.ItemType()); + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + int xFrameOffset = Main.tile[i, j].frameX; + int yFrameOffset = Main.tile[i, j].frameY; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/FurnitureExo/ExoWorkbenchGlow"); + Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffest; + Color drawColour = Color.White; + Tile trackTile = Main.tile[i, j]; + if (!trackTile.halfBrick() && trackTile.slope() == 0) + spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else if (trackTile.halfBrick()) + spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } +} diff --git a/Tiles/FurnitureExo/ExoWorkbenchTile.png b/Tiles/FurnitureExo/ExoWorkbenchTile.png new file mode 100644 index 0000000000..49012c5972 Binary files /dev/null and b/Tiles/FurnitureExo/ExoWorkbenchTile.png differ diff --git a/World/CalamityWorld.cs b/World/CalamityWorld.cs index eb5acc7a10..b2f1dedfa7 100644 --- a/World/CalamityWorld.cs +++ b/World/CalamityWorld.cs @@ -1092,7 +1092,7 @@ namespace CalamityMod.World { tasks.Insert(islandIndex + 2, new PassLegacy("EvilIsland", delegate (GenerationProgress progress) { - progress.Message = "Evil Island"; + progress.Message = "Corrupting a floating island"; WorldEvilIsland.PlaceEvilIsland(); })); } @@ -1116,14 +1116,14 @@ namespace CalamityMod.World int JungleTempleIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Jungle Temple")); tasks[JungleTempleIndex] = new PassLegacy("Jungle Temple", delegate (GenerationProgress progress) { - progress.Message = "Building the jungle temple (Calamity)"; + progress.Message = "Building a bigger jungle temple"; CustomTemple.NewJungleTemple(); }); int JungleTempleIndex2 = tasks.FindIndex(genpass => genpass.Name.Equals("Temple")); tasks[JungleTempleIndex2] = new PassLegacy("Temple", delegate (GenerationProgress progress) { - progress.Message = "Building the jungle temple (Calamity)"; + progress.Message = "Building a bigger jungle temple"; Main.tileSolid[162] = false; Main.tileSolid[226] = true; CustomTemple.NewJungleTemplePart2(); @@ -1133,7 +1133,7 @@ namespace CalamityMod.World int LihzahrdAltarIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Lihzahrd Altars")); tasks[LihzahrdAltarIndex] = new PassLegacy("Lihzahrd Altars", delegate (GenerationProgress progress) { - progress.Message = "Placing a Lihzahrd altar (Calamity)"; + progress.Message = "Placing the Lihzahrd altar"; CustomTemple.NewJungleTempleLihzahrdAltar(); }); @@ -1144,7 +1144,7 @@ namespace CalamityMod.World #region BrimstoneCrag tasks.Insert(FinalIndex + 1, new PassLegacy("BrimstoneCrag", delegate (GenerationProgress progress) { - progress.Message = "Brimstone Crag"; + progress.Message = "Uncovering the ruins of a fallen empire"; int x = Main.maxTilesX; @@ -1183,14 +1183,14 @@ namespace CalamityMod.World { tasks.Insert(SulphurIndex + 1, new PassLegacy("Sulphur", delegate (GenerationProgress progress) { - progress.Message = "Sulphur Sea"; + progress.Message = "Polluting the ocean"; SulphurousSea.PlaceSulphurSea(); })); } tasks.Insert(FinalIndex + 2, new PassLegacy("SpecialShrines", delegate (GenerationProgress progress) { - progress.Message = "Special Shrines"; + progress.Message = "Placing Special Shrines"; UndergroundShrines.PlaceShrines(); })); @@ -1227,13 +1227,13 @@ namespace CalamityMod.World tasks.Insert(FinalIndex + 4, new PassLegacy("Abyss", delegate (GenerationProgress progress) { - progress.Message = "The Abyss"; + progress.Message = "Discovering the new Challenger Deep"; //Putting the Mariana Trench to shame Abyss.PlaceAbyss(); })); tasks.Insert(FinalIndex + 5, new PassLegacy("Sulphur2", delegate (GenerationProgress progress) { - progress.Message = "Finishing Sulphur Sea"; + progress.Message = "Polluting the ocean more"; SulphurousSea.FinishGeneratingSulphurSea(); })); diff --git a/World/DraedonStructures.cs b/World/DraedonStructures.cs index 939de95903..1f32544031 100644 --- a/World/DraedonStructures.cs +++ b/World/DraedonStructures.cs @@ -526,8 +526,8 @@ namespace CalamityMod.World new ChestItem(ModContent.ItemType(), WorldGen.genRand.Next(8, 14 + 1)), new ChestItem(ModContent.ItemType(), WorldGen.genRand.Next(7, 12 + 1)), new ChestItem(ItemID.HerbBag, WorldGen.genRand.Next(12, 17 + 1)), - new ChestItem(ItemID.CorruptPlanterBox, WorldGen.genRand.Next(5, 9 + 1)), new ChestItem(ItemID.DayBloomPlanterBox, WorldGen.genRand.Next(5, 9 + 1)), + new ChestItem(ItemID.BlinkrootPlanterBox, WorldGen.genRand.Next(5, 9 + 1)), new ChestItem(ItemID.FireBlossomPlanterBox, WorldGen.genRand.Next(5, 9 + 1)), new ChestItem(ItemID.MoonglowPlanterBox, WorldGen.genRand.Next(5, 9 + 1)), new ChestItem(ItemID.ShiverthornPlanterBox, WorldGen.genRand.Next(5, 9 + 1)), @@ -538,6 +538,10 @@ namespace CalamityMod.World new ChestItem(ItemID.Bomb, WorldGen.genRand.Next(6, 7 + 1)), new ChestItem(potionType, WorldGen.genRand.Next(3, 5 + 1)), }; + if (!WorldGen.crimson) + contents.Add(new ChestItem(ItemID.CorruptPlanterBox, WorldGen.genRand.Next(5, 9 + 1))); + else + contents.Add(new ChestItem(ItemID.CrimsonPlanterBox, WorldGen.genRand.Next(5, 9 + 1))); Mod thorium = CalamityMod.Instance.thorium; if (thorium != null) diff --git a/World/MiscWorldgenRoutines.cs b/World/MiscWorldgenRoutines.cs index ec15c1b466..fbb1364a6f 100644 --- a/World/MiscWorldgenRoutines.cs +++ b/World/MiscWorldgenRoutines.cs @@ -23,7 +23,7 @@ namespace CalamityMod.World #region Dungeon Biome Chests public static void GenerateBiomeChests(GenerationProgress progress) { - progress.Message = "Calamity Mod: Biome Chests"; + progress.Message = "Adding a new Biome Chest"; // Get dungeon size field infos. These fields are private for some reason int MinX = (int)typeof(WorldGen).GetField("dMinX", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null) + 25; diff --git a/World/Planets/Planetoid.cs b/World/Planets/Planetoid.cs index d3e882d2c7..c92510ff74 100644 --- a/World/Planets/Planetoid.cs +++ b/World/Planets/Planetoid.cs @@ -13,7 +13,7 @@ namespace CalamityMod.World.Planets public static void GenerateAllBasePlanetoids(GenerationProgress progress) { - progress.Message = "Generating Planetoids..."; + progress.Message = "Creating a new solar system"; int GrassPlanetoidCount = Main.maxTilesX / 1100; int LCPlanetoidCount = Main.maxTilesX / 800; diff --git a/build.txt b/build.txt index 0b87730360..99c26eed2d 100644 --- a/build.txt +++ b/build.txt @@ -1,5 +1,5 @@ author = Fabsol and the Dev Team -version = 1.5.0.003 +version = 1.5.0.004 displayName = Calamity Mod (No Calamity Music) homepage = https://forums.terraria.org/index.php?threads/calamity-mod.44065/ buildIgnore = .vs\*, Properties\*, *.csproj, *.user, obj\*, bin\*, *.config, .git\*, LICENSE, README.md, .editorconfig, .gitignore, .gitattributes