public override Vector2 IdleBehavior()
        {
            base.IdleBehavior();
            float   idleAngle    = (float)(2 * Math.PI * animationFrameCounter % 240) / 240;
            Vector2 idlePosition = player.Center;

            idlePosition.X += -player.direction * IdleLocationSets.GetXOffsetInSet(IdleLocationSets.trailingInAir, projectile);
            idlePosition.Y += -35 + 5 * (float)Math.Sin(idleAngle);
            if (!Collision.CanHit(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);
            animationFrameCounter++;
            if (animationFrameCounter - reloadStartFrame == reloadCycleLength)
            {
                player.AddBuff(BuffID.Honey, 60);
            }

            return(vectorToIdlePosition);
        }
Beispiel #2
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);
        }
        public override Vector2 IdleBehavior()
        {
            Vector2 idlePosition = player.Top;

            idlePosition.X += -player.direction * IdleLocationSets.GetXOffsetInSet(IdleLocationSets.trailingInAir, projectile);
            idlePosition.Y += -5;
            if (!Collision.CanHitLine(idlePosition, 1, 1, player.Center, 1, 1))
            {
                idlePosition = player.Center;
            }
            Vector2 vectorToIdlePosition = idlePosition - projectile.Center;

            TeleportToPlayer(ref vectorToIdlePosition, 2000f);
            return(vectorToIdlePosition);
        }
        public override Vector2 IdleBehavior()
        {
            base.IdleBehavior();
            Vector2 idlePosition = player.Top;

            idlePosition.X += -player.direction * IdleLocationSets.GetXOffsetInSet(IdleLocationSets.trailingInAir, projectile);
            idlePosition.Y += -24 + 8 * (float)Math.Sin(MathHelper.TwoPi * (animationFrame % 120) / 120);
            Vector2 vectorToIdlePosition = idlePosition - projectile.Center;

            if (!Collision.CanHitLine(idlePosition, 1, 1, player.Center, 1, 1))
            {
                idlePosition.X = player.Top.X;
                idlePosition.Y = player.Top.Y - 16;
            }
            TeleportToPlayer(ref vectorToIdlePosition, 2000f);
            return(vectorToIdlePosition);
        }
        public override Vector2 IdleBehavior()
        {
            gHelper.SetIsOnGround();
            // the ground-based minions can sometimes jump/bounce to get themselves unstuck
            // , but the flying versions can't
            noLOSPursuitTime = gHelper.isFlying ? 15 : 300;
            Vector2 idlePosition = player.Center;

            idlePosition.X += -player.direction * IdleLocationSets.GetXOffsetInSet(IdleLocationSets.trailingOnGround, projectile);
            if (!Collision.CanHitLine(idlePosition, 1, 1, player.Center, 1, 1))
            {
                idlePosition = player.Center;
            }
            Vector2 vectorToIdlePosition = idlePosition - projectile.Center;

            TeleportToPlayer(ref vectorToIdlePosition, 2000f);
            return(vectorToIdlePosition);
        }
        public override Vector2 IdleBehavior()
        {
            base.IdleBehavior();
            Vector2 idlePosition = player.Center;

            idlePosition.X += -player.direction * IdleLocationSets.GetXOffsetInSet(IdleLocationSets.trailingInAir, projectile);
            idlePosition.Y += -5 * projectile.minionPos;
            if (!Collision.CanHitLine(idlePosition, 1, 1, player.Center, 1, 1))
            {
                idlePosition.X = player.Center.X + 20 * -player.direction;
                idlePosition.Y = player.Center.Y - 5;
            }
            Vector2 vectorToIdlePosition = idlePosition - projectile.Center;

            TeleportToPlayer(ref vectorToIdlePosition, 2000f);
            Lighting.AddLight(projectile.Center, Color.LightYellow.ToVector3() * 0.125f);
            return(vectorToIdlePosition);
        }
Beispiel #7
0
        public override Vector2 IdleBehavior()
        {
            Vector2 idlePosition = player.Top;

            projectile.ai[0] = (projectile.ai[0] + 1) % animationFrames;
            float idleAngle = (float)Math.PI * 2 * projectile.ai[0] / animationFrames;

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

            TeleportToPlayer(ref vectorToIdlePosition, 2000f);
            return(vectorToIdlePosition);
        }
        public override Vector2 IdleBehavior()
        {
            base.IdleBehavior();
            Vector2 idlePosition = player.Top;

            idlePosition.X += -player.direction * IdleLocationSets.GetXOffsetInSet(IdleLocationSets.trailingInAir, projectile);
            idlePosition.Y += -8;
            animationFrame += 1;
            if (!Collision.CanHitLine(idlePosition, 1, 1, player.Center, 1, 1))
            {
                idlePosition.X = player.Top.X;
                idlePosition.Y = player.Top.Y - 16;
            }
            idlePosition.Y += 4 * (float)Math.Sin(animationFrame / 32f);
            Vector2 vectorToIdlePosition = idlePosition - projectile.Center;

            TeleportToPlayer(ref vectorToIdlePosition, 2000f);
            Lighting.AddLight(projectile.Center, Color.Red.ToVector3() * 0.25f);
            return(vectorToIdlePosition);
        }
        public override Vector2 IdleBehavior()
        {
            base.IdleBehavior();
            hsHelper.firedProjectileId = (leveledPetPlayer?.PetLevel ?? 0) >= (int)CombatPetTier.Spectre ?
                                         ProjectileType <TwisterProjectile>() : ProjectileType <CloudPuffProjectile>();
            float   idleAngle    = (MathHelper.TwoPi * animationFrame % 240) / 240;
            Vector2 idlePosition = player.Center;

            idlePosition.X += -player.direction * IdleLocationSets.GetXOffsetInSet(IdleLocationSets.trailingInAir, Projectile);
            idlePosition.Y += -35 + 5 * (float)Math.Sin(idleAngle);
            if (!Collision.CanHit(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);
        }
Beispiel #10
0
        public override Vector2 IdleBehavior()
        {
            base.IdleBehavior();
            noLOSPursuitTime = gHelper.isFlying ? 15 : 300;
            Vector2 idlePosition = gHelper.isFlying ? player.Top : player.Bottom;
            Vector2 idleHitLine  = player.Center;

            idlePosition.X += -player.direction * IdleLocationSets.GetXOffsetInSet(IdleLocationSets.trailingOnGround, projectile);
            if (!Collision.CanHitLine(idleHitLine, 1, 1, player.Center, 1, 1))
            {
                idlePosition = player.Bottom;
            }
            Vector2 vectorToIdlePosition = idlePosition - projectile.Center;

            TeleportToPlayer(ref vectorToIdlePosition, 2000f);
            gHelper.SetIsOnGround();
            if (gHelper.offTheGroundFrames == 20 || (gHelper.offTheGroundFrames > 60 && Main.rand.Next(120) == 0) || (gHelper.isOnGround && gHelper.offTheGroundFrames > 20))
            {
                DrawPlatformDust();
            }
            Lighting.AddLight(projectile.Center, Color.PaleGreen.ToVector3() * 0.75f);
            return(vectorToIdlePosition);
        }
Beispiel #11
0
        public override Vector2 IdleBehavior()
        {
            base.IdleBehavior();
            Vector2 idlePosition = player.Top;
            float   idleAngle    = (float)Math.PI * 2 * (animationFrame % animationFrames) / animationFrames;

            idlePosition.X += -player.direction * IdleLocationSets.GetXOffsetInSet(IdleLocationSets.trailingInAir, projectile);
            idlePosition.Y += -5 + 8 * (float)Math.Sin(idleAngle);
            if (!Collision.CanHit(idlePosition, 1, 1, player.Top, 1, 1))
            {
                idlePosition.X = player.Top.X;
            }
            Vector2 vectorToIdlePosition = idlePosition - projectile.Center;

            TeleportToPlayer(ref vectorToIdlePosition, 2000f);
            Lighting.AddLight(projectile.Center, Color.Red.ToVector3() * 0.5f);
            int headType         = ProjectileType <CharredChimeraMinionHead>();
            int currentHeadCount = player.ownedProjectileCounts[headType];

            if (Main.myPlayer == player.whoAmI)
            {
                for (int i = currentHeadCount; i < EmpowerCount + 1; i++)
                {
                    Projectile.NewProjectile(projectile.Center, projectile.velocity, headType, projectile.damage, projectile.knockBack, player.whoAmI);
                }

                if (currentHeadCount > EmpowerCount + 1)
                {
                    allHeads = GetMinionsOfType(ProjectileType <CharredChimeraMinionHead>());
                    allHeads[0].Kill();                     // get rid of a head if there's too many
                }
            }
            allHeads = GetMinionsOfType(ProjectileType <CharredChimeraMinionHead>());
            TellHeadsToAttack();
            PositionHeads();
            return(vectorToIdlePosition);
        }