diff --git a/data/vaults/poolroom.vlt b/data/vaults/poolroom.vlt index 03bf305..c0534e4 100644 --- a/data/vaults/poolroom.vlt +++ b/data/vaults/poolroom.vlt @@ -13,7 +13,12 @@ autodoors:50 autopop fill(2,2,-3,-3) cell:low rock floor:100 fill(2,2,-3,-3) ob:waist-deep water:100 -scatter(2,2,-3,-3) mon:piranha:50%:100 +scatter(2,2,-3,-3) mon:piranha:40%:100 +! chance of some good stuff items... +scatter(2,2,-3,-3) ob:rare random thing:1:30 +scatter(2,2,-3,-3) ob:rare random thing:1:20 +scatter(2,2,-3,-3) ob:vrare random thing:1:10 +rarity:vrare rarity:uncommon @end diff --git a/objects.c b/objects.c index cf9b115..5f9795e 100644 --- a/objects.c +++ b/objects.c @@ -887,6 +887,10 @@ object_t *addobject(obpile_t *where, char *name, int canstack, int dolinks, enum wantrarity = RR_VERYRARE; p += strlen("very rare "); donesomething = B_TRUE; + } else if (strstarts(p, "vrare ")) { + wantrarity = RR_VERYRARE; + p += strlen("vrare "); + donesomething = B_TRUE; // force weapon/armour to be ones the holder is skilled in? } else if (strstarts(p, "appropriate ")) { if (where->owner) { @@ -1256,6 +1260,18 @@ object_t *addobject(obpile_t *where, char *name, int canstack, int dolinks, enum found = B_TRUE; } } + if (strstarts(p, "random thing")) { + char buf[BUFLEN]; + cell_t *cc; + condset_t cs; + + initcond(&cs); + cc = getobpilelocation(where); + ot = real_getrandomob(cc, buf, NA, NA, wantrarity, B_TRUE, &cs); + if (ot) { + found = B_TRUE; + } + } } if (!found) { @@ -7158,7 +7174,9 @@ objecttype_t *real_getrandomob(cell_t *cell, char *buf, int forcedepth, int forc } } if (wantcl == OC_NONE) { - addcond(cs, CC_OBCLASS, B_TRUE, getrandomobclass(hab->id)); + if (hab) { + addcond(cs, CC_OBCLASS, B_TRUE, getrandomobclass(hab->id)); + } } /*