Skip to content
This repository has been archived by the owner on May 20, 2024. It is now read-only.

Commit

Permalink
Merge branch 'issue/244' into release/1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Henry J. Wylde committed Jul 20, 2016
2 parents b981bf8 + 4710441 commit dae65d8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ Post v1 a change is further considered breaking if the state file format is inco

### Upcoming

*Revisions*

* Ignore the Jester when considering Necromancers win condition. ([#244](https://github.com/hjwylde/werewolf/issues/244))

### v1.4.0.0

*Major*
Expand Down
4 changes: 3 additions & 1 deletion src/Game/Werewolf/Game.hs
Original file line number Diff line number Diff line change
Expand Up @@ -352,11 +352,13 @@ hasFallenAngelWon game = game ^. fallenAngelLynched

-- | Queries whether the Necromancer has won. The 'Necromancer' wins if they and their zombies are
-- the only players surviving.
--
-- N.B., the Jester is not considered when determining whether the 'Necromancer' has won.
hasNecromancerWon :: Game -> Bool
hasNecromancerWon game =
not (hasEveryoneLost game)
&& allOf (players . traverse . alive)
(\player -> any ($ player) [is necromancer, is zombie]) game
(\player -> any ($ player) [is necromancer, is zombie, is jester]) game

-- | Queries whether the 'Villagers' have won. The 'Villagers' win if they are the only players
-- surviving.
Expand Down

0 comments on commit dae65d8

Please sign in to comment.