From 7c0ece5bd623aa58fa3124fe991a7c17119051fe Mon Sep 17 00:00:00 2001 From: PatR Date: Thu, 28 Sep 2023 13:25:20 -0700 Subject: [PATCH] fix #H2736 - missing Samurai quest throne Reported 11 years ago, the level definition for the Samurai quest home level specifies a throne room and entering it gives the "opulent throne room" message, but there isn't any throne. Initially I was going to add a throne but decided that its lack is probably intentional. The throne room designation is used to give periodic atomspheric messages. That's my guess anyway. Alter the room entry message there to omit "throne" from "you enter an opulent throne room". Add a no-throne comment to Sam-strt level definition. While in there, make Lord Sato's katana and splint mail explicitly rustproof and either blessed or uncursed. (The mail was already implicitly rustproof because splint mail created on the Sam quest home level always is, like for a Samurai's initial inventory.) --- dat/Sam-strt.lua | 10 +++++++--- doc/fixes3-7-0.txt | 5 ++++- src/hack.c | 24 ++++++++++++++++++++++-- 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/dat/Sam-strt.lua b/dat/Sam-strt.lua index ebcce3504..e6cac093c 100644 --- a/dat/Sam-strt.lua +++ b/dat/Sam-strt.lua @@ -1,4 +1,4 @@ --- NetHack Samurai Sam-strt.lua $NHDT-Date: 1652196014 2022/05/10 15:20:14 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.3 $ +-- NetHack Samurai Sam-strt.lua $NHDT-Date: 1695932714 2023/09/28 20:25:14 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.4 $ -- Copyright (c) 1989 by Jean-Christophe Collet -- Copyright (c) 1991-92 by M. Stephenson, P. Winner -- NetHack may be freely redistributed. See license for details. @@ -9,6 +9,10 @@ -- Here you meet your (besieged) class leader, Lord Sato -- and receive your quest assignment. -- +-- The throne room designation produces random atmospheric +-- messages (until the room is entered) but this one doesn't +-- actually contain any throne. +-- des.level_init({ style = "solidfill", fg = " " }); des.level_flags("mazelevel", "noteleport", "hardfloor") @@ -55,8 +59,8 @@ des.door("closed",50,04) des.door("closed",50,06) -- Lord Sato des.monster({ id = "Lord Sato", coord = {20, 04}, inventory = function() - des.object({ id = "splint mail", spe = 5 }); - des.object({ id = "katana", spe = 4 }); + des.object({ id = "splint mail", spe = 5, eroded=-1, buc="not-cursed" }); + des.object({ id = "katana", spe = 4, eroded=-1, buc="not-cursed" }); end }) -- The treasure of Lord Sato des.object("chest", 20, 04) diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 59c957b26..40264f42d 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -1,4 +1,4 @@ -$NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1235 $ $NHDT-Date: 1693427872 2023/08/30 20:37:52 $ +$NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1247 $ $NHDT-Date: 1695932713 2023/09/28 20:25:13 $ General Fixes and Modified Features ----------------------------------- @@ -1242,6 +1242,9 @@ applying a wielded, lit potion of oil to unlight it while other unlit "addinv: null obj after quiver merge otyp=N" where N is POT_OIL casting stone-to-flesh at self turned wielded or quivered rocks into unwielded, unquivered meatballs, merging stacks if there were some in each slot +the throne room on the Samurai quest home level lacked a throne but gave + "You enter an opulent throne room!" message the first time it was + entered; vary the message rather than add a throne Fixes to 3.7.0-x General Problems Exposed Via git Repository diff --git a/src/hack.c b/src/hack.c index deaa1be63..09ffa90df 100644 --- a/src/hack.c +++ b/src/hack.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 hack.c $NHDT-Date: 1655116515 2022/06/13 10:35:15 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.360 $ */ +/* NetHack 3.7 hack.c $NHDT-Date: 1695932717 2023/09/28 20:25:17 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.410 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Derek S. Ray, 2015. */ /* NetHack may be freely redistributed. See license for details. */ @@ -34,6 +34,7 @@ static boolean escape_from_sticky_mon(coordxy, coordxy); static void domove_core(void); static void maybe_smudge_engr(coordxy, coordxy, coordxy, coordxy); static struct monst *monstinroom(struct permonst *, int); +static boolean furniture_present(int, int); static void move_update(boolean); static int pickup_checks(void); static boolean doorless_door(coordxy, coordxy); @@ -3039,6 +3040,23 @@ monstinroom(struct permonst *mdat, int roomno) return (struct monst *) 0; } +/* check whether room contains a particular type of furniture */ +static boolean +furniture_present(int furniture, int roomno) +{ + int x, y, lx, ly, hx, hy; + struct mkroom *sroom = &gr.rooms[roomno]; + + ly = sroom->ly, hy = sroom->hy; + lx = sroom->lx; hx = sroom->hx; + /* the inside_room() check handles irregularly shaped rooms */ + for (y = ly; y <= hy; ++y) + for (x = lx; x <= hx; ++x) + if (levl[x][y].typ == furniture && inside_room(sroom, x, y)) + return TRUE; + return FALSE; +} + char * in_rooms(register coordxy x, register coordxy y, register int typewanted) { @@ -3220,7 +3238,9 @@ check_special_room(boolean newlev) Blind ? "humid" : "muddy"); break; case COURT: - You("enter an opulent throne room!"); + You("enter an opulent%s room!", + /* the throne room in Sam quest home level lacks a throne */ + !furniture_present(THRONE, roomno) ? "" : " throne"); break; case LEPREHALL: You("enter a leprechaun hall!");