* resistant (if they were, we'd have to reset the name as well as
* setting corpsenm).
*/
- for (wastyp = otmp->corpsenm; ; wastyp = rndmonnum()) {
+ for (wastyp = otmp->corpsenm; i < 1000 ; i++, wastyp = rndmonnum()) {
/* makemon without rndmonst() might create a group */
was = makemon(&mons[wastyp], 0, 0, MM_NOCOUNTBIRTH);
- if (!resists_ston(was)) {
+ if (was) {
+ if (!resists_ston(was)) {
(void) propagate(wastyp, TRUE, FALSE);
break;
+ }
+ mongone(was);
+ was = NULL;
}
- mongone(was);
}
- set_corpsenm(otmp, wastyp);
- while(was->minvent) {
- obj = was->minvent;
- obj->owornmask = 0;
- obj_extract_self(obj);
- (void) add_to_container(otmp, obj);
+ if (was) {
+ set_corpsenm(otmp, wastyp);
+ while(was->minvent) {
+ obj = was->minvent;
+ obj->owornmask = 0;
+ obj_extract_self(obj);
+ (void) add_to_container(otmp, obj);
+ }
+ otmp->owt = weight(otmp);
+ mongone(was);
}
- otmp->owt = weight(otmp);
- mongone(was);
}
+ /* Nasty hack here: try to determine if this is the Mines or Sokoban
+ * "prize" and then set record_achieve_special (maps to corpsenm)
+ * for the object. That field will later be checked to find out if
+ * the player obtained the prize. */
+ if(otmp->otyp == LUCKSTONE && Is_mineend_level(&u.uz)) {
+ otmp->record_achieve_special = 1;
+ } else if((otmp->otyp == AMULET_OF_REFLECTION ||
+ otmp->otyp == BAG_OF_HOLDING) &&
+ Is_sokoend_level(&u.uz)) {
+ otmp->record_achieve_special = 1;
+ }
+
stackobj(otmp);
- } /* if (rn2(100) < o->chance) */
- o_done:
- Free(o->name.str);
-}
-
-/*
- * Randomly place a specific engraving, then release its memory.
- */
-STATIC_OVL void
-create_engraving(e, croom)
-engraving *e;
-struct mkroom *croom;
-{
- xchar x, y;
-
- x = e->x, y = e->y;
- if (croom)
- get_room_loc(&x, &y, croom);
- else
- get_location(&x, &y, DRY);
-
- make_engr_at(x, y, e->engr.str, 0L, e->etype);
- free((genericptr_t) e->engr.str);
-}
-
-/*
- * Create stairs in a room.
- *
- */
+ if (o->lit) {
+ begin_burn(otmp, FALSE);
+ }
-STATIC_OVL void
-create_stairs(s,croom)
-stair *s;
-struct mkroom *croom;
-{
- schar x,y;
+ if (o->buried) {
+ boolean dealloced;
+ (void) bury_an_obj(otmp, &dealloced);
+ if (dealloced && container_idx) {
+ container_obj[container_idx-1] = NULL;
+ }
+ }
- x = s->x; y = s->y;
- get_free_room_loc(&x, &y, croom);
- mkstairs(x,y,(char)s->up, croom);
}
/*