92 lines
3.5 KiB
C#
92 lines
3.5 KiB
C#
using CalamityMod.Items.Accessories;
|
|
using CalamityMod.Items.Armor.Vanity;
|
|
using CalamityMod.Items.Materials;
|
|
using CalamityMod.Items.Pets;
|
|
using CalamityMod.Items.Placeables.Furniture.DevPaintings;
|
|
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 CalamityMod.NPCs.SupremeCalamitas;
|
|
using Microsoft.Xna.Framework;
|
|
using Microsoft.Xna.Framework.Graphics;
|
|
using Terraria;
|
|
using Terraria.GameContent.ItemDropRules;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.TreasureBags
|
|
{
|
|
[LegacyName("SCalBag", "SupremeCalamitasCoffer")]
|
|
public class CalamitasCoffer : ModItem, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Items.TreasureBags";
|
|
public override void SetStaticDefaults()
|
|
{
|
|
Item.ResearchUnlockCount = 3;
|
|
ItemID.Sets.BossBag[Item.type] = true;
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
Item.maxStack = 9999;
|
|
Item.consumable = true;
|
|
Item.width = 24;
|
|
Item.height = 24;
|
|
Item.rare = ItemRarityID.Purple;
|
|
Item.expert = true;
|
|
}
|
|
|
|
public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
|
|
{
|
|
itemGroup = ContentSamples.CreativeHelper.ItemGroup.BossBags;
|
|
}
|
|
|
|
public override bool CanRightClick() => true;
|
|
|
|
public override Color? GetAlpha(Color lightColor) => Color.Lerp(lightColor, Color.White, 0.4f);
|
|
|
|
public override void PostUpdate() => Item.TreasureBagLightAndDust();
|
|
|
|
public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
|
|
{
|
|
return CalamityUtils.DrawTreasureBagInWorld(Item, spriteBatch, ref rotation, ref scale, whoAmI);
|
|
}
|
|
|
|
public override void ModifyItemLoot(ItemLoot itemLoot)
|
|
{
|
|
// Money
|
|
itemLoot.Add(ItemDropRule.CoinsBasedOnNPCValue(ModContent.NPCType<SupremeCalamitas>()));
|
|
|
|
// Materials
|
|
itemLoot.Add(ModContent.ItemType<AshesofAnnihilation>(), 1, 30, 40);
|
|
|
|
// Weapons
|
|
itemLoot.Add(DropHelper.CalamityStyle(DropHelper.BagWeaponDropRateFraction, new int[]
|
|
{
|
|
ModContent.ItemType<Violence>(),
|
|
ModContent.ItemType<Condemnation>(),
|
|
ModContent.ItemType<Heresy>(),
|
|
ModContent.ItemType<Vehemence>(),
|
|
ModContent.ItemType<Perdition>(),
|
|
ModContent.ItemType<Vigilance>(),
|
|
ModContent.ItemType<Sacrifice>()
|
|
}));
|
|
|
|
// Equipment
|
|
itemLoot.Add(ModContent.ItemType<Calamity>());
|
|
itemLoot.AddRevBagAccessories();
|
|
|
|
// Vanity
|
|
var scalVanitySet = ItemDropRule.Common(ModContent.ItemType<SCalMask>(), 7);
|
|
scalVanitySet.OnSuccess(ItemDropRule.Common(ModContent.ItemType<AshenHorns>()));
|
|
scalVanitySet.OnSuccess(ItemDropRule.Common(ModContent.ItemType<SCalRobes>()));
|
|
scalVanitySet.OnSuccess(ItemDropRule.Common(ModContent.ItemType<SCalBoots>()));
|
|
itemLoot.Add(scalVanitySet);
|
|
itemLoot.Add(ModContent.ItemType<BrimstoneJewel>());
|
|
itemLoot.Add(ModContent.ItemType<ThankYouPainting>(), ThankYouPainting.DropInt);
|
|
}
|
|
}
|
|
}
|