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