From 532600423afbfe83185c6de28f951ebc3bcf5c3f Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 12 Jun 2016 15:46:19 +0200 Subject: =?UTF-8?q?cripple=20&=20shock=20=E2=80=93=20human?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Sequence/Contact/Archetypes.hs | 104 ++++++++++++++++++++++++++++++------- 1 file changed, 84 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/Sequence/Contact/Archetypes.hs b/src/Sequence/Contact/Archetypes.hs index 1ad26bb..5f431de 100644 --- a/src/Sequence/Contact/Archetypes.hs +++ b/src/Sequence/Contact/Archetypes.hs @@ -47,6 +47,30 @@ archetypes = [ ("Mensch", human) cTable :: Ord v => [(Integer, Integer, v)] -> Table v cTable = Map.fromList . map (\(from, to, value) -> (value, (abs (to - from) + 1) % 100)) +death :: Hitzone -> FormulaM Stats (Maybe Stats) +death zone = runMaybeT $ do + maxVitality <- (MaybeT . preview $ ctx . sMaxVitality) >>= lift + currentDmg <- MaybeT . preview $ ctx . sDamage' zone + allDmg <- MaybeT . preview $ ctx . sTotalDamage + let dmg = currentDmg + (maxVitality - allDmg) + dmg' = if dmg >= 0 then dmg else 0 + MaybeT . previews ctx $ set (sDamage' zone) dmg' + +unconsciousR :: Formula Stats -> FormulaM Stats (Maybe Stats) +unconsciousR roundsF = do + rounds <- roundsF + previews ctx $ over (sSequence . _Just . seqRound . _Wrapped) (+ rounds) + +unconscious :: FormulaM Stats (Maybe Stats) +unconscious = previews ctx $ set sSequence Nothing + +amputate :: Hitzone -> Effect +amputate zone = Effect (CI.mk $ review hitzone zone ++ " ist verloren") . runMaybeT $ do + hitzones <- MaybeT . preview $ ctx . sHitzones + (fromRational -> zoneProp) <- MaybeT . return $ Map.lookup zone hitzones + MaybeT . previews ctx . execState $ do + sHitzones %= Map.delete zone + sMaxVitality %= view (mapping . scaled $ 1 - zoneProp) human = Humanoid { _sAStrength = vStrength @@ -111,20 +135,39 @@ human = Humanoid & set seVal (sDamage' "Kopf" . to return) & set seBar (sMaxVitality . mapping (scaled 0.5)) & set seReBar (sMaxVitality . mapping (scaled 0.2)) - & set seEffect (cTable [ (1, 10, Effect "Tod" headshot) + & set seEffect (cTable [ (1, 10, Effect "Tod" $ death "Kopf") , (11, 25, effect "Blind") , (26, 35, effect "Blind, Rechts") , (36, 45, effect "Blind, Links") , (46, 75, effect "Taub") - , (76, 100, Effect "Bewusstlos" . unconscious $ d 10) + , (76, 100, Effect "Bewusstlos" . unconsciousR $ d 10) ]) ) - , ("Torso", def) - , ("Rechter Arm", def) - , ("Linker Arm", def) - , ("Unterleib", def) - , ("Rechtes Bein", def) - , ("Linkes Bein", def) + , ("Torso", def + & set seVal (sDamage' "Torso" . to return) + & set seBar (sMaxVitality . mapping (scaled 0.75)) + & set seReBar (sMaxVitality . mapping (scaled 0.2)) + & set seEffect (cTable [ (1, 5, Effect "Tod" $ death "Torso") + , (6, 25, Effect "Organschäden" . previews ctx $ over sFatigue (+ 25) . over (sDamage' "Torso") (+ 10)) + , (26, 45, effect "Innere Blutung (3 Schaden (Au) Minuten)") + , (46, 75, Effect "Bewusstlos" unconscious) + , (76, 100, Effect "Bewusstlos" . unconsciousR $ d 10) + ]) + ) + , ("Rechter Arm", arm "Rechter Arm") + , ("Linker Arm", arm "Linker Arm") + , ("Unterleib", def + & set seVal (sDamage' "Unterleib" . to return) + & set seBar (sMaxVitality . mapping (scaled 0.2)) + & set seReBar (sMaxVitality . mapping (scaled 0.2)) + & set seEffect ( cTable [ (1, 5, effect "Querschnittsgelähmt") + , (6, 25, Effect "Impotenz" . previews ctx $ over sFatigue (+ 15)) + , (26, 50, effect "Innere Blutung (2 Schaden (Au) Minuten)") + , (51, 100, Effect "Bewusstlos" unconscious) + ]) + ) + , ("Rechtes Bein", bein "Rechtes Bein") + , ("Linkes Bein", bein "Linkes Bein") ] , _sDamage = const 0 @@ -133,24 +176,45 @@ human = Humanoid , _sSequence = Nothing , _sPainShock = def + & set seReBar (sMaxVitality . mapping (scaled 0.75)) + & set seEffect ( cTable [ (1, 5, Effect "Organversagen" $ death "Torso") + , (6, 25, Effect "Koma" unconscious) + , (26, 45, Effect "Bewusstlos" . unconsciousR $ d 10) + , (46, 75, Effect "Bewusstlos" unconscious) + , (76, 100, Effect "Verlangsamt" $ d 10 >>= (\loss -> previews ctx $ over (sSequence . _Just . seqVal . _Just) (+ (-loss)))) + ]) , _sFatigueShock = def + & set seReBar (sMaxVitality . mapping (scaled 0.75)) + & set seEffect ( cTable [ (1, 25, Effect "Bewusstlos" . unconsciousR $ 2 * d 10) + , (26, 50, Effect "Bewusstlos" . unconsciousR $ d 10) + , (51, 75, Effect "Bewusstlos" unconscious) + , (76, 100, Effect "Verlangsamt" $ 2 * d 10 >>= (\loss -> previews ctx $ over (sSequence . _Just . seqVal . _Just) (+ (-loss)))) + ]) , _sExtraSkills = [] , _sModifiers = [] } where - headshot = runMaybeT $ do - maxVitality <- (MaybeT . preview $ ctx . sMaxVitality) >>= lift - currentDmg <- MaybeT . preview $ ctx . sDamage' "Kopf" - allDmg <- MaybeT . preview $ ctx . sTotalDamage - let dmg = currentDmg + (maxVitality - allDmg) - dmg' = if dmg >= 0 then dmg else 0 - MaybeT . previews ctx $ set (sDamage' "Kopf") dmg' - - unconscious :: Formula Stats -> FormulaM Stats (Maybe Stats) - unconscious roundsF = do - rounds <- roundsF - previews ctx $ over (sSequence . _Just . seqRound . _Wrapped) (+ rounds) + arm zone = def + & set seVal (sDamage' zone . to return) + & set seBar (sMaxVitality . mapping (scaled 0.3)) + & set seReBar (sMaxVitality . mapping (scaled 0.2)) + & set seEffect (cTable [ (1, 10, amputate zone) + , (11, 25, effect $ review hitzone zone ++ " ist gelähmt und unbrauchbar") + , (26, 45, effect $ review hitzone zone ++ " hat eingeschränkte Funktion (-50%)") + , (46, 75, Effect "Schwerste Schmerzen" . previews ctx $ over sFatigue (+ 10)) + , (76, 100, effect "Fleischwunde") + ]) + bein zone = def + & set seVal (sDamage' zone . to return) + & set seBar (sMaxVitality . mapping (scaled 0.4)) + & set seReBar (sMaxVitality . mapping (scaled 0.2)) + & set seEffect (cTable [ (1, 10, amputate zone) + , (11, 45, effect $ review hitzone zone ++ " ist gelähmt und unbrauchbar (halbierte Bewegung)") + , (46, 75, Effect "Schwerste Schmerzen" . previews ctx $ over sFatigue (+ 10)) + , (76, 100, effect "Fleischwunde") + ]) + dog = Quadruped { _sAStrength = vStrength -- cgit v1.2.3