Start allowing for more granular control of remote projectiles, cleanup
This commit is contained in:
@@ -593,7 +593,7 @@ determineProjectileTracking ::
|
||||
LabelDoubleTree ComposeLinkType Item ->
|
||||
LabelDoubleTree ComposeLinkType Item ->
|
||||
ProjectileHoming
|
||||
determineProjectileTracking magtree itmtree = case lookup RemoteScreenLink (magtree ^. ldtLeft) of
|
||||
determineProjectileTracking magtree itmtree = case lookup RemoteControllerLink (magtree ^. ldtLeft) of
|
||||
Just screen -> HomeUsingRemoteScreen (screen ^. ldtValue . itID)
|
||||
Nothing -> fromMaybe NoHoming $ do
|
||||
_ <- lookup AmmoTargetingLink (magtree ^. ldtLeft) -- should not have to give a direction
|
||||
@@ -611,10 +611,14 @@ createProjectile magtree muz itmtree cr = fromMaybe failsound $ do
|
||||
magid <- magtree ^? ldtValue . itLocation . ilInvID
|
||||
ammoitem <- cr ^? crInv . ix magid
|
||||
let homing = determineProjectileTracking magtree itmtree
|
||||
rdetonate = fmap (^. ldtValue . itID) $
|
||||
lookup RemoteDetonatorLink (magtree ^. ldtLeft)
|
||||
rscreen = fmap (^. ldtValue . itID) $
|
||||
lookup RemoteScreenLink (magtree ^. ldtLeft)
|
||||
aparams <- ((magtree ^? ldtLeft) >>= lookup AmmoPayloadLink >>= (^? ldtValue . itType . ibtAttach . shellPayload))
|
||||
<|> ammoitem ^? itConsumables . magParams . ampPayload
|
||||
return $
|
||||
createShell homing aparams muz cr
|
||||
createShell homing rdetonate rscreen aparams muz cr
|
||||
. startthesound
|
||||
where
|
||||
-- the sound should be moved to the projectile firing
|
||||
|
||||
Reference in New Issue
Block a user