Commit before using central mouse context type
This commit is contained in:
+12
-12
@@ -1,24 +1,24 @@
|
||||
module Dodge.SelectUse
|
||||
where
|
||||
module Dodge.SelectUse (selectUse) where
|
||||
|
||||
import Dodge.Payload
|
||||
import Control.Lens
|
||||
import Data.Maybe
|
||||
import Dodge.Data.ComposedItem
|
||||
import Dodge.Data.DoubleTree
|
||||
import Dodge.Data.World
|
||||
import Data.Maybe
|
||||
import Control.Lens
|
||||
import Dodge.Payload
|
||||
|
||||
selectUse :: LabelDoubleTree ComposeLinkType Item -> Creature -> World -> World
|
||||
selectUse ittree _ w = fromMaybe w $ do
|
||||
itid <- ittree ^? ldtValue . itID
|
||||
pjid <- ittree ^? ldtValue . itUse . uaParams . apLinkedProjectile . _Just
|
||||
thepj <- w ^? cWorld . lWorld . projectiles . ix pjid
|
||||
return $ w
|
||||
& cWorld . lWorld . projectiles . ix pjid . prjUpdates .~ [DestroyPU (Just itid) 30] -- 69 is placeholder, should be removed
|
||||
& cWorld . lWorld . projectiles . ix pjid . prjDraw .~ DrawBlankProjectile
|
||||
-- & itPoint . itUse . heldUse .~ HeldDoNothing
|
||||
-- & itPoint . itUse . heldMods .~ DoNothingMod
|
||||
& usePayload (_prjPayload thepj) (_prjPos thepj)
|
||||
return $
|
||||
w
|
||||
& cWorld . lWorld . projectiles . ix pjid . prjUpdates .~ [DestroyPU (Just itid) 30] -- 69 is placeholder, should be removed
|
||||
& cWorld . lWorld . projectiles . ix pjid . prjDraw .~ DrawBlankProjectile
|
||||
-- & itPoint . itUse . heldUse .~ HeldDoNothing
|
||||
-- & itPoint . itUse . heldMods .~ DoNothingMod
|
||||
& usePayload (_prjPayload thepj) (_prjPos thepj)
|
||||
|
||||
-- where
|
||||
-- itPoint = pointerToItemLocation $ w ^?! cWorld . lWorld . itemLocations . ix itid-- _itemLocations (_cWorld w) IM.! itid
|
||||
|
||||
|
||||
Reference in New Issue
Block a user