mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-20 23:50:27 +00:00
dual:: if there is no effect, do no move rather than double swing
This commit is contained in:
parent
e99896be06
commit
5e05a0db61
3
game.cpp
3
game.cpp
@ -8025,6 +8025,7 @@ bool movepcto(int d, int subdir, bool checkonly) {
|
||||
c2->wall == waMirrorWall;
|
||||
if(attackable && markOrb(itOrbAether) && c2->wall != waMirrorWall)
|
||||
attackable = false;
|
||||
bool nm; nm = attackable;
|
||||
if(forcedmovetype == fmAttack) attackable = true;
|
||||
attackable = attackable && (!c2->monst || isFriendly(c2));
|
||||
attackable = attackable && !nonAdjacentPlayer(cwt.at,c2);
|
||||
@ -8035,7 +8036,7 @@ bool movepcto(int d, int subdir, bool checkonly) {
|
||||
if(!checkonly && errormsgs) wouldkill("%The1 would get you!");
|
||||
return false;
|
||||
}
|
||||
if(checkonly) { nextmovetype = lmAttack; return true; }
|
||||
if(checkonly) { nextmovetype = nm ? lmAttack : lmSkip; return true; }
|
||||
if(c2->wall == waSmallTree) {
|
||||
drawParticles(c2, winf[c2->wall].color, 4);
|
||||
addMessage(XLAT("You chop down the tree."));
|
||||
|
@ -121,11 +121,13 @@ namespace dual {
|
||||
}
|
||||
|
||||
bool lms[2][5];
|
||||
eLastmovetype lmt[2][5];
|
||||
for(int k=0; k<2; k++) {
|
||||
switch_to(k);
|
||||
for(eForcemovetype fm: { fmMove, fmAttack, fmInstant, fmActivate }) {
|
||||
forcedmovetype = fm;
|
||||
lms[k][fm] = movepcto(fm == fmMove ? d : 0, subdir, true);
|
||||
lmt[k][fm] = nextmovetype;
|
||||
println(hlog, k, int(fm), " -> ", lms[k][fm]);
|
||||
forcedmovetype = fmSkip;
|
||||
for(int i=0; i<ittypes; i++) orbused[i] = orbusedbak[i];
|
||||
@ -144,6 +146,8 @@ namespace dual {
|
||||
return true;
|
||||
}
|
||||
for(auto fm: {fmMove, fmInstant, fmAttack}) if(lms[0][fm] && lms[1][fm]) {
|
||||
if(lmt[0][fm] == lmSkip && lmt[1][fm] == lmSkip)
|
||||
continue;
|
||||
println(hlog, "apply ", int(fm));
|
||||
if(checkonly) { switch_to(cg); return true; }
|
||||
int flash = items[itOrbFlash], lgt = items[itOrbLightning];
|
||||
|
Loading…
Reference in New Issue
Block a user