1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-06-13 17:06:52 +00:00

killing a tortoise with a saved baby now kills the baby too

This commit is contained in:
Zeno Rogue 2018-07-30 09:51:57 +02:00
parent 39e131d985
commit b3d074161e
2 changed files with 12 additions and 3 deletions

View File

@ -1981,6 +1981,8 @@ void killMonster(cell *c, eMonster who, flagtype deathflags) {
if(m == moWolfMoved) m = moWolf;
if(!isBulletType(m)) kills[m]++;
if(saved_tortoise_on(c)) c->item = itNone;
if(!c->item) if(m == moButterfly && (deathflags & AF_BULL))
c->item = itBull;
@ -5513,6 +5515,12 @@ void refreshFriend(cell *c) {
if(c->monst == moTameBomberbirdMoved) c->monst = moTameBomberbird;
}
bool saved_tortoise_on(cell *c) {
return
(c->monst == moTortoise && c->item == itBabyTortoise &&
!((tortoise::getb(c) ^ tortoise::babymap[c]) & tortoise::mask));
}
void moverefresh(bool turn = true) {
int dcs = isize(dcal);
@ -5582,9 +5590,8 @@ void moverefresh(bool turn = true) {
}
// tortoises who have found their children no longer move
if(c->monst == moTortoise && c->item == itBabyTortoise &&
!((tortoise::getb(c) ^ tortoise::babymap[c]) & tortoise::mask))
c->stuntime = 2;
if(saved_tortoise_on(c))
c->stuntime = 2;
if(c->monst == moReptile) {
if(c->wall == waChasm || cellUnstable(c)) {

View File

@ -3739,4 +3739,6 @@ namespace ors {
void reset();
}
bool saved_tortoise_on(cell *c);
}