From 1ca2b48b49d559158cda4feffa145bdfded2c1c2 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 13 Jun 2016 19:20:36 +0200 Subject: shockeffekte --- src/Sequence/Contact/Archetypes.hs | 159 ++++++++++++++++++++++++++++++------- 1 file changed, 132 insertions(+), 27 deletions(-) diff --git a/src/Sequence/Contact/Archetypes.hs b/src/Sequence/Contact/Archetypes.hs index d790917..626104b 100644 --- a/src/Sequence/Contact/Archetypes.hs +++ b/src/Sequence/Contact/Archetypes.hs @@ -51,7 +51,7 @@ 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 +death zone = Effect "Tod" . runMaybeT $ do maxVitality <- (MaybeT . preview $ ctx . sMaxVitality) >>= lift currentDmg <- MaybeT . preview $ ctx . sDamage' zone allDmg <- MaybeT . preview $ ctx . sTotalDamage @@ -88,6 +88,9 @@ damageMods = [ Modifier "Schmerz" $ damageMod sTotalDamage sPainTolerance let mod = dmg - tolerance return $ test & over tMod (+ mod) +vitBar :: Ratio Int -> Traversal' Stats (Formula Stats) +vitBar prop = sMaxVitality . mapping (scaled prop) + human = Humanoid { _sAStrength = vStrength , _sAEndurance = vEndurance @@ -149,9 +152,9 @@ human = Humanoid , _sArmor = const def , _sCripple = fromJust . flip Map.lookup [ ("Kopf", def & 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" $ death "Kopf") + & set seBar (vitBar 0.5) + & set seReBar (vitBar 0.2) + & set seEffect (cTable [ (1, 10, death "Kopf") , (11, 25, effect "Blind") , (26, 35, effect "Blind, Rechts") , (36, 45, effect "Blind, Links") @@ -161,9 +164,9 @@ human = Humanoid ) , ("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") + & set seBar (vitBar 0.75) + & set seReBar (vitBar 0.2) + & set seEffect (cTable [ (1, 5, 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) @@ -174,10 +177,10 @@ human = Humanoid , ("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 seBar (vitBar 0.2) + & set seReBar (vitBar 0.2) & set seEffect ( cTable [ (1, 5, effect "Querschnittsgelähmt") - , (6, 25, Effect "Impotenz" . previews ctx $ over sFatigue (+ 15)) + , (6, 25, Effect "Kastration" . previews ctx $ over sFatigue (+ 15)) , (26, 50, effect "Innere Blutung (2 Schaden (Au) Minuten)") , (51, 100, Effect "Bewusstlos" unconscious) ]) @@ -192,15 +195,15 @@ human = Humanoid , _sSequence = Nothing , _sPainShock = def - & set seReBar (sMaxVitality . mapping (scaled 0.75)) - & set seEffect ( cTable [ (1, 5, Effect "Organversagen" $ death "Torso") + & set seReBar (vitBar 0.75) + & set seEffect ( cTable [ (1, 5, 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 seReBar (vitBar 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) @@ -213,8 +216,8 @@ human = Humanoid where arm zone = def & set seVal (sDamage' zone . to return) - & set seBar (sMaxVitality . mapping (scaled 0.3)) - & set seReBar (sMaxVitality . mapping (scaled 0.2)) + & set seBar (vitBar 0.3) + & set seReBar (vitBar 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%)") @@ -223,8 +226,8 @@ human = Humanoid ]) bein zone = def & set seVal (sDamage' zone . to return) - & set seBar (sMaxVitality . mapping (scaled 0.4)) - & set seReBar (sMaxVitality . mapping (scaled 0.2)) + & set seBar (vitBar 0.4) + & set seReBar (vitBar 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)) @@ -257,17 +260,75 @@ dog = Quadruped , _sSeqEpsilon = False - , _sHitzones = [ ("Kopf", 0.05) - , ("Torso", 0.49) - , ("Rechter Vorderlauf", 0.08) - , ("Linker Vorderlauf", 0.08) - , ("Hinterteil", 0.10) - , ("Rechter Hinterlauf", 0.10) - , ("Linker Hinterlauf", 0.10) - ] - , _sDamage = const 0 + , _sHitzones = cTable [ (1, 5, "Kopf") + , (6, 54, "Torso") + , (55, 62, "Rechter Vorderlauf") + , (63, 70, "Linker Vorderlauf") + , (71, 80, "Hinterteil") + , (81, 90, "Rechter Hinterlauf") + , (91, 100, "Linker Hinterlauf") + ] , _sArmor = const def + , _sCripple = fromJust . flip Map.lookup [ ("Kopf", def + & set seVal (sDamage' "Kopf" . to return) + & set seBar (vitBar 0.5) + & set seReBar (vitBar 0.2) + & set seEffect (cTable [ (1, 10, death "Kopf") + , (11, 25, effect "Blind") + , (26, 35, effect "Blind, Rechts") + , (36, 45, effect "Blind, Links") + , (46, 75, effect "Geruchssinn ist verloren") + , (76, 100, Effect "Bewusstlos" . unconsciousR $ 2 * d 10) + ]) + ) + , ("Torso", def + & set seVal (sDamage' "Torso" . to return) + & set seBar (vitBar 0.75) + & set seReBar (vitBar 0.2) + & set seEffect ( cTable [ (1, 5, 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) + ]) + ) + , ("Hinterteil", def + & set seVal (sDamage' "Hinterteil" . to return) + & set seBar (vitBar 0.2) + & set seReBar (vitBar 0.2) + & set seEffect ( cTable [ (1, 5, effect "Querschnittsgelähmt") + , (6, 25, Effect "Kastration" . previews ctx $ over sFatigue (+ 10)) + , (26, 50, effect "Innere Blutung (2 Schaden (Au) Minuten)") + , (51, 100, Effect "Bewusstlos" . unconsciousR $ 2 * d 10) + ]) + ) + , (\x -> (x, lauf x)) "Rechter Vorderlauf" + , (\x -> (x, lauf x)) "Linker Vorderlauf" + , (\x -> (x, lauf x)) "Rechter Hinterlauf" + , (\x -> (x, lauf x)) "Linker Hinterlauf" + ] + + , _sDamage = const 0 + , _sFatigue = 0 + + , _sSequence = Nothing + + , _sPainShock = def + , _sFatigueShock = def + + , _sExtraSkills = [] + , _sModifiers = damageMods } + where + lauf zone = def + & set seVal (sDamage' zone . to return) + & set seBar (vitBar 0.3) + & set seReBar (vitBar 0.2) + & set seEffect ( cTable [ (1, 10, amputate zone) + , (11, 25, effect $ review hitzone zone ++ " ist gelähmt und unbrauchbar (halbierte Bewegung)") + , (26, 45, Effect "Schmerzen" . previews ctx $ over sFatigue (+ 15)) + , (46, 100, Effect "Fleischwunde" . previews ctx $ over sFatigue (+ 5)) + ]) dolphin = Dolphin { _sAStrength = vStrength @@ -298,8 +359,52 @@ dolphin = Dolphin , ("Rumpf", 0.65) , ("Schwanz", 0.25) ] - , _sDamage = const 0 , _sArmor = const def + , _sCripple = fromJust . flip Map.lookup [ ("Kopf", def + & set seVal (sDamage' "Kopf" . to return) + & set seBar (vitBar 0.6) + & set seReBar (vitBar 0.2) + & set seEffect ( cTable [ (1, 10, death "Kopf") + , (11, 25, effect "Blind") + , (26, 35, effect "Blind, Rechts") + , (36, 45, effect "Blind, Links") + , (46, 75, effect "Verlust des Biosonar") + , (76, 100, Effect "Bewusstlos" . unconsciousR $ 2 * d 10) + ]) + ) + , ("Rumpf", def + & set seVal (sDamage' "Rumpf" . to return) + & set seBar (vitBar 0.8) + & set seReBar (vitBar 0.2) + & set seEffect ( cTable [ (1, 5, death "Rumpf") + , (6, 25, Effect "Organschäden" . previews ctx $ over sFatigue (+ 7) . over (sDamage' "Rumpf") (+ 20)) + , (26, 45, effect "Blutung (2 Schaden (Au) Minuten)") + , (46, 75, Effect "Bewusstlos" unconscious) + , (76, 100, Effect "Bewusstlos" . unconsciousR $ d 10) + ]) + ) + , ("Schwanz", def + & set seVal (sDamage' "Schwanz" . to return) + & set seBar (vitBar 0.4) + & set seReBar (vitBar 0.2) + & set seEffect ( cTable [ (1, 10, amputate "Schwanz") + , (11, 25, effect "Halbierte Bewegung") + , (26, 45, Effect "Schmerz" . previews ctx $ over sFatigue (+ 15)) + , (46, 100, effect "Fleischwunde") + ]) + ) + ] + + , _sDamage = const 0 + , _sFatigue = 0 + + , _sSequence = Nothing + + , _sPainShock = def + , _sFatigueShock = def + + , _sExtraSkills = [] + , _sModifiers = damageMods } childOfMu = human -- cgit v1.2.3