diff --git a/ai.c b/ai.c index c850022..c11309e 100644 --- a/ai.c +++ b/ai.c @@ -731,6 +731,7 @@ int ai_bored(lifeform_t *lf, lifeform_t *master, int icanattack) { } // shopkeepers will return to their shops + /* if (hasjob(lf, J_SHOPKEEPER)) { f = lfhasflag(lf, F_OWNSSHOP); if (f) { @@ -748,6 +749,7 @@ int ai_bored(lifeform_t *lf, lifeform_t *master, int icanattack) { } } } + */ if (!lfhasflag(lf, F_STUNNED)) { lifeform_t *hateposs[MAXCANDIDATES],*poss[MAXCANDIDATES]; @@ -1829,9 +1831,11 @@ int aipickupok(lifeform_t *lf, object_t *o) { return B_TRUE; } + /* if (hasflag(o->flags, F_SHOPITEM)) { return B_FALSE; } + */ if (isedible(o)) { if (caneat(lf, o) && !isinbattle(lf, B_FALSE)) { diff --git a/data.c b/data.c index 9e3d36a..d98049b 100644 --- a/data.c +++ b/data.c @@ -856,6 +856,7 @@ void initjobs(void) { addflag(lastjob->flags, F_CASTCHANCE, 30, NA, NA, NULL); // non-player jobs + /* addjob(J_SHOPKEEPER, "Shopkeeper", "Shopkeepers make a living by selling goods to others. Always wary of thieves, most of them keep a shotgun under the counter."); addflag(lastjob->flags, F_NOPLAYER, B_TRUE, NA, NA, NULL); addflag(lastjob->flags, F_STARTATT, A_IQ, AT_AVERAGE, NA, NULL); @@ -863,6 +864,7 @@ void initjobs(void) { addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "shotgun"); addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "5-10 bullets"); addflag(lastjob->flags, F_WANTS, OT_GOLD, NA, NA, NULL); + */ } void initobjects(void) { @@ -1960,17 +1962,6 @@ void initobjects(void) { addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_POWDER, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_FEELTEXT, NA, NA, NA, "some ash"); - addot(OT_ASHEXPLODE, "pile of exploding powder", "A pile of ash.", MT_STONE, 0.1, OC_ROCK, SZ_TINY); - addflag(lastot->flags, F_GLYPH, NA, ',', NA, NULL); - addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); - addflag(lastot->flags, F_EXPLODEONDAM, NA, NA, NA, "1d6"); - addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, RR_RARE, ""); - addflag(lastot->flags, F_RARITY, H_CAVE, 100, RR_UNCOMMON, NULL); - addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); - addflag(lastot->flags, F_POWDER, B_TRUE, NA, NA, NULL); - addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, "pile of ash"); - addflag(lastot->flags, F_FEELTEXT, NA, NA, NA, "some ash"); - addflag(lastot->flags, F_VALUE, 100, NA, NA, NULL); addot(OT_ASHCONCEAL, "pile of concealing powder", "A pile of ash.", MT_STONE, 0.1, OC_ROCK, SZ_TINY); addflag(lastot->flags, F_GLYPH, NA, ',', NA, NULL); addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); @@ -1982,6 +1973,28 @@ void initobjects(void) { addflag(lastot->flags, F_FEELTEXT, NA, NA, NA, "some ash"); addflag(lastot->flags, F_AIFLEEITEM, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_VALUE, 80, NA, NA, NULL); + addot(OT_ASHEXPLODE, "pile of exploding powder", "A pile of ash.", MT_STONE, 0.1, OC_ROCK, SZ_TINY); + addflag(lastot->flags, F_GLYPH, NA, ',', NA, NULL); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); + addflag(lastot->flags, F_EXPLODEONDAM, NA, NA, NA, "1d6"); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, RR_RARE, ""); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_POWDER, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, "pile of ash"); + addflag(lastot->flags, F_FEELTEXT, NA, NA, NA, "some ash"); + addflag(lastot->flags, F_VALUE, 100, NA, NA, NULL); + addot(OT_ASHINVIS, "pile of prankster's dust", "A pile of ash.", MT_STONE, 0.1, OC_ROCK, SZ_TINY); + addflag(lastot->flags, F_GLYPH, NA, ',', NA, NULL); + addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, RR_RARE, ""); + addflag(lastot->flags, F_RARITY, H_CAVE, 70, RR_RARE, ""); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_POWDER, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, "pile of ash"); + addflag(lastot->flags, F_FEELTEXT, NA, NA, NA, "some ash"); + addflag(lastot->flags, F_AIFLEEITEM, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_VALUE, 100, NA, NA, NULL); addot(OT_ASHSLEEP, "pile of sleeping powder", "A pile of ash.", MT_STONE, 0.1, OC_ROCK, SZ_TINY); addflag(lastot->flags, F_GLYPH, NA, ',', NA, NULL); addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); @@ -5097,7 +5110,7 @@ void initobjects(void) { addot(OT_FIREPLACE, "brazier", "A heavy iron bowl filled with fire.", MT_METAL, 200, OC_FURNITURE, SZ_LARGE); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); - addflag(lastot->flags, F_RARITY, H_CAVE, 100, RR_RARE, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, RR_UNCOMMON, NULL); addflag(lastot->flags, F_GLYPH, C_RED, '\\', NA, NULL); addflag(lastot->flags, F_PRODUCESLIGHT, 6, NA, IFACTIVE, NULL); addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); diff --git a/data/vaults/bedroom.vlt b/data/vaults/bedroom.vlt index 4c5f92f..eaa14ba 100644 --- a/data/vaults/bedroom.vlt +++ b/data/vaults/bedroom.vlt @@ -10,7 +10,7 @@ @legend .:cell:carpetted floor -#:cell:rock wall +#:cell:SOLID b:ob:wooden bed t:ob:wooden table a:ob:armour rack diff --git a/data/vaults/cave_bear.vlt b/data/vaults/cave_bear.vlt index fff96a3..16ff1b5 100644 --- a/data/vaults/cave_bear.vlt +++ b/data/vaults/cave_bear.vlt @@ -10,7 +10,7 @@ O......B.# @end @legend -#:cell:rock wall +#:cell:SOLID O:ob:boulder O:exit B:mon:grizzly bear @@ -20,6 +20,7 @@ B:mon:grizzly bear scatter(3,1,-4,-2) ob:random food:5-10 scatter(3,1,-4,-2) mon:bear cub:1-3:50 goesin:dungeon +goesin:cave mayrotate rarity:uncommon maintainedge diff --git a/data/vaults/caveboss1.vlt b/data/vaults/caveboss1.vlt index 0ebfafd..78d4ce2 100644 --- a/data/vaults/caveboss1.vlt +++ b/data/vaults/caveboss1.vlt @@ -12,7 +12,7 @@ @end @legend -#:cell:rock wall +#:cell:metal wall f:ob:wooden footstool f:mon:goblin king a:mon:goblin archer diff --git a/data/vaults/caveboss2.vlt b/data/vaults/caveboss2.vlt index ab4547c..8c7ab20 100644 --- a/data/vaults/caveboss2.vlt +++ b/data/vaults/caveboss2.vlt @@ -14,7 +14,7 @@ @end @legend -#:cell:rock wall +#:cell:metal wall f:ob:wooden footstool f:mon:red wyrmling w:ob:goblin corpse diff --git a/data/vaults/cell.vlt b/data/vaults/cell.vlt index 95a14b3..b79db60 100644 --- a/data/vaults/cell.vlt +++ b/data/vaults/cell.vlt @@ -7,7 +7,7 @@ @end @legend -#:cell:rock wall +#:cell:SOLID m:mon:sleeping random +:ob:locked iron gate @end diff --git a/data/vaults/circle.vlt b/data/vaults/circle.vlt index 9a25c73..7eb46c6 100644 --- a/data/vaults/circle.vlt +++ b/data/vaults/circle.vlt @@ -12,7 +12,7 @@ @end @legend -#:cell:rock wall +#:cell:SOLID +:ob:wooden door +:exit @end diff --git a/data/vaults/crosshatch.vlt b/data/vaults/crosshatch.vlt index f455bc2..dc95ae7 100644 --- a/data/vaults/crosshatch.vlt +++ b/data/vaults/crosshatch.vlt @@ -13,7 +13,7 @@ ########### @end @legend -#:cell:rock wall +#:cell:SOLID @end @flags diff --git a/data/vaults/crossroads.vlt b/data/vaults/crossroads.vlt index a4b2369..1039893 100644 --- a/data/vaults/crossroads.vlt +++ b/data/vaults/crossroads.vlt @@ -8,7 +8,7 @@ x._.x @end @legend -#:cell:rock wall +#:cell:SOLID _:ob:fountain:50 s:ob:statue: x:exit diff --git a/data/vaults/diagcross.vlt b/data/vaults/diagcross.vlt index 31b376f..bb13e67 100644 --- a/data/vaults/diagcross.vlt +++ b/data/vaults/diagcross.vlt @@ -12,7 +12,7 @@ @end @legend -#:cell:rock wall +#:cell:SOLID X:exit @end diff --git a/data/vaults/fishbowl.vlt b/data/vaults/fishbowl.vlt index 3b2fc7c..a976f76 100644 --- a/data/vaults/fishbowl.vlt +++ b/data/vaults/fishbowl.vlt @@ -11,7 +11,7 @@ gggwwwggg @end @legend -#:cell:rock wall +#:cell:SOLID g:cell:glass wall w:ob:very deep water:100 @end diff --git a/data/vaults/glasscorner.vlt b/data/vaults/glasscorner.vlt index 988984e..fe9acc4 100644 --- a/data/vaults/glasscorner.vlt +++ b/data/vaults/glasscorner.vlt @@ -8,7 +8,7 @@ x.G# @end @legend -#:cell:rock wall +#:cell:SOLID G:cell:glass wall x:exit @end diff --git a/data/vaults/glasswall.vlt b/data/vaults/glasswall.vlt index ba2aa64..0c72f5a 100644 --- a/data/vaults/glasswall.vlt +++ b/data/vaults/glasswall.vlt @@ -9,7 +9,7 @@ @end @legend -#:cell:rock wall +#:cell:SOLID |:cell:glass wall @end diff --git a/data/vaults/godshrine1.vlt b/data/vaults/godshrine1.vlt index 842ded9..d077213 100644 --- a/data/vaults/godshrine1.vlt +++ b/data/vaults/godshrine1.vlt @@ -11,7 +11,7 @@ @end @legend -#:cell:rock wall +#:cell:metal wall +:ob:locked iron door +:exit g:ob:Godstone of Justice diff --git a/data/vaults/island.vlt b/data/vaults/island.vlt index 1e3c715..88309a9 100644 --- a/data/vaults/island.vlt +++ b/data/vaults/island.vlt @@ -1,19 +1,17 @@ @id:island @map -############ -#..........# -#...wwww...# -#..wwwwww..# -#..wwccww..# -#..wwccww..# -#..wwwwww..# -#...wwww...# -#..........# -############ +.......... +...wwww... +..wwwwww.. +..wwccww.. +..wwccww.. +..wwwwww.. +...wwww... +.......... @end @legend -#:cell:rock wall +#:cell:SOLID w:cell:low rock floor w:ob:very deep water c:ob:chest diff --git a/data/vaults/jimbo.vlt b/data/vaults/jimbo.vlt index aeaf3d2..1fc805b 100644 --- a/data/vaults/jimbo.vlt +++ b/data/vaults/jimbo.vlt @@ -12,7 +12,7 @@ X......@>|,# @end @legend -#:cell:rock wall +#:cell:SOLID |:ob:locked iron gate ,:ob:1-4 bones:50 ,:mon:prisoner:50 diff --git a/data/vaults/playerstart1.vlt b/data/vaults/playerstart1.vlt index b730417..3ec7c79 100644 --- a/data/vaults/playerstart1.vlt +++ b/data/vaults/playerstart1.vlt @@ -9,7 +9,7 @@ ########## @end @legend -#:cell:rock wall +#:cell:SOLID |:ob:iron gate ,:ob:1-4 bones:50 +:ob:wooden door diff --git a/data/vaults/playerstart2.vlt b/data/vaults/playerstart2.vlt index 5e00be5..6fb01ee 100644 --- a/data/vaults/playerstart2.vlt +++ b/data/vaults/playerstart2.vlt @@ -11,7 +11,7 @@ ###x### @end @legend -#:cell:rock wall +#:cell:SOLID -:ob:iron gate p:ob:playerstart x:exit diff --git a/data/vaults/playerstart3.vlt b/data/vaults/playerstart3.vlt index b05fd67..d4b6b6f 100644 --- a/data/vaults/playerstart3.vlt +++ b/data/vaults/playerstart3.vlt @@ -11,7 +11,7 @@ ######### @end @legend -#:cell:rock wall +#:cell:SOLID I:cell:glass wall ,:ob:4-8 pieces of broken glass p:ob:playerstart diff --git a/data/vaults/playerstart4.vlt b/data/vaults/playerstart4.vlt index 75140f0..3e02ff3 100644 --- a/data/vaults/playerstart4.vlt +++ b/data/vaults/playerstart4.vlt @@ -11,7 +11,7 @@ x._.p._.x ####x#### @end @legend -#:cell:rock wall +#:cell:SOLID w:cell:low rock floor w:ob:very deep water _:cell:wood floor diff --git a/data/vaults/playerstart5.vlt b/data/vaults/playerstart5.vlt index d337398..a9cdfc2 100644 --- a/data/vaults/playerstart5.vlt +++ b/data/vaults/playerstart5.vlt @@ -9,7 +9,7 @@ ####### @end @legend -#:cell:rock wall +#:cell:SOLID p:ob:playerstart x:exit @end diff --git a/data/vaults/playerstart6.vlt b/data/vaults/playerstart6.vlt index 6ac8eec..a6e1b0b 100644 --- a/data/vaults/playerstart6.vlt +++ b/data/vaults/playerstart6.vlt @@ -11,7 +11,7 @@ ###### @end @legend -#:cell:rock wall +#:cell:SOLID p:ob:playerstart x:exit @end diff --git a/data/vaults/playerstart7.vlt b/data/vaults/playerstart7.vlt index ccab1b4..5827198 100644 --- a/data/vaults/playerstart7.vlt +++ b/data/vaults/playerstart7.vlt @@ -11,7 +11,7 @@ ##+###+## @end @legend -#:cell:rock wall +#:cell:SOLID p:ob:playerstart p:ob:fountain f:ob:fountain diff --git a/data/vaults/pub.vlt b/data/vaults/pub.vlt index b4e6890..331ee38 100644 --- a/data/vaults/pub.vlt +++ b/data/vaults/pub.vlt @@ -24,5 +24,6 @@ scatter(2,1,-2,-2) ob:furniture:1-4 norandom mayrotate margin:3,3 +monstersstay @end diff --git a/data/vaults/riverroom.vlt b/data/vaults/riverroom.vlt index 8a48776..003419a 100644 --- a/data/vaults/riverroom.vlt +++ b/data/vaults/riverroom.vlt @@ -11,7 +11,7 @@ @end @legend -#:cell:rock wall +#:cell:SOLID ~:cell:low rock floor ~:ob:very deep water @end diff --git a/data/vaults/roundabout.vlt b/data/vaults/roundabout.vlt index d6a852e..438b0bf 100644 --- a/data/vaults/roundabout.vlt +++ b/data/vaults/roundabout.vlt @@ -10,7 +10,7 @@ x.###.x @end @legend -#:cell:rock wall +#:cell:SOLID x:exit @end diff --git a/data/vaults/shrine.vlt b/data/vaults/shrine.vlt index cc098b7..3cadee3 100644 --- a/data/vaults/shrine.vlt +++ b/data/vaults/shrine.vlt @@ -8,7 +8,7 @@ @end @legend -#:cell:rock wall +#:cell:SOLID p:ob:tree _:ob:holy circle @end diff --git a/data/vaults/supplycloset.vlt b/data/vaults/supplycloset.vlt index 5a96f23..8290047 100644 --- a/data/vaults/supplycloset.vlt +++ b/data/vaults/supplycloset.vlt @@ -6,7 +6,7 @@ @end @legend -#:cell:rock wall +#:cell:SOLID +:ob:wooden door +:exit o:ob:random tool diff --git a/data/vaults/supplycloset_tech.vlt b/data/vaults/supplycloset_tech.vlt index b8ccde8..98026e9 100644 --- a/data/vaults/supplycloset_tech.vlt +++ b/data/vaults/supplycloset_tech.vlt @@ -6,7 +6,7 @@ @end @legend -#:cell:rock wall +#:cell:SOLID +:ob:wooden door +:exit o:ob:random technology diff --git a/data/vaults/uturn.vlt b/data/vaults/uturn.vlt index 47221c5..50d3ee2 100644 --- a/data/vaults/uturn.vlt +++ b/data/vaults/uturn.vlt @@ -7,7 +7,7 @@ @end @legend -#:cell:rock wall +#:cell:SOLID X:exit @end diff --git a/defs.h b/defs.h index 5c46b84..a2d3620 100644 --- a/defs.h +++ b/defs.h @@ -35,7 +35,7 @@ #define DEF_SCREENH 24 #define DEF_RAGETIME 10 -#define DEF_SHOPIDENTPRICE (50) // cost to identify a just-purchased item +//#define DEF_SHOPIDENTPRICE (50) // cost to identify a just-purchased item #define DEF_VAULTMARGIN (3) #define DEF_VISRANGE (9) @@ -411,6 +411,7 @@ enum SHOPACTION { // ncurses colours #define C_NONE (-1) enum COLOUR { + C_RANDOM = -1, C_BLACK = 0, C_RED = 1, C_GREEN = 2, @@ -429,6 +430,10 @@ enum COLOUR { C_BOLDGREEN = 14, C_DARKGREY = 15, }; + +#define C_FIRST C_RED +#define C_LAST C_DARKGREY + #define BLACKBG 0 #define BLUEBG 16 #define GREENBG 32 @@ -719,12 +724,12 @@ enum CELLTYPE { CT_NONE = 0, // walls CT_WALL, + CT_WALLBRICK, CT_WALLDIRT, CT_WALLFLESH, CT_WALLGLASS, CT_WALLMETAL, CT_WALLWOOD, - CT_ROOMWALL, // empty CT_CORRIDOR, CT_DIRT, @@ -739,8 +744,6 @@ enum CELLTYPE { CT_LOOPCORRIDOR, CT_LOWFLOOR, CT_VLOWFLOOR, - // rooms - CT_ROOM, }; enum SPELLSCHOOL { @@ -1091,7 +1094,7 @@ enum JOB { J_PIRATE, J_PRINCE, J_ROGUE, - J_SHOPKEEPER, + //J_SHOPKEEPER, J_WIZARD, }; #define J_RANDOM J_NONE @@ -1198,6 +1201,7 @@ enum OBTYPE { OT_ASH, OT_ASHEXPLODE, OT_ASHCONCEAL, + OT_ASHINVIS, OT_ASHSLEEP, OT_GEMOFSEEING, // gems @@ -2071,6 +2075,8 @@ enum FLAG { F_NEWWATERDEPTH, // temp flag for the spread of f_deepwater obs. // v0+1 are x/y, v2 is new depth. F_STOMACHOF, // this map is the stomach of lf id V0, name = f->text + F_CELLTYPESOLID, // use celltype v0 for solid cells (walls) + F_CELLTYPEEMPTY, // use celltype v0 for empty cells (corridors/rooms) // object flags F_BADOBJECT, // this object is dangerous. ie. potion of poison, // potion of sleep, etc. @@ -2112,7 +2118,7 @@ enum FLAG { F_FEELTEXT, // when blind, show "you can feel"+f->text // for items in shops F_VENDITEM, // causes vending machine to show this item as identified - F_SHOPITEM, // v0 is object value. + //F_SHOPITEM, // v0 is object value. // v1 is the shop it is from // causes shops to show (worth $xx) after the ob's name. // also used for detecting theft! @@ -2761,7 +2767,7 @@ enum FLAG { // vanish. // v1 is lifetime left. this decrements each turn. // when at zero, lf vanishes. - F_OWNSSHOP, // v0 is roomid of the shop which this shopkeeper owns. + //F_OWNSSHOP, // v0 is roomid of the shop which this shopkeeper owns. F_GUARD, // this lf is a guard, who can be called by shopkeepers F_HATESALL, // lf will attack ALL other lfs on sight F_HATESRACE, // lf will attack lfs with race=v0 or baseid=v0 on @@ -3147,6 +3153,7 @@ enum FLAG { // marked as exits. F_NORANDOM, // this vault does not randomly appear // OR this spell doesn't apear in books + F_MONSTERSSTAY, // monsters in this vault won't leave it F_VAULTATOB, // v0/1=x/y, v2=pctchance, text=obname F_VAULTATLF, // v0/1=x/y, v2=pctchance, text=lfname F_VAULTATCELL, // v0/1=x/y, v2=pctchance, text=cellname @@ -3161,7 +3168,7 @@ enum FLAG { // can be repeated multiple times // if a vault doesnt have this flag, it can go anywhere F_VAULTISPLAYERSTART, // player can start in this vault - F_VAULTISSHOP, // this vault is a shop, so add f_shopitem to objects + //F_VAULTISSHOP, // this vault is a shop, so add f_shopitem to objects // here. F_VAULTISSHRINE, // this vault is a godstone shrine F_VAULTRARITY, // v0=rr_xxx diff --git a/doc/vaults.txt b/doc/vaults.txt index 1fa313c..ee54d90 100644 --- a/doc/vaults.txt +++ b/doc/vaults.txt @@ -10,6 +10,8 @@ General format: k:mon:kobold s:ob:50:short sword #:cell:stone wall + #:cell:EMPTY + #:cell:SOLID @end @flags ... @@ -46,7 +48,7 @@ Flags can be: - a range (x-y) - a pct of the total region cells (x%) coords can be negative ("count back from right/bottom") - pct is optional + pct is optional (chance of this happening) autodoors:pct // automatically add at least one door to the edges of // this room. @@ -89,8 +91,7 @@ Flags can be: // outline. shrine // } - shop // } this vault is a shop/shrine/etc - stomach // } + stomach // } this vault is a shrine/etc tag:xxxx // add tag "xxx" to vault(for use with rndvaultwithtag) diff --git a/io.c b/io.c index 491fe4b..a572551 100644 --- a/io.c +++ b/io.c @@ -232,6 +232,7 @@ void anim(cell_t *src, cell_t *dst, char ch, int colour) { updateviewfor(cell); drawlevelfor(player); // draw char & cursor at its current pos... + if (colour == C_RANDOM) gl.colour = rnd(C_FIRST, C_LAST); drawglyph(&gl, cell->x - viewx, cell->y - viewy); //mvwprintw(gamewin, cell->y - viewy, cell->x - viewx, "%c", gl.ch); wmove(gamewin, cell->y - viewy, cell->x - viewx); @@ -276,6 +277,7 @@ void animcells(cell_t *src, cell_t **dst, int ndst, int gradual, char ch, char c } else { gl.ch = ch2; } + if (colour == C_RANDOM) gl.colour = rnd(C_FIRST, C_LAST); if (gradual) { // update screen each time @@ -329,6 +331,7 @@ void animline(cell_t *src, cell_t *dst, int gradual, char ch, char ch2, int colo } else { gl.ch = ch2; } + if (colour == C_RANDOM) gl.colour = rnd(C_FIRST, C_LAST); if (gradual) { // update screen each time @@ -387,6 +390,7 @@ void animradial(cell_t *src, int radius, int ch,int colour, int dirtype, char *s if (c && haslos(player, c) && (getcelldistorth(src, c) <= i)) { // draw char & cursor at its current pos... //mvwprintw(gamewin, c->y - viewy, c->x - viewx, "%c", ch); + if (colour == C_RANDOM) gl.colour = rnd(C_FIRST, C_LAST); drawglyph(&gl, c->x - viewx, c->y - viewy); drawn = B_TRUE; nseen++; @@ -459,6 +463,7 @@ void animsky(cell_t *src, char ch, int colour) { // draw bolt coming down for (y = 0; y <= src->y - viewy; y++) { + if (colour == C_RANDOM) gl.colour = rnd(C_FIRST, C_LAST); drawglyph(&gl, src->x - viewx, y); } wrefresh(gamewin); @@ -3821,7 +3826,7 @@ void docomms(lifeform_t *lf) { char buf[BUFLEN]; char lfname[BUFLEN]; char ch; - int moneyowing = 0; + //int moneyowing = 0; enum ATTRBRACKET iqb; flag_t *f; cell_t *c; @@ -3908,6 +3913,7 @@ void docomms(lifeform_t *lf) { addchoice(&prompt, 'd', "(donate an item)", NULL, NULL, NULL); } + /* f = lfhasflag(lf, F_OWNSSHOP); if (f) { int shopid; @@ -3918,6 +3924,7 @@ void docomms(lifeform_t *lf) { addchoice(&prompt, 'p', buf, NULL, NULL, NULL); } } + */ addchoice(&prompt, 'y', "Yeeeeeaaaargh!", NULL, NULL, NULL); @@ -4179,6 +4186,7 @@ void docomms(lifeform_t *lf) { } } break; + /* case 'p': // can we afford this? if (givemoney(player, lf, moneyowing)) { @@ -4217,6 +4225,7 @@ void docomms(lifeform_t *lf) { sayphrase(lf, SP_PAYTHANKS, SV_TALK, NA, NULL); } break; + */ case 'r': msg("You say \"Get some rest.\" to %s.", lfname); if (lfhasflag(lf, F_RAGE) || !canhear(lf, player->cell, SV_SHOUT)) { @@ -10184,10 +10193,12 @@ void setobcolour(WINDOW *win, object_t *o, int set) { if (!o) return; // unpaid? + /* if (hasflag(o->flags, F_SHOPITEM) && o->pile->owner) { funcptr(win, C_ORANGE); return; } + */ if (hasflag(o->flags, F_KNOWNBAD)) { funcptr(win, C_RED); diff --git a/lf.c b/lf.c index e78b047..84659ca 100644 --- a/lf.c +++ b/lf.c @@ -4587,6 +4587,7 @@ raceclass_t *findraceclass(enum RACECLASS id) { return NULL; } +/* lifeform_t *findshopkeeper(map_t *m, int roomid) { lifeform_t *lf; for (lf = m->lf ; lf ; lf = lf->next) { @@ -4596,6 +4597,7 @@ lifeform_t *findshopkeeper(map_t *m, int roomid) { } return NULL; } +*/ skill_t *findskill(enum SKILL id) { skill_t *r; @@ -6881,6 +6883,7 @@ object_t *getouterequippedob(lifeform_t *lf, enum BODYPART bp) { return getequippedob(lf->pack, bp); } +/* int getowing(lifeform_t *buyer, int shopid, int *retnitems) { object_t *o; flag_t *f; @@ -6899,6 +6902,7 @@ int getowing(lifeform_t *buyer, int shopid, int *retnitems) { } return totcost; } +*/ // return the healthiest possible hurt condition that 'lf' will // recognise when looking at someone else. @@ -8961,6 +8965,7 @@ void givejob(lifeform_t *lf, enum JOB jobid) { f->val[0] = OT_HOOKHAND; f->val[1] = 4; } + /* } else if (j->id == J_SHOPKEEPER) { // shopkeepers are not hostile. killflagsofid(lf->flags, F_HOSTILE); @@ -8970,6 +8975,7 @@ void givejob(lifeform_t *lf, enum JOB jobid) { addflag(lf->flags, F_OWNSSHOP, getroomid(lf->cell), NA, NA, NULL); addflag(lf->flags, F_STAYINROOM, getroomid(lf->cell), NA, NA, NULL); } + */ } } @@ -12293,6 +12299,7 @@ int askforinfo(lifeform_t *lf, int diffmod) { return B_FALSE; } +/* int askforpayment(lifeform_t *shk, lifeform_t *lf) { char saybuf[BUFLEN]; int totcost = 0; @@ -12315,6 +12322,7 @@ int askforpayment(lifeform_t *shk, lifeform_t *lf) { say(shk, saybuf, SV_TALK); return B_FALSE; } +*/ char *assignnpcname(lifeform_t *lf) { npcname_t *poss,*sel; @@ -17744,7 +17752,7 @@ int steal(lifeform_t *lf, obpile_t *op, enum FLAG wantflag) { o = (object_t *)prompt.choice[rnd(0,prompt.nchoices-1)].data; } if (o) { - killflagsofid(o->flags, F_SHOPITEM); + //killflagsofid(o->flags, F_SHOPITEM); o = moveob(o, lf->pack, 1); if (o) { char obname[BUFLEN]; diff --git a/lf.h b/lf.h index 1c68881..553eb49 100644 --- a/lf.h +++ b/lf.h @@ -19,7 +19,7 @@ int areallies(lifeform_t *lf1, lifeform_t *lf2); int areenemies(lifeform_t *lf1, lifeform_t *lf2); int armourfits(lifeform_t *lf, object_t *o, enum ERROR *reason); int askforinfo(lifeform_t *lf, int diffmod); -int askforpayment(lifeform_t *shk, lifeform_t *lf); +//int askforpayment(lifeform_t *shk, lifeform_t *lf); char *assignnpcname(lifeform_t *lf); void autoshortcut(lifeform_t *lf, enum OBTYPE spellid); void autoskill(lifeform_t *lf); @@ -104,7 +104,7 @@ lifeform_t *findlfunique(enum RACE rid); race_t *findrace(enum RACE id); race_t *findracebyname(char *name); raceclass_t *findraceclass(enum RACECLASS id); -lifeform_t *findshopkeeper(map_t *m, int roomid); +//lifeform_t *findshopkeeper(map_t *m, int roomid); skill_t *findskill(enum SKILL id); skill_t *findskillbyname(char *name); enum SKILLLEVEL findskilllevbyname(char *name); @@ -177,7 +177,7 @@ int getnightvisrange(lifeform_t *lf); int getnoisedetails(lifeform_t *lf, enum NOISETYPE nid, char *heartext,char *seetext, int *volume); char *getlfconditionname(enum LFCONDITION cond); object_t *getouterequippedob(lifeform_t *lf, enum BODYPART bp); -int getowing(lifeform_t *buyer, int shopid, int *retnitems); +//int getowing(lifeform_t *buyer, int shopid, int *retnitems); enum LFCONDITION getseenlfconditioncutoff(lifeform_t *lf); char *getseenlfconditionname(lifeform_t *lf, lifeform_t *viewer); int getsmellrange(lifeform_t *lf); diff --git a/map.c b/map.c index ee7825c..a22d090 100644 --- a/map.c +++ b/map.c @@ -206,6 +206,11 @@ lifeform_t *addmonster(cell_t *c, enum RACE rid, char *racename, int jobok, int wantflags = addflagpile(NULL, NULL); + // override... + if (streq(racename, "random")) { + rid = R_RANDOM; + } + if (rid != R_SPECIFIED) { if (rid == R_RANDOM) { r = getrandomrace(c, NA); @@ -860,7 +865,7 @@ int autodoors(map_t *map, int roomid, int minx, int miny, int maxx, int maxy, in if (rnd(1,100) <= doorpct) { makedoor(cell[i], dooropenchance); } else { - setcelltype(cell[i], cell[i]->habitat->emptycelltype); + setcelltype(cell[i], getcellempty(cell[i])); cell[i]->isroomwall = compassdir(d); addflag(map->flags, F_ROOMEXIT, roomid, cell[i]->x, cell[i]->y, "from autodoors, only way out"); } @@ -882,7 +887,7 @@ int autodoors(map_t *map, int roomid, int minx, int miny, int maxx, int maxy, in if (rnd(1,100) <= doorpct) { makedoor(poss[sel], dooropenchance); } else { - setcelltype(poss[sel], poss[sel]->habitat->emptycelltype); + setcelltype(poss[sel], getcellempty(poss[sel])); addflag(map->flags, F_ROOMEXIT, roomid, poss[sel]->x, poss[sel]->y, "from autodoors, potential location"); } poss[sel]->isroomwall = compassdir(possdir[sel]); @@ -931,7 +936,7 @@ int autodoors(map_t *map, int roomid, int minx, int miny, int maxx, int maxy, in makedoor(cell[sel], dooropenchance); doorsadded++; } else { - setcelltype(cell[sel], cell[sel]->habitat->emptycelltype); + setcelltype(cell[sel], getcellempty(cell[sel])); addflag(map->flags, F_ROOMEXIT, roomid, cell[sel]->x, cell[sel]->y, "from autodoors, forced at end"); doorsadded++; } @@ -950,7 +955,7 @@ void breakwall(cell_t *c) { int roomwall; origtype = c->type; roomwall = isroom(c); - setcelltype(c, c->habitat->emptycelltype); + setcelltype(c, getcellempty(c)); if (origtype->solid && roomwall && onein(2)) { switch (origtype->material->id) { case MT_STONE: addob(c->obpile, "1-30 stones"); break; @@ -1236,7 +1241,7 @@ int damagecell(cell_t *c, int amt, enum DAMTYPE damtype) { sprintf(cellname, "%s %s", needan(c->type->name) ? "An" : "A", c->type->name); cellmat = c->type->material->id; // cell dies (have to do this before calling fragments()) - setcelltype(c, c->map->habitat->emptycelltype); + setcelltype(c, getcellempty(c)); // announce if (haslos(player, c)) { msg("%s %s!", cellname, willshatter(cellmat) ? "shatters" : "is destroyed"); @@ -1595,6 +1600,37 @@ void getcellglyph(glyph_t *g, cell_t *c, lifeform_t *viewer) { } } +enum CELLTYPE getcellempty(cell_t *c) { + flag_t *f; + if (c->habitat == c->map->habitat) { + f = hasflag(c->map->flags, F_CELLTYPEEMPTY); + if (f) return f->val[0]; + } + return c->habitat->emptycelltype; +} + +enum CELLTYPE getcellsolid(cell_t *c) { + flag_t *f; + if (c->habitat == c->map->habitat) { + f = hasflag(c->map->flags, F_CELLTYPESOLID); + if (f) return f->val[0]; + } + return c->habitat->solidcelltype; +} + +enum CELLTYPE getmapempty(map_t *m) { + flag_t *f; + f = hasflag(m->flags, F_CELLTYPEEMPTY); + if (f) return f->val[0]; + return m->habitat->emptycelltype; +} + +enum CELLTYPE getmapsolid(map_t *m) { + flag_t *f; + f = hasflag(m->flags, F_CELLTYPESOLID); + if (f) return f->val[0]; + return m->habitat->solidcelltype; +} enum DEPTH getcellwaterdepth(cell_t *c, lifeform_t *lf) { object_t *o; @@ -2166,8 +2202,8 @@ void createcave(map_t *map, int depth, map_t *parentmap, int exitdir, object_t * } // what kind of cells will 'empty' ones be? - emptycell = map->habitat->emptycelltype; - solidcell = map->habitat->solidcelltype; + emptycell = getmapempty(map); + solidcell = getmapsolid(map); // pick initial random points for (i = 0; i < numstartpos; i++) { @@ -2400,9 +2436,41 @@ void createdungeon(map_t *map, int depth, map_t *parentmap, int exitdir, object_ } } + // random chance of different wall type + + if (onein(6)) { + switch (rnd(1,3)) { + case 1: + addflag(map->flags, F_CELLTYPESOLID, CT_WALLBRICK, NA, NA, NULL); + break; + case 2: + addflag(map->flags, F_CELLTYPESOLID, CT_WALLMETAL, NA, NA, NULL); + break; + case 3: + addflag(map->flags, F_CELLTYPESOLID, CT_WALLWOOD, NA, NA, NULL); + break; + } + } + // random chance of different floor type + if (onein(6)) { + switch (rnd(1,3)) { + case 1: + addflag(map->flags, F_CELLTYPEEMPTY, CT_FLOORCARPET, NA, NA, NULL); + break; + case 2: + addflag(map->flags, F_CELLTYPEEMPTY, CT_FLOORTILE, NA, NA, NULL); + break; + case 3: + addflag(map->flags, F_CELLTYPEEMPTY, CT_FLOORWOOD, NA, NA, NULL); + break; + } + } + + // what kind of cells will 'empty' ones be? - emptycell = map->habitat->emptycelltype; - solidcell = map->habitat->solidcelltype; + emptycell = getmapempty(map); + //solidcell = map->habitat->solidcelltype; + solidcell = getmapsolid(map); // pick initial random spot if (corridortype == CDT_NORMAL) { @@ -2629,7 +2697,7 @@ void createdungeon(map_t *map, int depth, map_t *parentmap, int exitdir, object_ c = getrandomroomcell(map, i); if (c && isempty(c) && !countobs(c->obpile, B_TRUE)) { - setcelltype(c, CT_WALL); + setcelltype(c, solidcell); } } } @@ -2743,7 +2811,7 @@ void createforest(map_t *map, int depth, map_t *parentmap, int exitdir, object_t //object_t *o; // fill entire maze with emptiness - emptycell = map->habitat->emptycelltype; + emptycell = getmapempty(map); for (y = 0; y < map->h; y++) { for (x = 0; x < map->w; x++) { c = addcell(map, x, y); @@ -2858,8 +2926,8 @@ void createheaven(map_t *map, int depth, map_t *parentmap, int exitdir, object_t //object_t *o; // what kind of cells will 'empty' ones be? - emptycell = map->habitat->emptycelltype; - solidcell = map->habitat->solidcelltype; + emptycell = getmapempty(map); + solidcell = getmapsolid(map); // fill entire maze with walls for (y = 0; y < map->h; y++) { for (x = 0; x < map->w; x++) { @@ -3678,7 +3746,7 @@ void createsewer(map_t *map, int depth, map_t *parentmap, int exitdir, object_t break; } } - if (makewalkway) setcelltype(c, c->habitat->emptycelltype); + if (makewalkway) setcelltype(c, getcellempty(c)); } else if (c->type->id == CT_LOWFLOOR) { // any water cell orthogonally surrounded by water becomes very deep int dir,surrounded = B_TRUE; @@ -3706,7 +3774,7 @@ void createsewer(map_t *map, int depth, map_t *parentmap, int exitdir, object_t nexto = o->next; if (o->type->id != OT_SLIMEPOOL) { cell_t *c2; - c2 = getrandomcelloftype(map, c->habitat->emptycelltype); + c2 = getrandomcelloftype(map, getcellempty(c)); moveob(o, c2->obpile, ALL); } } @@ -3873,7 +3941,7 @@ int createvault(map_t *map, int roomid, vault_t *v, int *retw, int *reth, int *r // set cell type ct = getvaultcelltype(v, x-minx,y-miny, rotation); - setcelltype(cell, ct ? ct->id : cell->habitat->emptycelltype); + setcelltype(cell, ct ? ct->id : getcellempty(cell)); // set roomid cell->room = thisroom; // add objects @@ -4605,11 +4673,11 @@ void createroom(map_t *map, int roomid, int x1, int y1, int x2, int y2, int forc // ie. if you haven't forced walls then if this room overlaps // with another one, no walls will be created. if (forcewalls || (!forcewalls && cell->type->solid)) { - setcelltype(cell, cell->habitat->solidcelltype); + setcelltype(cell, getcellsolid(cell)); } //} } else { - setcelltype(cell, cell->habitat->emptycelltype); + setcelltype(cell, getcellempty(cell)); } cell->room = thisroom; } @@ -4876,7 +4944,7 @@ void expand_cave(map_t *map, int numpasses) { for (dir = DC_N; dir <= DC_NW; dir++) { c2 = getcellindir(c, dir); if (c2 && c2->type->solid && pctchance(chancetoclear)) { - setcelltype(c2, map->habitat->emptycelltype); + setcelltype(c2, getmapempty(map)); } } // mark cell as processed @@ -4970,7 +5038,7 @@ void finalisemap(map_t *map, object_t *entryob) { for (d = DC_N; d <= DC_NW; d++) { cell_t *c2; c2 = getcellindir(c, d); - if (c2) setcelltype(c2, map->habitat->emptycelltype); + if (c2) setcelltype(c2, getmapempty(map)); } } } else { @@ -6101,9 +6169,9 @@ object_t *hastrailof(obpile_t *op, lifeform_t *lf, enum OBTYPE oid, flag_t **tfl void initmap(void) { // habitats - // thingchance, obchance, vaultchance, maxvisrange, upstiartype, downstairtype + // thingchance, obchance, vaultchance, maxvisrange, upstiartype, downstairtype addhabitat(H_DUNGEON, "dungeon", CT_CORRIDOR, CT_WALL, 3, 50, 30, 6, OT_STAIRSUP, OT_STAIRSDOWN); - addhabitat(H_CAVE, "cave", CT_DIRT, CT_WALLDIRT, 5, 60, 10, 6, OT_TUNNELUP, OT_TUNNELDOWN); + addhabitat(H_CAVE, "cave", CT_DIRT, CT_WALLDIRT, 5, 65, 10, 6, OT_TUNNELUP, OT_TUNNELDOWN); addhabitat(H_FOREST, "forest", CT_GRASS, CT_WALL, 3, 75, 0, MAXVISRANGE, OT_NONE, OT_NONE); addhabitat(H_HEAVEN, "heaven", CT_CORRIDOR, CT_WALLGLASS, 5, 0, 0, MAXVISRANGE, OT_NONE, OT_NONE); addhabitat(H_PIT, "pit", CT_CORRIDOR, CT_WALL, 0, 0, 0, 5, OT_NONE, OT_NONE); @@ -6113,10 +6181,12 @@ void initmap(void) { addhabitat(H_SWAMP, "swamp", CT_CORRIDOR, CT_WALL, 3, 50, 0, MAXVISRANGE, OT_STAIRSUP, OT_STAIRSDOWN); // cell types - solid + // floorheight, hp addcelltype(CT_WALL, "rock wall", UNI_SHADEDARK, C_GREY, B_SOLID, B_OPAQUE, MT_STONE, 0, 50); - addcelltype(CT_WALLDIRT, "dirt wall", UNI_SHADEDARK, C_BROWN, B_SOLID, B_OPAQUE, MT_STONE, 0, 25); - addcelltype(CT_WALLWOOD, "wooden wall", UNI_SOLID, C_BROWN, B_SOLID, B_OPAQUE, MT_WOOD, 0, 40); - addcelltype(CT_WALLFLESH, "flesh wall", UNI_SOLID, C_RED, B_SOLID, B_OPAQUE, MT_FLESH, 0, 30); + addcelltype(CT_WALLBRICK, "brick wall", UNI_SHADEDARK, C_ORANGE, B_SOLID, B_OPAQUE, MT_STONE, 0, 40); + addcelltype(CT_WALLDIRT, "dirt wall", UNI_SHADEDARK, C_BROWN, B_SOLID, B_OPAQUE, MT_STONE, 0, 20); + 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_WALLMETAL, "metal wall", UNI_SOLID, C_WHITE, B_SOLID, B_OPAQUE, MT_METAL, 0, 75); // cell types - non-solid @@ -6148,12 +6218,14 @@ void initmap(void) { void initmaplayout(void) { - int vx[4],vy[4],i; + //int vx[4],vy[4]; + int i; // MAPMAPMAPMAP // region definitions (outlines) addregionoutline(RG_WORLDMAP); // link to first dungeon addregionthing(lastregionoutline, NA, 0, 0, RT_REGIONLINK, RG_MAINDUNGEON, "staircase going down"); + /* // four villages for (i = 0; i < 4; i++) { vx[i] = 0; vy[i] = 0; @@ -6178,7 +6250,7 @@ void initmaplayout(void) { addregionthing(lastregionoutline, NA, vx[i], vy[i], RT_RNDVAULTWITHFLAG, F_VAULTISSHOP, NULL); } //vx = 0; vy = -1; - + */ addregionoutline(RG_MAINDUNGEON); addregionthing(lastregionoutline, 1, NA, NA, RT_RNDVAULTWITHFLAG, F_VAULTISPLAYERSTART, NULL); @@ -6563,7 +6635,7 @@ int linkholes(map_t *map) { } // clear out the cell if required if (c2->type->solid) { - setcelltype(c2, c2->habitat->emptycelltype); + setcelltype(c2, getcellempty(c2)); } // note we specifically say DONT link the new hole, to avoid an infinite // loop! @@ -6729,7 +6801,7 @@ void makedoor(cell_t *cell, int openchance) { m = cell->map; - setcelltype(cell, cell->habitat->emptycelltype); + setcelltype(cell, getcellempty(cell)); if ((rnd(1,100) + m->depth) >= 66) { strcpy(doorbuf, "iron door"); @@ -6902,11 +6974,13 @@ void markroomwalls(map_t *m, room_t *r) { void mapentereffects(map_t *m) { int i; cell_t *c; - flag_t *f; + //flag_t *f; for (i = 0; i < m->w * m->h; i++) { vault_t *v; - // teleport shopkeepers back to their shops c = m->cell[i]; + v = getcellvault(c); + /* + // teleport shopkeepers back to their shops if (c->lf && hasjob(c->lf, J_SHOPKEEPER) && !isplayer(c->lf)) { f = lfhasflag(c->lf, F_OWNSSHOP); if (f) { @@ -6920,7 +6994,6 @@ void mapentereffects(map_t *m) { } } } - v = getcellvault(c); // replace people in the Inn if (v && streq(v->id, "inn") && c->lf && (c->lf->race->id == R_HUMAN)) { lifeform_t *lf; @@ -6928,6 +7001,7 @@ void mapentereffects(map_t *m) { lf = addmonster(c, R_HUMAN, NULL, B_TRUE, 1, B_FALSE, NULL); addflag(lf->flags, F_STAYINROOM, getroomid(c), B_MAYCHASE, NA, NULL); } + */ } // monsters on the new level now get a bunch of turns to simulate them moving about when the player wasn't there. @@ -7012,7 +7086,7 @@ int remove_deadends(map_t *m, int howmuch) { enum CELLTYPE solidcell; int i,n,count = 0; - solidcell = m->habitat->solidcelltype; + solidcell = getmapsolid(m); for (i = 0; i < howmuch; i++) { for (n = 0; n < m->w * m->h; n++) { @@ -7066,7 +7140,7 @@ void setcellknown(cell_t *cell, int forcelev) { o = hassecretdoor(cell->obpile); if (o) { celltype_t *ct; - ct = findcelltype(cell->habitat->solidcelltype); + ct = findcelltype(getcellsolid(cell)); cell->knownglyph = ct->glyph; } else { cell->knownglyph = cell->type->glyph; diff --git a/map.h b/map.h index bd81fb6..a11c278 100644 --- a/map.h +++ b/map.h @@ -29,6 +29,10 @@ int getcellclimbdifficulty(cell_t *c); int getcelldist(cell_t *src, cell_t *dst); int getcelldistorth(cell_t *src, cell_t *dst); void getcellglyph(glyph_t *g, cell_t *c, lifeform_t *viewer); +enum CELLTYPE getcellempty(cell_t *c); +enum CELLTYPE getcellsolid(cell_t *c); +enum CELLTYPE getmapempty(map_t *m); +enum CELLTYPE getmapsolid(map_t *m); enum DEPTH getcellwaterdepth(cell_t *c, lifeform_t *lf); cell_t *get_closest_adjcell(cell_t *src, cell_t *dst); int getdoorlockdiff(int depth); diff --git a/move.c b/move.c index b6c5a8a..1446f58 100644 --- a/move.c +++ b/move.c @@ -1110,11 +1110,11 @@ int movelf(lifeform_t *lf, cell_t *newcell) { enum FLAG flying; int changedlev = B_FALSE; room_t *preroom = NULL, *postroom = NULL; - int preshop = -1; + //int preshop = -1; int prespeed = B_FALSE, postspeed = B_FALSE; int prewater = B_FALSE; int preseenbyplayer = B_FALSE; - vault_t *v; + //vault_t *v; flag_t *retflag[MAXCANDIDATES]; int nretflags,i; @@ -1163,10 +1163,12 @@ int movelf(lifeform_t *lf, cell_t *newcell) { // remember current cell + room id prespeed = getmovespeed(lf); preroom = lf->cell->room; + /* v = getcellvault(lf->cell); if (v && hasflag(v->flags, F_VAULTISSHOP)) { preshop = getroomid(lf->cell); } + */ // getting out of water? if (hasobwithflag(lf->cell->obpile, F_DEEPWATER)) { prewater = B_TRUE; @@ -1178,7 +1180,7 @@ int movelf(lifeform_t *lf, cell_t *newcell) { } else { prespeed = SP_NORMAL; preroom = NULL; - preshop = B_FALSE; + //preshop = B_FALSE; prewater = B_FALSE; preseenbyplayer = B_FALSE; } @@ -1491,6 +1493,7 @@ int movelf(lifeform_t *lf, cell_t *newcell) { } } + /* // leaving a shop if (preshop) { // are you about to go outside a shop with stolen goods? @@ -1517,6 +1520,7 @@ int movelf(lifeform_t *lf, cell_t *newcell) { } } } + */ if (preseenbyplayer && !cansee(player, lf) && !changedlev) { if (areenemies(player, lf)) { real_getlfnamea(lf, lfname, B_FALSE, B_FALSE); diff --git a/objects.c b/objects.c index 91761cb..6aea789 100644 --- a/objects.c +++ b/objects.c @@ -4794,7 +4794,7 @@ char *real_getobname(object_t *o, char *buf, int count, int wantpremods, int wan char localbuf[BUFLEN]; char buf2[BUFLEN]; char triedbuf[BUFLEN]; - int shopitem = B_FALSE; + //int shopitem = B_FALSE; flag_t *f; brand_t *br; int hasunknownmod = B_FALSE; @@ -4804,9 +4804,11 @@ char *real_getobname(object_t *o, char *buf, int count, int wantpremods, int wan int nretflags = 0; // default to normal name + /* if (hasflag(o->flags, F_SHOPITEM)) { shopitem = B_TRUE; } + */ where = getoblocation(o); @@ -5364,7 +5366,8 @@ char *real_getobname(object_t *o, char *buf, int count, int wantpremods, int wan } // show if we've tried this - if (!shopitem && (gamemode == GM_GAMESTARTED)) { + //if (!shopitem && (gamemode == GM_GAMESTARTED)) { + if (gamemode == GM_GAMESTARTED) { knowledge_t *k; strcpy(triedbuf, ""); @@ -5430,6 +5433,7 @@ char *real_getobname(object_t *o, char *buf, int count, int wantpremods, int wan } } + /* // in a shop? if (shopitem) { char pricebuf[BUFLEN]; @@ -5437,6 +5441,7 @@ char *real_getobname(object_t *o, char *buf, int count, int wantpremods, int wan snprintf(pricebuf, BUFLEN, " [$%d%s]", (int)getshopprice(o, player, NULL), o->pile->owner ? ", unpaid" : ""); strcat(localbuf, pricebuf); } + */ // apply prefix now! if (count == 1) { @@ -12147,6 +12152,19 @@ int real_fireat(lifeform_t *thrower, object_t *o, int amt, cell_t *where, int sp if (!isknown(o)) makeknown(o->type->id); } explodecells(thrower->cell, roll(diebuf), B_FALSE, o, 1, DT_COMPASS, B_FALSE); + } else if (o->type->id == OT_ASHINVIS) { + int radius; + char buf[BUFLEN]; + // make everyone invisible + sprintf(buf, "%s dispers%s into twinkling light!", obname, (amt == 1) ? "es" : "e" ); + + if (haslos(player, srcloc)) { + if (!isknown(o)) makeknown(o->type->id); + } + radius = o->amt * 2; + if (radius > 10) radius = 10; + + spellcloud(srcloc, radius, UNI_SHADELIGHT, C_RANDOM, OT_S_INVISIBILITY, radius, B_TRUE, buf, "A cloud of twinkling lights appear!"); } else if (o->type->id == OT_ASHSLEEP) { int radius; char buf[BUFLEN]; diff --git a/vault.c b/vault.c index 2c9bd31..e3a1948 100644 --- a/vault.c +++ b/vault.c @@ -401,18 +401,26 @@ int addvaultthing(cell_t *c, vault_t *v, enum VAULTTHING vt, char *what) { rv = B_TRUE; } // first lifeform in a shop is the shopkeeper + /* if (lf && hasflag(v->flags, F_VAULTISSHOP)) { if (!findshopkeeper(c->map, getroomid(c))) { givejob(lf, J_SHOPKEEPER); } } - if (lf && streq(v->id, "inn") ) { + */ + if (lf && hasflag(v->flags, F_MONSTERSSTAY)) { addflag(lf->flags, F_STAYINROOM, getroomid(c), NA, NA, NULL); } break; case VT_CELL: - ct = findcelltypebyname(what); - setcelltype(c, ct ? ct->id : c->map->habitat->emptycelltype); + if (streq(what, "EMPTY")) { + ct = findcelltype(getmapempty(c->map)); + } else if (streq(what, "SOLID")) { + ct = findcelltype(getmapsolid(c->map)); + } else { + ct = findcelltypebyname(what); + } + setcelltype(c, ct ? ct->id : getmapempty(c->map)); break; default: break; @@ -1383,6 +1391,9 @@ int handleline(vault_t *v, char *line) { } else { dblog("vault flag mayflipy isnt valid for vaults with random maps."); } + } else if (streq(line, "monstersstay")) { + addflag(v->flags, F_MONSTERSSTAY, B_TRUE, NA, NA, NULL); + ok = B_TRUE; } else if (streq(line, "nolink")) { addflag(v->flags, F_VAULTNOLINK, B_TRUE, NA, NA, NULL); ok = B_TRUE; @@ -1424,9 +1435,11 @@ int handleline(vault_t *v, char *line) { } else if (streq(line, "playerstart")) { addflag(v->flags, F_VAULTISPLAYERSTART, B_TRUE, NA, NA, NULL); ok = B_TRUE; + /* } else if (streq(line, "shop")) { addflag(v->flags, F_VAULTISSHOP, B_TRUE, NA, NA, NULL); ok = B_TRUE; + */ } else if (strstarts(line, "tag:")) { char *p; p = line + 4; @@ -1668,6 +1681,9 @@ int vaultthingok(enum VAULTTHING vt, char *what) { } break; case VT_CELL: + if (streq(what, "EMPTY") || streq(what, "SOLID")) { + return B_TRUE; + } ct = findcelltypebyname(what); if (ct) return B_TRUE; break;