mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-02-22 14:00:13 +00:00
replaced TEMPLE_EACH with function temple_layer_size()
This commit is contained in:
parent
7f09bb6259
commit
9d88528939
15
bigstuff.cpp
15
bigstuff.cpp
@ -1661,6 +1661,17 @@ EX int masterAlt(cell *c) {
|
||||
return c->master->alt->distance;
|
||||
}
|
||||
|
||||
/** the distance between two layers of Temple of Cthulhu */
|
||||
EX int temple_layer_size() {
|
||||
if(among(geometry, gHoroRec, gHoroHex, gKiteDart3)) return 3;
|
||||
if(sol) return 6;
|
||||
if(WDIM == 3 && bt::in()) return 2;
|
||||
if(geometry == gSpace435) return 4;
|
||||
if(WDIM == 3 && hyperbolic) return 3;
|
||||
if(S3 == OINF) return 4;
|
||||
return 6;
|
||||
}
|
||||
|
||||
EX void moreBigStuff(cell *c) {
|
||||
|
||||
if((bearsCamelot(c->land) && !euclid && !quotient && !nil) || c->land == laCamelot)
|
||||
@ -1709,7 +1720,7 @@ EX void moreBigStuff(cell *c) {
|
||||
if(d <= 0) {
|
||||
c->land = laTemple, c->wall = waNone, c->monst = moNone, c->item = itNone;
|
||||
}
|
||||
if(d % TEMPLE_EACH==0) {
|
||||
if(d % temple_layer_size()==0) {
|
||||
c->landparam = 0;
|
||||
if(geometry == gSpace534) {
|
||||
int i = 0;
|
||||
@ -1752,7 +1763,7 @@ EX void moreBigStuff(cell *c) {
|
||||
int q = 0;
|
||||
for(int t=0; t<c->type; t++) {
|
||||
createMov(c, t);
|
||||
if(celldistAlt(c->move(t)) % TEMPLE_EACH == 0 && !ishept(c->move(t))) q++;
|
||||
if(celldistAlt(c->move(t)) % temple_layer_size() == 0 && !ishept(c->move(t))) q++;
|
||||
}
|
||||
if(q == 2) c->wall = waColumn;
|
||||
}
|
||||
|
@ -272,7 +272,7 @@ void celldrawer::setcolors() {
|
||||
int d = showoff ? 0 : (eubinary||c->master->alt) ? celldistAlt(c) : 99;
|
||||
if(chaosmode)
|
||||
fcol = 0x405090;
|
||||
else if(d % TEMPLE_EACH == 0)
|
||||
else if(d % temple_layer_size() == 0)
|
||||
fcol = gradient(0x304080, winf[waColumn].color, 0, 0.5, 1);
|
||||
// else if(c->type == 7)
|
||||
// wcol = 0x707070;
|
||||
|
@ -492,7 +492,7 @@ EX void placeItems(int qty, eItem it) {
|
||||
EX bool cantGetGrimoire(cell *c2, bool verbose IS(true)) {
|
||||
if(chaosmode) return false;
|
||||
if(!eubinary && !c2->master->alt) return false;
|
||||
if(c2->item == itGrimoire && items[itGrimoire] > celldistAlt(c2)/-TEMPLE_EACH) {
|
||||
if(c2->item == itGrimoire && items[itGrimoire] > celldistAlt(c2)/-temple_layer_size()) {
|
||||
if(verbose)
|
||||
addMessage(XLAT("You already have this Grimoire! Seek new tomes in the inner circles."));
|
||||
return true;
|
||||
|
10
landgen.cpp
10
landgen.cpp
@ -1497,12 +1497,12 @@ EX void giantLandSwitch(cell *c, int d, cell *from) {
|
||||
chaosmode ? -15 * items[itGrimoire]:
|
||||
(eubinary || c->master->alt) ? celldistAlt(c) : 10;
|
||||
// remember: d is negative
|
||||
if(chaosmode ? hrand(100) < 25 : d % TEMPLE_EACH == 0) {
|
||||
if(chaosmode ? hrand(100) < 25 : d % temple_layer_size() == 0) {
|
||||
if(hrand_monster(5000) < 20 - 2*d && !c->monst && !peace::on)
|
||||
c->monst = moTentacle, c->mondir = NODIR;
|
||||
}
|
||||
else {
|
||||
// int d0 = d % TEMPLE_EACH;
|
||||
// int d0 = d % temple_layer_size();
|
||||
// if(d0<0) d0=-d0;
|
||||
if(hrand(100) < (peace::on ? 15 : 30) && WDIM == 2)
|
||||
c->wall = waBigStatue;
|
||||
@ -1512,7 +1512,7 @@ EX void giantLandSwitch(cell *c, int d, cell *from) {
|
||||
c->monst = moCultistLeader;
|
||||
else if(hrand(5000) < 250 && !peace::on)
|
||||
c->item = itGrimoire;
|
||||
else if(hrand(5000) < 10 && (chaosmode ? items[itGrimoire] >= treasureForLocal() : -d > TEMPLE_EACH * 10) && !peace::on && !inv::on)
|
||||
else if(hrand(5000) < 10 && (chaosmode ? items[itGrimoire] >= treasureForLocal() : -d > temple_layer_size() * 10) && !peace::on && !inv::on)
|
||||
c->item = itOrbDragon;
|
||||
}
|
||||
}
|
||||
@ -2013,10 +2013,10 @@ EX void giantLandSwitch(cell *c, int d, cell *from) {
|
||||
if(d >= 8) c->wall = waSea;
|
||||
if(d == 7 && !safety) {
|
||||
bool placecolumn = false;
|
||||
if(c->landparam % TEMPLE_EACH == 0 && c->landparam <= 24) {
|
||||
if(c->landparam % temple_layer_size() == 0 && c->landparam <= 24) {
|
||||
int q = 0;
|
||||
forCellEx(c2, c)
|
||||
if(c2->landparam % TEMPLE_EACH == 0 && !pseudohept(c2)) q++;
|
||||
if(c2->landparam % temple_layer_size() == 0 && !pseudohept(c2)) q++;
|
||||
placecolumn = q == 2;
|
||||
if(placecolumn && weirdhyperbolic && !BITRUNCATED && hrand(100) >= 50)
|
||||
placecolumn = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user