Exemple #1
0
        public override Vector2 IdleBehavior()
        {
            base.IdleBehavior();
            List <Projectile> minions = IdleLocationSets.GetProjectilesInSet(IdleLocationSets.trailingInAir, projectile.owner);
            int   minionCount         = minions.Count;
            int   order     = minions.IndexOf(projectile);
            float idleAngle = (float)(2 * Math.PI * order) / minionCount;

            if (minions.Count > 0)
            {
                idleAngle += (2 * (float)Math.PI * groupAnimationFrame) / groupAnimationFrames;
            }
            Vector2 idlePosition = player.Center;

            idlePosition.X += -player.direction * IdleLocationSets.GetXOffsetInSet(minions, projectile);
            idlePosition.Y += -35 + 5 * (float)Math.Sin(idleAngle);
            if (!Collision.CanHitLine(idlePosition, 1, 1, player.Center, 1, 1))
            {
                idlePosition    = player.Center;
                idlePosition.X += 30 * -player.direction;
                idlePosition.Y += -35;
            }
            Vector2 vectorToIdlePosition = idlePosition - projectile.Center;

            TeleportToPlayer(ref vectorToIdlePosition, 2000f);
            return(vectorToIdlePosition);
        }
Exemple #2
0
        public override Vector2 IdleBehavior()
        {
            base.IdleBehavior();
            List <Projectile> minions      = IdleLocationSets.GetProjectilesInSet(IdleLocationSets.circlingBody, player.whoAmI);
            Vector2           idlePosition = player.Center;

            if (minions.Count > 0)
            {
                int minionCount = minions.Count;
                int order       = minions.IndexOf(projectile);
                idleAngle       = (float)(MathHelper.TwoPi * order) / minionCount;
                idleAngle      += (MathHelper.TwoPi * groupAnimationFrame) / groupAnimationFrames;
                idlePosition.X += 2 + 30 * (float)Math.Cos(idleAngle);
                idlePosition.Y += -12 + 5 * (float)Math.Sin(idleAngle);
            }
            Vector2 vectorToIdlePosition = idlePosition - projectile.Center;

            TeleportToPlayer(ref vectorToIdlePosition, 2000f);
            return(vectorToIdlePosition);
        }
Exemple #3
0
        public override Vector2 IdleBehavior()
        {
            base.IdleBehavior();
            wormDrawer.SegmentCount = GetSegmentCount();
            List <Projectile> minions = IdleLocationSets.GetProjectilesInSet(IdleLocationSets.circlingHead, player.whoAmI);
            int     minionCount       = minions.Count;
            Vector2 idlePosition      = player.Top;

            // this was silently failing sometimes, don't know why
            if (minionCount > 0)
            {
                int   radius    = player.velocity.Length() < 4 ? 48 + 2 * EmpowerCount : 48;
                float yRadius   = player.velocity.Length() < 4 ? 8 + 0.5f * EmpowerCount : 8;
                int   order     = minions.IndexOf(projectile);
                float idleAngle = (2 * PI * order) / minionCount;
                idleAngle      += 2 * PI * groupAnimationFrame / groupAnimationFrames;
                idlePosition.X += radius * (float)Math.Cos(idleAngle);
                idlePosition.Y += -20 + EmpowerCount + yRadius * (float)Math.Sin(idleAngle);
            }
            Vector2 vectorToIdlePosition = idlePosition - projectile.Center;

            TeleportToPlayer(ref vectorToIdlePosition, 2000f);
            return(vectorToIdlePosition);
        }
 public virtual List <Projectile> GetIdleSpaceSharingMinions()
 {
     return(MyGetIdleSpaceSharingMinions?.Invoke() ??
            IdleLocationSets.GetProjectilesInSet(IdleLocationSets.circlingHead, player.whoAmI));
 }