diff options
Diffstat (limited to 'src/Sequence/Contact')
| -rw-r--r-- | src/Sequence/Contact/Tests.hs | 5 | ||||
| -rw-r--r-- | src/Sequence/Contact/Types.hs | 20 |
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 | |||
| 61 | enactTest :: Test -> FormulaM Stats TestResult | 61 | enactTest :: Test -> FormulaM Stats TestResult |
| 62 | enactTest rawTest = do | 62 | enactTest 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 | ||
| 133 | vStrength = val sAStrength "Stärke?" True | 133 | vStrength = val sAStrength ["Stärke"] True |
| 134 | vEndurance = val sAEndurance "Ausdauer?" True | 134 | vEndurance = val sAEndurance ["Ausdauer"] True |
| 135 | vMass = val sAMass "Masse?" True | 135 | vMass = val sAMass ["Masse"] True |
| 136 | vReflexes = val sAReflexes "Reflexe?" True | 136 | vReflexes = val sAReflexes ["Reflexe"] True |
| 137 | vMobility = val sAMobility "Beweglichkeit?" True | 137 | vMobility = val sAMobility ["Beweglichkeit"] True |
| 138 | vDexterity = val sADexterity "Geschicklichkeit?" True | 138 | vDexterity = val sADexterity ["Geschicklichkeit"] True |
| 139 | vIntelligence = val sAIntelligence "Intelligenz?" True | 139 | vIntelligence = val sAIntelligence ["Intelligenz"] True |
| 140 | vCharisma = val sACharisma "Charisma?" True | 140 | vCharisma = val sACharisma ["Charisma"] True |
| 141 | vPerception = val sAPerception "Wahrnehmung?" True | 141 | vPerception = val sAPerception ["Wahrnehmung"] True |
| 142 | vWillpower = val sAWillpower "Entschlossenheit?" True | 142 | vWillpower = val sAWillpower ["Entschlossenheit"] True |
| 143 | 143 | ||
| 144 | scaled :: Ratio Int -> Iso' Int Int | 144 | scaled :: Ratio Int -> Iso' Int Int |
| 145 | scaled r = iso (\x -> floor $ x % 1 * r) (\x -> round $ x % 1 / r) | 145 | scaled r = iso (\x -> floor $ x % 1 * r) (\x -> round $ x % 1 / r) |
