Improve starting weapon rooms

This commit is contained in:
2021-11-24 22:13:42 +00:00
parent 2c759cb40e
commit 4ad02f29b2
4 changed files with 16 additions and 21 deletions
+10 -20
View File
@@ -255,7 +255,6 @@ randFirstWeapon = do
++ replicate 2 autoGun
++ [launcher]
weaponEmptyRoom :: RandomGen g => State g (SubCompTree Room)
weaponEmptyRoom = do
w <- state $ randomR (220,300)
@@ -267,10 +266,9 @@ weaponEmptyRoom = do
--,sPS (V2 (w/2) (h/2)) 0 putLamp
,mntLightLnkCond unusedLnkToPS
]
treeFromTrunk [PassDown corridor]
<$> ((fmap singleUseAll . randomiseOutLinks) =<<
changeLinkTo ((\p -> dist p (V2 (w/2) 0) < 10) . fst) (set rmPmnts plmnts $ roomRect w h 2 2)
)
f (V2 x y,a) = (a == pi && x > 25 && x < w - 25) || (a /= 0 && y > w - 30)
rm <- shuffleLinks $ restrictRMInLinksPD f (roomRect w h 2 2 & rmPmnts .~ plmnts)
return $ treeFromTrunk [PassDown corridor] (singleUseAll rm )
weaponUnderCrits :: RandomGen g => State g (SubCompTree Room)
weaponUnderCrits = do
@@ -312,18 +310,10 @@ weaponBehindPillar = do
weaponBetweenPillars :: RandomGen g => State g (SubCompTree Room)
weaponBetweenPillars = do
wpPos <- takeOne [V2 x y | x <- [20,120,220], y <- [20,120,220]]
(ps,_) <- takeNMore 2 ([], [V2 x y | x <- [20,220], y <- [20,120,220]])
let crPos1:crPos2:_ = ps
d p = argV $ V2 120 120 -.- p
plmnts =
[sPS wpPos 0 $ RandPS randFirstWeapon
, sps (unusedSpotAwayFromInLink 150) randC1
, sps (unusedSpotAwayFromInLink 150) randC1
, sps (unusedSpotAwayFromInLink 150) randC1
, sps (unusedSpotAwayFromInLink 150) randC1
--,sPS crPos1 (d crPos1) randC1
--,sPS crPos2 (d crPos2) randC1
]
critPlacementSpots <- replicateM 2 $ randDirPS $ unusedSpotAwayFromInLink 100
let plmnts =
sPS wpPos 0 (RandPS randFirstWeapon) :
map (\ps -> sps ps randC1) critPlacementSpots
theRoom = roomPillars & rmPmnts %~ (++ plmnts)
(fmap singleUseAll . randomiseOutLinks) =<< filterLinks f theRoom
where
@@ -362,9 +352,9 @@ deadEndRoom = defaultRoom
weaponRoom :: RandomGen g => State g (SubCompTree Room)
weaponRoom = join $ takeOne
[-- weaponEmptyRoom
--, weaponUnderCrits
--, weaponBehindPillar
weaponBetweenPillars
weaponUnderCrits
-- weaponBehindPillar
-- weaponBetweenPillars
--, weaponLongCorridor
]