Files
CalamityModPublic/Projectiles/Typeless/SkyFlareFriendly.cs
T
doze-zoze 774469e8db Yharims Gift rebalance
- No longer spawns dragon dust when moving
- 15 -> 10% dmg
- 12 -> 10 defense
- 15 -> 20% move speed
- 375/375/375 -> 250/500/750 meteor dmg
- Meteor spread changed, meteors now have 10 tile homing range
- fixed meteors not proccing on all iframe types
- Meteors now inflict Dragonfire
- All attacks with Yharim's Gift equipped inflict Auric Rebuke

Also fixed Virid Vanguard broken localization. Dragonfire meteor buff also effects the nohit bow but that already inflcited dragonfire in other ways.
2026-03-04 17:03:55 -05:00

131 lines
5.3 KiB
C#

using CalamityMod.Buffs.DamageOverTime;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Typeless
{
public class SkyFlareFriendly : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Typeless";
public override void SetStaticDefaults()
{
ProjectileID.Sets.TrailCacheLength[Type] = 2;
ProjectileID.Sets.TrailingMode[Type] = 0;
Main.projFrames[Type] = 3;
}
public override void SetDefaults()
{
Projectile.width = 42;
Projectile.height = 42;
Projectile.friendly = true;
Projectile.ignoreWater = true;
Projectile.extraUpdates = 1;
Projectile.penetrate = 1;
}
public override void AI()
{
Projectile.frameCounter++;
if (Projectile.frameCounter > 8)
{
Projectile.frame++;
Projectile.frameCounter = 0;
}
if (Projectile.frame > 2)
{
Projectile.frame = 0;
}
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2;
Lighting.AddLight(Projectile.Center, 0.7f, 0.3f, 0f);
}
public override bool PreDraw(ref Color lightColor)
{
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1);
return false;
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<Dragonfire>(), 300);
}
public override void OnKill(int timeLeft)
{
SoundEngine.PlaySound(SoundID.Item14, Projectile.position);
Projectile.position.X = Projectile.position.X + (float)(Projectile.width / 2);
Projectile.position.Y = Projectile.position.Y + (float)(Projectile.height / 2);
Projectile.width = Projectile.height = 200;
Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2);
Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2);
for (int i = 0; i < 4; i++)
{
int skyDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.CopperCoin, 0f, 0f, 100, default, 2f);
Main.dust[skyDust].velocity *= 3f;
if (Main.rand.NextBool())
{
Main.dust[skyDust].scale = 0.5f;
Main.dust[skyDust].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
}
}
for (int j = 0; j < 12; j++)
{
int skyDust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.CopperCoin, 0f, 0f, 100, default, 3f);
Main.dust[skyDust2].noGravity = true;
Main.dust[skyDust2].velocity *= 5f;
skyDust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.CopperCoin, 0f, 0f, 100, default, 2f);
Main.dust[skyDust2].velocity *= 2f;
}
if (!Main.dedServ)
{
Vector2 goreSource = Projectile.Center;
int goreAmt = 3;
Vector2 source = new Vector2(goreSource.X - 24f, goreSource.Y - 24f);
for (int goreIndex = 0; goreIndex < goreAmt; goreIndex++)
{
float velocityMult = 0.33f;
if (goreIndex < (goreAmt / 3))
{
velocityMult = 0.66f;
}
if (goreIndex >= (2 * goreAmt / 3))
{
velocityMult = 1f;
}
Mod mod = ModContent.GetInstance<CalamityMod>();
int type = Main.rand.Next(61, 64);
int smoke = Gore.NewGore(Projectile.GetSource_Death(), source, default, type, 1f);
Gore gore = Main.gore[smoke];
gore.velocity *= velocityMult;
gore.velocity.X += 1f;
gore.velocity.Y += 1f;
type = Main.rand.Next(61, 64);
smoke = Gore.NewGore(Projectile.GetSource_Death(), source, default, type, 1f);
gore = Main.gore[smoke];
gore.velocity *= velocityMult;
gore.velocity.X -= 1f;
gore.velocity.Y += 1f;
type = Main.rand.Next(61, 64);
smoke = Gore.NewGore(Projectile.GetSource_Death(), source, default, type, 1f);
gore = Main.gore[smoke];
gore.velocity *= velocityMult;
gore.velocity.X += 1f;
gore.velocity.Y -= 1f;
type = Main.rand.Next(61, 64);
smoke = Gore.NewGore(Projectile.GetSource_Death(), source, default, type, 1f);
gore = Main.gore[smoke];
gore.velocity *= velocityMult;
gore.velocity.X -= 1f;
gore.velocity.Y -= 1f;
}
}
}
}
}