Skip to content

Commit

Permalink
When submerged player is seized, monster immediately surfaces (tmewet…
Browse files Browse the repository at this point in the history
  • Loading branch information
zenzombie authored May 4, 2024
1 parent 3e4e27f commit 8e23431
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions changes/siezed-while-submerged.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
If the player is seized by a submerged monster they can see (i.e. player is also submerged), it will now immediately surface so it can be targeted with staffs/wands.
8 changes: 8 additions & 0 deletions src/brogue/Combat.c
Original file line number Diff line number Diff line change
Expand Up @@ -1073,6 +1073,14 @@ boolean attack(creature *attacker, creature *defender, boolean lungeAttack) {

attacker->bookkeepingFlags |= MB_SEIZING;
defender->bookkeepingFlags |= MB_SEIZED;

// if the player is seized by a submerged monster they can see (i.e. player is also submerged),
// it immediately surfaces so it can be targeted with staffs/wands
if (defender == &player && (attacker->bookkeepingFlags & MB_SUBMERGED) && canSeeMonster(attacker)) {
attacker->bookkeepingFlags &= ~MB_SUBMERGED;
monsterName(attackerName, attacker, true);
}

if (canSeeMonster(attacker) || canSeeMonster(defender)) {
sprintf(buf, "%s seizes %s!", attackerName, (defender == &player ? "your legs" : defenderName));
messageWithColor(buf, &white, 0);
Expand Down

0 comments on commit 8e23431

Please sign in to comment.