Skip to content

Commit

Permalink
Krakens can learn from monsters that die in deep water
Browse files Browse the repository at this point in the history
  • Loading branch information
zenzombie committed Mar 24, 2024
1 parent fc2ce59 commit 955bed3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions changes/release-the-kraken.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed an issue that prevented allies (e.g. kraken) from learning abilities from monsters that die in certain terrain (e.g. deep water).
8 changes: 5 additions & 3 deletions src/brogue/Combat.c
Original file line number Diff line number Diff line change
Expand Up @@ -1395,18 +1395,20 @@ static boolean anyoneWantABite(creature *decedent) {
if ((!(decedent->info.abilityFlags & LEARNABLE_ABILITIES)
&& !(decedent->info.flags & LEARNABLE_BEHAVIORS)
&& decedent->info.bolts[0] == BOLT_NONE)
|| (cellHasTerrainFlag(decedent->loc, T_PATHING_BLOCKER))
|| (cellHasTerrainFlag(decedent->loc, T_OBSTRUCTS_PASSABILITY))
|| decedent->info.monsterID == MK_SPECTRAL_IMAGE
|| (decedent->info.flags & (MONST_INANIMATE | MONST_IMMOBILE))) {

return false;
}

grid = allocGrid();
fillGrid(grid, 0);
calculateDistances(grid, decedent->loc.x, decedent->loc.y, T_PATHING_BLOCKER, NULL, true, true);
for (creatureIterator it = iterateCreatures(monsters); hasNextCreature(it);) {
creature *ally = nextCreature(&it);
if (ally->creatureState == MONSTER_ALLY) {
fillGrid(grid, 0);
calculateDistances(grid, decedent->loc.x, decedent->loc.y, forbiddenFlagsForMonster(&(ally->info)), NULL, true, true);
}
if (canAbsorb(ally, ourBolts, decedent, grid)) {
candidates++;
}
Expand Down

0 comments on commit 955bed3

Please sign in to comment.