Add gimbal and gyroscope, allowing more fine tuned projectile control

This commit is contained in:
2024-12-30 11:41:20 +00:00
parent 4c9632b3f3
commit 87f068f01a
11 changed files with 308 additions and 239 deletions
+2
View File
@@ -78,6 +78,8 @@ showAttachItem t = case t of
HOMINGMODULE -> "HOMING MOD"
AUGMENTEDHUD -> "AUGMENTED HUD"
SHELLPAYLOAD x -> show x
GIMBAL -> "GIMBAL"
GYROSCOPE -> "GYROSCOPE"
showEquipItem :: EquipItemType -> String
showEquipItem eit = case eit of
+20 -5
View File
@@ -44,15 +44,17 @@ useBreakListsLinkTest llist rlist = LTest ltest rtest
dropWhile
((\s -> not $ S.member s (structureToPotentialFunction ldt)) . fst)
llist
(_, linktype) <- safeHead xs
return $ LUpdate linktype (set _3 (useBreakListsLinkTest (tail xs) rlist)) id
(sf, linktype) <- safeHead xs
return $ LUpdate linktype (set _3 (useBreakListsLinkTest (tail xs) rlist))
(_2 .~ sf)
rtest ldt = do
let xs =
dropWhile
((\s -> not $ S.member s (structureToPotentialFunction ldt)) . fst)
rlist
(_, linktype) <- safeHead xs
return $ LUpdate linktype (set _3 (useBreakListsLinkTest llist (tail xs))) id
(sf, linktype) <- safeHead xs
return $ LUpdate linktype (set _3 (useBreakListsLinkTest llist (tail xs)))
(_2 .~ sf)
itemToBreakLists ::
Item ->
@@ -64,6 +66,7 @@ itemToBreakLists itm itmf = case (itm ^. itType, itmf) of
( getAmmoLinks itm
, [(WeaponTargetingSF, WeaponTargetingLink), (WeaponScopeSF, WeaponScopeLink)]
<> getAutoSpringLinks itm
<> extraWeaponLinks itm
)
(_, GadgetPlatformSF) ->
( getAmmoLinks itm
@@ -101,6 +104,15 @@ getAutoSpringLinks itm = case itm ^? itUse . heldTriggerType of
Just HammerTrigger -> [(MakeAutoSF, MakeAutoLink)]
_ -> []
extraWeaponLinks :: Item -> [(ItemStructuralFunction, ComposeLinkType)]
extraWeaponLinks itm = case itm ^. itType of
HELD GLAUNCHER -> launcherlinks
HELD RLAUNCHER -> launcherlinks
HELD RLAUNCHERX{} -> launcherlinks
_ -> []
where
launcherlinks = [(ProjectileStabiliserSF,ProjectileStabiliserLink)]
getAmmoLinks :: Item -> [(ItemStructuralFunction, ComposeLinkType)]
getAmmoLinks itm =
map
@@ -139,7 +151,10 @@ itemToFunction itm = case itm ^. itType of
structureToPotentialFunction ::
LabelDoubleTree ItemLink ComposedItem ->
S.Set ItemStructuralFunction
structureToPotentialFunction = S.singleton . (^. ldtValue . _2)
structureToPotentialFunction ldt = case ldt ^. ldtValue . _1 . itType of
ATTACH GIMBAL -> S.singleton ProjectileStabiliserSF
ATTACH GYROSCOPE -> S.singleton ProjectileStabiliserSF
_ -> S.singleton (ldt ^. ldtValue . _2)
baseCI :: Item -> ComposedItem
baseCI itm = (itm, itemToFunction itm, itemBaseConnections itm)
+1
View File
@@ -28,6 +28,7 @@ itemInvColor ci = case ci ^. _2 of
AmmoPayloadSF{} -> violet
AmmoEffectSF{} -> aquamarine
FunctionChangeSF -> yellow
ProjectileStabiliserSF -> white
--ammoTypeColor :: AmmoType -> Color
--ammoTypeColor = \case
+8
View File
@@ -1,4 +1,6 @@
module Dodge.Item.Scope (
gimbal,
gyroscope,
stickyMod,
shellModule,
zoomScope,
@@ -75,6 +77,12 @@ remoteDetonator = makeAttach REMOTEDETONATOR
joystick :: Item
joystick = makeAttach JOYSTICK
-- & itUse . uaParams .~ APLinkProjectile Nothing
--
gimbal :: Item
gimbal = makeAttach GIMBAL
gyroscope :: Item
gyroscope = makeAttach GYROSCOPE
smokeReducer :: Item
smokeReducer = makeAttach SMOKEREDUCER