Tweak turret health
This commit is contained in:
@@ -52,6 +52,7 @@ terminalScreenGlow mc w = fromMaybe w $ do
|
||||
. lights
|
||||
.:~ LSParam (_mcPos mc `v2z` 20) 30 (V3 x y z)
|
||||
|
||||
-- aiming sweeps, probably don't want this for non-laser turrets
|
||||
updateTurret :: Float -> Machine -> World -> World
|
||||
updateTurret rotSpeed mc w =
|
||||
w
|
||||
@@ -73,7 +74,9 @@ updateTurret rotSpeed mc w =
|
||||
mcid = _mcID mc
|
||||
ypos = you w ^. crPos . _xy
|
||||
aimpos = ypos + offset * vNormal (normalize (ypos - mcpos))
|
||||
offset = 10 * sin (fromIntegral (w ^. cWorld . cClock) / (pi * 10))
|
||||
-- note this is slightly less than your default radius, if changing check
|
||||
-- with front shield
|
||||
offset = 9 * sin (fromIntegral (w ^. cWorld . cClock) / (pi * 10))
|
||||
mcpos = _mcPos mc
|
||||
seesYou = hasLOSIndirect mcpos ypos w
|
||||
mcdir = _mcDir mc
|
||||
|
||||
@@ -28,7 +28,7 @@ putLasTurret rotSpeed =
|
||||
( defaultMachine
|
||||
-- & mcColor .~ blue
|
||||
& mcType .~ (lasTurret & mctTurret . tuTurnSpeed .~ rotSpeed)
|
||||
& mcHP .~ 50000
|
||||
& mcHP .~ 1500
|
||||
)
|
||||
(Just laser)
|
||||
|
||||
|
||||
@@ -8,7 +8,8 @@ module Dodge.Room.LasTurret (
|
||||
keyCardRoomRunPast,
|
||||
lasSensorTurretTest,
|
||||
healthTest,
|
||||
lasCenRunClose,
|
||||
lasRunYinYangCenter,
|
||||
lasRunYinYang,
|
||||
lasCenRunClose',
|
||||
lasCenRunClose1,
|
||||
lasCenRunCloseLongCor,
|
||||
@@ -147,8 +148,56 @@ lasCenSensEdge n = do
|
||||
, treePost [door, cleatLabel 0 corridor]
|
||||
]
|
||||
|
||||
lasCenRunClose :: (RandomGen g) => State g (MetaTree Room String)
|
||||
lasCenRunClose = do
|
||||
lasRunYinYang :: (RandomGen g) => State g (MetaTree Room String)
|
||||
lasRunYinYang = do
|
||||
npoly <- takeOne [6,8,10,12]
|
||||
thelight <- mntLightLnkCond $ rprBool $ const . isInLnk
|
||||
thelight1 <- mntLightLnkCond $ rprBool $ const . isOutLnk
|
||||
thelight2 <- mntLightLnkCond $ rprBool $ const . (\rp -> PolyEdge ((npoly + 1) `div` 4) `S.member`
|
||||
(fold $ rp ^? rpType . rplsType))
|
||||
thelight3 <- mntLightLnkCond $ rprBool $ const . (\rp -> PolyEdge (3*(npoly + 1) `div` 4) `S.member`
|
||||
(fold $ rp ^? rpType . rplsType))
|
||||
r <- shuffleLinks =<<
|
||||
(roomNgon npoly 250
|
||||
<&> rmPmnts
|
||||
.~
|
||||
[angwall a | a <- [0,pi/8..pi-pi/9]] <>
|
||||
[bngwall a | a <- [0,pi/8..pi-pi/9]] <>
|
||||
[ awall 0 (rectWH 15 5)
|
||||
, putLasTurret 0.02 & plSpot . psPos .~ negate offxy
|
||||
, putLasTurret 0.02 & plSpot . psPos .~ offxy
|
||||
-- , awall (V2 0 50) (square 10)
|
||||
, thelight
|
||||
, thelight1
|
||||
, thelight2
|
||||
, thelight3
|
||||
]
|
||||
<&> rmPath %~ (addNodesCrossingCirc 0 30
|
||||
. flip (foldr ($)) [apath a | a <- [0,pi/8..pi-2*pi/9]]
|
||||
. flip (foldr ($)) [bpath a | a <- [0,pi/8..pi-2*pi/9]]
|
||||
)
|
||||
<&> rmLinks %~ setInLinksByType (PolyEdge 0)
|
||||
<&> rmLinks %~ setOutLinksByType (PolyEdge (npoly `div` 2))
|
||||
)
|
||||
rToOnward "lasCenRunClose" $ return $ cleatOnward r
|
||||
where
|
||||
awall x v = heightWallPS (PS x 0) 30 v
|
||||
--angwall a = awall (V2 0 100 + rotateV a (V2 0 100)) (fmap (rotateV (pi/4 + a/2)) $ rectWH 5 (25 - a*10/pi ))
|
||||
rf = 0.8
|
||||
offxy = V2 0 (-100)
|
||||
angwall a = awall (V2 0 100 + rotateV a (V2 0 100)) (fmap (rotateV (pi/4 + a*rf)) $ rectWH 5 (23 - a*13/pi ))
|
||||
apath a' = addNodesCrossing $ (\x -> (x + f (V2 0 100),x - f (V2 0 100))) (V2 0 100 + rotateV a (V2 0 100))
|
||||
where
|
||||
a = a' + pi/16
|
||||
f = rotateV (pi/4 + a *0.8)
|
||||
bngwall a = awall (V2 0 (-100) + rotateV a (V2 0 (-100))) (fmap (rotateV (pi/4 + a*rf)) $ rectWH 5 (23 - a*13/pi ))
|
||||
bpath a' = addNodesCrossing $ (\x -> (x + f (V2 0 100),x - f (V2 0 100))) (V2 0 (-100) + rotateV a (V2 0 (-100)))
|
||||
where
|
||||
a = a' + pi/16
|
||||
f = rotateV (pi/4 + a *0.8)
|
||||
|
||||
lasRunYinYangCenter :: (RandomGen g) => State g (MetaTree Room String)
|
||||
lasRunYinYangCenter = do
|
||||
npoly <- takeOne [6,8,10,12]
|
||||
thelight <- mntLightLnkCond $ rprBool $ const . isInLnk
|
||||
thelight1 <- mntLightLnkCond $ rprBool $ const . isOutLnk
|
||||
|
||||
@@ -55,7 +55,7 @@ tutAnoTree = do
|
||||
-- , return . tToBTree "door" $ treePost [corridor, cleatOnward door]
|
||||
, corDoor
|
||||
-- , tToBTree "cor" . return <$> shuffleLinks (cleatOnward corridor)
|
||||
, lasCenRunClose'
|
||||
, lasRunYinYang
|
||||
-- , passthroughLockKeyLists lockRoomKeyItems itemRooms
|
||||
, tToBTree "door" . return <$> return (cleatOnward door)
|
||||
, tToBTree "cor" . return <$> shuffleLinks (cleatOnward corridor)
|
||||
|
||||
@@ -32,7 +32,7 @@ import Data.Foldable
|
||||
import Data.Monoid
|
||||
|
||||
testStringInit :: Universe -> [String]
|
||||
testStringInit _ = []
|
||||
testStringInit u = fmap show $ u ^.. uvWorld . cWorld . lWorld . machines . each . mcHP
|
||||
--testStringInit u = map show (u ^.. uvWorld . cWorld . lWorld . machines . traverse . mcDir)
|
||||
--testStringInit u = map show
|
||||
-- (u ^.. uvWorld . cWorld . lWorld . machines . traverse .mcType . _McDistributer)
|
||||
|
||||
Reference in New Issue
Block a user