Player effects and enemy infliction

This commit is contained in:
mochi-angel committed 2024-10-22 06:31:23 -07:00
1 parent d5d60b33e9
commit b5dc0df376
9 files changed
+23 -31

No files matched your search

+10 -22
View File
@@ -33,26 +33,8 @@ namespace CalamityMod.Buffs.DamageOverTime
internal static void DrawEffects(PlayerDrawSet drawInfo)
{
Player Player = drawInfo.drawPlayer;
// A bit of blood
if (Main.rand.NextBool(30))
{
int bloodLifetime = Main.rand.Next(22, 36);
float bloodScale = Main.rand.NextFloat(0.6f, 0.8f);
Color bloodColor = Color.Lerp(Color.Red, Color.DarkRed, Main.rand.NextFloat());
bloodColor = Color.Lerp(bloodColor, new Color(51, 22, 94), Main.rand.NextFloat(0.65f));
if (Main.rand.NextBool(15))
bloodScale *= 1.3f;
float randomSpeedMultiplier = Main.rand.NextFloat(1.25f, 1.5f);
Vector2 bloodVelocity = Main.rand.NextVector2Unit() * 2 * randomSpeedMultiplier;
bloodVelocity.Y -= 5f;
BloodParticle blood = new BloodParticle(Player.Center, bloodVelocity, bloodLifetime, bloodScale, bloodColor);
GeneralParticleHandler.SpawnParticle(blood);
}
// Blue n black dust
Dust water = Dust.NewDustDirect(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, DustID.Water, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1.4f);
Dust water = Dust.NewDustDirect(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, 390, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1.4f);
water.noGravity = true;
water.velocity *= 0.75f;
water.velocity.X *= 0.75f;
@@ -62,11 +44,17 @@ namespace CalamityMod.Buffs.DamageOverTime
water.noGravity = false;
water.scale *= 0.5f;
}
if (Main.rand.NextBool(5))
if (Main.rand.NextBool(4))
{
DirectionalPulseRing pulse = new DirectionalPulseRing(Player.Calamity().RandomDebuffVisualSpot, new Vector2(Main.rand.NextFloat(-1f, 1f), Main.rand.NextFloat(-3f, -4f)), Main.rand.NextBool() ? Color.DarkBlue : Color.Blue, new Vector2(0.8f, 1), 0, 0.09f, 0f, 45);
DirectionalPulseRing pulse = new DirectionalPulseRing(Player.Calamity().RandomDebuffVisualSpot, new Vector2(Main.rand.NextFloat(-1f, 1f), Main.rand.NextFloat(-3f, -4f)), Main.rand.NextBool() ? Color.DeepSkyBlue : Color.MediumBlue, new Vector2(0.8f, 1), 0, 0.09f, 0f, 45);
GeneralParticleHandler.SpawnParticle(pulse);
}
if (Main.rand.NextBool(10))
{
Color smokeColor = Color.MediumBlue;
Particle smoke = new HeavySmokeParticle(Player.Calamity().RandomDebuffVisualSpot, new Vector2(2f, 2f).RotatedByRandom(100) * Main.rand.NextFloat(0.3f, 0.7f), smokeColor, 40, Main.rand.NextFloat(0.3f, 0.4f), 0.5f, Main.rand.NextFloat(-0.2f, 0.2f), false, required: true);
GeneralParticleHandler.SpawnParticle(smoke);
}
}
internal static void DrawEffects(NPC npc, ref Color drawColor)
@@ -75,7 +63,7 @@ namespace CalamityMod.Buffs.DamageOverTime
if (Main.rand.NextBool(13))
{
Color smokeColor = Color.MediumBlue;
Particle smoke = new HeavySmokeParticle(npcSize, new Vector2(2f, 2f).RotatedByRandom(100) * Main.rand.NextFloat(0.3f, 0.7f), smokeColor, 40, Main.rand.NextFloat(0.3f, 0.4f), 0.5f, Main.rand.NextFloat(-0.2f, 0.2f), false, required: true);
Particle smoke = new HeavySmokeParticle(npcSize, new Vector2(2f, 2f).RotatedByRandom(100) * Main.rand.NextFloat(0.3f, 0.7f), smokeColor, 40, Main.rand.NextFloat(0.3f, 0.4f) + (0.00000013f * npc.width * npc.height), 0.5f, Main.rand.NextFloat(-0.2f, 0.2f), false, required: true);
GeneralParticleHandler.SpawnParticle(smoke);
}
Dust water = Dust.NewDustDirect(npc.position - new Vector2(2f), npc.width + 4, npc.height + 4, 360, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 1.4f);
+6 -3
View File
@@ -255,6 +255,9 @@ namespace CalamityMod.CalPlayer
if (drawInfo.shadow == 0f && (calamityPlayer.hFlames || calamityPlayer.hInferno || calamityPlayer.banishingFire))
HolyFlames.DrawEffects(drawInfo);
if (calamityPlayer.hadopelagicpressure && drawInfo.shadow == 0f)
HadopelagicPressure.DrawEffects(drawInfo);
// Icarus' Folly has visual effects but they are mutually exclusive with all Holy Flames variations to prevent visual clutter
else if (calamityPlayer.icarusFolly && drawInfo.shadow == 0f)
IcarusFolly.DrawEffects(drawInfo);
@@ -269,9 +272,6 @@ 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);
@@ -300,6 +300,9 @@ namespace CalamityMod.CalPlayer
if (calamityPlayer.vermillionFlux && drawInfo.shadow == 0f)
VermillionFlux.DrawEffects(drawInfo);
if (calamityPlayer.voidfrost && drawInfo.shadow == 0f)
Voidfrost.DrawEffects(drawInfo);
if (calamityPlayer.vHex && drawInfo.shadow == 0f)
VulnerabilityHex.DrawEffects(drawInfo);
#endregion
+1
View File
@@ -112,6 +112,7 @@ namespace CalamityMod.CalPlayer
ApplyDoTDebuff(vHex, 35);
ApplyDoTDebuff(trueVHex, 50);
ApplyDoTDebuff(cDepth, 18, purity);
ApplyDoTDebuff(hadopelagicpressure, 40, purity);
ApplyDoTDebuff(astralInfection, 24, infectedJewel || purity);
ApplyDoTDebuff(pFlames, alchFlask ? 10 : 30, purity);
ApplyDoTDebuff(cragsLava, 30);
+1 -1
View File
@@ -256,7 +256,7 @@ namespace CalamityMod.NPCs.Abyss
public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo)
{
if (hurtInfo.Damage > 0)
target.AddBuff(ModContent.BuffType<CrushDepth>(), 300, true);
target.AddBuff(ModContent.BuffType<HadopelagicPressure>(), 300, true);
}
public override void ModifyNPCLoot(NPCLoot npcLoot)
+1 -1
View File
@@ -624,7 +624,7 @@ namespace CalamityMod.NPCs.Abyss
public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo)
{
if (hurtInfo.Damage > 0)
target.AddBuff(ModContent.BuffType<CrushDepth>(), 300, true);
target.AddBuff(ModContent.BuffType<HadopelagicPressure>(), 300, true);
}
public override void ModifyNPCLoot(NPCLoot npcLoot)
+1 -1
View File
@@ -512,7 +512,7 @@ namespace CalamityMod.NPCs.Abyss
public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo)
{
if (hurtInfo.Damage > 0)
target.AddBuff(ModContent.BuffType<CrushDepth>(), 300, true);
target.AddBuff(ModContent.BuffType<HadopelagicPressure>(), 300, true);
}
}
}
+1 -1
View File
@@ -364,7 +364,7 @@ namespace CalamityMod.NPCs.Abyss
public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo)
{
if (hurtInfo.Damage > 0)
target.AddBuff(ModContent.BuffType<RiptideDebuff>(), 90);
target.AddBuff(ModContent.BuffType<CrushDepth>(), 90);
}
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
+1 -1
View File
@@ -709,7 +709,7 @@ namespace CalamityMod.NPCs.Abyss
public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo)
{
if (hurtInfo.Damage > 0)
target.AddBuff(ModContent.BuffType<CrushDepth>(), 300, true);
target.AddBuff(ModContent.BuffType<HadopelagicPressure>(), 300, true);
}
public override float SpawnChance(NPCSpawnInfo spawnInfo)
+1 -1
View File
@@ -1505,7 +1505,7 @@ namespace CalamityMod.NPCs.PrimordialWyrm
public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo)
{
if (NPC.Opacity == 1f && hurtInfo.Damage > 0)
target.AddBuff(ModContent.BuffType<CrushDepth>(), 1200, true);
target.AddBuff(ModContent.BuffType<HadopelagicPressure>(), 1200, true);
}
}
}