diff --git a/data.c b/data.c index 1d0ec6e..3ebf127 100644 --- a/data.c +++ b/data.c @@ -228,7 +228,6 @@ void initjobs(void) { addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "10 blocks of chocolate"); addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "10 vials of ambrosia"); addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "10 blessed scrolls of identify"); - addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "potion of water"); addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "salt"); addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "leather armour"); addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "leather boots"); @@ -2279,7 +2278,8 @@ void initobjects(void) { addflag(lastot->flags, F_DTVULN, DT_CHOP, NA, NA, NULL); addot(OT_TREE, "tree", "A tree.", MT_WOOD, 200, OC_FLORA, SZ_LARGE); addflag(lastot->flags, F_RARITY, H_FOREST, 100, NA, ""); - addflag(lastot->flags, F_GLYPH, C_GREEN, '#', NA, NULL); + //addflag(lastot->flags, F_GLYPH, C_GREEN, '#', NA, NULL); + addflag(lastot->flags, F_GLYPH, C_GREEN, UNI_TREE, NA, NULL); addflag(lastot->flags, F_IMPASSABLE, SZ_MIN, SZ_LARGE, NA, NULL); addflag(lastot->flags, F_BLOCKSVIEW, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_BLOCKSLOF, B_TRUE, NA, NA, NULL); @@ -3102,7 +3102,7 @@ void initobjects(void) { addflag(lastot->flags, F_TARGETTEDSPELL, TT_MONSTER, NA, NA, NULL); addflag(lastot->flags, F_LOSLOF, B_FALSE, LOF_NEED, NA, NULL); addflag(lastot->flags, F_AICASTTOATTACK, ST_ADJVICTIM, NA, NA, NULL); - addot(OT_S_REFRACTION, "refraction", "Instantly shatters all glass in the target location.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addot(OT_S_REFRACTION, "refraction", "Bends light around the caster, making them harder to hit.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); addflag(lastot->flags, F_SPELLSCHOOL, SS_AIR, NA, NA, NULL); addflag(lastot->flags, F_SPELLLEVEL, 2, NA, NA, NULL); addflag(lastot->flags, F_MAXPOWER, 4, NA, NA, NULL); @@ -13215,7 +13215,7 @@ void initrace(void) { addflag(lastrace->flags, F_WANTSOBFLAG, F_EDIBLE, B_COVETS, NA, NULL); addflag(lastrace->flags, F_SEEINDARK, 4, NA, NA, NULL); addflag(lastrace->flags, F_DTVULN, DT_POISONGAS, NA, NA, NULL); - addflag(lastrace->flags, F_MORALE, 7, NA, NA, NULL); + addflag(lastrace->flags, F_MORALE, 4, NA, NA, NULL); addrace(R_RATPLAGUE, "plague rat", 3, 'r', C_GREEN, MT_FLESH, RC_ANIMAL, "Plague rats are named both for their infectious bite as well as the great speed at which they run."); setbodytype(lastrace, BT_QUADRAPED); @@ -13354,6 +13354,7 @@ void initrace(void) { setbodytype(lastrace, BT_SNAKE); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_COLDBLOOD, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOSTAIRS, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_NOSMELL, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_LOW, NA, NULL); @@ -13387,6 +13388,7 @@ void initrace(void) { addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_NOSMELL, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_COLDBLOOD, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOSTAIRS, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_LOW, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); @@ -13414,6 +13416,7 @@ void initrace(void) { setbodytype(lastrace, BT_SNAKE); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_COLDBLOOD, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOSTAIRS, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_NOSMELL, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_LOW, NA, NULL); @@ -13444,6 +13447,7 @@ void initrace(void) { setbodytype(lastrace, BT_SNAKE); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_COLDBLOOD, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOSTAIRS, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_NOSMELL, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_LOW, NA, NULL); @@ -13476,6 +13480,7 @@ void initrace(void) { setbodytype(lastrace, BT_SNAKE); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_RARE, NULL); addflag(lastrace->flags, F_COLDBLOOD, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOSTAIRS, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_NOSMELL, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_LOW, NA, NULL); @@ -13509,6 +13514,7 @@ void initrace(void) { setbodytype(lastrace, BT_SNAKE); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_COLDBLOOD, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOSTAIRS, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_NOSMELL, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_HIGH, NA, NULL); @@ -13540,6 +13546,7 @@ void initrace(void) { addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_FREQUENT, NULL); addflag(lastrace->flags, F_RARITY, H_SEWER, NA, RR_COMMON, NULL); + addflag(lastrace->flags, F_NOSTAIRS, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_AQUATIC, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_NOSMELL, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_NEEDSWATER, B_TRUE, NA, NA, NULL); diff --git a/data/hiscores.db b/data/hiscores.db index 5478c6b..1c144fc 100644 Binary files a/data/hiscores.db and b/data/hiscores.db differ diff --git a/defs.h b/defs.h index cb272ed..06de22e 100644 --- a/defs.h +++ b/defs.h @@ -60,6 +60,9 @@ #define UNI_SHADEDARK 0x2593 #define UNI_SPIRAL 0x2202 //#define UNI_SOLID '#' +#define UNI_TUNNEL 0x2126 +#define UNI_TREELOTS 0x2051 +#define UNI_TREE 0x2042 // getrandomemptycell() params #define WE_NONE 0 diff --git a/lf.c b/lf.c index 535dd50..08a88c3 100644 --- a/lf.c +++ b/lf.c @@ -3057,13 +3057,15 @@ void die(lifeform_t *lf) { // drop corpse/splatter blood if (corpsecell) { if (vaporised) { - switch (rnd(1,2)) { - case 1: - fragments(corpsecell, "chunk of flesh", 0, UNLIMITED); - break; - case 2: - fragments(corpsecell, "pool of blood", 0, UNLIMITED); - break; + if (lf->material->id == MT_FLESH) { + switch (rnd(1,2)) { + case 1: + fragments(corpsecell, "chunk of flesh", 0, UNLIMITED); + break; + case 2: + fragments(corpsecell, "pool of blood", 0, UNLIMITED); + break; + } } } else if ((lf->lastdamtype == DT_BASH) && lfhasflag(lf, F_FROZEN)) { // shattered @@ -7375,10 +7377,12 @@ int getlfaccuracy(lifeform_t *lf, object_t *wep) { } // adjust for bulky armour/shield, or injuries - getflags(lf->flags, retflag, &nretflags, F_ARMOURPENALTY, F_INJURY, F_SHIELDPENALTY, F_NONE); + getflags(lf->flags, retflag, &nretflags, F_ACCURACYMOD, F_ARMOURPENALTY, F_INJURY, F_SHIELDPENALTY, F_NONE); for (i = 0; i < nretflags; i++) { f = retflag[i]; - if (f->id == F_SHIELDPENALTY) { + if (f->id == F_ACCURACYMOD) { + acc += f->val[0]; + } else if (f->id == F_SHIELDPENALTY) { acc -= adjustshieldpenalty(lf, f->val[0]); } else if (f->id == F_ARMOURPENALTY) { acc -= adjustarmourpenalty(lf, f->val[0]); @@ -9933,7 +9937,9 @@ void givejob(lifeform_t *lf, enum JOB jobid) { } } - generatealignment(lf); + if (isplayer(lf)) { + generatealignment(lf); + } if (hasflag(j->flags, F_STAYINROOM)) sethomeroom(lf); } diff --git a/map.c b/map.c index 944a061..89669c1 100644 --- a/map.c +++ b/map.c @@ -6521,7 +6521,8 @@ void initmap(void) { addcelltype(CT_WALLWOOD, "wooden wall", UNI_SOLID, C_BROWN, B_SOLID, B_OPAQUE, MT_WOOD, 0, 30); addcelltype(CT_WALLFLESH, "flesh wall", UNI_SOLID, C_RED, B_SOLID, B_OPAQUE, MT_FLESH, 0, 25); addcelltype(CT_WALLGLASS, "glass wall", UNI_SOLID, C_CYAN, B_SOLID, B_TRANS, MT_GLASS, 0, 20); - addcelltype(CT_WALLTREE, "dense bushland", UNI_SHADEDARK, C_GREEN, B_SOLID, B_OPAQUE, MT_PLANT, 0, 100); + //addcelltype(CT_WALLTREE, "dense bushland", UNI_SHADEDARK, C_GREEN, B_SOLID, B_OPAQUE, MT_PLANT, 0, 100); + addcelltype(CT_WALLTREE, "dense bushland", UNI_TREELOTS, C_GREEN, B_SOLID, B_OPAQUE, MT_PLANT, 0, 100); addcelltype(CT_WALLMETAL, "metal wall", UNI_SOLID, C_WHITE, B_SOLID, B_OPAQUE, MT_METAL, 0, 75); // cell types - non-solid addcelltype(CT_FAKE, "fake cell", '.', C_GREEN, B_EMPTY, B_TRANS, MT_STONE, 0, -1); diff --git a/move.c b/move.c index b36ca58..81c776d 100644 --- a/move.c +++ b/move.c @@ -2807,7 +2807,7 @@ int trymove(lifeform_t *lf, int dir, int onpurpose, int strafe) { // check for fleeing... if (isplayer(lf) && !isdead(lf)) { if (prebattle && !isinbattle(lf, B_FALSE) && onpurpose) { - angergodmaybe(R_GODBATTLE, 15, GA_COWARD); + angergodmaybe(R_GODBATTLE, 5, GA_COWARD); } } return B_FALSE; diff --git a/objects.c b/objects.c index 1ab2e0d..dcc1857 100644 --- a/objects.c +++ b/objects.c @@ -496,6 +496,7 @@ object_t *addobject(obpile_t *where, char *name, int canstack, int dolinks, enum int wantrarity = RR_NONE; int wantgoodness = G_NA; int wantfoodtaint = B_FALSE; + enum OBTYPE wantfountaintype = OT_NONE; enum LFSIZE wantarmsize = SZ_ANY; enum MATERIAL wantdiffmat = MT_NOTHING; map_t *targetmap = NULL; // for portals @@ -878,6 +879,18 @@ object_t *addobject(obpile_t *where, char *name, int canstack, int dolinks, enum corpserace = findracebyname(racename); ot = findot(OT_ROASTMEAT); + } else if (strstr(p, "water fountain")) { + wantfountaintype = OT_POT_WATER; + ot = findot(OT_FOUNTAIN); + } else if (strstarts(p, "fountain of ")) { + char potname[BUFLEN]; + char *p2; + objecttype_t *pot; + p2 = p + strlen("fountain of "); + sprintf(potname, "potion of %s", p2); + pot = findotn(potname); + wantfountaintype = pot->id; + ot = findot(OT_FOUNTAIN); } else if (strstr(p, "corpse")) { int len; char racename[BUFLEN]; @@ -1091,14 +1104,14 @@ object_t *addobject(obpile_t *where, char *name, int canstack, int dolinks, enum } } - // don't put floor gratings on low floors - if (ot->id == OT_GRATINGFLOOR) { - if (where->where && (where->where->type->id == CT_LOWFLOOR)) { - setcelltype(where->where, where->where->map->habitat->emptycelltype); - } - } if (gamemode != GM_LOADING) { + // don't put floor gratings on low floors + if (ot->id == OT_GRATINGFLOOR) { + if (where->where && (where->where->type->id == CT_LOWFLOOR)) { + setcelltype(where->where, where->where->map->habitat->emptycelltype); + } + } if (hasflag(ot->flags, F_ONEPERCELL)) { if (hasob(where, ot->id)) { if (db) dblog("DB: trying to add >1 ONEPERCELL object to a cell. (%s) bailing out.", ot->name); @@ -1441,7 +1454,9 @@ object_t *addobject(obpile_t *where, char *name, int canstack, int dolinks, enum // fountain flags if (o && (o->type->id == OT_FOUNTAIN)) { f = hasflag(o->flags, F_LINKOB); - if (where->where && (where->where->habitat->id != H_VILLAGE)) { + if (wantfountaintype != OT_NONE) { + f->val[0] = wantfountaintype; + } else if (where->where && (where->where->habitat->id != H_VILLAGE)) { if (onein(3)) { objecttype_t *ot; int min,max; @@ -1719,8 +1734,6 @@ object_t *addobject(obpile_t *where, char *name, int canstack, int dolinks, enum f->val[1] = maxhp; } } - - } else if (o->type->id == OT_HEAD) { flag_t *rf, *cf; @@ -5168,7 +5181,11 @@ char *real_getobname(object_t *o, char *buf, int count, int wantpremods, int wan if (ot) { char *srcp; // get potion name (or hidden name if we don't recognise it) - srcp = gethiddennameot(ot->id); + if (showall) { + srcp = ot->name; + } else { + srcp = gethiddennameot(ot->id); + } // if this is "potion of xxx" if (strstarts(srcp, "potion ") || strstarts(srcp, "vial ") || strstarts(srcp, "flask ")) { @@ -5674,7 +5691,7 @@ char *getobconditionname(object_t *o, char *buf) { if (iqb >= AT_LOW) { pct = getobhppct(o); - if (pct >= 100) { + if (pct >= 85) { strcpy(buf, ""); } else if (pct >= 75) { snprintf(buf, BUFLEN, "battered"); @@ -12186,8 +12203,8 @@ int real_takedamage(object_t *o, int howmuch, int damtype, int wantannounce) { getobconditionname(o, postdamname); // was it enough to change the status - if (!hasflag(o->flags, F_NOOBDAMTEXT) && strcmp(predamname, postdamname) && - !streq(postdamname, "battered")) { + if (!hasflag(o->flags, F_NOOBDAMTEXT) && strcmp(predamname, postdamname)) { + //&& !streq(postdamname, "battered")) { // if it was melting, drop some water here if (damtype == DT_MELT) { if (hasflag(o->flags, F_EQUIPPED) ) { diff --git a/spell.c b/spell.c index 6506241..4b2fe73 100644 --- a/spell.c +++ b/spell.c @@ -7121,7 +7121,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_ return B_TRUE; } - if (isplayer(caster)) { + if (o->pile->owner && isplayer(o->pile->owner)) { if (isidentified(o)) { // already identified? nothinghappens(); return B_TRUE; @@ -7611,6 +7611,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_ } else if (spellid == OT_S_OBJECTGROWTH) { enum OBTYPE newoid = OT_NONE; enum LFSIZE newsize = SZ_ANY; + enum CELLTYPE newcelltype = CT_NONE; skill_t *obsk = SK_NONE; char obname[BUFLEN],newobname[BUFLEN]; int seen; @@ -7645,24 +7646,33 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_ hasflag(targob->flags, F_MULTISIZE) && (getarmoursize(targob) < SZ_LARGE)) { newsize = getarmoursize(targob) + 1; + } else if (targob->type->obclass->id == OC_POTION) { + newcelltype = CT_WALLGLASS; } else { switch (targob->type->id) { - case OT_ASH: newoid = OT_STONE; break; - case OT_ASHCONCEAL: newoid = OT_STONE; break; - case OT_ASHEXPLODE: newoid = OT_STONE; break; - case OT_ASHSLEEP: newoid = OT_STONE; break; + case OT_ASH: newoid = OT_DUSTCLOUD; break; + case OT_ASHCONCEAL: newoid = OT_DUSTCLOUD; break; + case OT_ASHEXPLODE: newoid = OT_DUSTCLOUD; break; + case OT_ASHSLEEP: newoid = OT_DUSTCLOUD; break; case OT_BAGOFHOLDING: newoid = OT_BAGOFHOLDINGLARGE; break; case OT_BAGOFHOLDINGLARGE: newoid = OT_BAGOFHOLDINGHUGE; break; + case OT_BED: newoid = OT_DOORWOOD; break; case OT_BUCKLER: newoid = OT_SHIELD; break; - case OT_DOORWOOD: newoid = OT_DOORIRON; break; + case OT_CLOVER: newoid = OT_SHRUB; break; + case OT_DOORIRON: newcelltype = CT_WALLMETAL; break; + case OT_DOORWOOD: newcelltype = CT_WALLWOOD; break; + case OT_FENCEWOOD: newcelltype = CT_WALLWOOD; break; case OT_FIRESMALL: newoid = OT_FIREMED; break; case OT_FIREMED: newoid = OT_FIRELARGE; break; + case OT_FIREPLACE: newoid = OT_FIRELARGE; break; case OT_FLOWER: newoid = OT_SHRUB; break; case OT_FOUNTAIN: newoid = OT_WATERDEEP; break; - case OT_WOODENSTOOL: newoid = OT_WOODENTABLE; break; + case OT_GATEIRON: newcelltype = CT_WALLMETAL; break; + case OT_GATEWOOD: newcelltype = CT_WALLWOOD; break; case OT_ICESHEET: newoid = OT_ICICLE; break; case OT_LEAF: newoid = OT_SHRUB; break; case OT_MISTLETOE: newoid = OT_SHRUB; break; + case OT_NUT: newoid = OT_TREE; break; case OT_SACK: newoid = OT_SACKLARGE; break; case OT_SACKLARGE: newoid = OT_SACKHUGE; break; case OT_SHIELDHIDE: newoid = OT_SHIELD; break; @@ -7670,6 +7680,10 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_ case OT_SHIELDLARGE: newoid = OT_SHIELDTOWER; break; case OT_SHRUB: newoid = OT_TREE; break; case OT_STUMP: newoid = OT_TREE; break; + case OT_TREE: newcelltype = CT_WALLTREE; break; + case OT_WOODENBARREL: newoid = OT_DOORWOOD; break; + case OT_WOODENSTOOL: newoid = OT_WOODENTABLE; break; + case OT_WOODENTABLE: newoid = OT_DOORWOOD; break; default: break; } } @@ -7678,6 +7692,16 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_ resizeobject(targob, newsize); getobname(targob, newobname, 1); if (seen) msg("%s grows into %s!", obname, newobname); + } else if (newcelltype != CT_NONE) { + cell_t *where; + if (seen) { + celltype_t *ct; + ct = findcelltype(newcelltype); + msg("%s grows into %s %s!", needan(ct->name) ? "an" : "a", ct->name); + } + where = getoblocation(targob); + killob(targob); + setcelltype(where, newcelltype); } else if (newoid == targob->id) { if (seen) msg("%s shudders for a moment.", obname); } else if (newoid != OT_NONE) { @@ -7688,6 +7712,11 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_ if (targob) { getobname(targob, newobname, 1); if (seen) msg("%s grows into %s!", obname, newobname); + if (targob->type->id == OT_WATERDEEP) { + cell_t *where; + where = getoblocation(targob); + setcelltype(where, CT_LOWFLOOR); // lower floor so water doesn't spread + } } else { if (seen) msg("%s shudders then explodes!", obname); } diff --git a/text.c b/text.c index 4f1f8bd..ceed2ea 100644 --- a/text.c +++ b/text.c @@ -1374,7 +1374,7 @@ char *getregionname(char *buf, map_t *m, region_t *r, enum REGIONNAMEFORMAT how) snprintf(buf, BUFLEN, "goblin caves L%d", m->depth); break; case RG_WOODS: - snprintf(buf, BUFLEN, "syvan woods L%d", m->depth); + snprintf(buf, BUFLEN, "sylvan woods L%d", m->depth); break; case RG_WORLDMAP: snprintf(buf, BUFLEN, "the surface(%d,%d)",x,y); diff --git a/vault.c b/vault.c index 9bc732f..e3bdc51 100644 --- a/vault.c +++ b/vault.c @@ -18,6 +18,8 @@ vault_t *firstvault = NULL, *lastvault = NULL; +extern lifeform_t *player; + extern enum GAMEMODE gamemode; vlegend_t *addlegend(vault_t *v, int ch, enum VAULTTHING tt, int pct, char *what) { @@ -772,6 +774,7 @@ vault_t *getvaulttype(map_t *m) { if (hasflag(v->flags, F_NORANDOM)) continue; if (getvaultrarity(v) != rr) continue; + // can this vault go in this map? if (vaultokformap(v, m)) { poss[nposs++] = v; @@ -1732,6 +1735,12 @@ int vaultokformap(vault_t *v, map_t *m) { if (f && (getmapdifficulty(m) > f->val[0])) { return B_FALSE; } + // dont make bones files while debugging. + if ((gamemode == GM_GAMESTARTED) && hasjob(player, J_GOD)) { + if (hasflagval(v->flags, F_VAULTTAG, NA, NA, NA, "bones")) { + return B_FALSE; + } + } return B_TRUE; }