diff --git a/Content/Decimation.cs b/Content/Decimation.cs index ec85d42..54a70ff 100644 --- a/Content/Decimation.cs +++ b/Content/Decimation.cs @@ -96,8 +96,8 @@ namespace Decimation.Content { bossChecklist.Call("AddBossWithInfo", "The Bloodshot Eye", 2.5f, (Func) (() => DecimationWorld.downedBloodshotEye), "INSERT LATER"); - bossChecklist.Call("AddBossWithInfo", "The Ancient Dune Worm", 5.7f, - (Func) (() => DecimationWorld.downedDuneWorm), "INSERT LATER"); + bossChecklist.Call("AddBossWithInfo", "The Dune Wyrm", 5.7f, + (Func) (() => DecimationWorld.downedDuneWyrm), "INSERT LATER"); bossChecklist.Call("AddBossWithInfo", "Arachnus", 20f, (Func) (() => DecimationWorld.downedArachnus), "INSERT LATER"); } diff --git a/Content/DecimationWorld.cs b/Content/DecimationWorld.cs index adb5ac1..b95083e 100644 --- a/Content/DecimationWorld.cs +++ b/Content/DecimationWorld.cs @@ -15,14 +15,14 @@ namespace Decimation.Content public class DecimationWorld : ModWorld { public static bool downedBloodshotEye; - public static bool downedDuneWorm; + public static bool downedDuneWyrm; public static bool downedArachnus; public static bool downedWyvern; public override void Initialize() { downedBloodshotEye = false; - downedDuneWorm = false; + downedDuneWyrm = false; downedArachnus = false; downedWyvern = false; } @@ -31,7 +31,7 @@ namespace Decimation.Content { var downed = new List(); if (downedBloodshotEye) downed.Add("downedBloodshotEye"); - if (downedDuneWorm) downed.Add("downedDuneWorm"); + if (downedDuneWyrm) downed.Add("downedDuneWyrm"); if (downedArachnus) downed.Add("downedArachnus"); if (downedWyvern) downed.Add("downedWyvern"); return new TagCompound { @@ -42,7 +42,7 @@ namespace Decimation.Content { var downed = tag.GetList("downed"); downedBloodshotEye = downed.Contains("downedBloodshotEye"); - downedDuneWorm = downed.Contains("downedDuneWorm"); + downedDuneWyrm = downed.Contains("downedDuneWyrm"); downedArachnus = downed.Contains("downedArachnus"); downedWyvern = downed.Contains("downedWyvern"); } @@ -50,7 +50,7 @@ namespace Decimation.Content { BitsByte flags = new BitsByte(); flags[0] = downedBloodshotEye; //+1 flag number for each new boss - flags[1] = downedDuneWorm; + flags[1] = downedDuneWyrm; flags[2] = downedArachnus; flags[3] = downedWyvern; writer.Write(flags); @@ -59,7 +59,7 @@ namespace Decimation.Content { BitsByte flags = reader.ReadByte(); downedBloodshotEye = flags[0]; - downedDuneWorm = flags[1]; + downedDuneWyrm = flags[1]; downedArachnus = flags[2]; downedWyvern = flags[3]; } @@ -70,7 +70,7 @@ namespace Decimation.Content { byte flags = reader.ReadByte(); DecimationWorld.downedBloodshotEye = ((flags & 1) != 0); - DecimationWorld.downedDuneWorm = ((flags & 2) != 0); //double flag numbers with each new boss + DecimationWorld.downedDuneWyrm = ((flags & 2) != 0); //double flag numbers with each new boss DecimationWorld.downedArachnus = ((flags & 4) != 0); DecimationWorld.downedWyvern = ((flags & 8) != 0); } @@ -79,7 +79,7 @@ namespace Decimation.Content byte flags = reader.ReadByte(); byte flags2 = reader.ReadByte(); DecimationWorld.downedBloodshotEye = ((flags & 1) != 0); - DecimationWorld.downedDuneWorm = ((flags & 2) != 0); + DecimationWorld.downedDuneWyrm = ((flags & 2) != 0); DecimationWorld.downedArachnus = ((flags & 4) != 0); DecimationWorld.downedWyvern = ((flags & 8) != 0); } diff --git a/Content/Items/Boss/DuneWorm/DesertDessert.cs b/Content/Items/Boss/DuneWyrm/DesertDessert.cs similarity index 92% rename from Content/Items/Boss/DuneWorm/DesertDessert.cs rename to Content/Items/Boss/DuneWyrm/DesertDessert.cs index 6f3c6f9..7601476 100644 --- a/Content/Items/Boss/DuneWorm/DesertDessert.cs +++ b/Content/Items/Boss/DuneWyrm/DesertDessert.cs @@ -5,12 +5,12 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace Decimation.Content.Items.Boss.DuneWorm +namespace Decimation.Content.Items.Boss.DuneWyrm { internal class DesertDessert : DecimationItem { protected override string ItemName => "Desert Dessert"; - protected override string ItemTooltip => "Summons the Ancient Dune Worm"; + protected override string ItemTooltip => "Summons the Dune Wyrm"; protected override void Init() { diff --git a/Content/Items/Boss/DuneWorm/DesertDessert.png b/Content/Items/Boss/DuneWyrm/DesertDessert.png similarity index 100% rename from Content/Items/Boss/DuneWorm/DesertDessert.png rename to Content/Items/Boss/DuneWyrm/DesertDessert.png diff --git a/Content/Items/Boss/DuneWorm/DuneWyrmTreasureBag.cs b/Content/Items/Boss/DuneWyrm/DuneWyrmTreasureBag.cs similarity index 82% rename from Content/Items/Boss/DuneWorm/DuneWyrmTreasureBag.cs rename to Content/Items/Boss/DuneWyrm/DuneWyrmTreasureBag.cs index 17faece..e790c07 100644 --- a/Content/Items/Boss/DuneWorm/DuneWyrmTreasureBag.cs +++ b/Content/Items/Boss/DuneWyrm/DuneWyrmTreasureBag.cs @@ -1,7 +1,7 @@ using Decimation.Content.Items.Misc.Souls; -using Decimation.Content.Items.Placeable.DuneWorm; +using Decimation.Content.Items.Placeable.DuneWyrm; using Decimation.Content.Items.Tools; -using Decimation.Content.Items.Vanity.DuneWorm; +using Decimation.Content.Items.Vanity.DuneWyrm; using Decimation.Content.NPCs.DuneWyrm; using Decimation.Lib.Items; using Decimation.Lib.Util; @@ -9,7 +9,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace Decimation.Content.Items.Boss.DuneWorm +namespace Decimation.Content.Items.Boss.DuneWyrm { internal class DuneWyrmTreasureBag : DecimationItem { @@ -37,9 +37,9 @@ namespace Decimation.Content.Items.Boss.DuneWorm player.QuickSpawnItem(ItemID.FossilOre, Main.rand.Next(10, 15)); player.QuickSpawnItem(ModContent.ItemType()); if (Main.rand.Next(7) == 0) - player.QuickSpawnItem(ModContent.ItemType()); + player.QuickSpawnItem(ModContent.ItemType()); if (Main.rand.NextBool(13)) - player.QuickSpawnItem(ModContent.ItemType()); + player.QuickSpawnItem(ModContent.ItemType()); } } } \ No newline at end of file diff --git a/Content/Items/Boss/DuneWorm/DuneWyrmTreasureBag.png b/Content/Items/Boss/DuneWyrm/DuneWyrmTreasureBag.png similarity index 100% rename from Content/Items/Boss/DuneWorm/DuneWyrmTreasureBag.png rename to Content/Items/Boss/DuneWyrm/DuneWyrmTreasureBag.png diff --git a/Content/Items/Placeable/DuneWorm/DuneWormTrophy.cs b/Content/Items/Placeable/DuneWyrm/DuneWyrmTrophy.cs similarity index 53% rename from Content/Items/Placeable/DuneWorm/DuneWormTrophy.cs rename to Content/Items/Placeable/DuneWyrm/DuneWyrmTrophy.cs index ef9d76d..9d0bf50 100644 --- a/Content/Items/Placeable/DuneWorm/DuneWormTrophy.cs +++ b/Content/Items/Placeable/DuneWyrm/DuneWyrmTrophy.cs @@ -2,20 +2,20 @@ using Decimation.Lib.Items; using Terraria; using Terraria.ModLoader; -namespace Decimation.Content.Items.Placeable.DuneWorm +namespace Decimation.Content.Items.Placeable.DuneWyrm { - internal class DuneWormTrophy : DecimationPlaceableItem + internal class DuneWyrmTrophy : DecimationPlaceableItem { - protected override string ItemName => "Ancient Dune Worm Trophy"; + protected override string ItemName => "Dune Wyrm Trophy"; protected override string ItemTooltip => "Achievement get!"; - protected override int Tile => ModContent.TileType(); + protected override int Tile => ModContent.TileType(); protected override void InitPlaceable() { item.width = 32; item.height = 32; - this.item.maxStack = 99; - this.item.value = Item.buyPrice(0, 5); + item.maxStack = 99; + item.value = Item.buyPrice(0, 5); } } } \ No newline at end of file diff --git a/Content/Items/Placeable/DuneWorm/DuneWormTrophy.png b/Content/Items/Placeable/DuneWyrm/DuneWyrmTrophy.png similarity index 100% rename from Content/Items/Placeable/DuneWorm/DuneWormTrophy.png rename to Content/Items/Placeable/DuneWyrm/DuneWyrmTrophy.png diff --git a/Content/Items/Potions/Antidote.cs b/Content/Items/Potions/Antidote.cs index 62343e2..4cbfe6c 100644 --- a/Content/Items/Potions/Antidote.cs +++ b/Content/Items/Potions/Antidote.cs @@ -1,4 +1,5 @@ using Decimation.Lib.Items; +using Decimation.Lib.Util.Builder; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -9,7 +10,7 @@ namespace Decimation.Content.Items.Potions internal class Antidote : DecimationItem { protected override string ItemName => "Antidote"; - protected override string ItemTooltip => "Cure poison and venom."; + protected override string ItemTooltip => "Cures poison and venom."; protected override void Init() { @@ -32,13 +33,12 @@ namespace Decimation.Content.Items.Potions protected override ModRecipe GetRecipe() { - ModRecipe recipe = GetNewModRecipe(this, 1, TileID.AlchemyTable); - - recipe.AddIngredient(ItemID.Waterleaf); - recipe.AddIngredient(ItemID.Moonglow); - recipe.AddIngredient(ItemID.BottledHoney); - - return recipe; + return new RecipeBuilder(this) + .WithIngredient(ItemID.Waterleaf) + .WithIngredient(ItemID.Moonglow) + .WithIngredient(ItemID.BottledHoney) + .WithStation(TileID.AlchemyTable) + .Build(); } } } \ No newline at end of file diff --git a/Content/Items/Potions/GreaterAntidote.cs b/Content/Items/Potions/GreaterAntidote.cs new file mode 100644 index 0000000..e598fc0 --- /dev/null +++ b/Content/Items/Potions/GreaterAntidote.cs @@ -0,0 +1,44 @@ +using Decimation.Content.Buffs.Debuffs; +using Decimation.Lib.Items; +using Decimation.Lib.Util.Builder; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace Decimation.Content.Items.Potions +{ + public class GreaterAntidote : DecimationItem + { + protected override string ItemName => "Greater Antidote"; + protected override string ItemTooltip => "Cures poison, venom, confusion and avian flu"; + + protected override void Init() + { + item.CloneDefaults(ModContent.ItemType()); + + item.width = 24; + item.height = 26; + } + + public override bool UseItem(Player player) + { + player.ClearBuff(BuffID.Poisoned); + player.ClearBuff(BuffID.Venom); + player.ClearBuff(BuffID.Confused); + player.ClearBuff(ModContent.BuffType()); + + return true; + } + + protected override ModRecipe GetRecipe() + { + return new RecipeBuilder(this, 5) + .WithIngredient(ModContent.ItemType()) + .WithIngredient(ItemID.ManaPotion) + .WithIngredient(ItemID.GreaterHealingPotion) + .WithIngredient(ModContent.ItemType(), 5) + .WithStation(TileID.AlchemyTable) + .Build(); + } + } +} \ No newline at end of file diff --git a/Content/Items/Potions/GreaterAntidote.png b/Content/Items/Potions/GreaterAntidote.png new file mode 100644 index 0000000..0b75673 Binary files /dev/null and b/Content/Items/Potions/GreaterAntidote.png differ diff --git a/Content/Items/Vanity/DuneWorm/DuneWormMask.cs b/Content/Items/Vanity/DuneWyrm/DuneWyrmMask.cs similarity index 71% rename from Content/Items/Vanity/DuneWorm/DuneWormMask.cs rename to Content/Items/Vanity/DuneWyrm/DuneWyrmMask.cs index 2248b74..23c7f97 100644 --- a/Content/Items/Vanity/DuneWorm/DuneWormMask.cs +++ b/Content/Items/Vanity/DuneWyrm/DuneWyrmMask.cs @@ -2,12 +2,12 @@ using Decimation.Lib.Items; using Decimation.Lib.Util; using Terraria.ModLoader; -namespace Decimation.Content.Items.Vanity.DuneWorm +namespace Decimation.Content.Items.Vanity.DuneWyrm { [AutoloadEquip(EquipType.Head)] - internal class DuneWormMask : DecimationItem + internal class DuneWyrmMask : DecimationItem { - protected override string ItemName => "Ancient Dune Worm Mask"; + protected override string ItemName => "Ancient Dune Wyrm Mask"; protected override string ItemTooltip => "A bit dusty"; protected override void Init() @@ -16,6 +16,7 @@ namespace Decimation.Content.Items.Vanity.DuneWorm item.height = 34; item.rare = Rarity.Orange.GetRarityValue(); item.vanity = true; + item.maxStack = 1; } public override bool DrawHead() diff --git a/Content/Items/Vanity/DuneWorm/DuneWormMask.png b/Content/Items/Vanity/DuneWyrm/DuneWyrmMask.png similarity index 100% rename from Content/Items/Vanity/DuneWorm/DuneWormMask.png rename to Content/Items/Vanity/DuneWyrm/DuneWyrmMask.png diff --git a/Content/Items/Vanity/DuneWorm/DuneWormMask_Head.png b/Content/Items/Vanity/DuneWyrm/DuneWyrmMask_Head.png similarity index 100% rename from Content/Items/Vanity/DuneWorm/DuneWormMask_Head.png rename to Content/Items/Vanity/DuneWyrm/DuneWyrmMask_Head.png diff --git a/Content/NPCs/DuneWyrm/DuneWyrm.cs b/Content/NPCs/DuneWyrm/DuneWyrm.cs index 17b719c..5250c1d 100644 --- a/Content/NPCs/DuneWyrm/DuneWyrm.cs +++ b/Content/NPCs/DuneWyrm/DuneWyrm.cs @@ -56,7 +56,7 @@ namespace Decimation.Content.NPCs.DuneWyrm public override void BossLoot(ref string name, ref int potionType) { name = "The Dune Wyrm"; - DecimationWorld.downedDuneWorm = true; + DecimationWorld.downedDuneWyrm = true; potionType = ItemID.HealingPotion; base.BossLoot(ref name, ref potionType); diff --git a/Content/NPCs/TownNPCs/Skeleton.cs b/Content/NPCs/TownNPCs/Skeleton.cs index 51dedcf..af9cf9c 100644 --- a/Content/NPCs/TownNPCs/Skeleton.cs +++ b/Content/NPCs/TownNPCs/Skeleton.cs @@ -1,5 +1,5 @@ using System.Collections.Generic; -using Decimation.Content.Items.Boss.DuneWorm; +using Decimation.Content.Items.Boss.DuneWyrm; using Decimation.Content.Items.Misc; using Decimation.Content.Items.Misc.Souls; using Decimation.Content.Projectiles; @@ -159,7 +159,7 @@ namespace Decimation.Content.NPCs.TownNPCs nextSlot++; } - if (DecimationWorld.downedDuneWorm) + if (DecimationWorld.downedDuneWyrm) { shop.item[nextSlot].SetDefaults(ModContent.ItemType()); nextSlot++; diff --git a/Content/Tiles/DuneWormTrophy.cs b/Content/Tiles/DuneWyrmTrophy.cs similarity index 75% rename from Content/Tiles/DuneWormTrophy.cs rename to Content/Tiles/DuneWyrmTrophy.cs index 51b8653..9a6d17e 100644 --- a/Content/Tiles/DuneWormTrophy.cs +++ b/Content/Tiles/DuneWyrmTrophy.cs @@ -1,31 +1,29 @@ using Microsoft.Xna.Framework; -using System; using Terraria; -using Terraria.ID; using Terraria.ModLoader; using Terraria.ObjectData; namespace Decimation.Content.Tiles { - class DuneWormTrophy : ModTile + class DuneWyrmTrophy : ModTile { public override void SetDefaults() { Main.tileFrameImportant[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3Wall); - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[] {16, 16, 16}; TileObjectData.addTile(Type); dustType = 7; disableSmartCursor = true; ModTranslation name = CreateMapEntryName(); - name.SetDefault("Dune Worm Trophy"); + name.SetDefault("Dune Wyrm Trophy"); AddMapEntry(new Color(120, 85, 60), name); } public override void KillMultiTile(int i, int j, int frameX, int frameY) { - Item.NewItem(i * 16, j * 16, 48, 48, ModContent.ItemType()); + Item.NewItem(i * 16, j * 16, 48, 48, ModContent.ItemType()); } } -} +} \ No newline at end of file diff --git a/Content/Tiles/DuneWormTrophy.png b/Content/Tiles/DuneWyrmTrophy.png similarity index 100% rename from Content/Tiles/DuneWormTrophy.png rename to Content/Tiles/DuneWyrmTrophy.png diff --git a/Lib/Util/Builder/RecipeBuilder.cs b/Lib/Util/Builder/RecipeBuilder.cs index a13c29d..040be8e 100644 --- a/Lib/Util/Builder/RecipeBuilder.cs +++ b/Lib/Util/Builder/RecipeBuilder.cs @@ -14,11 +14,15 @@ namespace Decimation.Lib.Util.Builder public RecipeBuilder(Mod mod, ModItem result, int resultQuantity = 1) { - _mod = mod; _result = result.item.type; _resultQuantity = resultQuantity; } + public RecipeBuilder(ModItem result, int resultQuantity = 1) : this(Content.Decimation.Instance, result, + resultQuantity) + { + } + public RecipeBuilder WithIngredient(int item, int quantity = 1) { _ingredients.Add(item, quantity);