P90: Fixed tile collision issues, gave 30 armor pen so you can use it on early HM enemies more easily Meowthrower: Reduced knockback to make it worse on some types of enemies so other weapons can shine more (It was a little too good in every scenario against regular enemies) Opal Striker: Fixed tile collision issues Needler: Adjusted the dust visuals and reduced how long it inflicts acid venom since its a very potent debuff in early HM on many enemies
63 lines
2.3 KiB
C#
63 lines
2.3 KiB
C#
using Microsoft.Xna.Framework;
|
|
using Microsoft.Xna.Framework.Graphics;
|
|
using Terraria;
|
|
using Terraria.Audio;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
namespace CalamityMod.Projectiles.Ranged
|
|
{
|
|
public class OpalStrike : ModProjectile, ILocalizedModType
|
|
{
|
|
public bool FirstFrameNoDraw = true;
|
|
public new string LocalizationCategory => "Projectiles.Ranged";
|
|
public override void SetStaticDefaults()
|
|
{
|
|
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8;
|
|
ProjectileID.Sets.TrailingMode[Projectile.type] = 0;
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
Projectile.width = Projectile.height = 20;
|
|
Projectile.friendly = true;
|
|
Projectile.alpha = 55;
|
|
Projectile.penetrate = 2;
|
|
Projectile.timeLeft = 300;
|
|
Projectile.DamageType = DamageClass.Ranged;
|
|
Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration;
|
|
Projectile.extraUpdates = 2;
|
|
Projectile.usesLocalNPCImmunity = true;
|
|
Projectile.localNPCHitCooldown = 50;
|
|
Projectile.tileCollide = false; // Custom tile collision since the hitbox is large
|
|
}
|
|
|
|
public override void AI()
|
|
{
|
|
if (Collision.SolidCollision(Projectile.Center, 5, 5))
|
|
Projectile.Kill();
|
|
|
|
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2;
|
|
Dust.NewDustPerfect(Projectile.Center, 162);
|
|
}
|
|
|
|
public override bool PreDraw(ref Color lightColor)
|
|
{
|
|
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1);
|
|
return false;
|
|
}
|
|
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
|
|
{
|
|
target.AddBuff(BuffID.OnFire, 60);
|
|
}
|
|
public override void OnKill(int timeLeft)
|
|
{
|
|
for (int i = 0; i <= 8; i++)
|
|
{
|
|
Dust dust = Dust.NewDustPerfect(Projectile.position, 162, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(30f)) / 2, 0, default, Main.rand.NextFloat(1.6f, 2.3f));
|
|
dust.noGravity = false;
|
|
}
|
|
}
|
|
public override bool? CanDamage() => base.CanDamage();
|
|
}
|
|
}
|