tested, working.

many extensions, hellhole should probably be renamed.
develop
zilpin 2010-10-21 19:00:12 -04:00
parent 30b94dac87
commit e2d776d23f
1 changed files with 46 additions and 25 deletions

@ -41,8 +41,8 @@ void waitmsec (int delay)
X(pitTypeEerie,"Bottomless Eerie Pit" ) \ X(pitTypeEerie,"Bottomless Eerie Pit" ) \
X(pitTypeFloor,"Pit with floor" ) \ X(pitTypeFloor,"Pit with floor" ) \
X(pitTypeSolid,"Solid Pillar" ) \ X(pitTypeSolid,"Solid Pillar" ) \
X(pitTypeOasis,"Oasis, with partial aquifer (no hell access)" ) \ X(pitTypeOasis,"Oasis Pit (ends at magma, no hell access)" ) \
X(pitTypeOPool,"Oasis Pool, with partial aquifer (default 5 deep)" ) \ X(pitTypeOPool,"Oasis Pool, with partial aquifer (default 5 z-levels)" ) \
X(pitTypeMagma,"Magma Pit (similar to volcano, no hell access)" ) \ X(pitTypeMagma,"Magma Pit (similar to volcano, no hell access)" ) \
X(pitTypeMPool,"Magma Pool (default 5 z-levels)" ) X(pitTypeMPool,"Magma Pool (default 5 z-levels)" )
//end PITTYPEMACRO //end PITTYPEMACRO
@ -305,34 +305,43 @@ int main (void)
floor=344; floor=344;
floorvar=3; floorvar=3;
break; break;
case pitTypeSolid:
holeradius=0;
wallthickness=7;
wallpillar=4;
break;
case pitTypeOasis: case pitTypeOasis:
stopatmagma=-1; stopatmagma=-1;
//fillwater=-1; fillwater=-1;
holeradius=5;
wallthickness=2; wallthickness=2;
aquify=-1; //aquify=-1;
floor=340; floor=340;
floorvar=3; floorvar=3;
break; break;
case pitTypeOPool: case pitTypeOPool:
//fillwater=-1; pitdepth=5;
fillwater=-1;
holeradius=5;
wallthickness=2; wallthickness=2;
aquify=-1; //aquify=-1;
floor=340; floor=340;
floorvar=3; floorvar=3;
break; break;
case pitTypeMagma: case pitTypeMagma:
stopatmagma=-1; stopatmagma=-1;
exposemagma=-1; exposemagma=-1;
wallthickness=2;
fillmagma=-1; fillmagma=-1;
floor=264; floor=264;
break; break;
case pitTypeMPool: case pitTypeMPool:
pitdepth=5;
wallthickness=2;
fillmagma=-1; fillmagma=-1;
floor=340; floor=340;
floorvar=3; floorvar=3;
break; break;
default:
floor=35;
} }
@ -362,12 +371,13 @@ int main (void)
//Stop when magma sea is hit? //Stop when magma sea is hit?
stopatmagma=getyesno("Stop at magma sea?",stopatmagma); stopatmagma=getyesno("Stop at magma sea?",stopatmagma);
exposemagma=getyesno("Expose magma sea (no walls)?",exposemagma);
//Fill? //Fill?
fillmagma=getyesno("Fill with magma?",fillmagma); fillmagma=getyesno("Fill with magma?",fillmagma);
if(fillmagma) aquify=fillwater=0; if(fillmagma) aquify=fillwater=0;
fillwater=getyesno("Fill with water?",fillwater); fillwater=getyesno("Fill with water?",fillwater);
aquify=getyesno("Aquifer?",aquify); //aquify=getyesno("Aquifer?",aquify);
/////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////
@ -375,12 +385,14 @@ int main (void)
//If a settings struct existed, this could be in a routine //If a settings struct existed, this could be in a routine
printf("Using Settings:\n"); printf("Using Settings:\n");
printf("Pit Type......: %d = %s\n", pittype, pitTypeDesc[pittype]); printf("Pit Type......: %d = %s\n", pittype, pitTypeDesc[pittype]);
printf("Depth.........: %d\n", pitdepth);
printf("Hole Radius...: %d\n", holeradius); printf("Hole Radius...: %d\n", holeradius);
printf("Wall Thickness: %d\n", wallthickness); printf("Wall Thickness: %d\n", wallthickness);
printf("Pillars, Hole.: %d\n", holepillar); printf("Pillars, Hole.: %d\n", holepillar);
printf("Pillars, Wall.: %d\n", wallpillar); printf("Pillars, Wall.: %d\n", wallpillar);
printf("Expose Hell...: %c\n", (exposehell?'Y':'N') ); printf("Expose Hell...: %c\n", (exposehell?'Y':'N') );
printf("Stop at Magma.: %c\n", (stopatmagma?'Y':'N') ); printf("Stop at Magma.: %c\n", (stopatmagma?'Y':'N') );
printf("Expose Magma..: %c\n", (exposemagma?'Y':'N') );
printf("Magma Fill....: %c\n", (fillmagma?'Y':'N') ); printf("Magma Fill....: %c\n", (fillmagma?'Y':'N') );
printf("Water Fill....: %c\n", (fillwater?'Y':'N') ); printf("Water Fill....: %c\n", (fillwater?'Y':'N') );
printf("Aquifer.......: %c\n", (aquify?'Y':'N') ); printf("Aquifer.......: %c\n", (aquify?'Y':'N') );
@ -582,7 +594,7 @@ int main (void)
t_designation * d; t_designation * d;
////////////////////////////////////// //////////////////////////////////////
//From top to bottom, dig this dude. //From top to bottom, dig this thing.
////////////////////////////////////// //////////////////////////////////////
//Top level, cap. //Top level, cap.
@ -646,8 +658,10 @@ int main (void)
} }
//Pre-process this z-level, to get some tile statistics. //Pre-process this z-level, to get some tile statistics.
for(int32_t x=0;x<16;++x){ for(int32_t x=0;x<16;++x)
for(int32_t y=0;y<16;++y){ {
for(int32_t y=0;y<16;++y)
{
t=0; t=0;
tp = getTileTypeP(block.tiletypes[x][y]); tp = getTileTypeP(block.tiletypes[x][y]);
d = &block.designation[x][y]; d = &block.designation[x][y];
@ -764,6 +778,11 @@ int main (void)
d = &block.designation[x][y]; d = &block.designation[x][y];
tpat=pattern[x][y]; tpat=pattern[x][y];
//Up front, remove aquifer, to prevent bugginess
//It may be added back if aquify is set.
d->bits.water_table=0;
//Change behaviour based on settings and stats from this z-level //Change behaviour based on settings and stats from this z-level
//In hell? //In hell?
@ -778,7 +797,6 @@ int main (void)
//Leave certain tiles unchanged. //Leave certain tiles unchanged.
switch( tp->m ){ switch( tp->m ){
case MAGMA: case MAGMA:
case VEIN:
case FEATSTONE: case FEATSTONE:
case HFS: case HFS:
tpat=0; tpat=0;
@ -807,8 +825,8 @@ int main (void)
//d->bits.skyview = topblock.designation[x][y].bits.skyview; //d->bits.skyview = topblock.designation[x][y].bits.skyview;
//d->bits.subterranean = topblock.designation[x][y].bits.subterranean; //d->bits.subterranean = topblock.designation[x][y].bits.subterranean;
//Erase special markers //Erase special markers?
d->bits.feature_global = d->bits.feature_local = 0; //d->bits.feature_global = d->bits.feature_local = 0;
//Water? Magma? //Water? Magma?
if(fillmagma || fillwater){ if(fillmagma || fillwater){
@ -838,7 +856,7 @@ int main (void)
t=wmolten; t=wmolten;
break; break;
case HFS: case HFS:
t=whell; //t=whell;
break; break;
case VEIN: case VEIN:
t=440; //Solid vein block t=440; //Solid vein block
@ -861,6 +879,7 @@ int main (void)
case feature_Underworld: case feature_Underworld:
case feature_Hell_Temple: case feature_Hell_Temple:
//Whatever the feature is made of. "featstone wall" //Whatever the feature is made of. "featstone wall"
d->bits.feature_global = 0;
d->bits.feature_local = 1; d->bits.feature_local = 1;
t=335; t=335;
break; break;
@ -902,7 +921,9 @@ int main (void)
case 3: case 3:
//No obsidian walls on bottom of map! //No obsidian walls on bottom of map!
if(z<1) continue; if(z<1 && (d->bits.feature_global || d->bits.feature_local) ) {
t=335;
}
//Special wall, always sets to obsidian, to give a stairway //Special wall, always sets to obsidian, to give a stairway
t=331; t=331;
@ -930,8 +951,6 @@ int main (void)
//unlock fluids, so they fall down the pit. //unlock fluids, so they fall down the pit.
d->bits.flow_forbid = d->bits.liquid_static=0; d->bits.flow_forbid = d->bits.liquid_static=0;
block.blockflags.bits.liquid_1 = block.blockflags.bits.liquid_2 = 1; block.blockflags.bits.liquid_1 = block.blockflags.bits.liquid_2 = 1;
//Remove aquifer, to prevent bugginess
d->bits.water_table=0;
//Set the tile. //Set the tile.
block.tiletypes[x][y] = t; block.tiletypes[x][y] = t;
@ -961,7 +980,9 @@ int main (void)
/////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////
//The bottom level is special. //The bottom level is special.
if(-1){ if(-1){
Mapz->ReadBlock40d( bx, by, z , &block ); if(!Mapz->ReadBlock40d( bx, by, z , &block )){
cout << "Bad block! " << bx << "," << by << "," << z << endl;
}
for(uint32_t x=0;x<16;++x){ for(uint32_t x=0;x<16;++x){
for(uint32_t y=0;y<16;++y){ for(uint32_t y=0;y<16;++y){
t=floor; t=floor;
@ -1048,10 +1069,10 @@ int main (void)
} }
} }
//Write the block. //Write the block.
Mapz->WriteBlockFlags(bx,by,0, block.blockflags ); Mapz->WriteBlockFlags(bx,by,z, block.blockflags );
Mapz->WriteDesignations(bx,by,0, &block.designation ); Mapz->WriteDesignations(bx,by,z, &block.designation );
Mapz->WriteTileTypes(bx,by,0, &block.tiletypes ); Mapz->WriteTileTypes(bx,by,z, &block.tiletypes );
Mapz->WriteDirtyBit(bx,by,0,1); Mapz->WriteDirtyBit(bx,by,z,1);
} }