From c39700d8dee05d12b1a7fab5363e820dda03d75c Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Fri, 22 May 2020 16:52:30 +0200 Subject: [PATCH] added CAP_COMPLEX2 guards --- attack.cpp | 4 ++++ environment.cpp | 2 ++ items.cpp | 2 ++ mapeffects.cpp | 6 ++++++ monstermove.cpp | 10 ++++++++++ pcmove.cpp | 8 ++++++++ 6 files changed, 32 insertions(+) diff --git a/attack.cpp b/attack.cpp index 2a64e3b8..f5a0d049 100644 --- a/attack.cpp +++ b/attack.cpp @@ -566,12 +566,16 @@ EX void killMonster(cell *c, eMonster who, flagtype deathflags IS(0)) { playSound(c, "splash" + pick12()); destroyHalfvine(c); minerEffect(c); + #if CAP_COMPLEX2 brownian::dissolve_brownian(c, 1); + #endif forCellEx(c1, c) if(passable(c1, c, P_MONSTER | P_MIRROR | P_CLIMBUP | P_CLIMBDOWN)) { changes.ccell(c1); destroyHalfvine(c1); minerEffect(c1); + #if CAP_COMPLEX2 brownian::dissolve_brownian(c1, 1); + #endif if(c1->monst == moSlime || c1->monst == moSlimeNextTurn) killMonster(c1, who); } diff --git a/environment.cpp b/environment.cpp index 3bab467d..548ccca5 100644 --- a/environment.cpp +++ b/environment.cpp @@ -789,7 +789,9 @@ EX void monstersTurn() { orbbull::check(); + #if CAP_COMPLEX2 if(!phase1) terracotta::check(); + #endif if(items[itOrbFreedom]) for(int i=0; iitem == itDodeca && peace::on) peace::simon::extend(); } + #if CAP_COMPLEX2 if(c2->land == laHunting && c2->item && !inv::activating) { ambush::ambush(c2, ambush::size(c2, c2->item)); } + #endif if(isRevivalOrb(c2->item) && multi::revive_queue.size()) { multiRevival(cwt.at, c2); diff --git a/mapeffects.cpp b/mapeffects.cpp index 056f07ca..a0a95590 100644 --- a/mapeffects.cpp +++ b/mapeffects.cpp @@ -424,13 +424,17 @@ EX void explosion(cell *c, int power, int central) { playSound(c, "explosion"); drawFireParticles(c, 30, 150); + #if CAP_COMPLEX2 brownian::dissolve_brownian(c, 2); + #endif makeflame(c, central, false); forCellEx(c2, c) { changes.ccell(c2); destroyTrapsOn(c2); + #if CAP_COMPLEX2 brownian::dissolve_brownian(c2, 1); + #endif if(c2->wall == waRed2 || c2->wall == waRed3) c2->wall = waRed1; else if(c2->wall == waDeadTroll || c2->wall == waDeadTroll2 || c2->wall == waPetrified || c2->wall == waGargoyle) { @@ -468,7 +472,9 @@ EX void explodeMine(cell *c) { changes.ccell(c); c->wall = waMineOpen; explosion(c, 20, 20); + #if CAP_COMPLEX2 mine::auto_teleport_charges(); + #endif } EX void explodeBarrel(cell *c) { diff --git a/monstermove.cpp b/monstermove.cpp index 238600d0..9e62e241 100644 --- a/monstermove.cpp +++ b/monstermove.cpp @@ -62,7 +62,9 @@ EX void moveEffect(const movei& mi, eMonster m) { mayExplodeMine(ct, m); + #if CAP_COMPLEX2 if(!isNonliving(m)) terracotta::check_around(ct); + #endif if(ct->wall == waMineUnknown && !ct->item && !ignoresPlates(m) && normal_gravity_at(ct)) ct->landparam |= 2; // mark as safe @@ -84,7 +86,9 @@ EX void moveEffect(const movei& mi, eMonster m) { if(cf && isPrincess(m)) princess::move(mi); + #if CAP_COMPLEX2 if(cf && m == moKnight) camelot::move_knight(cf, ct); + #endif if(cf && m == moTortoise) { tortoise::move_adult(cf, ct); @@ -1533,9 +1537,11 @@ EX int movevalue(eMonster m, cell *c, cell *c2, flagtype flags) { else if(monstersnear(c2, m, NULL, c)) val = 50; // linked with mouse suicide! else if(passable_for(m, c2, c, 0)) { +#if CAP_COMPLEX2 if(mine::marked_mine(c2) && !ignoresPlates(m)) val = 50; else +#endif val = 4000; } else if(passable_for(m, c2, c, P_DEADLY)) val = -1100; @@ -1938,12 +1944,16 @@ EX void movehex_all() { } EX void movemonsters() { + #if CAP_COMPLEX2 ambush::distance = 0; + #endif DEBB(DF_TURN, ("lava1")); orboflava(1); + #if CAP_COMPLEX2 ambush::check_state(); + #endif sagefresh = true; turncount++; diff --git a/pcmove.cpp b/pcmove.cpp index 963031b0..e9b856e5 100644 --- a/pcmove.cpp +++ b/pcmove.cpp @@ -815,7 +815,9 @@ bool pcmove::after_escape() { return false; } else if(c2->monst == moKnight) { + #if CAP_COMPLEX2 if(vmsg()) camelot::knightFlavorMessage(c2); + #endif return false; } else if(c2->monst && (!isFriendly(c2) || c2->monst == moTameBomberbird || isMountable(c2->monst)) @@ -833,8 +835,10 @@ bool pcmove::after_escape() { bool pcmove::move_if_okay() { cell*& c2 = mi.t; + #if CAP_COMPLEX2 if(mine::marked_mine(c2) && !mine::safe() && !checkonly && warningprotection(XLAT("Are you sure you want to step there?"))) return false; + #endif if(snakelevel(c2) <= snakelevel(cwt.at)-2) { bool can_leave = false; @@ -1002,12 +1006,14 @@ bool pcmove::perform_actual_move() { else c2->wall = cwt.at->wall; } + #if CAP_COMPLEX2 if(c2->wall == waRoundTable) { addMessage(XLAT("You jump over the table!")); } if(cwt.at->wall == waRoundTable) camelot::roundTableMessage(c2); + #endif invismove = (turncount >= noiseuntil) && items[itOrbInvis] > 0; @@ -1240,7 +1246,9 @@ EX void playerMoveEffects(cell *c1, cell *c2) { destroyWeakBranch(c1, c2, moPlayer); + #if CAP_COMPLEX2 mine::uncover_full(c2); + #endif if((c2->wall == waClosePlate || c2->wall == waOpenPlate) && normal_gravity_at(c2) && !markOrb(itOrbAether)) toggleGates(c2, c2->wall);