diff --git a/data.c b/data.c index 3e13066..290c49c 100644 --- a/data.c +++ b/data.c @@ -5695,6 +5695,7 @@ void initobjects(void) { addflag(lastot->flags, F_DTCONVERT, DT_FIRE, NA, NA, "puff of steam"); addflag(lastot->flags, F_DRINKABLE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NUMCONVERT, 5, OT_PUDDLEWATERL, NA, NULL); addflag(lastot->flags, F_OBHP, 10, 10, NA, NULL); addflag(lastot->flags, F_OBHPDRAIN, 1, NA, NA, NULL); addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); @@ -5769,7 +5770,7 @@ void initobjects(void) { addflag(lastot->flags, F_OBHP, 15, 15, NA, NULL); addflag(lastot->flags, F_OBHPDRAIN, 1, NA, NA, NULL); addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); - addflag(lastot->flags, F_LINKOB, OT_POT_BLOOD, NA, NA, NULL); + addflag(lastot->flags, F_NUMCONVERT, 5, OT_BLOODPOOL, NA, NULL); addflag(lastot->flags, F_COSMETIC, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_NOFEEL, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_PURIFIESTO, OT_SPLASHWATER, NA, NA, NULL); @@ -5781,11 +5782,11 @@ void initobjects(void) { addflag(lastot->flags, F_RARITY, H_DUNGEON, 65, NA, NULL); addflag(lastot->flags, F_RARITY, H_CAVE, 65, NA, NULL); addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); - addflag(lastot->flags, F_SLIPPERY, 3, NA, NA, NULL); + addflag(lastot->flags, F_SLIPPERY, 5, NA, NA, NULL); addflag(lastot->flags, F_DIECONVERT, NA, NA, NA, "blood stain"); addflag(lastot->flags, F_DIECONVERTTEXT, NA, NA, NA, "dries up"); addflag(lastot->flags, F_DIECONVERTTEXTPL, NA, NA, NA, "dry up"); - addflag(lastot->flags, F_OBHP, 30, 30, NA, NULL); + addflag(lastot->flags, F_OBHP, 50, 50, NA, NULL); addflag(lastot->flags, F_OBHPDRAIN, 1, NA, NA, NULL); addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_DRINKABLE, B_TRUE, 0, NA, NULL); @@ -12382,6 +12383,9 @@ void initrace(void) { addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_HITDICE, 5, NA, NA, NULL); + addflag(lastrace->flags, F_FILLPOT, OT_POT_HEALINGMIN, NA, NA, NULL); + addflag(lastrace->flags, F_FILLPOT, OT_POT_HEALING, NA, NA, NULL); + addflag(lastrace->flags, F_FILLPOT, OT_POT_HEALINGMAJ, NA, NA, NULL); addflag(lastrace->flags, F_TR, 5, NA, NA, NULL); addflag(lastrace->flags, F_EVASION, 10, NA, NA, NULL); addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); @@ -12448,6 +12452,9 @@ void initrace(void) { addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_LARGE, NA, NA, NULL); + addflag(lastrace->flags, F_FILLPOT, OT_POT_HEALINGMIN, NA, NA, NULL); + addflag(lastrace->flags, F_FILLPOT, OT_POT_HEALING, NA, NA, NULL); + addflag(lastrace->flags, F_FILLPOT, OT_POT_HEALINGMAJ, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_COMMON, NULL); @@ -12488,6 +12495,9 @@ void initrace(void) { addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_LARGE, NA, NA, NULL); + addflag(lastrace->flags, F_FILLPOT, OT_POT_HEALINGMIN, NA, NA, NULL); + addflag(lastrace->flags, F_FILLPOT, OT_POT_HEALING, NA, NA, NULL); + addflag(lastrace->flags, F_FILLPOT, OT_POT_HEALINGMAJ, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_HITDICE, 5, NA, NA, NULL); diff --git a/data/hiscores.db b/data/hiscores.db index 3328979..944d73f 100644 Binary files a/data/hiscores.db and b/data/hiscores.db differ diff --git a/data/vaults/godshrine1.vlt b/data/vaults/godshrine1.vlt index 2e50a79..86f6bfd 100644 --- a/data/vaults/godshrine1.vlt +++ b/data/vaults/godshrine1.vlt @@ -22,7 +22,7 @@ m:ob:landmine trap @flags entertext:You enter an ornate shrine. -shrine +tag:shrine norandom mayrotate goesin:dungeon diff --git a/defs.h b/defs.h index 5acaa56..17b85fc 100644 --- a/defs.h +++ b/defs.h @@ -2420,6 +2420,8 @@ enum FLAG { F_SHRINKSTO, // used for spells. v0=new oid or celltype. // v1 = VT_OB or VT_CELL F_NOSHATTER, // object will not shatter, even if it's material should. + F_NUMCONVERT, // if o->amt is >= v0, object type changes into either + // f->text (if given), or obtype v1. F_STACKABLE, // can stack multiple objects togethr F_THE, // say "the xxx", not "a xxx" F_NO_PLURAL, // this obname doesn't need an 's' for plurals (eg. gold, money) diff --git a/doc/vaults.txt b/doc/vaults.txt index ee54d90..d179581 100644 --- a/doc/vaults.txt +++ b/doc/vaults.txt @@ -90,9 +90,6 @@ Flags can be: // appear when specifically requested via a region's // outline. - shrine // } - stomach // } this vault is a shrine/etc - tag:xxxx // add tag "xxx" to vault(for use with rndvaultwithtag) NOTES: diff --git a/flag.c b/flag.c index ba28f90..241079b 100644 --- a/flag.c +++ b/flag.c @@ -8,6 +8,7 @@ #include "io.h" #include "lf.h" #include "map.h" +#include "nexus.h" #include "objects.h" #include "spell.h" #include "text.h" @@ -1439,6 +1440,16 @@ int getflags(flagpile_t *fp, flag_t **retflag, int *nretflags, ... ) { return *nretflags; } +flag_t *getrandomflag(flagpile_t *fp, enum FLAG fid) { + flag_t *retflag[MAXCANDIDATES]; + int nretflags = 0; + getflags(fp, retflag, &nretflags, fid, F_NONE); + if (nretflags) { + return retflag[rnd(0,nretflags-1)]; + } + return NULL; +} + int modcounter(flagpile_t *fp, int amt) { flag_t *f; f = hasflag(fp, F_COUNTER); diff --git a/flag.h b/flag.h index d8e9b8b..e96d18e 100644 --- a/flag.h +++ b/flag.h @@ -26,6 +26,7 @@ int flagstacks(enum FLAG fid); int flagtomaxhp(flag_t *f); cell_t *getflagpilelocation(flagpile_t *fp); int getflags(flagpile_t *fp, flag_t **retflag, int *nretflags, ... ); +flag_t *getrandomflag(flagpile_t *fp, enum FLAG fid); flag_t *hasflag(flagpile_t *fp, int id); flag_t *hasflagknown(flagpile_t *fp, int id); flag_t *hasflag_real(flagpile_t *fp, int id, int wantknown, flag_t *exception, int lifetimeexception); diff --git a/lf.c b/lf.c index 3762a4c..05a04a7 100644 --- a/lf.c +++ b/lf.c @@ -199,7 +199,7 @@ void awardxpfor(lifeform_t *killed, float pct) { } void bleed(lifeform_t *lf, int splatter) { - flag_t *f,*bloodfillflag; + flag_t *f; char obname[BUFLEN]; flag_t *retflag[MAXCANDIDATES]; int nretflags; @@ -222,22 +222,19 @@ void bleed(lifeform_t *lf, int splatter) { strcpy(obname, "splash of blood"); } - bloodfillflag = hasflag(lf->flags, F_FILLPOT); - if (strlen(obname) > 0) { + int nfillpot = 0; object_t *o; o = addob(lf->cell->obpile, obname); - if (bloodfillflag) { - addflag(o->flags, F_FILLPOT, bloodfillflag->val[0], NA, NA, NULL); - } + nfillpot = copyflag(o->flags, lf->flags, F_FILLPOT); if (splatter) { addobsinradius(lf->cell, 1, DT_COMPASS, obname, B_TRUE, NULL); - if (bloodfillflag) { + if (nfillpot) { int i; for (i = 0; i < nretobs; i++) { - addflag(retobs[i]->flags, F_FILLPOT, bloodfillflag->val[0], NA, NA, NULL); + copyflag(retobs[i]->flags, lf->flags, F_FILLPOT); } } } diff --git a/map.c b/map.c index 77921e3..8b52140 100644 --- a/map.c +++ b/map.c @@ -7180,7 +7180,7 @@ void initmaplayout(void) { // l11 - 14: swamp addregionthing(lastregionoutline, rnd(11,14), NA, NA, RT_HABITAT, H_SWAMP, NULL); // l25: last level - addregionthing(lastregionoutline, 25, NA, NA, RT_RNDVAULTWITHFLAG, F_VAULTISSHRINE, NULL); // godstone on last floor + addregionthing(lastregionoutline, 25, NA, NA, RT_RNDVAULTWITHTAG, NA, "shrine"); // godstone on last floor // 1-3 fixed sewers addregionthing(lastregionoutline, rnd(1,25), NA, NA, RT_REGIONLINK, RG_SEWER, "drainage grate"); diff --git a/nexus.c b/nexus.c index ee6d2c5..a0f2890 100644 --- a/nexus.c +++ b/nexus.c @@ -1027,9 +1027,10 @@ void gettrrange(int depth, int *min, int *max, int range, int oodok) { } } - mid = (depth/2); + //mid = (depth/2); + mid = (depth); - *min = mid - range; limit(min, 0, maxmonhitdice); + *min = mid - range - 10; limit(min, 0, maxmonhitdice); *max = mid + range; limit(max, *min, maxmonhitdice); } diff --git a/objects.c b/objects.c index 9a6f08a..9b2cf5c 100644 --- a/objects.c +++ b/objects.c @@ -9700,7 +9700,8 @@ int operate(lifeform_t *lf, object_t *o, cell_t *where) { if (ch == 'y') { char newobname[BUFLEN]; flag_t *bfob; - bfob = hasflag(oo->flags, F_FILLPOT); + // get a random fillpot flag. + bfob = getrandomflag(oo->flags, F_FILLPOT); if (bfob) { objecttype_t *ot; ot = findot(bfob->val[0]); @@ -13488,6 +13489,42 @@ void timeeffectsob(object_t *o) { } } + // objects combine? + f = hasflag(o->flags, F_NUMCONVERT); + if (f && (o->amt >= f->val[0])) { + int newamt,i; + enum OBTYPE newoid = OT_NONE; + obpile_t *op; + char *newobname = NULL; + flagpile_t *fp; + newamt = o->amt / f->val[0]; + op = o->pile; + fp = addflagpile(NULL, NULL); + + if (strlen(f->text)) { + newobname = strdup(f->text); + } else { + newoid = f->val[1]; + } + // some flags will be inherited by the new object + copyflag(fp, o->flags, F_FILLPOT); + removeob(o, o->amt); + for (i = 0; i < newamt; i++) { + object_t *newob; + if (newobname) { + newob = addob(op, newobname); + } else { + newob = addobfast(op, newoid); + } + if (newob) { + copyflags(newob->flags, fp, NA); + } + } + if (newobname) free(newobname); + killflagpile(fp); + return; + } + // expire flags timeeffectsflags(o->flags); checkflagpile(o->flags); diff --git a/vault.c b/vault.c index 2a2754e..41ce04b 100644 --- a/vault.c +++ b/vault.c @@ -1457,9 +1457,6 @@ int handleline(vault_t *v, char *line) { p = line + 4; addflag(v->flags, F_VAULTTAG, B_TRUE, NA, NA, p); ok = B_TRUE; - } else if (streq(line, "shrine")) { // a godstone shrine - addflag(v->flags, F_VAULTISSHRINE, B_TRUE, NA, NA, NULL); - ok = B_TRUE; } } }