Hammers Circular hitbox and crit fix

Fixed the strange crit properties of the hammer line and gave all the explosions circular hitboxes.
Also gave Pwnagehammer the GFB big hit sound because I forgot before.
This commit is contained in:
Xyk committed 2023-07-27 23:31:48 -07:00
1 parent 2d671f939b
commit 92ebab0bb3
9 files changed
+118 -78

No files matched your search

@@ -30,7 +30,7 @@ TropicalAttunement: {
EvilAttunement: {
Name: Decay's Retort
Function:
Function:
'''
Lunge forward using a ghostly rapier projection that leeches life on enemy hits
You will bounce away from struck targets
@@ -359,3 +359,5 @@ PwnagehammerExplosionSmall.DisplayName: Pwnage Blast
PwnagehammerExplosionBig.DisplayName: Pwnage Blast
GalaxySmasherMini.DisplayName: Galaxy Smasher
GalaxySmasherEcho.DisplayName: Galaxy Smasher Echo
StellarContemptBlast.DisplayName: Stellar Blast
GalaxySmasherBlast.DisplayName: Galactic Blast
+3 -2
View File
@@ -14,7 +14,8 @@ namespace CalamityMod.Projectiles.Melee
{
public new string LocalizationCategory => "Projectiles.Melee";
public override void SetStaticDefaults() => Main.projFrames[Type] = 8;
private static float ExplosionRadius = 236f;
public override void SetDefaults()
{
Projectile.width = 472;
@@ -38,7 +39,7 @@ namespace CalamityMod.Projectiles.Melee
Projectile.Kill();
}
public override bool? CanDamage() => false;
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, ExplosionRadius, targetHitbox);
}
}
+1 -14
View File
@@ -107,22 +107,9 @@ namespace CalamityMod.Projectiles.Melee
else
SoundEngine.PlaySound(SlamHamSound, Projectile.Center);
Main.player[Projectile.owner].Calamity().GeneralScreenShakePower = 5;
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType<FallenBlast>(), Projectile.damage, Projectile.knockBack, Projectile.owner);
float distance = 248f;
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 0f, ModContent.ProjectileType<FallenBlast>(), Projectile.damage / 2, Projectile.knockBack, Projectile.owner, 0f);
for (int k = 0; k < Main.maxNPCs; k++)
{
NPC npc = Main.npc[k];
Vector2 vec = npc.Center - Projectile.Center;
float distanceTo = (float)Math.Sqrt(vec.X * vec.X + vec.Y * vec.Y);
if (distanceTo < distance && npc.CanBeChasedBy(Projectile, false) && k != Projectile.localAI[0])
{
float alldamage = Projectile.damage * 0.5f;
double damage = npc.StrikeNPC(npc.CalculateHitInfo((int)alldamage, Projectile.velocity.X > 0f ? 1 : -1, true, Projectile.knockBack));
player.addDPS((int)damage);
}
}
return false;
}
+35
View File
@@ -0,0 +1,35 @@
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Melee
{
public class GalaxySmasherBlast : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Melee";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public Player Owner => Main.player[Projectile.owner];
private static float ExplosionRadius = 568f;
public override void SetDefaults()
{
//These shouldn't matter because its circular
Projectile.width = 568;
Projectile.height = 568;
Projectile.friendly = true;
Projectile.DamageType = DamageClass.MeleeNoSpeed;
Projectile.ignoreWater = true;
Projectile.tileCollide = false;
Projectile.penetrate = -1;
Projectile.timeLeft = 2;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 10;
}
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, ExplosionRadius, targetHitbox);
}
}
+1 -13
View File
@@ -133,20 +133,8 @@ namespace CalamityMod.Projectiles.Melee
Particle pulse2 = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.Aqua, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0.1f, 1.5f, 11);
GeneralParticleHandler.SpawnParticle(pulse2);
float distance = 568f;
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 0f, ModContent.ProjectileType<GalaxySmasherBlast>(), Projectile.damage / 2, Projectile.knockBack, Projectile.owner, 0f);
for (int k = 0; k < Main.maxNPCs; k++)
{
NPC npc = Main.npc[k];
Vector2 vec = npc.Center - Projectile.Center;
float distanceTo = (float)Math.Sqrt(vec.X * vec.X + vec.Y * vec.Y);
if (distanceTo < distance && npc.CanBeChasedBy(Projectile, false) && k != Projectile.localAI[0])
{
float alldamage = Projectile.damage * 0.5f;
double damage = npc.StrikeNPC(npc.CalculateHitInfo((int)alldamage, Projectile.velocity.X > 0f ? 1 : -1, true, Projectile.knockBack));
player.addDPS((int)damage);
}
}
return false;
}
+6 -2
View File
@@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Melee
{
public new string LocalizationCategory => "Projectiles.Melee";
public static readonly SoundStyle BigSound = new("CalamityMod/Sounds/Item/PwnagehammerBigImpact");
public static readonly SoundStyle SlamHamSound = new("CalamityMod/Sounds/Item/TF2PanHit") { Volume = 1.1f };
public static readonly SoundStyle Kunk = new("CalamityMod/Sounds/Item/TF2PanHit") { Volume = 1.1f };
public int Explodamage = 0;
public override void SetStaticDefaults()
{
@@ -115,7 +115,11 @@ namespace CalamityMod.Projectiles.Melee
Main.dust[dust].scale = 3f;
}
SoundEngine.PlaySound(BigSound, Projectile.Center);
if (Main.zenithWorld)
SoundEngine.PlaySound(Kunk, Projectile.Center);
else
SoundEngine.PlaySound(BigSound, Projectile.Center);
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 0f, ModContent.ProjectileType<PwnagehammerExplosionBig>(), Projectile.damage / 2, Projectile.knockBack, Projectile.owner, 0f);
+35
View File
@@ -0,0 +1,35 @@
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Melee
{
public class StellarContemptBlast : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Melee";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public Player Owner => Main.player[Projectile.owner];
private static float ExplosionRadius = 336f;
public override void SetDefaults()
{
//These shouldn't matter because its circular
Projectile.width = 336;
Projectile.height = 336;
Projectile.friendly = true;
Projectile.DamageType = DamageClass.MeleeNoSpeed;
Projectile.ignoreWater = true;
Projectile.tileCollide = false;
Projectile.penetrate = -1;
Projectile.timeLeft = 2;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 10;
}
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, ExplosionRadius, targetHitbox);
}
}
+34 -46
View File
@@ -128,54 +128,42 @@ namespace CalamityMod.Projectiles.Melee
Main.dust[dust].velocity = velOffset;
Main.dust[dust].scale = 3.8f;
}
for (int i = 0; i < 88; ++i)
{
// Pick a random type of dust
int dustID;
switch (Main.rand.Next(6))
{
case 0:
dustID = 229;
break;
case 1:
case 2:
dustID = 156;
break;
default:
dustID = 156;
break;
}
// Choose a random speed and angle for the dust
float dustSpeed = Main.rand.NextFloat(6.0f, 29.0f);
float angleRandom = 0.09f;
Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(Projectile.velocity.ToRotation());
dustVel = dustVel.RotatedBy(-angleRandom);
dustVel = dustVel.RotatedByRandom(2.0f * angleRandom);
// Pick a size for the dust particle
float scale = Main.rand.NextFloat(2.2f, 4.8f);
// Actually spawn the dust
int idx = Dust.NewDust(Projectile.Center, 1, 1, dustID, dustVel.X, dustVel.Y, 0, default, scale);
Main.dust[idx].noGravity = true;
Main.dust[idx].position = Projectile.Center;
}
float distance = 336f;
for (int k = 0; k < Main.maxNPCs; k++)
{
NPC npc = Main.npc[k];
Vector2 vec = npc.Center - Projectile.Center;
float distanceTo = (float)Math.Sqrt(vec.X * vec.X + vec.Y * vec.Y);
if (distanceTo < distance && npc.CanBeChasedBy(Projectile, false) && k != Projectile.localAI[0])
for (int i = 0; i < 88; ++i)
{
float alldamage = Projectile.damage * 0.5f;
double damage = npc.StrikeNPC(npc.CalculateHitInfo((int)alldamage, Projectile.velocity.X > 0f ? 1 : -1, true, Projectile.knockBack));
player.addDPS((int)damage);
}
// Pick a random type of dust
int dustID;
switch (Main.rand.Next(6))
{
case 0:
dustID = 229;
break;
case 1:
case 2:
dustID = 156;
break;
default:
dustID = 156;
break;
}
// Choose a random speed and angle for the dust
float dustSpeed = Main.rand.NextFloat(6.0f, 29.0f);
float angleRandom = 0.09f;
Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(Projectile.velocity.ToRotation());
dustVel = dustVel.RotatedBy(-angleRandom);
dustVel = dustVel.RotatedByRandom(2.0f * angleRandom);
// Pick a size for the dust particle
float scale = Main.rand.NextFloat(2.2f, 4.8f);
// Actually spawn the dust
int idx = Dust.NewDust(Projectile.Center, 1, 1, dustID, dustVel.X, dustVel.Y, 0, default, scale);
Main.dust[idx].noGravity = true;
Main.dust[idx].position = Projectile.Center;
}
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 0f, ModContent.ProjectileType<StellarContemptBlast>(), Projectile.damage / 2, Projectile.knockBack, Projectile.owner, 0f);
return false;
}