Files
CalamityModPublic/Projectiles/Boss/ProfanedSpear.cs
T
Andrew Marheine 0ca092bee0 1 - Reworked Ethereal Extorter to not be complicated as hell.
2 - Reduced Old Die damage variance.
3 - Reduced Silva true melee damage bonus from 5x to 2x but made it trigger all the time.
4 - Reduced God Slayer ranged crit bonus damage.
5 - Removed Venerated Locket, Unstable Prism, Luxor's Gift, Dynamo Stem Cells, Moon Crown, Dragon Scales and Prismatic Regalia softcaps.
6 - Buffed Plasma Rifle left click, Viscera damage, Gilded Proboscis damage and Plasma Caster projectile speed.
7 - Nerfed Thunderstorm, Aether's Whisper, Viscera healing and Deep Sea Dumbbell flex.
2021-01-21 21:29:13 -06:00

106 lines
3.8 KiB
C#

using CalamityMod.Buffs.DamageOverTime;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.IO;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Boss
{
public class ProfanedSpear : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Profaned Spear");
ProjectileID.Sets.TrailCacheLength[projectile.type] = 4;
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
}
public override void SetDefaults()
{
projectile.Calamity().canBreakPlayerDefense = true;
projectile.width = 38;
projectile.height = 38;
projectile.hostile = true;
projectile.tileCollide = false;
projectile.penetrate = -1;
projectile.alpha = 255;
projectile.timeLeft = 300;
cooldownSlot = 1;
}
public override void SendExtraAI(BinaryWriter writer)
{
writer.Write(projectile.localAI[0]);
}
public override void ReceiveExtraAI(BinaryReader reader)
{
projectile.localAI[0] = reader.ReadSingle();
}
public override void AI()
{
if (projectile.timeLeft < 210)
projectile.tileCollide = true;
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 0.785f;
projectile.alpha -= 3;
projectile.ai[1] += 1f;
if (projectile.ai[1] <= 20f)
{
projectile.velocity.X *= 0.95f;
projectile.velocity.Y *= 0.95f;
}
else if (projectile.ai[1] > 20f && projectile.ai[1] <= 39f)
{
projectile.velocity.X *= 1.1f;
projectile.velocity.Y *= 1.1f;
}
else if (projectile.ai[1] == 40f)
{
projectile.ai[1] = 0f;
}
projectile.localAI[0] += 1f;
if (projectile.localAI[0] == 30f)
{
projectile.localAI[0] = 0f;
for (int l = 0; l < 12; l++)
{
Vector2 vector3 = Vector2.UnitX * (float)-(float)projectile.width / 2f;
vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default) * new Vector2(8f, 16f);
vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default);
int num9 = Dust.NewDust(projectile.Center, 0, 0, 244, 0f, 0f, 160, default, 1f);
Main.dust[num9].scale = 1.1f;
Main.dust[num9].noGravity = true;
Main.dust[num9].position = projectile.Center + vector3;
Main.dust[num9].velocity = projectile.velocity * 0.1f;
Main.dust[num9].velocity = Vector2.Normalize(projectile.Center - projectile.velocity * 3f - Main.dust[num9].position) * 1.25f;
}
}
}
public override Color? GetAlpha(Color lightColor)
{
return new Color(250, 150, 0, projectile.alpha);
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
return false;
}
public override void OnHitPlayer(Player target, int damage, bool crit)
{
target.AddBuff(ModContent.BuffType<HolyFlames>(), 120);
}
public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit)
{
target.Calamity().lastProjectileHit = projectile;
}
}
}