1 | /* |
1 | /* |
2 | * static char *rcsid_attack_c = |
2 | * static char *rcsid_attack_c = |
3 | * "$Id: attack.c,v 1.6 2006/03/26 08:32:11 root Exp $"; |
3 | * "$Id: attack.c,v 1.9 2006/03/31 17:20:10 root Exp $"; |
4 | */ |
4 | */ |
5 | /* |
5 | /* |
6 | CrossFire, A Multiplayer game for X-windows |
6 | CrossFire, A Multiplayer game for X-windows |
7 | |
7 | |
8 | Copyright (C) 2002 Mark Wedel & Crossfire Development Team |
8 | Copyright (C) 2002 Mark Wedel & Crossfire Development Team |
… | |
… | |
1189 | * not much is drained, low rate means a lot is drained. |
1189 | * not much is drained, low rate means a lot is drained. |
1190 | */ |
1190 | */ |
1191 | int rate; |
1191 | int rate; |
1192 | |
1192 | |
1193 | if(op->resist[ATNR_DRAIN] >= 0) |
1193 | if(op->resist[ATNR_DRAIN] >= 0) |
1194 | rate = 50 + op->resist[ATNR_DRAIN] / 2; |
1194 | rate = 400 + op->resist[ATNR_DRAIN] * 3; |
1195 | else if(op->resist[ATNR_DRAIN] < 0) |
1195 | else |
1196 | rate = 5000 / (100 - op->resist[ATNR_DRAIN]); |
1196 | rate = 400 * 100 / (100 - op->resist[ATNR_DRAIN]); |
1197 | |
1197 | |
1198 | /* full protection has no effect. Nothing else in this |
|
|
1199 | * function needs to get done, so just return. */ |
|
|
1200 | if(!rate) |
|
|
1201 | return 0; |
|
|
1202 | |
|
|
1203 | if(op->stats.exp <= rate) { |
1198 | if(op->stats.exp <= rate) { |
1204 | if(op->type == GOLEM) |
1199 | if(op->type == GOLEM) |
1205 | dam = 999; /* Its force is "sucked" away. 8) */ |
1200 | dam = 999; /* Its force is "sucked" away. 8) */ |
1206 | else |
1201 | else |
1207 | /* If we can't drain, lets try to do physical damage */ |
1202 | /* If we can't drain, lets try to do physical damage */ |
… | |
… | |
1658 | #ifdef PROHIBIT_PLAYERKILL |
1653 | #ifdef PROHIBIT_PLAYERKILL |
1659 | if (op->type == PLAYER) { |
1654 | if (op->type == PLAYER) { |
1660 | object *owner = get_owner (hitter); |
1655 | object *owner = get_owner (hitter); |
1661 | if (!owner) owner = hitter; |
1656 | if (!owner) owner = hitter; |
1662 | if (owner->type == PLAYER |
1657 | if (owner->type == PLAYER |
1663 | && !op_on_battleground (op, 0, 0) |
1658 | && (!op_on_battleground (op, 0, 0) || op->contr->peaceful || op->contr->peaceful) |
1664 | && op != owner) { |
1659 | && op != owner) { |
1665 | return 0; |
1660 | return 0; |
1666 | } |
1661 | } |
1667 | } |
1662 | } |
1668 | #endif |
1663 | #endif |