version 1.27 | | version 1.28 |
---|
| | |
/* | | /* |
* static char *rcsid_living_c = | | * static char *rcsid_living_c = |
* "$Id: living.c,v 1.27 2001/05/29 04:41:53 mwedel Exp $"; | | * "$Id: living.c,v 1.28 2001/07/14 04:04:53 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
*/ | | */ |
| | |
void fix_player(object *op) { | | void fix_player(object *op) { |
int i,j; | | int i,j, light=0; |
float f,max=9,added_speed=0,bonus_speed=0, sp_tmp,speed_reduce_from_disease=1; | | float f,max=9,added_speed=0,bonus_speed=0, sp_tmp,speed_reduce_from_disease=1; |
float M,W,s,D,K,S,M2; | | float M,W,s,D,K,S,M2; |
int weapon_weight=0,weapon_speed=0; | | int weapon_weight=0,weapon_speed=0; |
| | |
op->stats.luck=op->arch->clone.stats.luck; | | op->stats.luck=op->arch->clone.stats.luck; |
op->speed = op->arch->clone.speed; | | op->speed = op->arch->clone.speed; |
| | |
for(tmp=op->inv;tmp!=NULL;tmp=tmp->below) | | for(tmp=op->inv;tmp!=NULL;tmp=tmp->below) { |
| | /* See note in map.c:update_position about making this additive |
| | * since light sources are never applied, need to put check here. |
| | */ |
| | if (tmp->glow_radius > light) light=tmp->glow_radius; |
| | |
if(QUERY_FLAG(tmp,FLAG_APPLIED) && tmp->type!=CONTAINER && tmp->type!=CLOSE_CON) { | | if(QUERY_FLAG(tmp,FLAG_APPLIED) && tmp->type!=CONTAINER && tmp->type!=CLOSE_CON) { |
if(op->type==PLAYER | | |
/* The meaning of stats in skill or experience objects is different - | | /* The meaning of stats in skill or experience objects is different - |
* we use them solely to link skills to experience, thus it is | | * we use them solely to link skills to experience, thus it is |
* inappropriate to allow these applied objects to change stats. | | * inappropriate to allow these applied objects to change stats. |
* An exception is exp_wis, containing info about god-properties! */ | | * An exception is exp_wis, containing info about god-properties! */ |
&& (tmp->type!=EXPERIENCE || !strcmp(tmp->arch->name, "experience_wis")) | | if(op->type==PLAYER && (tmp->type!=EXPERIENCE || !strcmp(tmp->arch->name, "experience_wis"))) { |
) { | | |
if (tmp->type != POTION) { | | if (tmp->type != POTION) { |
for(i=0;i<7;i++) | | for(i=0;i<7;i++) |
change_attr_value(&(op->stats),i,get_attr_value(&(tmp->stats),i)); | | change_attr_value(&(op->stats),i,get_attr_value(&(tmp->stats),i)); |
| | |
max=ARMOUR_SPEED(tmp)/10.0; | | max=ARMOUR_SPEED(tmp)/10.0; |
break; | | break; |
} | | } |
| | } |
} /* Item is equipped - end of for loop going through items. */ | | } /* Item is equipped - end of for loop going through items. */ |
| | |
/* 'total resistance = total protections - total vulnerabilities'. | | /* 'total resistance = total protections - total vulnerabilities'. |
| | |
else if (ac<-120) ac=-120; | | else if (ac<-120) ac=-120; |
op->stats.ac=ac; | | op->stats.ac=ac; |
| | |
| | op->glow_radius = light; |
| | |
update_ob_speed(op); | | update_ob_speed(op); |
| | |
} | | } |