Move towards working implementation of attachment tree ammo
This commit is contained in:
@@ -5,6 +5,9 @@ module Dodge.WorldEffect (
|
||||
lineOutputTerminal,
|
||||
) where
|
||||
|
||||
import Dodge.Item.Grammar
|
||||
import Dodge.Data.ComposedItem
|
||||
import Dodge.Data.DoubleTree
|
||||
import Data.Foldable
|
||||
import qualified Data.Map.Strict as M
|
||||
import Data.Maybe
|
||||
@@ -34,13 +37,15 @@ doWdWd we = case we of
|
||||
WdWdNegateTrig trid -> cWorld . lWorld . triggers . ix trid %~ not
|
||||
WdWdFromItixCrixWdWd itid crid f -> \w -> fromMaybe w $ do
|
||||
cr <- w ^? cWorld . lWorld . creatures . ix crid
|
||||
it <- getItem itid w
|
||||
--it <- getItem itid w
|
||||
itRef <- cr ^? crManipulation . manObject . inInventory . ispItem
|
||||
it <- invTrees (_crInv cr) ^? ix itRef
|
||||
return $ doItCrWdWd f it cr w
|
||||
WdWdFromItCrixWdWd it crid f -> \w -> fromMaybe w $ do
|
||||
cr <- w ^? cWorld . lWorld . creatures . ix crid
|
||||
return $ doItCrWdWd f it cr w
|
||||
|
||||
doItCrWdWd :: ItCrWdWd -> Item -> Creature -> World -> World
|
||||
doItCrWdWd :: ItCrWdWd -> LabelDoubleTree ComposeLinkType Item -> Creature -> World -> World
|
||||
doItCrWdWd icww = case icww of
|
||||
ItCrWdId -> \_ _ -> id
|
||||
ItCrWdItemEffect -> flip itemEffect
|
||||
|
||||
Reference in New Issue
Block a user