Files
CalamityModPublic/Projectiles/Magic/BeastScythe.cs
T
mountaindrew10 4626974709 1 - Inferna Cutter now inflicts Hellfire instead of On Fire! and no longer inflicts Brimstone Flames.
2 - Mantis Claws now inflict Hellfire.
3 - Vulcanite Lance now inflicts Hellfire instead of On Fire!
4 - Fault Line now inflicts Hellfire instead of On Fire!
5 - Blood Bath now inflicts Burning Blood.
6 - Shaderain Staff no longer inflicts any debuffs.
7 - Icicle Trident no longer inflicts Glacial State.
8 - Infernal Rift now inflicts Hellfire instead of Brimstone Flames.
9 - Vesuvius no longer buffs the player with Molten and now inflicts Hellfire.
10 - Deathhail Staff now inflicts God Slayer Inferno instead of On Fire! and Frostburn.
11 - Divine Retribution no longer inflicts Crush Depth.
12 - Elemental Ray no longer inflicts any debuffs.
13 - Helium Flash no longer inflicts Irradiated.
14 - Ice Barrage no longer inflicts Exo Freeze.
15 - Sanguine Flare no longer inflicts any debuffs.
16 - Soul Piercer now inflicts God Slayer Inferno.
17 - Staff of Blushie now only inflicts Daybroken.
18 - Ultra Liquidator no longer inflicts any debuffs and no longer requires Ichor/Cursed Flames to craft.
19 - Venusian Trident now inflicts Daybroken instead of On Fire!
20 - The Wand now only inflicts Dragonfire.
21 - Gatling Laser no longer inflicts any debuffs.
22 - Ion Blaster no longer inflicts any debuffs.
23 - Lazhar now inflicts Daybroken instead of On Fire!
24 - Aetherflux Cannon now inflicts Holy Flames.
25 - Apoctosis Array no longer inflicts any debuffs.
26 - Plasma Caster no longer inflicts any debuffs.
27 - Purge Guzzler no longer inflicts On Fire!
28 - Death Valley Duster now inflicts Armor Crunch.
29 - Forbidden Sun now inflicts Hellfire instead of On Fire!
30 - Frigidflash Bolt now inflicts Hellfire instead of On Fire!
31 - Poseidon now inflicts Eutrophication.
32 - Primordial Earth now inflicts Armor Crunch.
33 - Seething Discharge now inflicts Brimstone Flames.
34 - Tome of Fates no longer inflicts Brimstone Flames.
35 - Apotheosis no longer inflicts Armor Crunch, Demon Flames and Exo Freeze, but now inflicts Whispering Death.
36 - Augur of the Elements no longer inflicts any debuffs.
37 - Event Horizon no longer inflicts any debuffs.
38 - Nuclear Fury no longer inflicts any debuffs.
39 - Primordial Ancient now inflicts Armor Crunch.
40 - Recitation of the Beast no longer inflicts any debuffs.
41 - Arctic Bear Paw no longer inflicts Confused.
42 - Mad Alchemist's Cocktail Glove no longer inflicts Poisoned, On Fire!, Cursed Inferno, Shadowflame and Frostburn, but now inflicts Electrified and the debuff durations have been doubled.
43 - Yharim's Crystal now inflicts Dragonfire.
2022-12-05 02:47:40 -06:00

181 lines
8.0 KiB
C#

using CalamityMod.Buffs.DamageOverTime;
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
namespace CalamityMod.Projectiles.Magic
{
public class BeastScythe : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Scythe");
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8;
ProjectileID.Sets.TrailingMode[Projectile.type] = 1;
}
public override void SetDefaults()
{
Projectile.width = 50;
Projectile.height = 54;
Projectile.alpha = 255;
Projectile.friendly = true;
Projectile.ignoreWater = true;
Projectile.netImportant = true;
Projectile.penetrate = 1;
Projectile.timeLeft = 600;
Projectile.DamageType = DamageClass.Magic;
Projectile.extraUpdates = 1;
Projectile.tileCollide = false;
}
public override void AI()
{
if (Projectile.alpha > 0)
{
Projectile.alpha -= 20;
}
if (Projectile.alpha < 0)
{
Projectile.alpha = 0;
}
Projectile.rotation += 0.5f;
Lighting.AddLight(Projectile.Center, 0.35f, 0f, 0.35f);
if (Main.rand.NextBool(3))
{
Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 173, Projectile.velocity.X * 0.25f, Projectile.velocity.Y * 0.25f);
}
Projectile.ai[0] += 1f;
if (Projectile.ai[0] <= 30f)
{
Projectile.velocity *= 0.999f;
}
if (Main.myPlayer == Projectile.owner && Projectile.ai[0] == 30f)
{
if (Main.player[Projectile.owner].channel)
{
float num115 = 20f;
Vector2 vector10 = new Vector2(Projectile.position.X + (float)Projectile.width * 0.5f, Projectile.position.Y + (float)Projectile.height * 0.5f);
float num116 = (float)Main.mouseX + Main.screenPosition.X - vector10.X;
float num117 = (float)Main.mouseY + Main.screenPosition.Y - vector10.Y;
if (Main.player[Projectile.owner].gravDir == -1f)
{
num117 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector10.Y;
}
float num118 = (float)Math.Sqrt((double)(num116 * num116 + num117 * num117));
num118 = (float)Math.Sqrt((double)(num116 * num116 + num117 * num117));
if (num118 > num115)
{
num118 = num115 / num118;
num116 *= num118;
num117 *= num118;
int num119 = (int)(num116 * 1000f);
int num120 = (int)(Projectile.velocity.X * 1000f);
int num121 = (int)(num117 * 1000f);
int num122 = (int)(Projectile.velocity.Y * 1000f);
if (num119 != num120 || num121 != num122)
{
Projectile.netUpdate = true;
}
Projectile.velocity.X = num116;
Projectile.velocity.Y = num117;
}
else
{
int num123 = (int)(num116 * 1000f);
int num124 = (int)(Projectile.velocity.X * 1000f);
int num125 = (int)(num117 * 1000f);
int num126 = (int)(Projectile.velocity.Y * 1000f);
if (num123 != num124 || num125 != num126)
{
Projectile.netUpdate = true;
}
Projectile.velocity.X = num116;
Projectile.velocity.Y = num117;
}
}
else
{
Projectile.netUpdate = true;
float num127 = 20f;
Vector2 vector11 = new Vector2(Projectile.position.X + (float)Projectile.width * 0.5f, Projectile.position.Y + (float)Projectile.height * 0.5f);
float num128 = (float)Main.mouseX + Main.screenPosition.X - vector11.X;
float num129 = (float)Main.mouseY + Main.screenPosition.Y - vector11.Y;
if (Main.player[Projectile.owner].gravDir == -1f)
{
num129 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector11.Y;
}
float num130 = (float)Math.Sqrt((double)(num128 * num128 + num129 * num129));
if (num130 == 0f || Projectile.ai[0] < 0f)
{
vector11 = new Vector2(Main.player[Projectile.owner].position.X + (float)(Main.player[Projectile.owner].width / 2), Main.player[Projectile.owner].position.Y + (float)(Main.player[Projectile.owner].height / 2));
num128 = Projectile.position.X + (float)Projectile.width * 0.5f - vector11.X;
num129 = Projectile.position.Y + (float)Projectile.height * 0.5f - vector11.Y;
num130 = (float)Math.Sqrt((double)(num128 * num128 + num129 * num129));
}
num130 = num127 / num130;
num128 *= num130;
num129 *= num130;
Projectile.velocity.X = num128;
Projectile.velocity.Y = num129;
}
}
if (Projectile.ai[0] >= 30f)
{
Projectile.velocity *= 1.001f;
CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 12f, 20f);
}
}
public override void Kill(int timeLeft)
{
SoundEngine.PlaySound(SoundID.Item14, Projectile.position);
Projectile.position = Projectile.Center;
Projectile.width = Projectile.height = 100;
Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2);
Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2);
Projectile.maxPenetrate = -1;
Projectile.penetrate = -1;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 10;
Projectile.damage /= 2;
Projectile.Damage();
bool flag = WorldGen.SolidTile(Framing.GetTileSafely((int)Projectile.position.X / 16, (int)Projectile.position.Y / 16));
for (int m = 0; m < 4; m++)
{
Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 173, 0f, 0f, 100, default, 1.5f);
}
for (int n = 0; n < 4; n++)
{
int num10 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 173, 0f, 0f, 0, default, 2.5f);
Main.dust[num10].noGravity = true;
Main.dust[num10].velocity *= 3f;
if (flag)
{
Main.dust[num10].noLight = true;
}
num10 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 173, 0f, 0f, 100, default, 1.5f);
Main.dust[num10].velocity *= 2f;
Main.dust[num10].noGravity = true;
if (flag)
{
Main.dust[num10].noLight = true;
}
}
}
public override bool PreDraw(ref Color lightColor)
{
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2);
return false;
}
}
}