1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-16 22:57:38 +00:00

determinePush now accepts movei instead of c

This commit is contained in:
Zeno Rogue
2021-05-29 15:44:07 +02:00
parent b0333a6ab7
commit d7e2b491ac
5 changed files with 16 additions and 11 deletions

View File

@@ -630,7 +630,7 @@ bool pcmove::actual_move() {
}
if(c2->monst == moAnimatedDie) {
mip = determinePush(cwt, subdir, [c2] (cell *c) { return canPushThumperOn(c, c2, cwt.at); });
mip = determinePush(cwt, subdir, [c2] (movei mi) { return canPushThumperOn(mi, cwt.at); });
if(mip.proper()) {
auto tgt = roll_effect(mip, dice::data[c2]);
if(tgt.happy() > 0) {
@@ -642,7 +642,7 @@ bool pcmove::actual_move() {
}
if(isPushable(c2->wall) && !c2->monst && !nonAdjacentPlayer(c2, cwt.at) && fmsMove) {
mip = determinePush(cwt, subdir, [c2] (cell *c) { return canPushThumperOn(c, c2, cwt.at); });
mip = determinePush(cwt, subdir, [c2] (movei mi) { return canPushThumperOn(mi, cwt.at); });
if(mip.t) changes.ccell(mip.t);
if(mip.d == NO_SPACE) {
if(vmsg(miWALL)) addMessage(XLAT("No room to push %the1.", c2->wall));
@@ -978,7 +978,7 @@ bool pcmove::attack() {
if(items[itCurseWeakness] || (isStunnable(c2->monst) && c2->hitpoints > 1)) {
if(monsterPushable(c2))
mip = determinePush(cwt, subdir, [c2] (cell *c) { return passable(c, c2, P_BLOW); });
mip = determinePush(cwt, subdir, [c2] (movei mi) { return passable(mi.t, mi.s, P_BLOW); });
else
mip.t = c2;
if(mip.t) changes.ccell(mip.t);