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
+5 -3
View File
@@ -2,6 +2,7 @@ module Dodge.Item.Weapon.Launcher (
explodeRemoteRocket,
) where
import Dodge.SoundLogic
import Control.Lens
import Dodge.Data.World
--import Dodge.Item.Location
@@ -9,18 +10,19 @@ import Dodge.Payload
explodeRemoteRocket ::
-- | Item id
Int ->
Maybe Int ->
-- | Projectile id
Int ->
World ->
World
explodeRemoteRocket itid pjid w =
explodeRemoteRocket mitid pjid w =
w
& cWorld . lWorld . projectiles . ix pjid . prjUpdates .~ [PJRetireRemote itid 30 pjid]
& cWorld . lWorld . projectiles . ix pjid . prjUpdates .~ [PJRetireRemote mitid 30 pjid]
& cWorld . lWorld . projectiles . ix pjid . prjDraw .~ DrawBlankProjectile
-- & itPoint . itUse . heldUse .~ HeldDoNothing
-- & itPoint . itUse . heldMods .~ DoNothingMod
& usePayload (_prjPayload thepj) (_prjPos thepj)
& stopSoundFrom (ShellSound pjid)
where
-- itPoint = pointerToItemLocation $ w ^?! cWorld . lWorld . itemLocations . ix itid-- _itemLocations (_cWorld w) IM.! itid
thepj = w ^?! cWorld . lWorld . projectiles . ix pjid