Beispiel #1
0
        public static int getPriorityNumber(JungleCamp camp)
        {
            if (camp.isDragBaron)
            {
                return(999);
            }

            if (((camp.team == 0 && HypaJungle.player.Team == GameObjectTeam.Chaos) ||
                 (camp.team == 1 && HypaJungle.player.Team == GameObjectTeam.Order)) && !HypaJungle.Config.Item("enemyJung").GetValue <bool>())
            {
                return(999);
            }

            if (camp.team == 3 && !HypaJungle.Config.Item("doCrabs").GetValue <bool>())
            {
                return(999);
            }

            int priority = 0;

            var distTillCamp = getPathLenght(HypaJungle.player.GetPath(camp.Position));
            var timeToCamp   = distTillCamp / HypaJungle.player.MoveSpeed;
            var spawnTime    = (Game.Time < camp.SpawnTime.TotalSeconds) ? camp.SpawnTime.TotalSeconds : camp.RespawnTimer.TotalSeconds;

            float revOn         = camp.ClearTick + (float)spawnTime;
            float timeTillSpawn = (camp.State == JungleCampState.Dead)?((revOn - Game.Time > 0) ? (revOn - Game.Time) : 0):0;

            camp.willKillMe = false;
            if (!jungler.canKill(camp, timeToCamp) && HypaJungle.Config.Item("checkKillability").GetValue <bool>())
            {
                priority       += 999;
                camp.willKillMe = true;
            }
            priority -= camp.bonusPrio;
            priority += (int)timeToCamp;
            priority += (int)timeTillSpawn;
            priority -= (camp.isBuff) ? jungler.buffPriority : 0;
            //priority -= (int)(timeTillSpawn - timeToCamp);
            //alive on come is better ;)
            //Priority focus!!
            if (player.Level <= 3)
            {
                if ((camp.campId == 10 || camp.campId == 4) & jungler.startCamp == Jungler.StartCamp.Red)
                {
                    priority -= 5;
                }
                if ((camp.campId == 1 || camp.campId == 7) & jungler.startCamp == Jungler.StartCamp.Blue)
                {
                    priority -= 5;
                }
                if ((camp.campId == 11 || camp.campId == 5) & jungler.startCamp == Jungler.StartCamp.Golems)
                {
                    priority -= 5;
                }
                if ((camp.campId == 14 || camp.campId == 13) & jungler.startCamp == Jungler.StartCamp.Frog)
                {
                    priority -= 5;
                }
            }


            camp.priority   = priority;
            camp.timeToCamp = timeToCamp;

            //if(!camp.isBuff)
            //  priority -= (isInBuffWay(camp)) ? 10 : 0;

            return(priority);
        }