mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-08-31 01:37:57 +00:00
customize land mode
This commit is contained in:
18
landgen.cpp
18
landgen.cpp
@@ -171,8 +171,8 @@ EX void place_elemental_wall(cell *c) {
|
||||
else if(c->land == laEEarth) c->wall = waStone;
|
||||
}
|
||||
|
||||
// automatically adjust monster generation for 3D geometries
|
||||
EX int hrand_monster(int x) {
|
||||
// automatically adjust monster generation for 3D geometries and custom difficulty
|
||||
EX int hrand_monster_in(eLand l, int x) {
|
||||
// dual geometry mode is much harder, so generate less monsters to balance it
|
||||
if(dual::state) x *= 3;
|
||||
// in 3D monster generation depends on the sight range
|
||||
@@ -180,9 +180,15 @@ EX int hrand_monster(int x) {
|
||||
int t = isize(gmatrix);
|
||||
if(t > 500) x = int(((long long)(x)) * t / 500);
|
||||
}
|
||||
if(use_custom_land_list) {
|
||||
x = x * 100 / custom_land_difficulty[l];
|
||||
if(x == 0) x = 1;
|
||||
}
|
||||
return hrand(x);
|
||||
}
|
||||
|
||||
#define hrand_monster(x) hrand_monster_in(c->land, x)
|
||||
|
||||
EX bool is_zebra_trapdoor(cell *c) {
|
||||
if(euclid && closed_or_bounded) return false;
|
||||
#if CAP_ARCM
|
||||
@@ -280,6 +286,12 @@ EX void gen_baby_tortoise(cell *c) {
|
||||
tortoise::babymap[c] = tortoise::getb(c) ^ tortoise::getRandomBits();
|
||||
}
|
||||
|
||||
EX int rebalance_treasure(int x, int y, eLand l) {
|
||||
int res = ((tactic::on || quotient == 2 || daily::on) ? (y) : inv::on ? min(2*(y),x) : (x));
|
||||
if(use_custom_land_list) res = (res * custom_land_treasure[l] + 50) / 100;
|
||||
return res;
|
||||
}
|
||||
|
||||
EX void giantLandSwitch(cell *c, int d, cell *from) {
|
||||
bool fargen = d == 9;
|
||||
switch(c->land) {
|
||||
@@ -3139,4 +3151,6 @@ EX void setdist(cell *c, int d, cell *from) {
|
||||
#endif
|
||||
}
|
||||
|
||||
#undef hrand_monster
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user