mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-10-11 20:57:41 +00:00
factored elementalXY
This commit is contained in:
28
bigstuff.cpp
28
bigstuff.cpp
@@ -822,16 +822,7 @@ void setLandQuotient(cell *c) {
|
||||
if(specialland == laWestWall) c->land = laCrossroads4;
|
||||
}
|
||||
|
||||
void setLandSphere(cell *c) {
|
||||
setland(c, specialland);
|
||||
if(specialland == laWarpCoast)
|
||||
setland(c, getHemisphere(c, 0) > 0 ? laWarpCoast : laWarpSea);
|
||||
if(specialland == laWestWall) c->land = laCrossroads4;
|
||||
if(specialland == laClearing)
|
||||
c->land = laClearing;
|
||||
if(specialland == laElementalWall) {
|
||||
int x = getHemisphere(c, 1);
|
||||
int y = getHemisphere(c, 2);
|
||||
void elementalXY(cell *c, int x, int y, bool make_wall) {
|
||||
if(x > 0 && y > 0) setland(c, laEFire);
|
||||
else if(x > 0 && y < 0) setland(c, laEAir);
|
||||
else if(x < 0 && y < 0) setland(c, laEWater);
|
||||
@@ -844,9 +835,24 @@ void setLandSphere(cell *c) {
|
||||
c->land = laElementalWall, c->barleft = laEEarth, c->barright = laEFire;
|
||||
else if(y < 0)
|
||||
c->land = laElementalWall, c->barleft = laEAir, c->barright = laEWater;
|
||||
if(c->land == laElementalWall && (c->type != 6 || GOLDBERG))
|
||||
if(x == 0 && y == 0)
|
||||
c->land = laElementalWall, c->wall = waBarrier;
|
||||
else if(c->land == laElementalWall && make_wall)
|
||||
c->wall = getElementalWall(hrand(2) ? c->barleft : c->barright);
|
||||
}
|
||||
|
||||
void setLandSphere(cell *c) {
|
||||
setland(c, specialland);
|
||||
if(specialland == laWarpCoast)
|
||||
setland(c, getHemisphere(c, 0) > 0 ? laWarpCoast : laWarpSea);
|
||||
if(specialland == laWestWall) c->land = laCrossroads4;
|
||||
if(specialland == laClearing)
|
||||
c->land = laClearing;
|
||||
if(specialland == laElementalWall) {
|
||||
int x = getHemisphere(c, 1);
|
||||
int y = getHemisphere(c, 2);
|
||||
elementalXY(c, x, y, (c->type != 6 || GOLDBERG));
|
||||
}
|
||||
if(!euwrap)
|
||||
if(specialland == laCrossroads || specialland == laCrossroads2 || specialland == laCrossroads3 || specialland == laTerracotta) {
|
||||
int x = getHemisphere(c, 1);
|
||||
|
Reference in New Issue
Block a user