1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-27 06:27:17 +00:00

added some missing CAP_* guards

This commit is contained in:
Zeno Rogue 2021-06-09 04:33:55 +02:00
parent 7777c7b415
commit b71e436cb6
11 changed files with 29 additions and 1 deletions

View File

@ -1602,6 +1602,7 @@ void celldrawer::draw_features() {
poly_outline = OUTLINE_DEFAULT; poly_outline = OUTLINE_DEFAULT;
} }
#if CAP_COMPLEX2
else if(isDie(c->wall)) { else if(isDie(c->wall)) {
color_t col = darkena(winf[c->wall].color, 0, 0xFF); color_t col = darkena(winf[c->wall].color, 0, 0xFF);
@ -1616,6 +1617,7 @@ void celldrawer::draw_features() {
die_target = V; die_target = V;
dice::draw_die(c, Vboat, 1, col); dice::draw_die(c, Vboat, 1, col);
} }
#endif
else if(c->wall == waExplosiveBarrel) { else if(c->wall == waExplosiveBarrel) {
if(GDIM == 3 && qfi.fshape) { if(GDIM == 3 && qfi.fshape) {

View File

@ -381,6 +381,7 @@ EX void pushThumper(const movei& mi) {
cto->wall = waCrateOnTarget; cto->wall = waCrateOnTarget;
th->wall = waCrateTarget; th->wall = waCrateTarget;
} }
#if CAP_COMPLEX2
else if(isDie(w)) { else if(isDie(w)) {
th->wall = waNone; th->wall = waNone;
cto->wall = w; cto->wall = w;
@ -405,6 +406,7 @@ EX void pushThumper(const movei& mi) {
else else
animateMovement(mi, LAYER_BOAT); animateMovement(mi, LAYER_BOAT);
} }
#endif
else else
cto->wall = w; cto->wall = w;
if(explode) cto->wall = waFireTrap, cto->wparam = explode; if(explode) cto->wall = waFireTrap, cto->wparam = explode;
@ -415,8 +417,10 @@ EX void pushThumper(const movei& mi) {
EX bool canPushThumperOn(movei mi, cell *player) { EX bool canPushThumperOn(movei mi, cell *player) {
cell *thumper = mi.s; cell *thumper = mi.s;
cell *tgt = mi.t; cell *tgt = mi.t;
#if CAP_COMPLEX2
if(dice::on(thumper) && !dice::can_roll(mi)) if(dice::on(thumper) && !dice::can_roll(mi))
return false; return false;
#endif
if(tgt->wall == waBoat || tgt->wall == waStrandedBoat) return false; if(tgt->wall == waBoat || tgt->wall == waStrandedBoat) return false;
if(isReptile(tgt->wall)) return false; if(isReptile(tgt->wall)) return false;
if(isWatery(tgt) && !tgt->monst) if(isWatery(tgt) && !tgt->monst)

View File

@ -2252,6 +2252,7 @@ EX bool drawMonsterType(eMonster m, cell *where, const shiftmatrix& V1, color_t
return true; return true;
} }
#if CAP_COMPLEX2
case moAnimatedDie: case moAngryDie: { case moAnimatedDie: case moAngryDie: {
if(where) if(where)
dice::draw_die(where, V, 1, darkena(col, 0, 0xFF)); dice::draw_die(where, V, 1, darkena(col, 0, 0xFF));
@ -2259,6 +2260,7 @@ EX bool drawMonsterType(eMonster m, cell *where, const shiftmatrix& V1, color_t
queuepoly(V, cgi.shDodeca, darkena(col, 0, 0xFF)); queuepoly(V, cgi.shDodeca, darkena(col, 0, 0xFF));
return true; return true;
} }
#endif
default: ; default: ;
} }

View File

@ -527,10 +527,12 @@ EX namespace history {
} }
EX void open_filedialog_to_create_image(bool ds) { EX void open_filedialog_to_create_image(bool ds) {
#if CAP_SHOT && CAP_SDL
dialog::openFileDialog(band_format_now, XLAT("rendered band ($ID=segment, $DATE=date)"), ".png", [ds] () { dialog::openFileDialog(band_format_now, XLAT("rendered band ($ID=segment, $DATE=date)"), ".png", [ds] () {
createImage(band_format_now, ds); createImage(band_format_now, ds);
return true; return true;
}); });
#endif
} }
#endif #endif
@ -691,7 +693,7 @@ EX namespace history {
} }
EX void renderAutoband() { EX void renderAutoband() {
#if CAP_SDL #if CAP_SDL && CAP_SHOT
if(!cwt.at || celldist(cwt.at) <= 7) return; if(!cwt.at || celldist(cwt.at) <= 7) return;
if(!autoband) return; if(!autoband) return;
eModel spm = pmodel; eModel spm = pmodel;

View File

@ -2586,8 +2586,10 @@ EX void giantLandSwitch(cell *c, int d, cell *from) {
} }
case laDice: { case laDice: {
#if CAP_COMPLEX2
if(fargen) if(fargen)
dice::generate_full(c, items[itDice] + yendor::hardness()); dice::generate_full(c, items[itDice] + yendor::hardness());
#endif
break; break;
} }

View File

@ -431,10 +431,12 @@ EX bool makeflame(cell *c, int timeout, bool checkonly) {
EX bool makeshallow(cell *c, int timeout, bool checkonly) { EX bool makeshallow(cell *c, int timeout, bool checkonly) {
changes.ccell(c); changes.ccell(c);
if(!checkonly) destroyTrapsOn(c); if(!checkonly) destroyTrapsOn(c);
#if CAP_COMPLEX2
if(c->land == laBrownian) { if(c->land == laBrownian) {
if(checkonly) return true; if(checkonly) return true;
brownian::dissolve(c, 1); brownian::dissolve(c, 1);
} }
#endif
if(c->wall == waChasm || c->wall == waOpenGate || c->wall == waRed2 || c->wall == waRed3 || if(c->wall == waChasm || c->wall == waOpenGate || c->wall == waRed2 || c->wall == waRed3 ||
c->wall == waTower) c->wall == waTower)
return false; return false;

View File

@ -103,8 +103,10 @@ EX void moveEffect(const movei& mi, eMonster m) {
tortoise::move_baby(cf, ct); tortoise::move_baby(cf, ct);
} }
#if CAP_COMPLEX2
if(isDie(m) && mi.proper()) if(isDie(m) && mi.proper())
dice::roll(mi); dice::roll(mi);
#endif
} }
EX void moveMonster(const movei& mi) { EX void moveMonster(const movei& mi) {

View File

@ -1104,6 +1104,7 @@ void blowoff(const movei& mi) {
if(ct->item) ct->item = itNone; if(ct->item) ct->item = itNone;
moveItem(cf, ct, true); moveItem(cf, ct, true);
} }
#if CAP_COMPLEX2
if(ct->monst == moAnimatedDie && dice::data[ct].happy() > 0) { if(ct->monst == moAnimatedDie && dice::data[ct].happy() > 0) {
ct->monst = moNone; ct->monst = moNone;
ct->wall = waHappyDie; ct->wall = waHappyDie;
@ -1123,6 +1124,7 @@ void blowoff(const movei& mi) {
ct->stuntime = 5; ct->stuntime = 5;
addMessage(XLAT("You have made a Happy Die angry!")); addMessage(XLAT("You have made a Happy Die angry!"));
} }
#endif
items[itOrbAir]--; items[itOrbAir]--;
createNoise(2); createNoise(2);
bfs(); bfs();
@ -1157,8 +1159,10 @@ EX movei blowoff_destination(cell *c, int& di) {
if(d<c->type) for(int e=d; e<d+c->type; e++) { if(d<c->type) for(int e=d; e<d+c->type; e++) {
int di = e % c->type; int di = e % c->type;
cell *c2 = c->move(di); cell *c2 = c->move(di);
#if CAP_COMPLEX2
if(dice::on(c) && !dice::can_roll(movei(c, di))) if(dice::on(c) && !dice::can_roll(movei(c, di)))
continue; continue;
#endif
if(c2 && c2->cpdist > c->cpdist && passable(c2, c, P_BLOW)) return movei(c, c2, di); if(c2 && c2->cpdist > c->cpdist && passable(c2, c, P_BLOW)) return movei(c, c2, di);
} }
return movei(c, c, NO_SPACE); return movei(c, c, NO_SPACE);

View File

@ -540,6 +540,7 @@ EX bool passable_for(eMonster m, cell *w, cell *from, flagtype extra) {
} }
return !pseudohept(w) && passable(w, from, extra); return !pseudohept(w) && passable(w, from, extra);
} }
#if CAP_COMPLEX2
if(m == moAnimatedDie) { if(m == moAnimatedDie) {
if(extra & P_ONPLAYER) { if(extra & P_ONPLAYER) {
if(isPlayerOn(w)) return true; if(isPlayerOn(w)) return true;
@ -559,6 +560,7 @@ EX bool passable_for(eMonster m, cell *w, cell *from, flagtype extra) {
else else
return passable(w, from, extra); return passable(w, from, extra);
} }
#endif
if(m == moFrog) { if(m == moFrog) {
return isNeighbor1(from, w) ? passable(w, from, extra) : check_jump(from, w, extra, dummy) == 3; return isNeighbor1(from, w) ? passable(w, from, extra) : check_jump(from, w, extra, dummy) == 3;
} }

View File

@ -629,6 +629,7 @@ bool pcmove::actual_move() {
return after_instant(false); return after_instant(false);
} }
#if CAP_COMPLEX2
if(c2->monst == moAnimatedDie) { if(c2->monst == moAnimatedDie) {
mip = determinePush(cwt, subdir, [] (movei mi) { return canPushThumperOn(mi, cwt.at); }); mip = determinePush(cwt, subdir, [] (movei mi) { return canPushThumperOn(mi, cwt.at); });
if(mip.proper()) { if(mip.proper()) {
@ -640,6 +641,7 @@ bool pcmove::actual_move() {
} }
} }
} }
#endif
if(isPushable(c2->wall) && !c2->monst && !nonAdjacentPlayer(c2, cwt.at) && fmsMove) { if(isPushable(c2->wall) && !c2->monst && !nonAdjacentPlayer(c2, cwt.at) && fmsMove) {
mip = determinePush(cwt, subdir, [] (movei mi) { return canPushThumperOn(mi, cwt.at); }); mip = determinePush(cwt, subdir, [] (movei mi) { return canPushThumperOn(mi, cwt.at); });

View File

@ -1076,15 +1076,19 @@ EX namespace reg3 {
if(geometry == gSpace535) if(geometry == gSpace535)
quotient_map = new seifert_weber::hrmap_seifert_cover(); quotient_map = new seifert_weber::hrmap_seifert_cover();
#if CAP_CRYSTAL
else if(geometry == gSpace344) else if(geometry == gSpace344)
quotient_map = new hrmap_from_crystal; quotient_map = new hrmap_from_crystal;
#endif
else else
quotient_map = new hrmap_field3(&fp); quotient_map = new hrmap_field3(&fp);
if(geometry == gSpace535) if(geometry == gSpace535)
emerald_map = new seifert_weber::hrmap_seifert_cover(); emerald_map = new seifert_weber::hrmap_seifert_cover();
#if CAP_CRYSTAL
else if(geometry == gSpace344) else if(geometry == gSpace344)
emerald_map = new hrmap_from_crystal; emerald_map = new hrmap_from_crystal;
#endif
else else
emerald_map = new hrmap_field3(&currfp); emerald_map = new hrmap_field3(&currfp);
h.emeraldval = 0; h.emeraldval = 0;