From 0d87481d29fea3a5d258d569bb1e1027bb9718d5 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Wed, 11 Mar 2020 10:27:33 +0100 Subject: [PATCH] fixed revolvers --- orbs.cpp | 24 +++++++++++++++--------- pcmove.cpp | 20 +++++++------------- system.cpp | 3 ++- 3 files changed, 24 insertions(+), 23 deletions(-) diff --git a/orbs.cpp b/orbs.cpp index 4d5320d2..52dfff68 100644 --- a/orbs.cpp +++ b/orbs.cpp @@ -928,15 +928,28 @@ void psi_attack(cell *dest) { checkmoveO(); } -void gun_attack(cell *dest) { +bool gun_attack(orbAction a, cell *dest) { playSound(dest, "orb-ranged"); addMessage(XLAT("You shoot %the1!", dest->monst)); + changes.ccell(dest); attackMonster(dest, AF_GUN, moNone); + apply_impact(dest); + + if(monstersnearO(a, cwt.at, moPlayer, NULL, cwt.at)) { + changes.rollback(); + return false; + } + if(isCheck(a)) { + changes.rollback(); + return true; + } + changes.commit(); items[itRevolver] --; bfs(); checkmoveO(); createNoise(5); monstersTurn(); + return true; } EX void checkStunKill(cell *dest) { @@ -1341,14 +1354,7 @@ EX eItem targetRangedOrb(cell *c, orbAction a) { for(cell *c1: gun_targets(cwt.at)) if(c1 == c) inrange = true; if(inrange) { changes.init(isCheck(a)); - gun_attack(c), apply_impact(c); - if(monstersnearO(a, cwt.at, moPlayer, NULL, cwt.at)) { - changes.rollback(); - } - else { - if(isCheck(a)) changes.rollback(); - return itRevolver; - } + if(gun_attack(a, c)) return itRevolver; } } diff --git a/pcmove.cpp b/pcmove.cpp index 8d5912ca..e0b206dc 100644 --- a/pcmove.cpp +++ b/pcmove.cpp @@ -299,20 +299,14 @@ bool pcmove::movepcto() { checkmove(); return true; } - - if(false && who_kills_me == moOutlaw && items[itRevolver]) { + + if(who_kills_me == moOutlaw && items[itRevolver] && !checkonly) { cell *c2 = cwt.cpeek(); - for(int i=0; itype; i++) { - cell *c3 = c2->move(i); - if(c3) for(int i=0; itype; i++) { - cell *c4 = c3->move(i); - if(c4 && c4->monst == moOutlaw) { - eItem i = targetRangedOrb(c4, roCheck); - if(i == itRevolver) { - targetRangedOrb(c4, roKeyboard); - return false; - } - } + forCellEx(c3, c2) forCellEx(c4, c3) if(c4->monst == moOutlaw) { + eItem i = targetRangedOrb(c4, roCheck); + if(i == itRevolver) { + targetRangedOrb(c4, roKeyboard); + return true; } } } diff --git a/system.cpp b/system.cpp index 6c190406..84cbb72f 100644 --- a/system.cpp +++ b/system.cpp @@ -1118,7 +1118,8 @@ EX void loadsave() { if(score != 0 && !(land == laOcean && verless(ver, "8.0f")) && !(land == laTerracotta && verless(ver, "10.3e")) - ) tactic::record(l2, score, xc); + && !(land == laWildWest && verless(ver, "11.3b") && !verless(ver, "11.3"))) + tactic::record(l2, score, xc); anticheat::nextid(tactic::id, ver, cert); } }