Work on chase crit shape

This commit is contained in:
2026-04-01 13:46:27 +01:00
parent 5f886106e2
commit 6d1cdcc9f3
11 changed files with 154 additions and 128 deletions
+23 -1
View File
@@ -10,6 +10,7 @@ module Dodge.Creature.Picture (
drawChaseCrit,
) where
import Linear
import Dodge.Data.Equipment.Misc
import Dodge.Creature.HandPos
import qualified Data.IntMap.Strict as IM
@@ -50,12 +51,33 @@ basicCrShape cr
rotmdir = rotateSH (_crMvDir cr - _crDir cr)
drawChaseCrit :: Creature -> Shape
drawChaseCrit cr = rotmdir $ colorSH (_skinLower cskin) $ feet cr
drawChaseCrit cr = mconcat
[ chaseUpperBody cr
, rotmdir $ colorSH (_skinLower cskin) $ feet cr
]
where
cskin = crShape $ _crType cr
crsize = 0.1 * crRad (cr ^. crType)
rotmdir = rotateSH (_crMvDir cr - _crDir cr)
chaseUpperBody :: Creature -> Shape
chaseUpperBody cr = colorSH (_skinUpper cskin)
(overPosSH (Q.apply torsoq) (upperPrismPolyHalfMI tz $ polyCirc 3 12
& each %~ vNormal
& each . _y *~ 0.6)
<> overPosSH (Q.apply neckq) (upperPrismPolyHalfMI 3 $ (+ V2 8 0) . vNormal <$> trapTBH 2 5 8)
)
<> colorSH (_skinHead cskin)
(overPosSH (Q.apply headq) (upperBox Medium Important 2 [V2 0 (-4), V2 9 0, V2 0 4]))
where
tz = 4
cskin = crShape $ _crType cr
torsoq = (V3 0 0 (10 + tz),Q.qid)
mcool = 1 - min 10 (fromIntegral . _meleeCooldown $ _crType cr) / 10
neckq = torsoq `Q.comp` (V3 6 0 0,Q.axisAngle (V3 0 1 0) (-1.8*mcool))
headq = neckq `Q.comp` (V3 16 0 0, Q.axisAngle (V3 0 1 0) (2*mcool))
oneSmooth :: Float -> Float
oneSmooth x = sin (pi * x * 0.5)