26 lines
791 B
Haskell
26 lines
791 B
Haskell
module Dodge.Item.Weapon.Launcher (
|
|
explodeRemoteRocket,
|
|
) where
|
|
|
|
import Control.Lens
|
|
import Dodge.Data.World
|
|
import Dodge.Item.Location
|
|
import Dodge.Payload
|
|
|
|
explodeRemoteRocket ::
|
|
-- | Item id
|
|
Int ->
|
|
-- | Projectile id
|
|
Int ->
|
|
World ->
|
|
World
|
|
explodeRemoteRocket itid pjid w =
|
|
w
|
|
& cWorld . lWorld . projectiles . ix pjid . prjUpdates .~ [PJRetireRemote itid 30 pjid]
|
|
& cWorld . lWorld . projectiles . ix pjid . prjDraw .~ DrawBlankProjectile
|
|
& itPoint . itUse . heldUse .~ HeldDoNothing
|
|
& usePayload (_prjPayload thepj) (_prjPos thepj)
|
|
where
|
|
itPoint = pointerToItemLocation $ w ^?! cWorld . lWorld . itemLocations . ix itid-- _itemLocations (_cWorld w) IM.! itid
|
|
thepj = w ^?! cWorld . lWorld . projectiles . ix pjid
|