Implement modules changing shell payloads

This commit is contained in:
2024-12-24 21:13:58 +00:00
parent e82ef26b3e
commit 81fd2131e0
18 changed files with 82 additions and 18 deletions
+5 -4
View File
@@ -3,7 +3,7 @@ module Dodge.Item.Grammar (
invAdj,
invRootMap,
invRootTrees,
basePCI,
baseCI,
allInvLocs,
) where
@@ -112,10 +112,11 @@ itemToFunction itm = case itm ^. itType of
TARGETING{} -> WeaponTargetingSF
EQUIP WRIST_ECG -> TriggerSF
EQUIP{} -> EquipmentPlatformSF
ATTACH SHELLPAYLOAD{} -> AmmoPayloadSF LauncherAmmo
_ -> UncomposableIsolateSF
basePCI :: Item -> ComposedItem
basePCI itm = (itm, itemToFunction itm, itemBaseConnections itm)
baseCI :: Item -> ComposedItem
baseCI itm = (itm, itemToFunction itm, itemBaseConnections itm)
itemBaseConnections :: Item -> LinkTest
itemBaseConnections itm = case _itType itm of
@@ -205,7 +206,7 @@ joinItemsInList f xs = snd $ h (xs, [])
invLDT :: IM.IntMap Item -> [LabelDoubleTree ItemLink ComposedItem]
invLDT =
joinItemsInList tryAttachItems . IM.elems
. fmap (singleLDT . basePCI)
. fmap (singleLDT . baseCI)
-- this assumes the creature inventory is well formed, specifically the
-- location ids