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,
deadUpperBody,
deadFeet,
drawChaseCrit,
) where
import Dodge.Data.Equipment.Misc
@@ -48,6 +49,16 @@ basicCrShape cr
crsize = 0.1 * crRad (cr ^. crType)
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
{-# INLINE feet #-}
feet cr = case cr ^? crStance . carriage of
@@ -59,8 +70,8 @@ feet cr = case cr ^? crStance . carriage of
aFoot = upperPrismPolyST 10 $ polyCirc 3 4
off = 5
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
{-# INLINE deadFeet #-}
-3
View File
@@ -7,16 +7,13 @@ in fact a creature with that id need not exist.
-}
module Dodge.Creature.Test (
crIsAiming,
-- crIsReloading,
crIsArmouredFrom,
oneH,
twists,
twoFlat,
-- crWeaponReady,
crInAimStance,
crNearPoint,
isAnimate,
-- crCanShoot,
crHasTargetLOS,
crAwayFromPost,
crHasTarget,
+1 -5
View File
@@ -28,11 +28,7 @@ yourControl _ w
| inTextInputFocus w = w
| NoSubInventory <- w ^. hud . subInventory =
w
& cWorld
. lWorld
. creatures
. ix 0
%~ wasdWithAiming w
& cWorld . lWorld . creatures . ix 0 %~ wasdWithAiming w
& tryClickUse (w ^. input . mouseButtons)
& handleHotkeys
| 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
BarrelCrit{} -> barrelShape
LampCrit{_lampHeight = h} -> lampCrSPic h
ChaseCrit {} -> noPic $ drawChaseCrit cr
_ -> basicCrPict m cr
barrelShape :: SPic
+4 -1
View File
@@ -437,10 +437,13 @@ loadAmmoTut = do
=<< shuffleLinks
=<< roomRectAutoLights 100 100
droom <- distributerRoom BulletAmmo (10 ^ (8::Int))
croom <- roomCCrits 2
return $
tToBTree "loadAmmoTest" $
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
, wprm & rmPmnts .:~ sps (PS 50 0) (PutFlIt burstRifle)
, triggerDoorRoom j