Work on weapon positioning
This commit is contained in:
@@ -65,8 +65,8 @@ rightHandPQ cr
|
||||
| oneH cr = (V3 11 (-3) 20, Q.qID)
|
||||
| twists cr = (V3 0 5 20, Q.qz (-1)) `Q.comp` (V3 4 (-10) 0, Q.qz 1)
|
||||
| twoFlat cr = (V3 4 (-8) 12, Q.qID)
|
||||
-- | Just dt <- yourRootItemDT w
|
||||
-- , Just as <- itemAimStance
|
||||
| Just TwoHandTwist <- cr ^? crManipulation . manObject . imAimStance
|
||||
= (V3 8 (-6) 10, Q.qID)
|
||||
| Just p <- crRightHandWall cr = (20 & _xy .~ p, Q.qID)
|
||||
| otherwise = (handWalkingPos LeftForward (-8) cr, Q.qID)
|
||||
|
||||
@@ -116,6 +116,10 @@ leftHandPQ :: Creature -> Point3Q
|
||||
leftHandPQ cr
|
||||
| twists cr = (V3 0 5 20, Q.qz (-1)) `Q.comp` (V3 12 4 0, Q.qz 0.4)
|
||||
| twoFlat cr = (V3 4 8 12, Q.qID)
|
||||
| Just TwoHandTwist <- cr ^? crManipulation . manObject . imAimStance
|
||||
= (V3 10 8 20, Q.qID)
|
||||
| Just TwoHandFlat <- cr ^? crManipulation . manObject . imAimStance
|
||||
= (V3 10 8 20, Q.qID)
|
||||
| Just p <- crLeftHandWall cr = (20 & _xy .~ p, Q.qID)
|
||||
| oneH cr = (V3 0 8 10, Q.qz 0.4)
|
||||
| otherwise = (handWalkingPos RightForward 8 cr, Q.qID)
|
||||
|
||||
@@ -102,7 +102,7 @@ twoFlat :: Creature -> Bool
|
||||
twoFlat = crInAimStance TwoHandFlat
|
||||
|
||||
twists :: Creature -> Bool
|
||||
twists cr = crInAimStance TwoHandUnder cr || crInAimStance TwoHandOver cr
|
||||
twists cr = crInAimStance TwoHandTwist cr
|
||||
|
||||
-- the use of crOldPos is because the damage position is calculated on the
|
||||
-- previous frame
|
||||
@@ -120,8 +120,7 @@ crIsArmouredFrom m p cr = fromMaybe False $ do
|
||||
-- even though angleVV can generate NaN, the comparison seems to deal with it
|
||||
frontarmdirection
|
||||
| crInAimStance OneHand cr = 0.5
|
||||
| crInAimStance TwoHandUnder cr = negate 1
|
||||
| crInAimStance TwoHandOver cr = negate 1
|
||||
| crInAimStance TwoHandTwist cr = negate 1
|
||||
| otherwise = 0
|
||||
|
||||
--crOnSeg :: Point2 -> Point2 -> Creature -> Bool
|
||||
|
||||
@@ -116,9 +116,6 @@ wasdWithAiming w cr = wasdAim inp w $ wasdMovement (w ^. cWorld . lWorld) inp ca
|
||||
|
||||
wasdAim :: Input -> World -> Creature -> Creature
|
||||
wasdAim inp w cr
|
||||
-- | Just 0 <- inp ^? mouseButtons . ix SDL.ButtonRight
|
||||
-- , Nothing <- inp ^? mouseButtons . ix SDL.ButtonLeft =
|
||||
-- setAimPosture cr
|
||||
| SDL.ButtonRight `M.member` _mouseButtons inp
|
||||
, AtEase <- cr ^. crStance . posture =
|
||||
setAimPosture cr
|
||||
@@ -137,7 +134,7 @@ setAimPosture cr =
|
||||
|
||||
doAimTwist :: Maybe AimStance -> Float -> Creature -> Creature
|
||||
doAimTwist as x
|
||||
| as == Just TwoHandOver || as == Just TwoHandUnder = crDir +~ x
|
||||
| as == Just TwoHandTwist = crDir +~ x
|
||||
| otherwise = id
|
||||
|
||||
removeAimPosture :: Creature -> Creature
|
||||
|
||||
@@ -8,8 +8,7 @@ import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
|
||||
data AimStance
|
||||
= TwoHandUnder
|
||||
| TwoHandOver
|
||||
= TwoHandTwist
|
||||
| TwoHandFlat
|
||||
| OneHand
|
||||
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||
|
||||
+23
-23
@@ -34,33 +34,33 @@ heldAimStance = \case
|
||||
PISTOL -> OneHand
|
||||
MACHINEPISTOL -> OneHand
|
||||
AUTOPISTOL -> OneHand
|
||||
SMG -> TwoHandUnder
|
||||
SMG -> TwoHandTwist
|
||||
BANGCONE -> OneHand
|
||||
BLUNDERBUSS -> TwoHandUnder
|
||||
GRAPECANNON{} -> TwoHandUnder
|
||||
MINIGUNX{} -> TwoHandUnder
|
||||
BLUNDERBUSS -> TwoHandTwist
|
||||
GRAPECANNON{} -> TwoHandTwist
|
||||
MINIGUNX{} -> TwoHandTwist
|
||||
VOLLEYGUN{} -> TwoHandFlat
|
||||
RIFLE -> TwoHandUnder
|
||||
ALTERIFLE -> TwoHandUnder
|
||||
AUTORIFLE -> TwoHandUnder
|
||||
BURSTRIFLE -> TwoHandUnder
|
||||
BANGROD -> TwoHandUnder
|
||||
ELEPHANTGUN -> TwoHandUnder
|
||||
AMR -> TwoHandUnder
|
||||
AUTOAMR -> TwoHandUnder
|
||||
SNIPERRIFLE -> TwoHandUnder
|
||||
RIFLE -> TwoHandTwist
|
||||
ALTERIFLE -> TwoHandTwist
|
||||
AUTORIFLE -> TwoHandTwist
|
||||
BURSTRIFLE -> TwoHandTwist
|
||||
BANGROD -> TwoHandTwist
|
||||
ELEPHANTGUN -> TwoHandTwist
|
||||
AMR -> TwoHandTwist
|
||||
AUTOAMR -> TwoHandTwist
|
||||
SNIPERRIFLE -> TwoHandTwist
|
||||
FLAMESPITTER -> OneHand
|
||||
FLAMETHROWER -> TwoHandUnder
|
||||
FLAMETORRENT -> TwoHandUnder
|
||||
FLAMEWALL -> TwoHandUnder
|
||||
BLOWTORCH -> TwoHandUnder
|
||||
FLAMETHROWER -> TwoHandTwist
|
||||
FLAMETORRENT -> TwoHandTwist
|
||||
FLAMEWALL -> TwoHandTwist
|
||||
BLOWTORCH -> TwoHandTwist
|
||||
TESLACOIL -> TwoHandFlat
|
||||
TRACTORGUN -> TwoHandUnder
|
||||
RLAUNCHER -> TwoHandOver
|
||||
RLAUNCHERX{} -> TwoHandOver
|
||||
GLAUNCHER -> TwoHandUnder
|
||||
POISONSPRAYER -> TwoHandUnder
|
||||
SHATTERGUN -> TwoHandUnder
|
||||
TRACTORGUN -> TwoHandTwist
|
||||
RLAUNCHER -> TwoHandTwist
|
||||
RLAUNCHERX{} -> TwoHandTwist
|
||||
GLAUNCHER -> TwoHandTwist
|
||||
POISONSPRAYER -> TwoHandTwist
|
||||
SHATTERGUN -> TwoHandTwist
|
||||
LED -> OneHand
|
||||
FLATSHIELD -> TwoHandFlat
|
||||
KEYCARD {} -> OneHand
|
||||
|
||||
@@ -102,7 +102,7 @@ extraWeaponLinks itm = case itm ^. itType of
|
||||
|
||||
extraWeaponLinksBelow :: Item -> [ItemSF]
|
||||
extraWeaponLinksBelow itm
|
||||
| TwoHandUnder <- itemBaseStance itm = [UnderBarrelSlotSF]
|
||||
| TwoHandTwist <- itemBaseStance itm = [UnderBarrelSlotSF]
|
||||
| otherwise = []
|
||||
|
||||
getAmmoLinks :: Item -> [ItemSF]
|
||||
|
||||
@@ -51,14 +51,11 @@ handleOrient loc = case loc ^. locDT . dtValue . _1 . itType of
|
||||
|
||||
handOrient :: Creature -> AimStance -> Point3Q
|
||||
handOrient cr = \case
|
||||
TwoHandUnder ->
|
||||
TwoHandTwist ->
|
||||
let (rp,_) = rightHandPQ cr
|
||||
(lp,_) = leftHandPQ cr
|
||||
in (rp,Q.qz (argV $ (lp - rp) ^. _xy))
|
||||
TwoHandOver ->
|
||||
let (rp,_) = rightHandPQ cr
|
||||
(lp,_) = leftHandPQ cr
|
||||
in (rp,Q.qz (argV $ (lp - rp) ^. _xy))
|
||||
-- in (rp,Q.qz (argV $ (lp - rp) ^. _xy))
|
||||
in (rp,Q.qNoRoll (lp - rp))
|
||||
OneHand -> rightHandPQ cr
|
||||
TwoHandFlat ->
|
||||
let (rp,_) = rightHandPQ cr
|
||||
|
||||
@@ -242,8 +242,7 @@ heldPositionInfo = aimStanceInfo . itemBaseStance
|
||||
|
||||
aimStanceInfo :: AimStance -> String
|
||||
aimStanceInfo as = case as of
|
||||
TwoHandUnder -> "It is held using two hands, tucked under the shoulder."
|
||||
TwoHandOver -> "It is held using two hands, resting over the shoulder."
|
||||
TwoHandTwist -> "It is held using two hands alongside the body."
|
||||
TwoHandFlat -> "It is held using two hands in front of the body."
|
||||
OneHand -> "It is held in one hand."
|
||||
|
||||
|
||||
Reference in New Issue
Block a user