version 1.63 | | version 1.64 |
---|
| | |
/* | | /* |
* static char *rcsid_attack_c = | | * static char *rcsid_attack_c = |
* "$Id: attack.c,v 1.63 2001/12/17 04:15:56 mwedel Exp $"; | | * "$Id: attack.c,v 1.64 2001/12/18 09:45:07 darth_bob Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
owner->level+turn_bonus[owner->stats.Wis]) | | owner->level+turn_bonus[owner->stats.Wis]) |
SET_FLAG(op, FLAG_SCARED); | | SET_FLAG(op, FLAG_SCARED); |
} break; | | } break; |
| | case ATNR_LIFE_STEALING: |
| | { |
| | int new_hp; |
| | /* this is replacement to drain for players, instead of taking |
| | * exp it takes hp. It is geared for players, probably not |
| | * much use giving it to monsters |
| | * |
| | * life stealing doesn't do a lot of damage, but it gives the |
| | * damage it does do to the player. Given that, |
| | * it only does 1/10'th normal damage (hence the divide by |
| | * 1000). |
| | */ |
| | /* You can't steal life from something undead */ |
| | if ((op->type == GOLEM) || (QUERY_FLAG(op, FLAG_UNDEAD))) return 0; |
| | /* If drain protection is higher than life stealing, use that */ |
| | if (op->resist[ATNR_DRAIN] >= op->resist[ATNR_LIFE_STEALING]) |
| | dam = (dam*(100 - op->resist[ATNR_DRAIN])) / 1000; |
| | else dam = (dam*(100 - op->resist[ATNR_LIFE_STEALING])) / 1000; |
| | /* You die at -1 hp, not zero. */ |
| | if (dam > (op->stats.hp+1)) dam = op->stats.hp+1; |
| | new_hp = hitter->stats.hp + dam; |
| | if (new_hp > hitter->stats.maxhp) new_hp = hitter->stats.maxhp; |
| | if (new_hp > hitter->stats.hp) hitter->stats.hp = new_hp; |
| | } |
} | | } |
return dam; | | return dam; |
} | | } |