Allow for laser to be attached to transformer to create weapon

This commit is contained in:
2025-07-10 10:31:04 +01:00
parent f557d5b954
commit e3c6ef1398
5 changed files with 49 additions and 55 deletions
+2 -8
View File
@@ -56,6 +56,7 @@ itemToBreakLists itm itmf = case (itm ^. itType, itmf) of
( getAmmoLinks itm
, [(ARHUDSF,SFLink ARHUDSF),(TriggerSF, TriggerLink),(MapperSF,SFLink MapperSF)]
)
(CRAFT TRANSFORMER, _) -> ([],[(LaserWeaponSF,SFLink LaserWeaponSF)])
(MAPPER, _) ->
( []
, [(ARHUDSF,SFLink ARHUDSF)]
@@ -127,7 +128,6 @@ itemToFunction itm = case itm ^. itType of
HELD LASER -> WeaponTargetingSF
HELD{} -> case itUseCondition itm of
UseableWhenAimed -> HeldPlatformSF
--Just MustBeHeld -> UnloadedWeaponSF
_ -> GadgetPlatformSF
_
| Just amtype <- magAmmoType itm-- ^? itConsumables . magType
@@ -160,6 +160,7 @@ treeToPotentialFunction ldt = case ldt ^. ldtValue . _1 . itType of
ATTACH GYROSCOPE -> S.singleton ProjectileStabiliserSF
HELD GLAUNCHER -> S.singleton UnderBarrelPlatformSF
HELD BURSTRIFLE -> S.singleton UnderBarrelPlatformSF
HELD LASER -> S.fromList [WeaponTargetingSF,LaserWeaponSF]
_ -> S.singleton (ldt ^. ldtValue . _2)
baseCI :: Item -> CItem
@@ -215,13 +216,6 @@ joinItemsInList f = fst . h . ([],)
h ( z : zs, y : ys) = case f y z of
Nothing -> h ( y : z : zs,ys)
Just w -> h ( zs,w : ys)
--joinItemsInList f xs = snd $ h (xs, [])
-- where
-- h ([], zs) = ([], zs)
-- h (y : ys, []) = h (ys, [y])
-- h (y : ys, z : zs) = case f y z of
-- Nothing -> h (ys, y : z : zs)
-- Just w -> h (w : ys, zs)
-- this puts the first elements in the intmap at the end of the list
invLDT :: IM.IntMap Item -> [LDTree ItemLink CItem]
+1
View File
@@ -35,6 +35,7 @@ itemInvColor ci = case ci ^. _2 of
ProjectileStabiliserSF -> white
UnderBarrelPlatformSF -> white
UnderBarrelSlotSF -> white
LaserWeaponSF -> white
--ammoTypeColor :: AmmoType -> Color
--ammoTypeColor = \case