Files
CalamityModPublic/Projectiles/Magic/InfernalBlade.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

139 lines
6.6 KiB
C#

using CalamityMod.Buffs.DamageOverTime;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
namespace CalamityMod.Projectiles.Magic
{
public class InfernalBlade : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Blade");
}
public override void SetDefaults()
{
Projectile.width = 10;
Projectile.height = 10;
Projectile.friendly = true;
Projectile.alpha = 255;
Projectile.penetrate = 1;
Projectile.ignoreWater = true;
Projectile.tileCollide = true;
Projectile.timeLeft = 180;
Projectile.DamageType = DamageClass.Magic;
}
public override void AI()
{
DelegateMethods.v3_1 = new Vector3(0.6f, 1f, 1f) * 0.2f;
Utils.PlotTileLine(Projectile.Center, Projectile.Center + Projectile.velocity * 10f, 8f, DelegateMethods.CastLightOpen);
if (Projectile.alpha > 0)
{
SoundEngine.PlaySound(SoundID.Item9, Projectile.Center);
Projectile.alpha = 0;
Projectile.scale = 1.1f;
Projectile.frame = Main.rand.Next(14);
float num98 = 16f;
int num99 = 0;
while ((float)num99 < num98)
{
Vector2 vector11 = Vector2.UnitX * 0f;
vector11 += -Vector2.UnitY.RotatedBy((double)((float)num99 * (6.28318548f / num98)), default) * new Vector2(1f, 4f);
vector11 = vector11.RotatedBy((double)Projectile.velocity.ToRotation(), default);
int num100 = Dust.NewDust(Projectile.Center, 0, 0, 182, 0f, 0f, 0, default, 1f);
Main.dust[num100].scale = 1.5f;
Main.dust[num100].noGravity = true;
Main.dust[num100].position = Projectile.Center + vector11;
Main.dust[num100].velocity = Projectile.velocity * 0f + vector11.SafeNormalize(Vector2.UnitY) * 1f;
num99++;
}
}
Projectile.rotation = Projectile.velocity.ToRotation() + 0.7853982f;
}
public override void Kill(int timeLeft)
{
Collision.HitTiles(Projectile.position, Projectile.velocity, Projectile.width, Projectile.height);
SoundEngine.PlaySound(SoundID.Item10, Projectile.position);
int dustAmt = Main.rand.Next(4, 10);
for (int d = 0; d < dustAmt; d++)
{
int fire = Dust.NewDust(Projectile.Center, 0, 0, 182, 0f, 0f, 100, default, 1f);
Dust dust = Main.dust[fire];
dust.velocity *= 1.6f;
dust.velocity.Y -= 1f;
dust.velocity += -Projectile.velocity * (Main.rand.NextFloat() * 2f - 1f) * 0.5f;
dust.scale = 2f;
dust.fadeIn = 0.5f;
dust.noGravity = true;
}
}
public override Color? GetAlpha(Color lightColor) => new Color(255, 50, 50, 0);
public override bool PreDraw(ref Color lightColor)
{
SpriteEffects spriteEffects = SpriteEffects.None;
if (Projectile.spriteDirection == -1)
{
spriteEffects = SpriteEffects.FlipHorizontally;
}
Color color25 = Lighting.GetColor((int)((double)Projectile.position.X + (double)Projectile.width * 0.5) / 16, (int)(((double)Projectile.position.Y + (double)Projectile.height * 0.5) / 16.0));
Texture2D texture2D3 = ModContent.Request<Texture2D>(Texture).Value;
int num155 = ModContent.Request<Texture2D>(Texture).Value.Height / Main.projFrames[Projectile.type];
int y3 = num155 * Projectile.frame;
Rectangle rectangle = new Rectangle(0, y3, texture2D3.Width, num155);
Vector2 origin2 = rectangle.Size() / 2f;
float num158 = 0f;
int num156 = 3;
int num157 = 1;
float value4 = 8f;
rectangle = new Rectangle(38 * Projectile.frame, 0, 38, 38);
origin2 = rectangle.Size() / 2f;
for (int num159 = 1; num159 < num156; num159 += num157)
{
Color color26 = color25;
color26 = Projectile.GetAlpha(color26);
color26 *= (float)(num156 - num159) / ((float)ProjectileID.Sets.TrailCacheLength[Projectile.type] * 1.5f);
Vector2 value5 = Projectile.oldPos[num159];
float num160 = Projectile.rotation;
SpriteEffects effects = spriteEffects;
if (ProjectileID.Sets.TrailingMode[Projectile.type] == 2)
{
num160 = Projectile.oldRot[num159];
effects = (Projectile.oldSpriteDirection[num159] == -1) ? SpriteEffects.FlipHorizontally : SpriteEffects.None;
}
Main.spriteBatch.Draw(texture2D3, value5 + Projectile.Size / 2f - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), color26, num160 + Projectile.rotation * num158 * (float)(num159 - 1) * (float)-(float)spriteEffects.HasFlag(SpriteEffects.FlipHorizontally).ToDirectionInt(), origin2, MathHelper.Lerp(Projectile.scale, value4, (float)num159 / 15f), effects, 0f);
}
Color color28 = Projectile.GetAlpha(color25);
Main.spriteBatch.Draw(texture2D3, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), color28, Projectile.rotation, origin2, Projectile.scale, SpriteEffects.None, 0);
return false;
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
OnHitEffects(target.Center);
target.AddBuff(BuffID.OnFire3, 180);
}
public override void OnHitPvp(Player target, int damage, bool crit)
{
OnHitEffects(target.Center);
target.AddBuff(BuffID.OnFire3, 180);
}
private void OnHitEffects(Vector2 targetPos)
{
if (Projectile.owner == Main.myPlayer)
{
var source = Projectile.GetSource_FromThis();
CalamityUtils.ProjectileBarrage(source, Projectile.Center, targetPos, Main.rand.NextBool(), 800f, 800f, 0f, 800f, 10f, ModContent.ProjectileType<InfernalBlade2>(), (int)(Projectile.damage * 0.75), 1f, Projectile.owner, true);
}
}
}
}