Commit before messing with item tree orientation etc
This commit is contained in:
@@ -24,6 +24,7 @@ module Dodge.Creature.Test (
|
||||
crSafeDistFromTarg,
|
||||
) where
|
||||
|
||||
import Dodge.Item.Grammar
|
||||
import Dodge.Creature.Radius
|
||||
import Dodge.Data.Equipment.Misc
|
||||
import Dodge.Data.AimStance
|
||||
@@ -94,8 +95,8 @@ crInAimStance as cr = crIsAiming cr && mitstance == Just as
|
||||
where
|
||||
mitstance = do
|
||||
i <- cr ^? crManipulation . manObject . imRootSelectedItem
|
||||
itm <- cr ^? crInv . ix i
|
||||
return $ aStance itm
|
||||
itm <- invRootTrees (cr ^. crInv) ^? ix i
|
||||
return $ aimStance itm
|
||||
--cr ^? crInv . ix i . itUse . heldAim . aimStance
|
||||
|
||||
oneH :: Creature -> Bool
|
||||
|
||||
@@ -140,7 +140,7 @@ setAimPosture = (crStance . posture .~ Aiming) . doAimTwist (- twoHandTwistAmoun
|
||||
doAimTwist :: Float -> Creature -> Creature
|
||||
doAimTwist x cr = fromMaybe cr $ do
|
||||
itRef <- cr ^? crManipulation . manObject . imRootSelectedItem
|
||||
astance <- fmap aStance $ cr ^? crInv . ix itRef
|
||||
astance <- fmap itemBaseStance $ cr ^? crInv . ix itRef
|
||||
guard $ astance == TwoHandOver || astance == TwoHandUnder
|
||||
return $ cr & crDir +~ x
|
||||
|
||||
|
||||
Reference in New Issue
Block a user