Stellar Striker Updates

Now summons lunar flares on hit

The sound of the "gong" goes up in pitch from the first to the 5th hit before the big hammer.

Big hammer now has a bit of screenshake

Other small edits to damage and dust
This commit is contained in:
Xyk committed 2023-07-18 13:19:13 -07:00
1 parent 1d2fc032a4
commit 163c192d33
4 files changed
+66 -16

No files matched your search

+3 -3
View File
@@ -1,6 +1,7 @@
using CalamityMod.Projectiles.Melee;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Items.Materials;
namespace CalamityMod.Items.Weapons.Melee
{
@@ -8,7 +9,7 @@ namespace CalamityMod.Items.Weapons.Melee
public class StellarContempt : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Melee";
public static int BaseDamage = 800;
public static int BaseDamage = 678;
public static float Speed = 25f;
public override void SetDefaults()
@@ -39,8 +40,7 @@ namespace CalamityMod.Items.Weapons.Melee
CreateRecipe().
AddIngredient<FallenPaladinsHammer>().
AddIngredient(ItemID.LunarBar, 5).
AddIngredient(ItemID.FragmentSolar, 10).
AddIngredient(ItemID.FragmentNebula, 10).
AddIngredient<GalacticaSingularity>(5).
AddTile(TileID.LunarCraftingStation).
Register();
}
@@ -1018,7 +1018,8 @@ StellarContempt: {
DisplayName: Stellar Contempt
Tooltip:
'''
Throws a heavy, gravity-affected hammer that will return to you after striking an enemy
Throws a heavy, gravity-affected hammer that summons lunar flares upon hitting an enemy
After striking an enemy the hammer will return to you
Every fifth hit, the hammer will charge with lunar energy and eviscerate whatever it hits
'''
}
+5 -4
View File
@@ -108,6 +108,7 @@ namespace CalamityMod.Projectiles.Melee
{
Player player = Main.player[Projectile.owner];
//This is what we call fucking IMPACT.
Main.player[Projectile.owner].Calamity().GeneralScreenShakePower = 7;
SoundEngine.PlaySound(SlamHamSound, Projectile.Center);
float numberOfDusts = 156f;
@@ -129,14 +130,14 @@ namespace CalamityMod.Projectiles.Melee
switch (Main.rand.Next(6))
{
case 0:
dustID = 156;
dustID = 229;
break;
case 1:
case 2:
dustID = 229;
dustID = 156;
break;
default:
dustID = 229;
dustID = 156;
break;
}
@@ -156,7 +157,7 @@ namespace CalamityMod.Projectiles.Melee
Main.dust[idx].position = Projectile.Center;
}
float distance = 272f;
float distance = 336f;
for (int k = 0; k < Main.maxNPCs; k++)
{
+56 -8
View File
@@ -14,8 +14,7 @@ namespace CalamityMod.Projectiles.Melee
{
public new string LocalizationCategory => "Projectiles.Melee";
public override string Texture => "CalamityMod/Items/Weapons/Melee/StellarContempt";
public static readonly SoundStyle UseSound = new("CalamityMod/Sounds/Item/PwnagehammerSound") { Volume = 0.35f, PitchVariance = 0.3f };
public static readonly SoundStyle HomingSound = new("CalamityMod/Sounds/Item/PwnagehammerHoming") { Volume = 0.3f, PitchVariance = 0.3f };
public static readonly SoundStyle UseSound = new("CalamityMod/Sounds/Item/PwnagehammerSound") { Volume = 0.35f};
public static readonly SoundStyle RedHamSound = new("CalamityMod/Sounds/Item/StellarContemptClone") { Volume = 1f};
private static float StartDustQuantity = 26f;
public ref int EmpoweredHammer => ref Main.player[Projectile.owner].Calamity().StellarHammer;
@@ -44,7 +43,7 @@ namespace CalamityMod.Projectiles.Melee
public override void AI()
{
//returnhammer determines if the hammer is slowing down after hitting an enemy, or homing in o0n the player.
//returnhammer determines if the hammer is slowing down after hitting an enemy, or homing in on the player.
Player player = Main.player[Projectile.owner];
Projectile.direction = Projectile.spriteDirection = Projectile.velocity.X > 0f ? 1 : -1;
Projectile.rotation += MathHelper.ToRadians(rotatehammer) * Projectile.direction;
@@ -70,14 +69,14 @@ namespace CalamityMod.Projectiles.Melee
switch (Main.rand.Next(6))
{
case 0:
dustID = 156;
dustID = 229;
break;
case 1:
case 2:
dustID = 229;
dustID = 156;
break;
default:
dustID = 229;
dustID = 156;
break;
}
@@ -192,7 +191,7 @@ namespace CalamityMod.Projectiles.Melee
Projectile.velocity *= 0f;
SoundEngine.PlaySound(RedHamSound, Projectile.Center);
int hammer = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity, ModContent.ProjectileType<StellarContemptEcho>(), Projectile.damage * 5, Projectile.knockBack * 1.5f, Projectile.owner, 0f, Projectile.ai[1]);
int hammer = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity, ModContent.ProjectileType<StellarContemptEcho>(), Projectile.damage * 6, Projectile.knockBack * 1.5f, Projectile.owner, 0f, Projectile.ai[1]);
Main.projectile[hammer].localAI[0] = Math.Sign(Projectile.velocity.X);
Main.projectile[hammer].netUpdate = true;
EmpoweredHammer = 0;
@@ -223,12 +222,16 @@ namespace CalamityMod.Projectiles.Melee
Player player = Main.player[Projectile.owner];
if (returnhammer == 0)
{
SoundEngine.PlaySound(UseSound, Projectile.Center);
SoundEngine.PlaySound(UseSound with { Pitch = EmpoweredHammer * 0.1f - 0.1f }, Projectile.Center);
if (EmpoweredHammer == 4)
{
Projectile.velocity.Y *= 0f;
Projectile.velocity.X *= 0f;
}
else
{
SpawnFlares(target.Center, target.width, target.height);
}
returnhammer = 1;
}
float numberOfDusts = 40f;
@@ -253,6 +256,51 @@ namespace CalamityMod.Projectiles.Melee
if (Projectile.damage < 1)
Projectile.damage = 1;
}
private void SpawnFlares(Vector2 targetPos, int width, int height)
{
// Play the Lunar Flare sound centered on the user, not the target (consistent with Lunar Flare and Stellar Striker)
Player user = Main.player[Projectile.owner];
SoundEngine.PlaySound(SoundID.Item88, Projectile.position);
Projectile.netUpdate = true;
int numFlares = EmpoweredHammer + 1;
int flareDamage = (int)(0.1f * Projectile.damage);
float flareKB = 4f;
for (int i = 0; i < numFlares; ++i)
{
float flareSpeed = Main.rand.NextFloat(9f, 13f);
// Flares never come from straight up, there is always at least an 80 pixel horizontal offset
float xDist = Main.rand.NextFloat(80f, 320f) * (Main.rand.NextBool() ? -1f : 1f);
float yDist = Main.rand.NextFloat(1200f, 1440f);
Vector2 startPoint = targetPos + new Vector2(xDist, -yDist);
// The flare is somewhat inaccurate based on the size of the target.
float xVariance = width / 4f;
if (xVariance < 8f)
xVariance = 8f;
float yVariance = height / 4f;
if (yVariance < 8f)
yVariance = 8f;
float xOffset = Main.rand.NextFloat(-xVariance, xVariance);
float yOffset = Main.rand.NextFloat(-yVariance, yVariance);
Vector2 offsetTarget = targetPos + new Vector2(xOffset, yOffset);
// Finalize the velocity vector and make sure it's going at the right speed.
Vector2 velocity = offsetTarget - startPoint;
velocity.Normalize();
velocity *= flareSpeed;
float AI1 = Main.rand.Next(3);
if (Projectile.owner == Main.myPlayer)
{
int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), startPoint, velocity, ProjectileID.LunarFlare, flareDamage, flareKB, Main.myPlayer, 0f, AI1);
if (proj.WithinBounds(Main.maxProjectiles))
Main.projectile[proj].DamageType = DamageClass.MeleeNoSpeed;
}
}
}
public override bool PreDraw(ref Color lightColor)
{