Neptune's Bounty

I'm very tired, I will tell you what it does when its totally done or something
This commit is contained in:
Xyk authored and Cameron Ewell committed 2024-02-03 20:54:19 -05:00
1 parent aeffc0a950
commit 15f3d5d784
9 files changed
+471 -139

No files matched your search

+1 -1
View File
@@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee
{
Item.width = 74;
Item.height = 74;
Item.damage = 60;
Item.damage = 130;
Item.knockBack = 7.5f;
Item.useTime = 65;
Item.useAnimation = 65;
+13 -28
View File
@@ -5,6 +5,7 @@ using CalamityMod.Projectiles.Melee;
using CalamityMod.Rarities;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
@@ -13,44 +14,28 @@ namespace CalamityMod.Items.Weapons.Melee
public class NeptunesBounty : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Melee";
public static readonly SoundStyle SpinSound = new("CalamityMod/Sounds/Item/SpinningWoosh") { Volume = 0.65f };
public override void SetDefaults()
{
Item.width = 122;
Item.height = 122;
Item.damage = 270;
Item.DamageType = DamageClass.Melee;
Item.useAnimation = 22;
Item.useTime = 22;
Item.useTurn = true;
Item.useStyle = ItemUseStyleID.Swing;
Item.damage = 585;
Item.knockBack = 9f;
Item.UseSound = SoundID.Item1;
Item.useTime = 65;
Item.useAnimation = 65;
Item.shoot = ModContent.ProjectileType<NeptunesBountyProjectile>();
Item.shootSpeed = 3f;
Item.noMelee = true;
Item.noUseGraphic = true;
Item.DamageType = DamageClass.Melee;
Item.useStyle = ItemUseStyleID.Shoot;
Item.UseSound = null;
Item.autoReuse = true;
Item.shoot = ModContent.ProjectileType<NeptuneOrb>();
Item.shootSpeed = 12f;
Item.value = CalamityGlobalItem.Rarity13BuyPrice;
Item.rare = ModContent.RarityType<PureGreen>();
}
public override void MeleeEffects(Player player, Rectangle hitbox)
{
if (Main.rand.NextBool(3))
{
Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 33);
}
}
public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<CrushDepth>(), 300);
}
public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo)
{
target.AddBuff(ModContent.BuffType<CrushDepth>(), 300);
}
public override void AddRecipes()
{
CreateRecipe().
@@ -314,3 +314,5 @@ DepthCrusherProjectile.DisplayName: Depth Crusher Projectile
DepthCrusherSplitProjectile.DisplayName: Depth Crusher Split Projectile
AbyssBladeProjectile.DisplayName: Abyss Blade Projectile
AbyssBladeSplitProjectile.DisplayName: Abyss Blade Split Projectile
NeptunesBountyProjectile.DisplayName: Neptunes Bounty Projectile
NeptunesBountySplitProjectile.DisplayName: Neptunes Bounty Split Projectile
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

+51
View File
@@ -0,0 +1,51 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Particles
{
public class WaterFlavoredParticle : Particle
{
public Color InitialColor;
public bool AffectedByGravity;
public override bool SetLifetime => true;
public override bool UseCustomDraw => true;
public override bool UseAdditiveBlend => false;
public override string Texture => "CalamityMod/Particles/WaterFlavored";
public WaterFlavoredParticle(Vector2 relativePosition, Vector2 velocity, bool affectedByGravity, int lifetime, float scale, Color color)
{
Position = relativePosition;
Velocity = velocity;
AffectedByGravity = affectedByGravity;
Scale = scale;
Lifetime = lifetime;
Color = InitialColor = color;
}
public override void Update()
{
Scale *= 0.93f;
Color = Color.Lerp(InitialColor, Color.Transparent, (float)Math.Pow(LifetimeCompletion, 3D));
Velocity *= 0.95f;
if (Velocity.Length() < 12f && AffectedByGravity)
{
Velocity.X *= 0.94f;
Velocity.Y += 0.25f;
}
Rotation = Velocity.ToRotation() + MathHelper.PiOver2;
}
public override void CustomDraw(SpriteBatch spriteBatch)
{
Vector2 scale = new Vector2(0.65f, 1f) * Scale;
Texture2D texture = ModContent.Request<Texture2D>(Texture).Value;
spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color, Rotation, texture.Size() * 0.5f, scale, 0, 0f);
spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color, Rotation, texture.Size() * 0.5f, scale * new Vector2(0.45f, 1f), 0, 0f);
}
}
}
+4 -14
View File
@@ -115,6 +115,7 @@ namespace CalamityMod.Projectiles.Melee
Projectile.velocity = (Main.MouseWorld - Owner.Center).SafeNormalize(Vector2.UnitX * Owner.direction) * 20;
startDamage = Projectile.damage;
Projectile.spriteDirection = Projectile.direction;
SpinSoundSlot = SoundEngine.PlaySound(AbyssBlade.SpinSound, Projectile.Center);
Time = 0;
}
@@ -134,12 +135,6 @@ namespace CalamityMod.Projectiles.Melee
if (Projectile.velocity.Y > 0)
Projectile.velocity.X *= 0.975f;
if (Projectile.soundDelay <= 0)
{
SpinSoundSlot = SoundEngine.PlaySound(AbyssBlade.SpinSound, Projectile.Center);
Projectile.soundDelay = 8;
}
Vector2 particlePosition = Projectile.Center + new Vector2(13.5f * Projectile.direction, 0) + Projectile.velocity * 0.5f;
if (Time % 3 == 0)
{
@@ -156,7 +151,7 @@ namespace CalamityMod.Projectiles.Melee
if (Collision.SolidCollision(Projectile.Center, 10, 10) && Time >= 2)
{
Projectile.extraUpdates = 1;
Projectile.extraUpdates = 2;
Projectile.rotation = 0;
spinMode = false;
SoundEngine.PlaySound(new("CalamityMod/Sounds/Custom/CeramicImpact", 2) { Volume = 0.65f, PitchVariance = 0.3f}, Projectile.Center);
@@ -204,13 +199,13 @@ namespace CalamityMod.Projectiles.Melee
if (Time > 9)
{
for (int i = 0; i < 3; i++)
for (int i = 0; i < 6; i++)
{
Vector2 dustPos = Projectile.Center - Projectile.velocity * 3 + Main.rand.NextVector2Circular(15, 15);
Dust dust = Dust.NewDustPerfect(dustPos, Main.rand.NextBool(3) ? dustType2 : dustType1);
dust.noGravity = true;
dust.scale = Main.rand.NextFloat(1.3f, 1.6f);
dust.velocity = -Projectile.velocity * Main.rand.NextFloat(0.1f, 0.6f);
dust.velocity = -Projectile.velocity * Main.rand.NextFloat(0.05f, 0.7f);
}
}
}
@@ -256,10 +251,5 @@ namespace CalamityMod.Projectiles.Melee
dust.velocity = new Vector2(5, 5).RotatedByRandom(100) * Main.rand.NextFloat(0.3f, 1f) * dustMulti;
}
}
public override bool OnTileCollide(Vector2 oldVelocity)
{
return false;
}
}
}
-96
View File
@@ -1,96 +0,0 @@
using CalamityMod.Buffs.DamageOverTime;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
namespace CalamityMod.Projectiles.Melee
{
public class NeptuneOrb : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Melee";
public override string Texture => "CalamityMod/Projectiles/Melee/DepthOrb";
public override void SetDefaults()
{
Projectile.width = 20;
Projectile.height = 20;
Projectile.aiStyle = ProjAIStyleID.Beam;
Projectile.friendly = true;
Projectile.DamageType = DamageClass.Melee;
Projectile.penetrate = -1;
Projectile.timeLeft = 300;
Projectile.ignoreWater = true;
}
public override void AI()
{
Lighting.AddLight(Projectile.Center, 0f, 0f, 1f);
if (Projectile.timeLeft % 20 == 19 && Projectile.owner == Main.myPlayer)
{
int splitDamage = Projectile.damage / 2;
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, 0f, 15f, ModContent.ProjectileType<DepthOrb2>(), splitDamage, Projectile.knockBack, Projectile.owner, 0f, 0f);
}
int waterDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 33, 0f, 0f, 100, default, 0.4f);
Main.dust[waterDust].noGravity = true;
Main.dust[waterDust].velocity *= 0.5f;
Main.dust[waterDust].velocity += Projectile.velocity * 0.1f;
}
public override bool PreDraw(ref Color lightColor)
{
if (Projectile.timeLeft > 295)
return false;
Texture2D tex = ModContent.Request<Texture2D>(Texture).Value;
Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0);
return false;
}
public override Color? GetAlpha(Color lightColor)
{
return new Color(50, 50, 255, Projectile.alpha);
}
public override void OnKill(int timeLeft)
{
SoundEngine.PlaySound(SoundID.Item10, Projectile.position);
Projectile.position = Projectile.Center;
Projectile.width = Projectile.height = 64;
Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2);
Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2);
for (int dustIndex = 0; dustIndex <= 30; dustIndex++)
{
float rando1 = (float)Main.rand.Next(-10, 11);
float rando2 = (float)Main.rand.Next(-10, 11);
float rando3 = (float)Main.rand.Next(3, 9);
float randoAdjuster = (float)Math.Sqrt((double)(rando1 * rando1 + rando2 * rando2));
randoAdjuster = rando3 / randoAdjuster;
rando1 *= randoAdjuster;
rando2 *= randoAdjuster;
int killWatery = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 33, 0f, 0f, 100, default, 1.2f);
Dust dust = Main.dust[killWatery];
dust.noGravity = true;
dust.position.X = Projectile.Center.X;
dust.position.Y = Projectile.Center.Y;
dust.position.X += (float)Main.rand.Next(-10, 11);
dust.position.Y += (float)Main.rand.Next(-10, 11);
dust.velocity.X = rando1;
dust.velocity.Y = rando2;
}
Projectile.maxPenetrate = -1;
Projectile.penetrate = -1;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 10;
Projectile.Damage();
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<CrushDepth>(), 180);
}
}
}
@@ -0,0 +1,316 @@
using CalamityMod.Buffs.DamageOverTime;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Particles;
using ReLogic.Utilities;
using static CalamityMod.CalamityUtils;
using CalamityMod.Buffs.StatBuffs;
namespace CalamityMod.Projectiles.Melee
{
public class NeptunesBountyProjectile : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Melee";
public override string Texture => "CalamityMod/Items/Weapons/Melee/NeptunesBounty";
public int Time = 0;
public int ChargeupTime = 25;
public int Lifetime = 300;
public int startDamage;
public bool setDamage = false;
public int dustType1 = 103;
public int dustType2 = 172;
public bool spinMode = false; // Initial spinning
public bool spinMode2 = false; // After [thing] happens spin effect
public Vector2 NPCDestination = new Vector2(0, 0);
public float OverallProgress => 1 - Projectile.timeLeft / (float)Lifetime;
public float ThrowProgress => 1 - Projectile.timeLeft / (float)(Lifetime);
public float ChargeProgress => 1 - (Projectile.timeLeft - Lifetime) / (float)(ChargeupTime);
public Player Owner => Main.player[Projectile.owner];
public SlotId SpinSoundSlot;
public override void SetStaticDefaults()
{
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20;
ProjectileID.Sets.TrailingMode[Projectile.type] = 2;
}
public override void SetDefaults()
{
Projectile.width = 135;
Projectile.height = 135;
Projectile.friendly = true;
Projectile.tileCollide = false;
Projectile.penetrate = -1;
Projectile.timeLeft = Lifetime + ChargeupTime;
Projectile.DamageType = DamageClass.Melee;
Projectile.ignoreWater = true;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 9;
}
public override bool ShouldUpdatePosition()
{
return ChargeProgress >= 1;
}
public override bool? CanDamage()
{
//We don't want the anticipation to deal damage.
if (ChargeProgress < 1)
return false;
return base.CanDamage();
}
//Swing animation keys
public CurveSegment pullback = new CurveSegment(EasingType.PolyOut, 0f, 0f, MathHelper.PiOver4 * -1.2f, 2);
public CurveSegment throwout = new CurveSegment(EasingType.PolyOut, 0.7f, MathHelper.PiOver4 * -1.2f, MathHelper.PiOver4 * 1.2f + MathHelper.PiOver2, 3);
internal float ArmAnticipationMovement() => PiecewiseAnimation(ChargeProgress, new CurveSegment[] { pullback, throwout });
public override void AI()
{
if (SoundEngine.TryGetActiveSound(SpinSoundSlot, out var SpinSound) && SpinSound.IsPlaying)
SpinSound.Position = Projectile.Center;
float playerDist = Vector2.Distance(Owner.Center, Projectile.Center);
Time++;
Projectile.spriteDirection = Projectile.direction;
Vector3 Light = spinMode2 ? new Vector3(0.200f, 0.200f, 0.255f) : new Vector3(0.070f, 0.070f, 0.250f);
Lighting.AddLight(Projectile.Center, Light * 4);
//Anticipation animation. Make the player look like theyre holding the depth crusher
if (ChargeProgress < 1)
{
Owner.ChangeDir(MathF.Sign(Main.MouseWorld.X - Owner.Center.X));
float armRotation = ArmAnticipationMovement() * Owner.direction;
Owner.heldProj = Projectile.whoAmI;
Projectile.spriteDirection = Owner.direction;
Projectile.direction = Owner.direction;
Projectile.Center = Owner.MountedCenter + Vector2.UnitY.RotatedBy(armRotation * Owner.gravDir) * -90f * Owner.gravDir + new Vector2(Owner.direction == 1 ? 10 : 3, 0);
Projectile.rotation = (-MathHelper.PiOver4 * Projectile.direction + armRotation) * Owner.gravDir;
Owner.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, MathHelper.Pi + armRotation);
return;
}
//Play the throw sound when the throw ACTUALLY BEGINS.
//Additionally, make the projectile collide and set its speed and velocity
if (Projectile.timeLeft == Lifetime)
{
Projectile.netUpdate = true;
SoundEngine.PlaySound(SoundID.Item1, Projectile.Center);
Projectile.Center = Owner.MountedCenter + Projectile.velocity * 12f;
Projectile.velocity = (Main.MouseWorld - Owner.Center).SafeNormalize(Vector2.UnitX * Owner.direction) * 28;
startDamage = Projectile.damage;
Projectile.spriteDirection = Projectile.direction;
SpinSoundSlot = SoundEngine.PlaySound(NeptunesBounty.SpinSound, Projectile.Center);
Time = 0;
spinMode = true;
}
if (Projectile.velocity.X > 0)
Projectile.direction = 1;
else
Projectile.direction = -1;
if (Time >= 75 && !spinMode2 && Projectile.velocity.Y >= 22)
{
Projectile.extraUpdates = 3;
SoundEngine.PlaySound(new("CalamityMod/Sounds/Item/VividClarityBeamAppear") { Volume = 0.65f, PitchVariance = 0.3f }, Projectile.Center);
SoundEngine.PlaySound(SoundID.ShimmerWeak1 with { Pitch = 0.15f }, Projectile.Center);
Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.Aqua, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0.01f, 0.9f, 22);
GeneralParticleHandler.SpawnParticle(pulse);
Particle pulse2 = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.DodgerBlue, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0.01f, 0.83f, 15);
GeneralParticleHandler.SpawnParticle(pulse2);
Projectile.damage = startDamage;
Time = 0;
bool foundTarget = false;
for (int i = 0; i < Main.maxNPCs; i++)
{
if (Main.npc[i].CanBeChasedBy(Projectile.GetSource_FromThis(), false))
NPCDestination = Main.npc[i].Center + Main.npc[i].velocity * 5f;
if (NPCDestination == new Vector2(0, 0))
foundTarget = false;
else
foundTarget = true;
}
if (!foundTarget)
{
Projectile.velocity = (-Projectile.velocity).SafeNormalize(Vector2.UnitX * Projectile.direction) * 25;
}
else
{
Projectile.velocity = (NPCDestination - Projectile.Center).SafeNormalize(Vector2.UnitX * Projectile.direction) * 25;
}
SpinSound?.Stop();
spinMode2 = true;
}
if (spinMode)
{
if (!spinMode2)
{
if (Projectile.velocity.Y < 22)
Projectile.velocity.Y += 0.42f;
if (Projectile.velocity.Y > 0)
Projectile.velocity.X *= 0.975f;
Vector2 particlePosition = Projectile.Center + new Vector2(13.5f * Projectile.direction, 0) + Projectile.velocity * 0.5f;
if (Time % 3 == 0)
{
Particle Smear = new CircularSmearVFX(particlePosition, Color.DeepSkyBlue * Main.rand.NextFloat(0.78f, 0.85f), Main.rand.NextFloat(-8, 8), Main.rand.NextFloat(1.2f, 1.3f));
GeneralParticleHandler.SpawnParticle(Smear);
}
if (playerDist < 1400f)
{
for (int i = 0; i < 2; i++)
{
Vector2 linePos = Projectile.Center + (i * MathHelper.Pi + Projectile.rotation + MathHelper.PiOver2).ToRotationVector2() * 75f;
SparkleParticle spark = new SparkleParticle(linePos, (i * MathHelper.Pi + Projectile.rotation * Math.Sign(Projectile.velocity.X)).ToRotationVector2() * Main.rand.NextFloat(5f, 12f), Color.DodgerBlue * 0.35f, Color.DarkBlue * 0.75f, Main.rand.NextFloat(0.15f, 0.4f), Main.rand.Next(7, 16), Main.rand.NextFloat(-8, 8), 0.2f, false);
GeneralParticleHandler.SpawnParticle(spark);
}
}
if (Time % 7 == 0)
{
Vector2 velDirection = new Vector2(80, 80).RotatedByRandom(100);
Vector2 location = Projectile.Center + velDirection;
Vector2 velocity;
bool foundTarget = false;
for (int i = 0; i < Main.maxNPCs; i++)
{
if (Main.npc[i].CanBeChasedBy(Projectile.GetSource_FromThis(), false))
NPCDestination = Main.npc[i].Center + Main.npc[i].velocity * 5f;
if (NPCDestination == new Vector2(0, 0))
foundTarget = false;
else
foundTarget = true;
}
if (!foundTarget)
{
velocity = velDirection.SafeNormalize(Vector2.UnitX * Projectile.direction) * 25;
}
else
{
velocity = (NPCDestination - location).SafeNormalize(Vector2.UnitX * Projectile.direction) * 25;
}
Projectile.NewProjectile(Projectile.GetSource_FromThis(), location, velocity, ModContent.ProjectileType<NeptunesBountySplitProjectile>(), startDamage / 5, Projectile.knockBack / 4, Projectile.owner);
}
}
else
{
if (Time == 1)
SpinSoundSlot = SoundEngine.PlaySound(NeptunesBounty.SpinSound with { Pitch = 0.2f }, Projectile.Center);
Vector2 particlePosition2 = Projectile.Center + new Vector2(13.5f * Projectile.direction, 0) + Projectile.velocity * 0.5f;
if (Time % 2 == 0)
{
Particle Smear2 = new CircularSmearVFX(particlePosition2, Color.Aqua * Main.rand.NextFloat(0.78f, 0.85f), Main.rand.NextFloat(-8, 8), Main.rand.NextFloat(1.2f, 1.3f));
GeneralParticleHandler.SpawnParticle(Smear2);
}
if (playerDist < 1400f)
{
for (int i = 0; i < 2; i++)
{
Vector2 linePos = Projectile.Center + (i * MathHelper.Pi + Projectile.rotation + MathHelper.PiOver2).ToRotationVector2() * 75f;
SparkleParticle spark = new SparkleParticle(linePos, (i * MathHelper.Pi + Projectile.rotation * Math.Sign(Projectile.velocity.X)).ToRotationVector2() * Main.rand.NextFloat(5f, 12f), Color.Aqua * 0.35f, Color.DodgerBlue * 0.75f, Main.rand.NextFloat(0.15f, 0.4f), Main.rand.Next(7, 16), Main.rand.NextFloat(-8, 8), 0.2f, false);
GeneralParticleHandler.SpawnParticle(spark);
}
}
}
Projectile.spriteDirection = Projectile.direction;
Projectile.rotation += (0.9f * (MathF.Abs(Projectile.velocity.Y) * 0.03f + 0.85f)) * Projectile.direction;
}
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<CrushDepth>(), 300);
SoundStyle HitSound = new("CalamityMod/Sounds/Item/SarosDiskThrow", 3) { Volume = 0.55f, Pitch = -0.8f };
if (spinMode2)
{
for (int i = 0; i < 4; i++)
{
AltSparkParticle spark = new AltSparkParticle(target.Center, (Projectile.velocity * 0.1f) * (i + 1), false, 15, 4f - i * 0.35f, Color.Aqua * 0.25f);
GeneralParticleHandler.SpawnParticle(spark);
}
for (int i = 0; i < 4; i++)
{
AltSparkParticle spark = new AltSparkParticle(target.Center, (-Projectile.velocity * 0.15f) * (i + 1), false, 15, 4f - i * 0.6f, Color.Aqua * 0.25f);
GeneralParticleHandler.SpawnParticle(spark);
}
for (int i = 0; i <= 20; i++)
{
Dust dust = Dust.NewDustPerfect(target.Center + Main.rand.NextVector2Circular(9, 9), Main.rand.NextBool() ? 307 : 180, Projectile.velocity * Main.rand.NextFloat(0.1f, 1.2f), 0, default, Main.rand.NextFloat(0.9f, 1.45f));
dust.noGravity = true;
Dust dust2 = Dust.NewDustPerfect(target.Center + Main.rand.NextVector2Circular(9, 9), Main.rand.NextBool() ? 307 : 180, -Projectile.velocity * Main.rand.NextFloat(0.1f, 1.2f), 0, default, Main.rand.NextFloat(0.9f, 1.45f));
dust2.noGravity = true;
}
SoundEngine.PlaySound(HitSound, Projectile.Center);
SoundEngine.PlaySound(new("CalamityMod/Sounds/Custom/SwiftSlice") { Volume = 0.65f, Pitch = -0.5f }, Projectile.Center);
}
}
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
{
if (Projectile.numHits > 0)
Projectile.damage = (int)(Projectile.damage * 0.93f);
if (Projectile.damage < 1)
Projectile.damage = 1;
}
public override void OnKill(int timeLeft)
{
if (SoundEngine.TryGetActiveSound(SpinSoundSlot, out var SpinSound))
SpinSound?.Stop();
for (int i = 0; i < 40; i++)
{
float dustMulti = Main.rand.NextFloat(0.3f, 1.5f);
Vector2 dustPos = Projectile.Center;
Dust dust = Dust.NewDustPerfect(dustPos, Main.rand.NextBool(3) ? dustType1 : dustType2);
dust.noGravity = true;
dust.scale = Main.rand.NextFloat(1.6f, 2.5f) - dustMulti;
dust.velocity = new Vector2(5, 5).RotatedByRandom(100) * Main.rand.NextFloat(0.3f, 1f) * dustMulti;
}
}
public override bool PreDraw(ref Color lightColor)
{
if (spinMode2)
{
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.Aqua * 0.6f, 1);
}
return true;
}
}
}
@@ -0,0 +1,84 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.NPCs.SupremeCalamitas;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Healing;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Melee
{
public class NeptunesBountySplitProjectile : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Melee";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public int Time = 0;
public int randTimer;
public int dustType1 = 80;
public int dustType2 = 172;
public int spreadDust = 0;
public Color WaterColor = Main.rand.NextBool() ? Color.DodgerBlue : Color.DeepSkyBlue;
public Player Owner => Main.player[Projectile.owner];
public override void SetDefaults()
{
Projectile.width = 20;
Projectile.height = 20;
Projectile.friendly = true;
Projectile.DamageType = DamageClass.Melee;
Projectile.tileCollide = false;
Projectile.penetrate = -1;
Projectile.timeLeft = 85;
Projectile.ignoreWater = true;
Projectile.extraUpdates = 1;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = -1;
}
public override void AI()
{
float playerDist = Vector2.Distance(Owner.Center, Projectile.Center);
Time++;
Projectile.velocity *= 0.98f;
if (Projectile.timeLeft % 2 == 0 && Time > 3f && playerDist < 1400f)
{
Color smokeColor = Color.RoyalBlue;
Particle smoke = new HeavySmokeParticle(Projectile.Center - Projectile.velocity, Projectile.velocity * Main.rand.NextFloat(-0.2f, -0.6f), smokeColor * 0.65f, 15, Main.rand.NextFloat(0.4f, 0.55f), 0.3f, Main.rand.NextFloat(-0.2f, 0.2f), false, required: true);
GeneralParticleHandler.SpawnParticle(smoke);
}
Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(3 + spreadDust, 3 + spreadDust), Main.rand.NextBool(3) ? dustType1 : dustType2, -Projectile.velocity * Main.rand.NextFloat(0.05f, 0.65f), 0, default, Main.rand.NextFloat(0.4f, 1.2f) + Time * 0.009f);
dust.noGravity = true;
if (dust.type == dustType1)
dust.alpha = 180;
if (Projectile.timeLeft == 20)
{
WaterFlavoredParticle spark = new WaterFlavoredParticle(Projectile.Center, -Projectile.velocity * 0.05f, false, 25, 0.85f + Time * 0.013f, WaterColor * 0.35f);
GeneralParticleHandler.SpawnParticle(spark);
}
else if (Projectile.timeLeft > 20)
{
WaterFlavoredParticle spark = new WaterFlavoredParticle(Projectile.Center, -Projectile.velocity * 0.05f, false, 2, 0.85f + Time * 0.013f, WaterColor * 0.35f);
GeneralParticleHandler.SpawnParticle(spark);
}
if (Projectile.timeLeft < 20)
{
Time -= 5;
spreadDust += 2;
}
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<CrushDepth>(), 240);
SoundEngine.PlaySound(SoundID.ShimmerWeak1 with { Pitch = 0.35f }, Projectile.Center);
}
}
}