Files
CalamityModPublic/Projectiles/Magic/PerditoSigilShotCreator.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

68 lines
2.6 KiB
C#

using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Magic
{
public class PerditoSigilShotCreator : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Magic";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public ref float FiringTimer => ref Projectile.ai[0];
public ref float ShotsFiredCount => ref Projectile.ai[1];
private const int TotalShots = 18;
private const int DelayBetweenShots = 3;
private const float ShotSpeed = 17f;
private const float SpawnRadius = 150f; // Radius around the cursor where shots spawn
public override void SetDefaults()
{
Projectile.width = 1;
Projectile.height = 1;
Projectile.friendly = true;
Projectile.DamageType = DamageClass.Magic;
Projectile.ignoreWater = true;
Projectile.tileCollide = false;
Projectile.penetrate = -1;
Projectile.timeLeft = DelayBetweenShots * TotalShots + 10;
}
public override void AI()
{
Projectile.Center = Main.MouseWorld;
Vector2 targetCenter = Projectile.Center;
FiringTimer++;
if (FiringTimer % DelayBetweenShots == 0 && ShotsFiredCount < TotalShots)
{
ShotsFiredCount++;
if (ShotsFiredCount == TotalShots)
{
SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/UnstableCastersGauntlet/PerditoSigilHit2") { Volume = 0.9f, PitchVariance = 0.1f }, Projectile.Center);
}
else
SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/UnstableCastersGauntlet/PerditoSigilHit1") { Volume = 0.8f, PitchVariance = 0.1f }, Projectile.Center);
float startAngle = Main.rand.NextFloat(MathHelper.TwoPi);
Vector2 spawnOffset = startAngle.ToRotationVector2() * SpawnRadius;
Vector2 spawnPosition = targetCenter + spawnOffset;
Vector2 velocity = (targetCenter - spawnPosition).SafeNormalize(Vector2.UnitX) * ShotSpeed;
Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnPosition, velocity, ModContent.ProjectileType<PerditoSigilShot>(), Projectile.damage, Projectile.knockBack, Projectile.owner);
}
if (ShotsFiredCount >= TotalShots)
{
Projectile.Kill();
}
}
public override bool? CanDamage() => false;
}
}