version 1.23 | | version 1.24 |
---|
| | |
/* | | /* |
* static char *rcsid_attack_c = | | * static char *rcsid_attack_c = |
* "$Id: attack.c,v 1.23 2000/12/04 00:40:05 cvs Exp $"; | | * "$Id: attack.c,v 1.24 2000/12/14 03:52:33 avogl Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
LOG(llevError,"hit_player_attacktype called without an attacktype\n"); | | LOG(llevError,"hit_player_attacktype called without an attacktype\n"); |
return 0; | | return 0; |
} | | } |
| | if (dam < 0) { |
| | LOG(llevError,"hit_player_attacktype called with negative damage: %d\n", dam); |
| | return 0; |
| | } |
| | |
/* AT_INTERNAL is supposed to do exactly dam. Put a case here so | | /* AT_INTERNAL is supposed to do exactly dam. Put a case here so |
* people can't mess with that or it otherwise get confused. | | * people can't mess with that or it otherwise get confused. |
*/ | | */ |
| | |
} | | } |
} | | } |
| | |
/* Adjust the damage. Note that negative values increase damage. */ | | /* Adjust the damage for resistance. Note that neg. values increase damage. */ |
if (op->resist[attacknum]) { | | if (op->resist[attacknum] || 1) { |
/* int oldam=dam;*/ | | /* basically: dam = dam*(100-op->resist[attacknum])/100; |
| | * in case 0>dam>1, we try to "simulate" a float value-effect */ |
dam = dam*(100-op->resist[attacknum])/100; | | dam = dam*(100-op->resist[attacknum]); |
/* fprintf(stderr,"Attacknum %d damage reduced from %d to %d, res=%d\n", | | if (dam >= 100) |
attacknum, oldam, dam, op->resist[attacknum]); | | dam /= 100; |
*/ | | else |
| | dam = (dam > (RANDOM()%100)) ? 1 : 0; |
} | | } |
| | |
/* Special hack. By default, if immune to something, you shouldn't need | | /* Special hack. By default, if immune to something, you shouldn't need |