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