1
0
Fork 0
mirror of https://codeberg.org/noisytoot/notnotdnethack.git synced 2025-04-03 07:00:46 +01:00

Make Priest quest fill slightly more interesting!

You can now specify a chance on ordinary rooms. If an ordinary room's chance fails, then the room isn't created at all.
This commit is contained in:
NeroOneTrueKing 2022-10-17 01:29:45 -05:00
parent aecc9d49c4
commit 8294f37fdc
3 changed files with 129 additions and 16 deletions

View file

@ -276,10 +276,61 @@ MONSTER:'W',random,random
LEVEL: "Pri-fila"
#
ROOM: "ordinary" , random, random, random, random
STAIR: random, up
ROOM: "ordinary" , unlit, random, random, (5, 5)
NAME: "entrance"
STAIR: (2, 2), up
OBJECT: random,random,random
MONSTER: 'Z', random, random
SUBROOM: "ordinary", unlit, (2, 2), (1, 1), "entrance"
DOOR: false , nodoor , north, random
DOOR: false , nodoor , south, random
DOOR: false , nodoor , east, random
DOOR: false , nodoor , west, random
# long room with zombies
ROOM: "ordinary", unlit, random, random, (11, 5)
CHANCE:20
NAME: "hall"
SUBROOM: "ordinary", unlit, (2, 1), (1, 1), "hall"
DOOR: false, nodoor, south, random
MONSTER: 'Z', random, random
OBJECT[20%]: random,random,random
SUBROOM: "ordinary", unlit, (4, 1), (1, 1), "hall"
DOOR: false, nodoor, south, random
MONSTER: 'Z', random, random
OBJECT[20%]: random,random,random
SUBROOM: "ordinary", unlit, (6, 1), (1, 1), "hall"
DOOR: false, nodoor, south, random
MONSTER: 'Z', random, random
OBJECT[20%]: random,random,random
SUBROOM: "ordinary", unlit, (8, 1), (1, 1), "hall"
DOOR: false, nodoor, south, random
MONSTER: 'Z', random, random
OBJECT[20%]: random,random,random
SUBROOM: "ordinary", unlit, (2, 4), (1, 1), "hall"
DOOR: false, nodoor, north, random
MONSTER: 'Z', random, random
OBJECT[20%]: random,random,random
SUBROOM: "ordinary", unlit, (4, 4), (1, 1), "hall"
DOOR: false, nodoor, north, random
MONSTER: 'Z', random, random
OBJECT[20%]: random,random,random
SUBROOM: "ordinary", unlit, (6, 4), (1, 1), "hall"
DOOR: false, nodoor, north, random
MONSTER: 'Z', random, random
OBJECT[20%]: random,random,random
SUBROOM: "ordinary", unlit, (8, 4), (1, 1), "hall"
DOOR: false, nodoor, north, random
MONSTER: 'Z', random, random
OBJECT[20%]: random,random,random
# Angel shrine
ROOM: "ordinary", unlit, random, random, (3, 3)
CHANCE:8
TRAP[33%]:"statue",(1,1)
OBJECT:'#',"lit candle",(1, 1)
CONTAINER:'#',"statue of an angel",(1, 1)
OBJECT:'#',"blessed +3 silver long sword",contained
ROOM: "ordinary" , random, random, random, random
OBJECT: random, random, random
@ -310,11 +361,39 @@ RANDOM_CORRIDORS
LEVEL: "Pri-filb"
#
ROOM: "ordinary" , random, random, random, random
STAIR: random, up
ROOM: "ordinary" , unlit, random, random, (5, 5)
NAME: "entrance"
STAIR: (2, 2), up
OBJECT: random,random,random
MONSTER: 'Z', random, random
MONSTER: 'W', "wraith", random
SUBROOM: "ordinary", unlit, (2, 2), (1, 1), "entrance"
DOOR: false , nodoor , north, random
DOOR: false , nodoor , south, random
DOOR: false , nodoor , east, random
DOOR: false , nodoor , west, random
# large, partly-enclosed morgues
ROOM: "ordinary", unlit, random, (right, center), (11, 11)
NAME: "enclosed_morgue_right"
CHANCE: 5
SUBROOM: "morgue", unlit, (2, 2), (9, 7), "enclosed_morgue_right"
OBJECT: random,random,random
OBJECT: random,random,random
DOOR: false, closed, west, random
DOOR: false, closed, north, random
DOOR: false, closed, south, random
DOOR: true, closed, west, random
ROOM: "ordinary", unlit, random, (left, center), (11, 11)
NAME: "enclosed_morgue_left"
CHANCE: 5
SUBROOM: "morgue", unlit, (0, 2), (9, 7), "enclosed_morgue_left"
OBJECT: random,random,random
OBJECT: random,random,random
DOOR: false, closed, east, random
DOOR: false, closed, north, random
DOOR: false, closed, south, random
DOOR: true, closed, east, random
ROOM: "morgue" , random, random, random, random
OBJECT: random, random, random
@ -345,4 +424,39 @@ ROOM: "morgue" , random, random, random, random
OBJECT: random, random, random
TRAP: random, random
# study with an attendant lich
ROOM: "ordinary", unlit, random, random, (7, 5)
NAME: "studyA1"
CHANCE: 4
SUBROOM: "ordinary", unlit, (2, 2), (1, 1), "studyA1"
CONTAINER:'(',"writing desk",(0, 0)
OBJECT:'+',random,contained
MONSTER: 'L', random, (0, 0), asleep
DOOR: false, closed, west, random
SUBROOM: "ordinary", unlit, (4, 2), (1, 1), "studyA1"
CONTAINER:'(',"writing desk",(0, 0)
DOOR: false, closed, east, random
ROOM: "ordinary", unlit, random, random, (7, 5)
NAME: "studyA2"
CHANCE: 4
SUBROOM: "ordinary", unlit, (2, 2), (1, 1), "studyA2"
CONTAINER:'(',"writing desk",(0, 0)
DOOR: false, closed, west, random
SUBROOM: "ordinary", unlit, (4, 2), (1, 1), "studyA2"
CONTAINER:'(',"writing desk",(0, 0)
OBJECT:'+',random,contained
MONSTER: 'L', random, (0, 0), asleep
DOOR: false, closed, east, random
# a store of relics! Or it used to be, hopefully there's still at least one left for you...
ROOM: "ordinary", unlit, (3,3), random, (1, 1)
CHANCE: 2
CONTAINER: '#', "iron chest", random
OBJECT[20%]: '#', "blessed +3 mithril magic-resistant plate mail", contained
OBJECT[20%]: '+', "remove curse", contained
OBJECT[20%]: '#', "holy-weapon +3 silver mace", contained
OBJECT[20%]: '#', "holy-weapon +3 crossbow", contained
OBJECT[20%]: '#', "blessed +3 prayer-warded robe", contained
RANDOM_CORRIDORS

View file

@ -1807,15 +1807,10 @@ default_case:
struct trap * ttmp = t_at(x, y);
struct obj * statue;
if (ttmp && ttmp->ttyp == STATUE_TRAP) {
for (statue = level.objects[x][y]; statue; statue = statue->nobj)
if (statue->o_id == ttmp->statueid)
delobj(statue);
ttmp->statueid = otmp->o_id;
//for (statue = level.objects[x][y]; statue; statue = statue->nobj)
//{
// if (statue->o_id == ttmp->statueid)
// {
// //obfree(statue, (struct obj *)0);
//
// }
//}
}
}
@ -2514,8 +2509,14 @@ room *r, *pr;
boolean okroom;
struct mkroom *aroom;
short i;
xchar rtype = (!r->chance || rn2(100) < r->chance) ? r->rtype : OROOM;
xchar rtype = r->rtype;
/* if rtype != OROOM, chance is chance to be the special type. Otherwise, chance is chance of being generated */
if (r->chance && r->chance <= rn2(100)) {
if (r->rtype != OROOM)
rtype = OROOM;
else
return;
}
if(pr) {
aroom = &subrooms[nsubroom];
okroom = create_subroom(pr->mkr, r->x, r->y, r->w, r->h,

View file

@ -579,8 +579,6 @@ room_chance : CHANCE_ID ':' INTEGER
{
if (tmproom[nrooms]->chance)
yyerror("This room already assigned a chance!");
else if (tmproom[nrooms]->rtype == OROOM)
yyerror("Only typed rooms can have a chance!");
else if ($3 < 1 || $3 > 99)
yyerror("The chance is supposed to be percentile.");
else