1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-24 17:10:36 +00:00

fixed revolvers

This commit is contained in:
Zeno Rogue 2020-03-11 10:27:33 +01:00
parent 1e43d1e052
commit 0d87481d29
3 changed files with 24 additions and 23 deletions

View File

@ -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;
}
}

View File

@ -300,19 +300,13 @@ bool pcmove::movepcto() {
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; i<c2->type; i++) {
cell *c3 = c2->move(i);
if(c3) for(int i=0; i<c3->type; i++) {
cell *c4 = c3->move(i);
if(c4 && c4->monst == moOutlaw) {
forCellEx(c3, c2) forCellEx(c4, c3) if(c4->monst == moOutlaw) {
eItem i = targetRangedOrb(c4, roCheck);
if(i == itRevolver) {
targetRangedOrb(c4, roKeyboard);
return false;
}
}
return true;
}
}
}

View File

@ -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);
}
}