Merge branch '1.4.4' of https://github.com/CalamityTeam/CalamityMod into Point-Blank-Death

This commit is contained in:
Altixal committed 2025-08-08 12:13:09 +07:00
commit abe324f5d2
2353 files changed
+25896 -28160

No files matched your search

+142 -2
View File
@@ -56,6 +56,55 @@ namespace CalamityMod.Backgrounds
}
}
}
if (!Main.dedServ && (Main.LocalPlayer.InModBiome(ModContent.GetInstance<BiomeManagers.TimelessShoresBiome>())))
{
int drawLimitX = Main.screenWidth / 16;
int drawLimitY = Main.screenHeight / 16;
Point drawPoint = (Main.screenPosition / 16).ToPoint();
for (int i = 0; i < drawLimitX; i++)
{
for (int j = 0; j < drawLimitY; j++)
{
Point pos = drawPoint + new Point(i, j);
if (!Main.tile[pos.X, pos.Y].HasTile &&
Main.tile[pos.X, pos.Y].WallType == 0 &&
Main.tile[pos.X, pos.Y].LiquidAmount == 0)
Lighting.AddLight(pos.X, pos.Y, TorchID.White, 0.2f);
}
}
}
if (!Main.dedServ && (Main.LocalPlayer.InModBiome(ModContent.GetInstance<BiomeManagers.PolypForestBiome>())))
{
int drawLimitX = Main.screenWidth / 16;
int drawLimitY = Main.screenHeight / 16;
Point drawPoint = (Main.screenPosition / 16).ToPoint();
for (int i = 0; i < drawLimitX; i++)
{
for (int j = 0; j < drawLimitY; j++)
{
Point pos = drawPoint + new Point(i, j);
if (!Main.tile[pos.X, pos.Y].HasTile &&
Main.tile[pos.X, pos.Y].WallType == 0)
Lighting.AddLight(pos.X, pos.Y, TorchID.White, 0.2f);
}
}
}
if (!Main.dedServ && (Main.LocalPlayer.InModBiome(ModContent.GetInstance<BiomeManagers.RadiantReefsBiome>())))
{
int drawLimitX = Main.screenWidth / 16;
int drawLimitY = Main.screenHeight / 16;
Point drawPoint = (Main.screenPosition / 16).ToPoint();
for (int i = 0; i < drawLimitX; i++)
{
for (int j = 0; j < drawLimitY; j++)
{
Point pos = drawPoint + new Point(i, j);
if (!Main.tile[pos.X, pos.Y].HasTile &&
Main.tile[pos.X, pos.Y].WallType == 0)
Lighting.AddLight(pos.X, pos.Y, TorchID.White, 0.2f);
}
}
}
}
private void DrawToTarget(On_Main.orig_CheckMonoliths orig)
@@ -73,6 +122,7 @@ namespace CalamityMod.Backgrounds
// Leaving this here for other programmers, in case I don't get to doing this myself.
Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, Main.Rasterizer, null, CalamityUtils.BackgroundMatrix);
DrawShoresBG();
DrawBurrowsBG();
Main.spriteBatch.End();
@@ -97,6 +147,7 @@ namespace CalamityMod.Backgrounds
// rendering code if that setting is on.
if (Main.WaveQuality > 0 || !CalamityClientConfig.Instance.SunkenSeaBackgroundDistortion)
{
DrawShoresBG();
DrawBurrowsBG();
}
else
@@ -123,14 +174,103 @@ namespace CalamityMod.Backgrounds
}
public static float Transparency;
public static float TransitionSpeed => 0.02f;
private static void DrawShoresBG()
{
if (Main.LocalPlayer.InModBiome(ModContent.GetInstance<BiomeManagers.TimelessShoresBiome>()))
{
Transparency += 1f;
if (Transparency > 1f)
Transparency = 1f;
}
else
{
// Make transparency immediately go down so it doesnt look weird, since vanilla underground backgrounds dont have the fade-in effect this background has.
Transparency -= 1f;
if (Transparency < 0f)
Transparency = 0f;
}
// Don't bother running any of the background drawing if the transparency is zero (meaning the background isnt actually active).
// Also do not run any of the background drawing if you have the vanilla background config option turned off.
if (Transparency > 0f && Main.BackgroundEnabled)
{
Vector2 vector = Main.screenPosition + new Vector2((Main.screenWidth >> 1), (Main.screenHeight >> 1));
float num = (Main.GameViewMatrix.Zoom.Y - 1f) * 0.5f * 200f;
float Scale = 1.5f;
float playerDrawPosition = ((Main.LocalPlayer.Center.Y / 16f) - 90) * 16f;
for (int Layers = 4; Layers >= 0; Layers--)
{
// Get each background texture.
Texture2D BGTexture = ModContent.Request<Texture2D>("CalamityMod/Backgrounds/SunkenSeaShoresBG" + Layers).Value;
Vector2 vector2 = new Vector2(BGTexture.Width, BGTexture.Height) * 0.5f;
float num2 = (Layers * 2 + 3f);
Vector2 vector3 = new Vector2(1f / num2);
Rectangle rectangle = new Rectangle(0, 0, BGTexture.Width, BGTexture.Height);
Vector2 zero = Vector2.Zero;
switch (Layers)
{
case 0:
{
zero.Y += 200f;
break;
}
case 1:
{
zero.Y += 0f;
break;
}
case 2:
{
zero.Y += 0f;
break;
}
case 3:
{
zero.Y += 0f;
break;
}
case 4:
{
zero.Y += 0f;
break;
}
}
vector2 *= Scale;
zero.Y -= num;
float LoopWidth = Scale * rectangle.Width;
float LoopHeight = Scale * rectangle.Height;
int LoopX = (int)((vector.X * vector3.X - vector2.X + zero.X - (Main.screenWidth >> 1)) / LoopWidth);
int LoopY = (int)((vector.Y * vector3.Y - vector2.Y + zero.Y - (Main.screenWidth >> 1)) / LoopWidth);
for (int i = LoopY - 2; i < LoopY + 4 + (int)(Main.screenWidth / LoopHeight); i++)
{
for (int j = LoopX - 2; j < LoopX + 4 + (int)(Main.screenWidth / LoopWidth); j++)
{
Vector2 drawPosition = (new Vector2(j * Scale * (rectangle.Width / vector3.X), playerDrawPosition) + vector2 - vector) * vector3 + vector - Main.screenPosition - vector2 + zero;
var frame = rectangle;
var color = Color.White * Transparency;
Main.spriteBatch.Draw(BGTexture, drawPosition, frame, color, 0f, Vector2.Zero, Scale, SpriteEffects.None, 0f);
}
}
}
}
}
private static void DrawBurrowsBG()
{
if (Main.LocalPlayer.InModBiome(ModContent.GetInstance<BiomeManagers.GleamingBurrowsBiome>()))
{
Transparency += TransitionSpeed;
Transparency += 1f;
if (Transparency > 1f)
Transparency = 1f;
Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

+112 -161
View File
@@ -27,7 +27,6 @@ namespace CalamityMod.Balancing
{
public sealed class BalancingChangesManager : ModSystem
{
internal static List<IBalancingRule[]> UniversalBalancingChanges = null;
internal static List<NPCBalancingChange> NPCSpecificBalancingChanges = null;
// Balancing changes in this method are sorted based on place in progression, NPC name (from A-Z), and strength of resistance in ascending order, in that level of priority.
@@ -37,6 +36,7 @@ namespace CalamityMod.Balancing
public override void SetStaticDefaults()
{
// Dirty shorthand for true melee resists, because they're super common and other class resists aren't.
// If you add/change a true melee resist here, be sure to add/change the resist in CalamityGlobalNPC ModifyHitByItem as well.
IBalancingRule ResistTrueMelee(float f) => new ClassResistBalancingRule(f, TrueMeleeDamageClass.Instance);
// Declare specific filters.
@@ -46,50 +46,12 @@ namespace CalamityMod.Balancing
bool DragonRageFilter(Projectile p) =>
p.type == ProjectileType<DragonRageStaff>() || p.type == ProjectileType<DragonRageFireball>() || (p.type == ProjectileType<FuckYou>() && p.CountsAsClass<MeleeDamageClass>());
// bool MonkStaffT3Filter(Projectile p) =>
// p.type == ProjectileID.MonkStaffT3_AltShot || (p.type == ProjectileID.Electrosphere && Main.player[p.owner].ActiveItem().type == ItemID.MonkStaffT3);
bool MushroomSpearFilter(Projectile p) =>
p.type == ProjectileID.Mushroom && Main.player[p.owner].ActiveItem().type == ItemID.MushroomSpear;
bool OrichalcumPetalFilter(Projectile p) =>
p.type == ProjectileID.FlowerPetal && Main.player[p.owner].onHitPetal;
bool SpectreMaskSetBonusFilter(Projectile p) =>
p.type == ProjectileID.SpectreWrath && Main.player[p.owner].ghostHurt;
bool AotCThrowCombo(Projectile p) =>
p.type == ProjectileType<ArkoftheCosmosSwungBlade>() && (p.ai[0] == 2 || p.ai[0] == 3);
bool HiveBeeFilter(Projectile p) =>
p.type == ProjectileType<BasicPlagueBee>() && Main.player[p.owner].ActiveItem().type == ItemType<TheHive>();
UniversalBalancingChanges = new List<IBalancingRule[]>()
{
// Nerf Crystal bullet shards by 45%
// Currently crystal bullet projectiles deal 50% of the bullet's damage which is absurd in vanilla, this nerfs them to 27.5%
Do(new ProjectileResistBalancingRule(0.55f, ProjectileID.CrystalShard)),
// Nerf Luminite Arrow trails by 50%.
Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.MoonlordArrowTrail)),
// Nerf Seedler seeds by 25%.
Do(new ProjectileResistBalancingRule(0.75f, ProjectileID.SeedlerNut, ProjectileID.SeedlerThorn)),
// Nerf Cursed Dart flames by 50%.
Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.CursedDartFlame)),
// Nerf Mushroom Spear projectiles by 50%.
Do(new ProjectileSpecificRequirementBalancingRule(0.5f, MushroomSpearFilter)),
// Nerf Orichalcum armor set bonus petals by 25%.
Do(new ProjectileSpecificRequirementBalancingRule(0.75f, OrichalcumPetalFilter)),
// Nerf Spectre Mask set bonus projectiles by 50%.
Do(new ProjectileSpecificRequirementBalancingRule(0.5f, SpectreMaskSetBonusFilter)),
};
NPCSpecificBalancingChanges = new List<NPCBalancingChange>();
#region Crabulon
@@ -97,28 +59,28 @@ namespace CalamityMod.Balancing
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<Crabulon>(), ResistTrueMelee(0.8f)));
#endregion
#region Brain of Cthulhu: Creepers
// 50% resist to true melee.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.Creeper, Do(ResistTrueMelee(0.5f))));
// 50% resist to Demon Scythe.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.Creeper, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.DemonScythe))));
#endregion
#region Eater of Worlds
// 50% resist to true melee.
NPCSpecificBalancingChanges.AddRange(Bundle(EaterOfWorldsIDList.List, Do(ResistTrueMelee(0.5f))));
// 50% resist to Demon Scythe.
NPCSpecificBalancingChanges.AddRange(Bundle(EaterOfWorldsIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.DemonScythe))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.EaterOfWorlds, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.DemonScythe))));
// 40% resist to Sky Glaze.
NPCSpecificBalancingChanges.AddRange(Bundle(EaterOfWorldsIDList.List, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType<StickyFeather>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.EaterOfWorlds, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType<StickyFeather>()))));
// 25% resist to true melee.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.EaterOfWorlds, Do(ResistTrueMelee(0.75f))));
#endregion
#region Brain of Cthulhu: Creepers
// 50% resist to Demon Scythe.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.Creeper, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.DemonScythe))));
// 25% resist to true melee.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.Creeper, Do(ResistTrueMelee(0.75f))));
#endregion
#region The Perforators
// 50% resist to true melee.
NPCSpecificBalancingChanges.AddRange(Bundle(PerforatorWormIDList.List, Do(ResistTrueMelee(0.5f))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Perforators, Do(ResistTrueMelee(0.5f))));
#endregion
#region Wall of Flesh
@@ -128,55 +90,58 @@ namespace CalamityMod.Balancing
#region Aquatic Scourge
// 50% resist to true melee.
NPCSpecificBalancingChanges.AddRange(Bundle(AquaticScourgeIDList.List, Do(ResistTrueMelee(0.5f))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AquaticScourge, Do(ResistTrueMelee(0.5f))));
// 50% resist to Adamantite Throwing Axe's lightning.
// Twisting Thunder and Gael's Greatsword use this projectile too, but they are far beyond progression, so who cares!
NPCSpecificBalancingChanges.AddRange(Bundle(AquaticScourgeIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.CultistBossLightningOrbArc))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AquaticScourge, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.CultistBossLightningOrbArc))));
// 50% resist to Dormant Brimseeker.
NPCSpecificBalancingChanges.AddRange(Bundle(AquaticScourgeIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<DormantBrimseekerBab>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AquaticScourge, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<DormantBrimseekerBab>()))));
// 50% resist to Mounted Scanner.
NPCSpecificBalancingChanges.AddRange(Bundle(AquaticScourgeIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<MountedScannerLaser>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AquaticScourge, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<MountedScannerLaser>()))));
// 40% resist to Cryophobia.
NPCSpecificBalancingChanges.AddRange(Bundle(AquaticScourgeIDList.List, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType<CryoBlast>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AquaticScourge, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType<CryoBlast>()))));
// 30% resist to Meowthrower.
NPCSpecificBalancingChanges.AddRange(Bundle(AquaticScourgeIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<MeowFire>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AquaticScourge, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<MeowFire>()))));
// 25% resist to Snowstorm Staff.
NPCSpecificBalancingChanges.AddRange(Bundle(AquaticScourgeIDList.List, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<Snowflake>(), ProjectileType<SnowflakeIceStar>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AquaticScourge, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<Snowflake>(), ProjectileType<SnowflakeIceStar>()))));
#endregion
#region The Destroyer
// 50% resist to true melee.
NPCSpecificBalancingChanges.AddRange(Bundle(DestroyerIDList.List, Do(ResistTrueMelee(0.5f))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Destroyer, Do(ResistTrueMelee(0.5f))));
// 50% resist to Adamantite Throwing Axe's lightning.
// See Aquatic Scourge comment.
NPCSpecificBalancingChanges.AddRange(Bundle(DestroyerIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.CultistBossLightningOrbArc))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Destroyer, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.CultistBossLightningOrbArc))));
// 50% resist to Dormant Brimseeker.
NPCSpecificBalancingChanges.AddRange(Bundle(DestroyerIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<DormantBrimseekerBab>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Destroyer, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<DormantBrimseekerBab>()))));
// 45% resist to Mounted Scanner.
NPCSpecificBalancingChanges.AddRange(Bundle(DestroyerIDList.List, Do(new ProjectileResistBalancingRule(0.55f, ProjectileType<MountedScannerLaser>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Destroyer, Do(new ProjectileResistBalancingRule(0.55f, ProjectileType<MountedScannerLaser>()))));
// 30% resist to Meowthrower.
NPCSpecificBalancingChanges.AddRange(Bundle(DestroyerIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<MeowFire>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Destroyer, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<MeowFire>()))));
// 25% resist to Avalanche's Ice Bombs and shards.
NPCSpecificBalancingChanges.AddRange(Bundle(DestroyerIDList.List, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<IceBombFriendly>(), ProjectileType<FrostShardFriendly>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Destroyer, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<IceBombFriendly>(), ProjectileType<FrostShardFriendly>()))));
// 25% resist to Snowstorm Staff.
NPCSpecificBalancingChanges.AddRange(Bundle(DestroyerIDList.List, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<Snowflake>(), ProjectileType<SnowflakeIceStar>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Destroyer, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<Snowflake>(), ProjectileType<SnowflakeIceStar>()))));
#endregion
#region Astrum Aureus
// 30% resist to The Ballista's greatarrows.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<AstrumAureus>(), Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<BallistaGreatArrow>()))));
// 25% resist to true melee.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<AstrumAureus>(), ResistTrueMelee(0.75f)));
// 25% resist to The Ballista's greatarrows.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<AstrumAureus>(), Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<BallistaGreatArrow>()))));
#endregion
#region Duke Fishron
@@ -197,28 +162,25 @@ namespace CalamityMod.Balancing
#region Ravager
// 50% resist to true melee.
NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(ResistTrueMelee(0.5f))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ravager, Do(ResistTrueMelee(0.5f))));
// 50% resist to Aegis Blade's explosions because the true melee resist ain't enough.
NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<AegisBlast>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ravager, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<AegisBlast>()))));
// 50% resist to Icicle Arrows.
NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<IcicleArrowProj>()))));
// 40% resist to Icicle Arrows.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ravager, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType<IcicleArrowProj>()))));
// 35% resist to Flying Dragon.
NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.65f, ProjectileID.DD2SquireSonicBoom))));
// 30% resist to Aurora Blazer.
NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<AuroraFire>()))));
// 30% resist to Flak Kraken.
NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<FlakKrakenProjectile>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ravager, Do(new ProjectileResistBalancingRule(0.65f, ProjectileID.DD2SquireSonicBoom))));
// 25% resist to Lucrecia.
NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<DNA>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ravager, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<DNA>()))));
// 20% resist to Aurora Blazer.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ravager, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<AuroraFire>()))));
// 20% resist to The Hive.
NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<HiveNuke>(), ProjectileType<HiveMissile>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ravager, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<HiveNuke>(), ProjectileType<HiveMissile>()))));
#endregion
#region Lunatic Cultist
@@ -237,37 +199,37 @@ namespace CalamityMod.Balancing
#region Astrum Deus
// 75% resist to Plaguenades.
NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.25f, ProjectileType<PlaguenadeBee>(), ProjectileType<PlaguenadeProj>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.25f, ProjectileType<PlaguenadeBee>(), ProjectileType<PlaguenadeProj>()))));
// 70% resist to Charged Blaster Cannon.
NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.3f, ProjectileID.ChargedBlasterLaser))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.3f, ProjectileID.ChargedBlasterLaser))));
// 70% resist to Stardust Dragon Staff.
NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.3f, ProjectileID.StardustDragon1, ProjectileID.StardustDragon2, ProjectileID.StardustDragon3, ProjectileID.StardustDragon4))));
// 55% resist to Flak Kraken.
NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.45f, ProjectileType<FlakKrakenProjectile>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.3f, ProjectileID.StardustDragon1, ProjectileID.StardustDragon2, ProjectileID.StardustDragon3, ProjectileID.StardustDragon4))));
// 50% resist to true melee.
NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(ResistTrueMelee(0.5f))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(ResistTrueMelee(0.5f))));
// 50% resist to Atlantis (Atlantis gaming!).
NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<AtlantisSpear>()))));
// 50% resist to Aurora Blazer.
NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<AuroraFire>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<AtlantisSpear>()))));
// 35% resist to Aerial Bane.
NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.65f, ProjectileID.DD2BetsyArrow))));
// 35% resist to Ballistic Poison Bomb's clouds.
NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType<BallisticPoisonCloud>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.65f, ProjectileID.DD2BetsyArrow))));
// 35% resist to Icicle Arrows.
NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType<IcicleArrowProj>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType<IcicleArrowProj>()))));
// 30% resist to Aurora Blazer.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<AuroraFire>()))));
// 30% resist to Flak Kraken.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<FlakKrakenProjectile>()))));
// 20% resist to Ballistic Poison Bomb's clouds.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<BallisticPoisonCloud>()))));
// 20% resist to Cluster Rocket fragments.
NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileID.ClusterFragmentsI, ProjectileID.ClusterFragmentsII))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.8f, ProjectileID.ClusterFragmentsI, ProjectileID.ClusterFragmentsII))));
#endregion
#region Moon Lord
@@ -301,28 +263,28 @@ namespace CalamityMod.Balancing
#region Storm Weaver
// 50% resist to true melee.
NPCSpecificBalancingChanges.AddRange(Bundle(StormWeaverIDList.List, Do(ResistTrueMelee(0.5f))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(ResistTrueMelee(0.5f))));
// 50% resist to Dazzling Stabber Staff.
NPCSpecificBalancingChanges.AddRange(Bundle(StormWeaverIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<DazzlingStabber>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<DazzlingStabber>()))));
// 50% resist to Last Prism.
NPCSpecificBalancingChanges.AddRange(Bundle(StormWeaverIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.LastPrismLaser))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.LastPrismLaser))));
// 50% resist to Legion of Celestia.
NPCSpecificBalancingChanges.AddRange(Bundle(StormWeaverIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<CelestialAxeMinion>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<CelestialAxeMinion>()))));
// 50% resist to Pristine Fury's alt fire.
NPCSpecificBalancingChanges.AddRange(Bundle(StormWeaverIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<PristineSecondary>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<PristineSecondary>()))));
// 50% resist to Tactician's Trump Card's explosions.
NPCSpecificBalancingChanges.AddRange(Bundle(StormWeaverIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<TacticiansElectricBoom>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<TacticiansElectricBoom>()))));
// 40% resist to Devil's Sunrise's slashes.
NPCSpecificBalancingChanges.AddRange(Bundle(StormWeaverIDList.List, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType<DevilsSunriseProj>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType<DevilsSunriseProj>()))));
// 35% resist to Event Horizon.
NPCSpecificBalancingChanges.AddRange(Bundle(StormWeaverIDList.List, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType<EventHorizonStar>(), ProjectileType<EventHorizonBlackhole>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType<EventHorizonStar>(), ProjectileType<EventHorizonBlackhole>()))));
#endregion
#region Old Duke
@@ -332,19 +294,19 @@ namespace CalamityMod.Balancing
#region The Devourer of Gods
// 65% resist to Wave Pounder.
NPCSpecificBalancingChanges.AddRange(Bundle(DevourerOfGodsIDList.List, Do(new ProjectileResistBalancingRule(0.35f, ProjectileType<WavePounderBoom>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.DevourerOfGods, Do(new ProjectileResistBalancingRule(0.35f, ProjectileType<WavePounderBoom>()))));
// 35% resist to Sulphuric Acid Cannon's explosions.
NPCSpecificBalancingChanges.AddRange(Bundle(DevourerOfGodsIDList.List, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType<SulphuricAcidCannonExplosion>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.DevourerOfGods, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType<SulphuricAcidCannonExplosion>()))));
// 25% resist to Corinth Prime's grenades.
NPCSpecificBalancingChanges.AddRange(Bundle(DevourerOfGodsIDList.List, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<CorinthPrimeAirburst>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.DevourerOfGods, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<CorinthPrimeAirburst>()))));
// 20% resist to Valediction's typhoons; will catch Nuclear Fury as well but that doesn't matter.
NPCSpecificBalancingChanges.AddRange(Bundle(DevourerOfGodsIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<NuclearFuryProjectile>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.DevourerOfGods, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<NuclearFuryProjectile>()))));
// 15% vulnerability to Time Bolt stealth strikes.
NPCSpecificBalancingChanges.AddRange(Bundle(DevourerOfGodsIDList.List, Do(new StealthStrikeBalancingRule(1.15f, ProjectileType<TimeBoltKnife>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.DevourerOfGods, Do(new StealthStrikeBalancingRule(1.15f, ProjectileType<TimeBoltKnife>()))));
#endregion The Devourer of Gods
#region Yharon
@@ -357,34 +319,34 @@ namespace CalamityMod.Balancing
#region Exo Mechs: Ares
// 35% resist to Devil's Devastation's slash.
NPCSpecificBalancingChanges.AddRange(Bundle(AresIDList.List, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType<DevilsDevastationHoldout>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ares, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType<DevilsDevastationHoldout>()))));
// 30% resist to Dynamic Pursuer.
NPCSpecificBalancingChanges.AddRange(Bundle(AresIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<DynamicPursuerProjectile>(), ProjectileType<DynamicPursuerLaser>(), ProjectileType<DynamicPursuerElectricity>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ares, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<DynamicPursuerProjectile>(), ProjectileType<DynamicPursuerLaser>(), ProjectileType<DynamicPursuerElectricity>()))));
// 25% resist to Aetherflux Cannon.
NPCSpecificBalancingChanges.AddRange(Bundle(AresIDList.List, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<PhasedGodRay>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ares, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<PhasedGodRay>()))));
// 25% resist to Prismatic Breaker's deathray.
NPCSpecificBalancingChanges.AddRange(Bundle(AresIDList.List, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<PrismaticRay>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ares, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<PrismaticRay>()))));
// 20% resist to the Spin Throw part of the Ark of the Cosmos' combo.
NPCSpecificBalancingChanges.AddRange(Bundle(AresIDList.List, Do(new ProjectileSpecificRequirementBalancingRule(0.8f, AotCThrowCombo))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ares, Do(new ProjectileSpecificRequirementBalancingRule(0.8f, AotCThrowCombo))));
// 20% resist to Dragon Rage projectiles.
NPCSpecificBalancingChanges.AddRange(Bundle(AresIDList.List, Do(new ProjectileSpecificRequirementBalancingRule(0.8f, DragonRageFilter))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ares, Do(new ProjectileSpecificRequirementBalancingRule(0.8f, DragonRageFilter))));
// 20% resist to Eclipse's Fall.
NPCSpecificBalancingChanges.AddRange(Bundle(AresIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<EclipsesSmol>(), ProjectileType<EclipsesFallMain>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ares, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<EclipsesSmol>(), ProjectileType<EclipsesFallMain>()))));
// 20% resist to Rancor.
NPCSpecificBalancingChanges.AddRange(Bundle(AresIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<RancorLaserbeam>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ares, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<RancorLaserbeam>()))));
// 20% resist to Yharim's Crystal.
NPCSpecificBalancingChanges.AddRange(Bundle(AresIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<YharimsCrystalBeam>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ares, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<YharimsCrystalBeam>()))));
// 20% resist to Zenith.
NPCSpecificBalancingChanges.AddRange(Bundle(AresIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileID.FinalFractal))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ares, Do(new ProjectileResistBalancingRule(0.8f, ProjectileID.FinalFractal))));
#endregion
#region Exo Mechs: Artemis and Apollo
@@ -396,85 +358,85 @@ namespace CalamityMod.Balancing
#region Exo Mechs: Thanatos
// 65% resist to true melee.
NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(ResistTrueMelee(0.35f))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(ResistTrueMelee(0.35f))));
// 65% resist to The Final Dawn's lunge.
NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.35f, ProjectileType<FinalDawnThrow2>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.35f, ProjectileType<FinalDawnThrow2>()))));
// 65% resist to Stellar Torus Staff.
NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.35f, ProjectileType<StellarTorusBeam>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.35f, ProjectileType<StellarTorusBeam>()))));
// 60% resist to Dynamic Pursuer.
NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.4f, ProjectileType<DynamicPursuerProjectile>(), ProjectileType<DynamicPursuerLaser>(), ProjectileType<DynamicPursuerElectricity>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.4f, ProjectileType<DynamicPursuerProjectile>(), ProjectileType<DynamicPursuerLaser>(), ProjectileType<DynamicPursuerElectricity>()))));
// 50% resist to Chicken Cannon.
NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<ChickenExplosion>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<ChickenExplosion>()))));
// 50% resist to Omicron's beam.
NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<OmicronBeam>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<OmicronBeam>()))));
// 50% resist to Rancor.
NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<RancorLaserbeam>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<RancorLaserbeam>()))));
// 50% resist to Vehemence's skulls.
NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<VehemenceSkull>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<VehemenceSkull>()))));
// 50% resist to Yharim's Crystal.
NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<YharimsCrystalBeam>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<YharimsCrystalBeam>()))));
// 45% resist to Prismatic Breaker's deathray.
NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.55f, ProjectileType<PrismaticRay>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.55f, ProjectileType<PrismaticRay>()))));
// 45% resist to Wrathwing's stealth strike fireballs.
NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.55f, ProjectileType<WrathwingCinder>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.55f, ProjectileType<WrathwingCinder>()))));
// 30% resist to Eclipse's Fall.
NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<EclipsesFallMain>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<EclipsesFallMain>()))));
// 30% resist to Sirius.
NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<SiriusExplosion>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<SiriusExplosion>()))));
// 30% resist to Ultima's rays.
NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<UltimaRay>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<UltimaRay>()))));
// 30% resist to Dragon Scales and The Wand's tornadoes.
NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<InfernadoFriendly>(), ProjectileType<DragonScalesInfernado>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<InfernadoFriendly>(), ProjectileType<DragonScalesInfernado>()))));
// 25% resist to the Spin Throw part of the Ark of the Cosmos' combo.
NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileSpecificRequirementBalancingRule(0.75f, AotCThrowCombo))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileSpecificRequirementBalancingRule(0.75f, AotCThrowCombo))));
// 25% resist to Dragon Rage projectiles.
NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileSpecificRequirementBalancingRule(0.75f, DragonRageFilter))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileSpecificRequirementBalancingRule(0.75f, DragonRageFilter))));
// 25% resist to Gael's Greatsword's big skulls.
NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileSpecificRequirementBalancingRule(0.75f, BigGaelsSkullFilter))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileSpecificRequirementBalancingRule(0.75f, BigGaelsSkullFilter))));
// 25% resist to Mirror of Kalandra's Paradoxica minion.
NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<Paradoxica>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<Paradoxica>()))));
// 25% resist to Zenith.
NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.75f, ProjectileID.FinalFractal))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.75f, ProjectileID.FinalFractal))));
// 20% resist to The Anomaly's Nanogun's bomb explosions.
NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<AnomalysNanogunMPFBBoom>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<AnomalysNanogunMPFBBoom>()))));
// 20% resist to Ariane's aura (Lilies of Finality).
NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<LiliesOfFinalityAoE>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<LiliesOfFinalityAoE>()))));
// 20% resist to Eradicator's beams.
NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<NebulaShot>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<NebulaShot>()))));
// 20% resist to Plasma Grenade and Dynamic Pursuer's explosions.
NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<PlasmaGrenadeProjectile>(), ProjectileType<PlasmaGrenadeSmallExplosion>(), ProjectileType<MassivePlasmaExplosion>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<PlasmaGrenadeProjectile>(), ProjectileType<PlasmaGrenadeSmallExplosion>(), ProjectileType<MassivePlasmaExplosion>()))));
// 20% resist to Voltaic Climax / Void Vortex hitscan beams.
NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<ClimaxBeam>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<ClimaxBeam>()))));
// 15% resist to The Final Dawn's AoE sweep flames.
NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType<FinalDawnFlame>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType<FinalDawnFlame>()))));
// 15% resist to Gruesome Eminence.
NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType<SpiritCongregation>()))));
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType<SpiritCongregation>()))));
#endregion
#region Supreme Calamitas: Brimstone Hearts
@@ -511,23 +473,12 @@ namespace CalamityMod.Balancing
public override void Unload()
{
UniversalBalancingChanges = null;
NPCSpecificBalancingChanges = null;
}
public static void ApplyFromProjectile(NPC npc, ref NPC.HitModifiers modifiers, Projectile proj)
{
// Apply universal balancing rules.
foreach (IBalancingRule[] balancingRules in UniversalBalancingChanges)
{
foreach (IBalancingRule balancingRule in balancingRules)
{
if (balancingRule.AppliesTo(npc, modifiers, proj))
balancingRule.ApplyBalancingChange(npc, ref modifiers);
}
}
// As well as rules specific to NPCs.
// Apply NPC-specific balancing rules.
foreach (NPCBalancingChange balanceChange in NPCSpecificBalancingChanges)
{
if (npc.type != balanceChange.NPCType)
+6 -38
View File
@@ -117,54 +117,22 @@
#endregion
#region Life Steal
// Life steal cap
// Life steal cap (Maximum HP healed per instance of lifesteal)
internal static readonly int LifeStealCap = 100;
// Life steal accessories require a more strict cooldown due to their ease of use and global application
internal static readonly float LifeStealAccessoryCooldownMultiplier = 3f;
// Life steal cooldown multipliers used for armor set bonuses
internal static readonly float LifeStealSetBonusCooldownMultiplier = 2f;
internal static readonly float LifeStealReaverTankCooldownMultiplier = 4f;
// The range was buffed in vanilla from 1200 to 3000 in 1.4.4, and I agree with that decision
internal static readonly float LifeStealRange = 3000f;
// Life steal caps (aka, how much life steal the player is allowed before it goes on cooldown)
internal static readonly float LifeStealCap_Classic = 60f;
internal static readonly float LifeStealCap_Expert = 50f;
internal static readonly float LifeStealCap_Revengeance = 40f;
internal static readonly float LifeStealCap_Death = 30f;
// Master nerfs the life steal cap by 10, resulting in 40 in non-Rev Master, 30 in Rev Master, and 20 in Death Master
internal static readonly float LifeStealCapReduction_Master = 10f;
// Base life steal caps from vanilla (aka, how much life steal the player is allowed before it goes on cooldown)
internal static readonly float LifeStealCap_Classic = 80f;
internal static readonly float LifeStealCap_Expert = 70f;
// The base life steal cooldowns from vanilla
internal static readonly float LifeStealRecoveryRate_Classic = 0.6f;
internal static readonly float LifeStealRecoveryRate_Expert = 0.5f;
// The calculations below show the time (in frames) for 10 life steal cooldown to recover in each difficulty
// Classic: 10 / 0.2 = 50
// Expert: 10 / 0.15 = 66.667
// Revengeance: 10 / 0.125 = 80
// Death: 10 / 0.1 = 100
// Master: 10 / 0.1 = 100
// Revengeance Master: 10 / 0.075 = 133.333
// Death Master: 10 / 0.05 = 200
// Nerfs the life steal recovery rate in Classic from 0.6/s to 0.2/s
// Nerfs the life steal recovery rate in Classic from 0.6 to 0.2 (36 HP/s to 12 HP/s)
internal static readonly float LifeStealRecoveryRateReduction_Classic = 0.4f;
// Nerfs the life steal recovery rate in Expert from 0.5/s to 0.15/s
// Nerfs the life steal recovery rate in Expert from 0.5 to 0.15 (30 HP/s to 9 HP/s)
internal static readonly float LifeStealRecoveryRateReduction_Expert = 0.35f;
// Nerfs the life steal recovery rate in Revengeance from 0.5/s to 0.125/s
internal static readonly float LifeStealRecoveryRateReduction_Revengeance = 0.375f;
// Nerfs the life steal recovery rate in Death from 0.5/s to 0.1/s
internal static readonly float LifeStealRecoveryRateReduction_Death = 0.4f;
// Nerfs the life steal recovery rate in Master by 0.05/s, resulting in 0.1/s in non-Rev Master, 0.075/s in Rev Master, and 0.05/s in Death Master
internal static readonly float LifeStealRecoveryRateReduction_Master = 0.05f;
#endregion
#region Rogue Base Stats
+2
View File
@@ -1,4 +1,5 @@
using Terraria;
using Terraria.GameContent;
using Terraria.ID;
using Terraria.ModLoader;
@@ -17,6 +18,7 @@ namespace CalamityMod.Buffs.Alcohol
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().cinnamonRoll = true;
player.Calamity().HeatDebuffMultiplier += 0.5f;
}
}
}
+2
View File
@@ -17,6 +17,8 @@ namespace CalamityMod.Buffs.Alcohol
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().evergreenGin = true;
player.Calamity().SicknessDebuffMultiplier += 0.25f;
player.Calamity().WaterDebuffMultiplier += 0.25f;
}
}
}
+1
View File
@@ -17,6 +17,7 @@ namespace CalamityMod.Buffs.Alcohol
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().fireball = true;
player.Calamity().HeatDebuffMultiplier += 0.25f;
}
}
}
+25 -35
View File
@@ -16,14 +16,14 @@ namespace CalamityMod.Buffs
{
// Globally remove summon tag buff stacking
// Other mods need to add to this list because we genuinely don't have any way to tell this
if (SummonTagBuffList.Includes(type) && buffIndex > 0)
if (CalamityBuffSets.IsSummonTagBuff[type] && buffIndex > 0)
{
for (int i = buffIndex; i >= 0; i--)
{
if (player.buffTime[i] > 0)
{
int buffID = player.buffType[i];
if (SummonTagBuffList.Includes(buffID) && buffID != type)
if (CalamityBuffSets.IsSummonTagBuff[buffID] && buffID != type)
{
player.DelBuff(i);
break;
@@ -36,10 +36,6 @@ namespace CalamityMod.Buffs
{
player.arrowDamage *= 0.955f;
}
else if (type == BuffID.Ironskin)
{
player.statDefense += CalamityUtils.GetScalingDefense(-1) - 8;
}
else if (type == BuffID.MagicPower)
{
player.GetDamage<MagicDamageClass>() -= 0.1f;
@@ -93,10 +89,6 @@ namespace CalamityMod.Buffs
{
player.Calamity().shine = true;
}
else if (type == BuffID.IceBarrier)
{
player.endurance -= 0.1f;
}
// Beetle Shell DR is a full compensation, as the vanilla multiplicative DR is removed entirely.
else if (type >= BuffID.BeetleEndurance1 && type <= BuffID.BeetleEndurance3 && player.beetleDefense)
@@ -115,6 +107,19 @@ namespace CalamityMod.Buffs
else if (type == BuffID.Rabies)
{
player.GetDamage<GenericDamageClass>() -= 0.2f;
// Reimplementation of random debuff infliction; now occurs on a consistent timer and with a different debuff list
if (player.buffTime[buffIndex] % 600 == 300)
{
int debuffType = Main.rand.Next(4) switch
{
0 => BuffID.Weak,
1 => BuffID.Bleeding,
2 => BuffID.Darkness,
_ => BuffID.BrokenArmor,
};
player.AddBuff(debuffType, Main.rand.Next(90, 211));
}
}
else if (type == BuffID.Werewolf)
{
@@ -126,14 +131,14 @@ namespace CalamityMod.Buffs
{
// Globally remove summon tag debuff stacking, unless allowed in the SummonTag
// Other mods need to add to this list because otherwise we can't tell which IsATag buff is actually for whips
if (SummonTagDebuffDict.TryGet(type, out var tag1) && !tag1.AllowsWhipStacking && buffIndex > 0)
if (CalamityBuffSets.SummonTagDebuff.TryGetValue(type, out var tag1) && !tag1.AllowsWhipStacking && buffIndex > 0)
{
for (int i = buffIndex; i >= 0; i--)
{
if (npc.buffTime[i] > 0)
{
int buffID = npc.buffType[i];
if (SummonTagDebuffDict.TryGet(buffID, out var tag2) && !tag2.AllowsWhipStacking && buffID != type)
if (CalamityBuffSets.SummonTagDebuff.TryGetValue(buffID, out var tag2) && !tag2.AllowsWhipStacking && buffID != type)
{
npc.DelBuff(i);
break;
@@ -144,28 +149,13 @@ namespace CalamityMod.Buffs
if (type == BuffID.Webbed)
{
if (npc.Calamity().webbed < npc.buffTime[buffIndex])
npc.Calamity().webbed = npc.buffTime[buffIndex];
if ((EnemyImmunitiesList.Includes(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0)
npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().webbed;
npc.DelBuff(buffIndex);
buffIndex--;
}
else if (type == BuffID.Slow)
{
if (npc.Calamity().slowed < npc.buffTime[buffIndex])
npc.Calamity().slowed = npc.buffTime[buffIndex];
if ((EnemyImmunitiesList.Includes(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0)
npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().slowed;
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().webbed = true;
if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0)
npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex];
}
if (type == BuffID.Electrified)
{
if (npc.Calamity().electrified < npc.buffTime[buffIndex])
npc.Calamity().electrified = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().electrified = true;
}
}
@@ -210,10 +200,6 @@ namespace CalamityMod.Buffs
tip = tip.Replace("25", "15");
break;
case BuffID.Ironskin:
tip = tip.Replace("8", CalamityUtils.GetScalingDefense(-1).ToString());
break;
case BuffID.LeafCrystal:
tip = CalamityUtils.GetTextValue("Vanilla.BuffDescription.LeafCrystal");
break;
@@ -251,6 +237,10 @@ namespace CalamityMod.Buffs
tip = tip.Replace("45", "22.5");
break;
case BuffID.Rabies:
tip = CalamityUtils.GetTextValue("Vanilla.BuffDescription.Rabies");
break;
case BuffID.SugarRush:
tip = tip.Replace("20", "10");
break;
@@ -1,4 +1,5 @@
using CalamityMod.Particles;
using CalamityMod.DataStructures;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
@@ -9,12 +10,18 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public class AstralInfectionDebuff : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 75,
SicknessDebuffScaling = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
@@ -24,10 +31,7 @@ namespace CalamityMod.Buffs.DamageOverTime
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().astralInfection < npc.buffTime[buffIndex])
npc.Calamity().astralInfection = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().astralInfection = true;
}
internal static void DrawEffects(PlayerDrawSet drawInfo)
+9 -5
View File
@@ -1,4 +1,5 @@
using CalamityMod.Particles;
using CalamityMod.DataStructures;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
@@ -9,12 +10,18 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public class AuricRebuke : ModBuff
{
public static DebuffData debuffData = new DebuffData(DebuffData.DebuffBehavior.Electric)
{
EnemyLostRegen = 200,
ElectricDebuffScaling = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
@@ -24,10 +31,7 @@ namespace CalamityMod.Buffs.DamageOverTime
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().auricRebuke < npc.buffTime[buffIndex])
npc.Calamity().auricRebuke = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().auricRebuke = true;
}
internal static void DrawEffects(PlayerDrawSet drawInfo)
+15 -5
View File
@@ -1,4 +1,5 @@
using Terraria;
using CalamityMod.DataStructures;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -6,12 +7,24 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public class BanishingFire : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 4000, //This is the minimum DoT. Banishing Fire scales with max HP
HeatDebuffScaling = 1, //Unused in the method, but kept so other things can know this is a heat debuff
NPCLifeRegenMethod = BanishingFireNPCLifeRegen
};
public static void BanishingFireNPCLifeRegen(NPC npc, int buffType, ref int buffIndex, ref int damage)
{
int baseBanishingFireDoTValue = (int)npc.Calamity().ActiveHeatDebuffMultiplier.ApplyTo((npc.lifeMax >= 1000000 ? npc.lifeMax / 500 : debuffData.EnemyLostRegen));
npc.Calamity().ApplyDPSDebuff(baseBanishingFireDoTValue, baseBanishingFireDoTValue / 5, ref npc.lifeRegen, ref damage);
}
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
@@ -21,10 +34,7 @@ namespace CalamityMod.Buffs.DamageOverTime
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().banishingFire < npc.buffTime[buffIndex])
npc.Calamity().banishingFire = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().banishingFire = true;
}
}
}
+9 -5
View File
@@ -1,4 +1,5 @@
using CalamityMod.Particles;
using CalamityMod.DataStructures;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
@@ -9,12 +10,18 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public class BrainRot : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 40,
SicknessDebuffScaling = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
@@ -24,10 +31,7 @@ namespace CalamityMod.Buffs.DamageOverTime
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().brainRot < npc.buffTime[buffIndex])
npc.Calamity().brainRot = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().brainRot = true;
}
internal static void DrawEffects(PlayerDrawSet drawInfo)
+10 -6
View File
@@ -1,4 +1,5 @@
using CalamityMod.Dusts;
using CalamityMod.DataStructures;
using CalamityMod.Dusts;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
@@ -9,25 +10,28 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public class BrimstoneFlames : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 60,
HeatDebuffScaling = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().bFlames = true;
player.Calamity().brimstoneFlames = true;
}
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().bFlames < npc.buffTime[buffIndex])
npc.Calamity().bFlames = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().brimstoneFlames = true;
}
internal static void DrawEffects(PlayerDrawSet drawInfo, bool hasDebuffResistance = false)
+10 -6
View File
@@ -1,4 +1,5 @@
using CalamityMod.Particles;
using CalamityMod.DataStructures;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
@@ -9,25 +10,28 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public class BurningBlood : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 40,
SicknessDebuffScaling = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().bBlood = true;
player.Calamity().burningBlood = true;
}
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().bBlood < npc.buffTime[buffIndex])
npc.Calamity().bBlood = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().burningBlood = true;
}
internal static void DrawEffects(PlayerDrawSet drawInfo)
+10 -6
View File
@@ -1,4 +1,5 @@
using CalamityMod.Particles;
using CalamityMod.DataStructures;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
@@ -9,25 +10,28 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public class CrushDepth : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 100,
WaterDebuffScaling = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().cDepth = true;
player.Calamity().crushDepth = true;
}
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().cDepth < npc.buffTime[buffIndex])
npc.Calamity().cDepth = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().crushDepth = true;
}
internal static void DrawEffects(PlayerDrawSet drawInfo)
+4 -1
View File
@@ -1,4 +1,6 @@
using Terraria;
using CalamityMod.DataStructures;
using CalamityMod.Projectiles.Boss;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.Localization;
@@ -16,6 +18,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = DebuffData.Daybroken;
}
public override void Update(Player player, ref int buffIndex)
+13 -4
View File
@@ -1,4 +1,5 @@
using System;
using CalamityMod.DataStructures;
using CalamityMod.Dusts;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Pets;
@@ -12,6 +13,17 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public class DemonicFlames : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 60, //Unused in the method, this is the amount of DoT from Forbidden Oathblade demon flames
HeatDebuffScaling = 1, //Unused in the method, but kept so other things can know this is a heat debuff
NPCLifeRegenMethod = DemonFlamesNPCLifeRegen
};
public static void DemonFlamesNPCLifeRegen(NPC npc, int buffType, ref int buffIndex, ref int damage)
{
int baseDemonicFlamesDoTValue = (int)Math.Max(npc.Calamity().ActiveHeatDebuffMultiplier.ApplyTo(npc.Calamity().demonicFlamesBonusDamage), npc.Calamity().demonicFlamesBonusDamage);
npc.Calamity().ApplyDPSDebuff(baseDemonicFlamesDoTValue, baseDemonicFlamesDoTValue / 15, ref npc.lifeRegen, ref damage);
}
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
@@ -27,10 +39,7 @@ namespace CalamityMod.Buffs.DamageOverTime
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().demonicFlames < npc.buffTime[buffIndex])
npc.Calamity().demonicFlames = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().demonicFlames = true;
}
internal static void DrawEffects(PlayerDrawSet drawInfo, bool hasDebuffResistance = false)
+9 -5
View File
@@ -1,4 +1,5 @@
using CalamityMod.Particles;
using CalamityMod.DataStructures;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
@@ -9,12 +10,18 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public class Dragonfire : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 960,
HeatDebuffScaling = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
@@ -24,10 +31,7 @@ namespace CalamityMod.Buffs.DamageOverTime
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().dragonFire < npc.buffTime[buffIndex])
npc.Calamity().dragonFire = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().dragonFire = true;
}
internal static void DrawEffects(PlayerDrawSet drawInfo)
+8 -5
View File
@@ -1,4 +1,5 @@
using CalamityMod.Dusts;
using CalamityMod.DataStructures;
using CalamityMod.Dusts;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
@@ -10,12 +11,17 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public class ElementalMix : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 400
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
@@ -25,10 +31,7 @@ namespace CalamityMod.Buffs.DamageOverTime
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().elementalMix < npc.buffTime[buffIndex])
npc.Calamity().elementalMix = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().elementalMix = true;
}
internal static void DrawEffects(PlayerDrawSet drawInfo)
+10 -6
View File
@@ -1,4 +1,5 @@
using CalamityMod.Particles;
using CalamityMod.DataStructures;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
@@ -9,25 +10,28 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public class GodSlayerInferno : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 500,
HeatDebuffScaling = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().gsInferno = true;
player.Calamity().godSlayerInferno = true;
}
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().gsInferno < npc.buffTime[buffIndex])
npc.Calamity().gsInferno = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().godSlayerInferno = true;
}
internal static void DrawEffects(PlayerDrawSet drawInfo)
+10 -6
View File
@@ -1,4 +1,5 @@
using CalamityMod.Particles;
using CalamityMod.DataStructures;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
@@ -9,25 +10,28 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public class HadopelagicPressure : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 400,
WaterDebuffScaling = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().hPressure = true;
player.Calamity().hadopelagicPressure = true;
}
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().hPressure < npc.buffTime[buffIndex])
npc.Calamity().hPressure = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().hadopelagicPressure = true;
}
internal static void DrawEffects(PlayerDrawSet drawInfo)
+9 -6
View File
@@ -1,6 +1,7 @@
using CalamityMod.Particles;
using System;
using CalamityMod.DataStructures;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
@@ -10,12 +11,17 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public class HeavyBleeding : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 80
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
@@ -25,10 +31,7 @@ namespace CalamityMod.Buffs.DamageOverTime
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().heavybleeding < npc.buffTime[buffIndex])
npc.Calamity().heavybleeding = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().heavyBleeding = true;
}
internal static void DrawEffects(PlayerDrawSet drawInfo)
{
+10 -6
View File
@@ -1,4 +1,5 @@
using CalamityMod.Particles;
using CalamityMod.DataStructures;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
@@ -9,25 +10,28 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public class HolyFlames : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 300,
HeatDebuffScaling = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().hFlames = true;
player.Calamity().holyFlames = true;
}
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().hFlames < npc.buffTime[buffIndex])
npc.Calamity().hFlames = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().holyFlames = true;
}
internal static void DrawEffects(PlayerDrawSet drawInfo)
+10 -2
View File
@@ -1,4 +1,5 @@
using Terraria;
using CalamityMod.DataStructures;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -6,17 +7,24 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public class HolyInferno : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 10000, //this is never applied to enemies
HeatDebuffScaling = 1,
GearCanModifyDebuff = false
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().hInferno = true;
player.Calamity().holyInferno = true;
}
}
}
+9 -6
View File
@@ -1,6 +1,7 @@
using CalamityMod.Particles;
using System;
using CalamityMod.DataStructures;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
@@ -10,12 +11,17 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public class Laceration : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 400
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
@@ -25,10 +31,7 @@ namespace CalamityMod.Buffs.DamageOverTime
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().laceration < npc.buffTime[buffIndex])
npc.Calamity().laceration = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().laceration = true;
}
internal static void DrawEffects(PlayerDrawSet drawInfo)
{
+1
View File
@@ -6,6 +6,7 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public class ManaBurn : ModBuff
{
//as of now, this doesn't use the custom debuff system due to the debuff being a front for the actual effects in the Chaos Stone rework
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
+8 -5
View File
@@ -1,4 +1,5 @@
using CalamityMod.Particles;
using CalamityMod.DataStructures;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
@@ -9,12 +10,17 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public class MiracleBlight : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 3000
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
@@ -24,10 +30,7 @@ namespace CalamityMod.Buffs.DamageOverTime
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().miracleBlight < npc.buffTime[buffIndex])
npc.Calamity().miracleBlight = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().miracleBlight = true;
}
internal static void DrawEffects(PlayerDrawSet drawInfo)
+9 -5
View File
@@ -1,4 +1,5 @@
using CalamityMod.Particles;
using CalamityMod.DataStructures;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
@@ -9,12 +10,18 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public class Nightwither : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 200,
ColdDebuffScaling = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
@@ -24,10 +31,7 @@ namespace CalamityMod.Buffs.DamageOverTime
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().nightwither < npc.buffTime[buffIndex])
npc.Calamity().nightwither = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().nightwither = true;
}
internal static void DrawEffects(PlayerDrawSet drawInfo, bool hasDebuffResistance = false)
+10 -6
View File
@@ -1,4 +1,5 @@
using CalamityMod.Particles;
using CalamityMod.DataStructures;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
@@ -9,25 +10,28 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public class Plague : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 100,
SicknessDebuffScaling = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().pFlames = true;
player.Calamity().plague = true;
}
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().pFlames < npc.buffTime[buffIndex])
npc.Calamity().pFlames = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().plague = true;
}
internal static void DrawEffects(PlayerDrawSet drawInfo)
+10 -6
View File
@@ -1,4 +1,5 @@
using Microsoft.Xna.Framework;
using CalamityMod.DataStructures;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
@@ -8,25 +9,28 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public class RiptideDebuff : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 30,
WaterDebuffScaling = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().rTide = true;
player.Calamity().riptide = true;
}
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().rTide < npc.buffTime[buffIndex])
npc.Calamity().rTide = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().riptide = true;
}
internal static void DrawEffects(PlayerDrawSet drawInfo)
+16 -5
View File
@@ -1,10 +1,24 @@
using Terraria;
using CalamityMod.DataStructures;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.DamageOverTime
{
public class SagePoison : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 50,
NPCLifeRegenMethod = SagePoisonPower
};
public static void SagePoisonPower(NPC npc, int buffType, ref int buffIndex, ref int damage)
{
// The dot ia multipliplied by this before being applied:
// (float)(Math.Pow(totalSageSpirits, 0.9D) + Math.Pow(totalSageSpirits, 1.13D)) * 0.5f;
// See SageNeedle.cs for details
int baseSagePoisonDoTValue = (int)npc.Calamity().ActiveTypelessDebuffMultiplier.ApplyTo(npc.Calamity().sagePoisonDamage);
npc.Calamity().ApplyDPSDebuff(baseSagePoisonDoTValue, baseSagePoisonDoTValue / 5, ref npc.lifeRegen, ref damage);
}
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
@@ -13,10 +27,7 @@ namespace CalamityMod.Buffs.DamageOverTime
}
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().sagePoisonTime < npc.buffTime[buffIndex])
npc.Calamity().sagePoisonTime = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().sagePoison = true;
}
}
}
+9 -2
View File
@@ -1,4 +1,5 @@
using Terraria;
using CalamityMod.DataStructures;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.DamageOverTime
@@ -6,17 +7,23 @@ namespace CalamityMod.Buffs.DamageOverTime
[LegacyName("CragsLava")]
public class SearingLava : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 1000, //Never infliced on enemies, token value. Really high bc this hurts a lot on players
HeatDebuffScaling = 1
};
public override void SetStaticDefaults()
{
Main.buffNoTimeDisplay[Type] = true;
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().cragsLava = true;
player.Calamity().searingLava = true;
}
}
}
+3 -1
View File
@@ -1,4 +1,5 @@
using Microsoft.Xna.Framework;
using CalamityMod.DataStructures;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
@@ -17,6 +18,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = DebuffData.Shadowflame;
}
public override void Update(Player player, ref int buffIndex)
+39 -5
View File
@@ -1,23 +1,57 @@
using Terraria;
using CalamityMod.Balancing;
using CalamityMod.DataStructures;
using CalamityMod.Projectiles.Summon;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.DamageOverTime
{
public class ShellfishClaps : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 150, //Damage per shellfish
NPCLifeRegenMethod = ShellfishStacking
};
public static void ShellfishStacking(NPC npc, int buffType, ref int buffIndex, ref int damage)
{
int projectileCount = 0;
int owner = 255;
foreach (Projectile p in Main.ActiveProjectiles)
{
if (p.type == ModContent.ProjectileType<Shellfish>() &&
p.ai[0] == 1f && p.ai[1] == npc.whoAmI)
{
owner = p.owner;
projectileCount++;
if (projectileCount >= 5)
{
projectileCount = 5;
break;
}
}
}
Item heldItem = Main.player[owner].ActiveItem();
int totalDamage = (int)Main.player[owner].GetTotalDamage<SummonDamageClass>().ApplyTo(debuffData.EnemyLostRegen);
if (CalamityUtils.ShouldTriggerSummonPenalty(Main.player[owner], heldItem))
totalDamage = (int)(totalDamage * BalancingConstants.SummonerCrossClassNerf);
int totalDisplayedDamage = totalDamage / 5;
npc.Calamity().ApplyDPSDebuff(projectileCount * totalDamage, projectileCount * totalDisplayedDamage, ref npc.lifeRegen, ref damage);
}
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().shellfishVore < npc.buffTime[buffIndex])
npc.Calamity().shellfishVore = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().shellfishStaffDebuff = true;
}
}
}
+2
View File
@@ -11,6 +11,8 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public class Shred : ModBuff
{
//This is not ported to the custom debuff system yet due to the complexities of it.
//I didn't want to break it! It will be done in a future PR
internal const int StackFalloffFrames = 320;
// This deals 600 DPS per stack, is boosted by ranged stats and can supercrit.
+29 -5
View File
@@ -1,23 +1,47 @@
using Terraria;
using CalamityMod.Balancing;
using CalamityMod.DataStructures;
using CalamityMod.Projectiles.Rogue;
using CalamityMod.Projectiles.Summon;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.DamageOverTime
{
public class SnapClamDebuff : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 15, //Damage per shellfish
NPCLifeRegenMethod = ShellfishStacking
};
public static void ShellfishStacking(NPC npc, int buffType, ref int buffIndex, ref int damage)
{
int projectileCount = 0;
foreach (Projectile p in Main.ActiveProjectiles)
{
if (p.ai[0] == 1f && p.ai[1] == npc.whoAmI)
{
if (p.type == ModContent.ProjectileType<SnapClamProj>())
projectileCount += 2;
if (p.type == ModContent.ProjectileType<SnapClamStealth>())
projectileCount++;
}
}
npc.Calamity().ApplyDPSDebuff((int)(projectileCount * debuffData.EnemyLostRegen), projectileCount * 3, ref npc.lifeRegen, ref damage);
}
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().clamDebuff < npc.buffTime[buffIndex])
npc.Calamity().clamDebuff = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().snapClamDebuff = true;
}
}
}
+9 -5
View File
@@ -1,4 +1,5 @@
using CalamityMod.Particles;
using CalamityMod.DataStructures;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
@@ -9,12 +10,18 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public class StaticDischarge : ModBuff
{
public static DebuffData debuffData = new DebuffData(DebuffData.DebuffBehavior.Electric)
{
EnemyLostRegen = 5,
ElectricDebuffScaling = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
@@ -24,10 +31,7 @@ namespace CalamityMod.Buffs.DamageOverTime
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().staticDischarge < npc.buffTime[buffIndex])
npc.Calamity().staticDischarge = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().staticDischarge = true;
}
internal static void DrawEffects(PlayerDrawSet drawInfo)
+9 -5
View File
@@ -1,4 +1,5 @@
using CalamityMod.Particles;
using CalamityMod.DataStructures;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
@@ -9,12 +10,18 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public class SulphuricPoisoning : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 240,
SicknessDebuffScaling = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
// Acid Venom immunity is granted automatically if you are immune to Sulphuric Poisoning.
BuffID.Sets.GrantImmunityWith[BuffID.Venom].Add(Type);
@@ -33,10 +40,7 @@ namespace CalamityMod.Buffs.DamageOverTime
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().sulphurPoison < npc.buffTime[buffIndex])
npc.Calamity().sulphurPoison = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().sulphurPoison = true;
}
internal static void DrawEffects(PlayerDrawSet drawInfo)
+17 -20
View File
@@ -1,4 +1,5 @@
using CalamityMod.Dusts;
using CalamityMod.DataStructures;
using CalamityMod.Dusts;
using CalamityMod.NPCs;
using CalamityMod.Particles;
using CalamityMod.Systems.Collections;
@@ -12,11 +13,13 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public class TrueVulnerabilityHex : ModBuff
{
// The visual number displayed in ticks as the enemy takes damage.
public const int TickNumber = 666;
// The exact amount True Vulnerability Hex reduces NPC life regen by.
public const int DPS = TickNumber * 6; // -3996 life regen, 1998 DPS
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 3996, //6x the tick size
SicknessDebuffScaling = 1,
MinimumDamageTickSize = 666, //Vhex should always have ticks of 666
MultiplierDamageTickSize = 0
};
public override void SetStaticDefaults()
{
@@ -25,6 +28,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.buffNoSave[Type] = true;
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex) => player.Calamity().trueVHex = true;
@@ -32,21 +36,14 @@ namespace CalamityMod.Buffs.DamageOverTime
public override void Update(NPC npc, ref int buffIndex)
{
CalamityGlobalNPC cgn = npc.Calamity();
if (cgn.trueVulnerabilityHex < npc.buffTime[buffIndex])
{
cgn.trueVulnerabilityHex = npc.buffTime[buffIndex];
// Set the remaining time of the fire drawer to be exactly right.
if (cgn.VulnerabilityHexFireDrawer != null)
cgn.VulnerabilityHexFireDrawer.SetLifetime = cgn.VulnerabilityHexFireDrawer.LocalTimer + cgn.trueVulnerabilityHex;
}
//If this isn't here the drawcode gives an index out of bounds
if (npc.buffTime[buffIndex] > 1)
cgn.trueVulnerabilityHex = true;
if (cgn.VulnerabilityHexFireDrawer != null)
cgn.VulnerabilityHexFireDrawer.SetLifetime = cgn.VulnerabilityHexFireDrawer.LocalTimer + npc.buffTime[buffIndex];
if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && cgn.debuffResistanceTimer <= 0)
cgn.debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex];
// Apply immunity timer.
if ((EnemyImmunitiesList.Includes(npc.type) || npc.boss) && cgn.debuffResistanceTimer <= 0)
cgn.debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + cgn.trueVulnerabilityHex;
// Destroy the vanilla buff, we don't use it.
npc.DelBuff(buffIndex);
buffIndex--;
}
internal static void DrawEffects(NPC npc, ref Color drawColor)
+12 -7
View File
@@ -1,4 +1,5 @@
using CalamityMod.NPCs;
using CalamityMod.DataStructures;
using CalamityMod.NPCs;
using CalamityMod.Systems.Collections;
using Microsoft.Xna.Framework;
using Terraria;
@@ -10,12 +11,19 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public class Vaporfied : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 30,
MinimumDamageTickSize = 6,
MultiplierDamageTickSize = 0
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
@@ -25,12 +33,9 @@ namespace CalamityMod.Buffs.DamageOverTime
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().vaporfied < npc.buffTime[buffIndex])
npc.Calamity().vaporfied = npc.buffTime[buffIndex];
if ((EnemyImmunitiesList.Includes(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0)
npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().vaporfied;
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().vaporfied = true;
if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0)
npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin +npc.buffTime[buffIndex];
}
internal static void DrawEffects(PlayerDrawSet drawInfo)
+9 -5
View File
@@ -1,4 +1,5 @@
using CalamityMod.Particles;
using CalamityMod.DataStructures;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
@@ -9,12 +10,18 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public class VermillionFlux : ModBuff
{
public static DebuffData debuffData = new DebuffData(DebuffData.DebuffBehavior.Electric)
{
EnemyLostRegen = 100,
ElectricDebuffScaling = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
@@ -24,10 +31,7 @@ namespace CalamityMod.Buffs.DamageOverTime
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().vermillionFlux < npc.buffTime[buffIndex])
npc.Calamity().vermillionFlux = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().vermillionFlux = true;
}
internal static void DrawEffects(PlayerDrawSet drawInfo)
+9 -5
View File
@@ -1,4 +1,5 @@
using CalamityMod.Particles;
using CalamityMod.DataStructures;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
@@ -9,12 +10,18 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public class Voidfrost : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 200,
ColdDebuffScaling = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
@@ -24,10 +31,7 @@ namespace CalamityMod.Buffs.DamageOverTime
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().voidfrost < npc.buffTime[buffIndex])
npc.Calamity().voidfrost = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().voidfrost = true;
}
internal static void DrawEffects(PlayerDrawSet drawInfo, bool hasDebuffResistance = false)
+19 -19
View File
@@ -1,4 +1,5 @@
using CalamityMod.Dusts;
using CalamityMod.DataStructures;
using CalamityMod.Dusts;
using CalamityMod.NPCs;
using CalamityMod.Particles;
using CalamityMod.Systems.Collections;
@@ -12,11 +13,13 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public class VulnerabilityHex : ModBuff
{
// The visual number displayed in ticks as the enemy takes damage.
public const int TickNumber = 666;
// The exact amount Vulnerability Hex reduces NPC life regen by.
public const int DPS = TickNumber * 4; // -2664 life regen, 1332 DPS
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 2664, //4x tick size
HeatDebuffScaling = 1,
MinimumDamageTickSize = 666,
MultiplierDamageTickSize = 0
};
public const int CalamityDuration = 60;
public const int AflameDuration = 120;
@@ -28,6 +31,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.buffNoSave[Type] = true;
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex) => player.Calamity().vHex = true;
@@ -35,21 +39,17 @@ namespace CalamityMod.Buffs.DamageOverTime
public override void Update(NPC npc, ref int buffIndex)
{
CalamityGlobalNPC cgn = npc.Calamity();
if (cgn.vulnerabilityHex < npc.buffTime[buffIndex])
{
cgn.vulnerabilityHex = npc.buffTime[buffIndex];
// Set the remaining time of the fire drawer to be exactly right.
if (cgn.VulnerabilityHexFireDrawer != null)
cgn.VulnerabilityHexFireDrawer.SetLifetime = cgn.VulnerabilityHexFireDrawer.LocalTimer + cgn.vulnerabilityHex;
}
//If this isn't here the drawcode gives an index out of bounds
if (npc.buffTime[buffIndex] > 1)
cgn.vulnerabilityHex = true;
// Set the remaining time of the fire drawer to be exactly right.
if (cgn.VulnerabilityHexFireDrawer != null)
cgn.VulnerabilityHexFireDrawer.SetLifetime = cgn.VulnerabilityHexFireDrawer.LocalTimer + npc.buffTime[buffIndex];
// Apply immunity timer.
if ((EnemyImmunitiesList.Includes(npc.type) || npc.boss) && cgn.debuffResistanceTimer <= 0)
cgn.debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + cgn.vulnerabilityHex;
// Destroy the vanilla buff, we don't use it.
npc.DelBuff(buffIndex);
buffIndex--;
if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && cgn.debuffResistanceTimer <= 0)
cgn.debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + +npc.buffTime[buffIndex];
}
internal static void DrawEffects(PlayerDrawSet drawInfo)
{
+8 -1
View File
@@ -1,16 +1,23 @@
using Terraria;
using CalamityMod.DataStructures;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.DamageOverTime
{
public class WeakBrimstoneFlames : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 10, //This is never infliced on enemies, this is just a token value
HeatDebuffScaling = 1,
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
Main.buffNoTimeDisplay[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex) => player.Calamity().weakBrimstoneFlames = true;
+2 -5
View File
@@ -1,4 +1,5 @@
using CalamityMod.CalPlayer;
using CalamityMod.Items.Accessories.Vanity;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -18,11 +19,7 @@ namespace CalamityMod.Buffs
public override void Update(Player player, ref int buffIndex)
{
CalamityPlayer modPlayer = player.Calamity();
if (modPlayer.snowmanPrevious)
{
modPlayer.snowmanPower = true;
}
else
if (player.Transformation().Type != ModContent.ItemType<Popo>())
{
player.DelBuff(buffIndex);
buffIndex--;
+2 -4
View File
@@ -1,4 +1,5 @@
using CalamityMod.CalPlayer;
using CalamityMod.Items.Accessories.Vanity;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -17,11 +18,8 @@ namespace CalamityMod.Buffs
public override void Update(Player player, ref int buffIndex)
{
CalamityPlayer modPlayer = player.Calamity();
if (modPlayer.snowmanPrevious)
{
modPlayer.snowmanPower = true;
if (player.Transformation().Type == ModContent.ItemType<Popo>())
modPlayer.snowmanNoseless = true;
}
else
{
player.DelBuff(buffIndex);
Binary file not shown.

Before

Width:  |  Height:  |  Size: 531 B

After

Width:  |  Height:  |  Size: 573 B

-1
View File
@@ -26,7 +26,6 @@ namespace CalamityMod.Buffs.StatBuffs
player.maxFallSpeed = 9f;
player.gills = true;
}
modPlayer.abyssalDivingSuitPower = true;
modPlayer.depthCharm = true;
modPlayer.jellyfishNecklace = true;
modPlayer.anechoicPlating = true;
-1
View File
@@ -21,7 +21,6 @@ namespace CalamityMod.Buffs.StatBuffs
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().adrenalineModeActive = true;
player.Calamity().AdrenalineTrail = true;
}
public override void ModifyBuffText(ref string buffName, ref string tip, ref int rare)
+1 -2
View File
@@ -20,14 +20,13 @@ namespace CalamityMod.Buffs.StatBuffs
CalamityPlayer modPlayer = player.Calamity();
if (modPlayer.aquaticHeartPrevious)
{
modPlayer.aquaticHeartPower = true;
player.ignoreWater = NPC.downedBoss3;
player.accFlipper = true;
if (player.breath <= player.breathMax + 2 && !modPlayer.ZoneAbyss && NPC.downedBoss3)
{
player.breath = player.breathMax + 3;
}
if (Main.myPlayer == player.whoAmI && player.wet && NPC.downedBoss3)
if (Main.myPlayer == player.whoAmI && player.Calamity().countsAsAnyWet && NPC.downedBoss3)
{
player.AddBuff(ModContent.BuffType<AquaticHeartWaterSpeed>(), 360);
}
-24
View File
@@ -1,24 +0,0 @@
using Terraria;
using Terraria.Localization;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.StatBuffs
{
public class BrutalCarnage : ModBuff
{
public static float MeleeDamageBoost = 0.2f;
public override LocalizedText Description => base.Description.WithFormatArgs(MeleeDamageBoost.ToPercent());
public override void SetStaticDefaults()
{
Main.debuff[Type] = false;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
}
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().brutalCarnage = true;
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 625 B

+1 -1
View File
@@ -8,7 +8,7 @@ namespace CalamityMod.Buffs.StatBuffs
{
public class Mushy : ModBuff
{
public static int DefenseBoost = 8;
public static int DefenseBoost = 5;
public static int RegenBoost = 2;
public override LocalizedText Description => base.Description.WithFormatArgs(DefenseBoost, RegenBoost.ToRegenPerSecond());
+1 -2
View File
@@ -7,7 +7,7 @@ namespace CalamityMod.Buffs.StatBuffs
{
public class SpiritDefense : ModBuff
{
public override LocalizedText Description => base.Description.WithFormatArgs(SpiritGlyph.DefenseBoost, SpiritGlyph.DamageReductionBoost.ToPercent());
public override LocalizedText Description => base.Description.WithFormatArgs(SpiritGlyph.DefenseBoost);
public override void SetStaticDefaults()
{
@@ -20,7 +20,6 @@ namespace CalamityMod.Buffs.StatBuffs
public override void Update(Player player, ref int buffIndex)
{
player.statDefense += SpiritGlyph.DefenseBoost;
player.endurance += SpiritGlyph.DamageReductionBoost; // TODO -- is this applied too late to be affected by the DR softcap?
}
}
}
+11 -5
View File
@@ -1,4 +1,5 @@
using CalamityMod.Dusts;
using CalamityMod.DataStructures;
using CalamityMod.Dusts;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
@@ -8,19 +9,24 @@ namespace CalamityMod.Buffs.StatDebuffs
{
public class AbsorberAffliction : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 400,
SicknessDebuffScaling = 1,
MultiplierDamageTickSize = 1 / 20f
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().absorberAffliction < npc.buffTime[buffIndex])
npc.Calamity().absorberAffliction = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().absorberAffliction = true;
}
internal static void DrawEffects(NPC npc, ref Color drawColor)
+2 -5
View File
@@ -22,15 +22,12 @@ namespace CalamityMod.Buffs.StatDebuffs
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().aCrunch < npc.buffTime[buffIndex])
npc.Calamity().aCrunch = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().armorCrunch = true;
}
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().aCrunch = true;
player.Calamity().armorCrunch = true;
}
}
}
+1 -4
View File
@@ -22,10 +22,7 @@ namespace CalamityMod.Buffs.StatDebuffs
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().crumble < npc.buffTime[buffIndex])
npc.Calamity().crumble = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().crumble = true;
}
public override void Update(Player player, ref int buffIndex)
+3 -6
View File
@@ -25,12 +25,9 @@ namespace CalamityMod.Buffs.StatDebuffs
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().eutrophication < npc.buffTime[buffIndex])
npc.Calamity().eutrophication = npc.buffTime[buffIndex];
if ((EnemyImmunitiesList.Includes(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0)
npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().eutrophication;
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().eutrophication = true;
if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0)
npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex];
}
internal static void DrawEffects(PlayerDrawSet drawInfo)
+1 -1
View File
@@ -15,7 +15,7 @@ namespace CalamityMod.Buffs.StatDebuffs
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().iCantBreathe = true;
player.Calamity().frozenLungs = true;
}
}
}
+3 -6
View File
@@ -18,12 +18,9 @@ namespace CalamityMod.Buffs.StatDebuffs
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().tesla < npc.buffTime[buffIndex])
npc.Calamity().tesla = npc.buffTime[buffIndex];
if ((EnemyImmunitiesList.Includes(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0)
npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().tesla;
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().galvanicCorrosion = true;
if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0)
npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex];
}
public override void Update(Player player, ref int buffIndex)
+3 -24
View File
@@ -18,34 +18,13 @@ namespace CalamityMod.Buffs.StatDebuffs
BuffID.Sets.LongerExpertDebuff[Type] = true;
}
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().gState = true;
}
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().gState < npc.buffTime[buffIndex])
npc.Calamity().gState = npc.buffTime[buffIndex];
if ((EnemyImmunitiesList.Includes(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0)
npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().gState;
npc.Calamity().glacialState = true;
if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0)
npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
}
internal static void DrawEffects(PlayerDrawSet drawInfo)
{
Player Player = drawInfo.drawPlayer;
if (Main.rand.NextBool(4))
{
Dust d = Dust.NewDustDirect(Player.Center - 10 * Vector2.One, 20, 20, DustID.IcyMerman);
d.noGravity = Main.rand.NextBool();
d.noLight = false;
d.velocity *= 0.2f;
d.velocity.Y -= Main.rand.NextFloat(0.4f, 0.6f);
d.scale = Main.rand.NextFloat(0.4f, 0.7f);
}
}
}
}
+43 -5
View File
@@ -1,4 +1,6 @@
using Terraria;
using CalamityMod.DataStructures;
using CalamityMod.Projectiles.Magic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -6,6 +8,44 @@ namespace CalamityMod.Buffs.StatDebuffs
{
public class Irradiated : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 20, //Base irradiated DOT. This is changed with some application sources.
NPCLifeRegenMethod = IrradiatedNPCLifeRegen
};
public static void IrradiatedNPCLifeRegen(NPC npc, int buffType, ref int buffIndex, ref int damage)
{
var cnpc = npc.Calamity();
int projectileCount = 0;
foreach (Projectile p in Main.ActiveProjectiles)
{
if (p.type == ModContent.ProjectileType<WaterLeechProj>() &&
p.ai[0] == 1f && p.ai[1] == npc.whoAmI)
{
projectileCount++;
}
}
int baseIrradiatedDoTValue = (int)(cnpc.scionsCurioEffected ? (int)(debuffData.EnemyLostRegen * 1.5f) : debuffData.EnemyLostRegen);
if (cnpc.scionsCurioEffected)
{
for (int playerIndex = 0; playerIndex < Main.maxPlayers; playerIndex++)
{
Player player = Main.player[playerIndex];
if (player.active)
{
float playerRangedDamage = player.GetTotalDamage(DamageClass.Ranged).ApplyTo(baseIrradiatedDoTValue * (1 + player.GetTotalCritChance(DamageClass.Ranged) * 0.01f));
if (playerRangedDamage > baseIrradiatedDoTValue && player.Calamity().scionsCurio)
{
baseIrradiatedDoTValue = (int)playerRangedDamage;
}
}
}
}
if (projectileCount > 0)
cnpc.ApplyDPSDebuff(projectileCount * baseIrradiatedDoTValue, projectileCount * 4, ref npc.lifeRegen, ref damage);
else
cnpc.ApplyDPSDebuff(baseIrradiatedDoTValue, baseIrradiatedDoTValue / 20, ref npc.lifeRegen, ref damage);
}
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
@@ -13,6 +53,7 @@ namespace CalamityMod.Buffs.StatDebuffs
Main.buffNoSave[Type] = true;
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
@@ -22,10 +63,7 @@ namespace CalamityMod.Buffs.StatDebuffs
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().irradiated < npc.buffTime[buffIndex])
npc.Calamity().irradiated = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().irradiated = true;
}
}
}
+3 -5
View File
@@ -1,4 +1,5 @@
using Terraria;
using CalamityMod.DataStructures;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.StatDebuffs
@@ -16,10 +17,7 @@ namespace CalamityMod.Buffs.StatDebuffs
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().marked < npc.buffTime[buffIndex])
npc.Calamity().marked = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().markedForDeath = true;
}
}
}
+1 -4
View File
@@ -16,10 +16,7 @@ namespace CalamityMod.Buffs.StatDebuffs
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().pearlAura < npc.buffTime[buffIndex])
npc.Calamity().pearlAura = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().pearlAura = true;
}
internal static void DrawEffects(NPC npc, ref Color drawColor)
+1 -4
View File
@@ -16,10 +16,7 @@ namespace CalamityMod.Buffs.StatDebuffs
}
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().relicOfResilienceWeakness < npc.buffTime[buffIndex])
npc.Calamity().relicOfResilienceWeakness = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().relicOfResilienceWeakness = true;
}
internal static void DrawEffects(NPC npc, ref Color drawColor)
{
+3 -6
View File
@@ -16,12 +16,9 @@ namespace CalamityMod.Buffs.StatDebuffs
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().tSad < npc.buffTime[buffIndex])
npc.Calamity().tSad = npc.buffTime[buffIndex];
if ((EnemyImmunitiesList.Includes(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0)
npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().tSad;
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().temporalSadness = true;
if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0)
npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex];
}
}
}
+3 -6
View File
@@ -18,12 +18,9 @@ namespace CalamityMod.Buffs.StatDebuffs
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().timeSlow < npc.buffTime[buffIndex])
npc.Calamity().timeSlow = npc.buffTime[buffIndex];
if ((EnemyImmunitiesList.Includes(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0)
npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().timeSlow;
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().timeDistortion = true;
if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0)
npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex];
}
}
}
+2 -5
View File
@@ -16,15 +16,12 @@ namespace CalamityMod.Buffs.StatDebuffs
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().wDeath = true;
player.Calamity().whisperingDeath = true;
}
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().wDeath < npc.buffTime[buffIndex])
npc.Calamity().wDeath = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().whisperingDeath = true;
}
}
}
+1 -4
View File
@@ -20,10 +20,7 @@ namespace CalamityMod.Buffs.StatDebuffs
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().wither < npc.buffTime[buffIndex])
npc.Calamity().wither = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
npc.Calamity().wither = true;
}
public override void Update(Player player, ref int buffIndex)
@@ -1,12 +1,12 @@
using CalamityMod.Projectiles.Summon;
using CalamityMod.Projectiles.Summon;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Summon
{
public class BrimstoneWaifu : BaseSummonBuff
public class BrimstoneElemental : BaseSummonBuff
{
protected override int MinionProjectileType => ModContent.ProjectileType<BrimstoneElementalMinion>();
protected override ref bool MinionBool => ref BuffModdedOwner.bWaifu;
protected override ref bool MinionBool => ref BuffModdedOwner.brimEleBuff;
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 467 B

After

Width:  |  Height:  |  Size: 467 B

@@ -3,10 +3,10 @@ using Terraria.ModLoader;
namespace CalamityMod.Buffs.Summon
{
public class CloudyWaifu : BaseSummonBuff
public class CloudElemental : BaseSummonBuff
{
protected override int MinionProjectileType => ModContent.ProjectileType<CloudElementalMinion>();
protected override ref bool MinionBool => ref BuffModdedOwner.cWaifu;
protected override ref bool MinionBool => ref BuffModdedOwner.cloudEleBuff;
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 488 B

After

Width:  |  Height:  |  Size: 488 B

+1 -1
View File
@@ -16,7 +16,7 @@ namespace CalamityMod.Buffs.Summon
{
CalamityPlayer modPlayer = player.Calamity();
if (!modPlayer.allWaifus)
if (!modPlayer.allElementals)
{
player.DelBuff(buffIndex);
buffIndex--;
@@ -3,10 +3,10 @@ using Terraria.ModLoader;
namespace CalamityMod.Buffs.Summon
{
public class SandyHealingWaifu : BaseSummonBuff
public class RareSandElemental : BaseSummonBuff
{
protected override int MinionProjectileType => ModContent.ProjectileType<SandElementalHealer>();
protected override ref bool MinionBool => ref BuffModdedOwner.dWaifu;
protected override ref bool MinionBool => ref BuffModdedOwner.rareSandEleBuff;
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 601 B

After

Width:  |  Height:  |  Size: 601 B

@@ -3,10 +3,10 @@ using Terraria.ModLoader;
namespace CalamityMod.Buffs.Summon
{
public class SandyWaifu : BaseSummonBuff
public class SandElemental : BaseSummonBuff
{
protected override int MinionProjectileType => ModContent.ProjectileType<SandElementalMinion>();
protected override ref bool MinionBool => ref BuffModdedOwner.sWaifu;
protected override ref bool MinionBool => ref BuffModdedOwner.sandEleBuff;
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 642 B

After

Width:  |  Height:  |  Size: 642 B

+1 -1
View File
@@ -1,4 +1,4 @@
using CalamityMod.Projectiles.Summon;
using CalamityMod.Projectiles.Typeless;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Summon
@@ -3,10 +3,10 @@ using Terraria.ModLoader;
namespace CalamityMod.Buffs.Summon
{
public class WaterWaifu : BaseSummonBuff
public class WaterElemental : BaseSummonBuff
{
protected override int MinionProjectileType => ModContent.ProjectileType<WaterElementalMinion>();
protected override ref bool MinionBool => ref BuffModdedOwner.slWaifu;
protected override ref bool MinionBool => ref BuffModdedOwner.waterEleBuff;
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 636 B

After

Width:  |  Height:  |  Size: 636 B

File diff suppressed because it is too large. Load diff
+18 -65
View File
@@ -8,6 +8,7 @@ using CalamityMod.Dusts;
using CalamityMod.Items.Weapons.Magic;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Typeless;
using CalamityMod.Systems.Collections;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
@@ -35,7 +36,14 @@ namespace CalamityMod.CalPlayer
PlayerDrawLayers.Shoes.Hide();
}
if (drawInfo.drawPlayer.Calamity().andromedaState != AndromedaPlayerState.Inactive)
if (drawInfo.drawPlayer.ownedProjectileCounts[ModContent.ProjectileType<VictideSpirit>()] > 0)
{
foreach (var layer in PlayerDrawLayerLoader.Layers)
{
layer.Hide();
}
}
else if (drawInfo.drawPlayer.Calamity().andromedaState != AndromedaPlayerState.Inactive)
{
foreach (var layer in PlayerDrawLayerLoader.Layers)
{
@@ -199,10 +207,10 @@ namespace CalamityMod.CalPlayer
if (calamityPlayer.auricRebuke && drawInfo.shadow == 0f)
AuricRebuke.DrawEffects(drawInfo);
if (calamityPlayer.bBlood && drawInfo.shadow == 0f)
if (calamityPlayer.burningBlood && drawInfo.shadow == 0f)
BurningBlood.DrawEffects(drawInfo);
if (calamityPlayer.bFlames && drawInfo.shadow == 0f)
if (calamityPlayer.brimstoneFlames && drawInfo.shadow == 0f)
{
bool resistsBrimstoneFlames = abaddon; // Looks weaker if you have Abaddon equipped
BrimstoneFlames.DrawEffects(drawInfo, resistsBrimstoneFlames);
@@ -211,7 +219,7 @@ namespace CalamityMod.CalPlayer
if (calamityPlayer.brainRot && drawInfo.shadow == 0f)
BrainRot.DrawEffects(drawInfo);
if (calamityPlayer.cDepth && drawInfo.shadow == 0f)
if (calamityPlayer.crushDepth && drawInfo.shadow == 0f)
CrushDepth.DrawEffects(drawInfo);
// Daybroken's visual effects are reduced if the player resists it
@@ -230,26 +238,17 @@ namespace CalamityMod.CalPlayer
if (calamityPlayer.eutrophication && drawInfo.shadow == 0f)
Eutrophication.DrawEffects(drawInfo);
if (calamityPlayer.gState && drawInfo.shadow == 0f)
{
// These lines cannot be moved to Glacial State's own file
r *= 0.13f;
g *= 0.66f;
GlacialState.DrawEffects(drawInfo);
}
if (calamityPlayer.gsInferno && drawInfo.shadow == 0f)
if (calamityPlayer.godSlayerInferno && drawInfo.shadow == 0f)
GodSlayerInferno.DrawEffects(drawInfo);
if (calamityPlayer.heavybleeding && drawInfo.shadow == 0f)
HeavyBleeding.DrawEffects(drawInfo);
// Holy Flames, Holy Inferno and Banishing Fire share the same visual effects
if (drawInfo.shadow == 0f && (calamityPlayer.hFlames || calamityPlayer.hInferno || calamityPlayer.banishingFire))
if (drawInfo.shadow == 0f && (calamityPlayer.holyFlames || calamityPlayer.holyInferno || calamityPlayer.banishingFire))
HolyFlames.DrawEffects(drawInfo);
if (calamityPlayer.hPressure && drawInfo.shadow == 0f)
if (calamityPlayer.hadopelagicPressure && drawInfo.shadow == 0f)
HadopelagicPressure.DrawEffects(drawInfo);
// Icarus' Folly has visual effects but they are mutually exclusive with all Holy Flames variations to prevent visual clutter
@@ -269,10 +268,10 @@ namespace CalamityMod.CalPlayer
if (calamityPlayer.nightwither && drawInfo.shadow == 0f) // Looks weaker if you have Moon Stone equipped
Nightwither.DrawEffects(drawInfo, reducedNightwitherDamage);
if (calamityPlayer.pFlames && drawInfo.shadow == 0f)
if (calamityPlayer.plague && drawInfo.shadow == 0f)
Plague.DrawEffects(drawInfo);
if (calamityPlayer.rTide && drawInfo.shadow == 0f)
if (calamityPlayer.riptide && drawInfo.shadow == 0f)
RiptideDebuff.DrawEffects(drawInfo);
if (calamityPlayer.shadowflame && drawInfo.shadow == 0f)
@@ -328,7 +327,7 @@ namespace CalamityMod.CalPlayer
GeneralParticleHandler.SpawnParticle(Plus);
}
}
if (calamityPlayer.bloomStoneDR > 0 && drawInfo.shadow == 0f)
if (calamityPlayer.bloomStoneBuffedHealRateTimer > 0 && drawInfo.shadow == 0f)
{
if (Main.rand.NextBool(10))
{
@@ -451,52 +450,6 @@ namespace CalamityMod.CalPlayer
Player drawPlayer = drawInfo.drawPlayer;
Item item = drawPlayer.ActiveItem();
// Vanity accessory effects, allows them to draw while the game is paused
if (drawPlayer.Calamity().ghostBracelet)
{
drawPlayer.legs = EquipLoader.GetEquipSlot(Mod, "GhostBracelet", EquipType.Legs);
drawPlayer.body = EquipLoader.GetEquipSlot(Mod, "GhostBracelet", EquipType.Body);
drawPlayer.head = EquipLoader.GetEquipSlot(Mod, "GhostBracelet", EquipType.Head);
}
else if ((drawPlayer.Calamity().snowmanPower || drawPlayer.Calamity().snowmanForce) && !drawPlayer.Calamity().snowmanHide)
{
drawPlayer.legs = EquipLoader.GetEquipSlot(Mod, "Popo", EquipType.Legs);
drawPlayer.body = EquipLoader.GetEquipSlot(Mod, "Popo", EquipType.Body);
drawPlayer.head = EquipLoader.GetEquipSlot(Mod, snowmanNoseless ? "PopoNoseless" : "Popo", EquipType.Head);
drawPlayer.face = -1;
}
else if (drawPlayer.Calamity().punchCard)
{
drawPlayer.legs = EquipLoader.GetEquipSlot(Mod, "PunchCard", EquipType.Legs);
drawPlayer.body = EquipLoader.GetEquipSlot(Mod, "PunchCard", EquipType.Body);
drawPlayer.head = EquipLoader.GetEquipSlot(Mod, "PunchCard", EquipType.Head);
}
else if ((drawPlayer.Calamity().abyssalDivingSuitPower || drawPlayer.Calamity().abyssalDivingSuitForce) && !drawPlayer.Calamity().abyssalDivingSuitHide)
{
drawPlayer.legs = EquipLoader.GetEquipSlot(Mod, "AbyssalDivingSuit", EquipType.Legs);
drawPlayer.body = EquipLoader.GetEquipSlot(Mod, "AbyssalDivingSuit", EquipType.Body);
drawPlayer.head = EquipLoader.GetEquipSlot(Mod, "AbyssalDivingSuit", EquipType.Head);
drawPlayer.face = -1;
}
else if ((drawPlayer.Calamity().aquaticHeartPower || drawPlayer.Calamity().aquaticHeartForce) && !drawPlayer.Calamity().aquaticHeartHide)
{
drawPlayer.legs = EquipLoader.GetEquipSlot(Mod, "AquaticHeart", EquipType.Legs);
drawPlayer.body = EquipLoader.GetEquipSlot(Mod, "AquaticHeart", EquipType.Body);
drawPlayer.head = EquipLoader.GetEquipSlot(Mod, "AquaticHeart", EquipType.Head);
drawPlayer.face = -1;
}
// Need to set all of these so that certain vanity pieces like Capricorn Tail don't screw it up
if (drawPlayer.Calamity().ghostBracelet || ((drawPlayer.Calamity().snowmanPower || drawPlayer.Calamity().snowmanForce) && !drawPlayer.Calamity().snowmanHide) ||
drawPlayer.Calamity().punchCard || ((drawPlayer.Calamity().abyssalDivingSuitPower || drawPlayer.Calamity().abyssalDivingSuitForce) && !drawPlayer.Calamity().abyssalDivingSuitHide) ||
((drawPlayer.Calamity().aquaticHeartPower || drawPlayer.Calamity().aquaticHeartForce) && !drawPlayer.Calamity().aquaticHeartHide))
{
drawInfo.legsGlowMask = -1;
drawInfo.legsOffset = Vector2.Zero;
drawInfo.bodyGlowMask = -1;
drawInfo.headGlowMask = -1;
drawInfo.helmetOffset = Vector2.Zero;
}
if (!drawPlayer.frozen &&
(item.IsAir || item.type > ItemID.None) &&
!drawPlayer.dead &&
+3 -1
View File
@@ -169,6 +169,8 @@ namespace CalamityMod.CalPlayer
if (canSulphurFish && bait == ModContent.ItemType<BloodwormItem>() && !BossRushEvent.BossRushActive)
{
CalamityGlobalNPC.OldDukeSpawn(Player.whoAmI, ModContent.NPCType<OldDuke>(), bait);
itemDrop = -1;
return;
}
// Ignore catches if it's junk
@@ -370,7 +372,7 @@ namespace CalamityMod.CalPlayer
if (ZoneAbyss || ZoneSulphur)
canSulphurFish = true;
Item item = Player.ActiveItem();
Item item = Player.HeldItem;
if (!canSulphurFish || item.fishingPole <= 0 || item.holdStyle != 1)
fishingLevel = -1;
+117 -179
View File
@@ -17,6 +17,8 @@ using CalamityMod.Items.Armor.Aerospec;
using CalamityMod.Items.Armor.Demonshade;
using CalamityMod.Items.Armor.LunicCorps;
using CalamityMod.Items.Armor.Silva;
using CalamityMod.Items.Armor.Sulphurous;
using CalamityMod.Items.Armor.Victide;
using CalamityMod.Items.Armor.Wulfrum;
using CalamityMod.Items.Mounts;
using CalamityMod.Items.Placeables.Furniture;
@@ -31,6 +33,7 @@ using CalamityMod.NPCs.Other;
using CalamityMod.NPCs.ProfanedGuardians;
using CalamityMod.NPCs.Providence;
using CalamityMod.NPCs.SupremeCalamitas;
using CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Melee;
using CalamityMod.Projectiles.Ranged;
@@ -244,7 +247,7 @@ namespace CalamityMod.CalPlayer
Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType<XykDeathAnim>(), Main.zenithWorld ? Main.rand.Next(5000, 50000 + 1) : 0, 0, Player.whoAmI);
}
if (hInferno)
if (holyInferno)
{
foreach (NPC n in Main.ActiveNPCs)
{
@@ -292,10 +295,10 @@ namespace CalamityMod.CalPlayer
if (silvaSet && silvaCountdown > 0)
{
if (silvaCountdown == silvaReviveDuration && !hasSilvaEffect)
if (silvaCountdown == SilvaReviveDuration && !hasSilvaEffect)
{
SoundEngine.PlaySound(SilvaHeadSummon.ActivationSound, Player.Center);
Player.AddBuff(ModContent.BuffType<SilvaRevival>(), silvaReviveDuration);
Player.AddBuff(ModContent.BuffType<SilvaRevival>(), SilvaReviveDuration);
}
hasSilvaEffect = true;
@@ -377,7 +380,7 @@ namespace CalamityMod.CalPlayer
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.SearingLava" + Main.rand.Next(1, 2 + 1)).ToNetworkText(Player.name));
}
if (gsInferno)
if (godSlayerInferno)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.GodSlayerInferno" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
}
@@ -408,11 +411,11 @@ namespace CalamityMod.CalPlayer
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.MiracleBlight" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
}
if (hInferno)
if (holyInferno)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.HolyInferno").ToNetworkText(Player.name));
}
if (hFlames || banishingFire)
if (holyFlames || banishingFire)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.HolyFlames" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
}
@@ -424,7 +427,7 @@ namespace CalamityMod.CalPlayer
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Daybroken").ToNetworkText(Player.name));
}
if (bBlood)
if (burningBlood)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.BurningBlood" + Main.rand.Next(1, 2 + 1)).ToNetworkText(Player.name));
}
@@ -444,23 +447,23 @@ namespace CalamityMod.CalPlayer
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.ElementalMix" + Main.rand.Next(1, 2 + 1)).ToNetworkText(Player.name));
}
if (cDepth)
if (crushDepth)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.CrushDepth" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
}
if (rTide)
if (riptide)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Riptide" + Main.rand.Next(1, 2 + 1)).ToNetworkText(Player.name));
}
if (hPressure)
if (hadopelagicPressure)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.HadopelagicPressure" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
}
if (bFlames || weakBrimstoneFlames || demonicFlames)
if (brimstoneFlames || weakBrimstoneFlames || demonicFlames)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.BrimstoneFlames" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
}
if (pFlames)
if (plague)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Plague" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
}
@@ -485,7 +488,7 @@ namespace CalamityMod.CalPlayer
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Withered").ToNetworkText(Player.name));
}
}
if (profanedCrystalBuffs && !profanedCrystalHide)
if (profanedCrystalBuffs && Player.Transformation().Type == ModContent.ItemType<ProfanedSoulCrystal>())
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.ProfanedSoulCrystal").ToNetworkText(Player.name));
}
@@ -635,11 +638,6 @@ namespace CalamityMod.CalPlayer
modifiers.ScalingBonusDamage += Screwdriver.PiercingDamageBuff;
}
// Calamity buffs Inferno Fork by 20%. This is multiplicative because it's supposed to be a buff to the weapon's base damage.
// However, because the weapon is coded like spaghetti, you have to multiply the explosion's damage too.
if (proj.type == ProjectileID.InfernoFriendlyBlast)
modifiers.SourceDamage *= 1.2f;
if (Player.Calamity().scionsCurio && proj.CountsAsClass<RangedDamageClass>())
target.Calamity().scionsCurioEffected = true;
@@ -708,7 +706,7 @@ namespace CalamityMod.CalPlayer
{
Item heldItem = Player.ActiveItem();
if (CalamityUtils.ShouldTriggerSummonPenalty(Player, heldItem) && !DisabledSummonerNerfMinionList.Includes(proj.type))
if (CalamityUtils.ShouldTriggerSummonPenalty(Player, heldItem) && !CalamityProjectileSets.MinionWhichIgnoresSummonerNerf[proj.type])
modifiers.FinalDamage *= BalancingConstants.SummonerCrossClassNerf;
}
}
@@ -723,7 +721,7 @@ namespace CalamityMod.CalPlayer
// Enemies deal less contact damage while sick, due to being weakened.
if (npc.poisoned)
{
float damageReductionFromPoison = (float)((npc.Calamity().irradiated > 0 ? npc.Calamity().irradiatedContactBoost : 1) * 0.05f);
float damageReductionFromPoison = (float)((npc.Calamity().irradiated ? npc.Calamity().irradiatedContactBoost : 1) * 0.05f);
if (npc.Calamity().VulnerableToSickness.HasValue)
{
if (npc.Calamity().VulnerableToSickness.Value)
@@ -738,7 +736,7 @@ namespace CalamityMod.CalPlayer
if (npc.venom)
{
float damageReductionFromVenom = (float)((npc.Calamity().irradiated > 0 ? npc.Calamity().irradiatedContactBoost : 1) * 0.05f);
float damageReductionFromVenom = (float)((npc.Calamity().irradiated ? npc.Calamity().irradiatedContactBoost : 1) * 0.05f);
if (npc.Calamity().VulnerableToSickness.HasValue)
{
if (npc.Calamity().VulnerableToSickness.Value)
@@ -751,9 +749,9 @@ namespace CalamityMod.CalPlayer
modifiers.SourceDamage *= damageReductionFromVenom;
}
if (npc.Calamity().astralInfection > 0)
if (npc.Calamity().astralInfection)
{
float damageReductionFromAstralInfection = (float)((npc.Calamity().irradiated > 0 ? npc.Calamity().irradiatedContactBoost : 1) * 0.05f);
float damageReductionFromAstralInfection = (float)((npc.Calamity().irradiated ? npc.Calamity().irradiatedContactBoost : 1) * 0.05f);
if (npc.Calamity().VulnerableToSickness.HasValue)
{
if (npc.Calamity().VulnerableToSickness.Value)
@@ -766,9 +764,9 @@ namespace CalamityMod.CalPlayer
modifiers.SourceDamage *= damageReductionFromAstralInfection;
}
if (npc.Calamity().pFlames > 0)
if (npc.Calamity().plague)
{
float damageReductionFromPlague = (float)((npc.Calamity().irradiated > 0 ? npc.Calamity().irradiatedContactBoost : 1) * 0.05f);
float damageReductionFromPlague = (float)((npc.Calamity().irradiated? npc.Calamity().irradiatedContactBoost : 1) * 0.05f);
if (npc.Calamity().VulnerableToSickness.HasValue)
{
if (npc.Calamity().VulnerableToSickness.Value)
@@ -781,9 +779,9 @@ namespace CalamityMod.CalPlayer
modifiers.SourceDamage *= damageReductionFromPlague;
}
if (npc.Calamity().wDeath > 0)
if (npc.Calamity().whisperingDeath)
{
float damageReductionFromWhisperingDeath = (float)((npc.Calamity().irradiated > 0 ? npc.Calamity().irradiatedContactBoost : 1) * 0.1f);
float damageReductionFromWhisperingDeath = (float)((npc.Calamity().irradiated ? npc.Calamity().irradiatedContactBoost : 1) * 0.1f);
if (npc.Calamity().VulnerableToSickness.HasValue)
{
if (npc.Calamity().VulnerableToSickness.Value)
@@ -814,7 +812,7 @@ namespace CalamityMod.CalPlayer
if (bloodflareMelee && bloodflareFrenzy && !Player.HasCooldown(BloodflareFrenzy.ID))
contactDamageReduction += 0.5;
if (npc.Calamity().tSad > 0)
if (npc.Calamity().temporalSadness)
contactDamageReduction += 0.5;
if (eskimoSet)
@@ -879,13 +877,13 @@ namespace CalamityMod.CalPlayer
// 10% is converted to 9%, 25% is converted to 20%, 50% is converted to 33%, 75% is converted to 43%, 100% is converted to 50%
if (contactDamageReduction > 0D)
{
if (aCrunch)
if (armorCrunch)
contactDamageReduction *= (double)ArmorCrunch.MultiplicativeDamageReductionPlayer;
if (crumble)
contactDamageReduction *= (double)Crumbling.MultiplicativeDamageReductionPlayer;
// Contact damage reduction is reduced by DR Damage, which itself is proportional to defense damage
// In GFB, as defense damage is uncapped, DR damage is also uncapped.
// In FTW, as defense damage is uncapped, DR damage is also uncapped.
int currentDefense = Player.GetCurrentDefense(false);
if (totalDefenseDamage > 0 && currentDefense > 0)
{
@@ -918,7 +916,7 @@ namespace CalamityMod.CalPlayer
#region Modify Hit By Proj
public override void ModifyHitByProjectile(Projectile proj, ref Player.HurtModifiers modifiers)
{
if (!ProjectileDestroyExceptionsList.Includes(proj.type) && proj.active && !proj.friendly && proj.hostile && proj.damage > 0)
if (!CalamityProjectileSets.ShouldNotBeReflected[proj.type] && proj.active && !proj.friendly && proj.hostile && proj.damage > 0 && !modifiers.PvP)
{
double dodgeDamageGateValuePercent = 0.05;
int dodgeDamageGateValue = (int)Math.Round(Player.statLifeMax2 * dodgeDamageGateValuePercent);
@@ -987,30 +985,23 @@ namespace CalamityMod.CalPlayer
// Reduce damage from vanilla traps
// Explosives
// 350 in normal, 450 in expert
// 350 damage
if (proj.type == ProjectileID.Explosives)
modifiers.SourceDamage *= (Main.expertMode ? 0.225f : 0.35f);
modifiers.SourceDamage *= 0.7f;
// Rolling Cacti
// 45 in normal, 65 in expert for cactus
// 30 in normal, 36 in expert for spikes
// 42 in normal, 84 in expert for cactus
// 36 in normal, 72 in expert for spikes
else if (proj.type == ProjectileID.RollingCactus || proj.type == ProjectileID.RollingCactusSpike)
modifiers.SourceDamage *= (Main.expertMode ? 0.3f : 0.5f);
modifiers.SourceDamage *= 0.6f;
// Normal Boulders and Temple traps
if (Main.expertMode)
// Boulders
if (Main.expertMode && !areThereAnyDamnBosses)
{
// 140 in normal, 182 in expert, 273 in master
if (proj.type == ProjectileID.Boulder || proj.type == ProjectileID.MiniBoulder)
modifiers.SourceDamage *= 0.65f;
// 80 in normal, 100 in expert, 150 in master
else if (proj.type == ProjectileID.SpikyBallTrap || proj.type == ProjectileID.FlamethrowerTrap || proj.type == ProjectileID.FlamesTrap || proj.type == ProjectileID.PoisonDartTrap)
modifiers.SourceDamage *= 0.625f;
// 120 in normal, 144 in expert, 216 in master
else if (proj.type == ProjectileID.SpearTrap)
modifiers.SourceDamage *= 0.6f;
// 140 in normal, 210 in expert, 315 in master for boulder
// 104 in normal, 156 in expert, 234 in master for mini boulder
if (proj.type == ProjectileID.Boulder || proj.type == ProjectileID.MiniBoulder || proj.type == ProjectileID.BouncyBoulder || proj.type == ProjectileID.LifeCrystalBoulder)
modifiers.SourceDamage *= 0.75f;
}
bool isFallingBlock = (proj.type == ProjectileID.SandBallFalling) || (proj.type == ProjectileID.SiltBall) || (proj.type == ProjectileID.AshBallFalling) ||
@@ -1027,7 +1018,7 @@ namespace CalamityMod.CalPlayer
if (Player.Calamity().trapProtection && isReducedTrap)
modifiers.SourceDamage *= 0.35f;
// Reduce damage dealt by rainbow trails depending on how faded they are.
// Reduce damage dealt by rainbow trails
if (proj.type == ProjectileID.HallowBossLastingRainbow)
{
// Find the oldPos of the projectile that is intersecting the player hitbox.
@@ -1042,11 +1033,10 @@ namespace CalamityMod.CalPlayer
hitbox.X = (int)trailHitbox.X;
hitbox.Y = (int)trailHitbox.Y;
// Adjust damage based on what part of the trail intersected the player hitbox.
if (hitbox.Intersects(Player.Hitbox))
{
if (k > startOfDamageFalloff)
modifiers.SourceDamage *= MathHelper.Lerp(0.4f, 1f, 1f - (k - startOfDamageFalloff) / (float)(trailLength - startOfDamageFalloff));
modifiers.SourceDamage *= EmpressofLightAI.EverlastingRainbowTrailDamageMult;
break;
}
@@ -1065,7 +1055,7 @@ namespace CalamityMod.CalPlayer
projectileDamageReduction += 0.25;
}
if (!ProjectileDestroyExceptionsList.Includes(proj.type) && proj.active && !proj.friendly && proj.hostile && proj.damage > 0)
if (!CalamityProjectileSets.ShouldNotBeReflected[proj.type] && proj.active && !proj.friendly && proj.hostile && proj.damage > 0 && !modifiers.PvP)
{
// Daedalus Reflect counts as a reflect but doesn't actually stop you from taking damage
if (daedalusReflect && !disableAllDodges && !evolution && !Player.HasCooldown(GlobalDodge.ID))
@@ -1146,7 +1136,7 @@ namespace CalamityMod.CalPlayer
// 10% is converted to 9%, 25% is converted to 20%, 50% is converted to 33%, 75% is converted to 43%, 100% is converted to 50%
if (projectileDamageReduction > 0D)
{
if (aCrunch)
if (armorCrunch)
projectileDamageReduction *= (double)ArmorCrunch.MultiplicativeDamageReductionPlayer;
if (crumble)
projectileDamageReduction *= (double)Crumbling.MultiplicativeDamageReductionPlayer;
@@ -1312,7 +1302,7 @@ namespace CalamityMod.CalPlayer
if (Main.npc[proj.Calamity().ParentNPCIndex].active)
{
if (sulphurSet)
Main.npc[proj.Calamity().ParentNPCIndex].AddBuff(BuffID.Poisoned, 60);
Main.npc[proj.Calamity().ParentNPCIndex].AddBuff(BuffID.Poisoned, SulphurousHelmet.SetBonusPoisonDuration);
if (ilSpark)
Main.npc[proj.Calamity().ParentNPCIndex].Calamity().shocked = 120;
}
@@ -1375,90 +1365,10 @@ namespace CalamityMod.CalPlayer
{
Player.AddBuff(BuffID.BrokenArmor, 600);
}
else if (proj.type == ProjectileID.DeathLaser || proj.type == ProjectileID.RocketSkeleton || proj.type == ProjectileID.BombSkeletronPrime)
{
Player.AddBuff(BuffID.OnFire, 180);
}
else if (proj.type == ProjectileID.Skull)
{
Player.AddBuff(BuffID.Weak, 180);
}
else if (proj.type == ProjectileID.CursedFlameHostile || proj.type == ProjectileID.EyeFire)
{
// Guaranteed Cursed Inferno for 1 second (vanilla also has a 68.75% chance of Cursed Inferno for 2 to 3 seconds)
Player.AddBuff(BuffID.CursedInferno, 60);
}
else if (proj.type == ProjectileID.DesertDjinnCurse)
{
Player.AddBuff(BuffID.Cursed, 180);
}
else if (proj.type == ProjectileID.Stinger || proj.type == ProjectileID.QueenBeeStinger)
{
// 66.6% chance of Poison for 5 seconds, 2 guaranteed seconds of Poison otherwise (vanilla also has a 33.3% chance of Poison for 10 seconds)
if (Main.rand.Next(3) > 0)
Player.AddBuff(BuffID.Poisoned, 300);
else
Player.AddBuff(BuffID.Poisoned, 120);
}
else if (proj.type == ProjectileID.PoisonSeedPlantera)
{
// 75% chance of Poison for 3 to 5 seconds, guaranteed Poison for 2 seconds (vanilla also has a 50% chance of Poison for 3 to 7 seconds)
if (Main.rand.Next(4) > 0)
Player.AddBuff(BuffID.Poisoned, Main.rand.Next(180, 301));
else
Player.AddBuff(BuffID.Poisoned, 120);
}
else if (proj.type == ProjectileID.ThornBall)
{
Player.AddBuff(BuffID.Poisoned, 420);
}
else if (proj.type == ProjectileID.CultistBossFireBall)
{
Player.AddBuff(ModContent.BuffType<Daybroken>(), 180);
}
else if (proj.type == ProjectileID.CultistBossIceMist)
{
if (!Player.frozen)
Player.AddBuff(BuffID.Frozen, 60);
Player.AddBuff(BuffID.Chilled, 180);
}
else if (proj.type == ProjectileID.CultistBossLightningOrbArc)
{
Player.AddBuff(BuffID.Electrified, 180);
}
else if (proj.type == ProjectileID.AncientDoomProjectile)
{
Player.AddBuff(ModContent.BuffType<Shadowflame>(), 120);
}
else if (proj.type == ProjectileID.CultistBossFireBallClone)
{
Player.AddBuff(ModContent.BuffType<Shadowflame>(), 180);
}
else if (proj.type == ProjectileID.PhantasmalBolt || proj.type == ProjectileID.PhantasmalEye)
{
Player.AddBuff(ModContent.BuffType<Nightwither>(), 120);
}
else if (proj.type == ProjectileID.PhantasmalSphere)
{
Player.AddBuff(ModContent.BuffType<Nightwither>(), 210);
}
else if (proj.type == ProjectileID.PhantasmalDeathray)
{
Player.AddBuff(ModContent.BuffType<Nightwither>(), 300);
}
else if ((proj.type == ProjectileID.FairyQueenLance || proj.type == ProjectileID.HallowBossRainbowStreak || proj.type == ProjectileID.HallowBossSplitShotCore) && NPC.ShouldEmpressBeEnraged())
{
Player.AddBuff(ModContent.BuffType<Daybroken>(), 120);
}
else if (proj.type == ProjectileID.HallowBossLastingRainbow && NPC.ShouldEmpressBeEnraged())
{
Player.AddBuff(ModContent.BuffType<Daybroken>(), 210);
}
else if (proj.type == ProjectileID.FairyQueenSunDance && NPC.ShouldEmpressBeEnraged())
{
Player.AddBuff(ModContent.BuffType<Daybroken>(), 300);
}
else if (proj.type == ProjectileID.BloodNautilusShot)
{
Player.AddBuff(ModContent.BuffType<BurningBlood>(), 240);
@@ -1471,10 +1381,51 @@ namespace CalamityMod.CalPlayer
{
Player.AddBuff(ModContent.BuffType<MiracleBlight>(), 600);
}
if (CalamityWorld.revenge)
{
if (proj.type == ProjectileID.CursedFlameHostile || proj.type == ProjectileID.EyeFire)
{
// Guaranteed Cursed Inferno for 1 second (vanilla also has a 68.75% chance of Cursed Inferno for 2 to 3 seconds)
Player.AddBuff(BuffID.CursedInferno, 60);
}
else if (proj.type == ProjectileID.ThornBall)
{
Player.AddBuff(BuffID.Venom, 120);
}
else if (proj.type == ProjectileID.CultistBossFireBall)
{
Player.AddBuff(ModContent.BuffType<Daybroken>(), 180);
}
else if (proj.type == ProjectileID.CultistBossIceMist && proj.ai[1] == 1f) // Main ice mists only; no shards
{
Player.AddBuff(BuffID.Chilled, 180);
}
else if (proj.type == ProjectileID.CultistBossLightningOrbArc)
{
Player.AddBuff(BuffID.Electrified, 180);
}
else if (proj.type == ProjectileID.CultistBossFireBallClone)
{
Player.AddBuff(ModContent.BuffType<Shadowflame>(), 240);
}
else if (proj.type == ProjectileID.PhantasmalBolt || proj.type == ProjectileID.PhantasmalEye)
{
Player.AddBuff(ModContent.BuffType<Nightwither>(), 120);
}
else if (proj.type == ProjectileID.PhantasmalSphere)
{
Player.AddBuff(ModContent.BuffType<Nightwither>(), 180);
}
else if (proj.type == ProjectileID.PhantasmalDeathray)
{
Player.AddBuff(ModContent.BuffType<Nightwither>(), 240);
}
}
}
// As these reflects do not cancel damage, they need to be in OnHit rather than ModifyHit
if (!ProjectileDestroyExceptionsList.Includes(proj.type) && proj.active && !proj.friendly && proj.hostile && hurtInfo.Damage > 0)
if (!CalamityProjectileSets.ShouldNotBeReflected[proj.type] && proj.active && !proj.friendly && proj.hostile && hurtInfo.Damage > 0 && !hurtInfo.PvP)
{
double dodgeDamageGateValuePercent = 0.05;
int dodgeDamageGateValue = (int)Math.Round(Player.statLifeMax2 * dodgeDamageGateValuePercent);
@@ -1750,11 +1701,17 @@ namespace CalamityMod.CalPlayer
// Handles energy shields and Boss Rush, in that order
modifiers.ModifyHurtInfo += ModifyHurtInfo_Calamity;
// TODO -- At some point it'd be nice to have a "TransformationPlayer" that has all the transformation sfx and visuals so their priorities can be more easily managed.
#region Custom Hurt Sounds
if (hurtSoundTimer == 0)
{
if (roverDrive && RoverDriveShieldDurability > 0)
if(Player.Transformation().Type != -1 && Player.Transformation().currentTransformation.HurtSound(Player) != null)
{
var hurtSound = Player.Transformation().currentTransformation.HurtSound(Player).Value;
modifiers.DisableSound();
SoundEngine.PlaySound(hurtSound.sound, Player.Center);
hurtSoundTimer = hurtSound.delay;
}
else if (roverDrive && RoverDriveShieldDurability > 0)
{
modifiers.DisableSound();
SoundEngine.PlaySound(RoverDrive.ShieldHurtSound, Player.Center);
@@ -1772,42 +1729,12 @@ namespace CalamityMod.CalPlayer
SoundEngine.PlaySound(TheSponge.ShieldHurtSound, Player.Center);
hurtSoundTimer = 20;
}
else if (((pSoulArtifact && !profanedCrystal) || profanedCrystalBuffs) && pSoulShieldDurability > 0)
{
modifiers.DisableSound();
SoundEngine.PlaySound(ProfanedGuardianDefender.ShieldDeathSound);
hurtSoundTimer = 20;
}
else if ((profanedCrystal || profanedCrystalForce) && !profanedCrystalHide)
{
modifiers.DisableSound();
SoundEngine.PlaySound(Providence.HurtSound, Player.Center);
hurtSoundTimer = 20;
}
else if ((abyssalDivingSuitPower || abyssalDivingSuitForce) && !abyssalDivingSuitHide)
{
modifiers.DisableSound();
SoundEngine.PlaySound(SoundID.NPCHit4, Player.Center); //metal hit noise
hurtSoundTimer = 10;
}
else if ((aquaticHeartPower || aquaticHeartForce) && !aquaticHeartHide)
{
modifiers.DisableSound();
SoundEngine.PlaySound(SoundID.FemaleHit, Player.Center); //female hit noise
hurtSoundTimer = 10;
}
else if (titanHeartSet)
{
modifiers.DisableSound();
SoundEngine.PlaySound(NPCs.Astral.Atlas.HurtSound, Player.Center);
hurtSoundTimer = 10;
}
else if (Player.GetModPlayer<WulfrumTransformationPlayer>().transformationActive)
{
modifiers.DisableSound();
SoundEngine.PlaySound(SoundID.NPCHit4, Player.Center);
hurtSoundTimer = 10;
}
else if (Player.GetModPlayer<WulfrumArmorPlayer>().wulfrumSet && (Player.name.ToLower() == "wagstaff" || Player.name.ToLower() == "john wulfrum"))
{
modifiers.DisableSound();
@@ -2304,8 +2231,8 @@ namespace CalamityMod.CalPlayer
if (RageEnabled)
rageCombatFrames = BalancingConstants.RageCombatDelayTime;
// Regenator has been CANCLED on TWITTER.COM!!!! (Just keeping this here since it's a neat effect and I'll probably yoink it for something else later)
if (regenator && false)
// Regenerator has been CANCLED on TWITTER.COM!!!! (Just keeping this here since it's a neat effect and I'll probably yoink it for something else later)
if (regenerator && false)
{
// Projectile damage and count is based on source damage of the hit
float hitPower = (hurtInfo.SourceDamage / (Player.statLifeMax2 * 0.5f));
@@ -2347,6 +2274,12 @@ namespace CalamityMod.CalPlayer
}
}
if (victideBarrierSet && !Player.HasCooldown(WardingWave.ID))
{
int healAmt = (int)(hurtInfo.Damage * VictideHeadBarrier.BarrierDamageAbsorptionPercent);
victideBarrierHeal += healAmt;
}
if (daedalusAbsorb && Main.rand.NextBool(10))
{
int healAmt = (int)(hurtInfo.Damage / 2D);
@@ -2622,13 +2555,13 @@ namespace CalamityMod.CalPlayer
if (!canTriggerHitEffects)
return;
if (aeroSet && hurtInfo.Damage > 25)
if (aeroSet && hurtInfo.Damage > AerospecBreastplate.SetBonusHurtDamageThreshold)
{
// https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list
var source = Player.GetSource_OnHurt(hurtInfo.DamageSource, AerospecBreastplate.FeatherEntitySourceContext);
for (int n = 0; n < 4; n++)
{
int featherDamage = (int)Player.GetBestClassDamage().ApplyTo(30);
int featherDamage = (int)Player.GetBestClassDamage().ApplyTo(AerospecBreastplate.SetBonusFeatherDamage);
CalamityUtils.ProjectileRain(source, Player.Center, 400f, 100f, 500f, 800f, 20f, ModContent.ProjectileType<StickyFeatherAero>(), featherDamage, 1f, Player.whoAmI);
}
@@ -2702,15 +2635,20 @@ namespace CalamityMod.CalPlayer
}
if (inkBomb && !abyssalMirror && !eclipseMirror)
{
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<Items.Accessories.InkBomb>()));
if (Player.whoAmI == Main.myPlayer && !Player.HasCooldown(Cooldowns.InkBomb.ID))
if (Player.whoAmI == Main.myPlayer)
{
Player.AddCooldown(Cooldowns.InkBomb.ID, CalamityUtils.SecondsToFrames(20));
rogueStealth += 0.5f;
if (!Player.HasCooldown(Cooldowns.InkBomb.ID))
{
Player.AddCooldown(Cooldowns.InkBomb.ID, CalamityUtils.SecondsToFrames(20));
rogueStealth += 0.5f;
SoundEngine.PlaySound(SoundID.NPCDeath28 with { Volume = 2f }, Player.Center);
}
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<Items.Accessories.InkBomb>()));
SoundEngine.PlaySound(SoundID.Item1, Player.Center);
for (int i = 0; i < 3; i++)
{
SoundEngine.PlaySound(SoundID.Item61, Player.Center);
int ink = Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, Main.rand.NextFloat(-3f, 3f), Main.rand.NextFloat(-0f, -4f), ModContent.ProjectileType<InkBombProjectile>(), 0, 0, Player.whoAmI);
int ink = Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.One.RotatedByRandom(MathHelper.TwoPi) * 2f, ModContent.ProjectileType<InkBombProjectile>(), 0, 0, Player.whoAmI);
if (ink.WithinBounds(Main.maxProjectiles))
Main.projectile[ink].DamageType = DamageClass.Generic;
}
@@ -2742,7 +2680,7 @@ namespace CalamityMod.CalPlayer
if (Player.whoAmI == Main.myPlayer)
{
for (int i = 0; i < 16; i++)
for (int i = 0; i < 10; i++)
{
Vector2 circleVel = (MathHelper.TwoPi * i / 16f).ToRotationVector2() * Main.rand.NextFloat(5f, 8f);
int shard = Projectile.NewProjectile(source, Player.Center, circleVel, ProjectileID.CrystalShard, sDamage, 1f, Player.whoAmI);
+58 -113
View File
@@ -97,46 +97,46 @@ namespace CalamityMod.CalPlayer
}
// Whispering Death sets positive regen to zero but doesn't actually deal any damage
ApplyDoTDebuff(wDeath, 0, laudanum);
ApplyDoTDebuff(whisperingDeath, 0, laudanum);
ApplyDoTDebuff(irradiated, 4, purity);
int sulphurDoT = 6 - (sulphurSet ? 2 : 0) - (sulphurskin ? 2 : 0) - (corrosiveSpine ? 2 : 0);
ApplyDoTDebuff(sulphurPoison, sulphurDoT, purity);
ApplyDoTDebuff(rTide, 6, purity);
ApplyDoTDebuff(riptide, 6, purity);
ApplyDoTDebuff(weakBrimstoneFlames, 7);
ApplyDoTDebuff(bBlood, 8, purity);
ApplyDoTDebuff(burningBlood, 8, purity);
ApplyDoTDebuff(brainRot, 8, purity);
ApplyDoTDebuff(heavybleeding, 16, purity);
ApplyDoTDebuff(laceration, 24, purity);
ApplyDoTDebuff(vaporfied, 8, purity);
int staticDoT = ((Player.controlLeft || Player.controlRight) ? 12 : 3) / (eleResist ? 2 : 1);
ApplyDoTDebuff(staticDischarge, staticDoT, purity);
ApplyDoTDebuff(bFlames, abaddon ? 10 : 20, purity);
ApplyDoTDebuff(demonicFlames, 33, purity); // Never inflicted on the player
ApplyDoTDebuff(daybroken, reducedDaybrokenDamage ? 15 : 30, purity);
ApplyDoTDebuff(nightwither, reducedNightwitherDamage ? 15 : 30, purity);
ApplyDoTDebuff(hFlames, 24, purity);
ApplyDoTDebuff(voidfrost, 30, purity);
ApplyDoTDebuff(vHex, 24);
ApplyDoTDebuff(trueVHex, 36);
ApplyDoTDebuff(cDepth, 15, purity);
ApplyDoTDebuff(astralInfection, 18, infectedJewel || hideOfDeus || purity);
ApplyDoTDebuff(hPressure, 30, purity);
ApplyDoTDebuff(pFlames, alchFlask ? 12 : 24, purity);
ApplyDoTDebuff(cragsLava, 30); // Being literally submerged in crags lava should do more than brimstone flames
ApplyDoTDebuff(heavybleeding, 16, purity);
ApplyDoTDebuff(crushDepth, 18, purity);
ApplyDoTDebuff(astralInfection, 24, infectedJewel || hideOfDeus || purity);
ApplyDoTDebuff(shadowflame, 30, purity);
ApplyDoTDebuff(elementalMix, 50, purity); // Never inflicted on the player
ApplyDoTDebuff(banishingFire, 60); // Never inflicted on the player
ApplyDoTDebuff(brimstoneFlames, abaddon ? 15 : 30, purity);
ApplyDoTDebuff(plague, alchFlask ? 15 : 30, purity);
ApplyDoTDebuff(vHex, 30); // Has other effects
ApplyDoTDebuff(searingLava, 30);
ApplyDoTDebuff(demonicFlames, 33, purity); // Never inflicted on the player
ApplyDoTDebuff(laceration, 36, purity);
ApplyDoTDebuff(daybroken, reducedDaybrokenDamage ? 20 : 40, purity);
ApplyDoTDebuff(nightwither, reducedNightwitherDamage ? 20 : 40, purity);
ApplyDoTDebuff(holyFlames, 40, purity);
ApplyDoTDebuff(voidfrost, 40, purity);
ApplyDoTDebuff(hadopelagicPressure, 40, purity);
// Profaned Soul Crystal turns you into Providence, a God, and you take more damage from God Slayer Inferno
ApplyDoTDebuff(gsInferno, profanedCrystalBuffs ? 45 : 35);
ApplyDoTDebuff(godSlayerInferno, profanedCrystalBuffs ? 50 : 40);
int fluxDoT = ((Player.controlLeft || Player.controlRight) ? 50 : 10) / (eleResist ? 2 : 1);
ApplyDoTDebuff(vermillionFlux, fluxDoT);
int dragonfireDoT = ((Player.name == "JFL" || Player.name == "MrJFL") ? 240 : 40) / (dynamoStemCells ? 2 : 1);
ApplyDoTDebuff(elementalMix, 50, purity); // Never inflicted on the player
ApplyDoTDebuff(trueVHex, 50);
int dragonfireDoT = ((Player.name == "JFL" || Player.name == "MrJFL") ? 200 : 50) / (dynamoStemCells ? 2 : 1);
ApplyDoTDebuff(dragonFire, dragonfireDoT);
int rebukeDoT = ((Player.controlLeft || Player.controlRight) ? 75 : 15) / (eleResist ? 2 : 1);
ApplyDoTDebuff(miracleBlight, 60);
ApplyDoTDebuff(banishingFire, 60); // Never inflicted on the player
int rebukeDoT = ((Player.controlLeft || Player.controlRight) ? 80 : 16) / (eleResist ? 2 : 1);
ApplyDoTDebuff(auricRebuke, rebukeDoT);
ApplyDoTDebuff(miracleBlight, 50);
// Slowly increase the sulphuric water poisoning effect. Once it's high enough, the player takes damage and the meter resets.
bool nearSafeZone = false;
@@ -191,7 +191,7 @@ namespace CalamityMod.CalPlayer
for (int l = 0; l < Player.MaxBuffs; l++)
{
int buff = Player.buffType[l];
if (AlcoholsDict.TryGet(buff, out var level))
if (CalamityBuffSets.AlcoholStrength.TryGetValue(buff, out int level))
alcoholPoisonLevel += level;
}
if (vodka)
@@ -331,11 +331,11 @@ namespace CalamityMod.CalPlayer
int buffID = Player.buffType[l];
if (Player.buffTime[l] <= 2)
continue;
bool shouldHalveDuration = SicknessDebuffsList.Includes(buffID);
bool shouldHalveDuration = CalamityBuffSets.IsSicknessDebuff[buffID];
if (livingDewHalveDebuffs)
shouldHalveDuration |= FireDebuffsList.Includes(buffID);
shouldHalveDuration |= CalamityBuffSets.IsFireDebuff[buffID];
if (purity)
shouldHalveDuration |= DebuffsList.Includes(buffID);
shouldHalveDuration |= CalamityBuffSets.IsDebuff[buffID];
if (shouldHalveDuration)
--Player.buffTime[l];
@@ -379,10 +379,10 @@ namespace CalamityMod.CalPlayer
}
// Permafrost's Concoction increases life regen while afflicted with a fire debuff
if (permafrostsConcoction && Player.buffType.Any(FireDebuffsList.Includes))
if (permafrostsConcoction && Player.buffType.Any(l => CalamityBuffSets.IsFireDebuff[l]))
{
if (Player.lifeRegenTime < 1800)
Player.lifeRegenTime = 1800;
if (Player.lifeRegenTime < 900)
Player.lifeRegenTime = 900;
Player.lifeRegen += 6;
}
@@ -402,7 +402,7 @@ namespace CalamityMod.CalPlayer
if (purity)
{
int intendedPurityDefense = 0;
int currentDebuffs = Player.buffType.Count(DebuffsList.List.Contains);
int currentDebuffs = Player.buffType.Count(i => CalamityBuffSets.IsDebuff[i]);
if (currentDebuffs > 0)
{
// Healing rate is normally 5 HP/s (+1 every 12 frames)
@@ -419,10 +419,10 @@ namespace CalamityMod.CalPlayer
if (Player.miscCounter % healFrameCadence == healFrameCadence - 1)
Player.Heal(1);
if (Player.lifeRegenTime < 1800)
Player.lifeRegenTime = 1800;
if (Player.lifeRegenTime < 900)
Player.lifeRegenTime = 900;
intendedPurityDefense = 20 + (currentDebuffs - 1) * 8;
intendedPurityDefense = 15 + (currentDebuffs - 1) * 5;
if (jewelBonusDefense < intendedPurityDefense)
jewelBonusDefense = intendedPurityDefense;
@@ -457,14 +457,14 @@ namespace CalamityMod.CalPlayer
// If the player has any debuffs, give the extra life regen and defense
// More defense is given for each additional debuff
int intendedJewelDefense = 0;
int currentDebuffs = Player.buffType.Count(DebuffsList.List.Contains);
int currentDebuffs = Player.buffType.Count(i => CalamityBuffSets.IsDebuff[i]);
if (currentDebuffs > 0)
{
Player.lifeRegen += 4;
if (Player.lifeRegenTime < 1800)
Player.lifeRegenTime = 1800;
if (Player.lifeRegenTime < 900)
Player.lifeRegenTime = 900;
intendedJewelDefense = 16 + (currentDebuffs - 1) * 5;
intendedJewelDefense = 12 + (currentDebuffs - 1) * 4;
if (jewelBonusDefense < intendedJewelDefense)
jewelBonusDefense = intendedJewelDefense;
}
@@ -484,11 +484,11 @@ namespace CalamityMod.CalPlayer
Player.lifeRegen += 2;
// If any debuff is detected, provide even more life regen and massively accelerate it
if (Player.buffType.Any(DebuffsList.List.Contains))
if (Player.buffType.Any(i => CalamityBuffSets.IsDebuff[i]))
{
Player.lifeRegen += 3;
if (Player.lifeRegenTime < 1800)
Player.lifeRegenTime = 1800;
if (Player.lifeRegenTime < 900)
Player.lifeRegenTime = 900;
}
}
#endregion
@@ -525,7 +525,7 @@ namespace CalamityMod.CalPlayer
Player.lifeRegenCount = 0;
}
if (hInferno)
if (holyInferno)
{
Player.nebulaLevelLife = 0;
@@ -625,6 +625,9 @@ namespace CalamityMod.CalPlayer
Player.lifeRegen += Main.eclipse ? 2 : 4;
}
if (silvaSet)
Player.lifeRegen += 6;
if (phantomicHeartRegen <= 720 && phantomicHeartRegen >= 600)
{
Player.lifeRegen += PhantomicArtifact.RegenBoost;
@@ -648,7 +651,7 @@ namespace CalamityMod.CalPlayer
for (int l = 0; l < Player.MaxBuffs; l++)
{
int hasBuff = Player.buffType[l];
lesserEffect = AlcoholsDict.TryGet(hasBuff, out var a);
lesserEffect = CalamityBuffSets.AlcoholStrength.TryGetValue(hasBuff, out var a);
}
if (Player.lifeRegen < 0)
Player.lifeRegen += lesserEffect ? 1 : regenBoost;
@@ -673,8 +676,8 @@ namespace CalamityMod.CalPlayer
{
Player.lifeRegen += 7;
if (Player.lifeRegenTime < 1800)
Player.lifeRegenTime = 1800;
if (Player.lifeRegenTime < 900)
Player.lifeRegenTime = 900;
Player.lifeRegenTime += 4;
}
@@ -693,23 +696,6 @@ namespace CalamityMod.CalPlayer
else
pinkCandleHealFraction = 0D;
if (reaverRegen && reaverRegenCooldown >= 60)
{
reaverRegenCooldown = 0;
if (Player.statLife != Player.statLifeMax2 && !noLifeRegen)
Player.HealPlayer(1, HealTextType.None);
}
if (BloomStoneRegen)
{
float dayTimeCompletion = !Main.dayTime ? 1f : (float)(Main.time / Main.dayLength);
float regenBenefitFactor = MathHelper.SmoothStep(0.25f, 1f, Utils.GetLerpValue(0f, 0.24f, dayTimeCompletion, true) * Utils.GetLerpValue(1f, 0.76f, dayTimeCompletion, true));
Player.lifeRegen += (int)MathHelper.Lerp(2f, 6f, regenBenefitFactor);
Player.lifeRegenTime += (int)MathHelper.Lerp(1f, 3f, regenBenefitFactor);
}
if (manaOverloader)
{
float manaRatio = Player.statMana / (float)Player.statManaMax2;
@@ -753,9 +739,9 @@ namespace CalamityMod.CalPlayer
if (turboRegenPower > 0)
{
// After a brief delay determined by your form of standing still regen, min-cap life regen time at 1800 / 3600.
if (Player.lifeRegenTime > regenTimeNeededForTurboRegen && Player.lifeRegenTime < 1800f)
Player.lifeRegenTime = 1800f;
// After a brief delay determined by your form of standing still regen, min-cap life regen time at 900 / 3600.
if (Player.lifeRegenTime > regenTimeNeededForTurboRegen && Player.lifeRegenTime < 900f)
Player.lifeRegenTime = 900f;
Player.lifeRegen += turboRegenPower;
Player.lifeRegenTime += turboRegenPower;
@@ -766,48 +752,7 @@ namespace CalamityMod.CalPlayer
}
#endregion
// Life regen soft cap.
if (Player.statLife < actualMaxLife)
{
// The soft cap doesn't apply if the player is not moving and not using a weapon while having any of the following:
// Shiny Stone, Cosmic Freeze buff from the Cosmic Discharge, Demonshade Armor, Regenator, or The Camper.
int baseLifeRegenBoost = 4;
bool noLifeRegenCap = (Player.shinyStone || cFreeze || shadeRegen || camper || regenator) &&
Player.StandingStill() && Player.itemAnimation == 0;
if (!noLifeRegenCap)
{
// Calculate the % of HP the player has left.
float maxLifeRatio = Player.statLife / (float)actualMaxLife;
// Calculate the ratio of the player's current max life relative to the starting HP of 100.
// This makes the soft cap far less harsh at lower amounts of max life.
// Ranges from 20 (at 100 max life) to 4 (at 500 max life) to 2 (at 1000 max life) to 1 (at greater than 2000 max life).
int lifeRegenSoftCapMax = 20;
int lifeRegenSoftCapMin = (int)Math.Round(100f / actualMaxLife * lifeRegenSoftCapMax);
// The soft cap for life regen which ranges from 20 (at less than 5% HP) to 1 (at greater than or equal to 95% HP).
// This value is capped at a min and max amount.
int lifeRegenSoftCap = (int)MathHelper.Clamp((int)Math.Round((1f - maxLifeRatio) * lifeRegenSoftCapMax), lifeRegenSoftCapMin, lifeRegenSoftCapMax);
// If life regen is greater than the calculated soft cap, reduce it.
if (Player.lifeRegen - baseLifeRegenBoost > lifeRegenSoftCap)
{
// The scalar used to calculate how much the life regen stat should be reduced by.
// Ranges from 1 (at 0% HP) to 2 (at 100% HP).
float lifeRegenScalar = 1f + maxLifeRatio;
// Calculate the amount of life regen the player should get according to the soft cap and their current % HP remaining.
// The higher the player's % HP remaining the less life regen they get and vice versa.
int defLifeRegen = (int)((Player.lifeRegen - baseLifeRegenBoost) / lifeRegenScalar);
// Set the player's life regen to the scaled amount.
Player.lifeRegen = baseLifeRegenBoost + defLifeRegen;
}
}
}
if (regenator) // Gives special regen of it's own, but disables all regular life regen
if (regenerator) // Gives special regen of it's own, but disables all regular life regen
{
if (Player.miscCounter % 7 == 0 && Player.statLife < (int)(Player.statLifeMax2 * 0.5f))
Player.HealPlayer(1, HealTextType.None);
@@ -818,7 +763,7 @@ namespace CalamityMod.CalPlayer
Player.lifeRegenTime += 10;
}
else
regenatorDamage = 0;
regeneratorDamage = 0;
if (toxicHeart) // Since it needs to know your life regen, it must be placed here
{
@@ -873,8 +818,8 @@ namespace CalamityMod.CalPlayer
}
}
// Regenator trades all positive regen for damage, and caps your health gain at 50%
if (regenator)
// Regenerator trades all positive regen for damage, and caps your health gain at 50%
if (regenerator)
{
int finalRegen = Player.lifeRegen + (int)Math.Round(regen * (Player.statLifeMax2 / 400f * 0.85f + 0.15f));
finalRegen = (int)Math.Max(finalRegen, 0);
@@ -884,8 +829,8 @@ namespace CalamityMod.CalPlayer
if (Player.palladiumRegen)
finalRegen += 4;
regenatorDamage = (finalRegen * 1.75f) * 0.01f;
Player.GetDamage<GenericDamageClass>() += regenatorDamage;
regeneratorDamage = (finalRegen * 1.75f) * 0.01f;
Player.GetDamage<GenericDamageClass>() += regeneratorDamage;
if (Player.lifeRegen > 0)
Player.lifeRegen = 0;
+188 -237
View File
@@ -17,6 +17,7 @@ using CalamityMod.ExtraTextures;
using CalamityMod.Items;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Ammo;
using CalamityMod.Items.Armor.Aerospec;
using CalamityMod.Items.Armor.Bloodflare;
using CalamityMod.Items.Armor.Brimflame;
using CalamityMod.Items.Armor.DesertProwler;
@@ -201,12 +202,12 @@ namespace CalamityMod.CalPlayer
rage = 0f;
}
if (furyFuel < furyFuelMax && furyRefuelTimer >= 0)
if (furyFuel < FuryFuelMax && furyRefuelTimer >= 0)
{
furyFuel += (int)furyRefuelTimer;
furyRefuelTimer = MathHelper.Lerp(furyRefuelTimer, 25, 0.01f);
if (furyFuel > furyFuelMax)
furyFuel = furyFuelMax;
if (furyFuel > FuryFuelMax)
furyFuel = FuryFuelMax;
}
else if (furyRefuelTimer < 0)
furyRefuelTimer++;
@@ -221,11 +222,6 @@ namespace CalamityMod.CalPlayer
// Apply stealth damage to rogue.
Player.GetDamage<RogueDamageClass>() += stealthDamage;
//Slow the player down after any other speed modifiers might have been applied.
//Todo - Move this back to the wulfrum set class whenever statmodifiers are implemented for stats other than damage
if (WulfrumHat.PowerModeEngaged(Player, out _))
Player.moveSpeed *= 0.8f;
if ((XykVisualsBlue || XykVisualsOrange))
{
bool Orange = XykVisualsOrange;
@@ -294,12 +290,16 @@ namespace CalamityMod.CalPlayer
{
if (dashStart)
{
Player.velocity.X *= 3.5f;
Player.velocity.X *= 2f;
lastDashWasTabi = true;
}
if (Player.dashDelay == -1)
{
Player.velocity.X *= 0.9f;
Player.velocity.X *= 0.95f;
if (Player.timeSinceLastDashStarted > 12)
{
Player.velocity.X *= 0.75f;
}
}
}
if ((devilsDevastationKillMode || exaltedKillMode) && !Player.mount.Active)
@@ -479,13 +479,17 @@ namespace CalamityMod.CalPlayer
IsFirstDashFrame = false;
else
IsFirstDashFrame = true;
// THIS MUST BE NEAR THE END OF PostUpdateMiscEffects SO ALL OTHER RUN SPEED IS DONE FIRST. DO NOT PUT ANY RUN SPEED AFTER THIS
// Multiplies movement speed by 1.5x so that you don't feel like a snail in the early game.
// This applies to movement speed boosts as well as base speed to ensure they are actually worth their listed value compared to base speed
//
// Disabled while Overhaul is enabled, because Overhaul does very similar things to make movement more snappy
if (ExternalMods.overhaul is null && CalamityServerConfig.Instance.FasterBaseSpeed)
// 22JUN2025: Ozzatron: Disabled while Remnants is enabled, because Remnants has its own move speed reworks.
bool ignoreSpeedConfig = ExternalMods.overhaul is not null || ExternalMods.remnants is not null;
if (!ignoreSpeedConfig && CalamityServerConfig.Instance.FasterBaseSpeed)
Player.moveSpeed *= BalancingConstants.DefaultMoveSpeedBoost;
// This is used to increase horizontal velocity based on the player's movement speed stat.
@@ -506,8 +510,8 @@ namespace CalamityMod.CalPlayer
for (int l = 0; l < Player.MaxBuffs; l++)
{
int hasBuff = Player.buffType[l];
if (Player.buffTime[l] > 360 && hasBuff == BuffID.ShadowDodge)
Player.buffTime[l] = 360;
if (Player.buffTime[l] > 600 && hasBuff == BuffID.ShadowDodge)
Player.buffTime[l] = 600;
}
}
@@ -623,7 +627,7 @@ namespace CalamityMod.CalPlayer
// If they're a boss, reduce the boss distance.
// Boss distance will always be >= enemy distance, so there's no need to do another check.
// Worm boss body and tail segments are not counted as bosses for this calculation.
if (npc.IsABoss() && !NoRageWormSegmentList.Includes(npc.type))
if (npc.IsABoss() && !CalamityNPCSets.BossSegmentThatDoesNotGenerateRageFaster[npc.type])
bossDistance = hitboxEdgeDist;
}
}
@@ -910,8 +914,11 @@ namespace CalamityMod.CalPlayer
if (target.Calamity().cursorFocus >= CalamityGlobalNPC.cursorFocusMax)
{
target.Calamity().trueVulnerabilityHex = target.Calamity().vulnerabilityHex >= 300 ? target.Calamity().vulnerabilityHex : 300;
target.Calamity().vulnerabilityHex = 0;
int vHexDuration = 0;
if (target.HasBuff<VulnerabilityHex>())
vHexDuration = target.buffTime[target.FindBuffIndex(ModContent.BuffType<VulnerabilityHex>())];
target.AddBuff(ModContent.BuffType<TrueVulnerabilityHex>(),vHexDuration <= 300 ? vHexDuration : 300);
target.RequestBuffRemoval(ModContent.BuffType<VulnerabilityHex>());
SoundEngine.PlaySound(new("CalamityMod/Sounds/Custom/WeaponEnchant"), target.Center);
for (int i = 0; i < 18; i++)
@@ -943,8 +950,12 @@ namespace CalamityMod.CalPlayer
// Incinerate the target with either Vulnerability Hex or True Vulnerability Hex, depending on current cursor focus.
// This adds 8 to the buff duration, which results in a net increase of 3 frames every time damage is dealt, due to damage occurring every 5 frames.
int buffToInflict = target.Calamity().trueVulnerabilityHex > 0 ? ModContent.BuffType<TrueVulnerabilityHex>() : ModContent.BuffType<VulnerabilityHex>();
target.AddBuff(buffToInflict, target.Calamity().trueVulnerabilityHex > 0 ? target.Calamity().trueVulnerabilityHex + 8 : target.Calamity().vulnerabilityHex < VulnerabilityHex.CalamityDuration ? VulnerabilityHex.CalamityDuration : target.Calamity().vulnerabilityHex + 8);
int buffToInflict = target.Calamity().trueVulnerabilityHex? ModContent.BuffType<TrueVulnerabilityHex>() : ModContent.BuffType<VulnerabilityHex>();
if (!target.HasBuff(buffToInflict))
target.AddBuff(buffToInflict, 52);
target.buffTime[target.FindBuffIndex(buffToInflict)] += 8;
if (target.buffTime[target.FindBuffIndex(buffToInflict)] < VulnerabilityHex.CalamityDuration)
target.buffTime[target.FindBuffIndex(buffToInflict)] = VulnerabilityHex.CalamityDuration;
// Make some fancy dust to indicate damage is being done.
for (int j = 0; j < 12; j++)
@@ -1117,34 +1128,11 @@ namespace CalamityMod.CalPlayer
}
}
// Life Steal nerf in difficulties above Expert
// Reduces the max possible life steal before the cooldown occurs (this mostly just nerfs how much life steal the player can get in bursts)
// Master Mode nerfs this by an additional 10
float lifeStealCap =
CalamityWorld.death ? BalancingConstants.LifeStealCap_Death :
CalamityWorld.revenge ? BalancingConstants.LifeStealCap_Revengeance :
Main.expertMode ? BalancingConstants.LifeStealCap_Expert :
BalancingConstants.LifeStealCap_Classic;
if (Main.masterMode)
lifeStealCap -= BalancingConstants.LifeStealCapReduction_Master;
if (Player.lifeSteal > lifeStealCap)
Player.lifeSteal = lifeStealCap;
// Normal Mode life steal recovery rate is 0.2/s
// Expert Mode life steal recovery rate is 0.15/s
// Revengeance Mode life steal recovery rate is 0.125/s
// Death Mode life steal recovery rate is 0.1/s
// Master Mode life steal recovery rate is nerfed by an additional 0.05/s
float lifeStealRecoveryRateReduction =
CalamityWorld.death ? BalancingConstants.LifeStealRecoveryRateReduction_Death :
CalamityWorld.revenge ? BalancingConstants.LifeStealRecoveryRateReduction_Revengeance :
Main.expertMode ? BalancingConstants.LifeStealRecoveryRateReduction_Expert :
BalancingConstants.LifeStealRecoveryRateReduction_Classic;
if (Main.masterMode)
lifeStealRecoveryRateReduction += BalancingConstants.LifeStealRecoveryRateReduction_Master;
// Reduce the rate of recovery of the Lifesteal variable
// Classic Mode: 36 HP/s to 12 HP/s
// Expert Mode: 30 HP/s to 9 HP/s
float lifeStealRecoveryRateReduction = Main.expertMode ? BalancingConstants.LifeStealRecoveryRateReduction_Expert : BalancingConstants.LifeStealRecoveryRateReduction_Classic;
float lifeStealCap = Main.expertMode ? BalancingConstants.LifeStealCap_Expert : BalancingConstants.LifeStealCap_Classic;
if (Player.lifeSteal < lifeStealCap)
Player.lifeSteal -= lifeStealRecoveryRateReduction;
@@ -1161,7 +1149,7 @@ namespace CalamityMod.CalPlayer
for (int l = 0; l < Player.MaxBuffs; l++)
{
int buffID = Player.buffType[l];
if (Player.buffTime[l] > 2 && DebuffsList.Includes(buffID))
if (Player.buffTime[l] > 2 && CalamityBuffSets.IsDebuff[buffID])
Player.buffTime[l]--;
}
}
@@ -1175,7 +1163,7 @@ namespace CalamityMod.CalPlayer
ProvidenceBurnEffectDrawer.ParticleSpawnRate = int.MaxValue;
// If the player has holy inferno, cause the player to ignite into flames.
if (hInferno)
if (holyInferno)
ProvidenceBurnEffectDrawer.ParticleSpawnRate = 1;
// Otherwise, if the intensity is too weak, but still present, cause the player to release holy cinders.
@@ -1196,11 +1184,11 @@ namespace CalamityMod.CalPlayer
}
ProvidenceBurnEffectDrawer.Update();
if (hInferno && holyInfernoFadeIntensity < 1f)
if (holyInferno && holyInfernoFadeIntensity < 1f)
{
holyInfernoFadeIntensity = MathHelper.Clamp(holyInfernoFadeIntensity + 0.015f, 0f, 1f);
}
else if (!hInferno && holyInfernoFadeIntensity > 0f)
else if (!holyInferno && holyInfernoFadeIntensity > 0f)
{
holyInfernoFadeIntensity = MathHelper.Clamp(holyInfernoFadeIntensity - 0.01f, 0f, 1f);
}
@@ -1222,7 +1210,7 @@ namespace CalamityMod.CalPlayer
Player.AddBuff(ModContent.BuffType<FrozenLungs>(), 2, false);
}
}
if (iCantBreathe)
if (frozenLungs)
{
if (Player.breath > 0 && Player.miscCounter % 2 == 0)
Player.breath--;
@@ -1312,18 +1300,16 @@ namespace CalamityMod.CalPlayer
if (!Player.wet)
{
if (aeroSet)
Player.maxFallSpeed = 15f;
Player.maxFallSpeed = AerospecBreastplate.SetBonusFallSpeed;
if (Player.PortalPhysicsEnabled)
Player.maxFallSpeed = 20f;
}
if (Player.controlDown && !Player.controlJump && ironBoots)
if (Player.controlDown && !Player.controlJump && (ironBoots || gSabaton) && !gSabatonFalling)
{
Player.maxFallSpeed = 23f; // This is slightly faster than slimy saddle (so it can be viable)
Player.maxFallSpeed *= 2; //This ties Slimy Saddle. It is made viable by also allowing the player to move horizontal, unlike Saddle, and curbing existing vertical speed very fast
if (Player.gravDir == 1 ? Player.velocity.Y <= 0 : Player.velocity.Y >= 0)
Player.velocity.Y *= 0.7f;
else if (Player.gravDir == 1 ? Player.velocity.Y < Player.maxFallSpeed : Player.velocity.Y > Player.maxFallSpeed)
Player.velocity.Y = MathHelper.Lerp(Player.velocity.Y, Player.maxFallSpeed, 0.1f);
}
if (LungingDown)
@@ -1344,10 +1330,6 @@ namespace CalamityMod.CalPlayer
if (holdingDown && Player.ControlsEnabled() && notInLiquid && notOnRope && notGrappling && airborne && !Player.Calamity().gSabatonFalling) //Player cannot further increase their ridiculous gravity during a Gravistar Slam
{
Player.velocity.Y += Player.gravity * Player.gravDir * (BalancingConstants.HoldingDownGravityMultiplier - 1f);
if (Player.Calamity().gSabaton && !Player.gravControl2)
{
Player.maxFallSpeed *= 1.5f;
}
if (Player.velocity.Y * Player.gravDir > Player.maxFallSpeed)
Player.velocity.Y = Player.maxFallSpeed * Player.gravDir;
}
@@ -1549,11 +1531,9 @@ namespace CalamityMod.CalPlayer
// The fire boots debuff boosts
if (hellfireTreads)
bootLevel = 2;
HeatDebuffMultiplier += 0.5f;
else if (flameWakerBoots)
bootLevel = 1;
else
bootLevel = 0;
HeatDebuffMultiplier += 0.25f;
if (rOfResilienceEffect > 0)
rOfResilienceEffect--;
@@ -1825,7 +1805,7 @@ namespace CalamityMod.CalPlayer
{
if (dOfTheDeepDefenseBuffTimer > 0)
{
int maxDefense = 15;
int maxDefense = 10;
int givenDefense = (int)Utils.Remap(dOfTheDeepDefenseBuffTimer, 0, dOfTheDeepDefenseBuffMax * 0.5f, 0, maxDefense);
Player.statDefense += givenDefense;
dOfTheDeepDefenseBuffTimer--;
@@ -1891,6 +1871,41 @@ namespace CalamityMod.CalPlayer
dOfTheDeepTimer++;
}
}
if (hookPullVisuals > 0)
{
if (bloomStone && Player.Calamity().bloomStoneHookVisuals) // Visual flowers while being pulled
{
Vector2 spawnPos = Player.Center + Main.rand.NextVector2Circular(20f, 20f);
float fade = (float)Math.Pow(Utils.GetLerpValue(0, 30, hookPullVisuals, true), 2);
Particle trail = new CustomSpark(Player.Center, -Player.velocity.SafeNormalize(Vector2.UnitX) * Main.rand.NextFloat(5f, 8f),
"CalamityMod/Particles/BloomCircle", false, Main.rand.Next(7, 10 + 1), 0.65f,
Color.Lerp(Color.HotPink, Color.Gold, Utils.GetLerpValue(60, 30, hookPullVisuals, true)) * 0.75f * fade, new Vector2(1f, 0.7f), true, shrinkSpeed: 0.6f);
GeneralParticleHandler.SpawnParticle(trail);
if (Main.rand.NextBool(3))
{
Particle floweyFromHitGameUndertale = new CustomSpark(spawnPos, -Player.velocity.SafeNormalize(Vector2.UnitX) * Main.rand.NextFloat(5f, 8f),
"CalamityMod/Particles/MiniFlower", false, Main.rand.Next(25, 28 + 1), Main.rand.NextFloat(2.3f, 2.6f) * fade,
Color.Lerp(Color.HotPink, Color.Plum, Main.rand.NextFloat(0, 0.65f)), new Vector2(1f, 1f), true, extraRotation: Main.rand.NextFloat(0, MathHelper.TwoPi));
GeneralParticleHandler.SpawnParticle(floweyFromHitGameUndertale);
}
if (Main.rand.NextBool())
{
Dust pollenDust = Dust.NewDustPerfect(Player.Center + Main.rand.NextVector2Circular(20f, 20f), ModContent.DustType<SquashDust>());
pollenDust.noLightEmittence = true;
pollenDust.noGravity = true;
pollenDust.scale = Main.rand.NextFloat(0.9f, 1.4f);
pollenDust.color = Color.Lerp(Color.Gold, Color.HotPink, Utils.GetLerpValue(60, 30, hookPullVisuals, true));
pollenDust.velocity = -Player.velocity.SafeNormalize(Vector2.UnitX) * Main.rand.NextFloat(2f, 5f);
pollenDust.fadeIn = -0.5f * fade;
}
}
hookPullVisuals--;
if (Player.velocity.Length() < 6)
hookPullVisuals = 0;
}
if (unstableGraniteCore)
{
@@ -2012,7 +2027,7 @@ namespace CalamityMod.CalPlayer
SyncCooldownRemoval(Main.dedServ, expiredCooldowns);
// Grant the player 5 seconds of immunity to immobilizing debuffs after an immobilizing debuff wears off.
if (Player.stoned || Player.frozen || Player.webbed || gState)
if (Player.stoned || Player.frozen || Player.webbed)
{
ImmobilityDebuffImmunityTimer = ImmobilityDebuffImmunityTimerMax;
}
@@ -2022,7 +2037,6 @@ namespace CalamityMod.CalPlayer
Player.buffImmune[BuffID.Stoned] = true;
Player.buffImmune[BuffID.Frozen] = true;
Player.buffImmune[BuffID.Webbed] = true;
Player.buffImmune[ModContent.BuffType<GlacialState>()] = true;
}
if (arsenalCooldown > 0)
@@ -2047,14 +2061,14 @@ namespace CalamityMod.CalPlayer
--fullRageSoundCountdownTimer;
if (plagueTaintedSMGDroneCooldown > 0)
plagueTaintedSMGDroneCooldown--;
if (flareGunOverheat > 0)
flareGunOverheat--;
if (momentumCapacitorTime > 0)
--momentumCapacitorTime;
if (phantomicHeartRegen > 0 && phantomicHeartRegen < 1000)
phantomicHeartRegen--;
if (phantomicBulwarkCooldown > 0)
phantomicBulwarkCooldown--;
if (KameiBladeUseDelay > 0)
KameiBladeUseDelay--;
if (galileoCooldown > 0)
galileoCooldown--;
if (gladiatorTimer > 0)
@@ -2096,15 +2110,27 @@ namespace CalamityMod.CalPlayer
if (theBeeCooldown > 0)
theBeeCooldown--;
if (bloomStoneHealTimer > 0)
if (bloomStoneTotalHeal > 0)
{
if (bloomStone && bloomStoneHealTimer % 40 == 0)
float healRateDiv = (Player.statLife >= Player.statLifeMax ? 5 : // 5 times as slow if at max hp already (overheal prevention)
bloomStoneBuffedHealRateTimer > 0 ? Utils.Remap(bloomStoneBuffedHealRateTimer, 90, 0, 0.5f, 1f, true) // 2 times faster if pollen buffed, scales back down to regular speed as the buff fades
: 1); // Regular speed
bloomStoneHealRate = 1 / healRateDiv;
if (!bloomStone) // If you take it off, all your healing is instantly gone
bloomStoneTotalHeal = 0;
float secondsOfHealing = 16; // Number of seconds healing occurs over at base, this can be met slower or faster depending on heal rate
if (bloomStoneHealTimer >= 60) // heal the player a portion of their potion every second
{
Player.HealPlayer(Math.Min(bloomStoneHealInc, bloomStoneTotalHeal));
int healAmount = (int)(Math.Max(Math.Min(bloomStoneHealPool, (int)(bloomStoneTotalHeal / secondsOfHealing)), 1));
Player.HealPlayer(healAmount);
bloomStoneHealPool -= healAmount; // Subtract the amount healed from the pool until it's empty
// Special specifically programmed interaction with Chalice of the Blood God: Healing over time clears bits of the bleedout buffer.
if (chaliceOfTheBloodGod && chaliceBleedoutBuffer > 0D)
{
float amountOfBleedToClear = ChaliceOfTheBloodGod.HealingPotionRatioForBufferClear * bloomStoneHealInc;
float amountOfBleedToClear = ChaliceOfTheBloodGod.HealingPotionRatioForBufferClear * healAmount;
chaliceBleedoutBuffer -= amountOfBleedToClear;
// Display text indicating that healing was applied to the bleedout buffer.
if (!Main.dedServ)
@@ -2115,22 +2141,16 @@ namespace CalamityMod.CalPlayer
}
}
bloomStoneTotalHeal -= bloomStoneHealInc;
if (bloomStoneTotalHeal < 0)
if (bloomStoneHealPool == 0) // When you're out of healing, reset values
{
bloomStoneTotalHeal = 0;
}
bloomStoneHealTimer = 0;
}
bloomStoneHealTimer--;
}
else
{
bloomStoneTotalHeal = 0;
bloomStoneHealInc = 0;
}
if (bloomStoneDR > 0)
{
Player.endurance += bloomStoneHealTimer > 0 ? 0.12f : 0.06f;
bloomStoneDR--;
bloomStoneHealTimer += bloomStoneHealRate;
}
if (bloomStoneBuffedHealRateTimer > 0)
bloomStoneBuffedHealRateTimer--;
if (summonProjCooldown > 0f)
summonProjCooldown -= 1f;
@@ -2156,13 +2176,6 @@ namespace CalamityMod.CalPlayer
if (vortexBoosterStealthDelay == 1 && Player.setVortex)
Player.vortexStealthActive = true;
}
if (statisPenaltyTimer > 0)
statisPenaltyTimer--;
if (statisPenaltyTimer == 0 && statisAnticheese > 0)
{
statisAnticheese--;
statisPenaltyTimer = statisTimerMax;
}
if (hallowedRuneCooldown > 0)
hallowedRuneCooldown--;
if (sulphurBubbleCooldown > 0)
@@ -2227,10 +2240,6 @@ namespace CalamityMod.CalPlayer
canFireGodSlayerRangedProjectile = true;
canFireBloodflareRangedProjectile = true;
}
if (reaverRegenCooldown < 60 && reaverRegen)
reaverRegenCooldown++;
else
reaverRegenCooldown = 0;
if (auralisAurora > 0)
auralisAurora--;
if (auralisAuroraCooldown > 0)
@@ -2319,8 +2328,10 @@ namespace CalamityMod.CalPlayer
// God Slayer Armor dash debuff immunity
if (LastUsedDashID == GodslayerArmorDash.ID && Player.dashDelay < 0)
{
foreach (int debuff in DebuffsList.List)
Player.buffImmune[debuff] = true;
for (int d = 0; d < Player.buffImmune.Length; d++)
{
Player.buffImmune[d] |= CalamityBuffSets.IsDebuff[d];
}
}
// Shield of the High Ruler
@@ -2391,8 +2402,11 @@ namespace CalamityMod.CalPlayer
if (silvaCountdown > 0 && hasSilvaEffect && silvaSet)
{
// You become immune to all debuffs
foreach (int debuff in DebuffsList.List)
Player.buffImmune[debuff] = true;
foreach (int debuff in Player.buffType)
{
if (CalamityBuffSets.IsDebuff[debuff])
Player.buffImmune[debuff] = true;
}
// Prevent thorns effects from being abused during invincibility
Player.thorns = 0f;
@@ -2471,8 +2485,7 @@ namespace CalamityMod.CalPlayer
if (Player.whoAmI == Main.myPlayer)
Player.AddCooldown(Cooldowns.TarragonImmunity.ID, CalamityUtils.SecondsToFrames(25));
bool shouldAffect = DebuffsList.Includes(buffID);
if (shouldAffect)
if (CalamityBuffSets.IsDebuff[buffID])
Player.GetDamage<RogueDamageClass>() += 0.1f;
}
}
@@ -2521,6 +2534,17 @@ namespace CalamityMod.CalPlayer
}
}
if (brimflameFrenzy)
{
Player.GetDamage<MagicDamageClass>() += BrimflameCowl.FrenzyMagicDamageBoost;
for (int l = 0; l < Player.MaxBuffs; l++)
{
if (Player.buffTime[l] <= 2 && Player.buffType[l] == ModContent.BuffType<BrimflameFrenzyBuff>() && Player.whoAmI == Main.myPlayer)
Player.AddCooldown(BrimflameFrenzy.ID, BrimflameCowl.FrenzyCooldown);
}
}
// Raider Talisman bonus
if (raiderTalisman && !vampiricTalisman && !StealthStrikeAvailable() && raiderCritLifespan > 0f)
Player.GetCritChance<ThrowingDamageClass>() += RaidersTalisman.RaiderBonus;
@@ -2540,7 +2564,7 @@ namespace CalamityMod.CalPlayer
if (Player.isNearFairy())
{
Player.lifeRegen += 4;
Player.statDefense += 10;
Player.statDefense += 6;
Player.moveSpeed += 0.1f;
}
}
@@ -2564,7 +2588,7 @@ namespace CalamityMod.CalPlayer
if (affliction || afflicted)
{
Player.endurance += 0.07f;
Player.statDefense += 13;
Player.statDefense += 9;
Player.GetDamage<GenericDamageClass>() += 0.1f;
}
@@ -2604,7 +2628,7 @@ namespace CalamityMod.CalPlayer
// Permafrost's Concoction bonuses/debuffs
if (permafrostsConcoction)
{
Player.manaCost *= 0.85f;
Player.manaCost -= 0.15f;
Player.statManaMax2 += 50;
}
@@ -2621,7 +2645,6 @@ namespace CalamityMod.CalPlayer
Player.buffImmune[BuffID.Frozen] = true;
Player.buffImmune[BuffID.Chilled] = true;
Player.buffImmune[ModContent.BuffType<GlacialState>()] = true;
}
// Cosmic Discharge Cosmic Freeze buff, gives surrounding enemies the Glacial State debuff
@@ -2734,23 +2757,19 @@ namespace CalamityMod.CalPlayer
// Plagued Fuel Pack and Blunder Booster effects
if (jetPackDash > 0 && Player.whoAmI == Main.myPlayer)
{
int velocityAmt = blunderBooster ? 35 : 25;
int velocityMult = jetPackDash > 1 ? velocityAmt : 5;
Player.velocity = new Vector2(jetPackDirection, -1) * velocityMult;
int velocityMult = (int)((blunderBooster ? 35 : 25) * Utils.GetLerpValue(-4, 5, jetPackDash, true));
Player.velocity = new Vector2(jetPackDirection, -1f) * velocityMult;
if (blunderBooster)
{
int lightningCount = Main.rand.Next(5, 7);
int lightningCount = 4;
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<BlunderBooster>()));
for (int i = 0; i < lightningCount; i++)
{
Vector2 lightningVel = new Vector2(Main.rand.NextFloat(-1, 1), Main.rand.NextFloat(-1, 1));
lightningVel.Normalize();
lightningVel *= Main.rand.NextFloat(1f, 2f);
int damage = (int)Player.GetTotalDamage<RogueDamageClass>().ApplyTo(30);
Vector2 lightningVel = Player.velocity.SafeNormalize(Vector2.UnitX).RotatedByRandom(0.3f) * Main.rand.NextFloat(7f, 10f);
int damage = (int)Player.GetTotalDamage<RogueDamageClass>().ApplyTo(35);
int projectile = Projectile.NewProjectile(source, Player.Center, lightningVel, ModContent.ProjectileType<BlunderBoosterLightning>(), damage, 0, Player.whoAmI, Main.rand.Next(2), 0f);
Main.projectile[projectile].timeLeft = Main.rand.Next(180, 240);
if (projectile.WithinBounds(Main.maxProjectiles))
Main.projectile[projectile].DamageType = DamageClass.Generic;
}
@@ -2765,17 +2784,14 @@ namespace CalamityMod.CalPlayer
}
else if (plaguedFuelPack)
{
int numClouds = Main.rand.Next(8, 10);
int numClouds = 3;
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<PlaguedFuelPack>()));
for (int i = 0; i < numClouds; i++)
{
Vector2 cloudVelocity = new Vector2(Main.rand.NextFloat(-1, 1), Main.rand.NextFloat(-1, 1));
cloudVelocity.Normalize();
cloudVelocity *= Main.rand.NextFloat(0f, 1f);
int damage = (int)Player.GetTotalDamage<RogueDamageClass>().ApplyTo(20);
Vector2 cloudVelocity = Player.velocity.SafeNormalize(Vector2.UnitX).RotatedByRandom(0.3f) * Main.rand.NextFloat(5f, 7f);
int damage = (int)Player.GetTotalDamage<RogueDamageClass>().ApplyTo(30);
int projectile = Projectile.NewProjectile(source, Player.Center, cloudVelocity, ModContent.ProjectileType<PlaguedFuelPackCloud>(), damage, 0, Player.whoAmI, 0, 0);
Main.projectile[projectile].timeLeft = Main.rand.Next(180, 240);
if (projectile.WithinBounds(Main.maxProjectiles))
Main.projectile[projectile].DamageType = DamageClass.Generic;
}
@@ -2802,7 +2818,7 @@ namespace CalamityMod.CalPlayer
{
brimflameFrenzy = false;
Player.ClearBuff(ModContent.BuffType<BrimflameFrenzyBuff>());
Player.AddCooldown(BrimflameFrenzy.ID, BrimflameScowl.CooldownLength);
Player.AddCooldown(BrimflameFrenzy.ID, BrimflameCowl.FrenzyCooldown);
}
if (!bloodflareMelee && bloodflareFrenzy)
{
@@ -2955,36 +2971,7 @@ namespace CalamityMod.CalPlayer
}
// Breath lost while at zero breath
double breathLoss = Main.remixWorld ? (point.Y < abyssLevel1 ? 50D * depthRatioFromAbyssLayer1 : 0D) : (point.Y > abyssLevel1 ? 50D * depthRatioFromAbyssLayer1 : 0D);
// Breath Loss Multiplier, depending on gear
// 27AUG2024: Ozzatron: fixed this being subtractive like mining speed. now doesn't stack exponentially
// It is now a multiplier for the time it takes to lose any unit amount of breath
double breathLossTimeMult = 1D +
(Player.gills ? 0.2 : 0D) + // 1.2
(oceanCrest ? 0.2 : 0D) + // 1.2
(victideSet ? 0.2 : 0D) + // 1.2
(Player.accDivingHelm ? 0.25 : 0D) + // 1.25
(Player.arcticDivingGear ? 0.25 : 0D) + // 1.25
(aquaticEmblem ? 0.25 : 0D) + // 1.25
(Player.accMerman ? 0.3 : 0D) + // 1.3
(reaverExplore ? 0.3 : 0D) + // 1.3
((aquaticHeart && NPC.downedBoss3) ? 0.3 : 0D) + // 1.3
(abyssalDivingSuit ? 0.3 : 0D) + // 1.3
externalBreathLossMultBoost;
// Invert the breath loss time multiplier, to get the multiplier for the speed at which breath is actually lost
double breathLossMult = 1D / breathLossTimeMult;
// Limit the multiplier to 5%
if (breathLossMult < 0.05)
breathLossMult = 0.05;
// Reduce breath lost while at zero breath, depending on gear
breathLoss *= breathLossTimeMult;
// Record the final breath loss for the stat meter
abyssBreathLossStat = (float)breathLoss;
double breathLoss = Main.remixWorld ? (point.Y < abyssLevel1 ? 1D : 0D) : (point.Y > abyssLevel1 ? 1D : 0D);
// Defense loss
int defenseLoss = (int)(120D * depthRatio);
@@ -3005,24 +2992,8 @@ namespace CalamityMod.CalPlayer
// Record the final defense reduction for the stat meter
abyssDefenseLossStat = defenseLoss;
// Bleed effect based on abyss layer
if (ZoneAbyssLayer4)
{
Player.bleed = true;
}
else if (ZoneAbyssLayer3)
{
if (!abyssalDivingSuit)
Player.bleed = true;
}
else if (ZoneAbyssLayer2)
{
if (!depthCharm)
Player.bleed = true;
}
// Ticks (frames) until breath is deducted from the breath meter
double tick = 12D * (1D - depthRatio);
double tick = 10D * (1D - depthRatio);
// Prevent 0
if (tick < 1D)
@@ -3030,16 +3001,16 @@ namespace CalamityMod.CalPlayer
// Tick (frame) multiplier, depending on gear
double tickMult = 1D +
(Player.gills ? 4D : 0D) + // 5
(oceanCrest ? 4D : 0D) + // 5
(Player.ignoreWater ? 5D : 0D) + // 10
(Player.accDivingHelm ? 10D : 0D) + // 20
(Player.arcticDivingGear ? 10D : 0D) + // 30
(aquaticEmblem ? 10D : 0D) + // 40
(Player.accMerman ? 15D : 0D) + // 55
(victideSet ? 5D : 0D) + // 60
((aquaticHeart && NPC.downedBoss3) ? 15D : 0D) + // 75
(abyssalDivingSuit ? 15D : 0D) + // 90
(Player.gills ? 2D : 0D) +
(oceanCrest ? 2D : 0D) +
(Player.ignoreWater ? 3D : 0D) +
(Player.accDivingHelm ? 5D : 0D) +
(Player.arcticDivingGear ? 5D : 0D) +
(aquaticEmblem ? 5D : 0D) +
(Player.accMerman ? 8D : 0D) +
(victideBurrowHead ? 2D : 0D) +
((aquaticHeart && NPC.downedBoss3) ? 8D : 0D) +
(abyssalDivingSuit ? 8D : 0D) +
externalBreathTickBoost;
// Limit the multiplier to 50
@@ -3053,6 +3024,8 @@ namespace CalamityMod.CalPlayer
abyssBreathLossRateStat = (float)tick;
float resistanceSlowdownFactor = 1f;
if (hadopelagicPressure)
resistanceSlowdownFactor -= abyssalDivingSuit ? 0.2f : 0.5f;
// Reduce breath over ticks (frames)
abyssBreathCD++;
@@ -3064,17 +3037,14 @@ namespace CalamityMod.CalPlayer
// Reduce breath
if (Player.breath > 0)
{
Player.breath -= (int)(cDepth && !depthCharm ? breathLoss + 1D : breathLoss);
if (hPressure)
resistanceSlowdownFactor -= (int)(!abyssalDivingSuit ? 1.2f : 0.5f);
Player.breath -= (int)(crushDepth && !depthCharm ? breathLoss + 1D : breathLoss);
}
}
// If breath is greater than 0 and player has gills or is merfolk, balance out the effects by reducing breath
if (Player.breath > 0)
{
if (Player.gills || Player.merman)
if (Player.gills || Player.merman || Player.accMerman)
Player.breath -= 3;
}
@@ -3083,8 +3053,8 @@ namespace CalamityMod.CalPlayer
// Resistance to life loss at zero breath
int lifeLossAtZeroBreathResist = 0 +
(depthCharm ? 3 : 0) +
(abyssalDivingSuit ? 6 : 0);
(depthCharm ? 4 : 0) +
(abyssalDivingSuit ? 5 : 0);
// Reduce life loss, depending on gear
lifeLossAtZeroBreath -= lifeLossAtZeroBreathResist;
@@ -3117,7 +3087,7 @@ namespace CalamityMod.CalPlayer
abyssDeath = false;
// Signus headcrab darkness
if (CalamityWorld.LegendaryMode && CalamityWorld.revenge)
if (CalamityWorld.LegendaryMode)
{
if (CalamityGlobalNPC.signus != -1)
{
@@ -3208,7 +3178,7 @@ namespace CalamityMod.CalPlayer
// Aquatic Emblem bonus
if (aquaticEmblem)
{
if (Player.IsUnderwater() && Player.wet && !Player.lavaWet && !Player.honeyWet &&
if (countsAsAnyWet && !Player.lavaWet && !Player.honeyWet &&
!Player.mount.Active)
{
if (aquaticBoost > 0f)
@@ -3225,17 +3195,17 @@ namespace CalamityMod.CalPlayer
else
{
aquaticBoost += 2f;
if (aquaticBoost > aquaticBoostMax)
aquaticBoost = aquaticBoostMax;
if (aquaticBoost > AquaticBoostMax)
aquaticBoost = AquaticBoostMax;
if (Player.mount.Active)
aquaticBoost = aquaticBoostMax;
aquaticBoost = AquaticBoostMax;
}
Player.statDefense += (int)((1f - aquaticBoost * 0.0001f) * 50f);
Player.statDefense += (int)((1f - aquaticBoost * 0.0001f) * 20f);
Player.moveSpeed -= (1f - aquaticBoost * 0.0001f) * 0.1f;
}
else
aquaticBoost = aquaticBoostMax;
aquaticBoost = AquaticBoostMax;
if (Player.ActiveItem().type == ModContent.ItemType<Auralis>() && Player.StandingStill(0.1f))
{
@@ -3363,12 +3333,12 @@ namespace CalamityMod.CalPlayer
if (AdamantiteSet)
Player.statDefense += AdamantiteSetDefenseBoost;
// Warmth makes Chilled, Frozen, and Glacial State tick down 3x as fast
// Warmth makes Chilled and Frozen tick down 3x as fast
if (Player.HasBuff(BuffID.Warmth))
{
for (int b = 0; b < Player.MaxBuffs; b++)
{
if (Player.buffType[b] == BuffID.Chilled || Player.buffType[b] == BuffID.Frozen || Player.buffType[b] == ModContent.BuffType<GlacialState>())
if (Player.buffType[b] == BuffID.Chilled || Player.buffType[b] == BuffID.Frozen)
{
if (Player.buffTime[b] > 3)
{
@@ -3408,11 +3378,6 @@ namespace CalamityMod.CalPlayer
Player.GetDamage<GenericDamageClass>() += Grax.DamageBoost;
}
if (brutalCarnage)
{
Player.GetDamage<MeleeDamageClass>() += BrutalCarnage.MeleeDamageBoost;
}
// Trinket of Chi bonus
if (trinketOfChi)
{
@@ -3430,7 +3395,7 @@ namespace CalamityMod.CalPlayer
Player.GetDamage<GenericDamageClass>() += 0.12f;
Player.GetKnockback<SummonDamageClass>() += 1.2f;
if (Main.eclipse || !Main.dayTime)
Player.statDefense += Main.eclipse ? 10 : 20;
Player.statDefense += Main.eclipse ? 8 : 16;
}
if (AbsorberRegen)
@@ -3477,7 +3442,7 @@ namespace CalamityMod.CalPlayer
if (tortShellPostHit > 0)
{
Player.statDefense -= 8;
Player.statDefense -= 6;
tortShellPostHit--;
}
else
@@ -3595,7 +3560,7 @@ namespace CalamityMod.CalPlayer
if (starBeamRye)
{
Player.GetDamage<MagicDamageClass>() += StarBeamRye.MagicDamageBoost;
Player.manaCost *= (1f - StarBeamRye.ManaCostReduction);
Player.manaCost -= StarBeamRye.ManaCostReduction;
Player.statManaMax2 += StarBeamRye.MaxManaBoost;
}
@@ -3626,7 +3591,7 @@ namespace CalamityMod.CalPlayer
}
}
if (HighTestFishingPoleList.Includes(Player.ActiveItem().type))
if (CalamityItemSets.FishingPoleThatNeverBreaks[Player.ActiveItem().type])
Player.accFishingLine = true;
if (planarSpeedBoost != 0)
@@ -3733,24 +3698,12 @@ namespace CalamityMod.CalPlayer
}
if (tarraSet)
{
if (!tarraMelee)
Player.calmed = true;
Player.lifeMagnet = true;
}
if (wDeath && !laudanum && !purity)
if (whisperingDeath && !laudanum && !purity)
Player.GetDamage<GenericDamageClass>() -= 0.2f;
if (astralInfection && !(infectedJewel || hideOfDeus || purity))
Player.GetDamage<GenericDamageClass>() -= 0.1f;
if (pFlames && !purity)
{
Player.GetDamage<GenericDamageClass>() -= 0.1f;
}
if (aCrunch && !laudanum && !purity)
if (armorCrunch && !laudanum && !purity)
{
Player.statDefense -= ArmorCrunch.DefenseReduction;
Player.endurance *= ArmorCrunch.MultiplicativeDamageReductionPlayer;
@@ -3761,14 +3714,6 @@ namespace CalamityMod.CalPlayer
Player.statDefense -= RemsRevenge.WitherDefenseReduction;
}
if (gState)
{
Player.velocity.X *= 0.5f;
Player.velocity.Y += 0.05f;
if (Player.velocity.Y > 15f)
Player.velocity.Y = 15f;
}
if (eutrophication && !purity)
Player.velocity = Vector2.Zero;
@@ -3820,11 +3765,17 @@ namespace CalamityMod.CalPlayer
Player.GetDamage<MeleeDamageClass>() += 0.1f;
}
// While making the rogue update verify if we should allow these to stack again - Shade
if (filthyGlove)
{
bonusStealthDamage += nanotech ? 0.05f : 0.08f;
}
if (rottenDogTooth && !nanotech)
{
bonusStealthDamage += 0.08f;
}
if (sandsWindBuff)
{
Player.GetDamage<GenericDamageClass>() += PrimordialEarth.BuffDamageBoost;
@@ -3850,7 +3801,7 @@ namespace CalamityMod.CalPlayer
if (Player.statLife > (int)(Player.statLifeMax2 * 0.5))
Player.GetDamage<GenericDamageClass>() += 0.1f;
if (Player.statLife <= (int)(Player.statLifeMax2 * 0.5))
Player.statDefense += 20;
Player.statDefense += 15;
}
if (vexation)
@@ -4071,7 +4022,7 @@ namespace CalamityMod.CalPlayer
if (eArtifact)
{
Player.manaCost *= 0.75f;
Player.manaCost -= 0.25f;
Player.maxMinions++;
}
@@ -4412,7 +4363,7 @@ namespace CalamityMod.CalPlayer
for (int l = 0; l < Player.MaxBuffs; l++)
{
int buffID = Player.buffType[l];
if (AmalgamBuffList.Includes(buffID))
if (CalamityBuffSets.BuffedByAmalgam[buffID])
{
if (amalgam)
{
@@ -4429,7 +4380,7 @@ namespace CalamityMod.CalPlayer
else
{
// Reset buff persistence if Amalgam is removed.
if (Main.persistentBuff[buffID] && !PersistentBuffList.Includes(buffID))
if (Main.persistentBuff[buffID] && !CalamityBuffSets.IsPersistentBuff[buffID])
Main.persistentBuff[buffID] = false;
}
}
@@ -4477,7 +4428,7 @@ namespace CalamityMod.CalPlayer
// Also gives acceleration, which is done in PostUpdateRunSpeeds
break;
case BuffID.Ichor:
Player.statDefense += 40; // +25 net defense
Player.statDefense += 20; // +10 net defense
break;
case BuffID.Bleeding:
Player.bleed = false;
@@ -4495,7 +4446,7 @@ namespace CalamityMod.CalPlayer
case BuffID.Weak:
Player.GetDamage<MeleeDamageClass>() += 0.051f; // Cancel melee damage nerf, add 10% all damage
Player.GetDamage<GenericDamageClass>() += 0.1f;
Player.statDefense += 14; // +10 net defense
Player.statDefense += 10; // +6 net defense
Player.moveSpeed += 0.25f; // +15% net move speed
break;
case BuffID.Slow:
@@ -4504,7 +4455,7 @@ namespace CalamityMod.CalPlayer
break;
case BuffID.Confused:
Player.confused = false;
Player.statDefense += 50;
Player.statDefense += 15;
break;
case BuffID.Cursed:
Player.cursed = false;
@@ -4922,7 +4873,7 @@ namespace CalamityMod.CalPlayer
}
if (DesertProwlerHat.ShroudedInSmoke(Player, out _))
Player.statDefense -= (int)(Player.statDefense * 0.75);
Player.statDefense -= (int)(Player.statDefense * DesertProwlerHat.SmokeDefenseMult);
}
#endregion
+101 -277
View File
@@ -8,7 +8,13 @@ using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Cooldowns;
using CalamityMod.Dusts;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Armor;
using CalamityMod.Items.Armor.Astral;
using CalamityMod.Items.Armor.Reaver;
using CalamityMod.Items.Armor.SnowRuffian;
using CalamityMod.Items.Armor.Sulphurous;
using CalamityMod.Items.Armor.TitanHeart;
using CalamityMod.Items.Armor.Umbraphile;
using CalamityMod.Items.Fishing.AstralCatches;
using CalamityMod.Items.VanillaArmorChanges;
using CalamityMod.NPCs;
@@ -103,7 +109,7 @@ namespace CalamityMod.CalPlayer
break;
case ItemID.FieryGreatsword:
target.AddBuff(BuffID.OnFire3, 180);
target.AddBuff(BuffID.OnFire3, 90);
break;
case ItemID.IceSickle:
@@ -138,7 +144,7 @@ namespace CalamityMod.CalPlayer
ItemLifesteal(target, item, damageDone);
ItemOnHit(item, damageDone, target.Center, hit.Crit, target.IsAnEnemy(false, true), targetIsDummy);
NPCDebuffs(target, item.CountsAsClass<MeleeDamageClass>(), item.CountsAsClass<RangedDamageClass>(), item.CountsAsClass<MagicDamageClass>(), item.CountsAsClass<SummonDamageClass>(), item.CountsAsClass<ThrowingDamageClass>(), item.CountsAsClass<SummonMeleeSpeedDamageClass>());
NPCDebuffs(target, item.CountsAsClass<MeleeDamageClass>(), item.CountsAsClass<RangedDamageClass>(), item.CountsAsClass<MagicDamageClass>(), item.CountsAsClass<SummonDamageClass>(), item.CountsAsClass<ThrowingDamageClass>(), item.CountsAsClass<SummonMeleeSpeedDamageClass>(), hit.Crit);
// Ursa Sergeant slash cooldown is reset on kill
if (ursaSergeant && target.life <= 0 && target.realLife == -1)
@@ -193,13 +199,14 @@ namespace CalamityMod.CalPlayer
// Arc Flash Ring lightning strike (Remember to change the one for projectile hits if applicable when you change this one!)
// This one has a lot less limits than the projectile one, but that's because vanilla broadsword code is limiting (wow so surprising)
if (arcFlashRing && (Main.rand.Next(0, 100) < 6))
bool spawnChance = (Main.rand.Next(0, 100) < 6);
if (arcFlashRing && spawnChance)
{
var source = item.GetSource_FromThis();
int damage = (int)((hit.Damage * 4f) * (hit.Crit ? 0.5f : 1)); // 400% damage (uneffected by crits)
Vector2 position = target.Center + new Vector2(0, -750);
int damage = (int)(((hit.Damage * 4f) * (hit.Crit ? 0.5f : 1)) / (Player.Calamity().adrenalineModeActive ? Player.Calamity().GetAdrenalineDamage() + 1 : 1)); // 400% damage (uneffected by crits and adrenaline)
Projectile.NewProjectile(source, position, new Vector2(0, 10), ProjectileType<FlashBolt>(), damage, 0f, Player.whoAmI, target.whoAmI);
Projectile bolt = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType<FlashBolt>(), damage, 0f, Player.whoAmI, target.whoAmI);
bolt.DamageType = hit.DamageType;
}
// Shattered Community tracks all damage dealt with Rage Mode (ignoring dummies).
@@ -233,25 +240,12 @@ namespace CalamityMod.CalPlayer
if (witheringWeaponEnchant)
witheringDamageDone += (int)(damageDone * (hit.Crit ? 2D : 1D));
cgn.IncreasedColdEffects_EskimoSet = eskimoSet;
cgn.IncreasedColdEffects_CryoStone = CryoStone;
cgn.IncreasedElectricityEffects_Unused = false;
cgn.IncreasedHeatEffects_Fireball = fireball;
cgn.IncreasedHeatEffects_CinnamonRoll = cinnamonRoll;
cgn.IncreasedHeatEffects_FireBoots = bootLevel;
cgn.IncreasedSicknessEffects_ToxicHeart = toxicHeart;
cgn.IncreasedWaterEffects_Amulet1 = sSpiritAmulet;
cgn.IncreasedWaterEffects_Amulet2 = dOfTheDeep;
cgn.IncreasedSicknessAndWaterEffects_EvergreenGin = evergreenGin;
cgn.IncreasedSicknessAndWaterEffects_CorrosiveSpine = corrosiveSpine;
cgn.IncreasedDebuffEffects_Amalgam = amalgam;
cgn.TypelessDebuffMultiplier = TypelessDebuffMultiplier;
cgn.HeatDebuffMultiplier = HeatDebuffMultiplier;
cgn.ColdDebuffMultiplier = ColdDebuffMultiplier;
cgn.SicknessDebuffMultiplier = SicknessDebuffMultiplier;
cgn.WaterDebuffMultiplier = WaterDebuffMultiplier;
cgn.ElectricDebuffMultiplier = ElectricDebuffMultiplier;
switch (proj.type)
{
@@ -396,27 +390,25 @@ namespace CalamityMod.CalPlayer
CalamityGlobalProjectile globalProj = proj.Calamity();
// Arc Flash Ring lightning strike (Remember to change the one for item hits if applicable when you change this one!)
// Minions ignore the chance penalty on penetration
bool spawnChance = (Main.rand.Next(0, 100) < MathHelper.Clamp(6 - proj.numHits, (proj.minion ? 6 : 1), 6));
if (arcFlashRing && spawnChance && proj.type != ProjectileType<FlashBolt>() && globalProj.spawnArcFlash)
bool spawnChance = (Main.rand.Next(0, 100) < 6);
if (arcFlashRing && spawnChance && proj.type != ProjectileType<FlashBolt>())
{
proj.active = true; // Okay so if a projectile manually kills itself on hit, it totally breaks the bolts. to prevent this we set them to active
var source = proj.GetSource_FromThis();
int damage = (int)((hit.Damage * 4f) * (hit.Crit ? 0.5f : 1)); // 400% damage (uneffected by crits)
Vector2 position = target.Center + new Vector2(0, -750);
int damage = (int)(((hit.Damage * 4f) * (hit.Crit ? 0.5f : 1)) / (Player.Calamity().adrenalineModeActive ? Player.Calamity().GetAdrenalineDamage() + 1 : 1)); // 400% damage (uneffected by crits and adrenaline)
Projectile bolt = Projectile.NewProjectileDirect(source, position, new Vector2(0, 10), ProjectileType<FlashBolt>(), damage, 0f, Player.whoAmI, target.whoAmI);
Projectile bolt = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType<FlashBolt>(), damage, 0f, Player.whoAmI, target.whoAmI, (globalProj.showArcFlash ? 0 : 1));
bolt.DamageType = hit.DamageType;
globalProj.spawnArcFlash = false;
// This is really only used for long lasting projectiles and contact damage minions
globalProj.arcFlashCooldown = 90;
globalProj.showArcFlash = false;
// This is really only used for piercing and long lasting projectiles so they dont flood the screen with bolts
globalProj.arcFlashCooldown = 30;
}
if (!proj.npcProj && !proj.trap && proj.friendly)
{
if (plaguebringerCarapace && FriendlyBeesList.Includes(proj.type))
if (plaguebringerCarapace && CalamityProjectileSets.IsFriendlyBeeProjectile[proj.type])
target.AddBuff(BuffType<Plague>(), 300);
// All projectiles fired from Soma Prime are marked using CalamityGlobalProjectile
@@ -574,11 +566,7 @@ namespace CalamityMod.CalPlayer
GeneralParticleHandler.SpawnParticle(orb);
}
int heal = (int)Math.Round(hit.Damage * 0.035);
if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
return;
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Main.player[proj.owner], heal, ProjectileType<AltTransfusionTrail>(), BalancingConstants.LifeStealRange);
Main.player[proj.owner].SpawnLifeStealProjectile(target, proj, ProjectileType<AltTransfusionTrail>(), (int)Math.Round(hit.Damage * 0.035));
}
if ((cgp.betterLifeBullet1 || cgp.betterLifeBullet2) && proj.numHits == 0)
@@ -594,13 +582,9 @@ namespace CalamityMod.CalPlayer
GeneralParticleHandler.SpawnParticle(orb);
}
int heal = (int)Math.Round(hit.Damage * 0.01);
if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
return;
for (int i = 0; i <= 2; i++)
{
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Main.player[proj.owner], heal, ProjectileType<AltTransfusionTrail>(), BalancingConstants.LifeStealRange);
Main.player[proj.owner].SpawnLifeStealProjectile(target, proj, ProjectileType<AltTransfusionTrail>(), (int)Math.Round(hit.Damage * 0.01), 0.75f);
}
}
@@ -608,7 +592,7 @@ namespace CalamityMod.CalPlayer
ProjLifesteal(target, proj, damageDone, hit.Crit);
ProjOnHit(proj, target.Center, hit.Crit, target.IsAnEnemy(false), targetIsDummy);
NPCDebuffs(target, proj.CountsAsClass<MeleeDamageClass>(), proj.CountsAsClass<RangedDamageClass>(), proj.CountsAsClass<MagicDamageClass>(), proj.CountsAsClass<SummonDamageClass>(), proj.CountsAsClass<ThrowingDamageClass>(), proj.CountsAsClass<SummonMeleeSpeedDamageClass>(), true, proj.noEnchantments);
NPCDebuffs(target, proj.CountsAsClass<MeleeDamageClass>(), proj.CountsAsClass<RangedDamageClass>(), proj.CountsAsClass<MagicDamageClass>(), proj.CountsAsClass<SummonDamageClass>(), proj.CountsAsClass<ThrowingDamageClass>(), proj.CountsAsClass<SummonMeleeSpeedDamageClass>(), hit.Crit, true, proj.noEnchantments);
// Shattered Community tracks all damage dealt with Rage Mode (ignoring dummies).
if (targetIsDummy)
@@ -627,9 +611,6 @@ namespace CalamityMod.CalPlayer
if (!item.CountsAsClass<MeleeDamageClass>() && Player.meleeEnchant == 7)
Projectile.NewProjectile(source, position, Player.velocity, ProjectileID.ConfettiMelee, 0, 0f, Player.whoAmI);
if (reaverDefense)
Player.lifeRegenTime += 1;
if (npcCheck)
{
if (item.CountsAsClass<MeleeDamageClass>() && hideOfDeus && hideOfDeusTimer == 0)
@@ -642,7 +623,7 @@ namespace CalamityMod.CalPlayer
}
if (astralStarRain && crit && astralStarRainCooldown <= 0)
{
astralStarRainCooldown = 60;
astralStarRainCooldown = AstralHelm.StarRainCooldown;
for (int n = 0; n < 3; n++)
{
int projectileType = Utils.SelectRandom(Main.rand, new int[]
@@ -653,7 +634,7 @@ namespace CalamityMod.CalPlayer
ProjectileID.StarCannonStar
});
int astralStarDamage = (int)Player.GetBestClassDamage().ApplyTo(120);
int astralStarDamage = (int)Player.GetBestClassDamage().ApplyTo(AstralHelm.StarDamage);
Projectile star = CalamityUtils.ProjectileRain(source, position, 400f, 100f, 500f, 800f, 12f, projectileType, astralStarDamage, 5f, Player.whoAmI);
if (star.whoAmI.WithinBounds(Main.maxProjectiles))
@@ -708,14 +689,11 @@ namespace CalamityMod.CalPlayer
if (theBee && lifeAndShieldCondition)
SoundEngine.PlaySound(SoundID.Item110, proj.Center);
if (reaverDefense)
Player.lifeRegenTime += 1;
if (npcCheck)
{
if (astralStarRain && crit && astralStarRainCooldown <= 0)
{
astralStarRainCooldown = 60;
astralStarRainCooldown = AstralHelm.StarRainCooldown;
for (int n = 0; n < 3; n++)
{
int projectileType = Utils.SelectRandom(Main.rand, new int[]
@@ -726,7 +704,7 @@ namespace CalamityMod.CalPlayer
ProjectileID.StarCannonStar
});
int astralStarDamage = (int)Player.GetBestClassDamage().ApplyTo(120);
int astralStarDamage = (int)Player.GetBestClassDamage().ApplyTo(AstralHelm.StarDamage);
Projectile star = CalamityUtils.ProjectileRain(source, position, 400f, 100f, 500f, 800f, 25f, projectileType, astralStarDamage, 5f, Player.whoAmI);
if (star.whoAmI.WithinBounds(Main.maxProjectiles))
@@ -838,8 +816,9 @@ namespace CalamityMod.CalPlayer
if (dynamoStemCells && MiniSwarmerCooldown <= 0 && proj.CountsAsClass<RangedDamageClass>())
{
MiniSwarmerCooldown = DynamoStemCells.MiniSwarmerCooldown;
Vector2 velocity = proj.velocity.SafeNormalize(Vector2.UnitY) * 19;
Vector2 directionToMouse = Main.MouseWorld - Player.Center;
directionToMouse.Normalize();
Vector2 velocity = directionToMouse * 19;
int MiniSwamerDamage = (int)Player.GetTotalDamage<RangedDamageClass>().ApplyTo(DynamoStemCells.MiniSwamerDamage);
Projectile.NewProjectile(source, Player.Center, velocity, ProjectileType<MiniatureFolly>(), MiniSwamerDamage, 2f, proj.owner);
}
@@ -1127,30 +1106,28 @@ namespace CalamityMod.CalPlayer
if (forbiddenCirclet && modProj.stealthStrike && forbiddenCooldown <= 0 && modProj.stealthStrikeHitCount < 3)
{
for (int index2 = 0; index2 < 6; index2++)
for (int index2 = 0; index2 < ForbiddenCirclet.EaterSpawnCount; index2++)
{
float xVector = Main.rand.Next(-35, 36) * 0.02f;
float yVector = Main.rand.Next(-35, 36) * 0.02f;
xVector *= 10f;
yVector *= 10f;
int damage = (int)Player.GetTotalDamage<RogueDamageClass>().ApplyTo(40);
float xVector = Main.rand.NextFloat(-7f, 7f);
float yVector = Main.rand.NextFloat(-7f, 7f);
int damage = (int)Player.GetTotalDamage<RogueDamageClass>().ApplyTo(ForbiddenCirclet.EaterDamage);
int eater = Projectile.NewProjectile(spawnSource, proj.Center.X, proj.Center.Y, xVector, yVector, ProjectileType<ForbiddenCircletEater>(), damage, proj.knockBack, proj.owner);
if (eater.WithinBounds(Main.maxProjectiles))
Main.projectile[eater].DamageType = DamageClass.Generic;
forbiddenCooldown = 15;
forbiddenCooldown = ForbiddenCirclet.EaterSpawnCooldown;
}
}
if (titanHeartSet && modProj.stealthStrike && titanCooldown <= 0 && modProj.stealthStrikeHitCount < 3)
{
int damage = (int)Player.GetTotalDamage<RogueDamageClass>().ApplyTo(40);
int damage = (int)Player.GetTotalDamage<RogueDamageClass>().ApplyTo(TitanHeartMask.ExplosionDamage);
Projectile.NewProjectile(spawnSource, proj.Center, Vector2.Zero, ProjectileType<TitanHeartBoom>(), damage, proj.knockBack, proj.owner, 1f, 0f);
SoundEngine.PlaySound(SoundID.Item14, proj.Center);
for (int dustexplode = 0; dustexplode < 180; dustexplode++)
for (int dustexplode = 0; dustexplode < 120; dustexplode++)
{
Vector2 dustd = Vector2.One.RotatedBy(MathHelper.ToRadians(dustexplode * 2)) * 1.7f;
Vector2 dustd = Vector2.One.RotatedBy(MathHelper.ToRadians(dustexplode * 3)) * 1.7f;
Dust dust = Dust.NewDustPerfect(proj.Center, Main.rand.NextBool() ? DustType<AstralBlue>() : DustType<AstralOrange>(), dustd, Alpha: 100);
dust.noGravity = true;
}
@@ -1160,6 +1137,7 @@ namespace CalamityMod.CalPlayer
if (raiderTalisman && modProj.stealthStrike)
{
raiderCritLifespan = CalamityUtils.SecondsToFrames(RaidersTalisman.RaiderCooldown);
// TO DO: Add nanotech here
Player.AddCooldown(RaiderBoost.ID, raiderCritLifespan, true, vampiricTalisman ? "Bloodfeast" : "default");
if (raiderSoundCooldown <= 0)
{
@@ -1173,9 +1151,7 @@ namespace CalamityMod.CalPlayer
// Umbraphile cannot trigger off of itself. It is guaranteed on stealth strikes and 20% chance otherwise.
if (umbraphileSet && ((modProj.stealthStrike && modProj.stealthStrikeHitCount < 3) || Main.rand.NextBool(5)))
{
// Umbraphile Rogue Blasts: 20%, softcap starts at 50 base damage
int umbraBlastDamage = CalamityUtils.DamageSoftCap(proj.damage * 0.20, 50);
int umbraBlastDamage = CalamityUtils.DamageSoftCap(proj.damage * UmbraphileHood.ExplosionDamageRatio, UmbraphileHood.ExplosionDamageSoftcap);
Projectile.NewProjectile(spawnSource, proj.Center, Vector2.Zero, ProjectileType<UmbraphileBoom>(), umbraBlastDamage, 0f, Player.whoAmI);
}
if (electricianGlove && modProj.stealthStrike && modProj.stealthStrikeHitCount < 3)
@@ -1200,7 +1176,7 @@ namespace CalamityMod.CalPlayer
#endregion
#region Debuffs
public void NPCDebuffs(NPC target, bool melee, bool ranged, bool magic, bool summon, bool rogue, bool whip, bool proj = false, bool noFlask = false)
public void NPCDebuffs(NPC target, bool melee, bool ranged, bool magic, bool summon, bool rogue, bool whip, bool crit, bool proj = false, bool noFlask = false)
{
if (melee && !noFlask) // Prevents Deep Sea Dumbell from snagging true melee debuff memes
{
@@ -1256,7 +1232,7 @@ namespace CalamityMod.CalPlayer
}
if (titanHeartMask)
{
target.AddBuff(BuffType<AstralInfectionDebuff>(), 120);
target.AddBuff(BuffType<AstralInfectionDebuff>(), TitanHeartMask.OnHitDebuffDuration);
}
}
if (summon)
@@ -1306,8 +1282,8 @@ namespace CalamityMod.CalPlayer
if (omegaBlueChestplate)
target.AddBuff(BuffType<HadopelagicPressure>(), 180);
if (sulphurSet)
target.AddBuff(BuffID.Poisoned, 60);
if (ilSpark && Player.IsUnderwater())
target.AddBuff(BuffID.Poisoned, SulphurousHelmet.SetBonusPoisonDuration);
if (ilSpark && Player.Calamity().countsAsAnyWet)
{
int duration = 60;
target.AddBuff(BuffType<StaticDischarge>(), duration);
@@ -1322,7 +1298,11 @@ namespace CalamityMod.CalPlayer
}
if (vexation)
{
target.AddBuff(BuffID.Venom, 120, false);
target.AddBuff(BuffID.Venom, 120, false);
}
if (snowRuffianSet && ranged && crit)
{
target.AddBuff(BuffID.Frostburn, SnowRuffianMask.SetBonusFrostburnDuration, false);
}
}
#endregion
@@ -1331,148 +1311,56 @@ namespace CalamityMod.CalPlayer
public void ProjLifesteal(NPC target, Projectile proj, int damage, bool crit)
{
CalamityGlobalProjectile modProj = proj.Calamity();
if (bloodflareSet && !target.IsAnEnemy(false) && !Player.moonLeech && target.lifeMax > 5)
if (target.IsAnEnemy(false))
{
if ((target.life < target.lifeMax * 0.5) && bloodflareHeartTimer <= 0)
if (bloodflareSet && !Player.moonLeech)
{
bloodflareHeartTimer = 300;
Item.NewItem(target.GetSource_Loot(), target.Hitbox, ItemID.Heart);
}
}
if (gladiatorSword && target.IsAnEnemy(false) && target.life <= 0 && target.Calamity().gladiatorOnKill && target.lifeMax > 5)
{
float healPower = 10 * Utils.GetLerpValue(300, 0, gladiatorTimer, true);
target.Calamity().gladiatorOnKill = false;
if (healPower >= 1)
{
Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, target.velocity * 0.5f, ProjectileType<GladiatorHealOrb>(), 0, 0, -1, (int)healPower);
gladiatorTimer = 300;
}
}
if (Main.LocalPlayer.lifeSteal > 0f && !Player.moonLeech && target.lifeMax > 5)
{
// Increases the degree to which Spectre Healing set contributes to the lifesteal cap
if (Player.ghostHeal && proj.CountsAsClass<MagicDamageClass>())
{
// This doesn't use Math.Round because it doesn't in vanilla
float cooldownMult = 0.2f;
cooldownMult -= proj.numHits * 0.05f;
if (cooldownMult < 0f)
cooldownMult = 0f;
float cooldown = damage * cooldownMult;
Main.LocalPlayer.lifeSteal -= cooldown;
}
if (vampiricTalisman && proj.CountsAsClass<RogueDamageClass>() && crit)
{
int heal = (int)Math.Round(damage * (Main.zenithWorld ? 0.01 : 0.008));
if (proj.Calamity().stealthStrike)
if ((target.life < target.lifeMax * 0.5) && bloodflareHeartTimer <= 0)
{
heal /= 2; //stealth strikes heal half due to generally dealing far more dmg
if (Main.zenithWorld)
heal *= -2; // IT YEARNS FOR MORE BLOOD
bloodflareHeartTimer = 300;
Item.NewItem(target.GetSource_Loot(), target.Hitbox, ItemID.Heart);
}
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
// Heals more if the ability is active
if (CalamityGlobalProjectile.CanSpawnLifeStealProjectile((raiderCritLifespan > 0) ? 1.5f : 1f, heal))
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange, BalancingConstants.LifeStealAccessoryCooldownMultiplier);
}
if (bloodyGlove && proj.CountsAsClass<RogueDamageClass>() && modProj.stealthStrike)
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, 2, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange, BalancingConstants.LifeStealAccessoryCooldownMultiplier);
if (target.IsAnEnemy(false))
if (gladiatorSword && target.life <= 0 && target.Calamity().gladiatorOnKill)
{
if (bloodflareThrowing && proj.CountsAsClass<ThrowingDamageClass>() && crit)
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, 2, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange, BalancingConstants.LifeStealSetBonusCooldownMultiplier);
if (bloodflareMelee && proj.IsTrueMelee())
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, 2, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange, BalancingConstants.LifeStealSetBonusCooldownMultiplier);
float healPower = 10 * Utils.GetLerpValue(300, 0, gladiatorTimer, true);
target.Calamity().gladiatorOnKill = false;
if (healPower >= 1)
{
Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, target.velocity * 0.5f, ProjectileType<GladiatorHealOrb>(), 0, 0, -1, (int)healPower);
gladiatorTimer = 300;
}
}
if (vampiricTalisman && proj.CountsAsClass<RogueDamageClass>() && crit && proj.numHits <1)
{
int heal = (int)Math.Round(damage * 0.008);
if (heal > 2)
heal = 2;
Player.SpawnLifeStealProjectile(target, proj, ProjectileID.VampireHeal, heal, (raiderCritLifespan > 0 && !proj.Calamity().stealthStrike) ? 1.3f : 1.6f);
}
if (bloodyGlove && proj.CountsAsClass<RogueDamageClass>() && modProj.stealthStrike && proj.numHits < 1)
//Nanotech has the same heal as Electrician's glove
Player.SpawnLifeStealProjectile(target, proj, ProjectileID.VampireHeal, electricianGlove ? 10 : 5, 2f);
if (bloodflareThrowing && proj.CountsAsClass<ThrowingDamageClass>() && crit)
Projectile.NewProjectile(proj.GetSource_OnHit(target), proj.Center, proj.velocity.SafeNormalize(Vector2.Zero) * Math.Min(((proj.velocity.Length() * proj.MaxUpdates) / 4f), 4f) * Main.rand.NextFloat(0.75f, 1.25f), ModContent.ProjectileType<BloodstoneHealOrb>(), 4, 0f, proj.owner);
if (proj.CountsAsClass<MagicDamageClass>() && Player.ActiveItem().CountsAsClass<MagicDamageClass>())
{
if (manaOverloader)
{
double healMult = 0.1;
healMult -= proj.numHits * healMult * 0.25;
int heal = (int)Math.Round(damage * healMult);
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (CalamityGlobalProjectile.CanSpawnLifeStealProjectile(healMult, heal))
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileType<ManaPolarizerHealOrb>(), BalancingConstants.LifeStealRange, BalancingConstants.LifeStealAccessoryCooldownMultiplier);
double healMult = 0.1D - proj.numHits * 0.025D;
Player.SpawnLifeStealProjectile(target, proj, ProjectileType<ManaPolarizerHealOrb>(), (int)Math.Round(damage * healMult), 1.5f);
}
}
if (silvaSet)
{
double healMult = 0.1;
healMult -= proj.numHits * healMult * 0.5;
int heal = (int)Math.Round(damage * healMult);
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (CalamityGlobalProjectile.CanSpawnLifeStealProjectile(healMult, heal))
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileType<SilvaOrb>(), BalancingConstants.LifeStealRange, BalancingConstants.LifeStealSetBonusCooldownMultiplier);
}
else if (proj.CountsAsClass<MagicDamageClass>() && Player.ActiveItem().CountsAsClass<MagicDamageClass>())
{
if (tarraMage)
if (ataxiaMage)
{
double healMult = 0.1;
healMult -= proj.numHits * healMult * 0.5;
int heal = (int)Math.Round(damage * healMult);
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (CalamityGlobalProjectile.CanSpawnLifeStealProjectile(healMult, heal))
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileType<ReaverHealOrb>(), BalancingConstants.LifeStealRange, BalancingConstants.LifeStealSetBonusCooldownMultiplier);
}
else if (ataxiaMage)
{
double healMult = 0.1;
healMult -= proj.numHits * healMult * 0.5;
int heal = (int)Math.Round(damage * healMult);
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (CalamityGlobalProjectile.CanSpawnLifeStealProjectile(healMult, heal))
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileType<HydrothermicHealOrb>(), BalancingConstants.LifeStealRange, BalancingConstants.LifeStealSetBonusCooldownMultiplier);
}
}
if (reaverDefense)
{
double healMult = 0.1;
healMult -= proj.numHits * healMult * 0.5;
int heal = (int)Math.Round(damage * healMult);
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (CalamityGlobalProjectile.CanSpawnLifeStealProjectile(healMult, heal))
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileType<ReaverHealOrb>(), BalancingConstants.LifeStealRange, BalancingConstants.LifeStealReaverTankCooldownMultiplier);
}
if (proj.CountsAsClass<ThrowingDamageClass>())
{
if (xerocSet && xerocDmg <= 0 && Player.ownedProjectileCounts[ProjectileType<EmpyreanEmber>()] < 3 && Player.ownedProjectileCounts[ProjectileType<EmpyreanBlast>()] < 3)
{
double healMult = 0.1;
healMult -= proj.numHits * healMult * 0.5;
int heal = (int)Math.Round(damage * healMult);
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (CalamityGlobalProjectile.CanSpawnLifeStealProjectile(healMult, heal))
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileType<EmpyreanHealOrb>(), BalancingConstants.LifeStealRange, BalancingConstants.LifeStealSetBonusCooldownMultiplier);
double healMult = 0.1D - proj.numHits * 0.05D;
Player.SpawnLifeStealProjectile(target, proj, ProjectileType<HydrothermicHealOrb>(), (int)Math.Round(damage * healMult), 1.25f);
}
}
}
@@ -1480,89 +1368,25 @@ namespace CalamityMod.CalPlayer
public void ItemLifesteal(NPC target, Item item, int damage)
{
if (bloodflareSet && target.IsAnEnemy(false) && target.lifeMax > 5)
if (target.IsAnEnemy(false))
{
if ((target.life < target.lifeMax * 0.5) && bloodflareHeartTimer <= 0)
if (bloodflareSet)
{
bloodflareHeartTimer = 300;
Item.NewItem(target.GetSource_Loot(), target.Hitbox, ItemID.Heart);
}
}
if (bloodflareMelee && item.CountsAsClass<MeleeDamageClass>() && target.lifeMax > 5)
{
if (target.IsAnEnemy(false) && Main.LocalPlayer.lifeSteal > 0f && !Player.moonLeech)
{
int heal = 4;
if (!Main.LocalPlayer.moonLeech)
if ((target.life < target.lifeMax * 0.5) && bloodflareHeartTimer <= 0)
{
Main.LocalPlayer.lifeSteal -= heal * BalancingConstants.LifeStealSetBonusCooldownMultiplier;
float lowestHealthCheck = 0f;
int healTarget = Player.whoAmI;
foreach (Player otherPlayer in Main.ActivePlayers)
{
if (!otherPlayer.dead && ((!Player.hostile && !otherPlayer.hostile) || Player.team == otherPlayer.team))
{
float playerDist = Vector2.Distance(target.Center, otherPlayer.Center);
if (playerDist < BalancingConstants.LifeStealRange && (otherPlayer.statLifeMax2 - otherPlayer.statLife) > lowestHealthCheck)
{
lowestHealthCheck = otherPlayer.statLifeMax2 - otherPlayer.statLife;
healTarget = otherPlayer.whoAmI;
}
}
}
// https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list
var source = Player.GetSource_FromThis(ReaverHeadTank.HealOrbEntitySourceContext);
Projectile.NewProjectile(source, target.Center, Vector2.Zero, ProjectileID.VampireHeal, 0, 0f, Player.whoAmI, healTarget, heal);
bloodflareHeartTimer = 300;
Item.NewItem(target.GetSource_Loot(), target.Hitbox, ItemID.Heart);
}
}
}
if (gladiatorSword && target.IsAnEnemy(false) && target.life <= 0 && target.Calamity().gladiatorOnKill && target.lifeMax > 5)
{
float healPower = 10 * Utils.GetLerpValue(300, 0, gladiatorTimer, true);
target.Calamity().gladiatorOnKill = false;
if (healPower >= 1)
if (gladiatorSword && target.life <= 0 && target.Calamity().gladiatorOnKill)
{
Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, target.velocity * 0.5f, ProjectileType<GladiatorHealOrb>(), 0, 0, -1, (int)healPower);
gladiatorTimer = 300;
}
}
if (reaverDefense)
{
if (Main.LocalPlayer.lifeSteal > 0f && !Player.moonLeech && target.lifeMax > 5)
{
double healMult = 0.1;
int heal = (int)Math.Round(damage * healMult);
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (heal > 0 && !Main.LocalPlayer.moonLeech)
float healPower = 10 * Utils.GetLerpValue(300, 0, gladiatorTimer, true);
target.Calamity().gladiatorOnKill = false;
if (healPower >= 1)
{
Main.LocalPlayer.lifeSteal -= heal * BalancingConstants.LifeStealReaverTankCooldownMultiplier;
float lowestHealthCheck = 0f;
int healTarget = Player.whoAmI;
for (int i = 0; i < Main.maxPlayers; i++)
{
Player otherPlayer = Main.player[i];
if (otherPlayer.active && !otherPlayer.dead && ((!Player.hostile && !otherPlayer.hostile) || Player.team == otherPlayer.team))
{
float playerDist = Vector2.Distance(target.Center, otherPlayer.Center);
if (playerDist < BalancingConstants.LifeStealRange && (otherPlayer.statLifeMax2 - otherPlayer.statLife) > lowestHealthCheck)
{
lowestHealthCheck = otherPlayer.statLifeMax2 - otherPlayer.statLife;
healTarget = otherPlayer.whoAmI;
}
}
}
// https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list
var source = Player.GetSource_FromThis(ReaverHeadTank.HealOrbEntitySourceContext);
Projectile.NewProjectile(source, target.Center, Vector2.Zero, ProjectileType<ReaverHealOrb>(), 0, 0f, Player.whoAmI, healTarget, heal);
Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, target.velocity * 0.5f, ProjectileType<GladiatorHealOrb>(), 0, 0, -1, (int)healPower);
gladiatorTimer = 300;
}
}
}
+1 -2
View File
@@ -61,8 +61,7 @@ namespace CalamityMod.CalPlayer.Dashes
// Constantly update the player's velocity direction.
Vector2 dashVel = Main.MouseWorld - player.Center;
dashVel = dashVel.SafeNormalize(Vector2.UnitX) * CalculateDashSpeed(player);
player.velocity = dashVel;
player.velocity = player.velocity.ToRotation().AngleTowards(dashVel.ToRotation(), 0.175f).ToRotationVector2() * CalculateDashSpeed(player);
// Fall way, way, faster than usual.
player.maxFallSpeed = 50f;
+2 -15
View File
@@ -15,24 +15,11 @@ namespace CalamityMod.CalPlayer.Dashes
public override DashCollisionType CollisionType => DashCollisionType.NoCollision;
public override bool IsOmnidirectional => false;
public int Time = 0;
public int lastDashDir = 0;
public override float CalculateDashSpeed(Player player) => (55f * player.moveSpeed);
public override float CalculateDashSpeed(Player player) => (48f);
public override void OnDashEffects(Player player)
{
if (Math.Sign(player.velocity.X) == lastDashDir && lastDashDir != 0)
{
player.Calamity().statisPenaltyTimer = player.Calamity().statisTimerMax;
if (player.Calamity().statisAnticheese < 6)
player.Calamity().statisAnticheese++;
}
else
player.Calamity().statisAnticheese = 0;
if (player.Calamity().statisAnticheese > 1)
player.velocity.X *= Utils.Remap(player.Calamity().statisAnticheese, 1, 6, 0.9f, 0.3f, true);
lastDashDir = Math.Sign(player.velocity.X);
lastDashDir = Math.Sign(player.velocity.X);
Time = 0;
for (int i = 0; i < 15; i++)
@@ -78,7 +65,7 @@ namespace CalamityMod.CalPlayer.Dashes
{
player.velocity.X = -140;
}
if (Time > 6)
if (Time > 8)
player.velocity.X *= 0.5f;
}
}
+6 -18
View File
@@ -24,23 +24,11 @@ namespace CalamityMod.CalPlayer.Dashes
public int Time = 0;
public Vector2 aimVel;
public bool strongVisuals = true;
public int lastDashDir = 0;
public override float CalculateDashSpeed(Player player) => (70f * player.moveSpeed);
public override float CalculateDashSpeed(Player player) => (64f);
public override void OnDashEffects(Player player)
{
if (Math.Sign(player.velocity.X) == lastDashDir && lastDashDir != 0)
{
player.Calamity().statisPenaltyTimer = player.Calamity().statisTimerMax;
if (player.Calamity().statisAnticheese < 6)
player.Calamity().statisAnticheese++;
}
else
player.Calamity().statisAnticheese = 0;
if (player.Calamity().statisAnticheese > 1)
player.velocity.X *= Utils.Remap(player.Calamity().statisAnticheese, 1, 6, 0.9f, 0.3f, true);
lastDashDir = Math.Sign(player.velocity.X);
strongVisuals = player.Calamity().voidSashVisuals;
Time = 0;
@@ -52,7 +40,7 @@ namespace CalamityMod.CalPlayer.Dashes
SoundEngine.PlaySound(sound with { Volume = 0.7f, Pitch = Main.rand.NextFloat(-0.15f, 0.15f) }, player.Center);
for (int i = 0; i < 40; i++)
{
Vector2 intenededVel = (MathHelper.TwoPi * i / 40f).ToRotationVector2() * 5.5f;
Vector2 intenededVel = (MathHelper.TwoPi * i / 40f).ToRotationVector2() * 3f;
Vector2 fxVel = new Vector2(intenededVel.X, intenededVel.Y * 2.3f).RotatedBy(player.velocity.ToRotation());
Vector2 fxPlace = player.Center + fxVel.RotatedBy(player.velocity.ToRotation()) + player.velocity.SafeNormalize(Vector2.UnitX) * 60;
@@ -61,8 +49,8 @@ namespace CalamityMod.CalPlayer.Dashes
}
for (int i = 0; i < 30; i++)
{
Vector2 intenededVel = (MathHelper.TwoPi * i / 30f).ToRotationVector2() * 5.5f;
Vector2 fxVel = new Vector2(intenededVel.X, intenededVel.Y * 2.3f).RotatedBy(player.velocity.ToRotation());
Vector2 intenededVel = (MathHelper.TwoPi * i / 30f).ToRotationVector2() * 3f;
Vector2 fxVel = new Vector2(intenededVel.X, intenededVel.Y * 2f).RotatedBy(player.velocity.ToRotation());
Vector2 fxPlace = player.Center + fxVel.RotatedBy(player.velocity.ToRotation()) + player.velocity.SafeNormalize(Vector2.UnitX) * 60;
Color dustColor = Main.rand.NextBool(3) ? Color.Indigo : Color.DarkOrchid;
@@ -109,7 +97,7 @@ namespace CalamityMod.CalPlayer.Dashes
SignusMetaball.SpawnParticle(fxPlace, fxVelocity * Main.rand.NextFloat(5, 8), 50f * Main.rand.NextFloat(0.7f, 1f), 8, new Vector2(0.8f, 1.2f), 0.18f, 0);
}
}
player.velocity.X *= 0.912f;
player.velocity.X *= 0.95f;
if (player.velocity.X > 140)
{
player.velocity.X = 140;
@@ -118,7 +106,7 @@ namespace CalamityMod.CalPlayer.Dashes
{
player.velocity.X = -140;
}
if (Time > 8)
if (Time > 10)
player.velocity.X *= 0.5f;
}
}
+6 -2
View File
@@ -60,10 +60,14 @@ namespace CalamityMod.CalPlayer.DrawLayers
{
for (int j = TopRange; j <= BottomRange; j++)
{
Tile tile = Main.tile[i, j];
if (!tile.HasTile || !TileID.Sets.IsAContainer[tile.TileType] || TileID.Sets.BasicDresser[tile.TileType])
continue;
int PotentialChest = Chest.FindChestByGuessing(i, j);
if (PotentialChest != -1 && !TileID.Sets.BasicDresser[Main.tile[i, j].TileType])
if (PotentialChest != -1)
{
// Adjust position ot the center of the chest
// Adjust position to the center of the chest
Chest chest = Main.chest[PotentialChest];
Vector2 chestCenter = new Vector2(chest.x + 1, chest.y + 1) * 16f;
float distance = Vector2.Distance(chestCenter, drawPlayer.MountedCenter);
-1
View File
@@ -21,7 +21,6 @@ namespace CalamityMod
public static readonly Condition PlayerHasRogueArmor = Create("HasRogueArmor", () => Main.LocalPlayer.Calamity().rogueStealthMax > 0f && Main.LocalPlayer.Calamity().wearingRogueArmor);
public static readonly Condition PlayerHasWings = Create("HasWings", () => Main.LocalPlayer.wingTimeMax > 0);
public static readonly Condition PlayerAlcoholPoisoned = Create("AlcoholPoison", () => Main.LocalPlayer.Calamity().alcoholPoisoning);
//
// Calamity Event Flag conditions
+5 -32
View File
@@ -1,6 +1,7 @@
using System.ComponentModel;
using System.Reflection;
using System.Runtime.Serialization;
using CalamityMod.Enums;
using CalamityMod.UI;
using CalamityMod.UI.DraedonsArsenal;
using CalamityMod.UI.Rippers;
@@ -27,36 +28,6 @@ namespace CalamityMod
ParticleLimit = (int)Utils.Clamp(ParticleLimit, MinParticleLimit, MaxParticleLimit);
}
internal static void SaveConfig()
{
// There is no current way to manually save a mod configuration file in tModLoader.
// The method which saves mod config files is private in ConfigManager, so reflection is used to invoke it.
try
{
MethodInfo saveMethodInfo = typeof(ConfigManager).GetMethod("Save", BindingFlags.Static | BindingFlags.NonPublic);
if (saveMethodInfo is not null)
saveMethodInfo.Invoke(null, [Instance]);
else
CalamityMod.Instance.Logger.Error("TML ConfigManager.Save reflection failed. Method signature has changed. Notify Calamity Devs if you see this in your log.");
}
catch
{
CalamityMod.Instance.Logger.Error("An error occurred while manually saving Calamity mod configuration. This may be due to a complex mod conflict. It is safe to ignore this error.");
}
}
#region Multi-Threading Settings
[Header("Multithreading")]
[BackgroundColor(192, 54, 64, 192)]
[SliderColor(224, 165, 56, 128)]
[Range(0f, 2f)]
[DefaultValue(0f)]
[Increment(1f)]
[DrawTicks]
public float SunkenSeaMultiThreading { get; set; }
#endregion
#region Graphics Changes
[Header("Graphics")]
@@ -299,8 +270,10 @@ namespace CalamityMod
public bool FasterFallHotkey { get; set; }
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
public bool CalamityArmorSetBonusDoubleTap { get; set; }
[SliderColor(224, 165, 56, 128)]
[DrawTicks]
[DefaultValue(SetBonusDoubleTapOptions.Auto)]
public SetBonusDoubleTapOptions SetBonusDoubleTap { get; set; }
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(false)]
+2 -2
View File
@@ -34,7 +34,7 @@ namespace CalamityMod
public override void Load()
{
// Initialize the EnemyStats struct as early as it is safe to do so
NPCStats.Load();
NPCStats.LoadDebuffs();
// Initialize Calamity Balance, since it is tightly coupled with the remaining systems
CalamityGlobalItem.LoadTweaks();
@@ -58,7 +58,7 @@ namespace CalamityMod
#region Unload
public override void Unload()
{
NPCStats.Unload();
NPCStats.UnloadDebuffs();
CalamityGlobalItem.UnloadTweaks();
CalamityGlobalProjectile.UnloadTweaks();
+2 -10
View File
@@ -1,13 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\tModLoader.targets" />
<PropertyGroup>
<AssemblyName>CalamityMod</AssemblyName>
<TargetFramework>net8.0</TargetFramework>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="tModLoader.CodeAssist" Version="0.1.5" />
</ItemGroup>
</Project>
Loaded 100 of 2353 files, more files were not shown because too many files have changed in this diff. Show more