Add Read/Show instance for Creature

This commit is contained in:
2022-07-22 10:44:54 +01:00
parent 4c5218c633
commit 6b69fc1684
35 changed files with 345 additions and 225 deletions
+4 -13
View File
@@ -9,7 +9,10 @@ module Dodge.Creature.Picture
, picAtCrPos
, shapeAtCrPos
, picAtCrPosNoRot
, basicCrCorpse
-- , basicCrCorpse
, deadScalp
, deadUpperBody
, deadFeet
) where
import Dodge.Data
import Dodge.Creature.HandPos (translateToRightHand,translateToLeftHand)
@@ -230,15 +233,3 @@ picAtCrPosNoRot :: Picture -> Creature -> SPic
--{-# INLINE picAtCrPos #-}
picAtCrPosNoRot thePic cr = (,) emptySH $ uncurryV translate (_crPos cr) thePic
basicCrCorpse :: Creature -> Corpse -> SPic
basicCrCorpse cr cp = noPic . tr . scaleSH (V3 crsize crsize crsize) $ mconcat
[ rotdir . colorSH (_skinHead cskin) $ deadScalp cr
, rotdir $ colorSH (_skinUpper cskin) $ deadUpperBody cr
, rotdir . rotmdir $ colorSH (_skinLower cskin) $ deadFeet cr
]
where
cskin = _crType cr -- this should be fixed
crsize = 0.1 * _crRad cr
tr = uncurryV translateSHf (_cpPos cp)
rotdir = rotateSH (_cpDir cp)
rotmdir = rotateSH (_crMvDir cr - _crDir cr)