Updated Meld items with new dust

This commit is contained in:
Xyk committed 2024-11-07 23:58:54 -08:00
1 parent 9d2601b6b4
commit ca0d533e37
13 files changed
+274 -168

No files matched your search

+12 -8
View File
@@ -17,7 +17,10 @@ namespace CalamityMod.Dusts
{
dust.rotation += MathF.Sign(dust.velocity.X);
dust.velocity *= 0.98f;
dust.scale += 0.02f;
if (dust.noGravity)
dust.scale += 0.02f;
else
dust.scale -= 0.01f;
float light = MathHelper.Clamp(dust.scale * 0.8f, 0f, 1f);
if (!dust.noLightEmittence)
@@ -28,16 +31,17 @@ namespace CalamityMod.Dusts
public override bool PreDraw(Dust dust)
{
Vector2 dustCenter = dust.position + new Vector2(0.25f, 0.25f);
Texture2D rechargeTexture2 = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/BasicCircle").Value;
Texture2D solidCenter = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/BasicCircle").Value;
Texture2D bloom = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle").Value;
// Glow Orb
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, dust.scale * 0.1f, SpriteEffects.None, 0);
if (dust.alpha < 1)
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, dust.scale * 0.04f, SpriteEffects.None, 0);
if (!dust.noLight)
{
Texture2D rechargeTexture = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle").Value;
// Glow Orb
Main.EntitySpriteDraw(rechargeTexture, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, rechargeTexture.Size() * 0.5f, dust.scale * 0.1f, SpriteEffects.None, 0);
if (dust.alpha < 1)
Main.EntitySpriteDraw(rechargeTexture, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, rechargeTexture.Size() * 0.5f, dust.scale * 0.04f, SpriteEffects.None, 0);
Main.EntitySpriteDraw(solidCenter, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, solidCenter.Size() * 0.5f, dust.scale * 0.075f, SpriteEffects.None, 0);
}
Main.EntitySpriteDraw(rechargeTexture2, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, rechargeTexture2.Size() * 0.5f, dust.scale * 0.075f, SpriteEffects.None, 0);
return false;
}
}
+9 -6
View File
@@ -17,7 +17,10 @@ namespace CalamityMod.Dusts
{
dust.rotation += MathF.Sign(dust.velocity.X);
dust.velocity *= 0.98f;
dust.scale += 0.02f;
if (dust.noGravity)
dust.scale += 0.02f;
else
dust.scale -= 0.01f;
float light = MathHelper.Clamp(dust.scale * 0.8f, 0f, 1f);
if (!dust.noLightEmittence)
@@ -28,16 +31,16 @@ namespace CalamityMod.Dusts
public override bool PreDraw(Dust dust)
{
Vector2 dustCenter = dust.position + new Vector2(0.25f, 0.25f);
Texture2D rechargeTexture2 = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/BasicCircle").Value;
Texture2D solidCenter = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/BasicCircle").Value;
if (!dust.noLight)
{
Texture2D rechargeTexture = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle").Value;
Texture2D bloom = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle").Value;
// Glow Orb
Main.EntitySpriteDraw(rechargeTexture, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, rechargeTexture.Size() * 0.5f, dust.scale * 0.1f, SpriteEffects.None, 0);
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, dust.scale * 0.1f, SpriteEffects.None, 0);
if (dust.alpha < 1)
Main.EntitySpriteDraw(rechargeTexture, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, rechargeTexture.Size() * 0.5f, dust.scale * 0.04f, SpriteEffects.None, 0);
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, dust.scale * 0.04f, SpriteEffects.None, 0);
}
Main.EntitySpriteDraw(rechargeTexture2, dustCenter - Main.screenPosition, null, Color.Black * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, rechargeTexture2.Size() * 0.5f, dust.scale * 0.075f, SpriteEffects.None, 0);
Main.EntitySpriteDraw(solidCenter, dustCenter - Main.screenPosition, null, Color.Black * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, solidCenter.Size() * 0.5f, dust.scale * 0.075f, SpriteEffects.None, 0);
return false;
}
}
+50
View File
@@ -0,0 +1,50 @@
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Dusts
{
public class VoidDustInverted : ModDust
{
public override void OnSpawn(Dust dust)
{
dust.scale *= Main.rand.NextFloat(0.8f, 1f);
}
public override bool Update(Dust dust)
{
dust.rotation += MathF.Sign(dust.velocity.X);
dust.velocity *= 0.98f;
if (dust.noGravity)
dust.scale += 0.02f;
else
dust.scale -= 0.01f;
float light = MathHelper.Clamp(dust.scale * 0.8f, 0f, 1f);
if (!dust.noLightEmittence)
Lighting.AddLight(dust.position, dust.color.ToVector3() * light);
return true;
}
public override bool PreDraw(Dust dust)
{
Vector2 dustCenter = dust.position + new Vector2(0.25f, 0.25f);
Texture2D solidCenter = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/BasicCircle").Value;
Texture2D bloom2 = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle").Value;
Texture2D bloom = ModContent.Request<Texture2D>("CalamityMod/Particles/SmallBloom").Value;
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, Color.Black * 0.4f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, dust.scale * 0.068f, SpriteEffects.None, 0);
if (dust.alpha < 1)
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, Color.Black * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, dust.scale * 0.057f, SpriteEffects.None, 0);
Main.EntitySpriteDraw(bloom2, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom2.Size() * 0.5f, dust.scale * 0.07f, SpriteEffects.None, 0);
if (!dust.noLight)
Main.EntitySpriteDraw(solidCenter, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * 0.75f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, solidCenter.Size() * 0.5f, dust.scale * 0.075f, SpriteEffects.None, 0);
return false;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

+8 -4
View File
@@ -1,4 +1,5 @@
using CalamityMod.Buffs.StatBuffs;
using CalamityMod.Dusts;
using CalamityMod.Items.Armor.Empyrean;
using CalamityMod.Items.Materials;
using CalamityMod.Particles;
@@ -50,8 +51,10 @@ namespace CalamityMod.Items.Accessories.Wings
if (Main.rand.NextBool((player.controlJump ? 2 : 4)))
{
Particle spark3 = new GlowOrbParticle(spawnPos, partVel, false, 19, partScale, Color.LightGreen, true, false, false);
GeneralParticleHandler.SpawnParticle(spark3);
Dust dust = Dust.NewDustPerfect(spawnPos, ModContent.DustType<VoidDustInverted>(), partVel, 0, default, partScale * 2f);
dust.noGravity = true;
dust.color = Color.LightGreen;
}
if (Main.rand.NextBool())
{
@@ -60,8 +63,9 @@ namespace CalamityMod.Items.Accessories.Wings
if (Main.rand.NextBool((player.controlJump ? 2 : 4)))
{
Particle spark3 = new GlowOrbParticle(spawnPos2, partVel, false, 19, partScale * 0.7f, Color.LightGreen, true, false, false);
GeneralParticleHandler.SpawnParticle(spark3);
Dust dust = Dust.NewDustPerfect(spawnPos2, ModContent.DustType<VoidDustInverted>(), partVel, 0, default, partScale * 1.7f);
dust.noGravity = true;
dust.color = Color.LightGreen;
}
}
+8 -25
View File
@@ -1,4 +1,5 @@
using CalamityMod.Items.Materials;
using CalamityMod.Dusts;
using CalamityMod.Items.Materials;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
@@ -65,30 +66,6 @@ namespace CalamityMod.Items.Tools
swingRotation = Utils.Remap(time, 0, player.itemAnimationMax, 0, 2.88f * swordDirection);
if (Main.rand.NextBool(4))
{
Vector2 dustVel = new Vector2(5 * swordDirection, -5).RotatedByRandom(1.55f) * Main.rand.NextFloat(0.7f, 1.3f) * 2;
Dust dust = Dust.NewDustPerfect(player.Center + dustVel * 9, 278);
dust.scale = Main.rand.NextFloat(0.5f, 0.75f);
dust.velocity = dustVel * 0.1f;
dust.color = Color.LightGreen;
dust.noGravity = true;
}
if (Main.rand.NextBool(4))
{
Vector2 dustVel = new Vector2(5 * swordDirection, -5).RotatedByRandom(1.55f) * Main.rand.NextFloat(0.7f, 1.3f) * 2;
float partScale = Main.rand.NextFloat(0.6f, 1.2f);
Vector2 partVel = dustVel * Main.rand.NextFloat(0.1f, 0.3f);
Particle spark3 = new GlowOrbParticle(player.Center + dustVel * 7, partVel, false, 18, partScale, Color.Black, false, false, false);
GeneralParticleHandler.SpawnParticle(spark3);
for (int i = 0; i < 2; i++)
{
Particle spark2 = new GlowOrbParticle(player.Center + dustVel * 7, partVel, false, 18, partScale * 0.5f, Color.LightGreen, true, false, false);
GeneralParticleHandler.SpawnParticle(spark2);
}
}
Vector2 dustVel2 = new Vector2(5 * swordDirection, -5).RotatedBy(swingRotation - 1.7f * swordDirection);
float partScale2 = Main.rand.NextFloat(0.5f, 0.8f);
@@ -96,6 +73,12 @@ namespace CalamityMod.Items.Tools
Particle smoke = new HeavySmokeParticle(player.Center + dustVel2 * 12 + Main.rand.NextVector2Circular(8, 8), partVel2.RotatedBy(MathHelper.ToRadians(90f * swordDirection)).RotatedBy(-0.3 * swordDirection) * -5, Color.Black, 13, partScale2, 0.5f, Main.rand.NextFloat(-0.2f, 0.2f), false);
GeneralParticleHandler.SpawnParticle(smoke);
if (Main.rand.NextBool())
{
Dust dust = Dust.NewDustPerfect(player.Center + dustVel2 * 12 + Main.rand.NextVector2Circular(8, 8), ModContent.DustType<VoidDustInverted>(), partVel2.RotatedBy(MathHelper.ToRadians(90f * swordDirection)).RotatedBy(-0.3 * swordDirection), 0, default, Main.rand.NextFloat(0.9f, 1.25f));
dust.noGravity = true;
dust.color = Color.LightGreen;
}
time++;
}
+1 -1
View File
@@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Ranged
Item.rare = ItemRarityID.Red;
Item.autoReuse = true;
Item.shoot = ModContent.ProjectileType<CosmicFire>();
Item.shootSpeed = 9f;
Item.shootSpeed = 8f;
Item.useAmmo = AmmoID.Gel;
}
+42 -13
View File
@@ -1,4 +1,5 @@
using System;
using CalamityMod.Dusts;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
@@ -50,15 +51,28 @@ namespace CalamityMod.Projectiles.Magic
}
if (preDamage)
{
if (targetDist < 1400f)
if (targetDist < 1400f && time > 3)
{
float scaler = Utils.GetLerpValue(-60, 120, time, true);
Particle blastRing = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Black, "CalamityMod/Particles/LargeBloom", Vector2.One, Main.rand.NextFloat(-10, 10), 0.6f * scaler, 0f, 4, false);
GeneralParticleHandler.SpawnParticle(blastRing);
Particle blastRing2 = new CustomPulse(Projectile.Center, Vector2.Zero, InnerColor, "CalamityMod/Particles/LargeBloom", Vector2.One, Main.rand.NextFloat(-10, 10), 0.35f * scaler, 0f, 4, true);
Particle blastRing2 = new CustomPulse(Projectile.Center, Vector2.Zero, InnerColor * 0.6f, "CalamityMod/Particles/LargeBloom", Vector2.One, Main.rand.NextFloat(-10, 10), 0.48f * scaler, 0f, 4, true);
GeneralParticleHandler.SpawnParticle(blastRing2);
}
Projectile.velocity *= 0.96f;
if (time == 3)
{
for (int i = 0; i < 6; i++)
{
float variance = Main.rand.NextFloat(-0.4f, 0.4f);
int dustStyle = ModContent.DustType<VoidDustInverted>();
Dust dust2 = Dust.NewDustPerfect(Projectile.Center, dustStyle);
dust2.scale = Main.rand.NextFloat(0.8f, 1.2f) - Math.Abs(variance);
dust2.velocity = Projectile.velocity.RotatedBy(variance) * Main.rand.NextFloat(1.2f, 1.5f) * (1 - Math.Abs(variance));
dust2.noGravity = true;
dust2.color = Color.LightGreen;
}
}
}
else
{
@@ -67,18 +81,19 @@ namespace CalamityMod.Projectiles.Magic
float curveStrength = Utils.GetLerpValue(scalingTimerMax, 0, scalingTimer, true) * 0.04f;
Projectile.velocity = Projectile.velocity.RotatedBy(curveStrength * curveDirection);
scaling = Utils.GetLerpValue(0, scalingTimerMax, scalingTimer, true);
float sharpScaling = Utils.GetLerpValue(scalingTimerMax * 0.7f, scalingTimerMax, scalingTimer, true);
if (time % 2 == 0 && targetDist < 1400f)
if (targetDist < 1400f)
{
Particle spark = new AltSparkParticle(Projectile.Center, -Projectile.velocity * 0.05f, false, 12, 3.5f * scaling, Color.Black);
Particle spark = new CustomSpark(Projectile.Center, -Projectile.velocity * 0.05f, "CalamityMod/Particles/GlowSpark2", false, 12, 0.07f * scaling, Color.Black * 0.85f, new Vector2(1.7f - (1 - sharpScaling), 0.9f + (1 - sharpScaling) * 2), false);
GeneralParticleHandler.SpawnParticle(spark);
Particle spark2 = new SparkParticle(Projectile.Center, -Projectile.velocity * 0.05f, false, 12, 1.5f * scaling, InnerColor);
Particle spark2 = new CustomSpark(Projectile.Center, -Projectile.velocity * 0.05f, "CalamityMod/Particles/GlowSpark", false, 12, 0.035f * scaling, Color.LightGreen * 0.55f, new Vector2(1.7f - (1 - sharpScaling), 0.9f + (1 - sharpScaling) * 2));
GeneralParticleHandler.SpawnParticle(spark2);
}
if (Main.rand.NextBool(6))
{
Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(6) ? 278 : 263, -Projectile.velocity);
dust.scale = dust.type == 278 ? Main.rand.NextFloat(0.3f, 0.6f) : Main.rand.NextFloat(0.6f, 1.4f);
Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(6) ? 278 : 267, -Projectile.velocity);
dust.scale = dust.type == 278 ? Main.rand.NextFloat(0.3f, 0.6f) : Main.rand.NextFloat(0.6f, 1.2f);
dust.velocity = -Projectile.velocity.RotatedByRandom(0.3f) * Main.rand.NextFloat(0.1f, 0.7f);
dust.noGravity = true;
dust.color = InnerColor;
@@ -89,11 +104,12 @@ namespace CalamityMod.Projectiles.Magic
{
if (curves > 1)
{
Particle blastRing = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Black, "CalamityMod/Particles/LargeBloom", Vector2.One, Main.rand.NextFloat(-10, 10), 0.4f, 0f, scalingTimerMax / 2, false);
Projectile.Center += Main.rand.NextVector2Circular(250, 250);
Particle blastRing = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Black, "CalamityMod/Particles/LargeBloom", Vector2.One, Main.rand.NextFloat(-10, 10), 0.6f, 0f, scalingTimerMax / 2, false);
GeneralParticleHandler.SpawnParticle(blastRing);
for (int i = 0; i < 2; i++)
{
Particle blastRing2 = new CustomPulse(Projectile.Center, Vector2.Zero, InnerColor, "CalamityMod/Particles/LargeBloom", Vector2.One, Main.rand.NextFloat(-10, 10), 0.26f, 0f, scalingTimerMax / 2, true);
Particle blastRing2 = new CustomPulse(Projectile.Center, Vector2.Zero, InnerColor, "CalamityMod/Particles/LargeBloom", Vector2.One, Main.rand.NextFloat(-10, 10), 0.36f, 0f, scalingTimerMax / 2, true);
GeneralParticleHandler.SpawnParticle(blastRing2);
}
Projectile.velocity = Vector2.Zero;
@@ -113,9 +129,9 @@ namespace CalamityMod.Projectiles.Magic
{
for (int i = 0; i <= 6; i++)
{
int dustStyle = Main.rand.NextBool() ? 66 : 263;
int dustStyle = ModContent.DustType<VoidDustInverted>();
Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(3) ? 191 : dustStyle, Projectile.velocity);
dust.scale = Main.rand.NextFloat(0.5f, 0.8f);
dust.scale = Main.rand.NextFloat(0.9f, 1.4f);
dust.velocity = new Vector2(5, 5).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1f);
dust.noGravity = true;
dust.color = dust.type == dustStyle ? InnerColor : default;
@@ -150,8 +166,21 @@ namespace CalamityMod.Projectiles.Magic
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
SoundStyle fire = new("CalamityMod/Sounds/Item/MeldShoot");
SoundEngine.PlaySound(fire with { Volume = 0.3f, Pitch = 0.9f }, Projectile.Center);
if (Projectile.numHits == 0)
{
SoundStyle fire = new("CalamityMod/Sounds/Item/MeldShoot");
SoundEngine.PlaySound(fire with { Volume = 0.3f, Pitch = 0.9f }, Projectile.Center);
for (int i = 0; i < 6; i++)
{
float variance = Main.rand.NextFloat(-0.6f, 0.6f);
int dustStyle = ModContent.DustType<VoidDustInverted>();
Dust dust2 = Dust.NewDustPerfect(target.Center, dustStyle);
dust2.scale = Main.rand.NextFloat(1.2f, 1.6f) - Math.Abs(variance);
dust2.velocity = (Projectile.velocity * 1.5f).RotatedBy(variance) * Main.rand.NextFloat(1.2f, 1.5f) * (1 - Math.Abs(variance));
dust2.noGravity = true;
dust2.color = Color.LightGreen;
}
}
}
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
{
+49 -31
View File
@@ -1,6 +1,8 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.Potions;
using CalamityMod.Dusts;
using CalamityMod.Particles;
using Microsoft.Build.Construction;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
@@ -15,11 +17,11 @@ namespace CalamityMod.Projectiles.Melee
{
public new string LocalizationCategory => "Projectiles.Melee";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public float sizeVariance = 2;
public float sizeVariance = 1;
public int time = 60;
public int spinDir = 100;
public int waveOften = 40;
public float scaleVariance = 1;
NPC target;
public override void SetStaticDefaults() => ProjectileID.Sets.CultistIsResistantTo[Type] = true;
public override void SetDefaults()
@@ -32,7 +34,7 @@ namespace CalamityMod.Projectiles.Melee
Projectile.ignoreWater = true;
Projectile.tileCollide = false;
Projectile.DamageType = DamageClass.Melee;
Projectile.timeLeft = 450;
Projectile.timeLeft = 600;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = -1;
}
@@ -45,51 +47,56 @@ namespace CalamityMod.Projectiles.Melee
{
spinDir = Main.rand.NextBool() ? 1 : -1;
waveOften = Main.rand.Next(10, 40 + 1);
scaleVariance = Main.rand.NextFloat(0.65f, 1f);
Projectile.scale = Main.rand.NextFloat(0.8f, 1.5f);
}
if (time % 18 == 0)
sizeVariance = Main.rand.NextFloat(1.5f, 2.5f) * scaleVariance;
Projectile.scale = MathHelper.Lerp(Projectile.scale, sizeVariance, 0.09f);
if (time % 2 == 0 && time > 5)
if (Projectile.numHits > 0)
Projectile.extraUpdates = 2;
else
Projectile.extraUpdates = 1;
sizeVariance = Utils.GetLerpValue(-5, 60, Projectile.timeLeft, true);
if (time > 5)
{
Particle spark = new AltSparkParticle(Projectile.Center, -Projectile.velocity * 0.3f, false, 6, 0.7f, Color.Black);
GeneralParticleHandler.SpawnParticle(spark);
}
if (Main.rand.NextBool(8))
{
Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(6) ? 278 : 263, -Projectile.velocity);
dust.scale = dust.type == 278 ? Main.rand.NextFloat(0.3f, 0.6f) : Main.rand.NextFloat(0.6f, 1.4f);
dust.velocity = -Projectile.velocity.RotatedByRandom(0.3f) * Main.rand.NextFloat(0.1f, 0.7f);
dust.noGravity = true;
dust.color = Color.LightGreen;
Particle spark2 = new CustomSpark(Projectile.Center, -Projectile.velocity * 0.4f, "CalamityMod/Particles/GlowSpark2", false, (int)MathHelper.Clamp(9 * sizeVariance, 3, 9), MathHelper.Clamp(0.03f * sizeVariance, 0.01f, 0.03f), Color.Black * 0.6f, new Vector2(1.2f, 0.5f), false, shrinkSpeed: 1.1f);
GeneralParticleHandler.SpawnParticle(spark2);
if (Main.rand.NextBool(8))
{
Dust dust = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType<VoidDustInverted>());
dust.scale = Main.rand.NextFloat(0.6f, 1.1f);
dust.velocity = -Projectile.velocity.RotatedByRandom(0.3f) * Main.rand.NextFloat(0.1f, 0.7f);
dust.noGravity = true;
dust.color = Color.LightGreen;
}
}
if (time >= 5)
{
if (Projectile.numHits < 1)
{
NPC target = Projectile.Center.ClosestNPCAt(320);
target = Projectile.Center.ClosestNPCAt(320);
if (target == null)
{
Vector2 moveToMouse = (Owner.Calamity().mouseWorld - Projectile.Center).SafeNormalize(Vector2.UnitX);
if (Projectile.velocity.Length() < 14)
Projectile.velocity += moveToMouse * 0.3f;
Projectile.velocity += moveToMouse * 0.15f;
else
Projectile.velocity *= 0.8f;
Projectile.velocity *= 0.95f;
if (time % waveOften == 0)
spinDir *= -1;
Projectile.velocity = Projectile.velocity.RotatedBy(Main.rand.NextFloat(0.05f, 0.15f) * spinDir * Utils.GetLerpValue(60, 180, time, true));
//Projectile.velocity = Projectile.velocity.RotatedBy(Main.rand.NextFloat(0.05f, 0.15f) * spinDir * Utils.GetLerpValue(60, 180, time, true));
}
else
{
Vector2 moveToEnemy = (target.Center - Projectile.Center).SafeNormalize(Vector2.UnitX);
if (Projectile.velocity.Length() < 14)
Projectile.velocity += moveToEnemy * 0.8f;
if (Projectile.velocity.Length() < 14 - 9 * Utils.GetLerpValue(280, 60, Projectile.timeLeft, true))
Projectile.velocity += moveToEnemy * 0.55f;
else
Projectile.velocity *= 0.7f;
Projectile.velocity *= 0.95f;
}
}
else
@@ -97,11 +104,10 @@ namespace CalamityMod.Projectiles.Melee
if (time % waveOften == 0)
spinDir *= -1;
Projectile.velocity = Projectile.velocity.RotatedBy(Main.rand.NextFloat(0.05f, 0.15f) * spinDir * Utils.GetLerpValue(60, 180, time, true));
Projectile.velocity = Projectile.velocity.RotatedBy(Main.rand.NextFloat(0.03f, 0.07f) * spinDir * Utils.GetLerpValue(60, 180, time, true));
}
}
if (Projectile.numHits > 0)
Projectile.extraUpdates = 2;
time++;
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
@@ -128,11 +134,23 @@ namespace CalamityMod.Projectiles.Melee
public override bool PreDraw(ref Color lightColor)
{
Asset<Texture2D> tex = ModContent.Request<Texture2D>("CalamityMod/Particles/WaterFlavored");
Asset<Texture2D> tex2 = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle");
Vector2 generalDrawPos = Projectile.Center - Main.screenPosition;
Main.EntitySpriteDraw(tex.Value, generalDrawPos, null, Color.Black, Projectile.rotation, tex.Size() * 0.5f, new Vector2(0.4f, 1) * Projectile.scale, SpriteEffects.None);
Main.EntitySpriteDraw(tex.Value, generalDrawPos, null, Color.LightGreen with { A = 0 }, Projectile.rotation, tex.Size() * 0.5f, new Vector2(0.4f, 1) * Projectile.scale * 0.7f, SpriteEffects.None);
Main.EntitySpriteDraw(tex.Value, generalDrawPos, null, Color.LightGreen with { A = 0 }, Projectile.rotation, tex.Size() * 0.5f, new Vector2(0.4f, 1) * Projectile.scale * 0.5f, SpriteEffects.None);
float minSpeed = 6;
float maxSpeed = 14;
float totalScale = Projectile.scale * sizeVariance;
for (int i = 0; i < 8; i++)
{
Vector2 rotationalDrawOffset = (MathHelper.TwoPi * i / 8f).ToRotationVector2() * Utils.Remap(Projectile.velocity.Length(), minSpeed, maxSpeed, 30, 7, true) * totalScale;
Vector2 aimDir = Utils.DirectionTo(Projectile.Center + rotationalDrawOffset, Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.UnitX) * 92);
Main.EntitySpriteDraw(tex.Value, generalDrawPos + rotationalDrawOffset, null, Color.Black * 0.8f, aimDir.ToRotation() + MathHelper.ToRadians(-90), tex.Size() * 0.5f, new Vector2(0.3f, 1) * totalScale, SpriteEffects.None);
}
for (int i = 0; i < 3; i++)
{
Vector2 rotationalDrawOffset = (MathHelper.TwoPi * i / 3f).ToRotationVector2() * 3;
Main.EntitySpriteDraw(tex2.Value, generalDrawPos + Projectile.velocity.SafeNormalize(Vector2.UnitX) * 30, null, Color.LightGreen with { A = 0 }, Projectile.rotation, tex2.Size() * 0.5f, new Vector2(Utils.Remap(Projectile.velocity.Length(), minSpeed, maxSpeed, 0.7f, 0.25f, true), Utils.Remap(Projectile.velocity.Length(), minSpeed, maxSpeed, 0.7f, 1.7f, true)) * totalScale * 0.2f, SpriteEffects.None);
}
return false;
}
}
+48 -39
View File
@@ -1,4 +1,6 @@
using CalamityMod.Buffs.DamageOverTime;
using System;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Dusts;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Typeless;
@@ -26,50 +28,53 @@ namespace CalamityMod.Projectiles.Ranged
Projectile.width = Projectile.height = 16;
Projectile.friendly = true;
Projectile.ignoreWater = true;
Projectile.tileCollide = true;
Projectile.DamageType = DamageClass.Ranged;
Projectile.penetrate = 1;
Projectile.MaxUpdates = 10;
Projectile.timeLeft = 27 * Projectile.MaxUpdates;
Projectile.MaxUpdates = 13;
Projectile.timeLeft = 45 * Projectile.MaxUpdates;
}
public override void AI()
{
Time++;
Lighting.AddLight(Projectile.Center, InnerColor.ToVector3() * 0.2f);
Player Owner = Main.player[Projectile.owner];
float targetDist = Vector2.Distance(Owner.Center, Projectile.Center); //used for some drawing prevention for when it's offscreen since it makes a fuck load of particles
if (Projectile.timeLeft % 3 == 0 && Time > 12f && targetDist < 1400f)
if (Main.rand.NextBool(5) && Time > 12f && targetDist < 1400f)
{
AltSparkParticle spark = new AltSparkParticle(Projectile.Center, -Projectile.velocity * 0.05f, false, 17, 2.3f, Color.Black);
GeneralParticleHandler.SpawnParticle(spark);
}
if (Main.rand.NextBool(3) && Time > 12f && targetDist < 1400f)
{
Particle orb = new GenericBloom(Projectile.Center + Main.rand.NextVector2Circular(10, 10), Projectile.velocity * Main.rand.NextFloat(0.05f, 0.5f), Color.Black, Main.rand.NextFloat(0.2f, 0.45f), Main.rand.Next(9, 12), true, false);
Particle orb = new GenericBloom(Projectile.Center + Main.rand.NextVector2CircularEdge(5, 5), Projectile.velocity * Main.rand.NextFloat(0.05f, 0.5f), Color.Black, Main.rand.NextFloat(0.2f, 0.4f), Main.rand.Next(9, 12), true, false);
GeneralParticleHandler.SpawnParticle(orb);
int dustStyle = ModContent.DustType<VoidDustInverted>();
Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(10, 10), dustStyle);
dust.scale = Main.rand.NextFloat(0.6f, 1.2f);
dust.velocity = new Vector2(0, Main.rand.NextFloat(0.1f, 5));
dust.noGravity = false;
dust.color = Color.LightGreen;
}
if (Projectile.timeLeft % 3 == 0 && Time > 12f && targetDist < 1400f)
if (Projectile.timeLeft % 2 == 0 && Time > 12f && targetDist < 1400f)
{
LineParticle spark2 = new LineParticle(Projectile.Center, -Projectile.velocity * 0.05f, false, 17, 1.7f, InnerColor);
Particle spark = new CustomSpark(Projectile.Center, -Projectile.velocity * 0.05f, "CalamityMod/Particles/GlowSpark2", false, 17, 0.05f + (deform * 0.045f), Color.Black, new Vector2(0.6f, 1.3f), false);
GeneralParticleHandler.SpawnParticle(spark);
Particle spark2 = new CustomSpark(Projectile.Center, -Projectile.velocity * 0.05f, "CalamityMod/Particles/GlowSpark", false, 17, 0.025f + (deform * 0.045f), Color.LightGreen, new Vector2(0.6f, 1.3f), true, false);
GeneralParticleHandler.SpawnParticle(spark2);
}
if (Main.rand.NextBool(3) && Time > 12f && targetDist < 1400f)
{
Particle orb2 = new GenericBloom(Projectile.Center + Main.rand.NextVector2Circular(5, 5), Projectile.velocity * Main.rand.NextFloat(0.05f, 0.5f), InnerColor, Main.rand.NextFloat(0.05f, 0.3f), Main.rand.Next(9, 12), true);
GeneralParticleHandler.SpawnParticle(orb2);
}
if (Time == 7f)
if (Time == 9f)
{
for (int i = 0; i <= 18; i++)
for (int i = 0; i <= 10; i++)
{
int dustStyle = Main.rand.NextBool() ? 66 : 263;
Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(3) ? 191 : dustStyle, Projectile.velocity);
dust.scale = Main.rand.NextFloat(1.5f, 2.3f);
dust.velocity = Projectile.velocity.RotatedByRandom(0.3f) * Main.rand.NextFloat(0.3f, 2.1f);
dust.noGravity = true;
dust.color = dust.type == dustStyle ? InnerColor : default;
float variance = Main.rand.NextFloat(-0.7f, 0.7f);
int dustStyle = ModContent.DustType<VoidDustInverted>();
Dust dust2 = Dust.NewDustPerfect(Projectile.Center, dustStyle);
dust2.scale = Main.rand.NextFloat(1.7f, 1.9f) - Math.Abs(variance);
dust2.velocity = (Projectile.velocity * 2).RotatedBy(variance) * Main.rand.NextFloat(0.35f, 1f) * (1 - Math.Abs(variance));
dust2.noGravity = true;
dust2.color = InnerColor;
}
}
if (BounceHits > 0f)
@@ -80,7 +85,7 @@ namespace CalamityMod.Projectiles.Ranged
dust.noGravity = true;
dust.color = InnerColor;
CalamityUtils.HomeInOnNPC(Projectile, false, 600f, 12f, 15f);
CalamityUtils.HomeInOnNPC(Projectile, false, 600f, 7f, 25f + 30 * deform);
}
}
@@ -96,34 +101,39 @@ namespace CalamityMod.Projectiles.Ranged
public override bool OnTileCollide(Vector2 oldVelocity)
{
Projectile.timeLeft = 27 * Projectile.MaxUpdates;
Projectile.timeLeft = 45 * Projectile.MaxUpdates;
for (int i = 0; i < 2; i++)
{
Particle blastRing = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Black, "CalamityMod/Particles/LargeBloom", Vector2.One, Main.rand.NextFloat(-10, 10), 0.3f, 0.6f, 25, false);
Particle blastRing = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Black, "CalamityMod/Particles/LargeBloom", Vector2.One, Main.rand.NextFloat(-10, 10), 0.35f, 0.4f, 38, false);
GeneralParticleHandler.SpawnParticle(blastRing);
}
for (int i = 0; i < 5; i++)
{
Particle blastRing = new CustomPulse(Projectile.Center, Vector2.Zero, InnerColor, "CalamityMod/Particles/BloomCircle", Vector2.One, Main.rand.NextFloat(-10, 10), 0.48f, 0.52f, 38);
GeneralParticleHandler.SpawnParticle(blastRing);
}
float numberOfDusts = 12;
float rotFactor = 360f / numberOfDusts;
float numberOfDusts = 10;
for (int i = 0; i < numberOfDusts; i++)
{
float rot = MathHelper.ToRadians(i * rotFactor);
Vector2 offset = new Vector2(Main.rand.NextFloat(1, 3.1f), 0).RotatedBy(rot * Main.rand.NextFloat(1.1f, 9.1f));
Vector2 velOffset = new Vector2(Main.rand.NextFloat(1, 3.1f), 0).RotatedBy(rot * Main.rand.NextFloat(1.1f, 9.1f));
Dust dust = Dust.NewDustPerfect(Projectile.Center + offset, 66, new Vector2(velOffset.X, velOffset.Y));
Dust dust = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType<VoidDustInverted>());
dust.noGravity = true;
dust.velocity = velOffset;
dust.velocity = new Vector2(5, 5).RotatedByRandom(100) * Main.rand.NextFloat(0.3f, 1f);
dust.scale = Main.rand.NextFloat(1.6f, 2.2f);
dust.color = InnerColor;
}
Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, InnerColor, new Vector2(1f, 1f), Main.rand.NextFloat(5, -5), 0.1f, 0.9f - (BounceHits * 0.25f), 25);
GeneralParticleHandler.SpawnParticle(pulse);
//Particle pulse = new CustomPulse(Projectile.Center, Vector2.Zero, InnerColor, "CalamityMod/Particles/SoftRoundExplosion", new Vector2(1f, 1f), Main.rand.NextFloat(5, -5), 0f, 0.1f, 15);
//GeneralParticleHandler.SpawnParticle(pulse);
if (BounceHits == 0f)
SoundEngine.PlaySound(DeadSunsWind.Ricochet, Projectile.Center);
BounceHits++;
if (BounceHits >= 4f)
Projectile.Kill();
if (Projectile.velocity.X != oldVelocity.X)
{
Projectile.velocity.X = -oldVelocity.X;
@@ -132,8 +142,7 @@ namespace CalamityMod.Projectiles.Ranged
{
Projectile.velocity.Y = -oldVelocity.Y;
}
if (BounceHits >= 4f)
Projectile.Kill();
return false;
}
}
+9 -5
View File
@@ -1,4 +1,5 @@
using System;
using CalamityMod.Dusts;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
@@ -39,10 +40,13 @@ namespace CalamityMod.Projectiles.Ranged
GeneralParticleHandler.SpawnParticle(explosion2);
Particle explosion3 = new DetailedExplosion(Projectile.Center, Vector2.Zero, Color.Black, Vector2.One, Main.rand.NextFloat(-5, 5), 0f, ExplosionRadius * 0.0030f + 0.1f, Main.rand.Next(15, 22), false);
GeneralParticleHandler.SpawnParticle(explosion3);
Particle orb = new GenericBloom(Projectile.Center, Projectile.velocity, color1, ExplosionRadius * 0.0085f + 0.05f, 10, true);
GeneralParticleHandler.SpawnParticle(orb);
Particle orb2 = new GenericBloom(Projectile.Center, Projectile.velocity, color2, ExplosionRadius * 0.006f + 0.05f, 10, true, true);
GeneralParticleHandler.SpawnParticle(orb2);
for (int i = 0; i < 4; i++)
{
Particle blastRing = new CustomPulse(Projectile.Center, Vector2.Zero, color1, "CalamityMod/Particles/BloomCircle", Vector2.One, Main.rand.NextFloat(-10, 10), 0, ExplosionRadius * 0.005f + 0.05f, 25);
GeneralParticleHandler.SpawnParticle(blastRing);
}
float numberOfDusts = ExplosionRadius * 0.1f + 10;
float rotFactor = 360f / numberOfDusts;
for (int i = 0; i < numberOfDusts; i++)
@@ -50,7 +54,7 @@ namespace CalamityMod.Projectiles.Ranged
float rot = MathHelper.ToRadians(i * rotFactor);
Vector2 offset = (Vector2.UnitX * Main.rand.NextFloat(ExplosionRadius * 0.2f, 3.1f)).RotatedBy(rot * Main.rand.NextFloat(1.1f, 9.1f));
Vector2 velOffset = (Vector2.UnitX * Main.rand.NextFloat(ExplosionRadius * 0.2f, 3.1f)).RotatedBy(rot * Main.rand.NextFloat(1.1f, 9.1f));
Dust dust = Dust.NewDustPerfect(Projectile.Center + offset, Main.rand.NextBool(4) ? 263 : Projectile.ai[1] == 5 ? 278 : 66, velOffset);
Dust dust = Dust.NewDustPerfect(Projectile.Center + offset, Main.rand.NextBool(4) ? ModContent.DustType<LightDust>() : Projectile.ai[1] == 5 ? 278 : ModContent.DustType<VoidDustInverted>(), velOffset);
dust.noGravity = dust.type == 278 ? false : true;
dust.color = color1;
dust.velocity = velOffset;
+14 -13
View File
@@ -1,5 +1,6 @@
using System;
using CalamityMod.Buffs.Potions;
using CalamityMod.Dusts;
using CalamityMod.Items.Weapons.Rogue;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Ranged;
@@ -149,11 +150,11 @@ namespace CalamityMod.Projectiles.Rogue
Projectile.Center = placementCenter;
if (Main.rand.NextBool())
if (Main.rand.NextBool(4))
{
int dustStyle = Main.rand.NextBool() ? 66 : 263;
int dustStyle = ModContent.DustType<VoidDustInverted>();
Dust dust = Dust.NewDustPerfect(portalSpot, dustStyle, Projectile.velocity);
dust.scale = Main.rand.NextFloat(0.4f, 0.8f);
dust.scale = Main.rand.NextFloat(0.6f, 1.1f);
dust.velocity = new Vector2(12, 12).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1f) * Utils.GetLerpValue(180, 0, stuckTimer);
dust.noGravity = true;
dust.color = Color.LightGreen;
@@ -213,10 +214,11 @@ namespace CalamityMod.Projectiles.Rogue
for (int i = 0; i <= 12; i++)
{
int dustStyle = Main.rand.NextBool() ? 66 : 263;
float variance = Main.rand.NextFloat(-0.6f, 0.6f);
int dustStyle = ModContent.DustType<VoidDustInverted>();
Dust dust2 = Dust.NewDustPerfect(Projectile.Center, dustStyle, Projectile.velocity);
dust2.scale = Main.rand.NextFloat(0.5f, 1.1f);
dust2.velocity = new Vector2(7, 7).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1f);
dust2.scale = Main.rand.NextFloat(1.5f, 1.7f) - Math.Abs(variance);
dust2.velocity = Projectile.velocity.RotatedBy(variance) * Main.rand.NextFloat(0.3f, 1f) * (1 - Math.Abs(variance));
dust2.noGravity = true;
dust2.color = Color.LightGreen;
}
@@ -247,9 +249,9 @@ namespace CalamityMod.Projectiles.Rogue
for (int k = 0; k < 8; k++)
{
Vector2 partPos = Projectile.Center + storedVelocity.SafeNormalize(Vector2.UnitX) * 68;
Color colorType = Main.rand.NextBool() ? Color.LightGreen : Color.Black;
Particle spark3 = new GlowOrbParticle(partPos, new Vector2(4, 4).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1f), false, 19, Main.rand.NextFloat(0.6f, 1f), colorType, colorType == Color.Black ? false : true, false, colorType == Color.Black ? false : true);
GeneralParticleHandler.SpawnParticle(spark3);
Dust dust = Dust.NewDustPerfect(partPos, ModContent.DustType<VoidDustInverted>(), new Vector2(4, 4).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1f), 0, default, Main.rand.NextFloat(1.4f, 1.75f));
dust.noGravity = true;
dust.color = Color.LightGreen;
}
}
@@ -335,11 +337,10 @@ namespace CalamityMod.Projectiles.Rogue
if (!canStick || stuckInTarget)
{
for (int i = 0; i < 4; i++)
for (int i = 0; i < 7; i++)
{
Color auraColor = Color.Lerp(Color.LightGreen, Color.White, Utils.GetLerpValue(0, 4, i)) * (1 - fading);
Vector2 rotationalDrawOffset = (MathHelper.TwoPi * i / 7f + Main.GlobalTimeWrappedHourly * 17f).ToRotationVector2();
rotationalDrawOffset *= MathHelper.Lerp(3f, 5.25f, (float)Math.Cos(Main.GlobalTimeWrappedHourly * 6f) * 0.5f + (!canStick ? 1.5f : 0));
Color auraColor = Color.LightGreen * (1 - fading);
Vector2 rotationalDrawOffset = (MathHelper.TwoPi * i / 7f).ToRotationVector2() * 3;
Main.EntitySpriteDraw(tex2.Value, Projectile.Center - Main.screenPosition + rotationalDrawOffset, null, (auraColor * alpha) with { A = 0 }, Projectile.rotation, tex2.Size() * 0.5f, Projectile.scale, storedVelocity.X > 0 ? SpriteEffects.None : SpriteEffects.FlipVertically);
}
}
+24 -23
View File
@@ -1,4 +1,5 @@
using System;
using CalamityMod.Dusts;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
@@ -60,14 +61,21 @@ namespace CalamityMod.Projectiles.Rogue
else if (time > 8)
Projectile.velocity *= 0.9f;
if (Projectile.velocity.Length() > 3 && Main.rand.NextBool())
if (Projectile.velocity.Length() > 3)
{
Vector2 placement = Projectile.Center + Main.rand.NextVector2Circular(70, 70);
float speed = Main.rand.NextFloat(0.9f, 1.9f);
Particle spark = new GlowOrbParticle(placement, -Projectile.velocity * speed, false, 11, 0.8f, Color.Black, false, false, false);
GeneralParticleHandler.SpawnParticle(spark);
Particle spark2 = new GlowOrbParticle(placement, -Projectile.velocity * speed, false, 11, 0.5f, Color.LightGreen, true, false, true);
GeneralParticleHandler.SpawnParticle(spark2);
float speed = Main.rand.NextFloat(0.6f, 0.9f);
if (Main.rand.NextBool())
{
int dustStyle = ModContent.DustType<VoidDustInverted>();
Dust dust = Dust.NewDustPerfect(placement, dustStyle);
dust.scale = Main.rand.NextFloat(0.8f, 1.2f);
dust.velocity = -Projectile.velocity * speed;
dust.noGravity = true;
dust.color = Color.LightGreen;
}
Particle smoke = new HeavySmokeParticle(Projectile.Center + Main.rand.NextVector2Circular(20, 20), -Projectile.velocity * speed, Color.Black, 22, Main.rand.NextFloat(-0.2f, 0.2f) + speed, 0.4f, Main.rand.NextFloat(-0.05f, 0.05f), false);
GeneralParticleHandler.SpawnParticle(smoke);
}
fade = MathHelper.Lerp(fade, 0, 0.088f);
@@ -93,7 +101,6 @@ namespace CalamityMod.Projectiles.Rogue
if (time == 8)
Projectile.Kill();
}
//if (Projectile.Calamity().stealthStrike)
time++;
if (stealthHitCooldown > 0)
@@ -182,12 +189,14 @@ namespace CalamityMod.Projectiles.Rogue
Particle orb7 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Black, "CalamityMod/Particles/SmallBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), (2.2f + i * 0.5f) * sizeBonus, 0f, 80, false);
GeneralParticleHandler.SpawnParticle(orb7);
}
for (int i = 0; i < 12; i++)
for (int i = 0; i < (19 * sizeBonus); i++)
{
Particle spark3 = new GlowOrbParticle(Projectile.Center, new Vector2(21, 21).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 1f) * sizeBonus, false, 25, Main.rand.NextFloat(0.8f, 1.5f) * sizeBonus, Color.LightGreen, true, false, false);
GeneralParticleHandler.SpawnParticle(spark3);
Particle spark4 = new GlowOrbParticle(Projectile.Center, new Vector2(21, 21).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 1f) * sizeBonus, false, 25, Main.rand.NextFloat(0.8f, 1.5f) * sizeBonus, Color.Black, false, false, false);
GeneralParticleHandler.SpawnParticle(spark4);
int dustStyle = ModContent.DustType<VoidDustInverted>();
Dust dust = Dust.NewDustPerfect(Projectile.Center, dustStyle);
dust.scale = Main.rand.NextFloat(1.4f, 2.2f) * sizeBonus;
dust.velocity = new Vector2(21, 21).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 1f) * sizeBonus;
dust.noGravity = true;
dust.color = Color.LightGreen;
}
for (int i = 0; i < (25 * sizeBonus); i++)
{
@@ -210,18 +219,10 @@ namespace CalamityMod.Projectiles.Rogue
{
Main.EntitySpriteDraw(portal.Value, Projectile.Center - Main.screenPosition, null, Color.LightGreen with { A = 0 } * Utils.GetLerpValue(45, 0, stealthHitCooldown), 0, portal.Size() * 0.5f, 1.1f * Utils.GetLerpValue(45, 0, stealthHitCooldown), SpriteEffects.None);
}
for (int i = 0; i < 3; i++)
for (int i = 0; i < 15; i++)
{
Color auraColor = Color.Black;
Vector2 rotationalDrawOffset = (MathHelper.TwoPi * i / 7f + Main.GlobalTimeWrappedHourly * 17f).ToRotationVector2();
rotationalDrawOffset *= MathHelper.Lerp(3f, 5.25f, (float)Math.Cos(Main.GlobalTimeWrappedHourly * 6f) * 0.5f);
Vector2 rotationalDrawOffset2 = (MathHelper.TwoPi * i / 7f + Main.GlobalTimeWrappedHourly * 17f).ToRotationVector2();
rotationalDrawOffset2 *= MathHelper.Lerp(3f, 5.25f, (float)Math.Cos(Main.GlobalTimeWrappedHourly * 6f) * 0.5f - 2);
Main.EntitySpriteDraw(tex2.Value, Projectile.Center - Main.screenPosition + rotationalDrawOffset, null, auraColor, Projectile.rotation, tex2.Size() * 0.5f, Projectile.scale, SpriteEffects.None);
for (int b = 0; b < 2; b++)
{
Main.EntitySpriteDraw(tex2.Value, Projectile.Center - Main.screenPosition + rotationalDrawOffset2, null, Color.LightGreen with { A = 0 }, Projectile.rotation, tex2.Size() * 0.5f, Projectile.scale, SpriteEffects.None);
}
Vector2 rotationalDrawOffset2 = (MathHelper.TwoPi * i / 15f).ToRotationVector2() * 5 * (fade + 0.2f);
Main.EntitySpriteDraw(tex2.Value, Projectile.Center - Main.screenPosition + rotationalDrawOffset2, null, Color.LightGreen with { A = 0 } * 0.4f, Projectile.rotation, tex2.Size() * 0.5f, Projectile.scale, SpriteEffects.None);
}
Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition, null, lightColor, Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0);