Continue to work on targeting inventory items
This commit is contained in:
@@ -275,6 +275,7 @@ crGetTargeting :: Creature -> Maybe TargetType
|
||||
crGetTargeting cr = do
|
||||
i <- cr ^? crManipulation . manObject . inInventory . ispItem
|
||||
itm <- cr ^? crInv . ix i
|
||||
--(cr ^? crInv . ix (i+1) . itUse . equipTargeting . _Just)
|
||||
itm ^? itType . iyModules . ix ModTarget . imtTargetType
|
||||
<|> (guard (canAttachTargetingBelow itm)
|
||||
>> cr ^? crInv . ix (i+1) . itUse . equipTargeting . _Just)
|
||||
|
||||
@@ -111,7 +111,7 @@ targetingHat tt =
|
||||
defaultEquipment
|
||||
& itUse . equipEffect . eeSite .~ GoesOnHead
|
||||
& itType . iyBase .~ EQUIP (TARGETINGHAT tt)
|
||||
-- & itUse . useTargeting ?~ tt
|
||||
& itUse . equipTargeting ?~ tt
|
||||
|
||||
headLamp :: Item
|
||||
headLamp =
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{-# OPTIONS_GHC -Wno-unused-imports #-}
|
||||
module Dodge.TestString where
|
||||
|
||||
import Dodge.Item.Display
|
||||
import AesonHelp
|
||||
import Dodge.SmoothScroll
|
||||
import HelpNum
|
||||
@@ -18,7 +19,13 @@ import Dodge.Data.Universe
|
||||
--import qualified Data.Map.Strict as M
|
||||
--import qualified IntMapHelp as IM
|
||||
testStringInit :: Universe -> [String]
|
||||
testStringInit _ = mempty
|
||||
testStringInit u = [fromMaybe "" $ do
|
||||
cr <- u ^? uvWorld . cWorld . lWorld . creatures . ix 0
|
||||
i <- cr ^? crManipulation . manObject . inInventory . ispItem
|
||||
fmap (show . canAttachTargetingBelow) (cr ^? crInv . ix i)
|
||||
]
|
||||
|
||||
|
||||
-- getPrettyShort (u ^? uvWorld . cWorld . lWorld . creatures . ix 0 . crHotkeys)
|
||||
-- <> ["---"]
|
||||
-- <> getPrettyShort ( u ^? uvWorld . cWorld . lWorld . creatures . ix 0 . crInvHotkeys)
|
||||
|
||||
Reference in New Issue
Block a user