83 maybeScript = let s = head . fromMaybe ["Normal"] $ Map.lookup "SCRIPT" prms in if s == "Normal" then [] else [eml ["escript Scripts/Multiplayer/", s, ".lua"]] |
83 maybeScript = let s = head . fromMaybe ["Normal"] $ Map.lookup "SCRIPT" prms in if s == "Normal" then [] else [eml ["escript Scripts/Multiplayer/", s, ".lua"]] |
84 maybeMap = let m = mParams Map.! "MAP" in if m `elem` mapGenTypes then [] else [eml ["emap ", m]] |
84 maybeMap = let m = mParams Map.! "MAP" in if m `elem` mapGenTypes then [] else [eml ["emap ", m]] |
85 scheme = tail $ prms Map.! "SCHEME" |
85 scheme = tail $ prms Map.! "SCHEME" |
86 mapgen = mParams Map.! "MAPGEN" |
86 mapgen = mParams Map.! "MAPGEN" |
87 mapgenSpecific = case mapgen of |
87 mapgenSpecific = case mapgen of |
88 "+maze+" -> [eml ["e$maze_size ", head $ prms Map.! "MAZE_SIZE"]] |
88 "1" -> [eml ["e$maze_size ", head $ prms Map.! "MAZE_SIZE"]] |
89 "+drawn" -> drawnMapData . head $ prms Map.! "DRAWNMAP" |
89 "2" -> drawnMapData . head $ prms Map.! "DRAWNMAP" |
90 _ -> [] |
90 _ -> [] |
91 gameFlags :: Word32 |
91 gameFlags :: Word32 |
92 gameFlags = foldl (\r (b, f) -> if b == "false" then r else r .|. f) 0 $ zip scheme gameFlagConsts |
92 gameFlags = foldl (\r (b, f) -> if b == "false" then r else r .|. f) 0 $ zip scheme gameFlagConsts |
93 schemeFlags = map (\(v, (n, m)) -> eml [n, " ", showB $ (readInt_ v) * m]) |
93 schemeFlags = map (\(v, (n, m)) -> eml [n, " ", showB $ (readInt_ v) * m]) |
94 $ filter (\(_, (n, _)) -> not $ B.null n) |
94 $ filter (\(_, (n, _)) -> not $ B.null n) |