2 - Mantis Claws now inflict Hellfire. 3 - Vulcanite Lance now inflicts Hellfire instead of On Fire! 4 - Fault Line now inflicts Hellfire instead of On Fire! 5 - Blood Bath now inflicts Burning Blood. 6 - Shaderain Staff no longer inflicts any debuffs. 7 - Icicle Trident no longer inflicts Glacial State. 8 - Infernal Rift now inflicts Hellfire instead of Brimstone Flames. 9 - Vesuvius no longer buffs the player with Molten and now inflicts Hellfire. 10 - Deathhail Staff now inflicts God Slayer Inferno instead of On Fire! and Frostburn. 11 - Divine Retribution no longer inflicts Crush Depth. 12 - Elemental Ray no longer inflicts any debuffs. 13 - Helium Flash no longer inflicts Irradiated. 14 - Ice Barrage no longer inflicts Exo Freeze. 15 - Sanguine Flare no longer inflicts any debuffs. 16 - Soul Piercer now inflicts God Slayer Inferno. 17 - Staff of Blushie now only inflicts Daybroken. 18 - Ultra Liquidator no longer inflicts any debuffs and no longer requires Ichor/Cursed Flames to craft. 19 - Venusian Trident now inflicts Daybroken instead of On Fire! 20 - The Wand now only inflicts Dragonfire. 21 - Gatling Laser no longer inflicts any debuffs. 22 - Ion Blaster no longer inflicts any debuffs. 23 - Lazhar now inflicts Daybroken instead of On Fire! 24 - Aetherflux Cannon now inflicts Holy Flames. 25 - Apoctosis Array no longer inflicts any debuffs. 26 - Plasma Caster no longer inflicts any debuffs. 27 - Purge Guzzler no longer inflicts On Fire! 28 - Death Valley Duster now inflicts Armor Crunch. 29 - Forbidden Sun now inflicts Hellfire instead of On Fire! 30 - Frigidflash Bolt now inflicts Hellfire instead of On Fire! 31 - Poseidon now inflicts Eutrophication. 32 - Primordial Earth now inflicts Armor Crunch. 33 - Seething Discharge now inflicts Brimstone Flames. 34 - Tome of Fates no longer inflicts Brimstone Flames. 35 - Apotheosis no longer inflicts Armor Crunch, Demon Flames and Exo Freeze, but now inflicts Whispering Death. 36 - Augur of the Elements no longer inflicts any debuffs. 37 - Event Horizon no longer inflicts any debuffs. 38 - Nuclear Fury no longer inflicts any debuffs. 39 - Primordial Ancient now inflicts Armor Crunch. 40 - Recitation of the Beast no longer inflicts any debuffs. 41 - Arctic Bear Paw no longer inflicts Confused. 42 - Mad Alchemist's Cocktail Glove no longer inflicts Poisoned, On Fire!, Cursed Inferno, Shadowflame and Frostburn, but now inflicts Electrified and the debuff durations have been doubled. 43 - Yharim's Crystal now inflicts Dragonfire.
119 lines
4.1 KiB
C#
119 lines
4.1 KiB
C#
using CalamityMod.Buffs.StatDebuffs;
|
|
using CalamityMod.Items.Weapons.Magic;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
using Terraria.Audio;
|
|
namespace CalamityMod.Projectiles.Magic
|
|
{
|
|
public class VolatileStarcore : ModProjectile
|
|
{
|
|
private static int Lifetime = 240;
|
|
private static int NumAnimationFrames = 6;
|
|
private static int AnimationFrameTime = 2;
|
|
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Volatile Starcore");
|
|
Main.projFrames[Projectile.type] = NumAnimationFrames;
|
|
}
|
|
public override void SetDefaults()
|
|
{
|
|
Projectile.width = 26;
|
|
Projectile.height = 26;
|
|
Projectile.DamageType = DamageClass.Magic;
|
|
Projectile.friendly = true;
|
|
Projectile.ignoreWater = true;
|
|
Projectile.extraUpdates = 2;
|
|
Projectile.timeLeft = Lifetime;
|
|
Projectile.alpha = 48;
|
|
}
|
|
|
|
public override void AI()
|
|
{
|
|
// Draw offsets
|
|
DrawOffsetX = -10;
|
|
DrawOriginOffsetY = -10;
|
|
DrawOriginOffsetX = 0;
|
|
|
|
// Play sound and set rotation on frame 1
|
|
if (Projectile.localAI[0] == 0f)
|
|
{
|
|
Projectile.localAI[0] = 1f;
|
|
SoundEngine.PlaySound(SoundID.NPCDeath56, Projectile.Center);
|
|
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4;
|
|
}
|
|
|
|
// Dust only shows up after the first few frames
|
|
if (Projectile.localAI[0] >= 5f)
|
|
SpawnDust();
|
|
|
|
// Lighting and spin
|
|
Lighting.AddLight(Projectile.Center, 1.8f, 1.6f, 0.5f);
|
|
Projectile.rotation += 0.11f;
|
|
|
|
// Increment frame counter
|
|
Projectile.localAI[0] += 1f;
|
|
|
|
// Update animation
|
|
Projectile.frameCounter++;
|
|
if (Projectile.frameCounter > AnimationFrameTime)
|
|
{
|
|
Projectile.frame++;
|
|
Projectile.frameCounter = 0;
|
|
}
|
|
if (Projectile.frame >= NumAnimationFrames)
|
|
Projectile.frame = 0;
|
|
}
|
|
|
|
private void SpawnDust()
|
|
{
|
|
int coreDustCount = 2; //3
|
|
int coreDustType = 262;
|
|
for (int i = 0; i < coreDustCount; ++i)
|
|
{
|
|
float scale = Main.rand.NextFloat(1.0f, 1.4f);
|
|
int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, coreDustType);
|
|
Main.dust[idx].velocity *= 0.7f;
|
|
Main.dust[idx].velocity += Projectile.velocity * 1.4f;
|
|
Main.dust[idx].scale = scale;
|
|
Main.dust[idx].noGravity = true;
|
|
}
|
|
|
|
int trailDustCount = 4; //5
|
|
int trailDustType = 264;
|
|
for (int i = 0; i < trailDustCount; ++i)
|
|
{
|
|
float scale = Main.rand.NextFloat(1.0f, 1.4f);
|
|
int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, trailDustType, 0f, 0f);
|
|
Main.dust[idx].velocity = Projectile.velocity * 0.8f;
|
|
Main.dust[idx].scale = scale;
|
|
Main.dust[idx].noGravity = true;
|
|
}
|
|
}
|
|
|
|
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
|
{
|
|
target.AddBuff(BuffID.Daybreak, 180);
|
|
}
|
|
|
|
public override void OnHitPvp(Player target, int damage, bool crit)
|
|
{
|
|
target.AddBuff(BuffID.Daybreak, 180);
|
|
}
|
|
|
|
public override void Kill(int timeLeft)
|
|
{
|
|
if (Projectile.owner != Main.myPlayer)
|
|
return;
|
|
|
|
// Spawn a Helium Flash on impact
|
|
int type = ModContent.ProjectileType<HeliumFlashBlast>();
|
|
int damage = (int)(HeliumFlash.ExplosionDamageMultiplier * Projectile.damage);
|
|
float kb = 9.5f;
|
|
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, type, damage, kb, Projectile.owner, 0f, 0f);
|
|
}
|
|
}
|
|
}
|