version 1.75 | | version 1.76 |
---|
| | |
/* | | /* |
* static char *rcsid_living_c = | | * static char *rcsid_living_c = |
* "$Id: living.c,v 1.75 2006/01/09 19:35:10 cavesomething Exp $"; | | * "$Id: living.c,v 1.76 2006/02/09 00:48:36 akirschbaum Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
*/ | | */ |
| | |
sint8 | | sint8 |
get_attr_value(living *stats,int attr) { | | get_attr_value(const living *stats,int attr) { |
switch(attr) { | | switch(attr) { |
case STR: | | case STR: |
return(stats->Str); | | return(stats->Str); |
| | |
* false otherwise. | | * false otherwise. |
*/ | | */ |
| | |
int allowed_class(object *op) { | | int allowed_class(const object *op) { |
return op->stats.Dex>0&&op->stats.Str>0&&op->stats.Con>0&& | | return op->stats.Dex>0&&op->stats.Str>0&&op->stats.Con>0&& |
op->stats.Int>0&&op->stats.Wis>0&&op->stats.Pow>0&& | | op->stats.Int>0&&op->stats.Wis>0&&op->stats.Pow>0&& |
op->stats.Cha>0; | | op->stats.Cha>0; |
| | |
* as soon as clients support this! | | * as soon as clients support this! |
* Please, anyone, write support for 'ext_title'. | | * Please, anyone, write support for 'ext_title'. |
*/ | | */ |
void set_dragon_name(object *pl, object *abil, object *skin) { | | void set_dragon_name(object *pl, const object *abil, const object *skin) { |
int atnr=-1; /* attacknumber of highest level */ | | int atnr=-1; /* attacknumber of highest level */ |
int level=0; /* highest level */ | | int level=0; /* highest level */ |
int i; | | int i; |
| | |
* the 'exp' value passed should be positive - this is the | | * the 'exp' value passed should be positive - this is the |
* amount that should get subtract from the player. | | * amount that should get subtract from the player. |
*/ | | */ |
sint64 check_exp_loss(object *op, sint64 exp) | | sint64 check_exp_loss(const object *op, sint64 exp) |
{ | | { |
sint64 del_exp; | | sint64 del_exp; |
| | |
| | |
return exp; | | return exp; |
} | | } |
| | |
sint64 check_exp_adjust(object *op, sint64 exp) | | sint64 check_exp_adjust(const object *op, sint64 exp) |
{ | | { |
if (exp<0) return check_exp_loss(op, exp); | | if (exp<0) return check_exp_loss(op, exp); |
else return MIN(exp, MAX_EXPERIENCE - op->stats.exp); | | else return MIN(exp, MAX_EXPERIENCE - op->stats.exp); |
| | |
* resistance to particular attacktype. | | * resistance to particular attacktype. |
* Returns 1 if op makes his save, 0 if he failed | | * Returns 1 if op makes his save, 0 if he failed |
*/ | | */ |
int did_make_save(object *op, int level, int bonus) | | int did_make_save(const object *op, int level, int bonus) |
{ | | { |
if (level > MAX_SAVE_LEVEL) level = MAX_SAVE_LEVEL; | | if (level > MAX_SAVE_LEVEL) level = MAX_SAVE_LEVEL; |
| | |