public override bool PreDraw(NPC npc, SpriteBatch spriteBatch, Color drawColor)
 {
     switch (npc.type)
     {
     case NPCID.DukeFishron:
         RevolutionsAI.DukeFishronDraw(npc, spriteBatch);
         break;
     }
     return(base.PreDraw(npc, spriteBatch, drawColor));
 }
        public override void AI(NPC npc)
        {
            if (Revolutions.Settings.extraAI)
            {
                if (myTalkCD[npc.whoAmI] > 0)
                {
                    myTalkCD[npc.whoAmI]--;
                }
                if (myTimer[npc.whoAmI] > 0)
                {
                    myTimer[npc.whoAmI]--;
                }
                if (myTimer2[npc.whoAmI] > 0)
                {
                    myTimer2[npc.whoAmI]--;
                }
                if (myTimer[npc.whoAmI] < 0)
                {
                    myTimer[npc.whoAmI]++;
                }
                if (myTimer2[npc.whoAmI] < 0)
                {
                    myTimer2[npc.whoAmI]++;
                }
                //一计时器两用,太酷了
                Player            target     = Main.player[npc.target];
                RevolutionsPlayer revtar     = target.GetModPlayer <RevolutionsPlayer>();
                Player            local      = Main.LocalPlayer;
                RevolutionsPlayer revlocal   = local.GetModPlayer <RevolutionsPlayer>();
                float             myDistance = Vector2.Distance(npc.Center, local.Center);
                switch (npc.type)
                {
                case NPCID.DukeFishron:
                    if (Main.rand.Next(1, 600) == 1 && myTalkCD[npc.whoAmI] == 0)
                    {
                        new Talk(npc.whoAmI, Language.GetTextValue("Mods.Revolutions.Talk.DkFsion0" + Main.rand.Next(1, 4).ToString()), 180, null);
                        myTalkCD[npc.whoAmI] = 360;
                    }
                    RevolutionsAI.DukeFishronAI(npc, target, revtar, ref myTimer[npc.whoAmI], ref myTimer2[npc.whoAmI], myOldLife[npc.whoAmI]);
                    break;

                case NPCID.Plantera:
                    if (Main.rand.Next(1, 600) == 1 && myTalkCD[npc.whoAmI] == 0)
                    {
                        new Talk(npc.whoAmI, Language.GetTextValue("Mods.Revolutions.Talk.Plantera0" + Main.rand.Next(1, 3).ToString()), 180, null);
                        myTalkCD[npc.whoAmI] = 360;
                    }
                    RevolutionsAI.PlanteraAI(npc, target, revtar, ref myTimer[npc.whoAmI], ref myTimer2[npc.whoAmI], myOldLife[npc.whoAmI]);
                    break;

                case NPCID.Guide:
                    if (myTalkCD[npc.whoAmI] == 0 && myDistance < 300f && npc.ai[0] != 4)
                    {
                        if (Main.rand.Next(1, 100) == 1 && Main.dayTime && !NPC.AnyDanger())
                        {
                            new Talk(npc.whoAmI, Language.GetTextValue("Mods.Revolutions.Talk.Guide1" + Main.rand.Next(1, 3).ToString()), 180, null);
                            myTalkCD[npc.whoAmI] = 600;
                        }
                        if (Main.rand.Next(1, 100) == 1 && !Main.dayTime && !NPC.AnyDanger())
                        {
                            if (npc.homeless)
                            {
                                new Talk(npc.whoAmI, Language.GetTextValue("Mods.Revolutions.Talk.Guide3" + Main.rand.Next(0, 2).ToString()), 180, null);
                            }
                            else
                            {
                                new Talk(npc.whoAmI, Language.GetTextValue("Mods.Revolutions.Talk.Guide3" + Main.rand.Next(1, 3).ToString()), 180, null);
                            }
                            myTalkCD[npc.whoAmI] = 600;
                        }
                        if (!Main.dayTime && NPC.AnyDanger() && Main.rand.Next(1, 50) == 1)
                        {
                            new Talk(npc.whoAmI, Language.GetTextValue("Mods.Revolutions.Talk.Guide61"), 180, null);
                            myTalkCD[npc.whoAmI] = 300;
                        }
                    }
                    else if (myTalkCD[npc.whoAmI] == 0 && myDistance > Vector2.Distance(npc.Center, revlocal.pastCenter[10]) && myDistance < RevolutionsPlayer.screenR / 2 && npc.ai[0] != 4)
                    {
                        if (local.HasItem(ItemID.GuideVoodooDoll))
                        {
                            new Talk(npc.whoAmI, Language.GetTextValue("Mods.Revolutions.Talk.Guide43"), 180, null);
                        }
                        else
                        {
                            new Talk(npc.whoAmI, Language.GetTextValue("Mods.Revolutions.Talk.Guide4" + Main.rand.Next(1, 3).ToString()), 180, null);
                        }
                        myTalkCD[npc.whoAmI] = 1800;
                    }
                    break;

                case NPCID.Nurse:
                    break;
                }
                if (RevolutionsPlayer.timer % 10 == 0 && RevolutionsPlayer.timer != 0)
                {
                    myOldLife[npc.whoAmI] = npc.life;
                }
            }
        }