diff --git a/assets/misc/tableSEComputer.kra b/assets/misc/tableSEComputer.kra new file mode 100644 index 0000000..2c40c82 Binary files /dev/null and b/assets/misc/tableSEComputer.kra differ diff --git a/assets/misc/tableSEComputer.png b/assets/misc/tableSEComputer.png new file mode 100644 index 0000000..e0597ac Binary files /dev/null and b/assets/misc/tableSEComputer.png differ diff --git a/assets/misc/tableSWComputer.kra b/assets/misc/tableSWComputer.kra index c902e60..58bce61 100644 Binary files a/assets/misc/tableSWComputer.kra and b/assets/misc/tableSWComputer.kra differ diff --git a/assets/misc/tableSWComputer.png b/assets/misc/tableSWComputer.png index a4a961d..17f2202 100644 Binary files a/assets/misc/tableSWComputer.png and b/assets/misc/tableSWComputer.png differ diff --git a/src/Load.hs b/src/Load.hs index d7f9d3f..44213b7 100644 --- a/src/Load.hs +++ b/src/Load.hs @@ -63,7 +63,7 @@ loadFork -> MVar (Float, T.Text) -> IO () loadFork ws win glc nvg future progress = do - let stateSteps = 49 + let stateSteps = 55 increment = 1 / stateSteps SDL.glMakeCurrent win glc modifyMVar_ progress (return . (\(p, _) -> @@ -398,6 +398,33 @@ loadFork ws win glc nvg future progress = do , AnimationConfig (0, 74) (64, 74) (64, 0) 4 2 APLoop ) ] + modifyMVar_ progress (return . (\(p, _) -> + ( p + increment + , "Loading Animation \"nwComputer: off\"" + ))) + nwComputerOff <- loadAnimationSprites "assets/misc/tableSEComputer.png" nvg + [ ( AnimId "computer" "off" NW + , AnimationConfig (0, 0) (64, 74) (64, 0) 2 2 APLoop + ) + ] + modifyMVar_ progress (return . (\(p, _) -> + ( p + increment + , "Loading Animation \"nwComputer: on\"" + ))) + nwComputerOn <- loadAnimationSprites "assets/misc/tableSEComputer.png" nvg + [ ( AnimId "computer" "on" NW + , AnimationConfig (128, 0) (64, 74) (0, 0) 1 0 APLoop + ) + ] + modifyMVar_ progress (return . (\(p, _) -> + ( p + increment + , "Loading Animation \"nwComputer: hack\"" + ))) + nwComputerHack <- loadAnimationSprites "assets/misc/tableSEComputer.png" nvg + [ ( AnimId "computer" "hack" NW + , AnimationConfig (0, 74) (64, 74) (64, 0) 4 2 APLoop + ) + ] modifyMVar_ progress (return . (\(p, _) -> ( p + increment , "Loading Animation \"toilet: free\"" @@ -438,6 +465,9 @@ loadFork ws win glc nvg future progress = do neComputerOff ++ neComputerOn ++ neComputerHack ++ + nwComputerOff ++ + nwComputerOn ++ + nwComputerHack ++ toiletFree ++ toiletOccupied ) diff --git a/src/MainGame/WorldMap.hs b/src/MainGame/WorldMap.hs index 2fc47ae..b3f4249 100644 --- a/src/MainGame/WorldMap.hs +++ b/src/MainGame/WorldMap.hs @@ -161,7 +161,8 @@ loadMapFork ud ad future progress = do access = case dir of N -> V2 1 (-1) NE -> V2 0 (-1) - _ -> error "not yet defined" + NW -> V2 1 0 + x -> error ("computer placement " ++ show x ++ " not defined") void $ createEntity $ newEntity { pos = Just $ reachCoord - fmap fromIntegral access , anim = Just $ AnimState (AnimId "computer" "off" dir) 0 0 diff --git a/src/Types/Interior.hs b/src/Types/Interior.hs index 8a89381..de602e9 100644 --- a/src/Types/Interior.hs +++ b/src/Types/Interior.hs @@ -23,7 +23,6 @@ data Cluster | ClusterTableNW | ClusterTableNE | ClusterTableSE - | ClusterComputerTableSW | ClusterCornerTable | ClusterTableGroup | ClusterCopier @@ -45,17 +44,33 @@ clusterMatWithRPs ClusterBox1 dim _ = ] , clusterPoints ClusterBox1 dim ) -clusterMatWithRPs ClusterTableSW dim@(h, _) _ = +clusterMatWithRPs ClusterTableSW dim@(mh, _) g = + let h = min 3 mh + ps = [ ReachPoint (if p /= 1 then Table else Computer) (V2 r 1) NE 0 | + (r, p) <- zip [1..] $ map fst (tail $ foldl + (\acc@((_, fg):_) _ -> randomR (1 :: Int, 3) fg : acc) + [(0, g)] + [1..h]) + ] + in ( M.fromLists $ replicate h [Just ImgEmpty, Just ImgTableSW] - , clusterPoints ClusterTableSW dim + , ps ) -clusterMatWithRPs ClusterTableSE dim@(_, w) _ = +clusterMatWithRPs ClusterTableSE dim@(_, mw) g = + let w = min 3 mw + ps = [ ReachPoint (if p /= 1 then Table else Computer) (V2 2 c) NW 0 | + (c, p) <- zip [1..] $ map fst (tail $ foldl + (\acc@((_, fg):_) _ -> randomR (1 :: Int, 3) fg : acc) + [(0, g)] + [1..w]) + ] + in ( M.fromLists $ [ replicate w (Just ImgTableSE) , replicate w (Just ImgEmpty) ] - , clusterPoints ClusterTableSE dim + , ps ) clusterMatWithRPs ClusterTableNE dim@(h, _) _ = ( M.fromLists $ replicate h @@ -69,12 +84,6 @@ clusterMatWithRPs ClusterTableNW dim@(_, w) _ = ] , clusterPoints ClusterTableNW dim ) -clusterMatWithRPs ClusterComputerTableSW dim _ = - ( M.fromLists [ - [Just ImgEmpty, Just ImgTableSW] - ] - , clusterPoints ClusterComputerTableSW dim - ) clusterMatWithRPs ClusterCornerTable dim _ = ( M.fromLists [ [Just ImgTableSE, Just ImgTableCorner] @@ -228,7 +237,6 @@ clusterRoom ClusterTableSW = [Offi] clusterRoom ClusterTableNW = [Offi] clusterRoom ClusterTableNE = [Offi] clusterRoom ClusterTableSE = [Offi] -clusterRoom ClusterComputerTableSW = [Offi] clusterRoom ClusterCornerTable = [Offi] clusterRoom ClusterTableGroup = [Offi] clusterRoom ClusterCopier = [Offi] @@ -247,12 +255,6 @@ clusterPoints ClusterTableNE (h, _) = [ ReachPoint Table (V2 r 2) SW 0 | r <- [1..h] ] clusterPoints ClusterTableNW (_, w) = [ ReachPoint Table (V2 1 c) SE 0 | c <- [1..w] ] -clusterPoints ClusterTableSW (h, _) = - [ ReachPoint Table (V2 r 1) NE 0 | r <- [1..h] ] -clusterPoints ClusterTableSE (_, w) = - [ ReachPoint Table (V2 2 c) NW 0 | c <- [1..w] ] -clusterPoints ClusterComputerTableSW _ = - [ ReachPoint Computer (V2 1 1) NE 0 ] clusterPoints ClusterCornerTable _ = [ ReachPoint Computer (V2 2 1) N 0 ]