product:: land generation for various lands

This commit is contained in:
Zeno Rogue 2019-08-19 14:29:10 +02:00
parent d91adc45a5
commit db42409878
2 changed files with 24 additions and 7 deletions

View File

@ -262,7 +262,7 @@ EX void giantLandSwitch(cell *c, int d, cell *from) {
}
}
}
else if(hyperbolic_not37 || fulltorus || S7 < 5 || archimedean || WDIM == 3) {
else if(PIU(hyperbolic_not37 || fulltorus || S7 < 5 || archimedean || WDIM == 3)) {
if(fargen) {
int i = hrand(100);
if(i < 10)
@ -314,12 +314,17 @@ EX void giantLandSwitch(cell *c, int d, cell *from) {
}
if(d == 8 && !sphere) {
if(prod && polarb50(c) && (product::get_where(c).second & 3) == 2) {
c->wall = waPalace;
break;
}
// note: Princess Challenge brings back the normal Palace generation
bool lookingForPrincess = !euclid && c->master->alt && !princess::challenge;
bool pgate = false;
if(PURE) {
if(PURE || GOLDBERG) {
int i = fiftyval049(c->master->c7);
if(i >= 8 && i <= 14 && !polarb50(c->master->c7)) pgate = true;
if(GOLDBERG) {
@ -348,17 +353,19 @@ EX void giantLandSwitch(cell *c, int d, cell *from) {
if(GOLDBERG) ;
else {
int q = 0, s = 0;
if(!ishept(c)) for(int i=0; i<c->type; i++)
if(!ishept(c)) for(int i=0; i<c->type - (prod ? 2 : 0); i++)
if(cdist50(c->move(i)) == 3 && polarb50(c->move(i)) && !ishept(c->move(i)))
q++, s += i;
if(q == 1 && c->move(s)->land == laPalace) {
switch(princess::generating ? 0 : hrand(2)) {
case 0:
c->wall = waClosedGate;
if(prod) toggleGates(c, waClosePlate, 1);
c->move(s)->wall = waClosedGate;
break;
case 1:
c->wall = waOpenGate;
if(prod) toggleGates(c, waOpenPlate, 1);
c->move(s)->wall = waOpenGate;
break;
}
@ -697,6 +704,7 @@ EX void giantLandSwitch(cell *c, int d, cell *from) {
else if(v == 25 || v == 59 || v == 27 || v == 57)
c->wall = waVineHalfB;
else c->wall = waNone;
if(prod && cellHalfvine(c)) c->wall = waNone;
if(NONSTDVAR && cellHalfvine(c)) {
c->wall = waNone;
forCellCM(c2, c) if(emeraldval(c2) == (v^1))
@ -1257,7 +1265,7 @@ EX void giantLandSwitch(cell *c, int d, cell *from) {
break;
case laStorms: {
bool randstorm = hyperbolic_not37 || NONSTDVAR || (quotient && geometry != gZebraQuotient);
bool randstorm = PIU(hyperbolic_not37 || NONSTDVAR || (quotient && geometry != gZebraQuotient));
if(fargen) {
if(fulltorus) {
@ -1323,6 +1331,13 @@ EX void giantLandSwitch(cell *c, int d, cell *from) {
while(i) { if(i&1) b++; i>>=1; }
if(ctof(c) && (b&1) && hrand(100) < 20) c->wall = (z&2) ? waCharged : waGrounded;
}
else if(prod) {
cell *c1 = product::get_where(c).first;
if(among(c1->wall, waCharged, waGrounded))
c->wall = c1->wall;
else if(hrand(100) < 15)
c->wall = waSandstone;
}
else {
int i = zebra40(c);
if(c->wall);

View File

@ -747,12 +747,14 @@ EX void generateSnake(cell *c, int i, int snakecolor) {
if(c3->monst || c3->bardir != NODIR || c3->wall) break;
c2 = c3;
c2->monst = moHexSnakeTail; c2->hitpoints = snakecolor;
i = (j + (c2->type%4 == 0 ? c2->type/2 : (len%2 ? 2 : c2->type - 2))) % c2->type;
int t = c2->type;
if(prod) t -= 2;
i = (j + (t%4 == 0 ? t/2 : (len%2 ? 2 : t - 2))) % t;
createMov(c2, i);
if(!inpair(c2->move(i), cpair)) {
vector<int> goodsteps;
{for(int i=0; i<c2->type; i++)
if(inpair(c2->move(i), cpair))
{for(int i=0; i<t; i++)
if(inpair(c2->cmove(i), cpair))
goodsteps.push_back(i);}
if(!isize(goodsteps)) break;
i = goodsteps[hrand(isize(goodsteps))];