diff options
author | Gregor Kleen <pngwjpgh@users.noreply.github.com> | 2016-07-08 01:31:19 +0200 |
---|---|---|
committer | Gregor Kleen <pngwjpgh@users.noreply.github.com> | 2016-07-08 01:32:01 +0200 |
commit | f235d13556440d9ae6e4cf0885f68e1794b81e61 (patch) | |
tree | e20f310b7421b25b72dc97a2bbb3e2ad9551fb39 /src/Main.hs | |
parent | 3496781f3ebad2901b60f19b388c893d8ad8aa37 (diff) | |
download | 2017-01-16_17:13:37-f235d13556440d9ae6e4cf0885f68e1794b81e61.tar 2017-01-16_17:13:37-f235d13556440d9ae6e4cf0885f68e1794b81e61.tar.gz 2017-01-16_17:13:37-f235d13556440d9ae6e4cf0885f68e1794b81e61.tar.bz2 2017-01-16_17:13:37-f235d13556440d9ae6e4cf0885f68e1794b81e61.tar.xz 2017-01-16_17:13:37-f235d13556440d9ae6e4cf0885f68e1794b81e61.zip |
More logging
Diffstat (limited to 'src/Main.hs')
-rw-r--r-- | src/Main.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Main.hs b/src/Main.hs index 449e21d..de90b80 100644 --- a/src/Main.hs +++ b/src/Main.hs | |||
@@ -297,6 +297,7 @@ entitySeqVal' ident = void . runMaybeT $ do | |||
297 | & set seqVal (Just sNum) | 297 | & set seqVal (Just sNum) |
298 | & set seqEpsilon (entity ^. eStats . sSeqEpsilon) | 298 | & set seqEpsilon (entity ^. eStats . sSeqEpsilon) |
299 | gEntities . at ident .= Just (newEntity & set eSeqVal val) | 299 | gEntities . at ident .= Just (newEntity & set eSeqVal val) |
300 | gLog <>= pure (ident, "Sequence: " ++ show sNum) | ||
300 | 301 | ||
301 | spendSeq :: Int -> String -> Sh GameState () | 302 | spendSeq :: Int -> String -> Sh GameState () |
302 | spendSeq n logStr = withFocus $ \focusId -> do | 303 | spendSeq n logStr = withFocus $ \focusId -> do |
@@ -342,7 +343,7 @@ doShock dmg efLens = withFocus $ \focusId -> do | |||
342 | lStats . efLens . seApplied .= True | 343 | lStats . efLens . seApplied .= True |
343 | Effect (CI.original -> effectName) effect <- evalF . table $ cripple ^. seEffect | 344 | Effect (CI.original -> effectName) effect <- evalF . table $ cripple ^. seEffect |
344 | lStats <~ (MaybeT . fmap join . runMaybeT $ evalF effect) | 345 | lStats <~ (MaybeT . fmap join . runMaybeT $ evalF effect) |
345 | lift $ shellPutStrLn effectName | 346 | lift . outputLogged focusId $ "Effect: " ++ effectName |
346 | lift . addNote $ "Effect: " ++ effectName | 347 | lift . addNote $ "Effect: " ++ effectName |
347 | 348 | ||
348 | takeHit :: Int -> Completable (Set Hitzone) -> Completable DamageType -> Sh GameState () | 349 | takeHit :: Int -> Completable (Set Hitzone) -> Completable DamageType -> Sh GameState () |
@@ -355,7 +356,7 @@ takeHit dmg a1 a2 = flip withArg a1 $ \zones -> flip withArg a2 $ \dType -> with | |||
355 | dmg' <- MaybeT . focusState lStats . evalFormula' [name] $ absorb armor dType dmg | 356 | dmg' <- MaybeT . focusState lStats . evalFormula' [name] $ absorb armor dType dmg |
356 | forM_ (Map.toList dmg') $ \(dType, dmg) -> lift . runMaybeT $ do | 357 | forM_ (Map.toList dmg') $ \(dType, dmg) -> lift . runMaybeT $ do |
357 | guard $ dmg > 0 | 358 | guard $ dmg > 0 |
358 | lift $ shellPutStrLn $ name ++ " took " ++ show dmg ++ " " ++ show dType | 359 | lift . outputLogged focusId $ name ++ " took " ++ show dmg ++ " " ++ show dType |
359 | case dType of | 360 | case dType of |
360 | Fatigue -> lStats . sFatigue += dmg | 361 | Fatigue -> lStats . sFatigue += dmg |
361 | _ -> lStats . sDamage . ix zone += dmg | 362 | _ -> lStats . sDamage . ix zone += dmg |