Files
CalamityModPublic/Projectiles/Summon/MechwormLaser.cs
T
mountaindrew10 c098604fd0 1 - Blood Clot Staff now inflicts Burning Blood.
2 - Cinder Blossom Staff now inflicts On Fire!
3 - Eye of Night no longer inflicts any debuffs.
4 - Caustic Staff now inflicts Hellfire instead of On Fire!
5 - Daedalus Golem Staff pellets now inflict Frostburn.
6 - Forgotten Apex Wand now has a 33% chance to inflict Armor Crunch.
7 - Gastric Belcher Staff acid vomit now inflicts Acid Venom.
8 - Tundra Flame Blossoms Staff now inflicts On Fire!
9 - Dragonblood Disgorger large dragon blood fire now inflicts Burning Blood.
10 - Elemental Axe no longer inflicts any debuffs.
11 - Flowers of Mortality no longer inflicts any debuffs.
12 - Midnight Sun Beacon no longer inflicts any debuffs.
13 - Staff of the Mechworm now inflicts God Slayer Inferno.
14 - Yharon's Kindle Staff now inflicts Dragonfire.
15 - Caustic Croaker Staff now inflicts Irradiated.
16 - Orthocera Shell now inflicts Irradiated.
17 - Cadaverous Carrion now inflicts Sulphuric Poisoning.
18 - Energy Staff now inflicts Holy Flames.
19 - Guidelight of Oblivion no longer inflicts any debuffs.
20 - Slime Puppet Staff now inflicts Slime.
21 - Cinder of Lament now inflicts Vulnerability Hex.
22 - Universe Splitter no longer inflicts Nightwither.
2022-12-04 23:10:15 -06:00

77 lines
2.6 KiB
C#

using CalamityMod.Buffs.DamageOverTime;
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Summon
{
public class MechwormLaser : ModProjectile
{
public override string Texture => "CalamityMod/Projectiles/LaserProj";
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Laser");
ProjectileID.Sets.MinionShot[Projectile.type] = true;
}
public override void SetDefaults()
{
Projectile.width = 5;
Projectile.height = 5;
Projectile.friendly = true;
Projectile.alpha = 255;
Projectile.penetrate = 4;
Projectile.extraUpdates = 2;
Projectile.timeLeft = 600;
Projectile.minion = true;
Projectile.minionSlots = 0;
Projectile.tileCollide = false;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 30;
Projectile.DamageType = DamageClass.Summon;
}
public override void AI()
{
// Very quickly fade in.
Projectile.alpha = Utils.Clamp(Projectile.alpha - 25, 0, 255);
Lighting.AddLight(Projectile.Center, Color.Cyan.ToVector3());
if (Projectile.ai[1] == 0f)
{
Projectile.localAI[0] += 6f;
if (Projectile.localAI[0] > 30)
Projectile.localAI[0] = 30;
}
else
{
Projectile.localAI[0] -= 6f;
if (Projectile.localAI[0] <= 0f)
{
Projectile.Kill();
}
}
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) => target.AddBuff(ModContent.BuffType<GodSlayerInferno>(), 120);
public override Color? GetAlpha(Color lightColor) => Color.Lerp(Color.Fuchsia, Color.Cyan, (float)Math.Sin(Main.GlobalTimeWrappedHourly * 1.9f + Projectile.identity * 2.4f) * 0.5f + 0.5f);
public override bool PreDraw(ref Color lightColor) => Projectile.DrawBeam(100f, 3f, lightColor);
public override void Kill(int timeLeft)
{
int dustAmt = Main.rand.Next(3, 7);
for (int d = 0; d < dustAmt; d++)
{
int rainbow = Dust.NewDust(Projectile.Center - Projectile.velocity / 2f, 0, 0, 66, 0f, 0f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 2.1f);
Main.dust[rainbow].velocity *= 2f;
Main.dust[rainbow].noGravity = true;
}
}
}
}