creating [Baby] Tortoises in the map editor now creates 'local' ones at first, and random ones on another click

This commit is contained in:
Zeno Rogue 2018-09-13 00:35:21 +02:00
parent 0116f1ae74
commit 198ae61ae4
1 changed files with 13 additions and 3 deletions

View File

@ -554,7 +554,8 @@ namespace mapeditor {
int cdir = where.first.spin; int cdir = where.first.spin;
saveUndo(c); saveUndo(c);
switch(painttype) { switch(painttype) {
case 0: case 0: {
eMonster last = c->monst;
c->monst = eMonster(paintwhat); c->monst = eMonster(paintwhat);
c->hitpoints = 3; c->hitpoints = 3;
c->stuntime = 0; c->stuntime = 0;
@ -569,12 +570,21 @@ namespace mapeditor {
mirror::createMirror(cellwalker(c, cdir, true), 0); mirror::createMirror(cellwalker(c, cdir, true), 0);
c->monst = moMimic; c->monst = moMimic;
} }
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;
}
break; break;
case 1: }
case 1: {
eItem last = c->item;
c->item = eItem(paintwhat); c->item = eItem(paintwhat);
if(c->item == itBabyTortoise) if(c->item == itBabyTortoise)
tortoise::babymap[c] = getBits(c) ^ tortoise::getRandomBits(); tortoise::babymap[c] = getBits(c) ^ (last == itBabyTortoise ? tortoise::getRandomBits() : 0);
break; break;
}
case 2: { case 2: {
eLand last = c->land; eLand last = c->land;
c->land = eLand(paintwhat); c->land = eLand(paintwhat);