Made many sweeping changes to Scorpio, added a new particle and a few sounds that are likely to be replaced with custom ones from Moonburn eventually
This commit is contained in:
Xyk authored and Cameron Ewell committed 2024-02-15 16:39:14 -05:00
1 parent daa3c90340
commit c2c12dfead
10 files changed
+279 -78

No files matched your search

+11 -8
View File
@@ -16,24 +16,27 @@ namespace CalamityMod.Items.Weapons.Ranged
#region Other stats
// Weapon stats.
public static int OriginalUseTime = 60;
public static int TimeBetweenBursts = 10;
public static int ProjectilesPerBurst = 6;
public static int OriginalUseTime = 30;
public static int TimeBetweenBursts = 8;
public static int ProjectilesPerBurst = 8;
// Small rocket stats.
public static float EnemyDetectionDistance = 2000f;
public static float TrackingSpeed = 0.06f; // VERY DELICATE VALUE, CHANGE SLOWLY.
// Large rocket stats.
public static float NukeEnemyDistanceDetection = 320f;
public static float NukeRequiredRotationProximity = 0.95f;
public static float NukeTrackingSpeed = 0.01f; // VERY DELICATE VALUE, CHANGE SLOWLY.
public static float NukeEnemyDistanceDetection = 300f;
public static float NukeRequiredRotationProximity = 0.96f;
public static float NukeTrackingSpeed = 0.0095f; // VERY DELICATE VALUE, CHANGE SLOWLY.
#endregion
public static readonly SoundStyle RocketShoot = new("CalamityMod/Sounds/Item/ScorpioShot") { Volume = 0.45f };
public static readonly SoundStyle RocketHit = new("CalamityMod/Sounds/Item/ScorpioHit") { Volume = 0.35f };
public static readonly SoundStyle NukeHit = new("CalamityMod/Sounds/Item/ScorpioNukeHit") { Volume = 0.6f };
public override void SetDefaults()
{
Item.damage = 40;
Item.damage = 20;
Item.DamageType = DamageClass.Ranged;
Item.useTime = Item.useAnimation = OriginalUseTime;
Item.shoot = ModContent.ProjectileType<ScorpioHoldout>();
@@ -62,7 +65,7 @@ namespace CalamityMod.Items.Weapons.Ranged
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType<ScorpioHoldout>(), 0, 0f, player.whoAmI);
Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType<ScorpioHoldout>(), 0, 0f, player.whoAmI, -30);
// We set the rotation to the direction to the mouse so the first frame doesn't appear bugged out.
holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero);
+63
View File
@@ -0,0 +1,63 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Particles
{
public class NanoParticle : Particle
{
public override string Texture => "CalamityMod/Particles/NanoParticleSmall";
public bool UseAltVisual = true;
public override bool UseAdditiveBlend => UseAltVisual;
public override bool UseCustomDraw => true;
public override bool SetLifetime => true;
private float Spin;
private float opacity;
private bool Big;
private bool EmitsLight;
private Vector2 Gravity;
private int Time = 0;
public NanoParticle(Vector2 position, Vector2 velocity, Color color, float scale, int lifeTime, bool bigSize = false, bool emitsLight = false, bool AddativeBlend = true, Vector2? gravity = null)
{
Position = position;
Velocity = velocity;
Color = color;
Scale = scale;
Lifetime = lifeTime;
Rotation = 0;
Big = bigSize;
EmitsLight = emitsLight;
UseAltVisual = AddativeBlend;
Gravity = (Vector2)(gravity == null ? Vector2.Zero : gravity);
Variant = Main.rand.Next(3);
}
public override void Update()
{
Time++;
Velocity += Gravity;
opacity = (float)Math.Sin(LifetimeCompletion * MathHelper.Pi);
if (EmitsLight)
Lighting.AddLight(Position, opacity * Color.R / 255f, opacity * Color.G / 255f, opacity * Color.B / 255f);
Velocity *= 0.95f;
Scale *= 0.98f;
if (Time % 3 == 0)
{
Position += Main.rand.NextVector2Circular(13, 13);
}
}
public override void CustomDraw(SpriteBatch spriteBatch)
{
Texture2D nanoTexture = Big ? ModContent.Request<Texture2D>("CalamityMod/Particles/NanoParticleBig").Value : ModContent.Request<Texture2D>(Texture).Value;
Rectangle frame = new Rectangle(0, (Big ? 8 : 6), (Big ? 8 : 6), (Big ? 8 : 6));
spriteBatch.Draw(nanoTexture, Position - Main.screenPosition, frame, Color * opacity, 0, frame.Size() / 2f, Scale, SpriteEffects.None, 0);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

+87 -28
View File
@@ -4,6 +4,7 @@ using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.Localization;
@@ -22,6 +23,7 @@ namespace CalamityMod.Projectiles.Ranged
public ref float ShootingTimer => ref Projectile.ai[0];
public ref float TimerBetweenBursts => ref Projectile.ai[1];
public ref float OffsetLengthScalar => ref Projectile.localAI[0];
public int ChargeLV = 0;
// The maximum amount that the gun is away from the player's hands.
public const float MaxOffsetScalarLength = 15f;
@@ -30,6 +32,7 @@ namespace CalamityMod.Projectiles.Ranged
// It'll carry over to the projectiles that it shoots.
public static int DustEffectsID { get; set; }
public static Color EffectsColor { get; set; }
public static Color StaticEffectsColor = Color.Turquoise;
public override void SetDefaults()
{
@@ -62,31 +65,33 @@ namespace CalamityMod.Projectiles.Ranged
// If the timer reaches Item.useTime, it'll shoot.
// It'll shoot once immediately as the timer reaches.
Item heldItem = Owner.ActiveItem();
// If the player's pressing RMB, it'll shoot the big rocket.
if (Owner.Calamity().mouseRight && ChargeLV >= 3)
{
ShootRocket(heldItem, true);
ShootingTimer = heldItem.useAnimation; // If you time your nukes well, you can reset the burst rocket cooldown
ChargeLV = -1;
}
if (ShootingTimer >= heldItem.useAnimation)
{
// If the player's pressing RMB, it'll shoot the big rocket.
if (Owner.Calamity().mouseRight)
if (ShootingTimer == heldItem.useAnimation && ChargeLV < 3)
ChargeLV++;
// Shooting the burst of small rockets.
// The time is adapted to the speed modifier from the reforge.
int adaptedTimeBetweenBursts = TimeBetweenBursts * heldItem.useAnimation / OriginalUseTime;
if (ShootingTimer % adaptedTimeBetweenBursts == 0f)
ShootRocket(heldItem, false);
// Resets the timers when everything has been shot.
if (ShootingTimer >= heldItem.useAnimation + adaptedTimeBetweenBursts * (ProjectilesPerBurst - 1))
{
ShootRocket(heldItem, true);
ShootingTimer = 0f;
}
// Otherwise, it's just shooting the burst of small rockets.
else
{
// The time is adapted to the speed modifier from the reforge.
int adaptedTimeBetweenBursts = TimeBetweenBursts * heldItem.useAnimation / OriginalUseTime;
if (ShootingTimer % adaptedTimeBetweenBursts == 0f)
ShootRocket(heldItem, false);
// Resets the timers when everything has been shot.
if (ShootingTimer >= heldItem.useAnimation + adaptedTimeBetweenBursts * (ProjectilesPerBurst - 1))
{
ShootingTimer = 0f;
TimerBetweenBursts = 0f;
NetUpdate();
}
TimerBetweenBursts = 0f;
NetUpdate();
}
}
@@ -125,6 +130,57 @@ namespace CalamityMod.Projectiles.Ranged
float armRotation = Projectile.rotation - MathHelper.PiOver2; // -Pi/2 because the arms rotation starts with arms pointing down.
Owner.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Quarter, armRotation);
Owner.SetCompositeArmBack(true, Player.CompositeArmStretchAmount.Full, armRotation + MathHelper.ToRadians(15f) * direction);
// Inside here go all the things that dedicated servers shouldn't spend resources on.
// Like visuals and sounds.
if (Main.dedServ)
return;
// Charge level visuals here
Vector2 nuzzlePosition = Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.Zero) * 48f + (-Vector2.UnitY.RotatedBy(Projectile.rotation) * 10f) * Projectile.direction;
if (ChargeLV == 1 && ShootingTimer % 3 == 0)
{
Vector2 position = nuzzlePosition - Projectile.velocity * 95;
Vector2 velocity = (-Projectile.velocity * 5).RotatedByRandom(0.3f) * Main.rand.NextFloat(0.6f, 1.4f);
SquishyLightParticle energy = new(position, velocity, Main.rand.NextFloat(0.12f, 0.14f), StaticEffectsColor, Main.rand.Next(3, 5 + 1), 1, 1.5f);
GeneralParticleHandler.SpawnParticle(energy);
Dust dust = Dust.NewDustPerfect(position, DustEffectsID, velocity, 0, default, Main.rand.NextFloat(1.2f, 1.7f));
dust.noGravity = true;
}
if (ChargeLV == 2 & ShootingTimer % 2 == 0)
{
Vector2 position = nuzzlePosition - Projectile.velocity * 95;
Vector2 velocity = (-Projectile.velocity * 5).RotatedByRandom(0.5f) * Main.rand.NextFloat(0.9f, 1.9f);
SquishyLightParticle energy = new(position, velocity, Main.rand.NextFloat(0.18f, 0.22f), StaticEffectsColor, Main.rand.Next(3, 5 + 1), 1, 1.5f);
GeneralParticleHandler.SpawnParticle(energy);
Dust dust = Dust.NewDustPerfect(position, DustEffectsID, velocity, 0, default, Main.rand.NextFloat(1.2f, 1.7f));
dust.noGravity = true;
}
if (ChargeLV >= 3)
{
Vector2 position = nuzzlePosition - Projectile.velocity * 95;
Vector2 velocity = (-Projectile.velocity * 5).RotatedByRandom(0.75f) * Main.rand.NextFloat(1.2f, 2.3f);
SquishyLightParticle energy = new(position, velocity, Main.rand.NextFloat(0.24f, 0.34f), StaticEffectsColor, Main.rand.Next(3, 5 + 1), 1, 1.5f);
GeneralParticleHandler.SpawnParticle(energy);
for (int i = 0; i < 2; i++)
{
Dust dust = Dust.NewDustPerfect(position, DustEffectsID, velocity, 0, default, Main.rand.NextFloat(1.6f, 2.1f));
dust.noGravity = true;
}
}
if (ChargeLV == 0 && ShootingTimer % 3 == 0)
{
Vector2 position = nuzzlePosition - Projectile.velocity * 95;
Vector2 velocity = (-Projectile.velocity * 4).RotatedByRandom(0.5f) * Main.rand.NextFloat(0.9f, 2f);
Particle smoke = new HeavySmokeParticle(position, velocity, Color.SlateGray, Main.rand.Next(40, 60 + 1), Main.rand.NextFloat(0.3f, 0.6f), 0.5f, Main.rand.NextFloat(-0.2f, 0.2f), true, required: true);
GeneralParticleHandler.SpawnParticle(smoke);
for (int i = 0; i < 2; i++)
{
Dust dust = Dust.NewDustPerfect(position, 303, velocity * 0.5f, 200, default, Main.rand.NextFloat(0.9f, 1.3f));
dust.noGravity = false;
}
}
}
public void ShootRocket(Item item, bool isRMB)
@@ -133,11 +189,11 @@ namespace CalamityMod.Projectiles.Ranged
Vector2 projectileVelocity = Projectile.velocity.SafeNormalize(Vector2.Zero);
// The position of the tip of the gun.
Vector2 nuzzlePosition = Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.Zero) * 48f + -Vector2.UnitY.RotatedBy(Projectile.rotation) * 10f;
Vector2 nuzzlePosition = Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.Zero) * 48f + (-Vector2.UnitY.RotatedBy(Projectile.rotation) * 10f) * Projectile.direction;
// Every time we shoot we use ammo.
// With this method we also use the item's stats, like the shoot speed, or the type of ammo it was used.
Owner.PickAmmo(item, out _, out float projSpeed, out int damage, out float knockback, out int rocketType);
Owner.PickAmmo(item, out _, out float projSpeed, out int damage, out float knockback, out int rocketType, Main.rand.Next(100) > 70); // 70% ammo conservation
// Decides the color of the effects depending on the type of rocket used.
switch (rocketType)
@@ -156,7 +212,7 @@ namespace CalamityMod.Projectiles.Ranged
break;
default:
DustEffectsID = 302;
EffectsColor = Color.Cyan;
EffectsColor = Color.Aquamarine;
break;
}
@@ -179,8 +235,14 @@ namespace CalamityMod.Projectiles.Ranged
if (Main.dedServ)
return;
SoundStyle RightClickSound = new("CalamityMod/Sounds/Item/RealityRuptureStealth") { Volume = 0.45f };
if (isRMB)
SoundEngine.PlaySound(RightClickSound with { Pitch = -0.1f }, Projectile.Center);
else
SoundEngine.PlaySound(RocketShoot with { Pitch = ChargeLV * 0.055f }, Projectile.Center);
// By decreasing the offset length of the gun from the arms, we give an effect of recoil.
OffsetLengthScalar -= isRMB ? 12f : 5f;
OffsetLengthScalar -= isRMB ? 30f : 5f;
int dustAmount = Main.rand.Next(10, 15 + 1);
for (int i = 0; i < dustAmount; i++)
@@ -204,9 +266,6 @@ namespace CalamityMod.Projectiles.Ranged
0.4f,
20);
GeneralParticleHandler.SpawnParticle(shootPulse);
if (isRMB)
Owner.Calamity().GeneralScreenShakePower = 3f;
}
public void NetUpdate()
+84 -26
View File
@@ -2,6 +2,7 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Audio;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
@@ -28,8 +29,8 @@ namespace CalamityMod.Projectiles.Ranged
public override void SetDefaults()
{
Projectile.DamageType = DamageClass.Ranged;
Projectile.MaxUpdates = 2;
Projectile.width = Projectile.height = 62;
Projectile.MaxUpdates = 3;
Projectile.width = Projectile.height = 15;
Projectile.timeLeft = 600;
Projectile.localNPCHitCooldown = -1;
@@ -69,24 +70,48 @@ namespace CalamityMod.Projectiles.Ranged
trailDust.noLight = true;
trailDust.noLightEmittence = true;
Particle thrustSpark = new SparkleParticle(
Projectile.Center - Vector2.UnitX.RotatedBy(Projectile.rotation) * 8f,
Vector2.Zero,
EffectsColor,
EffectsColor,
0.8f,
2);
GeneralParticleHandler.SpawnParticle(thrustSpark);
if (Projectile.timeLeft < 595)
{
SparkParticle spark = new SparkParticle(Projectile.Center - Projectile.velocity * 2f, Projectile.velocity * 0.01f, false, 8, 1.3f, StaticEffectsColor);
GeneralParticleHandler.SpawnParticle(spark);
}
if (Projectile.timeLeft % 3 == 0)
{
Particle nanoDust = new NanoParticle(Projectile.Center, -Projectile.velocity.RotatedBy(Main.rand.NextFloat(-0.2f, 0.2f)), Main.rand.NextBool(3) ? EffectsColor : StaticEffectsColor, Main.rand.NextFloat(0.65f, 0.9f), Main.rand.Next(15, 20 + 1), Main.rand.NextBool(), true);
GeneralParticleHandler.SpawnParticle(nanoDust);
}
Particle blastRing = new DirectionalPulseRing(
Projectile.Center + Projectile.velocity * 1.5f,
Vector2.Zero,
StaticEffectsColor * 2,
Vector2.One,
0f,
0.25f,
0.25f,
2);
GeneralParticleHandler.SpawnParticle(blastRing);
Projectile.velocity *= 1.032f;
}
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => modifiers.SourceDamage *= 1.25f;
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers) => modifiers.SourceDamage *= 1.25f;
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
{
modifiers.SourceDamage *= 5f;
if (Projectile.numHits == 1)
Projectile.damage = (int)(Projectile.damage * 0.2f); // Inital shot does big damage, AOE does a 5th of that damage so Deus doesn't get to cash in for healthcare
if (Projectile.numHits > 1)
Projectile.damage = (int)(Projectile.damage * 0.92f); // 8% penalty on explosion hits
if (Projectile.damage < 1)
Projectile.damage = 1;
}
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers) => modifiers.SourceDamage *= 1.8f;
public override void OnKill(int timeLeft)
{
var info = new CalamityUtils.RocketBehaviorInfo((int)RocketID);
int blastRadius = Projectile.RocketBehavior(info);
Projectile.ExpandHitboxBy((float)blastRadius);
Projectile.ExpandHitboxBy((float)blastRadius * 4.4f);
Projectile.Damage();
// Inside here go all the things that dedicated servers shouldn't spend resources on.
@@ -94,38 +119,71 @@ namespace CalamityMod.Projectiles.Ranged
if (Main.dedServ)
return;
Main.player[Projectile.owner].Calamity().GeneralScreenShakePower = 3f;
SoundEngine.PlaySound(RocketHit, Projectile.Center);
int dustAmount = Main.rand.Next(30, 35 + 1);
for (int i = 0; i < dustAmount; i++)
{
Dust boomDust = Dust.NewDustPerfect(Projectile.Center, 226, (MathHelper.TwoPi / dustAmount * i).ToRotationVector2() * Main.rand.NextFloat(4f, 10f), Scale: Main.rand.NextFloat(0.4f, 0.6f));
Dust boomDust = Dust.NewDustPerfect(Projectile.Center, DustEffectsID, (MathHelper.TwoPi / dustAmount * i).ToRotationVector2() * Main.rand.NextFloat(4f, 10f), Scale: Main.rand.NextFloat(1.2f, 1.75f));
boomDust.noGravity = true;
boomDust.noLight = true;
boomDust.noLightEmittence = true;
}
for (int i = 0; i < 40; i++)
{
float blastVel = Projectile.width / 33f;
Vector2 velocity = new Vector2(blastVel, blastVel).RotatedByRandom(100) * Main.rand.NextFloat(0.3f, 1.7f);
Particle nanoDust = new NanoParticle(Projectile.Center, velocity, Main.rand.NextBool(3) ? EffectsColor : StaticEffectsColor, Main.rand.NextFloat(2f, 3f), 45, Main.rand.NextBool(), true);
GeneralParticleHandler.SpawnParticle(nanoDust);
}
Particle explosion = new DetailedExplosion(
Particle smallBlastRing = new DirectionalPulseRing(
Projectile.Center,
Vector2.Zero,
EffectsColor * 0.6f,
StaticEffectsColor,
Vector2.One,
Main.rand.NextFloat(MathHelper.TwoPi),
Projectile.width / 3600f,
Projectile.width / 360f,
20);
GeneralParticleHandler.SpawnParticle(explosion);
0f,
Projectile.width / 2180f,
Projectile.width / 312f,
40);
GeneralParticleHandler.SpawnParticle(smallBlastRing);
Particle blastRing = new DirectionalPulseRing(
Projectile.Center,
Vector2.Zero,
EffectsColor,
EffectsColor * 0.6f,
Vector2.One,
0f,
Projectile.width / 3120f,
Projectile.width / 312f,
15);
Projectile.width / 1755f,
Projectile.width / 175f,
20);
GeneralParticleHandler.SpawnParticle(blastRing);
SoundEngine.PlaySound(NukeHit, Projectile.Center);
Vector2 BurstFXDirection = new Vector2(15, 0);
for (int i = 0; i < 4; i++)
{
SparkParticle spark = new SparkParticle(Projectile.Center, (BurstFXDirection) * (i + 1), false, 11, 5f - i * 0.6f, StaticEffectsColor * 0.8f);
GeneralParticleHandler.SpawnParticle(spark);
}
for (int i = 0; i < 4; i++)
{
SparkParticle spark = new SparkParticle(Projectile.Center, (-BurstFXDirection) * (i + 1), false, 11, 5f - i * 0.6f, StaticEffectsColor * 0.8f);
GeneralParticleHandler.SpawnParticle(spark);
}
Particle orb = new GenericBloom(Projectile.Center, Vector2.Zero, StaticEffectsColor, 2, 13, false);
GeneralParticleHandler.SpawnParticle(orb);
Particle orb2 = new GenericBloom(Projectile.Center, Vector2.Zero, Color.White, 1.5f, 12, false);
GeneralParticleHandler.SpawnParticle(orb2);
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
if (Projectile.numHits < 1)
{
Main.player[Projectile.owner].Calamity().GeneralScreenShakePower = 6f;
}
}
public float TrailWidthFunction(float completionRatio) => Utils.Remap(completionRatio, 0f, 0.8f, 15f, 0f);
+34 -16
View File
@@ -1,7 +1,9 @@
using CalamityMod.Particles;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Audio;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
@@ -98,42 +100,58 @@ namespace CalamityMod.Projectiles.Ranged
if (Main.dedServ)
return;
int dustAmount = Main.rand.Next(30, 35 + 1);
int dustAmount = Main.rand.Next(25, 30 + 1);
for (int i = 0; i < dustAmount; i++)
{
Dust boomDust = Dust.NewDustPerfect(Projectile.Center, DustEffectsID, (MathHelper.TwoPi / dustAmount * i).ToRotationVector2() * Main.rand.NextFloat(4f, 10f), Scale: Main.rand.NextFloat(0.4f, 0.6f));
Dust boomDust = Dust.NewDustPerfect(Projectile.Center, DustEffectsID, (MathHelper.TwoPi / dustAmount * i).ToRotationVector2() * Main.rand.NextFloat(4f, 10f), Scale: Main.rand.NextFloat(1f, 1.45f));
boomDust.noGravity = true;
boomDust.noLight = true;
boomDust.noLightEmittence = true;
}
Particle explosion = new DetailedExplosion(
SoundEngine.PlaySound(RocketHit, Projectile.Center);
Particle smallBlastRing = new DirectionalPulseRing(
Projectile.Center,
Vector2.Zero,
EffectsColor * 0.6f,
StaticEffectsColor,
Vector2.One,
Main.rand.NextFloat(MathHelper.TwoPi),
Projectile.width / 3600f,
Projectile.width / 360f,
20);
GeneralParticleHandler.SpawnParticle(explosion);
0f,
Projectile.width / 2180f,
Projectile.width / 312f,
40);
GeneralParticleHandler.SpawnParticle(smallBlastRing);
Particle blastRing = new DirectionalPulseRing(
Projectile.Center,
Vector2.Zero,
EffectsColor,
EffectsColor * 0.6f,
Vector2.One,
0f,
Projectile.width / 3120f,
Projectile.width / 312f,
15);
Projectile.width / 1755f,
Projectile.width / 175f,
20);
GeneralParticleHandler.SpawnParticle(blastRing);
for (int i = 0; i < 7; i++)
{
float blastVel = Projectile.width / 35f;
Vector2 velocity = new Vector2(blastVel, blastVel).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1.5f);
Particle nanoDust = new NanoParticle(Projectile.Center, velocity, Main.rand.NextBool(3) ? EffectsColor : StaticEffectsColor, Main.rand.NextFloat(1f, 1.5f), 40, Main.rand.NextBool(), true);
GeneralParticleHandler.SpawnParticle(nanoDust);
}
}
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
{
if (Projectile.numHits > 1)
Projectile.damage = (int)(Projectile.damage * 0.88f); // 12% penalty on explosion hits
if (Projectile.damage < 1)
Projectile.damage = 1;
}
public override bool? CanDamage() => Time >= TimeToLaunch ? null : false;
public float TrailWidthFunction(float completionRatio) => Utils.Remap(completionRatio, 0f, 0.8f, 15f, 0f);
public Color TrailColorFunction(float completionRatio) => Color.Lerp(EffectsColor, EffectsColor * 0.3f, Utils.GetLerpValue(0f, 0.8f, completionRatio)) * Utils.GetLerpValue(255f, 0f, Projectile.alpha);
public float TrailWidthFunction(float completionRatio) => Utils.Remap(completionRatio, 0f, 0.8f, 6f, 0f);
public Color TrailColorFunction(float completionRatio) => Color.Lerp(EffectsColor, StaticEffectsColor * 0.75f, Utils.GetLerpValue(0f, 0.5f, completionRatio)) * Utils.GetLerpValue(255f, 0f, Projectile.alpha);
public override bool PreDraw(ref Color lightColor)
{
Binary file not shown.
Binary file not shown.
Binary file not shown.