version 1.27 | | version 1.28 |
---|
| | |
/* | | /* |
* static char *rcsid_treasure_c = | | * static char *rcsid_treasure_c = |
* "$Id: treasure.c,v 1.27 2006/04/06 21:18:35 tchize Exp $"; | | * "$Id: treasure.c,v 1.28 2006/06/03 21:56:28 ryo_saeba Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
xl = x + freearr_x[i]; yl = y + freearr_y[i]; | | xl = x + freearr_x[i]; yl = y + freearr_y[i]; |
| | |
/* if the placement is blocked, return a fail. */ | | /* if the placement is blocked, return a fail. */ |
if(wall_blocked(map,xl,yl)) return 0; | | if(wall_blocked(map,xl,yl)) { |
| | free_object(the_chest); |
| | return 0; |
| | } |
| | |
| | |
/* put the treasures in the chest. */ | | /* put the treasures in the chest. */ |
| | |
int kx,ky; | | int kx,ky; |
object *the_keymaster; /* the monster that gets the key. */ | | object *the_keymaster; /* the monster that gets the key. */ |
object *the_key; | | object *the_key; |
| | char keybuf[256]; |
| | |
/* get a key and set its keycode */ | | /* get a key and set its keycode */ |
the_key = create_archetype("key2"); | | the_key = create_archetype("key2"); |
the_key->slaying = add_string(keycode); | | the_key->slaying = add_string(keycode); |
| | free_string(the_key->name); |
| | snprintf( keybuf,256, "key from level %d of %s", RP->dungeon_level, RP->dungeon_name[0] != '\0' ? RP->dungeon_name : "a random map" ); |
| | the_key->name = add_string(keybuf); |
| | |
| | |
if(door_flag==PASS_DOORS) { | | if(door_flag==PASS_DOORS) { |
| | |
free_object(door); | | free_object(door); |
doorlist[i]=new_door; | | doorlist[i]=new_door; |
insert_ob_in_map(new_door,map,NULL,0); | | insert_ob_in_map(new_door,map,NULL,0); |
sprintf(keybuf,"%d",(int)RANDOM()); | | snprintf(keybuf,256,"%d",(int)RANDOM()); |
new_door->slaying = add_string(keybuf); | | new_door->slaying = add_string(keybuf); |
keyplace(map,new_door->x,new_door->y,keybuf,NO_PASS_DOORS,2,RP); | | keyplace(map,new_door->x,new_door->y,keybuf,NO_PASS_DOORS,2,RP); |
} | | } |