Add gimbal and gyroscope, allowing more fine tuned projectile control
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user