Add missing file, workaround for placement positions bug
This commit is contained in:
@@ -23,19 +23,17 @@ import Dodge.Item.Random
|
||||
import Geometry.Data
|
||||
--import Padding
|
||||
import Color
|
||||
--import Shape
|
||||
import LensHelp
|
||||
|
||||
import qualified Data.Set as S
|
||||
import Data.Tree
|
||||
import Control.Monad.State
|
||||
import Control.Lens
|
||||
import System.Random
|
||||
--import qualified Data.IntMap.Strict as IM
|
||||
|
||||
horEdgeTest :: (Float -> Bool) -> ((Point2,Float) -> Bool)
|
||||
horEdgeTest t (V2 x _,_) = t x
|
||||
|
||||
|
||||
roomCritLS :: RandomGen g => State g LightSource
|
||||
roomCritLS = do
|
||||
col <- takeOne [0.5, 0.6]
|
||||
@@ -44,26 +42,20 @@ roomCritLS = do
|
||||
return $ lsPosColRad (V3 0 0 h) col rad
|
||||
|
||||
critRoom :: Room
|
||||
critRoom = corridorWallN
|
||||
{ _rmRandPSs = [psRandRanges (15,25) (30,45) (pi,2*pi)]
|
||||
}
|
||||
critRoom = corridorWallN & rmRandPSs .~ [psRandRanges (15,25) (30,45) (pi,2*pi)]
|
||||
|
||||
runPastRoom :: RandomGen g => Int -> State g (SubCompTree Room)
|
||||
runPastRoom i = do
|
||||
h <- state $ randomR (200,400::Float)
|
||||
theedgetest <- takeOne [horEdgeTest (<1), horEdgeTest (>39)]
|
||||
thels <- roomCritLS
|
||||
--theweapon <- join $ takeOne [randBlockBreakWeapon,return grenade]
|
||||
theweapon <- randBlockBreakWeapon
|
||||
cenroom <- shuffleLinks $ restrictRMInLinksPD (\(V2 _ y,_) -> y < 1)
|
||||
$ roomRectAutoLinks 40 h & rmPmnts .~ [plRRpt 0 (PutFlIt theweapon)]
|
||||
theedge <- takeOne [West,East]
|
||||
--let cenroom = filterSortOutLinksOn theedgetest ((\(V2 a b) -> (a,b)) . fst)
|
||||
let linkcor = critRoom {_rmPmnts =
|
||||
[ spanLS thels (V2 0 65) (V2 40 65)
|
||||
]
|
||||
}
|
||||
critroom = linkcor & rmPmnts %~ ( plRRpt 0 randC1 :)
|
||||
let linkcor = critRoom & rmPmnts .~ [ spanLS thels (V2 0 65) (V2 40 65) ]
|
||||
critroom = linkcor & rmPmnts .:~ plRRpt 0 randC1
|
||||
aswitchroom = corridorWallN
|
||||
{_rmExtPmnt = Just $ putLitButOnPosExtTrig red useLnkRoomPos
|
||||
,_rmLabel = Just i
|
||||
@@ -75,7 +67,6 @@ runPastRoom i = do
|
||||
critrooms :: [SubCompTree Room]
|
||||
critrooms = treeFromPost [PassDown switchdoor] (PassDown critroom) :
|
||||
replicate (n-2) (treeFromPost [PassDown switchdoor] (PassDown linkcor))
|
||||
return $ Node (PassDown cenroom)
|
||||
(map (applyToCompRoot $ rmConnectsTo .~ S.singleton (OnEdge theedge)) (controom : critrooms)
|
||||
return $ Node (PassDown cenroom) $
|
||||
map (applyToCompRoot $ rmConnectsTo .~ S.singleton (OnEdge theedge)) (controom : critrooms)
|
||||
++ [return $ PassDown aswitchroom]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user