From e3c3a4202edaf9105e1ae4eed2cc56aaa367fa01 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Fri, 4 May 2018 12:49:50 +0200 Subject: [PATCH] Kraken variant of pseudohept --- game.cpp | 2 +- graph.cpp | 2 +- landgen.cpp | 2 +- monstergen.cpp | 4 ++-- pattern2.cpp | 9 +++++++++ 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/game.cpp b/game.cpp index 9af11a48..91e58377 100644 --- a/game.cpp +++ b/game.cpp @@ -809,7 +809,7 @@ bool passable_for(eMonster m, cell *w, cell *from, flagtype extra) { } if((extra & P_ONPLAYER) && isPlayerOn(w)) return true; - if(pseudohept(w) || pseudohept(from)) return false; + if(kraken_pseudohept(w) || kraken_pseudohept(from)) return false; if(w->wall != waBoat && !slimepassable(w, from)) return false; forCellEx(w2, w) if(w2->wall != waBoat && !passable(w2, w, P_FISH | P_MONSTER)) return false; return true; diff --git a/graph.cpp b/graph.cpp index 48266c77..c8b2038f 100644 --- a/graph.cpp +++ b/graph.cpp @@ -2612,7 +2612,7 @@ void setcolors(cell *c, int& wcol, int &fcol) { fcol = 0x2020FF; else if(c->land == laKraken) { fcol = 0x0000A0; - int mafcol = (pseudohept(c) ? 64 : 8); + int mafcol = (kraken_pseudohept(c) ? 64 : 8); /* bool nearshore = false; for(int i=0; itype; i++) if(c->mov[i]->wall != waSea && c->mov[i]->wall != waBoat) diff --git a/landgen.cpp b/landgen.cpp index d3e6563f..fc85b461 100644 --- a/landgen.cpp +++ b/landgen.cpp @@ -1402,7 +1402,7 @@ void giantLandSwitch(cell *c, int d, cell *from) { forCellEx(c2, c) c2->wall = waNone; } - if(d == 8 && !pseudohept(c) && hrand(20000) < 10 + 3 * items[itKraken] + 2 * yendor::hardness() && c->wall == waSea && !c->item && !c->monst && !safety) { + if(d == 8 && !kraken_pseudohept(c) && hrand(20000) < 10 + 3 * items[itKraken] + 2 * yendor::hardness() && c->wall == waSea && !c->item && !c->monst && !safety) { bool ok = true; forCellEx(c2, c) if(c2->wall != waSea || c2->item || c2->monst) diff --git a/monstergen.cpp b/monstergen.cpp index a7e7a4e2..f282dc12 100644 --- a/monstergen.cpp +++ b/monstergen.cpp @@ -439,14 +439,14 @@ void wandering() { playSeenSound(c); continue; } - if(!peace::on && c->land == laKraken && ((sphere && !hrand(15)) || wchance(items[itKraken], 240)) && !pseudohept(c)) { + if(!peace::on && c->land == laKraken && ((sphere && !hrand(15)) || wchance(items[itKraken], 240)) && !kraken_pseudohept(c)) { bool b = sphere || canReachPlayer(c, moKrakenH); if(sphere && (haveKraken() || !items[itOrbFish])) { c->monst = moViking; c->wall = waBoat; c->item = itOrbFish; playSeenSound(c); continue; } - if(b) forCellEx(c2, c) if((sphere || c2->cpdist > gamerange()) && !pseudohept(c2)) { + if(b) forCellEx(c2, c) if((sphere || c2->cpdist > gamerange()) && !kraken_pseudohept(c2)) { forCellCM(c3, c2) if(c3->monst || c3->wall != waSea) goto notfound; c2->monst = moKrakenH; diff --git a/pattern2.cpp b/pattern2.cpp index 7576491e..77010804 100644 --- a/pattern2.cpp +++ b/pattern2.cpp @@ -1090,6 +1090,15 @@ bool pseudohept(cell *c) { return pattern_threecolor(c) == 0; } +// while Krakens movement is usually restricted to non-pseudohept cells, +// there is one special case when this does not work (because non-pseudohept cells have varying degrees) +bool kraken_pseudohept(cell *c) { + if(!euclid && !(S7&1) && gp_threecolor() == 1) + return ishept(c); + else + return pseudohept(c); + } + bool warptype(cell *c) { if(a4 && nonbitrunc) { if(euclid)