Unify launcher projectiles

This commit is contained in:
2024-09-27 13:55:34 +01:00
parent 5f9fb183a9
commit 21e49ddefc
9 changed files with 159 additions and 202 deletions
+8 -8
View File
@@ -24,7 +24,7 @@ import Dodge.Creature.HandPos
import Dodge.Data.World
import Dodge.Gas
import Dodge.Item.Weapon.BatteryGuns
import Dodge.Item.Weapon.Launcher
--import Dodge.Item.Weapon.Launcher
import Dodge.Item.Weapon.Radar
import Dodge.Item.Weapon.Shatter
import Dodge.Item.Weapon.TriggerType
@@ -323,7 +323,7 @@ useHeld hu = case hu of
-- HeldSonicWave -> aSonicWave
HeldForceField -> useForceFieldGun . _ldtValue
-- HeldShatter -> shootShatter . _ldtValue
HeldExplodeRemoteShell itid pjid -> const $ const $ explodeRemoteRocket itid pjid
-- HeldExplodeRemoteShell itid pjid -> const $ const $ explodeRemoteRocket itid pjid
--usePjCreation :: LabelDoubleTree ComposeLinkType Item -> Creature -> World -> World
--usePjCreation itm cr = fromMaybe id $ do
@@ -507,13 +507,13 @@ createProjectile magtree muz itm cr = fromMaybe failsound $ do
-- matype <- ammoitem ^? itUse . amagType
-- guard $ matype == ProjectileAmmo
j <- ammoitem ^? itLocation . ilInvID
return $ fireTrackingShell (mscreen ^? _Just . ldtValue) ammoitem muz itm cr . extrafuncs j
-- pt <- ammoitem ^? itUse . amagParams . ampPjCreation
return $ case mscreen of
Nothing -> fireShell ammoitem muz itm cr . extrafuncs j
Just stree -> fireTrackingShell
(stree ^. ldtValue . itID)
(stree ^?! ldtValue . itLocation . ilInvID) ammoitem muz itm cr
. extrafuncs j
-- return $ case mscreen of
-- Nothing -> fireShell ammoitem muz itm cr . extrafuncs j
-- Just stree -> fireTrackingShell
-- (stree ^? ldtValue) ammoitem muz itm cr
-- . extrafuncs j
where
--extrafuncs j = cancelanyreloading . startthesound . useammo j
extrafuncs j = startthesound . useammo j