mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2026-11-17 21:24:30 +00:00
CAP_FIELD part 1
This commit is contained in:
1 parent
b25730d5c9
commit
c5a771c888
15 files changed
+103
-5
No files matched your search
@@ -1087,6 +1087,7 @@ void buildBigStuff(cell *c, cell *from) {
|
||||
else if(c->land == laCrossroads2 && BITRUNCATED)
|
||||
buildCrossroads2(c);
|
||||
|
||||
#if CAP_FIELD
|
||||
else if(c->land == laPrairie && c->LHU.fi.walldist == 0 && !euclid) {
|
||||
for(int bd=0; bd<7; bd++) {
|
||||
int fval2 = createStep(c->master, bd)->fieldval;
|
||||
@@ -1097,6 +1098,7 @@ void buildBigStuff(cell *c, cell *from) {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
else if(ctof(c) && c->land && hrand(I10000) < wallchance(c, deepOcean))
|
||||
{
|
||||
|
||||
@@ -43,6 +43,7 @@ blizzardcell* getbcell(cell *c) {
|
||||
}
|
||||
|
||||
void drawBlizzards() {
|
||||
#if CAP_POLY && CAP_FIELD
|
||||
poly_outline = OUTLINE_NONE;
|
||||
auto it = blizzardcells.begin();
|
||||
bcells.clear();
|
||||
@@ -201,6 +202,7 @@ void drawBlizzards() {
|
||||
|
||||
for(auto bc: bcells)
|
||||
bc->c->listindex = bc->tmp;
|
||||
#endif
|
||||
}
|
||||
|
||||
vector<cell*> arrowtraps;
|
||||
|
||||
@@ -768,10 +768,12 @@ struct hrmap_quotient : hrmap {
|
||||
|
||||
connections.clear();
|
||||
switch(geometry) {
|
||||
#if CAP_FIELD
|
||||
case gFieldQuotient: {
|
||||
connections = currfp.connections;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
case gZebraQuotient: {
|
||||
heptspin hs(base.origin);
|
||||
@@ -1241,7 +1243,9 @@ void initcells() {
|
||||
|
||||
allmaps.push_back(currentmap);
|
||||
|
||||
#if CAP_FIELD
|
||||
windmap::create();
|
||||
#endif
|
||||
|
||||
// origin->emeraldval =
|
||||
}
|
||||
@@ -1822,8 +1826,10 @@ int celldistance(cell *c1, cell *c2) {
|
||||
return torusconfig::cyldist(decodeId(c1->master), decodeId(c2->master));
|
||||
}
|
||||
|
||||
#if CAP_FIELD
|
||||
if(geometry == gFieldQuotient && !GOLDBERG)
|
||||
return currfp.getdist(fieldpattern::fieldval(c1), fieldpattern::fieldval(c2));
|
||||
#endif
|
||||
|
||||
if(bounded) {
|
||||
|
||||
|
||||
+17
@@ -1995,12 +1995,14 @@ namespace heat {
|
||||
ld hdiff = absheat(ct) - absheat(c);
|
||||
hdiff /= 10;
|
||||
|
||||
#if CAP_FIELD
|
||||
if(ct->land == laBlizzard) {
|
||||
int v = (windmap::at(ct) - windmap::at(c)) & 255;
|
||||
if(v > 128) v -= 256;
|
||||
if(v < windmap::NOWINDFROM && v > -windmap::NOWINDFROM)
|
||||
hdiff = hdiff * (1 - v * 5. / windmap::NOWINDFROM);
|
||||
}
|
||||
#endif
|
||||
|
||||
if(shmup::on && (c->land == laCocytus || ct->land == laCocytus))
|
||||
hdiff /= 3;
|
||||
@@ -2807,6 +2809,7 @@ bool barrierhept(cell *c) {
|
||||
return c->bardir != NOBARRIERS && c->bardir != NODIR;
|
||||
}
|
||||
|
||||
#if CAP_FIELD
|
||||
namespace prairie {
|
||||
|
||||
using namespace fieldpattern;
|
||||
@@ -3075,6 +3078,14 @@ namespace prairie {
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
namespace prairie {
|
||||
bool no_worms(cell *c) { return false; }
|
||||
void treasures() { }
|
||||
void move() { }
|
||||
bool isriver(cell *c) { return false; }
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace ca {
|
||||
ld prob = .2;
|
||||
@@ -3146,10 +3157,12 @@ auto ccm = addHook(clearmemory, 0, [] () {
|
||||
clearing::bpdata.clear();
|
||||
tortoise::emap.clear();
|
||||
tortoise::babymap.clear();
|
||||
#if CAP_FIELD
|
||||
prairie::lasttreasure = NULL;
|
||||
prairie::enter = NULL;
|
||||
prairie::tchoices.clear();
|
||||
prairie::beaststogen.clear();
|
||||
#endif
|
||||
mirror::clearcache();
|
||||
}) +
|
||||
addHook(hooks_removecells, 0, [] () {
|
||||
@@ -3167,13 +3180,16 @@ auto ccm = addHook(clearmemory, 0, [] () {
|
||||
}
|
||||
return false;
|
||||
});
|
||||
#if CAP_FIELD
|
||||
set_if_removed(prairie::lasttreasure, NULL);
|
||||
set_if_removed(prairie::enter, NULL);
|
||||
eliminate_if(prairie::tchoices, is_cell_removed);
|
||||
eliminate_if(prairie::beaststogen, is_cell_removed);
|
||||
#endif
|
||||
for(auto& bpd: clearing::bpdata) set_if_removed(bpd.second.root, NULL);
|
||||
});
|
||||
|
||||
#if CAP_FIELD
|
||||
// windcode arrays precomputed for speed
|
||||
|
||||
int windcodes18920[] = {164,182,171,158,148,155,163,174,188,205,193,160,167,160,140,128,146,153,159,161,167,180,190,186,202,229,234,24,120,146,165,177,179,169,146,125,113,93,131,157,147,155,158,161,162,157,157,162,173,187,204,198,176,163,242,249,234,238,1,30,77,120,140,153,165,173,173,204,200,184,165,150,130,119,104,86,70,71,54,208,168,141,133,167,169,158,161,161,166,171,165,142,144,153,159,166,175,186,203,225,221,216,191,168,149,114,70,26,10,241,220,229,244,251,7,19,50,85,110,129,143,148,145,173,180,178,174,166,144,54,248,215,182,170,166,153,134,116,118,122,114,96,77,57,47,69,78,62,18,228,189,164,148,126,110,81,250,217,169,151,156,163,168,156,154,170,183,192,182,149,118,120,138,152,158,156,158,164,169,171,181,202,217,234,252,241,243,235,206,182,169,159,149,125,97,77,53,40,28,24,4,237,218,192,204,220,244,246,248,250,1,4,12,31,56,98,120,127,129,134,148,156,161,139,105,153,209,205,187,177,180,177,174,167,152,117,81,44,4,232,201,160,162,161,168,174,165,153,139,115,94,103,120,129,127,125,118,94,66,50,40,28,10,50,78,89,97,81,76,54,16,230,195,174,162,157,151,139,122,98,81,58,27,249,245,2,7,89,127,132,146,158,162,174,191,230,64,124,150,173,193,209,224,211,203,174,146,119,87,90,93,118,139,159,167,164,157,149,150,155,165,172,169,159,161,172,195,214,219,221,206,26,19,252,253,11,9,253,225,206,187,170,168,166,155,149,141,124,101,83,81,68,55,48,45,38,29,29,43,24,254,232,219,199,171,159,174,187,208,249,17,219,241,250,248,241,244,248,1,1,3,17,30,37,63,128,134,147,141,135,125,124,134,150,157,161,173,186,161,114,79,52,50,236,241,243,236,163,169,168,181,186,184,184,178,171,172,170,149,131,108,91,73,64,41,10,233,216,202,112,119,144,154,152,161,177,186,182,176,166,152,145,133,106,85,67,76,85,112,135,142,129,124,134,132,139,125,89,71,42,32,26,32,45,227,220,243,26,71,91,97,112,127,106,89,83,88,88,65,30,255,229,201,174,171,164,157,154,161,153,146,142,139,137,93,78,75,67,57,36,3,232,233,241,255,26,30,48,73,93,105,116,121,132,147,161,169,157,151,180,201,219,232,6,32,94,129,142,159,177,190,207,220,241,252,237,226,223,212,193,170,144,119,95,72,56,60,62,70,96,124,136,149,170,177,183,178,171,154,149,144,141,144,150,157,168,175,184,178,167,146,139,143,148,180,196,208,228,229,232,231,209,170,117,73,52,48,251,241,251,6,26,41,37,26,242,232,217,212,191,169,155,160,167,174,177,161,147,145,144,150,147,130,100,75,65,83,79,79,75,40,45,49,48,49,46,45,35,18,19,41,83,56,19,255,239,220,221,219,208,184,155,138,133,145,160,167,179,185,226,14,46,119,196,237,243,251,8,1,243,232,231,234,235,249,9,5,248,245,247,7,18,21,21,21,29,33,223,187,158,154,168,167,153,142,128,115,118,114,116,133,167,159,162,162,170,184,194,216,208,209,109,92,65,45,19,13,255,241,247,253,255,14,26,82,139,164,157,144,167,183,193,192,188,192,197,189,179,173,167,169,173,184,191,172,151,138,123,108,98,87,81,75,78,70,51,29,248,222,213,198,230,39,67,83,91,123,146,157,156,140,140,151,176,195,198,187,185,185,182,175,159,145,144,146,150,141,96,68,57,51,50,54,54,63,99,129,153,157,160,140,124,114,89,153,144,133,140,158,162,146,59,58,72,60,18,3,6,6,16,22,45,75,123,170,197,219,228,245,50,102,98,102,98,100,110,149,166,132,108,84,80,82,87,90,102,120,108,92,254,11,248,236,226,205,171,147,159,161,163,163,153,145,141,154,185,165,146,146,144,142,143,150,174,224,57,69,68,66,63,68,69,64,49,42,15,226,206,217,228,232,231,245,27,49,47,43,37,50,71,90,102,100,103,106,117,113,117,126,136,148,165,177,199,246,63,107,124,217,215,225,230,225,221,238,2,15,13,1,171,134,132,135,147,165,179,185,191,202,212,227,244,9,18,24,1,248,240,242,233,221,220,209,192,178,161,143,125,108,96,79,64,53,37,29,34,38,51,53,68,86,116,140,130,136,154,173,189,190,194,193,191,191,189,164,139,145,149,144,141,140,129,128,143,154,145,159,174,173,173,186,203,193,183,177,158,129,126,120,121,116,113,165,195,207,214,207,201,20,239,229,239,251,248,225,198,178,149,133,93,76,72,73,101,137,214,221,227,242,253,1,14,31,51,79,73,78,114,201,238,243,210,212,220,226,209,189,167,147,142,145,156,166,173,173,194,199,171,152,142,137,138,134,134,154,165,166,152,141,118,88,64,35,15,101,91,76,72,78,103,163,251,11,33,45,52,56,42,20,87,58,42,49,57,23,244,2,14,8,221,138,125,95,86,40,255,4,246,224,206,203,213,221,224,220,204,185,165,146,124,108,115,117,127,127,138,148,161,165,163,152,165,201,243,35,54,79,118,160,201,238,20,248,228,253,10,24,25,255,234,231,221,224,221,223,224,223,233,254,16,28,21,7,236,227,232,236,241,254,15,26,22,18,13,10,9,19,19,12,254,254,228,205,183,163,150,161,188,194,194,173,160,147,131,118,105,99,114,119,108,97,93,54,215,185,161,156,163,167,162,158,164,176,197,196,209,229,246,238,238,0,23,54,135,85,38,49,35,13,249,251,243,244,233,224,253,0,254,1,2,10,25,34,59,92,114,146,167,181,171,126,109,136,177,193,199,207,201,196,188,183,193,206,210,204,194,183,165,172,169,158,161,169,159,171,190,209,214,199,174,153,140,143,143,120,114,115,102,83,84,83,75,72,79,90,87,90,81,73,49,254,228,215,209,208,202,180,148,66,58,49,52,66,60,63,66,94,122,144,155,168,166,169,208,49,109,129,126,172,199,215,215,212,193,183,183,184,187,188,195,196,181,166,152,141,131,135,14Line truncated
|
||||
@@ -3306,6 +3322,7 @@ namespace windmap {
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
// Halloween namespace
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Hyperbolic Rogue -- implementation of the quotient geometries based on fields
|
||||
// Copyright (C) 2011-2018 Zeno Rogue, see 'hyper.cpp' for details
|
||||
|
||||
#if CAP_FIELD
|
||||
namespace hr {
|
||||
|
||||
namespace fieldpattern {
|
||||
@@ -791,3 +792,4 @@ int currfp_inverses(int i) { return currfp.inverses[i]; }
|
||||
int currfp_distwall(int i) { return currfp.distwall[i]; }
|
||||
|
||||
}
|
||||
#endif
|
||||
@@ -741,6 +741,7 @@ bool againstWind(cell *cto, cell *cfrom) {
|
||||
if(!cfrom || !cto) return false;
|
||||
int dcto = airdist(cto), dcfrom = airdist(cfrom);
|
||||
if(dcto < dcfrom) return true;
|
||||
#if CAP_FIELD
|
||||
if(cfrom->land == laBlizzard && !shmup::on && cto->land == laBlizzard && dcto == 3 && dcfrom == 3) {
|
||||
char vfrom = windmap::at(cfrom);
|
||||
char vto = windmap::at(cto);
|
||||
@@ -748,6 +749,7 @@ bool againstWind(cell *cto, cell *cfrom) {
|
||||
if(z >= windmap::NOWINDBELOW && z < windmap::NOWINDFROM)
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
whirlwind::calcdirs(cfrom);
|
||||
int d = neighborId(cfrom, cto);
|
||||
if(whirlwind::winddir(d) == -1) return true;
|
||||
@@ -2805,10 +2807,12 @@ bool recalcTide;
|
||||
#define LANDDIST LHU.bytes[1]
|
||||
#define CHAOSPARAM LHU.bytes[2]
|
||||
|
||||
#if CAP_FIELD
|
||||
int lavatide(cell *c, int t) {
|
||||
int tc = (shmup::on ? shmup::curtime/400 : turncount);
|
||||
return (windmap::at(c) + (tc+t)*4) & 255;
|
||||
}
|
||||
#endif
|
||||
|
||||
void checkTide(cell *c) {
|
||||
if(c->land == laOcean) {
|
||||
@@ -2841,6 +2845,7 @@ void checkTide(cell *c) {
|
||||
if(isFire(c) && t >= tidalphase)
|
||||
c->wall = waSea;
|
||||
}
|
||||
#if CAP_FIELD
|
||||
if(c->land == laVolcano) {
|
||||
int id = lavatide(c, 0);
|
||||
if(id < 96) {
|
||||
@@ -2856,6 +2861,7 @@ void checkTide(cell *c) {
|
||||
}
|
||||
else if(c->wall == waMagma) c->wall = waNone;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void buildAirmap() {
|
||||
|
||||
+13
-1
@@ -32,6 +32,7 @@ string euchelp =
|
||||
"* Halloween is specially designed for spherical geometry.\n"
|
||||
"* To see the difference, try Hunting Grounds in Euclidean -- it is impossible.\n";
|
||||
|
||||
#if CAP_FIELD
|
||||
void showQuotientConfig() {
|
||||
using namespace fieldpattern;
|
||||
gamescreen(2);
|
||||
@@ -88,6 +89,7 @@ void showQuotientConfig() {
|
||||
|
||||
dialog::display();
|
||||
}
|
||||
#endif
|
||||
|
||||
bool torus_bitrunc;
|
||||
|
||||
@@ -392,6 +394,7 @@ void ge_select_tiling(const vector<eGeometry>& lst) {
|
||||
dynamicval<eGeometry> cg(geometry, eGeometry(i));
|
||||
if(archimedean && !CAP_ARCM) continue;
|
||||
if(geometry == gCrystal && !CAP_CRYSTAL) continue;
|
||||
if(geometry == gFieldQuotient && !CAP_FIELD) continue;
|
||||
dialog::addBoolItem(XLAT(ginf[i].menu_displayed_name), on, letter++);
|
||||
dialog::lastItem().value += validclasses[land_validity(specialland).quality_level];
|
||||
dialog::add_action([i] {
|
||||
@@ -412,9 +415,11 @@ void ge_select_tiling(const vector<eGeometry>& lst) {
|
||||
prepare_torusconfig();
|
||||
pushScreen(showTorusConfig);
|
||||
}
|
||||
#if CAP_FIELD
|
||||
if(geometry == gFieldQuotient) {
|
||||
pushScreen(showQuotientConfig);
|
||||
}
|
||||
#endif
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -635,8 +640,10 @@ void showEuclideanMenu() {
|
||||
else if(euwrap)
|
||||
prepare_torusconfig(),
|
||||
pushScreen(showTorusConfig);
|
||||
#if CAP_FIELD
|
||||
else if(geometry == gFieldQuotient)
|
||||
pushScreen(showQuotientConfig);
|
||||
#endif
|
||||
});
|
||||
}
|
||||
else dialog::addBreak(100);
|
||||
@@ -729,7 +736,9 @@ void runGeometryExperiments() {
|
||||
#if CAP_COMMANDLINE
|
||||
int read_geom_args() {
|
||||
using namespace arg;
|
||||
if(argis("-qpar")) {
|
||||
if(0) ;
|
||||
#if CAP_FIELD
|
||||
else if(argis("-qpar")) {
|
||||
int p;
|
||||
shift(); sscanf(argcs(), "%d,%d,%d",
|
||||
&p, "ientspace::rvadd, "ientspace::rvdir
|
||||
@@ -761,6 +770,7 @@ int read_geom_args() {
|
||||
cheat();
|
||||
currfp.findsubpath();
|
||||
}
|
||||
#endif
|
||||
else if(argis("-tpar")) {
|
||||
torusconfig::torus_mode = torusconfig::tmSingle;
|
||||
shift(); sscanf(argcs(), "%d,%d,%d",
|
||||
@@ -795,6 +805,7 @@ int read_geom_args() {
|
||||
set_variation(eVariation::goldberg);
|
||||
}
|
||||
#endif
|
||||
#if CAP_FIELD
|
||||
else if(argis("-fi")) {
|
||||
fieldpattern::info();
|
||||
exit(0);
|
||||
@@ -805,6 +816,7 @@ int read_geom_args() {
|
||||
}
|
||||
else if(argis("-d:quotient"))
|
||||
launch_dialog(showQuotientConfig);
|
||||
#endif
|
||||
else if(argis("-d:torus")) {
|
||||
launch_dialog(showTorusConfig);
|
||||
prepare_torusconfig();
|
||||
|
||||
@@ -2813,9 +2813,12 @@ void setcolors(cell *c, color_t& wcol, color_t& fcol) {
|
||||
// water colors
|
||||
if(isWateryOrBoat(c) || c->wall == waReptileBridge) {
|
||||
if(c->land == laOcean)
|
||||
fcol = (c->landparam > 25 && !chaosmode) ? (
|
||||
0x90 + 8 * sintick(1000, windmap::windcodes[windmap::getId(c)] / 256.)
|
||||
) :
|
||||
fcol =
|
||||
#if CAP_FIELD
|
||||
(c->landparam > 25 && !chaosmode) ? (
|
||||
0x90 + 8 * sintick(1000, windmap::windcodes[windmap::getId(c)] / 256.)
|
||||
) :
|
||||
#endif
|
||||
0x1010C0 + int(32 * sintick(500, (chaosmode ? c->CHAOSPARAM : c->landparam)*.75/M_PI));
|
||||
else if(c->land == laOceanWall)
|
||||
fcol = 0x2020FF;
|
||||
@@ -2897,6 +2900,7 @@ void setcolors(cell *c, color_t& wcol, color_t& fcol) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if CAP_FIELD
|
||||
case laVolcano: {
|
||||
int id = lavatide(c, -1)/4;
|
||||
if(c->wall == waMagma) {
|
||||
@@ -2916,6 +2920,7 @@ void setcolors(cell *c, color_t& wcol, color_t& fcol) {
|
||||
} */
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
case laMinefield:
|
||||
fcol = floorcolors[c->land];
|
||||
@@ -3061,6 +3066,7 @@ void setcolors(cell *c, color_t& wcol, color_t& fcol) {
|
||||
break;
|
||||
}
|
||||
|
||||
#if CAP_FIELD
|
||||
case laPrairie:
|
||||
if(prairie::isriver(c)) {
|
||||
fcol = ((c->LHU.fi.rval & 1) ? 0x402000: 0x503000);
|
||||
@@ -3071,6 +3077,7 @@ void setcolors(cell *c, color_t& wcol, color_t& fcol) {
|
||||
// fcol += 0x1 * (511 / (1 + max((int) c->LHU.fi.walldist2, 1)));
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
case laCamelot: {
|
||||
int d = showoff ? 0 : ((eubinary||c->master->alt) ? celldistAltRelative(c) : 0);
|
||||
@@ -6083,7 +6090,9 @@ auto graphcm = addHook(clearmemory, 0, [] () {
|
||||
|
||||
void resetGeometry() {
|
||||
precalc();
|
||||
#if CAP_FIELD
|
||||
if(hyperbolic && &currfp != &fieldpattern::fp_invalid) currfp.analyze();
|
||||
#endif
|
||||
#if CAP_GL
|
||||
resetGL();
|
||||
#endif
|
||||
|
||||
@@ -2646,6 +2646,7 @@ bool allowChangeRange();
|
||||
|
||||
static inline bool orbProtection(eItem it) { return false; } // not implemented
|
||||
|
||||
#if CAP_FIELD
|
||||
namespace windmap {
|
||||
void create();
|
||||
|
||||
@@ -2655,6 +2656,7 @@ namespace windmap {
|
||||
int getId(cell *c);
|
||||
int at(cell *c);
|
||||
}
|
||||
#endif
|
||||
|
||||
extern int wavephase;
|
||||
|
||||
@@ -3062,6 +3064,7 @@ struct celllister : manual_celllister {
|
||||
|
||||
hrmap *newAltMap(heptagon *o);
|
||||
|
||||
#if CAP_FIELD
|
||||
#define currfp fieldpattern::getcurrfp()
|
||||
namespace fieldpattern {
|
||||
struct fpattern& getcurrfp();
|
||||
@@ -3070,6 +3073,7 @@ namespace fieldpattern {
|
||||
int currfp_gmul(int a, int b);
|
||||
int currfp_inverses(int i);
|
||||
int currfp_distwall(int i);
|
||||
#endif
|
||||
|
||||
const char *dnameof(eMonster m);
|
||||
const char *dnameof(eLand l);
|
||||
@@ -3915,6 +3919,7 @@ namespace torusconfig {
|
||||
flagtype tmflags();
|
||||
}
|
||||
|
||||
#if CAP_FIELD
|
||||
namespace fieldpattern {
|
||||
extern int current_extra;
|
||||
|
||||
@@ -3934,6 +3939,7 @@ namespace fieldpattern {
|
||||
extern vector<fgeomextra> fgeomextras;
|
||||
extern void enableFieldChange();
|
||||
}
|
||||
#endif
|
||||
|
||||
bool incompatible(eLand l1, eLand l2);
|
||||
eOrbLandRelation getOLR(eItem it, eLand l);
|
||||
|
||||
+12
-1
@@ -86,8 +86,12 @@ bool out_ruin(cell *c) {
|
||||
cd &= 31;
|
||||
return cd >= 16;
|
||||
}
|
||||
#if CAP_FIELD
|
||||
else
|
||||
return windmap::at(c) >= 128;
|
||||
#else
|
||||
else return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
eMonster genRuinMonster(cell *c) {
|
||||
@@ -154,6 +158,7 @@ void giantLandSwitch(cell *c, int d, cell *from) {
|
||||
|
||||
case laPrairie: // -------------------------------------------------------------
|
||||
|
||||
#if CAP_FIELD
|
||||
if(d == 7) {
|
||||
if(prairie::isriver(c)) {
|
||||
if(shmup::on) prairie::beaststogen.push_back(c);
|
||||
@@ -166,6 +171,7 @@ void giantLandSwitch(cell *c, int d, cell *from) {
|
||||
}
|
||||
prairie::generateTreasure(c);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
case laDungeon: // -------------------------------------------------------------
|
||||
@@ -947,6 +953,7 @@ void giantLandSwitch(cell *c, int d, cell *from) {
|
||||
break;
|
||||
|
||||
case laVolcano:
|
||||
#if CAP_FIELD
|
||||
if(d == 9) {
|
||||
c->wall = waNone;
|
||||
if(hrand(20000) < (items[itLavaLily] + yendor::hardness()))
|
||||
@@ -961,9 +968,11 @@ void giantLandSwitch(cell *c, int d, cell *from) {
|
||||
if(hrand(8000) < (items[itLavaLily] + yendor::hardness()))
|
||||
c->monst = moLavaWolf;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
case laBlizzard:
|
||||
#if CAP_FIELD
|
||||
if(d == 9) {
|
||||
bool windless = true;
|
||||
int w = windmap::at(c);
|
||||
@@ -987,7 +996,7 @@ void giantLandSwitch(cell *c, int d, cell *from) {
|
||||
}
|
||||
if((d == 7 || d == 6) && blizzard_no_escape(c))
|
||||
c->item = itOrbSafety, c->monst = moNone;
|
||||
|
||||
#endif
|
||||
break;
|
||||
|
||||
case laTerracotta:
|
||||
@@ -2458,8 +2467,10 @@ void setdist(cell *c, int d, cell *from) {
|
||||
c->wall = waInvisibleFloor;
|
||||
}
|
||||
|
||||
#if CAP_FIELD
|
||||
if(d >= BARLEV-1 && c->land == laPrairie)
|
||||
prairie::spread(c, from);
|
||||
#endif
|
||||
|
||||
if(d < BARLEV && c->land == laPrairie && !c->landparam) {
|
||||
printf("d=%d/%d\n", d, BARLEV);
|
||||
|
||||
@@ -1137,6 +1137,7 @@ namespace lv {
|
||||
land_validity_t sloppy_pattern = {1, q1 | one_and_half, "Somewhat sloppy pattern."};
|
||||
land_validity_t no_fractal_landscapes = {1, q1 | one_and_half, "Fractal landscapes not implemented in this geometry."};
|
||||
land_validity_t simplified_walls = { 1, q1, "Only simplified walls implemented."};
|
||||
land_validity_t disabled = {0, q0, "This land has been disabled with compilation flags."};
|
||||
}
|
||||
|
||||
// old Daily Challenges should keep their validity forever
|
||||
@@ -1149,6 +1150,11 @@ land_validity_t& land_validity(eLand l) {
|
||||
|
||||
using namespace lv;
|
||||
|
||||
#if !CAP_FIELD
|
||||
if(among(l, laPrairie, laBlizzard, laVolcano))
|
||||
return disabled;
|
||||
#endif
|
||||
|
||||
if(l == laBrownian) {
|
||||
if(quotient || !hyperbolic || geometry == gCrystal) return dont_work;
|
||||
}
|
||||
|
||||
@@ -340,6 +340,7 @@ int zebra3(cell *c) {
|
||||
}
|
||||
}
|
||||
|
||||
#if CAP_FIELD
|
||||
namespace fieldpattern {
|
||||
|
||||
pair<int, bool> fieldval(cell *c) {
|
||||
@@ -415,6 +416,7 @@ pair<int, int> subval(cell *c, int _subpathid = subpathid, int _subpathorder = s
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
int getHemisphere(heptagon *h, int which) {
|
||||
int id = h->fiftyval;
|
||||
@@ -1063,6 +1065,7 @@ namespace patterns {
|
||||
si.dir = downdir(c, coastvalEdge);
|
||||
}
|
||||
|
||||
#if CAP_FIELD
|
||||
else if(pat == PAT_FIELD) {
|
||||
if(euclid)
|
||||
// use the torus ID
|
||||
@@ -1075,6 +1078,7 @@ namespace patterns {
|
||||
si.id = windmap::getId(c);
|
||||
// todo dir
|
||||
}
|
||||
#endif
|
||||
|
||||
else if(sphere && pat == PAT_SIBLING) {
|
||||
val_all(c, si, sub, pat);
|
||||
@@ -1433,6 +1437,7 @@ namespace patterns {
|
||||
#endif
|
||||
case 'B':
|
||||
return colortables['B'][c->type & 15];
|
||||
#if CAP_FIELD
|
||||
case 'C': {
|
||||
if(!hyperbolic) return canvasback;
|
||||
using namespace fieldpattern;
|
||||
@@ -1458,11 +1463,14 @@ namespace patterns {
|
||||
if(z > z2) return 0xC00000;
|
||||
return 0xCCCC00;
|
||||
}
|
||||
#endif
|
||||
case 'M':
|
||||
return gradient(0, canvasback, 0, min(1.8/(1+celldist(c)), 1.), 1);
|
||||
#if CAP_FIELD
|
||||
case 'S':
|
||||
if(!hyperbolic) return canvasback;
|
||||
return 0x3F1F0F * fieldpattern::subval(c).second + 0x000080;
|
||||
#endif
|
||||
case 'g':
|
||||
return canvasback;
|
||||
case 'r':
|
||||
@@ -1552,12 +1560,14 @@ namespace patterns {
|
||||
|
||||
dialog::addSelItem(XLAT("random black-and-white"), "current", 'w');
|
||||
|
||||
#if CAP_FIELD
|
||||
if(!sphere) {
|
||||
dialog::addSelItem(XLAT("field pattern C"), "field", 'C');
|
||||
dialog::addSelItem(XLAT("field pattern D"), "field", 'D');
|
||||
dialog::addSelItem(XLAT("field pattern N"), "field", 'N');
|
||||
dialog::addSelItem(XLAT("field pattern S"), "field", 'S');
|
||||
}
|
||||
#endif
|
||||
|
||||
if(archimedean)
|
||||
dialog::addSelItem(XLAT("Archimedean"), "Archimedean", 'A');
|
||||
|
||||
@@ -1340,6 +1340,7 @@ bool airCurrents(transmatrix& nat, monster *m, int delta) {
|
||||
}
|
||||
}
|
||||
}
|
||||
#if CAP_FIELD
|
||||
if(c->land == laBlizzard) {
|
||||
int wmc = windmap::at(c);
|
||||
forCellEx(c2, c) {
|
||||
@@ -1360,6 +1361,7 @@ bool airCurrents(transmatrix& nat, monster *m, int delta) {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return carried;
|
||||
}
|
||||
|
||||
@@ -2575,6 +2577,7 @@ void moveMonster(monster *m, int delta) {
|
||||
direct = true;
|
||||
directi = 0;
|
||||
}
|
||||
#if CAP_FIELD
|
||||
else if(m->type == moHerdBull) {
|
||||
cell *cnext = prairie::next(c);
|
||||
if(cnext && gmatrix.count(cnext)) {
|
||||
@@ -2584,6 +2587,7 @@ void moveMonster(monster *m, int delta) {
|
||||
}
|
||||
else m->dead = true;
|
||||
}
|
||||
#endif
|
||||
else if(m->type == moButterfly) {
|
||||
int d = neighborId(m->base, m->torigin);
|
||||
cell *cnext = NULL;
|
||||
|
||||
@@ -467,3 +467,6 @@ union SDL_Event;
|
||||
#define CAP_BT CAP_GEOMETRY
|
||||
#endif
|
||||
|
||||
#ifndef CAP_FIELD
|
||||
#define CAP_FIELD (!(ISMINI))
|
||||
#endif
|
||||
@@ -1063,11 +1063,13 @@ int modecode() {
|
||||
}
|
||||
}
|
||||
|
||||
#if CAP_FIELD
|
||||
if(geometry == gFieldQuotient) {
|
||||
using namespace fieldpattern;
|
||||
mct += ll(current_extra) << 29;
|
||||
mct += ll(fgeomextras[current_extra].current_prime_id) << 37;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if CAP_CRYSTAL
|
||||
if(geometry == gCrystal) {
|
||||
|
||||
Reference in new issue
Block a user