Changed the visuals of almost every buff and debuff on the player
Also added new visuals for rage and adrenaline Added a new function for a often used particle to set its position mounted center on the player (this is why there's so many random file changes)
This commit is contained in:
1 parent
df6db119fc
commit
cb095902c3
23 files changed
+439
-174
No files matched your search
@@ -1,4 +1,4 @@
|
||||
using Terraria;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -17,6 +17,7 @@ namespace CalamityMod.Buffs.StatBuffs
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
player.Calamity().adrenalineModeActive = true;
|
||||
player.Calamity().AdrenalineTrail = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,6 +36,7 @@ namespace CalamityMod.Buffs.StatBuffs
|
||||
player.DelBuff(buffIndex--); // TML documentation requires you to decrement buffIndex if deleting the buff during Update.
|
||||
mp.rageModeActive = false;
|
||||
mp.rage = 0f;
|
||||
player.Calamity().ragePulseTimer = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -225,6 +225,9 @@ namespace CalamityMod.CalPlayer
|
||||
public float SulphWaterPoisoningLevel;
|
||||
public NPC unstableSelectedTarget;
|
||||
public int zapActivity = 0;
|
||||
public bool ragePulse = false;
|
||||
public int rageBuffTimer = 0;
|
||||
public int ragePulseTimer = 0;
|
||||
|
||||
private const int DashDisableCooldown = 12;
|
||||
|
||||
@@ -344,6 +347,7 @@ namespace CalamityMod.CalPlayer
|
||||
#region Adrenaline
|
||||
public bool AdrenalineEnabled => CalamityWorld.revenge || draedonsHeart;
|
||||
public bool adrenalineModeActive = false;
|
||||
public bool AdrenalineTrail = false;
|
||||
public float adrenaline = 0f;
|
||||
public float adrenalineMax = 100f; // 0 to 100% by default
|
||||
public int AdrenalineDuration = CalamityUtils.SecondsToFrames(5);
|
||||
@@ -2092,6 +2096,7 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
rageModeActive = false;
|
||||
adrenalineModeActive = false;
|
||||
AdrenalineTrail = false;
|
||||
RageDuration = BalancingConstants.DefaultRageDuration;
|
||||
RageDamageBoost = BalancingConstants.DefaultRageDamageBoost;
|
||||
|
||||
@@ -2360,6 +2365,7 @@ namespace CalamityMod.CalPlayer
|
||||
tRegen = false;
|
||||
rageModeActive = false;
|
||||
adrenalineModeActive = false;
|
||||
AdrenalineTrail = false;
|
||||
vodka = false;
|
||||
redWine = false;
|
||||
grapeBeer = false;
|
||||
@@ -3053,7 +3059,6 @@ namespace CalamityMod.CalPlayer
|
||||
if (Player.whoAmI == Main.myPlayer)
|
||||
SoundEngine.PlaySound(ActivationSound);
|
||||
|
||||
// TODO -- Adrenaline should provide bright green vibrating afterimages on the player for the duration.
|
||||
int dustPerSegment = 96;
|
||||
|
||||
// Parametric segment 1: y = 3x + 120
|
||||
@@ -3075,7 +3080,7 @@ namespace CalamityMod.CalPlayer
|
||||
for (int i = 0; i < dustPerSegment; ++i)
|
||||
{
|
||||
bool electricity = Main.rand.NextBool(4);
|
||||
int dustID = electricity ? 132 : DustID.TerraBlade;
|
||||
int dustID = electricity ? (Main.rand.NextBool(2) ? 132 : 131) : ModContent.DustType<AdrenDust>();
|
||||
|
||||
float interpolant = i + 0.5f;
|
||||
float spreadSpeed = Main.rand.NextFloat(0.5f, maxDustVelSpread);
|
||||
@@ -3086,19 +3091,19 @@ namespace CalamityMod.CalPlayer
|
||||
Dust d = Dust.NewDustPerfect(segmentOnePos, dustID, Vector2.Zero);
|
||||
if (electricity)
|
||||
d.noGravity = false;
|
||||
d.scale = Main.rand.NextFloat(0.8f, 1.4f);
|
||||
d.scale = Main.rand.NextFloat(1.2f, 1.8f);
|
||||
d.velocity = Main.rand.NextVector2Unit() * spreadSpeed;
|
||||
|
||||
Vector2 segmentTwoPos = Player.Center + segmentTwoStart + segmentTwoIncrement * interpolant;
|
||||
d = Dust.CloneDust(d);
|
||||
d.position = segmentTwoPos;
|
||||
d.scale = Main.rand.NextFloat(0.8f, 1.4f);
|
||||
d.scale = Main.rand.NextFloat(1.2f, 1.8f);
|
||||
d.velocity = Main.rand.NextVector2Unit() * spreadSpeed;
|
||||
|
||||
Vector2 segmentThreePos = Player.Center + segmentThreeStart + segmentThreeIncrement * interpolant;
|
||||
d = Dust.CloneDust(d);
|
||||
d.position = segmentThreePos;
|
||||
d.scale = Main.rand.NextFloat(0.8f, 1.4f);
|
||||
d.scale = Main.rand.NextFloat(1.2f, 1.8f);
|
||||
d.velocity = Main.rand.NextVector2Unit() * spreadSpeed;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using CalamityMod.CalPlayer.DrawLayers;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Items.Weapons.Ranged;
|
||||
@@ -199,71 +200,74 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
}
|
||||
}
|
||||
if (calamityPlayer.auricSet)
|
||||
{
|
||||
if (Player != null && !Player.dead)
|
||||
{
|
||||
Lighting.AddLight((int)Player.Center.X / 16, (int)Player.Center.Y / 16, 31 / 235f, 170 / 235f, 222 / 235f);
|
||||
if (!Player.mount.Active)
|
||||
{
|
||||
if (Main.rand.NextBool(14) && drawInfo.shadow == 0f)
|
||||
{
|
||||
int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 8, Player.height + 8, 206, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1.5f);
|
||||
Main.dust[dust].noGravity = true;
|
||||
Main.dust[dust].velocity *= 1f;
|
||||
drawInfo.DustCache.Add(dust);
|
||||
}
|
||||
if (noRogueStealth)
|
||||
{
|
||||
r *= 0f;
|
||||
g *= 0.55f;
|
||||
b *= 0.6f;
|
||||
fullBright = true;
|
||||
}
|
||||
}
|
||||
if (!Player.StandingStill() && !Player.mount.Active)
|
||||
{
|
||||
if (Main.rand.NextBool(8) && drawInfo.shadow == 0f)
|
||||
{
|
||||
int de_dust2 = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, Main.rand.NextBool(2) ? 204 : 213, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1.5f);
|
||||
Main.dust[de_dust2].noGravity = true;
|
||||
Main.dust[de_dust2].velocity *= 0.5f;
|
||||
drawInfo.DustCache.Add(de_dust2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (calamityPlayer.auricSet)
|
||||
{
|
||||
if (Player != null && !Player.dead)
|
||||
{
|
||||
Lighting.AddLight((int)Player.Center.X / 16, (int)Player.Center.Y / 16, 31 / 235f, 170 / 235f, 222 / 235f);
|
||||
if (!Player.mount.Active)
|
||||
{
|
||||
if (Main.rand.NextBool(14) && drawInfo.shadow == 0f)
|
||||
{
|
||||
int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 8, Player.height + 8, 206, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1.5f);
|
||||
Main.dust[dust].noGravity = true;
|
||||
Main.dust[dust].velocity *= 1f;
|
||||
drawInfo.DustCache.Add(dust);
|
||||
}
|
||||
if (noRogueStealth)
|
||||
{
|
||||
r *= 0f;
|
||||
g *= 0.55f;
|
||||
b *= 0.6f;
|
||||
fullBright = true;
|
||||
}
|
||||
}
|
||||
if (!Player.StandingStill() && !Player.mount.Active)
|
||||
{
|
||||
if (Main.rand.NextBool(8) && drawInfo.shadow == 0f)
|
||||
{
|
||||
int de_dust2 = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, Main.rand.NextBool(2) ? 204 : 213, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1.5f);
|
||||
Main.dust[de_dust2].noGravity = true;
|
||||
Main.dust[de_dust2].velocity *= 0.5f;
|
||||
drawInfo.DustCache.Add(de_dust2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (calamityPlayer.bFlames)
|
||||
{
|
||||
if (Main.rand.NextBool(abaddon ? 6 : 4) && drawInfo.shadow == 0f) //looks weaker if you have Abaddon equipped
|
||||
if (Main.rand.NextBool(abaddon ? 4 : 2) && drawInfo.shadow == 0f) //looks weaker if you have Abaddon equipped
|
||||
{
|
||||
int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, ModContent.DustType<BrimstoneFlame>(), Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, abaddon ? 1.3f : 3f);
|
||||
Main.dust[dust].noGravity = true;
|
||||
Main.dust[dust].velocity *= 1.8f;
|
||||
Main.dust[dust].velocity.Y -= 0.5f;
|
||||
drawInfo.DustCache.Add(dust);
|
||||
}
|
||||
if (noRogueStealth)
|
||||
{
|
||||
r *= 0.25f;
|
||||
g *= 0.01f;
|
||||
b *= 0.01f;
|
||||
fullBright = true;
|
||||
Dust dust = Dust.NewDustPerfect(Player.Center + new Vector2(Main.rand.NextFloat(-10f, 10f), Main.rand.NextFloat(-20f, 20f)), Main.rand.NextBool(3) ? 114 : ModContent.DustType<BrimstoneFlame>(), new Vector2(0, Main.rand.NextFloat(-3f, -5f)) + Player.velocity, 0, default, abaddon ? 1.1f : 1.6f);
|
||||
dust.noGravity = true;
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
Dust dust2 = Dust.NewDustPerfect(Player.Center + new Vector2(Main.rand.NextFloat(-10f, 10f), 19), Main.rand.NextBool(2) ? 90 : ModContent.DustType<BrimstoneFlame>(), new Vector2(Main.rand.NextFloat(-4f, 4f), Main.rand.NextFloat(-1f, -3f)) + Player.velocity, 0, default, abaddon ? 0.4f : 1.4f);
|
||||
dust2.noGravity = true;
|
||||
}
|
||||
|
||||
if (noRogueStealth)
|
||||
{
|
||||
r *= 0.25f;
|
||||
g *= 0.01f;
|
||||
b *= 0.01f;
|
||||
fullBright = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (calamityPlayer.shadowflame)
|
||||
{
|
||||
if (Main.rand.Next(5) < 4 && drawInfo.shadow == 0f)
|
||||
{
|
||||
int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, 27, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1.95f);
|
||||
int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, 27, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1.1f);
|
||||
Main.dust[dust].noGravity = true;
|
||||
Main.dust[dust].velocity *= 0.75f;
|
||||
Main.dust[dust].velocity.X = Main.dust[dust].velocity.X * 0.75f;
|
||||
Main.dust[dust].velocity.Y = Main.dust[dust].velocity.Y - 1f;
|
||||
Main.dust[dust].velocity.Y = Main.dust[dust].velocity.Y - 3f;
|
||||
if (Main.rand.NextBool(4))
|
||||
{
|
||||
Main.dust[dust].noGravity = false;
|
||||
Main.dust[dust].scale *= 0.5f;
|
||||
Main.dust[dust].scale *= 0.3f;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -271,7 +275,7 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
if (Main.rand.Next(5) < 4 && drawInfo.shadow == 0f)
|
||||
{
|
||||
int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, 46, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1.95f);
|
||||
int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, 298, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 0.6f);
|
||||
Main.dust[dust].noGravity = true;
|
||||
Main.dust[dust].velocity *= 0.75f;
|
||||
Main.dust[dust].velocity.X = Main.dust[dust].velocity.X * 0.75f;
|
||||
@@ -279,7 +283,12 @@ namespace CalamityMod.CalPlayer
|
||||
if (Main.rand.NextBool(4))
|
||||
{
|
||||
Main.dust[dust].noGravity = false;
|
||||
Main.dust[dust].scale *= 0.5f;
|
||||
Main.dust[dust].scale *= 0.2f;
|
||||
}
|
||||
if (Main.rand.NextBool(5))
|
||||
{
|
||||
DirectionalPulseRing pulse = new DirectionalPulseRing(Player.Center + new Vector2(Main.rand.NextFloat(-10f, 10f), Main.rand.NextFloat(-20f, 20f)), new Vector2(Main.rand.NextFloat(-1f, 1f), Main.rand.NextFloat(-3f, -4f)), Main.rand.NextBool(2) ? Color.OliveDrab : Color.GreenYellow, new Vector2(0.8f, 1), 0, 0.09f, 0f, 45, false);
|
||||
GeneralParticleHandler.SpawnParticle(pulse);
|
||||
}
|
||||
}
|
||||
if (noRogueStealth)
|
||||
@@ -295,37 +304,58 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
if (drawInfo.shadow == 0f)
|
||||
{
|
||||
int dustCount = Main.rand.NextBool() ? 2 : 3;
|
||||
for (int i = 0; i < dustCount; ++i)
|
||||
{
|
||||
int dustID = ModContent.DustType<BrimstoneFlame>();
|
||||
if (shatteredCommunity && Main.rand.NextBool(3))
|
||||
dustID = DustID.DemonTorch;
|
||||
ragePulseTimer++;
|
||||
int dustID = heartOfDarkness ? 240 : 114;
|
||||
|
||||
Vector2 dustVel = Player.velocity * 0.5f;
|
||||
int idx = Dust.NewDust(drawInfo.Position, Player.width, Player.height, dustID, dustVel.X, dustVel.Y);
|
||||
Dust d = Main.dust[idx];
|
||||
d.fadeIn = 0.4f;
|
||||
d.scale = Main.rand.NextFloat(0.8f, 1.5f);
|
||||
d.noGravity = true;
|
||||
d.noLight = false;
|
||||
drawInfo.DustCache.Add(idx);
|
||||
if (shatteredCommunity && Main.rand.NextBool(2))
|
||||
dustID = 112; //special dust visual for Shattered Community
|
||||
|
||||
if (heartOfDarkness && !shatteredCommunity && Main.rand.NextBool(2))
|
||||
dustID = 90; //special dust visual for Heart of Darkness
|
||||
|
||||
if (ragePulseTimer == 60)
|
||||
{
|
||||
DirectionalPulseRing pulse = new DirectionalPulseRing(Player.Center, Vector2.Zero, Color.Red, new Vector2(1, 1), 0, 0f, 0.23f, 40, true);
|
||||
GeneralParticleHandler.SpawnParticle(pulse);
|
||||
ragePulse = true;
|
||||
}
|
||||
|
||||
if (ragePulse)
|
||||
{
|
||||
rageBuffTimer++;
|
||||
if (rageBuffTimer >= 30)
|
||||
{
|
||||
DirectionalPulseRing pulse = new DirectionalPulseRing(Player.MountedCenter, Vector2.Zero, (shatteredCommunity ? Color.MediumPurple : Color.Red), new Vector2(1, 1), 0, 0f, 0.18f, 30, true);
|
||||
GeneralParticleHandler.SpawnParticle(pulse);
|
||||
rageBuffTimer = 0;
|
||||
ragePulse = false;
|
||||
ragePulseTimer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Dust dust = Dust.NewDustPerfect(Player.Center + new Vector2(Main.rand.NextFloat(-10f, 10f), Main.rand.NextFloat(-20f, 20f)), dustID);
|
||||
dust.scale = Main.rand.NextFloat(0.3f, 0.45f);
|
||||
if (dustID == 112)
|
||||
dust.scale = Main.rand.NextFloat(0.7f, 0.8f);
|
||||
if (dustID == 240)
|
||||
dust.scale = Main.rand.NextFloat(0.8f, 0.95f);
|
||||
dust.velocity = -Player.velocity / 3;
|
||||
dust.noGravity = true;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Dust while Adrenaline Mode is active
|
||||
if (calamityPlayer.adrenalineModeActive)
|
||||
{
|
||||
if (drawInfo.shadow == 0f)
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
int dustID = 132;
|
||||
int dustID = ModContent.DustType<AdrenDust>();
|
||||
Vector2 dustVel = Player.velocity * 0.5f;
|
||||
int idx = Dust.NewDust(drawInfo.Position, Player.width, Player.height, dustID, dustVel.X, dustVel.Y);
|
||||
int idx = Dust.NewDust(Main.rand.NextBool(5) ? drawInfo.Position : drawInfo.Position -Player.velocity * 1.5f, Player.width, Player.height, dustID, dustVel.X, dustVel.Y);
|
||||
Dust d = Main.dust[idx];
|
||||
d.fadeIn = 1.1f;
|
||||
d.scale = Main.rand.NextFloat(0.8f, 1.5f);
|
||||
d.noGravity = Main.rand.NextBool(4);
|
||||
d.scale = Main.rand.NextFloat(0.4f, 1.2f);
|
||||
d.noGravity = true;
|
||||
d.noLight = false;
|
||||
drawInfo.DustCache.Add(idx);
|
||||
}
|
||||
@@ -333,13 +363,10 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
if (calamityPlayer.gsInferno)
|
||||
{
|
||||
if (Main.rand.NextBool(4) && drawInfo.shadow == 0f)
|
||||
if (Main.rand.NextBool(1) && drawInfo.shadow == 0f)
|
||||
{
|
||||
int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, 173, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 3f);
|
||||
Main.dust[dust].noGravity = true;
|
||||
Main.dust[dust].velocity *= 1.8f;
|
||||
Main.dust[dust].velocity.Y -= 0.5f;
|
||||
drawInfo.DustCache.Add(dust);
|
||||
SparkParticle spark = new SparkParticle(Player.Center + new Vector2(Main.rand.NextFloat(-10f, 10f), Main.rand.NextFloat(-20f, 20f)), new Vector2(0, Main.rand.NextFloat(-5f, 5f)), false, Main.rand.Next(11, 13), Main.rand.NextFloat(0.2f, 0.5f), Main.rand.NextBool(7) ? Color.Aqua : Color.Fuchsia);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
}
|
||||
if (noRogueStealth)
|
||||
{
|
||||
@@ -353,24 +380,29 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
if (Main.rand.NextBool(4) && drawInfo.shadow == 0f)
|
||||
{
|
||||
int dustType = Main.rand.NextBool(2) ? ModContent.DustType<AstralOrange>() : ModContent.DustType<AstralBlue>();
|
||||
int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, dustType, Player.velocity.X * 0.2f, Player.velocity.Y * 0.2f, 100, default, 0.7f);
|
||||
Main.dust[dust].noGravity = true;
|
||||
Main.dust[dust].velocity *= 1.2f;
|
||||
Main.dust[dust].velocity.Y -= 0.5f;
|
||||
Main.dust[dust].color = new Color(255, 255, 255, 0);
|
||||
drawInfo.DustCache.Add(dust);
|
||||
DirectionalPulseRing pulse = new DirectionalPulseRing(Player.Center + new Vector2(Main.rand.NextFloat(-10f, 10f), Main.rand.NextFloat(-20f, 20f)), Vector2.Zero, Main.rand.NextBool(2) ? Color.DarkTurquoise : Color.Coral, new Vector2(1, 1), 0, 0.08f, 0f, 20, false);
|
||||
GeneralParticleHandler.SpawnParticle(pulse);
|
||||
Particle orb = new GenericBloom(Player.Center + new Vector2(Main.rand.NextFloat(-10f, 10f), Main.rand.NextFloat(-20f, 20f)), Vector2.Zero, Main.rand.NextBool(2) ? Color.DarkTurquoise : Color.Coral, 0.055f, 8);
|
||||
GeneralParticleHandler.SpawnParticle(orb);
|
||||
}
|
||||
}
|
||||
if (calamityPlayer.hFlames || calamityPlayer.hInferno || calamityPlayer.banishingFire)
|
||||
if (calamityPlayer.hFlames || calamityPlayer.hInferno || calamityPlayer.banishingFire) //Sun stone makes it look weaker
|
||||
{
|
||||
if (Main.rand.NextBool(4) && drawInfo.shadow == 0f)
|
||||
if (Main.rand.NextBool(reducedHolyFlamesDamage && !calamityPlayer.hInferno ? 4 : 2) && drawInfo.shadow == 0f)
|
||||
{
|
||||
int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, ModContent.DustType<HolyFireDust>(), Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 3f);
|
||||
Main.dust[dust].noGravity = true;
|
||||
Main.dust[dust].velocity *= 1.8f;
|
||||
Main.dust[dust].velocity.Y -= 0.5f;
|
||||
drawInfo.DustCache.Add(dust);
|
||||
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.Center + new Vector2(Main.rand.NextFloat(-10f, 10f), Main.rand.NextFloat(-20f, 20f)), Vect, Main.rand.NextBool(2) ? Color.Coral : Color.OrangeRed, Color.Orange, (reducedHolyFlamesDamage && !calamityPlayer.hInferno ? 0.4f : 0.8f), 15, 2f, 1.9f);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
}
|
||||
|
||||
if (Main.rand.NextBool(reducedHolyFlamesDamage && !calamityPlayer.hInferno ? 4 : 2) && drawInfo.shadow == 0f)
|
||||
{
|
||||
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, 87, dustVel.X, dustVel.Y);
|
||||
Main.dust[d].noGravity = true;
|
||||
Main.dust[d].scale = reducedHolyFlamesDamage && !calamityPlayer.hInferno ? Main.rand.NextFloat(0.3f, 0.5f) : Main.rand.NextFloat(0.7f, 1.2f);
|
||||
Main.dust[d].alpha = 235;
|
||||
}
|
||||
if (noRogueStealth)
|
||||
{
|
||||
@@ -380,9 +412,9 @@ namespace CalamityMod.CalPlayer
|
||||
fullBright = true;
|
||||
}
|
||||
}
|
||||
else if (calamityPlayer.icarusFolly || calamityPlayer.dragonFire)
|
||||
else if (calamityPlayer.icarusFolly)
|
||||
{
|
||||
if (Main.rand.NextBool(calamityPlayer.dragonFire ? 6 : 12) && drawInfo.shadow == 0f)
|
||||
if (Main.rand.NextBool(12) && drawInfo.shadow == 0f)
|
||||
{
|
||||
int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, (int)CalamityDusts.ProfanedFire, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 3f);
|
||||
Main.dust[dust].noGravity = true;
|
||||
@@ -391,28 +423,104 @@ namespace CalamityMod.CalPlayer
|
||||
drawInfo.DustCache.Add(dust);
|
||||
}
|
||||
}
|
||||
if (calamityPlayer.miracleBlight)
|
||||
if (calamityPlayer.dragonFire)
|
||||
{
|
||||
// Violent dust fountain
|
||||
for (int i = 0; i < 2; ++i)
|
||||
{
|
||||
Vector2 dustCorner = Player.position - 2f * Vector2.One;
|
||||
Vector2 dustVel = Player.velocity + new Vector2(0f, Main.rand.NextFloat(-15f, -12f));
|
||||
int d = Dust.NewDust(dustCorner, Player.width + 4, Player.height + 4, (int)CalamityDusts.MiracleBlight, dustVel.X, dustVel.Y);
|
||||
Main.dust[d].noGravity = true;
|
||||
drawInfo.DustCache.Add(d);
|
||||
Vector2 Vect2 = new Vector2(0f, Main.rand.NextBool(4) ? -2f : -8f).RotatedByRandom(MathHelper.ToRadians(Main.rand.NextBool(3) ? 10 : 35f)) * Main.rand.NextFloat(0.1f, 1.9f);
|
||||
SparkParticle spark = new SparkParticle(Player.Center + new Vector2(Main.rand.NextFloat(-10f, 10f), Main.rand.NextFloat(-20f, 20f)), new Vector2(Vect2.X - Player.velocity.X * 0.3f, Vect2.Y), false, 10, Main.rand.NextFloat(0.4f, 0.5f), Main.rand.NextBool(2) ? Color.OrangeRed : Color.Orange);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
|
||||
if (Main.rand.NextBool(3))
|
||||
{
|
||||
Vector2 Vect = new Vector2(0f, Main.rand.NextBool(2) ? -3f : -14f).RotatedByRandom(MathHelper.ToRadians(25f)) * Main.rand.NextFloat(0.1f, 1.9f);
|
||||
SmallSmokeParticle smoke = new SmallSmokeParticle(Player.Center + new Vector2(Main.rand.NextFloat(-10f, 10f), Main.rand.NextFloat(-20f, 20f)), Vect, Color.DimGray, Main.rand.NextBool(2) ? Color.Black : Color.DimGray, Main.rand.NextFloat(0.2f, 1.2f), 100);
|
||||
GeneralParticleHandler.SpawnParticle(smoke);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (calamityPlayer.pFlames)
|
||||
if (calamityPlayer.miracleBlight)
|
||||
{
|
||||
if (Main.rand.NextBool(4) && drawInfo.shadow == 0f)
|
||||
Color sparkColor;
|
||||
switch (Main.rand.Next(4))
|
||||
{
|
||||
int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, 89, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 3f);
|
||||
Main.dust[dust].noGravity = true;
|
||||
Main.dust[dust].velocity *= 1.2f;
|
||||
Main.dust[dust].velocity.Y -= 0.15f;
|
||||
drawInfo.DustCache.Add(dust);
|
||||
case 0:
|
||||
sparkColor = Color.DarkRed;
|
||||
break;
|
||||
case 1:
|
||||
sparkColor = Color.MediumTurquoise;
|
||||
break;
|
||||
case 2:
|
||||
sparkColor = Color.Orange;
|
||||
break;
|
||||
default:
|
||||
sparkColor = Color.LawnGreen;
|
||||
break;
|
||||
}
|
||||
|
||||
DirectionalPulseRing pulse = new DirectionalPulseRing(Player.Center + new Vector2(Main.rand.NextFloat(-10f, 10f), Main.rand.NextFloat(-20f, 20f)), new Vector2(5, 5).RotatedByRandom(360), sparkColor, new Vector2(Main.rand.NextFloat(1f, 5f), Main.rand.NextFloat(1f, 5f)), 0, Main.rand.NextFloat(0.07f, 0.1f), 0f, 18, false);
|
||||
GeneralParticleHandler.SpawnParticle(pulse);
|
||||
|
||||
float numberOfDusts = 3f;
|
||||
float rotFactor = 360f / numberOfDusts;
|
||||
if (Player.miscCounter % 4 == 0)
|
||||
{
|
||||
for (int i = 0; i < numberOfDusts; i++)
|
||||
{
|
||||
int DustType;
|
||||
switch (Main.rand.Next(4))
|
||||
{
|
||||
case 0:
|
||||
DustType = 219;
|
||||
break;
|
||||
case 1:
|
||||
DustType = 220;
|
||||
break;
|
||||
case 2:
|
||||
DustType = 226;
|
||||
break;
|
||||
default:
|
||||
DustType = 222;
|
||||
break;
|
||||
}
|
||||
|
||||
float rot = MathHelper.ToRadians(i * rotFactor);
|
||||
Vector2 offset = new Vector2(0.3f, 0).RotatedBy(rot * Main.rand.NextFloat(0.2f, 0.3f));
|
||||
Vector2 velOffset = CalamityUtils.RandomVelocity(100f, 70f, 150f, 0.04f);
|
||||
Dust dust = Dust.NewDustPerfect(Player.Center + new Vector2(Main.rand.NextFloat(-10f, 10f), Main.rand.NextFloat(-20f, 20f)) + offset, DustType, new Vector2(velOffset.X, velOffset.Y));
|
||||
dust.noGravity = true;
|
||||
dust.velocity = velOffset;
|
||||
velOffset *= 10;
|
||||
dust.position = Player.Center - velOffset;
|
||||
dust.scale = Main.rand.NextFloat(0.7f, 0.8f);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (calamityPlayer.pFlames) //Plague debuff
|
||||
{
|
||||
float numberOfDusts = 2f;
|
||||
float rotFactor = 360f / numberOfDusts;
|
||||
if (Player.miscCounter % 4 == 0)
|
||||
{
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
DirectionalPulseRing pulse = new DirectionalPulseRing(Player.Center + new Vector2(Main.rand.NextFloat(-10f, 10f), Main.rand.NextFloat(-20f, 20f)), Vector2.Zero, Main.rand.NextBool(3) ? Color.LimeGreen : Color.Green, new Vector2(1, 1), 0, Main.rand.NextFloat(0.07f, 0.18f), 0f, 35, false);
|
||||
GeneralParticleHandler.SpawnParticle(pulse);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 7; i++)
|
||||
{
|
||||
int DustID = Main.rand.NextBool(30) ? 220 : 89;
|
||||
float rot = MathHelper.ToRadians(i * rotFactor);
|
||||
Vector2 offset = new Vector2(0.3f, 0).RotatedBy(rot * Main.rand.NextFloat(0.2f, 0.3f));
|
||||
Dust dust2 = Dust.NewDustPerfect(Player.Center + new Vector2(Main.rand.NextFloat(-10f, 10f), Main.rand.NextFloat(-20f, 20f)) + offset, DustID);
|
||||
dust2.scale = Main.rand.NextFloat(0.3f, 0.4f);
|
||||
if (DustID == 220)
|
||||
dust2.scale = Main.rand.NextFloat(1f, 1.2f);
|
||||
}
|
||||
}
|
||||
|
||||
if (noRogueStealth)
|
||||
{
|
||||
r *= 0.07f;
|
||||
@@ -421,15 +529,22 @@ namespace CalamityMod.CalPlayer
|
||||
fullBright = true;
|
||||
}
|
||||
}
|
||||
if (calamityPlayer.nightwither)
|
||||
if (calamityPlayer.nightwither) //Moon stone makes it look weaker
|
||||
{
|
||||
if (Main.rand.NextBool(4) && drawInfo.shadow == 0f)
|
||||
if (Main.rand.NextBool(reducedNightwitherDamage ? 4 : 2) && drawInfo.shadow == 0f)
|
||||
{
|
||||
int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, 176, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 3f);
|
||||
Main.dust[dust].noGravity = true;
|
||||
Main.dust[dust].velocity *= 1.8f;
|
||||
Main.dust[dust].velocity.Y -= 0.5f;
|
||||
drawInfo.DustCache.Add(dust);
|
||||
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.Center + new Vector2(Main.rand.NextFloat(-10f, 10f), Main.rand.NextFloat(-20f, 20f)), Vect, Main.rand.NextBool(2) ? Color.Cyan : Color.DarkBlue, Color.DodgerBlue, (reducedNightwitherDamage ? 0.4f : 0.8f), 15, 2f, 1.9f);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
}
|
||||
for (int i = 0; i < (reducedNightwitherDamage ? 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);
|
||||
Main.dust[d].noGravity = true;
|
||||
Main.dust[d].scale = reducedNightwitherDamage ? Main.rand.NextFloat(0.3f, 0.4f) : Main.rand.NextFloat(0.5f, 0.7f);
|
||||
Main.dust[d].alpha = 235;
|
||||
}
|
||||
if (noRogueStealth)
|
||||
{
|
||||
@@ -443,13 +558,13 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
int dustType = Utils.SelectRandom(Main.rand, new int[]
|
||||
{
|
||||
246,
|
||||
242,
|
||||
229,
|
||||
226,
|
||||
247,
|
||||
187,
|
||||
234
|
||||
246,
|
||||
242,
|
||||
229,
|
||||
226,
|
||||
247,
|
||||
187,
|
||||
234
|
||||
});
|
||||
if (Main.rand.NextBool(4) && drawInfo.shadow == 0f)
|
||||
{
|
||||
@@ -474,6 +589,32 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
if (calamityPlayer.gState || calamityPlayer.cDepth || calamityPlayer.eutrophication)
|
||||
{
|
||||
if (Main.rand.NextBool(30) && cDepth)
|
||||
{
|
||||
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);
|
||||
}
|
||||
int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, 186, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 0.6f);
|
||||
Main.dust[dust].noGravity = true;
|
||||
Main.dust[dust].velocity *= 0.75f;
|
||||
Main.dust[dust].velocity.X = Main.dust[dust].velocity.X * 0.75f;
|
||||
Main.dust[dust].velocity.Y = Main.dust[dust].velocity.Y - 1f;
|
||||
if (Main.rand.NextBool(4) & cDepth)
|
||||
{
|
||||
Main.dust[dust].noGravity = false;
|
||||
Main.dust[dust].scale *= 0.2f;
|
||||
}
|
||||
if (noRogueStealth)
|
||||
{
|
||||
r *= 0f;
|
||||
@@ -488,20 +629,35 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, 165, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1f);
|
||||
Main.dust[dust].noGravity = false;
|
||||
Main.dust[dust].velocity *= 1.8f;
|
||||
Main.dust[dust].velocity.Y += 0.5f;
|
||||
Main.dust[dust].velocity *= 1.2f;
|
||||
Main.dust[dust].velocity.Y += 0.8f;
|
||||
drawInfo.DustCache.Add(dust);
|
||||
}
|
||||
}
|
||||
if (calamityPlayer.bBlood)
|
||||
{
|
||||
if (Main.rand.NextBool(6) && drawInfo.shadow == 0f)
|
||||
if (Main.rand.NextBool(11))
|
||||
{
|
||||
int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, 5, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 3f);
|
||||
Main.dust[dust].noGravity = true;
|
||||
Main.dust[dust].velocity *= 1.8f;
|
||||
Main.dust[dust].velocity.Y -= 0.5f;
|
||||
drawInfo.DustCache.Add(dust);
|
||||
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);
|
||||
}
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
float rot = MathHelper.ToRadians(i * 280);
|
||||
Vector2 offset = new Vector2(0.1f, 0).RotatedBy(rot * Main.rand.NextFloat(0.08f, 0.05f));
|
||||
Dust dust2 = Dust.NewDustPerfect(Player.Center + new Vector2(Main.rand.NextFloat(-10f, 10f), Main.rand.NextFloat(-20f, 20f)) + offset, 5);
|
||||
dust2.scale = Main.rand.NextFloat(0.6f, 0.7f);
|
||||
}
|
||||
if (noRogueStealth)
|
||||
{
|
||||
@@ -513,14 +669,20 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
if (calamityPlayer.mushy)
|
||||
{
|
||||
if (Main.rand.NextBool(6) && drawInfo.shadow == 0f)
|
||||
if (Main.rand.NextBool(4) && drawInfo.shadow == 0f)
|
||||
{
|
||||
int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, 56, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 2f);
|
||||
Main.dust[dust].noGravity = true;
|
||||
Main.dust[dust].velocity *= 0.5f;
|
||||
Main.dust[dust].velocity.Y -= 0.1f;
|
||||
drawInfo.DustCache.Add(dust);
|
||||
Dust dust = Dust.NewDustPerfect(Player.Center + new Vector2(Main.rand.NextFloat(-10f, 10f), Main.rand.NextFloat(-20f, 20f)), 56, Vector2.Zero, 100, default, 0.9f);
|
||||
dust.noGravity = true;
|
||||
dust.velocity *= 0.5f;
|
||||
dust.velocity.Y -= 0.1f;
|
||||
dust.alpha = 200;
|
||||
}
|
||||
if (Main.rand.NextBool(15))
|
||||
{
|
||||
Dust dust2 = Dust.NewDustPerfect(Player.Center + new Vector2(Main.rand.NextFloat(-10f, 10f), 19), Main.rand.NextBool(3) ? 41 : 56, new Vector2(Main.rand.NextFloat(-1f, 1f), Main.rand.NextFloat(-1f, -2f)) + Player.velocity / 3, 0, default, 0.9f);
|
||||
dust2.alpha = 145;
|
||||
}
|
||||
|
||||
if (noRogueStealth)
|
||||
{
|
||||
r *= 0.15f;
|
||||
@@ -555,14 +717,19 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
if (calamityPlayer.bloodfinBoost)
|
||||
{
|
||||
if (Main.rand.NextBool(6) && drawInfo.shadow == 0f)
|
||||
if (Main.rand.NextBool(3) && drawInfo.shadow == 0f)
|
||||
{
|
||||
int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, 5, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 3f);
|
||||
int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, Main.rand.NextBool(8) ? 296 : 5, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1.25f);
|
||||
Main.dust[dust].noGravity = true;
|
||||
Main.dust[dust].velocity *= 1.8f;
|
||||
Main.dust[dust].velocity *= 1.3f;
|
||||
Main.dust[dust].velocity.Y -= 0.5f;
|
||||
drawInfo.DustCache.Add(dust);
|
||||
}
|
||||
if (Main.rand.NextBool(16) && drawInfo.shadow == 0f)
|
||||
{
|
||||
Particle Plus = new HealingPlus(Player.Center - new Vector2(4, 0), Main.rand.NextFloat(0.4f, 0.8f), Color.Red, Color.DarkRed, Main.rand.Next(10, 15));
|
||||
GeneralParticleHandler.SpawnParticle(Plus);
|
||||
}
|
||||
if (noRogueStealth)
|
||||
{
|
||||
r *= 0.5f;
|
||||
@@ -586,12 +753,12 @@ namespace CalamityMod.CalPlayer
|
||||
drawInfo.GoreCache.Add(heart);
|
||||
}
|
||||
}
|
||||
if (calamityPlayer.shadow && CalamityConfig.Instance.StealthInvisibility)
|
||||
{
|
||||
r *= 0f;
|
||||
g *= 0f;
|
||||
b *= 0f;
|
||||
}
|
||||
if (calamityPlayer.shadow && CalamityConfig.Instance.StealthInvisibility)
|
||||
{
|
||||
r *= 0f;
|
||||
g *= 0f;
|
||||
b *= 0f;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -527,6 +527,7 @@ namespace CalamityMod.CalPlayer
|
||||
// If Adrenaline Mode is currently active, you smoothly lose all adrenaline over the duration.
|
||||
if (adrenalineModeActive)
|
||||
{
|
||||
|
||||
adrenalineDiff = -adrenalineMax / AdrenalineDuration;
|
||||
|
||||
// If using Draedon's Heart, you get healing instead of damage.
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace CalamityMod.CalPlayer.Dashes
|
||||
GSDashSlot = SoundEngine.PlaySound(DevourerofGodsHead.DeathAnimationSound, player.Center);
|
||||
SoundOnce = true;
|
||||
|
||||
Particle pulse = new DirectionalPulseRing(player.Center, Vector2.Zero, Color.Orchid, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0.1f, 12f, 18);
|
||||
Particle pulse = new DirectionalPulseRing(player.Center, Vector2.Zero, Color.Orchid, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0.1f, 12f, 18, false);
|
||||
GeneralParticleHandler.SpawnParticle(pulse);
|
||||
|
||||
for (int i = 0; i <= 15; i++)
|
||||
@@ -96,9 +96,9 @@ namespace CalamityMod.CalPlayer.Dashes
|
||||
|
||||
if (Time > 20 && Time < 100)
|
||||
{
|
||||
Particle pulse = new DirectionalPulseRing(player.Center - player.velocity * 0.52f, player.velocity / 1.5f, Color.Fuchsia, new Vector2(1f, 2f), player.velocity.ToRotation(), 0.82f, 0.32f, 60);
|
||||
Particle pulse = new DirectionalPulseRing(player.Center - player.velocity * 0.52f, player.velocity / 1.5f, Color.Fuchsia, new Vector2(1f, 2f), player.velocity.ToRotation(), 0.82f, 0.32f, 60, false);
|
||||
GeneralParticleHandler.SpawnParticle(pulse);
|
||||
Particle pulse2 = new DirectionalPulseRing(player.Center - player.velocity * 0.40f, player.velocity / 1.5f * 0.9f, Color.Aqua, new Vector2(0.8f, 1.5f), player.velocity.ToRotation(), 0.58f, 0.28f, 50);
|
||||
Particle pulse2 = new DirectionalPulseRing(player.Center - player.velocity * 0.40f, player.velocity / 1.5f * 0.9f, Color.Aqua, new Vector2(0.8f, 1.5f), player.velocity.ToRotation(), 0.58f, 0.28f, 50, false);
|
||||
GeneralParticleHandler.SpawnParticle(pulse2);
|
||||
Time = 111;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
using System.Collections.Generic;
|
||||
using CalamityMod.Items.VanillaArmorChanges;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.CalPlayer.DrawLayers
|
||||
{
|
||||
public class AdrenalineTrailLayer : PlayerDrawLayer
|
||||
{
|
||||
public override Position GetDefaultPosition() => new AfterParent(PlayerDrawLayers.LastVanillaLayer);
|
||||
public int Time = 0;
|
||||
public override bool GetDefaultVisibility(PlayerDrawSet drawInfo)
|
||||
{
|
||||
Player drawPlayer = drawInfo.drawPlayer;
|
||||
if (drawInfo.shadow != 0f || drawPlayer.dead)
|
||||
return false;
|
||||
|
||||
return drawPlayer.Calamity().AdrenalineTrail;
|
||||
}
|
||||
|
||||
protected override void Draw(ref PlayerDrawSet drawInfo)
|
||||
{
|
||||
Time++;
|
||||
Player drawPlayer = drawInfo.drawPlayer;
|
||||
List<DrawData> existingDrawData = drawInfo.DrawDataCache;
|
||||
float movementSpeedInterpolant = CobaltArmorSetChange.CalculateMovementSpeedInterpolant(drawPlayer);
|
||||
for (float i = 0; i < drawPlayer.Calamity().OldPositions.Length; i += 0.9f)
|
||||
{
|
||||
float completionRatio = i / (float)drawPlayer.Calamity().OldPositions.Length;
|
||||
float scale = MathHelper.Lerp(1.1f, 0.1f, completionRatio);
|
||||
float opacity = MathHelper.Lerp(0.5f, 0.3f, completionRatio) * movementSpeedInterpolant;
|
||||
List<DrawData> afterimages = new List<DrawData>();
|
||||
for (int j = 0; j < existingDrawData.Count; j++)
|
||||
{
|
||||
var drawData = existingDrawData[j];
|
||||
Vector2 extraPosition = (Time % 6 == 0 ? new Vector2(Main.rand.NextFloat(-10f, 10f), Main.rand.NextFloat(-10f, 10f)) : Vector2.Zero);
|
||||
drawData.position = existingDrawData[j].position - drawPlayer.position + drawPlayer.oldPosition + extraPosition;
|
||||
drawData.color = new Color(0, 255, 201) * opacity;
|
||||
drawData.scale = new Vector2(scale);
|
||||
afterimages.Add(drawData);
|
||||
}
|
||||
drawInfo.DrawDataCache.InsertRange(0, afterimages);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Dusts
|
||||
{
|
||||
public class AdrenDust : ModDust
|
||||
{
|
||||
public override void OnSpawn(Dust dust)
|
||||
{
|
||||
dust.color = default;
|
||||
dust.velocity *= 0.5f;
|
||||
dust.noGravity = true;
|
||||
dust.noLight = true;
|
||||
dust.alpha = 50;
|
||||
}
|
||||
|
||||
public override bool Update(Dust dust)
|
||||
{
|
||||
dust.position += dust.velocity;
|
||||
dust.scale *= 0.94f;
|
||||
dust.velocity *= 0.90f;
|
||||
Lighting.AddLight(dust.position, 0.255f, 0.185f, 0.094f);
|
||||
if (dust.scale < 0.4f)
|
||||
{
|
||||
dust.active = false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Dust dust, Color lightColor) => new Color(Color.White.R, Color.White.G, Color.White.B, dust.alpha);
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
@@ -4,6 +4,8 @@ using System;
|
||||
using static CalamityMod.CalamityUtils;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using rail;
|
||||
using CalamityMod.CalPlayer;
|
||||
|
||||
namespace CalamityMod.Particles
|
||||
{
|
||||
@@ -14,13 +16,16 @@ namespace CalamityMod.Particles
|
||||
public override bool SetLifetime => true;
|
||||
public override bool UseCustomDraw => true;
|
||||
|
||||
public Player player = Main.player[Main.myPlayer];
|
||||
|
||||
private float OriginalScale;
|
||||
private float FinalScale;
|
||||
private float opacity;
|
||||
private Vector2 Squish;
|
||||
private Color BaseColor;
|
||||
private bool LockToPlayerPosition;
|
||||
|
||||
public DirectionalPulseRing(Vector2 position, Vector2 velocity, Color color, Vector2 squish, float rotation, float originalScale, float finalScale, int lifeTime)
|
||||
public DirectionalPulseRing(Vector2 position, Vector2 velocity, Color color, Vector2 squish, float rotation, float originalScale, float finalScale, int lifeTime, bool lockToPlayerPosition)
|
||||
{
|
||||
Position = position;
|
||||
Velocity = velocity;
|
||||
@@ -31,6 +36,7 @@ namespace CalamityMod.Particles
|
||||
Lifetime = lifeTime;
|
||||
Squish = squish;
|
||||
Rotation = rotation;
|
||||
LockToPlayerPosition = lockToPlayerPosition;
|
||||
}
|
||||
|
||||
public override void Update()
|
||||
@@ -43,6 +49,9 @@ namespace CalamityMod.Particles
|
||||
Color = BaseColor * opacity;
|
||||
Lighting.AddLight(Position, Color.R / 255f, Color.G / 255f, Color.B / 255f);
|
||||
Velocity *= 0.95f;
|
||||
|
||||
if (LockToPlayerPosition)
|
||||
Position = player.MountedCenter;
|
||||
}
|
||||
|
||||
public override void CustomDraw(SpriteBatch spriteBatch)
|
||||
|
||||
@@ -121,7 +121,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
|
||||
TargetRecoil = recoil;
|
||||
|
||||
// Shooty ring
|
||||
Particle pulse = new DirectionalPulseRing(Owner.MountedCenter + direction * GunLength, Vector2.Zero, Color.DeepSkyBlue, new Vector2(0.5f, 1f), direction.ToRotation(), 0.2f, 1f, 30);
|
||||
Particle pulse = new DirectionalPulseRing(Owner.MountedCenter + direction * GunLength, Vector2.Zero, Color.DeepSkyBlue, new Vector2(0.5f, 1f), direction.ToRotation(), 0.2f, 1f, 30, false);
|
||||
GeneralParticleHandler.SpawnParticle(pulse);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
|
||||
int step = 10;
|
||||
while (step < LaserLength)
|
||||
{
|
||||
Particle pulse = new DirectionalPulseRing(Projectile.Center + MathHelper.WrapAngle(Projectile.rotation + MathHelper.PiOver2).ToRotationVector2() * step, Vector2.Zero, Color.Red, new Vector2(0.5f, 1f), MathHelper.WrapAngle(Projectile.rotation + MathHelper.PiOver2), 0.1f, 1f, 12);
|
||||
Particle pulse = new DirectionalPulseRing(Projectile.Center + MathHelper.WrapAngle(Projectile.rotation + MathHelper.PiOver2).ToRotationVector2() * step, Vector2.Zero, Color.Red, new Vector2(0.5f, 1f), MathHelper.WrapAngle(Projectile.rotation + MathHelper.PiOver2), 0.1f, 1f, 12, false);
|
||||
GeneralParticleHandler.SpawnParticle(pulse);
|
||||
step += 100;
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
|
||||
boomDust.noGravity = true;
|
||||
}
|
||||
|
||||
Particle boom = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.White, Vector2.One, 0f, 0.05f, 1f + Main.rand.NextFloat(0.2f), 20);
|
||||
Particle boom = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.White, Vector2.One, 0f, 0.05f, 1f + Main.rand.NextFloat(0.2f), 20, false);
|
||||
GeneralParticleHandler.SpawnParticle(boom);
|
||||
|
||||
SoundEngine.PlaySound(SoundID.Item14, Projectile.Center);
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
|
||||
// Random flavor pulse.
|
||||
if (Main.rand.NextBool(100))
|
||||
{
|
||||
Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.DarkCyan, Vector2.One, 0f, 0.05f, 0.4f + Main.rand.NextFloat(0.2f), 30);
|
||||
Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.DarkCyan, Vector2.One, 0f, 0.05f, 0.4f + Main.rand.NextFloat(0.2f), 30, false);
|
||||
GeneralParticleHandler.SpawnParticle(pulse);
|
||||
}
|
||||
|
||||
@@ -229,7 +229,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
|
||||
pulseDust.noGravity = true;
|
||||
}
|
||||
|
||||
Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, empowered ? Color.White : Color.DarkCyan * 1.2f, Vector2.One, 0f, 0.05f, 0.5f + Main.rand.NextFloat(0.2f), 20);
|
||||
Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, empowered ? Color.White : Color.DarkCyan * 1.2f, Vector2.One, 0f, 0.05f, 0.5f + Main.rand.NextFloat(0.2f), 20, false);
|
||||
GeneralParticleHandler.SpawnParticle(pulse);
|
||||
}
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ namespace CalamityMod.Projectiles.Magic
|
||||
}
|
||||
|
||||
Color pulseColor = Main.rand.NextBool() ? Color.Coral : Color.DeepSkyBlue;
|
||||
Particle pulse = new DirectionalPulseRing(Owner.MountedCenter + direction * 44f, Vector2.Zero, pulseColor, new Vector2(0.5f, 1f), direction.ToRotation(), 0.04f, 0.2f, 30);
|
||||
Particle pulse = new DirectionalPulseRing(Owner.MountedCenter + direction * 44f, Vector2.Zero, pulseColor, new Vector2(0.5f, 1f), direction.ToRotation(), 0.04f, 0.2f, 30, false);
|
||||
GeneralParticleHandler.SpawnParticle(pulse);
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ namespace CalamityMod.Projectiles.Magic
|
||||
}
|
||||
|
||||
Color pulseColor = Main.rand.NextBool() ? Color.Coral : Color.DeepSkyBlue;
|
||||
Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, pulseColor, new Vector2(0.5f, 1f), direction.ToRotation(), 0.05f, 0.34f + Main.rand.NextFloat(0.3f), 30);
|
||||
Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, pulseColor, new Vector2(0.5f, 1f), direction.ToRotation(), 0.05f, 0.34f + Main.rand.NextFloat(0.3f), 30, false);
|
||||
GeneralParticleHandler.SpawnParticle(pulse);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,9 +131,9 @@ namespace CalamityMod.Projectiles.Melee
|
||||
else
|
||||
SoundEngine.PlaySound(SlamHamSound, Projectile.Center);
|
||||
|
||||
Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.Violet, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0.2f, 4f, 12);
|
||||
Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.Violet, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0.2f, 4f, 12, false);
|
||||
GeneralParticleHandler.SpawnParticle(pulse);
|
||||
Particle pulse2 = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.Aqua, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0.1f, 1.5f, 11);
|
||||
Particle pulse2 = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.Aqua, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0.1f, 1.5f, 11, false);
|
||||
GeneralParticleHandler.SpawnParticle(pulse2);
|
||||
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 0f, ModContent.ProjectileType<GalaxySmasherBlast>(), Projectile.damage / 2, Projectile.knockBack, Projectile.owner, 0f);
|
||||
|
||||
@@ -153,7 +153,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
if (InPulse == 0)
|
||||
{
|
||||
SoundEngine.PlaySound(RedHamSound, Projectile.Center);
|
||||
Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.Aqua, new Vector2(1f, 1f), Main.rand.NextFloat(12f, 25f), 0.1f, 1.95f, 120);
|
||||
Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.Aqua, new Vector2(1f, 1f), Main.rand.NextFloat(12f, 25f), 0.1f, 1.95f, 120, false);
|
||||
GeneralParticleHandler.SpawnParticle(pulse);
|
||||
InPulse = 1;
|
||||
}
|
||||
@@ -244,7 +244,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
}
|
||||
if (PulseCooldown >= 15);
|
||||
{
|
||||
Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.Violet, new Vector2(0.5f, 0.5f), Main.rand.NextFloat(12f, 25f), 0.2f, 1.4f + (EmpoweredHammer * 0.1f), 14);
|
||||
Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.Violet, new Vector2(0.5f, 0.5f), Main.rand.NextFloat(12f, 25f), 0.2f, 1.4f + (EmpoweredHammer * 0.1f), 14, false);
|
||||
GeneralParticleHandler.SpawnParticle(pulse);
|
||||
PulseCooldown = 0;
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
SoundEngine.PlaySound(SoundID.Item92, NuzzlePosition);
|
||||
SoundEngine.PlaySound(SoundID.Item60, NuzzlePosition);
|
||||
|
||||
Particle pulse = new DirectionalPulseRing(NuzzlePosition + Projectile.rotation.ToRotationVector2() * 5f, Vector2.Zero, color, new Vector2(0.5f, 1f), Projectile.rotation, 0.05f, 0.34f + Main.rand.NextFloat(0.3f), 30);
|
||||
Particle pulse = new DirectionalPulseRing(NuzzlePosition + Projectile.rotation.ToRotationVector2() * 5f, Vector2.Zero, color, new Vector2(0.5f, 1f), Projectile.rotation, 0.05f, 0.34f + Main.rand.NextFloat(0.3f), 30, false);
|
||||
GeneralParticleHandler.SpawnParticle(pulse);
|
||||
|
||||
if (Owner == Main.LocalPlayer && Owner.Calamity().GeneralScreenShakePower < 5)
|
||||
|
||||
@@ -74,9 +74,9 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
dust2.scale = Main.rand.NextFloat(0.8f, 1.5f);
|
||||
}
|
||||
SoundEngine.PlaySound(ChargeImpact, Projectile.position);
|
||||
Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.Lime, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0.1f, 0.6f, 20);
|
||||
Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.Lime, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0.1f, 0.6f, 20, false);
|
||||
GeneralParticleHandler.SpawnParticle(pulse);
|
||||
Particle pulse2 = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.Chartreuse, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0.1f, 0.5f, 16);
|
||||
Particle pulse2 = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.Chartreuse, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0.1f, 0.5f, 16, false);
|
||||
GeneralParticleHandler.SpawnParticle(pulse2);
|
||||
|
||||
for (int i = 0; i < 25; ++i)
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
PulseTimer = PrevPulseTimer * 2f;
|
||||
|
||||
Color pulseColor = Main.rand.NextBool() ? (Main.rand.NextBool() ? Color.SkyBlue : Color.LightSkyBlue) : (Main.rand.NextBool() ? Color.LightBlue : Color.DeepSkyBlue);
|
||||
Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, pulseColor, new Vector2(0.5f, 1f), Projectile.velocity.ToRotation(), 0.05f, 0.2f + 0.3f * (1 - Progress), 30);
|
||||
Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, pulseColor, new Vector2(0.5f, 1f), Projectile.velocity.ToRotation(), 0.05f, 0.2f + 0.3f * (1 - Progress), 30, false);
|
||||
GeneralParticleHandler.SpawnParticle(pulse);
|
||||
|
||||
int numDust = 18;
|
||||
|
||||
@@ -120,7 +120,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
// Spawn a ring particle based off charge percent to emphasize the impact
|
||||
float originalScale = 0.2f * ChargePercent;
|
||||
float maxScale = 1f * ChargePercent;
|
||||
Particle pulse = new DirectionalPulseRing(Owner.MountedCenter + direction * WeaponLength, Vector2.Zero, Color.White, new Vector2(0.5f, 1f), direction.ToRotation(), originalScale, maxScale, 30);
|
||||
Particle pulse = new DirectionalPulseRing(Owner.MountedCenter + direction * WeaponLength, Vector2.Zero, Color.White, new Vector2(0.5f, 1f), direction.ToRotation(), originalScale, maxScale, 30, false);
|
||||
GeneralParticleHandler.SpawnParticle(pulse);
|
||||
|
||||
// Play a sound with volume scaling with charge percent
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 272, Projectile.oldVelocity.X * 0.3f, Projectile.oldVelocity.Y * 0.3f, 0, default, Main.rand.NextFloat(1.7f, 2.1f));
|
||||
}
|
||||
Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.Plum, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0.1f, 1f, 13);
|
||||
Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.Plum, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0.1f, 1f, 13, false);
|
||||
GeneralParticleHandler.SpawnParticle(pulse);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,9 +37,9 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
{
|
||||
target.AddBuff(BuffID.OnFire3, 240);
|
||||
|
||||
Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.OrangeRed, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0f, Main.rand.NextFloat(0.8f, 1.1f), 20);
|
||||
Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.OrangeRed, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0f, Main.rand.NextFloat(0.8f, 1.1f), 20, false);
|
||||
GeneralParticleHandler.SpawnParticle(pulse);
|
||||
Particle pulse2 = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.DarkOrange, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0f, Main.rand.NextFloat(0.6f, 0.9f), 20);
|
||||
Particle pulse2 = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.DarkOrange, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0f, Main.rand.NextFloat(0.6f, 0.9f), 20, false);
|
||||
GeneralParticleHandler.SpawnParticle(pulse2);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user