Add skin colors

This commit is contained in:
2022-06-04 12:25:16 +01:00
parent 2b9ad58f6f
commit 602a004e87
14 changed files with 68 additions and 37 deletions
+9 -11
View File
@@ -36,7 +36,7 @@ basicCrPict :: Creature
basicCrPict cr cfig w =
drawCrEquipment cr
<>
(basicCrShape col cr
(basicCrShape cr
, pictures $
targetingPic ++
[ creatureDisplayText cfig w cr
@@ -44,7 +44,6 @@ basicCrPict cr cfig w =
]
)
where
col = _crSkinColor cr
targetingPic = IM.elems $ IM.mapMaybeWithKey f $ _crInv cr
f invid it = fmap (\g -> g invid it cr cfig w) (it ^? itTargeting . tgDraw)
@@ -58,24 +57,23 @@ shapeAtCrPos sh cr _ _ =
)
basicCrShape
:: Color -- ^ Creature color
-> Creature
:: Creature
-> Shape
basicCrShape col cr
basicCrShape cr
| _crCamouflage cr == Invisible = mempty
| otherwise = tr . scaleSH (V3 crsize crsize crsize) $ mconcat
[ --rotdir . _spShape $ drawEquipment cr
rotdir . dm . translateSHz 20 $ scalp cr
, rotdir . dm $ upperBody col cr
, dm . rotmdir $ feet cr
rotdir . dm . colorSH (_skinHead cskin) . translateSHz 20 $ scalp cr
, rotdir . dm $ colorSH (_skinUpper cskin) $ upperBody cr
, dm . rotmdir $ colorSH (_skinLower cskin) $ feet cr
]
where
cskin = _crSkin cr
crsize = 0.1 * _crRad cr
dm = damageModSH cr
tr = uncurryV translateSHf (_crPos cr)
rotdir = rotateSH (_crDir cr)
rotmdir = rotateSH (_crMvDir cr)
. colorSH (greyN 0.3)
creatureDisplayText :: Configuration -> World -> Creature -> Picture
creatureDisplayText cfig w cr
@@ -227,10 +225,10 @@ baseShoulder :: Shape
{-# INLINE baseShoulder #-}
baseShoulder = translateSHz (-10) . scaleSH (V3 0.5 1 1) . upperPrismPolyHalf 10 $ polyCirc 3 1
upperBody :: Color -> Creature -> Shape
upperBody :: Creature -> Shape
{-# INLINE upperBody #-}
--upperBody col cr = colorSH (light4 col) $ mconcat
upperBody col cr = colorSH (light4 col) $ mconcat
upperBody cr = mconcat
[ arms cr
, shoulderSH $ torso cr
]