39 lines
1.1 KiB
Haskell
39 lines
1.1 KiB
Haskell
module Dodge.Creature.Info (
|
|
yourInfo,
|
|
) where
|
|
|
|
import Dodge.Creature.Statistics
|
|
import Dodge.Inventory.CheckSlots
|
|
import Dodge.Data.Creature
|
|
import LensHelp
|
|
|
|
yourInfo :: Creature -> String
|
|
yourInfo cr =
|
|
yourStatsInfo cr
|
|
++ " You can carry a maximum of " ++ show maxInvSlots ++ " individual items. "
|
|
++ " You can't remember your name."
|
|
|
|
statsModifier :: Int -> String -> String -> String -> String
|
|
statsModifier x s1 s2 s3
|
|
| x < 15 = "extremely " ++ s1
|
|
| x < 30 = "very " ++ s1
|
|
| x < 45 = "quite " ++ s1
|
|
| x < 55 = "of average " ++ s2
|
|
| x < 70 = "quite " ++ s3
|
|
| x < 85 = "very " ++ s3
|
|
| x < 100 = "extremely " ++ s3
|
|
| otherwise = "super-humanly " ++ s3
|
|
|
|
yourStatsInfo :: Creature -> String
|
|
yourStatsInfo cr =
|
|
"You are " ++ statsModifier str "weak" "strength" "strong" ++ conj
|
|
++ statsModifier dex "clumsy." "dexterity." "dexterous."
|
|
where
|
|
str = cr & crStrength
|
|
dex = cr & crDexterity
|
|
conj
|
|
| (str < 45 && dex < 45) || (str > 55 && dex > 55) || (mid str && mid dex) =
|
|
" and "
|
|
| otherwise = " but "
|
|
mid x = x > 45 && x < 55
|