fixed Orb of the Warp destroyed while refactoring

This commit is contained in:
Zeno Rogue 2019-04-17 00:42:51 +02:00
parent 5b87088ade
commit f507b7cf55
8 changed files with 18 additions and 15 deletions

View File

@ -1219,7 +1219,7 @@ void buildBigStuff(cell *c, cell *from) {
}
}
else if(good_for_wall(c) && isWarped(c->land) && hrand(10000) < 3000 && c->land &&
else if(good_for_wall(c) && isWarpedType(c->land) && hrand(10000) < 3000 && c->land &&
buildBarrierNowall(c, eLand(c->land ^ laWarpSea ^ laWarpCoast))) ;
else if(good_for_wall(c) && c->land == laCrossroads4 && hrand(10000) < 7000 && c->land && !c->master->alt && !tactic::on && !racing::on &&

View File

@ -63,7 +63,7 @@ LANDFLAGCHECK(generateAll, flag & LF_GENERATE_ALL)
LANDFLAGCHECK(isIcyLand, flag & LF_ICY)
LANDFLAGCHECK(isGravityLand, flag & LF_GRAVITY)
LANDFLAGCHECK(isEquidLand, flag & LF_EQUI)
LANDFLAGCHECK(isWarped, flag & LF_WARPED)
LANDFLAGCHECK(isWarpedType, flag & LF_WARPED)
LANDFLAGCHECK(isCyclic, flag & LF_CYCLIC)
LANDFLAGCHECK(isTechnicalLand, flag & LF_TECHNICAL)
LANDFLAGCHECK(is_mirrorland, flag & LF_MIRROR)

View File

@ -455,6 +455,9 @@ eGravity get_move_gravity(cell *c, cell *c2) {
}
}
bool isWarped(cell *c) {
return isWarpedType(c->land) || (!inmirrororwall(c->land) && (items[itOrb37] && c->cpdist <= 4));
}
bool nonAdjacent(cell *c, cell *c2) {
if(isWarped(c) && isWarped(c2) && warptype(c) == warptype(c2)) {
@ -1791,7 +1794,7 @@ bool snakepile(cell *c, eMonster m) {
else if(doesFall(c)) return false;
else if((c->wall == waSea && c->land == laLivefjord))
c->wall = waNone;
else if((c->wall == waSea && isWarped(c->land)))
else if((c->wall == waSea && isWarpedType(c->land)))
c->wall = waNone;
else if(isGravityLand(c->land)) {
if(m == moHexSnake)
@ -2113,7 +2116,7 @@ void killMonster(cell *c, eMonster who, flagtype deathflags) {
if(isRatling(m) && c->wall == waBoat) {
bool avenge = false;
for(int i=0; i<c->type; i++) if(!isWarped(c->move(i)->land))
for(int i=0; i<c->type; i++) if(!isWarpedType(c->move(i)->land))
avenge = true;
if(avenge) { avengers += 2; }
}
@ -3093,7 +3096,7 @@ void bfs() {
cell *c2 = c->move(i);
if(!c2) continue;
if(isWarped(c2->land)) havewhat |= HF_WARP;
if(isWarpedType(c2->land)) havewhat |= HF_WARP;
if(c2->land == laMirror) havewhat |= HF_MIRROR;
if((c->wall == waBoat || c->wall == waSea) &&

View File

@ -3085,7 +3085,7 @@ void setcolors(cell *c, color_t& wcol, color_t& fcol) {
fcol = 0x0000C0 + int(32 * sintick(200, ((eubinary||c->master->alt) ? celldistAlt(c) : 0)*.75/M_PI));
else if(c->land == laLivefjord)
fcol = 0x000080;
else if(isWarped(c->land))
else if(isWarpedType(c->land))
fcol = 0x0000C0 + int((warptype(c)?30:-30) * sintick(600));
else
fcol = wcol;
@ -3400,7 +3400,7 @@ void setcolors(cell *c, color_t& wcol, color_t& fcol) {
default:
if(isElemental(c->land)) fcol = linf[c->land].color;
if(isWarped(c->land)) {
if(isWarpedType(c->land)) {
fcol = warptype(c) ? 0x80C080 : 0xA06020;
if(c->wall == waSmallTree) wcol = 0x608000;
}
@ -4605,7 +4605,7 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
set_floor(shFloor);
}
else if(randomPatternsMode && c->land != laBarrier && !isWarped(c->land)) {
else if(randomPatternsMode && c->land != laBarrier && !isWarpedType(c->land)) {
int j = (randompattern[c->land]/5) % 15;
int k = randompattern[c->land] % RPV_MODULO;
int k7 = randompattern[c->land] % 7;

View File

@ -864,7 +864,7 @@ void describeMouseover() {
if(rosedist(c) || c->land == laRose || c->wall == waRose)
appendHelp(string("\n\n") + rosedesc);
if(isWarped(c) && !isWarped(c->land))
if(isWarped(c) && !isWarpedType(c->land))
out += ", warped";
if(isWarped(c)) {

View File

@ -3074,7 +3074,7 @@ int cdist50(cell *c);
bool polarb50(cell *c);
bool isGravityLand(eLand l);
bool isWarped(eLand l);
bool isWarpedType(eLand l);
bool isWarped(cell *c);
struct hrmap {

View File

@ -1727,7 +1727,7 @@ void giantLandSwitch(cell *c, int d, cell *from) {
c->wall = waSmallTree;
int q = 0;
if(BITRUNCATED && !chaosmode && !weirdhyperbolic) for(int i=0; i<c->type; i++)
if(c->move(i) && !isWarped(c->move(i)->land) && c->move(i)->land != laCrossroads4)
if(c->move(i) && !isWarpedType(c->move(i)->land) && c->move(i)->land != laCrossroads4)
q++;
if(q == 1) c->wall = waWarpGate;
}
@ -1736,7 +1736,7 @@ void giantLandSwitch(cell *c, int d, cell *from) {
c->wall = waSea;
int q = 0;
if(BITRUNCATED && !chaosmode) for(int i=0; i<c->type; i++)
if(c->move(i) && !isWarped(c->move(i)->land)) q++;
if(c->move(i) && !isWarpedType(c->move(i)->land)) q++;
if(q == 1) c->wall = waWarpGate;
}
}

View File

@ -322,7 +322,7 @@ eLand getNewLand(eLand old) {
if(old == laDragon && tortoise::seek() && hrand(100) < 50)
return laTortoise;
if(isWarped(old) && (hrand(100) < 25) && chaosmode) return eLand(old ^ laWarpCoast ^ laWarpSea);
if(isWarpedType(old) && (hrand(100) < 25) && chaosmode) return eLand(old ^ laWarpCoast ^ laWarpSea);
if(createOnSea(old))
return getNewSealand(old);
@ -788,11 +788,11 @@ land_validity_t& land_validity(eLand l) {
if(l == laWhirlpool && a4)
return dont_work;
if(isWarped(l) && a4 && GOLDBERG)
if(isWarpedType(l) && a4 && GOLDBERG)
return dont_work;
#if CAP_IRR
if((isWarped(l) || l == laDual) && IRREGULAR && !irr::bitruncations_performed)
if((isWarpedType(l) || l == laDual) && IRREGULAR && !irr::bitruncations_performed)
return dont_work;
if(IRREGULAR && among(l, laPrairie, laMirror, laMirrorOld))