version 1.3 | | version 1.4 |
---|
| | |
/* | | /* |
* static char *rcsid_treasure_c = | | * static char *rcsid_treasure_c = |
* "$Id: treasure.c,v 1.3 2000/05/26 09:50:47 jec Exp $"; | | * "$Id: treasure.c,v 1.4 2000/06/19 01:34:31 cvs Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
#define TRAPPED 16 /* trap dropped in same location as chest. */ | | #define TRAPPED 16 /* trap dropped in same location as chest. */ |
#define SPARSE 32 /* 1/2 as much treasure as default */ | | #define SPARSE 32 /* 1/2 as much treasure as default */ |
#define RICH 64 /* 2x as much treasure as default */ | | #define RICH 64 /* 2x as much treasure as default */ |
| | #define FILLED 128 /* Fill/tile the entire map with treasure */ |
#define LAST_OPTION 64 /* set this to the last real option, for random */ | | #define LAST_OPTION 64 /* set this to the last real option, for random */ |
| | |
#define NO_PASS_DOORS 0 | | #define NO_PASS_DOORS 0 |
| | |
if(treasureoptions<=0) treasureoptions=RANDOM() % (2*LAST_OPTION); | | if(treasureoptions<=0) treasureoptions=RANDOM() % (2*LAST_OPTION); |
| | |
/* filter out the mutually exclusive options */ | | /* filter out the mutually exclusive options */ |
if(treasureoptions & (RICH|SPARSE)) | | if(treasureoptions & (RICH|SPARSE)) { |
if(RANDOM()%2) treasureoptions -=1; | | if(RANDOM()%2) treasureoptions -=1; |
else treasureoptions-=2; | | else treasureoptions-=2;} |
| | |
/* pick the number of treasures */ | | /* pick the number of treasures */ |
if(treasureoptions & SPARSE) | | if(treasureoptions & SPARSE) |
| | |
| | |
| | |
/* put the treasures in the chest. */ | | /* put the treasures in the chest. */ |
if(style_map) { | | /* if(style_map) { */ |
| | if(0) { /* don't use treasure style maps for now! */ |
int ti; | | int ti; |
/* if treasurestyle lists a treasure list, use it. */ | | /* if treasurestyle lists a treasure list, use it. */ |
treasurelist *tlist=find_treasurelist(treasurestyle); | | treasurelist *tlist=find_treasurelist(treasurestyle); |