Пример #1
0
 public override void SetControls()
 {
     if (intelligence < 95 && (player.controlUseItem | player.controlHook) && player.HeldItem.hammer < 1 && player.HeldItem.axe < 1 && player.HeldItem.pick < 1)
     {
         Main.mouseX += (int)(ThreadLocalRandom.NextDouble() * 5 * (Math.Pow(1.2, (96 - intelligence) / 4)));
         Main.mouseY += (int)(ThreadLocalRandom.NextDouble() * 5 * (Math.Pow(1.2, (96 - intelligence) / 4)));
     }
 }
Пример #2
0
        public override void PreUpdate()
        {
            if (arbLegs)
            {
                //player.height = 70;
                //player.width = 56;
            }

            if (whiskers)
            {
                if (sniffTime > 0)
                {
                    sniffTime--;
                }
                else if (sniffFrame2 < 20)
                {
                    if (sniffFrame2 % 4 == 0)
                    {
                        sniffFrame++;
                    }
                    sniffFrame2++;
                }
                else
                {
                    sniffEnd = true;
                    switch (sniffCount)
                    {
                    case 0:
                        sniffFrame  = 0;
                        sniffFrame2 = 0;
                        sniffCount++;
                        sniffing = true;
                        break;

                    case 1:
                        if (ThreadLocalRandom.NextDouble() > 0.333333)
                        {
                            sniffFrame  = 0;
                            sniffFrame2 = 0;
                            sniffCount++;
                        }
                        else
                        {
                            sniffCount = 0;
                            sniffTime  = (short)ThreadLocalRandom.Next(120, 540);
                            sniffing   = false;
                        }
                        break;

                    case 2:
                        if (ThreadLocalRandom.NextDouble() > 0.5)
                        {
                            sniffFrame  = 0;
                            sniffFrame2 = 0;
                            sniffCount++;
                        }
                        else
                        {
                            sniffCount = 0;
                            sniffTime  = (short)ThreadLocalRandom.Next(120, 540);
                            sniffing   = false;
                        }
                        break;

                    case 3:
                        sniffCount = 0;
                        sniffTime  = (short)ThreadLocalRandom.Next(120, 540);
                        sniffing   = false;
                        break;
                    }
                }
            }
        }