Terra Bullet visuals
This commit is contained in:
1 parent
b792e59f3f
commit
2fbdec11cf
3 files changed
+30
-21
No files matched your search
@@ -26,7 +26,7 @@ namespace CalamityMod.Items.Ammo
|
||||
Item.value = Item.sellPrice(copper: 16);
|
||||
Item.rare = ItemRarityID.Lime;
|
||||
Item.shoot = ModContent.ProjectileType<TerraBulletMain>();
|
||||
Item.shootSpeed = 10f;
|
||||
Item.shootSpeed = 2f;
|
||||
Item.ammo = AmmoID.Bullet;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.Audio;
|
||||
using CalamityMod.Particles;
|
||||
|
||||
namespace CalamityMod.Projectiles.Ranged
|
||||
{
|
||||
@@ -11,8 +12,8 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
public new string LocalizationCategory => "Projectiles.Ranged";
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2;
|
||||
ProjectileID.Sets.TrailingMode[Projectile.type] = 0;
|
||||
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8;
|
||||
ProjectileID.Sets.TrailingMode[Projectile.type] = 2;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
@@ -26,7 +27,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
Projectile.penetrate = 1;
|
||||
Projectile.timeLeft = 600;
|
||||
Projectile.alpha = 255;
|
||||
Projectile.extraUpdates = 3;
|
||||
Projectile.extraUpdates = 5;
|
||||
Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration;
|
||||
}
|
||||
|
||||
@@ -41,14 +42,16 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
// After 15 frames, the alpha will be exactly 0
|
||||
if (Projectile.alpha > 0)
|
||||
Projectile.alpha -= 17;
|
||||
|
||||
// Dust type 74, scale 0.8, no gravity, no light, no velocity
|
||||
Vector2 pos = Projectile.Center - Projectile.velocity * 0.1f;
|
||||
Dust d = Dust.NewDustDirect(pos, 0, 0, 74, Scale: 0.8f);
|
||||
d.position = pos;
|
||||
d.velocity = Vector2.Zero;
|
||||
d.noGravity = true;
|
||||
d.noLight = true;
|
||||
for (int b = 0; b < 2; b++)
|
||||
{
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(5) ? 131 : 294, -Projectile.velocity * Main.rand.NextFloat(0.05f, 0.5f));
|
||||
dust.noGravity = true;
|
||||
dust.scale = Main.rand.NextFloat(0.45f, 0.65f);
|
||||
if (dust.type == 131)
|
||||
dust.scale = Main.rand.NextFloat(0.35f, 0.55f);
|
||||
else
|
||||
dust.fadeIn = 0.5f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,8 +70,14 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f);
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType<TerraBulletSplit>(), (int)(Projectile.damage * 0.3), 0f, Projectile.owner, 0f, 0f);
|
||||
}
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
Vector2 velocity = new Vector2(4, 4).RotatedByRandom(100);
|
||||
LineParticle spark2 = new LineParticle(Projectile.Center + velocity, velocity * Main.rand.NextFloat(0.5f, 1f), false, 11, 0.65f, Main.rand.NextBool(3) ? Color.MediumAquamarine : Color.Lime);
|
||||
GeneralParticleHandler.SpawnParticle(spark2);
|
||||
}
|
||||
}
|
||||
SoundEngine.PlaySound(SoundID.Item118, Projectile.position);
|
||||
SoundEngine.PlaySound(SoundID.Item118 with { Pitch = 0.5f }, Projectile.Center);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -45,14 +45,14 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
{
|
||||
Projectile.alpha -= 85;
|
||||
}
|
||||
float x2 = Projectile.position.X - Projectile.velocity.X / 10f;
|
||||
float y2 = Projectile.position.Y - Projectile.velocity.Y / 10f;
|
||||
int terraDust = Dust.NewDust(new Vector2(x2, y2), 1, 1, 74, 0f, 0f, 0, default, 0.8f);
|
||||
Main.dust[terraDust].alpha = Projectile.alpha;
|
||||
Main.dust[terraDust].position.X = x2;
|
||||
Main.dust[terraDust].position.Y = y2;
|
||||
Main.dust[terraDust].velocity *= 0f;
|
||||
Main.dust[terraDust].noGravity = true;
|
||||
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(5) ? 131 : 294, -Projectile.velocity * Main.rand.NextFloat(0.05f, 0.5f));
|
||||
dust.noGravity = true;
|
||||
dust.scale = Main.rand.NextFloat(0.35f, 0.55f);
|
||||
if (dust.type == 131)
|
||||
dust.scale = Main.rand.NextFloat(0.25f, 0.45f);
|
||||
else
|
||||
dust.fadeIn = 0.5f;
|
||||
|
||||
if (speed == 0f)
|
||||
speed = Projectile.velocity.Length();
|
||||
|
||||
Reference in new issue
Block a user