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.
109 lines
5.2 KiB
C#
109 lines
5.2 KiB
C#
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
using Terraria.Audio;
|
|
using CalamityMod.Buffs.DamageOverTime;
|
|
using CalamityMod.Buffs.StatDebuffs;
|
|
|
|
namespace CalamityMod.Projectiles.Summon
|
|
{
|
|
public class EXPLODINGFROG : ModProjectile
|
|
{
|
|
public const float MinExplodeDistance = 120f;
|
|
public const float ExplodeWaitTime = 45f;
|
|
public const float ExplosionAngleVariance = 0.8f;
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("A not frog of the explosive variety");
|
|
Main.projFrames[Projectile.type] = 5;
|
|
ProjectileID.Sets.MinionSacrificable[Projectile.type] = true;
|
|
ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true;
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
Projectile.width = 44;
|
|
Projectile.height = 26;
|
|
Projectile.ignoreWater = true;
|
|
Projectile.tileCollide = true;
|
|
Projectile.sentry = true;
|
|
Projectile.timeLeft = Projectile.SentryLifeTime;
|
|
Projectile.penetrate = -1;
|
|
Projectile.DamageType = DamageClass.Summon;
|
|
}
|
|
|
|
public override void AI()
|
|
{
|
|
if (Projectile.frameCounter++ > 5)
|
|
{
|
|
Projectile.frame++;
|
|
Projectile.frameCounter = 0;
|
|
}
|
|
if (Projectile.frame >= Main.projFrames[Projectile.type])
|
|
{
|
|
Projectile.frame = 0;
|
|
}
|
|
Player player = Main.player[Projectile.owner];
|
|
bool canExplode = Projectile.Center.ClosestNPCAt(MinExplodeDistance) != null;
|
|
if (player.HasMinionAttackTargetNPC)
|
|
{
|
|
canExplode = Main.npc[player.MinionAttackTargetNPC].Distance(Projectile.Center) < MinExplodeDistance;
|
|
}
|
|
if (canExplode)
|
|
Projectile.ai[0]++;
|
|
if (Projectile.ai[0] >= ExplodeWaitTime)
|
|
{
|
|
if (Main.myPlayer == Projectile.owner)
|
|
{
|
|
// Goop projectiles
|
|
for (int i = 0; i < 3; i++)
|
|
{
|
|
int p = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center,
|
|
new Vector2(0f, -Main.rand.NextFloat(6f, 10f)).RotatedByRandom(ExplosionAngleVariance),
|
|
ModContent.ProjectileType<FrogGore1>(), Projectile.damage, Projectile.knockBack, Projectile.owner);
|
|
if (Main.projectile.IndexInRange(p))
|
|
Main.projectile[p].originalDamage = Projectile.originalDamage;
|
|
p = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center,
|
|
new Vector2(0f, -Main.rand.NextFloat(6f, 10f)).RotatedByRandom(ExplosionAngleVariance),
|
|
ModContent.ProjectileType<FrogGore2>(), Projectile.damage, Projectile.knockBack, Projectile.owner);
|
|
if (Main.projectile.IndexInRange(p))
|
|
Main.projectile[p].originalDamage = Projectile.originalDamage;
|
|
}
|
|
int p2 = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center,
|
|
new Vector2(0f, -Main.rand.NextFloat(6f, 10f)).RotatedByRandom(ExplosionAngleVariance),
|
|
ModContent.ProjectileType<FrogGore3>(), Projectile.damage, Projectile.knockBack, Projectile.owner);
|
|
if (Main.projectile.IndexInRange(p2))
|
|
Main.projectile[p2].originalDamage = Projectile.originalDamage;
|
|
p2 = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center,
|
|
new Vector2(0f, -Main.rand.NextFloat(6f, 10f)).RotatedByRandom(ExplosionAngleVariance),
|
|
ModContent.ProjectileType<FrogGore4>(), Projectile.damage, Projectile.knockBack, Projectile.owner);
|
|
if (Main.projectile.IndexInRange(p2))
|
|
Main.projectile[p2].originalDamage = Projectile.originalDamage;
|
|
p2 = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center,
|
|
new Vector2(0f, -Main.rand.NextFloat(6f, 10f)).RotatedByRandom(ExplosionAngleVariance),
|
|
ModContent.ProjectileType<FrogGore5>(), Projectile.damage, Projectile.knockBack, Projectile.owner);
|
|
if (Main.projectile.IndexInRange(p2))
|
|
Main.projectile[p2].originalDamage = Projectile.originalDamage;
|
|
}
|
|
// WoF vomit sound.
|
|
SoundEngine.PlaySound(SoundID.NPCDeath13, Projectile.Center);
|
|
Projectile.Kill();
|
|
}
|
|
Projectile.velocity.Y += 0.5f;
|
|
|
|
if (Projectile.velocity.Y > 10f)
|
|
{
|
|
Projectile.velocity.Y = 10f;
|
|
}
|
|
|
|
Projectile.StickToTiles(false, false);
|
|
}
|
|
|
|
public override bool? CanDamage() => false;
|
|
|
|
// Don't die on tile collision
|
|
public override bool OnTileCollide(Vector2 oldVelocity) => false;
|
|
}
|
|
}
|