diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2016-06-04 18:06:36 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2016-06-04 18:06:36 +0200 |
commit | fbaf4d9da45f714c32f410d3b5785fd06504325a (patch) | |
tree | 053712472ca7e73f70a43c66b8d4b718591c8584 /src/Sequence/Contact | |
parent | 048779ac250b0cb463839edd8f46d9785fb3f9e5 (diff) | |
download | 2017-01-16_17:13:37-fbaf4d9da45f714c32f410d3b5785fd06504325a.tar 2017-01-16_17:13:37-fbaf4d9da45f714c32f410d3b5785fd06504325a.tar.gz 2017-01-16_17:13:37-fbaf4d9da45f714c32f410d3b5785fd06504325a.tar.bz2 2017-01-16_17:13:37-fbaf4d9da45f714c32f410d3b5785fd06504325a.tar.xz 2017-01-16_17:13:37-fbaf4d9da45f714c32f410d3b5785fd06504325a.zip |
archetypes & cleanup
Diffstat (limited to 'src/Sequence/Contact')
-rw-r--r-- | src/Sequence/Contact/Archetypes.hs | 90 | ||||
-rw-r--r-- | src/Sequence/Contact/Types.hs | 12 |
2 files changed, 101 insertions, 1 deletions
diff --git a/src/Sequence/Contact/Archetypes.hs b/src/Sequence/Contact/Archetypes.hs new file mode 100644 index 0000000..94addce --- /dev/null +++ b/src/Sequence/Contact/Archetypes.hs | |||
@@ -0,0 +1,90 @@ | |||
1 | {-# LANGUAGE OverloadedStrings, OverloadedLists, ViewPatterns, MultiParamTypeClasses #-} | ||
2 | |||
3 | module Sequence.Contact.Archetypes where | ||
4 | |||
5 | import Control.Lens | ||
6 | |||
7 | import Sequence.Contact.Types | ||
8 | import Sequence.Formula | ||
9 | |||
10 | import Sequence.Types | ||
11 | import Sequence.Utils | ||
12 | |||
13 | import Data.Map (Map) | ||
14 | import qualified Data.Map as Map | ||
15 | |||
16 | import Data.Default | ||
17 | |||
18 | import Data.List | ||
19 | |||
20 | import Data.CaseInsensitive (CI) | ||
21 | import qualified Data.CaseInsensitive as CI | ||
22 | |||
23 | |||
24 | instance Completion Entity GameState where | ||
25 | completableLabel _ = "<archetype>" | ||
26 | complete _ _ (CI.foldCase -> prefix) = return . filter (prefix `isPrefixOf`) . map CI.foldedCase $ Map.keys archetypes | ||
27 | |||
28 | instance Argument Entity GameState where | ||
29 | arg = return . fmap (flip (set eStats) def) . flip Map.lookup archetypes . CI.mk | ||
30 | |||
31 | archetypes :: Map (CI String) Stats | ||
32 | archetypes = [ ("Mensch", human) | ||
33 | , ("Kind von Mu", childOfMu) | ||
34 | ] | ||
35 | |||
36 | |||
37 | human = Humanoid | ||
38 | { _sAStrength = vStrength | ||
39 | , _sAEndurance = vEndurance | ||
40 | , _sAMass = vMass | ||
41 | , _sAReflexes = vReflexes | ||
42 | , _sAMobility = vMobility | ||
43 | , _sADexterity = vDexterity | ||
44 | , _sAIntelligence = vIntelligence | ||
45 | , _sACharisma = vCharisma | ||
46 | , _sAPerception = vPerception | ||
47 | , _sAWillpower = vWillpower | ||
48 | |||
49 | , _sSArchaicRanged = 20 + vStrength `quot'` 2 + vDexterity `quot'` 2 + vPerception | ||
50 | , _sSFirearms = 15 + vMobility `quot'` 2 + vDexterity `quot'` 2 + vPerception | ||
51 | , _sSHeavyWeapons = vStrength `quot'` 2 + vPerception | ||
52 | , _sSEnergyWeapons = 10 + vMobility `quot'` 2 + vDexterity `quot'` 2 + vPerception | ||
53 | , _sSUnarmedMelee = 30 + vReflexes + vMobility `quot'` 2 | ||
54 | , _sSArmedMelee = 25 + vReflexes + vMobility `quot'` 2 | ||
55 | , _sSThrownWeapons = 25 + vMobility `quot'` 2 + vPerception | ||
56 | , _sSStealth = 5 + vMobility + vDexterity | ||
57 | , _sSThievery = 5 + vDexterity * 2 + vIntelligence | ||
58 | , _sSLockpicking = vDexterity + vIntelligence | ||
59 | , _sSTrapping = vDexterity + vIntelligence + vPerception `quot'` 2 | ||
60 | , _sSSciences = 10 + vIntelligence * 4 | ||
61 | , _sSFirstAid = 10 + vDexterity + vIntelligence * 2 | ||
62 | , _sSMedicine = 5 + vDexterity `quot'` 2 + vIntelligence * 3 | ||
63 | , _sSHumanities = 20 + vIntelligence * 3 | ||
64 | , _sSEngineering = 5 + vDexterity + vIntelligence * 2 | ||
65 | , _sSCraft = 25 + vDexterity * 2 | ||
66 | , _sSInterface = 5 + vIntelligence * 2 + vPerception `quot'` 2 | ||
67 | , _sSSpeech = vIntelligence + vCharisma * 2 + vWillpower `quot'` 2 | ||
68 | , _sSLeadership = 5 + vCharisma * 3 + vWillpower | ||
69 | , _sSHomeEconomics = 25 + vIntelligence | ||
70 | , _sSSurvival = 30 + vReflexes + vMobility + vIntelligence + vPerception + vWillpower `quot'` 2 | ||
71 | , _sSMotorcycle = vReflexes * 2 + vMobility + vWillpower | ||
72 | , _sSWheeled = 15 + vReflexes + vWillpower | ||
73 | , _sSHovercraft = 10 + vReflexes + vWillpower | ||
74 | , _sSAircraft = vReflexes + vWillpower | ||
75 | , _sSSpacecraft = vReflexes + vIntelligence `quot'` 2 + vPerception `quot'` 2 | ||
76 | , _sSWatercraft = 20 + vReflexes `quot'` 2 + vPerception `quot'` 2 | ||
77 | , _sSTracked = 15 + vReflexes + vPerception | ||
78 | , _sSExoskeleton = 30 + vReflexes + vMobility * 2 + vPerception | ||
79 | |||
80 | , _sMaxVitality = vEndurance * 2 + vMass * 2 + vWillpower + 10 | ||
81 | , _sSeqVal = vReflexes * 2 + vMobility + vPerception + d 10 | ||
82 | , _sPainTolerance = vMass `quot'` 2 + vWillpower | ||
83 | , _sFatigueTolerance = vWillpower `quot'` 2 + vEndurance | ||
84 | } | ||
85 | |||
86 | childOfMu = human | ||
87 | & sAStrength +~ 2 | ||
88 | & sAReflexes +~ 5 | ||
89 | & sAMobility +~ 5 | ||
90 | & sAPerception +~ 2 | ||
diff --git a/src/Sequence/Contact/Types.hs b/src/Sequence/Contact/Types.hs index b63b369..d3ca31e 100644 --- a/src/Sequence/Contact/Types.hs +++ b/src/Sequence/Contact/Types.hs | |||
@@ -38,7 +38,7 @@ data Stats = Prop | |||
38 | , _sSHumanities | 38 | , _sSHumanities |
39 | , _sSEngineering | 39 | , _sSEngineering |
40 | , _sSCraft | 40 | , _sSCraft |
41 | , _sSInterfacte | 41 | , _sSInterface |
42 | , _sSSpeech | 42 | , _sSSpeech |
43 | , _sSLeadership | 43 | , _sSLeadership |
44 | , _sSHomeEconomics | 44 | , _sSHomeEconomics |
@@ -108,3 +108,13 @@ makeLenses ''Stats | |||
108 | instance Default Stats where | 108 | instance Default Stats where |
109 | def = Prop | 109 | def = Prop |
110 | 110 | ||
111 | vStrength = val sAStrength "Stärke?" True | ||
112 | vEndurance = val sAEndurance "Ausdauer?" True | ||
113 | vMass = val sAMass "Masse?" True | ||
114 | vReflexes = val sAReflexes "Reflexe?" True | ||
115 | vMobility = val sAMobility "Beweglichkeit?" True | ||
116 | vDexterity = val sADexterity "Geschicklichkeit?" True | ||
117 | vIntelligence = val sAIntelligence "Intelligenz?" True | ||
118 | vCharisma = val sACharisma "Charisma?" True | ||
119 | vPerception = val sAPerception "Wahrnehmung?" True | ||
120 | vWillpower = val sAWillpower "Entschlossenheit?" True | ||