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.
99 lines
3.6 KiB
C#
99 lines
3.6 KiB
C#
using CalamityMod.Buffs.DamageOverTime;
|
|
using Microsoft.Xna.Framework;
|
|
using System;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
namespace CalamityMod.Projectiles.Summon
|
|
{
|
|
public class Cinder : ModProjectile
|
|
{
|
|
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
|
|
|
|
public const float FallAcceleration = 0.185f;
|
|
public const float FallSpeedMax = 16;
|
|
public const float FallDelay = 300;
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Cinder");
|
|
ProjectileID.Sets.MinionShot[Projectile.type] = true;
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
Projectile.width = 6;
|
|
Projectile.height = 12;
|
|
Projectile.friendly = true;
|
|
Projectile.penetrate = 3;
|
|
Projectile.timeLeft = 300;
|
|
Projectile.usesIDStaticNPCImmunity = true;
|
|
Projectile.idStaticNPCHitCooldown = 10;
|
|
Projectile.minion = true;
|
|
Projectile.DamageType = DamageClass.Summon;
|
|
}
|
|
|
|
public override void AI()
|
|
{
|
|
if (Projectile.velocity.X != Projectile.velocity.X)
|
|
{
|
|
Projectile.velocity.X *= -0.1f;
|
|
}
|
|
if (Projectile.velocity.X != Projectile.velocity.X)
|
|
{
|
|
Projectile.velocity.X *= -0.5f;
|
|
}
|
|
if (Projectile.velocity.Y != Projectile.velocity.Y && Projectile.velocity.Y > 1f)
|
|
{
|
|
Projectile.velocity.Y *= -0.5f;
|
|
}
|
|
Projectile.ai[0]++;
|
|
if (Projectile.ai[0] > 5f)
|
|
{
|
|
Projectile.ai[0] = 5f;
|
|
if (Projectile.velocity.Y == 0f && Projectile.velocity.X != 0f)
|
|
{
|
|
Projectile.velocity.X *= 0.97f;
|
|
if (Math.Abs(Projectile.velocity.X) < 0.01)
|
|
{
|
|
Projectile.velocity.X = 0f;
|
|
Projectile.netUpdate = true;
|
|
}
|
|
}
|
|
}
|
|
|
|
if (Projectile.ai[0] >= FallDelay && Projectile.velocity.Y < FallSpeedMax)
|
|
{
|
|
Projectile.velocity.Y += FallAcceleration;
|
|
}
|
|
|
|
Projectile.rotation += Projectile.velocity.X * 0.1f;
|
|
int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 6, 0f, 0f, 100, default, 1f);
|
|
Main.dust[idx].position += new Vector2(2f);
|
|
Main.dust[idx].scale += Main.rand.NextFloat(0.5f);
|
|
Main.dust[idx].noGravity = true;
|
|
Main.dust[idx].velocity.Y -= 2f;
|
|
if (Main.rand.NextBool(2))
|
|
{
|
|
idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 6, 0f, 0f, 100, default, 1f);
|
|
Main.dust[idx].position += new Vector2(2f);
|
|
Main.dust[idx].scale += 0.3f + Main.rand.NextFloat(0.5f);
|
|
Main.dust[idx].noGravity = true;
|
|
Main.dust[idx].velocity.Y -= 2f;
|
|
}
|
|
if (Projectile.velocity.Y < 0.25f && Projectile.velocity.Y > 0.15f)
|
|
{
|
|
Projectile.velocity.X *= 0.8f;
|
|
}
|
|
Projectile.rotation = -Projectile.velocity.X * 0.05f;
|
|
if (Projectile.velocity.Y > 16f)
|
|
{
|
|
Projectile.velocity.Y = 16f;
|
|
}
|
|
}
|
|
|
|
public override bool OnTileCollide(Vector2 oldVelocity) => false;
|
|
|
|
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) => target.AddBuff(BuffID.OnFire, 180);
|
|
}
|
|
}
|