Implement bullet synth
This commit is contained in:
@@ -122,4 +122,5 @@ chemFuelPouch =
|
||||
}
|
||||
|
||||
bulletSynthesizer :: Item
|
||||
bulletSynthesizer = makeAttach BULLETSYNTHESIZER
|
||||
bulletSynthesizer = makeAttach BULLETSYNTH
|
||||
& itUse .~ UseAttach (APInt 0)
|
||||
|
||||
@@ -61,7 +61,7 @@ itemBaseName itm = case _itType itm of
|
||||
showAttachItem :: AttachType -> Item -> String
|
||||
showAttachItem t itm = case t of
|
||||
ZOOMSCOPE -> "ZOOMSCOPE"
|
||||
BULLETSYNTHESIZER -> "BSYNTH"
|
||||
BULLETSYNTH -> "BSYNTH"
|
||||
REMOTESCREEN -> "REMOTE SCREEN " ++ show (itm ^? itUse . uaParams . apLinkedProjectile . _Just)
|
||||
HOMINGMODULE -> "HOMING MOD"
|
||||
AUGMENTEDHUD -> "AUGMENTED HUD"
|
||||
@@ -93,20 +93,21 @@ showAutoRechargeProgress lc = case lc of
|
||||
-- ic = (itm ^?! itUse . heldConsumption . laSource)
|
||||
|
||||
itemNumberDisplay :: Creature -> ComposedItem -> [String]
|
||||
itemNumberDisplay cr ci = case (ci ^. cItemFunction,iu) of
|
||||
(WeaponTargetingSF,_) -> [maybe "" (const "!TARG!") (itm ^? itTargeting . itTgPos . _Just)]
|
||||
itemNumberDisplay cr ci = case (ci ^. cItemFunction, itm ^?! itUse) of
|
||||
(WeaponTargetingSF,_)
|
||||
-> [maybe "" (const "!TARG!") (itm ^? itTargeting . itTgPos . _Just)]
|
||||
(_,UseHeld{}) -> []
|
||||
(_,UseHotkey{}) -> [showAutoRechargeProgress (_leftConsumption iu)]
|
||||
(_,UseHotkey{_leftConsumption=lc}) -> [showAutoRechargeProgress lc]
|
||||
(_,UseEquip{}) -> showEquipmentNumber cr itm
|
||||
(_,UseCraft) -> []
|
||||
(_,UseConsume {}) -> []
|
||||
(_,UseAttach (APInt i)) -> [show i]
|
||||
(_,UseAttach {}) -> []
|
||||
(_,UseAmmoMag {}) -> [maybe "" shortShow $ itm ^? itUse . amagLoadStatus . iaLoaded]
|
||||
(_,UseScope OpticScope {_opticZoom = x}) -> [shortShow x]
|
||||
(_,UseBulletMod {}) -> mempty
|
||||
where
|
||||
itm = ci ^. cItem
|
||||
iu = itm ^?! itUse
|
||||
|
||||
showEquipmentNumber :: Creature -> Item -> [String]
|
||||
showEquipmentNumber _ itm = case _eeUse ee of
|
||||
|
||||
@@ -21,6 +21,12 @@ import Dodge.Item.Orientation
|
||||
import LensHelp
|
||||
import ListHelp
|
||||
|
||||
tryAttachItems ::
|
||||
LabelDoubleTree ItemLink PartiallyComposedItem ->
|
||||
LabelDoubleTree ItemLink PartiallyComposedItem ->
|
||||
Maybe (LabelDoubleTree ItemLink PartiallyComposedItem)
|
||||
tryAttachItems = leftRightCombine leftIsParentCombine rightIsParentCombine
|
||||
|
||||
useBreakL ::
|
||||
[(ItemStructuralFunction, ComposeLinkType)] ->
|
||||
[(ItemStructuralFunction, ComposeLinkType)] ->
|
||||
@@ -66,6 +72,8 @@ itemToBreakLists ci = case (itm ^. itType, ci ^. cItemFunction) of
|
||||
, []
|
||||
)
|
||||
(_, WeaponTargetingSF) -> (getAmmoLinks itm ++ [(AugmentedHUDSF, AugmentedHUDLink)], [])
|
||||
(ATTACH BULLETSYNTH, _)
|
||||
-> ([(AmmoMagSF ElectricalAmmo, AmmoInLink 0 ElectricalAmmo)],[])
|
||||
_ -> ([], [])
|
||||
where
|
||||
itm = ci ^. cItem
|
||||
@@ -78,10 +86,11 @@ getAmmoLinks itm =
|
||||
|
||||
itemToFunction :: Item -> ItemStructuralFunction
|
||||
itemToFunction itm = case itm ^. itType of
|
||||
HELD LASER -> WeaponTargetingSF
|
||||
HELD{} -> WeaponPlatformSF
|
||||
AMMOMAG{} -> maybe UncomposableIsolateSF AmmoMagSF $ itm ^? itUse . amagType
|
||||
ATTACH REMOTESCREEN -> RemoteScreenSF
|
||||
ATTACH BULLETSYNTHESIZER -> AmmoModifierSF BulletAmmo
|
||||
ATTACH BULLETSYNTH -> AmmoModifierSF BulletAmmo
|
||||
ATTACH ZOOMSCOPE -> WeaponScopeSF
|
||||
ATTACH HOMINGMODULE -> AmmoTargetingSF ProjectileAmmo
|
||||
ATTACH AUGMENTEDHUD -> AugmentedHUDSF
|
||||
@@ -89,8 +98,8 @@ itemToFunction itm = case itm ^. itType of
|
||||
BULLETMOD BulletModPayload{} -> AmmoPayloadSF BulletAmmo
|
||||
BULLETMOD BulletModEffect{} -> AmmoEffectSF BulletAmmo
|
||||
TARGETING{} -> WeaponTargetingSF
|
||||
LEFT {} -> EquipmentPlatformSF
|
||||
EQUIP {} -> EquipmentPlatformSF
|
||||
LEFT{} -> EquipmentPlatformSF
|
||||
EQUIP{} -> EquipmentPlatformSF
|
||||
_ -> UncomposableIsolateSF
|
||||
|
||||
pciToCI :: PartiallyComposedItem -> ComposedItem
|
||||
@@ -98,8 +107,12 @@ pciToCI (x, y, _) = CItem x y
|
||||
|
||||
basePCI :: Item -> PartiallyComposedItem
|
||||
basePCI itm = case _itType itm of
|
||||
HELD LASER -> (itm, WeaponTargetingSF, laserLinkTest itm)
|
||||
_ -> (itm, itemToFunction itm, uncurry useBreakL $ itemToBreakLists (CItem itm (itemToFunction itm)))
|
||||
_ -> (itm, itemToFunction itm, itemBaseConnections itm)
|
||||
|
||||
itemBaseConnections :: Item -> LinkTest
|
||||
itemBaseConnections itm = case _itType itm of
|
||||
HELD LASER -> laserLinkTest itm
|
||||
_ -> uncurry useBreakL $ itemToBreakLists (CItem itm (itemToFunction itm))
|
||||
|
||||
laserLinkTest :: Item -> LinkTest
|
||||
laserLinkTest itm = LTest (llleft itm) (llright itm)
|
||||
@@ -171,7 +184,7 @@ joinItemsInList f xs = snd $ h (xs, [])
|
||||
-- this puts the first elements in the intmap at the end of the list
|
||||
invLDT :: IM.IntMap Item -> [LabelDoubleTree ItemLink PartiallyComposedItem]
|
||||
invLDT =
|
||||
joinItemsInList (leftRightCombine leftIsParentCombine rightIsParentCombine) . IM.elems
|
||||
joinItemsInList tryAttachItems . IM.elems
|
||||
. fmap (singleLDT . basePCI)
|
||||
|
||||
-- this assumes the creature inventory is well formed, specifically the
|
||||
|
||||
@@ -12,6 +12,7 @@ itInvHeight :: Item -> Int
|
||||
itInvHeight x = case x ^. itType of
|
||||
HELD (MINIGUNX i) -> (i + 3) `div` 2
|
||||
HELD LAUNCHER -> 3
|
||||
HELD LAUNCHERX{} -> 3
|
||||
HELD FLATSHIELD -> 3
|
||||
HELD (BANGSTICK i) -> max 1 (i `div` 2)
|
||||
_ -> 1
|
||||
@@ -27,7 +28,7 @@ itDim x = case x ^. itType of
|
||||
& dimCenter .~ V3 9 0 0
|
||||
HELD y | hasCaneGunDim y -> did & dimRad .~ 8
|
||||
& dimCenter .~ V3 5 0 0
|
||||
HELD (MINIGUNX {}) -> did & dimRad .~ 20
|
||||
HELD MINIGUNX {} -> did & dimRad .~ 20
|
||||
& dimCenter .~ V3 5 0 0
|
||||
& dimAttachPos .~ V3 5 (-5) 0
|
||||
HELD LAUNCHER -> did & dimRad .~ 9
|
||||
|
||||
Reference in New Issue
Block a user