Fixed Dune Wyrm dropping nothing

This commit is contained in:
FyloZ 2020-06-05 21:34:00 -04:00
parent 6d48fb7ef0
commit c3fcc05859
10 changed files with 75 additions and 85 deletions

View File

@ -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;
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -1,45 +1,29 @@
using Decimation.Content.Items.Accessories;
using Decimation.Content.Items.Weapons.Arachnus;
using Decimation.Lib.Items;
using Decimation.Lib.Util;
using Terraria;
using Terraria.ModLoader;
namespace Decimation.Content.Items.Boss.Arachnus
{
internal class ArachnusTreasureBag : DecimationItem
internal class ArachnusTreasureBag : DecimationTreasureBag
{
protected override string ItemName => "Treasure Bag";
protected override string ItemTooltip => "{$CommonItemTooltip.RightClickToOpen}";
public override int BossBagNPC => ModContent.NPCType<NPCs.Arachnus.Arachnus>();
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)
switch (Main.rand.Next(3))
{
case 0:
player.QuickSpawnItem(ModContent.ItemType<ChainStynger>());
else if (rand == 1)
break;
case 1:
player.QuickSpawnItem(ModContent.ItemType<GlaiveWeaver>());
else if (rand == 2)
break;
case 2:
player.QuickSpawnItem(ModContent.ItemType<Infernolizer>());
break;
}
player.QuickSpawnItem(ModContent.ItemType<ShinySentinel>());
}

View File

@ -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<BloodshotEye>();
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<BloodiedEssence>(), Main.rand.Next(35, 51));
player.QuickSpawnItem(ModContent.ItemType<NecrosisStone>());
int random = Main.rand.Next(3);
int weapon = 0;
switch (random)
switch (Main.rand.Next(3))
{
case 0:
weapon = ModContent.ItemType<VampiricShiv>();
@ -50,11 +29,6 @@ namespace Decimation.Content.Items.Boss.Bloodshot
case 2:
weapon = ModContent.ItemType<BloodStream>();
break;
default:
Main.NewText(
"Unexpected error in Bloodshot Eye drops: weapon drop random is out of range (" + random + ").",
Color.Red);
break;
}
player.QuickSpawnItem(weapon);

View File

Before

Width:  |  Height:  |  Size: 506 B

After

Width:  |  Height:  |  Size: 506 B

View File

@ -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<DuneWyrmHead>();
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<NPCs.DuneWyrm.DuneWyrmHead>();
public override void OpenBossBag(Player player)
{
player.QuickSpawnItem(ModContent.ItemType<SoulofTime>(), Main.rand.Next(20, 35));
player.QuickSpawnItem(ItemID.FossilOre, Main.rand.Next(10, 15));
player.QuickSpawnItem(ModContent.ItemType<TheHourGlass>());
if (Main.rand.Next(7) == 0)
if (Main.rand.NextBool(7))
player.QuickSpawnItem(ModContent.ItemType<DuneWyrmMask>());
if (Main.rand.NextBool(13))
player.QuickSpawnItem(ModContent.ItemType<DuneWyrmTrophy>());

View File

@ -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<TreasureBagBloodshotEye>();
bossBag = ModContent.ItemType<BloodshotEyeTreasureBag>();
}
public override void AI()

View File

@ -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<DuneWyrmTreasureBag>();
DuneWyrmBody.bodyPartsCount = 0;
}
@ -53,6 +56,20 @@ namespace Decimation.Content.NPCs.DuneWyrm
target.AddBuff(ModContent.BuffType<Hyperthermic>(), Main.expertMode ? 600 : 300);
}
public override void NPCLoot()
{
if (!Main.expertMode)
{
Item.NewItem(npc.Center, ModContent.ItemType<SoulofTime>(), Main.rand.Next(15, 26));
if (Main.rand.NextBool(20)) Item.NewItem(npc.Center, ModContent.ItemType<DuneWyrmMask>());
}
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<DuneWyrmHead>();
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<DuneWyrmTreasureBag>();
undergroundSound = mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/Earthquake");
}

View File

@ -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);
}
}