Remove duplicated selection/manipulation positions

Needs more testing to make sure it all works properly
This commit is contained in:
2026-05-14 20:40:46 +01:00
parent 06b984c2e5
commit c70097f1e1
15 changed files with 318 additions and 323 deletions
+4 -4
View File
@@ -66,10 +66,10 @@ rightHandPQ w cr
| oneH w cr = (V3 11 (-3) 20, Q.qid)
| twists w cr = (V3 0 5 20, Q.qz (-1)) `Q.comp` (V3 4 (-10) 0, Q.qz 1)
| twoFlat w cr = (V3 8 (-8) 12, Q.qid)
| Just TwoHandTwist <- w ^? hud . manObject . imAimStance
| Just TwoHandTwist <- w ^? hud . manObject . hiAimStance
--revise1 | Just TwoHandTwist <- cr ^? crManipulation . manObject . imAimStance
= (V3 6 (-6) 10, Q.qid)
| Just TwoHandFlat <- w ^? hud . manObject . imAimStance
| Just TwoHandFlat <- w ^? hud . manObject . hiAimStance
= (V3 (8 - twoHandOffY cr) (-8) 12, Q.qid)
| Just p <- crRightHandWall cr = (20 & _xy .~ p, Q.qid)
| otherwise = (handWalkingPos LeftForward (-8) cr, Q.qid)
@@ -120,10 +120,10 @@ leftHandPQ :: World -> Creature -> Point3Q
leftHandPQ w cr
| twists w cr = (V3 0 5 20, Q.qz (-1)) `Q.comp` (V3 12 4 0, Q.qz 0.4)
| twoFlat w cr = (V3 8 8 12, Q.qid)
| Just TwoHandTwist <- w ^? hud . manObject . imAimStance
| Just TwoHandTwist <- w ^? hud . manObject . hiAimStance
--revise1 | Just TwoHandTwist <- cr ^? crManipulation . manObject . imAimStance
= (V3 (10 + twoHandOffY cr) 6 20, Q.qid)
| Just TwoHandFlat <- w ^? hud . manObject . imAimStance
| Just TwoHandFlat <- w ^? hud . manObject . hiAimStance
= (V3 (8 + twoHandOffY cr) 6 12, Q.qid)
| Just p <- crLeftHandWall cr = (20 & _xy .~ p, Q.qid)
| oneH w cr = (V3 0 8 10, Q.qz 0.4)
+1 -1
View File
@@ -73,7 +73,7 @@ crCurrentEquipment lw = fmap f . _crEquipment
strFromHeldItem :: World -> Creature -> Int
strFromHeldItem w cr = fromMaybe 0 $ do
Aiming {} <- cr ^? crStance . posture
is <- w^?hud . manObject . imAttachedItems
is <- w^?hud . manObject . hiAttachedItems
--revise1 is <- cr ^? crManipulation . manObject . imAttachedItems
let js = IM.elems $ IM.restrictKeys (cr ^. crInv . unNIntMap) is
return . negate . sum . fmap itemWeight $ IM.restrictKeys (w ^.cWorld.lWorld. items) $ IS.fromList js
+1 -1
View File
@@ -86,7 +86,7 @@ crAwayFromPost cr = case _apGoal $ _crActionPlan cr of
crInAimStance :: AimStance -> World -> Creature -> Bool
crInAimStance as w cr = cr ^? crStance . posture == Just Aiming
&& w ^? hud . manObject . imAimStance == Just as
&& w ^? hud . manObject . hiAimStance == Just as
--revise1 && cr ^? crManipulation . manObject . imAimStance == Just as
oneH :: World -> Creature -> Bool
+2 -2
View File
@@ -128,7 +128,7 @@ wasdAim inp w cr
setposture x r =
cr
& crStance . posture .~ x
& doAimTwist (w ^? hud . manObject . imAimStance) r
& doAimTwist (w ^? hud . manObject . hiAimStance) r
--revise1 & doAimTwist (cr ^? crManipulation . manObject . imAimStance) r
mousedir = argV $ w ^. cWorld . lWorld . lAimPos - (cr ^. crPos . _xy)
@@ -156,7 +156,7 @@ aimTurn :: World -> Float -> Creature -> Creature
aimTurn lw a cr = creatureTurnTowardDir a (x * 0.2) cr
where
x = fromMaybe 1 $ do
itRef <- lw ^? hud . manObject . imRootSelectedItem
itRef <- lw ^? hud . manObject . hiRootSelectedItem
--revise1 itRef <- cr ^? crManipulation . manObject . imRootSelectedItem
fmap itemBulkiness $ cr ^? crInv . ix itRef >>= \k -> lw ^?cWorld.lWorld. items . ix k . itType