Files
CalamityModPublic/Projectiles/Summon/MechwormTail.cs
T
mountaindrew10 c098604fd0 1 - Blood Clot Staff now inflicts Burning Blood.
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.
2022-12-04 23:10:15 -06:00

79 lines
2.7 KiB
C#

using CalamityMod.Buffs.DamageOverTime;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Summon
{
public class MechwormTail : ModProjectile
{
private int playerMinionSlots = 0;
private bool runCheck = true;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Mechworm");
ProjectileID.Sets.MinionSacrificable[Projectile.type] = true;
ProjectileID.Sets.NeedsUUID[Projectile.type] = true;
}
public override void SetDefaults()
{
Projectile.width = 24;
Projectile.height = 24;
Projectile.friendly = true;
Projectile.ignoreWater = true;
Projectile.alpha = 255;
Projectile.netImportant = true;
Projectile.timeLeft = 18000;
Projectile.penetrate = -1;
Projectile.tileCollide = false;
Projectile.timeLeft *= 5;
Projectile.minion = true;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 30;
Projectile.hide = true;
Projectile.DamageType = DamageClass.Summon;
}
public override void AI()
{
Player owner = Main.player[Projectile.owner];
if (owner.maxMinions > playerMinionSlots)
playerMinionSlots = owner.maxMinions;
if (runCheck)
{
runCheck = false;
playerMinionSlots = owner.maxMinions;
}
Projectile.localAI[0] = 0f;
MechwormBody.SegmentAI(Projectile, 16, ref playerMinionSlots);
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) => target.AddBuff(ModContent.BuffType<GodSlayerInferno>(), 90);
public override bool PreDraw(ref Color lightColor)
{
Texture2D tex = ModContent.Request<Texture2D>(Texture).Value;
Vector2 drawPosition = Projectile.Center - Main.screenPosition;
Main.EntitySpriteDraw(tex, drawPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0);
return false;
}
public override bool? CanDamage() => Projectile.alpha == 0;
public override void DrawBehind(int index, List<int> behindNPCsAndTiles, List<int> behindNPCs, List<int> behindProjectiles, List<int> overPlayers, List<int> overWiresUI)
{
behindProjectiles.Add(index);
}
public override bool ShouldUpdatePosition() => false;
}
}