version 1.27 | | version 1.28 |
---|
| | |
/* | | /* |
* static char *rcsid_attack_c = | | * static char *rcsid_attack_c = |
* "$Id: attack.c,v 1.27 2000/12/24 01:12:44 cvs Exp $"; | | * "$Id: attack.c,v 1.28 2001/01/08 20:39:59 avogl Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
void confuse_player(object *op, object *hitter, int dam) | | void confuse_player(object *op, object *hitter, int dam) |
{ | | { |
object *tmp; | | object *tmp; |
| | int maxduration; |
| | |
tmp = present_in_ob(CONFUSION,op); | | tmp = present_in_ob(CONFUSION,op); |
if(!tmp) { | | if(!tmp) { |
tmp = get_archetype("confusion"); | | tmp = get_archetype("confusion"); |
tmp = insert_ob_in_ob(tmp,op); | | tmp = insert_ob_in_ob(tmp,op); |
} | | } |
tmp->stats.food += 5; | | |
if( tmp->stats.food > 30) | | /* Duration added per hit and max. duration of confusion both depend |
tmp->stats.food = 30; | | on the player's resistance */ |
| | tmp->stats.food += MAX(1, 5*(100-op->resist[ATNR_CONFUSION])/100); |
| | maxduration = MAX(2, 30*(100-op->resist[ATNR_CONFUSION])/100); |
| | if( tmp->stats.food > maxduration) |
| | tmp->stats.food = maxduration; |
| | |
if(op->type == PLAYER && !QUERY_FLAG(op,FLAG_CONFUSED)) | | if(op->type == PLAYER && !QUERY_FLAG(op,FLAG_CONFUSED)) |
new_draw_info(NDI_UNIQUE, 0,op,"You suddenly feel very confused!"); | | new_draw_info(NDI_UNIQUE, 0,op,"You suddenly feel very confused!"); |
SET_FLAG(op, FLAG_CONFUSED); | | SET_FLAG(op, FLAG_CONFUSED); |