Beamsplitter attachment for lasers
This commit is contained in:
@@ -13,7 +13,10 @@ itemAimStance dt
|
||||
| otherwise = itemBaseStance $ dt ^. dtValue . _1
|
||||
where
|
||||
islasweapon = dt ^. dtValue . _1 . itType == CRAFT TRANSFORMER
|
||||
&& dt ^? dtRight . ix 0 . dtValue . _2 == Just LaserWeaponSF
|
||||
&& islas (dt ^? dtRight . ix 0 . dtValue . _2) -- == Just LaserWeaponSF
|
||||
islas = \case
|
||||
Just (LaserWeaponXSF {}) -> True
|
||||
_ -> False
|
||||
|
||||
itemBaseStance :: Item -> AimStance
|
||||
itemBaseStance itm = case itm ^. itType of
|
||||
|
||||
@@ -42,6 +42,7 @@ craftItemSPic = \case
|
||||
PIPE -> colorSH green $ xCylinderST 3 10
|
||||
TUBE -> colorSH cyan $ xCylinderST 5 20
|
||||
HARDWARE -> colorSH orange $ upperPrismPolyST 3 $ square 4
|
||||
BEAMSPLITTER -> colorSH orange $ upperPrismPolyST 3 $ square 4
|
||||
SPRING -> colorSH green $ xCylinderST 1 5
|
||||
HOSE -> colorSH green $ xCylinderST 1 10
|
||||
TAPE ->
|
||||
|
||||
@@ -53,7 +53,8 @@ itemAboveAttachables (itm,sf) = case (itm ^. itType, sf) of
|
||||
itemBelowAttachables :: CItem -> [ItemSF]
|
||||
itemBelowAttachables (itm,sf) = case (itm ^. itType, sf) of
|
||||
(LASER, WeaponTargetingSF) -> getAmmoLinks itm
|
||||
(LASER, LaserWeaponSF) -> [PulseBallSF] <> getAmmoLinks itm
|
||||
(LASER, LaserWeaponXSF 1) -> [PulseBallSF,BeamSplitterSF] <> getAmmoLinks itm
|
||||
(LASER, LaserWeaponXSF {}) -> replicate 5 BeamSplitterSF <> getAmmoLinks itm
|
||||
-- (LASER, PulseBallSF) -> [PulseBallSF]
|
||||
--(HELD LASER, _) -> [PulseBallSF]
|
||||
(HELD LED, _) -> getAmmoLinks itm
|
||||
@@ -151,10 +152,12 @@ treeToPotentialFunction ldt = case ldt ^. dtValue . _1 . itType of
|
||||
ATTACH GYROSCOPE -> S.singleton ProjectileStabiliserSF
|
||||
HELD GLAUNCHER -> S.singleton UnderBarrelPlatformSF
|
||||
HELD BURSTRIFLE -> S.singleton UnderBarrelPlatformSF
|
||||
LASER | sf == WeaponTargetingSF -> S.fromList [WeaponTargetingSF,LaserWeaponSF]
|
||||
LASER | sf == WeaponTargetingSF -> S.fromList (WeaponTargetingSF: [LaserWeaponXSF i| i <- [1..6]])
|
||||
LASER -> S.fromList [LaserWeaponXSF i| i <- [1..6]]
|
||||
-- following limits items to ten ammo slots
|
||||
_ | AmmoMagSF _ x <- ldt ^. dtValue . _2 -> S.fromList [AmmoMagSF i x | i <- [0..9]]
|
||||
ATTACH CAPACITOR -> S.fromList [CapacitorSF,PulseBallSF]
|
||||
CRAFT BEAMSPLITTER -> S.singleton BeamSplitterSF
|
||||
_ -> S.singleton (ldt ^. dtValue . _2)
|
||||
where
|
||||
sf = ldt ^. dtValue . _2
|
||||
@@ -172,7 +175,7 @@ leftIsParentCombine ltree rtree = do
|
||||
& dtValue %~ f
|
||||
|
||||
updateLeftParentSF :: ItemType -> ItemSF -> ItemSF -> ItemSF
|
||||
updateLeftParentSF LASER WeaponTargetingSF TransformerSF = LaserWeaponSF
|
||||
updateLeftParentSF LASER WeaponTargetingSF TransformerSF = LaserWeaponXSF 1
|
||||
updateLeftParentSF _ psf _ = psf
|
||||
|
||||
rightIsParentCombine :: DTComb CItem
|
||||
@@ -183,7 +186,8 @@ rightIsParentCombine ltree rtree = do
|
||||
& dtValue %~ f
|
||||
|
||||
updateRightParentSF :: ItemType -> ItemSF -> ItemSF -> ItemSF
|
||||
updateRightParentSF LASER LaserWeaponSF CapacitorSF = PulseLaserSF
|
||||
updateRightParentSF LASER (LaserWeaponXSF 1) CapacitorSF = PulseLaserSF
|
||||
updateRightParentSF LASER (LaserWeaponXSF x) BeamSplitterSF = LaserWeaponXSF (x+1)
|
||||
updateRightParentSF _ psf _ = psf
|
||||
|
||||
leftChildList :: DTree CItem -> [ItemSF]
|
||||
|
||||
@@ -183,6 +183,7 @@ craftInfo fit = case fit of
|
||||
MOTOR -> "A device that can create rotational force."
|
||||
TRANSFORMER -> "A device that can step up or down voltage and current."
|
||||
PRISM -> "An object that refracts light."
|
||||
BEAMSPLITTER -> "Divides a single light beam into two paths."
|
||||
THERMOMETER -> "An object that measures temperature."
|
||||
LIGHTER -> "A device that can create a small flame."
|
||||
MAGNET -> "A device that attracts according to its dipoles."
|
||||
|
||||
@@ -38,7 +38,7 @@ sfInvColor = \case
|
||||
ProjectileStabiliserSF -> white
|
||||
UnderBarrelPlatformSF -> white
|
||||
UnderBarrelSlotSF -> white
|
||||
LaserWeaponSF -> white
|
||||
-- LaserWeaponSF -> white
|
||||
PulseLaserSF -> white
|
||||
CapacitorSF -> yellow
|
||||
PulseBallSF -> white
|
||||
@@ -46,6 +46,8 @@ sfInvColor = \case
|
||||
TransformerSF -> yellow
|
||||
PumpSF -> yellow
|
||||
TorchSF{} -> green
|
||||
LaserWeaponXSF {} -> white
|
||||
BeamSplitterSF {} -> white
|
||||
|
||||
--ammoTypeColor :: AmmoType -> Color
|
||||
--ammoTypeColor = \case
|
||||
|
||||
@@ -80,7 +80,7 @@ itemShapeMin g = f . (^. _1) . itemSPic
|
||||
orientAttachment :: Item -> CItem -> Point3Q
|
||||
orientAttachment par (ch,chsf) = case (_itType par, chsf) of
|
||||
(ATTACH UNDERBARRELSLOT, _) -> (V3 (-5) (-8) 0, Q.qID)
|
||||
(_,LaserWeaponSF) -> (V3 2 8 0, Q.qID)
|
||||
(_,LaserWeaponXSF {}) -> (V3 2 8 0, Q.qID)
|
||||
-- (_,TorchSF) -> (V3 2 8 0, Q.qID)
|
||||
-- (HELD BURSTRIFLE, _, HELD TORCH) -> (V3 20 0 0, Q.axisAngle (V3 0 0 1) (pi/2))
|
||||
-- (HELD LAUNCHER, _, HELD TORCH) -> (V3 0 20 0, Q.axisAngle (V3 0 0 1) (pi/4))
|
||||
|
||||
Reference in New Issue
Block a user