1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-07-13 22:52:49 +00:00

old moveMonster removed

This commit is contained in:
Zeno Rogue 2019-11-22 18:19:22 +01:00
parent 9521b622e1
commit e6853e6540
3 changed files with 14 additions and 15 deletions

View File

@ -1802,7 +1802,8 @@ EX namespace hive {
if(!q) { if(c->land == laHive) c->landparam += 3; continue; } if(!q) { if(c->land == laHive) c->landparam += 3; continue; }
int d = gmoves[hrand(q)]; int d = gmoves[hrand(q)];
cell *c2 = c->move(d); movei mi(c, d);
auto& c2 = mi.t;
if(c2->monst || isPlayerOn(c2)) { if(c2->monst || isPlayerOn(c2)) {
eMonster killed = c2->monst; eMonster killed = c2->monst;
if(isPlayerOn(c2)) killed = moPlayer; if(isPlayerOn(c2)) killed = moPlayer;
@ -1818,7 +1819,7 @@ EX namespace hive {
// c->monst = moDeadBug, deadbug.push_back(c); // c->monst = moDeadBug, deadbug.push_back(c);
} }
else { else {
moveMonster(c2, c, d); moveMonster(mi);
// pheromones! // pheromones!
if(c->land == laHive && c->landparam < 90) c->landparam += 5; if(c->land == laHive && c->landparam < 90) c->landparam += 5;
if(c2->land == laHive && c2->landparam < 90) c2->landparam += 5; if(c2->land == laHive && c2->landparam < 90) c2->landparam += 5;
@ -3148,7 +3149,7 @@ EX namespace prairie {
beastAttack(cp, true, true); beastAttack(cp, true, true);
if(!cn->monst && !isPlayerOn(cn) && passable_for(cp->monst, cn, cp, P_DEADLY)) if(!cn->monst && !isPlayerOn(cn) && passable_for(cp->monst, cn, cp, P_DEADLY))
moveMonster(cn, cp, NODIR); moveMonster(movei(cp, cn, TELEPORT));
else { else {
playSound(NULL, "hit-axe"+pick123()); playSound(NULL, "hit-axe"+pick123());
beastcrash(cn, cp); beastcrash(cn, cp);

View File

@ -3827,10 +3827,6 @@ EX void makeTrollFootprints(cell *c) {
c->landparam = turncount + 100; c->landparam = turncount + 100;
} }
EX void moveMonster(cell *ct, cell *cf, int direction_hint) {
moveMonster(movei(cf, ct, direction_hint));
}
EX void moveMonster(const movei& mi) { EX void moveMonster(const movei& mi) {
auto& cf = mi.s; auto& cf = mi.s;
auto& ct = mi.t; auto& ct = mi.t;
@ -4499,7 +4495,8 @@ EX cell *moveNormal(cell *c, flagtype mf) {
} }
if(!quantum) { if(!quantum) {
cell *c2 = c->move(d); movei mi(c, d);
auto& c2 = mi.t;
if(isPlayerOn(c2)) { if(isPlayerOn(c2)) {
if(m == moCrusher) { if(m == moCrusher) {
addMessage(XLAT("%The1 raises his weapon...", m)); addMessage(XLAT("%The1 raises his weapon...", m));
@ -4521,13 +4518,13 @@ EX cell *moveNormal(cell *c, flagtype mf) {
} }
else if(m2) { else if(m2) {
attackMonster(c2, AF_NORMAL | AF_MSG, m); attackMonster(c2, AF_NORMAL | AF_MSG, m);
animateAttack(movei(c, d), LAYER_SMALL); animateAttack(mi, LAYER_SMALL);
if(m == moFlailer && m2 == moIllusion) if(m == moFlailer && m2 == moIllusion)
attackMonster(c, 0, m2); attackMonster(c, 0, m2);
return c2; return c2;
} }
moveMonster(c2, c, d); moveMonster(mi);
if(m == moRagingBull) beastAttack(c2, false, false); if(m == moRagingBull) beastAttack(c2, false, false);
return c2; return c2;
} }
@ -4553,10 +4550,10 @@ EX cell *moveNormal(cell *c, flagtype mf) {
} }
if(!attacking) for(int i=0; i<nc; i++) { if(!attacking) for(int i=0; i<nc; i++) {
cell *c2 = c->move(posdir[i]); movei mi(c, posdir[i]);
if(!c->monst) c->monst = m; if(!c->monst) c->monst = m;
moveMonster(c2, c, posdir[i]); moveMonster(mi);
if(m == moRagingBull) beastAttack(c2, false, false); if(m == moRagingBull) beastAttack(mi.t, false, false);
} }
return c->move(d); return c->move(d);
} }
@ -5076,7 +5073,7 @@ EX void groupmove2(cell *c, cell *from, int d, eMonster movtype, flagtype mf) {
return; return;
} }
moveMonster(from, c, revhint(from, d)); moveMonster(movei(from, d).rev());
onpath(from, 0); onpath(from, 0);
} }
onpath(c, 0); onpath(c, 0);
@ -5428,7 +5425,7 @@ EX void moveghosts() {
addMessage(XLAT("%The1 scares %the2 a bit!", c->monst, c2->monst)); addMessage(XLAT("%The1 scares %the2 a bit!", c->monst, c2->monst));
c2->stuntime = 1; c2->stuntime = 1;
} }
else moveMonster(c2, c, d); else moveMonster(movei(c, d));
} }
nextghost: ; nextghost: ;

View File

@ -445,6 +445,7 @@ inline cellwalker operator+ (heptspin hs, cth_t) { return cellwalker(hs.at->c7,
constexpr int STRONGWIND = 99; constexpr int STRONGWIND = 99;
constexpr int FALL = 98; constexpr int FALL = 98;
constexpr int NO_SPACE = 97; constexpr int NO_SPACE = 97;
constexpr int TELEPORT = 96;
namespace whirlwind { cell *jumpDestination(cell*); } namespace whirlwind { cell *jumpDestination(cell*); }