1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-06-28 07:52:53 +00:00

fixed the Hag's attack

This commit is contained in:
Zeno Rogue 2021-05-23 15:54:59 +02:00
parent 5e1bea6c3b
commit ece8c94d4c

View File

@ -1875,22 +1875,24 @@ EX void specialMoves() {
} }
else if(m == moHexer && c->item && (classflag(c->item) & IF_CURSE) && !peace::on) { else if(m == moHexer && c->item && (classflag(c->item) & IF_CURSE) && !peace::on) {
bool shot = false;
// bool dont_approach = false; // bool dont_approach = false;
// smaller range on the sphere // smaller range on the sphere
int firerange = (sphere || getDistLimit() < 5) ? 2 : 4; int firerange = (sphere || getDistLimit() < 5) ? 2 : 4;
bool dont_approach; bool dont_approach = false;
for(int i=0; i<isize(targets); i++) { for(int i=0; i<isize(targets); i++) {
cell *t = targets[i]; cell *t = targets[i];
if(isPlayerOn(t) && celldistance(c,t) <= firerange) { if(isPlayerOn(t)) {
int d = celldistance(c,t);
if(d <= firerange) {
addMessage(XLAT("%The1 curses you with %the2!", m, c->item)); addMessage(XLAT("%The1 curses you with %the2!", m, c->item));
items[c->item] += orbcharges(c->item); items[c->item] += orbcharges(c->item);
c->item = itNone; c->item = itNone;
c->stuntime = 1; c->stuntime = 1;
} }
if(celldistance(c,t) == firerange+1) dont_approach = true; if(d == firerange+1) dont_approach = true;
}
} }
if(dont_approach) c->stuntime = 1; if(dont_approach) c->stuntime = 1;