
function HealGang()
{
   echo("HEAL CLICK");
   alxPlay(click);

   // check to see if they are infected
   
   if($disease !$= true)
      return;

         
   // they can heal if they have a doctor or not
   // if they have a doctor the amount of medicine needed will be reduced by half
   
   %num = GetTotalCombatPeople();
   
   // 1 unit of medicine per 10 men or per 20 men if they have a doctor
   
   if($Doctor $= true)
      %num = %num / CheckDoctor();
   else
      %num = %num / 5;
   
   %medsneeded = mCeil(%num);
   
   // if they don't have enough meds they can't heal
   
   if(%medsneeded > $medicine)
   {
      infowindow.Visible = true;
      infotext.setText("You don't have enough medicine to heal your gang. You can find more medicine by searching for supplies."); 
      InfoYesbutton.Visible = false;
      InfoNobutton.Visible = false;
      Infocontinuebutton.Visible = true;
      
      infocontinuebutton.command = "Infowindow.Visible = false;";
   }
   else
   {
      $disease = "";
      PromoteDoctor(); // so he gets experience for the heal
      DecreaseMedicine(%medsneeded);
      IncreaseMorale();
      UpdateStatsBar();      
   }
}


