using CalamityMod.Buffs;
using CalamityMod.Buffs.Alcohol;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.Potions;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Buffs.Summon.Whips;
using CalamityMod.DataStructures;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Armor;
using CalamityMod.Items.Weapons.Summon;
using CalamityMod.Projectiles.Summon;
using ReLogic.Reflection;
using Terraria.ID;
using Terraria.ModLoader;
using static Terraria.ModLoader.ModContent;
namespace CalamityMod.Systems.Collections
{
[ReinitializeDuringResizeArrays]
public static class CalamityBuffSets
{
private static SetFactory Factory = BuffID.Sets.Factory;
///
/// If for a buff type, then that buff will have its duration extended with The Amalgam equipped.
/// Also used to remove buffs when contacting the Whispering Maelstrom in the Get fixed boi seed.
/// Defaults to .
///
public static bool[] BuffedByAmalgam = Factory.CreateNamedSet("BuffedByAmalgam")
.Description("Allows this buff to have its duration extended with The Amalgam equipped. Also used to remove buffs when contacting the Whispering Maelstrom in Get fixed boi.")
.RegisterBoolSet(BuffID.ObsidianSkin, BuffID.Regeneration, BuffID.Swiftness, BuffID.Gills, BuffID.Ironskin, BuffID.ManaRegeneration, BuffID.MagicPower, BuffID.Featherfall,
BuffID.Spelunker, BuffID.Invisibility, BuffID.Shine, BuffID.NightOwl, BuffID.Battle, BuffID.Thorns, BuffID.WaterWalking, BuffID.Archery, BuffID.Hunter, BuffID.Gravitation,
BuffID.Tipsy, BuffID.WellFed, BuffID.WellFed2, BuffID.WellFed3, BuffID.Honey, BuffID.WeaponImbueVenom, BuffID.WeaponImbueCursedFlames, BuffID.WeaponImbueFire,
BuffID.WeaponImbueGold, BuffID.WeaponImbueIchor, BuffID.WeaponImbueNanites, BuffID.WeaponImbueConfetti, BuffID.WeaponImbuePoison, BuffID.Lucky, BuffID.Mining,
BuffID.Heartreach, BuffID.Calm, BuffID.Builder, BuffID.Titan, BuffID.Flipper, BuffID.Summoning, BuffID.Dangersense, BuffID.AmmoReservation, BuffID.Lifeforce, BuffID.Endurance,
BuffID.Rage, BuffID.Inferno, BuffID.Wrath, BuffID.Lovestruck, BuffID.Stinky, BuffID.Fishing, BuffID.Sonar, BuffID.Crate, BuffID.Warmth, BuffID.SugarRush,
BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(),
BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(),
BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(),
BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(),
BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(),
BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(),
BuffType(), BuffType(), BuffType(), BuffType());
///
/// If for a buff type, then that buff is a persistent buff.
/// Used by The Amalgam to prevent removing their persistence when the accessory is unequipped.
/// Defaults to .
///
public static bool[] IsPersistentBuff = Factory.CreateNamedSet("IsPersistentBuff")
.Description("Prevents persistent buffs from having their persistence removed by The Amalgam when it is unequipped.")
.RegisterBoolSet(BuffID.WeaponImbueVenom, BuffID.WeaponImbueCursedFlames, BuffID.WeaponImbueFire, BuffID.WeaponImbueGold, BuffID.WeaponImbueIchor, BuffID.WeaponImbueNanites,
BuffID.WeaponImbueConfetti, BuffID.WeaponImbuePoison, BuffType(), BuffType(), BuffType(),
BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(),
BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(),
BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(),
BuffType(), BuffType(), BuffType(), BuffType(), BuffType());
///
/// If for a buff type, then that buff is considered to be a debuff.
/// This general-purpose set has several different uses, including Crown Jewel and its upgrades' debuff effects, and removing debuffs with Cleansing Jelly and its upgrades' auras.
/// Defaults to .
///
public static bool[] IsDebuff = Factory.CreateNamedSet("IsDebuff")
.Description("General-purpose set with several different uses, including Crown Jewel line regen, removal via Cleansing Jelly line aura, etc.")
.RegisterBoolSet(BuffID.Poisoned, BuffID.Darkness, BuffID.Cursed, BuffID.OnFire, BuffID.Bleeding, BuffID.Confused, BuffID.Slow, BuffID.Weak, BuffID.Silenced, BuffID.BrokenArmor,
BuffID.CursedInferno, BuffID.Frostburn, BuffID.Chilled, BuffID.Frozen, BuffID.Burning, BuffID.Suffocation, BuffID.Ichor, BuffID.Venom, BuffID.Blackout, BuffID.Electrified,
BuffID.Rabies, BuffID.Webbed, BuffID.Stoned, BuffID.Dazed, BuffID.VortexDebuff, BuffID.WitheredArmor, BuffID.WitheredWeapon, BuffID.ShadowFlame, BuffID.OgreSpit, BuffID.BetsysCurse,
BuffID.Wet, BuffID.Slimed, BuffID.OnFire3, BuffID.Frostburn2, BuffType(), BuffType(), BuffType(), BuffType(), BuffType(),
BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(),
BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(),
BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(),
BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(),
BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(),
BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(),
BuffType(), BuffType(), BuffType(), BuffType(), BuffType());
///
/// If for a buff type, then that buff is a whip tag buff on the player.
/// Used to prevent "whip stacking", the ability to grant the player multiple whip buff effects at once.
/// Defaults to .
///
public static bool[] IsSummonTagBuff = Factory.CreateNamedSet("IsSummonTagBuff")
.Description("Whip tag buffs for the player, used to prevent whip stacking.")
.RegisterBoolSet(BuffID.CoolWhipPlayerBuff, BuffID.ScytheWhipPlayerBuff, BuffID.SwordWhipPlayerBuff, BuffID.ThornWhipPlayerBuff, BuffType());
///
/// Associates a buff type with its structure. If a buff type is not a key in this dictionary, then it has no associated .
/// Used for several different effects, such as applying tag effects to NPCs, preventing "whip stacking" on NPCs, and drawing the tag effect icon below the NPC.
///
public static SummonTag[] SummonTagDebuff = Factory.CreateNamedSet("SummonTagDebuff")
.Description("Associates a buff type with its SummonTag structure. Used for several different effects, such as applying tag effects to NPCs, preventing whip stacking on NPCs, and drawing the tag effect icon below the NPC.")
.RegisterCustomSet(null,
BuffID.BlandWhipEnemyDebuff, SummonTag.LeatherWhip,
BuffID.BoneWhipNPCDebuff, SummonTag.SpinalTap,
BuffID.CoolWhipNPCDebuff, SummonTag.CoolWhip,
BuffID.FlameWhipEnemyDebuff, SummonTag.Firecracker,
BuffID.MaceWhipNPCDebuff, SummonTag.MorningStar,
BuffID.RainbowWhipNPCDebuff, SummonTag.Kaleidoscope,
BuffID.ScytheWhipEnemyDebuff, SummonTag.DarkHarvest,
BuffID.SwordWhipNPCDebuff, SummonTag.Durendal ,
BuffID.ThornWhipNPCDebuff, SummonTag.Snapthorn,
BuffType(), Cnidarian.summonTag,
BuffType(), ForbiddenCirclet.summonTag,
BuffType(), ProfanedSoulCrystal.SummonTag,
BuffType(), VoidConcentrationStaff.summonTag
);
private static DebuffData Alch(int level) => new DebuffData() { AlcoholLevel = level };
///
/// Associates a buff type with its unique . This class is used to store information about the buff such as DoT, elemental affliation, and whether or not it is an alcohol.
/// Defaults to null, or having no assigned .
///
public static DebuffData[] DebuffDataset = BuffID.Sets.Factory.CreateNamedSet("DebuffData")
.Description("Associates a buff with its DebuffData, which stores information about that buff.")
.RegisterCustomSet(null,
BuffID.OnFire, DebuffData.OnFire,
BuffID.OnFire3, DebuffData.Hellfire,
BuffID.CursedInferno, DebuffData.CursedInferno,
BuffID.ShadowFlame, DebuffData.Shadowflame,
BuffID.Daybreak, DebuffData.Daybroken,
BuffID.Burning, DebuffData.Burning,
BuffID.Frostburn, DebuffData.Frostburn,
BuffID.Frostburn2, DebuffData.Frostbite,
BuffID.Poisoned, DebuffData.Poisoned,
BuffID.Venom, DebuffData.AcidVenom,
BuffID.Electrified, DebuffData.Electrified,
BuffID.Oiled, DebuffData.Oiled,
BuffID.Tipsy, Alch(1),
BuffType(), Alch(1),
BuffType(), Alch(1),
BuffType(), Alch(1),
BuffType(), Alch(1),
BuffType(), Alch(1),
BuffType(), Alch(1),
BuffType(), Alch(1),
BuffType(), Alch(1),
BuffType(), Alch(1),
BuffType(), Alch(1),
BuffType(), Alch(1),
BuffType(), Alch(1),
BuffType(), Alch(1),
BuffType(), Alch(1),
BuffType(), Alch(1),
BuffType(), Alch(1),
BuffType(), Alch(1),
BuffType(), Alch(1),
BuffType(), Alch(1),
BuffType(), Alch(1),
BuffType(), Alch(1),
BuffType(), Alch(2),
BuffType(), Alch(3)
);
public static int GetBuffIDFromAlcoholType(AlcoholType type)
{
return type switch
{
AlcoholType.BaconOil => BuffType(),
AlcoholType.BloodyMary => BuffType(),
AlcoholType.CaribbeanRum => BuffType(),
AlcoholType.CinnamonRoll => BuffType(),
AlcoholType.Everclear => BuffType(),
AlcoholType.EvergreenGin => BuffType(),
AlcoholType.Fireball => BuffType(),
AlcoholType.GrapeBeer => BuffType(),
AlcoholType.Manhattan => BuffType(),
AlcoholType.Margarita => BuffType(),
AlcoholType.Moonshine => BuffType(),
AlcoholType.MoscowMule => BuffType(),
AlcoholType.OldFashioned => BuffType(),
AlcoholType.PurpleHaze => BuffType(),
AlcoholType.RedWine => BuffType(),
AlcoholType.Rum => BuffType(),
AlcoholType.Screwdriver => BuffType(),
AlcoholType.StarBeamRye => BuffType(),
AlcoholType.Tequila => BuffType(),
AlcoholType.TequilaSunrise => BuffType(),
AlcoholType.Vodka => BuffType(),
AlcoholType.Whiskey => BuffType(),
AlcoholType.WhiteWine => BuffType(),
// Vanilla treats both Ale and Sake as the "Tipsy" buff
AlcoholType.Ale => BuffID.Tipsy,
AlcoholType.Sake => BuffID.Tipsy,
_ => -1
};
}
}
}