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

96 lines
3.7 KiB
C#

using CalamityMod.Buffs.StatDebuffs;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Summon
{
public class CausticStaffProjectile : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Thorn");
ProjectileID.Sets.MinionShot[Projectile.type] = true;
}
public override void SetDefaults()
{
Projectile.width = 10;
Projectile.height = 10;
Projectile.friendly = true;
Projectile.minion = true;
Projectile.minionSlots = 0f;
Projectile.ignoreWater = true;
Projectile.penetrate = 3;
Projectile.timeLeft = 360;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 10;
Projectile.extraUpdates = 1;
Projectile.tileCollide = false;
Projectile.DamageType = DamageClass.Summon;
}
public override void AI()
{
int fire = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 6, 0f, 0f, 0, default, 0.5f);
Dust dust = Main.dust[fire];
dust.velocity *= 0.1f;
dust.scale = 1.3f;
dust.noGravity = true;
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2;
Projectile.velocity.X *= 0.99f;
if (Projectile.velocity.Y < 9f)
Projectile.velocity.Y += 0.085f;
}
public override void Kill(int timeLeft)
{
for (int i = 0; i < 5; i++)
{
Dust dust = Dust.NewDustPerfect(Projectile.Center, 6);
dust.noGravity = true;
dust.velocity = Vector2.UnitY.RotatedByRandom(MathHelper.TwoPi) * Main.rand.NextFloat(2f);
}
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
Player player = Main.player[Projectile.owner];
if ((player.ActiveItem().CountsAsClass<SummonDamageClass>() &&
!player.ActiveItem().CountsAsClass<MeleeDamageClass>() &&
!player.ActiveItem().CountsAsClass<RangedDamageClass>() &&
!player.ActiveItem().CountsAsClass<MagicDamageClass>() &&
!player.ActiveItem().CountsAsClass<ThrowingDamageClass>()) ||
player.ActiveItem().hammer > 0 ||
player.ActiveItem().pick > 0 ||
player.ActiveItem().axe > 0)
{
int duration = Main.rand.Next(60, 181); // Anywhere between 1 and 3 seconds
switch ((int)Projectile.ai[0])
{
case 0:
if (target.Calamity().marked <= 0)
target.AddBuff(ModContent.BuffType<MarkedforDeath>(), duration);
break;
case 1:
if (!target.ichor)
target.AddBuff(BuffID.Ichor, duration);
break;
case 2:
if (!target.venom)
target.AddBuff(BuffID.Venom, duration);
break;
case 3:
if (!target.onFire2)
target.AddBuff(BuffID.CursedInferno, duration);
break;
case 4:
if (!target.onFire3)
target.AddBuff(BuffID.OnFire3, duration);
break;
default:
break;
}
}
}
}
}