version 1.52 | | version 1.53 |
---|
| | |
/* | | /* |
* static char *rcsid_living_c = | | * static char *rcsid_living_c = |
* "$Id: living.c,v 1.52 2003/09/15 06:12:48 mwedel Exp $"; | | * "$Id: living.c,v 1.53 2003/09/26 05:46:09 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
| | |
if (abil->resist[abil->stats.exp]>0 && abil->resist[abil->stats.exp]%5 == 0) { | | if (abil->resist[abil->stats.exp]>0 && abil->resist[abil->stats.exp]%5 == 0) { |
/* time to hand out a new ability-gift */ | | /* time to hand out a new ability-gift */ |
(*dragon_gain_func)(who, abil->stats.exp, | | (*dragon_gain_func)(who, (int)abil->stats.exp, |
(int)((1+abil->resist[abil->stats.exp])/5.)); | | (int)((1+abil->resist[abil->stats.exp])/5.)); |
} | | } |
| | |
| | |
* 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. |
*/ | | */ |
int check_exp_loss(object *op, int exp) | | sint64 check_exp_loss(object *op, sint64 exp) |
{ | | { |
int del_exp; | | sint64 del_exp; |
| | |
if (exp > op->stats.exp) exp = op->stats.exp; | | if (exp > op->stats.exp) exp = op->stats.exp; |
if (settings.use_permanent_experience) { | | if (settings.use_permanent_experience) { |
| | |
return exp; | | return exp; |
} | | } |
| | |
int check_exp_adjust(object *op, int exp) | | sint64 check_exp_adjust(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); |