From 1de906200b304c683cc333f104acf3c3ec3383be Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Mon, 14 Aug 2017 21:13:06 +0200 Subject: [PATCH] fine-tuning the Hyperstone Quest in OSM --- help.cpp | 15 +++++++++++++++ inventory.cpp | 51 ++++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 61 insertions(+), 5 deletions(-) diff --git a/help.cpp b/help.cpp index 0682a27f..d167c440 100644 --- a/help.cpp +++ b/help.cpp @@ -261,6 +261,14 @@ string generateHelpForItem(eItem it) { "You can gain further Orbs of the Mirror by collecting 2, 4, 8..." ); + if(it == itPower) + help += XLAT( + "\n\nThe amount of Orbs obtained by using Orbs of Mirroring is " + "multiplied by sqrt(1+p/20), where p is the number of Powerstones " + "collected. This also affects the mirrorings which happened before " + "collecting the Powerstones." + ); + if(it == itOrbLuck) help += XLAT( "\n\nIn the Orb Strategy Mode, the Orb of Luck also " @@ -430,6 +438,13 @@ string generateHelpForLand(eLand l) { l == laReptile || l == laIvoryTower) TREQ(R30) + if(l == laPower && inv::on) + help += XLAT( + "\n\nThe amount of Orbs obtained by using Orbs of Mirroring is " + "multiplied by sqrt(1+p/20), where p is the number of Powerstones " + "collected. This also affects the mirrorings which happened before " + "collecting the Powerstones." + ); if(isCoastal(l)) s += XLAT("Coastal region -- connects inland and aquatic regions.\n"); diff --git a/inventory.cpp b/inventory.cpp index 1b92eb20..57629359 100644 --- a/inventory.cpp +++ b/inventory.cpp @@ -16,8 +16,34 @@ namespace inv { static const int MIRRORED = 1000; static const int TESTMIRRORED = 900; + + struct lateextraorb { + eItem treasure; + eItem orb; + int at; + }; - int mirrorqty(eItem orb) { + vector lateextraorbs = { + {itPower, itOrbFlash}, + {itPower, itOrbSpeed}, + {itPower, itOrbAether}, + {itPower, itOrbWinter}, + + {itTrollEgg, itOrbFish}, + {itTrollEgg, itOrbStunning}, + {itTrollEgg, itOrbLuck}, + {itTrollEgg, itOrbLife}, + {itTrollEgg, itOrbDigging}, + {itTrollEgg, itOrbSpace}, + + {itFulgurite, itOrbLightning}, + {itWindstone, itOrbSpeed}, + {itDragon, itOrbDragon}, + {itSlime, itOrbFlash}, + {itDodeca, itOrbShield} + }; + + int mirrorqty0(eItem orb) { if(shmup::on && isShmupLifeOrb(orb)) return 3; if(orb == itOrbWater) return 10; @@ -54,6 +80,10 @@ namespace inv { if(orb == itOrbMirror) return 1; return 3; } + + int mirrorqty(eItem orb) { + return int(mirrorqty0(orb) * sqrt(1.000001+items[itPower]/20.)); + } struct nextinfo { int min, real, max; }; @@ -138,7 +168,11 @@ namespace inv { void compute() { for(int i=0; i= TESTMIRRORED) remaining[i] += MIRRORED; + for(int i=0; i= TESTMIRRORED) { + remaining[i] += MIRRORED; + remaining[i] -= mirrorqty0(eItem(i)); + remaining[i] += mirrorqty(eItem(i)); + } sirand(rseed); @@ -183,6 +217,11 @@ namespace inv { gainRandomOrbs(elementalOrbs, itElemental, 12, 0); gainRandomOrbs(demonicOrbs, itHell, 20, 100); + for(auto& it: lateextraorbs) { + it.at = 10 + irand(41); + if(items[it.treasure] >= it.at) remaining[it.orb]++; + } + if(items[itOrbLove] && !items[itSavedPrincess]) items[itSavedPrincess] = 1; int& r = remaining[itGreenStone]; @@ -190,7 +229,7 @@ namespace inv { if(items[itBone] >= 0) { for(int i=0; i= TESTMIRRORED) r -= (MIRRORED - mirrorqty(eItem(i))); + if(usedup[i] >= TESTMIRRORED) r -= (MIRRORED - mirrorqty0(eItem(i))); } } @@ -350,6 +389,8 @@ namespace inv { if(isIn(which, offensiveOrbs)) extras += extraline(itBone, its(items[itBone]/25*25+25) + "?"); if(isIn(which, elementalOrbs)) extras += extraline(itElemental, its(items[itBone]/20*20+20) + "?"); if(isIn(which, demonicOrbs)) extras += extraline(itHell, its(max(125, items[itHell]/25*25+25)) + "?"); + for(auto& a: lateextraorbs) if(a.orb == which) + extras += extraline(a.treasure, items[a.treasure] >= a.at ? (its(a.at)+"!") : "10-50"); if(extras != "") displaystr(vid.xres/2, vid.fsize*5, 2, vid.fsize, XLAT("Extras:")+extras, icol, 8); @@ -358,7 +399,7 @@ namespace inv { if(remaining[which] != 1 || usedup[which]) { string s = XLAT("Number of uses left: %1", its(remaining[which])); int us = usedup[which]; - if(us >= TESTMIRRORED) s += XLAT(" (mirrored)"), us = us - MIRRORED + mirrorqty(which); + if(us >= TESTMIRRORED) s += XLAT(" (mirrored)"), us = us - MIRRORED + mirrorqty0(which); if(us) s += XLAT(" (used %1 times)", its(us)); displaystr(vid.xres/2, vid.yres - vid.fsize*6, 2, vid.fsize, s, icol, 8); } @@ -412,7 +453,7 @@ namespace inv { else if(remaining[orb] > 0) { usedup[itOrbMirror]++; usedup[orb] += MIRRORED; - usedup[orb] -= mirrorqty(orb); + usedup[orb] -= mirrorqty0(orb); addMessage(XLAT("You mirror %the1.", orb)); mirroring = false; }