mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-04-09 12:16:45 +00:00
Rock Snakes from the Snake Nest now keep their colors in other lands
This commit is contained in:
parent
9e712ae8ea
commit
95a2f617cf
2
game.cpp
2
game.cpp
@ -4613,7 +4613,7 @@ vector<cell*> hexdfs;
|
||||
void moveHexSnake(cell *from, cell *c, int d, bool mounted) {
|
||||
if(from->wall == waBoat) from->wall = waSea;
|
||||
moveEffect(from, c, c->monst);
|
||||
from->monst = c->monst; from->mondir = d;
|
||||
from->monst = c->monst; from->mondir = d; from->hitpoints = c->hitpoints;
|
||||
c->monst = moHexSnakeTail;
|
||||
preventbarriers(from);
|
||||
|
||||
|
@ -1826,7 +1826,7 @@ bool drawMonster(const transmatrix& Vparam, int ct, cell *c, int col) {
|
||||
|
||||
if(isIvy(c) || isWorm(c) || isMutantIvy(c) || c->monst == moFriendlyIvy) {
|
||||
|
||||
if((m == moHexSnake || m == moHexSnakeTail) && c->land == laSnakeNest) {
|
||||
if((m == moHexSnake || m == moHexSnakeTail) && c->hitpoints == 2) {
|
||||
int d = c->mondir;
|
||||
if(d == NODIR)
|
||||
forCellIdEx(c2, i, c)
|
||||
|
@ -1626,7 +1626,7 @@ void giantLandSwitch(cell *c, int d, cell *from) {
|
||||
for(int t=0; t<c->type; t++) if(c->mov[t]->mpdist > c->mpdist && !pseudohept(c->mov[t]))
|
||||
i = t;
|
||||
if(i != -1 && !peace::on)
|
||||
generateSnake(c, i);
|
||||
generateSnake(c, i, 1);
|
||||
}
|
||||
else if(hrand(16000) < 50+items[itRedGem]+yendor::hardness() && (nonbitrunc?hrand(10)<3:!ishept(c)) && !c->monst)
|
||||
c->monst = moRedTroll,
|
||||
@ -1641,7 +1641,7 @@ void giantLandSwitch(cell *c, int d, cell *from) {
|
||||
for(int t=0; t<c->type; t++) if(c->mov[t]->mpdist > c->mpdist)
|
||||
gooddir.push_back(t);
|
||||
if(size(gooddir))
|
||||
generateSnake(c, gooddir[hrand(size(gooddir))]);
|
||||
generateSnake(c, gooddir[hrand(size(gooddir))], 2);
|
||||
}
|
||||
else if(hrand(10000) < items[itSnake] - 10 + yendor::hardness() && !c->monst && !c->wall && !peace::on) {
|
||||
c->monst = pick(moRedTroll, moMiner, moSkeleton, moBomberbird);
|
||||
|
@ -673,8 +673,9 @@ void wandering() {
|
||||
}
|
||||
}
|
||||
|
||||
void generateSnake(cell *c, int i) {
|
||||
void generateSnake(cell *c, int i, int color) {
|
||||
c->monst = moHexSnake;
|
||||
c->hitpoints = color;
|
||||
int cpair = (1<<pattern_threecolor(c)) | (1<<pattern_threecolor(c->mov[i]));
|
||||
preventbarriers(c);
|
||||
int len = nonbitrunc ? 2 : ROCKSNAKELENGTH;
|
||||
@ -689,7 +690,7 @@ void generateSnake(cell *c, int i) {
|
||||
cell *c3 = c2->mov[i];
|
||||
if(c3->monst || c3->bardir != NODIR || c3->wall) break;
|
||||
c2 = c3;
|
||||
c2->monst = moHexSnakeTail;
|
||||
c2->monst = moHexSnakeTail; c2->hitpoints = color;
|
||||
i = (j + (c2->type%4 == 0 ? c2->type/2 : (len%2 ? 2 : c2->type - 2))) % c2->type;
|
||||
createMov(c2, i);
|
||||
if(!inpair(c2->mov[i], cpair)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user