diff --git a/complex.cpp b/complex.cpp index ffff4afa..5be3373f 100644 --- a/complex.cpp +++ b/complex.cpp @@ -2301,7 +2301,7 @@ void livecaves() { /* evolver */ namespace tortoise { - map emap; + map emap; map babymap; int last; @@ -2318,13 +2318,11 @@ namespace tortoise { const int numbits = (int) tfCOUNT; const int mask = (1<> i)&1) bi++; diff --git a/debug.cpp b/debug.cpp index 6f63c5ae..6b8387fc 100644 --- a/debug.cpp +++ b/debug.cpp @@ -366,6 +366,19 @@ struct debugScreen { }); dialog::addSelItem("barrier left", dnameof2(what->barleft), 0); dialog::addSelItem("barrier right", dnameof2(what->barright), 0); + if(what->item == itBabyTortoise) { + dialog::addSelItem("baby Tortoise flags", itsh(tortoise::babymap[what]), 'B'); + dialog::add_action([what] () { + dialog::editNumber(tortoise::babymap[what], 0, (1<<21)-1, 1, getBits(what), "", ""); + }); + } + if(what->monst == moTortoise) { + dialog::addSelItem("adult Tortoise flags", itsh(tortoise::emap[what]), 'A'); + dialog::add_action([what] () { + tortoise::emap[what] = tortoise::getb(what); + dialog::editNumber(tortoise::emap[what], 0, (1<<21)-1, 1, getBits(what), "", ""); + }); + } dialog::addBreak(50); if(show_debug_data) { diff --git a/game.cpp b/game.cpp index 97e4d2c3..1c0da424 100644 --- a/game.cpp +++ b/game.cpp @@ -3294,7 +3294,7 @@ void moveEffect(cell *ct, cell *cf, eMonster m, int direction_hint) { if(cf && isPrincess(m)) princess::move(ct, cf); if(cf && m == moTortoise) { - tortoise::emap[ct] = tortoise::get(cf); + tortoise::emap[ct] = tortoise::getb(cf); tortoise::emap.erase(cf); } diff --git a/mapeditor.cpp b/mapeditor.cpp index 1a664d31..71840a81 100644 --- a/mapeditor.cpp +++ b/mapeditor.cpp @@ -160,10 +160,14 @@ namespace mapstream { f.write_char(c->land); f.write_char(c->mondir); f.write_char(c->monst); + if(c->monst == moTortoise) + f.write(tortoise::emap[c] = tortoise::getb(c)); f.write_char(c->wall); // f.write_char(c->barleft); // f.write_char(c->barright); f.write_char(c->item); + if(c->item == itBabyTortoise) + f.write(tortoise::babymap[c]); f.write_char(c->mpdist); // f.write_char(c->bardir); f.write(c->wparam); f.write(c->landparam); @@ -324,10 +328,14 @@ namespace mapstream { c->land = (eLand) f.read_char(); c->mondir = fixspin(rspin, f.read_char(), c->type); c->monst = (eMonster) f.read_char(); + if(c->monst == moTortoise && vernum >= 11001) + f.read(tortoise::emap[c]); c->wall = (eWall) f.read_char(); // c->barleft = (eLand) f.read_char(); // c->barright = (eLand) f.read_char(); c->item = (eItem) f.read_char(); + if(c->item == itBabyTortoise && vernum >= 11001) + f.read(tortoise::babymap[c]); c->mpdist = f.read_char(); c->bardir = NOBARRIERS; // fixspin(rspin, f.read_char(), c->type); @@ -625,7 +633,7 @@ namespace mapeditor { if(c->monst ==moTortoise && last == moTortoise) { cell *c1 = c; for(int i=0; i<100; i++) c1 = c1->cmove(hrand(c1->type)); - tortoise::emap[c] = c1; + tortoise::emap[c] = tortoise::getRandomBits(); } break; } diff --git a/orbs.cpp b/orbs.cpp index 077f26c6..1c9ad388 100644 --- a/orbs.cpp +++ b/orbs.cpp @@ -801,7 +801,7 @@ void summonAt(cell *dest) { if(dest->monst == moFireElemental && isFire(dest)) dest->wall = waNone; if(dest->monst == moTortoise) - tortoise::emap[dest] = dest, dest->hitpoints = 3; + tortoise::emap[dest] = getBits(dest), dest->hitpoints = 3; addMessage(XLAT("You summon %the1!", dest->monst)); moveEffect(dest, dest, dest->monst, -1); if(dest->wall == waClosePlate || dest->wall == waOpenPlate) diff --git a/shmup.cpp b/shmup.cpp index 1eef5e21..aa99287e 100644 --- a/shmup.cpp +++ b/shmup.cpp @@ -3340,7 +3340,7 @@ bool drawMonster(const transmatrix& V, cell *c, const transmatrix*& Vboat, trans c->stuntime = 1 + (m->stunoff - curtime-1)/300; if(hasHitpoints(m->type)) c->hitpoints = m->hitpoints; - if(m->type == moTortoise) tortoise::emap[c] = m->torigin; + if(m->type == moTortoise) tortoise::emap[c] = getBits(m->torigin); drawMonsterType(m->type, c, view, col, m->footphase); if(m->type == moTortoise) tortoise::emap.erase(c); break;