From a016d9c507e906cba12f8d39d42a93e09ab4e7ec Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 9 Jul 2016 14:45:28 +0200 Subject: Transfinite armor --- src/Main.hs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/Main.hs') diff --git a/src/Main.hs b/src/Main.hs index 4b78ae2..3d098e2 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -165,9 +165,12 @@ stateMaintenance = do return x isDead <- evalF =<< MaybeT (preuse $ lStats . sDead) isUnconscious <- evalF =<< MaybeT (preuse $ lStats . sUnconscious) - guard $ isDead || isUnconscious - when isDead . lift . shellPutStrLn $ name ++ " is dead" - when (isUnconscious && not isDead) . lift . shellPutStrLn $ name ++ " is unconscious" + isDestroyed <- evalF =<< MaybeT (preuse $ lStats . sDestroyed) + guard $ isDead || isUnconscious || isDestroyed + case (isDead, isDestroyed, isUnconscious) of + (True, _, _) -> lift . shellPutStrLn $ name ++ " is dead" + (_, True, _) -> lift . shellPutStrLn $ name ++ " is unconscious" + (_, _, True) -> lift . shellPutStrLn $ name ++ " is destroyed" gFocus' . eSeqVal .= Nothing -- gFocus .= Nothing void $ do -- cgit v1.2.3