Files
CalamityModPublic/Projectiles/Summon/MortalityBeam.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

74 lines
3.1 KiB
C#

using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Summon
{
public class MortalityBeam : ModProjectile
{
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public ref float Time => ref Projectile.ai[0];
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Beam");
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10;
ProjectileID.Sets.TrailingMode[Projectile.type] = 0;
ProjectileID.Sets.MinionShot[Projectile.type] = true;
}
public override void SetDefaults()
{
Projectile.width = Projectile.height = 20;
Projectile.friendly = true;
Projectile.ignoreWater = true;
Projectile.tileCollide = false;
Projectile.minionSlots = 0f;
Projectile.minion = true;
Projectile.penetrate = 1;
Projectile.timeLeft = 180;
Projectile.DamageType = DamageClass.Summon;
}
public override void AI()
{
Lighting.AddLight(Projectile.Center, Color.White.ToVector3());
if (!Main.dedServ)
{
for (int i = -1; i <= 1; i += 2)
{
float offset = (float)Math.Sin(Time / 45f * MathHelper.TwoPi) * 10f * i;
Vector2 rotatedOffset = new Vector2(offset, 2f).RotatedBy(Projectile.velocity.ToRotation() + MathHelper.PiOver2);
Dust rainbowDust = Dust.NewDustPerfect(Projectile.Center + rotatedOffset, 261);
rainbowDust.color = Main.hslToRgb(Main.rand.NextFloat(), 0.9f, 0.5f);
rainbowDust.velocity = Vector2.Zero;
rainbowDust.scale = 1.5f;
rainbowDust.noGravity = true;
}
}
Time++;
NPC potentialTarget = Projectile.Center.MinionHoming(1000f, Main.player[Projectile.owner], false);
if (potentialTarget != null)
Projectile.velocity = (Projectile.velocity * 5f + Projectile.SafeDirectionTo(potentialTarget.Center) * 13f) / 6f;
}
public override void Kill(int timeLeft)
{
if (Main.myPlayer == Projectile.owner)
{
float redHue = Main.rgbToHsl(Color.Red).X;
float greenHue = Main.rgbToHsl(Color.SeaGreen).X;
float blueHue = Main.rgbToHsl(Color.Blue).X;
Vector2 spawnPosition = Projectile.Center + Main.rand.NextVector2CircularEdge(10f, 10f);
Projectile bolt = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), spawnPosition, Main.rand.NextVector2CircularEdge(9f, 9f), ModContent.ProjectileType<MortalityBolt>(), Projectile.damage, Projectile.knockBack, Projectile.owner);
bolt.originalDamage = Projectile.originalDamage;
bolt.localAI[0] = Utils.SelectRandom(Main.rand, redHue, greenHue, blueHue);
}
}
}
}