Make launcherX use multiple ammo sources

This commit is contained in:
2024-06-28 22:40:24 +01:00
parent 009a6cd30f
commit 32cb2b2e80
17 changed files with 220 additions and 342 deletions
+9 -13
View File
@@ -1,19 +1,22 @@
module Dodge.Base.You where
module Dodge.Base.You
(you
, yourScopeInvID
, yourInv
, yourScrollAttachment
, yourItem
)where
import Dodge.Data.World
import Dodge.HeldScroll
import qualified IntMapHelp as IM
import qualified Data.Map.Strict as M
--import qualified Data.Map.Strict as M
import Control.Lens
import Control.Monad
import Data.Maybe
--import Data.Maybe
you :: World -> Creature
you w = w ^?! cWorld . lWorld . creatures . ix 0
youc :: CWorld -> Creature
youc w = w ^?! lWorld . creatures . ix 0
yourItem :: World -> Maybe Item
yourItem w = do
i <- you w ^? crManipulation . manObject . inInventory . ispItem
@@ -36,13 +39,6 @@ yourScopeInvID w = do
yourInv :: World -> IM.IntMap Item
yourInv = _crInv . you
attachmentTree :: Creature -> M.Map AttachType Int
attachmentTree cr = fromMaybe mempty $ do
i <- cr ^? crManipulation . manObject . inInventory . ispItem
return $ upDownAttachments cr i i mempty
upDownAttachments :: Creature -> Int -> Int -> M.Map AttachType Int -> M.Map AttachType Int
upDownAttachments _ _ _ s = s
--yourInvSel :: World -> Int
--yourInvSel = crSel . you