From a3acd688805e9440679339b4928e37e85f180c4f Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Wed, 3 Jan 2018 22:10:52 +0100 Subject: [PATCH] fixed stalemate wrt the other moPair; fixed Magnetic warnings; improved Ruins balance; added the cases for Ruin Walls --- flags.cpp | 2 +- game.cpp | 15 ++++++++++++--- landgen.cpp | 4 ++-- landlock.cpp | 10 ++++++++++ orbgen.cpp | 2 +- orbs.cpp | 2 ++ 6 files changed, 28 insertions(+), 7 deletions(-) diff --git a/flags.cpp b/flags.cpp index f646bcf9..ba07ae62 100644 --- a/flags.cpp +++ b/flags.cpp @@ -277,7 +277,7 @@ int itemclass(eItem i) { i == itGreenGrass || i == itBull || i == itLavaLily || i == itHunting || i == itBlizzard || i == itTerra || i == itGlowCrystal || i == itSnake || - i == itDock || i == itRuins || i == itSwitch + i == itDock || i == itRuins || i == itSwitch || i == itMagnet ) return IC_TREASURE; if(i == itSavedPrincess || i == itStrongWind || i == itWarning) diff --git a/game.cpp b/game.cpp index 53ba7430..400c3fd0 100644 --- a/game.cpp +++ b/game.cpp @@ -1054,6 +1054,9 @@ bool stalemate1::isKilled(cell *w) { if(head1 == head2 && dragon::totalhp(head1) ==1) return true; } + if((w->monst == moPair || isMagneticPole(w->monst)) && killed && w->mov[w->mondir] == killed) + return true; + if(w->monst == moKrakenT && killed && killed->monst == moKrakenT && killed->hitpoints) { cell *head1 = w->mov[w->mondir]; cell *head2 = killed->mov[killed->mondir]; @@ -1485,7 +1488,7 @@ void prespill(cell* c, eWall t, int rad, cell *from) { c->wall == waVinePlant || isFire(c) || c->wall == waBonfireOff || c->wall == waVineHalfA || c->wall == waVineHalfB || c->wall == waCamelotMoat || c->wall == waSea || c->wall == waCTree || c->wall == waRubble || c->wall == waGargoyleFloor || c->wall == waGargoyle || - c->wall == waRose || c->wall == waPetrified || c->wall == waPetrifiedBridge) + c->wall == waRose || c->wall == waPetrified || c->wall == waPetrifiedBridge || c->wall == waRuinWall) t = waTemporary; if(c->wall == waSulphur) { @@ -1540,7 +1543,7 @@ bool earthFloor(cell *c) { if(c->wall == waDeadwall) { c->wall = waDeadfloor; return true; } if(c->wall == waDune) { c->wall = waNone; return true; } if(c->wall == waStone && c->land != laTerracotta) { c->wall = waNone; return true; } - if(c->wall == waAncientGrave || c->wall == waFreshGrave) { + if(c->wall == waAncientGrave || c->wall == waFreshGrave || c->wall == waRuinWall) { c->wall = waNone; return true; } @@ -1591,6 +1594,11 @@ bool earthWall(cell *c) { c->wall = waDune; return true; } + if(c->wall == waNone && c->land == laRuins) { + c->item = itNone; + c->wall = waRuinWall; + return true; + } if(c->wall == waNone && isElemental(c->land)) { c->item = itNone; c->wall = waStone; @@ -1768,7 +1776,7 @@ void explodeMine(cell *c) { placeWater(c, c); } else if(c2->wall == waPalace || c2->wall == waOpenGate || c2->wall == waClosedGate || - c2->wall == waSandstone || c2->wall == waMetal || c2->wall == waSaloon) { + c2->wall == waSandstone || c2->wall == waMetal || c2->wall == waSaloon || c2->wall == waRuinWall) { c2->wall = waNone; makeflame(c2, 10, false); } @@ -3962,6 +3970,7 @@ void explodeAround(cell *c) { if(c2->wall == waPlatform) c2->wall = waNone; if(c2->wall == waStone) c2->wall = waNone, destroyTrapsAround(c2); if(c2->wall == waRose) c2->wall = waNone; + if(c2->wall == waRuinWall) c2->wall = waNone; if(c2->wall == waLadder) c2->wall = waNone; if(c2->wall == waGargoyle) c2->wall = waNone; if(c2->wall == waSandstone) c2->wall = waNone; diff --git a/landgen.cpp b/landgen.cpp index 0f88d950..95ca5dfc 100644 --- a/landgen.cpp +++ b/landgen.cpp @@ -1925,7 +1925,7 @@ void giantLandSwitch(cell *c, int d, cell *from) { forCellEx(c2, c) if(out_ruin(c2)) c->wall = waRuinWall; } - if(hrand(50000) < kf && !c->monst && !c->wall) { + if(hrand(40000) < kf && !c->monst && !c->wall) { cell *c1 = c; cell *c2 = createMov(c1, hrand(c1->type)); if(c2->monst || c2->wall) return; @@ -1936,7 +1936,7 @@ void giantLandSwitch(cell *c, int d, cell *from) { } } ONEMPTY { - if(hrand(10000) < kf && !c->monst) { + if(hrand(7000) < kf && !c->monst) { c->monst = pick(moHexDemon, moHexDemon, moHexDemon, moAltDemon, moAltDemon, moMonk, moMonk, moSkeleton, moSkeleton, moCrusher); c->hitpoints = 3; } diff --git a/landlock.cpp b/landlock.cpp index 5cd78fb5..6f64a5b5 100644 --- a/landlock.cpp +++ b/landlock.cpp @@ -215,6 +215,9 @@ int isNative(eLand l, eMonster m) { case laRuins: return among(m, moPair, moHexDemon, moAltDemon, moMonk, moCrusher) ? 2 : m == moSkeleton ? 1 : 0; + + case laMagnetic: + return isMagneticPole(m) ? 2 : 0; } return false; } @@ -311,6 +314,7 @@ eItem treasureType(eLand l) { case laDocks: return itDock; case laRuins: return itRuins; case laSwitch: return itSwitch; + case laMagnetic: return itMagnet; case laCA: return itNone; } @@ -549,6 +553,9 @@ bool landUnlocked(eLand l) { case laRuins: return kills[moSkeleton]; + + case laMagnetic: + return false; // not implemented } return false; } @@ -1222,6 +1229,9 @@ int isLandValid(eLand l) { if(l == laStorms && torus) return 3; + + if(l == laMagnetic) + return 0; return 2; } diff --git a/orbgen.cpp b/orbgen.cpp index 0d7f7805..d8dfd8da 100644 --- a/orbgen.cpp +++ b/orbgen.cpp @@ -114,7 +114,7 @@ const orbinfo orbinfos[ORBLINES] = { {orbgenflags::S_GUEST, laSwitch, 2000, 0, itOrbSpace}, {orbgenflags::S_NATIVE, laSwitch, 2000, 3000, itOrbPhasing}, {orbgenflags::S_NATIVE, laMagnetic, 2000, 3000, itOrbMagnetism}, - {orbgenflags::S_NATIVE, laRuins, 2000, 3000, itOrbSlaying}, + {orbgenflags::S_NATIVE, laRuins, 1200, 2500, itOrbSlaying}, {orbgenflags::S_NATIVE, laWhirlpool, 0, 2000, itOrbWater}, // needs to be last }; diff --git a/orbs.cpp b/orbs.cpp index 1f3af3e2..cbfec4fc 100644 --- a/orbs.cpp +++ b/orbs.cpp @@ -187,6 +187,7 @@ void flashCell(cell *c, eMonster killer, flagtype flags) { if(c->wall == waGiantRug) c->wall = waNone; if(c->wall == waMirror) c->wall = waNone; if(c->wall == waCloud) c->wall = waNone; + if(c->wall == waRuinWall) c->wall = waNone; if(c->wall == waDune) c->wall = waNone; if(c->wall == waSaloon) c->wall = waNone; if(c->wall == waSandstone) c->wall = waNone; @@ -379,6 +380,7 @@ void castLightningBolt(cellwalker lig) { if(c->wall == waDeadwall) c->wall = waDeadfloor2, brk = true; if(c->wall == waGlass) c->wall = waNone, spin = true; if(c->wall == waDune) c->wall = waNone, brk = true; + if(c->wall == waRuinWall) c->wall = waNone; if(c->wall == waIcewall) c->wall = waNone, brk = true; if(c->wall == waAncientGrave) c->wall = waNone, spin = true; if(c->wall == waFreshGrave) c->wall = waNone, spin = true;