version 1.1 | | version 1.2 |
---|
| | |
/* | | /* |
* static char *rcsid_attack_c = | | * static char *rcsid_attack_c = |
* "$Id: attack.c,v 1.1 1999/04/02 19:10:04 uid200 Exp $"; | | * "$Id: attack.c,v 1.2 1999/06/13 05:01:06 cvs Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
add_refcount(op_name = op->name); | | add_refcount(op_name = op->name); |
if(hitter->head!=NULL) | | if(hitter->head!=NULL) |
hitter=hitter->head; | | hitter=hitter->head; |
| | |
| | if (hitter->name==NULL) { |
| | if(settings.debug) { |
| | dump_object(hitter); |
| | LOG(llevDebug,"Object without name tried to attack.\n%s\n",errmsg); |
| | } |
| | return 1; |
| | } |
| | |
if(op->stats.luck) { | | if(op->stats.luck) { |
luck=RANDOM()%abs(op->stats.luck); | | luck=RANDOM()%abs(op->stats.luck); |
if(op->stats.luck<0) | | if(op->stats.luck<0) |
| | |
if(QUERY_FLAG(op,FLAG_WIZ)||!QUERY_FLAG(op,FLAG_ALIVE)||op->stats.hp<0) | | if(QUERY_FLAG(op,FLAG_WIZ)||!QUERY_FLAG(op,FLAG_ALIVE)||op->stats.hp<0) |
return 0; | | return 0; |
| | |
| | /* If its already dead, or we're the wizard, don't attack it - no point */ |
| | if(hitter->name==NULL) { |
| | if (settings.debug) |
| | LOG(llevDebug, "hit_player: hitter has no name\n"); |
| | return 0; |
| | } |
| | |
#ifdef ATTACK_DEBUG | | #ifdef ATTACK_DEBUG |
LOG(llevDebug,"hit player: attacktype %d, dam %d\n", type, dam); | | LOG(llevDebug,"hit player: attacktype %d, dam %d\n", type, dam); |
#endif | | #endif |