Files
CalamityModPublic/Items/TreasureBags/SCalBag.cs
T
2021-09-12 20:07:49 -04:00

77 lines
2.6 KiB
C#

using CalamityMod.Items.Accessories;
using CalamityMod.Items.Armor.Vanity;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Pets;
using CalamityMod.Items.Weapons.Magic;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Items.Weapons.Rogue;
using CalamityMod.Items.Weapons.Summon;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using SCalBoss = CalamityMod.NPCs.SupremeCalamitas.SupremeCalamitas;
namespace CalamityMod.Items.TreasureBags
{
public class SCalBag : ModItem
{
public override int BossBagNPC => ModContent.NPCType<SCalBoss>();
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Treasure Coffer");
Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}");
}
public override void SetDefaults()
{
item.maxStack = 999;
item.consumable = true;
item.width = 24;
item.height = 24;
item.rare = ItemRarityID.Purple;
item.expert = true;
}
public override bool CanRightClick() => true;
public override void OpenBossBag(Player player)
{
player.TryGettingDevArmor();
// Materials
DropHelper.DropItem(player, ModContent.ItemType<CalamitousEssence>(), 25, 35);
// Weapons
float w = DropHelper.BagWeaponDropRateFloat;
DropHelper.DropEntireWeightedSet(player,
DropHelper.WeightStack<Violence>(w),
DropHelper.WeightStack<Condemnation>(w),
DropHelper.WeightStack<Heresy>(w),
DropHelper.WeightStack<Vehemenc>(w),
DropHelper.WeightStack<Perdition>(w),
DropHelper.WeightStack<Vigilance>(w),
DropHelper.WeightStack<Sacrifice>(w)
);
// Equipment
DropHelper.DropItem(player, ModContent.ItemType<Calamity>());
// Vanity
// SCal vanity set (This drops all at once, or not at all)
if (Main.rand.NextBool(7))
{
DropHelper.DropItem(player, ModContent.ItemType<AshenHorns>());
DropHelper.DropItem(player, ModContent.ItemType<SCalMask>());
DropHelper.DropItem(player, ModContent.ItemType<SCalRobes>());
DropHelper.DropItem(player, ModContent.ItemType<SCalBoots>());
}
// The Brimstone Jewel is an expert-only vanity
DropHelper.DropItem(player, ModContent.ItemType<BrimstoneJewel>());
}
}
}