diff --git a/src/Dodge/Creature/Picture.hs b/src/Dodge/Creature/Picture.hs index b03d3401c..3ac37b93e 100644 --- a/src/Dodge/Creature/Picture.hs +++ b/src/Dodge/Creature/Picture.hs @@ -22,12 +22,16 @@ basicCrPict -> Creature -> World -> Picture -basicCrPict col cr _ = uncurry translate (_crPos cr) $ rotate (_crDir cr) $ pictures - [ onLayer CrLayer . piercingMod $ bluntScale naked +basicCrPict col cr w = pictures $ + targetingPic ++ + [ tr . onLayer CrLayer . piercingMod $ bluntScale naked -- , drawAwakeLevel cr - , drawEquipment cr + , tr $ drawEquipment cr ] where + targetingPic = IM.elems $ IM.mapMaybeWithKey f $ _crInv cr + f invid it = fmap ((\g -> g invid it cr w) . snd) (it ^? itTargeting . _Just) + tr = uncurry translate (_crPos cr) . rotate (_crDir cr) cdir = _crDir cr naked | strikeMelee = color white $ circleSolid $ _crRad cr diff --git a/src/Dodge/Data.hs b/src/Dodge/Data.hs index a628ea264..2501c539b 100644 --- a/src/Dodge/Data.hs +++ b/src/Dodge/Data.hs @@ -219,7 +219,7 @@ data Item , _itEffect :: ItEffect , _itInvDisplay :: Item -> String , _itInvColor :: Color - , _itTargeting :: Maybe (World -> Maybe Point2, Item -> Int -> Creature -> World -> Picture) + , _itTargeting :: Maybe (World -> Maybe Point2, Int -> Item -> Creature -> World -> Picture) , _itWorldTrigger :: Maybe (Int -> World -> Bool) } | Consumable diff --git a/src/Dodge/Item/Weapon/ExtraEffect.hs b/src/Dodge/Item/Weapon/ExtraEffect.hs index c08dbb223..44c9bb7a1 100644 --- a/src/Dodge/Item/Weapon/ExtraEffect.hs +++ b/src/Dodge/Item/Weapon/ExtraEffect.hs @@ -11,6 +11,7 @@ import Dodge.Item.Weapon.UseEffect --import Dodge.Item.Attachment.Data import Dodge.WorldEvent.Flash import Dodge.WorldEvent.ThingsHit +import Dodge.Picture.Layer import Picture import Geometry.Vector @@ -115,9 +116,16 @@ rbSetTarget = ItInvEffect targetCurrentMousePos :: World - -> (World -> Maybe Point2, Item -> Int -> Creature -> World -> Picture) -targetCurrentMousePos w = (f, \_ _ _ _ -> cursorPic) + -> (World -> Maybe Point2, Int -> Item -> Creature -> World -> Picture) +targetCurrentMousePos w = (f, \_ _ _ w' -> cursorPic w') where f _ = Just mwp mwp = mouseWorldPos w - cursorPic = line [mwp +.+ (5,5), mwp -.- (5,5)] + cursorPic w' = setLayer 1 $ onLayer InvLayer $ uncurry translate mwp + $ rotate (_cameraRot w') + $ pictures + [line [( x,x), (-x,-x)] + ,line [(-x,x), ( x,-x)] + ] + where + x = 5 / _cameraZoom w'