Void Blast visuals
This commit is contained in:
1 parent
d76140ee79
commit
d82e5d5b1f
5 files changed
+65
-78
No files matched your search
@@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
Item.width = 96;
|
||||
Item.height = 38;
|
||||
Item.damage = 1404;
|
||||
Item.damage = 2088;
|
||||
Item.DamageType = DamageClass.Ranged;
|
||||
Item.useTime = 5;
|
||||
Item.useAnimation = 5;
|
||||
|
||||
@@ -1447,9 +1447,10 @@ Voidragon: {
|
||||
Tooltip:
|
||||
'''
|
||||
Loads a 50 round magazine of bullets and concentrated void blasts
|
||||
After firing, the gun unleashes a powerful homing rocket before reloading
|
||||
Rocket damage is based on how many shots hit
|
||||
'Fade to black'
|
||||
After firing, the gun unleashes a beam of abyssal fire that erases foes from existence
|
||||
The beam grows more powerful based on the amount of shots hit
|
||||
At maximum damage, abyssal portals rotate around the user that constantly summon creatures from beyond
|
||||
'Fade to black'
|
||||
'''
|
||||
}
|
||||
|
||||
|
||||
@@ -116,13 +116,13 @@ namespace CalamityMod.Projectiles
|
||||
/// If true, adds a fire trail to the projectile, and makes it inflict Hellfire.<br/>
|
||||
/// Used by Thermocline Blaster.
|
||||
/// </summary>
|
||||
|
||||
// Used by Megalodon, Seadragon & Voidragon, allows bullets to track their damage scaling
|
||||
public bool sharkBullets = false;
|
||||
|
||||
// Adds fire to bullets, currently used by Thermocline Blaster
|
||||
public bool fireBullet = false;
|
||||
/// <summary>
|
||||
/// If true, allows projectiles to track damage scaling.<br/>
|
||||
/// Used by Megalodon and Voidragon.
|
||||
/// </summary>
|
||||
public bool sharkBullets = false;
|
||||
/// <summary>
|
||||
/// If true, adds an ice trail to the projectile, and makes it inflict Frostbite.<br/>
|
||||
/// Used by Thermocline Blaster.
|
||||
/// </summary>
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using System;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using CalamityMod.Rarities;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Audio;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.ID;
|
||||
@@ -14,78 +19,45 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Ranged";
|
||||
public override string Texture => "CalamityMod/Projectiles/Melee/GalaxiaBolt";
|
||||
public int time = 0;
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.width = 10;
|
||||
Projectile.height = 10;
|
||||
Projectile.alpha = 150;
|
||||
Projectile.friendly = true;
|
||||
Projectile.DamageType = DamageClass.Ranged;
|
||||
Projectile.extraUpdates = 1;
|
||||
Projectile.extraUpdates = 2;
|
||||
Projectile.penetrate = 1;
|
||||
Projectile.timeLeft = 600;
|
||||
Projectile.usesLocalNPCImmunity = true;
|
||||
Projectile.localNPCHitCooldown = 10;
|
||||
Projectile.ignoreWater = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Projectile.localAI[0] += 1f;
|
||||
if (Projectile.localAI[0] == 12f)
|
||||
{
|
||||
Projectile.localAI[0] = 0f;
|
||||
for (int l = 0; l < 12; l++)
|
||||
{
|
||||
Vector2 dustVel = Vector2.UnitX * (float)-(float)Projectile.width / 2f;
|
||||
dustVel += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default) * new Vector2(8f, 16f);
|
||||
dustVel = dustVel.RotatedBy((double)(Projectile.rotation - 1.57079637f), default);
|
||||
int shadowDust = Dust.NewDust(Projectile.Center, 0, 0, DustID.ShadowbeamStaff, 0f, 0f, 160, default, 1f);
|
||||
Main.dust[shadowDust].scale = 1.1f;
|
||||
Main.dust[shadowDust].noGravity = true;
|
||||
Main.dust[shadowDust].position = Projectile.Center + dustVel;
|
||||
Main.dust[shadowDust].velocity = Projectile.velocity * 0.1f;
|
||||
Main.dust[shadowDust].velocity = Vector2.Normalize(Projectile.Center - Projectile.velocity * 3f - Main.dust[shadowDust].position) * 1.25f;
|
||||
}
|
||||
}
|
||||
Projectile.alpha -= 15;
|
||||
int alphaControl = 150;
|
||||
if (Projectile.Center.Y >= Projectile.ai[1])
|
||||
{
|
||||
alphaControl = 0;
|
||||
}
|
||||
if (Projectile.alpha < alphaControl)
|
||||
{
|
||||
Projectile.alpha = alphaControl;
|
||||
}
|
||||
Projectile.spriteDirection = Projectile.direction = (Projectile.velocity.X > 0).ToDirectionInt();
|
||||
Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == 1 ? 0f : MathHelper.Pi) + MathHelper.ToRadians(90) * Projectile.direction;
|
||||
if (Main.rand.NextBool(16))
|
||||
{
|
||||
Vector2 value3 = Vector2.UnitX.RotatedByRandom(1.5707963705062866).RotatedBy((double)Projectile.velocity.ToRotation(), default);
|
||||
int extraDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.ShadowbeamStaff, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f, 150, default, 1.2f);
|
||||
Main.dust[extraDust].velocity = value3 * 0.66f;
|
||||
Main.dust[extraDust].position = Projectile.Center + value3 * 12f;
|
||||
}
|
||||
if (Main.rand.NextBool(48) && !Main.dedServ)
|
||||
{
|
||||
int voidGore = Gore.NewGore(Projectile.GetSource_FromAI(), Projectile.Center, new Vector2(Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f), 16, 1f);
|
||||
Main.gore[voidGore].velocity *= 0.66f;
|
||||
Main.gore[voidGore].velocity += Projectile.velocity * 0.3f;
|
||||
}
|
||||
if (Projectile.ai[1] == 1f)
|
||||
{
|
||||
Projectile.light = 0.9f;
|
||||
if (Main.rand.NextBool(10))
|
||||
{
|
||||
Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.ShadowbeamStaff, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f, 150, default, 1.2f);
|
||||
}
|
||||
if (Main.rand.NextBool(20) && !Main.dedServ)
|
||||
{
|
||||
Gore.NewGore(Projectile.GetSource_FromAI(), Projectile.position, new Vector2(Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f), Main.rand.Next(16, 18), 1f);
|
||||
}
|
||||
}
|
||||
Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.1f / 255f, (255 - Projectile.alpha) * 0.7f / 255f, (255 - Projectile.alpha) * 0.15f / 255f);
|
||||
|
||||
if (Projectile.timeLeft <= 597f)
|
||||
{
|
||||
Particle smoke = new HeavySmokeParticle(Projectile.Center, -Projectile.velocity * 0.5f, Color.Lerp(Color.MidnightBlue, Color.Indigo, (float)Math.Sin(Main.GlobalTimeWrappedHourly * 6f)), 20, Main.rand.NextFloat(0.4f, 0.7f) * Projectile.scale, 0.8f, 0, false, 0, true);
|
||||
GeneralParticleHandler.SpawnParticle(smoke);
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
Particle smokeGlow = new HeavySmokeParticle(Projectile.Center, -Projectile.velocity * 0.5f, Color.DarkOrchid, 20, Main.rand.NextFloat(0.4f, 0.8f) * Projectile.scale, 0.3f, 0, true, 0.005f, true);
|
||||
GeneralParticleHandler.SpawnParticle(smokeGlow);
|
||||
}
|
||||
Particle spark2 = new CustomSpark(Projectile.Center, -Projectile.velocity * 0.05f, "CalamityMod/Particles/GlowSpark2", false, 5, 0.052f, Color.Black, new Vector2(0.6f, 1.3f), false);
|
||||
GeneralParticleHandler.SpawnParticle(spark2);
|
||||
SparkParticle spark = new SparkParticle(Projectile.Center - Projectile.velocity.SafeNormalize(Vector2.UnitY) * 3.5f, Projectile.velocity * 0.01f, false, 5, 1.2f * Projectile.scale, Main.rand.NextBool() ? Color.Indigo : Color.BlueViolet);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
}
|
||||
time++;
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<Voidfrost>(), 180);
|
||||
@@ -96,6 +68,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
Owner.Calamity().sharkGunDamageScaling++;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnKill(int timeLeft)
|
||||
{
|
||||
SoundStyle fire = new("CalamityMod/Sounds/Item/OmicronBeam");
|
||||
@@ -134,17 +107,28 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
Particle spark = new CustomSpark(Projectile.Center, new Vector2(3, 3).RotatedByRandom(100) * Main.rand.NextFloat(2f, 4f), "CalamityMod/Particles/ProvidenceMarkParticle", false, 27, Main.rand.NextFloat(1.1f, 1.3f), Color.Lerp(Color.MediumPurple, Color.Indigo, Main.rand.NextFloat(0.5f, 0.7f)), new Vector2(0.6f, 0.5f), true, false, 0, false, false, Main.rand.NextFloat(0.35f, 0.4f));
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
}
|
||||
if (Main.rand.NextBool())
|
||||
for (int i = 0; i < 30; i++)
|
||||
{
|
||||
for (int i = 0; i < 30; i++)
|
||||
{
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.Next(72, 73 + 1), Main.rand.NextVector2CircularEdge(8f, 8f) * (Main.rand.NextFloat(1f, 1.2f) + Projectile.scale));
|
||||
dust.noGravity = true;
|
||||
dust.noLight = true;
|
||||
dust.scale = Main.rand.NextFloat(0.8f, 1.2f) + Projectile.scale;
|
||||
dust.alpha = Main.rand.Next(120, 180 + 1);
|
||||
}
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType<VoidDustInverted>(), Main.rand.NextVector2CircularEdge(8f, 8f) * (Main.rand.NextFloat(1f, 1.2f) + Projectile.scale));
|
||||
dust.noGravity = true;
|
||||
dust.scale = Main.rand.NextFloat(0.8f, 1.2f) + Projectile.scale;
|
||||
dust.alpha = Main.rand.Next(120, 180 + 1);
|
||||
dust.color = Main.rand.NextBool() ? Color.Indigo : Color.DarkBlue;
|
||||
}
|
||||
}
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
if (time == 0)
|
||||
return false;
|
||||
Texture2D texture = ModContent.Request<Texture2D>("CalamityMod/Particles/GlowSpark").Value;
|
||||
Vector2 drawPosition = Projectile.Center - Main.screenPosition;
|
||||
Color drawColor = Projectile.GetAlpha(lightColor);
|
||||
float drawRotation = Projectile.rotation;
|
||||
Vector2 rotationPoint = texture.Size() * 0.5f;
|
||||
|
||||
Main.EntitySpriteDraw(texture, drawPosition, null, Color.Indigo with { A = 0 }, drawRotation, rotationPoint, new Vector2(0.5f, 1.4f) * 0.025f * Projectile.scale, SpriteEffects.None);
|
||||
Main.EntitySpriteDraw(texture, drawPosition, null, Color.DeepSkyBlue with { A = 0 }, drawRotation, rotationPoint, new Vector2(0.5f, 1.4f) * 0.02f * Projectile.scale, SpriteEffects.None);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
Dust dust = Dust.NewDustPerfect(GunTipPosition + (-Projectile.velocity.RotatedBy(0.15 * Projectile.direction) * 50), dustType);
|
||||
dust.scale = Main.rand.NextFloat(1.2f, 1.8f) * (Owner.Calamity().sharkGunDamageScaling * 0.02f) - rotMulti * 0.1f;
|
||||
dust.noGravity = true;
|
||||
dust.velocity = new Vector2(-1.2f, -2).RotatedBy(-Owner.direction).RotatedByRandom(rotMulti * 0.8f) * (Main.rand.NextFloat(1f, 3.2f) - rotMulti) * (Owner.Calamity().sharkGunDamageScaling * 0.015f);
|
||||
dust.velocity = new Vector2(-1.2f, -2).RotatedBy(Projectile.rotation).RotatedByRandom(rotMulti * 0.8f) * (Main.rand.NextFloat(1f, 3.2f) - rotMulti) * (Owner.Calamity().sharkGunDamageScaling * 0.015f);
|
||||
dust.alpha = Main.rand.Next(90, 150);
|
||||
dust.color = Main.rand.NextBool() ? Color.Indigo : Color.DarkBlue;
|
||||
}
|
||||
@@ -77,9 +77,11 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
#endregion
|
||||
#region Visuals and Sounds
|
||||
SoundStyle fire = new("CalamityMod/Sounds/Item/GunShotTiny");
|
||||
SoundEngine.PlaySound(fire with { Volume = 0.3f, Pitch = 0.4f, PitchVariance = 0.1f, MaxInstances = -1 }, Projectile.Center);
|
||||
SoundEngine.PlaySound(fire with { Volume = 0.4f, Pitch = 0.1f, PitchVariance = 0.1f, MaxInstances = -1 }, Projectile.Center);
|
||||
Particle sparker = new CritSpark(GunTipPosition, Vector2.Zero, Color.Gold, Color.LightGoldenrodYellow, 1.7f, 3, 0.5f, 3f);
|
||||
GeneralParticleHandler.SpawnParticle(sparker);
|
||||
Particle spark2 = new GlowSparkParticle(GunTipPosition, shootVelocity.RotatedByRandom(0.8f) * Main.rand.NextFloat(1.2f, 1.5f), false, 15, 0.017f, Main.rand.NextBool() ? Color.Indigo : Color.BlueViolet, new Vector2(1.5f, 0.7f), true, false, 1.3f);
|
||||
GeneralParticleHandler.SpawnParticle(spark2);
|
||||
for (int i = 0; i <= 4; i++)
|
||||
{
|
||||
Dust dust = Dust.NewDustPerfect(GunTipPosition, Main.rand.NextBool(3) ? 303 : 244, (shootVelocity * Main.rand.NextFloat(0.2f, 1.1f)).RotatedByRandom(0.4f));
|
||||
@@ -132,7 +134,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
//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);
|
||||
SoundEngine.PlaySound(fire with { Volume = 0.7f, Pitch = 0.15f }, Projectile.Center);
|
||||
for (int i = 0; i <= 13; i++)
|
||||
{
|
||||
Dust dust = Dust.NewDustPerfect(GunTipPosition, 303, shootVelocity.RotatedByRandom(0.5f) * Main.rand.NextFloat(0.2f, 1.1f), 80, default, Main.rand.NextFloat(0.4f, 1.3f));
|
||||
@@ -153,7 +155,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
Particle pulse = new DirectionalPulseRing(GunTipPosition, shootVelocity / 4, Color.Gray, new Vector2(1f, 2.5f), rotation, 0.03f, 0.3f, 20);
|
||||
GeneralParticleHandler.SpawnParticle(pulse);
|
||||
//Extra sound and muzzle flash if the scaling is at max
|
||||
if (Owner.Calamity().sharkGunDamageScaling == 30)
|
||||
if (Owner.Calamity().sharkGunDamageScaling == 50)
|
||||
{
|
||||
SoundStyle fireperfect = new("CalamityMod/Sounds/Item/ShadowboltReflect");
|
||||
SoundEngine.PlaySound(fireperfect with { Volume = 0.6f, Pitch = 0f }, GunTipPosition);
|
||||
@@ -168,7 +170,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
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<AnomalysNanogunPlasmaBeam>(), (int)(Projectile.damage * 5f) * Owner.Calamity().sharkGunDamageScaling, Projectile.knockBack, Projectile.owner);
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity, ModContent.ProjectileType<AnomalysNanogunPlasmaBeam>(), (int)(Projectile.damage * 2.5f) * Owner.Calamity().sharkGunDamageScaling, Projectile.knockBack, Projectile.owner);
|
||||
|
||||
//After firing the rocket, kill the projectile to allow left click to be held down
|
||||
Projectile.Kill();
|
||||
|
||||
Reference in new issue
Block a user