Move handle positions

This commit is contained in:
2023-05-28 15:02:23 +01:00
parent 7fc36ab028
commit 29017e6b06
15 changed files with 40 additions and 35 deletions
+3 -2
View File
@@ -11,8 +11,9 @@ import ShapePicture
-- the position of a weapon handle -- the position of a weapon handle
aimingWeaponHandlePos :: Creature -> Item -> Point2 aimingWeaponHandlePos :: Creature -> Item -> Point2
aimingWeaponHandlePos _ it = case it ^? itUse . heldAim . aimStance of aimingWeaponHandlePos _ it = case it ^? itUse . heldAim . aimStance of
Just TwoHandTwist -> 0 Just TwoHandUnder -> 0
Just OneHand -> V2 10 0 Just TwoHandOver -> V2 (-7) 0
Just OneHand -> V2 10 (-2)
Just TwoHandFlat -> V2 10 0 Just TwoHandFlat -> V2 10 0
Nothing -> 0 Nothing -> 0
+3 -2
View File
@@ -103,7 +103,7 @@ twoFlat :: Creature -> Bool
twoFlat = crInAimStance TwoHandFlat twoFlat = crInAimStance TwoHandFlat
twists :: Creature -> Bool twists :: Creature -> Bool
twists = crInAimStance TwoHandTwist twists cr = crInAimStance TwoHandUnder cr || crInAimStance TwoHandOver cr
-- the use of crOldPos is because the damage position is calculated on the -- the use of crOldPos is because the damage position is calculated on the
-- previous frame -- previous frame
@@ -124,7 +124,8 @@ hasFrontArmour p cr = fromMaybe False $ do
frontarmdirection frontarmdirection
| crInAimStance OneHand cr = 0.5 | crInAimStance OneHand cr = 0.5
| crInAimStance TwoHandTwist cr = negate 1 | crInAimStance TwoHandUnder cr = negate 1
| crInAimStance TwoHandOver cr = negate 1
| otherwise = 0 | otherwise = 0
--crOnSeg :: Point2 -> Point2 -> Creature -> Bool --crOnSeg :: Point2 -> Point2 -> Creature -> Bool
+5 -1
View File
@@ -117,7 +117,11 @@ wasdWithAiming w speed cr
astance <- cr ^? crInv . ix itRef . itUse . heldAim . aimStance astance <- cr ^? crInv . ix itRef . itUse . heldAim . aimStance
let currenttwistamount = cr ^. crTwist let currenttwistamount = cr ^. crTwist
case (astance, currenttwistamount) of case (astance, currenttwistamount) of
(TwoHandTwist, 0) -> (TwoHandUnder, 0) ->
return $
(crTwist .~ twistamount * pi)
. (crDir -~ twistamount * pi)
(TwoHandOver, 0) ->
return $ return $
(crTwist .~ twistamount * pi) (crTwist .~ twistamount * pi)
. (crDir -~ twistamount * pi) . (crDir -~ twistamount * pi)
+2 -1
View File
@@ -85,7 +85,8 @@ data Muzzle = Muzzle
data AimStance data AimStance
= TwoHandTwist = TwoHandUnder
| TwoHandOver
| TwoHandFlat | TwoHandFlat
| OneHand | OneHand
-- | LeaveHolstered -- | LeaveHolstered
+1 -1
View File
@@ -12,7 +12,7 @@ defaultAimParams =
, _aimZoom = ItZoom 20 0.2 1 , _aimZoom = ItZoom 20 0.2 1
, _aimStance = OneHand , _aimStance = OneHand
--, _aimHandlePos = 10 --, _aimHandlePos = 10
, _aimHandlePos = 3 , _aimHandlePos = V2 3 0
, _aimMuzzles = [Muzzle (V2 20 0) 0 0] , _aimMuzzles = [Muzzle (V2 20 0) 0 0]
-- , _aimMuzPos = 20 -- , _aimMuzPos = 20
} }
+2 -6
View File
@@ -31,7 +31,6 @@ teslaGun =
& itUse . heldMods .~ TeslaMod & itUse . heldMods .~ TeslaMod
& itUse . heldAim . aimWeight .~ 6 & itUse . heldAim . aimWeight .~ 6
& itUse . heldAim . aimStance .~ TwoHandFlat & itUse . heldAim . aimStance .~ TwoHandFlat
& itUse . heldAim . aimHandlePos .~ 4
-- & itUse . heldAim . aimMuzPos .~ 4 -- & itUse . heldAim . aimMuzPos .~ 4
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 4 0) 0 0] & itUse . heldAim . aimMuzzles .~ [Muzzle (V2 4 0) 0 0]
& itType . iyBase .~ HELD TESLAGUN & itType . iyBase .~ HELD TESLAGUN
@@ -63,8 +62,8 @@ lasGun =
& itUse . heldMods .~ LasMod & itUse . heldMods .~ LasMod
& itUse . heldAim . aimWeight .~ 6 & itUse . heldAim . aimWeight .~ 6
& itUse . heldAim . aimRange .~ 1 & itUse . heldAim . aimRange .~ 1
& itUse . heldAim . aimStance .~ TwoHandTwist & itUse . heldAim . aimStance .~ TwoHandUnder
& itUse . heldAim . aimHandlePos .~ 5 -- & itUse . heldAim . aimHandlePos .~ 5
-- & itUse . heldAim . aimMuzPos .~ 30 -- & itUse . heldAim . aimMuzPos .~ 30
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 30 0) 0 0] & itUse . heldAim . aimMuzzles .~ [Muzzle (V2 30 0) 0 0]
& itType . iyBase .~ HELD LASGUN & itType . iyBase .~ HELD LASGUN
@@ -95,8 +94,6 @@ tractorGun =
& itUse . heldMods .~ AmmoCheckMod & itUse . heldMods .~ AmmoCheckMod
& itUse . heldAim . aimWeight .~ 6 & itUse . heldAim . aimWeight .~ 6
& itUse . heldAim . aimRange .~ 1 & itUse . heldAim . aimRange .~ 1
& itUse . heldAim . aimStance .~ TwoHandTwist
& itUse . heldAim . aimHandlePos .~ 5
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 30 0) 0 0] & itUse . heldAim . aimMuzzles .~ [Muzzle (V2 30 0) 0 0]
& itType . iyBase .~ HELD TRACTORGUN & itType . iyBase .~ HELD TRACTORGUN
@@ -147,7 +144,6 @@ lasCircle =
& itUse . heldMods .~ CircleLaserMod & itUse . heldMods .~ CircleLaserMod
& itUse . heldAim . aimWeight .~ 6 & itUse . heldAim . aimWeight .~ 6
& itUse . heldAim . aimRange .~ 1 & itUse . heldAim . aimRange .~ 1
& itUse . heldAim . aimStance .~ TwoHandTwist
dualBeam :: Item dualBeam :: Item
dualBeam = dualBeam =
+5 -5
View File
@@ -31,7 +31,7 @@ defaultBangCane =
& itUse . heldDelay . rateMax .~ 6 & itUse . heldDelay . rateMax .~ 6
& itUse . heldMods .~ BangCaneMod & itUse . heldMods .~ BangCaneMod
& itUse . heldAim . aimStance .~ OneHand & itUse . heldAim . aimStance .~ OneHand
& itUse . heldAim . aimHandlePos .~ 5 -- & itUse . heldAim . aimHandlePos .~ 5
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 15 0) 0 0.01] & itUse . heldAim . aimMuzzles .~ [Muzzle (V2 15 0) 0 0.01]
& itUse . heldConsumption . laSource . _InternalSource . iaMax .~ 1 & itUse . heldConsumption . laSource . _InternalSource . iaMax .~ 1
& itUse . heldConsumption . laSource . _InternalSource . iaCycle .~ [loadPartialInsert 10 1] & itUse . heldConsumption . laSource . _InternalSource . iaCycle .~ [loadPartialInsert 10 1]
@@ -45,7 +45,7 @@ volleyGun i =
& itUse . heldAim . aimRange .~ 1 & itUse . heldAim . aimRange .~ 1
& itUse . heldAim . aimStance .~ TwoHandFlat & itUse . heldAim . aimStance .~ TwoHandFlat
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5} & itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
& itUse . heldAim . aimHandlePos .~ 5 -- & itUse . heldAim . aimHandlePos .~ 5
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 15 x) 0 0.01 | x <- spreadAroundCenter i 3] & itUse . heldAim . aimMuzzles .~ [Muzzle (V2 15 x) 0 0.01 | x <- spreadAroundCenter i 3]
& itUse . heldConsumption . laSource . _InternalSource . iaMax .~ i & itUse . heldConsumption . laSource . _InternalSource . iaMax .~ i
& itParams & itParams
@@ -63,7 +63,7 @@ volleyGun i =
rifle :: Item rifle :: Item
rifle = rifle =
defaultBangCane defaultBangCane
& itUse . heldAim . aimStance .~ TwoHandTwist & itUse . heldAim . aimStance .~ TwoHandUnder
& itType . iyBase .~ HELD RIFLE & itType . iyBase .~ HELD RIFLE
& itUse . heldConsumption . laSource . _InternalSource . iaMax .~ 1 & itUse . heldConsumption . laSource . _InternalSource . iaMax .~ 1
& itUse . heldConsumption . laSource . _InternalSource . iaCycle .~ [loadEject 5, loadInsert 5, loadPrime 5] & itUse . heldConsumption . laSource . _InternalSource . iaCycle .~ [loadEject 5, loadInsert 5, loadPrime 5]
@@ -105,9 +105,9 @@ miniGunUse i =
& heldDelay .~ WarmUpNoDelay{_warmTime = 0, _warmMax = 100} & heldDelay .~ WarmUpNoDelay{_warmTime = 0, _warmMax = 100}
& heldAim . aimWeight .~ 6 & heldAim . aimWeight .~ 6
& heldAim . aimRange .~ 1 & heldAim . aimRange .~ 1
& heldAim . aimStance .~ TwoHandTwist & heldAim . aimStance .~ TwoHandUnder
& heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5} & heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
& heldAim . aimHandlePos .~ 5 -- & heldAim . aimHandlePos .~ 5
& heldConsumption & heldConsumption
.~ (defaultBulletLoadable & laSource .~ AboveSource) .~ (defaultBulletLoadable & laSource .~ AboveSource)
--(defaultBulletLoadable --(defaultBulletLoadable
+3 -3
View File
@@ -24,7 +24,7 @@ bangCone =
& itDimension . dimCenter .~ V3 5 0 0 & itDimension . dimCenter .~ V3 5 0 0
& itUse . heldDelay . rateMax .~ 20 & itUse . heldDelay . rateMax .~ 20
& itUse . heldMods .~ BangConeMod & itUse . heldMods .~ BangConeMod
& itUse . heldAim . aimHandlePos .~ 5 -- & itUse . heldAim . aimHandlePos .~ 5
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 15 0) 0 0.5] & itUse . heldAim . aimMuzzles .~ [Muzzle (V2 15 0) 0 0.5]
& itType . iyBase .~ HELD BANGCONE & itType . iyBase .~ HELD BANGCONE
& itUse . heldConsumption . laSource . _InternalSource . iaMax .~ 5 & itUse . heldConsumption . laSource . _InternalSource . iaMax .~ 5
@@ -35,9 +35,9 @@ blunderbuss =
bangCone bangCone
& itUse . heldConsumption . laSource . _InternalSource . iaMax .~ 25 & itUse . heldConsumption . laSource . _InternalSource . iaMax .~ 25
& itUse . heldConsumption . laSource . _InternalSource . iaCycle .~ [loadEject 5, loadInsert 30, loadPrime 5] & itUse . heldConsumption . laSource . _InternalSource . iaCycle .~ [loadEject 5, loadInsert 30, loadPrime 5]
& itUse . heldAim . aimStance .~ TwoHandTwist & itUse . heldAim . aimStance .~ TwoHandUnder
& itUse . heldAim . aimWeight .~ 6 & itUse . heldAim . aimWeight .~ 6
& itUse . heldAim . aimHandlePos .~ 5 -- & itUse . heldAim . aimHandlePos .~ 5
& itUse . heldAim . aimMuzzles . ix 0 . mzPos . _x .~ 30 & itUse . heldAim . aimMuzzles . ix 0 . mzPos . _x .~ 30
& itType . iyBase .~ HELD BLUNDERBUSS & itType . iyBase .~ HELD BLUNDERBUSS
+2 -2
View File
@@ -28,8 +28,8 @@ launcher =
& itUse . heldMods .~ LauncherMod & itUse . heldMods .~ LauncherMod
& itUse . heldAim . aimWeight .~ 8 & itUse . heldAim . aimWeight .~ 8
& itUse . heldAim . aimRange .~ 0.5 & itUse . heldAim . aimRange .~ 0.5
& itUse . heldAim . aimStance .~ TwoHandTwist & itUse . heldAim . aimStance .~ TwoHandOver
& itUse . heldAim . aimHandlePos .~ 5 -- & itUse . heldAim . aimHandlePos .~ V2 3 0
-- & itUse . heldAim . aimMuzPos .~ 20 -- & itUse . heldAim . aimMuzPos .~ 20
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 20 0) 0 0] & itUse . heldAim . aimMuzzles .~ [Muzzle (V2 20 0) 0 0]
& itUse . heldConsumption . laAmmoType & itUse . heldConsumption . laAmmoType
+3 -3
View File
@@ -37,7 +37,7 @@ bangRod =
& itUse . heldAim . aimRange .~ 1 & itUse . heldAim . aimRange .~ 1
& itUse . heldAim . aimStance .~ OneHand & itUse . heldAim . aimStance .~ OneHand
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5} & itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
& itUse . heldAim . aimHandlePos .~ 5 -- & itUse . heldAim . aimHandlePos .~ 5
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 30 0) 0 0.1] & itUse . heldAim . aimMuzzles .~ [Muzzle (V2 30 0) 0 0.1]
& itUse . heldConsumption . laAmmoType .~ hvBulletAmmo & itUse . heldConsumption . laAmmoType .~ hvBulletAmmo
@@ -45,7 +45,7 @@ elephantGun :: Item
elephantGun = elephantGun =
bangRod bangRod
& itType . iyBase .~ HELD ELEPHANTGUN & itType . iyBase .~ HELD ELEPHANTGUN
& itUse . heldAim . aimStance .~ TwoHandTwist & itUse . heldAim . aimStance .~ TwoHandUnder
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0.05 & itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0.05
& itUse . heldMods .~ ElephantGunMod & itUse . heldMods .~ ElephantGunMod
& itParams . recoil .~ 50 & itParams . recoil .~ 50
@@ -82,7 +82,7 @@ machineGun =
& itUse . heldMods .~ MachineGunMod & itUse . heldMods .~ MachineGunMod
& itUse . heldAim . aimWeight .~ 8 & itUse . heldAim . aimWeight .~ 8
& itUse . heldAim . aimRange .~ 1 & itUse . heldAim . aimRange .~ 1
& itUse . heldAim . aimStance .~ TwoHandTwist & itUse . heldAim . aimStance .~ TwoHandUnder
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5} & itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
& itUse . heldDelay .~ VariableRate{_rateMax = 25, _rateMaxMax = 24, _rateMinMax = 7, _rateTime = 0} & itUse . heldDelay .~ VariableRate{_rateMax = 25, _rateMaxMax = 24, _rateMinMax = 7, _rateTime = 0}
& itUse . heldConsumption . laSource . _InternalSource . iaMax .~ 100 & itUse . heldConsumption . laSource . _InternalSource . iaMax .~ 100
+2 -2
View File
@@ -91,8 +91,8 @@ flameThrower =
& itUse . heldMods .~ FlameThrowerMod & itUse . heldMods .~ FlameThrowerMod
& itUse . heldAim . aimWeight .~ 5 & itUse . heldAim . aimWeight .~ 5
& itUse . heldAim . aimZoom .~ defaultItZoom{_izMax = 5, _izMin = 1.5} & itUse . heldAim . aimZoom .~ defaultItZoom{_izMax = 5, _izMin = 1.5}
& itUse . heldAim . aimStance .~ TwoHandTwist & itUse . heldAim . aimStance .~ TwoHandUnder
& itUse . heldAim . aimHandlePos .~ 0 -- & itUse . heldAim . aimHandlePos .~ 0
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 18 0) 0 0] & itUse . heldAim . aimMuzzles .~ [Muzzle (V2 18 0) 0 0]
& itUse . heldConsumption & itUse . heldConsumption
.~ ( defaultLoadable .~ ( defaultLoadable
+3 -2
View File
@@ -91,8 +91,9 @@ smg =
autoPistol -- & some parameter affecting stability autoPistol -- & some parameter affecting stability
& itUse . heldMods .~ SmgMod --(ammoCheckI : smgAfterHamMods) & itUse . heldMods .~ SmgMod --(ammoCheckI : smgAfterHamMods)
& itType . iyBase .~ HELD SMG & itType . iyBase .~ HELD SMG
& itUse . heldAim . aimStance .~ TwoHandTwist & itUse . heldAim . aimStance .~ TwoHandUnder
& itUse . heldAim . aimHandlePos .~ 2 & itUse . heldAim . aimMuzzles .~ [Muzzle (V2 20 0) 0 0]
-- & itUse . heldAim . aimHandlePos .~ 2
& itParams . torqueAfter .~ 0.05 & itParams . torqueAfter .~ 0.05
revolverX :: Int -> Item revolverX :: Int -> Item
+3 -3
View File
@@ -14,7 +14,7 @@ flatShield =
& itUse . heldAim . aimWeight .~ 5 & itUse . heldAim . aimWeight .~ 5
& itUse . heldAim . aimTurnSpeed .~ 0.5 & itUse . heldAim . aimTurnSpeed .~ 0.5
& itUse . heldAim . aimStance .~ TwoHandFlat & itUse . heldAim . aimStance .~ TwoHandFlat
& itUse . heldAim . aimHandlePos .~ 0 -- & itUse . heldAim . aimHandlePos .~ 0
& itInvSize .~ 3 & itInvSize .~ 3
& itType . iyBase .~ HELD FLATSHIELD & itType . iyBase .~ HELD FLATSHIELD
@@ -34,7 +34,7 @@ binoculars =
defaultHeldItem defaultHeldItem
& itScope .~ ZoomScope (V2 0 0) 1 0.5 False & itScope .~ ZoomScope (V2 0 0) 1 0.5 False
& itType . iyBase .~ HELD BINOCULARS & itType . iyBase .~ HELD BINOCULARS
& itUse . heldAim . aimHandlePos .~ 5 -- & itUse . heldAim . aimHandlePos .~ 5
-- & itUse . heldAim . aimMuzPos .~ 10 -- & itUse . heldAim . aimMuzPos .~ 10
& itUse . heldAim . aimStance .~ TwoHandFlat & itUse . heldAim . aimStance .~ TwoHandFlat
& itUse . heldScroll .~ HeldScrollZoom -- zoomLongGun & itUse . heldScroll .~ HeldScrollZoom -- zoomLongGun
@@ -46,7 +46,7 @@ torch =
defaultHeldItem defaultHeldItem
& itEffect . ieInv .~ EffectWhileHeld CreateHeldLight & itEffect . ieInv .~ EffectWhileHeld CreateHeldLight
& itType . iyBase .~ HELD TORCH & itType . iyBase .~ HELD TORCH
& itUse . heldAim . aimHandlePos .~ 5 -- & itUse . heldAim . aimHandlePos .~ 5
& itUse . heldAim . aimMuzzles . ix 0 . mzPos . _x .~ 10 & itUse . heldAim . aimMuzzles . ix 0 . mzPos . _x .~ 10
forceFieldGun :: Item forceFieldGun :: Item
+2 -1
View File
@@ -231,7 +231,8 @@ heldPositionInfo = maybe undefined aimStanceInfo . (^? itUse . heldAim . aimStan
aimStanceInfo :: AimStance -> String aimStanceInfo :: AimStance -> String
aimStanceInfo as = case as of aimStanceInfo as = case as of
TwoHandTwist -> "It is held in two hands along its length." TwoHandUnder -> "It is held in two hands and tucked under the shoulder."
TwoHandOver -> "It is held in two hands and over the shoulder."
TwoHandFlat -> "It is held in two hands at its sides." TwoHandFlat -> "It is held in two hands at its sides."
OneHand -> "It is held in one hand." OneHand -> "It is held in one hand."
+1 -1
View File
@@ -15,7 +15,7 @@ droneLauncher =
& itUse . heldMods .~ AmmoUseCheckMod & itUse . heldMods .~ AmmoUseCheckMod
& itUse . heldAim . aimWeight .~ 8 & itUse . heldAim . aimWeight .~ 8
& itUse . heldAim . aimRange .~ 0.5 & itUse . heldAim . aimRange .~ 0.5
& itUse . heldAim . aimStance .~ TwoHandTwist & itUse . heldAim . aimStance .~ TwoHandOver
& itUse . heldConsumption . laAmmoType .~ DroneAmmo{_amString = "LASDRONE"} & itUse . heldConsumption . laAmmoType .~ DroneAmmo{_amString = "LASDRONE"}
& itUse . heldConsumption . laSource . _InternalSource . iaMax .~ 2 & itUse . heldConsumption . laSource . _InternalSource . iaMax .~ 2
& itType . iyBase .~ HELD DRONELAUNCHER & itType . iyBase .~ HELD DRONELAUNCHER