// all things consumed by the gang //////////////////////////

// food /////////////////////////////////////////////////////

// eat once per day

function ConsumeFood()
{
   // if food is gone things start happening!

   if($food == 0)
   {
      $starving = true;
      DecreaseMorale(2);
   }

   %people = GetTotalNumPeople();
   
   // if they have less then half food units for the total number of people they still start starving
      
   if(%people >  $food)
   {
      %div = %people / 2;
      
      if(%people > $food)
      {
         $starving = true;
         DecreaseMorale(2);
         DisplayTutorial(starving);
      }

      $food = 0;
   }
   else  
   {
      DecreaseFood(%people);
      $starving = false;
   }
    
   UpdateStatsBar();
}

// fuel //////////////////////////////////////////////////////////////
// will get called whenever the gang goes a certain distance

function ConsumeFuel()
{
   %fuel = GetTotalFuelConsumption();
   
   if(%fuel > $fuel)
      $FuelFlag = true;
   else
      DecreaseFuel(%fuel);
}

function IncreaseFood(%num)
{
   echo("Increase food by " @ %num @ " and original food count is " @ $food);
   
   $food = $food+%num;   
   
   echo("Food is now " @ $food);
}

function DecreaseFood(%num)
{
   echo("Decrease food by " @ %num @ " and original food count is " @ $food);
   
   $food = $food-%num;   
   
   echo("Food is now " @ $food);
}

function IncreaseFuel(%num)
{
   echo("Increase fuel by " @ %num @ " and original fuel count is " @ $fuel);
   
   $fuel = $fuel+%num;   
   
   echo("Fuel is now " @ $fuel);
}

function DecreaseFuel(%num)
{
   echo("Decrease fuel by " @ %num @ " and original fuel count is " @ $fuel);
   
   $fuel = $fuel-%num;   
   
   echo("Fuel is now " @ $fuel);
}

function IncreaseMedicine(%num)
{
   echo("Increase medicine by " @ %num @ " and original medicine count is " @ $medicine);
   
   $medicine = $medicine+%num;   
   
   echo("Medicine is now " @ $medicine);
}

function DecreaseMedicine(%num)
{
   echo("Decrease medicine by " @ %num @ " and original medicine count is " @ $medicine);
   
   $medicine = $medicine-%num;   
   
   echo("Medicine is now " @ $medicine);
}

function IncreaseGuns(%num)
{
   echo("Increase guns by " @ %num @ " and original guns count is " @ $guns);
   
   $guns = $guns+%num;   
   
   echo("Guns is now " @ $guns);
}

function DecreaseGuns(%num)
{
   echo("Decrease guns by " @ %num @ " and original guns count is " @ $guns);
   
   $guns = $guns-%num;   
   
   echo("Guns is now " @ $guns);
}

function IncreaseAmmo(%num)
{
   echo("Increase ammo by " @ %num @ " and original ammo count is " @ $ammo);
   
   $ammo = $ammo+%num;   
   
   echo("Ammo is now " @ $ammo);
}

function DecreaseAmmo(%num)
{
   echo("Decrease ammo by " @ %num @ " and original ammo count is " @ $ammo);
   
   $ammo = $ammo-%num;   
   
   echo("Ammo is now " @ $ammo);
}

function IncreaseSpareParts(%num)
{
   echo("Increase spare parts by " @ %num @ " and original spare parts count is " @ $spareparts);
   
   $spareparts = $spareparts+%num;   
   
   echo("spare parts is now " @ $spareparts);
}

function DecreaseSpareParts(%num)
{
   echo("Decrease spare parts by " @ %num @ " and original spare parts count is " @ $spareparts);
   
   $spareparts = $spareparts-%num;   
   
   echo("spare parts is now " @ $spareparts);
}

function IncreaseTires(%num)
{
   echo("Increase tires by " @ %num @ " and original tires count is " @ $tires);
   
   $tires = $tires+%num;   
   
   echo("tires is now " @ $tires);
}

function DecreaseTires(%num)
{
   echo("Decrease tires by " @ %num @ " and original tires count is " @ $tires);
   
   $tires = $tires-%num;   
   
   echo("tires is now " @ $tires);
}
