mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-05-07 17:54:07 +00:00
fixed the Sword in S3==4
This commit is contained in:
parent
e76df0ced3
commit
0d2c520298
17
game.cpp
17
game.cpp
@ -1288,10 +1288,15 @@ int monstersnear(cell *c, cell *nocount, eMonster who, cell *pushto, cell *comef
|
|||||||
if(who == moPlayer) for(int b=0; b<2; b++) {
|
if(who == moPlayer) for(int b=0; b<2; b++) {
|
||||||
sm.swordnext[b] = sword::pos(multi::cpid, b);
|
sm.swordnext[b] = sword::pos(multi::cpid, b);
|
||||||
sm.swordtransit[b] = NULL;
|
sm.swordtransit[b] = NULL;
|
||||||
if(sm.swordnext[b] && sm.swordnext[b] != sm.swordlast[b] && !isNeighbor(sm.swordlast[b], sm.swordnext[b]))
|
if(sm.swordnext[b] && sm.swordnext[b] != sm.swordlast[b] && !isNeighbor(sm.swordlast[b], sm.swordnext[b])) {
|
||||||
forCellEx(c2, sm.swordnext[b])
|
forCellEx(c2, sm.swordnext[b])
|
||||||
if(c2 != c && c2 != comefrom && isNeighbor(c2, sm.swordlast[b]))
|
if(c2 != c && c2 != comefrom && isNeighbor(c2, S3==3 ? sm.swordlast[b] : *wcw))
|
||||||
sm.swordtransit[b] = c2;
|
sm.swordtransit[b] = c2;
|
||||||
|
if(S3 == 4)
|
||||||
|
forCellEx(c2, c)
|
||||||
|
if(c2 != comefrom && isNeighbor(c2, sm.swordlast[b]))
|
||||||
|
sm.swordtransit[b] = c2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stalemate::moves.push_back(sm);
|
stalemate::moves.push_back(sm);
|
||||||
@ -4700,9 +4705,17 @@ void stabbingAttack(cell *mf, cell *mt, eMonster who, int bonuskill) {
|
|||||||
if(swordAttack(mt, who, st, bb)) numbb++;
|
if(swordAttack(mt, who, st, bb)) numbb++;
|
||||||
if(sf != st && !isNeighbor(sf,st)) {
|
if(sf != st && !isNeighbor(sf,st)) {
|
||||||
// also attack the in-transit cell
|
// also attack the in-transit cell
|
||||||
|
if(S3 == 3) {
|
||||||
forCellEx(sb, sf) if(isNeighbor(sb, st) && sb != mf && sb != mt)
|
forCellEx(sb, sf) if(isNeighbor(sb, st) && sb != mf && sb != mt)
|
||||||
if(swordAttack(mt, who, sb, bb)) numbb++;
|
if(swordAttack(mt, who, sb, bb)) numbb++;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
forCellEx(sb, mf) if(isNeighbor(sb, st) && sb != mt)
|
||||||
|
if(swordAttack(mt, who, sb, bb)) numbb++;
|
||||||
|
forCellEx(sb, mt) if(isNeighbor(sb, sf) && sb != mf)
|
||||||
|
if(swordAttack(mt, who, sb, bb)) numbb++;
|
||||||
|
}
|
||||||
|
}
|
||||||
achievement_count("SLASH", numbb, 0);
|
achievement_count("SLASH", numbb, 0);
|
||||||
numslash += numbb;
|
numslash += numbb;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user