mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-25 01:20:37 +00:00
ls:: Hive in H/V
This commit is contained in:
parent
d4247e7b13
commit
ec4b02d754
@ -34,7 +34,7 @@ EX bool checkBarriersFront(cellwalker bb, int q IS(5), bool cross IS(false)) {
|
||||
|
||||
/** return true if the cell c is not allowed to generate barriers because of other large things already existing nearby. */
|
||||
EX bool hasbardir(cell *c) {
|
||||
return c->bardir != NODIR && c->bardir != NOBARRIERS;
|
||||
return c->bardir != NODIR && c->bardir != NOBARRIERS && c->bardir != NOBARRIERS2;
|
||||
}
|
||||
|
||||
EX void preventbarriers(cell *c) {
|
||||
|
@ -274,7 +274,7 @@ void celldrawer::setcolors() {
|
||||
if(c->wall == waWaxWall) wcol = c->landparam;
|
||||
if(items[itOrbInvis] && c->wall == waNone && c->landparam)
|
||||
fcol = gradient(fcol, 0xFF0000, 0, c->landparam, 100);
|
||||
if(c->bardir == NOBARRIERS && c->barleft)
|
||||
if(among(int(c->bardir), NOBARRIERS, NOBARRIERS2) && c->barleft)
|
||||
fcol = minf[moBug0+c->barright].color;
|
||||
break;
|
||||
case laSwitch:
|
||||
|
11
complex.cpp
11
complex.cpp
@ -1993,21 +1993,23 @@ EX namespace hive {
|
||||
if(ls::any_chaos() && getDistLimit() <= 5) radius = 4;
|
||||
if(getDistLimit() <= 3) radius = 3;
|
||||
|
||||
for(int i=(ls::any_chaos()?0:2); i<radius; i++)
|
||||
for(int i=(ls::any_chaos()?0:2); i<radius; i++) {
|
||||
bf += revstep;
|
||||
if(ls::horodisk_structure()) moreBigStuff(bf.at);
|
||||
}
|
||||
cell *citycenter = bf.at;
|
||||
buginfo.clear();
|
||||
|
||||
|
||||
// mark the area with BFS
|
||||
bugcitycell(citycenter, 0);
|
||||
for(int i=0; i<isize(buginfo); i++) {
|
||||
buginfo_t& b(buginfo[i]);
|
||||
cell *c = b.where;
|
||||
int d = b.dist[0];
|
||||
if(ls::hv_structure()) moreBigStuff(c);
|
||||
// ERRORS!
|
||||
if(c->land != laHive && c->land != laNone) return;
|
||||
if(c->bardir != NODIR) return;
|
||||
if(ls::horodisk_structure() ? c->bardir != NOBARRIERS : c->bardir != NODIR) return;
|
||||
if(c->land == laHive && c->landparam >= 100) return;
|
||||
// bfs
|
||||
if(d < radius) for(int t=0; t<c->type; t++)
|
||||
@ -2021,7 +2023,8 @@ EX namespace hive {
|
||||
int d = b.dist[0];
|
||||
if(d <= 1 && c->wall == waNone)
|
||||
c->item = itRoyalJelly;
|
||||
preventbarriers(c);
|
||||
if(ls::horodisk_structure()) c->bardir = NOBARRIERS2;
|
||||
else preventbarriers(c);
|
||||
if(d == 9 || d == 6 || d == 3)
|
||||
c->barleft = eLand(d/3),
|
||||
c->barright = eLand(k);
|
||||
|
@ -1643,8 +1643,9 @@ EX void giantLandSwitch(cell *c, int d, cell *from) {
|
||||
|
||||
case laHive:
|
||||
if(fargen) {
|
||||
if(hrand(2000) < (ls::tame_chaos() ? 1000 : (PURE && !ls::any_chaos()) ?200: ls::any_chaos() ? 10 : 2) && !safety)
|
||||
if(hrand(2000) < (ls::tame_chaos() ? 1000 : (PURE && !ls::any_chaos()) ?200: ls::any_chaos() ? 10 : ls::horodisk_structure() ? 50 : ls::hv_structure() ? 10 : 2) && !safety)
|
||||
hive::createBugArmy(c);
|
||||
if(hrand_monster(20000) < 10 && ls::horodisk_structure()) c->monst = moPirate;
|
||||
if(hrand(2000) < 100 && !c->wall && !c->item && !c->monst) {
|
||||
int nww = 0;
|
||||
for(int i=0; i<c->type; i++) if(c->move(i) && c->move(i)->wall == waWaxWall)
|
||||
|
@ -20,6 +20,7 @@ extern int cellcount, heptacount;
|
||||
|
||||
#define NODIR 126
|
||||
#define NOBARRIERS 127
|
||||
#define NOBARRIERS2 125
|
||||
|
||||
/** \brief Cell information for the game. struct cell builds on this */
|
||||
struct gcell {
|
||||
|
Loading…
Reference in New Issue
Block a user