1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-01-11 18:00:34 +00:00

relaxed local orb generation rule in the Chaos Mode implemented in special cases too

This commit is contained in:
Zeno Rogue 2017-10-11 23:23:22 +02:00
parent 623839be07
commit c18efff9df
2 changed files with 10 additions and 5 deletions

View File

@ -231,7 +231,7 @@ void giantLandSwitch(cell *c, int d, cell *from) {
if(hrand(5000) < PT(100 + 2 * (kills[moPalace] + kills[moFatGuard] + kills[moVizier] + kills[moSkeleton]), 200) && notDippingFor(itPalace) && if(hrand(5000) < PT(100 + 2 * (kills[moPalace] + kills[moFatGuard] + kills[moVizier] + kills[moSkeleton]), 200) && notDippingFor(itPalace) &&
c->wall != waOpenGate && !lookingForPrincess0) c->wall != waOpenGate && !lookingForPrincess0)
c->item = itPalace; c->item = itPalace;
if(items[itPalace] >= 10 && hrand(5000) < 16 && c->wall != waOpenGate && !inv::on && !peace::on) if(items[itPalace] >= treasureForLocal() && hrand(5000) < 16 && c->wall != waOpenGate && !inv::on && !peace::on)
c->item = hrand(100) < 80 ? itOrbFrog : itOrbDiscord; c->item = hrand(100) < 80 ? itOrbFrog : itOrbDiscord;
if(hrand(5000) < 20*PRIZEMUL && c->wall != waOpenGate) if(hrand(5000) < 20*PRIZEMUL && c->wall != waOpenGate)
placePrizeOrb(c); placePrizeOrb(c);
@ -1059,7 +1059,7 @@ void giantLandSwitch(cell *c, int d, cell *from) {
c->monst = moCultistLeader; c->monst = moCultistLeader;
else if(hrand(5000) < 250 && !peace::on) else if(hrand(5000) < 250 && !peace::on)
c->item = itGrimoire; c->item = itGrimoire;
else if(hrand(5000) < 10 && (chaosmode ? items[itGrimoire] >= 10 : -d > TEMPLE_EACH * 10) && !peace::on && !inv::on) else if(hrand(5000) < 10 && (chaosmode ? items[itGrimoire] >= treasureForLocal() : -d > TEMPLE_EACH * 10) && !peace::on && !inv::on)
c->item = itOrbDragon; c->item = itOrbDragon;
} }
} }
@ -1537,7 +1537,7 @@ void giantLandSwitch(cell *c, int d, cell *from) {
c->item = itCoast; c->item = itCoast;
if(hrand(15000) < 10 + 2 * items[itCoast] + 2 * yendor::hardness()) if(hrand(15000) < 10 + 2 * items[itCoast] + 2 * yendor::hardness())
c->monst = moAlbatross; c->monst = moAlbatross;
if(items[itCoast] >= 10 && hrand(10000) < 5 && !peace::on && !inv::on) if(items[itCoast] >= treasureForLocal() && hrand(10000) < 5 && !peace::on && !inv::on)
c->item = itOrbAir; c->item = itOrbAir;
else placeLocalSpecial(c, 10000, 6, 5); else placeLocalSpecial(c, 10000, 6, 5);
buildPrizeMirror(c, 2000); buildPrizeMirror(c, 2000);

View File

@ -423,6 +423,11 @@ void placePrizeOrb(cell *c) {
// printf("land: %s orb: %s\n", dnameof(l), dnameof(c->item)); // printf("land: %s orb: %s\n", dnameof(l), dnameof(c->item));
} }
// 10 not in chaos, less in chaos
int treasureForLocal() {
return (chaosmode ? 1+hrand(10) : 10);
}
void placeLocalOrbs(cell *c) { void placeLocalOrbs(cell *c) {
eLand l = c->land; eLand l = c->land;
if(l == laZebra && c->wall == waTrapdoor) return; if(l == laZebra && c->wall == waTrapdoor) return;
@ -442,7 +447,7 @@ void placeLocalOrbs(cell *c) {
ch = 0; ch = 0;
if(tactic::trailer && ch < 5) ch = 0; if(tactic::trailer && ch < 5) ch = 0;
int tc = items[treasureType(oi.l)] * landMultiplier(oi.l); int tc = items[treasureType(oi.l)] * landMultiplier(oi.l);
int tcmin = (chaosmode ? 1+hrand(10) : 10); int tcmin = treasureForLocal();
if(inv::on) { if(inv::on) {
if(!(oi.flags & orbgenflags::OSM_LOCAL25)) if(!(oi.flags & orbgenflags::OSM_LOCAL25))
tc = 0; tc = 0;
@ -465,7 +470,7 @@ void placeLocalOrbs(cell *c) {
void placeLocalSpecial(cell *c, int outof, int loc=1, int priz=1) { void placeLocalSpecial(cell *c, int outof, int loc=1, int priz=1) {
if(peace::on || safety) return; if(peace::on || safety) return;
int i = hrand(outof); int i = hrand(outof);
if(i < loc && items[treasureType(c->land)] >= 10 && !inv::on) if(i < loc && items[treasureType(c->land)] >= treasureForLocal() && !inv::on)
c->item = nativeOrbType(c->land); c->item = nativeOrbType(c->land);
else if(i >= loc && i < loc + PRIZEMUL * priz) else if(i >= loc && i < loc + PRIZEMUL * priz)
placePrizeOrb(c); placePrizeOrb(c);