예제 #1
0
        public static void MakeZomboAt(ZomboType type, Alliance alliance, Point at)
        {
            var zombo = new Zombo(type, alliance, at);

            FullMap.SetAt(zombo);
            zombos.Add(zombo);
        }
예제 #2
0
        static void FightForMelee(Zombo fightFor)
        {
            var killTargets = PointHelper.ZombosAroundPoint(fightFor.location).Where(x => x.alliance != fightFor.alliance);

            if (killTargets.Any())
            {
                EntityControl.Kill(ListHelper.RandomElementInEnumerable(killTargets));
            }
        }
예제 #3
0
        public static void RandomWalkZombo(Zombo toWalk)
        {
            var options = PointHelper.EmptyPointsAroundPoint(toWalk.location);

            if (options.Any())
            {
                var moveTo = ListHelper.RandomElementInEnumerable(options);
                EntityControl.MoveZomboTo(toWalk, moveTo);
            }
        }
예제 #4
0
 public static void FightForZombo(Zombo fightFor)
 {
     if (fightFor.IsZombie())
     {
         FightForMelee(fightFor);
     }
     else if (fightFor.IsRanged())
     {
         FightForRanged(fightFor);
     }
 }
예제 #5
0
 static void FightForRanged(Zombo fightFor)
 {
     for (int i = 0; i < 1; i++)
     {
         var killTargets = PointHelper.ZombosAroundPoint(fightFor.location, 3).Where(x => x.alliance != fightFor.alliance);
         if (killTargets.Any())
         {
             EntityControl.Kill(ListHelper.RandomElementInEnumerable(killTargets));
             ZomboFoodManager.IncrementFoodFor(fightFor, 1);
         }
     }
 }
예제 #6
0
 static void DuplicateCheck(Zombo check)
 {
     if (check.FoodCount >= FoodToCopy[check.zomboType])
     {
         var possiblePoints = PointHelper.EmptyPointsAroundPoint(check.location);
         if (possiblePoints.Count() == 8)
         {
             EntityControl.DuplicateZomboAt(check, ListHelper.RandomElementInEnumerable(possiblePoints));
             check.FoodCount -= FoodToCopy[check.zomboType];
         }
     }
 }
예제 #7
0
 public static void IncrementFoodFor(Zombo incrementFor, int by) => incrementFor.FoodCount += by;
예제 #8
0
 static void PassiveFoodCheck(Zombo check)
 {
     IncrementFoodFor(check, PassiveFood[check.zomboType]);
 }
예제 #9
0
 public static void ManageFoodFor(Zombo manageFor)
 {
     PassiveFoodCheck(manageFor);
     DuplicateCheck(manageFor);
 }
예제 #10
0
 public static void OverrideColorForZombo(Zombo overrideFor) => OverrideColorFor(overrideFor, AllianceColorMap[overrideFor.alliance]);
예제 #11
0
        //TODO: add some killed flag to the zombo killed above to indicate that it shouldn't execute. also affects below

        static void ManageZombo(Zombo toManage)
        {
            ZomboRandomWalker.RandomWalkZombo(toManage);
            ZomboFighter.FightForZombo(toManage);
            ZomboFoodManager.ManageFoodFor(toManage);
        }
예제 #12
0
 public static void Kill(Zombo toKill)
 {
     FullMap.ResetAt(toKill.location);
     zombos.Remove(toKill);
 }
예제 #13
0
 public static void MoveZomboTo(Zombo zombo, Point moveTo)
 {
     FullMap.ResetAt(zombo.location);
     zombo.location = moveTo;
     FullMap.SetAt(zombo);
 }
예제 #14
0
 public static void DuplicateZomboAt(Zombo toDuplicate, Point duplicateAt) => MakeZomboAt(toDuplicate.zomboType, toDuplicate.alliance, duplicateAt);