Don't advance the main RNG during hallucination

This is based on the multiple-RNGs code fron NetHack4, but using
only the parts relevant to the display RNG (and with substantial
changes, both because of post-3.4.3 changes, and because Nethack4's
display code is based on Slash'EM's rather than NetHack's).
This commit is contained in:
Alex Smith
2019-01-28 04:45:26 +00:00
parent 1083971228
commit ce5184c3da
21 changed files with 150 additions and 93 deletions

View File

@@ -1076,7 +1076,7 @@ struct obj *obj;
if ((u.dx || u.dy) && (bhitpos.x != u.ux || bhitpos.y != u.uy)) {
int x = bhitpos.x - u.dx, y = bhitpos.y - u.dy;
tmp_at(DISP_FLASH, obj_to_glyph(obj));
tmp_at(DISP_FLASH, obj_to_glyph(obj, rn2_on_display_rng));
while (isok(x,y) && (x != u.ux || y != u.uy)) {
tmp_at(x, y);
delay_output();
@@ -1145,7 +1145,7 @@ boolean twoweap; /* used to restore twoweapon mode if wielded weapon returns */
bhitpos.x = mon->mx;
bhitpos.y = mon->my;
if (tethered_weapon)
tmp_at(DISP_TETHER, obj_to_glyph(obj));
tmp_at(DISP_TETHER, obj_to_glyph(obj, rn2_on_display_rng));
} else if (u.dz) {
if (u.dz < 0
/* Mjollnir must we wielded to be thrown--caller verifies this;
@@ -1374,7 +1374,7 @@ boolean twoweap; /* used to restore twoweapon mode if wielded weapon returns */
}
if (!IS_SOFT(levl[bhitpos.x][bhitpos.y].typ) && breaktest(obj)) {
tmp_at(DISP_FLASH, obj_to_glyph(obj));
tmp_at(DISP_FLASH, obj_to_glyph(obj, rn2_on_display_rng));
tmp_at(bhitpos.x, bhitpos.y);
delay_output();
tmp_at(DISP_END, 0);