summaryrefslogtreecommitdiff
path: root/src/Sequence/Contact
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2016-06-10 14:02:54 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2016-06-10 14:02:54 +0200
commitd8b49cbe1aff7cb3fcacac01d36128a248fc848b (patch)
treea006809f338a88a13c11dde14dd56782d0870ccd /src/Sequence/Contact
parent736e78441ae8b0cffa610de4baa7248f726cf69c (diff)
download2017-01-16_17:13:37-d8b49cbe1aff7cb3fcacac01d36128a248fc848b.tar
2017-01-16_17:13:37-d8b49cbe1aff7cb3fcacac01d36128a248fc848b.tar.gz
2017-01-16_17:13:37-d8b49cbe1aff7cb3fcacac01d36128a248fc848b.tar.bz2
2017-01-16_17:13:37-d8b49cbe1aff7cb3fcacac01d36128a248fc848b.tar.xz
2017-01-16_17:13:37-d8b49cbe1aff7cb3fcacac01d36128a248fc848b.zip
More sequence fu
Diffstat (limited to 'src/Sequence/Contact')
-rw-r--r--src/Sequence/Contact/Archetypes.hs13
-rw-r--r--src/Sequence/Contact/Types.hs6
-rw-r--r--src/Sequence/Contact/Types/Internal.hs15
3 files changed, 28 insertions, 6 deletions
diff --git a/src/Sequence/Contact/Archetypes.hs b/src/Sequence/Contact/Archetypes.hs
index ff37fdb..32cfa22 100644
--- a/src/Sequence/Contact/Archetypes.hs
+++ b/src/Sequence/Contact/Archetypes.hs
@@ -96,6 +96,7 @@ human = Humanoid
96 , _sPainTolerance = vMass `quot'` 2 + vWillpower 96 , _sPainTolerance = vMass `quot'` 2 + vWillpower
97 , _sFatigueTolerance = vWillpower `quot'` 2 + vEndurance 97 , _sFatigueTolerance = vWillpower `quot'` 2 + vEndurance
98 98
99
99 , _sHitzones = cTable [ (1, 5, "Kopf") 100 , _sHitzones = cTable [ (1, 5, "Kopf")
100 , (6, 54, "Torso") 101 , (6, 54, "Torso")
101 , (55, 62, "Rechter Arm") 102 , (55, 62, "Rechter Arm")
@@ -113,7 +114,7 @@ human = Humanoid
113 , (26, 35, effect "Blind, Rechts") 114 , (26, 35, effect "Blind, Rechts")
114 , (36, 45, effect "Blind, Links") 115 , (36, 45, effect "Blind, Links")
115 , (46, 75, effect "Taub") 116 , (46, 75, effect "Taub")
116 , (76, 100, effect "Bewusstlos – 1w10 Runden") 117 , (76, 100, Effect "Bewusstlos" . unconscious $ d 10)
117 ]) 118 ])
118 ) 119 )
119 , ("Torso", def) 120 , ("Torso", def)
@@ -127,8 +128,13 @@ human = Humanoid
127 , _sDamage = const 0 128 , _sDamage = const 0
128 , _sFatigue = 0 129 , _sFatigue = 0
129 130
131 , _sSequence = Nothing
132
130 , _sPainShock = def 133 , _sPainShock = def
131 , _sFatigueShock = def 134 , _sFatigueShock = def
135
136 , _sExtraSkills = []
137 , _sModifiers = []
132 } 138 }
133 where 139 where
134 headshot = runMaybeT $ do 140 headshot = runMaybeT $ do
@@ -139,6 +145,11 @@ human = Humanoid
139 dmg' = if dmg >= 0 then dmg else 0 145 dmg' = if dmg >= 0 then dmg else 0
140 MaybeT . previews ctx $ set (sDamage' "Kopf") dmg' 146 MaybeT . previews ctx $ set (sDamage' "Kopf") dmg'
141 147
148 unconscious :: Formula Stats -> FormulaM Stats (Maybe Stats)
149 unconscious roundsF = do
150 rounds <- roundsF
151 previews ctx $ over (sSequence . _Just . seqRound . _Wrapped) (+ rounds)
152
142dog = Quadruped 153dog = Quadruped
143 { _sAStrength = vStrength 154 { _sAStrength = vStrength
144 , _sAEndurance = vEndurance 155 , _sAEndurance = vEndurance
diff --git a/src/Sequence/Contact/Types.hs b/src/Sequence/Contact/Types.hs
index a0add1a..dff886d 100644
--- a/src/Sequence/Contact/Types.hs
+++ b/src/Sequence/Contact/Types.hs
@@ -94,7 +94,7 @@ makePrisms ''SeqVal
94makeLenses ''SeqVal 94makeLenses ''SeqVal
95 95
96instance Default SeqVal where 96instance Default SeqVal where
97 def = SeqVal { _seqRound = 0 97 def = SeqVal { _seqRound = Down 0
98 , _seqVal = Nothing 98 , _seqVal = Nothing
99 , _seqEpsilon = False 99 , _seqEpsilon = False
100 } 100 }
@@ -112,7 +112,9 @@ makeLenses ''Stats
112 112
113instance Default Stats where 113instance Default Stats where
114 def = Prop 114 def = Prop
115 { _sHitzones = [("Volumen", 1)] 115 { _sSeqEpsilon = False
116
117 , _sHitzones = [("Volumen", 1)]
116 , _sArmor = const def 118 , _sArmor = const def
117 , _sCripple = const def 119 , _sCripple = const def
118 120
diff --git a/src/Sequence/Contact/Types/Internal.hs b/src/Sequence/Contact/Types/Internal.hs
index 7e9be2b..e4a2eef 100644
--- a/src/Sequence/Contact/Types/Internal.hs
+++ b/src/Sequence/Contact/Types/Internal.hs
@@ -7,6 +7,7 @@ import Sequence.Formula (Formula, FormulaM, Table)
7import Data.Map (Map) 7import Data.Map (Map)
8import Data.Set (Set) 8import Data.Set (Set)
9import Data.Ratio 9import Data.Ratio
10import Data.Ord
10import Data.Monoid 11import Data.Monoid
11 12
12import Control.Lens 13import Control.Lens
@@ -46,11 +47,11 @@ data Modifier = Modifier (CI String) (Test -> FormulaM Stats Test)
46data Effect = Effect (CI String) (FormulaM Stats (Maybe Stats)) 47data Effect = Effect (CI String) (FormulaM Stats (Maybe Stats))
47 48
48data SeqVal = SeqVal 49data SeqVal = SeqVal
49 { _seqRound :: Int 50 { _seqRound :: Down Int
50 , _seqVal :: Maybe Int 51 , _seqVal :: Maybe Int
51 , _seqEpsilon :: Bool 52 , _seqEpsilon :: Bool
52 } 53 }
53 deriving (Show, Ord, Eq) 54 deriving (Show, Eq, Ord)
54 55
55data ShockEffect = ShockEffect 56data ShockEffect = ShockEffect
56 { _seApplied :: Bool 57 { _seApplied :: Bool
@@ -60,7 +61,9 @@ data ShockEffect = ShockEffect
60 } 61 }
61 62
62data Stats = Prop 63data Stats = Prop
63 { _sHitzones :: Table Hitzone 64 { _sSeqEpsilon :: Bool
65
66 , _sHitzones :: Table Hitzone
64 , _sArmor :: Hitzone -> Armor 67 , _sArmor :: Hitzone -> Armor
65 , _sCripple :: Hitzone -> ShockEffect 68 , _sCripple :: Hitzone -> ShockEffect
66 69
@@ -123,6 +126,8 @@ data Stats = Prop
123 , _sPainTolerance 126 , _sPainTolerance
124 , _sFatigueTolerance :: Formula Stats 127 , _sFatigueTolerance :: Formula Stats
125 128
129 , _sSeqEpsilon :: Bool
130
126 , _sHitzones :: Table Hitzone 131 , _sHitzones :: Table Hitzone
127 , _sArmor :: Hitzone -> Armor 132 , _sArmor :: Hitzone -> Armor
128 , _sCripple :: Hitzone -> ShockEffect 133 , _sCripple :: Hitzone -> ShockEffect
@@ -161,6 +166,8 @@ data Stats = Prop
161 , _sPainTolerance 166 , _sPainTolerance
162 , _sFatigueTolerance :: Formula Stats 167 , _sFatigueTolerance :: Formula Stats
163 168
169 , _sSeqEpsilon :: Bool
170
164 , _sHitzones :: Table Hitzone 171 , _sHitzones :: Table Hitzone
165 , _sArmor :: Hitzone -> Armor 172 , _sArmor :: Hitzone -> Armor
166 , _sCripple :: Hitzone -> ShockEffect 173 , _sCripple :: Hitzone -> ShockEffect
@@ -199,6 +206,8 @@ data Stats = Prop
199 , _sPainTolerance 206 , _sPainTolerance
200 , _sFatigueTolerance :: Formula Stats 207 , _sFatigueTolerance :: Formula Stats
201 208
209 , _sSeqEpsilon :: Bool
210
202 , _sHitzones :: Table Hitzone 211 , _sHitzones :: Table Hitzone
203 , _sArmor :: Hitzone -> Armor 212 , _sArmor :: Hitzone -> Armor
204 , _sCripple :: Hitzone -> ShockEffect 213 , _sCripple :: Hitzone -> ShockEffect