From d196ace4100ec5f8cfb0fad265d3baa44873fc9d Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Tue, 14 Jun 2016 03:26:18 +0200 Subject: fixed questions --- src/Sequence/Contact/Tests.hs | 5 +++-- src/Sequence/Contact/Types.hs | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 12 deletions(-) (limited to 'src/Sequence/Contact') 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 views sExtraSkills (baseTests <>) where - test k v = maybe mempty (Map.singleton k) <$> preview v + test k v = maybe mempty (Map.singleton k) <$> previews v (set (mapped . tName) k) skillTest = to (\x -> flip (set tBaseDifficulty) def <$> x) attributeTest = to (\x -> flip (set tBaseDifficulty) def . (* 10) <$> x) @@ -61,10 +61,11 @@ instance Argument (FormulaM Stats Test) GameState where enactTest :: Test -> FormulaM Stats TestResult enactTest rawTest = do test <- foldM (&) rawTest =<< toListOf (ctx . sModifiers . folded . _Modifier . _2) <$> ask + manualMod <- val ignored [CI.original (rawTest ^. tName), "Modifier"] False let critFailureBar = 95 - test^.tCritFailureMod critSuccessBar = 5 + test^.tCritSuccessMod - bar = test^.tBaseDifficulty + test^.tMod + bar = test^.tBaseDifficulty + test^.tMod + manualMod toResult pw = (toResult' pw) pw (abs $ bar - pw) toResult' pw | 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 where apply = sModifiers <>~ [Modifier (CI.mk $ effectName ++ " (modifier)") modifier] -vStrength = val sAStrength "Stärke?" True -vEndurance = val sAEndurance "Ausdauer?" True -vMass = val sAMass "Masse?" True -vReflexes = val sAReflexes "Reflexe?" True -vMobility = val sAMobility "Beweglichkeit?" True -vDexterity = val sADexterity "Geschicklichkeit?" True -vIntelligence = val sAIntelligence "Intelligenz?" True -vCharisma = val sACharisma "Charisma?" True -vPerception = val sAPerception "Wahrnehmung?" True -vWillpower = val sAWillpower "Entschlossenheit?" True +vStrength = val sAStrength ["Stärke"] True +vEndurance = val sAEndurance ["Ausdauer"] True +vMass = val sAMass ["Masse"] True +vReflexes = val sAReflexes ["Reflexe"] True +vMobility = val sAMobility ["Beweglichkeit"] True +vDexterity = val sADexterity ["Geschicklichkeit"] True +vIntelligence = val sAIntelligence ["Intelligenz"] True +vCharisma = val sACharisma ["Charisma"] True +vPerception = val sAPerception ["Wahrnehmung"] True +vWillpower = val sAWillpower ["Entschlossenheit"] True scaled :: Ratio Int -> Iso' Int Int scaled r = iso (\x -> floor $ x % 1 * r) (\x -> round $ x % 1 / r) -- cgit v1.2.3