diff --git a/Backgrounds/SunkenSeaBurrowsBG.cs b/Backgrounds/SunkenSeaBurrowsBG.cs
index e096f3fdfd..d464073728 100644
--- a/Backgrounds/SunkenSeaBurrowsBG.cs
+++ b/Backgrounds/SunkenSeaBurrowsBG.cs
@@ -3,26 +3,52 @@ using Terraria.ModLoader;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
+using ReLogic.Content;
+using Terraria.ID;
namespace CalamityMod.Backgrounds
{
- internal static class SunkenSeaBurrowsBG
+ public class SunkenSeaBurrowsBG : ModSystem
{
- public static void Load()
+ public override void Load()
{
if (Main.dedServ)
{
return;
}
- On_Main.DrawBackgroundBlackFill += DrawBurrowsBG;
+ On_Main.DrawBackgroundBlackFill += On_Main_DrawBackgroundBlackFill;
}
- public static float Transparency;
+ ///
+ /// This code runs because there is a system in vanilla that causes backgrounds to not draw if lighting is too low.
+ /// That would be fine, the problem arises because sloped tiles still block light the same way normal tiles do.
+ /// Which means that the background will occasionally be blocked by slopes as though said slopes were full squares.
+ /// This is a hacky method that sets the light level of every sloped tile *AT LEAST* high enough to render the background while in the Burrows.
+ ///
+ /// ENNWAY's note:
+ /// if this doesn't get fixed in 1.4.5 i am throwing really big rocks at unsuspecting re logic employees
+ ///
+ public override void PreUpdatePlayers()
+ {
+ if (!Main.dedServ && Main.LocalPlayer.InModBiome())
+ {
+ for (int i = 0; i < Main.screenWidth / 16; i++)
+ {
+ for (int j = 0; j < Main.screenWidth / 16; j++)
+ {
+ Point pos = (Main.screenPosition / 16).ToPoint() + new Point(i, j);
- public static float TransitionSpeed => 0.02f;
+ if (Main.tile[pos.X, pos.Y].Slope != SlopeType.Solid)
+ {
+ Lighting.AddLight(pos.X, pos.Y, TorchID.White, 0.1f);
+ }
+ }
+ }
+ }
+ }
- private static void DrawBurrowsBG(On_Main.orig_DrawBackgroundBlackFill orig, Main self)
+ private void On_Main_DrawBackgroundBlackFill(On_Main.orig_DrawBackgroundBlackFill orig, Main self)
{
if (Main.gameMenu || Main.screenPosition.Y + Main.screenHeight < ((int)Main.worldSurface) * 16f)
{
@@ -33,6 +59,15 @@ namespace CalamityMod.Backgrounds
orig(self);
+ DrawBurrowsBG();
+ }
+
+ public static float Transparency;
+
+ public static float TransitionSpeed => 0.02f;
+
+ private static void DrawBurrowsBG()
+ {
if (Main.LocalPlayer.InModBiome(ModContent.GetInstance()))
{
Transparency += TransitionSpeed;
@@ -75,54 +110,54 @@ namespace CalamityMod.Backgrounds
switch (Layers)
{
case 0:
- {
- zero.Y += 800f;
- break;
- }
+ {
+ zero.Y += 800f;
+ break;
+ }
case 1:
- {
- zero.Y += 200f;
- break;
- }
+ {
+ zero.Y += 200f;
+ break;
+ }
case 2:
- {
- zero.Y += 450f;
- break;
- }
+ {
+ zero.Y += 450f;
+ break;
+ }
case 3:
- {
- zero.Y += 45f;
- break;
- }
+ {
+ zero.Y += 45f;
+ break;
+ }
case 4:
- {
- zero.Y += 45f;
- break;
- }
+ {
+ zero.Y += 45f;
+ break;
+ }
}
vector2 *= Scale;
zero.Y -= num;
float LoopWidth = Scale * rectangle.Width;
- //float LoopHeight = Scale * rectangle.Height;
+ 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);
+ 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 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), ((Main.LocalPlayer.Center.Y / 16f) - 90) * 16f) + vector2 - vector) * vector3 + vector - Main.screenPosition - vector2 + zero;
var frame = rectangle;
- var color = Color.MediumTurquoise * Transparency;
+ var color = Color.White * Transparency;
Main.spriteBatch.Draw(BGTexture, drawPosition, frame, color, 0f, Vector2.Zero, Scale, SpriteEffects.None, 0f);
}
- //}
+ }
}
}
}
}
-}
\ No newline at end of file
+}
diff --git a/Balancing/BalancingChangesManager.cs b/Balancing/BalancingChangesManager.cs
index 1088cbea8e..a6b7bce540 100644
--- a/Balancing/BalancingChangesManager.cs
+++ b/Balancing/BalancingChangesManager.cs
@@ -1,5 +1,4 @@
-using System.Collections.Generic;
-using System.Linq;
+using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.NPCs.AstrumAureus;
using CalamityMod.NPCs.CeaselessVoid;
using CalamityMod.NPCs.Crabulon;
@@ -8,7 +7,6 @@ using CalamityMod.NPCs.ExoMechs.Artemis;
using CalamityMod.NPCs.OldDuke;
using CalamityMod.NPCs.ProfanedGuardians;
using CalamityMod.NPCs.Providence;
-using CalamityMod.NPCs.Ravager;
using CalamityMod.NPCs.SupremeCalamitas;
using CalamityMod.NPCs.Yharon;
using CalamityMod.Projectiles.DraedonsArsenal;
@@ -19,6 +17,8 @@ using CalamityMod.Projectiles.Rogue;
using CalamityMod.Projectiles.Summon;
using CalamityMod.Projectiles.Summon.MirrorofKalandraMinions;
using CalamityMod.Projectiles.Typeless;
+using System.Collections.Generic;
+using System.Linq;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -60,6 +60,9 @@ namespace CalamityMod.Balancing
bool AotCThrowCombo(Projectile p) =>
p.type == ProjectileType() && (p.ai[0] == 2 || p.ai[0] == 3);
+ bool HiveBeeFilter(Projectile p) =>
+ p.type == ProjectileType() && Main.player[p.owner].ActiveItem().type == ItemType();
+
UniversalBalancingChanges = new List()
{
// Nerf Crystal bullet shards by 45%
@@ -171,8 +174,8 @@ namespace CalamityMod.Balancing
// 45% resist to Mounted Scanner.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DestroyerIDs, Do(new ProjectileResistBalancingRule(0.55f, ProjectileType()))));
- // 40% resist to Meowthrower.
- NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DestroyerIDs, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType()))));
+ // 30% resist to Meowthrower.
+ NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DestroyerIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType()))));
// 25% resist to SHPC.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DestroyerIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType()))));
@@ -188,7 +191,7 @@ namespace CalamityMod.Balancing
#region Duke Fishron
// 20% vulnerability to The Hive's bees.
- NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.DukeFishron, Do(new ProjectileResistBalancingRule(1.2f, ProjectileType()))));
+ NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.DukeFishron, Do(new ProjectileSpecificRequirementBalancingRule(1.2f, HiveBeeFilter))));
// 35% vulnerability to Resurrection Butterfly.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.DukeFishron, Do(new ProjectileResistBalancingRule(1.35f, ProjectileType(), ProjectileType()))));
@@ -313,8 +316,8 @@ namespace CalamityMod.Balancing
// 50% resist to Dazzling Stabber Staff.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.StormWeaverIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType()))));
- // 50% resist to Elemental Axe.
- NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.StormWeaverIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType()))));
+ // 50% resist to Legion of Celestia.
+ NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.StormWeaverIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType()))));
// 50% resist to Pristine Fury's alt fire.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.StormWeaverIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType()))));
@@ -338,8 +341,8 @@ namespace CalamityMod.Balancing
// 50% resist to Eidolic Wail.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DevourerOfGodsIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType()))));
- // 35% resist to Venusian Trident's explosions.
- NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DevourerOfGodsIDs, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType(), ProjectileType()))));
+ // 25% resist to Corinth Prime's Grenades.
+ NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DevourerOfGodsIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType()))));
// 20% resist to Valediction's typhoons; will catch Nuclear Fury as well but that doesn't matter.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DevourerOfGodsIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType()))));
@@ -354,9 +357,6 @@ namespace CalamityMod.Balancing
#endregion
#region Exo Mechs: Ares
- // 50% resist to true melee.
- NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(ResistTrueMelee(0.5f))));
-
// 30% resist to Dynamic Pursuer.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType(), ProjectileType(), ProjectileType()))));
@@ -501,11 +501,11 @@ namespace CalamityMod.Balancing
#endregion
#region Supreme Calamitas: Soul Seekers
- // 85% resist to Chicken Cannon.
- NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), new ProjectileResistBalancingRule(0.15f, ProjectileType())));
+ // 80% resist to Chicken Cannon.
+ NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), new ProjectileResistBalancingRule(0.2f, ProjectileType())));
- // 50% resist to Subsuming Vortex.
- NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), new ProjectileResistBalancingRule(0.5f, ProjectileType(), ProjectileType(), ProjectileType())));
+ // 40% resist to Subsuming Vortex.
+ NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), new ProjectileResistBalancingRule(0.6f, ProjectileType(), ProjectileType(), ProjectileType())));
// 40% resist to Supernova.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), new ProjectileResistBalancingRule(0.6f, ProjectileType(), ProjectileType())));
@@ -515,15 +515,6 @@ namespace CalamityMod.Balancing
// 25% resist to Yharim's Crystal.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), new ProjectileResistBalancingRule(0.75f, ProjectileType())));
-
- // 10% resist to Celestus.
- NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), new ProjectileResistBalancingRule(0.9f, ProjectileType(), ProjectileType())));
-
- // 10% resist to Executioner's Blade stealth strikes.
- NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), new ProjectileResistBalancingRule(0.9f, ProjectileType())));
-
- // 10% resist to Surge Driver's alt click comets.
- NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), new ProjectileResistBalancingRule(0.9f, ProjectileType())));
#endregion
}
diff --git a/Buffs/CalamityGlobalBuff.cs b/Buffs/CalamityGlobalBuff.cs
index a8239f952a..37acd3132c 100644
--- a/Buffs/CalamityGlobalBuff.cs
+++ b/Buffs/CalamityGlobalBuff.cs
@@ -65,6 +65,10 @@ namespace CalamityMod.Buffs
player.pickSpeed += 0.05f;
player.GetAttackSpeed() -= 0.1f;
}
+ else if (type == BuffID.Weak)
+ {
+ player.GetAttackSpeed() += 0.051f;
+ }
else if (type == BuffID.Shine)
{
player.Calamity().shine = true;
diff --git a/Buffs/DamageOverTime/Daybroken.cs b/Buffs/DamageOverTime/Daybroken.cs
new file mode 100644
index 0000000000..854ac4e535
--- /dev/null
+++ b/Buffs/DamageOverTime/Daybroken.cs
@@ -0,0 +1,46 @@
+using Terraria;
+using Terraria.DataStructures;
+using Terraria.ID;
+using Terraria.Localization;
+using Terraria.ModLoader;
+
+namespace CalamityMod.Buffs.DamageOverTime
+{
+ public class Daybroken : ModBuff
+ {
+ public override LocalizedText DisplayName => Language.GetOrRegister("BuffName.Daybreak");
+ public override LocalizedText Description => Language.GetOrRegister("BuffDescription.Daybreak");
+ public override void SetStaticDefaults()
+ {
+ Main.debuff[Type] = true;
+ Main.pvpBuff[Type] = true;
+ Main.buffNoSave[Type] = true;
+ BuffID.Sets.LongerExpertDebuff[Type] = true;
+ }
+
+ public override void Update(Player player, ref int buffIndex)
+ {
+ player.Calamity().daybroken = true;
+ }
+
+ internal static void DrawEffects(PlayerDrawSet drawInfo, bool reducedEffects)
+ {
+ Player Player = drawInfo.drawPlayer;
+
+ if (Main.rand.Next(reducedEffects ? 8 : 4) < 3)
+ {
+ Dust solarDust = Dust.NewDustDirect(Player.position, Player.width, Player.height, DustID.OrangeTorch, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, reducedEffects ? 175 : 100, default, reducedEffects ? 2f : 3f);
+ solarDust.noGravity = true;
+ solarDust.velocity *= 2.8f;
+ solarDust.velocity.Y -= 0.5f;
+ if (Main.rand.NextBool(4))
+ {
+ solarDust.noGravity = false;
+ solarDust.scale *= 0.5f;
+ }
+ }
+
+ Lighting.AddLight((int)(Player.position.X / 16f), (int)(Player.position.Y / 16f + 1f), 1f, 0.3f, 0.1f);
+ }
+ }
+}
diff --git a/ExtraTextures/VanillaBuffs/Daybroken.png b/Buffs/DamageOverTime/Daybroken.png
similarity index 100%
rename from ExtraTextures/VanillaBuffs/Daybroken.png
rename to Buffs/DamageOverTime/Daybroken.png
diff --git a/Buffs/DamageOverTime/HolyFlames.cs b/Buffs/DamageOverTime/HolyFlames.cs
index eb50771d81..ca809682e8 100644
--- a/Buffs/DamageOverTime/HolyFlames.cs
+++ b/Buffs/DamageOverTime/HolyFlames.cs
@@ -30,24 +30,24 @@ namespace CalamityMod.Buffs.DamageOverTime
buffIndex--;
}
- internal static void DrawEffects(PlayerDrawSet drawInfo, bool hasDebuffResistance = false)
+ internal static void DrawEffects(PlayerDrawSet drawInfo)
{
Player Player = drawInfo.drawPlayer;
- if (Main.rand.NextBool(hasDebuffResistance ? 4 : 2))
+ if (Main.rand.NextBool(2))
{
Vector2 Vect = new Vector2(0f, Main.rand.NextBool(4) ? -5f : -9f).RotatedByRandom(MathHelper.ToRadians(25f)) * Main.rand.NextFloat(0.1f, 1.9f);
- CritSpark spark = new CritSpark(Player.Calamity().RandomDebuffVisualSpot, Vect, Main.rand.NextBool() ? Color.Coral : Color.OrangeRed, Color.Orange, (hasDebuffResistance ? 0.4f : 0.8f), 15, 2f, 1.9f);
+ CritSpark spark = new CritSpark(Player.Calamity().RandomDebuffVisualSpot, Vect, Main.rand.NextBool() ? Color.Coral : Color.OrangeRed, Color.Orange, 0.8f, 15, 2f, 1.9f);
GeneralParticleHandler.SpawnParticle(spark);
}
- if (Main.rand.NextBool(hasDebuffResistance ? 4 : 2))
+ if (Main.rand.NextBool(2))
{
Vector2 dustCorner = Player.position - 2f * Vector2.One;
Vector2 dustVel = Player.velocity + new Vector2(0f, Main.rand.NextFloat(-5f, -1f));
int d = Dust.NewDust(dustCorner, Player.width + 4, Player.height + 4, DustID.GemTopaz, dustVel.X, dustVel.Y);
Main.dust[d].noGravity = true;
- Main.dust[d].scale = hasDebuffResistance ? Main.rand.NextFloat(0.3f, 0.5f) : Main.rand.NextFloat(0.7f, 1.2f);
+ Main.dust[d].scale = Main.rand.NextFloat(0.7f, 1.2f);
Main.dust[d].alpha = 235;
}
}
diff --git a/Buffs/DamageOverTime/Nightwither.cs b/Buffs/DamageOverTime/Nightwither.cs
index 553cfc013b..6b3db2fead 100644
--- a/Buffs/DamageOverTime/Nightwither.cs
+++ b/Buffs/DamageOverTime/Nightwither.cs
@@ -37,16 +37,16 @@ namespace CalamityMod.Buffs.DamageOverTime
if (Main.rand.NextBool(hasDebuffResistance ? 4 : 2))
{
Vector2 Vect = new Vector2(0f, Main.rand.NextBool(4) ? -5f : -9f).RotatedByRandom(MathHelper.ToRadians(25f)) * Main.rand.NextFloat(0.1f, 1.9f);
- CritSpark spark = new CritSpark(Player.Calamity().RandomDebuffVisualSpot, Vect, Main.rand.NextBool() ? Color.Cyan : Color.DarkBlue, Color.DodgerBlue, (hasDebuffResistance ? 0.4f : 0.8f), 15, 2f, 1.9f);
+ CritSpark spark = new CritSpark(Player.Calamity().RandomDebuffVisualSpot, Vect, Main.rand.NextBool() ? Color.Cyan : Color.Turquoise, Color.PaleTurquoise, (hasDebuffResistance ? 0.4f : 0.8f), 15, 2f, 1.9f);
GeneralParticleHandler.SpawnParticle(spark);
}
for (int i = 0; i < (hasDebuffResistance ? 1 : 2); i++)
{
Vector2 dustCorner = Player.position - 2f * Vector2.One;
Vector2 dustVel = Player.velocity + new Vector2(0f, Main.rand.NextFloat(-11f, -2f));
- int d = Dust.NewDust(dustCorner, Player.width + 4, Player.height + 4, Main.rand.NextBool(4) ? 160 : 206, dustVel.X, dustVel.Y);
+ int d = Dust.NewDust(dustCorner, Player.width + 4, Player.height + 4, Main.rand.NextBool(4) ? 300 : 323, dustVel.X, dustVel.Y);
Main.dust[d].noGravity = true;
- Main.dust[d].scale = hasDebuffResistance ? Main.rand.NextFloat(0.3f, 0.4f) : Main.rand.NextFloat(0.5f, 0.7f);
+ Main.dust[d].scale = hasDebuffResistance ? Main.rand.NextFloat(0.3f, 0.3f) : Main.rand.NextFloat(0.5f, 0.5f);
Main.dust[d].alpha = 235;
}
}
@@ -57,16 +57,16 @@ namespace CalamityMod.Buffs.DamageOverTime
if (Main.rand.NextBool(3))
{
Vector2 Vect = new Vector2(0f, Main.rand.NextBool(4) ? -5f : -9f).RotatedByRandom(MathHelper.ToRadians(25f)) * Main.rand.NextFloat(0.1f, 1.9f);
- CritSpark spark = new CritSpark(npcSize, Vect, Main.rand.NextBool() ? Color.Cyan : Color.DarkBlue, Color.DodgerBlue, 0.8f, 15, 2f, 1.9f);
+ CritSpark spark = new CritSpark(npcSize, Vect, Main.rand.NextBool() ? Color.Cyan : Color.Turquoise, Color.PaleTurquoise, 0.8f, 15, 2f, 1.9f);
GeneralParticleHandler.SpawnParticle(spark);
}
for (int i = 0; i < 2; i++)
{
Vector2 dustCorner = npc.position - 2f * Vector2.One;
Vector2 dustVel = npc.velocity + new Vector2(0f, Main.rand.NextFloat(-11f, -2f));
- int d = Dust.NewDust(dustCorner, npc.width + 4, npc.height + 4, Main.rand.NextBool(4) ? 160 : 206, dustVel.X, dustVel.Y);
+ int d = Dust.NewDust(dustCorner, npc.width + 4, npc.height + 4, Main.rand.NextBool(4) ? 300 : 323, dustVel.X, dustVel.Y);
Main.dust[d].noGravity = true;
- Main.dust[d].scale = Main.rand.NextFloat(0.6f, 0.8f);
+ Main.dust[d].scale = Main.rand.NextFloat(0.5f, 0.5f);
Main.dust[d].alpha = 235;
}
}
diff --git a/Buffs/DamageOverTime/Nightwither.png b/Buffs/DamageOverTime/Nightwither.png
index 7a68497f9b..648834aa00 100644
Binary files a/Buffs/DamageOverTime/Nightwither.png and b/Buffs/DamageOverTime/Nightwither.png differ
diff --git a/Buffs/DamageOverTime/RancorBurn.cs b/Buffs/DamageOverTime/RancorBurn.cs
deleted file mode 100644
index cab69f7bf8..0000000000
--- a/Buffs/DamageOverTime/RancorBurn.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-using Terraria;
-using Terraria.ID;
-using Terraria.ModLoader;
-
-namespace CalamityMod.Buffs.DamageOverTime
-{
- public class RancorBurn : ModBuff
- {
- public override void SetStaticDefaults()
- {
- Main.debuff[Type] = true;
- Main.buffNoSave[Type] = true;
- Main.buffNoTimeDisplay[Type] = true;
- BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
- }
-
- public override void Update(NPC npc, ref int buffIndex)
- {
- if (npc.Calamity().RancorBurnTime < npc.buffTime[buffIndex])
- npc.Calamity().RancorBurnTime = npc.buffTime[buffIndex];
- npc.DelBuff(buffIndex);
- buffIndex--;
- }
- }
-}
diff --git a/Buffs/DamageOverTime/RancorBurn.png b/Buffs/DamageOverTime/RancorBurn.png
deleted file mode 100644
index f7e99e7e26..0000000000
Binary files a/Buffs/DamageOverTime/RancorBurn.png and /dev/null differ
diff --git a/Buffs/DamageOverTime/TrueVulnerabilityHex.cs b/Buffs/DamageOverTime/TrueVulnerabilityHex.cs
new file mode 100644
index 0000000000..ff9aeafec2
--- /dev/null
+++ b/Buffs/DamageOverTime/TrueVulnerabilityHex.cs
@@ -0,0 +1,79 @@
+using CalamityMod.Dusts;
+using CalamityMod.NPCs;
+using CalamityMod.Particles;
+using Microsoft.Xna.Framework;
+using Terraria;
+using Terraria.DataStructures;
+using Terraria.ID;
+using Terraria.ModLoader;
+
+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 override void SetStaticDefaults()
+ {
+ Main.debuff[Type] = true;
+ Main.pvpBuff[Type] = true;
+ Main.buffNoSave[Type] = true;
+ BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
+ BuffID.Sets.LongerExpertDebuff[Type] = true;
+ }
+
+ public override void Update(Player player, ref int buffIndex) => player.Calamity().trueVHex = true;
+
+ 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;
+ }
+
+ // Apply immunity timer.
+ if ((CalamityLists.enemyImmunityList.Contains(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)
+ {
+ if (Main.rand.NextBool())
+ {
+ Vector2 position = new(npc.position.X + Main.rand.NextFloat(npc.width), npc.position.Y + Main.rand.NextFloat(npc.height));
+ VoidSparkParticle voidSpark = new(position, -Vector2.UnitY.RotatedByRandom(MathHelper.Pi / 10f) * Main.rand.NextFloat(10f, 18f), false, 20, Main.rand.NextFloat(0.02f, 0.05f), Main.rand.NextBool() ? Color.Black : Color.Lerp(Color.Red, Color.Magenta, 0.35f));
+ GeneralParticleHandler.SpawnParticle(voidSpark);
+ }
+ }
+
+ internal static void DrawEffects(PlayerDrawSet drawInfo)
+ {
+ Player Player = drawInfo.drawPlayer;
+
+ if (Main.rand.NextBool())
+ {
+ VoidSparkParticle spark2 = new VoidSparkParticle(Player.Calamity().RandomDebuffVisualSpot, -Vector2.UnitY * Main.rand.NextFloat(6f, 10f), false, Main.rand.Next(18, 27), Main.rand.NextFloat(0.015f, 0.045f), Main.rand.NextBool() ? Color.Black : Color.Lerp(Color.Red, Color.Magenta, 0.65f));
+ GeneralParticleHandler.SpawnParticle(spark2);
+ }
+
+ Dust dust = Dust.NewDustPerfect(Player.Calamity().RandomDebuffVisualSpot, Main.rand.NextBool() ? 261 : (int)CalamityDusts.Brimstone);
+ dust.scale = Main.rand.NextFloat(0.6f, 0.7f);
+ dust.velocity = -Vector2.UnitY.RotatedByRandom(MathHelper.PiOver4) * Main.rand.NextFloat(0.5f, 2.5f);
+ if (dust.type == 261)
+ dust.color = Color.Lerp(Color.Orange, Color.White, Main.rand.NextFloat());
+
+ }
+ }
+}
diff --git a/Buffs/DamageOverTime/TrueVulnerabilityHex.png b/Buffs/DamageOverTime/TrueVulnerabilityHex.png
new file mode 100644
index 0000000000..2793cfdc04
Binary files /dev/null and b/Buffs/DamageOverTime/TrueVulnerabilityHex.png differ
diff --git a/Buffs/DamageOverTime/Voidfrost.cs b/Buffs/DamageOverTime/Voidfrost.cs
new file mode 100644
index 0000000000..fb3b694d61
--- /dev/null
+++ b/Buffs/DamageOverTime/Voidfrost.cs
@@ -0,0 +1,81 @@
+using CalamityMod.Particles;
+using Microsoft.Xna.Framework;
+using Terraria;
+using Terraria.DataStructures;
+using Terraria.ID;
+using Terraria.ModLoader;
+
+namespace CalamityMod.Buffs.DamageOverTime
+{
+ public class Voidfrost : ModBuff
+ {
+ public override void SetStaticDefaults()
+ {
+ Main.debuff[Type] = true;
+ Main.pvpBuff[Type] = true;
+ Main.buffNoSave[Type] = true;
+ BuffID.Sets.LongerExpertDebuff[Type] = true;
+ }
+
+ public override void Update(Player player, ref int buffIndex)
+ {
+ player.Calamity().voidfrost = true;
+ }
+
+ 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--;
+ }
+
+ internal static void DrawEffects(PlayerDrawSet drawInfo, bool hasDebuffResistance = false)
+ {
+ Player Player = drawInfo.drawPlayer;
+
+ if (Main.rand.NextBool(5))
+ {
+ Vector2 Vect = new Vector2(0f, Main.rand.NextBool(4) ? -5f : -9f).RotatedByRandom(MathHelper.ToRadians(25f)) * Main.rand.NextFloat(0.1f, 1.9f);
+ SnowflakeSparkle snowflake = new SnowflakeSparkle(Player.Calamity().RandomDebuffVisualSpot, Vect, Main.rand.NextBool() ? Color.Cyan : Color.DarkBlue, Color.DodgerBlue, 0.4f, 15, 2f, 1.9f);
+ GeneralParticleHandler.SpawnParticle(snowflake);
+ }
+ if (Main.rand.NextBool(40))
+ {
+ Vector2 Vect = new Vector2(0f, Main.rand.NextBool(4) ? -5f : -9f).RotatedByRandom(MathHelper.ToRadians(25f)) * Main.rand.NextFloat(0.1f, 1.9f);
+ MediumMistParticle mist = new MediumMistParticle(Player.Calamity().RandomDebuffVisualSpot, Vect, new Color(172, 238, 255), new Color(145, 170, 188), Main.rand.NextFloat(0.5f, 1.5f), 245 - Main.rand.Next(50), 0.02f);
+ GeneralParticleHandler.SpawnParticle(mist);
+ }
+ Vector2 dustCorner = Player.position - 2f * Vector2.One;
+ Vector2 dustVel = Player.velocity + new Vector2(0f, Main.rand.NextFloat(-11f, -2f));
+ int d = Dust.NewDust(dustCorner, Player.width + 4, Player.height + 4, Main.rand.NextBool(4) ? 20 : 113, dustVel.X, dustVel.Y);
+ Main.dust[d].noGravity = true;
+ Main.dust[d].scale = Main.rand.NextFloat(1f, 0.3f);
+ Main.dust[d].alpha = 10;
+ }
+
+ internal static void DrawEffects(NPC npc, ref Color drawColor)
+ {
+ Vector2 npcSize = npc.Center + new Vector2(Main.rand.NextFloat(-npc.width / 2, npc.width / 2), Main.rand.NextFloat(-npc.height / 2, npc.height / 2));
+ if (Main.rand.NextBool(5))
+ {
+ Vector2 Vect = new Vector2(0f, Main.rand.NextBool(4) ? -5f : -9f).RotatedByRandom(MathHelper.ToRadians(25f)) * Main.rand.NextFloat(0.1f, 1.9f);
+ SnowflakeSparkle snowflake = new SnowflakeSparkle(npcSize, Vect, Main.rand.NextBool() ? Color.Cyan : Color.DarkBlue, Color.DodgerBlue, 0.8f, 15, 2f, 1.9f);
+ GeneralParticleHandler.SpawnParticle(snowflake);
+ }
+ if (Main.rand.NextBool(40))
+ {
+ Vector2 Vect = new Vector2(0f, Main.rand.NextBool(4) ? -5f : -9f).RotatedByRandom(MathHelper.ToRadians(25f)) * Main.rand.NextFloat(0.1f, 1.9f);
+ MediumMistParticle mist = new MediumMistParticle(npcSize, Vect, new Color(172, 238, 255), new Color(145, 170, 188), Main.rand.NextFloat(0.5f, 1.5f), 245 - Main.rand.Next(50), 0.02f);
+ GeneralParticleHandler.SpawnParticle(mist);
+ }
+
+ Vector2 dustCorner = npc.position - 2f * Vector2.One;
+ Vector2 dustVel = npc.velocity + new Vector2(0f, Main.rand.NextFloat(-11f, -2f));
+ int d = Dust.NewDust(dustCorner, npc.width + 4, npc.height + 4, Main.rand.NextBool(4) ? 20 : 113, dustVel.X, dustVel.Y);
+ Main.dust[d].noGravity = true;
+ Main.dust[d].scale = Main.rand.NextFloat(1f, 0.3f);
+ Main.dust[d].alpha = 10;
+ }
+ }
+}
diff --git a/Buffs/DamageOverTime/Voidfrost.png b/Buffs/DamageOverTime/Voidfrost.png
new file mode 100644
index 0000000000..7a68497f9b
Binary files /dev/null and b/Buffs/DamageOverTime/Voidfrost.png differ
diff --git a/Buffs/DamageOverTime/VulnerabilityHex.cs b/Buffs/DamageOverTime/VulnerabilityHex.cs
index 6ea2f5c298..13cbad0a14 100644
--- a/Buffs/DamageOverTime/VulnerabilityHex.cs
+++ b/Buffs/DamageOverTime/VulnerabilityHex.cs
@@ -1,24 +1,23 @@
-using CalamityMod.NPCs;
+using CalamityMod.Dusts;
+using CalamityMod.NPCs;
using CalamityMod.Particles;
+using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
-using Microsoft.Xna.Framework;
-using ReLogic.Utilities;
-using CalamityMod.Dusts;
namespace CalamityMod.Buffs.DamageOverTime
{
public class VulnerabilityHex : ModBuff
{
- // This is the visual number displayed in ticks as the enemy takes damage from this debuff.
+ // The visual number displayed in ticks as the enemy takes damage.
public const int TickNumber = 666;
- // This is the exact DPS dealt by Vulnerability Hex to NPCs.
- public const int DPS = TickNumber * 4; // 2664 DPS
+ // The exact amount Vulnerability Hex reduces NPC life regen by.
+ public const int DPS = TickNumber * 4; // -2664 life regen, 1332 DPS
- public const int CalamityDuration = 24;
+ public const int CalamityDuration = 60;
public const int AflameDuration = 120;
public override void SetStaticDefaults()
diff --git a/Buffs/DamageOverTime/VulnerabilityHex.png b/Buffs/DamageOverTime/VulnerabilityHex.png
index 2793cfdc04..c547bc2e18 100644
Binary files a/Buffs/DamageOverTime/VulnerabilityHex.png and b/Buffs/DamageOverTime/VulnerabilityHex.png differ
diff --git a/Buffs/Potions/ShadowBuff.cs b/Buffs/Potions/ShadowBuff.cs
index 72ee6c1d8b..0244cb7c0b 100644
--- a/Buffs/Potions/ShadowBuff.cs
+++ b/Buffs/Potions/ShadowBuff.cs
@@ -15,7 +15,7 @@ namespace CalamityMod.Buffs.Potions
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().shadow = true;
- if (player.yoraiz0rEye < 2 && CalamityConfig.Instance.StealthInvisibility)
+ if (player.yoraiz0rEye < 2 && CalamityClientConfig.Instance.StealthInvisibility)
player.yoraiz0rEye = 2;
}
}
diff --git a/Buffs/Potions/TeslaBuff.cs b/Buffs/Potions/TeslaBuff.cs
deleted file mode 100644
index e5a8fac63b..0000000000
--- a/Buffs/Potions/TeslaBuff.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using Terraria;
-using Terraria.ModLoader;
-
-namespace CalamityMod.Buffs.Potions
-{
- public class TeslaBuff : ModBuff
- {
- public override void SetStaticDefaults()
- {
- Main.debuff[Type] = false;
- Main.pvpBuff[Type] = true;
- Main.buffNoSave[Type] = false;
- }
-
- public override void Update(Player player, ref int buffIndex)
- {
- player.Calamity().tesla = true;
- }
- }
-}
diff --git a/Buffs/StatBuffs/BossEffects.cs b/Buffs/StatBuffs/BossEffects.cs
index 46022d0e27..e32088eaa6 100644
--- a/Buffs/StatBuffs/BossEffects.cs
+++ b/Buffs/StatBuffs/BossEffects.cs
@@ -24,7 +24,7 @@ namespace CalamityMod.Buffs.StatBuffs
public override void ModifyBuffText(ref string buffName, ref string tip, ref int rare)
{
- if (CalamityConfig.Instance.BossZen)
+ if (CalamityServerConfig.Instance.BossZen)
tip = tip.Replace(":", ":\n" + this.GetLocalizedValue("ZenDescription"));
}
}
diff --git a/Buffs/StatDebuffs/PearlAura.cs b/Buffs/StatDebuffs/PearlAura.cs
index b7b27ee3df..ed0232c4b2 100644
--- a/Buffs/StatDebuffs/PearlAura.cs
+++ b/Buffs/StatDebuffs/PearlAura.cs
@@ -1,4 +1,6 @@
-using Terraria;
+using Microsoft.Xna.Framework;
+using Terraria;
+using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.StatDebuffs
@@ -19,5 +21,16 @@ namespace CalamityMod.Buffs.StatDebuffs
npc.DelBuff(buffIndex);
buffIndex--;
}
+
+ internal static void DrawEffects(NPC npc, ref Color drawColor)
+ {
+ if (Main.rand.NextBool(4))
+ {
+ int dustType = Main.rand.NextBool() ? DustID.GemSapphire : DustID.BlueCrystalShard;
+ Vector2 dustVelocity = Vector2.UnitX.RotatedBy(Main.rand.NextFloat(-MathHelper.Pi / 12f, 0f)) * (Main.rand.NextBool() ? -1f : 1f);
+ Dust theDust = Dust.NewDustDirect(npc.position, npc.width, npc.height, dustType, dustVelocity.X, dustVelocity.Y);
+ theDust.noGravity = true;
+ }
+ }
}
}
diff --git a/Buffs/Summon/ElementalAxeBuff.cs b/Buffs/Summon/LegionofCelestiaBuff.cs
similarity index 91%
rename from Buffs/Summon/ElementalAxeBuff.cs
rename to Buffs/Summon/LegionofCelestiaBuff.cs
index 1454140e20..9157620388 100644
--- a/Buffs/Summon/ElementalAxeBuff.cs
+++ b/Buffs/Summon/LegionofCelestiaBuff.cs
@@ -5,7 +5,7 @@ using Terraria.ModLoader;
namespace CalamityMod.Buffs.Summon
{
- public class ElementalAxeBuff : ModBuff
+ public class LegionofCelestiaBuff : ModBuff
{
public override void SetStaticDefaults()
{
@@ -17,7 +17,7 @@ namespace CalamityMod.Buffs.Summon
public override void Update(Player player, ref int buffIndex)
{
CalamityPlayer modPlayer = player.Calamity();
- if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0)
+ if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0)
{
modPlayer.eAxe = true;
}
diff --git a/Buffs/Summon/ElementalAxeBuff.png b/Buffs/Summon/LegionofCelestiaBuff.png
similarity index 100%
rename from Buffs/Summon/ElementalAxeBuff.png
rename to Buffs/Summon/LegionofCelestiaBuff.png
diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs
index fb8b456175..7efa1af247 100644
--- a/CalPlayer/CalamityPlayer.cs
+++ b/CalPlayer/CalamityPlayer.cs
@@ -85,9 +85,9 @@ namespace CalamityMod.CalPlayer
public double contactDamageReduction = 0D;
public double projectileDamageReduction = 0D;
public const float projectileMeleeWeaponMeleeSpeedMultiplier = 0f;
- public bool brimlashBusterBoost = false;
public int evilSmasherBoost = 0;
- public int hellbornBoost = 0;
+ public int burningSeaBurnOut = 0;
+ public int hellbornShots = 0;
public int searedPanCounter = 0;
public int searedPanTimer = 0;
public int potionTimer = 0;
@@ -95,7 +95,7 @@ namespace CalamityMod.CalPlayer
public bool blockAllDashes = false;
public bool resetHeightandWidth = false;
public bool noLifeRegen = false;
- public bool reducedHolyFlamesDamage = false;
+ public bool reducedDaybrokenDamage = false;
public bool reducedNightwitherDamage = false;
public float rangedAmmoCost = 1f;
public float healingPotionMultiplier = 1f;
@@ -179,6 +179,7 @@ namespace CalamityMod.CalPlayer
#region Timer and Counter
public int gaelSwipes = 0;
+ public int arsenalCooldown = 0;
public int dragoonDrizzlefishGelBoost = 1;
public int deadSunCounter = 6;
public int DragonsBreathAudioCooldown = 0;
@@ -488,6 +489,7 @@ namespace CalamityMod.CalPlayer
public bool unstableGraniteCore = false;
public bool regenator = false;
public bool theBee = false;
+ public bool shouldTriggerBeeCooldown = false;
public int theBeeCooldown = 0;
public bool alluringBait = false;
public bool enchantedPearl = false;
@@ -506,11 +508,14 @@ namespace CalamityMod.CalPlayer
public bool evasionScarf = false;
public bool badgeOfBravery = false;
public bool warbannerOfTheSun = false;
+ public bool tesla = false;
+ public bool teslaVisuals = true;
public bool cryogenSoul = false;
public bool ascendantInsignia = false;
public int ascendantInsigniaBuffTime = 0;
public int ascendantInsigniaCooldown = 0;
public bool ascendantTrail = false;
+ public bool frozenWingsCold = false;
public bool magmaStoneVisuals = true;
public bool eGauntlet = false;
public bool eGauntletVisuals = true; // Used to control dust spawned when swinging
@@ -549,7 +554,7 @@ namespace CalamityMod.CalPlayer
public bool aBrain = false;
public bool amalgam = false;
public bool raiderTalisman = false;
- public float raiderCritBonus = RaidersTalisman.RaiderBonus;
+ public float raiderCritLifespan = 0f;
public int raiderSoundCooldown = 0;
public bool gSabaton = false;
public int gSabatonHotkeyHoldTime = 0;
@@ -574,6 +579,7 @@ namespace CalamityMod.CalPlayer
public bool alchFlask = false;
public bool toxicHeart = false;
public bool abaddon = false;
+
public bool aeroStone = false;
public bool lifejelly = false;
public bool cleansingjelly = false;
@@ -638,6 +644,7 @@ namespace CalamityMod.CalPlayer
public bool royalGel = false;
public bool handWarmer = false;
public bool ursaSergeant = false;
+ public bool ursaSergeantVisual = false;
public bool scuttlersJewel = false;
public int scuttlerCooldown = 0;
public bool thiefsDime = false;
@@ -804,6 +811,7 @@ namespace CalamityMod.CalPlayer
public bool astralStarRain = false;
public int astralStarRainCooldown = 0;
public int AbaddonCooldown = 0;
+ public int ursaSergeantCooldown = 0;
public int AlchFlaskCooldown = 0;
public bool plagueReaper = false;
public bool plaguebringerPatronSet = false;
@@ -873,6 +881,7 @@ namespace CalamityMod.CalPlayer
#region Debuff
public bool alcoholPoisoning = false;
public bool shadowflame = false;
+ public bool daybroken = false;
public bool wDeath = false;
public bool dragonFire = false;
public bool vermillionFlux = false;
@@ -897,6 +906,7 @@ namespace CalamityMod.CalPlayer
public bool icarusFolly = false;
public bool weakPetrification = false;
public bool vHex = false;
+ public bool trueVHex = false;
public bool DoGExtremeGravity = false;
public bool warped = false;
public bool cDepth = false;
@@ -907,6 +917,7 @@ namespace CalamityMod.CalPlayer
public bool absorberAffliction = false;
public bool sulphurPoison = false;
public bool nightwither = false;
+ public bool voidfrost = false;
public bool eutrophication = false;
public bool iCantBreathe = false; //Frozen Lungs debuff
public bool cragsLava = false;
@@ -962,7 +973,6 @@ namespace CalamityMod.CalPlayer
public bool astralInjection = false;
public bool gravityNormalizer = false;
public bool flaskHoly = false;
- public bool tesla = false;
public bool galvanicCorrosion = false;
public bool sulphurskin = false;
public bool baguette = false;
@@ -1171,8 +1181,7 @@ namespace CalamityMod.CalPlayer
public bool omegaBlueTransformation;
public bool omegaBlueTransformationForce;
public bool omegaBlueTransformationPower;
- public bool redBow;
- public bool cocosFeather;
+ public bool ghostBracelet;
#endregion
#region Calamitas Enchant Effects
@@ -1731,9 +1740,12 @@ namespace CalamityMod.CalPlayer
evolution = false;
nanotech = false;
deadshotBrooch = false;
+ tesla = false;
+ teslaVisuals = true;
cryogenSoul = false;
ascendantInsignia = false;
ascendantTrail = false;
+ frozenWingsCold = false;
magmaStoneVisuals = true;
eGauntlet = false;
eGauntletVisuals = true;
@@ -1803,6 +1815,7 @@ namespace CalamityMod.CalPlayer
tracersElysian = false;
tracersSeraph = false;
ursaSergeant = false;
+ ursaSergeantVisual = false;
scuttlersJewel = false;
thiefsDime = false;
dynamoStemCells = false;
@@ -1825,7 +1838,7 @@ namespace CalamityMod.CalPlayer
CryoStoneVanity = false;
voidField = false;
copyrightInfringementShield = false;
- reducedHolyFlamesDamage = false;
+ reducedDaybrokenDamage = false;
reducedNightwitherDamage = false;
daedalusReflect = false;
@@ -1953,6 +1966,7 @@ namespace CalamityMod.CalPlayer
alcoholPoisoning = false;
shadowflame = false;
+ daybroken = false;
wDeath = false;
dragonFire = false;
vermillionFlux = false;
@@ -1978,6 +1992,7 @@ namespace CalamityMod.CalPlayer
elementalMix = false;
icarusFolly = false;
vHex = false;
+ trueVHex = false;
DoGExtremeGravity = false;
warped = false;
cDepth = false;
@@ -1989,6 +2004,7 @@ namespace CalamityMod.CalPlayer
snowmanNoseless = false;
sulphurPoison = false;
nightwither = false;
+ voidfrost = false;
eutrophication = false;
iCantBreathe = false;
cragsLava = false;
@@ -2024,7 +2040,6 @@ namespace CalamityMod.CalPlayer
astralInjection = false;
gravityNormalizer = false;
flaskHoly = false;
- tesla = false;
galvanicCorrosion = false;
sulphurskin = false;
baguette = false;
@@ -2223,8 +2238,7 @@ namespace CalamityMod.CalPlayer
omegaBlueTransformationPrevious = omegaBlueTransformation;
omegaBlueTransformation = omegaBlueTransformationForce = omegaBlueTransformationPower = false;
- redBow = false;
- cocosFeather = false;
+ ghostBracelet = false;
rageModeActive = false;
adrenalineModeActive = false;
@@ -2273,13 +2287,13 @@ namespace CalamityMod.CalPlayer
#region Screen Position Movements
public override void ModifyScreenPosition()
{
- if (CalamityConfig.Instance.ScreenshakePower == 0)
+ if (CalamityClientConfig.Instance.ScreenshakePower == 0)
return;
if (GeneralScreenShakePower > 0f)
{
- Main.screenPosition += Main.rand.NextVector2Circular(GeneralScreenShakePower * CalamityConfig.Instance.ScreenshakePower, GeneralScreenShakePower * CalamityConfig.Instance.ScreenshakePower);
- GeneralScreenShakePower = MathHelper.Clamp(GeneralScreenShakePower - 0.185f, 0f, 20f * CalamityConfig.Instance.ScreenshakePower);
+ Main.screenPosition += Main.rand.NextVector2Circular(GeneralScreenShakePower * CalamityClientConfig.Instance.ScreenshakePower, GeneralScreenShakePower * CalamityClientConfig.Instance.ScreenshakePower);
+ GeneralScreenShakePower = MathHelper.Clamp(GeneralScreenShakePower - 0.185f, 0f, 20f * CalamityClientConfig.Instance.ScreenshakePower);
}
}
#endregion
@@ -2327,6 +2341,7 @@ namespace CalamityMod.CalPlayer
#region Debuffs
heldGaelsLastFrame = false;
gaelSwipes = 0;
+ arsenalCooldown = 0;
andromedaState = AndromedaPlayerState.Inactive;
planarSpeedBoost = 0;
galileoCooldown = 0;
@@ -2346,7 +2361,7 @@ namespace CalamityMod.CalPlayer
spiritOriginConvertedCrit = 0;
rage = 0f;
adrenaline = 0f;
- raiderCritBonus = 0f;
+ raiderCritLifespan = 0f;
raiderSoundCooldown = 0;
gSabatonHotkeyHoldTime = 0;
gSabatonFall = 0;
@@ -2354,6 +2369,7 @@ namespace CalamityMod.CalPlayer
gSabatonTempJumpSpeed = 0;
astralStarRainCooldown = 0;
AbaddonCooldown = 0;
+ ursaSergeantCooldown = 0;
AlchFlaskCooldown = 0;
ascendantInsigniaCooldown = 0;
silvaMageCooldown = 0;
@@ -2383,6 +2399,7 @@ namespace CalamityMod.CalPlayer
noLifeRegen = false;
alcoholPoisoning = false;
shadowflame = false;
+ daybroken = false;
wDeath = false;
dragonFire = false;
vermillionFlux = false;
@@ -2408,6 +2425,7 @@ namespace CalamityMod.CalPlayer
elementalMix = false;
icarusFolly = false;
vHex = false;
+ trueVHex = false;
DoGExtremeGravity = false;
warped = false;
cDepth = false;
@@ -2419,6 +2437,7 @@ namespace CalamityMod.CalPlayer
abyssalDivingSuitPlateHits = 0;
sulphurPoison = false;
nightwither = false;
+ voidfrost = false;
eutrophication = false;
iCantBreathe = false;
cragsLava = false;
@@ -2492,7 +2511,6 @@ namespace CalamityMod.CalPlayer
astralInjection = false;
gravityNormalizer = false;
flaskHoly = false;
- tesla = false;
galvanicCorrosion = false;
sulphurskin = false;
baguette = false;
@@ -2683,11 +2701,11 @@ namespace CalamityMod.CalPlayer
#endregion
KameiBladeUseDelay = 0;
- brimlashBusterBoost = false;
AdrenalineTrail = false;
ascendantTrail = false;
evilSmasherBoost = 0;
- hellbornBoost = 0;
+ burningSeaBurnOut = 0;
+ hellbornShots = 0;
searedPanCounter = 0;
searedPanTimer = 0;
potionTimer = 0;
@@ -2711,7 +2729,7 @@ namespace CalamityMod.CalPlayer
// Respawn the player faster
// 3 seconds normally and configurable while a boss is alive between 15 and 60 seconds
- int respawnTimerSet = areThereAnyDamnBosses ? (CalamityConfig.Instance.PlayerRespawnTime_BossAlive * 60) : 180;
+ int respawnTimerSet = areThereAnyDamnBosses ? (CalamityServerConfig.Instance.PlayerRespawnTime_BossAlive * 60) : 180;
if (Player.respawnTimer > respawnTimerSet)
Player.respawnTimer = respawnTimerSet;
}
@@ -2762,7 +2780,7 @@ namespace CalamityMod.CalPlayer
if (CalamityKeybinds.GravistarSabatonHotkey.Current && gSabaton && Main.myPlayer == Player.whoAmI && (Player.velocity.Y != Player.oldVelocity.Y) && !Player.pulley && !Player.mount.Active && Player.grappling[0] == -1 && !Player.tongued)
{
gSabatonHotkeyHoldTime++;
- if (gSabatonHotkeyHoldTime < 60 && gSabatonHotkeyHoldTime % 3f == 0)
+ if (gSabatonHotkeyHoldTime < 30 && gSabatonHotkeyHoldTime % 3f == 0)
{
SpawnGravistarParticle();
}
@@ -2835,16 +2853,15 @@ namespace CalamityMod.CalPlayer
Player.statLife = Player.statLifeMax2;
}
}
- if (CalamityKeybinds.SandCloakHotkey.JustPressed && sandCloak && Main.myPlayer == Player.whoAmI && rogueStealth >= rogueStealthMax * 0.1f &&
- wearingRogueArmor && rogueStealthMax > 0 && !Player.HasCooldown(Cooldowns.SandCloak.ID))
+ if (CalamityKeybinds.SandCloakHotkey.JustPressed && sandCloak && Main.myPlayer == Player.whoAmI && !Player.HasCooldown(Cooldowns.SandCloak.ID))
{
- Player.AddCooldown(Cooldowns.SandCloak.ID, CalamityUtils.SecondsToFrames(30));
+ Player.AddCooldown(Cooldowns.SandCloak.ID, CalamityUtils.SecondsToFrames(20));
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType()));
- rogueStealth -= rogueStealthMax * 0.1f;
- int damage = Player.ApplyArmorAccDamageBonusesTo(7);
+ int damage = Player.ApplyArmorAccDamageBonusesTo(12);
+ float knockback = 2.5f;
- int veil = Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 8, Player.whoAmI);
+ int veil = Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, Player.whoAmI);
Main.projectile[veil].Center = Player.Center;
SoundEngine.PlaySound(SoundID.Item45, Player.Center);
}
@@ -3384,14 +3401,14 @@ namespace CalamityMod.CalPlayer
public override void UpdateEquips()
{
// TODO -- why is boss health bar code in Player.UpdateEquips and not a ModSystem
- CalamityConfig.Instance.BossHealthBarExtraInfo = shouldDrawSmallText;
+ CalamityClientConfig.Instance.BossHealthBarExtraInfo = shouldDrawSmallText;
// Putting this in GlobalItem will run multiple times for each slot, which this system already does, creating a slew of problems.
VanillaArmorChangeManager.ApplyPotentialEffectsTo(Player);
// If the config is enabled, vastly increase the player's base tile and wall placement speeds
// This stacks with the Brick Layer and Portable Cement Mixer
- if (CalamityConfig.Instance.FasterTilePlacement)
+ if (CalamityServerConfig.Instance.FasterTilePlacement)
{
Player.tileSpeed += 0.5f;
Player.wallSpeed += 0.5f;
@@ -3466,59 +3483,72 @@ namespace CalamityMod.CalPlayer
{
Player.AddBuff(ModContent.BuffType(), 60, true);
}
- if (gSabaton && Player.whoAmI == Main.myPlayer)
+ if (gSabaton)
{
- //While holding hotkey, but before slam, bring Y velocity closer to 0
- if (gSabatonHotkeyHoldTime < 60 && gSabatonHotkeyHoldTime != 0 && !gSabatonFalling)
+ if (Player.whoAmI == Main.myPlayer)
{
- Player.velocity.Y *= (60 - (gSabatonHotkeyHoldTime / 4f)) / 60f;
- }
- //Play sound a bit early so it goes in time with the fall
- if (gSabatonHotkeyHoldTime == 45 && !gSabatonFalling)
- {
- SoundEngine.PlaySound(new("CalamityMod/Sounds/Custom/GravistarCharge") { Volume = 0.3f });
- }
- //1 second passed, falling time
- if (gSabatonHotkeyHoldTime == 60)
- {
- gSabatonFalling = true;
- }
- //Cancel fall and don't give 'on ground' effects if on rope, on mount, grappled, or tongued
- if (Player.pulley || Player.mount.Active || Player.grappling[0] != -1 || Player.tongued)
- {
- gSabatonFall = 0;
- gSabatonFalling = false;
- }
- if (gSabatonFalling)
- {
- SpawnGravistarParticle();
-
- //Cap time converted to damage at 2 seconds
- if (gSabatonFall < 120)
- gSabatonFall++;
-
- Player.maxFallSpeed = 40f;
- Player.gravity = 1.3f;
- //If the player can fly during the fall, the physics gets a bit funky
- Player.controlJump = false;
-
- //Check if player hit some form of solid resistance (the ground)
- if (Player.oldVelocity.Y == Player.velocity.Y)
+ // While holding hotkey, but before slam, bring Y velocity closer to 0
+ if (gSabatonHotkeyHoldTime < 30 && gSabatonHotkeyHoldTime != 0 && !gSabatonFalling)
+ {
+ Player.velocity.Y *= (60 - (gSabatonHotkeyHoldTime / 2f)) / 60f;
+ }
+ // Play sound a bit early so it goes in time with the fall
+ if (gSabatonHotkeyHoldTime == 15 && !gSabatonFalling)
+ {
+ SoundEngine.PlaySound(new("CalamityMod/Sounds/Custom/GravistarCharge") { Volume = 0.3f });
+ }
+ // 0.5 seconds passed, falling time
+ if (gSabatonHotkeyHoldTime == 30)
+ {
+ gSabatonFalling = true;
+ Player.velocity.Y = 0.01f;
+ }
+ // Cancel fall and don't give 'on ground' effects if on rope, on mount, grappled, or tongued
+ // Also cancel fall if the player has upwards Y velocity (Goodbye Inner Tube cheese)
+ if (Player.velocity.Y < 0f || Player.pulley || Player.mount.Active || Player.grappling[0] != -1 || Player.tongued)
{
- var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType()));
- //Spawn explosion. ai[0] is used for transferring the recorded falling time
-
- int damage = Player.ApplyArmorAccDamageBonusesTo(Player.CalcIntDamage(GravistarSabaton.SlamDamage));
-
- Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 4f, Player.whoAmI, gSabatonFall);
gSabatonFall = 0;
gSabatonFalling = false;
- //Temporary jump speed is granted for 40 frames
- gSabatonTempJumpSpeed = 40;
+ }
+ if (gSabatonFalling)
+ {
+ SpawnGravistarParticle();
+
+ // Cap time converted to damage at 2 seconds
+ if (gSabatonFall < 120)
+ gSabatonFall++;
+
+ Player.maxFallSpeed = 40f;
+ Player.gravity = 1.3f;
+ // If the player can fly during the fall, the physics gets a bit funky
+ Player.controlJump = false;
+
+ // Check if player hit some form of solid resistance (the ground)
+ if (Player.oldVelocity.Y == Player.velocity.Y)
+ {
+ var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType()));
+ //Spawn explosion. ai[0] is used for transferring the recorded falling time
+
+ int damage = Player.ApplyArmorAccDamageBonusesTo(Player.CalcIntDamage(InterstellarStompers.SlamDamage));
+
+ Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 4f, Player.whoAmI, gSabatonFall);
+ gSabatonFall = 0;
+ gSabatonFalling = false;
+ // Temporary jump speed is granted for 40 frames
+ gSabatonTempJumpSpeed = 40;
+ }
}
}
-
}
+ else // Reset slam effect if the accessory is unequipped
+ {
+ gSabatonFall = 0;
+ gSabatonFalling = false;
+ }
+
+ // Reset The Evolution's same projectile DR if unequipped or the cooldown ends
+ if (!evolution || !Player.HasCooldown(GlobalDodge.ID))
+ projTypeJustHitBy = -1;
}
#endregion
@@ -3641,7 +3671,7 @@ namespace CalamityMod.CalPlayer
#region PostUpdateBuffs
public override void PostUpdateBuffs()
{
- if (Player.whoAmI == Main.myPlayer && CalamityConfig.Instance.VanillaCooldownDisplay)
+ if (Player.whoAmI == Main.myPlayer && CalamityClientConfig.Instance.VanillaCooldownDisplay)
{
if (Player.whoAmI == Main.myPlayer && Player.potionDelay != 0)
potionSick = true;
@@ -3867,9 +3897,6 @@ namespace CalamityMod.CalPlayer
#region Get Weapon Damage And KB
public override void ModifyWeaponDamage(Item item, ref StatModifier damage)
{
- if (fungalSymbiote && CalamityLists.MushroomWeaponIDs.Contains(item.type))
- damage += 0.1f;
-
if (item.CountsAsClass())
{
// Apply weapon modifier stealth strike damage bonus
@@ -3957,7 +3984,7 @@ namespace CalamityMod.CalPlayer
if (item.CountsAsClass())
{
var source = Player.GetSource_ItemUse(item);
- if (fungalSymbiote && CalamityLists.MushroomWeaponIDs.Contains(item.type) && Player.whoAmI == Main.myPlayer)
+ if (fungalSymbiote && Player.HasBuff(ModContent.BuffType()) && Player.whoAmI == Main.myPlayer)
{
if (Player.itemAnimation == (int)(Player.itemAnimationMax * 0.1) ||
Player.itemAnimation == (int)(Player.itemAnimationMax * 0.3) ||
@@ -4272,18 +4299,13 @@ namespace CalamityMod.CalPlayer
profanedCrystalAnimCounter = new KeyValuePair(0, 10);
}
- if (redBow)
+ if (ghostBracelet)
{
- Player.legs = EquipLoader.GetEquipSlot(Mod, "RedBow", EquipType.Legs);
- Player.body = EquipLoader.GetEquipSlot(Mod, "RedBow", EquipType.Body);
- Player.head = EquipLoader.GetEquipSlot(Mod, "RedBow", EquipType.Head);
- }
- if (cocosFeather)
- {
- Player.legs = EquipLoader.GetEquipSlot(Mod, "CocosFeather", EquipType.Legs);
- Player.body = EquipLoader.GetEquipSlot(Mod, "CocosFeather", EquipType.Body);
- Player.head = EquipLoader.GetEquipSlot(Mod, "CocosFeather", EquipType.Head);
+ Player.legs = EquipLoader.GetEquipSlot(Mod, "GhostBracelet", EquipType.Legs);
+ Player.body = EquipLoader.GetEquipSlot(Mod, "GhostBracelet", EquipType.Body);
+ Player.head = EquipLoader.GetEquipSlot(Mod, "GhostBracelet", EquipType.Head);
}
+
if (snowRuffianSet)
{
Player.wings = EquipLoader.GetEquipSlot(Mod, "SnowRuffianMask", EquipType.Wings);
@@ -4920,11 +4942,11 @@ namespace CalamityMod.CalPlayer
// Enabling the config while a player is loaded will show the timer immediately.
// But it won't start running until you save and quit and re-enter a world.
- if (CalamityConfig.Instance.SpeedrunTimer)
+ if (CalamityClientConfig.Instance.SpeedrunTimer)
CalamityMod.SpeedrunTimer.Restart();
- bool showWikiMessage = CalamityConfig.Instance.WikiStatusMessage;
- bool showVCMMMessage = CalamityConfig.Instance.VCMMStatusMessage && !CalamityMod.Instance.VCMMAvailable;
+ bool showWikiMessage = CalamityClientConfig.Instance.WikiStatusMessage;
+ bool showVCMMMessage = CalamityClientConfig.Instance.VCMMStatusMessage && !CalamityMod.Instance.VCMMAvailable;
bool showStartupMessages = showWikiMessage || showVCMMMessage;
// Set a random delay between 12 and 20 seconds. When this delay hits zero, startup messages display
diff --git a/CalPlayer/CalamityPlayerDashEffects.cs b/CalPlayer/CalamityPlayerDashEffects.cs
index 5c45619b75..1d37410d2e 100644
--- a/CalPlayer/CalamityPlayerDashEffects.cs
+++ b/CalPlayer/CalamityPlayerDashEffects.cs
@@ -21,7 +21,7 @@ namespace CalamityMod.CalPlayer
{
get
{
- return (String.IsNullOrEmpty(dashID) && Player.dashType == 0 && CalamityConfig.Instance.DefaultDashEnabled) ? DefaultDash.ID : dashID; //gives default dash ONLY if no custom or vanilla dash.
+ return (String.IsNullOrEmpty(dashID) && Player.dashType == 0 && CalamityServerConfig.Instance.DefaultDashEnabled) ? DefaultDash.ID : dashID; //gives default dash ONLY if no custom or vanilla dash.
}
set => dashID = value;
}
diff --git a/CalPlayer/CalamityPlayerDrawEffects.cs b/CalPlayer/CalamityPlayerDrawEffects.cs
index 45fb5d0a21..88af62a2d8 100644
--- a/CalPlayer/CalamityPlayerDrawEffects.cs
+++ b/CalPlayer/CalamityPlayerDrawEffects.cs
@@ -110,7 +110,7 @@ namespace CalamityMod.CalPlayer
}
// TODO -- rogue stealth visuals are an utter catastrophe and should be fully destroyed on next stealth rework
- if (calamityPlayer.rogueStealth > 0f && calamityPlayer.rogueStealthMax > 0f && Player.townNPCs < 3f && CalamityConfig.Instance.StealthInvisibility)
+ if (calamityPlayer.rogueStealth > 0f && calamityPlayer.rogueStealthMax > 0f && Player.townNPCs < 3f && CalamityClientConfig.Instance.StealthInvisibility)
{
// A translucent orchid color, the rogue class color
float colorValue = calamityPlayer.rogueStealth / calamityPlayer.rogueStealthMax * 0.9f; //0 to 0.9
@@ -208,6 +208,9 @@ namespace CalamityMod.CalPlayer
if (calamityPlayer.astralInfection && drawInfo.shadow == 0f)
AstralInfectionDebuff.DrawEffects(drawInfo);
+ if (calamityPlayer.auricRebuke && drawInfo.shadow == 0f)
+ AuricRebuke.DrawEffects(drawInfo);
+
if (calamityPlayer.bBlood && drawInfo.shadow == 0f)
BurningBlood.DrawEffects(drawInfo);
@@ -223,14 +226,9 @@ namespace CalamityMod.CalPlayer
if (calamityPlayer.cDepth && drawInfo.shadow == 0f)
CrushDepth.DrawEffects(drawInfo);
- if (calamityPlayer.vermillionFlux && drawInfo.shadow == 0f)
- VermillionFlux.DrawEffects(drawInfo);
-
- if (calamityPlayer.auricRebuke && drawInfo.shadow == 0f)
- AuricRebuke.DrawEffects(drawInfo);
-
- if (calamityPlayer.staticDischarge && drawInfo.shadow == 0f)
- StaticDischarge.DrawEffects(drawInfo);
+ // Daybroken's visual effects are reduced if the player resists it
+ if (calamityPlayer.daybroken && drawInfo.shadow == 0f)
+ Daybroken.DrawEffects(drawInfo, reducedDaybrokenDamage);
if (calamityPlayer.dragonFire && drawInfo.shadow == 0f)
Dragonfire.DrawEffects(drawInfo);
@@ -255,11 +253,7 @@ namespace CalamityMod.CalPlayer
// Holy Flames, Holy Inferno and Banishing Fire share the same visual effects
if (drawInfo.shadow == 0f && (calamityPlayer.hFlames || calamityPlayer.hInferno || calamityPlayer.banishingFire))
- {
- // You cannot "resist" Holy Inferno or Banishing Fire, so if you have either of those the visuals are always full strength
- bool resistsHolyFlames = !calamityPlayer.hInferno && !calamityPlayer.banishingFire && reducedHolyFlamesDamage;
- HolyFlames.DrawEffects(drawInfo, resistsHolyFlames);
- }
+ HolyFlames.DrawEffects(drawInfo);
// Icarus' Folly has visual effects but they are mutually exclusive with all Holy Flames variations to prevent visual clutter
else if (calamityPlayer.icarusFolly && drawInfo.shadow == 0f)
@@ -275,6 +269,9 @@ namespace CalamityMod.CalPlayer
if (calamityPlayer.nightwither && drawInfo.shadow == 0f) // Looks weaker if you have Moon Stone equipped
Nightwither.DrawEffects(drawInfo, reducedNightwitherDamage);
+ if (calamityPlayer.voidfrost && drawInfo.shadow == 0f)
+ Voidfrost.DrawEffects(drawInfo);
+
if (calamityPlayer.pFlames && drawInfo.shadow == 0f)
Plague.DrawEffects(drawInfo);
@@ -284,6 +281,9 @@ namespace CalamityMod.CalPlayer
if (calamityPlayer.shadowflame && drawInfo.shadow == 0f)
Shadowflame.DrawEffects(drawInfo);
+ if (calamityPlayer.staticDischarge && drawInfo.shadow == 0f)
+ StaticDischarge.DrawEffects(drawInfo);
+
if (calamityPlayer.sulphurPoison && drawInfo.shadow == 0f)
SulphuricPoisoning.DrawEffects(drawInfo);
@@ -291,9 +291,15 @@ namespace CalamityMod.CalPlayer
if (calamityPlayer.tRegen && drawInfo.shadow == 0f)
TarraLifeRegen.DrawEffects(drawInfo);
+ if (calamityPlayer.trueVHex && drawInfo.shadow == 0f)
+ TrueVulnerabilityHex.DrawEffects(drawInfo);
+
if (calamityPlayer.vaporfied && drawInfo.shadow == 0f)
Vaporfied.DrawEffects(drawInfo);
+ if (calamityPlayer.vermillionFlux && drawInfo.shadow == 0f)
+ VermillionFlux.DrawEffects(drawInfo);
+
if (calamityPlayer.vHex && drawInfo.shadow == 0f)
VulnerabilityHex.DrawEffects(drawInfo);
#endregion
@@ -446,7 +452,7 @@ namespace CalamityMod.CalPlayer
ModContent.ItemType(),
ModContent.ItemType(),
ModContent.ItemType(),
- ModContent.ItemType(),
+ ModContent.ItemType(),
ModContent.ItemType(),
ModContent.ItemType(),
ModContent.ItemType(),
diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs
index 73ddee1d2b..0b99c5dae4 100644
--- a/CalPlayer/CalamityPlayerHitHurt.cs
+++ b/CalPlayer/CalamityPlayerHitHurt.cs
@@ -1,4 +1,5 @@
using System;
+using System.Collections.Generic;
using System.Linq;
using CalamityMod.Balancing;
using CalamityMod.Buffs.Cooldowns;
@@ -19,10 +20,13 @@ using CalamityMod.Items.Armor.LunicCorps;
using CalamityMod.Items.Armor.Silva;
using CalamityMod.Items.Armor.Wulfrum;
using CalamityMod.Items.Mounts;
+using CalamityMod.Items.Tools;
using CalamityMod.Items.VanillaArmorChanges;
+using CalamityMod.Items.Weapons.DraedonsArsenal;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.NPCs;
using CalamityMod.NPCs.Abyss;
+using CalamityMod.NPCs.Cryogen;
using CalamityMod.NPCs.NormalNPCs;
using CalamityMod.NPCs.Other;
using CalamityMod.NPCs.ProfanedGuardians;
@@ -38,12 +42,11 @@ using CalamityMod.Projectiles.Typeless;
using CalamityMod.UI;
using CalamityMod.World;
using Microsoft.Xna.Framework;
-using Mono.Cecil;
using Terraria;
using Terraria.Audio;
using Terraria.Chat;
using Terraria.DataStructures;
-using Terraria.GameContent.Events;
+using Terraria.Graphics.Renderers;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.Localization;
@@ -442,6 +445,10 @@ namespace CalamityMod.CalPlayer
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Shadowflame").Format(Player.name));
}
+ if (daybroken)
+ {
+ damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Daybroken").Format(Player.name));
+ }
if (bBlood)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.BurningBlood" + Main.rand.Next(1, 2 + 1)).Format(Player.name));
@@ -490,10 +497,6 @@ namespace CalamityMod.CalPlayer
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.ManaBurn").Format(Player.name));
}
- if (bloodyMary || everclear || evergreenGin || fireball || margarita || moonshine || moscowMule || redWine || screwdriver || starBeamRye || tequila || tequilaSunrise || vodka || whiteWine || Player.tipsy)
- {
- damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AlcoholSmall").Format(Player.name));
- }
if (witheredDebuff)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Withered").Format(Player.name));
@@ -508,7 +511,7 @@ namespace CalamityMod.CalPlayer
if (Main.zenithWorld)
SoundEngine.PlaySound(LeonDeathNoiseRE4_ForGFB, Player.Center);
- if (NorfleetCounter >= 3 && NorfleetCounter < 1000)
+ if (NorfleetCounter > 3 && NorfleetCounter < 1000)
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Norfleet").Format(Player.name));
NorfleetCounter = 0;
@@ -585,11 +588,45 @@ namespace CalamityMod.CalPlayer
{
float meleeBoost = MathHelper.Lerp(0f, FrostArmorSetChange.ProximityBoost, 1 - DistanceInterpolant);
modifiers.SourceDamage += meleeBoost;
+
+ if (meleeBoost >= FrostArmorSetChange.ProximityBoost * 0.5f)
+ {
+ float intensity = meleeBoost / FrostArmorSetChange.ProximityBoost;
+ SoundEngine.PlaySound(Cryogen.HitSound with { Volume = intensity - 0.2f }, Player.Center);
+ }
+ if (meleeBoost > 0f)
+ {
+ int count = (int)(30f * meleeBoost);
+ for (int i = 0; i < count; i++)
+ {
+ Vector2 velocity = Main.rand.NextVector2Unit() * (5f + 100f * meleeBoost);
+ float scale = Main.rand.NextFloat(0.5f, 1f) + 0.5f * meleeBoost / FrostArmorSetChange.ProximityBoost;
+ Particle sparkle = new CritSpark(target.Center, velocity, Color.White, Color.DodgerBlue, scale, 15, 0.1f, scale * 2f);
+ GeneralParticleHandler.SpawnParticle(sparkle);
+ }
+ }
}
else if (item.CountsAsClass())
{
float rangedBoost = MathHelper.Lerp(0f, FrostArmorSetChange.ProximityBoost, DistanceInterpolant);
modifiers.SourceDamage += rangedBoost;
+
+ if (rangedBoost >= FrostArmorSetChange.ProximityBoost * 0.5f)
+ {
+ float intensity = rangedBoost / FrostArmorSetChange.ProximityBoost;
+ SoundEngine.PlaySound(Cryogen.HitSound with { Volume = intensity - 0.2f }, Player.Center);
+ }
+ if (rangedBoost > 0f)
+ {
+ int count = (int)(30f * rangedBoost);
+ for (int i = 0; i < count; i++)
+ {
+ Vector2 velocity = Main.rand.NextVector2Unit() * (5f + 100f * rangedBoost);
+ float scale = Main.rand.NextFloat(0.5f, 1f) + 0.5f * rangedBoost / FrostArmorSetChange.ProximityBoost;
+ Particle sparkle = new CritSpark(target.Center, velocity, Color.White, Color.DodgerBlue, scale, 15, 0.1f, scale * 2f);
+ GeneralParticleHandler.SpawnParticle(sparkle);
+ }
+ }
}
}
}
@@ -671,11 +708,45 @@ namespace CalamityMod.CalPlayer
{
float meleeBoost = MathHelper.Lerp(0f, FrostArmorSetChange.ProximityBoost, 1 - DistanceInterpolant);
modifiers.SourceDamage += meleeBoost;
+
+ if (meleeBoost >= FrostArmorSetChange.ProximityBoost * 0.5f)
+ {
+ float intensity = meleeBoost / FrostArmorSetChange.ProximityBoost;
+ SoundEngine.PlaySound(Cryogen.HitSound with { Volume = intensity - 0.2f }, Player.Center);
+ }
+ if (meleeBoost > 0f)
+ {
+ int count = (int)(30f * meleeBoost);
+ for (int i = 0; i < count; i++)
+ {
+ Vector2 velocity = Main.rand.NextVector2Unit() * (5f + 100f * meleeBoost);
+ float scale = Main.rand.NextFloat(0.5f, 1f) + 0.5f * meleeBoost / FrostArmorSetChange.ProximityBoost;
+ Particle sparkle = new CritSpark(target.Center, velocity, Color.White, Color.DodgerBlue, scale, 15, 0.1f, scale * 2f);
+ GeneralParticleHandler.SpawnParticle(sparkle);
+ }
+ }
}
else if (proj.CountsAsClass())
{
float rangedBoost = MathHelper.Lerp(0f, FrostArmorSetChange.ProximityBoost, DistanceInterpolant);
modifiers.SourceDamage += rangedBoost;
+
+ if (rangedBoost >= FrostArmorSetChange.ProximityBoost * 0.5f)
+ {
+ float intensity = rangedBoost / FrostArmorSetChange.ProximityBoost;
+ SoundEngine.PlaySound(Cryogen.HitSound with { Volume = intensity - 0.2f }, Player.Center);
+ }
+ if (rangedBoost > 0f)
+ {
+ int count = (int)(30f * rangedBoost);
+ for (int i = 0; i < count; i++)
+ {
+ Vector2 velocity = Main.rand.NextVector2Unit() * (5f + 100f * rangedBoost);
+ float scale = Main.rand.NextFloat(0.5f, 1f) + 0.5f * rangedBoost / FrostArmorSetChange.ProximityBoost;
+ Particle sparkle = new CritSpark(target.Center, velocity, Color.White, Color.DodgerBlue, scale, 15, 0.1f, scale * 2f);
+ GeneralParticleHandler.SpawnParticle(sparkle);
+ }
+ }
}
}
@@ -692,32 +763,8 @@ namespace CalamityMod.CalPlayer
{
Item heldItem = Player.ActiveItem();
- bool wearingForbiddenSet = Player.armor[0].type == ItemID.AncientBattleArmorHat && Player.armor[1].type == ItemID.AncientBattleArmorShirt && Player.armor[2].type == ItemID.AncientBattleArmorPants;
-
- bool forbiddenWithMagicWeapon = wearingForbiddenSet && heldItem.CountsAsClass();
- bool gemTechBlueGem = GemTechSet && GemTechState.IsBlueGemActive;
-
- bool crossClassNerfDisabled = forbiddenWithMagicWeapon || fearmongerSet || gemTechBlueGem || profanedCrystalBuffs || DD2Event.Ongoing;
- crossClassNerfDisabled |= CalamityLists.DisabledSummonerNerfMinions.Contains(proj.type);
-
- // If this projectile is a summon, its owner is holding an item, and the cross class nerf isn't disabled from equipment:
- if (isSummon && heldItem.type > ItemID.None && !crossClassNerfDisabled)
- {
- bool heldItemIsClassedWeapon = !heldItem.CountsAsClass() && (
- heldItem.CountsAsClass() ||
- heldItem.CountsAsClass() ||
- heldItem.CountsAsClass() ||
- heldItem.CountsAsClass()
- );
-
- bool heldItemIsTool = heldItem.pick > 0 || heldItem.axe > 0 || heldItem.hammer > 0;
- bool heldItemCanBeUsed = heldItem.useStyle != ItemUseStyleID.None;
- bool heldItemIsAccessoryOrAmmo = heldItem.accessory || heldItem.ammo != AmmoID.None;
- bool heldItemIsExcludedByModCall = CalamityLists.DisabledSummonerNerfItems.Contains(heldItem.type);
-
- if (heldItemIsClassedWeapon && heldItemCanBeUsed && !heldItemIsTool && !heldItemIsAccessoryOrAmmo && !heldItemIsExcludedByModCall)
- modifiers.FinalDamage *= BalancingConstants.SummonerCrossClassNerf;
- }
+ if (CalamityUtils.ShouldTriggerSummonPenalty(Player, heldItem) && !CalamityLists.DisabledSummonerNerfMinions.Contains(proj.type))
+ modifiers.FinalDamage *= BalancingConstants.SummonerCrossClassNerf;
}
}
#endregion
@@ -801,6 +848,9 @@ namespace CalamityMod.CalPlayer
modifiers.SourceDamage *= damageReductionFromWhisperingDeath;
}
+ if (trueVHex)
+ modifiers.SourceDamage *= 1.15f;
+
//
// At this point, the player is guaranteed to be hit if there is no dodge.
// The amount of damage that will be dealt is yet to be determined.
@@ -855,7 +905,7 @@ namespace CalamityMod.CalPlayer
if (theBee && theBeeCooldown <= 0 && lifeAndShieldCondition)
{
contactDamageReduction += 0.5;
- theBeeCooldown = 600;
+ shouldTriggerBeeCooldown = true;
}
// Apply Adrenaline DR if available
@@ -950,6 +1000,7 @@ namespace CalamityMod.CalPlayer
{
proj.hostile = false;
proj.friendly = true;
+ proj.damage *= 10;
proj.velocity *= -2f;
proj.extraUpdates += 1;
proj.penetrate = 1;
@@ -978,6 +1029,9 @@ namespace CalamityMod.CalPlayer
projectileDamageReduction += 0.2;
}
+ if (trueVHex)
+ modifiers.SourceDamage *= 1.15f;
+
if (auralisAuroraCounter >= 300)
{
modifiers.SourceDamage.Flat -= 100;
@@ -1054,13 +1108,7 @@ namespace CalamityMod.CalPlayer
if (evolution)
{
if (proj.type == projTypeJustHitBy)
- projectileDamageReduction += 0.15;
- }
-
- if (transformer)
- {
- if (proj.type == ProjectileID.BulletSnowman || proj.type == ProjectileID.BulletDeadeye || proj.type == ProjectileID.SniperBullet)
- projectileDamageReduction += 0.5;
+ projectileDamageReduction += 0.25;
}
if (CalamityLists.projectileDestroyExceptionList.TrueForAll(x => proj.type != x) && proj.active && !proj.friendly && proj.hostile && proj.damage > 0)
@@ -1094,7 +1142,7 @@ namespace CalamityMod.CalPlayer
if (theBee && theBeeCooldown <= 0 && lifeAndShieldCondition)
{
projectileDamageReduction += 0.5;
- theBeeCooldown = 600;
+ shouldTriggerBeeCooldown = true;
}
// Apply Adrenaline DR if available
@@ -1255,21 +1303,7 @@ namespace CalamityMod.CalPlayer
}
}
- if (alchFlask)
- {
- for (int i = 0; i < 9; i++)
- {
- int seekerDamage = (int)Player.GetBestClassDamage().ApplyTo(15);
- seekerDamage = Player.ApplyArmorAccDamageBonusesTo(seekerDamage);
-
- Projectile bee = Projectile.NewProjectileDirect(Player.GetSource_FromThis(), Player.Center, new Vector2(5, 5).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1.2f), ModContent.ProjectileType(), seekerDamage, 0f, Player.whoAmI, -20, 30, 2);
- bee.ArmorPenetration = 35;
- bee.penetrate = 6;
- bee.extraUpdates = 2;
- bee.timeLeft = 600;
- }
- Player.AddBuff(BuffID.Honey, 900);
- }
+ OnHitByCombat(hurtInfo);
}
public override void OnHitByProjectile(Projectile proj, Player.HurtInfo hurtInfo)
@@ -1285,20 +1319,36 @@ namespace CalamityMod.CalPlayer
if (!hasIFrames && !Player.creativeGodMode)
nextHitDealsDefenseDamage |= proj.Calamity().DealsDefenseDamage;
- if (sulphurSet && !proj.friendly && hurtInfo.Damage > 0)
+ // CIT 22JUL2024: This entire code segment is bugged, so I'm disabling it.
+ // Very likely because it's trying to index into Main.npc using Projectile.owner.
+ /*if (!proj.friendly && hurtInfo.Damage > 0)
{
if (Main.player[proj.owner] is null)
{
if (!Main.npc[proj.owner].friendly)
- Main.npc[proj.owner].AddBuff(BuffID.Poisoned, 60);
+ {
+ if (sulphurSet)
+ Main.npc[proj.owner].AddBuff(BuffID.Poisoned, 60);
+ if (aSpark)
+ {
+ if (transformer)
+ Main.npc[proj.owner].Calamity().transformerShocked = 120;
+ else
+ Main.npc[proj.owner].Calamity().shocked = 120;
+ }
+ }
}
else
{
Player p = Main.player[proj.owner];
if (p.hostile && Player.hostile && (Player.team != p.team || p.team == 0))
- p.AddBuff(BuffID.Poisoned, 60);
+ {
+ if (sulphurSet)
+ p.AddBuff(BuffID.Poisoned, 60);
+ }
+
}
- }
+ }*/
if (proj.hostile && hurtInfo.Damage > 0)
{
@@ -1390,6 +1440,10 @@ namespace CalamityMod.CalPlayer
{
Player.AddBuff(BuffID.Poisoned, 300);
}
+ else if (proj.type == ProjectileID.CultistBossFireBall)
+ {
+ Player.AddBuff(ModContent.BuffType(), 120);
+ }
else if (proj.type == ProjectileID.CultistBossIceMist)
{
if (!Player.frozen)
@@ -1421,17 +1475,17 @@ namespace CalamityMod.CalPlayer
{
Player.AddBuff(ModContent.BuffType(), 300);
}
- else if (proj.type == ProjectileID.FairyQueenLance || proj.type == ProjectileID.HallowBossRainbowStreak || proj.type == ProjectileID.HallowBossSplitShotCore)
+ else if ((proj.type == ProjectileID.FairyQueenLance || proj.type == ProjectileID.HallowBossRainbowStreak || proj.type == ProjectileID.HallowBossSplitShotCore) && NPC.ShouldEmpressBeEnraged())
{
- Player.AddBuff(NPC.ShouldEmpressBeEnraged() ? ModContent.BuffType() : ModContent.BuffType(), 60);
+ Player.AddBuff(ModContent.BuffType(), 60);
}
- else if (proj.type == ProjectileID.HallowBossLastingRainbow)
+ else if (proj.type == ProjectileID.HallowBossLastingRainbow && NPC.ShouldEmpressBeEnraged())
{
- Player.AddBuff(NPC.ShouldEmpressBeEnraged() ? ModContent.BuffType() : ModContent.BuffType(), 120);
+ Player.AddBuff(ModContent.BuffType(), 120);
}
- else if (proj.type == ProjectileID.FairyQueenSunDance)
+ else if (proj.type == ProjectileID.FairyQueenSunDance && NPC.ShouldEmpressBeEnraged())
{
- Player.AddBuff(NPC.ShouldEmpressBeEnraged() ? ModContent.BuffType() : ModContent.BuffType(), 180);
+ Player.AddBuff(ModContent.BuffType(), 180);
}
else if (proj.type == ProjectileID.BloodNautilusShot)
{
@@ -1450,23 +1504,6 @@ namespace CalamityMod.CalPlayer
// As these reflects do not cancel damage, they need to be in OnHit rather than ModifyHit
if (CalamityLists.projectileDestroyExceptionList.TrueForAll(x => proj.type != x) && proj.active && !proj.friendly && proj.hostile && hurtInfo.Damage > 0)
{
- // The Transformer can reflect bullets
- if (transformer)
- {
- if (proj.type == ProjectileID.BulletSnowman || proj.type == ProjectileID.BulletDeadeye || proj.type == ProjectileID.SniperBullet || proj.type == ProjectileID.VortexLaser)
- {
- proj.hostile = false;
- proj.friendly = true;
- proj.velocity *= -1f;
- proj.damage = (int)Player.GetBestClassDamage().ApplyTo(proj.damage * 8);
- proj.penetrate = 1;
-
- // 17APR2024: Ozzatron: The Transformer is a reflect which also functions as a dodge. It uses vanilla dodge iframes and benefits from Cross Necklace.
- int transformerIFrames = Player.ComputeReflectIFrames();
- Player.GiveUniversalIFrames(transformerIFrames, true);
- }
- }
-
double dodgeDamageGateValuePercent = 0.05;
int dodgeDamageGateValue = (int)Math.Round(Player.statLifeMax2 * dodgeDamageGateValuePercent);
@@ -1502,6 +1539,52 @@ namespace CalamityMod.CalPlayer
{
Player.AddBuff(ModContent.BuffType(), 15, true);
}
+
+ OnHitByCombat(hurtInfo);
+ }
+
+ // Shortcut for applying hit effects when hit by either an NPC or projectile
+ // Reminder that external sources ie. forcefully called hurt functions, hazards (thorns, spikes, lava) are not valid
+ public void OnHitByCombat(Player.HurtInfo hurtInfo)
+ {
+ // Apply The Bee cooldown, must be applied here so that it does not apply on dodges
+ if (theBee && shouldTriggerBeeCooldown)
+ {
+ shouldTriggerBeeCooldown = false;
+ if (hurtInfo.Damage > 0)
+ theBeeCooldown = TheBee.CooldownLength;
+ }
+
+ if (alchFlask)
+ {
+ for (int i = 0; i < 9; i++)
+ {
+ int seekerDamage = (int)Player.GetBestClassDamage().ApplyTo(15);
+ seekerDamage = Player.ApplyArmorAccDamageBonusesTo(seekerDamage);
+
+ Projectile bee = Projectile.NewProjectileDirect(Player.GetSource_FromThis(), Player.Center, new Vector2(5, 5).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1.2f), ModContent.ProjectileType(), seekerDamage, 0f, Player.whoAmI, -20, 30, 2);
+ bee.ArmorPenetration = 35;
+ bee.penetrate = 6;
+ bee.extraUpdates = 2;
+ bee.timeLeft = 600;
+ }
+ Player.AddBuff(BuffID.Honey, 900);
+ }
+
+ if (ursaSergeant)
+ {
+ ursaSergeantCooldown = (int)MathHelper.Clamp(ursaSergeantCooldown - 180, 0, 300);
+ Player.AddBuff(ModContent.BuffType(), 150);
+ for (int i = 0; i < 9; i++)
+ {
+ Particle spark2 = new LineParticle(Player.Center, new Vector2(8, 8).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1f), false, 20, Main.rand.NextFloat(0.5f, 1.1f), Main.rand.NextBool() ? Color.Coral : Color.DarkTurquoise);
+ GeneralParticleHandler.SpawnParticle(spark2);
+ Dust dust2 = Dust.NewDustPerfect(Player.Center, 267, new Vector2(8, 8).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1f));
+ dust2.scale = Main.rand.NextFloat(0.75f, 1.2f);
+ dust2.noGravity = true;
+ dust2.color = Main.rand.NextBool() ? Color.Coral : Color.DarkTurquoise;
+ }
+ }
}
#endregion
@@ -1539,14 +1622,14 @@ namespace CalamityMod.CalPlayer
Rectangle npcHitbox = n.getRect();
if ((Player.getRect()).Intersects(npcHitbox) && (n.noTileCollide || Collision.CanHit(Player.position, Player.width, Player.height, n.position, n.width, n.height)))
{
- int damage = Player.ApplyArmorAccDamageBonusesTo(Player.CalcIntDamage(GravistarSabaton.PassthroughDamage));
+ int damage = Player.ApplyArmorAccDamageBonusesTo(Player.CalcIntDamage(InterstellarStompers.PassthroughDamage));
Projectile.NewProjectile(Player.GetSource_FromThis(), n.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0, Main.myPlayer);
// 17APR2024: Ozzatron: Gravistar Sabaton gives iframes when passing through enemies for projectile safety.
// This is a fixed and intentionally very low number of iframes, and is not boosted by Cross Necklace.
n.Calamity().dashImmunityTime[Player.whoAmI] = 4;
- Player.GiveUniversalIFrames(GravistarSabaton.PassthroughIFrames, false);
+ Player.GiveUniversalIFrames(InterstellarStompers.PassthroughIFrames, false);
return true;
}
@@ -2054,11 +2137,12 @@ namespace CalamityMod.CalPlayer
// If the player was just hit by something capable of dealing defense damage, then apply defense damage.
// Bloodflare Core makes every hit deal defense damage (to enable its function).
- // Defense damage is not applied if the player has iframes.
- // This function will be ignored if the player is wearing Chalice, as it handles its defense damage elsewhere.
+ // Defense damage is not applied if the player has iframes or godmode.
bool hitCanApplyDefenseDamage = nextHitDealsDefenseDamage || bloodflareCore;
+ bool defenseDamageShouldApply = hitCanApplyDefenseDamage && !hasIFrames && !Player.creativeGodMode;
- if (hitCanApplyDefenseDamage && !hasIFrames && !Player.creativeGodMode)
+ // 15AUG2024: Ozzatron: External flag which completely disables defense damage. This overrides Bloodflare Core.
+ if (defenseDamageShouldApply && !CalamityMod.ExternalFlag_DisableDefenseDamage)
{
double halfDefense = Player.statDefense / 2.0;
int netMitigation = hurtInfo.SourceDamage - hurtInfo.Damage;
@@ -2210,8 +2294,6 @@ namespace CalamityMod.CalPlayer
if (evilSmasherBoost > 0)
evilSmasherBoost -= 1;
- hellbornBoost = 0;
-
if (trinketOfChi)
chiBuffTimer = 0;
@@ -2385,15 +2467,15 @@ namespace CalamityMod.CalPlayer
if (npcDist < range)
{
- float duration = Main.rand.Next(300 + (int)hurtInfo.Damage / 3, 480 + (int)hurtInfo.Damage / 2);
- npc.AddBuff(BuffID.Confused, (int)duration, false);
+ int duration = Main.rand.Next(300 + hurtInfo.Damage / 3, 480 + hurtInfo.Damage / 2);
+ npc.AddBuff(BuffID.Confused, duration, false);
if (amalgam)
{
- npc.AddBuff(BuffID.Venom, (int)duration);
- npc.AddBuff(ModContent.BuffType(), (int)duration);
- npc.AddBuff(ModContent.BuffType(), (int)duration);
- npc.AddBuff(ModContent.BuffType(), (int)duration);
- npc.AddBuff(ModContent.BuffType(), (int)duration);
+ npc.AddBuff(BuffID.Venom, duration);
+ npc.AddBuff(ModContent.BuffType(), duration);
+ npc.AddBuff(ModContent.BuffType(), duration);
+ npc.AddBuff(ModContent.BuffType(), duration);
+ npc.AddBuff(ModContent.BuffType(), duration);
}
}
}
@@ -2459,6 +2541,10 @@ namespace CalamityMod.CalPlayer
else
Player.immuneTime += iFramesToAdd;
+ // Similar handle to 1.4 Star Cloak: these hits ie. spikes or lava cannot activate hit effects
+ if (hurtInfo.CooldownCounter != -1 && hurtInfo.CooldownCounter != 1)
+ return;
+
if (aeroSet && hurtInfo.Damage > 25)
{
// https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list
@@ -2508,55 +2594,40 @@ namespace CalamityMod.CalPlayer
}
if (aSpark)
{
- var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType()));
- if (hurtInfo.Damage > 0)
+ SoundEngine.PlaySound(SoundID.Item93, Player.Center);
+
+ // Only visual effects are done here
+ // The actual spark spawning is now handled with the shocked variable in CalamityGlobalNPC
+
+ SeaFoamParticle boom = new(Player.Center, Vector2.Zero, new Color(89, 239, 247), new Color(56, 158, 209), 1f, 200f, Main.rand.NextBool() ? -1f : 1f);
+ GeneralParticleHandler.SpawnParticle(boom);
+
+ for (int e = 0; e < 6; e++)
{
- SoundEngine.PlaySound(SoundID.Item93, Player.Center);
- float spread = 45f * 0.0174f;
- double startAngle = Math.Atan2(Player.velocity.X, Player.velocity.Y) - spread / 2;
- double deltaAngle = spread / 8f;
- double offsetAngle;
-
- // Start with base damage, then apply the best damage class you can
- int sDamage = 6;
+ Vector2 dustVel = Main.rand.NextVector2CircularEdge(1f, 1f) * Main.rand.NextFloat(4.5f, 5.25f);
+ Dust electric = Dust.NewDustPerfect(Player.Center, DustID.Electric, dustVel, Scale: 0.75f);
+ electric.noGravity = true;
if (transformer)
- sDamage += 42;
- sDamage = (int)Player.GetBestClassDamage().ApplyTo(sDamage);
- sDamage = Player.ApplyArmorAccDamageBonusesTo(sDamage);
-
- if (Player.whoAmI == Main.myPlayer)
{
- for (int i = 0; i < (transformer ? 5 : 4); i++)
- {
- offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
- int spark1 = Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), sDamage, 1.25f, Player.whoAmI, 0f, 0f);
- int spark2 = Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), sDamage, 1.25f, Player.whoAmI, 0f, 0f);
- if (spark1.WithinBounds(Main.maxProjectiles))
- {
- Main.projectile[spark1].timeLeft = 120;
- Main.projectile[spark1].DamageType = DamageClass.Generic;
- if (transformer)
- {
- Main.projectile[spark1].timeLeft = 240;
- Main.projectile[spark1].extraUpdates = 1;
- Main.projectile[spark1].penetrate = 10;
- }
- }
- if (spark2.WithinBounds(Main.maxProjectiles))
- {
- Main.projectile[spark2].timeLeft = 120;
- Main.projectile[spark2].DamageType = DamageClass.Generic;
- if (transformer)
- {
- Main.projectile[spark2].timeLeft = 240;
- Main.projectile[spark2].extraUpdates = 1;
- Main.projectile[spark2].penetrate = 10;
- }
- }
- }
+ NanoParticle nano = new(Player.Center, dustVel, new Color(0, 186, 242), 1f, 20, true, true);
+ GeneralParticleHandler.SpawnParticle(nano);
}
}
}
+ if (rBrain)
+ {
+ if (!CalamityUtils.AnyProjectiles(ModContent.ProjectileType()))
+ {
+ var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType()));
+ int effectStrength = amalgam ? 3 : aBrain ? 2 : 1;
+ int effectDamage = amalgam ? 300 : aBrain ? 50 : 15;
+ effectDamage = (int)Player.GetBestClassDamage().ApplyTo(effectDamage);
+ effectDamage = Player.ApplyArmorAccDamageBonusesTo(effectDamage);
+
+ Vector2 spawnerVelocity = -Vector2.UnitY.RotatedByRandom(MathHelper.Pi / 40f) * 12.5f;
+ Projectile.NewProjectile(source, Player.Center, spawnerVelocity, ModContent.ProjectileType(), effectDamage, 0f, Player.whoAmI, 0f, 0f, effectStrength);
+ }
+ }
if (inkBomb && !abyssalMirror && !eclipseMirror)
{
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType()));
diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs
index 8e810d1a4b..6b913f7cee 100644
--- a/CalPlayer/CalamityPlayerLifeRegen.cs
+++ b/CalPlayer/CalamityPlayerLifeRegen.cs
@@ -75,7 +75,7 @@ namespace CalamityMod.CalPlayer
}
//
- // Calamity debuffs (Vanilla Shadowflame is added here)
+ // Calamity debuffs (Vanilla Shadowflame and Daybroken are added here)
//
void ApplyDoTDebuff(bool hasDebuff, int negativeLifeRegenToApply, bool immuneCondition = false)
{
@@ -104,9 +104,12 @@ namespace CalamityMod.CalPlayer
int staticDoT = ((Player.controlLeft || Player.controlRight) ? 12 : 3) / (eleResist ? 2 : 1);
ApplyDoTDebuff(staticDischarge, staticDoT, purity);
ApplyDoTDebuff(bFlames, abaddon ? 10 : 30, purity);
+ ApplyDoTDebuff(daybroken, reducedDaybrokenDamage ? 20 : 40, purity);
ApplyDoTDebuff(nightwither, reducedNightwitherDamage ? 20 : 40, purity);
- ApplyDoTDebuff(hFlames, reducedHolyFlamesDamage ? 20 : 40, purity);
+ ApplyDoTDebuff(hFlames, 40, purity);
+ ApplyDoTDebuff(voidfrost, 40, purity);
ApplyDoTDebuff(vHex, 35);
+ ApplyDoTDebuff(trueVHex, 50);
ApplyDoTDebuff(cDepth, 18, purity);
ApplyDoTDebuff(astralInfection, 24, infectedJewel || purity);
ApplyDoTDebuff(pFlames, alchFlask ? 10 : 30, purity);
@@ -653,29 +656,12 @@ namespace CalamityMod.CalPlayer
if (trinketOfChi || chiRegen)
Player.lifeRegen += 2;
- if (ursaSergeant)
- {
- if (Player.statLife <= (int)(actualMaxLife * 0.15))
- {
- Player.lifeRegen += 3;
- Player.lifeRegenTime += 3;
- }
- else if (Player.statLife <= (int)(actualMaxLife * 0.25))
- {
- Player.lifeRegen += 2;
- Player.lifeRegenTime += 2;
- }
- else if (Player.statLife <= (int)(actualMaxLife * 0.5))
- {
- Player.lifeRegen += 1;
- Player.lifeRegenTime += 1;
- }
- }
-
+ // Remember this is for 5 seconds after triggering a reflect with a long cooldown
if (evolutionLifeRegenCounter > 0)
{
- Player.lifeRegenTime += 2;
- Player.lifeRegen += 2;
+ Player.lifeRegen += 12;
+ if (Player.lifeRegenTime < 3600f)
+ Player.lifeRegenTime = 3600f;
}
if (darkSunRing)
diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs
index bcd4392897..e8f325b942 100644
--- a/CalPlayer/CalamityPlayerMiscEffects.cs
+++ b/CalPlayer/CalamityPlayerMiscEffects.cs
@@ -86,7 +86,7 @@ namespace CalamityMod.CalPlayer
// Give the player a 24% jump speed boost while wings are equipped, otherwise grant 4% more jump speed so that players can jump 7 tiles high
if (Player.wingsLogic > 0)
Player.jumpSpeedBoost += 1.2f;
- else if (CalamityConfig.Instance.FasterJumpSpeed)
+ else if (CalamityServerConfig.Instance.FasterJumpSpeed)
Player.jumpSpeedBoost += 0.2f;
// Decrease the counter on Fearmonger set turbo regeneration
@@ -193,13 +193,12 @@ namespace CalamityMod.CalPlayer
Player.GetCritChance() = -spiritOriginConvertedCrit;
}
- if (Player.ActiveItem().type == ModContent.ItemType())
- heldGaelsLastFrame = true;
-
if (Player.ActiveItem().type != ModContent.ItemType())
saharaSlicersBolts = 0;
// De-equipping Gael's Greatsword deletes all rage.
+ if (Player.ActiveItem().type == ModContent.ItemType())
+ heldGaelsLastFrame = true;
else if (heldGaelsLastFrame)
{
heldGaelsLastFrame = false;
@@ -664,7 +663,7 @@ namespace CalamityMod.CalPlayer
// Auric Ore causes an Auric Rejection unless you are wearing Auric Armor
// Auric Rejection causes an electrical explosion that yeets the player a considerable distance
- if ((tile.TileType == auricOreID && !(auricSet || tracersSeraph)) || tile.TileType == auricRepulserID)
+ if ((tile.TileType == auricOreID && !(auricSet || tracersSeraph || Player.creativeGodMode)) || tile.TileType == auricRepulserID)
{
// Cut grappling hooks so the player is surely thrown
Player.RemoveAllGrapplingHooks();
@@ -691,18 +690,8 @@ namespace CalamityMod.CalPlayer
SoundEngine.PlaySound(explode with { Pitch = 0.8f }, touchedTile.ToWorldCoordinates());
GenericSparkle sparker = new GenericSparkle(touchedTile.ToWorldCoordinates(), Vector2.Zero, Color.Goldenrod, Color.Gold, 2.5f, 9, Main.rand.NextFloat(-0.01f, 0.01f), 2.68f);
GeneralParticleHandler.SpawnParticle(sparker);
- //GeneralScreenShakePower = 200;
Player.RemoveAllIFrames();
Projectile.NewProjectile(new EntitySource_TileInteraction(Player, touchedTile.X, touchedTile.Y), touchedTile.ToWorldCoordinates(), Vector2.Zero, ModContent.ProjectileType(), 40000, 0f);
- //for (int i = 0; i < 3; i++)
- {
- /* int p = Projectile.NewProjectile(new EntitySource_TileInteraction(Player, touchedTile.X, touchedTile.Y), touchedTile.ToWorldCoordinates(), Vector2.Zero, ModContent.ProjectileType(), 0, 0f);
- Projectile explosion = Main.projectile[p];
- explosion.ai[1] = 560f + 90f;
- explosion.localAI[1] = 0.25f;
- explosion.Opacity = MathHelper.Lerp(0.18f, 0.6f, 0.2f) + Main.rand.NextFloat(-0.08f, 0.08f);
- explosion.netUpdate = true;*/
- }
WorldGen.KillTile(touchedTile.X, touchedTile.Y, noItem: true);
}
}
@@ -716,11 +705,6 @@ namespace CalamityMod.CalPlayer
if (!blazingCursorDamage)
return;
- // miscCounter is used to limit Calamity's hit rate.
- int framesPerHit = 5;
- if (Player.miscCounter % framesPerHit != 1)
- return;
-
Rectangle sigilHitbox = Utils.CenteredRectangle(Main.MouseWorld, new Vector2(35f, 62f));
int sigilDamage = (int)Player.GetBestClassDamage().ApplyTo(Calamity.BaseDamage);
sigilDamage = Player.ApplyArmorAccDamageBonusesTo(sigilDamage);
@@ -728,9 +712,39 @@ namespace CalamityMod.CalPlayer
bool brightenedSigil = false;
foreach (NPC target in Main.ActiveNPCs)
{
- if (!target.Hitbox.Intersects(sigilHitbox) || target.immortal || target.dontTakeDamage || target.townNPC || NPCID.Sets.ActsLikeTownNPC[target.type] || NPCID.Sets.CountsAsCritter[target.type])
+ if (!target.Hitbox.Intersects(sigilHitbox) || target.immortal || target.dontTakeDamage || target.friendly || NPCID.Sets.CountsAsCritter[target.type])
continue;
+ // Increment the cursor focus counter. Note this actually has a net of increasing by 2 per frame, due to the 1 per frame falloff in GlobalNPC.
+ // If this counter reaches 300 (which takes 2.5 seconds without interruptions), True VHex is activated.
+ if (target.Calamity().cursorFocus < CalamityGlobalNPC.cursorFocusMax)
+ {
+ target.Calamity().cursorFocus += 3;
+
+ // Draw an expanding orb effect on the cursor based on the cursor focus value.
+ float cursorFocusRatio = target.Calamity().cursorFocus / (float)CalamityGlobalNPC.cursorFocusMax;
+ StrongBloom indicator = new(Main.MouseWorld, Vector2.Zero, Color.Lerp(Color.Magenta, Color.Red, cursorFocusRatio), cursorFocusRatio * 0.7f, 2);
+ GeneralParticleHandler.SpawnParticle(indicator);
+
+ if (target.Calamity().cursorFocus >= CalamityGlobalNPC.cursorFocusMax)
+ {
+ target.Calamity().trueVulnerabilityHex = target.Calamity().vulnerabilityHex >= 300 ? target.Calamity().vulnerabilityHex : 300;
+ target.Calamity().vulnerabilityHex = 0;
+ SoundEngine.PlaySound(new("CalamityMod/Sounds/Custom/WeaponEnchant"), target.Center);
+
+ for (int i = 0; i < 18; i++)
+ {
+ Vector2 orbVel = new Vector2(15, 15).RotatedByRandom(MathHelper.Pi) * Main.rand.NextFloat(0.33f, 1f);
+ GlowOrbParticle orb = new(target.Center + orbVel, orbVel, false, 60, Main.rand.NextFloat(0.95f, 1.75f), Color.Lerp(Color.Red, Color.Magenta, 0.3f));
+ GeneralParticleHandler.SpawnParticle(orb);
+ }
+ }
+ }
+
+ // miscCounter is used to limit Calamity's hit rate.
+ if (Player.miscCounter % Calamity.FramesPerHit != 1)
+ return;
+
// Brighten the sigil because it is dealing damage. This can only happen once per hit event.
if (!brightenedSigil)
{
@@ -740,13 +754,15 @@ namespace CalamityMod.CalPlayer
// Create a direct strike to hit this specific NPC.
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType()));
- Projectile sigilStrike = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), sigilDamage, 0f, Player.whoAmI, target.whoAmI);
+ Projectile sigilStrike = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), sigilDamage, 0f, Player.whoAmI, target.whoAmI, 1f);
// Enable crits by setting the sigil's damage class to be whatever the player's strongest damage class is.
sigilStrike.DamageType = Player.GetBestClass();
- // Incinerate the target with Vulnerability Hex.
- target.AddBuff(ModContent.BuffType(), VulnerabilityHex.CalamityDuration);
+ // 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() : ModContent.BuffType();
+ target.AddBuff(buffToInflict, target.Calamity().trueVulnerabilityHex > 0 ? target.Calamity().trueVulnerabilityHex + 8 : target.Calamity().vulnerabilityHex < VulnerabilityHex.CalamityDuration ? VulnerabilityHex.CalamityDuration : target.Calamity().vulnerabilityHex + 8);
// Make some fancy dust to indicate damage is being done.
for (int j = 0; j < 12; j++)
@@ -985,7 +1001,7 @@ namespace CalamityMod.CalPlayer
{
Player.buffImmune[ModContent.BuffType()] = true;
}
- if (CalamityConfig.Instance.ChilledWaterRework)
+ if (CalamityServerConfig.Instance.ChilledWaterRework)
{
if (Main.expertMode && Player.ZoneSnow && Player.wet && !Player.lavaWet && !Player.honeyWet)
{
@@ -1108,7 +1124,7 @@ namespace CalamityMod.CalPlayer
Player.noFallDmg = true;
}
- if (CalamityConfig.Instance.FasterFallHotkey)
+ if (CalamityClientConfig.Instance.FasterFallHotkey)
{
// Allow the player to double their gravity (but NOT max fall speed!) by holding the down button while in midair.
bool holdingDown = Player.controlDown && !Player.controlJump;
@@ -1138,7 +1154,7 @@ namespace CalamityMod.CalPlayer
}
// Increase Rope climb velocities, if enabled
- if (CalamityConfig.Instance.FasterRopeClimbSpeed)
+ if (CalamityServerConfig.Instance.FasterRopeClimbSpeed)
{
if (Player.pulley)
{
@@ -1424,6 +1440,8 @@ namespace CalamityMod.CalPlayer
Player.buffImmune[ModContent.BuffType()] = true;
}
+ if (arsenalCooldown > 0)
+ arsenalCooldown--;
if (ascendantInsigniaCooldown > 0 && ascendantInsigniaBuffTime <= 0)
ascendantInsigniaCooldown--;
if (DragonsBreathAudioCooldown > 0)
@@ -1456,14 +1474,16 @@ namespace CalamityMod.CalPlayer
soundCooldown--;
if (shadowPotCooldown > 0)
shadowPotCooldown--;
- if (raiderCritBonus > 0f)
- raiderCritBonus -= RaidersTalisman.RaiderBonus / (float)CalamityUtils.SecondsToFrames(RaidersTalisman.RaiderCooldown);
+ if (raiderCritLifespan > 0f)
+ raiderCritLifespan--;
if (raiderSoundCooldown > 0)
raiderSoundCooldown--;
if (astralStarRainCooldown > 0)
astralStarRainCooldown--;
if (AbaddonCooldown > 0)
AbaddonCooldown--;
+ if (ursaSergeantCooldown > 0)
+ ursaSergeantCooldown--;
if (AlchFlaskCooldown > 0)
AlchFlaskCooldown--;
if (tarraRangedCooldown > 0)
@@ -1522,8 +1542,17 @@ namespace CalamityMod.CalPlayer
hideOfDeusTimer--;
if (murasamaHitCooldown > 0)
murasamaHitCooldown--;
- if (hellbornBoost > 0)
- hellbornBoost--;
+ if (burningSeaBurnOut > 0)
+ {
+ burningSeaBurnOut--;
+ if (Main.rand.NextBool())
+ {
+ Vector2 dustSpawnPos = Player.position + new Vector2(Main.rand.NextFloat(Player.width), 0f);
+ Vector2 dustVelocity = -Vector2.UnitY * Main.rand.NextFloat(3f, 6f);
+ Dust burnOutDust = Dust.NewDustPerfect(dustSpawnPos, (int)CalamityDusts.Brimstone, dustVelocity);
+ burnOutDust.noGravity = true;
+ }
+ }
if (persecutedEnchantSummonTimer < 1800)
persecutedEnchantSummonTimer++;
else
@@ -1578,6 +1607,9 @@ namespace CalamityMod.CalPlayer
FlameLickedShell.HandleParryCountdown(Player);
}
+ if (!flameLickedShell && flameLickedShellParry > 0)
+ flameLickedShellParry--;
+
// Silver Armor "Medkit" effect
if (silverMedkitTimer > 0)
{
@@ -1699,7 +1731,10 @@ namespace CalamityMod.CalPlayer
Player.statLife = upperHealthLimit;
if (necroReviveCounter >= NecroArmorSetChange.PostMortemDuration * 60)
+ {
Player.KillMe(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.NecroRevive").Format(Player.name)), 1000, -1);
+ necroReviveCounter = -1;
+ }
else if (necroReviveCounter % 60 == 59)
SoundEngine.PlaySound(NecroArmorSetChange.TimerSound, Player.Center);
}
@@ -1836,8 +1871,8 @@ namespace CalamityMod.CalPlayer
}
// Raider Talisman bonus
- if (raiderTalisman && !StealthStrikeAvailable())
- Player.GetCritChance() += raiderCritBonus;
+ if (raiderTalisman && !StealthStrikeAvailable() && raiderCritLifespan > 0f)
+ Player.GetCritChance() += RaidersTalisman.RaiderBonus;
if (kamiBoost)
Player.GetDamage() += 0.15f;
@@ -2274,11 +2309,12 @@ namespace CalamityMod.CalPlayer
double breathLossMult = 1D -
(Player.gills ? 0.2 : 0D) - // 0.8
(oceanCrest ? 0.2 : 0D) - // 0.8
+ (victideSet ? 0.2 : 0D) - // 0.8
(Player.accDivingHelm ? 0.25 : 0D) - // 0.75
(Player.arcticDivingGear ? 0.25 : 0D) - // 0.75
(aquaticEmblem ? 0.25 : 0D) - // 0.75
(Player.accMerman ? 0.3 : 0D) - // 0.7
- (victideSet ? 0.2 : 0D) - // 0.85
+ (reaverExplore ? 0.3 : 0D) - // 0.7
((aquaticHeart && NPC.downedBoss3) ? 0.3 : 0D) - // 0.7
(abyssalDivingSuit ? 0.3 : 0D); // 0.7
@@ -2366,7 +2402,7 @@ namespace CalamityMod.CalPlayer
// Reduce breath
if (Player.breath > 0)
- Player.breath -= (int)(cDepth ? breathLoss + 1D : breathLoss);
+ Player.breath -= (int)(cDepth && !depthCharm ? breathLoss + 1D : breathLoss);
}
// If breath is greater than 0 and player has gills or is merfolk, balance out the effects by reducing breath
@@ -2693,7 +2729,7 @@ namespace CalamityMod.CalPlayer
{
Player.statDefense += 30;
Player.endurance += 0.1f;
- Player.GetDamage() += 0.2f;
+ Player.GetDamage() += 0.15f;
}
if (brutalCarnage)
@@ -2816,7 +2852,7 @@ namespace CalamityMod.CalPlayer
// 50% movement speed bonus so that you don't feel like a snail in the early game
// Disabled while Overhaul is enabled, because Overhaul does very similar things to make movement more snappy
- if (CalamityMod.Instance.overhaul is null && CalamityConfig.Instance.FasterBaseSpeed)
+ if (CalamityMod.Instance.overhaul is null && CalamityServerConfig.Instance.FasterBaseSpeed)
Player.moveSpeed += BalancingConstants.DefaultMoveSpeedBoost;
// Reduce how slow Chilled makes the player, because it's cancerous right now
@@ -2919,7 +2955,7 @@ namespace CalamityMod.CalPlayer
if (giantPearl)
{
- if (Main.netMode != NetmodeID.MultiplayerClient && !areThereAnyDamnBosses)
+ if (Main.netMode != NetmodeID.MultiplayerClient)
{
foreach (NPC npc in Main.ActiveNPCs)
{
@@ -3001,15 +3037,8 @@ namespace CalamityMod.CalPlayer
Player.wingTimeMax = (int)(Player.wingTimeMax * flightTimeMult);
if (vHex)
- {
Player.statDefense -= 20;
- if (Player.wingTimeMax < 0)
- Player.wingTimeMax = 0;
-
- Player.wingTimeMax = (int)(Player.wingTimeMax * 0.75);
- }
-
if (icarusFolly)
{
if (Player.wingTimeMax < 0)
@@ -3040,7 +3069,11 @@ namespace CalamityMod.CalPlayer
}
if (mushy)
- Player.statDefense += 6;
+ {
+ Player.statDefense += 8;
+ if (fungalSymbiote)
+ Player.GetDamage() += 0.1f;
+ }
if (omniscience)
{
@@ -3125,14 +3158,6 @@ namespace CalamityMod.CalPlayer
if (manaOverloader)
Player.GetDamage() += 0.06f;
- if (rBrain)
- {
- if (Player.statLife <= (int)(Player.statLifeMax2 * 0.75))
- Player.GetDamage() += 0.1f;
- if (Player.statLife <= (int)(Player.statLifeMax2 * 0.5))
- Player.moveSpeed -= 0.05f;
- }
-
if (bloodyWormTooth)
{
Player.GetDamage() += 0.1f;
@@ -3224,6 +3249,25 @@ namespace CalamityMod.CalPlayer
}
}
+ if (silvaSummon && Player.whoAmI == Main.myPlayer)
+ {
+ var source = Player.GetSource_FromThis(SilvaHeadSummon.SilvaCrystalEntitySourceContext);
+ if (Player.FindBuffIndex(ModContent.BuffType()) == -1)
+ {
+ Player.AddBuff(ModContent.BuffType(), 3600, true);
+ }
+ if (Player.ownedProjectileCounts[ModContent.ProjectileType()] < 1)
+ {
+ // 08DEC2023: Ozzatron: Silva Crystals spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care.
+ int baseDamage = Player.ApplyArmorAccDamageBonusesTo(600);
+ var damage = (int)Player.GetTotalDamage().ApplyTo(baseDamage);
+
+ var p = Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, 0f, -1f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, -20f, 0f);
+ if (Main.projectile.IndexInRange(p))
+ Main.projectile[p].originalDamage = baseDamage;
+ }
+ }
+
if (ascendantInsignia && ascendantInsigniaBuffTime > 0)
{
ascendantTrail = true;
@@ -3239,9 +3283,6 @@ namespace CalamityMod.CalPlayer
Player.moveSpeed -= moveSpeedLoss;
}
- if (ursaSergeant)
- Player.moveSpeed -= 0.15f;
-
if (godSlayerThrowing)
{
if (Player.statLife >= Player.statLifeMax2)
@@ -3309,13 +3350,9 @@ namespace CalamityMod.CalPlayer
if (Main.rand.NextBool(10))
{
Vector2 velocity = CalamityUtils.RandomVelocity(50f, 30f, 60f);
- int spark = Projectile.NewProjectile(source, npc.Center, velocity, ModContent.ProjectileType(), damage / 2, 0f, Player.whoAmI);
- if (spark.WithinBounds(Main.maxProjectiles))
- {
- Main.projectile[spark].DamageType = DamageClass.Generic;
- Main.projectile[spark].localNPCHitCooldown = -2;
- Main.projectile[spark].penetrate = 5;
- }
+ Projectile spark = Projectile.NewProjectileDirect(source, npc.Center, velocity, ModContent.ProjectileType(), damage / 2, 0f, Player.whoAmI);
+ spark.localNPCHitCooldown = -2;
+ spark.timeLeft = 30;
}
}
}
@@ -3431,7 +3468,6 @@ namespace CalamityMod.CalPlayer
Player.lavaImmune = true;
Player.fireWalk = true;
Player.buffImmune[ModContent.BuffType()] = Main.dayTime || empowered;
- Player.buffImmune[ModContent.BuffType()] = !Main.dayTime || empowered;
Player.buffImmune[BuffID.OnFire] = true;
Player.buffImmune[BuffID.Burning] = true;
Player.buffImmune[BuffID.Daybreak] = true;
@@ -3528,11 +3564,24 @@ namespace CalamityMod.CalPlayer
if (check)
{
// https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list
- var source = Player.GetSource_Buff(Player.FindBuffIndex(ModContent.BuffType()));
- int damage = (int)Player.GetBestClassDamage().ApplyTo(10);
+ var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType()));
+ int damage = (int)Player.GetBestClassDamage().ApplyTo(12);
if (Player.ownedProjectileCounts[ModContent.ProjectileType()] < 1)
Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Player.whoAmI);
}
+
+ // Reduce duration of Static Discharge
+ for (int l = 0; l < Player.MaxBuffs; l++)
+ {
+ if (Player.buffType[l] == ModContent.BuffType())
+ {
+ if (Player.buffTime[l] > 2)
+ {
+ Player.buffTime[l]--;
+ break;
+ }
+ }
+ }
}
}
else if (Player.ownedProjectileCounts[ModContent.ProjectileType()] > 0)
@@ -4250,13 +4299,13 @@ namespace CalamityMod.CalPlayer
{
if (startMessageDisplayDelay == 0)
{
- if (CalamityConfig.Instance.WikiStatusMessage)
+ if (CalamityClientConfig.Instance.WikiStatusMessage)
{
CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Misc.WikiStatus1");
CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Misc.WikiStatus2");
}
- if (CalamityConfig.Instance.VCMMStatusMessage && !CalamityMod.Instance.VCMMAvailable)
+ if (CalamityClientConfig.Instance.VCMMStatusMessage && !CalamityMod.Instance.VCMMAvailable)
{
CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Misc.VCMMStatus");
}
diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs
index e5ab8c846f..6c4215c529 100644
--- a/CalPlayer/CalamityPlayerOnHit.cs
+++ b/CalPlayer/CalamityPlayerOnHit.cs
@@ -7,9 +7,7 @@ using CalamityMod.Buffs.StatBuffs;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Cooldowns;
using CalamityMod.Dusts;
-using CalamityMod.EntitySources;
using CalamityMod.Items.Accessories;
-using CalamityMod.Items.Armor.Prismatic;
using CalamityMod.Items.Armor.Reaver;
using CalamityMod.Items.Potions.Alcohol;
using CalamityMod.Items.VanillaArmorChanges;
@@ -27,7 +25,6 @@ using CalamityMod.Projectiles.Summon;
using CalamityMod.Projectiles.Typeless;
using CalamityMod.Systems;
using Microsoft.Xna.Framework;
-using MonoMod.Cil;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
@@ -59,9 +56,10 @@ namespace CalamityMod.CalPlayer
return;
// Handle on-hit melee effects for the gem tech armor set.
- GemTechState.MeleeOnHitEffects(target);
+ if (item.CountsAsClass())
+ GemTechState.MeleeOnHitEffects(target);
- // Handle on-hit melee effects for the mythril armor set.
+ // Handle on-hit melee effects for the mythril armor set. (all class inclusive)
MythrilArmorSetChange.OnHitEffects(target, damageDone, Player);
if (witheringWeaponEnchant)
@@ -71,6 +69,7 @@ namespace CalamityMod.CalPlayer
target.AddBuff(BuffType(), VulnerabilityHex.AflameDuration);
target.Calamity().IncreasedColdEffects_EskimoSet = eskimoSet;
+ target.Calamity().IncreasedColdEffects_FrozenWings = frozenWingsCold;
target.Calamity().IncreasedColdEffects_CryoStone = CryoStone;
target.Calamity().IncreasedElectricityEffects_Transformer = transformer;
@@ -181,6 +180,10 @@ namespace CalamityMod.CalPlayer
if (rageModeActive && shatteredCommunity)
Player.GetModPlayer().AccumulateRageDamage(damageDone);
+
+ // Ursa Sergeant slash cooldown is reset on kill
+ if (ursaSergeant && target.life <= 0 && target.realLife == -1)
+ ursaSergeantCooldown = (int)MathHelper.Clamp(ursaSergeantCooldown - 180, 0, 300);
}
#endregion
@@ -197,17 +200,18 @@ namespace CalamityMod.CalPlayer
GemTechState.MeleeOnHitEffects(target);
// Handle on-hit ranged effects for the gem tech armor set.
- if (proj.CountsAsClass() && proj.type != ModContent.ProjectileType())
+ if (proj.CountsAsClass() && proj.type != ProjectileType())
GemTechState.RangedOnHitEffects(target, proj.damage);
// Handle on-hit projectiles effects for the mythril armor set.
- if (proj.type != ModContent.ProjectileType())
+ if (proj.type != ProjectileType())
MythrilArmorSetChange.OnHitEffects(target, damageDone, Player);
if (witheringWeaponEnchant)
witheringDamageDone += (int)(damageDone * (hit.Crit ? 2D : 1D));
cgn.IncreasedColdEffects_EskimoSet = eskimoSet;
+ cgn.IncreasedColdEffects_FrozenWings = frozenWingsCold;
cgn.IncreasedColdEffects_CryoStone = CryoStone;
cgn.IncreasedElectricityEffects_Transformer = transformer;
@@ -286,6 +290,10 @@ namespace CalamityMod.CalPlayer
target.AddBuff(BuffType(), 60);
break;
+ case ProjectileID.LunarFlare:
+ target.AddBuff(BuffType(), 180);
+ break;
+
case ProjectileID.Cascade:
target.AddBuff(BuffID.OnFire, 60);
break;
@@ -338,6 +346,10 @@ namespace CalamityMod.CalPlayer
target.AddBuff(BuffID.OnFire3, 120);
}
+ // Ursa Sergeant slash cooldown is reset on kill
+ if (ursaSergeant && target.life <= 0 && target.realLife == -1)
+ ursaSergeantCooldown = (int)MathHelper.Clamp(ursaSergeantCooldown - 180, 0, 300);
+
if (!proj.npcProj && !proj.trap && proj.friendly)
{
if ((plaguebringerCarapace || uberBees) && CalamityLists.friendlyBeeList.Contains(proj.type))
@@ -487,7 +499,7 @@ namespace CalamityMod.CalPlayer
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
return;
- CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Main.player[proj.owner], heal, ModContent.ProjectileType(), BalancingConstants.LifeStealRange);
+ CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Main.player[proj.owner], heal, ProjectileType(), BalancingConstants.LifeStealRange);
}
if ((cgp.betterLifeBullet1 || cgp.betterLifeBullet2) && proj.numHits == 0)
@@ -509,7 +521,7 @@ namespace CalamityMod.CalPlayer
for (int i = 0; i <= 2; i++)
{
- CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Main.player[proj.owner], heal, ModContent.ProjectileType(), BalancingConstants.LifeStealRange);
+ CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Main.player[proj.owner], heal, ProjectileType(), BalancingConstants.LifeStealRange);
}
}
@@ -615,13 +627,13 @@ namespace CalamityMod.CalPlayer
if (!proj.CountsAsClass() && !proj.CountsAsClass() && Player.meleeEnchant == 7)
Projectile.NewProjectile(source, position, proj.velocity, ProjectileID.ConfettiMelee, 0, 0f, proj.owner);
- if (alchFlask && AlchFlaskCooldown == 0 && proj.type != ModContent.ProjectileType())
+ if (alchFlask && AlchFlaskCooldown == 0 && proj.type != ProjectileType())
{
int seekerDamage = (int)Player.GetBestClassDamage().ApplyTo(10);
seekerDamage = Player.ApplyArmorAccDamageBonusesTo(seekerDamage);
Vector2 seekerVelocity = new Vector2(5, 5).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1.2f);
- Projectile bee = Projectile.NewProjectileDirect(source, position, seekerVelocity, ModContent.ProjectileType(), seekerDamage, 0f, Player.whoAmI, -20, 30, 2);
+ Projectile bee = Projectile.NewProjectileDirect(source, position, seekerVelocity, ProjectileType(), seekerDamage, 0f, Player.whoAmI, -20, 30, 2);
bee.ArmorPenetration = 20;
bee.penetrate = 2;
bee.extraUpdates = 1;
@@ -664,7 +676,17 @@ namespace CalamityMod.CalPlayer
{
AbaddonCooldown = 15;
int AbaddonExploDamage = CalamityUtils.DamageSoftCap(proj.damage * 0.03f, 25);
- Projectile.NewProjectile(source, position, Vector2.Zero, ModContent.ProjectileType(), AbaddonExploDamage, 0f, Player.whoAmI);
+ Projectile.NewProjectile(source, position, Vector2.Zero, ProjectileType(), AbaddonExploDamage, 0f, Player.whoAmI);
+ }
+
+ if (ursaSergeant && ursaSergeantCooldown <= 0)
+ {
+ ursaSergeantCooldown = 300;
+
+ int ursaSlashdamage = (int)Player.GetBestClassDamage().ApplyTo(333);
+ ursaSlashdamage = Player.ApplyArmorAccDamageBonusesTo(ursaSlashdamage);
+
+ Projectile.NewProjectile(source, position, Vector2.Zero, ProjectileType(), ursaSlashdamage, 0f, Player.whoAmI);
}
if (proj.CountsAsClass())
@@ -787,7 +809,7 @@ namespace CalamityMod.CalPlayer
// Bloodflare Mage Explosion: 50%, softcap starts at 500 base damage to not overly punish slow weapons
int bloodflareFireballDamage = Player.ApplyArmorAccDamageBonusesTo(CalamityUtils.DamageSoftCap(proj.damage * 0.5, 250));
- int fire = Projectile.NewProjectile(source, position, Vector2.Zero, ModContent.ProjectileType(), bloodflareFireballDamage, 0f, Player.whoAmI, 0f, 0f, 1f);
+ int fire = Projectile.NewProjectile(source, position, Vector2.Zero, ProjectileType(), bloodflareFireballDamage, 0f, Player.whoAmI, 0f, 0f, 1f);
if (fire.WithinBounds(Main.maxProjectiles))
{
Main.projectile[fire].DamageType = DamageClass.Generic;
@@ -1075,11 +1097,11 @@ namespace CalamityMod.CalPlayer
int damage = (int)Player.GetTotalDamage().ApplyTo(40);
damage = Player.ApplyArmorAccDamageBonusesTo(damage);
- Projectile.NewProjectile(spawnSource, proj.Center, Vector2.Zero, ProjectileType(), damage, proj.knockBack, proj.owner, 1f, 0f);
+ Projectile.NewProjectile(spawnSource, proj.Center, Vector2.Zero, ProjectileType(), damage, proj.knockBack, proj.owner, 1f, 0f);
SoundEngine.PlaySound(SoundID.Item14, proj.Center);
- for (int dustexplode = 0; dustexplode < 360; dustexplode++)
+ for (int dustexplode = 0; dustexplode < 180; dustexplode++)
{
- Vector2 dustd = new Vector2(17f, 17f).RotatedBy(MathHelper.ToRadians(dustexplode));
+ Vector2 dustd = new Vector2(17f, 17f).RotatedBy(MathHelper.ToRadians(dustexplode * 2));
int d = Dust.NewDust(proj.Center, proj.width, proj.height, Main.rand.NextBool() ? DustType() : DustType(), dustd.X, dustd.Y, 100, default, 1f);
Main.dust[d].noGravity = true;
Main.dust[d].position = proj.Center;
@@ -1134,7 +1156,7 @@ namespace CalamityMod.CalPlayer
if (raiderTalisman && modProj.stealthStrike)
{
- raiderCritBonus = RaidersTalisman.RaiderBonus;
+ raiderCritLifespan = CalamityUtils.SecondsToFrames(RaidersTalisman.RaiderCooldown);
if (raiderSoundCooldown <= 0)
{
SoundEngine.PlaySound(RaidersTalisman.StealthHitSound, Player.Center);
@@ -1182,7 +1204,7 @@ namespace CalamityMod.CalPlayer
{
if (eGauntlet)
{
- CalamityUtils.Inflict246DebuffsNPC(target, ModContent.BuffType());
+ CalamityUtils.Inflict246DebuffsNPC(target, BuffType());
}
if (ataxiaFire)
{
@@ -1244,13 +1266,9 @@ namespace CalamityMod.CalPlayer
if (pSoulArtifact && !profanedCrystal)
target.AddBuff(BuffType(), 300);
- if (profanedCrystalBuffs)
+ if (profanedCrystal && (DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs))
{
- bool empowered = pscState == (int)ProfanedSoulCrystal.ProfanedSoulCrystalState.Empowered;
- if (empowered || Main.dayTime)
- target.AddBuff(BuffType(), 600);
- if (empowered || !Main.dayTime)
- target.AddBuff(BuffType(), 600);
+ target.AddBuff(BuffType(), 600);
}
if (divineBless)
@@ -1265,7 +1283,7 @@ namespace CalamityMod.CalPlayer
//20% chance for Voltaic Jelly
if (Main.rand.NextBool(starTaintedGenerator ? 1 : 5))
{
- target.AddBuff(ModContent.BuffType(), 60);
+ target.AddBuff(BuffType(), 60);
}
}
@@ -1283,6 +1301,11 @@ namespace CalamityMod.CalPlayer
target.AddBuff(BuffType(), 180);
if (sulphurSet)
target.AddBuff(BuffID.Poisoned, 60);
+ if (aSpark && Player.IsUnderwater())
+ {
+ int duration = transformer ? 120 : 60;
+ target.AddBuff(BuffType(), duration);
+ }
if (abyssalAmulet)
{
CalamityUtils.Inflict246DebuffsNPC(target, BuffType());
@@ -1324,7 +1347,7 @@ namespace CalamityMod.CalPlayer
if (gladiatorSword && target.IsAnEnemy(false) && target.life <= 0 && target.Calamity().gladiatorOnKill && target.lifeMax > 5)
{
target.Calamity().gladiatorOnKill = false;
- Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center.X, target.Center.Y, target.velocity.X / 2, target.velocity.Y / 2, ModContent.ProjectileType(), 0, 0f);
+ Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center.X, target.Center.Y, target.velocity.X / 2, target.velocity.Y / 2, ProjectileType(), 0, 0f);
}
if (Main.player[Main.myPlayer].lifeSteal > 0f && !Player.moonLeech && target.lifeMax > 5)
@@ -1490,7 +1513,7 @@ namespace CalamityMod.CalPlayer
if (gladiatorSword && target.IsAnEnemy(false) && target.life <= 0 && target.Calamity().gladiatorOnKill && target.lifeMax > 5)
{
target.Calamity().gladiatorOnKill = false;
- Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, target.velocity * 0.5f, ModContent.ProjectileType(), 0, 0f);
+ Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, target.velocity * 0.5f, ProjectileType(), 0, 0f);
}
if (reaverDefense)
diff --git a/CalPlayer/DrawLayers/HatExtensionLayer.cs b/CalPlayer/DrawLayers/HatExtensionLayer.cs
index b2231f0f0a..7b512ea262 100644
--- a/CalPlayer/DrawLayers/HatExtensionLayer.cs
+++ b/CalPlayer/DrawLayers/HatExtensionLayer.cs
@@ -23,9 +23,6 @@ namespace CalamityMod.CalPlayer.DrawLayers
if (drawPlayer.armor[10].type > ItemID.None)
headItem = drawPlayer.armor[10];
- if (drawPlayer.Calamity().cocosFeather)
- headItem = new Item(ModContent.ItemType());
-
if (ModContent.GetModItem(headItem.type) is IExtendedHat extendedHatDrawer)
{
string equipSlotName = extendedHatDrawer.EquipSlotName(drawPlayer) != "" ? extendedHatDrawer.EquipSlotName(drawPlayer) : headItem.ModItem.Name;
diff --git a/CalPlayer/DrawLayers/HeldItemGlowMaskLayer.cs b/CalPlayer/DrawLayers/HeldItemGlowMaskLayer.cs
index bbe33b81dd..92ecc32019 100644
--- a/CalPlayer/DrawLayers/HeldItemGlowMaskLayer.cs
+++ b/CalPlayer/DrawLayers/HeldItemGlowMaskLayer.cs
@@ -81,7 +81,7 @@ namespace CalamityMod.CalPlayer.DrawLayers
else if (itemType == ModContent.ItemType())
glowMask = ModContent.Request("CalamityMod/Items/Weapons/Magic/SoulPiercerGlow").Value;
else if (itemType == ModContent.ItemType())
- glowMask = ModContent.Request("CalamityMod/Items/Weapons/Magic/SubsumingVortexGlow").Value;
+ glowMask = ModContent.Request("CalamityMod/Items/Weapons/Magic/SubsumingVortexSmallGlow").Value;
else if (itemType == ModContent.ItemType())
glowMask = ModContent.Request("CalamityMod/Items/Weapons/Melee/TerrorBladeGlow").Value;
else if (itemType == ModContent.ItemType())
diff --git a/CalamityConditions.cs b/CalamityConditions.cs
index 8cce78968e..0bba1b6e52 100644
--- a/CalamityConditions.cs
+++ b/CalamityConditions.cs
@@ -19,7 +19,7 @@ namespace CalamityMod
// Config based conditions
//
- public static readonly Condition PotionSellingConfig = Create("PotionConfig", () => CalamityConfig.Instance.PotionSelling);
+ public static readonly Condition PotionSellingConfig = Create("PotionConfig", () => CalamityServerConfig.Instance.PotionSelling);
//
// Player conditions
diff --git a/CalamityConfig.cs b/CalamityConfig.cs
index 9633a4a45b..6d19bd6f3e 100644
--- a/CalamityConfig.cs
+++ b/CalamityConfig.cs
@@ -5,25 +5,22 @@ using CalamityMod.UI.DraedonsArsenal;
using CalamityMod.UI.Rippers;
using CalamityMod.UI.SulphurousWaterMeter;
using Terraria;
+using Terraria.Localization;
using Terraria.ModLoader.Config;
namespace CalamityMod
{
[BackgroundColor(49, 32, 36, 216)]
- public class CalamityConfig : ModConfig
+ public class CalamityClientConfig : ModConfig
{
- public static CalamityConfig Instance;
+ public static CalamityClientConfig Instance;
- // TODO -- Not all Calamity config settings should be considered client side.
- // There are many configs which are server side and should stay that way.
public override ConfigScope Mode => ConfigScope.ClientSide;
- public override bool AcceptClientChanges(ModConfig pendingConfig, int whoAmI, ref string message) => true;
// Clamps values that would cause ugly problems if loaded directly without sanitization.
[OnDeserialized]
internal void ClampValues(StreamingContext context)
{
- BossHealthBoost = Utils.Clamp(BossHealthBoost, MinBossHealthBoost, MaxBossHealthBoost);
RipperMeterShake = Utils.Clamp(RipperMeterShake, MinMeterShake, MaxMeterShake);
ParticleLimit = (int)Utils.Clamp(ParticleLimit, MinParticleLimit, MaxParticleLimit);
}
@@ -48,10 +45,6 @@ namespace CalamityMod
[DefaultValue(5000)]
public int ParticleLimit { get; set; }
- [BackgroundColor(192, 54, 64, 192)]
- [DefaultValue(false)]
- public bool BossesStopWeather { get; set; }
-
[BackgroundColor(192, 54, 64, 192)]
[SliderColor(224, 165, 56, 128)]
[Range(0f, 10f)]
@@ -106,6 +99,33 @@ namespace CalamityMod
[DefaultValue(true)]
public bool StealthMeter { get; set; }
+ [BackgroundColor(192, 54, 64, 192)]
+ [DefaultValue(true)]
+ public bool ChargeMeter { get; set; }
+
+ private const float MinMeterShake = 0f;
+ private const float MaxMeterShake = 4f;
+
+ [BackgroundColor(192, 54, 64, 192)]
+ [SliderColor(224, 165, 56, 128)]
+ [Range(MinMeterShake, MaxMeterShake)]
+ [Increment(1f)]
+ [DrawTicks]
+ [DefaultValue(2f)]
+ public float RipperMeterShake { get; set; }
+
+ [BackgroundColor(192, 54, 64, 192)]
+ [DefaultValue(false)]
+ public bool SpeedrunTimer { get; set; }
+
+ [BackgroundColor(192, 54, 64, 192)]
+ [DefaultValue(true)]
+ public bool FlightBar { get; set; }
+ #endregion
+
+ #region Meter Positions
+ [Header("MeterPositions")]
+
[BackgroundColor(192, 54, 64, 192)]
[SliderColor(224, 165, 56, 128)]
[Range(0f, 100f)]
@@ -130,10 +150,6 @@ namespace CalamityMod
[DefaultValue(SulphurousWaterMeterUI.DefaultPosY)]
public float SulphuricWaterMeterPosY { get; set; }
- [BackgroundColor(192, 54, 64, 192)]
- [DefaultValue(true)]
- public bool ChargeMeter { get; set; }
-
[BackgroundColor(192, 54, 64, 192)]
[SliderColor(224, 165, 56, 128)]
[Range(0f, 100f)]
@@ -147,8 +163,28 @@ namespace CalamityMod
public float ChargeMeterPosY { get; set; }
[BackgroundColor(192, 54, 64, 192)]
- [DefaultValue(false)]
- public bool SpeedrunTimer { get; set; }
+ [SliderColor(224, 165, 56, 128)]
+ [Range(0f, 100f)]
+ [DefaultValue(RipperUI.DefaultRagePosX)]
+ public float RageMeterPosX { get; set; }
+
+ [BackgroundColor(192, 54, 64, 192)]
+ [SliderColor(224, 165, 56, 128)]
+ [Range(0f, 100f)]
+ [DefaultValue(RipperUI.DefaultRagePosY)]
+ public float RageMeterPosY { get; set; }
+
+ [BackgroundColor(192, 54, 64, 192)]
+ [SliderColor(224, 165, 56, 128)]
+ [Range(0f, 100f)]
+ [DefaultValue(RipperUI.DefaultAdrenPosX)]
+ public float AdrenalineMeterPosX { get; set; }
+
+ [BackgroundColor(192, 54, 64, 192)]
+ [SliderColor(224, 165, 56, 128)]
+ [Range(0f, 100f)]
+ [DefaultValue(RipperUI.DefaultAdrenPosY)]
+ public float AdrenalineMeterPosY { get; set; }
[BackgroundColor(192, 54, 64, 192)]
[SliderColor(224, 165, 56, 128)]
@@ -162,10 +198,6 @@ namespace CalamityMod
[DefaultValue(SpeedrunTimerUI.DefaultTimerPosY)]
public float SpeedrunTimerPosY { get; set; }
- [BackgroundColor(192, 54, 64, 192)]
- [DefaultValue(true)]
- public bool FlightBar { get; set; }
-
[BackgroundColor(192, 54, 64, 192)]
[SliderColor(224, 165, 56, 128)]
[Range(0f, 100f)]
@@ -206,7 +238,37 @@ namespace CalamityMod
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
public bool FasterFallHotkey { get; set; }
+ #endregion
+ }
+ [BackgroundColor(49, 32, 36, 216)]
+ public class CalamityServerConfig : ModConfig
+ {
+ public static CalamityServerConfig Instance;
+ public override ConfigScope Mode => ConfigScope.ServerSide;
+ public override bool AcceptClientChanges(ModConfig pendingConfig, int whoAmI, ref NetworkText message)
+ {
+ if (whoAmI == 0)
+ {
+ return true;
+ }
+ if (whoAmI != 0)
+ {
+ message = CalamityUtils.GetText("Configs.CalamityServerConfig.Denied").ToNetworkText();
+ return false;
+ }
+ return false;
+ }
+
+ // Clamps values that would cause ugly problems if loaded directly without sanitization.
+ [OnDeserialized]
+ internal void ClampValues(StreamingContext context)
+ {
+ BossHealthBoost = Utils.Clamp(BossHealthBoost, MinBossHealthBoost, MaxBossHealthBoost);
+ }
+
+ [Header("Gameplay")]
+ #region General Gameplay Changes
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
public bool RemoveReforgeRNG { get; set; }
@@ -257,6 +319,10 @@ namespace CalamityMod
[DrawTicks]
[DefaultValue(MinBossHealthBoost)]
public float BossHealthBoost { get; set; }
+
+ [BackgroundColor(192, 54, 64, 192)]
+ [DefaultValue(false)]
+ public bool BossesStopWeather { get; set; }
#endregion
#region Default Player Stat Boosts
@@ -306,44 +372,5 @@ namespace CalamityMod
[DefaultValue(false)]
public bool ForceTownSafety { get; set; }
#endregion
-
- #region Revengeance Mode Changes
- [Header("Revengeance")]
-
- private const float MinMeterShake = 0f;
- private const float MaxMeterShake = 4f;
-
- [BackgroundColor(192, 54, 64, 192)]
- [SliderColor(224, 165, 56, 128)]
- [Range(MinMeterShake, MaxMeterShake)]
- [Increment(1f)]
- [DrawTicks]
- [DefaultValue(2f)]
- public float RipperMeterShake { get; set; }
-
- [BackgroundColor(192, 54, 64, 192)]
- [SliderColor(224, 165, 56, 128)]
- [Range(0f, 100f)]
- [DefaultValue(RipperUI.DefaultRagePosX)]
- public float RageMeterPosX { get; set; }
-
- [BackgroundColor(192, 54, 64, 192)]
- [SliderColor(224, 165, 56, 128)]
- [Range(0f, 100f)]
- [DefaultValue(RipperUI.DefaultRagePosY)]
- public float RageMeterPosY { get; set; }
-
- [BackgroundColor(192, 54, 64, 192)]
- [SliderColor(224, 165, 56, 128)]
- [Range(0f, 100f)]
- [DefaultValue(RipperUI.DefaultAdrenPosX)]
- public float AdrenalineMeterPosX { get; set; }
-
- [BackgroundColor(192, 54, 64, 192)]
- [SliderColor(224, 165, 56, 128)]
- [Range(0f, 100f)]
- [DefaultValue(RipperUI.DefaultAdrenPosY)]
- public float AdrenalineMeterPosY { get; set; }
- #endregion
}
}
diff --git a/CalamityLists.cs b/CalamityLists.cs
index 4cd4d3d5f5..1d288f932b 100644
--- a/CalamityLists.cs
+++ b/CalamityLists.cs
@@ -13,6 +13,7 @@ using CalamityMod.Items.LoreItems;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables;
using CalamityMod.Items.Placeables.Furniture.Trophies;
+using CalamityMod.Items.Tools;
using CalamityMod.Items.TreasureBags;
using CalamityMod.Items.Weapons.DraedonsArsenal;
using CalamityMod.Items.Weapons.Magic;
@@ -63,6 +64,7 @@ using CalamityMod.Projectiles.DraedonsArsenal;
using CalamityMod.Projectiles.Enemy;
using CalamityMod.Projectiles.Magic;
using CalamityMod.Projectiles.Melee;
+using CalamityMod.Projectiles.Melee.MaceFlails;
using CalamityMod.Projectiles.Ranged;
using CalamityMod.Projectiles.Rogue;
using CalamityMod.Projectiles.Summon;
@@ -104,8 +106,7 @@ namespace CalamityMod
public static List amalgamBuffList;
public static List persistentBuffList;
public static List MagicGunIDs;
- public static List MushroomWeaponIDs;
- public static List MushroomProjectileIDs;
+ public static List BlacklistedWeaponsWithToolPower;
// Some of these lists of enemies are unused, but were difficult to create. Many of these common enemy types have a ton of variants.
public static List zombieList;
@@ -281,7 +282,7 @@ namespace CalamityMod
"cocodezi_",
"Mendzey",
"GameRDheAsianSandwich",
- "Tobias",
+ "Chigbungus",
"Streakist",
"Eisaya",
"Xenocrona",
@@ -816,6 +817,7 @@ namespace CalamityMod
ProjectileType(),
ProjectileType(),
ProjectileType(),
+ ProjectileType(),
ProjectileType(),
ProjectileType(),
ProjectileType(),
@@ -837,6 +839,7 @@ namespace CalamityMod
ProjectileType(),
ProjectileType(),
ProjectileType(),
+ ProjectileType(),
ProjectileType(),
ProjectileType(),
ProjectileType(),
@@ -910,17 +913,17 @@ namespace CalamityMod
NPCType(),
NPCType(),
NPCType(),
+ NPCID.EyeofCthulhu,
+ NPCType(),
NPCID.EaterofWorldsHead,
NPCID.EaterofWorldsBody,
NPCID.EaterofWorldsTail,
NPCID.BrainofCthulhu,
NPCID.Creeper,
- NPCID.EyeofCthulhu,
- NPCType(),
NPCID.QueenBee,
+ NPCID.Deerclops,
NPCID.SkeletronHead,
NPCID.SkeletronHand,
- NPCID.Deerclops,
NPCID.WallofFlesh,
NPCID.WallofFleshEye,
NPCID.PirateShipCannon,
@@ -928,6 +931,7 @@ namespace CalamityMod
NPCID.Probe,
NPCID.Retinazer,
NPCID.Spazmatism,
+ NPCType(),
NPCID.SkeletronPrime,
NPCType(),
NPCID.PrimeCannon,
@@ -937,7 +941,6 @@ namespace CalamityMod
NPCID.Plantera,
NPCID.PlanterasTentacle,
NPCType(),
- NPCID.HallowBoss,
NPCID.Everscream,
NPCID.SantaNK1,
NPCID.IceQueen,
@@ -955,6 +958,7 @@ namespace CalamityMod
NPCID.DukeFishron,
NPCID.Sharkron,
NPCID.Sharkron2,
+ NPCID.HallowBoss,
NPCID.CultistBoss,
NPCID.CultistDragonHead,
NPCID.CultistDragonBody1,
@@ -1562,6 +1566,7 @@ namespace CalamityMod
TileType(),
TileType(),
TileType(),
+ TileType(),
TileID.LivingFire,
TileID.LivingCursedFire,
TileID.LivingDemonFire,
@@ -1585,7 +1590,6 @@ namespace CalamityMod
BuffType(),
BuffType(),
BuffType(),
- BuffType(),
BuffType(),
BuffType(),
BuffType(),
@@ -1723,32 +1727,17 @@ namespace CalamityMod
ItemID.ZapinatorOrange
};
- MushroomWeaponIDs = new List()
+ // This list intentionally does not contain Grax.
+ BlacklistedWeaponsWithToolPower = new List()
{
- ItemType(),
- ItemType(),
- ItemType