Dehardcode number of glass gems
This commit is contained in:
@@ -572,7 +572,8 @@ make_corpse(struct monst *mtmp, unsigned int corpseflags)
|
||||
case PM_GLASS_GOLEM:
|
||||
num = d(2, 4); /* very low chance of creating all glass gems */
|
||||
while (num--)
|
||||
obj = mksobj_at((LAST_GEM + rnd(9)), x, y, TRUE, FALSE);
|
||||
obj = mksobj_at((LAST_GEM + rnd(NUM_GLASS_GEMS)),
|
||||
x, y, TRUE, FALSE);
|
||||
free_mgivenname(mtmp);
|
||||
break;
|
||||
case PM_CLAY_GOLEM:
|
||||
|
||||
@@ -556,7 +556,7 @@ m_throw(
|
||||
nomul(0);
|
||||
|
||||
if (singleobj->oclass == GEM_CLASS
|
||||
&& singleobj->otyp <= LAST_GEM + 9 /* 9 glass colors */
|
||||
&& singleobj->otyp <= LAST_GEM + NUM_GLASS_GEMS
|
||||
&& is_unicorn(g.youmonst.data)) {
|
||||
if (singleobj->otyp > LAST_GEM) {
|
||||
You("catch the %s.", xname(singleobj));
|
||||
|
||||
@@ -3956,7 +3956,7 @@ readobjnam_postparse2(struct _readobjnam_data *d)
|
||||
s += 9;
|
||||
if (!strcmpi(s, "glass")) { /* choose random color */
|
||||
/* 9 different kinds */
|
||||
d->typ = LAST_GEM + rnd(9);
|
||||
d->typ = LAST_GEM + rnd(NUM_GLASS_GEMS);
|
||||
if (objects[d->typ].oc_class == GEM_CLASS)
|
||||
return 2; /*goto typfnd;*/
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user