Add a new themed room: "Twin business"
This themed room boasts two shops, a weapons and an armor store, that can generate in a number of different configurations. Makes the random corridor joining routine obey unjoined areas. Fixes a bug in shopkeeper naming routine, where multiple shops of the same type on the same level might reuse the shopkeeper name. This is modified and consolidated commit from xNetHack by copperwater <aosdict@gmail.com>.
This commit is contained in:
@@ -495,7 +495,7 @@ const char *const *nlp;
|
||||
int i, trycnt, names_avail;
|
||||
const char *shname = 0;
|
||||
struct monst *mtmp;
|
||||
int name_wanted;
|
||||
int name_wanted = shk->m_id;
|
||||
s_level *sptr;
|
||||
|
||||
if (nlp == shklight && In_mines(&u.uz)
|
||||
@@ -510,7 +510,7 @@ const char *const *nlp;
|
||||
use ledger_no rather than depth to keep minetown distinct. */
|
||||
int nseed = (int) ((long) ubirthday / 257L);
|
||||
|
||||
name_wanted = ledger_no(&u.uz) + (nseed % 13) - (nseed % 5);
|
||||
name_wanted += ledger_no(&u.uz) + (nseed % 13) - (nseed % 5);
|
||||
if (name_wanted < 0)
|
||||
name_wanted += (13 + 5);
|
||||
shk->female = name_wanted & 1;
|
||||
@@ -518,6 +518,8 @@ const char *const *nlp;
|
||||
for (names_avail = 0; nlp[names_avail]; names_avail++)
|
||||
continue;
|
||||
|
||||
name_wanted = name_wanted % names_avail;
|
||||
|
||||
for (trycnt = 0; trycnt < 50; trycnt++) {
|
||||
if (nlp == shktools) {
|
||||
shname = shktools[rn2(names_avail)];
|
||||
@@ -545,6 +547,7 @@ const char *const *nlp;
|
||||
continue;
|
||||
if (strcmp(ESHK(mtmp)->shknam, shname))
|
||||
continue;
|
||||
name_wanted = names_avail; /* try a random name */
|
||||
break;
|
||||
}
|
||||
if (!mtmp)
|
||||
|
||||
Reference in New Issue
Block a user