예제 #1
0
파일: Wizard.cs 프로젝트: toannatkm0/LOZ
        public static Vector3 RandomizePosition(this Vector2 v)
        {
            var r         = new Random(Environment.TickCount);
            var minRandBy = Program.Config.Item("autosharp.randomizer.minrand").GetValue <Slider>().Value;
            var maxRandBy = Program.Config.Item("autosharp.randomizer.maxrand").GetValue <Slider>().Value;

            if (Program.Config.Item("autosharp.randomizer.playdefensive").GetValue <bool>() && Heroes.Player.CountEnemiesInRange(800) >= Heroes.Player.CountAlliesInRange(800))
            {
                minRandBy *= Wizard.GetDefensiveMultiplier();
            }
            else
            {
                minRandBy *= r.Next(-1, 1);
            }
            return(new Vector2(v.X + r.Next(minRandBy, maxRandBy), v.Y + r.Next(minRandBy, maxRandBy)).To3D());
        }
예제 #2
0
        public static Vector3 RandomizePosition(this Vector2 v)
        {
            var r         = new Random(Environment.TickCount);
            var minRandBy = Program.getMinRand;
            var maxRandBy = Program.getMaxRand;

            if (Program.getDefen && Heroes.Player.LSCountEnemiesInRange(800) >= Heroes.Player.CountAlliesInRange(800))
            {
                minRandBy *= Wizard.GetDefensiveMultiplier();
            }
            else
            {
                minRandBy *= r.Next(-1, 1);
            }
            return(new Vector2(v.X + r.Next(minRandBy, maxRandBy), v.Y + r.Next(minRandBy, maxRandBy)).To3D());
        }
예제 #3
0
        public static Vector3 RandomizePosition(this GameObject o)
        {
            if (o == null)
            {
                return(Vector3.Zero);
            }
            var r         = new Random(Environment.TickCount);
            var minRandBy = 50;  //Program.Config.Item("autosharp.randomizer.minrand").GetValue<Slider>().Value;
            var maxRandBy = 250; //Program.Config.Item("autosharp.randomizer.maxrand").GetValue<Slider>().Value;
            //if (Program.Config.Item("autosharp.randomizer.playdefensive").GetValue<bool>() && Heroes.Player.CountEnemiesInRange(800) >= Heroes.Player.CountAlliesInRange(800))
            bool defensive = true;

            if (defensive)
            {
                minRandBy *= Wizard.GetDefensiveMultiplier();
            }
            else
            {
                minRandBy *= r.Next(-1, 1);
            }
            return(new Vector2(o.Position.X + r.Next(minRandBy, maxRandBy), o.Position.Y + r.Next(minRandBy, maxRandBy)).To3D());
        }