gameServer/EngineInteraction.hs
changeset 11547 2bbbe9cb2980
parent 11355 d94f65b66c60
child 11556 af9aa8d5863c
equal deleted inserted replaced
11546:59bf29b4f523 11547:2bbbe9cb2980
   142         gameFlags :: Word32
   142         gameFlags :: Word32
   143         gameFlags = foldl (\r (b, f) -> if b == "false" then r else r .|. f) 0 $ zip scheme gameFlagConsts
   143         gameFlags = foldl (\r (b, f) -> if b == "false" then r else r .|. f) 0 $ zip scheme gameFlagConsts
   144         schemeFlags = map (\(v, (n, m)) -> eml [n, " ", showB $ (readInt_ v) * m])
   144         schemeFlags = map (\(v, (n, m)) -> eml [n, " ", showB $ (readInt_ v) * m])
   145             $ filter (\(_, (n, _)) -> not $ B.null n)
   145             $ filter (\(_, (n, _)) -> not $ B.null n)
   146             $ zip (drop (length gameFlagConsts) scheme) schemeParams
   146             $ zip (drop (length gameFlagConsts) scheme) schemeParams
   147         schemeAdditional = let scriptParam = B.tail $ scheme !! 41 in [eml ["e$scriptparam ", scriptParam] | not $ B.null scriptParam]
   147         schemeAdditional = let scriptParam = B.tail $ scheme !! 42 in [eml ["e$scriptparam ", scriptParam] | not $ B.null scriptParam]
   148         ammoStr :: B.ByteString
   148         ammoStr :: B.ByteString
   149         ammoStr = head . tail $ prms Map.! "AMMO"
   149         ammoStr = head . tail $ prms Map.! "AMMO"
   150         ammo = let l = B.length ammoStr `div` 4; ((a, b), (c, d)) = (B.splitAt l . fst &&& B.splitAt l . snd) . B.splitAt (l * 2) $ ammoStr in
   150         ammo = let l = B.length ammoStr `div` 4; ((a, b), (c, d)) = (B.splitAt l . fst &&& B.splitAt l . snd) . B.splitAt (l * 2) $ ammoStr in
   151                    (map (\(x, y) -> eml [x, " ", y]) $ zip ["eammloadt", "eammprob", "eammdelay", "eammreinf"] [a, b, c, d])
   151                    (map (\(x, y) -> eml [x, " ", y]) $ zip ["eammloadt", "eammprob", "eammdelay", "eammreinf"] [a, b, c, d])
   152                    ++ [em "eammstore" | scheme !! 14 == "true" || scheme !! 20 == "false"]
   152                    ++ [em "eammstore" | scheme !! 14 == "true" || scheme !! 20 == "false"]