Example #1
0
 private static void FightOrHelp(IFighter fighter, UnitGroup opositeGroup, UnitGroup currentGroup)
 {
     if (UnitAction.Random && fighter.IsHelpfull())
     {
         fighter.HelpTo(currentGroup.GetTargetExeptCurrentFighter(fighter));
     }
     else if (UnitAction.Random && fighter.IsHealer() && currentGroup.IsNeedHeal())
     {
         fighter.HealUnit(currentGroup.GetTargetWithLowerHealth());
     }
     else
     {
         fighter.FightWith(GetTarget(fighter, opositeGroup, currentGroup));
     }
 }