Work on laser run past rooms
This commit is contained in:
@@ -9,6 +9,9 @@ module Dodge.Room.LasTurret (
|
||||
lasSensorTurretTest,
|
||||
healthTest,
|
||||
lasCenRunClose,
|
||||
lasCenRunClose',
|
||||
lasCenRunClose1,
|
||||
lasCenRunCloseLongCor,
|
||||
) where
|
||||
|
||||
import Data.Foldable (fold)
|
||||
@@ -267,6 +270,49 @@ lasCenRunCloseLongCor = do
|
||||
|
||||
lasCenRunClose1 :: (RandomGen g) => State g (MetaTree Room String)
|
||||
lasCenRunClose1 = do
|
||||
--(alinks,blinks) <- shufflePair (bllinks,brlinks)
|
||||
(alinks,blinks) <- shufflePair (bllinks,tmllink)
|
||||
outwall <- takeOne [awall (V2 185 25) (rectWH 10 50)
|
||||
, awall (V2 200 50) (rectWH 50 10) ]
|
||||
r <- roomRectAutoLights 250 200
|
||||
<&> rmPmnts
|
||||
<>~ [ putLasTurret 0.02 & plSpot .~ PS (V2 125 100) 0
|
||||
, awall (V2 65 25) (rectWH 10 50)
|
||||
, outwall
|
||||
, awall (V2 95 150) (rectWH 10 10)
|
||||
--, awall (V2 105 150) (rectWH 20 10)
|
||||
, awall (V2 155 150) (rectWH 10 10)
|
||||
, sps0 $ putConvexChasm $ rectNSWE 200 110 105 145
|
||||
-- , awall (V2 150 215) (rectWH 60 10)
|
||||
]
|
||||
<&> rmLinks %~ setInLinks alinks
|
||||
-- <&> rmLinks %~ setOutLinks (memtest (OnEdge South) (FromEdge West 3))
|
||||
<&> rmLinks %~ setOutLinks blinks
|
||||
<&> rmLinks . each %~ mvlinks
|
||||
<&> rmPath %~ S.map (both %~ mvpath)
|
||||
rToOnward "lasCenRunClose" $ return $ cleatOnward r
|
||||
where
|
||||
mvlinks lnk | tmllink lnk = lnk & rlPos -~ V2 20 0
|
||||
| tmrlink lnk = lnk & rlPos +~ V2 20 0
|
||||
| otherwise = lnk
|
||||
mvpath (V2 x y) | y > 190 , x > 50 , x < 125 = V2 (x- 20) y
|
||||
| y > 190 , x > 125 , x < 200 = V2 (x+ 20) y
|
||||
| otherwise = V2 x y
|
||||
tmllink = memtest (FromEdge West 1) (OnEdge North)
|
||||
tmrlink = memtest (FromEdge West 2) (OnEdge North)
|
||||
bllinks = etest
|
||||
(memtest (FromEdge West 0) (OnEdge South))
|
||||
(memtest (FromEdge South 0) (OnEdge West))
|
||||
brlinks = etest
|
||||
(memtest (FromEdge East 0) (OnEdge South))
|
||||
(memtest (FromEdge South 0) (OnEdge East))
|
||||
awall x v = heightWallPS (PS x 0) 30 v
|
||||
etest f g x = f x || g x
|
||||
memtest a b x = let y = _rlType x
|
||||
in a `S.member` y && b `S.member` y
|
||||
|
||||
lasCenRunClose2 :: (RandomGen g) => State g (MetaTree Room String)
|
||||
lasCenRunClose2 = do
|
||||
(alinks,blinks) <- shufflePair (bllinks,trlinks)
|
||||
a <- takeOne [3*pi/2,3*pi/4]
|
||||
laspos <- takeOne [V2 60 190, V2 65 185]
|
||||
|
||||
@@ -55,7 +55,7 @@ tutAnoTree = do
|
||||
-- , return . tToBTree "door" $ treePost [corridor, cleatOnward door]
|
||||
, corDoor
|
||||
-- , tToBTree "cor" . return <$> shuffleLinks (cleatOnward corridor)
|
||||
, lasCenRunClose
|
||||
, lasCenRunClose1
|
||||
-- , passthroughLockKeyLists lockRoomKeyItems itemRooms
|
||||
, tToBTree "door" . return <$> return (cleatOnward door)
|
||||
, tToBTree "cor" . return <$> shuffleLinks (cleatOnward corridor)
|
||||
|
||||
@@ -26,7 +26,6 @@ module Dodge.RoomLink (
|
||||
|
||||
import Dodge.Base.CardinalPoint
|
||||
import Control.Lens
|
||||
import Data.List (partition)
|
||||
import qualified Data.Set as S
|
||||
import Dodge.Data.GenWorld
|
||||
import Geometry
|
||||
@@ -104,12 +103,11 @@ swapInOutLinks = rmLinks %~ map (rlType %~ S.map f)
|
||||
f OutLink = InLink
|
||||
f x = x
|
||||
|
||||
overLnkType :: RoomLinkType -> ([RoomLink] -> [RoomLink]) -> Room -> Room
|
||||
overLnkType lt f = rmLinks %~ g
|
||||
overLnkType :: RoomLinkType -> (RoomLink -> RoomLink) -> [RoomLink] -> [RoomLink]
|
||||
overLnkType lt f = each %~ g
|
||||
where
|
||||
g lnks =
|
||||
let (xs, ys) = partition (S.member lt . _rlType) lnks
|
||||
in f xs ++ ys
|
||||
g lnk | lt `S.member` _rlType lnk = f lnk
|
||||
| otherwise = lnk
|
||||
|
||||
rlPosDir :: RoomLink -> (Point2, Float)
|
||||
rlPosDir rl = (_rlPos rl, _rlDir rl)
|
||||
|
||||
@@ -2585,8 +2585,8 @@ ammoMagSPic src/Dodge/Item/Draw/SPic.hs 128;" f
|
||||
amr src/Dodge/Item/Held/Rod.hs 34;" f
|
||||
anRoom src/Dodge/Floor.hs 116;" f
|
||||
analyser src/Dodge/Placement/Instance/Analyser.hs 8;" f
|
||||
analyserByDoor src/Dodge/Room/LasTurret.hs 113;" f
|
||||
analyserByNthLink src/Dodge/Room/LasTurret.hs 97;" f
|
||||
analyserByDoor src/Dodge/Room/LasTurret.hs 116;" f
|
||||
analyserByNthLink src/Dodge/Room/LasTurret.hs 100;" f
|
||||
andOrRegex src/Dodge/DisplayInventory.hs 78;" f
|
||||
angleBetween src/Geometry.hs 158;" f
|
||||
angleVV src/Geometry/Vector.hs 58;" f
|
||||
@@ -2785,7 +2785,7 @@ cardinalBetweenAdj src/Dodge/Base/CardinalPoint.hs 28;" f
|
||||
cardinalVectors src/Dodge/FloorItem.hs 24;" f
|
||||
cdtPropagateFold src/Dodge/DoubleTree.hs 407;" f
|
||||
ceilingTo src/Geometry/Zone.hs 15;" f
|
||||
cenLasTur src/Dodge/Room/LasTurret.hs 37;" f
|
||||
cenLasTur src/Dodge/Room/LasTurret.hs 40;" f
|
||||
centerText src/Picture/Base.hs 176;" f
|
||||
centerVaultExplosiveExit src/Dodge/Room/NoNeedWeapon.hs 20;" f
|
||||
centerVaultRoom src/Dodge/Room/Procedural.hs 269;" f
|
||||
@@ -3718,8 +3718,8 @@ headLampShape src/Dodge/Item/Draw/SPic.hs 423;" f
|
||||
headMap src/Dodge/DoubleTree.hs 249;" f
|
||||
headPQ src/Dodge/Creature/HandPos.hs 116;" f
|
||||
healS src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 627;" f
|
||||
healthAnalyserByDoor src/Dodge/Room/LasTurret.hs 94;" f
|
||||
healthTest src/Dodge/Room/LasTurret.hs 116;" f
|
||||
healthAnalyserByDoor src/Dodge/Room/LasTurret.hs 97;" f
|
||||
healthTest src/Dodge/Room/LasTurret.hs 119;" f
|
||||
heightWallPS src/Dodge/Placement/Instance/Wall.hs 24;" f
|
||||
heldAimStance src/Dodge/Item/AimStance.hs 24;" f
|
||||
heldAimZoom src/Dodge/Update/Camera.hs 157;" f
|
||||
@@ -3942,8 +3942,8 @@ justify src/Justify.hs 9;" f
|
||||
k src/ShortShow.hs 48;" f
|
||||
k' src/ShortShow.hs 48;" f
|
||||
keyCard src/Dodge/Item/Held/Utility.hs 20;" f
|
||||
keyCardAnalyserByDoor src/Dodge/Room/LasTurret.hs 91;" f
|
||||
keyCardRoomRunPast src/Dodge/Room/LasTurret.hs 79;" f
|
||||
keyCardAnalyserByDoor src/Dodge/Room/LasTurret.hs 94;" f
|
||||
keyCardRoomRunPast src/Dodge/Room/LasTurret.hs 82;" f
|
||||
keyCardRunPastRand src/Dodge/LockAndKey.hs 36;" f
|
||||
keyPic src/Dodge/Item/Draw/SPic.hs 439;" f
|
||||
keyholeCorridor src/Dodge/Room/Corridor.hs 45;" f
|
||||
@@ -3955,16 +3955,16 @@ lConnectMulti src/Dodge/Render/Connectors.hs 51;" f
|
||||
lShape src/Dodge/Placement/Instance/LightSource.hs 54;" f
|
||||
lamp src/Dodge/Creature/Lamp.hs 18;" f
|
||||
lampCrSPic src/Dodge/Render/ShapePicture.hs 116;" f
|
||||
lasCenRunClose src/Dodge/Room/LasTurret.hs 147;" f
|
||||
lasCenRunClose' src/Dodge/Room/LasTurret.hs 181;" f
|
||||
lasCenRunClose1 src/Dodge/Room/LasTurret.hs 257;" f
|
||||
lasCenRunCloseLongCor src/Dodge/Room/LasTurret.hs 227;" f
|
||||
lasCenSensEdge src/Dodge/Room/LasTurret.hs 135;" f
|
||||
lasCenRunClose src/Dodge/Room/LasTurret.hs 150;" f
|
||||
lasCenRunClose' src/Dodge/Room/LasTurret.hs 195;" f
|
||||
lasCenRunClose1 src/Dodge/Room/LasTurret.hs 271;" f
|
||||
lasCenRunCloseLongCor src/Dodge/Room/LasTurret.hs 241;" f
|
||||
lasCenSensEdge src/Dodge/Room/LasTurret.hs 138;" f
|
||||
lasGunPic src/Dodge/Item/Draw/SPic.hs 414;" f
|
||||
lasPulseS src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 731;" f
|
||||
lasSensorTurretTest src/Dodge/Room/LasTurret.hs 128;" f
|
||||
lasTunnel src/Dodge/Room/LasTurret.hs 287;" f
|
||||
lasTunnelRunPast src/Dodge/Room/LasTurret.hs 328;" f
|
||||
lasSensorTurretTest src/Dodge/Room/LasTurret.hs 131;" f
|
||||
lasTunnel src/Dodge/Room/LasTurret.hs 301;" f
|
||||
lasTunnelRunPast src/Dodge/Room/LasTurret.hs 342;" f
|
||||
lasTurret src/Dodge/Placement/Instance/Turret.hs 35;" f
|
||||
laser src/Dodge/Item/Held/BatteryGuns.hs 34;" f
|
||||
laserSpark src/Dodge/Material/Damage.hs 33;" f
|
||||
@@ -3999,8 +3999,8 @@ legsSPic src/Dodge/Item/Draw/SPic.hs 448;" f
|
||||
lerpP2A src/Dodge/ShiftPoint.hs 14;" f
|
||||
liShape src/Dodge/Placement/Instance/LightSource.hs 79;" f
|
||||
light src/Color.hs 131;" f
|
||||
lightSensByDoor src/Dodge/Room/LasTurret.hs 64;" f
|
||||
lightSensInsideDoor src/Dodge/Room/LasTurret.hs 52;" f
|
||||
lightSensByDoor src/Dodge/Room/LasTurret.hs 67;" f
|
||||
lightSensInsideDoor src/Dodge/Room/LasTurret.hs 55;" f
|
||||
lightSensor src/Dodge/Placement/Instance/Sensor.hs 26;" f
|
||||
lightsToRender src/Dodge/Render/Lights.hs 14;" f
|
||||
lightx4 src/Color.hs 155;" f
|
||||
|
||||
Reference in New Issue
Block a user