Fix bullet particle spawn
This commit is contained in:
@@ -71,17 +71,22 @@ targetRBCreature :: Targeting
|
||||
targetRBCreature = defaultTargeting
|
||||
& tgUpdate .~ targetRBCreatureUp
|
||||
& tgDraw .~ targetRBCreatureDraw
|
||||
|
||||
targetCursor :: Targeting
|
||||
targetCursor = defaultTargeting
|
||||
& tgUpdate .~ targetUpdateWith targetCursorUpdate
|
||||
& tgDraw .~ targetSimpleDraw
|
||||
targetSimpleDraw :: Int -> Item -> Creature -> Configuration -> World -> Picture
|
||||
targetSimpleDraw _ it _ cfig w = fromMaybe mempty $ do
|
||||
|
||||
targetDraw :: (Item -> Picture) -> Int -> Item -> Creature -> Configuration -> World -> Picture
|
||||
targetDraw f _ it _ cfig w = fromMaybe mempty $ do
|
||||
p <- it ^? itTargeting . tgPos . _Just
|
||||
return $ winScale cfig
|
||||
$ setLayer FixedCoordLayer
|
||||
$ color white
|
||||
$ uncurryV translate (worldPosToScreen w p) activeTargetCursorPic
|
||||
$ uncurryV translate (worldPosToScreen w p)
|
||||
$ f it
|
||||
targetSimpleDraw :: Int -> Item -> Creature -> Configuration -> World -> Picture
|
||||
targetSimpleDraw = targetDraw $ const activeTargetCursorPic
|
||||
targetRBCreatureUp :: Item -> Creature -> World -> Targeting -> (World, Targeting)
|
||||
targetRBCreatureUp it cr w t
|
||||
| not $ _itIsHeld it = (w, t
|
||||
@@ -112,15 +117,9 @@ targetRBCreatureUp it cr w t
|
||||
Just $ hasLOS cpos (_crPos cr) w
|
||||
|
||||
targetRBCreatureDraw :: Int -> Item -> Creature -> Configuration -> World -> Picture
|
||||
targetRBCreatureDraw _ it _ cfig w = fromMaybe mempty $ do
|
||||
p <- it ^? itTargeting . tgPos . _Just
|
||||
return $ winScale cfig
|
||||
$ setLayer FixedCoordLayer
|
||||
$ color white
|
||||
$ uncurryV translate (worldPosToScreen w p)
|
||||
thepic
|
||||
targetRBCreatureDraw = targetDraw thepic
|
||||
where
|
||||
thepic | _tgActive $ _itTargeting it = activeTargetCursorPic
|
||||
thepic it | _tgActive $ _itTargeting it = activeTargetCursorPic
|
||||
| otherwise = targetCursorPic
|
||||
|
||||
activeTargetCursorPic :: Picture
|
||||
|
||||
Reference in New Issue
Block a user