version 1.12 | | version 1.13 |
---|
| | |
/* | | /* |
* static char *rcsid_attack_c = | | * static char *rcsid_attack_c = |
* "$Id: attack.c,v 1.12 2000/06/07 23:46:18 jec Exp $"; | | * "$Id: attack.c,v 1.13 2000/06/08 16:08:41 jec Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
} else if (attacktype & AT_TURN_UNDEAD) { | | } else if (attacktype & AT_TURN_UNDEAD) { |
if (QUERY_FLAG(op,FLAG_UNDEAD)) { | | if (QUERY_FLAG(op,FLAG_UNDEAD)) { |
object *owner=get_owner(hitter)==NULL?hitter:get_owner(hitter); | | object *owner=get_owner(hitter)==NULL?hitter:get_owner(hitter); |
/* if undead are not an enemy of your god, you turn them at half strength */ | | object *god = find_god (determine_god (owner)); |
if(op->level<((turn_bonus[owner->stats.Wis]+owner->level) / | | int div = 1; |
(strstr(find_god(determine_god(owner))->slaying,undead_name)?1:2))) | | /* if undead are not an enemy of your god, you turn them at half |
| | * strength */ |
| | if ( ! god || ! god->slaying |
| | || strstr (god->slaying, undead_name) == NULL) |
| | div = 2; |
| | if (op->level < (turn_bonus[owner->stats.Wis]+owner->level) / div) |
SET_FLAG(op, FLAG_SCARED); | | SET_FLAG(op, FLAG_SCARED); |
} | | } |
else dam=0; /*don't damage non undead - should we damage undead? */ | | else dam=0; /*don't damage non undead - should we damage undead? */ |
| | |
* a proper match, otherwise no damage. | | * a proper match, otherwise no damage. |
*/ | | */ |
if (type & AT_HOLYWORD) { | | if (type & AT_HOLYWORD) { |
| | object *god; |
if ((!hitter->slaying || | | if ((!hitter->slaying || |
(!(op->race && strstr(hitter->slaying,op->race)) && | | (!(op->race && strstr(hitter->slaying,op->race)) && |
!(op->name && strstr(hitter->slaying,op->name)))) && | | !(op->name && strstr(hitter->slaying,op->name)))) && |
(!QUERY_FLAG(op,FLAG_UNDEAD) || | | (!QUERY_FLAG(op,FLAG_UNDEAD) || |
(hitter->title != NULL && | | (hitter->title != NULL |
(strstr(find_god(determine_god(hitter))->race,undead_name)!=NULL)))) | | && (god = find_god(determine_god(hitter))) != NULL |
| | && god->race != NULL |
| | && strstr(god->race,undead_name) != NULL))) |
return 0; | | return 0; |
} | | } |
| | |
| | |
} | | } |
if(QUERY_FLAG (op, FLAG_FRIENDLY)) { | | if(QUERY_FLAG (op, FLAG_FRIENDLY)) { |
remove_friendly_object(op); | | remove_friendly_object(op); |
if(get_owner(op)!=NULL) | | if (get_owner (op) != NULL && op->owner->type == PLAYER) |
op->owner->contr->golem=NULL; | | op->owner->contr->golem=NULL; |
else | | else |
LOG(llevDebug,"Encountered golem without owner.\n"); | | LOG (llevError, "BUG: hit_player(): Encountered golem " |
| | "without owner.\n"); |
remove_ob(op); | | remove_ob(op); |
free_object(op); | | free_object(op); |
return maxdam; | | return maxdam; |