Beispiel #1
0
 public void clicked(Map map)
 {
     //selector.selected(person,agent);
     if (hex != null)
     {
         ability.cast(map, hex);
     }
     else
     {
         ability.cast(map, person);
     }
 }
 public void clicked(Map map)
 {
     //selector.selected(person,agent);
     ability.playSound(map.world.audioStore);
     if (hex != null)
     {
         ability.cast(map, hex);
     }
     else if (unit != null)
     {
         ability.cast(map, unit);
     }
     else
     {
         ability.cast(map, person);
     }
 }
Beispiel #3
0
 public void ai_testCold()
 {
     if (automatedAbilities.Count == 0)
     {
         foreach (Ability a in new God_WintersScythe().getUniquePowers())
         {
             if (a is Ab_Ice_IceBlood)
             {
                 continue;
             }                                      //Basically throwing away your gains if you don't know what you're doing. Which the AI doesn't
             if (a is Ab_Ice_Blizzard)
             {
                 continue;
             }                                      //Basically throwing away your gains if you don't know what you're doing. Which the AI doesn't
             automatedAbilities.Add(a);
         }
     }
     if (overmind.power > 0)
     {
         Location target = null;
         int      c      = 0;
         Ability  chosen = null;
         foreach (Ability a in automatedAbilities)
         {
             if (map.turn - a.turnLastCast <= a.getCooldown())
             {
                 continue;
             }
             if (overmind.power < a.getCost())
             {
                 continue;
             }
             foreach (Location loc in map.locations)
             {
                 if (a.castable(map, loc.hex))
                 {
                     c += 1;
                     if (Eleven.random.Next(c) == 0)
                     {
                         target = loc;
                         chosen = a;
                     }
                 }
             }
         }
         if (chosen != null)
         {
             chosen.cast(map, target.hex);
         }
     }
     //Only spend reserve power on this boondoggle
     if (overmind.power > map.param.overmind_maxPower * 0.66)
     {
         foreach (Unit u in overmind.map.units)
         {
             if (u is Unit_Investigator && u.task is Task_Investigate)
             {
                 u.task          = new Task_Disrupted();
                 overmind.power -= overmind.map.param.ability_disruptAgentCost;
                 break;
             }
         }
     }
 }