summaryrefslogtreecommitdiff
path: root/src/Sequence/Contact
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2016-06-14 03:26:18 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2016-06-14 03:26:18 +0200
commitd196ace4100ec5f8cfb0fad265d3baa44873fc9d (patch)
tree6f6714769e2d539b70aef2f06ea0d7e16e46855e /src/Sequence/Contact
parent0c5fe56414a323f49d7b086c0a64a216443a22bb (diff)
download2017-01-16_17:13:37-d196ace4100ec5f8cfb0fad265d3baa44873fc9d.tar
2017-01-16_17:13:37-d196ace4100ec5f8cfb0fad265d3baa44873fc9d.tar.gz
2017-01-16_17:13:37-d196ace4100ec5f8cfb0fad265d3baa44873fc9d.tar.bz2
2017-01-16_17:13:37-d196ace4100ec5f8cfb0fad265d3baa44873fc9d.tar.xz
2017-01-16_17:13:37-d196ace4100ec5f8cfb0fad265d3baa44873fc9d.zip
fixed questions
Diffstat (limited to 'src/Sequence/Contact')
-rw-r--r--src/Sequence/Contact/Tests.hs5
-rw-r--r--src/Sequence/Contact/Types.hs20
2 files changed, 13 insertions, 12 deletions
diff --git a/src/Sequence/Contact/Tests.hs b/src/Sequence/Contact/Tests.hs
index 8665186..c100ce9 100644
--- a/src/Sequence/Contact/Tests.hs
+++ b/src/Sequence/Contact/Tests.hs
@@ -40,7 +40,7 @@ tests = do
40 40
41 views sExtraSkills (baseTests <>) 41 views sExtraSkills (baseTests <>)
42 where 42 where
43 test k v = maybe mempty (Map.singleton k) <$> preview v 43 test k v = maybe mempty (Map.singleton k) <$> previews v (set (mapped . tName) k)
44 44
45 skillTest = to (\x -> flip (set tBaseDifficulty) def <$> x) 45 skillTest = to (\x -> flip (set tBaseDifficulty) def <$> x)
46 attributeTest = to (\x -> flip (set tBaseDifficulty) def . (* 10) <$> x) 46 attributeTest = to (\x -> flip (set tBaseDifficulty) def . (* 10) <$> x)
@@ -61,10 +61,11 @@ instance Argument (FormulaM Stats Test) GameState where
61enactTest :: Test -> FormulaM Stats TestResult 61enactTest :: Test -> FormulaM Stats TestResult
62enactTest rawTest = do 62enactTest rawTest = do
63 test <- foldM (&) rawTest =<< toListOf (ctx . sModifiers . folded . _Modifier . _2) <$> ask 63 test <- foldM (&) rawTest =<< toListOf (ctx . sModifiers . folded . _Modifier . _2) <$> ask
64 manualMod <- val ignored [CI.original (rawTest ^. tName), "Modifier"] False
64 let 65 let
65 critFailureBar = 95 - test^.tCritFailureMod 66 critFailureBar = 95 - test^.tCritFailureMod
66 critSuccessBar = 5 + test^.tCritSuccessMod 67 critSuccessBar = 5 + test^.tCritSuccessMod
67 bar = test^.tBaseDifficulty + test^.tMod 68 bar = test^.tBaseDifficulty + test^.tMod + manualMod
68 toResult pw = (toResult' pw) pw (abs $ bar - pw) 69 toResult pw = (toResult' pw) pw (abs $ bar - pw)
69 toResult' pw 70 toResult' pw
70 | bar > critSuccessBar 71 | bar > critSuccessBar
diff --git a/src/Sequence/Contact/Types.hs b/src/Sequence/Contact/Types.hs
index 9bb9903..4bd9790 100644
--- a/src/Sequence/Contact/Types.hs
+++ b/src/Sequence/Contact/Types.hs
@@ -130,16 +130,16 @@ applyModifier effectName modifier = Effect (CI.mk effectName) $ previews ctx app
130 where 130 where
131 apply = sModifiers <>~ [Modifier (CI.mk $ effectName ++ " (modifier)") modifier] 131 apply = sModifiers <>~ [Modifier (CI.mk $ effectName ++ " (modifier)") modifier]
132 132
133vStrength = val sAStrength "Stärke?" True 133vStrength = val sAStrength ["Stärke"] True
134vEndurance = val sAEndurance "Ausdauer?" True 134vEndurance = val sAEndurance ["Ausdauer"] True
135vMass = val sAMass "Masse?" True 135vMass = val sAMass ["Masse"] True
136vReflexes = val sAReflexes "Reflexe?" True 136vReflexes = val sAReflexes ["Reflexe"] True
137vMobility = val sAMobility "Beweglichkeit?" True 137vMobility = val sAMobility ["Beweglichkeit"] True
138vDexterity = val sADexterity "Geschicklichkeit?" True 138vDexterity = val sADexterity ["Geschicklichkeit"] True
139vIntelligence = val sAIntelligence "Intelligenz?" True 139vIntelligence = val sAIntelligence ["Intelligenz"] True
140vCharisma = val sACharisma "Charisma?" True 140vCharisma = val sACharisma ["Charisma"] True
141vPerception = val sAPerception "Wahrnehmung?" True 141vPerception = val sAPerception ["Wahrnehmung"] True
142vWillpower = val sAWillpower "Entschlossenheit?" True 142vWillpower = val sAWillpower ["Entschlossenheit"] True
143 143
144scaled :: Ratio Int -> Iso' Int Int 144scaled :: Ratio Int -> Iso' Int Int
145scaled r = iso (\x -> floor $ x % 1 * r) (\x -> round $ x % 1 / r) 145scaled r = iso (\x -> floor $ x % 1 * r) (\x -> round $ x % 1 / r)