Exemple #1
0
        public IStep doSmth()
        {
            CStep result = new CStep();

            st.Refresh();

            if (st.isEnemyDetected)
            {
                if (CanKillDarkBotOnThisStep())
                {
                    result.Set(Steps.ROCKET, st.GetEnemyCoord() );
                } else
                {
                    if (HaveChanceToKill())
                    {
                        if (API.isVisible())
                        {
                            if(st.isMyWeaponReady)
                                if (API.endAfterTime() <= 4)
                                {
                                    result.Set(Steps.ROCKET, st.GetEnemyCoord());
                                } else
                                {
                                    result.Set(Steps.BLASTER, st.GetEnemyCoord());
                                }
                            else
                                GoToUpdates(result);
                        } else
                        {
                            if(st.isMyWeaponReady)
                                result.Set(Steps.ROCKET, st.GetEnemyCoord());
                            else GoToUpdates(result);
                        }
                    } else
                    {
                        GoToUpdates(result);//1.2.2.1.	Идем к бонусам или аптечкам
                    }
                }
            } else
            {
                if (HaveChanceToKill())
                {
                    if (st.Map.LocCount <= 2)
                    {
                        int k = Rnd.Next(st.Map.LocCount - 1);
                        result.Set(Steps.ROCKET, st.Map.EnemyLocList(k));
                    } else
                    {
                        GoToUpdates(result);//1.2.2.1.	Идем к бонусам или аптечкам1
                    }
                } else
                {
                    GoToUpdates(result);//1.2.2.1.	Идем к бонусам или аптечкам1
                }
            }

            if (!st.CanIStep())
                result.Set(Steps.STEP, st.MyCoord);

            st.PredStep = result;

            return result;
        }
Exemple #2
0
        private void GoToUpdates(CStep step)
        {
            int MaxDistanceToArea = (st.MapHeight+st.MapWidth)/(2+3);
            int MaxAreaRadius = 4;

            CCoord coord;
            if (API.isVisible())
            {
                int k = Useful.Min(API.endAfterTime() - 1, 3);
                coord = FindUpdatesConcentrationArea(k, MaxAreaRadius);
                if (coord == null)
                {
                    List<CCoord> list = GetNearUpdates(st.MyCoord, int.MaxValue);
                    if (list.Count > 0) coord = list[0];
                    else coord = getMapCenter();
                }
                step.Set(Steps.STEP, GetTrackToPoint(coord)[0]);
            } else
            {
                int k = Useful.Min(API.endAfterTime()-4, MaxDistanceToArea);
                coord = FindUpdatesConcentrationArea(k, MaxAreaRadius);
                if (coord == null)
                {
                    List<CCoord> list = GetNearUpdates(st.MyCoord, int.MaxValue);
                    if (list.Count > 0) coord = list[0];
                    else coord = getMapCenter();
                }
                step.Set(Steps.STEP, GetTrackToPoint(coord)[0]);
            }
        }