Initial Implementation/Inflictions

This commit is contained in:
mochi-angel committed 2024-07-05 11:42:33 -07:00
1 parent 3e69566ddf
commit 8a286f2d4f
30 files changed
+163 -35

No files matched your search

+81
View File
@@ -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(4))
{
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(2))
{
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;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 659 B

+3
View File
@@ -911,6 +911,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;
@@ -1994,6 +1995,7 @@ namespace CalamityMod.CalPlayer
snowmanNoseless = false;
sulphurPoison = false;
nightwither = false;
voidfrost = false;
eutrophication = false;
iCantBreathe = false;
cragsLava = false;
@@ -2425,6 +2427,7 @@ namespace CalamityMod.CalPlayer
abyssalDivingSuitPlateHits = 0;
sulphurPoison = false;
nightwither = false;
voidfrost = false;
eutrophication = false;
iCantBreathe = false;
cragsLava = false;
@@ -1562,3 +1562,8 @@ AeolianEarthBuff: {
Damage reduction increased by 8%, damage increased by 18%
'''
}
Voidfrost: {
DisplayName: Voidfrost
Description: Mods.CalamityMod.Buffs.Voidfrost.Description
}
+15
View File
@@ -281,6 +281,7 @@ namespace CalamityMod.NPCs
public int astralInfection = 0;
public int wDeath = 0;
public int nightwither = 0;
public int voidfrost = 0;
public int shellfishVore = 0;
public int clamDebuff = 0;
public int sulphurPoison = 0;
@@ -500,6 +501,7 @@ namespace CalamityMod.NPCs
myClone.astralInfection = astralInfection;
myClone.wDeath = wDeath;
myClone.nightwither = nightwither;
myClone.voidfrost = voidfrost;
myClone.shellfishVore = shellfishVore;
myClone.clamDebuff = clamDebuff;
myClone.sulphurPoison = sulphurPoison;
@@ -1040,6 +1042,13 @@ namespace CalamityMod.NPCs
ApplyDPSDebuff(baseNightwitherDoTValue, baseNightwitherDoTValue / 5, ref npc.lifeRegen, ref damage);
}
// Voidfrost
if (voidfrost > 0)
{
int baseVoidfrostDoTValue = (int)(300 * coldDamageMult);
ApplyDPSDebuff(baseVoidfrostDoTValue, baseVoidfrostDoTValue / 5, ref npc.lifeRegen, ref damage);
}
// Plague
if (pFlames > 0)
{
@@ -5208,6 +5217,8 @@ namespace CalamityMod.NPCs
wDeath--;
if (nightwither > 0)
nightwither--;
if (voidfrost > 0)
voidfrost--;
if (shellfishVore > 0)
shellfishVore--;
if (clamDebuff > 0)
@@ -6514,6 +6525,9 @@ namespace CalamityMod.NPCs
if (nightwither > 0)
Nightwither.DrawEffects(npc, ref drawColor);
if (voidfrost > 0)
Voidfrost.DrawEffects(npc, ref drawColor);
if (pFlames > 0) // Plague debuff
Plague.DrawEffects(npc, ref drawColor);
@@ -6731,6 +6745,7 @@ namespace CalamityMod.NPCs
("CalamityMod/Buffs/DamageOverTime/SulphuricPoisoning", NPC => NPC.Calamity().sulphurPoison > 0),
("CalamityMod/Buffs/DamageOverTime/Vaporfied", NPC => NPC.Calamity().vaporfied > 0),
("CalamityMod/Buffs/DamageOverTime/VermillionFlux", NPC => NPC.Calamity().vermillionFlux > 0),
("CalamityMod/Buffs/DamageOverTime/Voidfrost", NPC => NPC.Calamity().voidfrost > 0),
("CalamityMod/Buffs/DamageOverTime/VulnerabilityHex", NPC => NPC.Calamity().vulnerabilityHex > 0),
// All other important Calamity debuffs, in alphabetical order
+1 -1
View File
@@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Magic
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<Nightwither>(), 120);
target.AddBuff(ModContent.BuffType<Voidfrost>(), 120);
}
public override void OnKill(int timeLeft)
+1 -1
View File
@@ -100,7 +100,7 @@ namespace CalamityMod.Projectiles.Melee
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
Player player = Main.player[Projectile.owner];
target.AddBuff(ModContent.BuffType<Nightwither>(), 180);
target.AddBuff(ModContent.BuffType<Voidfrost>(), 180);
target.AddBuff(ModContent.BuffType<GlacialState>(), 60);
if (Projectile.localAI[1] <= 0f && Projectile.owner == Main.myPlayer)
{
+2 -3
View File
@@ -117,14 +117,13 @@ namespace CalamityMod.Projectiles.Melee
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<Nightwither>(), 420);
target.AddBuff(ModContent.BuffType<Voidfrost>(), 420);
Projectile.direction = Main.player[Projectile.owner].direction;
}
public override void OnHitPlayer(Player target, Player.HurtInfo info)
{
target.AddBuff(BuffID.Frostburn, 180);
target.AddBuff(ModContent.BuffType<Nightwither>(), 420);
target.AddBuff(ModContent.BuffType<Voidfrost>(), 420);
Projectile.direction = Main.player[Projectile.owner].direction;
}
}
+1 -1
View File
@@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Melee
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<Nightwither>(), 240);
target.AddBuff(ModContent.BuffType<Voidfrost>(), 240);
Projectile.localAI[1] = 4f;
}
}
+1 -1
View File
@@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Melee
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<Nightwither>(), 180);
target.AddBuff(ModContent.BuffType<Voidfrost>(), 180);
}
}
}
+1 -1
View File
@@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Melee
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<Nightwither>(), 180);
target.AddBuff(ModContent.BuffType<Voidfrost>(), 180);
}
}
}
+1 -1
View File
@@ -177,7 +177,7 @@ namespace CalamityMod.Projectiles.Melee
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<Nightwither>(), 240);
target.AddBuff(ModContent.BuffType<Voidfrost>(), 240);
}
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, radius, targetHitbox);
+5
View File
@@ -1,4 +1,5 @@
using System;
using CalamityMod.Buffs.DamageOverTime;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
@@ -104,6 +105,10 @@ namespace CalamityMod.Projectiles.Melee
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1);
return false;
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<Voidfrost>(), 800);
}
public override void OnKill(int timeLeft)
{
+6 -1
View File
@@ -1,4 +1,5 @@
using Microsoft.Xna.Framework;
using CalamityMod.Buffs.DamageOverTime;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
@@ -44,5 +45,9 @@ namespace CalamityMod.Projectiles.Melee
CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 12f, 20f);
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<Voidfrost>(), 800);
}
}
}
@@ -63,13 +63,13 @@ namespace CalamityMod.Projectiles.Melee.Shortswords
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<Nightwither>(), 300);
target.AddBuff(ModContent.BuffType<Voidfrost>(), 300);
SpawnMeteor(Main.player[Projectile.owner]);
}
public override void OnHitPlayer(Player target, Player.HurtInfo info)
{
target.AddBuff(ModContent.BuffType<Nightwither>(), 300);
target.AddBuff(ModContent.BuffType<Voidfrost>(), 300);
SpawnMeteor(Main.player[Projectile.owner]);
}
+2
View File
@@ -1,4 +1,5 @@
using System;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Projectiles.BaseProjectiles;
using Microsoft.Xna.Framework;
@@ -70,5 +71,6 @@ namespace CalamityMod.Projectiles.Melee.Spears
Main.dust[idx].velocity = Vector2.Zero;
}
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType<Voidfrost>(), 180);
}
}
+4 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Items.Weapons.Melee;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
@@ -151,6 +152,8 @@ namespace CalamityMod.Projectiles.Melee
float scale = Main.rand.NextFloat(1.0f, 1.8f);
Main.dust[idx].scale = scale;
}
target.AddBuff(ModContent.BuffType<Voidfrost>(), 180);
}
public override void OnKill(int timeLeft)
+1 -1
View File
@@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Ranged
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 120);
target.AddBuff(ModContent.BuffType<Voidfrost>(), 800);
}
}
}
+1 -1
View File
@@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Ranged
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<Nightwither>(), 450);
target.AddBuff(ModContent.BuffType<Voidfrost>(), 450);
SoundEngine.PlaySound(HalleysInferno.Hit, Projectile.Center);
// Dust emission on hit
+4 -3
View File
@@ -1,4 +1,5 @@
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.StatDebuffs;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
@@ -74,13 +75,13 @@ namespace CalamityMod.Projectiles.Rogue
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(BuffID.Frostburn2, 300);
target.AddBuff(ModContent.BuffType<Voidfrost>(), 300);
target.AddBuff(ModContent.BuffType<GlacialState>(), 150);
}
public override void OnHitPlayer(Player target, Player.HurtInfo info)
{
target.AddBuff(BuffID.Frostburn2, 300);
target.AddBuff(ModContent.BuffType<Voidfrost>(), 300);
target.AddBuff(ModContent.BuffType<GlacialState>(), 150);
}
+4 -3
View File
@@ -1,4 +1,5 @@
using Microsoft.Xna.Framework;
using CalamityMod.Buffs.DamageOverTime;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
@@ -70,9 +71,9 @@ namespace CalamityMod.Projectiles.Rogue
}
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Frostburn2, 120);
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType<Voidfrost>(), 120);
public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.Frostburn2, 120);
public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType<Voidfrost>(), 120);
public override bool PreDraw(ref Color lightColor)
{
+2 -2
View File
@@ -55,13 +55,13 @@ namespace CalamityMod.Projectiles.Rogue
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<Nightwither>(), Projectile.timeLeft);
target.AddBuff(ModContent.BuffType<Voidfrost>(), Projectile.timeLeft);
OnHitEffects();
}
public override void OnHitPlayer(Player target, Player.HurtInfo info)
{
target.AddBuff(ModContent.BuffType<Nightwither>(), Projectile.timeLeft);
target.AddBuff(ModContent.BuffType<Voidfrost>(), Projectile.timeLeft);
OnHitEffects();
}
+2 -2
View File
@@ -63,9 +63,9 @@ namespace CalamityMod.Projectiles.Rogue
}
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType<Nightwither>(), 120);
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType<Voidfrost>(), 120);
public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType<Nightwither>(), 120);
public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType<Voidfrost>(), 120);
public override bool OnTileCollide(Vector2 oldVelocity)
{
+2 -2
View File
@@ -96,9 +96,9 @@ namespace CalamityMod.Projectiles.Rogue
}
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType<Nightwither>(), 120);
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType<Voidfrost>(), 120);
public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType<Nightwither>(), 120);
public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType<Voidfrost>(), 120);
public override bool OnTileCollide(Vector2 oldVelocity)
{
+3 -2
View File
@@ -1,4 +1,5 @@
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Buffs.Summon;
using CalamityMod.CalPlayer;
using Microsoft.Xna.Framework;
@@ -351,7 +352,7 @@ namespace CalamityMod.Projectiles.Summon
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<GlacialState>(), 60);
target.AddBuff(BuffID.Frostburn2, 180);
target.AddBuff(ModContent.BuffType<Voidfrost>(), 180);
}
public override bool? CanDamage() => AttackMode == 2;
+2 -1
View File
@@ -1,4 +1,5 @@
using System;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Buffs.Summon;
using CalamityMod.CalPlayer;
@@ -145,7 +146,7 @@ namespace CalamityMod.Projectiles.Summon
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<GlacialState>(), 60);
target.AddBuff(BuffID.Frostburn2, 180);
target.AddBuff(ModContent.BuffType<Voidfrost>(), 180);
}
public override bool? CanDamage() => AttackMode == 2;
+3 -2
View File
@@ -1,4 +1,5 @@
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.StatDebuffs;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
@@ -104,7 +105,7 @@ namespace CalamityMod.Projectiles.Summon
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<GlacialState>(), 60);
target.AddBuff(BuffID.Frostburn2, 180);
target.AddBuff(ModContent.BuffType<Voidfrost>(), 180);
}
}
}
+6 -1
View File
@@ -1,4 +1,5 @@
using Microsoft.Xna.Framework;
using CalamityMod.Buffs.DamageOverTime;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -45,5 +46,9 @@ namespace CalamityMod.Projectiles.Summon
}
}
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<Voidfrost>(), 180);
}
}
}
+1 -1
View File
@@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Summon
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<Nightwither>(), 180);
target.AddBuff(ModContent.BuffType<Voidfrost>(), 180);
float x4 = Main.rgbToHsl(new Color(103, 203, Main.DiscoB)).X;
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType<SiriusExplosion>(), Projectile.damage, Projectile.knockBack, Projectile.owner, x4, Projectile.whoAmI);
}
+1 -1
View File
@@ -231,6 +231,6 @@ namespace CalamityMod.Projectiles.Summon
return new Color(255 - Projectile.alpha, 255 - Projectile.alpha, 255 - Projectile.alpha, 0);
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType<Nightwither>(), 180);
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType<Voidfrost>(), 180);
}
}