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.7 2006/03/30 11:11:35 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 |
… | |
… | |
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 = 50 + op->resist[ATNR_DRAIN] / 2; |
1195 | else if(op->resist[ATNR_DRAIN] < 0) |
1195 | else |
1196 | rate = 5000 / (100 - op->resist[ATNR_DRAIN]); |
1196 | rate = 5000 / (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 */ |