示例#1
0
// DESC: modifies health of patient if machine happens to harm user
// PRE: patient must have modify_help member function
// POST: patient.condition will be modified to reflect damage, returns
//       nothing
void x_rayer::apply(patient & user)
{
  
  // halve patient condition randomly. odds are 1 in DAMAGE_CHANCE
  if (rand_num(0,X_RAYER_DAMAGE_CHANCE) == 0)
    user.modify_phys_health(-user.get_phys_health()/2);
  
  m_num_uses += 1;
  
  return;
}