Files
CalamityModPublic/Projectiles/Rogue/HypothermiaChunk.cs
T
Storm2103 93fb9b3545 Starting with Post-DoG, most here are minor buffs/nerfs that are going to be tested after I have lunch.
Exceptions:
- Locket nerf, its still fucking broken and should not contriute that much, idk why I made the knives deal 70 when 65 or 60 were fine, given that some of the more trustworthy members of tierlistcord complained about it still being better than DScales imma go with 60
- Plasma Grenade: All plasma weapons inflict cursed inferno so why this one doesnt? will also affect weapons which use this explosion (Dynamic Pursuer) but this would barely do anything.
- Eradicator and Penumbra: Killed Yharon a minute under so a fat nerf is needed
2023-10-02 17:04:51 -04:00

94 lines
3.5 KiB
C#

using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Microsoft.Xna.Framework;
using CalamityMod.Buffs.StatDebuffs;
namespace CalamityMod.Projectiles.Rogue
{
public class HypothermiaChunk : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Rogue";
public override void SetStaticDefaults()
{
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6;
ProjectileID.Sets.TrailingMode[Projectile.type] = 0;
}
public override void SetDefaults()
{
Projectile.width = 20;
Projectile.height = 20;
Projectile.friendly = true;
Projectile.penetrate = 1;
Projectile.timeLeft = 100;
Projectile.extraUpdates = 4;
Projectile.ignoreWater = true;
Projectile.DamageType = RogueDamageClass.Instance;
Projectile.tileCollide = false;
}
public override void AI()
{
//Rotation
Projectile.spriteDirection = Projectile.direction = (Projectile.velocity.X > 0).ToDirectionInt();
Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == 1 ? 0f : MathHelper.Pi);
Lighting.AddLight(Projectile.Center, 0.1f, 0f, 0.5f);
if (Projectile.ai[0] < 0.2f)
{
Projectile.ai[0] += 0.1f;
}
else
{
Projectile.tileCollide = true;
}
if (Main.rand.NextBool(10))
{
Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 318, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f, 0, default, 0.8f);
}
}
public override void OnKill(int timeLeft)
{
for (int i = 0; i <= 3; i++)
{
Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 318, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f, 0, default, 0.8f);
}
if (Projectile.owner == Main.myPlayer)
{
int numSplits = Main.rand.NextBool() ? 4 : 3;
int type = ModContent.ProjectileType<HypothermiaShard>();
int shardDamage = (int)(Projectile.damage * 0.5f);
float shardKB = Projectile.knockBack * 0.75f;
for (int i = 0; i < numSplits; ++i)
{
Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f);
int texID = Main.rand.Next(4);
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, type, shardDamage, shardKB, Main.myPlayer, texID, 1f);
}
}
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(BuffID.Frostburn2, 300);
target.AddBuff(ModContent.BuffType<GlacialState>(), 150);
}
public override void OnHitPlayer(Player target, Player.HurtInfo info)
{
target.AddBuff(BuffID.Frostburn2, 300);
target.AddBuff(ModContent.BuffType<GlacialState>(), 150);
}
public override bool PreDraw(ref Color lightColor)
{
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1);
return false;
}
}
}