mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-17 18:54:48 +00:00
extra safety in dual
This commit is contained in:
parent
9bec1bc96e
commit
44890b4fb2
17
orbgen.cpp
17
orbgen.cpp
@ -443,14 +443,27 @@ int treasureForLocal() {
|
|||||||
return (chaosmode ? 1+hrand(10) : 10);
|
return (chaosmode ? 1+hrand(10) : 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool extra_safety_for_memory(cell *c) {
|
||||||
|
if(hyperbolic && (archimedean || S3 > 3) && !quotient && !tactic::on && in_full_game()) {
|
||||||
|
if(hrand(1000) < 1) {
|
||||||
|
c->item = itOrbSafety;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
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;
|
||||||
if(isGravityLand(l) && l != laWestWall && cellEdgeUnstable(c)) return;
|
if(isGravityLand(l) && l != laWestWall && cellEdgeUnstable(c)) return;
|
||||||
if(isElemental(l)) l = laElementalWall;
|
if(isElemental(l)) l = laElementalWall;
|
||||||
if(peace::on) return;
|
|
||||||
if(daily::on) return;
|
if(daily::on) return;
|
||||||
|
|
||||||
|
if(extra_safety_for_memory(c)) return;
|
||||||
|
|
||||||
|
if(peace::on) return;
|
||||||
|
|
||||||
for(auto& oi: orbinfos) {
|
for(auto& oi: orbinfos) {
|
||||||
if(!(oi.flags & orbgenflags::LOCAL10)) continue;
|
if(!(oi.flags & orbgenflags::LOCAL10)) continue;
|
||||||
if(oi.l != l) continue;
|
if(oi.l != l) continue;
|
||||||
@ -483,7 +496,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 || daily::on) return;
|
if(safety || daily::on || extra_safety_for_memory(c) || peace::on) return;
|
||||||
int i = hrand(outof);
|
int i = hrand(outof);
|
||||||
if(i < loc && items[treasureType(c->land)] >= treasureForLocal() && !inv::on)
|
if(i < loc && items[treasureType(c->land)] >= treasureForLocal() && !inv::on)
|
||||||
c->item = nativeOrbType(c->land);
|
c->item = nativeOrbType(c->land);
|
||||||
|
Loading…
Reference in New Issue
Block a user