Add smoothing to feet, start new chase crit picture

This commit is contained in:
2026-04-01 12:12:17 +01:00
parent 579d5296b1
commit 5f886106e2
5 changed files with 19 additions and 11 deletions
+13 -2
View File
@@ -7,6 +7,7 @@ module Dodge.Creature.Picture (
deadScalp, deadScalp,
deadUpperBody, deadUpperBody,
deadFeet, deadFeet,
drawChaseCrit,
) where ) where
import Dodge.Data.Equipment.Misc import Dodge.Data.Equipment.Misc
@@ -48,6 +49,16 @@ basicCrShape cr
crsize = 0.1 * crRad (cr ^. crType) crsize = 0.1 * crRad (cr ^. crType)
rotmdir = rotateSH (_crMvDir cr - _crDir cr) rotmdir = rotateSH (_crMvDir cr - _crDir cr)
drawChaseCrit :: Creature -> Shape
drawChaseCrit cr = rotmdir $ colorSH (_skinLower cskin) $ feet cr
where
cskin = crShape $ _crType cr
crsize = 0.1 * crRad (cr ^. crType)
rotmdir = rotateSH (_crMvDir cr - _crDir cr)
oneSmooth :: Float -> Float
oneSmooth x = sin (pi * x * 0.5)
feet :: Creature -> Shape feet :: Creature -> Shape
{-# INLINE feet #-} {-# INLINE feet #-}
feet cr = case cr ^? crStance . carriage of feet cr = case cr ^? crStance . carriage of
@@ -59,8 +70,8 @@ feet cr = case cr ^? crStance . carriage of
aFoot = upperPrismPolyST 10 $ polyCirc 3 4 aFoot = upperPrismPolyST 10 $ polyCirc 3 4
off = 5 off = 5
sLen = _strideLength $ _crStance cr sLen = _strideLength $ _crStance cr
--f i = 6 * (sLen - i) / sLen -- f i = 8 * (sLen - 2*i) / sLen
f i = 8 * (sLen - 2*i) / sLen f i = 8 * oneSmooth ((sLen - 2*i) / sLen)
deadFeet :: Creature -> Shape deadFeet :: Creature -> Shape
{-# INLINE deadFeet #-} {-# INLINE deadFeet #-}
-3
View File
@@ -7,16 +7,13 @@ in fact a creature with that id need not exist.
-} -}
module Dodge.Creature.Test ( module Dodge.Creature.Test (
crIsAiming, crIsAiming,
-- crIsReloading,
crIsArmouredFrom, crIsArmouredFrom,
oneH, oneH,
twists, twists,
twoFlat, twoFlat,
-- crWeaponReady,
crInAimStance, crInAimStance,
crNearPoint, crNearPoint,
isAnimate, isAnimate,
-- crCanShoot,
crHasTargetLOS, crHasTargetLOS,
crAwayFromPost, crAwayFromPost,
crHasTarget, crHasTarget,
+1 -5
View File
@@ -28,11 +28,7 @@ yourControl _ w
| inTextInputFocus w = w | inTextInputFocus w = w
| NoSubInventory <- w ^. hud . subInventory = | NoSubInventory <- w ^. hud . subInventory =
w w
& cWorld & cWorld . lWorld . creatures . ix 0 %~ wasdWithAiming w
. lWorld
. creatures
. ix 0
%~ wasdWithAiming w
& tryClickUse (w ^. input . mouseButtons) & tryClickUse (w ^. input . mouseButtons)
& handleHotkeys & handleHotkeys
| otherwise = w & cWorld . lWorld . creatures . ix 0 %~ wasdWithAiming w | otherwise = w & cWorld . lWorld . creatures . ix 0 %~ wasdWithAiming w
+1
View File
@@ -115,6 +115,7 @@ drawCreature m cr = translateSP (_crPos cr) . rotateSP (_crDir cr) $
_ | null (cr ^? crHP . _HP) -> mempty _ | null (cr ^? crHP . _HP) -> mempty
BarrelCrit{} -> barrelShape BarrelCrit{} -> barrelShape
LampCrit{_lampHeight = h} -> lampCrSPic h LampCrit{_lampHeight = h} -> lampCrSPic h
ChaseCrit {} -> noPic $ drawChaseCrit cr
_ -> basicCrPict m cr _ -> basicCrPict m cr
barrelShape :: SPic barrelShape :: SPic
+4 -1
View File
@@ -437,10 +437,13 @@ loadAmmoTut = do
=<< shuffleLinks =<< shuffleLinks
=<< roomRectAutoLights 100 100 =<< roomRectAutoLights 100 100
droom <- distributerRoom BulletAmmo (10 ^ (8::Int)) droom <- distributerRoom BulletAmmo (10 ^ (8::Int))
croom <- roomCCrits 2
return $ return $
tToBTree "loadAmmoTest" $ tToBTree "loadAmmoTest" $
treePost treePost
[amrm & rmPmnts .:~ sps (PS 50 0) (PutFlIt (drumMag & itConsumables ?~ 90)) [ croom
, door
, amrm & rmPmnts .:~ sps (PS 50 0) (PutFlIt (drumMag & itConsumables ?~ 90))
, triggerDoorRoom i , triggerDoorRoom i
, wprm & rmPmnts .:~ sps (PS 50 0) (PutFlIt burstRifle) , wprm & rmPmnts .:~ sps (PS 50 0) (PutFlIt burstRifle)
, triggerDoorRoom j , triggerDoorRoom j