From fbaf4d9da45f714c32f410d3b5785fd06504325a Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 4 Jun 2016 18:06:36 +0200 Subject: archetypes & cleanup --- src/Sequence/Contact/Archetypes.hs | 90 ++++++++++++++++++++++++++++++++++++++ src/Sequence/Contact/Types.hs | 12 ++++- 2 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 src/Sequence/Contact/Archetypes.hs (limited to 'src/Sequence/Contact') 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 @@ +{-# LANGUAGE OverloadedStrings, OverloadedLists, ViewPatterns, MultiParamTypeClasses #-} + +module Sequence.Contact.Archetypes where + +import Control.Lens + +import Sequence.Contact.Types +import Sequence.Formula + +import Sequence.Types +import Sequence.Utils + +import Data.Map (Map) +import qualified Data.Map as Map + +import Data.Default + +import Data.List + +import Data.CaseInsensitive (CI) +import qualified Data.CaseInsensitive as CI + + +instance Completion Entity GameState where + completableLabel _ = "" + complete _ _ (CI.foldCase -> prefix) = return . filter (prefix `isPrefixOf`) . map CI.foldedCase $ Map.keys archetypes + +instance Argument Entity GameState where + arg = return . fmap (flip (set eStats) def) . flip Map.lookup archetypes . CI.mk + +archetypes :: Map (CI String) Stats +archetypes = [ ("Mensch", human) + , ("Kind von Mu", childOfMu) + ] + + +human = Humanoid + { _sAStrength = vStrength + , _sAEndurance = vEndurance + , _sAMass = vMass + , _sAReflexes = vReflexes + , _sAMobility = vMobility + , _sADexterity = vDexterity + , _sAIntelligence = vIntelligence + , _sACharisma = vCharisma + , _sAPerception = vPerception + , _sAWillpower = vWillpower + + , _sSArchaicRanged = 20 + vStrength `quot'` 2 + vDexterity `quot'` 2 + vPerception + , _sSFirearms = 15 + vMobility `quot'` 2 + vDexterity `quot'` 2 + vPerception + , _sSHeavyWeapons = vStrength `quot'` 2 + vPerception + , _sSEnergyWeapons = 10 + vMobility `quot'` 2 + vDexterity `quot'` 2 + vPerception + , _sSUnarmedMelee = 30 + vReflexes + vMobility `quot'` 2 + , _sSArmedMelee = 25 + vReflexes + vMobility `quot'` 2 + , _sSThrownWeapons = 25 + vMobility `quot'` 2 + vPerception + , _sSStealth = 5 + vMobility + vDexterity + , _sSThievery = 5 + vDexterity * 2 + vIntelligence + , _sSLockpicking = vDexterity + vIntelligence + , _sSTrapping = vDexterity + vIntelligence + vPerception `quot'` 2 + , _sSSciences = 10 + vIntelligence * 4 + , _sSFirstAid = 10 + vDexterity + vIntelligence * 2 + , _sSMedicine = 5 + vDexterity `quot'` 2 + vIntelligence * 3 + , _sSHumanities = 20 + vIntelligence * 3 + , _sSEngineering = 5 + vDexterity + vIntelligence * 2 + , _sSCraft = 25 + vDexterity * 2 + , _sSInterface = 5 + vIntelligence * 2 + vPerception `quot'` 2 + , _sSSpeech = vIntelligence + vCharisma * 2 + vWillpower `quot'` 2 + , _sSLeadership = 5 + vCharisma * 3 + vWillpower + , _sSHomeEconomics = 25 + vIntelligence + , _sSSurvival = 30 + vReflexes + vMobility + vIntelligence + vPerception + vWillpower `quot'` 2 + , _sSMotorcycle = vReflexes * 2 + vMobility + vWillpower + , _sSWheeled = 15 + vReflexes + vWillpower + , _sSHovercraft = 10 + vReflexes + vWillpower + , _sSAircraft = vReflexes + vWillpower + , _sSSpacecraft = vReflexes + vIntelligence `quot'` 2 + vPerception `quot'` 2 + , _sSWatercraft = 20 + vReflexes `quot'` 2 + vPerception `quot'` 2 + , _sSTracked = 15 + vReflexes + vPerception + , _sSExoskeleton = 30 + vReflexes + vMobility * 2 + vPerception + + , _sMaxVitality = vEndurance * 2 + vMass * 2 + vWillpower + 10 + , _sSeqVal = vReflexes * 2 + vMobility + vPerception + d 10 + , _sPainTolerance = vMass `quot'` 2 + vWillpower + , _sFatigueTolerance = vWillpower `quot'` 2 + vEndurance + } + +childOfMu = human + & sAStrength +~ 2 + & sAReflexes +~ 5 + & sAMobility +~ 5 + & 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 , _sSHumanities , _sSEngineering , _sSCraft - , _sSInterfacte + , _sSInterface , _sSSpeech , _sSLeadership , _sSHomeEconomics @@ -108,3 +108,13 @@ makeLenses ''Stats instance Default Stats where def = Prop +vStrength = val sAStrength "Stärke?" True +vEndurance = val sAEndurance "Ausdauer?" True +vMass = val sAMass "Masse?" True +vReflexes = val sAReflexes "Reflexe?" True +vMobility = val sAMobility "Beweglichkeit?" True +vDexterity = val sADexterity "Geschicklichkeit?" True +vIntelligence = val sAIntelligence "Intelligenz?" True +vCharisma = val sACharisma "Charisma?" True +vPerception = val sAPerception "Wahrnehmung?" True +vWillpower = val sAWillpower "Entschlossenheit?" True -- cgit v1.2.3