Rocket and Mag, visual adjustments

This commit is contained in:
mochi-angel committed 2024-11-13 15:23:04 -08:00
1 parent 4180c56f95
commit 83bcc320a8
5 files changed
+25 -17

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 B

+9 -2
View File
@@ -44,6 +44,12 @@ namespace CalamityMod.Projectiles.Ranged
{
Player Owner = Main.player[Projectile.owner];
SoundEngine.PlaySound(SoundID.Item149, Projectile.Center);
if (Main.netMode != NetmodeID.Server)
{
string goreType = "MegalodonMag";
Gore.NewGore(Projectile.GetSource_FromAI(), Projectile.Center + (-Projectile.velocity * 9), Projectile.velocity.RotatedBy(2f * -Owner.direction) * Main.rand.NextFloat(0.6f, 0.7f), Mod.Find<ModGore>(goreType).Type);
}
//Set the scaling to 0 whenever it reloads
Owner.Calamity().sharkGunDamageScaling = 0;
}
if (Time >= 90)
@@ -104,7 +110,8 @@ namespace CalamityMod.Projectiles.Ranged
if (framesBetweenShots == 0)
{
Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * 30;
//If the player hasn't hit any shots, increase the multiplier from 0 to 1 to avoid the rocket doing 0 damage
//Debug Text
//Main.NewText(Owner.Calamity().sharkGunDamageScaling);
#region Visuals and Sounds
SoundStyle fire = new("CalamityMod/Sounds/Item/GunShotHeavy");
SoundEngine.PlaySound(fire with { Volume = 0.6f, Pitch = 0.2f }, Projectile.Center);
@@ -137,13 +144,13 @@ namespace CalamityMod.Projectiles.Ranged
}
#endregion
//If the player hasn't hit any shots, increase the multiplier from 0 to 1 to avoid the rocket doing 0 damage
if (Owner.Calamity().sharkGunDamageScaling == 0)
{
Owner.Calamity().sharkGunDamageScaling++;
}
//Fire the rocket. Damage is 50% of base, multiplied by how many shots the player hits
Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity, ModContent.ProjectileType<MegalodonRocket>(), (int)(Projectile.damage * 0.5f) * Owner.Calamity().sharkGunDamageScaling, Projectile.knockBack, Projectile.owner);
Main.NewText(Owner.Calamity().sharkGunDamageScaling);
//After firing the rocket, kill the projectile to allow left click to be held down
Projectile.Kill();
+15 -14
View File
@@ -14,8 +14,6 @@ namespace CalamityMod.Projectiles.Ranged
public class MegalodonRocket : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Ranged";
public override string Texture => "CalamityMod/Projectiles/Ranged/FishronRPG";
public static int Lifetime = 600;
public override void SetStaticDefaults()
{
@@ -26,8 +24,8 @@ namespace CalamityMod.Projectiles.Ranged
public override void SetDefaults()
{
Projectile.width = 14;
Projectile.height = 14;
Projectile.width = 46;
Projectile.height = 38;
Projectile.aiStyle = ProjAIStyleID.Arrow;
Projectile.friendly = true;
Projectile.DamageType = DamageClass.Ranged;
@@ -39,6 +37,10 @@ namespace CalamityMod.Projectiles.Ranged
public override void AI()
{
//Rotation
Projectile.spriteDirection = Projectile.direction = (Projectile.velocity.X > 0).ToDirectionInt();
Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == 1 ? 0f : MathHelper.Pi) * Projectile.direction;
Lighting.AddLight(Projectile.Center, 0.3f, 0.5f, 0.1f);
if (Projectile.timeLeft <= Lifetime - 6)
{
@@ -49,15 +51,14 @@ namespace CalamityMod.Projectiles.Ranged
SparkParticle spark2 = new SparkParticle(Projectile.Center + Main.rand.NextVector2Circular(15, 15) - Projectile.velocity.SafeNormalize(Vector2.UnitX) * 10, -Projectile.velocity * Main.rand.NextFloat(0.5f, 1.5f), false, Main.rand.Next(9, 12 + 1), 0.4f, Color.OrangeRed);
GeneralParticleHandler.SpawnParticle(spark2);
}
int smokyFire2 = Dust.NewDust(Projectile.Center, Projectile.width, Projectile.height, DustID.Smoke, 0f, 0f, 100, default, 0.5f);
Main.dust[smokyFire2].scale = 0.1f + (float)Main.rand.Next(5) * 0.1f;
Main.dust[smokyFire2].fadeIn = 1.5f + (float)Main.rand.Next(5) * 0.1f;
Main.dust[smokyFire2].noGravity = true;
Main.dust[smokyFire2].position = Projectile.Center + new Vector2(0f, (float)(-(float)Projectile.height / 2)).RotatedBy((double)Projectile.rotation, default) * 1.1f;
smokyFire2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Torch, 0f, 0f, 100, default, 1f);
Main.dust[smokyFire2].scale = 1f + (float)Main.rand.Next(5) * 0.1f;
Main.dust[smokyFire2].noGravity = true;
Main.dust[smokyFire2].position = Projectile.Center + new Vector2(0f, (float)(-(float)Projectile.height / 2 - 6)).RotatedBy((double)Projectile.rotation, default) * 1.1f;
Dust dust = Dust.NewDustPerfect(Projectile.Center, DustID.Torch, Projectile.velocity, 500, default, 0.5f);
dust.scale = Main.rand.NextFloat(0.7f, 1.5f);
dust.velocity = Projectile.velocity * Main.rand.NextFloat(-3, 3);
dust.noGravity = true;
Dust dust2 = Dust.NewDustPerfect(Projectile.Center, DustID.Smoke, Projectile.velocity, 500, default, 0.5f);
dust2.scale = Main.rand.NextFloat(0.7f, 1.5f);
dust2.velocity = Projectile.velocity * Main.rand.NextFloat(-3, 3);
dust2.noGravity = true;
}
CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 450f, 12f, 20f);
}
@@ -90,7 +91,7 @@ namespace CalamityMod.Projectiles.Ranged
GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, Color.Blue, "CalamityMod/Particles/LargeBloom", Vector2.One, 0f, 1f, 0f, 25));
GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/LargeBloom", Vector2.One, 0f, 0.5f, 0f, 15));
for (int i = 0; i < 8; i++) GeneralParticleHandler.SpawnParticle(new BloodParticle2(Projectile.Center, new Vector2(Main.rand.NextFloat(6, 12), 0).RotatedBy(Main.rand.NextFloat(MathHelper.TwoPi)), 12, Main.rand.NextFloat(0.3f, 0.4f), Color.DodgerBlue));
for (int i = 0; i < 8; i++) GeneralParticleHandler.SpawnParticle(new BloodParticle2(Projectile.Center, new Vector2(Main.rand.NextFloat(6, 12), 0).RotatedBy(Main.rand.NextFloat(MathHelper.TwoPi)), 12, Main.rand.NextFloat(0.3f, 0.4f), Color.DarkGoldenrod * 0.8f));
Particle pulse = new CustomPulse(Projectile.Center, Vector2.Zero, Color.RoyalBlue * 0.5f, "CalamityMod/Particles/FlameExplosion", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 0.1f, 15);
GeneralParticleHandler.SpawnParticle(pulse);
Particle pulse2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.CornflowerBlue, "CalamityMod/Particles/FlameExplosion2", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 0.07f, 15);
Binary file not shown.

After

Width:  |  Height:  |  Size: 1004 B

+1 -1
View File
@@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Ranged
if (Main.rand.NextBool(3))
{
Color smokeColor = Color.MediumBlue;
Particle smoke = new HeavySmokeParticle(Projectile.Center, Projectile.velocity * Main.rand.NextFloat(-0.2f, -0.6f), smokeColor, 30, Main.rand.NextFloat(0.6f, 0.8f), 0.3f, Main.rand.NextFloat(-0.2f, 0.2f), false, required: true);
Particle smoke = new HeavySmokeParticle(Projectile.Center, Projectile.velocity * Main.rand.NextFloat(-0.2f, -0.6f), smokeColor, 30, Main.rand.NextFloat(0.5f, 0.7f), 0.3f, Main.rand.NextFloat(-0.2f, 0.2f), false, required: true);
GeneralParticleHandler.SpawnParticle(smoke);
}
}