Files
CalamityModPublic/Projectiles/Rogue/InfestedClawmerangProj.cs
T
Altixal 51593d3a03 Various tweaks (see description)
- Removed noDropItem from a bunch of projectiles that no longer drop items due to way overdue 1.4 changes
- Several smaller balance changes/tweaks
- Titan Arm now has scaling crit damage
- In addition to buffing/tweaking it, Cosmic Kunai stealth effect now affects the entire 5-kunai stream.
-> Removed pointless code suggesting the scythes hit more than once because it. doesn't. (Hitbox expansion on its own does nothing)
-> Also coalesced the 3 multipliers (1.5x SSDF 1.5x on shoot 1.25x on Projectile AI) into one 3x multiplier on shoot.
- Tweaked BaseSporeSacProjectile so that as it fades away and drops to 0 damage it no longer attempts to home in on anything and stick to enemies for fun.
- Added a new attribute to BaseSporeSacProjectile to allow Clawmerang & Mycoroot spores to home without prematurely fading.
2026-06-08 11:13:48 +07:00

68 lines
3.0 KiB
C#

using CalamityMod.Buffs.StatBuffs;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Rogue
{
public class InfestedClawmerangProj : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Rogue";
public override string Texture => "CalamityMod/Items/Weapons/Rogue/InfestedClawmerang";
public override void SetDefaults()
{
Projectile.width = 30;
Projectile.height = 30;
Projectile.friendly = true;
Projectile.penetrate = -1;
Projectile.aiStyle = ProjAIStyleID.Boomerang;
Projectile.timeLeft = 300;
AIType = ProjectileID.WoodenBoomerang;
Projectile.DamageType = RogueDamageClass.Instance;
Projectile.usesIDStaticNPCImmunity = true;
Projectile.idStaticNPCHitCooldown = 10;
}
public override void AI()
{
Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0.35f / 255f, (255 - Projectile.alpha) * 0.5f / 255f);
if (Main.rand.NextBool(5))
{
Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.BlueFairy, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f);
}
if (Projectile.Calamity().stealthStrike)
{
if (Projectile.timeLeft % 15 == 0 && Projectile.owner == Main.myPlayer)
{
Vector2 sporeVel = Utils.DirectionFrom(Projectile.Center, Main.player[Projectile.owner].Center).RotatedByRandom(MathHelper.Pi) * Main.rand.NextFloat(4.5f, 6.5f);
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, sporeVel, ModContent.ProjectileType<ShroomerangSpore>(), (int)(Projectile.damage * 0.5f), 1f, Projectile.owner, -10f, 1f, 1f);
}
}
}
public override bool PreDraw(ref Color lightColor)
{
Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value;
Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0);
return false;
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
Player player = Main.player[Projectile.owner];
if (Projectile.Calamity().stealthStrike)
player.AddBuff(ModContent.BuffType<Mushy>(), 720);
}
public override void OnHitPlayer(Player target, Player.HurtInfo info)
{
Player player = Main.player[Projectile.owner];
if (Projectile.Calamity().stealthStrike)
player.AddBuff(ModContent.BuffType<Mushy>(), 720);
}
}
}