version 1.56 | | version 1.57 |
---|
| | |
/* | | /* |
* static char *rcsid_attack_c = | | * static char *rcsid_attack_c = |
* "$Id: attack.c,v 1.56 2001/11/04 20:22:55 michtoen Exp $"; | | * "$Id: attack.c,v 1.57 2001/11/26 17:52:26 michtoen Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
| | |
if (get_attack_mode (&op, &hitter, &simple_attack)) | | if (get_attack_mode (&op, &hitter, &simple_attack)) |
goto error; | | goto error; |
| | |
#ifdef PLUGINS | | #ifdef PLUGINS |
/* GROS: Handle for plugin attack event */ | | /* GROS: Handle for plugin attack event */ |
if(op->event_hook[EVENT_ATTACK] != NULL) | | if(op->event_hook[EVENT_ATTACK] != NULL) |
| | |
leave: | | leave: |
if (op_name) | | if (op_name) |
free_string (op_name); | | free_string (op_name); |
| | |
return dam; | | return dam; |
} | | } |
| | |
int attack_ob (object *op, object *hitter) | | int attack_ob (object *op, object *hitter) |
{ | | { |
| | |
if (hitter->head) | | if (hitter->head) |
hitter = hitter->head; | | hitter = hitter->head; |
return attack_ob_simple (op, hitter, hitter->stats.dam, hitter->stats.wc); | | return attack_ob_simple (op, hitter, hitter->stats.dam, hitter->stats.wc); |
| | |
} | | } |
else | | else |
#endif | | #endif |
| | |
hit_something = attack_ob_simple (victim, hitter, op->stats.dam, | | hit_something = attack_ob_simple (victim, hitter, op->stats.dam, |
op->stats.wc); | | op->stats.wc); |
| | |
| | |
if (get_attack_mode (&op, &hitter, &simple_attack)) | | if (get_attack_mode (&op, &hitter, &simple_attack)) |
return 0; | | return 0; |
| | |
if (QUERY_FLAG (op, FLAG_WIZ)) | | /* very simple: if our target has no_damage 1 set or is wiz, we can't hurt him */ |
| | if (QUERY_FLAG (op, FLAG_WIZ) || QUERY_FLAG (op, FLAG_NO_DAMAGE)) |
return 0; | | return 0; |
| | |
op_tag = op->count; | | op_tag = op->count; |