All auto-generated monsters in ice caves should start with cold immunity.
This commit is contained in:
parent
e698875655
commit
6a7175a8d3
1
defs.h
1
defs.h
|
@ -4964,6 +4964,7 @@ typedef struct habitat_s {
|
|||
enum OBTYPE upstairtype, downstairtype;
|
||||
int stairsinrooms;
|
||||
enum CELLTYPE emptycelltype,solidcelltype;
|
||||
struct flagpile_s *monflags; // random monsters in this habitat get these
|
||||
struct habitat_s *next, *prev;
|
||||
} habitat_t;
|
||||
|
||||
|
|
61
map.c
61
map.c
|
@ -648,6 +648,10 @@ int addrandomthing(cell_t *c, int obchance, int *nadded) {
|
|||
lf = addmonster(c, R_RANDOM, NULL, B_TRUE, 1, B_TRUE, B_ALLOWEXTRA, nadded);
|
||||
if (lf) {
|
||||
rv = TT_MONSTER;
|
||||
if (c->habitat) {
|
||||
// ensure it has proper resistances
|
||||
copyflags(lf->flags, c->habitat->monflags, NA);
|
||||
}
|
||||
}
|
||||
//if (gamemode == GM_GAMESTARTED) checkallflags(player->cell->map); // debugging
|
||||
}
|
||||
|
@ -5866,6 +5870,31 @@ void killcell(cell_t **c) {
|
|||
// }
|
||||
}
|
||||
|
||||
void killbranch(branch_t *b) {
|
||||
branch_t *nextone, *lastone;
|
||||
// free mem
|
||||
free(b->name);
|
||||
|
||||
// remove from list
|
||||
nextone = b->next;
|
||||
if (nextone != NULL) {
|
||||
nextone->prev = b->prev;
|
||||
} else { /* last */
|
||||
lastbranch = b->prev;
|
||||
}
|
||||
|
||||
if (b->prev == NULL) {
|
||||
/* first */
|
||||
nextone = b->next;
|
||||
free(firstbranch);
|
||||
firstbranch = nextone;
|
||||
} else {
|
||||
lastone = b->prev;
|
||||
free (lastone->next );
|
||||
lastone->next = nextone;
|
||||
}
|
||||
}
|
||||
|
||||
void killcelltype(celltype_t *ct) {
|
||||
celltype_t *nextone, *lastone;
|
||||
if (ct->name) free(ct->name);
|
||||
|
@ -5896,6 +5925,33 @@ void killfakes(map_t *map, cell_t *cell) {
|
|||
free(map->name);
|
||||
}
|
||||
|
||||
void killhabitat(habitat_t *h) {
|
||||
habitat_t *nextone, *lastone;
|
||||
// free mem
|
||||
free(h->name);
|
||||
killflagpile(h->monflags);
|
||||
h->monflags = NULL;
|
||||
|
||||
// remove from list
|
||||
nextone = h->next;
|
||||
if (nextone != NULL) {
|
||||
nextone->prev = h->prev;
|
||||
} else { /* last */
|
||||
lasthabitat = h->prev;
|
||||
}
|
||||
|
||||
if (h->prev == NULL) {
|
||||
/* first */
|
||||
nextone = h->next;
|
||||
free(firsthabitat);
|
||||
firsthabitat = nextone;
|
||||
} else {
|
||||
lastone = h->prev;
|
||||
free (lastone->next );
|
||||
lastone->next = nextone;
|
||||
}
|
||||
}
|
||||
|
||||
void killmap(map_t *m) {
|
||||
map_t *nextone, *lastone;
|
||||
int i;
|
||||
|
@ -8812,10 +8868,12 @@ object_t *hastrailof(obpile_t *op, lifeform_t *lf, int oid, flag_t **tflag, life
|
|||
|
||||
|
||||
void initmap(void) {
|
||||
habitat_t *h;
|
||||
// habitats
|
||||
// thingchance, obchance, vaultchance, maxvisrange, upstiartype, downstairtype, stairs_in_rooms,temp
|
||||
addhabitat(H_DUNGEON, "dungeon", CT_CORRIDOR, CT_WALL, 5, 60, 40, 6, OT_STAIRSUP, OT_STAIRSDOWN, B_TRUE, T_NORMAL);
|
||||
addhabitat(H_ICECAVE, "ice cavern", CT_CORRIDOR, CT_WALLICE, 10, 45, 20, 6, OT_ICESTAIRSUP, OT_ICESTAIRSDOWN, B_FALSE, T_COLD);
|
||||
h = addhabitat(H_ICECAVE, "ice cavern", CT_CORRIDOR, CT_WALLICE, 10, 45, 20, 6, OT_ICESTAIRSUP, OT_ICESTAIRSDOWN, B_FALSE, T_COLD);
|
||||
addflag(h->monflags, F_DTIMMUNE, DT_COLD, B_TRUE, NA, NULL);
|
||||
addhabitat(H_CAVE, "cave", CT_DIRT, CT_WALLDIRT, 5, 45, 20, 6, OT_TUNNELUP, OT_TUNNELDOWN, B_FALSE, T_NORMAL);
|
||||
addhabitat(H_FOREST, "forest", CT_GRASS, CT_WALLTREE, 5, 75, 0, MAXVISRANGE, OT_TREEUP, OT_TREEDOWN, B_FALSE, T_NORMAL);
|
||||
addhabitat(H_HEAVEN, "heaven", CT_CORRIDOR, CT_WALLGLASS, 5, 0, 0, MAXVISRANGE, OT_NONE, OT_NONE, B_FALSE, T_NORMAL);
|
||||
|
@ -8874,6 +8932,7 @@ void initmap(void) {
|
|||
addbranch(BH_WOODS, "The Sylvan Woods", B_TRUE, H_FOREST, 3, 3, D_DOWN, B_TRUE, 1, B_FALSE);
|
||||
addbranch(BH_MASTERVAULTS, "The Master Vaults", B_TRUE, H_MASTERVAULTS, 3, 1, D_DOWN, B_TRUE, 5, B_TRUE);
|
||||
addbranch(BH_ICECAVERNS, "The Ice Caverns", B_TRUE, H_ICECAVE, 1, 1, D_DOWN, B_TRUE, 10, B_FALSE);
|
||||
|
||||
// minor branches
|
||||
addbranch(BH_PIT, "A Pit", B_FALSE, H_PIT, 1, 1, D_DOWN, B_FALSE, 0, B_TRUE);
|
||||
addbranch(BH_SEWER, "A Sewer", B_FALSE, H_SEWER, 1, 0, D_NONE, B_FALSE, 2, B_TRUE);
|
||||
|
|
2
map.h
2
map.h
|
@ -185,9 +185,11 @@ int isoutdoors(map_t *m);
|
|||
int isroom(cell_t *c);
|
||||
int issolid(cell_t *c);
|
||||
int iswallindir(cell_t *cell, int dir);
|
||||
void killbranch(branch_t *b);
|
||||
void killcell(cell_t **c);
|
||||
void killcelltype(celltype_t *ct);
|
||||
void killfakes(map_t *map, cell_t *cell);
|
||||
void killhabitat(habitat_t *h);
|
||||
void killmap(map_t *m);
|
||||
void killregion(region_t *r);
|
||||
int linkexit(cell_t *c, int wantfilled, int *ncellsadded);
|
||||
|
|
2
nexus.c
2
nexus.c
|
@ -914,6 +914,8 @@ void cleanup(void) {
|
|||
while (firstoption) killoption(firstoption);
|
||||
// free maps (this will kill its lifeforms & obs & cells too)
|
||||
while (firstmap) killmap(firstmap);
|
||||
// free branches
|
||||
while (firstbranch) killbranch(firstbranch);
|
||||
// free knowledge
|
||||
while (knowledge) killknowledge(knowledge);
|
||||
// free brands
|
||||
|
|
Loading…
Reference in New Issue