version 1.98 | | version 1.99 |
---|
| | |
/* | | /* |
* static char *rcsid_apply_c = | | * static char *rcsid_apply_c = |
* "$Id: apply.c,v 1.98 2004/02/18 05:28:54 mwedel Exp $"; | | * "$Id: apply.c,v 1.99 2004/02/27 23:00:27 ryo_saeba Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
do { | | do { |
i=10; /* let's give it 10 tries */ | | i=10; /* let's give it 10 tries */ |
while((tmp=generate_treasure(op->randomitems, | | while((tmp=generate_treasure(op->randomitems, |
op->stats.exp?op->stats.exp:MAX(op->map->difficulty, 5)))==NULL&&--i); | | op->stats.exp?(int)op->stats.exp:MAX(op->map->difficulty, 5)))==NULL&&--i); |
if(tmp==NULL) | | if(tmp==NULL) |
return 0; | | return 0; |
if(QUERY_FLAG(tmp, FLAG_CURSED) || QUERY_FLAG(tmp, FLAG_DAMNED)) { | | if(QUERY_FLAG(tmp, FLAG_CURSED) || QUERY_FLAG(tmp, FLAG_DAMNED)) { |
| | |
return 0; | | return 0; |
while ((op->stats.hp--)>0) | | while ((op->stats.hp--)>0) |
create_treasure(op->randomitems, op, op->map?GT_ENVIRONMENT:0, | | create_treasure(op->randomitems, op, op->map?GT_ENVIRONMENT:0, |
op->stats.exp ? op->stats.exp : | | op->stats.exp ? (int)op->stats.exp : |
op->map == NULL ? 14: op->map->difficulty,0); | | op->map == NULL ? 14: op->map->difficulty,0); |
| | |
/* If we generated on object and put it in this object inventory, | | /* If we generated on object and put it in this object inventory, |
| | |
| | |
void eat_special_food(object *who, object *food) { | | void eat_special_food(object *who, object *food) { |
object *force; | | object *force; |
int i, did_one=0, k; | | int i, did_one=0; |
| | sint8 k; |
| | |
force = get_archetype(FORCE_NAME); | | force = get_archetype(FORCE_NAME); |
| | |
| | |
*/ | | */ |
int i,j; | | int i,j; |
for(i=0;i<7;i++) { | | for(i=0;i<7;i++) { |
int stat=get_attr_value(stats,i); | | sint8 stat=get_attr_value(stats,i); |
int race_bonus = get_attr_value(&(pl->arch->clone.stats),i); | | int race_bonus = get_attr_value(&(pl->arch->clone.stats),i); |
stat += get_attr_value(ns,i); | | stat += get_attr_value(ns,i); |
if(stat > 20 + race_bonus) { | | if(stat > 20 + race_bonus) { |