2 - Holy Fire Bullets no longer inflicts On Fire! 3 - Icy Bullets no longer inflict Glacial State. 4 - Toxibow now inflicts Irradiated for 8 seconds. 5 - Corroded Caustibow no longer inflicts Sulphuric Poisoning but increased duration of Irradiated to 8 seconds. 6 - Flarewing Bow bats now inflict Hellfire. 7 - Arterial Assault no longer inflicts Brimstone Flames. 8 - Contagion no longer inflicts Plague. 9 - Deathwind now inflicts God Slayer Inferno instead of On Fire! and Frostburn. 10 - Drataliornus now only inflicts Dragonfire. 11 - The Maelstrom now inflicts Crush Depth. 12 - Eviscerator now inflicts Burning Blood. 13 - Clamor Rifle now inflicts Eutrophication. 14 - Hellborn now inflicts Hellfire on gun hits. 15 - Helstorm now inflicts Hellfire on gun hits. 16 - Leviatitan no longer inflicts Poisoned. 17 - Needler now inflicts Acid Venom. 18 - Ace's High no longer inflicts Brimstone Flames. 19 - Auralis no longer inflicts Cursed Inferno and Ichor. 20 - Claret Cannon no longer inflicts Brimstone Flames. 21 - Dragon's Breath no longer inflicts On Fire! 22 - Karasawa no longer inflicts any debuffs. 23 - Spyker now inflicts Acid Venom. 24 - Universal Genesis no longer inflicts any debuffs. 25 - Mineral Mortar now inflicts Armor Crunch. 26 - Blissful Bombardier now inflicts Holy Flames instead of Dragonfire. 27 - Chicken Cannon now inflicts Dragonfire. 28 - Scorched Earth no longer inflicts On Fire! 29 - Dragoon Drizzlefish now inflicts Brimstone Flames for 1 second with primary fireballs and 0.5 seconds with split fireballs. 30 - Meowthrower no longer inflicts any debuffs. 31 - Blood Boiler no longer inflicts Brimstone Flames. 32 - Elemental Eruption no longer inflicts any debuffs. 33 - Flak Kraken now inflicts Crush Depth. 34 - Elemental Blaster no longer inflicts any debuffs. 35 - Heavy Laser Rifle no longer inflicts On Fire! 36 - Spetic Skewer no longer inflicts Acid Venom. 37 - Starmada no longer inflicts any debuffs. 38 - Sulphuric Acid Cannon now inflicts Sulphuric Poisoning.
91 lines
3.5 KiB
C#
91 lines
3.5 KiB
C#
using Microsoft.Xna.Framework;
|
|
using System;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
using Terraria.Audio;
|
|
using CalamityMod.Buffs.DamageOverTime;
|
|
|
|
namespace CalamityMod.Projectiles.Ranged
|
|
{
|
|
public class ChickenExplosion : ModProjectile
|
|
{
|
|
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
|
|
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Kentucky Fried Explosion");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
Projectile.width = 1000;
|
|
Projectile.height = 1000;
|
|
Projectile.friendly = true;
|
|
Projectile.ignoreWater = false;
|
|
Projectile.tileCollide = false;
|
|
Projectile.penetrate = -1;
|
|
Projectile.timeLeft = 150;
|
|
Projectile.DamageType = DamageClass.Ranged;
|
|
Projectile.usesLocalNPCImmunity = true;
|
|
Projectile.localNPCHitCooldown = 15;
|
|
}
|
|
|
|
public override void AI()
|
|
{
|
|
Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.75f / 255f, (255 - Projectile.alpha) * 0.5f / 255f, (255 - Projectile.alpha) * 0.01f / 255f);
|
|
if (Projectile.localAI[0] == 0f)
|
|
{
|
|
SoundEngine.PlaySound(SoundID.Item20, Projectile.position);
|
|
Projectile.localAI[0] += 1f;
|
|
}
|
|
|
|
EmitDust();
|
|
}
|
|
|
|
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
|
{
|
|
target.AddBuff(ModContent.BuffType<Dragonfire>(), 300);
|
|
}
|
|
|
|
public override void OnHitPvp(Player target, int damage, bool crit)
|
|
{
|
|
target.AddBuff(ModContent.BuffType<Dragonfire>(), 300);
|
|
}
|
|
|
|
public void EmitDust()
|
|
{
|
|
if (Main.dedServ)
|
|
return;
|
|
|
|
for (int i = 0; i < 70; i++)
|
|
{
|
|
// The exponent being greater than 1 gives the randomness a bias towards 0. This means that more dust will spawn
|
|
// closer to the center than the edge.
|
|
Vector2 dustSpawnOffset = Main.rand.NextVector2Unit() * (float)Math.Pow(Main.rand.NextFloat(), 2.4D) * Projectile.Size * 0.5f;
|
|
|
|
// Dust should fly off more quickly the farther away it is from the center.
|
|
// At 5% out, a speed of 5 pixels/second is achieved. At 85%, a speed of 15 pixels/second is.
|
|
// Direction is determined based on the outward direction rotated by anywhere from -90 to 90 degrees.
|
|
Vector2 dustVelocity = dustSpawnOffset.SafeNormalize(Vector2.UnitY).RotatedByRandom(MathHelper.PiOver2 * Main.rand.NextFloatDirection());
|
|
dustVelocity *= MathHelper.Lerp(5f, 15f, Utils.GetLerpValue(0.05f, 0.85f, (dustSpawnOffset / Projectile.Size / 0.5f).Length()));
|
|
|
|
// Fire variants.
|
|
int dustType = 6;
|
|
if (Main.rand.NextBool(4))
|
|
dustType = 244;
|
|
|
|
// Smoke.
|
|
if (Main.rand.NextBool(7))
|
|
dustType = 31;
|
|
|
|
Dust flame = Dust.NewDustPerfect(Projectile.Center + dustSpawnOffset, dustType, dustVelocity);
|
|
flame.scale = Main.rand.NextFloat(0.85f, 1.3f);
|
|
flame.noGravity = true;
|
|
}
|
|
}
|
|
|
|
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, Projectile.Size.Length() * 0.5f, targetHitbox);
|
|
}
|
|
}
|