Add shrinkability and cursed items

This commit is contained in:
2021-11-18 18:30:22 +00:00
parent 147d6098ab
commit a546d070f0
82 changed files with 273 additions and 233 deletions
+9 -19
View File
@@ -10,18 +10,10 @@ module Dodge.Creature.Picture
, picAtCrPosNoRot
) where
import Dodge.Data
import Dodge.Config.Data
--import Dodge.Data.DamageType
--import Dodge.Base
--import Dodge.Creature.Stance.Data
import Dodge.Creature.Perception.Data
--import Dodge.Creature.State.Data
import Dodge.Creature.Stance.Data
--import Dodge.Creature.Memory.Data
import Dodge.Creature.Test
--import Dodge.Creature.AlertLevel.Data
--import Dodge.Picture.Layer
import Dodge.Item.Data
import Dodge.Clock
import Picture
import Geometry
@@ -58,13 +50,14 @@ basicCrShape
:: Color -- ^ Creature color
-> Creature
-> Shape
basicCrShape col cr = tr $ mconcat
basicCrShape col cr = 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
]
where
crsize = 0.1 * _crRad cr
dm = damageModSH cr
tr = uncurryV translateSHf (_crPos cr)
rotdir = rotateSH (_crDir cr)
@@ -161,7 +154,7 @@ arms :: Creature -> Shape
{-# INLINE arms #-}
arms cr
| oneH cr = shoulderSH . translateSHf 11 (-3) . rotateSH (-0.5) $ scaleSH (V3 1 1.5 1) aHand
| twists cr = shoulderSH . translateSHf 0 (0.5* crad) . rotateSH (-1) $ mconcat
| twists cr = shoulderSH . translateSHf 0 5 . rotateSH (-1) $ mconcat
[ translateSHf 12 4 aHand
, translateSHf 4 (-10) aHand
]
@@ -175,7 +168,6 @@ arms cr
--crIt = _crInv cr IM.! _crInvSel cr
aHand :: Shape
aHand = translateSHz (-4) . upperPrismPolyHalf 4 $ polyCirc 3 4
crad = _crRad cr
off = 8
sLen = _strideLength $ _crStance cr
f i = negate 2 + negate 6 * fromIntegral (sLen - i) / fromIntegral sLen
@@ -183,12 +175,11 @@ arms cr
scalp :: Creature -> Shape
{-# INLINE scalp #-}
scalp cr
| twists cr = translateSHf 0 (0.5*crad) . rotateSH (-1) $ translateSHf (negate 0.25 * crad) 0.25 fhead
| oneH cr = rotateSH 0.5 $ translateSHf (0.25 * crad) 0 fhead
| otherwise = translateSHf (0.25 * crad) 0 fhead
| twists cr = translateSHf 0 5 . rotateSH (-1) $ translateSHf (negate 2.5) 0.25 fhead
| oneH cr = rotateSH 0.5 $ translateSHf 2.5 0 fhead
| otherwise = translateSHf 2.5 0 fhead
where
fhead = colorSH (greyN 0.9) . upperPrismPolyHalf 5 . polyCirc 4 $ crad * 0.5
crad = _crRad cr
fhead = colorSH (greyN 0.9) . upperPrismPolyHalf 5 $ polyCirc 4 5
oneH :: Creature -> Bool
oneH cr = crIsAiming' cr && crIt ^? itAimStance == Just OneHand
@@ -212,7 +203,7 @@ torso cr
[ translateSHf 0 3 . rotateSH (negate 0.2) $ aShoulder
, translateSHf 0 (negate 3) . rotateSH 0.2 $ aShoulder
]
| twists cr = translateSHf 0 (0.5* crad) . rotateSH (-1) $ mconcat
| twists cr = translateSHf 0 5 . rotateSH (-1) $ mconcat
[ rotateSH (negate 0.2) . translateSHf 2 3 . rotateSH (negate 0.4) $ aShoulder
, rotateSH (negate 0.2) . translateSHf 0 (negate 3) . rotateSH 0.2 $ aShoulder
]
@@ -222,8 +213,7 @@ torso cr
]
where
--aShoulder = translateSHz (-10) . scaleSH (V3 0.5 1 1) . upperPrismPoly 10 $ polyCirc 3 crad
aShoulder = scaleSH (V3 crad crad 1) baseShoulder
crad = _crRad cr
aShoulder = scaleSH (V3 10 10 1) baseShoulder
baseShoulder :: Shape
{-# INLINE baseShoulder #-}