Files
CalamityModPublic/Projectiles/Summon/AstralProbeRound.cs
T
Altixal 0756e9b14f more assortment of stuff
- Buffed Amazon, Anchor, Ball O' Fugu, Breaker Blade, Candy Corn Rifle, Classy Cane, Clockwork Assault Rifle, Cobalt Naginata, Cobalt Repeater, Cobalt Sword, Crackshot Colt, Cutlass, Fates Reveal, Frostbrand, KO Cannon, Orichalcum Repeater, Palladium Repeater, Slag Magnum, Starspawn Helix Staff, The Last Mourning, The Maelstrom, Tundra Flame Blossoms Staff, Unstable Caster's Gauntlet
- Nerfed Amber Staff, Bee Keeper, Burnt Sienna, Chain Guillotines, Chlorophyte Partisan, Dart Rifle, Enchanted Boomerang, Enchanted Sword, Meowmere, Muramasa, Swordfish, Thunder Zapper, Veering Wind
- Reduced Ark line projectile parry effectiveness to account for the fact most projectiles don't do that much damage anymore
- Reverted changes to Starfury stars, now uses the 1.4.4 tile collision style
- Caustic Staff dragons spawn less passive dust + reverted shadowflames whoops
- Tweaked Face Melter and allowed it to received modifier bonuses on speed (buff)
- Applied changes to Marked For Death (effective nerf to Eye of Magnus/buff to Lunic Eye)
2026-05-23 23:34:10 +07:00

86 lines
3.4 KiB
C#

using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Dusts;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Summon
{
public class AstralProbeRound : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Summon";
public override string Texture => "CalamityMod/Projectiles/Boss/AstralLaser";
public override void SetStaticDefaults()
{
Main.projFrames[Type] = 3;
ProjectileID.Sets.TrailCacheLength[Type] = 3;
ProjectileID.Sets.TrailingMode[Type] = 0;
ProjectileID.Sets.MinionShot[Type] = true;
}
public override void SetDefaults()
{
Projectile.timeLeft = 600;
Projectile.width = 62;
Projectile.height = 20;
Projectile.alpha = 125;
Projectile.DamageType = DamageClass.Summon;
Projectile.MaxUpdates = 4;
Projectile.netImportant = true;
Projectile.friendly = true;
Projectile.ignoreWater = true;
Projectile.tileCollide = false;
}
public override void AI()
{
Projectile.rotation = Projectile.velocity.ToRotation(); // The projectile looks at where it's going.
Projectile.frameCounter++;
Projectile.frame = Projectile.frameCounter / 3 % Main.projFrames[Type];
// The projectile does it's animation.
Lighting.AddLight(Projectile.Center, Vector3.One * 0.1f); // The projectile emtis light.
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 120);
public override bool PreDraw(ref Color lightColor)
{
Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value;
Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame);
Vector2 origin = frame.Size() * 0.5f;
SpriteEffects direction = Projectile.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally;
for (int i = 0; i < Projectile.oldPos.Length; i++)
{
Color afterimageDrawColor = Color.White with { A = 25 } * Projectile.Opacity * (1f - i / (float)Projectile.oldPos.Length);
Vector2 afterimageDrawPosition = Projectile.oldPos[i] + Projectile.Size * 0.5f - Main.screenPosition;
Main.EntitySpriteDraw(texture, afterimageDrawPosition, frame, afterimageDrawColor, Projectile.rotation, origin, Projectile.scale, direction, 0);
}
// Makes the projectile have afterimages.
return true;
}
public override void OnKill(int timeLeft)
{
SoundEngine.PlaySound(SoundID.Item10, Projectile.position);
for (int k = 0; k < 5; k++)
{
int randomDust = Utils.SelectRandom(Main.rand, new int[]
{
ModContent.DustType<AstralOrange>(),
ModContent.DustType<AstralBlue>()
});
Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, randomDust, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f);
}
}
}
}