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
+1
View File
@@ -67,6 +67,7 @@ shellMag =
{ _magParams =
ProjectileParams
{ _ampPayload = ExplosionPayload
-- { _ampPayload = ShrapnelBomb
}
, _magLoadStatus =
ReloadStatus
+1
View File
@@ -73,6 +73,7 @@ showAttachItem t itm = case t of
(itm ^? itUse . uaParams . apLinkedProjectile . _Just)
HOMINGMODULE -> "HOMING MOD"
AUGMENTEDHUD -> "AUGMENTED HUD"
SHELLPAYLOAD x -> show x
showEquipItem :: EquipItemType -> String
showEquipItem eit = case eit of
+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
+6
View File
@@ -1,4 +1,5 @@
module Dodge.Item.Scope (
shellModule,
zoomScope,
targetingScope,
remoteScreen,
@@ -38,6 +39,11 @@ bulletModule bm =
& itType .~ BULLETMOD bm
& itUse .~ UseBulletMod {_ubMod = bm}
shellModule :: Payload -> Item
shellModule p = defaultHeldItem
& itType .~ ATTACH (SHELLPAYLOAD p)
& itUse .~ UseNothing
--bulletTargetingModule :: BulletTrajectoryType -> Item
--bulletTargetingModule = bulletModule . BulletModTrajectory