Removed nearly all unused textures in the entire mod, especially focusing on projectiles. Apotheosis & the Death Valley Duster weapon line were ignored to prevent merge conflicts.
92 lines
2.9 KiB
C#
92 lines
2.9 KiB
C#
using CalamityMod.Buffs.DamageOverTime;
|
|
using CalamityMod.Dusts;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
namespace CalamityMod.Projectiles.Summon
|
|
{
|
|
public class BrimstoneFireSummon : ModProjectile
|
|
{
|
|
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
|
|
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Fire");
|
|
ProjectileID.Sets.MinionShot[projectile.type] = true;
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
projectile.width = 6;
|
|
projectile.height = 6;
|
|
projectile.friendly = true;
|
|
projectile.ignoreWater = true;
|
|
projectile.minion = true;
|
|
projectile.minionSlots = 0f;
|
|
projectile.penetrate = 2;
|
|
projectile.extraUpdates = 3;
|
|
projectile.timeLeft = 50;
|
|
projectile.usesIDStaticNPCImmunity = true;
|
|
projectile.idStaticNPCHitCooldown = 9;
|
|
}
|
|
|
|
public override void AI()
|
|
{
|
|
Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.25f / 255f, (255 - projectile.alpha) * 0.05f / 255f, (255 - projectile.alpha) * 0.05f / 255f);
|
|
if (projectile.ai[0] > 7f)
|
|
{
|
|
float scalar = 1f;
|
|
if (projectile.ai[0] == 8f)
|
|
{
|
|
scalar = 0.25f;
|
|
}
|
|
else if (projectile.ai[0] == 9f)
|
|
{
|
|
scalar = 0.5f;
|
|
}
|
|
else if (projectile.ai[0] == 10f)
|
|
{
|
|
scalar = 0.75f;
|
|
}
|
|
projectile.ai[0] += 1f;
|
|
int dustType = (int)CalamityDusts.Brimstone;
|
|
if (Main.rand.NextBool(2))
|
|
{
|
|
int brim = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f);
|
|
Dust dust = Main.dust[brim];
|
|
if (Main.rand.NextBool(3))
|
|
{
|
|
dust.noGravity = true;
|
|
dust.scale *= 3f;
|
|
dust.velocity.X *= 2f;
|
|
dust.velocity.Y *= 2f;
|
|
}
|
|
else
|
|
{
|
|
dust.scale *= 1.5f;
|
|
}
|
|
dust.velocity.X *= 1.2f;
|
|
dust.velocity.Y *= 1.2f;
|
|
dust.scale *= scalar;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
projectile.ai[0] += 1f;
|
|
}
|
|
projectile.rotation += 0.3f * (float)projectile.direction;
|
|
}
|
|
|
|
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
|
{
|
|
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 120);
|
|
}
|
|
|
|
public override void OnHitPvp(Player target, int damage, bool crit)
|
|
{
|
|
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 120);
|
|
}
|
|
}
|
|
}
|