packages feed

werewolf 0.3.0.1 → 0.3.0.3

raw patch · 8 files changed

+34/−30 lines, 8 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -2,6 +2,11 @@  #### Upcoming +#### v0.3.0.3++* Tidied up the help text to be smaller. ([#26](https://github.com/hjwylde/werewolf/issues/26))+* Fixed a bug where the turn was advanced to Werewolves when no Werewolves were alive. ([#26](https://github.com/hjwylde/werewolf/issues/26))+ #### v0.3.0.1  *Revisions*@@ -19,6 +24,13 @@  * Allowed `start` to work when the game has ended but `end` hasn't been called. ([#15](https://github.com/hjwylde/werewolf/issues/15)) * Added `quit` command. ([#13](https://github.com/hjwylde/werewolf/issues/13))++#### v0.2.0.1++*Revisions*++* Tidied up the help text to be smaller. ([#26](https://github.com/hjwylde/werewolf/issues/26))+* Fixed a bug where the turn was advanced to Werewolves when no Werewolves were alive. ([#26](https://github.com/hjwylde/werewolf/issues/26))  #### v0.2.0.0 
app/Main.hs view
@@ -14,8 +14,8 @@     main, handle, ) where +import           Data.Text (Text) import qualified Data.Text as T-import Data.Text (Text)  import Options.Applicative 
app/Werewolf/Commands/Help.hs view
@@ -61,36 +61,26 @@  commandsMessages :: [Text] commandsMessages = map T.unlines [[-    "Usage: COMMAND ARG ..."-    ], [-    "Available commands:",-    "  end - end the current game",-    "  help - help documents",-    "  quit - quit the current game",-    "  see - see a player's allegiance",-    "  start - start a new game",-    "  vote - vote against a player"-    ], [-    "End:",+    "End: end the current game",     "Usage: end",-    "  Ends the current game."+    "- Ends the current game."     ], [-    "Quit:",+    "Quit: quit the current game",     "Usage: quit",-    "  Quit the current game."+    "- Quit the current game."     ], [-    "See:",+    "See: see a player's allegiance",     "Usage: see PLAYER",-    "  See a player's allegiance. A Seer may determine a player's allegiance once per day."+    "- See a player's allegiance. A Seer may determine a player's allegiance once per day."     ], [-    "Start:",-    "Usage: start PLAYER ...",-    "  Starts a new game with the given players. A game requires at least 7 players."+    "Start: start a new game",+    "Usage: start [--extra-roles ROLE,...] PLAYER ...",+    "- Starts a new game with the given players and extra roles. A game requires at least 7 players."     ], [-    "Vote:",+    "Vote: vote against a player",     "Usage: vote PLAYER",     T.unwords [-        "  Vote against a player.",+        "- Vote against a player.",         "A townsperson may vote at daytime to lynch someone",         "and a Werewolf may vote at nighttime to kill a Villager."         ]
app/Werewolf/Options.hs view
@@ -19,10 +19,10 @@     werewolfPrefs, werewolfInfo, werewolf, ) where -import Data.List.Extra-import           Data.Text    (Text)-import qualified Data.Text    as T-import           Data.Version (showVersion)+import           Data.List.Extra+import           Data.Text       (Text)+import qualified Data.Text       as T+import           Data.Version    (showVersion)  import qualified Werewolf.Commands.Help      as Help import qualified Werewolf.Commands.Interpret as Interpret
src/Game/Werewolf/Engine.hs view
@@ -130,7 +130,9 @@     turn' <- use turn     alivePlayers <- uses players filterAlive -    let nextTurn = head . drop1 $ filter (turnAvailable $ map _role alivePlayers) (dropWhile (turn' /=) turnRotation)+    let nextTurn = if length (nub $ map (_allegiance . _role) alivePlayers) <= 1+        then NoOne+        else head . drop1 $ filter (turnAvailable $ map _role alivePlayers) (dropWhile (turn' /=) turnRotation)      tell $ turnMessages nextTurn alivePlayers 
src/Game/Werewolf/Game.hs view
@@ -34,7 +34,7 @@ import           Data.Text (Text)  import Game.Werewolf.Player-import Game.Werewolf.Role hiding (Villagers, Werewolves)+import Game.Werewolf.Role   hiding (Villagers, Werewolves)  data Game = Game     { _turn    :: Turn
src/Game/Werewolf/Response.hs view
@@ -129,7 +129,7 @@ turnMessages Seers players      = seersTurnMessages $ filter isSeer players turnMessages Villagers _        = [villagersTurnMessage] turnMessages Werewolves players = werewolvesTurnMessages $ filter isWerewolf players-turnMessages NoOne _            = undefined+turnMessages NoOne _            = []  seersTurnMessages :: [Player] -> [Message] seersTurnMessages seers = publicMessage "The Seers wake up.":privateMessage (map _name seers) "Who's allegiance would you like to see?":[]
werewolf.cabal view
@@ -1,5 +1,5 @@ name:           werewolf-version:        0.3.0.1+version:        0.3.0.3  author:         Henry J. Wylde maintainer:     public@hjwylde.com