Example #1
0
bool monster::hurt(int dam)
{
 hp -= dam;
 process_trigger(MTRIG_HURT, int(dam / 8));
 if (hp < 1)
  return true;
 return false;
}
Example #2
0
bool monster::hurt(int dam)
{
 hp -= dam;
 if (hp < 1)
  return true;
 if (dam > 0)
  process_trigger(MTRIG_HURT, 1 + int(dam / 3));
 return false;
}
Example #3
0
void monster::apply_damage(Creature* source, body_part /*bp*/, int dam) {
    if( dead ) {
        return;
    }
    hp -= dam;
    if( hp < 1 ) {
        die( source );
    } else if( dam > 0 ) {
        process_trigger( MTRIG_HURT, 1 + int( dam / 3 ) );
    }
}
bool monster::hurt(int dam, int real_dam)
{
 hp -= dam;
 if( real_dam > 0 ) {
     hp = std::max( hp, -real_dam );
 }
 if (hp < 1) {
     return true;
 }
 if (dam > 0) {
     process_trigger(MTRIG_HURT, 1 + int(dam / 3));
 }
 return false;
}