From 49ba1a7fc40bc3aacfd8cac5dba902bfb91e77fb Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 22 May 2021 01:40:55 +0200 Subject: [PATCH] Orb of Luck improved --- flags.cpp | 4 ++++ help.cpp | 13 +++++++++++++ landgen.cpp | 8 ++++---- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/flags.cpp b/flags.cpp index 4a4bc7bf..0466325c 100644 --- a/flags.cpp +++ b/flags.cpp @@ -292,6 +292,10 @@ EX bool isPermanentFlying(eMonster m) { return m == moAirElemental || isGhostAether(m); } +EX bool isLuckyLand(eLand l) { + return among(l, laIce, laDesert, laDeadCaves, laOvergrown); + } + EX bool survivesFire(eMonster m) { return isGhostAether(m) || m == moWitchWinter || m == moWitchGhost || diff --git a/help.cpp b/help.cpp index b8859cc5..5998ac88 100644 --- a/help.cpp +++ b/help.cpp @@ -458,6 +458,19 @@ EX string generateHelpForItem(eItem it) { "and sub-lands." ); + if(it == itOrbLuck) { + help += XLAT("\n\nAdditionally, the probabilities of generating terrain features are subtly changed in the following lands:"); + + int cnt = 0; + for(int i=0; iwall == waIcewall && items[itDiamond] >= 5 && hrand(200) == 1) + if(c->wall == waIcewall && items[itDiamond] >= 5 && hrand(items[itOrbLuck] ? 50 : 200) == 1) c->wall = waBonfireOff; } if(d == 8 && BARLEV == 8) { @@ -1104,7 +1104,7 @@ EX void giantLandSwitch(cell *c, int d, cell *from) { case laDeadCaves: if(fargen) { int die = (randomPatternsMode ? (RANDPAT?100:0) : hrand(100)); - if(die<50) c->wall = waDeadwall; + if(die<(items[itOrbLuck] ? 48 : 50)) c->wall = waDeadwall; else if(die<55) c->wall = waDeadfloor2; else c->wall = waDeadfloor; } @@ -1233,7 +1233,7 @@ EX void giantLandSwitch(cell *c, int d, cell *from) { c->wall = RANDPAT ? waNone : RANDPATV(laWineyard) ? waBigTree : waSmallTree; else c->wall = - (hrand(50+items[itMutant]/2+yendor::hardness()) < 30) ? (hrand(100) < 50 ? waBigTree : waSmallTree) : waNone; + (hrand(50+items[itMutant]/2+yendor::hardness()-(items[itOrbLuck]?10:0)) < 30) ? (hrand(100) < 50 ? waBigTree : waSmallTree) : waNone; } if(d == 8) { bool ok = c->landparam == 0; @@ -1835,7 +1835,7 @@ EX void giantLandSwitch(cell *c, int d, cell *from) { } } - if(hrand(300) == 1 && items[itSpice] >= 5) c->wall = waThumperOff; + if(hrand(items[itOrbLuck] ? 100 : 300) == 1 && items[itSpice] >= 5) c->wall = waThumperOff; } ONEMPTY { if(hrand(5000) < PT(100 + 2 * (kills[moWorm] + kills[moDesertman]), 200) && notDippingFor(itSpice))