1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-22 08:10:40 +00:00

Merge pull request #281 from jruderman/gen_no_stun

Clear stuntime when generating new monsters
This commit is contained in:
Zeno Rogue 2021-08-04 19:09:18 +02:00 committed by GitHub
commit 0f746b5009
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 2 deletions

View File

@ -346,7 +346,7 @@ EX void bfs() {
c2->item = itNone; c2->item = itNone;
c2->landparam |= 2; c2->landparam |= 2;
c2->landparam &= ~1; c2->landparam &= ~1;
if(!c2->monst) c2->monst = moBomberbird; if(!c2->monst) c2->monst = moBomberbird, c2->stuntime = 0;
} }
if(c2->item == itBarrow && c2->cpdist == distlimit && c2->wall != waBarrowDig) { if(c2->item == itBarrow && c2->cpdist == distlimit && c2->wall != waBarrowDig) {

View File

@ -166,10 +166,12 @@ EX bool collectItem(cell *c2, bool telekinesis IS(false)) {
else if(c2->item == itOrbLife) { else if(c2->item == itOrbLife) {
playSound(c2, "pickup-orb"); // TODO summon playSound(c2, "pickup-orb"); // TODO summon
placeGolem(cwt.at, c2, moGolem); placeGolem(cwt.at, c2, moGolem);
if(cwt.at->monst == moGolem) cwt.at->stuntime = 0;
} }
else if(c2->item == itOrbFriend) { else if(c2->item == itOrbFriend) {
playSound(c2, "pickup-orb"); // TODO summon playSound(c2, "pickup-orb"); // TODO summon
placeGolem(cwt.at, c2, moTameBomberbird); placeGolem(cwt.at, c2, moTameBomberbird);
if(cwt.at->monst == moTameBomberbird) cwt.at->stuntime = 0;
} }
#if CAP_TOUR #if CAP_TOUR
else if(tour::on && (c2->item == itOrbSafety || c2->item == itOrbRecall)) { else if(tour::on && (c2->item == itOrbSafety || c2->item == itOrbRecall)) {

View File

@ -253,6 +253,8 @@ EX void gen_eclectic_monster(cell *c) {
cell *c1 = c; cell *c1 = c;
c1->monst = moPair; c1->monst = moPair;
c2->monst = moPair; c2->monst = moPair;
c1->stuntime = 0;
c2->stuntime = 0;
c1->mondir = neighborId(c1, c2); c1->mondir = neighborId(c1, c2);
c2->mondir = neighborId(c2, c1); c2->mondir = neighborId(c2, c1);
} }
@ -911,6 +913,7 @@ EX void giantLandSwitch(cell *c, int d, cell *from) {
c->item = itTrollEgg; c->item = itTrollEgg;
forCellCM(c2, c) forCellCM(c3, c2) { forCellCM(c2, c) forCellCM(c3, c2) {
c3->monst = pickTroll(c); c3->monst = pickTroll(c);
c3->stuntime = 0;
c2->item = itTrollEgg; c2->item = itTrollEgg;
} }
} }
@ -1696,6 +1699,7 @@ EX void giantLandSwitch(cell *c, int d, cell *from) {
forCellIdEx(c2, i, c) { forCellIdEx(c2, i, c) {
c2->monst = moKrakenT; c2->monst = moKrakenT;
c2->hitpoints = 1; c2->hitpoints = 1;
c2->stuntime = 0;
c2->mondir = c->c.spin(i); c2->mondir = c->c.spin(i);
} }
if(!peace::on) playSound(c, "seen-kraken"); if(!peace::on) playSound(c, "seen-kraken");
@ -2050,7 +2054,9 @@ EX void giantLandSwitch(cell *c, int d, cell *from) {
c->item = itHunting; c->item = itHunting;
auto& p = next[hrand(isize(next))]; auto& p = next[hrand(isize(next))];
p.first->monst = moHunterGuard; p.first->monst = moHunterGuard;
p.first->stuntime = 0;
p.second->monst = moHunterGuard; p.second->monst = moHunterGuard;
p.second->stuntime = 0;
} }
} }
else if(items[itHunting] < 10) { else if(items[itHunting] < 10) {
@ -2069,8 +2075,10 @@ EX void giantLandSwitch(cell *c, int d, cell *from) {
cell *dog2 = dogcells[hrand(isize(dogcells))]; cell *dog2 = dogcells[hrand(isize(dogcells))];
if(valence() != 3 || isNeighbor(dog1, dog2)) { if(valence() != 3 || isNeighbor(dog1, dog2)) {
dog1->monst = moHunterGuard; dog1->monst = moHunterGuard;
dog1->stuntime = 0;
dog1->landparam = 0; dog1->landparam = 0;
dog2->monst = moHunterGuard; dog2->monst = moHunterGuard;
dog2->stuntime = 0;
dog2->landparam = 1; dog2->landparam = 1;
break; break;
} }
@ -2078,7 +2086,9 @@ EX void giantLandSwitch(cell *c, int d, cell *from) {
} }
else if(isize(dogcells)) { else if(isize(dogcells)) {
c->item = itHunting; c->item = itHunting;
dogcells[hrand(isize(dogcells))]->monst = moHunterGuard; cell *dog = dogcells[hrand(isize(dogcells))];
dog->monst = moHunterGuard;
dog->stuntime = 0;
} }
} }
} }
@ -2339,6 +2349,8 @@ EX void giantLandSwitch(cell *c, int d, cell *from) {
if(c2->monst || c2->wall) return; if(c2->monst || c2->wall) return;
c1->monst = moPair; c1->monst = moPair;
c2->monst = moPair; c2->monst = moPair;
c1->stuntime = 0;
c2->stuntime = 0;
c1->mondir = neighborId(c1, c2); c1->mondir = neighborId(c1, c2);
c2->mondir = neighborId(c2, c1); c2->mondir = neighborId(c2, c1);
} }
@ -3016,6 +3028,8 @@ EX void setdist(cell *c, int d, cell *from) {
if(d < BARLEV) brownian::apply_futures(c); if(d < BARLEV) brownian::apply_futures(c);
#endif #endif
if(!c->monst) c->stuntime = 0;
giantLandSwitch(c, d, from); giantLandSwitch(c, d, from);
if(d == min(reduced_barlev, 9)) moreBigStuff(c); if(d == min(reduced_barlev, 9)) moreBigStuff(c);

View File

@ -527,10 +527,12 @@ EX void wandering() {
forCellCM(c3, c2) if(c3->monst || c3->wall != waSea) forCellCM(c3, c2) if(c3->monst || c3->wall != waSea)
goto notfound; goto notfound;
c2->monst = moKrakenH; c2->monst = moKrakenH;
c2->stuntime = 0;
playSeenSound(c2); playSeenSound(c2);
for(int i=0; i<c2->type; i++) { for(int i=0; i<c2->type; i++) {
c2->move(i)->monst = moKrakenT; c2->move(i)->monst = moKrakenT;
c2->move(i)->hitpoints = 1; c2->move(i)->hitpoints = 1;
c2->move(i)->stuntime = 0;
c2->move(i)->mondir = c2->c.spin(i); c2->move(i)->mondir = c2->c.spin(i);
} }
goto found; goto found;

View File

@ -602,6 +602,7 @@ EX void teleportTo(cell *dest) {
playSound(dest, "other-teleport"); playSound(dest, "other-teleport");
if(dest->monst) { if(dest->monst) {
cwt.at->monst = dest->monst; cwt.at->monst = dest->monst;
cwt.at->stuntime = dest->stuntime;
dest->monst = moNone; dest->monst = moNone;
} }
@ -1074,6 +1075,7 @@ void poly_attack(cell *dest) {
void placeIllusion(cell *c) { void placeIllusion(cell *c) {
c->monst = moIllusion; c->monst = moIllusion;
c->stuntime = 0;
useupOrb(itOrbIllusion, 5); useupOrb(itOrbIllusion, 5);
addMessage(XLAT("You create an Illusion!")); addMessage(XLAT("You create an Illusion!"));
bfs(); bfs();