mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-02-02 20:29:17 +00:00
fixed the bug in the Prairie which caused the Bulls not to attack correctly
This commit is contained in:
parent
610d6ee1b3
commit
8bc4cb5207
10
complex.cpp
10
complex.cpp
@ -3144,13 +3144,9 @@ EX namespace prairie {
|
|||||||
cell *cp = whirlline[q];
|
cell *cp = whirlline[q];
|
||||||
cell *cn = whirlline[q+1];
|
cell *cn = whirlline[q+1];
|
||||||
if(cp->monst == moHerdBull && !cp->stuntime) {
|
if(cp->monst == moHerdBull && !cp->stuntime) {
|
||||||
forCellEx(c2, cp) {
|
cp->mondir = neighborId(cp, cn);
|
||||||
int flags = AF_GETPLAYER | AF_BULL;
|
beastAttack(cp, true, true);
|
||||||
if(c2 != cn) flags |= AF_ONLY_FBUG;
|
|
||||||
if(canAttack(c, moHerdBull, c2, c2->monst, flags))
|
|
||||||
attackMonster(c2, flags | AF_MSG, moHerdBull);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!cn->monst && !isPlayerOn(cn) && passable_for(cp->monst, cn, cp, P_DEADLY))
|
if(!cn->monst && !isPlayerOn(cn) && passable_for(cp->monst, cn, cp, P_DEADLY))
|
||||||
moveMonster(cn, cp, NODIR);
|
moveMonster(cn, cp, NODIR);
|
||||||
else {
|
else {
|
||||||
|
10
game.cpp
10
game.cpp
@ -4429,10 +4429,10 @@ cell *determinePush(cellwalker who, cell *c2, int subdir, const T& valid, int& p
|
|||||||
|
|
||||||
// Angry Beast attack
|
// Angry Beast attack
|
||||||
// note: this is done both before and after movement
|
// note: this is done both before and after movement
|
||||||
EX void beastAttack(cell *c, bool player) {
|
EX void beastAttack(cell *c, bool player, bool targetdir) {
|
||||||
if(c->mondir == NODIR) return;
|
if(c->mondir == NODIR) return;
|
||||||
forCellIdEx(c2, d, c) {
|
forCellIdEx(c2, d, c) {
|
||||||
bool opposite = anglestraight(c, d, c->mondir);
|
bool opposite = targetdir ? (d==c->mondir) : anglestraight(c, d, c->mondir);
|
||||||
int flags = AF_BULL;
|
int flags = AF_BULL;
|
||||||
if(player) flags |= AF_GETPLAYER;
|
if(player) flags |= AF_GETPLAYER;
|
||||||
if(!opposite) flags |= AF_ONLY_FBUG;
|
if(!opposite) flags |= AF_ONLY_FBUG;
|
||||||
@ -4481,7 +4481,7 @@ EX cell *moveNormal(cell *c, flagtype mf) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Angry Beasts attack all neighbors first
|
// Angry Beasts attack all neighbors first
|
||||||
if(m == moRagingBull) beastAttack(c, true);
|
if(m == moRagingBull) beastAttack(c, true, false);
|
||||||
d = pickMoveDirection(c, mf);
|
d = pickMoveDirection(c, mf);
|
||||||
}
|
}
|
||||||
if(d == -1) {
|
if(d == -1) {
|
||||||
@ -4519,7 +4519,7 @@ EX cell *moveNormal(cell *c, flagtype mf) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
moveMonster(c2, c, d);
|
moveMonster(c2, c, d);
|
||||||
if(m == moRagingBull) beastAttack(c2, false);
|
if(m == moRagingBull) beastAttack(c2, false, false);
|
||||||
return c2;
|
return c2;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -4547,7 +4547,7 @@ EX cell *moveNormal(cell *c, flagtype mf) {
|
|||||||
cell *c2 = c->move(posdir[i]);
|
cell *c2 = c->move(posdir[i]);
|
||||||
if(!c->monst) c->monst = m;
|
if(!c->monst) c->monst = m;
|
||||||
moveMonster(c2, c, posdir[i]);
|
moveMonster(c2, c, posdir[i]);
|
||||||
if(m == moRagingBull) beastAttack(c2, false);
|
if(m == moRagingBull) beastAttack(c2, false, false);
|
||||||
}
|
}
|
||||||
return c->move(d);
|
return c->move(d);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user