Add AimStance to creature posture when Aiming
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
{-# LANGUAGE LambdaCase #-}
|
||||
module Dodge.Item.AimStance (aimStance,itemBaseStance) where
|
||||
module Dodge.Item.AimStance (itemAimStance,itemBaseStance) where
|
||||
|
||||
import Dodge.Data.Item
|
||||
import Dodge.Data.ComposedItem
|
||||
@@ -7,8 +7,8 @@ import Dodge.Data.DoubleTree
|
||||
import Control.Lens
|
||||
import Dodge.Data.AimStance
|
||||
|
||||
aimStance :: DTree CItem -> AimStance
|
||||
aimStance dt
|
||||
itemAimStance :: DTree CItem -> AimStance
|
||||
itemAimStance dt
|
||||
| islasweapon = TwoHandFlat
|
||||
| otherwise = itemBaseStance $ dt ^. dtValue . _1
|
||||
where
|
||||
|
||||
@@ -34,9 +34,10 @@ handleOrient loc = case loc ^. locDT . dtValue . _1 . itType of
|
||||
_ -> (V3 (-3) 0 0, Q.qID)
|
||||
|
||||
-- note this is relative to the creature
|
||||
-- the aimstance here should match any aimstance in Aiming
|
||||
handOrient :: Creature -> AimStance -> Point3Q
|
||||
handOrient cr = case cr ^. crStance . posture of
|
||||
Aiming -> \case
|
||||
Aiming {} -> \case
|
||||
TwoHandUnder -> (V3 (-3) 0 shoulderHeight, Q.qID)
|
||||
TwoHandOver -> (V3 0 0 shoulderHeight, Q.qID)
|
||||
OneHand -> (V3 13 (-2) shoulderHeight, Q.qID)
|
||||
@@ -60,7 +61,7 @@ locOrient loc cr =
|
||||
|
||||
handHandleOrient :: LocationDT CItem -> Creature -> Point3Q
|
||||
handHandleOrient loc cr =
|
||||
handOrient cr (aimStance (loc' ^. locDT))
|
||||
handOrient cr (itemAimStance (loc' ^. locDT))
|
||||
`Q.comp` handleOrient loc'
|
||||
where
|
||||
loc' = locToTop loc
|
||||
|
||||
Reference in New Issue
Block a user