Пример #1
0
        public override void AI()
        {
            if (npc.velocity.X < 0f)
            {
                npc.spriteDirection = -1;
            }
            else
            {
                npc.spriteDirection = 1;
            }
            npc.TargetClosest(true);
            Player player = Main.player[npc.target];

            BaseAI.AIFloater(npc, ref npc.ai, true, 0.2f, 3, 1.5f, .05f, 1.3f, 4);
            npc.ai[3]++;

            if (npc.ai[3] >= 120)
            {
                FireMagic(npc, npc.velocity);
                npc.ai[3] = 0;
            }

            npc.frameCounter++;
            if (npc.frameCounter >= 10)
            {
                npc.frameCounter = 0;
                npc.frame.Y     += 66;
                if (Shooty == true)
                {
                    if (npc.frame.Y < 66 * 8)
                    {
                        npc.frame.Y = 66 * 8;
                    }
                    if (npc.frame.Y > (66 * 15))
                    {
                        npc.frameCounter = 0;
                        npc.frame.Y      = 0;
                        Shooty           = false;
                    }
                }
                else
                {
                    if (npc.frame.Y > (66 * 7))
                    {
                        npc.frameCounter = 0;
                        npc.frame.Y      = 0;
                    }
                }
            }
        }
Пример #2
0
        public override void AI()
        {
            Player player = Main.player[npc.target]; // makes it so you can reference the player the npc is targetting

            BaseAI.AIFloater(npc, ref npc.ai, false, 0.2f, 2f, 1.5f, 0.04f, 1.5f, 3);

            if (npc.wet)
            {
                npc.life = 0;
            }

            npc.frameCounter++;
            if (npc.frameCounter > 8)
            {
                npc.frameCounter = 0;
                npc.frame.Y     += 20;
                if (npc.frame.Y > 40)
                {
                    npc.frame.Y = 0;
                }
            }
        }