diff --git a/dat/Val-strt.lua b/dat/Val-strt.lua index d5ce45f07..906500fcf 100644 --- a/dat/Val-strt.lua +++ b/dat/Val-strt.lua @@ -51,7 +51,6 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ]]); -- Dungeon Description des.region(selection.area(00,00,75,19), "lit") -des.region(selection.area(27,08,42,12), "lit") -- Portal arrival point des.levregion({ region = {66,17,66,17}, type="branch" }) -- Stairs diff --git a/src/dogmove.c b/src/dogmove.c index 6669f4c72..5a5f5f68a 100644 --- a/src/dogmove.c +++ b/src/dogmove.c @@ -1034,7 +1034,12 @@ dog_move(register struct monst *mtmp, * 60% to 80%: up to level * 40% to 60%: up to level - 1 * 25% to 40%: up to level - 2 - * below 25%: prevented from attacking at all by a different case + * below 25%: won't attack peacefuls of any level (different case) + * below 20%: up to level - 3 + * + * note that balk's maximum value is +3, as it is the lowest level + * the pet will balk at attacking rather than the highest level they + * are willing to attack; note the >= used when comparing it. */ int balk = mtmp->m_lev + ((5 * mtmp->mhp) / mtmp->mhpmax) - 2; diff --git a/src/dokick.c b/src/dokick.c index 3c2a0c348..d6afaff42 100644 --- a/src/dokick.c +++ b/src/dokick.c @@ -1096,9 +1096,9 @@ dokick(void) kick_dumb(x, y); return ECMD_TIME; } - if ((Luck < 0 || g.maploc->doormask) && !rn2(3)) { + if ((Luck < 0 || g.maploc->looted) && !rn2(3)) { + g.maploc->looted = 0; /* don't leave loose ends.. */ g.maploc->typ = ROOM; - g.maploc->doormask = 0; /* don't leave loose ends.. */ (void) mkgold((long) rnd(200), x, y); if (Blind) pline("CRASH! You destroy it."); diff --git a/src/lock.c b/src/lock.c index d2d934cb2..d41208450 100644 --- a/src/lock.c +++ b/src/lock.c @@ -600,7 +600,7 @@ pick_lock( autounlock ? yname(pick) : ""); c = ynq(qbuf); if (c != 'y') - return 0; + return PICKLOCK_DID_NOTHING; /* note: for !autounlock, 'apply' already did touch check */ if (autounlock && !touch_artifact(pick, &g.youmonst)) diff --git a/src/makemon.c b/src/makemon.c index dd6e3b439..b1bb5d90b 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -1273,7 +1273,7 @@ makemon( case S_SNAKE: if (g.in_mklev) if (x && y) - (void) mkobj_at(0, x, y, TRUE); + (void) mkobj_at(RANDOM_CLASS, x, y, TRUE); (void) hideunder(mtmp); break; case S_LIGHT: diff --git a/src/mklev.c b/src/mklev.c index 4a7e35e51..f3eb47b0f 100644 --- a/src/mklev.c +++ b/src/mklev.c @@ -12,7 +12,7 @@ static boolean generate_stairs_room_good(struct mkroom *, int); static struct mkroom *generate_stairs_find_room(void); static void generate_stairs(void); -static void mkfount(int, struct mkroom *); +static void mkfount(struct mkroom *); static boolean find_okay_roompos(struct mkroom *, coord *); static void mksink(struct mkroom *); static void mkaltar(struct mkroom *); @@ -635,7 +635,7 @@ makeniche(int trap_type) (void) mksobj_at(SCR_TELEPORTATION, xx, yy + dy, TRUE, FALSE); if (!rn2(3)) - (void) mkobj_at(0, xx, yy + dy, TRUE); + (void) mkobj_at(RANDOM_CLASS, xx, yy + dy, TRUE); } } return; @@ -789,7 +789,7 @@ fill_ordinary_room(struct mkroom *croom) if (Is_rogue_level(&u.uz)) goto skip_nonrogue; if (!rn2(10)) - mkfount(0, croom); + mkfount(croom); if (!rn2(60)) mksink(croom); if (!rn2(60)) @@ -833,14 +833,14 @@ fill_ordinary_room(struct mkroom *croom) skip_nonrogue: if (!rn2(3) && somexyspace(croom, &pos)) { - (void) mkobj_at(0, pos.x, pos.y, TRUE); + (void) mkobj_at(RANDOM_CLASS, pos.x, pos.y, TRUE); trycnt = 0; while (!rn2(5)) { if (++trycnt > 100) { impossible("trycnt overflow4"); break; } - (void) mkobj_at(0, pos.x, pos.y, TRUE); + (void) mkobj_at(RANDOM_CLASS, pos.x, pos.y, TRUE); } } } @@ -1752,19 +1752,12 @@ generate_stairs(void) } static void -mkfount(int mazeflag, struct mkroom *croom) +mkfount(struct mkroom *croom) { coord m; - register int tryct = 0; - do { - if (++tryct > 200) - return; - if (mazeflag) - mazexy(&m); - else if (!somexy(croom, &m)) - return; - } while (occupied(m.x, m.y) || bydoor(m.x, m.y)); + if (!find_okay_roompos(croom, &m)) + return; /* Put a fountain at m.x, m.y */ if (!set_levltyp(m.x, m.y, FOUNTAIN)) diff --git a/src/mkmaze.c b/src/mkmaze.c index bec803d3a..ea1ebdae4 100644 --- a/src/mkmaze.c +++ b/src/mkmaze.c @@ -1101,7 +1101,7 @@ makemaz(const char *s) for (x = rn1(8, 11); x; x--) { mazexy(&mm); - (void) mkobj_at(rn2(2) ? GEM_CLASS : 0, mm.x, mm.y, TRUE); + (void) mkobj_at(rn2(2) ? GEM_CLASS : RANDOM_CLASS, mm.x, mm.y, TRUE); } for (x = rn1(10, 2); x; x--) { mazexy(&mm);