public override bool PreAI()
        {
            if (IsNotMultiplayerClient() && !initialized)
            {
                int     chosenYDir = Main.rand.NextBool().ToDirectionInt();
                Vector2 spawnPos   = npc.position;

                npc.netUpdate = initialized = true;
                Dagoom.GroundDeploy(npc, ref yDirection, spawnPos, chosenYDir, DecideYDeploy);
                if (yDirection == 0 && !Dagoom.GroundDeploy(npc, ref yDirection, spawnPos,
                                                            -chosenYDir, DecideYDeploy))
                {
                    Deactivate();
                    return(false);
                }

                npc.TargetClosest(false);
                if (persistDirection == 0)
                {
                    FaceTarget(Target.Center);
                }
            }

            return(initialized);
        }
Example #2
0
        public override bool PreAI()
        {
            if (IsNotMultiplayerClient() && !initialized)
            {
                int     chosenYDir = Main.rand.NextBool().ToDirectionInt();
                Vector2 spawnPos   = npc.position;

                npc.netUpdate = initialized = true;
                Dagoom.GroundDeploy(npc, ref yDirection, spawnPos, chosenYDir, DecideYDeploy);
                if (yDirection == 0 && !Dagoom.GroundDeploy(npc, ref yDirection, spawnPos,
                                                            -chosenYDir, DecideYDeploy))
                {
                    Deactivate();
                    return(false);
                }
                else if (yDirection < 0)
                {
                    startFrame   = 8;
                    endFrame     = 12;
                    maxFrame     = (byte)Main.npcFrameCount[npc.type];
                    FrameCounter = startFrame;
                }

                npc.TargetClosest(false);
                if (npc.Center.X > Main.player[npc.target].Center.X)
                {
                    persistDirection = -1;
                }
                else
                {
                    persistDirection = 1;
                }
                xDirection = persistDirection;
            }

            return(initialized);
        }
Example #3
0
        public override bool PreAI()
        {
            if (IsNotMultiplayerClient() && !initialized)
            {
                int     chosenYDir = Main.rand.NextBool().ToDirectionInt();
                Vector2 spawnPos   = npc.position;

                npc.netUpdate = initialized = true;
                Dagoom.GroundDeploy(npc, ref yDirection, spawnPos, chosenYDir, DecideYDeploy);
                if (yDirection == 0 && !Dagoom.GroundDeploy(npc, ref yDirection, spawnPos,
                                                            -chosenYDir, DecideYDeploy))
                {
                    Deactivate();
                    return(false);
                }
                else if (yDirection < 0)
                {
                    npc.frame.Y  = 442;
                    FrameCounter = 13;
                }
            }

            return(initialized);
        }