significantly less messy

This commit is contained in:
GinYuH authored and Cameron Ewell committed 2024-09-29 15:41:07 -04:00
1 parent 1c34d0457b
commit 90c31b565f
5 files changed
+51 -24

No files matched your search

+6
View File
@@ -86,6 +86,12 @@ namespace CalamityMod.Items.Weapons.Melee
float SpeedY = velocity.Y + Main.rand.NextFloat(-spreadfactor, spreadfactor + 1);
Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, (int)(damage * 0.125f), knockback, player.whoAmI);
}
foreach (Projectile p in Main.ActiveProjectiles)
{
if (p.type == ModContent.ProjectileType<DeathsAscensionRift>() && p.owner == player.whoAmI)
p.ai[0] = 1f;
}
}
else
{
@@ -337,9 +337,10 @@ DeathsAscension: {
DisplayName: Death's Ascension
Tooltip:
'''
Performs powerful soul-infused swings that create rifts on enemy hits which spew out swirls of scythes
Up to 4 rifts can exist at once
Performs powerful soul-infused swings that create up to 4 rifts on enemy hits
Press <right> to launch a barrage of homing scythes
All active rifts will fire scythes along with you
Rift scythes orbit the rift when enemies are near and home when enemies are far
'It feels just right in your grip...
[c/660066:But the hands that wield it are not yours']
'''
@@ -50,15 +50,7 @@ namespace CalamityMod.Projectiles.Melee
}
else
{
Projectile.velocity = Projectile.velocity.SafeNormalize(Vector2.UnitY).RotatedBy(0.05f) * Projectile.velocity.Length();
Projectile.ai[2]--;
}
// Rift scythes cant pierce once when they start homing
if (Projectile.ai[2] == 1)
{
Projectile.penetrate = 1;
Projectile.localNPCHitCooldown = 1;
Projectile.velocity = Projectile.velocity.SafeNormalize(Vector2.UnitY).RotatedBy(0.1f) * 20;
}
}
+39 -11
View File
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using CalamityMod.CalPlayer;
using CalamityMod.Graphics.Metaballs;
using Microsoft.Xna.Framework;
using Mono.Cecil;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
@@ -23,9 +24,11 @@ namespace CalamityMod.Projectiles.Melee
Projectile.height = 50;
Projectile.friendly = true;
Projectile.ignoreWater = true;
Projectile.timeLeft = 600;
Projectile.timeLeft = 300;
Projectile.penetrate = -1;
Projectile.tileCollide = false;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 30;
}
public override void AI()
@@ -36,24 +39,49 @@ namespace CalamityMod.Projectiles.Melee
float offset = i * 5;
float sizeRandomness = MathHelper.Lerp(10, 0, (float)(i / (float)ballAmt));
float positionRandomness = 20;
float scale = (MathHelper.Lerp(90, 10, (float)(i / (float)ballAmt)) + Main.rand.NextFloat(-sizeRandomness, sizeRandomness)) * Utils.GetLerpValue(600, 590, Projectile.timeLeft, true); ;
float scale = (MathHelper.Lerp(90, 10, (float)(i / (float)ballAmt)) + Main.rand.NextFloat(-sizeRandomness, sizeRandomness)) * Utils.GetLerpValue(300, 290, Projectile.timeLeft, true); ;
StreamGougeMetaball.SpawnParticle(Projectile.Center + Vector2.UnitY * (offset + Main.rand.NextFloat(-positionRandomness, positionRandomness)) , Vector2.Zero, scale);
StreamGougeMetaball.SpawnParticle(Projectile.Center + Vector2.UnitY * -(offset + Main.rand.NextFloat(-positionRandomness, positionRandomness)), Vector2.Zero, scale);
}
if (Projectile.ai[0]++ % 60 == 0)
// When the weapon is swung fire scythes from the rift
if (Projectile.ai[0] >= 1)
{
SoundEngine.PlaySound(SoundID.Item104 with { Pitch = 0.4f }, Projectile.Center);
SoundEngine.PlaySound(SoundID.Item71 with { Pitch = -0.4f }, Projectile.Center);
int scytheAmt = 4;
float speed = 30;
for (int i = 0; i < scytheAmt; i++)
// If an enemy is close enough, do orbital scythes
NPC n = CalamityUtils.ClosestNPCAt(Projectile.Center, 320, true, true);
if (n != null)
{
Vector2 scytheVelocity = Vector2.UnitY.RotatedBy(MathHelper.Lerp(0, 3 * MathHelper.PiOver2, (float)(i / (float)(scytheAmt - 1))) + Projectile.ai[1]) * speed;
int revolveTime = 70;
int p = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, scytheVelocity, ModContent.ProjectileType<DeathsAscensionProjectile>(), (int)(Projectile.damage * 0.1f), Projectile.knockBack, Projectile.owner, ai2: revolveTime);
Main.projectile[p].penetrate = -1;
int scytheAmt = 4;
float speed = 30;
for (int i = 0; i < scytheAmt; i++)
{
Vector2 scytheVelocity = Vector2.UnitY.RotatedBy(MathHelper.Lerp(0, 3 * MathHelper.PiOver2, (float)(i / (float)(scytheAmt - 1))) + Projectile.ai[1]) * speed;
if (Projectile.owner == Main.myPlayer)
{
int p = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, scytheVelocity, ModContent.ProjectileType<DeathsAscensionProjectile>(), (int)(Projectile.damage * 0.125f), Projectile.knockBack, Projectile.owner, ai2: 1);
Main.projectile[p].penetrate = -1;
Main.projectile[p].timeLeft = 65;
}
}
}
// Otherwise shoot at the cursor
else
{
Vector2 direction = Projectile.Center.DirectionTo(Main.MouseWorld) * 12;
int spreadfactor = 9;
for (int index = 0; index < 4; ++index)
{
float SpeedX = direction.X + Main.rand.NextFloat(-spreadfactor, spreadfactor + 1);
float SpeedY = direction.Y + Main.rand.NextFloat(-spreadfactor, spreadfactor + 1); if (Projectile.owner == Main.myPlayer)
{
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, SpeedX, SpeedY, ModContent.ProjectileType<DeathsAscensionProjectile>(), (int)(Projectile.damage * 0.125f), Projectile.knockBack, Projectile.owner);
}
}
}
Projectile.ai[0] = 0;
}
Projectile.ai[1] += 0.1f;
+2 -2
View File
@@ -171,9 +171,9 @@ namespace CalamityMod.Projectiles.Melee
{
if (Projectile.ai[2] <= 0 && Main.player[Projectile.owner].ownedProjectileCounts[ModContent.ProjectileType<DeathsAscensionRift>()] < 4)
{
Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center + Main.rand.NextVector2Circular(48, 48), Vector2.Zero, ModContent.ProjectileType<DeathsAscensionRift>(), Projectile.damage, Projectile.knockBack, Projectile.owner);
Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center + Main.rand.NextVector2Circular(48, 48), Vector2.Zero, ModContent.ProjectileType<DeathsAscensionRift>(), Projectile.damage, Projectile.knockBack, Projectile.owner, ai1: Main.rand.NextFloat(0, 3f));
SoundEngine.PlaySound(SoundID.Item165 with { Pitch = -1 }, Projectile.Center);
Projectile.ai[2] = 20;
Projectile.ai[2] = 40;
float screenShakePower = 3 * Utils.GetLerpValue(1300f, 0f, target.Distance(Main.LocalPlayer.Center), true);
if (Main.LocalPlayer.Calamity().GeneralScreenShakePower < screenShakePower)
Main.LocalPlayer.Calamity().GeneralScreenShakePower = screenShakePower;