tactic:: removed lasttactic in favor of specialland. No more treasures on Crossroads in equid lands. Fixed warped walls and CR4 in a4.

This commit is contained in:
Zeno Rogue 2018-04-11 17:44:46 +02:00
parent 10f244f785
commit 9d91390677
9 changed files with 25 additions and 26 deletions

View File

@ -60,7 +60,7 @@ bool checkBarriersBack(cellwalker bb, int q, bool cross) {
// warp coasts use a different algorithm when has_nice_dual() is on // warp coasts use a different algorithm when has_nice_dual() is on
bool warped_version(eLand l1, eLand l2) { bool warped_version(eLand l1, eLand l2) {
return has_nice_dual() && (l1 == laWarpCoast || l1 == laWarpSea || l2 == laWarpSea || l2 == laWarpCoast); return (has_nice_dual() && (l1 == laWarpCoast || l1 == laWarpSea || l2 == laWarpSea || l2 == laWarpCoast)) || ((S3==4) && !nonbitrunc);
} }
bool checkBarriersNowall(cellwalker bb, int q, int dir, eLand l1=laNone, eLand l2=laNone) { bool checkBarriersNowall(cellwalker bb, int q, int dir, eLand l1=laNone, eLand l2=laNone) {
@ -742,7 +742,7 @@ bool buildBarrierNowall(cell *c, eLand l2, bool force) {
for(int j=0; j<c->type; j++) swap(ds[j], ds[hrand(j+1)]); for(int j=0; j<c->type; j++) swap(ds[j], ds[hrand(j+1)]);
for(int i=0; i<c->type; i++) { for(int i=0; i<c->type; i++) {
int d = ds[i]; int d = (S3>3 && nonbitrunc) ? (2+(i&1)) : ds[i];
/* if(warpv && gp::on) { /* if(warpv && gp::on) {
d = hrand(c->type); */ d = hrand(c->type); */
if(warpv && c->mov[d] && c->mov[d]->mpdist < c->mpdist) continue; if(warpv && c->mov[d] && c->mov[d]->mpdist < c->mpdist) continue;

View File

@ -444,7 +444,7 @@ void buildEquidistant(cell *c) {
c->landparam = 50; c->landparam = 50;
return; return;
} */ } */
if(geometry) return; if(sphere || euclid) return;
eLand b = c->land; eLand b = c->land;
if(chaosmode && !inmirror(b)) return; if(chaosmode && !inmirror(b)) return;
if(!b) { if(!b) {
@ -1305,7 +1305,7 @@ void moreBigStuff(cell *c) {
if(c->land == laOcean || c->land == laWhirlpool) { if(c->land == laOcean || c->land == laWhirlpool) {
bool fullwhirlpool = false; bool fullwhirlpool = false;
if(tactic::on && tactic::lasttactic == laWhirlpool) if(tactic::on && specialland == laWhirlpool)
fullwhirlpool = true; fullwhirlpool = true;
if(yendor::on && yendor::clev().l == laWhirlpool) if(yendor::on && yendor::clev().l == laWhirlpool)
fullwhirlpool = true; fullwhirlpool = true;

View File

@ -6083,7 +6083,7 @@ void activateSafety(eLand l) {
if(l == laClearing) l = laOvergrown; if(l == laClearing) l = laOvergrown;
if(l == laWhirlpool) l = laOcean; if(l == laWhirlpool) l = laOcean;
if(l == laCrossroads5) l = laCrossroads2; // could not fit! if(l == laCrossroads5) l = laCrossroads2; // could not fit!
if(l == laCamelot && !(tactic::on && tactic::lasttactic == laCamelot)) if(l == laCamelot && !(tactic::on && specialland == laCamelot))
l = laCrossroads; l = laCrossroads;
firstland = l; firstland = l;
safetyland = l; safetyland = l;

View File

@ -2307,7 +2307,6 @@ int getHemisphere(cell *c, int which);
namespace tactic { namespace tactic {
extern bool on; extern bool on;
extern bool trailer; extern bool trailer;
extern eLand lasttactic;
} }
namespace yendor { namespace yendor {

View File

@ -2087,7 +2087,7 @@ void giantLandSwitch(cell *c, int d, cell *from) {
c->wall = hrand(2) ? waMirror : waCloud; c->wall = hrand(2) ? waMirror : waCloud;
else if(!ctof(c) && hyperstonesUnlocked() && hrand(8000) < 100 && !gp::on) else if(!ctof(c) && hyperstonesUnlocked() && hrand(8000) < 100 && !gp::on)
c->wall = hrand(2) ? waMirror : waCloud; c->wall = hrand(2) ? waMirror : waCloud;
else if(!ctof(c) && tactic::on && isCrossroads(tactic::lasttactic) && hrand(8000) < 120 && !gp::on) else if(!ctof(c) && tactic::on && isCrossroads(specialland) && hrand(8000) < 120 && !gp::on)
c->wall = hrand(2) ? waMirror : waCloud; c->wall = hrand(2) ? waMirror : waCloud;
else if(c->land == laCrossroads4 && hrand(24000) < 10 && tactic::on) else if(c->land == laCrossroads4 && hrand(24000) < 10 && tactic::on)
c->wall = waRose; c->wall = waRose;

View File

@ -582,7 +582,7 @@ void countHyperstoneQuest(int& i1, int& i2) {
bool hyperstonesUnlocked() { bool hyperstonesUnlocked() {
int i1, i2; int i1, i2;
if(tactic::on && isCrossroads(tactic::lasttactic) && !tactic::trailer) return true; if(tactic::on && isCrossroads(specialland) && !tactic::trailer) return true;
countHyperstoneQuest(i1, i2); countHyperstoneQuest(i1, i2);
return i1 == i2; return i1 == i2;
} }
@ -756,7 +756,7 @@ eLand getNewLand(eLand old) {
if(old == laEWater && lchance(old)) return hrand(2) ? laEEarth : laEAir; if(old == laEWater && lchance(old)) return hrand(2) ? laEEarth : laEAir;
if(old == laEFire && lchance(old)) return hrand(2) ? laEEarth : laEAir; if(old == laEFire && lchance(old)) return hrand(2) ? laEEarth : laEAir;
if(tactic::on && !(tactic::trailer && old == firstland)) return firstland; if(tactic::on && !(tactic::trailer && old == specialland)) return specialland;
if(weirdhyperbolic && specialland != old) return specialland; if(weirdhyperbolic && specialland != old) return specialland;
if(yendor::on && (yendor::clev().flags & YF_WALLS)) { if(yendor::on && (yendor::clev().flags & YF_WALLS)) {

View File

@ -518,8 +518,8 @@ void placeCrossroadOrbs(cell *c) {
else continue; else continue;
} }
if(tactic::on) { if(tactic::on && isCrossroads(specialland)) {
if(isCrossroads(tactic::lasttactic) && (oi.flags & orbgenflags::NO_TACTIC)) if(oi.flags & orbgenflags::NO_TACTIC)
continue; continue;
else mintreas = 0; else mintreas = 0;
} }

View File

@ -87,9 +87,11 @@ void initgame() {
firstland = safetyland; firstland = safetyland;
} }
if(peace::on) firstland = specialland; bool use_special_land =
!safety &&
if(tactic::on && geometry) specialland = firstland; (peace::on || tactic::on || geometry || gp::on);
if(use_special_land) firstland = specialland;
if(firstland == laNone || firstland == laBarrier) if(firstland == laNone || firstland == laBarrier)
firstland = laCrossroads; firstland = laCrossroads;
@ -99,17 +101,16 @@ void initgame() {
if(firstland == laHauntedWall) firstland = laGraveyard; if(firstland == laHauntedWall) firstland = laGraveyard;
if(firstland == laMercuryRiver) firstland = laTerracotta; if(firstland == laMercuryRiver) firstland = laTerracotta;
if(firstland == laMountain && !tactic::on) firstland = laJungle; if(firstland == laMountain && !tactic::on) firstland = laJungle;
if(isGravityLand(firstland) && !tactic::on) firstland = weirdhyperbolic ? laCrossroads4 : laCrossroads; if((isGravityLand(firstland) && !isCyclic(firstland)) || firstland == laOcean)
firstland = weirdhyperbolic ? laCrossroads4 : laCrossroads;
cwt.c = currentmap->gamestart(); cwt.spin = 0; cwt.mirrored = false; cwt.c = currentmap->gamestart(); cwt.spin = 0; cwt.mirrored = false;
cwt.c->land = ((geometry || gp::on) && !safety) ? specialland : firstland; cwt.c->land = firstland;
chaosAchieved = false; chaosAchieved = false;
if(firstland == laElementalWall) cwt.c->land = randomElementalLand(); if(firstland == laElementalWall) cwt.c->land = randomElementalLand();
if((tactic::on || weirdhyperbolic) && (isGravityLand(firstland) || firstland == laOcean) && firstland != laMountain)
cwt.c->land = weirdhyperbolic ? laCrossroads4 : nonbitrunc ? laCrossroads : laCrossroads2;
createMov(cwt.c, 0); createMov(cwt.c, 0);
setdist(cwt.c, BARLEV, NULL); setdist(cwt.c, BARLEV, NULL);
@ -141,7 +142,6 @@ void initgame() {
if(tactic::on && tactic::trailer) if(tactic::on && tactic::trailer)
items[treasureType(firstland)] = trailer_cash0; items[treasureType(firstland)] = trailer_cash0;
tactic::lasttactic = firstland;
yendor::lastchallenge = yendor::challenge; yendor::lastchallenge = yendor::challenge;
yendor::init(2); yendor::init(2);
@ -776,16 +776,16 @@ void saveStats(bool emergency = false) {
int xcode = modecode(); int xcode = modecode();
if(tactic::on) { if(tactic::on) {
int score = items[treasureType(tactic::lasttactic)]; int score = items[treasureType(specialland)];
if(score) { if(score) {
int c = int c =
anticheat::certify(dnameof(tactic::lasttactic), turncount, t, (int) timerstart, anticheat::certify(dnameof(specialland), turncount, t, (int) timerstart,
xcode*999 + tactic::id + 256 * score); xcode*999 + tactic::id + 256 * score);
fprintf(f, "TACTICS %s %d %d %d %d %d %d %d %d date: %s\n", VER, fprintf(f, "TACTICS %s %d %d %d %d %d %d %d %d date: %s\n", VER,
tactic::id, tactic::lasttactic, score, turncount, t, int(timerstart), tactic::id, specialland, score, turncount, t, int(timerstart),
c, xcode, buf); c, xcode, buf);
tactic::record(tactic::lasttactic, score); tactic::record(specialland, score);
anticheat::nextid(tactic::id, VER, c); anticheat::nextid(tactic::id, VER, c);
} }
} }

View File

@ -680,7 +680,7 @@ namespace tactic {
int xr = vid.xres / 64; int xr = vid.xres / 64;
if(on) record(firstland, items[treasureType(firstland)]); if(on) record(specialland, items[treasureType(specialland)]);
int xc = modecode(); int xc = modecode();
@ -725,7 +725,7 @@ namespace tactic {
dialog::displayPageButtons(3, true); dialog::displayPageButtons(3, true);
uploadScore(); uploadScore();
if(on) unrecord(firstland); if(on) unrecord(specialland);
if(getcstat >= 1000 && getcstat < 1000 + size(landlist)) { if(getcstat >= 1000 && getcstat < 1000 + size(landlist)) {
int ld = landlist[getcstat-1000]; int ld = landlist[getcstat-1000];
@ -741,7 +741,7 @@ namespace tactic {
keyhandler = [] (int sym, int uni) { keyhandler = [] (int sym, int uni) {
if(uni >= 1000 && uni < 1000 + size(landlist)) { if(uni >= 1000 && uni < 1000 + size(landlist)) {
firstland = specialland = landlist[uni - 1000]; specialland = landlist[uni - 1000];
restartGame(tactic::on ? 0 : rg::tactic); restartGame(tactic::on ? 0 : rg::tactic);
} }
else if(uni == '0') { else if(uni == '0') {