Commit of decompiled and "updated" code.
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace FabusMod.Projectiles.Minions;
|
||||
|
||||
public class GoddessMinion : Minion
|
||||
{
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.netImportant = true;
|
||||
Projectile.CloneDefaults(388);
|
||||
AIType = 388;
|
||||
Projectile.width = 50;
|
||||
Projectile.height = 50;
|
||||
Main.projFrames[Projectile.type] = 8;
|
||||
Projectile.friendly = true;
|
||||
Projectile.minion = true;
|
||||
Projectile.minionSlots = 1f;
|
||||
Projectile.penetrate = -1;
|
||||
Projectile.timeLeft = 18000;
|
||||
Projectile.ignoreWater = true;
|
||||
Projectile.tileCollide = false;
|
||||
ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true;
|
||||
AnimateProjectile();
|
||||
}
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Goddess' Summoner");
|
||||
}
|
||||
|
||||
public override bool OnTileCollide(Vector2 oldVelocity)
|
||||
{
|
||||
if (Projectile.velocity.X != oldVelocity.X)
|
||||
{
|
||||
Projectile.velocity.X = oldVelocity.X;
|
||||
}
|
||||
if (Projectile.velocity.Y != oldVelocity.Y)
|
||||
{
|
||||
Projectile.velocity.Y = oldVelocity.Y;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void CheckActive()
|
||||
{
|
||||
Player obj = Main.player[Projectile.owner];
|
||||
FabuPlayer modPlayer = obj.GetModPlayer<FabuPlayer>();
|
||||
if (obj.dead)
|
||||
{
|
||||
modPlayer.goddessMinion = false;
|
||||
}
|
||||
if (modPlayer.goddessMinion)
|
||||
{
|
||||
Projectile.timeLeft = 2;
|
||||
}
|
||||
}
|
||||
|
||||
public void AnimateProjectile()
|
||||
{
|
||||
Projectile projectile = Projectile;
|
||||
projectile.frameCounter++;
|
||||
if (Projectile.frameCounter >= 2)
|
||||
{
|
||||
Projectile projectile2 = Projectile;
|
||||
projectile2.frame++;
|
||||
Projectile projectile3 = Projectile;
|
||||
projectile3.frame %= 3;
|
||||
Projectile.frameCounter = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user