Split many mod/world things into systems

This commit is contained in:
DominicKarma committed 2022-04-04 20:38:44 -05:00
1 parent e69f54f585
commit 60cfab641e
192 files changed
+3100 -3012

No files matched your search

+6 -13
View File
@@ -1,42 +1,35 @@
using Terraria;
using Terraria.ModLoader;
using Terraria.ModLoader;
namespace CalamityMod.Backgrounds
{
public class AstralDesertSurfaceBGStyle : ModSurfaceBgStyle
public class AstralDesertSurfaceBGStyle : ModSurfaceBackgroundStyle
{
public override int ChooseFarTexture() => Mod.GetBackgroundSlot("Backgrounds/AstralDesertSurfaceFar");
public override int ChooseFarTexture() => BackgroundTextureLoader.GetBackgroundSlot("Backgrounds/AstralDesertSurfaceFar");
public override int ChooseMiddleTexture() => Mod.GetBackgroundSlot("Backgrounds/AstralDesertSurfaceMiddle");
public override int ChooseMiddleTexture() => BackgroundTextureLoader.GetBackgroundSlot("Backgrounds/AstralDesertSurfaceMiddle");
public override int ChooseCloseTexture(ref float scale, ref double parallax, ref float a, ref float b)
{
b -= 75f;
return Mod.GetBackgroundSlot("Backgrounds/AstralDesertSurfaceClose");
return BackgroundTextureLoader.GetBackgroundSlot("Backgrounds/AstralDesertSurfaceClose");
}
public override bool ChooseBgStyle() => !Main.gameMenu && Main.LocalPlayer.InAstral() && Main.LocalPlayer.ZoneDesert;
public override void ModifyFarFades(float[] fades, float transitionSpeed)
{
//This just fades in the background and fades out other backgrounds.
// This just fades in the background and fades out other backgrounds.
for (int i = 0; i < fades.Length; i++)
{
if (i == Slot)
{
fades[i] += transitionSpeed;
if (fades[i] > 1f)
{
fades[i] = 1f;
}
}
else
{
fades[i] -= transitionSpeed;
if (fades[i] < 0f)
{
fades[i] = 0f;
}
}
}
}
+6 -12
View File
@@ -1,38 +1,32 @@
using Terraria;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Backgrounds
{
public class AstralSnowSurfaceBGStyle : ModSurfaceBgStyle
public class AstralSnowSurfaceBGStyle : ModSurfaceBackgroundStyle
{
public override int ChooseFarTexture() => Mod.GetBackgroundSlot("Backgrounds/AstralSnowSurfaceFar");
public override int ChooseFarTexture() => BackgroundTextureLoader.GetBackgroundSlot("Backgrounds/AstralSnowSurfaceFar");
public override int ChooseMiddleTexture() => Mod.GetBackgroundSlot("Backgrounds/AstralSnowSurfaceMiddle");
public override int ChooseMiddleTexture() => BackgroundTextureLoader.GetBackgroundSlot("Backgrounds/AstralSnowSurfaceMiddle");
public override int ChooseCloseTexture(ref float scale, ref double parallax, ref float a, ref float b) => Mod.GetBackgroundSlot("Backgrounds/AstralSurfaceClose");
public override bool ChooseBgStyle() => !Main.gameMenu && Main.LocalPlayer.InAstral() && Main.LocalPlayer.ZoneSnow;
public override int ChooseCloseTexture(ref float scale, ref double parallax, ref float a, ref float b) => BackgroundTextureLoader.GetBackgroundSlot("Backgrounds/AstralSurfaceClose");
public override void ModifyFarFades(float[] fades, float transitionSpeed)
{
//This just fades in the background and fades out other backgrounds.
// This just fades in the background and fades out other backgrounds.
for (int i = 0; i < fades.Length; i++)
{
if (i == Slot)
{
fades[i] += transitionSpeed;
if (fades[i] > 1f)
{
fades[i] = 1f;
}
}
else
{
fades[i] -= transitionSpeed;
if (fades[i] < 0f)
{
fades[i] = 0f;
}
}
}
}
+6 -13
View File
@@ -1,42 +1,35 @@
using Terraria;
using Terraria.ModLoader;
using Terraria.ModLoader;
namespace CalamityMod.Backgrounds
{
public class AstralSurfaceBGStyle : ModSurfaceBgStyle
public class AstralSurfaceBGStyle : ModSurfaceBackgroundStyle
{
public override int ChooseFarTexture() => Mod.GetBackgroundSlot("Backgrounds/AstralSurfaceFar");
public override int ChooseFarTexture() => BackgroundTextureLoader.GetBackgroundSlot("Backgrounds/AstralSurfaceFar");
public override int ChooseMiddleTexture() => Mod.GetBackgroundSlot("Backgrounds/AstralSurfaceMiddle");
public override int ChooseMiddleTexture() => BackgroundTextureLoader.GetBackgroundSlot("Backgrounds/AstralSurfaceMiddle");
public override int ChooseCloseTexture(ref float scale, ref double parallax, ref float a, ref float b)
{
scale *= 0.75f;
return Mod.GetBackgroundSlot("Backgrounds/AstralSurfaceClose");
return BackgroundTextureLoader.GetBackgroundSlot("Backgrounds/AstralSurfaceClose");
}
public override bool ChooseBgStyle() => !Main.gameMenu && Main.LocalPlayer.InAstral() && !Main.LocalPlayer.ZoneDesert && !Main.LocalPlayer.ZoneSnow;
public override void ModifyFarFades(float[] fades, float transitionSpeed)
{
//This just fades in the background and fades out other backgrounds.
// This just fades in the background and fades out other backgrounds.
for (int i = 0; i < fades.Length; i++)
{
if (i == Slot)
{
fades[i] += transitionSpeed;
if (fades[i] > 1f)
{
fades[i] = 1f;
}
}
else
{
fades[i] -= transitionSpeed;
if (fades[i] < 0f)
{
fades[i] = 0f;
}
}
}
}
+3 -7
View File
@@ -1,18 +1,14 @@
using Terraria;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Backgrounds
{
public class AstralUndergroundBGStyle : ModUgBgStyle
public class AstralUndergroundBGStyle : ModUndergroundBackgroundStyle
{
public override bool ChooseBgStyle() => Main.LocalPlayer.InAstral();
public override void FillTextureArray(int[] textureSlots)
{
for (int i = 0; i <= 3; i++)
{
textureSlots[i] = Mod.GetBackgroundSlot("Backgrounds/AstralUG" + i.ToString());
}
textureSlots[i] = BackgroundTextureLoader.GetBackgroundSlot("Backgrounds/AstralUG" + i.ToString());
}
}
}
+3 -5
View File
@@ -1,18 +1,16 @@
using Terraria;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Backgrounds
{
public class SulphurSeaSurfaceBGStyle : ModSurfaceBgStyle
public class SulphurSeaSurfaceBGStyle : ModSurfaceBackgroundStyle
{
public override int ChooseCloseTexture(ref float scale, ref double parallax, ref float a, ref float b)
{
b -= 250f;
return Mod.GetBackgroundSlot("Backgrounds/SulphurSeaSurfaceClose");
return BackgroundTextureLoader.GetBackgroundSlot("Backgrounds/SulphurSeaSurfaceClose");
}
public override bool ChooseBgStyle() => !Main.gameMenu && Main.LocalPlayer.InSulphur();
public override void ModifyFarFades(float[] fades, float transitionSpeed)
{
//This just fades in the background and fades out other backgrounds.
+30
View File
@@ -0,0 +1,30 @@
using CalamityMod.Backgrounds;
using CalamityMod.Systems;
using CalamityMod.Waters;
using CalamityMod.World;
using Terraria;
using Terraria.Graphics.Capture;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.BiomeManagers
{
public class AbovegroundAstralBiome : ModBiome
{
public override ModWaterStyle WaterStyle => ModContent.Find<AstralWater>("CalamityMod/Waters/AstralWater");
public override ModSurfaceBackgroundStyle SurfaceBackgroundStyle => ModContent.Find<AstralSurfaceBGStyle>("CalamityMod/Backgrounds/AstralSurfaceBGStyle");
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("Astral") ?? MusicID.Space;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Astral Surface");
}
public override bool IsBiomeActive(Player player)
{
return !player.ZoneDungeon && (BiomeTileCounterSystem.AstralTiles > 950 || (player.ZoneSnow && BiomeTileCounterSystem.AstralTiles > 300)) &&
!player.ZoneDesert && !player.ZoneSnow;
}
}
}
@@ -0,0 +1,28 @@
using CalamityMod.Backgrounds;
using CalamityMod.Systems;
using CalamityMod.Waters;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.BiomeManagers
{
public class AbovegroundAstralDesertBiome : ModBiome
{
public override ModWaterStyle WaterStyle => ModContent.Find<AstralWater>("CalamityMod/Waters/AstralWater");
public override ModSurfaceBackgroundStyle SurfaceBackgroundStyle => ModContent.Find<AstralDesertSurfaceBGStyle>("CalamityMod/Backgrounds/AstralDesertSurfaceBGStyle");
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("Astral") ?? MusicID.Space;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Astral Desert Surface");
}
public override bool IsBiomeActive(Player player)
{
return !player.ZoneDungeon && (BiomeTileCounterSystem.AstralTiles > 950 || (player.ZoneSnow && BiomeTileCounterSystem.AstralTiles > 300))
&& player.ZoneDesert && !player.ZoneSnow;
}
}
}
@@ -0,0 +1,28 @@
using CalamityMod.Backgrounds;
using CalamityMod.Systems;
using CalamityMod.Waters;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.BiomeManagers
{
public class AbovegroundAstralSnowBiome : ModBiome
{
public override ModWaterStyle WaterStyle => ModContent.Find<AstralWater>("CalamityMod/Waters/AstralWater");
public override ModSurfaceBackgroundStyle SurfaceBackgroundStyle => ModContent.Find<AstralSnowSurfaceBGStyle>("CalamityMod/Backgrounds/AstralSnowSurfaceBGStyle");
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("Astral") ?? MusicID.Space;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Astral Snow Surface");
}
public override bool IsBiomeActive(Player player)
{
return !player.ZoneDungeon && (BiomeTileCounterSystem.AstralTiles > 950 || (player.ZoneSnow && BiomeTileCounterSystem.AstralTiles > 300)) &&
!player.ZoneDesert && player.ZoneSnow;
}
}
}
+67
View File
@@ -0,0 +1,67 @@
using CalamityMod.CalPlayer;
using CalamityMod.Systems;
using CalamityMod.Waters;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.BiomeManagers
{
public class AbyssLayer1Biome : ModBiome
{
public static bool MeetsBaseAbyssRequirement(Player player, out int playerYTileCoords)
{
Point point = player.Center.ToTileCoordinates();
int x = Main.maxTilesX;
int y = Main.maxTilesY;
int genLimit = x / 2;
int abyssChasmY = y - 250;
int abyssChasmX = CalamityWorld.abyssSide ? genLimit - (genLimit - 135) : genLimit + (genLimit - 135);
bool abyssPosX = false;
bool abyssPosY = point.Y <= abyssChasmY;
if (CalamityWorld.abyssSide)
{
if (point.X < abyssChasmX + 80)
abyssPosX = true;
}
else
{
if (point.X > abyssChasmX - 80)
abyssPosX = true;
}
playerYTileCoords = point.Y;
return point.Y > (Main.rockLayer - y * 0.05) &&
!player.lavaWet &&
!player.honeyWet &&
abyssPosY &&
abyssPosX;
}
public override ModWaterStyle WaterStyle => ModContent.Find<AbyssWater>("CalamityMod/Waters/AbyssWater");
public override int Music
{
get
{
if (CalamityPlayer.areThereAnyDamnBosses)
return Main.curMusic;
return CalamityMod.Instance.GetMusicFromMusicMod("Abyss1") ?? MusicID.Hell;
}
}
public override void SetStaticDefaults()
{
DisplayName.SetDefault("First Layer of the Abyss");
}
public override bool IsBiomeActive(Player player)
{
return MeetsBaseAbyssRequirement(player, out int playerYTileCoords) &&
playerYTileCoords < (Main.rockLayer + Main.maxTilesY * 0.03);
}
}
}
+35
View File
@@ -0,0 +1,35 @@
using CalamityMod.CalPlayer;
using CalamityMod.Waters;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.BiomeManagers
{
public class AbyssLayer2Biome : ModBiome
{
public override int Music
{
get
{
if (CalamityPlayer.areThereAnyDamnBosses)
return Main.curMusic;
return CalamityMod.Instance.GetMusicFromMusicMod("Abyss1") ?? MusicID.Hell;
}
}
public override ModWaterStyle WaterStyle => ModContent.Find<AbyssWater>("CalamityMod/Waters/AbyssWater");
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Second Layer of the Abyss");
}
public override bool IsBiomeActive(Player player)
{
return AbyssLayer1Biome.MeetsBaseAbyssRequirement(player, out int playerYTileCoords) &&
playerYTileCoords > (Main.rockLayer + Main.maxTilesY * 0.03) &&
playerYTileCoords <= (Main.rockLayer + Main.maxTilesY * 0.14);
}
}
}
+35
View File
@@ -0,0 +1,35 @@
using CalamityMod.CalPlayer;
using CalamityMod.Waters;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.BiomeManagers
{
public class AbyssLayer3Biome : ModBiome
{
public override int Music
{
get
{
if (CalamityPlayer.areThereAnyDamnBosses)
return Main.curMusic;
return CalamityMod.Instance.GetMusicFromMusicMod("Abyss2") ?? MusicID.Hell;
}
}
public override ModWaterStyle WaterStyle => ModContent.Find<AbyssWater>("CalamityMod/Waters/AbyssWater");
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Third Layer of the Abyss");
}
public override bool IsBiomeActive(Player player)
{
return AbyssLayer1Biome.MeetsBaseAbyssRequirement(player, out int playerYTileCoords) &&
playerYTileCoords > (Main.rockLayer + Main.maxTilesY * 0.14) &&
playerYTileCoords <= (Main.rockLayer + Main.maxTilesY * 0.26);
}
}
}
+34
View File
@@ -0,0 +1,34 @@
using CalamityMod.CalPlayer;
using CalamityMod.Waters;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.BiomeManagers
{
public class AbyssLayer4Biome : ModBiome
{
public override int Music
{
get
{
if (CalamityPlayer.areThereAnyDamnBosses)
return Main.curMusic;
return CalamityMod.Instance.GetMusicFromMusicMod("Abyss3") ?? MusicID.Hell;
}
}
public override ModWaterStyle WaterStyle => ModContent.Find<AbyssWater>("CalamityMod/Waters/AbyssWater");
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Fourth Layer of the Abyss");
}
public override bool IsBiomeActive(Player player)
{
return AbyssLayer1Biome.MeetsBaseAbyssRequirement(player, out int playerYTileCoords) &&
playerYTileCoords > Main.rockLayer + Main.maxTilesY * 0.26;
}
}
}
+24
View File
@@ -0,0 +1,24 @@
using CalamityMod.Backgrounds;
using CalamityMod.Systems;
using CalamityMod.Waters;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.BiomeManagers
{
public class BrimstoneCragsBiome : ModBiome
{
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("Crag") ?? MusicID.Eerie;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Brimstone Crags");
}
public override bool IsBiomeActive(Player player)
{
return BiomeTileCounterSystem.BrimstoneCragTiles > 100;
}
}
}
+65
View File
@@ -0,0 +1,65 @@
using CalamityMod.Backgrounds;
using CalamityMod.CalPlayer;
using CalamityMod.Systems;
using CalamityMod.Waters;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.BiomeManagers
{
public class SulphurousSeaBiome : ModBiome
{
public override ModWaterStyle WaterStyle => ModContent.Find<SulphuricWater>("CalamityMod/Waters/SulphuricWater");
public override ModSurfaceBackgroundStyle SurfaceBackgroundStyle => ModContent.Find<SulphurSeaSurfaceBGStyle>("CalamityMod/Backgrounds/SulphurSeaSurfaceBGStyle");
public override int Music
{
get
{
int music = Main.curMusic;
if (!CalamityPlayer.areThereAnyDamnBosses)
{
bool acidRain = CalamityWorld.rainingAcid;
// Acid Rain themes
if (acidRain)
{
music = DownedBossSystem.downedPolterghast
? CalamityMod.Instance.GetMusicFromMusicMod("AcidRain2") ?? MusicID.Eclipse // Acid Rain Tier 3
: CalamityMod.Instance.GetMusicFromMusicMod("AcidRain1") ?? MusicID.OldOnesArmy; // Acid Rain Tier 1 + 2
}
// Regular Sulphur Sea theme, when Acid Rain is not occurring
else
music = CalamityMod.Instance.GetMusicFromMusicMod("SulphurousSea") ?? MusicID.Desert;
}
return music;
}
}
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Sulpurous Sea");
}
public override bool IsBiomeActive(Player player)
{
Point point = player.Center.ToTileCoordinates();
bool sulphurPosX = false;
if (CalamityWorld.abyssSide)
{
if (point.X < 380)
sulphurPosX = true;
}
else
{
if (point.X > Main.maxTilesX - 380)
sulphurPosX = true;
}
return BiomeTileCounterSystem.SulphurTiles >= 300 || (player.ZoneOverworldHeight && sulphurPosX);
}
}
}
+25
View File
@@ -0,0 +1,25 @@
using CalamityMod.Systems;
using CalamityMod.Waters;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.BiomeManagers
{
public class SunkenSeaBiome : ModBiome
{
public override ModWaterStyle WaterStyle => ModContent.Find<SunkenSeaWater>("CalamityMod/Waters/SunkenSeaWater");
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("SunkenSea") ?? MusicID.Temple;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Sunken Sea");
}
public override bool IsBiomeActive(Player player)
{
return BiomeTileCounterSystem.SunkenSeaTiles > 150;
}
}
}
+28
View File
@@ -0,0 +1,28 @@
using CalamityMod.Backgrounds;
using CalamityMod.Systems;
using CalamityMod.Waters;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.BiomeManagers
{
public class UndergroundAstralBiome : ModBiome
{
public override ModWaterStyle WaterStyle => ModContent.Find<AstralWater>("CalamityMod/Waters/AstralWater");
public override ModUndergroundBackgroundStyle UndergroundBackgroundStyle => ModContent.Find<AstralUndergroundBGStyle>("CalamityMod/Backgrounds/AstralUndergroundBGStyle");
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("AstralUnderground") ?? MusicID.Space;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Astral Underground");
}
public override bool IsBiomeActive(Player player)
{
return !player.ZoneDungeon && (BiomeTileCounterSystem.AstralTiles > 950 || (player.ZoneSnow && BiomeTileCounterSystem.AstralTiles > 300)) &&
(player.ZoneDirtLayerHeight || player.ZoneRockLayerHeight || player.ZoneUnderworldHeight);
}
}
}
+3 -3
View File
@@ -19,7 +19,7 @@ namespace CalamityMod.Buffs.StatBuffs
public override void Update(Player player, ref int buffIndex)
{
if (CalamityWorld.downedSCal && CalamityWorld.downedExoMechs && (player.Calamity().minionSlotStat - player.slotsMinions) >= 10 && !player.Calamity().profanedCrystalForce)
if (DownedBossSystem.downedSCal && DownedBossSystem.downedExoMechs && (player.Calamity().minionSlotStat - player.slotsMinions) >= 10 && !player.Calamity().profanedCrystalForce)
{
player.Calamity().profanedCrystalBuffs = true;
}
@@ -48,13 +48,13 @@ namespace CalamityMod.Buffs.StatBuffs
(enrage ? "\nYour weakened life force fuels your desperate attacks" : "");
}
}
else if (CalamityWorld.downedSCal && CalamityWorld.downedExoMechs)
else if (DownedBossSystem.downedSCal && DownedBossSystem.downedExoMechs)
{
tip = "Your profaned soul is constrained by your insufficient summoning powers";
}
else
{
tip = !CalamityWorld.downedExoMechs ? "The soul within this crystal has been defiled by overwhelming energy waves from dangerous mechanations" : "The profaned soul within has been defiled by the powerful magic of a supreme witch";
tip = !DownedBossSystem.downedExoMechs ? "The soul within this crystal has been defiled by overwhelming energy waves from dangerous mechanations" : "The profaned soul within has been defiled by the powerful magic of a supreme witch";
}
}
}
+1 -1
View File
@@ -35,7 +35,7 @@ namespace CalamityMod.Buffs.Summon
Player player = Main.player[Main.myPlayer];
bool offense = player.Calamity().gOffense;
bool defense = player.Calamity().gDefense;
if (player.Calamity().profanedCrystal && (!player.Calamity().profanedCrystalBuffs && !CalamityWorld.downedSCal))
if (player.Calamity().profanedCrystal && (!player.Calamity().profanedCrystalBuffs && !DownedBossSystem.downedSCal))
{
tip = "The Profaned Babs will accompany you!";
}
+55 -185
View File
@@ -78,6 +78,7 @@ using Terraria.Localization;
using Terraria.ModLoader;
using Terraria.ModLoader.IO;
using Terraria.Audio;
using CalamityMod.BiomeManagers;
namespace CalamityMod.CalPlayer
{
@@ -1069,15 +1070,18 @@ namespace CalamityMod.CalPlayer
#endregion
#region Biome
public bool ZoneCalamity = false;
public bool ZoneAstral = false;
public bool ZoneSunkenSea = false;
public bool ZoneSulphur = false;
public bool ZoneAbyss = false;
public bool ZoneAbyssLayer1 = false;
public bool ZoneAbyssLayer2 = false;
public bool ZoneAbyssLayer3 = false;
public bool ZoneAbyssLayer4 = false;
public bool ZoneCalamity => Player.InModBiome(ModContent.GetInstance<BrimstoneCragsBiome>());
public bool ZoneAstral => Player.InModBiome(ModContent.GetInstance<AbovegroundAstralBiome>()) ||
Player.InModBiome(ModContent.GetInstance<AbovegroundAstralSnowBiome>()) ||
Player.InModBiome(ModContent.GetInstance<AbovegroundAstralDesertBiome>()) ||
Player.InModBiome(ModContent.GetInstance<UndergroundAstralBiome>());
public bool ZoneSunkenSea => Player.InModBiome(ModContent.GetInstance<SunkenSeaBiome>());
public bool ZoneSulphur => Player.InModBiome(ModContent.GetInstance<SulphurousSeaBiome>());
public bool ZoneAbyss => ZoneAbyssLayer1 || ZoneAbyssLayer2 || ZoneAbyssLayer3 || ZoneAbyssLayer4;
public bool ZoneAbyssLayer1 => Player.InModBiome(ModContent.GetInstance<AbyssLayer1Biome>());
public bool ZoneAbyssLayer2 => Player.InModBiome(ModContent.GetInstance<AbyssLayer2Biome>());
public bool ZoneAbyssLayer3 => Player.InModBiome(ModContent.GetInstance<AbyssLayer3Biome>());
public bool ZoneAbyssLayer4 => Player.InModBiome(ModContent.GetInstance<AbyssLayer4Biome>());
public bool abyssDeath = false;
public int abyssBreathCD;
public float caveDarkness = 0f;
@@ -1225,7 +1229,7 @@ namespace CalamityMod.CalPlayer
cooldowns = new Dictionary<string, CooldownInstance>(16);
}
public override TagCompound Save()
public override void SaveData(TagCompound tag)
{
var boost = new List<string>();
boost.AddWithCondition("extraAccessoryML", extraAccessoryML);
@@ -1301,40 +1305,34 @@ namespace CalamityMod.CalPlayer
cooldownsTag.Add(id, singleCDTag);
}
return new TagCompound
{
{ "boost", boost },
{ "rage", rage },
{ "stress", rage * (10000 / 100f) }, // Backwards compatibility -- save new rage as old stress.
{ "adrenaline", adrenaline },
{ "aquaticBoostPower", aquaticBoost },
{ "sCalDeathCount", sCalDeathCount },
{ "sCalKillCount", sCalKillCount },
{ "meleeLevel", meleeLevel },
{ "exactMeleeLevel", exactMeleeLevel },
{ "rangedLevel", rangedLevel },
{ "exactRangedLevel", exactRangedLevel },
{ "magicLevel", magicLevel },
{ "exactMagicLevel", exactMagicLevel },
{ "summonLevel", summonLevel },
{ "exactSummonLevel", exactSummonLevel },
{ "rogueLevel", rogueLevel },
{ "exactRogueLevel", exactRogueLevel },
{ "deathCount", deathCount },
{ "itemTypeLastReforged", itemTypeLastReforged },
{ "reforgeTierSafety", reforgeTierSafety },
{ "moveSpeedStat", moveSpeedStat },
{ "defenseDamage", totalDefenseDamage },
{ "defenseDamageRecoveryFrames", defenseDamageRecoveryFrames },
{ "totalDefenseDamageRecoveryFrames", totalDefenseDamageRecoveryFrames },
{ "totalSpeedrunTicks", totalTicks },
{ "lastSplitType", lastSplitType },
{ "lastSplitTicks", lastSplit.Ticks },
{ "cooldowns", cooldownsTag }
};
tag["boost"] = boost;
tag["rage"] = rage;
tag["adrenaline"] = adrenaline;
tag["aquaticBoostPower"] = aquaticBoost;
tag["sCalDeathCount"] = sCalDeathCount;
tag["sCalKillCount"] = sCalKillCount;
tag["meleeLevel"] = meleeLevel;
tag["exactMeleeLevel"] = exactMeleeLevel;
tag["rangedLevel"] = rangedLevel;
tag["exactRangedLevel"] = exactRangedLevel;
tag["magicLevel"] = magicLevel;
tag["exactMagicLevel"] = exactMagicLevel;
tag["summonLevel"] = summonLevel;
tag["exactSummonLevel"] = exactSummonLevel;
tag["rogueLevel"] = rogueLevel;
tag["exactRogueLevel"] = exactRogueLevel;
tag["itemTypeLastReforged"] = itemTypeLastReforged;
tag["reforgeTierSafety"] = reforgeTierSafety;
tag["moveSpeedStat"] = moveSpeedStat;
tag["defenseDamage"] = totalDefenseDamage;
tag["defenseDamageRecoveryFrames"] = defenseDamageRecoveryFrames;
tag["totalSpeedrunTicks"] = totalDefenseDamageRecoveryFrames;
tag["lastSplitType"] = lastSplitType;
tag["lastSplitTicks"] = lastSplit.Ticks;
tag["cooldowns"] = cooldownsTag;
}
public override void Load(TagCompound tag)
public override void LoadData(TagCompound tag)
{
var boost = tag.GetList<string>("boost");
extraAccessoryML = boost.Contains("extraAccessoryML");
@@ -1501,9 +1499,9 @@ namespace CalamityMod.CalPlayer
(NPC.downedFishron ? 0.01f : 0f) + // 0.15
(NPC.downedAncientCultist ? 0.01f : 0f) +
(NPC.downedMoonlord ? 0.01f : 0f) +
(CalamityWorld.downedProvidence ? 0.01f : 0f) +
(CalamityWorld.downedDoG ? 0.01f : 0f) +
(CalamityWorld.downedYharon ? 0.01f : 0f); // 0.2
(DownedBossSystem.downedProvidence ? 0.01f : 0f) +
(DownedBossSystem.downedDoG ? 0.01f : 0f) +
(DownedBossSystem.downedYharon ? 0.01f : 0f); // 0.2
int integerTypeBoost = (int)(floatTypeBoost * 50f);
Player.statLifeMax2 += Player.statLifeMax / 5 / 20 * integerTypeBoost;
}
@@ -2592,6 +2590,7 @@ namespace CalamityMod.CalPlayer
#endregion
#region BiomeStuff
internal static readonly FieldInfo EffectsField = typeof(SkyManager).GetField("_effects", BindingFlags.NonPublic | BindingFlags.Instance);
public override void UpdateBiomeVisuals()
@@ -2687,145 +2686,16 @@ namespace CalamityMod.CalPlayer
public override void UpdateBiomes()
{
Point point = Player.Center.ToTileCoordinates();
ZoneCalamity = CalamityWorld.calamityTiles > 50;
ZoneAstral = !Player.ZoneDungeon && (CalamityWorld.astralTiles > 950 || (Player.ZoneSnow && CalamityWorld.astralTiles > 300));
ZoneSunkenSea = CalamityWorld.sunkenSeaTiles > 150;
int x = Main.maxTilesX;
int y = Main.maxTilesY;
int genLimit = x / 2;
int abyssChasmY = y - 250;
int abyssChasmX = CalamityWorld.abyssSide ? genLimit - (genLimit - 135) : genLimit + (genLimit - 135);
bool abyssPosX = false;
bool sulphurPosX = false;
bool abyssPosY = point.Y <= abyssChasmY;
if (CalamityWorld.abyssSide)
{
if (point.X < 380)
{
sulphurPosX = true;
}
if (point.X < abyssChasmX + 80)
{
abyssPosX = true;
}
}
else
{
if (point.X > Main.maxTilesX - 380)
{
sulphurPosX = true;
}
if (point.X > abyssChasmX - 80)
{
abyssPosX = true;
}
}
ZoneAbyss = point.Y > (Main.rockLayer - y * 0.05) &&
!Player.lavaWet &&
!Player.honeyWet &&
abyssPosY &&
abyssPosX;
ZoneAbyssLayer1 = ZoneAbyss &&
point.Y <= (Main.rockLayer + y * 0.03);
ZoneAbyssLayer2 = ZoneAbyss &&
point.Y > (Main.rockLayer + y * 0.03) &&
point.Y <= (Main.rockLayer + y * 0.14);
ZoneAbyssLayer3 = ZoneAbyss &&
point.Y > (Main.rockLayer + y * 0.14) &&
point.Y <= (Main.rockLayer + y * 0.26);
ZoneAbyssLayer4 = ZoneAbyss &&
point.Y > (Main.rockLayer + y * 0.26);
ZoneSulphur = (CalamityWorld.sulphurTiles >= 300 || (Player.ZoneOverworldHeight && sulphurPosX)) && !ZoneAbyss;
//Overriding 1.4's ass req boosts
if (Main.snowTiles > 300)
Player.ZoneSnow = true;
}
public override bool CustomBiomesMatch(Player other)
{
CalamityPlayer modOther = other.Calamity();
// least common biomes checked first so it short circuits as rapidly as possible
return ZoneAbyssLayer4 == modOther.ZoneAbyssLayer4 &&
ZoneAbyssLayer3 == modOther.ZoneAbyssLayer3 &&
ZoneAbyssLayer2 == modOther.ZoneAbyssLayer2 &&
ZoneAbyssLayer1 == modOther.ZoneAbyssLayer1 &&
ZoneCalamity == modOther.ZoneCalamity &&
ZoneSulphur == modOther.ZoneSulphur &&
ZoneSunkenSea == modOther.ZoneSunkenSea &&
ZoneAbyss == modOther.ZoneAbyss &&
ZoneAstral == modOther.ZoneAstral;
}
public override void CopyCustomBiomesTo(Player other)
{
CalamityPlayer modOther = other.Calamity();
modOther.ZoneCalamity = ZoneCalamity;
modOther.ZoneAstral = ZoneAstral;
modOther.ZoneSulphur = ZoneSulphur;
modOther.ZoneSunkenSea = ZoneSunkenSea;
modOther.ZoneAbyss = ZoneAbyss;
modOther.ZoneAbyssLayer1 = ZoneAbyssLayer1;
modOther.ZoneAbyssLayer2 = ZoneAbyssLayer2;
modOther.ZoneAbyssLayer3 = ZoneAbyssLayer3;
modOther.ZoneAbyssLayer4 = ZoneAbyssLayer4;
}
public override void SendCustomBiomes(BinaryWriter writer)
{
BitsByte flags = new BitsByte();
flags[0] = ZoneCalamity;
flags[1] = ZoneAstral;
flags[2] = ZoneAbyss;
flags[3] = ZoneAbyssLayer1;
flags[4] = ZoneAbyssLayer2;
flags[5] = ZoneAbyssLayer3;
flags[6] = ZoneAbyssLayer4;
flags[7] = ZoneSulphur;
BitsByte flags2 = new BitsByte();
flags2[0] = ZoneSunkenSea;
writer.Write(flags);
writer.Write(flags2);
}
public override void ReceiveCustomBiomes(BinaryReader reader)
{
BitsByte flags = reader.ReadByte();
ZoneCalamity = flags[0];
ZoneAstral = flags[1];
ZoneAbyss = flags[2];
ZoneAbyssLayer1 = flags[3];
ZoneAbyssLayer2 = flags[4];
ZoneAbyssLayer3 = flags[5];
ZoneAbyssLayer4 = flags[6];
ZoneSulphur = flags[7];
BitsByte flags2 = reader.ReadByte();
ZoneSunkenSea = flags2[0];
}
public override Texture2D GetMapBackgroundImage()
{
if (ZoneSulphur)
{
return ModContent.Request<Texture2D>("CalamityMod/Backgrounds/MapBackgrounds/SulphurBG");
}
return ModContent.Request<Texture2D>("CalamityMod/Backgrounds/MapBackgrounds/SulphurBG").Value;
if (ZoneAstral)
{
return ModContent.Request<Texture2D>("CalamityMod/Backgrounds/MapBackgrounds/AstralBG");
}
return ModContent.Request<Texture2D>("CalamityMod/Backgrounds/MapBackgrounds/AstralBG").Value;
return null;
}
#endregion
@@ -3863,9 +3733,9 @@ namespace CalamityMod.CalPlayer
(NPC.downedFishron ? 0.01f : 0f) + // 0.15
(NPC.downedAncientCultist ? 0.01f : 0f) +
(NPC.downedMoonlord ? 0.01f : 0f) +
(CalamityWorld.downedProvidence ? 0.01f : 0f) +
(CalamityWorld.downedDoG ? 0.01f : 0f) +
(CalamityWorld.downedYharon ? 0.01f : 0f); // 0.2
(DownedBossSystem.downedProvidence ? 0.01f : 0f) +
(DownedBossSystem.downedDoG ? 0.01f : 0f) +
(DownedBossSystem.downedYharon ? 0.01f : 0f); // 0.2
meleeSpeedMult += floatTypeBoost * 0.25f;
}
if (eArtifact)
@@ -4098,7 +3968,7 @@ namespace CalamityMod.CalPlayer
public override bool CanSellItem(NPC vendor, Item[] shopInventory, Item item)
{
if (item.type == ModContent.ItemType<ProfanedSoulCrystal>())
return CalamityWorld.downedSCal; //no easy moneycoins for post doggo/yhar
return DownedBossSystem.downedSCal; //no easy moneycoins for post doggo/yhar
return base.CanSellItem(vendor, shopInventory, item);
}
@@ -8831,19 +8701,19 @@ namespace CalamityMod.CalPlayer
// start with a vanilla cost of zero instead of 3 silver
price -= Item.buyPrice(0, 0, 3, 0);
if (CalamityWorld.downedYharon)
if (DownedBossSystem.downedYharon)
price += Item.buyPrice(0, 9, 0, 0);
else if (CalamityWorld.downedDoG)
else if (DownedBossSystem.downedDoG)
price += Item.buyPrice(0, 6, 0, 0);
else if (CalamityWorld.downedProvidence)
else if (DownedBossSystem.downedProvidence)
price += Item.buyPrice(0, 3, 20, 0);
else if (NPC.downedMoonlord)
price += Item.buyPrice(0, 2, 0, 0);
else if (NPC.downedFishron || CalamityWorld.downedPlaguebringer || CalamityWorld.downedScavenger)
else if (NPC.downedFishron || DownedBossSystem.downedPlaguebringer || DownedBossSystem.downedScavenger)
price += Item.buyPrice(0, 1, 20, 0);
else if (NPC.downedGolemBoss)
price += Item.buyPrice(0, 0, 90, 0);
else if (NPC.downedPlantBoss || CalamityWorld.downedCalamitas)
else if (NPC.downedPlantBoss || DownedBossSystem.downedCalamitas)
price += Item.buyPrice(0, 0, 60, 0);
else if (NPC.downedMechBossAny)
price += Item.buyPrice(0, 0, 40, 0);
+86 -80
View File
@@ -1,4 +1,4 @@
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Accessories;
using CalamityMod.Events;
using CalamityMod.Items.Fishing;
using CalamityMod.Items.Fishing.AstralCatches;
@@ -18,17 +18,23 @@ using System.Linq;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems;
using Terraria.DataStructures;
namespace CalamityMod.CalPlayer
{
public partial class CalamityPlayer : ModPlayer
{
#region Catch Fish
public override void CatchFish(Item fishingRod, Item bait, int power, int liquidType, int poolSize, int worldLayer, int questFish, ref int caughtType, ref bool junk)
public override void CatchFish(FishingAttempt attempt, ref int itemDrop, ref int npcSpawn, ref AdvancedPopupRequest sonar, ref Vector2 sonarPosition)
{
bool water = liquidType == 0;
bool lava = liquidType == 1;
bool honey = liquidType == 2;
int bait = attempt.playerFishingConditions.BaitItemType;
int power = attempt.playerFishingConditions.BaitPower + attempt.playerFishingConditions.PolePower;
int questFish = attempt.questFish;
int poolSize = attempt.waterTilesCount;
bool water = !attempt.inHoney && !attempt.inLava;
bool lava = attempt.inLava;
bool honey = attempt.inHoney;
Point point = Player.Center.ToTileCoordinates();
bool canSulphurFish = false;
@@ -47,35 +53,35 @@ namespace CalamityMod.CalPlayer
canSulphurFish = true;
// Old Duke spawn
if (canSulphurFish && bait.type == ModContent.ItemType<BloodwormItem>() && water && !BossRushEvent.BossRushActive)
if (canSulphurFish && bait == ModContent.ItemType<BloodwormItem>() && water && !BossRushEvent.BossRushActive)
{
CalamityGlobalNPC.OldDukeSpawn(Player.whoAmI, ModContent.NPCType<OldDuke>(), bait.type);
CalamityGlobalNPC.OldDukeSpawn(Player.whoAmI, ModContent.NPCType<OldDuke>(), bait);
}
// Quest Fish
if (ZoneSunkenSea && questFish == ModContent.ItemType<EutrophicSandfish>() && Main.rand.NextBool(10))
{
caughtType = ModContent.ItemType<EutrophicSandfish>();
itemDrop = ModContent.ItemType<EutrophicSandfish>();
return;
}
if (ZoneSunkenSea && questFish == ModContent.ItemType<SurfClam>() && Main.rand.NextBool(10))
{
caughtType = ModContent.ItemType<SurfClam>();
itemDrop = ModContent.ItemType<SurfClam>();
return;
}
if (ZoneSunkenSea && questFish == ModContent.ItemType<Serpentuna>() && Main.rand.NextBool(10))
{
caughtType = ModContent.ItemType<Serpentuna>();
itemDrop = ModContent.ItemType<Serpentuna>();
return;
}
if (ZoneCalamity && questFish == ModContent.ItemType<Brimlish>() && Main.rand.NextBool(10))
{
caughtType = ModContent.ItemType<Brimlish>();
itemDrop = ModContent.ItemType<Brimlish>();
return;
}
if (ZoneCalamity && questFish == ModContent.ItemType<Slurpfish>() && Main.rand.NextBool(10))
{
caughtType = ModContent.ItemType<Slurpfish>();
itemDrop = ModContent.ItemType<Slurpfish>();
return;
}
@@ -105,7 +111,7 @@ namespace CalamityMod.CalPlayer
fishList.Add(ItemID.ArmoredCavefish);
fishList.Add(ItemID.Stinkfish);
fishList.Add(ItemID.SpecularFish);
fishList.AddWithCondition<int>(ItemID.ChaosFish, Player.ZoneHoly);
fishList.AddWithCondition<int>(ItemID.ChaosFish, Player.ZoneHallow);
fishList.AddWithCondition<int>(ItemID.VariegatedLardfish, Player.ZoneJungle);
}
if (Player.ZoneOverworldHeight || Player.ZoneSkyHeight)
@@ -116,8 +122,8 @@ namespace CalamityMod.CalPlayer
fishList.AddWithCondition<int>(ItemID.Ebonkoi, Player.ZoneCorrupt);
fishList.AddWithCondition<int>(ItemID.CrimsonTigerfish, Player.ZoneCrimson);
fishList.AddWithCondition<int>(ItemID.Hemopiranha, Player.ZoneCrimson);
fishList.AddWithCondition<int>(ItemID.PrincessFish, Player.ZoneHoly);
fishList.AddWithCondition<int>(ItemID.Prismite, Player.ZoneHoly);
fishList.AddWithCondition<int>(ItemID.PrincessFish, Player.ZoneHallow);
fishList.AddWithCondition<int>(ItemID.Prismite, Player.ZoneHallow);
fishList.AddWithCondition<int>(ItemID.Damselfish, Player.ZoneSkyHeight);
fishList.AddWithCondition<int>(ModContent.ItemType<AldebaranAlewife>(), ZoneAstral);
fishList.AddWithCondition<int>(ModContent.ItemType<CoralskinFoolfish>(), ZoneSunkenSea);
@@ -129,7 +135,7 @@ namespace CalamityMod.CalPlayer
{
int fishAmt = fishList.Count;
int caughtFish = fishList[Main.rand.Next(fishAmt)];
caughtType = caughtFish;
itemDrop = caughtFish;
return;
}
}
@@ -170,7 +176,7 @@ namespace CalamityMod.CalPlayer
if (Main.rand.NextBool(chanceForBiomeCrate))
{
if (ZoneCalamity)
caughtType = ModContent.ItemType<BrimstoneCrate>();
itemDrop = ModContent.ItemType<BrimstoneCrate>();
}
}
}
@@ -222,24 +228,24 @@ namespace CalamityMod.CalPlayer
break;
}
}
if (Player.ZoneSnow && Player.ZoneRockLayerHeight && (Player.ZoneCorrupt || Player.ZoneCrimson || Player.ZoneHoly))
if (Player.ZoneSnow && Player.ZoneRockLayerHeight && (Player.ZoneCorrupt || Player.ZoneCrimson || Player.ZoneHallow))
{
rareItemList.Add(ItemID.ScalyTruffle);
}
rareItemList.AddWithCondition<int>(ItemID.Toxikarp, Player.ZoneCorrupt);
rareItemList.AddWithCondition<int>(ItemID.Bladetongue, Player.ZoneCrimson);
rareItemList.AddWithCondition<int>(ItemID.CrystalSerpent, Player.ZoneHoly);
rareItemList.AddWithCondition<int>(ItemID.CrystalSerpent, Player.ZoneHallow);
if (rareItemList.Any())
{
int rareItemAmt = rareItemList.Count;
int caughtRareItem = rareItemList[Main.rand.Next(rareItemAmt)];
caughtType = caughtRareItem;
itemDrop = caughtRareItem;
}
}
else if (Main.rand.NextBool(chanceForGoldCrate))
{
caughtType = ItemID.GoldenCrate;
itemDrop = ItemID.GoldenCrate;
}
else if (Main.rand.NextBool(chanceForBiomeCrate))
{
@@ -250,7 +256,7 @@ namespace CalamityMod.CalPlayer
biomeCrateList.AddWithCondition<int>(ModContent.ItemType<AbyssalCrate>(), canSulphurFish);
biomeCrateList.AddWithCondition<int>(ItemID.CorruptFishingCrate, Player.ZoneCorrupt);
biomeCrateList.AddWithCondition<int>(ItemID.CrimsonFishingCrate, Player.ZoneCrimson);
biomeCrateList.AddWithCondition<int>(ItemID.HallowedFishingCrate, Player.ZoneHoly);
biomeCrateList.AddWithCondition<int>(ItemID.HallowedFishingCrate, Player.ZoneHallow);
biomeCrateList.AddWithCondition<int>(ItemID.DungeonFishingCrate, Player.ZoneDungeon);
biomeCrateList.AddWithCondition<int>(ItemID.JungleFishingCrate, Player.ZoneJungle);
biomeCrateList.AddWithCondition<int>(ItemID.FloatingIslandFishingCrate, Player.ZoneSkyHeight);
@@ -259,16 +265,16 @@ namespace CalamityMod.CalPlayer
{
int biomeCrateAmt = biomeCrateList.Count;
int caughtBiomeCrate = biomeCrateList[Main.rand.Next(biomeCrateAmt)];
caughtType = caughtBiomeCrate;
itemDrop = caughtBiomeCrate;
}
}
else if (Main.rand.NextBool(chanceForIronCrate))
{
caughtType = ItemID.IronCrate;
itemDrop = ItemID.IronCrate;
}
else
{
caughtType = ItemID.WoodenCrate;
itemDrop = ItemID.WoodenCrate;
}
return;
}
@@ -277,7 +283,7 @@ namespace CalamityMod.CalPlayer
if (water)
{
if (caughtType == ItemID.WoodenCrate || caughtType == ItemID.IronCrate || caughtType == ItemID.GoldenCrate || caughtType == ItemID.FrogLeg || caughtType == ItemID.BalloonPufferfish || caughtType == ItemID.ZephyrFish)
if (itemDrop == ItemID.WoodenCrate || itemDrop == ItemID.IronCrate || itemDrop == ItemID.GoldenCrate || itemDrop == ItemID.FrogLeg || itemDrop == ItemID.BalloonPufferfish || itemDrop == ItemID.ZephyrFish)
{
return;
}
@@ -285,15 +291,15 @@ namespace CalamityMod.CalPlayer
{
if (Main.rand.NextBool(25))
{
caughtType = ModContent.ItemType<FishofNight>();
itemDrop = ModContent.ItemType<FishofNight>();
}
}
if (Player.ZoneHoly && Player.ZoneRockLayerHeight && Main.hardMode)
if (Player.ZoneHallow && Player.ZoneRockLayerHeight && Main.hardMode)
{
if (Main.rand.NextBool(25))
{
caughtType = ModContent.ItemType<FishofLight>();
itemDrop = ModContent.ItemType<FishofLight>();
}
}
@@ -301,7 +307,7 @@ namespace CalamityMod.CalPlayer
{
if (Main.rand.NextBool(25))
{
caughtType = Main.rand.NextBool() ? ModContent.ItemType<SunbeamFish>() : ModContent.ItemType<FishofFlight>();
itemDrop = Main.rand.NextBool() ? ModContent.ItemType<SunbeamFish>() : ModContent.ItemType<FishofFlight>();
}
}
@@ -309,7 +315,7 @@ namespace CalamityMod.CalPlayer
{
if (Main.rand.NextBool(10))
{
caughtType = ModContent.ItemType<EnchantedStarfish>();
itemDrop = ModContent.ItemType<EnchantedStarfish>();
}
}
@@ -317,7 +323,7 @@ namespace CalamityMod.CalPlayer
{
if (Main.rand.NextBool(25))
{
caughtType = ModContent.ItemType<StuffedFish>();
itemDrop = ModContent.ItemType<StuffedFish>();
}
}
@@ -325,7 +331,7 @@ namespace CalamityMod.CalPlayer
{
if (Main.rand.NextBool(25))
{
caughtType = ModContent.ItemType<GlimmeringGemfish>();
itemDrop = ModContent.ItemType<GlimmeringGemfish>();
}
}
@@ -333,7 +339,7 @@ namespace CalamityMod.CalPlayer
{
if (Main.rand.NextBool(25) && Main.hardMode)
{
caughtType = ModContent.ItemType<FishofEleum>();
itemDrop = ModContent.ItemType<FishofEleum>();
}
}
@@ -341,7 +347,7 @@ namespace CalamityMod.CalPlayer
{
if (Main.rand.NextBool(Main.hardMode ? 100 : 40))
{
caughtType = ModContent.ItemType<Spadefish>();
itemDrop = ModContent.ItemType<Spadefish>();
}
}
@@ -350,39 +356,39 @@ namespace CalamityMod.CalPlayer
int astralFish = Main.rand.Next(100);
if (astralFish >= 85) // 15%
{
caughtType = ModContent.ItemType<ProcyonidPrawn>();
itemDrop = ModContent.ItemType<ProcyonidPrawn>();
}
else if (astralFish <= 84 && astralFish >= 70) // 15%
{
caughtType = ModContent.ItemType<ArcturusAstroidean>();
itemDrop = ModContent.ItemType<ArcturusAstroidean>();
}
else if (astralFish <= 69 && astralFish >= 55) // 15%
{
caughtType = ModContent.ItemType<AldebaranAlewife>();
itemDrop = ModContent.ItemType<AldebaranAlewife>();
}
else if (Player.cratePotion && astralFish <= 18 && astralFish >= 9) // 10%
{
caughtType = ModContent.ItemType<AstralCrate>();
itemDrop = ModContent.ItemType<AstralCrate>();
}
else if (!Player.cratePotion && astralFish <= 13 && astralFish >= 9) // 5%
{
caughtType = ModContent.ItemType<AstralCrate>();
itemDrop = ModContent.ItemType<AstralCrate>();
}
else if (astralFish <= 8 && astralFish >= 6) // 3%
{
caughtType = ModContent.ItemType<UrsaSergeant>();
itemDrop = ModContent.ItemType<UrsaSergeant>();
}
else if (astralFish <= 5 && astralFish >= 3) // 3%
{
caughtType = ModContent.ItemType<GacruxianMollusk>();
itemDrop = ModContent.ItemType<GacruxianMollusk>();
}
else if (astralFish <= 2 && astralFish >= 0) // 3%
{
caughtType = ModContent.ItemType<PolarisParrotfish>();
itemDrop = ModContent.ItemType<PolarisParrotfish>();
}
else // 36% w/o crate pot, 31% w/ crate pot
{
caughtType = ModContent.ItemType<TwinklingPollox>();
itemDrop = ModContent.ItemType<TwinklingPollox>();
return;
}
}
@@ -392,57 +398,57 @@ namespace CalamityMod.CalPlayer
int sunkenFish = Main.rand.Next(100);
if (sunkenFish >= 85 && Main.hardMode) // 15%
{
caughtType = ModContent.ItemType<ScarredAngelfish>();
itemDrop = ModContent.ItemType<ScarredAngelfish>();
}
else if (sunkenFish <= 84 && sunkenFish >= 70) // 15%
{
caughtType = ModContent.ItemType<SunkenSailfish>();
itemDrop = ModContent.ItemType<SunkenSailfish>();
}
else if (sunkenFish <= 69 && sunkenFish >= 55) // 15%
{
caughtType = ModContent.ItemType<CoralskinFoolfish>();
itemDrop = ModContent.ItemType<CoralskinFoolfish>();
}
else if (Player.cratePotion && sunkenFish <= 18 && sunkenFish >= 9) // 10%
{
caughtType = ModContent.ItemType<SunkenCrate>();
itemDrop = ModContent.ItemType<SunkenCrate>();
}
else if (!Player.cratePotion && sunkenFish <= 13 && sunkenFish >= 9) // 5%
{
caughtType = ModContent.ItemType<SunkenCrate>();
itemDrop = ModContent.ItemType<SunkenCrate>();
}
else if (sunkenFish <= 31 && sunkenFish >= 29) // 3%
{
caughtType = ModContent.ItemType<GreenwaveLoach>();
itemDrop = ModContent.ItemType<GreenwaveLoach>();
}
else if (sunkenFish <= 8 && sunkenFish >= 6 && Main.hardMode) // 3%
{
caughtType = ModContent.ItemType<SerpentsBite>();
itemDrop = ModContent.ItemType<SerpentsBite>();
}
else if (sunkenFish <= 5 && sunkenFish >= 3) // 3%
{
caughtType = ModContent.ItemType<RustedJingleBell>();
itemDrop = ModContent.ItemType<RustedJingleBell>();
}
else if (sunkenFish <= 2 && sunkenFish >= 0 && CalamityWorld.downedDesertScourge) // 3%
else if (sunkenFish <= 2 && sunkenFish >= 0 && DownedBossSystem.downedDesertScourge) // 3%
{
caughtType = ModContent.ItemType<SparklingEmpress>();
itemDrop = ModContent.ItemType<SparklingEmpress>();
}
else // 38% w/o crate pot, 33% w/ crate pot + 18% if prehardmode
{
caughtType = ModContent.ItemType<PrismaticGuppy>();
itemDrop = ModContent.ItemType<PrismaticGuppy>();
return;
}
}
if (Player.FindBuffIndex(BuffID.Gills) > -1 && CalamityWorld.downedCalamitas && Main.rand.NextBool(25))
if (Player.FindBuffIndex(BuffID.Gills) > -1 && DownedBossSystem.downedCalamitas && Main.rand.NextBool(25))
{
caughtType = ModContent.ItemType<Floodtide>();
itemDrop = ModContent.ItemType<Floodtide>();
}
if (junk)
if (attempt.common)
{
if (canSulphurFish)
{
caughtType = ModContent.ItemType<PlantyMush>();
itemDrop = ModContent.ItemType<PlantyMush>();
}
return;
}
@@ -459,10 +465,10 @@ namespace CalamityMod.CalPlayer
}
switch (Main.rand.Next(4))
{
case 0: caughtType = ModContent.ItemType<IronBoots>(); break; //movement acc
case 1: caughtType = ModContent.ItemType<DepthCharm>(); break; //regen acc
case 2: caughtType = ModContent.ItemType<AnechoicPlating>(); break; //defense acc
case 3: caughtType = ModContent.ItemType<StrangeOrb>(); break; //light pet
case 0: itemDrop = ModContent.ItemType<IronBoots>(); break; //movement acc
case 1: itemDrop = ModContent.ItemType<DepthCharm>(); break; //regen acc
case 2: itemDrop = ModContent.ItemType<AnechoicPlating>(); break; //defense acc
case 3: itemDrop = ModContent.ItemType<StrangeOrb>(); break; //light pet
}
return;
}*/
@@ -471,11 +477,11 @@ namespace CalamityMod.CalPlayer
{
if (Main.rand.NextBool(15))
{
caughtType = ModContent.ItemType<PlantyMush>();
itemDrop = ModContent.ItemType<PlantyMush>();
}
if (Main.rand.NextFloat() < 0.08f)
{
caughtType = Utils.SelectRandom(Main.rand, new int[]
itemDrop = Utils.SelectRandom(Main.rand, new int[]
{
ModContent.ItemType<AlluringBait>(),
ModContent.ItemType<AbyssalAmulet>()
@@ -483,11 +489,11 @@ namespace CalamityMod.CalPlayer
}
if (Player.cratePotion && Main.rand.NextBool(5)) // 20%
{
caughtType = ModContent.ItemType<AbyssalCrate>();
itemDrop = ModContent.ItemType<AbyssalCrate>();
}
else if (!Player.cratePotion && Main.rand.NextBool(10)) // 10%
{
caughtType = ModContent.ItemType<AbyssalCrate>();
itemDrop = ModContent.ItemType<AbyssalCrate>();
}
}
@@ -495,7 +501,7 @@ namespace CalamityMod.CalPlayer
{
if (Main.rand.NextBool(25))
{
caughtType = ModContent.ItemType<Xerocodile>();
itemDrop = ModContent.ItemType<Xerocodile>();
}
}
}
@@ -507,43 +513,43 @@ namespace CalamityMod.CalPlayer
int cragFish = Main.rand.Next(100);
if (cragFish >= 85) // 15%
{
caughtType = ModContent.ItemType<CoastalDemonfish>();
itemDrop = ModContent.ItemType<CoastalDemonfish>();
}
else if (cragFish <= 84 && cragFish >= 70) // 15%
{
caughtType = ModContent.ItemType<BrimstoneFish>();
itemDrop = ModContent.ItemType<BrimstoneFish>();
}
else if (cragFish <= 69 && cragFish >= 55) // 15%
{
caughtType = ModContent.ItemType<Shadowfish>();
itemDrop = ModContent.ItemType<Shadowfish>();
}
else if (cragFish <= 54 && cragFish >= 41 && Main.hardMode) // 14%
{
caughtType = ModContent.ItemType<ChaoticFish>();
itemDrop = ModContent.ItemType<ChaoticFish>();
}
else if (Player.cratePotion && cragFish <= 30 && cragFish >= 21) // 10%
{
caughtType = ModContent.ItemType<BrimstoneCrate>();
itemDrop = ModContent.ItemType<BrimstoneCrate>();
}
else if (!Player.cratePotion && cragFish <= 25 && cragFish >= 21) // 5%
{
caughtType = ModContent.ItemType<BrimstoneCrate>();
itemDrop = ModContent.ItemType<BrimstoneCrate>();
}
else if (cragFish <= 20 && cragFish >= 11 && CalamityWorld.downedProvidence) // 10%
else if (cragFish <= 20 && cragFish >= 11 && DownedBossSystem.downedProvidence) // 10%
{
caughtType = ModContent.ItemType<Bloodfin>();
itemDrop = ModContent.ItemType<Bloodfin>();
}
else if (cragFish <= 10 && cragFish >= (Main.hardMode ? 8 : 6)) // 5% (3% hardmode)
{
caughtType = ModContent.ItemType<DragoonDrizzlefish>();
itemDrop = ModContent.ItemType<DragoonDrizzlefish>();
}
else if (cragFish <= 2 && cragFish >= 0) // 3%
{
caughtType = ModContent.ItemType<CharredLasher>();
itemDrop = ModContent.ItemType<CharredLasher>();
}
else // 32% w/o crate pot, 27% w/ crate pot, add 10% pre-Prov, add another 12% prehardmode
{
caughtType = ModContent.ItemType<CragBullhead>();
itemDrop = ModContent.ItemType<CragBullhead>();
}
}
}
@@ -551,7 +557,7 @@ namespace CalamityMod.CalPlayer
#endregion
#region Get Fishing Level
public override void GetFishingLevel(Item fishingRod, Item bait, ref int fishingLevel)
public override void GetFishingLevel(Item fishingRod, Item bait, ref float fishingLevel)
{
if ((ZoneAstral || ZoneAbyss || ZoneSulphur) && bait.type == ModContent.ItemType<ArcturusAstroidean>())
fishingLevel = (int)(fishingLevel * 1.1f);
+5 -5
View File
@@ -230,9 +230,9 @@ namespace CalamityMod.CalPlayer
Player.lifeRegenTime = 0;
lifeRegenLost += 6;
if (CalamityWorld.downedAquaticScourge)
if (DownedBossSystem.downedAquaticScourge)
lifeRegenLost += 6;
if (CalamityWorld.downedPolterghast)
if (DownedBossSystem.downedPolterghast)
lifeRegenLost += 12;
}
@@ -731,9 +731,9 @@ namespace CalamityMod.CalPlayer
(NPC.downedFishron ? 0.01f : 0f) + // 0.15
(NPC.downedAncientCultist ? 0.01f : 0f) +
(NPC.downedMoonlord ? 0.01f : 0f) +
(CalamityWorld.downedProvidence ? 0.01f : 0f) +
(CalamityWorld.downedDoG ? 0.01f : 0f) +
(CalamityWorld.downedYharon ? 0.01f : 0f); // 0.2
(DownedBossSystem.downedProvidence ? 0.01f : 0f) +
(DownedBossSystem.downedDoG ? 0.01f : 0f) +
(DownedBossSystem.downedYharon ? 0.01f : 0f); // 0.2
int integerTypeBoost = (int)(floatTypeBoost * 50f);
int regenBoost = 1 + (integerTypeBoost / 5);
bool lesserEffect = false;
+5 -5
View File
@@ -757,7 +757,7 @@ namespace CalamityMod.CalPlayer
if (Player.miscCounter % slimeRainRate == 0f)
{
if (CalamityWorld.downedAquaticScourge && !CalamityWorld.downedPolterghast && Main.rand.NextBool(12))
if (DownedBossSystem.downedAquaticScourge && !DownedBossSystem.downedPolterghast && Main.rand.NextBool(12))
{
NPC.NewNPC((int)spawnPoint.X, (int)spawnPoint.Y, ModContent.NPCType<IrradiatedSlime>());
}
@@ -875,7 +875,7 @@ namespace CalamityMod.CalPlayer
AllCritBoost(critUp);
}
bool canProvideBuffs = profanedCrystalBuffs || (!profanedCrystal && pArtifact) || (profanedCrystal && CalamityWorld.downedSCal && CalamityWorld.downedExoMechs);
bool canProvideBuffs = profanedCrystalBuffs || (!profanedCrystal && pArtifact) || (profanedCrystal && DownedBossSystem.downedSCal && DownedBossSystem.downedExoMechs);
bool attack = Player.ownedProjectileCounts[ModContent.ProjectileType<MiniGuardianAttack>()] > 0;
// Guardian bonuses if not burnt out
@@ -2643,9 +2643,9 @@ namespace CalamityMod.CalPlayer
(NPC.downedFishron ? 0.01f : 0f) + // 0.15
(NPC.downedAncientCultist ? 0.01f : 0f) +
(NPC.downedMoonlord ? 0.01f : 0f) +
(CalamityWorld.downedProvidence ? 0.01f : 0f) +
(CalamityWorld.downedDoG ? 0.01f : 0f) +
(CalamityWorld.downedYharon ? 0.01f : 0f); // 0.2
(DownedBossSystem.downedProvidence ? 0.01f : 0f) +
(DownedBossSystem.downedDoG ? 0.01f : 0f) +
(DownedBossSystem.downedYharon ? 0.01f : 0f); // 0.2
int integerTypeBoost = (int)(floatTypeBoost * 50f);
int critBoost = integerTypeBoost / 2;
float damageBoost = floatTypeBoost * 0.5f;
+30 -805
View File
@@ -1,4 +1,4 @@
using CalamityMod.Balancing;
using CalamityMod.Balancing;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.CalPlayer;
@@ -57,6 +57,7 @@ using CalamityMod.Waters;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using System;
using System.Collections.Generic;
using System.Diagnostics;
@@ -64,6 +65,7 @@ using System.IO;
using System.Reflection;
using Terraria;
using Terraria.DataStructures;
using Terraria.GameContent;
using Terraria.GameContent.Dyes;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
@@ -84,11 +86,11 @@ namespace CalamityMod
public static int sharkKillCount = 0;
// Textures
public static Texture2D heartOriginal2;
public static Texture2D heartOriginal;
public static Texture2D rainOriginal;
public static Texture2D manaOriginal;
public static Texture2D carpetOriginal;
public static Asset<Texture2D> heartOriginal2;
public static Asset<Texture2D> heartOriginal;
public static Asset<Texture2D> rainOriginal;
public static Asset<Texture2D> manaOriginal;
public static Asset<Texture2D> carpetOriginal;
public static Texture2D AstralCactusTexture;
public static Texture2D AstralCactusGlowTexture;
public static Texture2D AstralSky;
@@ -141,11 +143,11 @@ namespace CalamityMod
Instance = this;
// Save vanilla textures.
heartOriginal2 = Main.heartTexture;
heartOriginal = Main.heart2Texture;
rainOriginal = Main.rainTexture;
manaOriginal = Main.manaTexture;
carpetOriginal = Main.flyingCarpetTexture;
heartOriginal2 = TextureAssets.Heart;
heartOriginal = TextureAssets.Heart2;
rainOriginal = TextureAssets.Rain;
manaOriginal = TextureAssets.Mana;
carpetOriginal = TextureAssets.FlyingCarpet;
// Apply IL edits instantly afterwards.
ILChanges.Load();
@@ -173,12 +175,10 @@ namespace CalamityMod
CalamityGlobalItem.LoadTweaks();
// Mount balancing occurs during runtime and is undone when Calamity is unloaded.
Mount.mounts[Mount.Unicorn].dashSpeed *= CalamityPlayer.UnicornSpeedNerfPower;
Mount.mounts[Mount.Unicorn].runSpeed *= CalamityPlayer.UnicornSpeedNerfPower;
Mount.mounts[Mount.MinecartMech].dashSpeed *= CalamityPlayer.MechanicalCartSpeedNerfPower;
Mount.mounts[Mount.MinecartMech].runSpeed *= CalamityPlayer.MechanicalCartSpeedNerfPower;
Mount.mounts[MountID.Unicorn].dashSpeed *= CalamityPlayer.UnicornSpeedNerfPower;
Mount.mounts[MountID.Unicorn].runSpeed *= CalamityPlayer.UnicornSpeedNerfPower;
Mount.mounts[MountID.MinecartMech].dashSpeed *= CalamityPlayer.MechanicalCartSpeedNerfPower;
Mount.mounts[MountID.MinecartMech].runSpeed *= CalamityPlayer.MechanicalCartSpeedNerfPower;
if (!Main.dedServ)
{
@@ -240,9 +240,9 @@ namespace CalamityMod
AddEquipTexture(null, EquipType.Legs, "CirrusDress_Legs", "CalamityMod/Items/Armor/CirrusDress_Legs");
AstralCactusTexture = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/Tiles/AstralCactus");
AstralCactusGlowTexture = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/Tiles/AstralCactusGlow");
AstralSky = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/AstralSky");
AstralCactusTexture = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/Tiles/AstralCactus", AssetRequestMode.ImmediateLoad).Value;
AstralCactusGlowTexture = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/Tiles/AstralCactusGlow", AssetRequestMode.ImmediateLoad).Value;
AstralSky = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/AstralSky", AssetRequestMode.ImmediateLoad).Value;
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();
@@ -365,17 +365,17 @@ namespace CalamityMod
if (!Main.dedServ)
{
Main.heartTexture = heartOriginal2;
Main.heart2Texture = heartOriginal;
Main.rainTexture = rainOriginal;
Main.manaTexture = manaOriginal;
Main.flyingCarpetTexture = carpetOriginal;
TextureAssets.Heart = heartOriginal2;
TextureAssets.Heart2 = heartOriginal;
TextureAssets.Rain = rainOriginal;
TextureAssets.Mana = manaOriginal;
TextureAssets.FlyingCarpet = carpetOriginal;
GeneralParticleHandler.Unload();
}
Mount.mounts[Mount.Unicorn].dashSpeed /= CalamityPlayer.UnicornSpeedNerfPower;
Mount.mounts[Mount.Unicorn].runSpeed /= CalamityPlayer.UnicornSpeedNerfPower;
Mount.mounts[Mount.MinecartMech].dashSpeed /= CalamityPlayer.MechanicalCartSpeedNerfPower;
Mount.mounts[Mount.MinecartMech].runSpeed /= CalamityPlayer.MechanicalCartSpeedNerfPower;
Mount.mounts[MountID.Unicorn].dashSpeed /= CalamityPlayer.UnicornSpeedNerfPower;
Mount.mounts[MountID.Unicorn].runSpeed /= CalamityPlayer.UnicornSpeedNerfPower;
Mount.mounts[MountID.MinecartMech].dashSpeed /= CalamityPlayer.MechanicalCartSpeedNerfPower;
Mount.mounts[MountID.MinecartMech].runSpeed /= CalamityPlayer.MechanicalCartSpeedNerfPower;
heartOriginal2 = null;
heartOriginal = null;
@@ -418,19 +418,6 @@ namespace CalamityMod
}
#endregion
#region Fusable Particle Updating
public override void MidUpdateProjectileItem()
{
// Update all fusable particles.
// These are really only visual and as such don't really need any complex netcode.
foreach (BaseFusableParticleSet.FusableParticleRenderCollection particleSet in FusableParticleManager.ParticleSets)
{
foreach (BaseFusableParticleSet.FusableParticle particle in particleSet.ParticleSet.Particles)
particleSet.ParticleSet.UpdateBehavior(particle);
}
}
#endregion
#region Vanilla Enemy DR
private void SetupVanillaDR()
{
@@ -763,7 +750,7 @@ namespace CalamityMod
#region Music
// This function returns an available Calamity Music Mod track, or null if the Calamity Music Mod is not available.
public int? GetMusicFromMusicMod(string songFilename) => MusicAvailable ? (int?)musicMod.GetSoundSlot(SoundType.Music, "Sounds/Music/" + songFilename) : null;
public int? GetMusicFromMusicMod(string songFilename) => MusicAvailable ? MusicLoader.GetMusicSlot(musicMod, "Sounds/Music/" + songFilename) : null;
public override void UpdateMusic(ref int music, ref MusicPriority priority)
{
@@ -772,80 +759,6 @@ namespace CalamityMod
if (Main.myPlayer != -1 && !Main.gameMenu && Main.LocalPlayer.active)
{
Player p = Main.LocalPlayer;
if (p.InCalamity())
{
if (!CalamityPlayer.areThereAnyDamnBosses)
{
music = GetMusicFromMusicMod("Crag") ?? MusicID.Eerie;
priority = MusicPriority.Environment;
}
}
if (p.InSunkenSea())
{
if (!CalamityPlayer.areThereAnyDamnBosses)
{
music = GetMusicFromMusicMod("SunkenSea") ?? MusicID.Temple;
priority = MusicPriority.Environment;
}
}
if (p.InAstral(1))
{
if (!CalamityPlayer.areThereAnyDamnBosses)
{
music = GetMusicFromMusicMod("Astral") ?? MusicID.Space;
priority = MusicPriority.Environment;
}
}
if (p.InAstral(2))
{
if (!CalamityPlayer.areThereAnyDamnBosses)
{
music = GetMusicFromMusicMod("AstralUnderground") ?? MusicID.Space;
priority = MusicPriority.Environment;
}
}
if (p.InAbyss(1) || p.InAbyss(2))
{
if (!CalamityPlayer.areThereAnyDamnBosses)
{
music = GetMusicFromMusicMod("Abyss1") ?? MusicID.Hell;
priority = MusicPriority.BiomeHigh;
}
}
if (p.InAbyss(3))
{
if (!CalamityPlayer.areThereAnyDamnBosses)
{
music = GetMusicFromMusicMod("Abyss2") ?? MusicID.Hell;
priority = MusicPriority.BiomeHigh;
}
}
if (p.InAbyss(4))
{
if (!CalamityPlayer.areThereAnyDamnBosses)
{
music = GetMusicFromMusicMod("Abyss3") ?? MusicID.Hell;
priority = MusicPriority.BiomeHigh;
}
}
if (p.InSulphur())
{
if (!CalamityPlayer.areThereAnyDamnBosses)
{
bool acidRain = CalamityWorld.rainingAcid;
priority = acidRain ? MusicPriority.Event : MusicPriority.BiomeHigh;
// Acid Rain themes
if (acidRain)
music = CalamityWorld.downedPolterghast
? GetMusicFromMusicMod("AcidRain2") ?? MusicID.Eclipse // Acid Rain Tier 3
: GetMusicFromMusicMod("AcidRain1") ?? MusicID.OldOnesArmy; // Acid Rain Tier 1 + 2
// Regular Sulphur Sea theme, when Acid Rain is not occurring
else
music = GetMusicFromMusicMod("SulphurousSea") ?? MusicID.Desert;
}
}
if (CalamityWorld.DoGSecondStageCountdown <= 530 && CalamityWorld.DoGSecondStageCountdown > 50) // 8 seconds before DoG returns
{
music = GetMusicFromMusicMod("DevourerOfGodsP2") ?? MusicID.LunarBoss;
@@ -866,613 +779,12 @@ namespace CalamityMod
}
#endregion
#region Lighting Effects
public override void ModifySunLightColor(ref Color tileColor, ref Color backgroundColor)
{
if (Main.gameMenu)
BossRushEvent.StartTimer = 0;
float bossRushWhiteFade = BossRushEvent.StartTimer / (float)BossRushEvent.StartEffectTotalTime;
if (BossRushSky.ShouldDrawRegularly)
bossRushWhiteFade = 1f;
if (BossRushEvent.BossRushActive || BossRushEvent.StartTimer > 0 || BossRushSky.ShouldDrawRegularly)
{
backgroundColor = Color.Lerp(backgroundColor, Color.LightGray, bossRushWhiteFade);
tileColor = Color.Lerp(tileColor, Color.LightGray, bossRushWhiteFade);
}
else if (SkyManager.Instance["CalamityMod:ExoMechs"].IsActive())
{
float intensity = SkyManager.Instance["CalamityMod:ExoMechs"].Opacity;
backgroundColor = Color.Lerp(backgroundColor, Color.DarkGray, intensity * 0.9f);
backgroundColor = Color.Lerp(backgroundColor, Color.Black, intensity * 0.67f);
tileColor = Color.Lerp(tileColor, Color.DarkGray, intensity * 0.8f);
tileColor = Color.Lerp(tileColor, Color.Black, intensity * 0.3f);
}
}
#endregion
#region Mod Support
public override void PostSetupContent() => WeakReferenceSupport.Setup();
public override object Call(params object[] args) => ModCalls.Call(args);
#endregion
#region DrawingStuff
public override void ModifyInterfaceLayers(List<GameInterfaceLayer> layers)
{
int buffDisplayIndex = layers.FindIndex(layer => layer.Name == "Vanilla: Resource Bars");
if (buffDisplayIndex != -1)
{
layers.Insert(buffDisplayIndex, new LegacyGameInterfaceLayer("Cooldown Rack UI", delegate ()
{
CooldownRackUI.Draw(Main.spriteBatch);
return true;
}, InterfaceScaleType.UI));
}
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));
layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Draedon Hologram", () =>
{
LabHologramProjectorUI.Draw(Main.spriteBatch);
return true;
}, InterfaceScaleType.None));
// For these layers, InterfaceScaleType.Game tells the game that this UI should take zoom into account.
// These must be separate layers or they will malfunction when hovering one at non-100% zoom.
layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Charging Station UI", () =>
{
ChargingStationUI.Draw(Main.spriteBatch);
return true;
}, InterfaceScaleType.Game));
layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Power Cell Factory UI", () =>
{
PowerCellFactoryUI.Draw(Main.spriteBatch);
return true;
}, InterfaceScaleType.Game));
layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Boss HP Bars", delegate ()
{
if (Main.LocalPlayer.Calamity().drawBossHPBar)
{
BossHealthBarManager.Update();
BossHealthBarManager.Draw(Main.spriteBatch);
}
return true;
}, InterfaceScaleType.None));
// Mode Indicator UI.
layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Mode Indicator UI", delegate ()
{
ModeIndicatorUI.Draw(Main.spriteBatch);
return true;
}, InterfaceScaleType.UI));
// 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));
// Charge meter
layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Charge UI", () =>
{
ChargeMeterUI.Draw(Main.spriteBatch, Main.LocalPlayer);
return true;
}, InterfaceScaleType.None));
// Enchantment meters
layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Enchantment Meters", () =>
{
EnchantmentMetersUI.Draw(Main.spriteBatch, Main.LocalPlayer);
return true;
}, InterfaceScaleType.None));
// Calamitas Enchantment UI
layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Calamitas Enchantment", () =>
{
CalamitasEnchantUI.Draw(Main.spriteBatch);
return true;
}, InterfaceScaleType.None));
// Codebreaker UI.
layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Codebreaker Decryption GUI", () =>
{
CodebreakerUI.Draw(Main.spriteBatch);
return true;
}, InterfaceScaleType.None));
// Popup GUIs.
layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Popup GUIs", () =>
{
PopupGUIManager.UpdateAndDraw(Main.spriteBatch);
return true;
}, InterfaceScaleType.None));
// Exo Mech selection.
layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Exo Mech Selection", () =>
{
if (Main.LocalPlayer.Calamity().AbleToSelectExoMech)
ExoMechSelectionUI.Draw(Main.spriteBatch);
return true;
}, InterfaceScaleType.None));
// Defense damage indicator.
layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Defense Damage Indicator", () =>
{
if (Main.EquipPage != 1 && Main.EquipPage != 2)
DefenseDamageDisplayUI.Draw(Main.spriteBatch);
return true;
}, InterfaceScaleType.None));
}
// Invasion UIs.
int invasionIndex = layers.FindIndex(layer => layer.Name == "Vanilla: Diagnose Net");
if (invasionIndex != -1)
{
layers.Insert(invasionIndex, new LegacyGameInterfaceLayer("Calamity Invasion UIs", () =>
{
InvasionProgressUIManager.UpdateAndDraw(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>)
{
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<DrawData>)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();
@@ -1510,66 +822,6 @@ namespace CalamityMod
}
#endregion
#region Lighting
const float MaxSignusDarkness = -0.4f;
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;
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 Stop Rain
public static void StopRain()
{
@@ -1583,32 +835,5 @@ namespace CalamityMod
#region Netcode
public override void HandlePacket(BinaryReader reader, int whoAmI) => CalamityNetcode.HandlePacket(this, reader, whoAmI);
#endregion
#region Tile Entity Time Handler
public override void MidUpdateTimeWorld() => TileEntityTimeHandler.Update();
#endregion
#region Ash Drawing
public override void MidUpdateItemDust() => DeathAshParticle.UpdateAll();
#endregion Ash Drawing
#region Post NPC Updating
// TODO - Apply caching to this process. For now most of the looping issues should be eradicated but it can be reduced further.
public override void MidUpdateNPCGore() => CalamityGlobalNPC.ResetTownNPCNameBools();
#endregion
#region Speedrun Timer Stopper
public override void PreSaveAndQuit() => SpeedrunTimer?.Stop();
#endregion
#region Particles updating
public override void PostUpdateEverything()
{
if (!Main.dedServ)
{
GeneralParticleHandler.Update();
}
}
#endregion
}
}
+14 -14
View File
@@ -130,9 +130,9 @@ namespace CalamityMod.Events
playerCount++;
}
}
if (CalamityWorld.downedPolterghast)
if (DownedBossSystem.downedPolterghast)
return (int)(Math.Log(playerCount + Math.E - 1) * 170f);
else if (CalamityWorld.downedAquaticScourge)
else if (DownedBossSystem.downedAquaticScourge)
return (int)(Math.Log(playerCount + Math.E - 1) * 135f);
else
return (int)(Math.Log(playerCount + Math.E - 1) * 110f);
@@ -143,7 +143,7 @@ namespace CalamityMod.Events
/// </summary>
public static void TryStartEvent(bool forceRain = false)
{
if (CalamityWorld.rainingAcid || (!NPC.downedBoss1 && !Main.hardMode && !CalamityWorld.downedAquaticScourge) || BossRushEvent.BossRushActive)
if (CalamityWorld.rainingAcid || (!NPC.downedBoss1 && !Main.hardMode && !DownedBossSystem.downedAquaticScourge) || BossRushEvent.BossRushActive)
return;
int playerCount = 0;
@@ -252,7 +252,7 @@ namespace CalamityMod.Events
}
// Summon Old Duke tornado post-Polter as needed
if (CalamityWorld.downedPolterghast && CalamityWorld.acidRainPoints == 1)
if (DownedBossSystem.downedPolterghast && CalamityWorld.acidRainPoints == 1)
{
if (!NPC.AnyNPCs(ModContent.NPCType<OldDuke>()) &&
CalamityUtils.CountProjectiles(ModContent.ProjectileType<OverlyDramaticDukeSummoner>()) <= 0)
@@ -296,8 +296,8 @@ namespace CalamityMod.Events
Main.maxRaining = 0f;
if (win)
{
CalamityWorld.downedEoCAcidRain = true;
CalamityWorld.downedAquaticScourgeAcidRain = CalamityWorld.downedAquaticScourge;
DownedBossSystem.downedEoCAcidRain = true;
DownedBossSystem.downedAquaticScourgeAcidRain = DownedBossSystem.downedAquaticScourge;
}
CalamityWorld.triedToSummonOldDuke = false;
CalamityMod.StopRain();
@@ -338,7 +338,7 @@ namespace CalamityMod.Events
{
// Attempt to start the acid rain at the 4:29AM.
// This does not happen if a player has the Broken Water Filter in use.
bool increasedEventChance = !CalamityWorld.downedEoCAcidRain || (!CalamityWorld.downedAquaticScourgeAcidRain && CalamityWorld.downedAquaticScourge) || (!CalamityWorld.downedBoomerDuke && CalamityWorld.downedPolterghast);
bool increasedEventChance = !DownedBossSystem.downedEoCAcidRain || (!DownedBossSystem.downedAquaticScourgeAcidRain && DownedBossSystem.downedAquaticScourge) || (!DownedBossSystem.downedBoomerDuke && DownedBossSystem.downedPolterghast);
if ((int)Main.time == (int)(Main.nightLength - 1f) && !Main.dayTime && Main.rand.NextBool(increasedEventChance ? 3 : 300))
{
bool shouldNotStartEvent = false;
@@ -360,7 +360,7 @@ namespace CalamityMod.Events
}
// Attempt to force an Acid Rain immediately after the EoC is dead when someone wanders to the sea.
if (NPC.downedBoss1 && !CalamityWorld.downedEoCAcidRain && !CalamityWorld.forcedRainAlready)
if (NPC.downedBoss1 && !DownedBossSystem.downedEoCAcidRain && !CalamityWorld.forcedRainAlready)
{
for (int playerIndex = 0; playerIndex < Main.maxPlayers; playerIndex++)
{
@@ -387,9 +387,9 @@ namespace CalamityMod.Events
{
Dictionary<int, AcidRainSpawnData> possibleEnemies = PossibleEnemiesPreHM;
if (CalamityWorld.downedAquaticScourge)
if (DownedBossSystem.downedAquaticScourge)
possibleEnemies = PossibleEnemiesAS;
if (CalamityWorld.downedPolterghast)
if (DownedBossSystem.downedPolterghast)
possibleEnemies = PossibleEnemiesPolter;
if (CalamityWorld.rainingAcid)
@@ -397,7 +397,7 @@ namespace CalamityMod.Events
if (possibleEnemies.Select(enemy => enemy.Key).Contains(npc.type))
{
CalamityWorld.acidRainPoints -= possibleEnemies[npc.type].InvasionContributionPoints;
if (CalamityWorld.downedPolterghast)
if (DownedBossSystem.downedPolterghast)
{
CalamityWorld.acidRainPoints = (int)MathHelper.Max(1, CalamityWorld.acidRainPoints); // Cap at 1. The last point is for Old Duke.
}
@@ -405,11 +405,11 @@ namespace CalamityMod.Events
// UpdateInvasion incorporates a world sync, so this is indeed synced as a result.
Main.rainTime += Main.rand.Next(240, 300 + 1); // Add some time to the rain, so that it doesn't end mid-way.
}
Dictionary<int, AcidRainSpawnData> possibleMinibosses = CalamityWorld.downedPolterghast ? PossibleMinibossesPolter : PossibleMinibossesAS;
Dictionary<int, AcidRainSpawnData> possibleMinibosses = DownedBossSystem.downedPolterghast ? PossibleMinibossesPolter : PossibleMinibossesAS;
if (possibleMinibosses.Select(miniboss => miniboss.Key).Contains(npc.type))
{
CalamityWorld.acidRainPoints -= possibleMinibosses[npc.type].InvasionContributionPoints;
if (CalamityWorld.downedPolterghast)
if (DownedBossSystem.downedPolterghast)
{
CalamityWorld.acidRainPoints = (int)MathHelper.Max(1, CalamityWorld.acidRainPoints); // Cap at 1. The last point is for Old Duke.
}
@@ -421,7 +421,7 @@ namespace CalamityMod.Events
CalamityWorld.acidRainPoints = (int)MathHelper.Max(0, CalamityWorld.acidRainPoints); // To prevent negative completion ratios
if (CalamityWorld.rainingAcid && CalamityWorld.downedPolterghast &&
if (CalamityWorld.rainingAcid && DownedBossSystem.downedPolterghast &&
npc.type == ModContent.NPCType<OldDuke>() &&
CalamityWorld.acidRainPoints <= 2f)
{
+1 -1
View File
@@ -42,7 +42,7 @@ namespace CalamityMod.Items.Accessories
CreateRecipe()
.AddIngredient<ManaJelly>()
.AddIngredient<LifeJelly>()
.AddIngredient<VitalJelly>(
.AddIngredient<VitalJelly>()
.AddIngredient(ItemID.SoulofLight, 2)
.AddIngredient(ItemID.SoulofNight, 2)
.AddTile(TileID.Anvils)
+2 -2
View File
@@ -53,8 +53,8 @@ namespace CalamityMod.Items.Accessories
public override void ModifyTooltips(List<TooltipLine> tooltips)
{
bool scal = CalamityWorld.downedSCal;
bool draedon = CalamityWorld.downedExoMechs;
bool scal = DownedBossSystem.downedSCal;
bool draedon = DownedBossSystem.downedExoMechs;
if (!scal || !draedon)
{
string rejectionReason = (!draedon) ? "[c/f05a5a:The soul within this crystal has been defiled by overwhelming energy waves from dangerous mechanations]" : "[c/f05a5a:The soul within this crystal has been defiled by the powerful magic of a supreme witch]"; //there might be a better way to word the draedon line, not sure
+14 -14
View File
@@ -1424,11 +1424,11 @@ namespace CalamityMod.Items
* Post-Yharon = 4
*/
if (CalamityWorld.downedYharon)
if (DownedBossSystem.downedYharon)
player.statDefense += 3;
else if (CalamityWorld.downedPolterghast || CalamityWorld.downedDoG)
else if (DownedBossSystem.downedPolterghast || DownedBossSystem.downedDoG)
player.statDefense += 2;
else if (Main.hardMode || NPC.downedGolemBoss || NPC.downedMoonlord || CalamityWorld.downedProvidence)
else if (Main.hardMode || NPC.downedGolemBoss || NPC.downedMoonlord || DownedBossSystem.downedProvidence)
player.statDefense += 1;
player.endurance += 0.0025f;
@@ -1445,11 +1445,11 @@ namespace CalamityMod.Items
* Post-Yharon = 8
*/
if (CalamityWorld.downedYharon)
if (DownedBossSystem.downedYharon)
player.statDefense += 6;
else if (CalamityWorld.downedDoG)
else if (DownedBossSystem.downedDoG)
player.statDefense += 4;
else if (CalamityWorld.downedProvidence || CalamityWorld.downedPolterghast)
else if (DownedBossSystem.downedProvidence || DownedBossSystem.downedPolterghast)
player.statDefense += 3;
else if (NPC.downedGolemBoss || NPC.downedMoonlord)
player.statDefense += 2;
@@ -1470,13 +1470,13 @@ namespace CalamityMod.Items
* Post-Yharon = 11
*/
if (CalamityWorld.downedYharon)
if (DownedBossSystem.downedYharon)
player.statDefense += 8;
else if (CalamityWorld.downedDoG)
else if (DownedBossSystem.downedDoG)
player.statDefense += 6;
else if (CalamityWorld.downedPolterghast)
else if (DownedBossSystem.downedPolterghast)
player.statDefense += 5;
else if (CalamityWorld.downedProvidence)
else if (DownedBossSystem.downedProvidence)
player.statDefense += 4;
else if (NPC.downedMoonlord)
player.statDefense += 3;
@@ -1497,13 +1497,13 @@ namespace CalamityMod.Items
* Post-Yharon = 15
*/
if (CalamityWorld.downedYharon)
if (DownedBossSystem.downedYharon)
player.statDefense += 11;
else if (CalamityWorld.downedDoG)
else if (DownedBossSystem.downedDoG)
player.statDefense += 8;
else if (CalamityWorld.downedPolterghast)
else if (DownedBossSystem.downedPolterghast)
player.statDefense += 6;
else if (CalamityWorld.downedProvidence)
else if (DownedBossSystem.downedProvidence)
player.statDefense += 5;
else if (NPC.downedMoonlord)
player.statDefense += 4;
+6 -6
View File
@@ -262,14 +262,14 @@ namespace CalamityMod.Items
case ItemID.HallowedFishingCrate:
BlockCrateDrops();
int potion = WorldGen.crimson ? ModContent.ItemType<ProfanedRagePotion>() : ModContent.ItemType<HolyWrathPotion>();
DropHelper.DropItemCondition(player, ModContent.ItemType<UnholyEssence>(), CalamityWorld.downedProvidence, 0.15f, 5, 10);
DropHelper.DropItemCondition(player, potion, CalamityWorld.downedProvidence, 0.1f, 1, 2);
DropHelper.DropItemCondition(player, ModContent.ItemType<UnholyEssence>(), DownedBossSystem.downedProvidence, 0.15f, 5, 10);
DropHelper.DropItemCondition(player, potion, DownedBossSystem.downedProvidence, 0.1f, 1, 2);
break;
case ItemID.DungeonFishingCrate:
BlockCrateDrops();
DropHelper.DropItemCondition(player, ItemID.Ectoplasm, NPC.downedPlantBoss, 0.1f, 1, 5);
DropHelper.DropItemCondition(player, ModContent.ItemType<Phantoplasm>(), CalamityWorld.downedPolterghast, 0.1f, 1, 5);
DropHelper.DropItemCondition(player, ModContent.ItemType<Phantoplasm>(), DownedBossSystem.downedPolterghast, 0.1f, 1, 5);
break;
case ItemID.JungleFishingCrate:
@@ -277,15 +277,15 @@ namespace CalamityMod.Items
DropHelper.DropItemChance(player, ModContent.ItemType<MurkyPaste>(), 0.2f, 1, 3);
DropHelper.DropItemCondition(player, ModContent.ItemType<BeetleJuice>(), Main.hardMode, 0.2f, 1, 3);
DropHelper.DropItemCondition(player, ModContent.ItemType<TrapperBulb>(), Main.hardMode, 0.2f, 1, 3);
DropHelper.DropItemCondition(player, ItemID.ChlorophyteBar, CalamityWorld.downedCalamitas || NPC.downedPlantBoss, 0.1f, 1, 3);
DropHelper.DropItemCondition(player, ItemID.ChlorophyteBar, DownedBossSystem.downedCalamitas || NPC.downedPlantBoss, 0.1f, 1, 3);
DropHelper.DropItemCondition(player, ModContent.ItemType<DraedonBar>(), NPC.downedPlantBoss, 0.1f, 1, 3);
DropHelper.DropItemCondition(player, ModContent.ItemType<PlagueCellCluster>(), NPC.downedGolemBoss, 0.2f, 3, 6);
DropHelper.DropItemCondition(player, ModContent.ItemType<UeliaceBar>(), CalamityWorld.downedProvidence, 0.1f, 1, 3);
DropHelper.DropItemCondition(player, ModContent.ItemType<UeliaceBar>(), DownedBossSystem.downedProvidence, 0.1f, 1, 3);
break;
case ItemID.FloatingIslandFishingCrate:
BlockCrateDrops();
DropHelper.DropItemCondition(player, ModContent.ItemType<AerialiteBar>(), CalamityWorld.downedHiveMind || CalamityWorld.downedPerforator, 0.1f, 1, 3);
DropHelper.DropItemCondition(player, ModContent.ItemType<AerialiteBar>(), DownedBossSystem.downedHiveMind || DownedBossSystem.downedPerforator, 0.1f, 1, 3);
DropHelper.DropItemCondition(player, ModContent.ItemType<EssenceofCinder>(), Main.hardMode, 0.2f, 2, 4);
DropHelper.DropItemCondition(player, ModContent.ItemType<GalacticaSingularity>(), NPC.downedMoonlord, 0.1f, 1, 3);
break;
+9 -9
View File
@@ -50,13 +50,13 @@ namespace CalamityMod.Items.Fishing.AstralCatches
DropHelper.DropItem(player, ItemID.FallenStar, 5, 10);
DropHelper.DropItemChance(player, ItemID.Meteorite, 0.2f, 10, 20);
DropHelper.DropItemChance(player, ItemID.MeteoriteBar, 0.1f, 1, 3);
DropHelper.DropItemCondition(player, ModContent.ItemType<AstralJelly>(), CalamityWorld.downedAstrageldon, 0.2f, 2, 5);
DropHelper.DropItemCondition(player, ModContent.ItemType<AstralOre>(), CalamityWorld.downedStarGod, 0.2f, 10, 20);
DropHelper.DropItemCondition(player, ModContent.ItemType<AstralBar>(), CalamityWorld.downedStarGod, 0.1f, 1, 3);
DropHelper.DropItemCondition(player, ModContent.ItemType<MeldBlob>(), CalamityWorld.downedStarGod, 0.25f, 5, 10);
DropHelper.DropItemCondition(player, ModContent.ItemType<AstralJelly>(), DownedBossSystem.downedAstrageldon, 0.2f, 2, 5);
DropHelper.DropItemCondition(player, ModContent.ItemType<AstralOre>(), DownedBossSystem.downedStarGod, 0.2f, 10, 20);
DropHelper.DropItemCondition(player, ModContent.ItemType<AstralBar>(), DownedBossSystem.downedStarGod, 0.1f, 1, 3);
DropHelper.DropItemCondition(player, ModContent.ItemType<MeldBlob>(), DownedBossSystem.downedStarGod, 0.25f, 5, 10);
// Weapons
DropHelper.DropItemFromSetCondition(player, CalamityWorld.downedAstrageldon, 0.1f,
DropHelper.DropItemFromSetCondition(player, DownedBossSystem.downedAstrageldon, 0.1f,
ModContent.ItemType<StellarKnife>(),
ModContent.ItemType<AstralachneaStaff>(),
ModContent.ItemType<TitanArm>(),
@@ -83,16 +83,16 @@ namespace CalamityMod.Items.Fishing.AstralCatches
DropHelper.DropItemChance(player, ItemID.MiningPotion, 10, 1, 3);
DropHelper.DropItemChance(player, ItemID.HeartreachPotion, 10, 1, 3);
DropHelper.DropItemChance(player, ItemID.TrapsightPotion, 10, 1, 3); //Dangersense Potion
DropHelper.DropItemCondition(player, ModContent.ItemType<AstralInjection>(), CalamityWorld.downedAstrageldon, 0.1f, 1, 3);
DropHelper.DropItemCondition(player, ModContent.ItemType<GravityNormalizerPotion>(), CalamityWorld.downedAstrageldon, 0.1f, 1, 3);
DropHelper.DropItemCondition(player, ModContent.ItemType<AstralInjection>(), DownedBossSystem.downedAstrageldon, 0.1f, 1, 3);
DropHelper.DropItemCondition(player, ModContent.ItemType<GravityNormalizerPotion>(), DownedBossSystem.downedAstrageldon, 0.1f, 1, 3);
int healingPotID = ItemID.HealingPotion;
int manaPotID = ItemID.ManaPotion;
if (CalamityWorld.downedDoG)
if (DownedBossSystem.downedDoG)
{
healingPotID = ModContent.ItemType<SupremeHealingPotion>();
manaPotID = ModContent.ItemType<SupremeManaPotion>();
}
else if (CalamityWorld.downedProvidence)
else if (DownedBossSystem.downedProvidence)
{
healingPotID = ItemID.SuperHealingPotion;
manaPotID = ItemID.SuperManaPotion;
@@ -28,7 +28,7 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches
public override bool IsAnglerQuestAvailable()
{
return CalamityWorld.downedBrimstoneElemental;
return DownedBossSystem.downedBrimstoneElemental;
}
public override void AnglerQuestChat(ref string description, ref string catchLocation)
@@ -45,8 +45,8 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches
DropHelper.DropItem(player, ModContent.ItemType<DemonicBoneAsh>(), 1, 4);
DropHelper.DropItemCondition(player, ModContent.ItemType<EssenceofChaos>(), Main.hardMode, 0.2f, 2, 4);
DropHelper.DropItemCondition(player, ModContent.ItemType<BlightedLens>(), Main.hardMode, 0.15f, 2, 6);
DropHelper.DropItemCondition(player, ModContent.ItemType<UnholyCore>(), CalamityWorld.downedBrimstoneElemental, 0.1f, 1, 3);
DropHelper.DropItemCondition(player, ModContent.ItemType<Bloodstone>(), CalamityWorld.downedProvidence && CalamityWorld.downedPolterghast, 0.1f, 1, 3);
DropHelper.DropItemCondition(player, ModContent.ItemType<UnholyCore>(), DownedBossSystem.downedBrimstoneElemental, 0.1f, 1, 3);
DropHelper.DropItemCondition(player, ModContent.ItemType<Bloodstone>(), DownedBossSystem.downedProvidence && DownedBossSystem.downedPolterghast, 0.1f, 1, 3);
// Weapons (none)
@@ -67,12 +67,12 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches
DropHelper.DropItemChance(player, ItemID.InfernoPotion, 10, 1, 3);
int healingPotID = ItemID.LesserHealingPotion;
int manaPotID = ItemID.LesserManaPotion;
if (CalamityWorld.downedDoG)
if (DownedBossSystem.downedDoG)
{
healingPotID = ModContent.ItemType<SupremeHealingPotion>();
manaPotID = ModContent.ItemType<SupremeManaPotion>();
}
else if (CalamityWorld.downedProvidence)
else if (DownedBossSystem.downedProvidence)
{
healingPotID = ItemID.SuperHealingPotion;
manaPotID = ItemID.SuperManaPotion;
+12 -12
View File
@@ -51,24 +51,24 @@ namespace CalamityMod.Items.Fishing.SulphurCatches
DropHelper.DropItem(player, ModContent.ItemType<SulphurousSandstone>(), 5, 10);
DropHelper.DropItem(player, ModContent.ItemType<HardenedSulphurousSandstone>(), 5, 10);
DropHelper.DropItem(player, ModContent.ItemType<Acidwood>(), 5, 10);
DropHelper.DropItemCondition(player, ModContent.ItemType<SulfuricScale>(), CalamityWorld.downedEoCAcidRain, 0.1f, 1, 3);
DropHelper.DropItemCondition(player, ModContent.ItemType<CorrodedFossil>(), CalamityWorld.downedAquaticScourgeAcidRain, 0.1f, 1, 3);
DropHelper.DropItemCondition(player, ModContent.ItemType<DepthCells>(), CalamityWorld.downedCalamitas, 0.2f, 2, 5);
DropHelper.DropItemCondition(player, ModContent.ItemType<Lumenite>(), CalamityWorld.downedCalamitas, 0.2f, 2, 5);
DropHelper.DropItemCondition(player, ModContent.ItemType<PlantyMush>(), CalamityWorld.downedCalamitas, 0.2f, 2, 5);
DropHelper.DropItemCondition(player, ModContent.ItemType<Tenebris>(), CalamityWorld.downedCalamitas, 0.2f, 2, 5);
DropHelper.DropItemCondition(player, ModContent.ItemType<SulfuricScale>(), DownedBossSystem.downedEoCAcidRain, 0.1f, 1, 3);
DropHelper.DropItemCondition(player, ModContent.ItemType<CorrodedFossil>(), DownedBossSystem.downedAquaticScourgeAcidRain, 0.1f, 1, 3);
DropHelper.DropItemCondition(player, ModContent.ItemType<DepthCells>(), DownedBossSystem.downedCalamitas, 0.2f, 2, 5);
DropHelper.DropItemCondition(player, ModContent.ItemType<Lumenite>(), DownedBossSystem.downedCalamitas, 0.2f, 2, 5);
DropHelper.DropItemCondition(player, ModContent.ItemType<PlantyMush>(), DownedBossSystem.downedCalamitas, 0.2f, 2, 5);
DropHelper.DropItemCondition(player, ModContent.ItemType<Tenebris>(), DownedBossSystem.downedCalamitas, 0.2f, 2, 5);
DropHelper.DropItemCondition(player, ModContent.ItemType<CruptixBar>(), NPC.downedGolemBoss, 0.1f, 1, 3);
DropHelper.DropItemCondition(player, ModContent.ItemType<ReaperTooth>(), CalamityWorld.downedPolterghast && CalamityWorld.downedBoomerDuke, 0.1f, 1, 5);
DropHelper.DropItemCondition(player, ModContent.ItemType<ReaperTooth>(), DownedBossSystem.downedPolterghast && DownedBossSystem.downedBoomerDuke, 0.1f, 1, 5);
// Weapons
DropHelper.DropItemFromSetCondition(player, CalamityWorld.downedSlimeGod || Main.hardMode, 0.1f,
DropHelper.DropItemFromSetCondition(player, DownedBossSystem.downedSlimeGod || Main.hardMode, 0.1f,
ModContent.ItemType<Archerfish>(),
ModContent.ItemType<BallOFugu>(),
ModContent.ItemType<HerringStaff>(),
ModContent.ItemType<Lionfish>(),
ModContent.ItemType<BlackAnurian>());
DropHelper.DropItemFromSetCondition(player, CalamityWorld.downedAquaticScourgeAcidRain, 0.1f,
DropHelper.DropItemFromSetCondition(player, DownedBossSystem.downedAquaticScourgeAcidRain, 0.1f,
ModContent.ItemType<SkyfinBombers>(),
ModContent.ItemType<NuclearRod>(),
ModContent.ItemType<SulphurousGrabber>(),
@@ -78,7 +78,7 @@ namespace CalamityMod.Items.Fishing.SulphurCatches
ModContent.ItemType<BelchingSaxophone>());
// Equipment
DropHelper.DropItemFromSetCondition(player, CalamityWorld.downedSlimeGod || Main.hardMode, 0.25f,
DropHelper.DropItemFromSetCondition(player, DownedBossSystem.downedSlimeGod || Main.hardMode, 0.25f,
ModContent.ItemType<StrangeOrb>(),
ModContent.ItemType<DepthCharm>(),
ModContent.ItemType<IronBoots>(),
@@ -102,12 +102,12 @@ namespace CalamityMod.Items.Fishing.SulphurCatches
DropHelper.DropItemChance(player, ModContent.ItemType<AnechoicCoating>(), 10, 1, 3);
int healingPotID = ItemID.LesserHealingPotion;
int manaPotID = ItemID.LesserManaPotion;
if (CalamityWorld.downedDoG)
if (DownedBossSystem.downedDoG)
{
healingPotID = ModContent.ItemType<SupremeHealingPotion>();
manaPotID = ModContent.ItemType<SupremeManaPotion>();
}
else if (CalamityWorld.downedProvidence)
else if (DownedBossSystem.downedProvidence)
{
healingPotID = ItemID.SuperHealingPotion;
manaPotID = ItemID.SuperManaPotion;
@@ -1,6 +1,7 @@
using Terraria.ID;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.World;
using CalamityMod.Systems;
namespace CalamityMod.Items.Fishing.SunkenSeaCatches
{
@@ -28,12 +29,12 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches
public override bool IsAnglerQuestAvailable()
{
return CalamityWorld.downedDesertScourge;
return DownedBossSystem.downedDesertScourge;
}
public override void AnglerQuestChat(ref string description, ref string catchLocation)
{
description = "You ever get to see what would happen if a lizard that lived in the desert scurried too deep underground? I did, and they sure are cool! But it’s way too slippery for me to get my hands on it now. You go and get it so I can keep it as a pet!";
description = "You ever get to see what would happen if a lizard that lived in the desert scurried too deep underground? I did, and they sure are cool! But it’s way too slippery for me to get my hands on it now. You go and get it so I can keep it as a pet!";
catchLocation = "Caught in the Sunken Sea.";
}
}
@@ -1,4 +1,4 @@
using CalamityMod.Items.Materials;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Critters;
using CalamityMod.Items.Placeables;
using CalamityMod.Items.Potions;
@@ -11,6 +11,7 @@ using CalamityMod.World;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems;
namespace CalamityMod.Items.Fishing.SunkenSeaCatches
{
@@ -45,12 +46,12 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches
//Modded materials
DropHelper.DropItem(player, ModContent.ItemType<Items.Placeables.Navystone>(), 10, 30);
DropHelper.DropItem(player, ModContent.ItemType<Items.Placeables.EutrophicSand>(), 10, 30);
DropHelper.DropItemCondition(player, ModContent.ItemType<PrismShard>(), CalamityWorld.downedDesertScourge, 5, 10);
DropHelper.DropItemCondition(player, ModContent.ItemType<Items.Placeables.SeaPrism>(), CalamityWorld.downedDesertScourge, 0.2f, 2, 5);
DropHelper.DropItemCondition(player, ModContent.ItemType<MolluskHusk>(), CalamityWorld.downedCLAMHardMode, 0.12f, 2, 5);
DropHelper.DropItemCondition(player, ModContent.ItemType<PrismShard>(), DownedBossSystem.downedDesertScourge, 5, 10);
DropHelper.DropItemCondition(player, ModContent.ItemType<Items.Placeables.SeaPrism>(), DownedBossSystem.downedDesertScourge, 0.2f, 2, 5);
DropHelper.DropItemCondition(player, ModContent.ItemType<MolluskHusk>(), DownedBossSystem.downedCLAMHardMode, 0.12f, 2, 5);
// Weapons
DropHelper.DropItemFromSetCondition(player, CalamityWorld.downedCLAMHardMode, 0.07f,
DropHelper.DropItemFromSetCondition(player, DownedBossSystem.downedCLAMHardMode, 0.07f,
ModContent.ItemType<ShellfishStaff>(),
ModContent.ItemType<ClamCrusher>(),
ModContent.ItemType<Poseidon>(),
@@ -73,12 +74,12 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches
DropHelper.DropItemChance(player, ItemID.TrapsightPotion, 10, 1, 3); //Dangersense Potion
int healingPotID = ItemID.LesserHealingPotion;
int manaPotID = ItemID.LesserManaPotion;
if (CalamityWorld.downedDoG)
if (DownedBossSystem.downedDoG)
{
healingPotID = ModContent.ItemType<SupremeHealingPotion>();
manaPotID = ModContent.ItemType<SupremeManaPotion>();
}
else if (CalamityWorld.downedProvidence)
else if (DownedBossSystem.downedProvidence)
{
healingPotID = ItemID.SuperHealingPotion;
manaPotID = ItemID.SuperManaPotion;
+3 -2
View File
@@ -1,6 +1,7 @@
using Terraria.ID;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.World;
using CalamityMod.Systems;
namespace CalamityMod.Items.Fishing.SunkenSeaCatches
{
@@ -28,7 +29,7 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches
public override bool IsAnglerQuestAvailable()
{
return CalamityWorld.downedDesertScourge;
return DownedBossSystem.downedDesertScourge;
}
public override void AnglerQuestChat(ref string description, ref string catchLocation)
+1 -1
View File
@@ -153,7 +153,7 @@ namespace CalamityMod.Items.Placeables
resultType = CalamityConfig.Instance.EarlyHardmodeProgressionRework ? (!NPC.downedMechBossAny ? ItemID.PalladiumOre : !twoMechsDowned ? ItemID.OrichalcumOre : ItemID.TitaniumOre) : ItemID.TitaniumOre;
resultStack = Main.rand.Next(1, 17);
}
else if (CalamityWorld.downedStarGod)
else if (DownedBossSystem.downedStarGod)
{
resultType = ModContent.ItemType<Ores.AstralOre>();
resultStack = Main.rand.Next(1, 2);
+1 -1
View File
@@ -136,7 +136,7 @@ namespace CalamityMod.Items.Placeables
resultType = CalamityConfig.Instance.EarlyHardmodeProgressionRework ? (!NPC.downedMechBossAny ? ItemID.PalladiumOre : !twoMechsDowned ? ItemID.OrichalcumOre : ItemID.TitaniumOre) : ItemID.TitaniumOre;
resultStack = Main.rand.Next(1, 17);
}
else if (CalamityWorld.downedStarGod)
else if (DownedBossSystem.downedStarGod)
{
resultType = ModContent.ItemType<Ores.AstralOre>();
resultStack = Main.rand.Next(1, 2);
+1 -1
View File
@@ -37,7 +37,7 @@ namespace CalamityMod.Items.SummonItems
public override void ModifyTooltips(List<TooltipLine> list)
{
TooltipLine line = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip1");
bool sentinelsNotDefeated = !CalamityWorld.downedSentinel1 || !CalamityWorld.downedSentinel2 || !CalamityWorld.downedSentinel3;
bool sentinelsNotDefeated = !DownedBossSystem.downedSentinel1 || !DownedBossSystem.downedSentinel2 || !DownedBossSystem.downedSentinel3;
if (line != null)
line.Text = sentinelsNotDefeated ? "WARNING! Some sentinels have not been truly defeated yet and will spawn at full power during this fight!" : "";
+3 -2
View File
@@ -1,4 +1,5 @@
using CalamityMod.World;
using CalamityMod.Systems;
using CalamityMod.World;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -27,7 +28,7 @@ namespace CalamityMod.Items.Tools.ClimateChange
public override bool CanUseItem(Player player)
{
return CalamityWorld.downedDesertScourge;
return DownedBossSystem.downedDesertScourge;
}
// this is extremely ugly and has to be fully qualified because we add an item called Sandstorm
+2 -2
View File
@@ -43,7 +43,7 @@ namespace CalamityMod.Items.TreasureBags
// Materials
DropHelper.DropItem(player, ModContent.ItemType<EssenceofChaos>(), 5, 9);
DropHelper.DropItemCondition(player, ModContent.ItemType<Bloodstone>(), CalamityWorld.downedProvidence, 25, 35);
DropHelper.DropItemCondition(player, ModContent.ItemType<Bloodstone>(), DownedBossSystem.downedProvidence, 25, 35);
// Weapons
float w = DropHelper.BagWeaponDropRateFloat;
@@ -59,7 +59,7 @@ namespace CalamityMod.Items.TreasureBags
DropHelper.DropItem(player, ModContent.ItemType<Gehenna>());
DropHelper.DropItemChance(player, ModContent.ItemType<Hellborn>(), 0.1f);
DropHelper.DropItemChance(player, ModContent.ItemType<FabledTortoiseShell>(), 0.1f);
DropHelper.DropItemCondition(player, ModContent.ItemType<Brimrose>(), CalamityWorld.downedProvidence);
DropHelper.DropItemCondition(player, ModContent.ItemType<Brimrose>(), DownedBossSystem.downedProvidence);
// Vanity
DropHelper.DropItemCondition(player, ModContent.ItemType<CharredRelic>(), CalamityWorld.revenge);
+1 -1
View File
@@ -43,7 +43,7 @@ namespace CalamityMod.Items.TreasureBags
DropHelper.DropItem(player, ModContent.ItemType<CalamityDust>(), 14, 18);
DropHelper.DropItem(player, ModContent.ItemType<BlightedLens>(), 1, 3);
DropHelper.DropItem(player, ModContent.ItemType<EssenceofChaos>(), 5, 9);
DropHelper.DropItemCondition(player, ModContent.ItemType<Bloodstone>(), CalamityWorld.downedProvidence, 35, 45);
DropHelper.DropItemCondition(player, ModContent.ItemType<Bloodstone>(), DownedBossSystem.downedProvidence, 35, 45);
// Weapons
float w = DropHelper.BagWeaponDropRateFloat;
+6 -6
View File
@@ -47,21 +47,21 @@ namespace CalamityMod.Items.TreasureBags
// Weapons
// Higher chance due to how the drops work
float w = DropHelper.BagWeaponDropRateFloat * 2f;
if (CalamityWorld.downedAres)
if (DownedBossSystem.downedAres)
{
DropHelper.DropEntireWeightedSet(player,
DropHelper.WeightStack<PhotonRipper>(w),
DropHelper.WeightStack<TheJailor>(w)
);
}
if (CalamityWorld.downedThanatos)
if (DownedBossSystem.downedThanatos)
{
DropHelper.DropEntireWeightedSet(player,
DropHelper.WeightStack<SpineOfThanatos>(w),
DropHelper.WeightStack<RefractionRotor>(w)
);
}
if (CalamityWorld.downedArtemisAndApollo)
if (DownedBossSystem.downedArtemisAndApollo)
{
DropHelper.DropEntireWeightedSet(player,
DropHelper.WeightStack<SurgeDriver>(w),
@@ -76,16 +76,16 @@ namespace CalamityMod.Items.TreasureBags
// Vanity
// Higher chance due to how the drops work
float maskDropRate = 1f / 3.5f;
if (CalamityWorld.downedThanatos)
if (DownedBossSystem.downedThanatos)
DropHelper.DropItemChance(player, ModContent.ItemType<ThanatosMask>(), maskDropRate);
if (CalamityWorld.downedArtemisAndApollo)
if (DownedBossSystem.downedArtemisAndApollo)
{
DropHelper.DropItemChance(player, ModContent.ItemType<ArtemisMask>(), maskDropRate);
DropHelper.DropItemChance(player, ModContent.ItemType<ApolloMask>(), maskDropRate);
}
if (CalamityWorld.downedAres)
if (DownedBossSystem.downedAres)
DropHelper.DropItemChance(player, ModContent.ItemType<AresMask>(), maskDropRate);
DropHelper.DropItemChance(player, ModContent.ItemType<DraedonMask>(), maskDropRate);
+3 -3
View File
@@ -41,8 +41,8 @@ namespace CalamityMod.Items.TreasureBags
player.TryGettingDevArmor(player.GetItemSource_OpenItem(Item.type));
// Materials
DropHelper.DropItemCondition(player, ModContent.ItemType<FleshyGeodeT1>(), !CalamityWorld.downedProvidence);
DropHelper.DropItemCondition(player, ModContent.ItemType<FleshyGeodeT2>(), CalamityWorld.downedProvidence);
DropHelper.DropItemCondition(player, ModContent.ItemType<FleshyGeodeT1>(), !DownedBossSystem.downedProvidence);
DropHelper.DropItemCondition(player, ModContent.ItemType<FleshyGeodeT2>(), DownedBossSystem.downedProvidence);
// Weapons
float w = DropHelper.BagWeaponDropRateFloat;
@@ -58,7 +58,7 @@ namespace CalamityMod.Items.TreasureBags
// Equipment
DropHelper.DropItemChance(player, ModContent.ItemType<BloodPact>(), 0.5f);
DropHelper.DropItemChance(player, ModContent.ItemType<FleshTotem>(), 0.5f);
DropHelper.DropItemCondition(player, ModContent.ItemType<BloodflareCore>(), CalamityWorld.downedProvidence);
DropHelper.DropItemCondition(player, ModContent.ItemType<BloodflareCore>(), DownedBossSystem.downedProvidence);
DropHelper.DropItemCondition(player, ModContent.ItemType<InfernalBlood>(), CalamityWorld.revenge && !player.Calamity().rageBoostTwo);
DropHelper.DropItemChance(player, ModContent.ItemType<Vesuvius>(), 0.1f);
+1 -1
View File
@@ -73,7 +73,7 @@ namespace CalamityMod.Items.Weapons.Melee
{
if (player.ownedProjectileCounts[Item.shoot] > 0)
return false;
return CalamityWorld.downedYharon || player.name == "Jetstream Sam" || player.name == "Samuel Rodrigues";
return DownedBossSystem.downedYharon || player.name == "Jetstream Sam" || player.name == "Samuel Rodrigues";
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
+36 -35
View File
@@ -1,9 +1,10 @@
using CalamityMod.CalPlayer;
using CalamityMod.CalPlayer;
using CalamityMod.Cooldowns;
using CalamityMod.Events;
using CalamityMod.Items;
using CalamityMod.Particles;
using CalamityMod.Projectiles;
using CalamityMod.Systems;
using CalamityMod.UI;
using CalamityMod.UI.CalamitasEnchants;
using CalamityMod.World;
@@ -40,25 +41,25 @@ namespace CalamityMod
case "acid rain eoc":
case "acidrain eoc":
case "acidraineoc":
return CalamityWorld.downedEoCAcidRain;
return DownedBossSystem.downedEoCAcidRain;
case "desertscourge":
case "desert scourge":
return CalamityWorld.downedDesertScourge;
return DownedBossSystem.downedDesertScourge;
case "clam":
case "giantclam":
case "giant clam":
return CalamityWorld.downedCLAM;
return DownedBossSystem.downedCLAM;
case "crabulon":
return CalamityWorld.downedCrabulon;
return DownedBossSystem.downedCrabulon;
case "hivemind":
case "hive mind":
case "thehivemind":
case "the hive mind":
return CalamityWorld.downedHiveMind;
return DownedBossSystem.downedHiveMind;
case "perforator":
case "perforators":
@@ -68,13 +69,13 @@ namespace CalamityMod
case "perforator hive":
case "theperforatorhive":
case "the perforator hive":
return CalamityWorld.downedPerforator;
return DownedBossSystem.downedPerforator;
case "slimegod":
case "slime god":
case "theslimegod":
case "the slime god":
return CalamityWorld.downedSlimeGod;
return DownedBossSystem.downedSlimeGod;
case "hmclam":
case "clamhm":
@@ -88,10 +89,10 @@ namespace CalamityMod
case "hardmode clam":
case "hardmodegiantclam":
case "hardmode giant clam":
return CalamityWorld.downedCLAMHardMode;
return DownedBossSystem.downedCLAMHardMode;
case "cryogen":
return CalamityWorld.downedCryogen;
return DownedBossSystem.downedCryogen;
case "acid rain 2":
case "acidrain 2":
@@ -104,15 +105,15 @@ namespace CalamityMod
case "acidrain aquaticscourge":
case "acidrainscourge":
case "acidrainaquaticscourge":
return CalamityWorld.downedAquaticScourgeAcidRain;
return DownedBossSystem.downedAquaticScourgeAcidRain;
case "aquaticscourge":
case "aquatic scourge":
return CalamityWorld.downedAquaticScourge;
return DownedBossSystem.downedAquaticScourge;
case "brimstoneelemental":
case "brimstone elemental":
return CalamityWorld.downedBrimstoneElemental;
return DownedBossSystem.downedBrimstoneElemental;
case "calamitas":
case "clone":
@@ -121,12 +122,12 @@ namespace CalamityMod
case "clonelamitas":
case "calamitasdoppelganger":
case "calamitas doppelganger":
return CalamityWorld.downedCalamitas;
return DownedBossSystem.downedCalamitas;
case "gss":
case "greatsandshark":
case "great sand shark":
return CalamityWorld.downedGSS;
return DownedBossSystem.downedGSS;
// Don't remove the old references to "Siren" here to avoid breaking other mods
case "sirenleviathan":
@@ -146,12 +147,12 @@ namespace CalamityMod
case "anahitaandleviathan":
case "anahita and leviathan":
case "anahita and the leviathan":
return CalamityWorld.downedLeviathan;
return DownedBossSystem.downedLeviathan;
case "aureus":
case "astrumaureus":
case "astrum aureus":
return CalamityWorld.downedAstrageldon;
return DownedBossSystem.downedAstrageldon;
case "pbg":
case "plaguebringer":
@@ -159,17 +160,17 @@ namespace CalamityMod
case "plaguebringer goliath":
case "theplaguebringergoliath":
case "the plaguebringer goliath":
return CalamityWorld.downedPlaguebringer;
return DownedBossSystem.downedPlaguebringer;
case "scavenger": // backwards compatibility
case "ravager":
return CalamityWorld.downedScavenger;
return DownedBossSystem.downedScavenger;
case "stargod": // backwards compatibility
case "star god": // backwards compatibility
case "astrumdeus":
case "astrum deus":
return CalamityWorld.downedStarGod;
return DownedBossSystem.downedStarGod;
case "guardians":
case "donuts":
@@ -177,24 +178,24 @@ namespace CalamityMod
case "profaned guardians":
case "theprofanedguardians":
case "the profaned guardians":
return CalamityWorld.downedGuardians;
return DownedBossSystem.downedGuardians;
case "dragonfolly":
case "the dragonfolly":
case "bumblebirb":
case "bumblefuck":
return CalamityWorld.downedBumble;
return DownedBossSystem.downedBumble;
case "providence":
case "providencetheprofanedgoddess":
case "providence the profaned goddess":
case "providence, the profaned goddess":
return CalamityWorld.downedProvidence;
return DownedBossSystem.downedProvidence;
case "polterghast":
case "necroghast":
case "necroplasm":
return CalamityWorld.downedPolterghast;
return DownedBossSystem.downedPolterghast;
// Old Duke is also Acid Rain tier 3, so he gets those names too
case "oldduke":
@@ -213,18 +214,18 @@ namespace CalamityMod
case "acid rain duke":
case "acidrain duke":
case "acidrainduke":
return CalamityWorld.downedBoomerDuke;
return DownedBossSystem.downedBoomerDuke;
case "sentinel1": // backwards compatibility
case "void":
case "ceaselessvoid":
case "ceaseless void":
return CalamityWorld.downedSentinel1;
return DownedBossSystem.downedSentinel1;
case "sentinel2": // backwards compatibility
case "stormweaver":
case "storm weaver":
return CalamityWorld.downedSentinel2;
return DownedBossSystem.downedSentinel2;
case "sentinel3": // backwards compatibility
case "cosmicwraith":
@@ -233,7 +234,7 @@ namespace CalamityMod
case "signusenvoyofthedevourer":
case "signus envoy of the devourer":
case "signus, envoy of the devourer":
return CalamityWorld.downedSentinel3;
return DownedBossSystem.downedSentinel3;
case "sentinelany": // backwards compatibility
case "anysentinel":
@@ -241,27 +242,27 @@ namespace CalamityMod
case "onesentinel":
case "one sentinel":
case "sentinel":
return CalamityWorld.downedSentinel1 || CalamityWorld.downedSentinel2 || CalamityWorld.downedSentinel3;
return DownedBossSystem.downedSentinel1 || DownedBossSystem.downedSentinel2 || DownedBossSystem.downedSentinel3;
case "sentinelall": // backwards compatibility
case "sentinels":
case "allsentinel":
case "allsentinels":
case "all sentinels":
return CalamityWorld.downedSentinel1 && CalamityWorld.downedSentinel2 && CalamityWorld.downedSentinel3;
return DownedBossSystem.downedSentinel1 && DownedBossSystem.downedSentinel2 && DownedBossSystem.downedSentinel3;
case "dog":
case "devourerofgods":
case "devourer of gods":
case "thedevourerofgods":
case "the devourer of gods":
return CalamityWorld.downedDoG;
return DownedBossSystem.downedDoG;
case "yharon":
case "jungledragonyharon":
case "jungle dragon yharon":
case "jungle dragon, yharon":
return CalamityWorld.downedYharon;
return DownedBossSystem.downedYharon;
case "draedon":
case "exomechs":
@@ -271,12 +272,12 @@ namespace CalamityMod
case "artemis":
case "thanatos":
case "ares":
return CalamityWorld.downedExoMechs;
return DownedBossSystem.downedExoMechs;
case "scal":
case "supremecalamitas":
case "supreme calamitas":
return CalamityWorld.downedSCal;
return DownedBossSystem.downedSCal;
case "adulteidolonwyrm":
case "adult eidolon wyrm":
@@ -284,7 +285,7 @@ namespace CalamityMod
case "adult wyrm":
case "adulteidolon":
case "adult eidolon":
return CalamityWorld.downedAdultEidolonWyrm;
return DownedBossSystem.downedAdultEidolonWyrm;
}
}
#endregion
+31 -31
View File
@@ -79,38 +79,38 @@ namespace CalamityMod
{
internal class Downed
{
public static readonly Func<bool> DownedDesertScourge = () => CalamityWorld.downedDesertScourge;
public static readonly Func<bool> DownedGiantClam = () => CalamityWorld.downedCLAM;
public static readonly Func<bool> DownedCrabulon = () => CalamityWorld.downedCrabulon;
public static readonly Func<bool> DownedHiveMind = () => CalamityWorld.downedHiveMind;
public static readonly Func<bool> DownedPerfs = () => CalamityWorld.downedPerforator;
public static readonly Func<bool> DownedSlimeGod = () => CalamityWorld.downedSlimeGod;
public static readonly Func<bool> DownedCryogen = () => CalamityWorld.downedCryogen;
public static readonly Func<bool> DownedBrimstoneElemental = () => CalamityWorld.downedBrimstoneElemental;
public static readonly Func<bool> DownedAquaticScourge = () => CalamityWorld.downedAquaticScourge;
public static readonly Func<bool> DownedCalamitas = () => CalamityWorld.downedCalamitas;
public static readonly Func<bool> DownedGSS = () => CalamityWorld.downedGSS;
public static readonly Func<bool> DownedLeviathan = () => CalamityWorld.downedLeviathan;
public static readonly Func<bool> DownedAureus = () => CalamityWorld.downedAstrageldon;
public static readonly Func<bool> DownedPBG = () => CalamityWorld.downedPlaguebringer;
public static readonly Func<bool> DownedRavager = () => CalamityWorld.downedScavenger;
public static readonly Func<bool> DownedDeus = () => CalamityWorld.downedStarGod;
public static readonly Func<bool> DownedGuardians = () => CalamityWorld.downedGuardians;
public static readonly Func<bool> DownedBirb = () => CalamityWorld.downedBumble;
public static readonly Func<bool> DownedProvidence = () => CalamityWorld.downedProvidence;
public static readonly Func<bool> DownedCeaselessVoid = () => CalamityWorld.downedSentinel1;
public static readonly Func<bool> DownedStormWeaver = () => CalamityWorld.downedSentinel2;
public static readonly Func<bool> DownedSignus = () => CalamityWorld.downedSentinel3;
public static readonly Func<bool> DownedPolterghast = () => CalamityWorld.downedPolterghast;
public static readonly Func<bool> DownedBoomerDuke = () => CalamityWorld.downedBoomerDuke;
public static readonly Func<bool> DownedDoG = () => CalamityWorld.downedDoG;
public static readonly Func<bool> DownedYharon = () => CalamityWorld.downedYharon;
public static readonly Func<bool> DownedExoMechs = () => CalamityWorld.downedExoMechs;
public static readonly Func<bool> DownedSCal = () => CalamityWorld.downedSCal;
public static readonly Func<bool> DownedAdultEidolonWyrm = () => CalamityWorld.downedAdultEidolonWyrm;
public static readonly Func<bool> DownedDesertScourge = () => DownedBossSystem.downedDesertScourge;
public static readonly Func<bool> DownedGiantClam = () => DownedBossSystem.downedCLAM;
public static readonly Func<bool> DownedCrabulon = () => DownedBossSystem.downedCrabulon;
public static readonly Func<bool> DownedHiveMind = () => DownedBossSystem.downedHiveMind;
public static readonly Func<bool> DownedPerfs = () => DownedBossSystem.downedPerforator;
public static readonly Func<bool> DownedSlimeGod = () => DownedBossSystem.downedSlimeGod;
public static readonly Func<bool> DownedCryogen = () => DownedBossSystem.downedCryogen;
public static readonly Func<bool> DownedBrimstoneElemental = () => DownedBossSystem.downedBrimstoneElemental;
public static readonly Func<bool> DownedAquaticScourge = () => DownedBossSystem.downedAquaticScourge;
public static readonly Func<bool> DownedCalamitas = () => DownedBossSystem.downedCalamitas;
public static readonly Func<bool> DownedGSS = () => DownedBossSystem.downedGSS;
public static readonly Func<bool> DownedLeviathan = () => DownedBossSystem.downedLeviathan;
public static readonly Func<bool> DownedAureus = () => DownedBossSystem.downedAstrageldon;
public static readonly Func<bool> DownedPBG = () => DownedBossSystem.downedPlaguebringer;
public static readonly Func<bool> DownedRavager = () => DownedBossSystem.downedScavenger;
public static readonly Func<bool> DownedDeus = () => DownedBossSystem.downedStarGod;
public static readonly Func<bool> DownedGuardians = () => DownedBossSystem.downedGuardians;
public static readonly Func<bool> DownedBirb = () => DownedBossSystem.downedBumble;
public static readonly Func<bool> DownedProvidence = () => DownedBossSystem.downedProvidence;
public static readonly Func<bool> DownedCeaselessVoid = () => DownedBossSystem.downedSentinel1;
public static readonly Func<bool> DownedStormWeaver = () => DownedBossSystem.downedSentinel2;
public static readonly Func<bool> DownedSignus = () => DownedBossSystem.downedSentinel3;
public static readonly Func<bool> DownedPolterghast = () => DownedBossSystem.downedPolterghast;
public static readonly Func<bool> DownedBoomerDuke = () => DownedBossSystem.downedBoomerDuke;
public static readonly Func<bool> DownedDoG = () => DownedBossSystem.downedDoG;
public static readonly Func<bool> DownedYharon = () => DownedBossSystem.downedYharon;
public static readonly Func<bool> DownedExoMechs = () => DownedBossSystem.downedExoMechs;
public static readonly Func<bool> DownedSCal = () => DownedBossSystem.downedSCal;
public static readonly Func<bool> DownedAdultEidolonWyrm = () => DownedBossSystem.downedAdultEidolonWyrm;
public static readonly Func<bool> DownedAcidRainInitial = () => CalamityWorld.downedEoCAcidRain;
public static readonly Func<bool> DownedAcidRainHardmode = () => CalamityWorld.downedAquaticScourgeAcidRain;
public static readonly Func<bool> DownedAcidRainInitial = () => DownedBossSystem.downedEoCAcidRain;
public static readonly Func<bool> DownedAcidRainHardmode = () => DownedBossSystem.downedAquaticScourgeAcidRain;
}
internal class WeakReferenceSupport
+1 -1
View File
@@ -194,7 +194,7 @@ namespace CalamityMod.NPCs.Abyss
DropHelper.DropItem(NPC, ModContent.ItemType<Voidstone>(), 10, 20);
int minCells = Main.expertMode ? 7 : 5;
int maxCells = Main.expertMode ? 10 : 7;
DropHelper.DropItemCondition(NPC, ModContent.ItemType<DepthCells>(), CalamityWorld.downedCalamitas, 0.5f, minCells, maxCells);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<DepthCells>(), DownedBossSystem.downedCalamitas, 0.5f, minCells, maxCells);
}
public override void HitEffect(int hitDirection, double damage)
+2 -2
View File
@@ -241,8 +241,8 @@ namespace CalamityMod.NPCs.Abyss
{
int minCells = Main.expertMode ? 7 : 5;
int maxCells = Main.expertMode ? 10 : 7;
DropHelper.DropItemCondition(NPC, ModContent.ItemType<DepthCells>(), CalamityWorld.downedCalamitas, 0.5f, minCells, maxCells);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<BobbitHook>(), CalamityWorld.downedPolterghast, 3, 1, 1);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<DepthCells>(), DownedBossSystem.downedCalamitas, 0.5f, minCells, maxCells);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<BobbitHook>(), DownedBossSystem.downedPolterghast, 3, 1, 1);
}
public override void HitEffect(int hitDirection, double damage)
+2 -2
View File
@@ -554,8 +554,8 @@ namespace CalamityMod.NPCs.Abyss
DropHelper.DropItem(NPC, ItemID.BlackInk, 3, 5);
int minCells = Main.expertMode ? 31 : 26;
int maxCells = Main.expertMode ? 45 : 38;
DropHelper.DropItemCondition(NPC, ModContent.ItemType<DepthCells>(), CalamityWorld.downedCalamitas, 0.5f, minCells, maxCells);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<CalamarisLament>(), CalamityWorld.downedPolterghast, 3, 1, 1);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<DepthCells>(), DownedBossSystem.downedCalamitas, 0.5f, minCells, maxCells);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<CalamarisLament>(), DownedBossSystem.downedPolterghast, 3, 1, 1);
DropHelper.DropItemChance(NPC, ModContent.ItemType<InkBomb>(), 10, 1, 1);
}
+2 -2
View File
@@ -303,10 +303,10 @@ namespace CalamityMod.NPCs.Abyss
public override void NPCLoot()
{
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Lumenite>(), CalamityWorld.downedCalamitas, 0.5f);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Lumenite>(), DownedBossSystem.downedCalamitas, 0.5f);
int minCells = Main.expertMode ? 2 : 1;
int maxCells = Main.expertMode ? 3 : 2;
DropHelper.DropItemCondition(NPC, ModContent.ItemType<DepthCells>(), CalamityWorld.downedCalamitas, 0.5f, minCells, maxCells);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<DepthCells>(), DownedBossSystem.downedCalamitas, 0.5f, minCells, maxCells);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<ChaoticOre>(), NPC.downedGolemBoss, 1f, 3, 9);
}
+2 -2
View File
@@ -303,10 +303,10 @@ namespace CalamityMod.NPCs.Abyss
public override void NPCLoot()
{
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Lumenite>(), CalamityWorld.downedCalamitas, 0.5f);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Lumenite>(), DownedBossSystem.downedCalamitas, 0.5f);
int minCells = Main.expertMode ? 2 : 1;
int maxCells = Main.expertMode ? 3 : 2;
DropHelper.DropItemCondition(NPC, ModContent.ItemType<DepthCells>(), CalamityWorld.downedCalamitas, 0.5f, minCells, maxCells);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<DepthCells>(), DownedBossSystem.downedCalamitas, 0.5f, minCells, maxCells);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<ChaoticOre>(), NPC.downedGolemBoss, 1f, 3, 9);
}
+4 -4
View File
@@ -496,12 +496,12 @@ namespace CalamityMod.NPCs.Abyss
public override void NPCLoot()
{
DropHelper.DropItem(NPC, ModContent.ItemType<Voidstone>(), 30, 40);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<SoulEdge>(), CalamityWorld.downedPolterghast, 3, 1, 1);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<EidolicWail>(), CalamityWorld.downedPolterghast, 3, 1, 1);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<StardustStaff>(), CalamityWorld.downedPolterghast, 10, 1, 1);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<SoulEdge>(), DownedBossSystem.downedPolterghast, 3, 1, 1);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<EidolicWail>(), DownedBossSystem.downedPolterghast, 3, 1, 1);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<StardustStaff>(), DownedBossSystem.downedPolterghast, 10, 1, 1);
int minLumenyl = Main.expertMode ? 8 : 6;
int maxLumenyl = Main.expertMode ? 11 : 8;
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Lumenite>(), CalamityWorld.downedCalamitas, 1f, minLumenyl, maxLumenyl);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Lumenite>(), DownedBossSystem.downedCalamitas, 1f, minLumenyl, maxLumenyl);
DropHelper.DropItemCondition(NPC, ItemID.Ectoplasm, NPC.downedPlantBoss, 1, 8, 12);
}
+2 -2
View File
@@ -249,10 +249,10 @@ namespace CalamityMod.NPCs.Abyss
public override void NPCLoot()
{
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Lumenite>(), CalamityWorld.downedCalamitas, 0.5f);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Lumenite>(), DownedBossSystem.downedCalamitas, 0.5f);
int minCells = Main.expertMode ? 3 : 2;
int maxCells = Main.expertMode ? 6 : 4;
DropHelper.DropItemCondition(NPC, ModContent.ItemType<DepthCells>(), CalamityWorld.downedCalamitas, 0.5f, minCells, maxCells);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<DepthCells>(), DownedBossSystem.downedCalamitas, 0.5f, minCells, maxCells);
int inkBombDropRate = Main.expertMode ? 25 : 40;
DropHelper.DropItemChance(NPC, ModContent.ItemType<InkBomb>(), inkBombDropRate, 1, 1);
}
+2 -2
View File
@@ -339,10 +339,10 @@ namespace CalamityMod.NPCs.Abyss
{
int minLumenyl = Main.expertMode ? 3 : 2;
int maxLumenyl = Main.expertMode ? 4 : 3;
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Lumenite>(), CalamityWorld.downedCalamitas, 0.5f, minLumenyl, maxLumenyl);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Lumenite>(), DownedBossSystem.downedCalamitas, 0.5f, minLumenyl, maxLumenyl);
int minCells = Main.expertMode ? 8 : 6;
int maxCells = Main.expertMode ? 11 : 8;
DropHelper.DropItemCondition(NPC, ModContent.ItemType<DepthCells>(), CalamityWorld.downedCalamitas, 0.5f, minCells, maxCells);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<DepthCells>(), DownedBossSystem.downedCalamitas, 0.5f, minCells, maxCells);
}
public override void HitEffect(int hitDirection, double damage)
+1 -1
View File
@@ -113,7 +113,7 @@ namespace CalamityMod.NPCs.Abyss
public override void NPCLoot()
{
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Lumenite>(), CalamityWorld.downedCalamitas, 0.5f);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Lumenite>(), DownedBossSystem.downedCalamitas, 0.5f);
}
public override void HitEffect(int hitDirection, double damage)
+2 -2
View File
@@ -289,10 +289,10 @@ namespace CalamityMod.NPCs.Abyss
public override void NPCLoot()
{
DropHelper.DropItem(NPC, ModContent.ItemType<Voidstone>(), 8, 15);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Lumenite>(), CalamityWorld.downedCalamitas, 0.5f);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Lumenite>(), DownedBossSystem.downedCalamitas, 0.5f);
int minCells = Main.expertMode ? 2 : 1;
int maxCells = Main.expertMode ? 3 : 2;
DropHelper.DropItemCondition(NPC, ModContent.ItemType<DepthCells>(), CalamityWorld.downedCalamitas, 0.5f, minCells, maxCells);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<DepthCells>(), DownedBossSystem.downedCalamitas, 0.5f, minCells, maxCells);
}
public override void HitEffect(int hitDirection, double damage)
+1 -1
View File
@@ -206,7 +206,7 @@ namespace CalamityMod.NPCs.Abyss
DropHelper.DropItemCondition(NPC, ModContent.ItemType<AbyssShocker>(), NPC.downedBoss3, 10, 1, 1);
int minCells = Main.expertMode ? 10 : 5;
int maxCells = Main.expertMode ? 14 : 7;
DropHelper.DropItemCondition(NPC, ModContent.ItemType<DepthCells>(), CalamityWorld.downedCalamitas, 0.5f, minCells, maxCells);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<DepthCells>(), DownedBossSystem.downedCalamitas, 0.5f, minCells, maxCells);
DropHelper.DropItemChance(NPC, ModContent.ItemType<LifeJelly>(), Main.expertMode ? 5 : 7);
DropHelper.DropItemChance(NPC, ModContent.ItemType<ManaJelly>(), Main.expertMode ? 5 : 7);
DropHelper.DropItemChance(NPC, ModContent.ItemType<VitalJelly>(), Main.expertMode ? 5 : 7);
+1 -1
View File
@@ -301,7 +301,7 @@ namespace CalamityMod.NPCs.Abyss
{
int minCells = Main.expertMode ? 4 : 3;
int maxCells = Main.expertMode ? 7 : 5;
DropHelper.DropItemCondition(NPC, ModContent.ItemType<DepthCells>(), CalamityWorld.downedCalamitas, 0.5f, minCells, maxCells);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<DepthCells>(), DownedBossSystem.downedCalamitas, 0.5f, minCells, maxCells);
}
public override void HitEffect(int hitDirection, double damage)
+4 -4
View File
@@ -653,10 +653,10 @@ namespace CalamityMod.NPCs.Abyss
DropHelper.DropItem(NPC, ModContent.ItemType<AnechoicCoating>(), 2, 3);
int minCells = Main.expertMode ? 14 : 10;
int maxCells = Main.expertMode ? 22 : 17;
DropHelper.DropItemCondition(NPC, ModContent.ItemType<DepthCells>(), CalamityWorld.downedCalamitas, 0.5f, minCells, maxCells);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<ReaperTooth>(), CalamityWorld.downedPolterghast, 1f, 3, 4);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<DeepSeaDumbbell>(), CalamityWorld.downedPolterghast, 3, 1, 1);
if (CalamityWorld.downedPolterghast)
DropHelper.DropItemCondition(NPC, ModContent.ItemType<DepthCells>(), DownedBossSystem.downedCalamitas, 0.5f, minCells, maxCells);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<ReaperTooth>(), DownedBossSystem.downedPolterghast, 1f, 3, 4);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<DeepSeaDumbbell>(), DownedBossSystem.downedPolterghast, 3, 1, 1);
if (DownedBossSystem.downedPolterghast)
{
DropHelper.DropItemChance(NPC, ModContent.ItemType<Valediction>(), 3);
}
+1 -1
View File
@@ -153,7 +153,7 @@ namespace CalamityMod.NPCs.Abyss
{
int minCells = Main.expertMode ? 4 : 2;
int maxCells = Main.expertMode ? 6 : 3;
DropHelper.DropItemCondition(NPC, ModContent.ItemType<DepthCells>(), CalamityWorld.downedCalamitas, 0.5f, minCells, maxCells);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<DepthCells>(), DownedBossSystem.downedCalamitas, 0.5f, minCells, maxCells);
}
public override void HitEffect(int hitDirection, double damage)
+2 -2
View File
@@ -116,10 +116,10 @@ namespace CalamityMod.NPCs.Abyss
public override void NPCLoot()
{
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Lumenite>(), CalamityWorld.downedCalamitas, 0.25f);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Lumenite>(), DownedBossSystem.downedCalamitas, 0.25f);
int minCells = Main.expertMode ? 2 : 1;
int maxCells = Main.expertMode ? 3 : 2;
DropHelper.DropItemCondition(NPC, ModContent.ItemType<DepthCells>(), CalamityWorld.downedCalamitas, 0.5f, minCells, maxCells);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<DepthCells>(), DownedBossSystem.downedCalamitas, 0.5f, minCells, maxCells);
}
public override void HitEffect(int hitDirection, double damage)
+5 -5
View File
@@ -35,7 +35,7 @@ namespace CalamityMod.NPCs.AcidRain
NPC.defense = 4;
NPC.knockBackResist = 0.9f;
if (CalamityWorld.downedPolterghast)
if (DownedBossSystem.downedPolterghast)
{
NPC.DR_NERD(0.05f);
NPC.damage = 100;
@@ -43,7 +43,7 @@ namespace CalamityMod.NPCs.AcidRain
NPC.defense = 20;
NPC.knockBackResist = 0.7f;
}
else if (CalamityWorld.downedAquaticScourge)
else if (DownedBossSystem.downedAquaticScourge)
{
NPC.damage = 50;
NPC.lifeMax = 240;
@@ -91,9 +91,9 @@ namespace CalamityMod.NPCs.AcidRain
public void SwimTowardsTarget()
{
float swimSpeed = 12f;
if (CalamityWorld.downedAquaticScourge)
if (DownedBossSystem.downedAquaticScourge)
swimSpeed += 3f;
if (CalamityWorld.downedPolterghast)
if (DownedBossSystem.downedPolterghast)
swimSpeed += 4f;
// Swim upwards if sufficiently under water.
@@ -136,7 +136,7 @@ namespace CalamityMod.NPCs.AcidRain
public override void NPCLoot()
{
DropHelper.DropItemChance(NPC, ModContent.ItemType<SulfuricScale>(), 2, 1, 3);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<SlitheringEels>(), CalamityWorld.downedAquaticScourge, 0.05f);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<SlitheringEels>(), DownedBossSystem.downedAquaticScourge, 0.05f);
}
public override void FindFrame(int frameHeight)
+14 -14
View File
@@ -1,4 +1,4 @@
using CalamityMod.Dusts;
using CalamityMod.Dusts;
using CalamityMod.Items.Accessories;
using CalamityMod.Projectiles.Enemy;
using CalamityMod.World;
@@ -42,7 +42,7 @@ namespace CalamityMod.NPCs.AcidRain
get
{
float phase2CeilingRatio = CalamityWorld.revenge ? 0.85f : 0.7f;
return NPC.life / (float)NPC.lifeMax < phase2CeilingRatio && CalamityWorld.downedPolterghast;
return NPC.life / (float)NPC.lifeMax < phase2CeilingRatio && DownedBossSystem.downedPolterghast;
}
}
@@ -64,7 +64,7 @@ namespace CalamityMod.NPCs.AcidRain
NPC.lifeMax = 4000;
NPC.defense = 25;
if (CalamityWorld.downedPolterghast)
if (DownedBossSystem.downedPolterghast)
{
NPC.damage = 160;
NPC.lifeMax = 80630;
@@ -128,7 +128,7 @@ namespace CalamityMod.NPCs.AcidRain
int spikesPerBurst = 5;
float burstSpeed = 8f;
int burstShootRate = 92;
if (CalamityWorld.downedPolterghast)
if (DownedBossSystem.downedPolterghast)
{
spikesPerBurst += 3;
burstSpeed += 3.25f;
@@ -166,7 +166,7 @@ namespace CalamityMod.NPCs.AcidRain
if (Main.netMode != NetmodeID.MultiplayerClient)
{
int damage = CalamityWorld.downedPolterghast ? 52 : 33;
int damage = DownedBossSystem.downedPolterghast ? 52 : 33;
float shootOffsetAngle = Main.rand.NextFloat(MathHelper.TwoPi);
for (int i = 0; i < spikesPerBurst; i++)
{
@@ -187,7 +187,7 @@ namespace CalamityMod.NPCs.AcidRain
float slamAcceleration = 0.375f;
float maxSlamSpeed = 19f;
int slamCount = 2;
if (CalamityWorld.downedPolterghast)
if (DownedBossSystem.downedPolterghast)
{
opacityFadeoutIncrement += 0.03f;
slamAcceleration += 0.07f;
@@ -272,7 +272,7 @@ namespace CalamityMod.NPCs.AcidRain
SoundEngine.PlaySound(SoundID.DD2_ExplosiveTrapExplode, NPC.Center);
if (Main.netMode != NetmodeID.MultiplayerClient)
{
int nukeDamage = CalamityWorld.downedPolterghast ? 72 : 38;
int nukeDamage = DownedBossSystem.downedPolterghast ? 72 : 38;
int dropletDamage = (int)(nukeDamage * 0.6f);
int explosion = Projectile.NewProjectile(NPC.Center, Vector2.Zero, ModContent.ProjectileType<CragmawExplosion>(), nukeDamage, 0f);
if (Main.projectile.IndexInRange(explosion))
@@ -312,7 +312,7 @@ namespace CalamityMod.NPCs.AcidRain
float digReapperSpeed = 4f;
int chargeupTelegraphTime = 60;
float opacityFadeoutIncrement = 0.025f;
if (CalamityWorld.downedPolterghast)
if (DownedBossSystem.downedPolterghast)
{
opacityFadeoutIncrement += 0.025f;
chargeupTelegraphTime -= 15;
@@ -398,7 +398,7 @@ namespace CalamityMod.NPCs.AcidRain
if (Main.netMode != NetmodeID.MultiplayerClient)
{
int laserbeamDamage = CalamityWorld.downedPolterghast ? 120 : 40;
int laserbeamDamage = DownedBossSystem.downedPolterghast ? 120 : 40;
Projectile.NewProjectile(NPC.Center, -Vector2.UnitY, ModContent.ProjectileType<CragmawBeam>(), laserbeamDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI);
}
}
@@ -447,10 +447,10 @@ namespace CalamityMod.NPCs.AcidRain
NPC.damage = (int)(NPC.damage * 0.85f);
}
public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor)
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
{
Texture2D texture = InPhase2 ? ModContent.Request<Texture2D>("CalamityMod/NPCs/AcidRain/CragmawMire2") : ModContent.Request<Texture2D>("CalamityMod/NPCs/AcidRain/CragmawMire");
CalamityMod.DrawTexture(spriteBatch, texture, 0, NPC, NPC.GetAlpha(drawColor), true);
Texture2D texture = InPhase2 ? ModContent.Request<Texture2D>("CalamityMod/NPCs/AcidRain/CragmawMire2").Value : ModContent.Request<Texture2D>("CalamityMod/NPCs/AcidRain/CragmawMire").Value;
Main.EntitySpriteDraw(texture, screenPos, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, NPC.frame.Size() * 0.5f, NPC.scale, 0, 0);
return false;
}
@@ -479,8 +479,8 @@ namespace CalamityMod.NPCs.AcidRain
public override void NPCLoot()
{
DropHelper.DropItemChance(NPC, ModContent.ItemType<NuclearRod>(), CalamityWorld.downedPolterghast ? 0.1f : 1f);
DropHelper.DropItemChance(NPC, ModContent.ItemType<SpentFuelContainer>(), CalamityWorld.downedPolterghast ? 0.1f : 1f);
DropHelper.DropItemChance(NPC, ModContent.ItemType<NuclearRod>(), DownedBossSystem.downedPolterghast ? 0.1f : 1f);
DropHelper.DropItemChance(NPC, ModContent.ItemType<SpentFuelContainer>(), DownedBossSystem.downedPolterghast ? 0.1f : 1f);
}
}
}
+1 -1
View File
@@ -120,7 +120,7 @@ namespace CalamityMod.NPCs.AcidRain
public override float SpawnChance(NPCSpawnInfo spawnInfo)
{
if (spawnInfo.playerSafe || !spawnInfo.Player.Calamity().ZoneSulphur || !CalamityWorld.downedAquaticScourge)
if (spawnInfo.playerSafe || !spawnInfo.Player.Calamity().ZoneSulphur || !DownedBossSystem.downedAquaticScourge)
{
return 0f;
}
+4 -4
View File
@@ -39,7 +39,7 @@ namespace CalamityMod.NPCs.AcidRain
NPC.aiStyle = AIType = -1;
if (CalamityWorld.downedPolterghast)
if (DownedBossSystem.downedPolterghast)
{
NPC.lifeMax = 4125;
NPC.DR_NERD(0.2f);
@@ -147,10 +147,10 @@ namespace CalamityMod.NPCs.AcidRain
if (Main.netMode == NetmodeID.MultiplayerClient)
return;
float speed = CalamityWorld.downedPolterghast ? 29f : 17f;
float speed = DownedBossSystem.downedPolterghast ? 29f : 17f;
speed *= Main.rand.NextFloat(0.8f, 1.2f);
int damage = Main.expertMode ? CalamityWorld.downedPolterghast ? 32 : 18 : CalamityWorld.downedPolterghast ? 42 : 23;
int damage = Main.expertMode ? DownedBossSystem.downedPolterghast ? 32 : 18 : DownedBossSystem.downedPolterghast ? 42 : 23;
Vector2 spawnPosition = NPC.Top + Vector2.UnitY * 6f;
Vector2 shootVelocity = (closestTargetToTop.Center - spawnPosition).SafeNormalize(Vector2.UnitY).RotatedByRandom(0.25f) * speed;
Projectile.NewProjectile(spawnPosition, shootVelocity, ModContent.ProjectileType<FlakAcid>(), damage, 2f);
@@ -169,7 +169,7 @@ namespace CalamityMod.NPCs.AcidRain
public override void NPCLoot()
{
DropHelper.DropItemChance(NPC, ModContent.ItemType<CorrodedFossil>(), 3 * (CalamityWorld.downedPolterghast ? 5 : 1), 1, 3);
DropHelper.DropItemChance(NPC, ModContent.ItemType<CorrodedFossil>(), 3 * (DownedBossSystem.downedPolterghast ? 5 : 1), 1, 3);
DropHelper.DropItemChance(NPC, ModContent.ItemType<FlakToxicannon>(), 0.05f);
}
+7 -7
View File
@@ -35,13 +35,13 @@ namespace CalamityMod.NPCs.AcidRain
NPC.lifeMax = 60;
NPC.defense = 3;
if (CalamityWorld.downedPolterghast)
if (DownedBossSystem.downedPolterghast)
{
NPC.damage = 80;
NPC.lifeMax = 2750;
NPC.defense = 15;
}
else if (CalamityWorld.downedAquaticScourge)
else if (DownedBossSystem.downedAquaticScourge)
{
NPC.damage = 35;
NPC.lifeMax = 200;
@@ -92,8 +92,8 @@ namespace CalamityMod.NPCs.AcidRain
if (Main.rand.NextBool(480))
SoundEngine.PlaySound(SoundID.Zombie, NPC.Center, 13);
float explodeDistance = CalamityWorld.downedAquaticScourge ? 295f : 195f;
if (CalamityWorld.downedPolterghast)
float explodeDistance = DownedBossSystem.downedAquaticScourge ? 295f : 195f;
if (DownedBossSystem.downedPolterghast)
explodeDistance = 470f;
// Explode if a player gets too close.
@@ -101,9 +101,9 @@ namespace CalamityMod.NPCs.AcidRain
{
if (Main.netMode != NetmodeID.MultiplayerClient)
{
int damage = Main.expertMode ? CalamityWorld.downedAquaticScourge ? 21 : 8 : CalamityWorld.downedAquaticScourge ? 27 : 10;
int damage = Main.expertMode ? DownedBossSystem.downedAquaticScourge ? 21 : 8 : DownedBossSystem.downedAquaticScourge ? 27 : 10;
float speed = Main.rand.NextFloat(6f, 9f);
if (CalamityWorld.downedPolterghast)
if (DownedBossSystem.downedPolterghast)
{
speed *= 1.8f;
damage = Main.expertMode ? 36 : 45;
@@ -150,7 +150,7 @@ namespace CalamityMod.NPCs.AcidRain
public override void NPCLoot()
{
float dropChance = CalamityWorld.downedAquaticScourge ? 0.01f : 0.05f;
float dropChance = DownedBossSystem.downedAquaticScourge ? 0.01f : 0.05f;
DropHelper.DropItemChance(NPC, ModContent.ItemType<CausticCroakerStaff>(), dropChance);
DropHelper.DropItemChance(NPC, ModContent.ItemType<SulfuricScale>(), 2, 1, 3);
}
+6 -6
View File
@@ -45,7 +45,7 @@ namespace CalamityMod.NPCs.AcidRain
NPC.defense = 15;
NPC.DR_NERD(0.075f);
if (CalamityWorld.downedPolterghast)
if (DownedBossSystem.downedPolterghast)
{
NPC.damage = 120;
NPC.lifeMax = 3850;
@@ -72,7 +72,7 @@ namespace CalamityMod.NPCs.AcidRain
{
Time++;
NPC.TargetClosest(false);
float maxSpeed = CalamityWorld.downedPolterghast ? 12.8f : 10.5f;
float maxSpeed = DownedBossSystem.downedPolterghast ? 12.8f : 10.5f;
if (!Main.player.IndexInRange(NPC.target))
return;
@@ -125,7 +125,7 @@ namespace CalamityMod.NPCs.AcidRain
// And jump/shoot.
else if (Time % 220f > 180f)
{
float verticalAcceleration = CalamityWorld.downedPolterghast ? 0.07f : 0.05f;
float verticalAcceleration = DownedBossSystem.downedPolterghast ? 0.07f : 0.05f;
if (Time % 220f < 200f)
NPC.velocity.Y -= verticalAcceleration;
else
@@ -161,12 +161,12 @@ namespace CalamityMod.NPCs.AcidRain
if (NPC.spriteDirection == -1)
spitDirection += MathHelper.PiOver2;
int damage = CalamityWorld.downedPolterghast ? 40 : CalamityWorld.downedAquaticScourge ? 26 : 18;
int damage = DownedBossSystem.downedPolterghast ? 40 : DownedBossSystem.downedAquaticScourge ? 26 : 18;
if (Main.expertMode)
damage = (int)Math.Round(damage * 0.8);
// Spit two extra streams of acid at the target post-Polterghast.
if (CalamityWorld.downedPolterghast)
if (DownedBossSystem.downedPolterghast)
{
for (int i = 0; i < 2; i++)
{
@@ -184,7 +184,7 @@ namespace CalamityMod.NPCs.AcidRain
public override void NPCLoot()
{
DropHelper.DropItemChance(NPC, ModContent.ItemType<CorrodedFossil>(), 3 * (CalamityWorld.downedPolterghast ? 5 : 1), 1, 3);
DropHelper.DropItemChance(NPC, ModContent.ItemType<CorrodedFossil>(), 3 * (DownedBossSystem.downedPolterghast ? 5 : 1), 1, 3);
DropHelper.DropItemChance(NPC, ModContent.ItemType<OrthoceraShell>(), 20);
}
+3 -3
View File
@@ -27,13 +27,13 @@ namespace CalamityMod.NPCs.AcidRain
NPC.defense = 5;
NPC.lifeMax = 50;
if (CalamityWorld.downedPolterghast)
if (DownedBossSystem.downedPolterghast)
{
NPC.damage = 60;
NPC.lifeMax = 3250;
NPC.defense = 20;
}
else if (CalamityWorld.downedAquaticScourge)
else if (DownedBossSystem.downedAquaticScourge)
{
NPC.damage = 30;
NPC.lifeMax = 130;
@@ -67,7 +67,7 @@ namespace CalamityMod.NPCs.AcidRain
{
player.AddBuff(ModContent.BuffType<Irradiated>(), 3, false);
player.AddBuff(BuffID.Poisoned, 2, false);
if (CalamityWorld.downedPolterghast)
if (DownedBossSystem.downedPolterghast)
{
player.AddBuff(ModContent.BuffType<SulphuricPoisoning>(), 3, false);
player.AddBuff(BuffID.Venom, 2, false);
+5 -5
View File
@@ -35,7 +35,7 @@ namespace CalamityMod.NPCs.AcidRain
NPC.defense = 6;
NPC.knockBackResist = 1f;
if (CalamityWorld.downedPolterghast)
if (DownedBossSystem.downedPolterghast)
{
NPC.knockBackResist = 0.8f;
NPC.damage = 88;
@@ -43,7 +43,7 @@ namespace CalamityMod.NPCs.AcidRain
NPC.defense = 18;
NPC.DR_NERD(0.05f);
}
else if (CalamityWorld.downedAquaticScourge)
else if (DownedBossSystem.downedAquaticScourge)
{
NPC.damage = 38;
NPC.lifeMax = 220;
@@ -99,9 +99,9 @@ namespace CalamityMod.NPCs.AcidRain
// Charge once sufficiently slowed down.
float chargeSpeed = 11.5f;
if (CalamityWorld.downedAquaticScourge)
if (DownedBossSystem.downedAquaticScourge)
chargeSpeed += 4f;
if (CalamityWorld.downedPolterghast)
if (DownedBossSystem.downedPolterghast)
chargeSpeed += 3.5f;
if (NPC.velocity.Length() < 1.25f)
{
@@ -162,7 +162,7 @@ namespace CalamityMod.NPCs.AcidRain
public override void NPCLoot()
{
DropHelper.DropItemChance(NPC, ModContent.ItemType<SulfuricScale>(), 2, 1, 3);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<SkyfinBombers>(), CalamityWorld.downedAquaticScourge, 0.05f);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<SkyfinBombers>(), DownedBossSystem.downedAquaticScourge, 0.05f);
}
public override void HitEffect(int hitDirection, double damage)
+4 -4
View File
@@ -42,7 +42,7 @@ namespace CalamityMod.NPCs.AcidRain
NPC.lifeMax = 280;
NPC.defense = 3;
if (CalamityWorld.downedPolterghast)
if (DownedBossSystem.downedPolterghast)
{
NPC.damage = 85;
NPC.lifeMax = 3850;
@@ -140,8 +140,8 @@ namespace CalamityMod.NPCs.AcidRain
NPC.knockBackResist = 0.5f;
NPC.DR_NERD(0f);
float flySpeed = CalamityWorld.downedPolterghast ? 17f : 14f;
float flyInertia = CalamityWorld.downedPolterghast ? 20f : 24.5f;
float flySpeed = DownedBossSystem.downedPolterghast ? 17f : 14f;
float flyInertia = DownedBossSystem.downedPolterghast ? 20f : 24.5f;
// Fly more sharply if close to the target.
if (NPC.WithinRange(Target.Center, 200f))
@@ -223,7 +223,7 @@ namespace CalamityMod.NPCs.AcidRain
public override void NPCLoot()
{
DropHelper.DropItemChance(NPC, ModContent.ItemType<CorrodedFossil>(), 3 * (CalamityWorld.downedPolterghast ? 5 : 1), 1, 3);
DropHelper.DropItemChance(NPC, ModContent.ItemType<CorrodedFossil>(), 3 * (DownedBossSystem.downedPolterghast ? 5 : 1), 1, 3);
DropHelper.DropItemChance(NPC, ModContent.ItemType<SulphurousGrabber>(), 20);
}
+5 -5
View File
@@ -38,7 +38,7 @@ namespace CalamityMod.NPCs.AcidRain
NPC.defense = 15;
NPC.DR_NERD(0.25f);
if (CalamityWorld.downedPolterghast)
if (DownedBossSystem.downedPolterghast)
{
NPC.damage = 80;
NPC.lifeMax = 4125;
@@ -73,7 +73,7 @@ namespace CalamityMod.NPCs.AcidRain
if (NPC.velocity.Length() < MinSpeedLungePrompt)
{
NPC.TargetClosest();
float lungeSpeed = CalamityWorld.downedPolterghast ? 18.5f : 15f;
float lungeSpeed = DownedBossSystem.downedPolterghast ? 18.5f : 15f;
NPC.velocity = NPC.SafeDirectionTo(Target.Center, -Vector2.UnitY) * lungeSpeed;
NPC.velocity.X *= 1.6f;
@@ -97,7 +97,7 @@ namespace CalamityMod.NPCs.AcidRain
{
float speedX = 18f;
float speedY = 9f;
if (CalamityWorld.downedPolterghast)
if (DownedBossSystem.downedPolterghast)
{
speedX = 22f;
speedY = 11f;
@@ -134,7 +134,7 @@ namespace CalamityMod.NPCs.AcidRain
public override void NPCLoot()
{
DropHelper.DropItemChance(NPC, ModContent.ItemType<CorrodedFossil>(), 3 * (CalamityWorld.downedPolterghast ? 5 : 1), 1, 3);
DropHelper.DropItemChance(NPC, ModContent.ItemType<CorrodedFossil>(), 3 * (DownedBossSystem.downedPolterghast ? 5 : 1), 1, 3);
}
public override void PostDraw(SpriteBatch spriteBatch, Color drawColor)
@@ -149,7 +149,7 @@ namespace CalamityMod.NPCs.AcidRain
if (SpikeShootCountdown <= 0f)
{
SoundEngine.PlaySound(SoundID.NPCDeath11, NPC.Center);
int projDamage = CalamityWorld.downedPolterghast ? 35 : CalamityWorld.downedAquaticScourge ? 29 : 21;
int projDamage = DownedBossSystem.downedPolterghast ? 35 : DownedBossSystem.downedAquaticScourge ? 29 : 21;
if (Main.expertMode)
projDamage = (int)Math.Round(projDamage * 0.8);
+4 -4
View File
@@ -37,12 +37,12 @@ namespace CalamityMod.NPCs.AcidRain
NPC.lifeMax = 30;
NPC.damage = 0;
if (CalamityWorld.downedPolterghast)
if (DownedBossSystem.downedPolterghast)
{
NPC.lifeMax = 1235;
NPC.defense = 10;
}
else if (CalamityWorld.downedAquaticScourge)
else if (DownedBossSystem.downedAquaticScourge)
NPC.lifeMax = 90;
NPC.value = Item.buyPrice(0, 0, 2, 5);
@@ -119,7 +119,7 @@ namespace CalamityMod.NPCs.AcidRain
{
float swimSpeed = Target.wet ? 23f : 17f;
float swimIntertia = 24f;
if (CalamityWorld.downedPolterghast)
if (DownedBossSystem.downedPolterghast)
{
swimSpeed *= 1.6f;
swimIntertia = 17f;
@@ -208,7 +208,7 @@ namespace CalamityMod.NPCs.AcidRain
public override void NPCLoot()
{
float dropChance = CalamityWorld.downedAquaticScourge ? 0.01f : 0.05f;
float dropChance = DownedBossSystem.downedAquaticScourge ? 0.01f : 0.05f;
DropHelper.DropItemChance(NPC, ModContent.ItemType<ParasiticSceptor>(), dropChance);
}
}
+2 -2
View File
@@ -1349,11 +1349,11 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm
int minLumenyl = Main.expertMode ? 65 : 50;
int maxLumenyl = Main.expertMode ? 135 : 108;
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Lumenite>(), CalamityWorld.downedCalamitas, 1f, minLumenyl, maxLumenyl);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Lumenite>(), DownedBossSystem.downedCalamitas, 1f, minLumenyl, maxLumenyl);
DropHelper.DropItemCondition(NPC, ItemID.Ectoplasm, NPC.downedPlantBoss, 1, 21, 32);
// Mark Adult Eidolon Wyrm as defeated
CalamityWorld.downedAdultEidolonWyrm = true;
DownedBossSystem.downedAdultEidolonWyrm = true;
CalamityNetcode.SyncWorld();
}
+5 -5
View File
@@ -195,10 +195,10 @@ namespace CalamityMod.NPCs.AquaticScourge
DropHelper.DropItem(NPC, ItemID.GreaterHealingPotion, 8, 14);
DropHelper.DropItemChance(NPC, ModContent.ItemType<AquaticScourgeTrophy>(), 10);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<KnowledgeAquaticScourge>(), true, !CalamityWorld.downedAquaticScourge);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<KnowledgeSulphurSea>(), true, !CalamityWorld.downedAquaticScourge);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<KnowledgeAquaticScourge>(), true, !DownedBossSystem.downedAquaticScourge);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<KnowledgeSulphurSea>(), true, !DownedBossSystem.downedAquaticScourge);
CalamityGlobalNPC.SetNewShopVariable(new int[] { ModContent.NPCType<SEAHOE>() }, CalamityWorld.downedAquaticScourge);
CalamityGlobalNPC.SetNewShopVariable(new int[] { ModContent.NPCType<SEAHOE>() }, DownedBossSystem.downedAquaticScourge);
// All other drops are contained in the bag, so they only drop directly on Normal
if (!Main.expertMode)
@@ -228,7 +228,7 @@ namespace CalamityMod.NPCs.AquaticScourge
DropHelper.DropItemCondition(NPC, ModContent.ItemType<SeasSearing>(), !Main.expertMode, 0.1f);
// If Aquatic Scourge has not yet been killed, notify players of buffed Acid Rain
if (!CalamityWorld.downedAquaticScourge)
if (!DownedBossSystem.downedAquaticScourge)
{
if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active)
SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/MaulerRoar"), (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y);
@@ -242,7 +242,7 @@ namespace CalamityMod.NPCs.AquaticScourge
}
// Mark Aquatic Scourge as dead
CalamityWorld.downedAquaticScourge = true;
DownedBossSystem.downedAquaticScourge = true;
CalamityNetcode.SyncWorld();
}
+2 -2
View File
@@ -38,7 +38,7 @@ namespace CalamityMod.NPCs.Astral
NPC.DeathSound = Mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath");
Banner = NPC.type;
BannerItem = ModContent.ItemType<AriesBanner>();
if (CalamityWorld.downedAstrageldon)
if (DownedBossSystem.downedAstrageldon)
{
NPC.damage = 85;
NPC.defense = 24;
@@ -124,7 +124,7 @@ namespace CalamityMod.NPCs.Astral
{
DropHelper.DropItemChance(NPC, ModContent.ItemType<Stardust>(), 0.5f, 1, 2);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Stardust>(), Main.expertMode);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<StellarKnife>(), CalamityWorld.downedAstrageldon, 7, 1, 1);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<StellarKnife>(), DownedBossSystem.downedAstrageldon, 7, 1, 1);
}
}
}
+2 -2
View File
@@ -37,7 +37,7 @@ namespace CalamityMod.NPCs.Astral
NPC.DeathSound = SoundID.NPCDeath14;
Banner = NPC.type;
BannerItem = ModContent.ItemType<AstralProbeBanner>();
if (CalamityWorld.downedAstrageldon)
if (DownedBossSystem.downedAstrageldon)
{
NPC.damage = 30;
NPC.defense = 20;
@@ -142,7 +142,7 @@ namespace CalamityMod.NPCs.Astral
if (Collision.CanHit(NPC.position, NPC.width, NPC.height, Main.player[NPC.target].position, Main.player[NPC.target].width, Main.player[NPC.target].height))
{
int num8 = Main.expertMode ? 14 : 18;
if (CalamityWorld.downedAstrageldon)
if (DownedBossSystem.downedAstrageldon)
num8 += 6;
int num9 = ProjectileID.PinkLaser;
+3 -3
View File
@@ -36,7 +36,7 @@ namespace CalamityMod.NPCs.Astral
animationType = NPCID.BlueSlime;
Banner = NPC.type;
BannerItem = ModContent.ItemType<AstralSlimeBanner>();
if (CalamityWorld.downedAstrageldon)
if (DownedBossSystem.downedAstrageldon)
{
NPC.damage = 65;
NPC.defense = 18;
@@ -84,8 +84,8 @@ namespace CalamityMod.NPCs.Astral
DropHelper.DropItemChance(NPC, ModContent.ItemType<Stardust>(), Main.expertMode ? 1 : 2, 1, 3);
int oreMin = Main.expertMode ? 11 : 8;
int oreMax = Main.expertMode ? 16 : 12;
DropHelper.DropItemCondition(NPC, ModContent.ItemType<AstralOre>(), CalamityWorld.downedStarGod, oreMin, oreMax);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<AbandonedSlimeStaff>(), CalamityWorld.downedAstrageldon, 0.05f, 1, 1);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<AstralOre>(), DownedBossSystem.downedStarGod, oreMin, oreMax);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<AbandonedSlimeStaff>(), DownedBossSystem.downedAstrageldon, 0.05f, 1, 1);
}
}
}
+2 -2
View File
@@ -46,7 +46,7 @@ namespace CalamityMod.NPCs.Astral
animationType = NPCID.WallCreeper;
Banner = NPC.type;
BannerItem = ModContent.ItemType<AstralachneaBanner>();
if (CalamityWorld.downedAstrageldon)
if (DownedBossSystem.downedAstrageldon)
{
NPC.damage = 90;
NPC.defense = 30;
@@ -168,7 +168,7 @@ namespace CalamityMod.NPCs.Astral
{
DropHelper.DropItem(NPC, ModContent.ItemType<Stardust>(), 2, 3);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Stardust>(), Main.expertMode);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<AstralachneaStaff>(), CalamityWorld.downedAstrageldon, 7, 1, 1);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<AstralachneaStaff>(), DownedBossSystem.downedAstrageldon, 7, 1, 1);
}
}
}
+2 -2
View File
@@ -47,7 +47,7 @@ namespace CalamityMod.NPCs.Astral
animationType = NPCID.BlackRecluseWall;
Banner = ModContent.NPCType<AstralachneaGround>();
BannerItem = ModContent.ItemType<AstralachneaBanner>();
if (CalamityWorld.downedAstrageldon)
if (DownedBossSystem.downedAstrageldon)
{
NPC.damage = 90;
NPC.defense = 30;
@@ -141,7 +141,7 @@ namespace CalamityMod.NPCs.Astral
{
DropHelper.DropItem(NPC, ModContent.ItemType<Stardust>(), 2, 3);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Stardust>(), Main.expertMode);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<AstralachneaStaff>(), CalamityWorld.downedAstrageldon, 7, 1, 1);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<AstralachneaStaff>(), DownedBossSystem.downedAstrageldon, 7, 1, 1);
}
}
}
+3 -3
View File
@@ -116,7 +116,7 @@ namespace CalamityMod.NPCs.Astral
NPC.DeathSound = Mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AtlasDeath");
Banner = NPC.type;
BannerItem = ModContent.ItemType<AtlasBanner>();
if (CalamityWorld.downedAstrageldon)
if (DownedBossSystem.downedAstrageldon)
{
NPC.damage = 100;
NPC.defense = 50;
@@ -617,7 +617,7 @@ namespace CalamityMod.NPCs.Astral
{
return 0f;
}
else if (spawnInfo.Player.InAstral(1) && NPC.downedAncientCultist && !CalamityWorld.downedStarGod)
else if (spawnInfo.Player.InAstral(1) && NPC.downedAncientCultist && !DownedBossSystem.downedStarGod)
{
return 0.27f;
}
@@ -639,7 +639,7 @@ namespace CalamityMod.NPCs.Astral
int maxStardust = Main.expertMode ? 9 : 8;
DropHelper.DropItem(NPC, ModContent.ItemType<Stardust>(), minStardust, maxStardust);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<TitanArm>(), CalamityWorld.downedAstrageldon, 7, 1, 1);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<TitanArm>(), DownedBossSystem.downedAstrageldon, 7, 1, 1);
DropHelper.DropItem(NPC, ModContent.ItemType<TitanHeart>());
}
}
+2 -2
View File
@@ -40,7 +40,7 @@ namespace CalamityMod.NPCs.Astral
NPC.aiStyle = -1;
Banner = NPC.type;
BannerItem = ModContent.ItemType<BigSightseerBanner>();
if (CalamityWorld.downedAstrageldon)
if (DownedBossSystem.downedAstrageldon)
{
NPC.damage = 85;
NPC.defense = 30;
@@ -194,7 +194,7 @@ namespace CalamityMod.NPCs.Astral
NPC.noTileCollide = true;
NPC.alpha = 80;
NPC.aiStyle = -1;
if (CalamityWorld.downedAstrageldon)
if (DownedBossSystem.downedAstrageldon)
{
NPC.damage = 75;
}
+1 -1
View File
@@ -42,7 +42,7 @@ namespace CalamityMod.NPCs.Astral
animationType = NPCID.SandShark;
Banner = NPC.type;
BannerItem = ModContent.ItemType<FusionFeederBanner>();
if (CalamityWorld.downedAstrageldon)
if (DownedBossSystem.downedAstrageldon)
{
NPC.damage = 65;
NPC.defense = 22;
+2 -2
View File
@@ -40,7 +40,7 @@ namespace CalamityMod.NPCs.Astral
NPC.value = Item.buyPrice(0, 0, 15, 0);
Banner = NPC.type;
BannerItem = ModContent.ItemType<HadarianBanner>();
if (CalamityWorld.downedAstrageldon)
if (DownedBossSystem.downedAstrageldon)
{
NPC.damage = 80;
NPC.defense = 18;
@@ -205,7 +205,7 @@ namespace CalamityMod.NPCs.Astral
{
DropHelper.DropItem(NPC, ModContent.ItemType<Stardust>(), 2, 3);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Stardust>(), Main.expertMode);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<HadarianMembrane>(), CalamityWorld.downedAstrageldon, 2, 2, 3);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<HadarianMembrane>(), DownedBossSystem.downedAstrageldon, 2, 2, 3);
}
}
}
+2 -2
View File
@@ -39,7 +39,7 @@ namespace CalamityMod.NPCs.Astral
NPC.value = Item.buyPrice(0, 0, 15, 0);
Banner = NPC.type;
BannerItem = ModContent.ItemType<HiveBanner>();
if (CalamityWorld.downedAstrageldon)
if (DownedBossSystem.downedAstrageldon)
{
NPC.damage = 90;
NPC.defense = 25;
@@ -143,7 +143,7 @@ namespace CalamityMod.NPCs.Astral
{
DropHelper.DropItem(NPC, ModContent.ItemType<Stardust>(), 2, 3);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Stardust>(), Main.expertMode);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<HivePod>(), CalamityWorld.downedAstrageldon, 7, 1, 1);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<HivePod>(), DownedBossSystem.downedAstrageldon, 7, 1, 1);
}
}
}
+1 -1
View File
@@ -34,7 +34,7 @@ namespace CalamityMod.NPCs.Astral
NPC.knockBackResist = 0.5f;
NPC.noGravity = true;
NPC.value = Item.buyPrice(0, 0, 5, 0);
if (CalamityWorld.downedAstrageldon)
if (DownedBossSystem.downedAstrageldon)
{
NPC.damage = 50;
NPC.defense = 8;
+3 -3
View File
@@ -42,7 +42,7 @@ namespace CalamityMod.NPCs.Astral
NPC.DeathSound = Mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath");
Banner = NPC.type;
BannerItem = ModContent.ItemType<MantisBanner>();
if (CalamityWorld.downedAstrageldon)
if (DownedBossSystem.downedAstrageldon)
{
NPC.damage = 85;
NPC.defense = 16;
@@ -118,7 +118,7 @@ namespace CalamityMod.NPCs.Astral
SoundEngine.PlaySound(SoundID.Item71, NPC.position);
Vector2 vector = Main.player[NPC.target].Center - NPC.Center;
vector.Normalize();
int damage = CalamityWorld.downedAstrageldon ? 55 : 45;
int damage = DownedBossSystem.downedAstrageldon ? 55 : 45;
Projectile.NewProjectile(NPC.Center + (NPC.Center.X < target.Center.X ? -14f : 14f) * Vector2.UnitX, vector * 7f, ModContent.ProjectileType<MantisRing>(), damage, 0f);
}
}
@@ -240,7 +240,7 @@ namespace CalamityMod.NPCs.Astral
{
DropHelper.DropItem(NPC, ModContent.ItemType<Stardust>(), 2, 3);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Stardust>(), Main.expertMode);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<AstralScythe>(), CalamityWorld.downedAstrageldon, 7, 1, 1);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<AstralScythe>(), DownedBossSystem.downedAstrageldon, 7, 1, 1);
}
}
}
+2 -2
View File
@@ -50,7 +50,7 @@ namespace CalamityMod.NPCs.Astral
NPC.aiStyle = -1;
Banner = NPC.type;
BannerItem = ModContent.ItemType<NovaBanner>();
if (CalamityWorld.downedAstrageldon)
if (DownedBossSystem.downedAstrageldon)
{
NPC.damage = 75;
NPC.defense = 25;
@@ -285,7 +285,7 @@ namespace CalamityMod.NPCs.Astral
{
DropHelper.DropItem(NPC, ModContent.ItemType<Stardust>(), 2, 3);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Stardust>(), Main.expertMode);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<StellarCannon>(), CalamityWorld.downedAstrageldon, 7, 1, 1);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<StellarCannon>(), DownedBossSystem.downedAstrageldon, 7, 1, 1);
DropHelper.DropItemChance(NPC, ModContent.ItemType<GloriousEnd>(), 7, 1, 1);
}
}
+1 -1
View File
@@ -40,7 +40,7 @@ namespace CalamityMod.NPCs.Astral
NPC.aiStyle = -1;
Banner = NPC.type;
BannerItem = ModContent.ItemType<SmallSightseerBanner>();
if (CalamityWorld.downedAstrageldon)
if (DownedBossSystem.downedAstrageldon)
{
NPC.damage = 58;
NPC.defense = 26;
+2 -2
View File
@@ -42,7 +42,7 @@ namespace CalamityMod.NPCs.Astral
animationType = NPCID.GiantFlyingFox;
Banner = NPC.type;
BannerItem = ModContent.ItemType<StellarCulexBanner>();
if (CalamityWorld.downedAstrageldon)
if (DownedBossSystem.downedAstrageldon)
{
NPC.damage = 90;
NPC.defense = 28;
@@ -123,7 +123,7 @@ namespace CalamityMod.NPCs.Astral
{
DropHelper.DropItemChance(NPC, ModContent.ItemType<Stardust>(), 0.5f, 1, 2);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Stardust>(), Main.expertMode);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<StarbusterCore>(), CalamityWorld.downedAstrageldon, 7, 1, 1);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<StarbusterCore>(), DownedBossSystem.downedAstrageldon, 7, 1, 1);
}
}
}
+4 -4
View File
@@ -317,9 +317,9 @@ namespace CalamityMod.NPCs.AstrumAureus
DropHelper.DropBags(NPC);
DropHelper.DropItemChance(NPC, ModContent.ItemType<AstrageldonTrophy>(), 10);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<KnowledgeAstrumAureus>(), true, !CalamityWorld.downedAstrageldon);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<KnowledgeAstrumAureus>(), true, !DownedBossSystem.downedAstrageldon);
CalamityGlobalNPC.SetNewShopVariable(new int[] { NPCID.Wizard, ModContent.NPCType<FAP>() }, CalamityWorld.downedAstrageldon);
CalamityGlobalNPC.SetNewShopVariable(new int[] { NPCID.Wizard, ModContent.NPCType<FAP>() }, DownedBossSystem.downedAstrageldon);
// All other drops are contained in the bag, so they only drop directly on Normal
if (!Main.expertMode)
@@ -358,7 +358,7 @@ namespace CalamityMod.NPCs.AstrumAureus
ThreadPool.QueueUserWorkItem(_ => AstralBiome.PlaceAstralMeteor());
// If Astrum Aureus has not yet been killed, notify players of new Astral enemy drops
if (!CalamityWorld.downedAstrageldon)
if (!DownedBossSystem.downedAstrageldon)
{
string key = "Mods.CalamityMod.AureusBossText";
string key2 = "Mods.CalamityMod.AureusBossText2";
@@ -369,7 +369,7 @@ namespace CalamityMod.NPCs.AstrumAureus
}
// Mark Astrum Aureus as dead
CalamityWorld.downedAstrageldon = true;
DownedBossSystem.downedAstrageldon = true;
CalamityNetcode.SyncWorld();
}
+4 -4
View File
@@ -251,8 +251,8 @@ namespace CalamityMod.NPCs.AstrumDeus
DropHelper.DropItem(NPC, ItemID.GreaterHealingPotion, 8, 14);
DropHelper.DropItemChance(NPC, ModContent.ItemType<AstrumDeusTrophy>(), 10);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<KnowledgeAstrumDeus>(), !CalamityWorld.downedStarGod);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<KnowledgeAstralInfection>(), !CalamityWorld.downedStarGod);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<KnowledgeAstrumDeus>(), !DownedBossSystem.downedStarGod);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<KnowledgeAstralInfection>(), !DownedBossSystem.downedStarGod);
// Drop a large spray of all 4 lunar fragments
int minFragments = Main.expertMode ? 20 : 16;
@@ -287,7 +287,7 @@ namespace CalamityMod.NPCs.AstrumDeus
}
// Notify players that Astral Ore can be mined if Deus has never been killed yet
if (!CalamityWorld.downedStarGod)
if (!DownedBossSystem.downedStarGod)
{
string key = "Mods.CalamityMod.AstralBossText";
Color messageColor = Color.Gold;
@@ -295,7 +295,7 @@ namespace CalamityMod.NPCs.AstrumDeus
}
// Mark Astrum Deus as dead
CalamityWorld.downedStarGod = true;
DownedBossSystem.downedStarGod = true;
CalamityNetcode.SyncWorld();
}
+2 -2
View File
@@ -40,7 +40,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental
NPC.canGhostHeal = false;
NPC.HitSound = SoundID.NPCHit23;
NPC.DeathSound = SoundID.NPCDeath39;
if (CalamityWorld.downedProvidence)
if (DownedBossSystem.downedProvidence)
{
NPC.lifeMax = 26000;
}
@@ -76,7 +76,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental
}
bool goIntoShell = NPC.life <= NPC.lifeMax * 0.25;
bool provy = CalamityWorld.downedProvidence && !BossRushEvent.BossRushActive;
bool provy = DownedBossSystem.downedProvidence && !BossRushEvent.BossRushActive;
if (goIntoShell || Main.npc[CalamityGlobalNPC.brimstoneElemental].ai[0] == 4f)
{
boostDR = true;
@@ -40,7 +40,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental
NPC.value = Item.buyPrice(0, 40, 0, 0);
NPC.LifeMaxNERB(41000, 49200, 780000);
NPC.DR_NERD(0.15f);
if (CalamityWorld.downedProvidence && !BossRushEvent.BossRushActive)
if (DownedBossSystem.downedProvidence && !BossRushEvent.BossRushActive)
{
NPC.damage *= 3;
NPC.defense *= 4;
@@ -156,16 +156,16 @@ namespace CalamityMod.NPCs.BrimstoneElemental
DropHelper.DropBags(NPC);
DropHelper.DropItemChance(NPC, ModContent.ItemType<BrimstoneElementalTrophy>(), 10);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<KnowledgeBrimstoneCrag>(), true, !CalamityWorld.downedBrimstoneElemental);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<KnowledgeBrimstoneElemental>(), true, !CalamityWorld.downedBrimstoneElemental);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<KnowledgeBrimstoneCrag>(), true, !DownedBossSystem.downedBrimstoneElemental);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<KnowledgeBrimstoneElemental>(), true, !DownedBossSystem.downedBrimstoneElemental);
CalamityGlobalNPC.SetNewShopVariable(new int[] { NPCID.Wizard }, CalamityWorld.downedBrimstoneElemental);
CalamityGlobalNPC.SetNewShopVariable(new int[] { NPCID.Wizard }, DownedBossSystem.downedBrimstoneElemental);
if (!Main.expertMode)
{
//Materials
DropHelper.DropItemSpray(NPC, ModContent.ItemType<EssenceofChaos>(), 4, 8);
if (CalamityWorld.downedProvidence)
if (DownedBossSystem.downedProvidence)
DropHelper.DropItemSpray(NPC, ModContent.ItemType<Bloodstone>(), 20, 30, 2);
// Weapons
@@ -180,7 +180,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental
// Equipment
DropHelper.DropItem(NPC, ModContent.ItemType<Gehenna>(), true);
DropHelper.DropItem(NPC, ModContent.ItemType<Abaddon>(), true);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Brimrose>(), CalamityWorld.downedProvidence);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Brimrose>(), DownedBossSystem.downedProvidence);
// Vanity
DropHelper.DropItemChance(NPC, ModContent.ItemType<BrimstoneWaifuMask>(), 7);
@@ -190,7 +190,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Hellborn>(), !Main.expertMode, 0.1f);
// mark brimmy as dead
CalamityWorld.downedBrimstoneElemental = true;
DownedBossSystem.downedBrimstoneElemental = true;
CalamityNetcode.SyncWorld();
}
+2 -2
View File
@@ -397,7 +397,7 @@ namespace CalamityMod.NPCs.Bumblebirb
DropHelper.DropBags(NPC);
DropHelper.DropItemChance(NPC, ModContent.ItemType<BumblebirbTrophy>(), 10);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<KnowledgeBumblebirb>(), true, !CalamityWorld.downedBumble);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<KnowledgeBumblebirb>(), true, !DownedBossSystem.downedBumble);
// All other drops are contained in the bag, so they only drop directly on Normal
if (!Main.expertMode)
@@ -424,7 +424,7 @@ namespace CalamityMod.NPCs.Bumblebirb
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Swordsplosion>(), !Main.expertMode, 0.1f);
// Mark The Dragonfolly as dead
CalamityWorld.downedBumble = true;
DownedBossSystem.downedBumble = true;
CalamityNetcode.SyncWorld();
}
+1 -1
View File
@@ -37,7 +37,7 @@ namespace CalamityMod.NPCs.Calamitas
NPC.defense = (CalamityWorld.death || BossRushEvent.BossRushActive) ? 15 : 10;
NPC.DR_NERD((CalamityWorld.death || BossRushEvent.BossRushActive) ? 0.225f : 0.15f);
NPC.LifeMaxNERB(11000, 13200, 80000);
if (CalamityWorld.downedProvidence && !BossRushEvent.BossRushActive)
if (DownedBossSystem.downedProvidence && !BossRushEvent.BossRushActive)
{
NPC.damage *= 3;
NPC.defense *= 5;
+1 -1
View File
@@ -37,7 +37,7 @@ namespace CalamityMod.NPCs.Calamitas
NPC.defense = (CalamityWorld.death || BossRushEvent.BossRushActive) ? 15 : 10;
NPC.DR_NERD((CalamityWorld.death || BossRushEvent.BossRushActive) ? 0.225f : 0.15f);
NPC.LifeMaxNERB(9200, 11025, 80000);
if (CalamityWorld.downedProvidence && !BossRushEvent.BossRushActive)
if (DownedBossSystem.downedProvidence && !BossRushEvent.BossRushActive)
{
NPC.damage *= 3;
NPC.defense *= 5;
+6 -6
View File
@@ -48,7 +48,7 @@ namespace CalamityMod.NPCs.Calamitas
NPC.value = Item.buyPrice(0, 50, 0, 0);
NPC.DR_NERD((CalamityWorld.death || BossRushEvent.BossRushActive) ? 0.075f : 0.15f);
NPC.LifeMaxNERB(37500, 45000, 520000);
if (CalamityWorld.downedProvidence && !BossRushEvent.BossRushActive)
if (DownedBossSystem.downedProvidence && !BossRushEvent.BossRushActive)
{
NPC.damage *= 3;
NPC.defense *= 3;
@@ -169,9 +169,9 @@ namespace CalamityMod.NPCs.Calamitas
DropHelper.DropItem(NPC, ItemID.BrokenHeroSword, true);
DropHelper.DropItemChance(NPC, ModContent.ItemType<CalamitasTrophy>(), 10);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<KnowledgeCalamitasClone>(), !CalamityWorld.downedCalamitas);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<KnowledgeCalamitasClone>(), !DownedBossSystem.downedCalamitas);
CalamityGlobalNPC.SetNewShopVariable(new int[] { ModContent.NPCType<THIEF>() }, CalamityWorld.downedCalamitas);
CalamityGlobalNPC.SetNewShopVariable(new int[] { ModContent.NPCType<THIEF>() }, DownedBossSystem.downedCalamitas);
if (!Main.expertMode)
{
@@ -179,7 +179,7 @@ namespace CalamityMod.NPCs.Calamitas
DropHelper.DropItemSpray(NPC, ModContent.ItemType<EssenceofChaos>(), 4, 8);
DropHelper.DropItem(NPC, ModContent.ItemType<CalamityDust>(), 9, 14);
DropHelper.DropItem(NPC, ModContent.ItemType<BlightedLens>(), 1, 2);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Bloodstone>(), CalamityWorld.downedProvidence, 1f, 30, 40);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Bloodstone>(), DownedBossSystem.downedProvidence, 1f, 30, 40);
// Weapons
float w = DropHelper.NormalWeaponDropRateFloat;
@@ -209,7 +209,7 @@ namespace CalamityMod.NPCs.Calamitas
string key = "Mods.CalamityMod.PlantBossText";
Color messageColor = Color.RoyalBlue;
if (!CalamityWorld.downedCalamitas)
if (!DownedBossSystem.downedCalamitas)
{
if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active)
SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/WyrmScream"), (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y);
@@ -218,7 +218,7 @@ namespace CalamityMod.NPCs.Calamitas
}
// Mark Calamitas as dead
CalamityWorld.downedCalamitas = true;
DownedBossSystem.downedCalamitas = true;
CalamityNetcode.SyncWorld();
}
+6 -6
View File
@@ -695,7 +695,7 @@ namespace CalamityMod.NPCs
float lifeRatio = npc.life / (float)npc.lifeMax;
// Variables for buffing the AI
bool provy = CalamityWorld.downedProvidence && !BossRushEvent.BossRushActive;
bool provy = DownedBossSystem.downedProvidence && !BossRushEvent.BossRushActive;
bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive;
bool expertMode = Main.expertMode || BossRushEvent.BossRushActive;
bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive;
@@ -1235,7 +1235,7 @@ namespace CalamityMod.NPCs
bool death = CalamityWorld.death || BossRushEvent.BossRushActive;
bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive;
bool expertMode = Main.expertMode || BossRushEvent.BossRushActive;
bool provy = CalamityWorld.downedProvidence && !BossRushEvent.BossRushActive;
bool provy = DownedBossSystem.downedProvidence && !BossRushEvent.BossRushActive;
// Percent life remaining
float lifeRatio = npc.life / (float)npc.lifeMax;
@@ -1894,7 +1894,7 @@ namespace CalamityMod.NPCs
bool death = CalamityWorld.death || BossRushEvent.BossRushActive;
bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive;
bool expertMode = Main.expertMode || BossRushEvent.BossRushActive;
bool provy = CalamityWorld.downedProvidence && !BossRushEvent.BossRushActive;
bool provy = DownedBossSystem.downedProvidence && !BossRushEvent.BossRushActive;
// Get a target
if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active)
@@ -2175,7 +2175,7 @@ namespace CalamityMod.NPCs
bool death = CalamityWorld.death || BossRushEvent.BossRushActive;
bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive;
bool expertMode = Main.expertMode || BossRushEvent.BossRushActive;
bool provy = CalamityWorld.downedProvidence && !BossRushEvent.BossRushActive;
bool provy = DownedBossSystem.downedProvidence && !BossRushEvent.BossRushActive;
// Get a target
if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active)
@@ -4234,7 +4234,7 @@ namespace CalamityMod.NPCs
}
// Destroy all Dark Energies if their total HP is below 20%
int darkEnergyMaxHP = BossRushEvent.BossRushActive ? 44000 : (CalamityWorld.DoGSecondStageCountdown <= 0 || !CalamityWorld.downedSentinel1) ? 12000 : 3000;
int darkEnergyMaxHP = BossRushEvent.BossRushActive ? 44000 : (CalamityWorld.DoGSecondStageCountdown <= 0 || !DownedBossSystem.downedSentinel1) ? 12000 : 3000;
int totalDarkEnergiesSpawned = darkEnergyAmt * 3 + 2;
int totalDarkEnergyMaxHP = darkEnergyMaxHP * totalDarkEnergiesSpawned;
int succPhaseGateValue = (int)(totalDarkEnergyMaxHP * 0.2);
@@ -6671,7 +6671,7 @@ namespace CalamityMod.NPCs
float lifeRatio = npc.life / (float)npc.lifeMax;
// Variables for buffing the AI
bool provy = CalamityWorld.downedProvidence && !BossRushEvent.BossRushActive;
bool provy = DownedBossSystem.downedProvidence && !BossRushEvent.BossRushActive;
bool expertMode = Main.expertMode || BossRushEvent.BossRushActive;
bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive;
bool death = CalamityWorld.death || BossRushEvent.BossRushActive;
+42 -42
View File
@@ -2000,7 +2000,7 @@ namespace CalamityMod.NPCs
// Reduce prehardmode desert enemy stats pre-Desert Scourge
case NPCID.WalkingAntlion:
if (!CalamityWorld.downedDesertScourge)
if (!DownedBossSystem.downedDesertScourge)
{
npc.lifeMax = (int)(npc.lifeMax * DesertEnemyStatMultiplier);
npc.damage = (int)(npc.damage * DesertEnemyStatMultiplier);
@@ -2015,7 +2015,7 @@ namespace CalamityMod.NPCs
case NPCID.Antlion:
case NPCID.FlyingAntlion:
if (!CalamityWorld.downedDesertScourge)
if (!DownedBossSystem.downedDesertScourge)
{
npc.lifeMax = (int)(npc.lifeMax * DesertEnemyStatMultiplier);
npc.damage = (int)(npc.damage * DesertEnemyStatMultiplier);
@@ -2034,8 +2034,8 @@ namespace CalamityMod.NPCs
// Reduce Tomb Crawler stats
case NPCID.TombCrawlerHead:
npc.lifeMax = (int)(npc.lifeMax * (CalamityWorld.downedDesertScourge ? 0.6 : 0.45));
if (!CalamityWorld.downedDesertScourge)
npc.lifeMax = (int)(npc.lifeMax * (DownedBossSystem.downedDesertScourge ? 0.6 : 0.45));
if (!DownedBossSystem.downedDesertScourge)
{
npc.damage = (int)(npc.damage * DesertEnemyStatMultiplier);
npc.defDamage = npc.damage;
@@ -2049,8 +2049,8 @@ namespace CalamityMod.NPCs
case NPCID.TombCrawlerBody:
case NPCID.TombCrawlerTail:
npc.lifeMax = (int)(npc.lifeMax * (CalamityWorld.downedDesertScourge ? 0.6 : 0.45));
if (!CalamityWorld.downedDesertScourge)
npc.lifeMax = (int)(npc.lifeMax * (DownedBossSystem.downedDesertScourge ? 0.6 : 0.45));
if (!DownedBossSystem.downedDesertScourge)
{
npc.damage = (int)(npc.damage * DesertEnemyStatMultiplier);
npc.defDamage = npc.damage;
@@ -2114,7 +2114,7 @@ namespace CalamityMod.NPCs
npc.defDamage = npc.damage;
}
if (CalamityWorld.downedDoG)
if (DownedBossSystem.downedDoG)
{
if (CalamityLists.pumpkinMoonBuffList.Contains(npc.type))
{
@@ -2721,7 +2721,7 @@ namespace CalamityMod.NPCs
return DukeFishronAI.BuffedDukeFishronAI(npc, Mod);
case NPCID.Pumpking:
if (CalamityWorld.downedDoG)
if (DownedBossSystem.downedDoG)
{
return CalamityGlobalAI.BuffedPumpkingAI(npc);
}
@@ -2729,7 +2729,7 @@ namespace CalamityMod.NPCs
break;
case NPCID.PumpkingBlade:
if (CalamityWorld.downedDoG)
if (DownedBossSystem.downedDoG)
{
return CalamityGlobalAI.BuffedPumpkingBladeAI(npc);
}
@@ -2737,7 +2737,7 @@ namespace CalamityMod.NPCs
break;
case NPCID.IceQueen:
if (CalamityWorld.downedDoG)
if (DownedBossSystem.downedDoG)
{
return CalamityGlobalAI.BuffedIceQueenAI(npc);
}
@@ -2745,7 +2745,7 @@ namespace CalamityMod.NPCs
break;
case NPCID.Mothron:
if (CalamityWorld.downedDoG)
if (DownedBossSystem.downedDoG)
{
return CalamityGlobalAI.BuffedMothronAI(npc);
}
@@ -4240,7 +4240,7 @@ namespace CalamityMod.NPCs
}
// Boosts
if (CalamityWorld.downedDoG && (Main.pumpkinMoon || Main.snowMoon || Main.eclipse))
if (DownedBossSystem.downedDoG && (Main.pumpkinMoon || Main.snowMoon || Main.eclipse))
{
spawnRate = (int)(spawnRate * 0.75);
maxSpawns = (int)(maxSpawns * 3f);
@@ -4426,11 +4426,11 @@ namespace CalamityMod.NPCs
{
pool.Clear();
if (!(CalamityWorld.downedPolterghast && CalamityWorld.acidRainPoints == 1))
if (!(DownedBossSystem.downedPolterghast && CalamityWorld.acidRainPoints == 1))
{
Dictionary<int, AcidRainSpawnData> PossibleEnemies = AcidRainEvent.PossibleEnemiesPreHM;
Dictionary<int, AcidRainSpawnData> PossibleMinibosses = new Dictionary<int, AcidRainSpawnData>();
if (CalamityWorld.downedAquaticScourge)
if (DownedBossSystem.downedAquaticScourge)
{
PossibleEnemies = AcidRainEvent.PossibleEnemiesAS;
PossibleMinibosses = AcidRainEvent.PossibleMinibossesAS;
@@ -4439,7 +4439,7 @@ namespace CalamityMod.NPCs
PossibleEnemies.Add(NPCType<IrradiatedSlime>(), new AcidRainSpawnData(1, 0f, AcidRainSpawnRequirement.Anywhere));
}
}
if (CalamityWorld.downedPolterghast)
if (DownedBossSystem.downedPolterghast)
{
PossibleEnemies = AcidRainEvent.PossibleEnemiesPolter;
PossibleMinibosses = AcidRainEvent.PossibleMinibossesPolter;
@@ -5362,111 +5362,111 @@ namespace CalamityMod.NPCs
if (type == NPCType<DesertScourgeHead>() || type == NPCType<DesertScourgeBody>() || type == NPCType<DesertScourgeTail>())
{
return CalamityWorld.downedDesertScourge;
return DownedBossSystem.downedDesertScourge;
}
else if (type == NPCType<CrabulonIdle>())
{
return CalamityWorld.downedCrabulon;
return DownedBossSystem.downedCrabulon;
}
else if (type == NPCType<HiveMind.HiveMind>())
{
return CalamityWorld.downedHiveMind;
return DownedBossSystem.downedHiveMind;
}
else if (type == NPCType<PerforatorHive>())
{
return CalamityWorld.downedPerforator;
return DownedBossSystem.downedPerforator;
}
else if (type == NPCType<SlimeGodCore>() || type == NPCType<SlimeGod.SlimeGod>() || type == NPCType<SlimeGodRun>() || type == NPCType<SlimeGodSplit>() || type == NPCType<SlimeGodRunSplit>())
{
return CalamityWorld.downedSlimeGod;
return DownedBossSystem.downedSlimeGod;
}
else if (type == NPCType<Cryogen.Cryogen>())
{
return CalamityWorld.downedCryogen;
return DownedBossSystem.downedCryogen;
}
else if (type == NPCType<AquaticScourgeHead>() || type == NPCType<AquaticScourgeBody>() || type == NPCType<AquaticScourgeBodyAlt>() || type == NPCType<AquaticScourgeTail>())
{
return CalamityWorld.downedAquaticScourge;
return DownedBossSystem.downedAquaticScourge;
}
else if (type == NPCType<BrimstoneElemental.BrimstoneElemental>())
{
return CalamityWorld.downedBrimstoneElemental;
return DownedBossSystem.downedBrimstoneElemental;
}
else if (type == NPCType<CalamitasRun3>())
{
return CalamityWorld.downedCalamitas;
return DownedBossSystem.downedCalamitas;
}
else if (type == NPCType<Leviathan.Leviathan>() || type == NPCType<Siren>())
{
return CalamityWorld.downedLeviathan;
return DownedBossSystem.downedLeviathan;
}
else if (type == NPCType<AstrumAureus.AstrumAureus>())
{
return CalamityWorld.downedAstrageldon;
return DownedBossSystem.downedAstrageldon;
}
else if (type == NPCType<AstrumDeusHeadSpectral>() || type == NPCType<AstrumDeusBodySpectral>() || type == NPCType<AstrumDeusTailSpectral>())
{
return CalamityWorld.downedStarGod;
return DownedBossSystem.downedStarGod;
}
else if (type == NPCType<PlaguebringerGoliath.PlaguebringerGoliath>())
{
return CalamityWorld.downedPlaguebringer;
return DownedBossSystem.downedPlaguebringer;
}
else if (type == NPCType<RavagerBody>())
{
return CalamityWorld.downedScavenger;
return DownedBossSystem.downedScavenger;
}
else if (type == NPCType<ProfanedGuardianBoss>())
{
return CalamityWorld.downedGuardians;
return DownedBossSystem.downedGuardians;
}
else if (type == NPCType<Bumblefuck>())
{
return CalamityWorld.downedBumble;
return DownedBossSystem.downedBumble;
}
else if (type == NPCType<Providence.Providence>())
{
return CalamityWorld.downedProvidence;
return DownedBossSystem.downedProvidence;
}
else if (type == NPCType<CeaselessVoid.CeaselessVoid>() || type == NPCType<DarkEnergy>())
{
return CalamityWorld.downedSentinel1;
return DownedBossSystem.downedSentinel1;
}
else if (type == NPCType<StormWeaverHead>() || type == NPCType<StormWeaverBody>() || type == NPCType<StormWeaverTail>())
{
return CalamityWorld.downedSentinel2;
return DownedBossSystem.downedSentinel2;
}
else if (type == NPCType<Signus.Signus>())
{
return CalamityWorld.downedSentinel3;
return DownedBossSystem.downedSentinel3;
}
else if (type == NPCType<Polterghast.Polterghast>())
{
return CalamityWorld.downedPolterghast;
return DownedBossSystem.downedPolterghast;
}
else if (type == NPCType<OldDuke.OldDuke>())
{
return CalamityWorld.downedBoomerDuke;
return DownedBossSystem.downedBoomerDuke;
}
else if (type == NPCType<DevourerofGodsHead>() || type == NPCType<DevourerofGodsBody>() || type == NPCType<DevourerofGodsTail>())
{
return CalamityWorld.downedDoG;
return DownedBossSystem.downedDoG;
}
else if (type == NPCType<Yharon.Yharon>())
{
return CalamityWorld.downedYharon;
return DownedBossSystem.downedYharon;
}
else if (type == NPCType<Artemis>() || type == NPCType<Apollo>() || type == NPCType<AresBody>() || type == NPCType<AresGaussNuke>() || type == NPCType<AresLaserCannon>() || type == NPCType<AresPlasmaFlamethrower>() || type == NPCType<AresTeslaCannon>() || type == NPCType<ThanatosHead>() || type == NPCType<ThanatosBody1>() || type == NPCType<ThanatosBody2>() || type == NPCType<ThanatosTail>())
{
return CalamityWorld.downedExoMechs;
return DownedBossSystem.downedExoMechs;
}
else if (type == NPCType<SupremeCalamitas.SupremeCalamitas>())
{
return CalamityWorld.downedSCal;
return DownedBossSystem.downedSCal;
}
else if (type == NPCType<EidolonWyrmHeadHuge>())
{
return CalamityWorld.downedAdultEidolonWyrm;
return DownedBossSystem.downedAdultEidolonWyrm;
}
return true;
+6 -6
View File
@@ -392,7 +392,7 @@ namespace CalamityMod.NPCs
CalamityUtils.DisplayLocalizedText(key, messageColor);
}
}
else if (npc.type == NPCID.DD2Betsy && !CalamityWorld.downedBetsy)
else if (npc.type == NPCID.DD2Betsy && !DownedBossSystem.downedBetsy)
{
// Drop weapons Calamity style instead of mutually exclusive.
if (!Main.expertMode)
@@ -409,7 +409,7 @@ namespace CalamityMod.NPCs
}
// Mark Betsy as dead (Vanilla does not keep track of her)
CalamityWorld.downedBetsy = true;
DownedBossSystem.downedBetsy = true;
CalamityNetcode.SyncWorld();
}
else if (npc.type == NPCID.DukeFishron)
@@ -765,7 +765,7 @@ namespace CalamityMod.NPCs
private void CheckBossSpawn(NPC npc)
{
if ((npc.type == ModContent.NPCType<PhantomSpirit>() || npc.type == ModContent.NPCType<PhantomSpiritS>() || npc.type == ModContent.NPCType<PhantomSpiritM>() ||
npc.type == ModContent.NPCType<PhantomSpiritL>()) && !NPC.AnyNPCs(ModContent.NPCType<Polterghast.Polterghast>()) && !CalamityWorld.downedPolterghast)
npc.type == ModContent.NPCType<PhantomSpiritL>()) && !NPC.AnyNPCs(ModContent.NPCType<Polterghast.Polterghast>()) && !DownedBossSystem.downedPolterghast)
{
CalamityMod.ghostKillCount++;
if (CalamityMod.ghostKillCount == 10)
@@ -1045,7 +1045,7 @@ namespace CalamityMod.NPCs
break;
case NPCID.GiantCursedSkull:
DropHelper.DropItemCondition(npc, ModContent.ItemType<Keelhaul>(), CalamityWorld.downedLeviathan, Main.expertMode ? 15 : 25, 1, 1);
DropHelper.DropItemCondition(npc, ModContent.ItemType<Keelhaul>(), DownedBossSystem.downedLeviathan, Main.expertMode ? 15 : 25, 1, 1);
break;
case NPCID.Necromancer:
@@ -1172,7 +1172,7 @@ namespace CalamityMod.NPCs
case NPCID.Reaper:
case NPCID.Psycho:
DropHelper.DropItemCondition(npc, ModContent.ItemType<SolarVeil>(), CalamityWorld.downedCalamitas || NPC.downedPlantBoss, Main.expertMode ? 0.75f : 0.5f, 1, 4);
DropHelper.DropItemCondition(npc, ModContent.ItemType<SolarVeil>(), DownedBossSystem.downedCalamitas || NPC.downedPlantBoss, Main.expertMode ? 0.75f : 0.5f, 1, 4);
break;
case NPCID.MartianOfficer:
@@ -1241,7 +1241,7 @@ namespace CalamityMod.NPCs
private void EventLoot(NPC npc, bool pumpkin, bool frost, bool eclipse)
{
// Nightmare Fuel, Endothermic Energy and Darksun Fragments
if (!CalamityWorld.downedDoG)
if (!DownedBossSystem.downedDoG)
{
return;
}
Loaded 100 of 192 files, more files were not shown because too many files have changed in this diff. Show more