Add Nullified debuff, add Transcendent weapons and tool
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using ForgottenWawiTech.Content.Projectiles.Transcendent;
|
||||
|
||||
namespace ForgottenWawiTech.Content.Players
|
||||
{
|
||||
public class TranscendentPlayer : ModPlayer
|
||||
{
|
||||
public bool SwarmModuleEquipped;
|
||||
private int swarmTimer;
|
||||
|
||||
public void HandleSwarmAccessory(Item sourceItem)
|
||||
{
|
||||
SwarmModuleEquipped = true;
|
||||
|
||||
if (Player.whoAmI != Main.myPlayer)
|
||||
return;
|
||||
|
||||
swarmTimer++;
|
||||
if (swarmTimer >= 90)
|
||||
{
|
||||
swarmTimer = 0;
|
||||
|
||||
int baseDamage = 220;
|
||||
int damage = (int)Player.GetDamage(DamageClass.Summon).ApplyTo(baseDamage);
|
||||
float knockBack = 3f;
|
||||
Vector2 velocity = Main.rand.NextVector2Circular(6f, 6f);
|
||||
if (velocity.LengthSquared() < 0.01f)
|
||||
{
|
||||
velocity = new Vector2(0f, -6f);
|
||||
}
|
||||
|
||||
Projectile.NewProjectile(
|
||||
Player.GetSource_Accessory(sourceItem),
|
||||
Player.Center,
|
||||
velocity,
|
||||
ModContent.ProjectileType<TranscendentBladeShard>(),
|
||||
damage,
|
||||
knockBack,
|
||||
Player.whoAmI);
|
||||
}
|
||||
}
|
||||
|
||||
public override void ResetEffects()
|
||||
{
|
||||
SwarmModuleEquipped = false;
|
||||
}
|
||||
|
||||
public override void PostUpdate()
|
||||
{
|
||||
if (SwarmModuleEquipped)
|
||||
{
|
||||
if (Main.rand.NextBool(6))
|
||||
{
|
||||
Dust dust = Dust.NewDustDirect(Player.position, Player.width, Player.height, DustID.RainbowTorch, Player.velocity.X * 0.2f, Player.velocity.Y * 0.2f, 150, default, 1.1f);
|
||||
dust.noGravity = true;
|
||||
}
|
||||
}
|
||||
else if (Player.whoAmI == Main.myPlayer && swarmTimer > 0)
|
||||
{
|
||||
swarmTimer = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user