Dead Sun's Wind touch ups
new visuals and damage, changed some particles as well
This commit is contained in:
1 parent
96afcfe7e3
commit
abb5a877f4
7 files changed
+88
-28
No files matched your search
@@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public static readonly SoundStyle Explosion = new("CalamityMod/Sounds/Item/DeadSunExplosion") { Volume = 0.5f };
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.damage = 155;
|
||||
Item.damage = 182;
|
||||
Item.DamageType = DamageClass.Ranged;
|
||||
Item.width = 70;
|
||||
Item.height = 24;
|
||||
@@ -42,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player)
|
||||
{
|
||||
if (Main.rand.Next(0, 100) < 70)
|
||||
if (Main.rand.Next(0, 100) < 20)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -355,10 +355,10 @@ DeadSunsWind: {
|
||||
DisplayName: Dead Sun's Wind
|
||||
Tooltip:
|
||||
'''
|
||||
Fires a concentrated blast of cosmic plasma that bounces and explodes on hit
|
||||
Upon hitting a surface a shot becomes empowered, dealing 1.2x damage and homing in on enemies
|
||||
Fires a concentrated blast of superheated cosmic plasma that explodes and can ricochet off blocks
|
||||
Shots aggressively home in on enemies after being ricocheted
|
||||
Consecutive hits cause larger explosions
|
||||
70% chance to save ammo
|
||||
20% chance to save ammo
|
||||
'''
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Particles
|
||||
{
|
||||
public class AltSparkParticle : Particle
|
||||
{
|
||||
public Color InitialColor;
|
||||
public bool AffectedByGravity;
|
||||
public override bool SetLifetime => true;
|
||||
public override bool UseCustomDraw => true;
|
||||
public override bool UseAdditiveBlend => false;
|
||||
|
||||
public override string Texture => "CalamityMod/Projectiles/StarProj";
|
||||
|
||||
public AltSparkParticle(Vector2 relativePosition, Vector2 velocity, bool affectedByGravity, int lifetime, float scale, Color color)
|
||||
{
|
||||
Position = relativePosition;
|
||||
Velocity = velocity;
|
||||
AffectedByGravity = affectedByGravity;
|
||||
Scale = scale;
|
||||
Lifetime = lifetime;
|
||||
Color = InitialColor = color;
|
||||
}
|
||||
|
||||
public override void Update()
|
||||
{
|
||||
Scale *= 0.95f;
|
||||
Color = Color.Lerp(InitialColor, Color.Transparent, (float)Math.Pow(LifetimeCompletion, 3D));
|
||||
Velocity *= 0.95f;
|
||||
if (Velocity.Length() < 12f && AffectedByGravity)
|
||||
{
|
||||
Velocity.X *= 0.94f;
|
||||
Velocity.Y += 0.25f;
|
||||
}
|
||||
Rotation = Velocity.ToRotation() + MathHelper.PiOver2;
|
||||
}
|
||||
|
||||
public override void CustomDraw(SpriteBatch spriteBatch)
|
||||
{
|
||||
Vector2 scale = new Vector2(0.5f, 1.6f) * Scale;
|
||||
Texture2D texture = ModContent.Request<Texture2D>(Texture).Value;
|
||||
|
||||
spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color, Rotation, texture.Size() * 0.5f, scale, 0, 0f);
|
||||
spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color, Rotation, texture.Size() * 0.5f, scale * new Vector2(0.45f, 1f), 0, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,8 @@ namespace CalamityMod.Particles
|
||||
public class DetailedExplosion : Particle
|
||||
{
|
||||
public override string Texture => "CalamityMod/Particles/DetailedExplosion";
|
||||
public override bool UseAdditiveBlend => true;
|
||||
public bool UseAltVisual = true;
|
||||
public override bool UseAdditiveBlend => UseAltVisual;
|
||||
public override bool SetLifetime => true;
|
||||
public override bool UseCustomDraw => true;
|
||||
|
||||
@@ -20,7 +21,7 @@ namespace CalamityMod.Particles
|
||||
private Vector2 Squish;
|
||||
private Color BaseColor;
|
||||
|
||||
public DetailedExplosion(Vector2 position, Vector2 velocity, Color color, Vector2 squish, float rotation, float originalScale, float finalScale, int lifeTime)
|
||||
public DetailedExplosion(Vector2 position, Vector2 velocity, Color color, Vector2 squish, float rotation, float originalScale, float finalScale, int lifeTime, bool UseAdditiveBlend = true)
|
||||
{
|
||||
Position = position;
|
||||
Velocity = velocity;
|
||||
@@ -31,6 +32,7 @@ namespace CalamityMod.Particles
|
||||
Lifetime = lifeTime;
|
||||
Squish = squish;
|
||||
Rotation = rotation;
|
||||
UseAltVisual = UseAdditiveBlend;
|
||||
}
|
||||
|
||||
public override void Update()
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 9.0 KiB |
@@ -16,7 +16,9 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
public ref int HitCount => ref Main.player[Projectile.owner].Calamity().deadSunCounter;
|
||||
public int Time = 0;
|
||||
public int bounceKill = 0;
|
||||
public bool extraDamage = false;
|
||||
public bool Homing = false;
|
||||
public Color color1 = Color.Turquoise;
|
||||
public Color color2 = Color.Indigo;
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.width = 10;
|
||||
@@ -33,27 +35,30 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
{
|
||||
Time++;
|
||||
Lighting.AddLight(Projectile.Center, 0.117f, 0.155f, 0.159f);
|
||||
|
||||
if (Projectile.timeLeft % 3 == 0 && Time > 12)
|
||||
{
|
||||
SparkParticle spark = new SparkParticle(Projectile.Center, -Projectile.velocity * 0.05f, false, 20, 2.3f, Main.rand.NextBool() ? Color.Turquoise : Color.MediumSpringGreen);
|
||||
//SparkParticle spark = new SparkParticle(Projectile.Center, -Projectile.velocity * 0.05f, false, 20, 2.3f, Main.rand.NextBool() ? color2 : color1);
|
||||
//GeneralParticleHandler.SpawnParticle(spark);
|
||||
AltSparkParticle spark = new AltSparkParticle(Projectile.Center, -Projectile.velocity * 0.05f, false, 20, 2.3f, Color.Black);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
}
|
||||
if (Projectile.timeLeft % 2 == 0 && Time > 12)
|
||||
{
|
||||
SparkParticle spark2 = new SparkParticle(Projectile.Center, -Projectile.velocity * 0.05f, false, 20, 0.9f, Color.White);
|
||||
SparkParticle spark2 = new SparkParticle(Projectile.Center, -Projectile.velocity * 0.05f, false, 20, 0.9f, color1);
|
||||
GeneralParticleHandler.SpawnParticle(spark2);
|
||||
}
|
||||
if (Time == 7)
|
||||
{
|
||||
for (int i = 0; i <= 18; i++)
|
||||
{
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(3) ? 191 : 156, Projectile.velocity);
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(3) ? 191 : Main.rand.NextBool(4) ? 229 : 156, Projectile.velocity);
|
||||
dust.scale = Main.rand.NextFloat(1.5f, 2.3f);
|
||||
dust.velocity = Projectile.velocity.RotatedByRandom(0.3f) * Main.rand.NextFloat(0.3f, 2.1f);
|
||||
dust.noGravity = true;
|
||||
}
|
||||
}
|
||||
if (extraDamage)
|
||||
if (Homing)
|
||||
{
|
||||
for (int i = 0; i <= 2; i++)
|
||||
{
|
||||
@@ -69,7 +74,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
|
||||
{
|
||||
SoundEngine.PlaySound(DeadSunsWind.Explosion with { Pitch = HitCount * 0.05f }, Projectile.Center);
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType<DeadSunExplosion>(), Projectile.damage - (Projectile.damage / 3), 4f, Projectile.owner, HitCount * 10, extraDamage ? 5 : 0);
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType<DeadSunExplosion>(), Projectile.damage / 2, 4f, Projectile.owner, HitCount * 10, Homing ? 5 : 0);
|
||||
if (HitCount >= 15)
|
||||
HitCount = 6;
|
||||
else
|
||||
@@ -78,28 +83,27 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
|
||||
public override bool OnTileCollide(Vector2 oldVelocity)
|
||||
{
|
||||
float numberOfDusts = 20;
|
||||
Projectile.timeLeft = 500;
|
||||
float numberOfDusts = 25;
|
||||
float rotFactor = 360f / numberOfDusts;
|
||||
for (int i = 0; i < numberOfDusts; i++)
|
||||
{
|
||||
float rot = MathHelper.ToRadians(i * rotFactor);
|
||||
Vector2 offset = new Vector2(Main.rand.NextFloat(1, 3.1f), 0).RotatedBy(rot * Main.rand.NextFloat(1.1f, 9.1f));
|
||||
Vector2 velOffset = new Vector2(Main.rand.NextFloat(1, 3.1f), 0).RotatedBy(rot * Main.rand.NextFloat(1.1f, 9.1f));
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center + offset, Main.rand.NextBool(4) ? 229 : 156, new Vector2(velOffset.X, velOffset.Y));
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center + offset, Main.rand.NextBool(6) ? 229 : 156, new Vector2(velOffset.X, velOffset.Y));
|
||||
dust.noGravity = true;
|
||||
dust.velocity = velOffset;
|
||||
dust.scale = Main.rand.NextFloat(2.6f, 3.2f);
|
||||
}
|
||||
Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.Turquoise, new Vector2(1f, 1f), Main.rand.NextFloat(5, -5), 0.1f, 0.9f - (bounceKill * 0.25f), 25);
|
||||
Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, color1, new Vector2(1f, 1f), Main.rand.NextFloat(5, -5), 0.1f, 0.9f - (bounceKill * 0.25f), 25);
|
||||
GeneralParticleHandler.SpawnParticle(pulse);
|
||||
Particle pulse2 = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.MediumSpringGreen, new Vector2(1f, 1f), Main.rand.NextFloat(5, -5), 0.05f, 0.8f - (bounceKill * 0.25f), 25);
|
||||
Particle pulse2 = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, color2, new Vector2(1f, 1f), Main.rand.NextFloat(5, -5), 0.05f, 0.8f - (bounceKill * 0.25f), 25);
|
||||
GeneralParticleHandler.SpawnParticle(pulse2);
|
||||
extraDamage = true;
|
||||
Homing = true;
|
||||
if (bounceKill == 0)
|
||||
{
|
||||
Projectile.damage = Projectile.damage + (Projectile.damage / 5); // 20% damage bonus after a bounce
|
||||
SoundEngine.PlaySound(DeadSunsWind.Ricochet, Projectile.Center);
|
||||
}
|
||||
|
||||
bounceKill++;
|
||||
if (Projectile.velocity.X != oldVelocity.X)
|
||||
{
|
||||
|
||||
@@ -15,7 +15,8 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
|
||||
public Player Owner => Main.player[Projectile.owner];
|
||||
public ref float ExplosionRadius => ref Projectile.ai[0];
|
||||
|
||||
public Color color1 = Color.Turquoise;
|
||||
public Color color2 = Color.Indigo;
|
||||
public override void SetDefaults()
|
||||
{
|
||||
//These shouldn't matter because its circular
|
||||
@@ -32,13 +33,15 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
}
|
||||
public override void AI()
|
||||
{
|
||||
Particle explosion = new DetailedExplosion(Projectile.Center, Vector2.Zero, Color.Turquoise, new Vector2(1f, 1f), Main.rand.NextFloat(-5, 5), 0f, ExplosionRadius * 0.0065f + 0.1f, Main.rand.Next(15, 22));
|
||||
Particle explosion = new DetailedExplosion(Projectile.Center, Vector2.Zero, color1, new Vector2(1f, 1f), Main.rand.NextFloat(-5, 5), 0f, ExplosionRadius * 0.0065f + 0.1f, Main.rand.Next(15, 22));
|
||||
GeneralParticleHandler.SpawnParticle(explosion);
|
||||
Particle explosion2 = new DetailedExplosion(Projectile.Center, Vector2.Zero, Color.MediumSpringGreen, new Vector2(1f, 1f), Main.rand.NextFloat(-5, 5), 0f, ExplosionRadius * 0.0045f + 0.1f, Main.rand.Next(15, 22));
|
||||
Particle explosion2 = new DetailedExplosion(Projectile.Center, Vector2.Zero, Color.Black, new Vector2(1f, 1f), Main.rand.NextFloat(-5, 5), 0f, ExplosionRadius * 0.0045f + 0.1f, Main.rand.Next(15, 22), false);
|
||||
GeneralParticleHandler.SpawnParticle(explosion2);
|
||||
Particle orb = new GenericBloom(Projectile.Center, Projectile.velocity, Color.Turquoise, ExplosionRadius * 0.0085f + 0.05f, 10, true);
|
||||
Particle explosion3 = new DetailedExplosion(Projectile.Center, Vector2.Zero, Color.Black, new Vector2(1f, 1f), Main.rand.NextFloat(-5, 5), 0f, ExplosionRadius * 0.0030f + 0.1f, Main.rand.Next(15, 22), false);
|
||||
GeneralParticleHandler.SpawnParticle(explosion3);
|
||||
Particle orb = new GenericBloom(Projectile.Center, Projectile.velocity, color1, ExplosionRadius * 0.0085f + 0.05f, 10, true);
|
||||
GeneralParticleHandler.SpawnParticle(orb);
|
||||
Particle orb2 = new GenericBloom(Projectile.Center, Projectile.velocity, Color.MediumSpringGreen, ExplosionRadius * 0.006f + 0.05f, 10, true);
|
||||
Particle orb2 = new GenericBloom(Projectile.Center, Projectile.velocity, color2, ExplosionRadius * 0.006f + 0.05f, 10, true);
|
||||
GeneralParticleHandler.SpawnParticle(orb2);
|
||||
float numberOfDusts = ExplosionRadius * 0.1f + 10;
|
||||
float rotFactor = 360f / numberOfDusts;
|
||||
@@ -48,8 +51,8 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
Vector2 offset = new Vector2(Main.rand.NextFloat(ExplosionRadius * 0.2f, 3.1f), 0).RotatedBy(rot * Main.rand.NextFloat(1.1f, 9.1f));
|
||||
Vector2 velOffset = new Vector2(Main.rand.NextFloat(ExplosionRadius * 0.2f, 3.1f), 0).RotatedBy(rot * Main.rand.NextFloat(1.1f, 9.1f));
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center + offset, Main.rand.NextBool(4) ? 229 : Projectile.ai[1] == 5 ? 226 : 156, new Vector2(velOffset.X, velOffset.Y));
|
||||
dust.noGravity = dust.type == 226 ? false : true;
|
||||
dust.color = dust.type == 226 ? Color.Turquoise : default;
|
||||
dust.noGravity = dust.type == 226? false : true;
|
||||
dust.color = dust.type == 226 ? color1 : default;
|
||||
dust.velocity = velOffset;
|
||||
dust.scale = dust.type == 226 ? Main.rand.NextFloat(0.7f, 1.3f) : Main.rand.NextFloat(1.6f, 2.2f);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user