Files
CalamityModPublic/Projectiles/Ranged/ImpactRound.cs
T
Andrew Marheine bb66f80599 1 - Cinnamon Roll and Fireball boost heat-related debuff damage by 50%.
2 - Evergreen Gin boosts sickness and water-related debuff damage by 50%.
3 - Eskimo Set boosts cold-related debuff damage by 50%.
4 - Removed organic and inorganic damage bonuses.
5 - Fixed Aegis Blade alt fire doing stupid damage.
2022-01-11 14:53:37 -06:00

66 lines
1.8 KiB
C#

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Ranged
{
public class ImpactRound : ModProjectile
{
public override string Texture => "CalamityMod/Projectiles/Ranged/AMRShot";
private bool initialized = false;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Impact Round");
}
public override void SetDefaults()
{
projectile.width = 4;
projectile.height = 4;
projectile.light = 0.5f;
projectile.alpha = 255;
projectile.extraUpdates = 7;
projectile.scale = 1.18f;
projectile.friendly = true;
projectile.ranged = true;
projectile.ignoreWater = true;
projectile.aiStyle = 1;
aiType = ProjectileID.BulletHighVelocity;
projectile.penetrate = -1;
projectile.timeLeft = 600;
projectile.tileCollide = false;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 10;
projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration;
}
public override void AI()
{
if (!initialized && projectile.ranged) //Ranged check prevents quiver splits triggering the sound
{
initialized = true;
if (Main.netMode != NetmodeID.Server)
{
var sound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LargeWeaponFire");
sound = sound.WithVolume(sound.Volume * 0.45f);
Main.PlaySound(sound, projectile.Center);
}
}
}
public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection)
{
double damageMult = 1D;
if (crit)
damageMult += 0.25;
damage = (int)(damage * damageMult);
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) => projectile.timeLeft < 600;
}
}