packages feed

werewolf 0.4.6.0 → 0.4.6.1

raw patch · 5 files changed

+13/−21 lines, 5 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -2,6 +2,13 @@  #### Upcoming +#### v0.4.6.1++*Revisions*++* Fixed Village Idiot text to have spaces around the name. ([#87](https://github.com/hjwylde/werewolf/issues/87))+* Fixed a bug where the Werewolves couldn't win if it was down to 1 Werewolf and the Village Idiot. ([#88](https://github.com/hjwylde/werewolf/issues/88))+ #### v0.4.6.0  *Minor*
src/Game/Werewolf/Command.hs view
@@ -262,11 +262,10 @@ voteLynchCommand :: Text -> Text -> Command voteLynchCommand callerName targetName = Command $ do     validatePlayer callerName callerName-    whenM (uses allowedVoters (callerName `notElem`))                       $ throwError [playerCannotDoThatMessage callerName]-    unlessM isVillagesTurn                                                  $ throwError [playerCannotDoThatRightNowMessage callerName]-    whenJustM (getPlayerVote callerName) . const                            $ throwError [playerHasAlreadyVotedMessage callerName]+    whenM (uses allowedVoters (callerName `notElem`))   $ throwError [playerCannotDoThatMessage callerName]+    unlessM isVillagesTurn                              $ throwError [playerCannotDoThatRightNowMessage callerName]+    whenJustM (getPlayerVote callerName) . const        $ throwError [playerHasAlreadyVotedMessage callerName]     validatePlayer callerName targetName-    whenM (use villageIdiotRevealed &&^ isPlayerVillageIdiot targetName)    $ throwError [playerCannotLynchVillageIdiotMessage callerName]      votes %= Map.insert callerName targetName 
src/Game/Werewolf/Messages.hs view
@@ -59,7 +59,7 @@     scapegoatLynchedMessage, villageIdiotLynchedMessage,      -- ** Error messages-    playerHasAlreadyVotedMessage, playerCannotLynchVillageIdiotMessage,+    playerHasAlreadyVotedMessage,      -- * Werewolves' turn messages     playerMadeDevourVoteMessage, playerDevouredMessage, noPlayerDevouredMessage,@@ -460,17 +460,13 @@  villageIdiotLynchedMessage :: Text -> Message villageIdiotLynchedMessage name = publicMessage $ T.concat-    [ "Just as the townsfolk tie", name, "up to the pyre, a voice in the crowd yells out."+    [ "Just as the townsfolk tie ", name, " up to the pyre, a voice in the crowd yells out."     , " \"We can't burn ", name, "! He's that oaf, you know, John's boy!\""     , " The Village Idiot is quickly untied and apologised to."     ]  playerHasAlreadyVotedMessage :: Text -> Message playerHasAlreadyVotedMessage to = privateMessage to "You've already voted!"--playerCannotLynchVillageIdiotMessage :: Text -> Message-playerCannotLynchVillageIdiotMessage to =-    privateMessage to "You cannot lynch the Village Idiot!"  playerMadeDevourVoteMessage :: Text -> Text -> Text -> Message playerMadeDevourVoteMessage to voterName targetName = privateMessage to $ T.concat
test/src/Game/Werewolf/Test/Command.hs view
@@ -146,7 +146,6 @@     , testProperty "vote lynch command errors when caller has voted"                prop_voteLynchCommandErrorsWhenCallerHasVoted     , testProperty "vote lynch command errors when caller is not in allowed voters" prop_voteLynchCommandErrorsWhenCallerIsNotInAllowedVoters     , testProperty "vote lynch command errors when caller is known village idiot"   prop_voteLynchCommandErrorsWhenCallerIsKnownVillageIdiot-    , testProperty "vote lynch command errors when target is known village idiot"   prop_voteLynchCommandErrorsWhenTargetIsKnownVillageIdiot     , testProperty "vote lynch command updates votes"                               prop_voteLynchCommandUpdatesVotes     ] @@ -867,15 +866,6 @@         verbose_runCommandErrors game command     where         caller = findByRole_ villageIdiotRole (game ^. players)--prop_voteLynchCommandErrorsWhenTargetIsKnownVillageIdiot :: GameWithVillageIdiotRevealedAtVillagesTurn -> Property-prop_voteLynchCommandErrorsWhenTargetIsKnownVillageIdiot (GameWithVillageIdiotRevealedAtVillagesTurn game) =-    forAll (arbitraryPlayer game) $ \caller -> do-        let command = voteLynchCommand (caller ^. name) (target ^. name)--        verbose_runCommandErrors game command-    where-        target = findByRole_ villageIdiotRole (game ^. players)  prop_voteLynchCommandUpdatesVotes :: GameAtVillagesTurn -> Property prop_voteLynchCommandUpdatesVotes (GameAtVillagesTurn game) =
werewolf.cabal view
@@ -1,5 +1,5 @@ name:           werewolf-version:        0.4.6.0+version:        0.4.6.1  author:         Henry J. Wylde maintainer:     public@hjwylde.com