summaryrefslogtreecommitdiff
path: root/src/Sequence
diff options
context:
space:
mode:
Diffstat (limited to 'src/Sequence')
-rw-r--r--src/Sequence/Contact/Tests.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Sequence/Contact/Tests.hs b/src/Sequence/Contact/Tests.hs
index 82b1cf3..a3b15d7 100644
--- a/src/Sequence/Contact/Tests.hs
+++ b/src/Sequence/Contact/Tests.hs
@@ -54,9 +54,10 @@ instance Completion (FormulaM Stats Test) GameState where
54instance Argument (FormulaM Stats Test) GameState where 54instance Argument (FormulaM Stats Test) GameState where
55 arg str = join <$> preuses (gFocus' . eStats) (preview (getTest str)) 55 arg str = join <$> preuses (gFocus' . eStats) (preview (getTest str))
56 56
57enactTest :: Test -> FormulaM input TestResult 57enactTest :: Test -> FormulaM Stats TestResult
58enactTest test = toResult <$> d 100 58enactTest rawTest = do
59 where 59 test <- foldM (&) rawTest =<< toListOf (ctx . sModifiers . folded . _Modifier . _2) <$> ask
60 let
60 critFailureBar = 95 - test^.tCritFailureMod 61 critFailureBar = 95 - test^.tCritFailureMod
61 critSuccessBar = 5 + test^.tCritSuccessMod 62 critSuccessBar = 5 + test^.tCritSuccessMod
62 bar = test^.tBaseDifficulty + test^.tMod 63 bar = test^.tBaseDifficulty + test^.tMod
@@ -67,6 +68,7 @@ enactTest test = toResult <$> d 100
67 | pw <= bar = Success 68 | pw <= bar = Success
68 | pw >= critFailureBar = CritFailure 69 | pw >= critFailureBar = CritFailure
69 | otherwise = Failure 70 | otherwise = Failure
71 toResult <$> d 100
70 72
71-- hasTest :: Stats -> String -> Bool 73-- hasTest :: Stats -> String -> Bool
72-- hasTest stats str = has (getTest str) stats 74-- hasTest stats str = has (getTest str) stats