Tweak airlock door to stop z fighting
This commit is contained in:
@@ -22,6 +22,9 @@ data Annotation
|
||||
| Key Int
|
||||
| Corridor
|
||||
| DoorAno
|
||||
| SwitchDoorAno
|
||||
| DoorNumAno Int
|
||||
| AirlockAno
|
||||
| FirstWeapon
|
||||
| StartRoom
|
||||
| EndRoom
|
||||
@@ -42,12 +45,17 @@ randomPadCorridors (Node x xs) = do
|
||||
xs' <- mapM randomPadCorridors xs
|
||||
return $ treeTrunk (replicate n [Corridor]) (Node x xs')
|
||||
|
||||
roomThenCorridor :: RandomGen g => Room -> State g (Tree (Either Room Room))
|
||||
roomThenCorridor theRoom = fmap (\r -> Node (Left theRoom) [(pure . Right) r])
|
||||
(randomiseOutLinks corridor)
|
||||
|
||||
annoToRoomTree :: RandomGen g => [Annotation] -> State g (Tree (Either Room Room))
|
||||
annoToRoomTree [OrAno as] = do
|
||||
a <- takeOne as
|
||||
annoToRoomTree a
|
||||
annoToRoomTree [Corridor] = fmap (pure . Right) $ randomiseOutLinks corridor
|
||||
annoToRoomTree [DoorAno] = fmap (\r -> Node (Left door) [(pure . Right) r]) (randomiseOutLinks corridor)
|
||||
annoToRoomTree [DoorAno] = roomThenCorridor door
|
||||
annoToRoomTree [DoorNumAno i,AirlockAno] = roomThenCorridor (airlock i)
|
||||
annoToRoomTree [FirstWeapon] = do
|
||||
branchWP <- branchRectWith weaponRoom
|
||||
blockedC <- blockedCorridor
|
||||
|
||||
Reference in New Issue
Block a user