using CalamityMod.Buffs.Alcohol; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer; using CalamityMod.ILEditing; using CalamityMod.Items.Accessories; using CalamityMod.Items.Accessories.Vanity; using CalamityMod.Items.Accessories.Wings; using CalamityMod.Items.Ammo.FiniteUse; using CalamityMod.Items.Armor; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.Dyes; using CalamityMod.Items.Fishing.AstralCatches; using CalamityMod.Items.Fishing.BrimstoneCragCatches; using CalamityMod.Items.Fishing.FishingRods; using CalamityMod.Items.Fishing.SunkenSeaCatches; using CalamityMod.Items.LoreItems; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Items.Placeables.Furniture.Trophies; using CalamityMod.Items.TreasureBags; using CalamityMod.Items.Tools; 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.Localization; using CalamityMod.NPCs; using CalamityMod.NPCs.Abyss; using CalamityMod.NPCs.AquaticScourge; using CalamityMod.NPCs.Astral; using CalamityMod.NPCs.AstrumAureus; using CalamityMod.NPCs.AstrumDeus; using CalamityMod.NPCs.BrimstoneElemental; using CalamityMod.NPCs.Bumblebirb; using CalamityMod.NPCs.Calamitas; using CalamityMod.NPCs.CeaselessVoid; using CalamityMod.NPCs.Crabulon; using CalamityMod.NPCs.Cryogen; using CalamityMod.NPCs.DesertScourge; using CalamityMod.NPCs.DevourerofGods; using CalamityMod.NPCs.GreatSandShark; using CalamityMod.NPCs.HiveMind; using CalamityMod.NPCs.Leviathan; using CalamityMod.NPCs.NormalNPCs; using CalamityMod.NPCs.OldDuke; using CalamityMod.NPCs.Perforator; using CalamityMod.NPCs.PlaguebringerGoliath; using CalamityMod.NPCs.Polterghast; using CalamityMod.NPCs.ProfanedGuardians; using CalamityMod.NPCs.Providence; using CalamityMod.NPCs.Ravager; using CalamityMod.NPCs.Signus; using CalamityMod.NPCs.SlimeGod; using CalamityMod.NPCs.StormWeaver; using CalamityMod.NPCs.SunkenSea; using CalamityMod.NPCs.SupremeCalamitas; using CalamityMod.NPCs.Yharon; using CalamityMod.Projectiles.Boss; using CalamityMod.Projectiles.Enemy; using CalamityMod.Projectiles.Hybrid; using CalamityMod.Projectiles.Magic; using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Ranged; using CalamityMod.Projectiles.Rogue; using CalamityMod.Projectiles.Typeless; using CalamityMod.Skies; using CalamityMod.UI; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using System.Collections.Generic; using System.IO; using System.Reflection; using Terraria; using Terraria.DataStructures; using Terraria.GameContent.Dyes; using Terraria.Graphics.Effects; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.Config; using Terraria.UI; namespace CalamityMod { public class CalamityMod : Mod { // CONSIDER -- I have been advised by Jopo that Mods should never contain static variables // Hotkeys public static ModHotKey NormalityRelocatorHotKey; public static ModHotKey AegisHotKey; public static ModHotKey TarraHotKey; public static ModHotKey RageHotKey; public static ModHotKey AdrenalineHotKey; public static ModHotKey AstralTeleportHotKey; public static ModHotKey AstralArcanumUIHotkey; public static ModHotKey MomentumCapacitatorHotkey; public static ModHotKey SandCloakHotkey; public static ModHotKey SpectralVeilHotKey; public static ModHotKey PlaguePackHotKey; // Boss Spawners public static int ghostKillCount = 0; public static int sharkKillCount = 0; public static int astralKillCount = 0; // Textures & Shaders public static Texture2D heartOriginal2; public static Texture2D heartOriginal; public static Texture2D rainOriginal; public static Texture2D manaOriginal; public static Texture2D carpetOriginal; public static Texture2D AstralCactusTexture; public static Texture2D AstralCactusGlowTexture; public static Texture2D AstralSky; public static Effect CustomShader; public static Effect LightShader; // DR data structure public static SortedDictionary DRValues; // Lists public static IList donatorList; public static List rangedProjectileExceptionList; public static List projectileDestroyExceptionList; public static List projectileMinionList; public static List enemyImmunityList; public static List dungeonEnemyBuffList; public static List dungeonProjectileBuffList; public static List bossScaleList; public static List bossHPScaleList; public static List beeEnemyList; public static List beeProjectileList; public static List hardModeNerfList; public static List debuffList; public static List fireWeaponList; public static List iceWeaponList; public static List natureWeaponList; public static List alcoholList; public static List doubleDamageBuffList; //100% buff public static List sixtySixDamageBuffList; //66% buff public static List fiftyDamageBuffList; //50% buff public static List thirtyThreeDamageBuffList; //33% buff public static List twentyFiveDamageBuffList; //25% buff public static List twentyDamageBuffList; //20% buff public static List weaponAutoreuseList; public static List quarterDamageNerfList; //25% nerf public static List pumpkinMoonBuffList; public static List frostMoonBuffList; public static List eclipseBuffList; public static List eventProjectileBuffList; public static List revengeanceEnemyBuffList25Percent; public static List revengeanceEnemyBuffList20Percent; public static List revengeanceEnemyBuffList15Percent; public static List revengeanceEnemyBuffList10Percent; public static List revengeanceEnemyBuffList5Percent; public static List revengeanceProjectileBuffList25Percent; public static List revengeanceProjectileBuffList20Percent; public static List revengeanceProjectileBuffList15Percent; public static List revengeanceProjectileBuffList10Percent; public static List revengeanceProjectileBuffList5Percent; public static List revengeanceLifeStealExceptionList; public static List movementImpairImmuneList; public static List trapProjectileList; public static List scopedWeaponList; public static List boomerangList; public static List javelinList; public static List daggerList; public static List flaskBombList; public static List spikyBallList; public static List boomerangProjList; public static List javelinProjList; public static List daggerProjList; public static List flaskBombProjList; public static List spikyBallProjList; public static List noGravityList; public static List lavaFishList; public static List highTestFishList; public static List flamethrowerList; public static List forceItemList; public static List zombieList; public static List demonEyeList; public static List skeletonList; public static List angryBonesList; public static List hornetList; public static List mossHornetList; public static List legOverrideList; // TODO -- Calamity should check for other mods existing in exactly one place internal Mod thorium = null; public bool fargosMutant = false; internal static Configs CalamityConfig; internal static CalamityMod instance; #region Load public override void Load() { instance = this; heartOriginal2 = Main.heartTexture; heartOriginal = Main.heart2Texture; rainOriginal = Main.rainTexture; manaOriginal = Main.manaTexture; carpetOriginal = Main.flyingCarpetTexture; NormalityRelocatorHotKey = RegisterHotKey("Normality Relocator", "Z"); RageHotKey = RegisterHotKey("Rage Mode", "V"); AdrenalineHotKey = RegisterHotKey("Adrenaline Mode", "B"); AegisHotKey = RegisterHotKey("Elysian Guard", "N"); TarraHotKey = RegisterHotKey("Armor Set Bonus", "Y"); AstralTeleportHotKey = RegisterHotKey("Astral Teleport", "P"); AstralArcanumUIHotkey = RegisterHotKey("Astral Arcanum UI Toggle", "O"); MomentumCapacitatorHotkey = RegisterHotKey("Momentom Capacitater Effect", "U"); SandCloakHotkey = RegisterHotKey("Sand Cloak Effect", "C"); SpectralVeilHotKey = RegisterHotKey("Spectral Veil Teleport", "Z"); PlaguePackHotKey = RegisterHotKey("Plagued Fuel Pack Dash", "Q"); if (!Main.dedServ) { LoadClient(); } ILChanges.Initialize(); thorium = ModLoader.GetMod("ThoriumMod"); BossHealthBarManager.Load(this); SetupLists(); SetupVanillaDR(); SetupThoriumBossDR(thorium); CalamityLocalization.AddLocalizations(); } private void LoadClient() { AddEquipTexture(new AbyssalDivingSuitHead(), null, EquipType.Head, "AbyssalDivingSuitHead", "CalamityMod/Items/Accessories/AbyssalDivingSuit_Head"); AddEquipTexture(new AbyssalDivingSuitBody(), null, EquipType.Body, "AbyssalDivingSuitBody", "CalamityMod/Items/Accessories/AbyssalDivingSuit_Body", "CalamityMod/Items/Accessories/AbyssalDivingSuit_Arms"); AddEquipTexture(new AbyssalDivingSuitLegs(), null, EquipType.Legs, "AbyssalDivingSuitLeg", "CalamityMod/Items/Accessories/AbyssalDivingSuit_Legs"); AddEquipTexture(new SirenHead(), null, EquipType.Head, "SirenHead", "CalamityMod/Items/Accessories/SirenTrans_Head"); AddEquipTexture(new SirenBody(), null, EquipType.Body, "SirenBody", "CalamityMod/Items/Accessories/SirenTrans_Body", "CalamityMod/Items/Accessories/SirenTrans_Arms"); AddEquipTexture(new SirenLegs(), null, EquipType.Legs, "SirenLeg", "CalamityMod/Items/Accessories/SirenTrans_Legs"); AddEquipTexture(new SirenHeadAlt(), null, EquipType.Head, "SirenHeadAlt", "CalamityMod/Items/Accessories/SirenTransAlt_Head"); AddEquipTexture(new SirenBodyAlt(), null, EquipType.Body, "SirenBodyAlt", "CalamityMod/Items/Accessories/SirenTransAlt_Body", "CalamityMod/Items/Accessories/SirenTransAlt_Arms"); AddEquipTexture(new SirenLegsAlt(), null, EquipType.Legs, "SirenLegAlt", "CalamityMod/Items/Accessories/SirenTransAlt_Legs"); AddEquipTexture(new PopoHead(), null, EquipType.Head, "PopoHead", "CalamityMod/Items/Accessories/Vanity/Popo_Head"); AddEquipTexture(new PopoNoselessHead(), null, EquipType.Head, "PopoNoselessHead", "CalamityMod/Items/Accessories/Vanity/PopoNoseless_Head"); AddEquipTexture(new PopoBody(), null, EquipType.Body, "PopoBody", "CalamityMod/Items/Accessories/Vanity/Popo_Body", "CalamityMod/Items/Accessories/Vanity/Popo_Arms"); AddEquipTexture(new PopoLegs(), null, EquipType.Legs, "PopoLeg", "CalamityMod/Items/Accessories/Vanity/Popo_Legs"); AddEquipTexture(new ProfanedCrystalHead(), null, EquipType.Head, "ProviHead", "CalamityMod/Items/Accessories/ProfanedSoulTransHead"); AddEquipTexture(new ProfanedCrystalBody(), null, EquipType.Body, "ProviBody", "CalamityMod/Items/Accessories/ProfanedSoulTransBody", "CalamityMod/Items/Accessories/ProfanedSoulTransArms"); AddEquipTexture(new ProfanedCrystalLegs(), null, EquipType.Legs, "ProviLegs", "CalamityMod/Items/Accessories/ProfanedSoulTransLegs"); AddEquipTexture(new ProfanedCrystalWings(), null, EquipType.Wings, "ProviWings", "CalamityMod/Items/Accessories/Wings/ProfanedSoulTransWings"); AddEquipTexture(new SnowRuffianWings(), null, EquipType.Wings, "SnowRuffWings", "CalamityMod/Items/Armor/SnowRuffianWings"); AstralCactusTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/Tiles/AstralCactus"); AstralCactusGlowTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/Tiles/AstralCactusGlow"); AstralSky = ModContent.GetTexture("CalamityMod/ExtraTextures/AstralSky"); CustomShader = GetEffect("Effects/CustomShader"); LightShader = GetEffect("Effects/LightBurstShader"); Filters.Scene["CalamityMod:DevourerofGodsHead"] = new Filter(new DoGScreenShaderData("FilterMiniTower").UseColor(0.4f, 0.1f, 1.0f).UseOpacity(0.5f), EffectPriority.VeryHigh); SkyManager.Instance["CalamityMod:DevourerofGodsHead"] = new DoGSky(); Filters.Scene["CalamityMod:DevourerofGodsHeadS"] = new Filter(new DoGScreenShaderDataS("FilterMiniTower").UseColor(0.4f, 0.1f, 1.0f).UseOpacity(0.5f), EffectPriority.VeryHigh); SkyManager.Instance["CalamityMod:DevourerofGodsHeadS"] = new DoGSkyS(); Filters.Scene["CalamityMod:CalamitasRun3"] = new Filter(new CalScreenShaderData("FilterMiniTower").UseColor(1.1f, 0.3f, 0.3f).UseOpacity(0.6f), EffectPriority.VeryHigh); SkyManager.Instance["CalamityMod:CalamitasRun3"] = new CalSky(); Filters.Scene["CalamityMod:PlaguebringerGoliath"] = new Filter(new PbGScreenShaderData("FilterMiniTower").UseColor(0.2f, 0.6f, 0.2f).UseOpacity(0.35f), EffectPriority.VeryHigh); SkyManager.Instance["CalamityMod:PlaguebringerGoliath"] = new PbGSky(); Filters.Scene["CalamityMod:Yharon"] = new Filter(new YScreenShaderData("FilterMiniTower").UseColor(1f, 0.4f, 0f).UseOpacity(0.75f), EffectPriority.VeryHigh); SkyManager.Instance["CalamityMod:Yharon"] = new YSky(); Filters.Scene["CalamityMod:Leviathan"] = new Filter(new LevScreenShaderData("FilterMiniTower").UseColor(0f, 0f, 0.5f).UseOpacity(0.5f), EffectPriority.VeryHigh); SkyManager.Instance["CalamityMod:Leviathan"] = new LevSky(); Filters.Scene["CalamityMod:Providence"] = new Filter(new ProvScreenShaderData("FilterMiniTower").UseColor(0.45f, 0.4f, 0.2f).UseOpacity(0.5f), EffectPriority.VeryHigh); SkyManager.Instance["CalamityMod:Providence"] = new ProvSky(); Filters.Scene["CalamityMod:SupremeCalamitas"] = new Filter(new SCalScreenShaderData("FilterMiniTower").UseColor(1.1f, 0.3f, 0.3f).UseOpacity(0.65f), EffectPriority.VeryHigh); SkyManager.Instance["CalamityMod:SupremeCalamitas"] = new SCalSky(); Filters.Scene["CalamityMod:Signus"] = new Filter(new SignusScreenShaderData("FilterMiniTower").UseColor(0.35f, 0.1f, 0.55f).UseOpacity(0.35f), EffectPriority.VeryHigh); SkyManager.Instance["CalamityMod:Signus"] = new SignusSky(); Filters.Scene["CalamityMod:Astral"] = new Filter(new AstralScreenShaderData(new Ref(CustomShader), "AstralPass").UseColor(0.18f, 0.08f, 0.24f), EffectPriority.VeryHigh); SkyManager.Instance["CalamityMod:Astral"] = new AstralSky(); Filters.Scene["CalamityMod:LightBurst"] = new Filter(new ScreenShaderData(new Ref(LightShader), "BurstPass"), EffectPriority.VeryHigh); Filters.Scene["CalamityMod:LightBurst"].Load(); RipperUI.Reset(); AstralArcanumUI.Load(this); GameShaders.Hair.BindShader(ModContent.ItemType(), new LegacyHairShaderData().UseLegacyMethod((Player player, Color newColor, ref bool lighting) => Color.Lerp(player.hairColor, new Color(0, 255, 171), ((float)player.Calamity().adrenaline / (float)player.Calamity().adrenalineMax)))); GameShaders.Hair.BindShader(ModContent.ItemType(), new LegacyHairShaderData().UseLegacyMethod((Player player, Color newColor, ref bool lighting) => Color.Lerp(player.hairColor, new Color(255, 83, 48), ((float)player.Calamity().rage / (float)player.Calamity().rageMax)))); GameShaders.Hair.BindShader(ModContent.ItemType(), new LegacyHairShaderData().UseLegacyMethod((Player player, Color newColor, ref bool lighting) => Color.Lerp(player.hairColor, new Color(139, 205, 255), ((float)player.wingTime / (float)player.wingTimeMax)))); } #endregion #region Unload public override void Unload() { NormalityRelocatorHotKey = null; RageHotKey = null; AdrenalineHotKey = null; AegisHotKey = null; TarraHotKey = null; AstralTeleportHotKey = null; AstralArcanumUIHotkey = null; MomentumCapacitatorHotkey = null; SandCloakHotkey = null; SpectralVeilHotKey = null; PlaguePackHotKey = null; AstralCactusTexture = null; AstralCactusGlowTexture = null; AstralSky = null; DRValues?.Clear(); DRValues = null; donatorList = null; rangedProjectileExceptionList = null; projectileDestroyExceptionList = null; projectileMinionList = null; enemyImmunityList = null; dungeonEnemyBuffList = null; dungeonProjectileBuffList = null; bossScaleList = null; bossHPScaleList = null; beeEnemyList = null; beeProjectileList = null; hardModeNerfList = null; debuffList = null; fireWeaponList = null; iceWeaponList = null; natureWeaponList = null; alcoholList = null; doubleDamageBuffList = null; sixtySixDamageBuffList = null; fiftyDamageBuffList = null; thirtyThreeDamageBuffList = null; twentyFiveDamageBuffList = null; weaponAutoreuseList = null; quarterDamageNerfList = null; pumpkinMoonBuffList = null; frostMoonBuffList = null; eclipseBuffList = null; eventProjectileBuffList = null; revengeanceEnemyBuffList25Percent = null; revengeanceEnemyBuffList20Percent = null; revengeanceEnemyBuffList15Percent = null; revengeanceEnemyBuffList10Percent = null; revengeanceEnemyBuffList5Percent = null; revengeanceProjectileBuffList25Percent = null; revengeanceProjectileBuffList20Percent = null; revengeanceProjectileBuffList15Percent = null; revengeanceProjectileBuffList10Percent = null; revengeanceProjectileBuffList5Percent = null; revengeanceLifeStealExceptionList = null; movementImpairImmuneList = null; trapProjectileList = null; scopedWeaponList = null; boomerangList = null; javelinList = null; daggerList = null; flaskBombList = null; spikyBallList = null; boomerangProjList = null; javelinProjList = null; daggerProjList = null; flaskBombProjList = null; spikyBallProjList = null; noGravityList = null; lavaFishList = null; highTestFishList = null; flamethrowerList = null; forceItemList = null; zombieList = null; demonEyeList = null; skeletonList = null; angryBonesList = null; hornetList = null; mossHornetList = null; legOverrideList = null; thorium = null; fargosMutant = false; CalamityConfig = null; instance = null; BossHealthBarManager.Unload(); base.Unload(); TileFraming.Unload(); RipperUI.Reset(); AstralArcanumUI.Unload(); base.Unload(); if (!Main.dedServ) { Main.heartTexture = heartOriginal2; Main.heart2Texture = heartOriginal; Main.rainTexture = rainOriginal; Main.manaTexture = manaOriginal; Main.flyingCarpetTexture = carpetOriginal; } heartOriginal2 = null; heartOriginal = null; rainOriginal = null; manaOriginal = null; carpetOriginal = null; } #endregion #region Late Loading public override void PostAddRecipes() { // This is placed here so that all tiles from all mods are guaranteed to be loaded at this point. TileFraming.Load(); } #endregion #region ConfigCrap internal static void SaveConfig(Configs CalamityConfig) { // in-game ModConfig saving from mod code is not supported yet in tmodloader, and subject to change, so we need to be extra careful. // This code only supports client configs, and doesn't call onchanged. It also doesn't support ReloadRequired or anything else. MethodInfo saveMethodInfo = typeof(ConfigManager).GetMethod("Save", BindingFlags.Static | BindingFlags.NonPublic); if (saveMethodInfo != null) saveMethodInfo.Invoke(null, new object[] { CalamityConfig }); else instance.Logger.Warn("In-game SaveConfig failed, code update required"); } #endregion #region SetupLists public static void SetupLists() { donatorList = new List() { "Vorbis", "SoloMael", "Chaotic Reks", "The Buildmonger", "Yuh", "Littlepiggy", "LompL", "Lilith Saintclaire", "Ben Shapiro", "Frederik Henschel", "Faye", "Gibb50", "Braden Hajer", "Hannes Holmlund", "profoundmango69", "Jack M Sargent", "Hans Volter", "Krankwagon", "MishiroUsui", "pixlgray", "Arkhine", "Lodude", "DevAesthetic", "Mister Winchester", "Zacky", "Veine", "Javyz", "Shifter", "Crysthamyr", "Elfinlocks", "Ein", "2Larry2", "Jenonen", "Dodu", "Arti", "Tervastator", "Luis Arguello", "Alexander Davis", "BakaQing", "Laura Coonrod", "Xaphlactus", "MajinBagel", "Bendy", "Rando Calrissian", "Tails the Fox 92", "Bread", "Minty Candy", "Preston Card", "MovingTarget_086", "Shiro", "Chip", "Taylor Riverpaw", "ShotgunAngel", "Sandblast", "ThomasThePencil", "Aero (Aero#4599)", "GlitchOut", "Daawnz", "CrabBar", "Yatagarasu", "Jarod Isaac Gordon", "Zombieh", "MingWhy", "Random Weeb", "Ahmed Fahad Zamel Al Sharif", "Eragon3942", "TheBlackHand", "william", "Samuel Foreman", "Christopher Pham", "DemoN K!ng", "Malik Ciaramella", "Ryan Baker-Ortiz", "Aleksanders Denisovs", "TheSilverGhost", "Lucazii", "Shay", "Prism", "BobIsNotMyRealName", "Guwahavel", "Azura", "Joshua Miranda", "Doveda", "William Chang", "Arche", "DevilSunrise", "Yanmei", "Chaos", "Ryan Tucker", "Fish Repairs", "Melvin Brouwers", "Vroomy Has -3,000 IQ", "The Goliath", "DaPyRo", "Termi", "Circuit-Jay", "Commmander Frostbite", "cytokat", "Cameron Fowlks", "Orudeon", "BumbleDoge", "John Ballard", "Naglfar", "Helixas", "Vetus Dea", "High Charity", "Devonte Plati", "Cerberus", "Brendan Kendall", "Victor Pittman", "KAT-G307", "Tombarry Expresserino", "Drip Veezy", "Glaid", "Apotheosis", "Bladesaber", "Devon Leigh", "Ruthoranium", "cocodezi_", "Mendzey", "GameRDheAsianSandwich", "Tobias", "Streakist .", "Eisaya A Cook", "Xenocrona", "RKMoon" }; rangedProjectileExceptionList = new List() { ProjectileID.Phantasm, ProjectileID.VortexBeater, ProjectileID.DD2PhoenixBow, ProjectileID.IchorDart, ProjectileID.PhantasmArrow, ProjectileID.RainbowBack, ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType() }; projectileDestroyExceptionList = new List() { //holdout projectiles ProjectileID.Phantasm, ProjectileID.VortexBeater, ProjectileID.DD2PhoenixBow, ProjectileID.LastPrism, ProjectileID.LaserMachinegun, ProjectileID.ChargedBlasterCannon, ProjectileID.MedusaHead, ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType() }; projectileMinionList = new List() { ProjectileID.PygmySpear, ProjectileID.UFOMinion, ProjectileID.UFOLaser, ProjectileID.StardustCellMinionShot, ProjectileID.MiniSharkron, ProjectileID.MiniRetinaLaser, ProjectileID.ImpFireball, ProjectileID.HornetStinger, ProjectileID.DD2FlameBurstTowerT1Shot, ProjectileID.DD2FlameBurstTowerT2Shot, ProjectileID.DD2FlameBurstTowerT3Shot, ProjectileID.DD2BallistraProj, ProjectileID.DD2ExplosiveTrapT1Explosion, ProjectileID.DD2ExplosiveTrapT2Explosion, ProjectileID.DD2ExplosiveTrapT3Explosion, ProjectileID.SpiderEgg, ProjectileID.BabySpider, ProjectileID.FrostBlastFriendly, ProjectileID.MoonlordTurretLaser, ProjectileID.RainbowCrystalExplosion }; enemyImmunityList = new List() { NPCID.KingSlime, NPCID.EaterofWorldsHead, NPCID.EaterofWorldsBody, NPCID.EaterofWorldsTail, NPCID.BrainofCthulhu, NPCID.Creeper, NPCID.EyeofCthulhu, NPCID.QueenBee, NPCID.SkeletronHead, NPCID.SkeletronHand, NPCID.WallofFlesh, NPCID.WallofFleshEye, NPCID.Retinazer, NPCID.Spazmatism, NPCID.SkeletronPrime, NPCID.PrimeCannon, NPCID.PrimeSaw, NPCID.PrimeLaser, NPCID.PrimeVice, NPCID.Plantera, NPCID.IceQueen, NPCID.Pumpking, NPCID.Mothron, NPCID.Golem, NPCID.GolemHead, NPCID.GolemHeadFree, NPCID.GolemFistRight, NPCID.GolemFistLeft, NPCID.GolemHeadFree, NPCID.DukeFishron, NPCID.Sharkron, NPCID.Sharkron2, NPCID.CultistBoss, NPCID.MoonLordHead, NPCID.MoonLordHand, NPCID.MoonLordCore, NPCID.MoonLordFreeEye, NPCID.DD2WyvernT1, NPCID.DD2WyvernT2, NPCID.DD2WyvernT3, NPCID.DD2DarkMageT1, NPCID.DD2DarkMageT3, NPCID.DD2SkeletonT1, NPCID.DD2SkeletonT3, NPCID.DD2WitherBeastT2, NPCID.DD2WitherBeastT3, NPCID.DD2DrakinT2, NPCID.DD2DrakinT3, NPCID.DD2KoboldWalkerT2, NPCID.DD2KoboldWalkerT3, NPCID.DD2KoboldFlyerT2, NPCID.DD2KoboldFlyerT3, NPCID.DD2OgreT2, NPCID.DD2OgreT3, NPCID.DD2Betsy, ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() //brothers }; dungeonEnemyBuffList = new List() { NPCID.SkeletonSniper, NPCID.TacticalSkeleton, NPCID.SkeletonCommando, NPCID.Paladin, NPCID.GiantCursedSkull, NPCID.BoneLee, NPCID.DiabolistWhite, NPCID.DiabolistRed, NPCID.NecromancerArmored, NPCID.Necromancer, NPCID.RaggedCasterOpenCoat, NPCID.RaggedCaster, NPCID.HellArmoredBonesSword, NPCID.HellArmoredBonesMace, NPCID.HellArmoredBonesSpikeShield, NPCID.HellArmoredBones, NPCID.BlueArmoredBonesSword, NPCID.BlueArmoredBonesNoPants, NPCID.BlueArmoredBonesMace, NPCID.BlueArmoredBones, NPCID.RustyArmoredBonesSwordNoArmor, NPCID.RustyArmoredBonesSword, NPCID.RustyArmoredBonesFlail, NPCID.RustyArmoredBonesAxe }; dungeonProjectileBuffList = new List() { ProjectileID.PaladinsHammerHostile, ProjectileID.ShadowBeamHostile, ProjectileID.InfernoHostileBolt, ProjectileID.InfernoHostileBlast, ProjectileID.LostSoulHostile, ProjectileID.SniperBullet, ProjectileID.RocketSkeleton, ProjectileID.BulletDeadeye, ProjectileID.Shadowflames }; bossScaleList = new List() { NPCID.EaterofWorldsHead, NPCID.EaterofWorldsBody, NPCID.EaterofWorldsTail, NPCID.Creeper, NPCID.SkeletronHand, NPCID.WallofFleshEye, NPCID.TheHungry, NPCID.TheHungryII, NPCID.TheDestroyerBody, NPCID.TheDestroyerTail, NPCID.PrimeCannon, NPCID.PrimeVice, NPCID.PrimeSaw, NPCID.PrimeLaser, NPCID.PlanterasTentacle, NPCID.Pumpking, NPCID.IceQueen, NPCID.Mothron, NPCID.GolemHead }; bossHPScaleList = new List() { NPCID.EaterofWorldsHead, NPCID.EaterofWorldsBody, NPCID.EaterofWorldsTail, NPCID.SkeletronHand, NPCID.WallofFleshEye, NPCID.TheDestroyerBody, NPCID.TheDestroyerTail, NPCID.PrimeCannon, NPCID.PrimeLaser, NPCID.PrimeVice, NPCID.PrimeSaw, NPCID.GolemHead, NPCID.GolemHeadFree, NPCID.GolemFistRight, NPCID.GolemFistLeft, NPCID.MoonLordHead, NPCID.MoonLordHand }; beeEnemyList = new List() { NPCID.GiantMossHornet, NPCID.BigMossHornet, NPCID.LittleMossHornet, NPCID.TinyMossHornet, NPCID.MossHornet, NPCID.VortexHornetQueen, NPCID.VortexHornet, NPCID.Bee, NPCID.BeeSmall, NPCID.QueenBee, ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }; beeProjectileList = new List() { ProjectileID.Stinger, ProjectileID.HornetStinger, ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType() }; hardModeNerfList = new List() { ProjectileID.WebSpit, ProjectileID.PinkLaser, ProjectileID.FrostBlastHostile, ProjectileID.RuneBlast, ProjectileID.GoldenShowerHostile, ProjectileID.RainNimbus, ProjectileID.Stinger, ProjectileID.FlamingArrow, ProjectileID.BulletDeadeye, ProjectileID.CannonballHostile }; debuffList = new List() { 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.OgreSpit, BuffID.BetsysCurse, ModContent.BuffType(), ModContent.BuffType(), ModContent.BuffType(), ModContent.BuffType(), ModContent.BuffType(), ModContent.BuffType(), ModContent.BuffType(), ModContent.BuffType(), ModContent.BuffType(), ModContent.BuffType(), ModContent.BuffType(), ModContent.BuffType(), ModContent.BuffType(), ModContent.BuffType(), ModContent.BuffType(), ModContent.BuffType(), ModContent.BuffType() }; fireWeaponList = new List() { ItemID.FieryGreatsword, ItemID.DD2SquireDemonSword, ItemID.TheHorsemansBlade, ItemID.Cascade, ItemID.HelFire, ItemID.Flamarang, ItemID.MoltenFury, ItemID.Sunfury, ItemID.PhoenixBlaster, ItemID.Flamelash, ItemID.SolarEruption, ItemID.DayBreak, ItemID.HellwingBow, ItemID.DD2PhoenixBow, ItemID.DD2BetsyBow, ItemID.FlareGun, ItemID.Flamethrower, ItemID.EldMelter, ItemID.FlowerofFire, ItemID.MeteorStaff, ItemID.ApprenticeStaffT3, ItemID.InfernoFork, ItemID.HeatRay, ItemID.BookofSkulls, ItemID.ImpStaff, ItemID.DD2FlameburstTowerT1Popper, ItemID.DD2FlameburstTowerT2Popper, ItemID.DD2FlameburstTowerT3Popper, ItemID.MolotovCocktail, ItemID.WandofSparking, ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType() }; iceWeaponList = new List() { ItemID.IceBlade, ItemID.IceSickle, ItemID.Frostbrand, ItemID.Amarok, ItemID.NorthPole, ItemID.IceBoomerang, ItemID.IceBow, ItemID.SnowmanCannon, ItemID.SnowballCannon, ItemID.IceRod, ItemID.FlowerofFrost, ItemID.FrostStaff, ItemID.BlizzardStaff, ItemID.StaffoftheFrostHydra, ItemID.Snowball, ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), //Cryonic Bar set stuff, could potentially be removed ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType() }; natureWeaponList = new List() { ItemID.BladeofGrass, ItemID.ChlorophyteClaymore, ItemID.ChlorophyteSaber, ItemID.ChlorophytePartisan, ItemID.ChlorophyteShotbow, ItemID.Seedler, ItemID.ChristmasTreeSword, ItemID.TerraBlade, ItemID.JungleYoyo, ItemID.Yelets, ItemID.MushroomSpear, ItemID.ThornChakram, ItemID.Bananarang, ItemID.FlowerPow, ItemID.BeesKnees, ItemID.Toxikarp, ItemID.Bladetongue, ItemID.PoisonStaff, ItemID.VenomStaff, ItemID.StaffofEarth, ItemID.BeeGun, ItemID.LeafBlower, ItemID.WaspGun, ItemID.CrystalSerpent, ItemID.Razorpine, ItemID.HornetStaff, ItemID.QueenSpiderStaff, ItemID.SlimeStaff, ItemID.PygmyStaff, ItemID.RavenStaff, ItemID.BatScepter, ItemID.SpiderStaff, ItemID.Beenade, ItemID.FrostDaggerfish, ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType() }; alcoholList = new List() { ModContent.BuffType(), ModContent.BuffType(), ModContent.BuffType(), ModContent.BuffType(), ModContent.BuffType(), ModContent.BuffType(), ModContent.BuffType(), ModContent.BuffType(), ModContent.BuffType(), ModContent.BuffType(), ModContent.BuffType(), ModContent.BuffType(), ModContent.BuffType(), ModContent.BuffType(), ModContent.BuffType(), ModContent.BuffType(), ModContent.BuffType(), ModContent.BuffType(), ModContent.BuffType() }; doubleDamageBuffList = new List() { ItemID.BallOHurt, ItemID.TheMeatball, ItemID.BlueMoon, ItemID.Sunfury, ItemID.DaoofPow, ItemID.FlowerPow, ItemID.Anchor, ItemID.KOCannon, ItemID.GolemFist, ItemID.BreakerBlade, ItemID.MonkStaffT2, ItemID.ProximityMineLauncher, ItemID.FireworksLauncher }; sixtySixDamageBuffList = new List() { ItemID.TrueNightsEdge, ItemID.MedusaHead, ItemID.StaffofEarth, ItemID.ChristmasTreeSword, ItemID.MonkStaffT1, ItemID.InfernoFork, ItemID.VenomStaff, ItemID.Frostbrand }; fiftyDamageBuffList = new List() { ItemID.NightsEdge, ItemID.EldMelter, ItemID.Flamethrower, ItemID.MoonlordTurretStaff, ItemID.WaspGun, ItemID.Keybrand, ItemID.PulseBow, ItemID.PaladinsHammer }; thirtyThreeDamageBuffList = new List() { ItemID.WandofSparking, ItemID.IceBow, ItemID.Marrow, ItemID.CrystalVileShard, ItemID.SoulDrain, ItemID.ClingerStaff, ItemID.ChargedBlasterCannon, ItemID.NettleBurst, ItemID.Excalibur, ItemID.AmberStaff, ItemID.BluePhasesaber, ItemID.RedPhasesaber, ItemID.GreenPhasesaber, ItemID.WhitePhasesaber, ItemID.YellowPhasesaber, ItemID.PurplePhasesaber, ItemID.TheRottedFork, ItemID.VampireKnives, ItemID.Cascade, ItemID.TrueExcalibur }; twentyFiveDamageBuffList = new List() { ItemID.Muramasa, ItemID.StakeLauncher, ItemID.BookStaff }; twentyDamageBuffList = new List() { ItemID.TerraBlade, ItemID.ChainGuillotines, ItemID.FlowerofFrost, ItemID.PoisonStaff, ItemID.Gungnir, ItemID.TacticalShotgun }; weaponAutoreuseList = new List() { ItemID.NightsEdge, ItemID.TrueNightsEdge, ItemID.TrueExcalibur, ItemID.PhoenixBlaster, ItemID.VenusMagnum, ItemID.MagicDagger, ItemID.BeamSword, ItemID.MonkStaffT2, ItemID.PaladinsHammer, ItemID.PearlwoodSword, ItemID.PearlwoodBow, ItemID.TaxCollectorsStickOfDoom, ItemID.StylistKilLaKillScissorsIWish }; quarterDamageNerfList = new List() { ItemID.DaedalusStormbow, ItemID.PhoenixBlaster, ItemID.VenusMagnum, ItemID.BlizzardStaff, ItemID.DD2BetsyBow }; pumpkinMoonBuffList = new List() { NPCID.Scarecrow1, NPCID.Scarecrow2, NPCID.Scarecrow3, NPCID.Scarecrow4, NPCID.Scarecrow5, NPCID.Scarecrow6, NPCID.Scarecrow7, NPCID.Scarecrow8, NPCID.Scarecrow9, NPCID.Scarecrow10, NPCID.HeadlessHorseman, NPCID.MourningWood, NPCID.Splinterling, NPCID.Pumpking, NPCID.PumpkingBlade, NPCID.Hellhound, NPCID.Poltergeist }; frostMoonBuffList = new List() { NPCID.ZombieElf, NPCID.ZombieElfBeard, NPCID.ZombieElfGirl, NPCID.PresentMimic, NPCID.GingerbreadMan, NPCID.Yeti, NPCID.Everscream, NPCID.IceQueen, NPCID.SantaNK1, NPCID.ElfCopter, NPCID.Nutcracker, NPCID.NutcrackerSpinning, NPCID.ElfArcher, NPCID.Krampus, NPCID.Flocko }; eclipseBuffList = new List() { NPCID.Eyezor, NPCID.Reaper, NPCID.Frankenstein, NPCID.SwampThing, NPCID.Vampire, NPCID.VampireBat, NPCID.Butcher, NPCID.CreatureFromTheDeep, NPCID.Fritz, NPCID.Nailhead, NPCID.Psycho, NPCID.DeadlySphere, NPCID.DrManFly, NPCID.ThePossessed, NPCID.Mothron, NPCID.MothronEgg, NPCID.MothronSpawn }; eventProjectileBuffList = new List() { ProjectileID.FlamingWood, ProjectileID.GreekFire1, ProjectileID.GreekFire2, ProjectileID.GreekFire3, ProjectileID.FlamingScythe, ProjectileID.FlamingArrow, ProjectileID.PineNeedleHostile, ProjectileID.OrnamentHostile, ProjectileID.OrnamentHostileShrapnel, ProjectileID.FrostWave, ProjectileID.FrostShard, ProjectileID.Missile, ProjectileID.Present, ProjectileID.Spike, ProjectileID.BulletDeadeye, ProjectileID.EyeLaser, ProjectileID.Nail, ProjectileID.DrManFlyFlask }; // Enemies that inflict an average of 1 to 50 damage in Expert Mode revengeanceEnemyBuffList25Percent = new List() { NPCID.ServantofCthulhu, NPCID.EyeofCthulhu, NPCID.EaterofWorldsHead, NPCID.EaterofWorldsBody, NPCID.EaterofWorldsTail, NPCID.Creeper, NPCID.Bee, NPCID.BeeSmall, NPCID.SkeletronHand, NPCID.GiantWormHead, NPCID.BlazingWheel, ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }; // Enemies that inflict an average of 51 to 100 damage in Expert Mode revengeanceEnemyBuffList20Percent = new List() { NPCID.KingSlime, NPCID.BrainofCthulhu, NPCID.QueenBee, NPCID.SkeletronHead, NPCID.TheHungryII, NPCID.LeechHead, NPCID.TheDestroyerBody, NPCID.TheDestroyerTail, NPCID.Probe, NPCID.PrimeSaw, NPCID.PrimeVice, NPCID.PrimeLaser, NPCID.PrimeCannon, NPCID.DevourerHead, NPCID.MeteorHead, NPCID.BoneSerpentHead, NPCID.ManEater, NPCID.Snatcher, NPCID.Piranha, NPCID.Shark, NPCID.SpikeBall, NPCID.DiggerHead, NPCID.WallCreeper, NPCID.WallCreeperWall, NPCID.Lihzahrd, NPCID.Pumpking, NPCID.SlimeSpiked, ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }; // Enemies that inflict an average of 101 to 200 damage in Expert Mode revengeanceEnemyBuffList15Percent = new List() { NPCID.WallofFlesh, NPCID.Spazmatism, NPCID.Retinazer, NPCID.SkeletronPrime, NPCID.Plantera, NPCID.PlanterasTentacle, NPCID.Spore, NPCID.DetonatingBubble, NPCID.Golem, NPCID.GolemHead, NPCID.GolemHeadFree, NPCID.GolemFistLeft, NPCID.GolemFistRight, NPCID.DukeFishron, NPCID.Sharkron, NPCID.Sharkron2, NPCID.CultistDragonHead, NPCID.AncientCultistSquidhead, NPCID.AncientLight, NPCID.DD2Betsy, NPCID.Mimic, NPCID.WyvernHead, NPCID.SeekerHead, NPCID.AnglerFish, NPCID.Werewolf, NPCID.Wraith, NPCID.Arapaima, NPCID.BlackRecluse, NPCID.BlackRecluseWall, NPCID.AngryTrapper, NPCID.LihzahrdCrawler, NPCID.PirateCaptain, NPCID.FlyingSnake, NPCID.Reaper, NPCID.Paladin, NPCID.BoneLee, NPCID.MourningWood, NPCID.PumpkingBlade, NPCID.PresentMimic, NPCID.Everscream, NPCID.IceQueen, NPCID.SantaNK1, NPCID.StardustWormHead, NPCID.Butcher, NPCID.Psycho, NPCID.DeadlySphere, NPCID.BigMimicCorruption, NPCID.BigMimicCrimson, NPCID.BigMimicHallow, NPCID.Mothron, NPCID.DuneSplicerHead, NPCID.SandShark, NPCID.SandsharkCorrupt, NPCID.SandsharkCrimson, NPCID.SandsharkHallow, ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }; // Enemies that inflict an average of 201 to 400 damage in Expert Mode revengeanceEnemyBuffList10Percent = new List() { NPCID.TheDestroyer, NPCID.SolarCrawltipedeHead, ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }; // Enemies that inflict an average of 401+ damage in Expert Mode revengeanceEnemyBuffList5Percent = new List() { ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }; revengeanceProjectileBuffList25Percent = new List() { ProjectileID.SandBallFalling, ProjectileID.AshBallFalling, ProjectileID.EbonsandBallFalling, ProjectileID.PearlSandBallFalling, ProjectileID.CrimsandBallFalling, ProjectileID.GeyserTrap, ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType() }; revengeanceProjectileBuffList20Percent = new List() { ProjectileID.PoisonDartTrap, ProjectileID.DemonSickle, ProjectileID.SandnadoHostile, ProjectileID.DD2BetsyFireball, ProjectileID.DD2BetsyFlameBreath, ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType() }; revengeanceProjectileBuffList15Percent = new List() { ProjectileID.SpikyBallTrap, ProjectileID.SpearTrap, ProjectileID.FlamethrowerTrap, ProjectileID.FlamesTrap, ProjectileID.Fireball, ProjectileID.PaladinsHammerHostile, ProjectileID.FlamingWood, ProjectileID.FlamingScythe, ProjectileID.FrostWave, ProjectileID.Present, ProjectileID.Spike, ProjectileID.SaucerDeathray, ProjectileID.NebulaBolt, ProjectileID.NebulaSphere, ProjectileID.NebulaLaser, ProjectileID.StardustSoldierLaser, ProjectileID.VortexLaser, ProjectileID.VortexVortexLightning, ProjectileID.VortexLightning, ProjectileID.VortexAcid, ProjectileID.Sharknado, ProjectileID.Cthulunado, ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType() }; revengeanceProjectileBuffList10Percent = new List() { ProjectileID.Boulder, ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType() }; revengeanceProjectileBuffList5Percent = new List() { ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType() }; revengeanceLifeStealExceptionList = new List() { NPCID.Probe, NPCID.CultistDragonHead, NPCID.CultistDragonBody1, NPCID.CultistDragonBody2, NPCID.CultistDragonBody3, NPCID.CultistDragonBody4, NPCID.CultistDragonTail, NPCID.AncientCultistSquidhead, NPCID.AncientLight, NPCID.Sharkron, NPCID.Sharkron2, NPCID.PlanterasTentacle, NPCID.Spore, NPCID.TheHungryII, NPCID.LeechHead, NPCID.LeechBody, NPCID.LeechTail, NPCID.TheDestroyerBody, NPCID.TheDestroyerTail, NPCID.EaterofWorldsBody, NPCID.EaterofWorldsTail, NPCID.GolemHead, NPCID.GolemHeadFree, NPCID.GolemFistRight, NPCID.GolemFistLeft, NPCID.MoonLordCore }; movementImpairImmuneList = new List() { NPCID.QueenBee, }; trapProjectileList = new List() { ProjectileID.PoisonDartTrap, ProjectileID.SpikyBallTrap, ProjectileID.SpearTrap, ProjectileID.FlamethrowerTrap, ProjectileID.FlamesTrap, ProjectileID.PoisonDart, ProjectileID.GeyserTrap }; scopedWeaponList = new List() { ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType() }; boomerangList = new List() { ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType() }; boomerangProjList = new List() { ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType() }; javelinList = new List() { ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType() }; javelinProjList = new List() { ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType() }; daggerList = new List() { ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType() }; daggerProjList = new List() { ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType() }; flaskBombList = new List() { ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType() }; flaskBombProjList = new List() { ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType() }; spikyBallList = new List() { ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType() }; spikyBallProjList = new List() { ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType() }; noGravityList = new List() { ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), }; lavaFishList = new List() { ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType() }; highTestFishList = new List() { ItemID.GoldenFishingRod, ModContent.ItemType(), ModContent.ItemType() }; flamethrowerList = new List() { ModContent.ItemType(), ModContent.ItemType() }; forceItemList = new List() { ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ItemID.HotlineFishingHook, ItemID.BottomlessBucket, ItemID.SuperAbsorbantSponge, ItemID.FishingPotion, ItemID.SonarPotion, ItemID.CratePotion, ItemID.AnglerTackleBag, ItemID.HighTestFishingLine, ItemID.TackleBox, ItemID.AnglerEarring, ItemID.FishermansGuide, ItemID.WeatherRadio, ItemID.Sextant, ItemID.AnglerHat, ItemID.AnglerVest, ItemID.AnglerPants, ItemID.GoldenBugNet, ItemID.FishronWings, ItemID.Flairon, ItemID.Tsunami, ItemID.BubbleGun, ItemID.RazorbladeTyphoon, ItemID.TempestStaff, ItemID.FishronBossBag, ItemID.Coral, ItemID.Seashell, ItemID.Starfish, ItemID.SoulofSight, ItemID.GreaterHealingPotion, ItemID.SuperHealingPotion }; zombieList = new List() { NPCID.Zombie, NPCID.ArmedZombie, NPCID.BaldZombie, NPCID.PincushionZombie, NPCID.ArmedZombiePincussion, // what is this spelling NPCID.SlimedZombie, NPCID.ArmedZombieSlimed, NPCID.SwampZombie, NPCID.ArmedZombieSwamp, NPCID.TwiggyZombie, NPCID.ArmedZombieTwiggy, NPCID.FemaleZombie, NPCID.ArmedZombieCenx, NPCID.ZombieRaincoat, NPCID.ZombieEskimo, NPCID.ArmedZombieEskimo // halloween zombies not included because they don't drop shackles or zombie arms }; demonEyeList = new List() { NPCID.DemonEye, NPCID.CataractEye, NPCID.SleepyEye, NPCID.DialatedEye, // it is spelled "dilated" NPCID.GreenEye, NPCID.PurpleEye, NPCID.DemonEyeOwl, NPCID.DemonEyeSpaceship }; skeletonList = new List() { NPCID.Skeleton, NPCID.ArmoredSkeleton, NPCID.SkeletonArcher, NPCID.HeadacheSkeleton, NPCID.MisassembledSkeleton, NPCID.PantlessSkeleton, NPCID.SkeletonTopHat, NPCID.SkeletonAstonaut, NPCID.SkeletonAlien, NPCID.BoneThrowingSkeleton, NPCID.BoneThrowingSkeleton2, NPCID.BoneThrowingSkeleton3, NPCID.BoneThrowingSkeleton4, NPCID.GreekSkeleton }; angryBonesList = new List() { NPCID.AngryBones, NPCID.AngryBonesBig, NPCID.AngryBonesBigMuscle, NPCID.AngryBonesBigHelmet }; hornetList = new List() { NPCID.Hornet, NPCID.HornetFatty, NPCID.HornetHoney, NPCID.HornetLeafy, NPCID.HornetSpikey, NPCID.HornetStingy }; mossHornetList = new List() { NPCID.MossHornet, NPCID.TinyMossHornet, NPCID.LittleMossHornet, NPCID.BigMossHornet, NPCID.GiantMossHornet }; Mod thorium = ModLoader.GetMod("ThoriumMod"); if (CalamityMod.CalamityConfig.RevengeanceAndDeathThoriumBossBuff && thorium != null) { enemyImmunityList.Add(thorium.NPCType("TheGrandThunderBirdv2")); enemyImmunityList.Add(thorium.NPCType("QueenJelly")); enemyImmunityList.Add(thorium.NPCType("Viscount")); enemyImmunityList.Add(thorium.NPCType("GraniteEnergyStorm")); enemyImmunityList.Add(thorium.NPCType("TheBuriedWarrior")); enemyImmunityList.Add(thorium.NPCType("ThePrimeScouter")); enemyImmunityList.Add(thorium.NPCType("BoreanStrider")); enemyImmunityList.Add(thorium.NPCType("BoreanStriderPopped")); enemyImmunityList.Add(thorium.NPCType("FallenDeathBeholder")); enemyImmunityList.Add(thorium.NPCType("FallenDeathBeholder2")); enemyImmunityList.Add(thorium.NPCType("Lich")); enemyImmunityList.Add(thorium.NPCType("LichHeadless")); enemyImmunityList.Add(thorium.NPCType("Abyssion")); enemyImmunityList.Add(thorium.NPCType("AbyssionCracked")); enemyImmunityList.Add(thorium.NPCType("AbyssionReleased")); enemyImmunityList.Add(thorium.NPCType("SlagFury")); enemyImmunityList.Add(thorium.NPCType("Omnicide")); enemyImmunityList.Add(thorium.NPCType("RealityBreaker")); enemyImmunityList.Add(thorium.NPCType("Aquaius")); enemyImmunityList.Add(thorium.NPCType("Aquaius2")); revengeanceEnemyBuffList25Percent.Add(thorium.NPCType("TheGrandThunderBirdv2")); revengeanceEnemyBuffList25Percent.Add(thorium.NPCType("QueenJelly")); revengeanceEnemyBuffList20Percent.Add(thorium.NPCType("Viscount")); revengeanceEnemyBuffList20Percent.Add(thorium.NPCType("GraniteEnergyStorm")); revengeanceEnemyBuffList20Percent.Add(thorium.NPCType("TheBuriedWarrior")); revengeanceEnemyBuffList20Percent.Add(thorium.NPCType("ThePrimeScouter")); revengeanceEnemyBuffList20Percent.Add(thorium.NPCType("BoreanStrider")); revengeanceEnemyBuffList20Percent.Add(thorium.NPCType("BoreanStriderPopped")); revengeanceEnemyBuffList15Percent.Add(thorium.NPCType("FallenDeathBeholder")); revengeanceEnemyBuffList15Percent.Add(thorium.NPCType("FallenDeathBeholder2")); revengeanceEnemyBuffList15Percent.Add(thorium.NPCType("Lich")); revengeanceEnemyBuffList15Percent.Add(thorium.NPCType("LichHeadless")); revengeanceEnemyBuffList15Percent.Add(thorium.NPCType("Abyssion")); revengeanceEnemyBuffList15Percent.Add(thorium.NPCType("AbyssionCracked")); revengeanceEnemyBuffList15Percent.Add(thorium.NPCType("AbyssionReleased")); revengeanceEnemyBuffList15Percent.Add(thorium.NPCType("SlagFury")); revengeanceEnemyBuffList15Percent.Add(thorium.NPCType("Omnicide")); revengeanceEnemyBuffList15Percent.Add(thorium.NPCType("RealityBreaker")); revengeanceEnemyBuffList15Percent.Add(thorium.NPCType("Aquaius")); revengeanceEnemyBuffList15Percent.Add(thorium.NPCType("Aquaius2")); revengeanceProjectileBuffList25Percent.Add(thorium.ProjectileType("GrandThunderBirdZap")); revengeanceProjectileBuffList25Percent.Add(thorium.ProjectileType("ThunderGust")); revengeanceProjectileBuffList25Percent.Add(thorium.ProjectileType("BubbleBomb")); revengeanceProjectileBuffList25Percent.Add(thorium.ProjectileType("QueenJellyArm")); revengeanceProjectileBuffList25Percent.Add(thorium.ProjectileType("QueenTorrent")); revengeanceProjectileBuffList20Percent.Add(thorium.ProjectileType("ViscountRipple")); revengeanceProjectileBuffList20Percent.Add(thorium.ProjectileType("ViscountRipple2")); revengeanceProjectileBuffList20Percent.Add(thorium.ProjectileType("ViscountBlood")); revengeanceProjectileBuffList20Percent.Add(thorium.ProjectileType("ViscountStomp")); revengeanceProjectileBuffList20Percent.Add(thorium.ProjectileType("ViscountStomp2")); revengeanceProjectileBuffList20Percent.Add(thorium.ProjectileType("ViscountRockFall")); revengeanceProjectileBuffList20Percent.Add(thorium.ProjectileType("GraniteCharge")); revengeanceProjectileBuffList20Percent.Add(thorium.ProjectileType("BuriedShock")); revengeanceProjectileBuffList20Percent.Add(thorium.ProjectileType("BuriedDagger")); revengeanceProjectileBuffList20Percent.Add(thorium.ProjectileType("BuriedArrow")); revengeanceProjectileBuffList20Percent.Add(thorium.ProjectileType("BuriedArrow2")); revengeanceProjectileBuffList20Percent.Add(thorium.ProjectileType("BuriedArrowF")); revengeanceProjectileBuffList20Percent.Add(thorium.ProjectileType("BuriedArrowP")); revengeanceProjectileBuffList20Percent.Add(thorium.ProjectileType("BuriedArrowC")); revengeanceProjectileBuffList20Percent.Add(thorium.ProjectileType("BuriedMagic")); revengeanceProjectileBuffList20Percent.Add(thorium.ProjectileType("BuriedMagicPop")); revengeanceProjectileBuffList20Percent.Add(thorium.ProjectileType("MainBeamOuter")); revengeanceProjectileBuffList20Percent.Add(thorium.ProjectileType("MainBeam")); revengeanceProjectileBuffList20Percent.Add(thorium.ProjectileType("MainBeamCheese")); revengeanceProjectileBuffList20Percent.Add(thorium.ProjectileType("VaporizeBlast")); revengeanceProjectileBuffList20Percent.Add(thorium.ProjectileType("GravitonSurge")); revengeanceProjectileBuffList20Percent.Add(thorium.ProjectileType("Vaporize")); revengeanceProjectileBuffList20Percent.Add(thorium.ProjectileType("GravitonCharge")); revengeanceProjectileBuffList20Percent.Add(thorium.ProjectileType("GravitySpark")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("DoomBeholderBeam")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("VoidLaserPro")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("BeholderBeam")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("BlizzardBarrage")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("FrostSurge")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("FrostSurgeR")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("BlizzardCascade")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("BlizzardBoom")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("BlizzardFang")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("FrostMytePro")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("IceAnomaly")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("LichGaze")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("LichGazeB")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("LichFlareSpawn")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("LichFlare")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("LichPulse")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("LichMatter")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("SoulRenderLich")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("LichFlareDeathD")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("LichFlareDeathU")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("Whirlpool")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("AbyssionSpit")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("AbyssionSpit2")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("AquaRipple")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("AbyssalStrike2")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("OldGodSpit")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("OldGodSpit2")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("WaterPulse")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("TyphoonBlastHostile")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("TyphoonBlastHostileSmaller")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("AquaBarrage")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("DeathRaySpawnR")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("DeathRaySpawnL")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("DeathRaySpawn")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("OmniDeath")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("OmniSphereOrb")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("FlameLash")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("FlamePulse")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("FlamePulseTorn")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("FlameNova")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("MoltenFury")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("RealityFury")); revengeanceProjectileBuffList15Percent.Add(thorium.ProjectileType("UFOBlast")); } legOverrideList = new List() { instance.GetEquipSlot("ProviLegs", EquipType.Legs), instance.GetEquipSlot("SirenLegAlt", EquipType.Legs), instance.GetEquipSlot("SirenLeg", EquipType.Legs), instance.GetEquipSlot("PopoLeg", EquipType.Legs) }; } #endregion #region Vanilla Enemy DR private void SetupVanillaDR() { DRValues = new SortedDictionary { { NPCID.AngryBonesBig, 0.2f }, { NPCID.AngryBonesBigHelmet, 0.2f }, { NPCID.AngryBonesBigMuscle, 0.2f }, { NPCID.AnomuraFungus, 0.1f }, { NPCID.Antlion, 0.1f }, { NPCID.Arapaima, 0.1f }, { NPCID.ArmoredSkeleton, 0.15f }, { NPCID.ArmoredViking, 0.1f }, { NPCID.BigMimicCorruption, 0.3f }, { NPCID.BigMimicCrimson, 0.3f }, { NPCID.BigMimicHallow, 0.3f }, { NPCID.BigMimicJungle, 0.3f }, // unused vanilla enemy { NPCID.BlueArmoredBones, 0.2f }, { NPCID.BlueArmoredBonesMace, 0.2f }, { NPCID.BlueArmoredBonesNoPants, 0.2f }, { NPCID.BlueArmoredBonesSword, 0.2f }, { NPCID.BoneLee, 0.2f }, { NPCID.Crab, 0.05f }, { NPCID.Crawdad, 0.2f }, { NPCID.Crawdad2, 0.2f }, { NPCID.CultistBoss, 0.05f }, { NPCID.DD2Betsy, 0.1f }, { NPCID.DD2OgreT2, 0.1f }, { NPCID.DD2OgreT3, 0.15f }, { NPCID.DeadlySphere, 0.4f }, { NPCID.DiabolistRed, 0.2f }, { NPCID.DiabolistWhite, 0.2f }, { NPCID.DungeonGuardian, 0.999999f }, { NPCID.DungeonSpirit, 0.2f }, { NPCID.ElfCopter, 0.15f }, { NPCID.Everscream, 0.1f }, { NPCID.FlyingAntlion, 0.05f }, { NPCID.GiantCursedSkull, 0.2f }, { NPCID.GiantShelly, 0.2f }, { NPCID.GiantShelly2, 0.2f }, { NPCID.GiantTortoise, 0.35f }, { NPCID.Golem, 0.25f }, { NPCID.GolemFistLeft, 0.25f }, { NPCID.GolemFistRight, 0.25f }, { NPCID.GolemHead, 0.25f }, { NPCID.GolemHeadFree, 0.25f }, { NPCID.GraniteFlyer, 0.1f }, { NPCID.GraniteGolem, 0.15f }, { NPCID.GreekSkeleton, 0.1f }, { NPCID.HellArmoredBones, 0.2f }, { NPCID.HellArmoredBonesMace, 0.2f }, { NPCID.HellArmoredBonesSpikeShield, 0.2f }, { NPCID.HellArmoredBonesSword, 0.2f }, { NPCID.IceGolem, 0.1f }, { NPCID.IceQueen, 0.1f }, { NPCID.IceTortoise, 0.35f }, { NPCID.HeadlessHorseman, 0.05f }, { NPCID.MartianDrone, 0.2f }, { NPCID.MartianSaucer, 0.2f }, { NPCID.MartianSaucerCannon, 0.2f }, { NPCID.MartianSaucerCore, 0.2f }, { NPCID.MartianSaucerTurret, 0.2f }, { NPCID.MartianTurret, 0.2f }, { NPCID.MartianWalker, 0.35f }, { NPCID.Mimic, 0.3f }, { NPCID.MoonLordCore, 0.05f }, { NPCID.MoonLordHand, 0.05f }, { NPCID.MoonLordHead, 0.05f }, { NPCID.Mothron, 0.2f }, { NPCID.MothronEgg, 0.5f }, { NPCID.MourningWood, 0.1f }, { NPCID.Necromancer, 0.2f }, { NPCID.NecromancerArmored, 0.2f }, { NPCID.Paladin, 0.45f }, { NPCID.PirateCaptain, 0.05f }, { NPCID.PirateShipCannon, 0.15f }, { NPCID.PossessedArmor, 0.25f }, { NPCID.PresentMimic, 0.3f }, { NPCID.PrimeCannon, 0.2f }, { NPCID.PrimeLaser, 0.2f }, { NPCID.PrimeSaw, 0.2f }, { NPCID.PrimeVice, 0.2f }, { NPCID.Probe, 0.2f }, { NPCID.Pumpking, 0.1f }, { NPCID.QueenBee, 0.05f }, { NPCID.RaggedCaster, 0.2f }, { NPCID.RaggedCasterOpenCoat, 0.2f }, { NPCID.Retinazer, 0.2f }, { NPCID.RustyArmoredBonesAxe, 0.2f }, { NPCID.RustyArmoredBonesFlail, 0.2f }, { NPCID.RustyArmoredBonesSword, 0.2f }, { NPCID.RustyArmoredBonesSwordNoArmor, 0.2f }, { NPCID.SandElemental, 0.1f }, { NPCID.SantaNK1, 0.35f }, { NPCID.SeaSnail, 0.05f }, { NPCID.SkeletonArcher, 0.1f }, { NPCID.SkeletonCommando, 0.2f }, { NPCID.SkeletonSniper, 0.2f }, { NPCID.SkeletronHand, 0.05f }, { NPCID.SkeletronHead, 0.05f }, { NPCID.SkeletronPrime, 0.2f }, { NPCID.Spazmatism, 0.2f }, { NPCID.TacticalSkeleton, 0.2f }, { NPCID.TheDestroyer, 0.1f }, { NPCID.TheDestroyerBody, 0.2f }, { NPCID.TheDestroyerTail, 0.35f }, { NPCID.TheHungry, 0.1f }, { NPCID.UndeadViking, 0.1f }, { NPCID.WalkingAntlion, 0.1f }, { NPCID.WallofFlesh, 0.5f }, }; } #endregion #region Thorium Boss DR private void SetupThoriumBossDR(Mod thorium) { if (thorium is null || !CalamityMod.CalamityConfig.RevengeanceAndDeathThoriumBossBuff) return; void ThoriumDR(string npcName, float dr) { int type = thorium.NPCType(npcName); if (DRValues.ContainsKey(type)) DRValues[type] = dr; else DRValues.Add(type, dr); }; ThoriumDR("Viscount", 0.05f); ThoriumDR("BoreanStrider", 0.05f); ThoriumDR("FallenDeathBeholder", 0.05f); ThoriumDR("Lich", 0.05f); ThoriumDR("AbyssionReleased", 0.05f); ThoriumDR("CryoCore", 0.1f); ThoriumDR("BioCore", 0.1f); ThoriumDR("PyroCore", 0.1f); ThoriumDR("Aquaius", 0.1f); ThoriumDR("ThePrimeScouter", 0.2f); ThoriumDR("FallenDeathBeholder2", 0.2f); ThoriumDR("SlagFury", 0.2f); ThoriumDR("Aquaius2", 0.2f); ThoriumDR("GraniteEnergyStorm", 0.2f); ThoriumDR("TheBuriedWarrior", 0.25f); ThoriumDR("TheBuriedWarrior1", 0.25f); ThoriumDR("TheBuriedWarrior2", 0.25f); ThoriumDR("LichHeadless", 0.25f); ThoriumDR("AbyssionCracked", 0.25f); ThoriumDR("Omnicide", 0.3f); ThoriumDR("Abyssion", 0.35f); } #endregion #region Music public override void UpdateMusic(ref int music, ref MusicPriority priority) { Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); if (Main.musicVolume != 0) { if (Main.myPlayer != -1 && !Main.gameMenu && Main.LocalPlayer.active) { Player p = Main.LocalPlayer; if (p.InCalamity()) { if (!CalamityPlayer.areThereAnyDamnBosses) { if (calamityModMusic != null) music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/Crag"); else music = MusicID.Eerie; priority = MusicPriority.Environment; } } if (p.InSunkenSea()) { if (!CalamityPlayer.areThereAnyDamnBosses) { if (calamityModMusic != null) music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/SunkenSea"); else music = MusicID.Temple; priority = MusicPriority.Environment; } } if (p.InAstral(1)) { if (!CalamityPlayer.areThereAnyDamnBosses) { if (calamityModMusic != null) { music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/Astral"); } else music = MusicID.Space; priority = MusicPriority.Environment; } } if (p.InAstral(2)) { if (!CalamityPlayer.areThereAnyDamnBosses) { if (calamityModMusic != null) { music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/AstralUnderground"); } else music = MusicID.Space; priority = MusicPriority.Environment; } } if (p.InAbyss(1) || p.InAbyss(2)) { if (!CalamityPlayer.areThereAnyDamnBosses) { if (calamityModMusic != null) music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/TheAbyss"); else music = MusicID.Hell; priority = MusicPriority.BiomeHigh; } } if (p.InAbyss(3)) { if (!CalamityPlayer.areThereAnyDamnBosses) { if (calamityModMusic != null) music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/TheDeepAbyss"); else music = MusicID.Hell; priority = MusicPriority.BiomeHigh; } } if (p.InAbyss(4)) { if (!CalamityPlayer.areThereAnyDamnBosses) { if (calamityModMusic != null) music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/TheVoid"); else music = MusicID.Hell; priority = MusicPriority.BiomeHigh; } } if (p.InSulphur()) { if (!CalamityPlayer.areThereAnyDamnBosses) { bool acidRain = CalamityWorld.rainingAcid; if (calamityModMusic != null) { string musicChoice = acidRain ? CalamityWorld.downedPolterghast ? "Sounds/Music/AcidRain1" : "Sounds/Music/AcidRain1" : "Sounds/Music/Sulphur"; //replace first acidrain1 once second theme is added. music = calamityModMusic.GetSoundSlot(SoundType.Music, musicChoice); } else music = acidRain ? CalamityWorld.downedPolterghast ? MusicID.Eclipse : MusicID.OldOnesArmy : MusicID.Desert; //if you have a better choice of music, feel free to change, it was pretty random choosing ngl priority = acidRain ? MusicPriority.Event : MusicPriority.BiomeHigh; } } if (CalamityWorld.DoGSecondStageCountdown <= 540 && CalamityWorld.DoGSecondStageCountdown > 60) //8 seconds before DoG spawns { if (!CalamityPlayer.areThereAnyDamnBosses) { if (calamityModMusic != null) music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/UniversalCollapse"); else music = MusicID.LunarBoss; priority = MusicPriority.BossMedium; } } } } } #endregion #region ModSupport public override void PostSetupContent() => WeakReferenceSupport.Setup(); public override object Call(params object[] args) => ModCalls.Call(args); #endregion #region DrawingStuff public override void ModifyInterfaceLayers(List layers) { int mouseIndex = layers.FindIndex(layer => layer.Name == "Vanilla: Mouse Text"); if (mouseIndex != -1) { layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Boss HP Bars", delegate () { if (Main.LocalPlayer.Calamity().drawBossHPBar) { BossHealthBarManager.Update(); BossHealthBarManager.Draw(Main.spriteBatch); } return true; }, InterfaceScaleType.None)); // Astral Arcanum overlay (if open) layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Astral Arcanum UI", delegate () { AstralArcanumUI.UpdateAndDraw(Main.spriteBatch); return true; }, InterfaceScaleType.None)); // Rage and Adrenaline bars layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Rage and Adrenaline UI", delegate () { RipperUI.Draw(Main.spriteBatch, Main.LocalPlayer); return true; }, InterfaceScaleType.None)); // Stealth bar layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Stealth UI", () => { StealthUI.Draw(Main.spriteBatch, Main.LocalPlayer); return true; }, InterfaceScaleType.None)); } // Invasion UI (used for Acid Rain) int invasionIndex = layers.FindIndex(layer => layer.Name == "Vanilla: Diagnose Net"); if (invasionIndex != -1) { layers.Insert(invasionIndex, new LegacyGameInterfaceLayer("Acid Rain Invasion UI", () => { if (CalamityWorld.rainingAcid) { AcidRainUI.Draw(Main.spriteBatch); } return true; }, InterfaceScaleType.None)); } } public static Color GetNPCColor(NPC npc, Vector2? position = null, bool effects = true, float shadowOverride = 0f) { return npc.GetAlpha(BuffEffects( npc, GetLightColor(position != null ? (Vector2)position : npc.Center), shadowOverride != 0f ? shadowOverride : 0f, effects, npc.poisoned, npc.onFire, npc.onFire2, Main.player[Main.myPlayer].detectCreature, false, false, false, npc.venom, npc.midas, npc.ichor, npc.onFrostBurn, false, false, npc.dripping, npc.drippingSlime, npc.loveStruck, npc.stinky) ); } public static Color GetLightColor(Vector2 position) => Lighting.GetColor((int)(position.X / 16f), (int)(position.Y / 16f)); public static Color BuffEffects(Entity codable, Color lightColor, float shadow = 0f, bool effects = true, bool poisoned = false, bool onFire = false, bool onFire2 = false, bool hunter = false, bool noItems = false, bool blind = false, bool bleed = false, bool venom = false, bool midas = false, bool ichor = false, bool onFrostBurn = false, bool burned = false, bool honey = false, bool dripping = false, bool drippingSlime = false, bool loveStruck = false, bool stinky = false) { float cr = 1f; float cg = 1f; float cb = 1f; float ca = 1f; if (effects && honey && Main.rand.NextBool(30)) { int dustID = Dust.NewDust(codable.position, codable.width, codable.height, 152, 0f, 0f, 150, default, 1f); Main.dust[dustID].velocity.Y = 0.3f; Main.dust[dustID].velocity.X *= 0.1f; Main.dust[dustID].scale += Main.rand.Next(3, 4) * 0.1f; Main.dust[dustID].alpha = 100; Main.dust[dustID].noGravity = true; Main.dust[dustID].velocity += codable.velocity * 0.1f; if (codable is Player) { Main.playerDrawDust.Add(dustID); } } if (poisoned) { if (effects && Main.rand.NextBool(30)) { int dustID = Dust.NewDust(codable.position, codable.width, codable.height, 46, 0f, 0f, 120, default, 0.2f); Main.dust[dustID].noGravity = true; Main.dust[dustID].fadeIn = 1.9f; if (codable is Player) { Main.playerDrawDust.Add(dustID); } } cr *= 0.65f; cb *= 0.75f; } if (venom) { if (effects && Main.rand.NextBool(10)) { int dustID = Dust.NewDust(codable.position, codable.width, codable.height, 171, 0f, 0f, 100, default, 0.5f); Main.dust[dustID].noGravity = true; Main.dust[dustID].fadeIn = 1.5f; if (codable is Player) { Main.playerDrawDust.Add(dustID); } } cg *= 0.45f; cr *= 0.75f; } if (midas) { cb *= 0.3f; cr *= 0.85f; } if (ichor) { if (codable is NPC) { lightColor = new Color(255, 255, 0, 255); } else { cb = 0f; } } if (burned) { if (effects) { int dustID = Dust.NewDust(new Vector2(codable.position.X - 2f, codable.position.Y - 2f), codable.width + 4, codable.height + 4, 6, codable.velocity.X * 0.4f, codable.velocity.Y * 0.4f, 100, default, 2f); Main.dust[dustID].noGravity = true; Main.dust[dustID].velocity *= 1.8f; Main.dust[dustID].velocity.Y -= 0.75f; if (codable is Player) { Main.playerDrawDust.Add(dustID); } } if (codable is Player) { cr = 1f; cb *= 0.6f; cg *= 0.7f; } } if (onFrostBurn) { if (effects) { if (Main.rand.Next(4) < 3) { int dustID = Dust.NewDust(new Vector2(codable.position.X - 2f, codable.position.Y - 2f), codable.width + 4, codable.height + 4, 135, codable.velocity.X * 0.4f, codable.velocity.Y * 0.4f, 100, default, 3.5f); Main.dust[dustID].noGravity = true; Main.dust[dustID].velocity *= 1.8f; Main.dust[dustID].velocity.Y -= 0.5f; if (Main.rand.NextBool(4)) { Main.dust[dustID].noGravity = false; Main.dust[dustID].scale *= 0.5f; } if (codable is Player) { Main.playerDrawDust.Add(dustID); } } Lighting.AddLight((int)(codable.position.X / 16f), (int)(codable.position.Y / 16f + 1f), 0.1f, 0.6f, 1f); } if (codable is Player) { cr *= 0.5f; cg *= 0.7f; } } if (onFire) { if (effects) { if (Main.rand.Next(4) != 0) { int dustID = Dust.NewDust(codable.position - new Vector2(2f, 2f), codable.width + 4, codable.height + 4, 6, codable.velocity.X * 0.4f, codable.velocity.Y * 0.4f, 100, default, 3.5f); Main.dust[dustID].noGravity = true; Main.dust[dustID].velocity *= 1.8f; Main.dust[dustID].velocity.Y -= 0.5f; if (Main.rand.NextBool(4)) { Main.dust[dustID].noGravity = false; Main.dust[dustID].scale *= 0.5f; } if (codable is Player) { Main.playerDrawDust.Add(dustID); } } Lighting.AddLight((int)(codable.position.X / 16f), (int)(codable.position.Y / 16f + 1f), 1f, 0.3f, 0.1f); } if (codable is Player) { cb *= 0.6f; cg *= 0.7f; } } if (dripping && shadow == 0f && Main.rand.Next(4) != 0) { Vector2 position = codable.position; position.X -= 2f; position.Y -= 2f; if (Main.rand.NextBool(2)) { int dustID = Dust.NewDust(position, codable.width + 4, codable.height + 2, 211, 0f, 0f, 50, default, 0.8f); if (Main.rand.NextBool(2)) { Main.dust[dustID].alpha += 25; } if (Main.rand.NextBool(2)) { Main.dust[dustID].alpha += 25; } Main.dust[dustID].noLight = true; Main.dust[dustID].velocity *= 0.2f; Main.dust[dustID].velocity.Y += 0.2f; Main.dust[dustID].velocity += codable.velocity; if (codable is Player) { Main.playerDrawDust.Add(dustID); } } else { int dustID = Dust.NewDust(position, codable.width + 8, codable.height + 8, 211, 0f, 0f, 50, default, 1.1f); if (Main.rand.NextBool(2)) { Main.dust[dustID].alpha += 25; } if (Main.rand.NextBool(2)) { Main.dust[dustID].alpha += 25; } Main.dust[dustID].noLight = true; Main.dust[dustID].noGravity = true; Main.dust[dustID].velocity *= 0.2f; Main.dust[dustID].velocity.Y += 1f; Main.dust[dustID].velocity += codable.velocity; if (codable is Player) { Main.playerDrawDust.Add(dustID); } } } if (drippingSlime && shadow == 0f) { int alpha = 175; Color newColor = new Color(0, 80, 255, 100); if (Main.rand.Next(4) != 0) { if (Main.rand.NextBool(2)) { Vector2 position2 = codable.position; position2.X -= 2f; position2.Y -= 2f; int dustID = Dust.NewDust(position2, codable.width + 4, codable.height + 2, 4, 0f, 0f, alpha, newColor, 1.4f); if (Main.rand.NextBool(2)) { Main.dust[dustID].alpha += 25; } if (Main.rand.NextBool(2)) { Main.dust[dustID].alpha += 25; } Main.dust[dustID].noLight = true; Main.dust[dustID].velocity *= 0.2f; Main.dust[dustID].velocity.Y += 0.2f; Main.dust[dustID].velocity += codable.velocity; if (codable is Player) { Main.playerDrawDust.Add(dustID); } } } cr *= 0.8f; cg *= 0.8f; } if (onFire2) { if (effects) { if (Main.rand.Next(4) != 0) { int dustID = Dust.NewDust(codable.position - new Vector2(2f, 2f), codable.width + 4, codable.height + 4, 75, codable.velocity.X * 0.4f, codable.velocity.Y * 0.4f, 100, default, 3.5f); Main.dust[dustID].noGravity = true; Main.dust[dustID].velocity *= 1.8f; Main.dust[dustID].velocity.Y -= 0.5f; if (Main.rand.NextBool(4)) { Main.dust[dustID].noGravity = false; Main.dust[dustID].scale *= 0.5f; } if (codable is Player) { Main.playerDrawDust.Add(dustID); } } Lighting.AddLight((int)(codable.position.X / 16f), (int)(codable.position.Y / 16f + 1f), 1f, 0.3f, 0.1f); } if (codable is Player) { cb *= 0.6f; cg *= 0.7f; } } if (noItems) { cr *= 0.65f; cg *= 0.8f; } if (blind) { cr *= 0.7f; cg *= 0.65f; } if (bleed) { bool dead = codable is Player ? ((Player)codable).dead : codable is NPC ? ((NPC)codable).life <= 0 : false; if (effects && !dead && Main.rand.NextBool(30)) { int dustID = Dust.NewDust(codable.position, codable.width, codable.height, 5, 0f, 0f, 0, default, 1f); Main.dust[dustID].velocity.Y += 0.5f; Main.dust[dustID].velocity *= 0.25f; if (codable is Player) { Main.playerDrawDust.Add(dustID); } } cg *= 0.9f; cb *= 0.9f; } if (loveStruck && effects && shadow == 0f && Main.instance.IsActive && !Main.gamePaused && Main.rand.NextBool(5)) { Vector2 value = new Vector2(Main.rand.Next(-10, 11), Main.rand.Next(-10, 11)); value.Normalize(); value.X *= 0.66f; int goreID = Gore.NewGore(codable.position + new Vector2(Main.rand.Next(codable.width + 1), Main.rand.Next(codable.height + 1)), value * Main.rand.Next(3, 6) * 0.33f, 331, Main.rand.Next(40, 121) * 0.01f); Main.gore[goreID].sticky = false; Main.gore[goreID].velocity *= 0.4f; Main.gore[goreID].velocity.Y -= 0.6f; if (codable is Player) { Main.playerDrawGore.Add(goreID); } } if (stinky && shadow == 0f) { cr *= 0.7f; cb *= 0.55f; if (effects && Main.rand.NextBool(5) && Main.instance.IsActive && !Main.gamePaused) { Vector2 value2 = new Vector2(Main.rand.Next(-10, 11), Main.rand.Next(-10, 11)); value2.Normalize(); value2.X *= 0.66f; value2.Y = Math.Abs(value2.Y); Vector2 vector = value2 * Main.rand.Next(3, 5) * 0.25f; int dustID = Dust.NewDust(codable.position, codable.width, codable.height, 188, vector.X, vector.Y * 0.5f, 100, default, 1.5f); Main.dust[dustID].velocity *= 0.1f; Main.dust[dustID].velocity.Y -= 0.5f; if (codable is Player) { Main.playerDrawDust.Add(dustID); } } } lightColor.R = (byte)(lightColor.R * cr); lightColor.G = (byte)(lightColor.G * cg); lightColor.B = (byte)(lightColor.B * cb); lightColor.A = (byte)(lightColor.A * ca); if (codable is NPC) { NPCLoader.DrawEffects((NPC)codable, ref lightColor); } if (hunter && (codable is NPC ? ((NPC)codable).lifeMax > 1 : true)) { if (effects && !Main.gamePaused && Main.instance.IsActive && Main.rand.NextBool(50)) { int dustID = Dust.NewDust(codable.position, codable.width, codable.height, 15, 0f, 0f, 150, default, 0.8f); Main.dust[dustID].velocity *= 0.1f; Main.dust[dustID].noLight = true; if (codable is Player) { Main.playerDrawDust.Add(dustID); } } byte colorR = 50, colorG = 255, colorB = 50; if (codable is NPC && !(((NPC)codable).friendly || ((NPC)codable).catchItem > 0 || (((NPC)codable).damage == 0 && ((NPC)codable).lifeMax == 5))) { colorR = 255; colorG = 50; } if (!(codable is NPC) && lightColor.R < 150) { lightColor.A = Main.mouseTextColor; } if (lightColor.R < colorR) { lightColor.R = colorR; } if (lightColor.G < colorG) { lightColor.G = colorG; } if (lightColor.B < colorB) { lightColor.B = colorB; } } return lightColor; } public static void DrawTexture(object sb, Texture2D texture, int shader, Entity codable, Color? overrideColor = null, bool drawCentered = false) { Color lightColor = overrideColor != null ? (Color)overrideColor : codable is NPC ? GetNPCColor((NPC)codable, codable.Center, false) : codable is Projectile ? ((Projectile)codable).GetAlpha(GetLightColor(codable.Center)) : GetLightColor(codable.Center); int frameCount = codable is NPC ? Main.npcFrameCount[((NPC)codable).type] : 1; Rectangle frame = codable is NPC ? ((NPC)codable).frame : new Rectangle(0, 0, texture.Width, texture.Height); float scale = codable is NPC ? ((NPC)codable).scale : ((Projectile)codable).scale; float rotation = codable is NPC ? ((NPC)codable).rotation : ((Projectile)codable).rotation; int spriteDirection = codable is NPC ? ((NPC)codable).spriteDirection : ((Projectile)codable).spriteDirection; float offsetY = codable is NPC ? ((NPC)codable).gfxOffY : 0f; DrawTexture(sb, texture, shader, codable.position + new Vector2(0f, offsetY), codable.width, codable.height, scale, rotation, spriteDirection, frameCount, frame, lightColor, drawCentered); } public static void DrawTexture(object sb, Texture2D texture, int shader, Vector2 position, int width, int height, float scale, float rotation, int direction, int framecount, Rectangle frame, Color? overrideColor = null, bool drawCentered = false) { Vector2 origin = new Vector2(texture.Width / 2, texture.Height / framecount / 2); Color lightColor = overrideColor != null ? (Color)overrideColor : GetLightColor(position + new Vector2(width * 0.5f, height * 0.5f)); if (sb is List) { DrawData dd = new DrawData(texture, GetDrawPosition(position, origin, width, height, texture.Width, texture.Height, framecount, scale, drawCentered), frame, lightColor, rotation, origin, scale, direction == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0) { shader = shader }; ((List)sb).Add(dd); } else if (sb is SpriteBatch) { bool applyDye = shader > 0; if (applyDye) { ((SpriteBatch)sb).End(); ((SpriteBatch)sb).Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend); GameShaders.Armor.ApplySecondary(shader, Main.player[Main.myPlayer], null); } ((SpriteBatch)sb).Draw(texture, GetDrawPosition(position, origin, width, height, texture.Width, texture.Height, framecount, scale, drawCentered), frame, lightColor, rotation, origin, scale, direction == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); if (applyDye) { ((SpriteBatch)sb).End(); ((SpriteBatch)sb).Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend); } } } public static Vector2 GetDrawPosition(Vector2 position, Vector2 origin, int width, int height, int texWidth, int texHeight, int framecount, float scale, bool drawCentered = false) { Vector2 screenPos = new Vector2((int)Main.screenPosition.X, (int)Main.screenPosition.Y); if (drawCentered) { Vector2 texHalf = new Vector2(texWidth / 2, texHeight / framecount / 2); return position + new Vector2(width * 0.5f, height * 0.5f) - (texHalf * scale) + (origin * scale) - screenPos; } return position - screenPos + new Vector2(width * 0.5f, height) - new Vector2(texWidth * scale / 2f, texHeight * scale / framecount) + (origin * scale) + new Vector2(0f, 5f); } #endregion #region Recipes public override void AddRecipeGroups() => CalamityRecipes.AddRecipeGroups(); public override void AddRecipes() => CalamityRecipes.AddRecipes(); #endregion #region Seasons public static Season CurrentSeason { get { DateTime date = DateTime.Now; int day = date.DayOfYear - Convert.ToInt32(DateTime.IsLeapYear(date.Year) && date.DayOfYear > 59); if (day < 80 || day >= 355) { return Season.Winter; } else if (day >= 80 && day < 172) { return Season.Spring; } else if (day >= 172 && day < 266) { return Season.Summer; } else { return Season.Fall; } } } #endregion #region Lighting const float MaxCaveDarkness = -0.3f; const float MaxSignusDarkness = -0.5f; const float MaxAbyssDarkness = -0.7f; public override void ModifyLightingBrightness(ref float scale) { // Apply the calculated darkness value for the local player. CalamityPlayer modPlayer = Main.LocalPlayer.Calamity(); float darkRatio = MathHelper.Clamp(modPlayer.caveDarkness, 0f, 1f); if (modPlayer.ZoneAbyss) scale += MaxAbyssDarkness * darkRatio; else if (CalamityWorld.death) scale += MaxCaveDarkness * darkRatio; if (CalamityWorld.revenge) { if (CalamityGlobalNPC.signus != -1) { if (Main.npc[CalamityGlobalNPC.signus].active) { if (Vector2.Distance(Main.LocalPlayer.Center, Main.npc[CalamityGlobalNPC.signus].Center) <= 5200f) { float signusLifeRatio = 1f - (Main.npc[CalamityGlobalNPC.signus].life / Main.npc[CalamityGlobalNPC.signus].lifeMax); // Reduce the power of Signus darkness based on your light level. float multiplier = 1f; switch (modPlayer.GetTotalLightStrength()) { case 0: break; case 1: case 2: multiplier = 0.75f; break; case 3: case 4: multiplier = 0.5f; break; case 5: case 6: multiplier = 0.25f; break; default: multiplier = 0f; break; } // Increased darkness in Death Mode if (CalamityWorld.death) multiplier += (1f - multiplier) * 0.1f; // Total darkness float signusDarkness = signusLifeRatio * multiplier; darkRatio = MathHelper.Clamp(signusDarkness, 0f, 1f); scale += MaxSignusDarkness * darkRatio; } } } } } #endregion #region Packets public override void HandlePacket(BinaryReader reader, int whoAmI) { try { CalamityModMessageType msgType = (CalamityModMessageType)reader.ReadByte(); switch (msgType) { case CalamityModMessageType.MeleeLevelSync: Main.player[reader.ReadInt32()].Calamity().HandleLevels(reader, 0); break; case CalamityModMessageType.RangedLevelSync: Main.player[reader.ReadInt32()].Calamity().HandleLevels(reader, 1); break; case CalamityModMessageType.MagicLevelSync: Main.player[reader.ReadInt32()].Calamity().HandleLevels(reader, 2); break; case CalamityModMessageType.SummonLevelSync: Main.player[reader.ReadInt32()].Calamity().HandleLevels(reader, 3); break; case CalamityModMessageType.RogueLevelSync: Main.player[reader.ReadInt32()].Calamity().HandleLevels(reader, 4); break; case CalamityModMessageType.ExactMeleeLevelSync: Main.player[reader.ReadInt32()].Calamity().HandleExactLevels(reader, 0); break; case CalamityModMessageType.ExactRangedLevelSync: Main.player[reader.ReadInt32()].Calamity().HandleExactLevels(reader, 1); break; case CalamityModMessageType.ExactMagicLevelSync: Main.player[reader.ReadInt32()].Calamity().HandleExactLevels(reader, 2); break; case CalamityModMessageType.ExactSummonLevelSync: Main.player[reader.ReadInt32()].Calamity().HandleExactLevels(reader, 3); break; case CalamityModMessageType.ExactRogueLevelSync: Main.player[reader.ReadInt32()].Calamity().HandleExactLevels(reader, 4); break; case CalamityModMessageType.StressSync: Main.player[reader.ReadInt32()].Calamity().HandleStress(reader); break; case CalamityModMessageType.BossRushStage: int stage = reader.ReadInt32(); CalamityWorld.bossRushStage = stage; break; case CalamityModMessageType.AdrenalineSync: Main.player[reader.ReadInt32()].Calamity().HandleAdrenaline(reader); break; case CalamityModMessageType.TeleportPlayer: Main.player[reader.ReadInt32()].Calamity().HandleTeleport(reader.ReadInt32(), true, whoAmI); break; case CalamityModMessageType.DoGCountdownSync: int countdown = reader.ReadInt32(); CalamityWorld.DoGSecondStageCountdown = countdown; break; case CalamityModMessageType.BossSpawnCountdownSync: int countdown2 = reader.ReadInt32(); CalamityWorld.bossSpawnCountdown = countdown2; break; case CalamityModMessageType.DeathBossSpawnCountdownSync: int countdown3 = reader.ReadInt32(); CalamityWorld.deathBossSpawnCooldown = countdown3; break; case CalamityModMessageType.BossTypeSync: int type = reader.ReadInt32(); CalamityWorld.bossType = type; break; case CalamityModMessageType.DeathCountSync: Main.player[reader.ReadInt32()].Calamity().HandleDeathCount(reader); break; case CalamityModMessageType.DeathModeUnderworldTimeSync: Main.player[reader.ReadInt32()].Calamity().HandleDeathModeUnderworldTime(reader); break; case CalamityModMessageType.DeathModeBlizzardTimeSync: Main.player[reader.ReadInt32()].Calamity().HandleDeathModeBlizzardTime(reader); break; case CalamityModMessageType.RevengeanceBoolSync: bool revActive = reader.ReadBoolean(); CalamityWorld.revenge = revActive; break; case CalamityModMessageType.DeathBoolSync: bool deathActive = reader.ReadBoolean(); CalamityWorld.death = deathActive; break; case CalamityModMessageType.DefiledBoolSync: bool defiledActive = reader.ReadBoolean(); CalamityWorld.defiled = defiledActive; break; case CalamityModMessageType.IronHeartBoolSync: bool ironHeartActive = reader.ReadBoolean(); CalamityWorld.ironHeart = ironHeartActive; break; case CalamityModMessageType.ArmageddonBoolSync: bool armaActive = reader.ReadBoolean(); CalamityWorld.armageddon = armaActive; break; case CalamityModMessageType.DemonTrophyBoolSync: bool demonModeBoost = reader.ReadBoolean(); CalamityWorld.demonMode = demonModeBoost; break; case CalamityModMessageType.NPCRegenerationSync: byte npcIndex = reader.ReadByte(); Main.npc[npcIndex].lifeRegen = reader.ReadInt32(); break; case CalamityModMessageType.AcidRainSync: CalamityWorld.rainingAcid = reader.ReadBoolean(); CalamityWorld.acidRainPoints = reader.ReadInt32(); break; case CalamityModMessageType.AcidRainUIDrawFadeSync: CalamityWorld.acidRainExtraDrawTime = reader.ReadInt32(); break; case CalamityModMessageType.AcidRainOldDukeSummonSync: CalamityWorld.triedToSummonOldDuke = reader.ReadBoolean(); break; case CalamityModMessageType.GaelsGreatswordSwingSync: byte playerIndex = reader.ReadByte(); Main.player[playerIndex].Calamity().gaelSwipes = reader.ReadInt32(); break; case CalamityModMessageType.SpawnSuperDummy: int x = reader.ReadInt32(); int y = reader.ReadInt32(); // Not strictly necessary, but helps prevent unnecessary packetstorm in MP if (Main.netMode != NetmodeID.MultiplayerClient) NPC.NewNPC(x, y, ModContent.NPCType()); break; default: Logger.Error($"Failed to parse Calamity packet: No Calamity packet exists with ID {msgType}."); break; } } catch(Exception e) { if (e is EndOfStreamException eose) Logger.Error("Failed to parse Calamity packet: Packet was too short, missing data, or otherwise corrupt.", eose); else if (e is ObjectDisposedException ode) Logger.Error("Failed to parse Calamity packet: Packet reader disposed or destroyed.", ode); else if (e is IOException ioe) Logger.Error("Failed to parse Calamity packet: An unknown I/O error occurred.", ioe); else throw e; // this either will crash the game or be caught by TML's packet policing } } #endregion #region Stop Rain public static void StopRain() { if (!Main.raining) return; Main.raining = false; UpdateServerBoolean(); } #endregion #region Update Server Boolean public static void UpdateServerBoolean() { if (Main.netMode == NetmodeID.Server) { NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); } } #endregion } public enum Season : byte { Winter, Spring, Summer, Fall } enum CalamityModMessageType : byte { MeleeLevelSync, RangedLevelSync, MagicLevelSync, SummonLevelSync, RogueLevelSync, ExactMeleeLevelSync, ExactRangedLevelSync, ExactMagicLevelSync, ExactSummonLevelSync, ExactRogueLevelSync, StressSync, AdrenalineSync, TeleportPlayer, BossRushStage, DoGCountdownSync, BossSpawnCountdownSync, BossTypeSync, DeathCountSync, RevengeanceBoolSync, DeathBoolSync, DefiledBoolSync, IronHeartBoolSync, ArmageddonBoolSync, DemonTrophyBoolSync, NPCRegenerationSync, DeathModeUnderworldTimeSync, DeathModeBlizzardTimeSync, DeathBossSpawnCountdownSync, AcidRainSync, AcidRainUIDrawFadeSync, AcidRainOldDukeSummonSync, GaelsGreatswordSwingSync, SpawnSuperDummy, } }