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.
85 lines
3.3 KiB
C#
85 lines
3.3 KiB
C#
using CalamityMod.Buffs.DamageOverTime;
|
|
using Microsoft.Xna.Framework;
|
|
using CalamityMod.Dusts;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
using Terraria.Audio;
|
|
namespace CalamityMod.Projectiles.Summon
|
|
{
|
|
public class AstralProbeRound : ModProjectile
|
|
{
|
|
public override string Texture => "CalamityMod/Projectiles/Ranged/AstralRound";
|
|
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Blast");
|
|
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6;
|
|
ProjectileID.Sets.TrailingMode[Projectile.type] = 0;
|
|
ProjectileID.Sets.MinionShot[Projectile.type] = true;
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
Projectile.width = 4;
|
|
Projectile.height = 4;
|
|
Projectile.friendly = true;
|
|
Projectile.ignoreWater = true;
|
|
Projectile.tileCollide = false;
|
|
Projectile.minionSlots = 0f;
|
|
Projectile.minion = true;
|
|
Projectile.penetrate = 1;
|
|
Projectile.timeLeft = 300;
|
|
Projectile.extraUpdates = 2;
|
|
Projectile.DamageType = DamageClass.Summon;
|
|
}
|
|
|
|
public override void AI()
|
|
{
|
|
Lighting.AddLight(Projectile.Center, 0.3f, 0.5f, 0.1f);
|
|
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2;
|
|
if (Main.rand.NextBool(3))
|
|
{
|
|
int randomDust = Utils.SelectRandom(Main.rand, new int[]
|
|
{
|
|
ModContent.DustType<AstralOrange>(),
|
|
ModContent.DustType<AstralBlue>()
|
|
});
|
|
int astral = Dust.NewDust(Projectile.position, 1, 1, randomDust, 0f, 0f, 0, default, 0.5f);
|
|
Main.dust[astral].alpha = Projectile.alpha;
|
|
Main.dust[astral].velocity *= 0f;
|
|
Main.dust[astral].noGravity = true;
|
|
}
|
|
NPC potentialTarget = Projectile.Center.MinionHoming(1200f, Main.player[Projectile.owner]);
|
|
if (potentialTarget != null)
|
|
Projectile.velocity = (Projectile.velocity * 20f + Projectile.SafeDirectionTo(potentialTarget.Center) * 17f) / 21f;
|
|
}
|
|
|
|
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) => target.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 120);
|
|
|
|
public override bool PreDraw(ref Color lightColor)
|
|
{
|
|
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1);
|
|
return false;
|
|
}
|
|
|
|
public override void Kill(int timeLeft)
|
|
{
|
|
SoundEngine.PlaySound(SoundID.Item10, Projectile.position);
|
|
for (int k = 0; k < 5; k++)
|
|
{
|
|
int randomDust = Main.rand.Next(2);
|
|
if (randomDust == 0)
|
|
{
|
|
randomDust = ModContent.DustType<AstralOrange>();
|
|
}
|
|
else
|
|
{
|
|
randomDust = ModContent.DustType<AstralBlue>();
|
|
}
|
|
Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, randomDust, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f);
|
|
}
|
|
}
|
|
}
|
|
}
|