From 5f886106e24e2c2af6c0023a04bc0a9caa830f74 Mon Sep 17 00:00:00 2001 From: justin Date: Wed, 1 Apr 2026 12:12:17 +0100 Subject: [PATCH] Add smoothing to feet, start new chase crit picture --- src/Dodge/Creature/Picture.hs | 15 +++++++++++++-- src/Dodge/Creature/Test.hs | 3 --- src/Dodge/Creature/YourControl.hs | 6 +----- src/Dodge/Render/ShapePicture.hs | 1 + src/Dodge/Room/Tutorial.hs | 5 ++++- 5 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/Dodge/Creature/Picture.hs b/src/Dodge/Creature/Picture.hs index 4ec3a9dcc..c2b718ef9 100644 --- a/src/Dodge/Creature/Picture.hs +++ b/src/Dodge/Creature/Picture.hs @@ -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 #-} diff --git a/src/Dodge/Creature/Test.hs b/src/Dodge/Creature/Test.hs index 8e1850f38..fefcbf150 100644 --- a/src/Dodge/Creature/Test.hs +++ b/src/Dodge/Creature/Test.hs @@ -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, diff --git a/src/Dodge/Creature/YourControl.hs b/src/Dodge/Creature/YourControl.hs index c8990988b..74ddd0350 100644 --- a/src/Dodge/Creature/YourControl.hs +++ b/src/Dodge/Creature/YourControl.hs @@ -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 diff --git a/src/Dodge/Render/ShapePicture.hs b/src/Dodge/Render/ShapePicture.hs index 2b88e8841..272a9d120 100644 --- a/src/Dodge/Render/ShapePicture.hs +++ b/src/Dodge/Render/ShapePicture.hs @@ -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 diff --git a/src/Dodge/Room/Tutorial.hs b/src/Dodge/Room/Tutorial.hs index 309ac8f66..1cd8a4a0b 100644 --- a/src/Dodge/Room/Tutorial.hs +++ b/src/Dodge/Room/Tutorial.hs @@ -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