From c3fcc05859caaaa14d071ba02ea443af12096fae Mon Sep 17 00:00:00 2001 From: FyloZ Date: Fri, 5 Jun 2020 21:34:00 -0400 Subject: [PATCH] Fixed Dune Wyrm dropping nothing --- Content/Debug/DebugSword.cs | 10 +++-- Content/Debug/DebugSword.png | Bin 0 -> 1486 bytes .../Boss/Arachnus/ArachnusTreasureBag.cs | 42 ++++++------------ .../Arachnus/{Moltenkey.cs => MoltenKey.cs} | 0 ...dshotEye.cs => BloodshotEyeTreasureBag.cs} | 30 +------------ ...hotEye.png => BloodshotEyeTreasureBag.png} | Bin .../Boss/DuneWyrm/DuneWyrmTreasureBag.cs | 24 ++-------- Content/NPCs/Bloodshot/BloodshotEye.cs | 2 +- Content/NPCs/DuneWyrm/DuneWyrm.cs | 22 +++++++-- Lib/Items/DecimationTreasureBag.cs | 30 +++++++++++++ 10 files changed, 75 insertions(+), 85 deletions(-) create mode 100644 Content/Debug/DebugSword.png rename Content/Items/Boss/Arachnus/{Moltenkey.cs => MoltenKey.cs} (100%) rename Content/Items/Boss/Bloodshot/{TreasureBagBloodshotEye.cs => BloodshotEyeTreasureBag.cs} (53%) rename Content/Items/Boss/Bloodshot/{TreasureBagBloodshotEye.png => BloodshotEyeTreasureBag.png} (100%) create mode 100644 Lib/Items/DecimationTreasureBag.cs diff --git a/Content/Debug/DebugSword.cs b/Content/Debug/DebugSword.cs index 893da65..19a9d7d 100644 --- a/Content/Debug/DebugSword.cs +++ b/Content/Debug/DebugSword.cs @@ -1,17 +1,21 @@ using Decimation.Lib.Items; -using Terraria.ID; namespace Decimation.Content.Debug { public class DebugSword : DecimationWeapon { - public override string Texture => "Terraria/Item_" + ItemID.TrueExcalibur; protected override string ItemName => "Debug Sword"; protected override int Damages => 9999999; protected override void InitWeapon() { - item.CloneDefaults(ItemID.TrueExcalibur); + item.width = 168; + item.height = 168; + item.useTime = 30; + item.useAnimation = 30; + item.crit = 50; + item.autoReuse = false; + item.knockBack = 100; } } } \ No newline at end of file diff --git a/Content/Debug/DebugSword.png b/Content/Debug/DebugSword.png new file mode 100644 index 0000000000000000000000000000000000000000..a50cbf952801acbd1de2b16958a3f5fd5b08f6a5 GIT binary patch literal 1486 zcmZ`(c{JMz5dK*-btG|ATX&s}BSc8OI$F|b5FsLL%WBtKCe7=#}QtmwYKOAZ4qfuNA|b>?f$XzX6Ab{-+c4tuc4FN@laVcSpWc_F3vbI zh;{#jlq8rlLtozmLF$Sl(GdWi=gaK{N`v)@U}rKB01^!WAT=ETzJsmQWdMjr0l-QC z0N9iPz_HlM4o^FfK$6@jP9zek7XZYdhlPQ?`T2P^n>`#RZUJUeK?70)0sj;*A&Njd)XYDAw1TUOoaI7P*>)0+!7cf%CBAiP7h z1-m_wWlCHP9U*kl5t1=WYsLHF&+CjUE;uIDRE*m)eF+|m;cv2sWazS!)lUstq%)Fw zlV}2mDCD>cT5SyOz#kAX6z}i zfx=>M=42)0D%7K>_feDrW!QFn_Az0EAvGd0Ec(#3Y|m-EiKulOhHF*oyw9G~ddf{V z?FkXwO@VCs2&b1{K1{t9eFmY5i^*w=G=|2gY$AzX%%MKqn^|dt+!P_!p7Y`}*DfSo zsZ=Q!?gL=|66+X8&d5T7RpX zitXELEG%e>KfaIcT&*gzC*ic=nDGpZOJpHN$9(%G4K%9_5)J$Gp_kCb?wgY*%dahuKQ2`qsEyWWBfCa_ zdjB#t_8dW2S$oTJsxSER%05Yc;!cHn2_?Qc&W>cpy1%WO+c~{&ux-7$xm2V)I8G(X z41QS@_iW9PA;N;`er1>Udj2aZa#j?NyzpM_QCZeT=jmq=agN#)l1O)M*^2OxEdDwT zar&a?{ewV0S9#{>?G-IiN?ik^USaT{P1>XD!#nLzDztTN(5MNMz^m_E*YvD=JE4aD zbKTxD>&V^ExOHFp&10L%)iBh7fwJqCr zG`rHk=%RJGC9}2DX^S8r$epNWFuox|exQtE5<+f#yV7gcPrU%~(!rZgX>pa^CT6OQ zo082V+N_>97ftM*aZ$l1qeu@61G6JJ4uCHFr@>dJ^!>NO5Taq|f-h8$(wj*Gz z>lZDAVU}Q9yx&N%K6@^CO1iJy(|Kq27R1rKc(tljz8K%a? "Treasure Bag"; - protected override string ItemTooltip => "{$CommonItemTooltip.RightClickToOpen}"; public override int BossBagNPC => ModContent.NPCType(); - protected override void Init() - { - item.consumable = true; - item.width = 32; - item.height = 32; - item.rare = Rarity.Cyan.GetRarityValue(); - - this.item.expert = true; - this.item.maxStack = 999; - } - - public override bool CanRightClick() - { - return true; - } - public override void OpenBossBag(Player player) { - player.TryGettingDevArmor(); - - int rand = Main.rand.Next(3); - if (rand == 0) - player.QuickSpawnItem(ModContent.ItemType()); - else if (rand == 1) - player.QuickSpawnItem(ModContent.ItemType()); - else if (rand == 2) - player.QuickSpawnItem(ModContent.ItemType()); + switch (Main.rand.Next(3)) + { + case 0: + player.QuickSpawnItem(ModContent.ItemType()); + break; + case 1: + player.QuickSpawnItem(ModContent.ItemType()); + break; + case 2: + player.QuickSpawnItem(ModContent.ItemType()); + break; + } player.QuickSpawnItem(ModContent.ItemType()); } diff --git a/Content/Items/Boss/Arachnus/Moltenkey.cs b/Content/Items/Boss/Arachnus/MoltenKey.cs similarity index 100% rename from Content/Items/Boss/Arachnus/Moltenkey.cs rename to Content/Items/Boss/Arachnus/MoltenKey.cs diff --git a/Content/Items/Boss/Bloodshot/TreasureBagBloodshotEye.cs b/Content/Items/Boss/Bloodshot/BloodshotEyeTreasureBag.cs similarity index 53% rename from Content/Items/Boss/Bloodshot/TreasureBagBloodshotEye.cs rename to Content/Items/Boss/Bloodshot/BloodshotEyeTreasureBag.cs index e55075f..3fcd69a 100644 --- a/Content/Items/Boss/Bloodshot/TreasureBagBloodshotEye.cs +++ b/Content/Items/Boss/Bloodshot/BloodshotEyeTreasureBag.cs @@ -3,43 +3,22 @@ using Decimation.Content.Items.Misc; using Decimation.Content.Items.Weapons.Bloodshot; using Decimation.Content.NPCs.Bloodshot; using Decimation.Lib.Items; -using Decimation.Lib.Util; -using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace Decimation.Content.Items.Boss.Bloodshot { - internal class TreasureBagBloodshotEye : DecimationItem + internal class BloodshotEyeTreasureBag : DecimationTreasureBag { - protected override string ItemName => "Treasure Bag"; - protected override string ItemTooltip => "{$CommonItemTooltip.RightClickToOpen}"; public override int BossBagNPC => ModContent.NPCType(); - protected override void Init() - { - item.consumable = true; - item.width = 24; - item.height = 24; - item.rare = Rarity.Rainbow.GetRarityValue(); - - this.item.expert = true; - } - - public override bool CanRightClick() - { - return true; - } - public override void OpenBossBag(Player player) { player.QuickSpawnItem(ModContent.ItemType(), Main.rand.Next(35, 51)); player.QuickSpawnItem(ModContent.ItemType()); - int random = Main.rand.Next(3); int weapon = 0; - - switch (random) + switch (Main.rand.Next(3)) { case 0: weapon = ModContent.ItemType(); @@ -50,11 +29,6 @@ namespace Decimation.Content.Items.Boss.Bloodshot case 2: weapon = ModContent.ItemType(); break; - default: - Main.NewText( - "Unexpected error in Bloodshot Eye drops: weapon drop random is out of range (" + random + ").", - Color.Red); - break; } player.QuickSpawnItem(weapon); diff --git a/Content/Items/Boss/Bloodshot/TreasureBagBloodshotEye.png b/Content/Items/Boss/Bloodshot/BloodshotEyeTreasureBag.png similarity index 100% rename from Content/Items/Boss/Bloodshot/TreasureBagBloodshotEye.png rename to Content/Items/Boss/Bloodshot/BloodshotEyeTreasureBag.png diff --git a/Content/Items/Boss/DuneWyrm/DuneWyrmTreasureBag.cs b/Content/Items/Boss/DuneWyrm/DuneWyrmTreasureBag.cs index 729db71..a6d1795 100644 --- a/Content/Items/Boss/DuneWyrm/DuneWyrmTreasureBag.cs +++ b/Content/Items/Boss/DuneWyrm/DuneWyrmTreasureBag.cs @@ -2,41 +2,23 @@ using Decimation.Content.Items.Misc.Souls; using Decimation.Content.Items.Placeable.DuneWyrm; using Decimation.Content.Items.Tools; using Decimation.Content.Items.Vanity.DuneWyrm; -using Decimation.Content.NPCs.DuneWyrm; using Decimation.Lib.Items; -using Decimation.Lib.Util; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace Decimation.Content.Items.Boss.DuneWyrm { - internal class DuneWyrmTreasureBag : DecimationItem + internal class DuneWyrmTreasureBag : DecimationTreasureBag { - protected override string ItemName => "Treasure Bag"; - protected override string ItemTooltip => "Right click to open"; - public override int BossBagNPC => ModContent.NPCType(); - - protected override void Init() - { - item.consumable = true; - item.width = 32; - item.height = 32; - item.rare = Rarity.Rainbow.GetRarityValue(); - item.expert = true; - } - - public override bool CanRightClick() - { - return true; - } + public override int BossBagNPC => ModContent.NPCType(); public override void OpenBossBag(Player player) { player.QuickSpawnItem(ModContent.ItemType(), Main.rand.Next(20, 35)); player.QuickSpawnItem(ItemID.FossilOre, Main.rand.Next(10, 15)); player.QuickSpawnItem(ModContent.ItemType()); - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) player.QuickSpawnItem(ModContent.ItemType()); if (Main.rand.NextBool(13)) player.QuickSpawnItem(ModContent.ItemType()); diff --git a/Content/NPCs/Bloodshot/BloodshotEye.cs b/Content/NPCs/Bloodshot/BloodshotEye.cs index 0ac0462..1018ba3 100644 --- a/Content/NPCs/Bloodshot/BloodshotEye.cs +++ b/Content/NPCs/Bloodshot/BloodshotEye.cs @@ -49,7 +49,7 @@ namespace Decimation.Content.NPCs.Bloodshot npc.knockBackResist = 0; npc.dontTakeDamage = true; music = mod.GetSoundSlot(SoundType.Music, "Sounds/Music/Boss_1_Orchestra"); - bossBag = ModContent.ItemType(); + bossBag = ModContent.ItemType(); } public override void AI() diff --git a/Content/NPCs/DuneWyrm/DuneWyrm.cs b/Content/NPCs/DuneWyrm/DuneWyrm.cs index 736ac4b..d7b24cf 100644 --- a/Content/NPCs/DuneWyrm/DuneWyrm.cs +++ b/Content/NPCs/DuneWyrm/DuneWyrm.cs @@ -2,6 +2,8 @@ using System.Linq; using Decimation.Content.Buffs.Debuffs; using Decimation.Content.Items.Boss.DuneWyrm; +using Decimation.Content.Items.Misc.Souls; +using Decimation.Content.Items.Vanity.DuneWyrm; using Decimation.Content.NPCs.DuneWyrm.AncientTombCrawler; using Decimation.Content.Projectiles; using Decimation.Lib.NPCs; @@ -27,10 +29,11 @@ namespace Decimation.Content.NPCs.DuneWyrm npc.width = 116; npc.height = 116; Main.npcFrameCount[npc.type] = 1; - npc.value = Item.buyPrice(gold: 12); npc.npcSlots = 1f; npc.aiStyle = -1; + npc.boss = true; music = mod.GetSoundSlot(SoundType.Music, "Sounds/Music/The_Deserts_Call"); + bossBag = ModContent.ItemType(); DuneWyrmBody.bodyPartsCount = 0; } @@ -53,6 +56,20 @@ namespace Decimation.Content.NPCs.DuneWyrm target.AddBuff(ModContent.BuffType(), Main.expertMode ? 600 : 300); } + public override void NPCLoot() + { + if (!Main.expertMode) + { + Item.NewItem(npc.Center, ModContent.ItemType(), Main.rand.Next(15, 26)); + + if (Main.rand.NextBool(20)) Item.NewItem(npc.Center, ModContent.ItemType()); + } + else + { + npc.DropBossBags(); + } + } + public override void BossLoot(ref string name, ref int potionType) { name = "The Dune Wyrm"; @@ -279,6 +296,7 @@ namespace Decimation.Content.NPCs.DuneWyrm headType = ModContent.NPCType(); speed = BaseSpeed; turnSpeed = 0.045f; + npc.value = Item.buyPrice(gold: 16); npc.scale = 1.5f; npc.lavaImmune = true; npc.noGravity = true; @@ -288,8 +306,6 @@ namespace Decimation.Content.NPCs.DuneWyrm npc.netAlways = true; npc.DeathSound = SoundID.NPCDeath18; npc.HitSound = SoundID.NPCHit1; - npc.boss = true; - bossBag = ModContent.ItemType(); undergroundSound = mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/Earthquake"); } diff --git a/Lib/Items/DecimationTreasureBag.cs b/Lib/Items/DecimationTreasureBag.cs new file mode 100644 index 0000000..3ea9943 --- /dev/null +++ b/Lib/Items/DecimationTreasureBag.cs @@ -0,0 +1,30 @@ +using Decimation.Lib.Util; +using Terraria; + +namespace Decimation.Lib.Items +{ + public abstract class DecimationTreasureBag : DecimationItem + { + protected sealed override string ItemName => "Treasure Bag"; + protected sealed override string ItemTooltip => "{$CommonItemTooltip.RightClickToOpen}"; + + public abstract override int BossBagNPC { get; } + + protected sealed override void Init() + { + item.consumable = true; + item.width = 32; + item.height = 32; + item.rare = Rarity.Rainbow.GetRarityValue(); + item.expert = true; + item.maxStack = 999; + } + + public sealed override bool CanRightClick() + { + return true; + } + + public abstract override void OpenBossBag(Player player); + } +} \ No newline at end of file