mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-05-05 16:54:08 +00:00
fixed some bugs with Snake Nest generation
This commit is contained in:
parent
0c0f16ab12
commit
e77314dbc1
@ -1789,8 +1789,9 @@ bool drawMonster(const transmatrix& Vparam, int ct, cell *c, int col) {
|
|||||||
int d = c->mondir;
|
int d = c->mondir;
|
||||||
if(d == NODIR)
|
if(d == NODIR)
|
||||||
forCellIdEx(c2, i, c)
|
forCellIdEx(c2, i, c)
|
||||||
if(c2->monst == moHexSnakeTail && c2->mondir == c->spin(i))
|
if(among(c2->monst, moHexSnakeTail, moHexSnake) && c2->mondir == c->spin(i))
|
||||||
d = i;
|
d = i;
|
||||||
|
if(d == NODIR) { d = hrand(c->type); createMov(c, d); }
|
||||||
int c1 = nestcolors[pattern_threecolor(c)];
|
int c1 = nestcolors[pattern_threecolor(c)];
|
||||||
int c2 = nestcolors[pattern_threecolor(c->mov[d])];
|
int c2 = nestcolors[pattern_threecolor(c->mov[d])];
|
||||||
col = (c1 + c2); // sum works because they are dark and should be brightened
|
col = (c1 + c2); // sum works because they are dark and should be brightened
|
||||||
|
@ -1521,7 +1521,7 @@ void giantLandSwitch(cell *c, int d, cell *from) {
|
|||||||
ONEMPTY {
|
ONEMPTY {
|
||||||
if(hrand(30000) < 30+items[itRedGem]+yendor::hardness() && !c->monst && !c->wall && !peace::on) {
|
if(hrand(30000) < 30+items[itRedGem]+yendor::hardness() && !c->monst && !c->wall && !peace::on) {
|
||||||
vector<int> gooddir;
|
vector<int> gooddir;
|
||||||
for(int t=0; t<c->type; t++) if(c->mov[t]->mpdist > c->mpdist && !pseudohept(c->mov[t]))
|
for(int t=0; t<c->type; t++) if(c->mov[t]->mpdist > c->mpdist)
|
||||||
gooddir.push_back(t);
|
gooddir.push_back(t);
|
||||||
if(size(gooddir))
|
if(size(gooddir))
|
||||||
generateSnake(c, gooddir[hrand(size(gooddir))]);
|
generateSnake(c, gooddir[hrand(size(gooddir))]);
|
||||||
|
@ -656,7 +656,7 @@ void generateSnake(cell *c, int i) {
|
|||||||
if(c3->monst || c3->bardir != NODIR || c3->wall) break;
|
if(c3->monst || c3->bardir != NODIR || c3->wall) break;
|
||||||
c2 = c3;
|
c2 = c3;
|
||||||
c2->monst = moHexSnakeTail;
|
c2->monst = moHexSnakeTail;
|
||||||
i = (j + (c2->type%4 == 0 ? c2->type/2 : (len%2 ? 2 : c2->type - 2))) % S6;
|
i = (j + (c2->type%4 == 0 ? c2->type/2 : (len%2 ? 2 : c2->type - 2))) % c2->type;
|
||||||
createMov(c2, i);
|
createMov(c2, i);
|
||||||
if(!inpair(c2->mov[i], cpair)) {
|
if(!inpair(c2->mov[i], cpair)) {
|
||||||
vector<int> goodsteps;
|
vector<int> goodsteps;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user