diff --git a/assets/misc/watercooler.kra b/assets/misc/watercooler.kra new file mode 100644 index 0000000..9f57de6 Binary files /dev/null and b/assets/misc/watercooler.kra differ diff --git a/assets/misc/watercooler.png b/assets/misc/watercooler.png new file mode 100644 index 0000000..3e0882f Binary files /dev/null and b/assets/misc/watercooler.png differ diff --git a/src/Load.hs b/src/Load.hs index f00d962..0158ab8 100644 --- a/src/Load.hs +++ b/src/Load.hs @@ -59,7 +59,7 @@ loadFork -> MVar (Float, T.Text) -> IO () loadFork ws win glc nvg future progress = do - let stateSteps = 34 + let stateSteps = 35 increment = 1 / stateSteps SDL.glMakeCurrent win glc modifyMVar_ progress (return . (\(p, _) -> @@ -184,25 +184,32 @@ loadFork ws win glc nvg future progress = do mmiscPlant2 <- createImage nvg (FileName "assets/misc/plant2.png") 0 modifyMVar_ progress (return . (\(p, _) -> ( p + increment - , "Loading Animation \"intruder: standing\"" + , "Loading asset \"watercooler\"" ))) - let mimgs = [ mwallasc, mwalldesc, - mwallcornern, mwallcornere, mwallcorners, mwallcornerw, - mwalltne, mwalltse, mwalltsw, mwalltnw, mwallcross, - mmiscbox1, - mtable1, mtable2, mtable3, mtable4, mtableC, - mtablec1, mtablec2, mtablec3, mtablec4, - mmiscFlipchart, - mmiscPlant1, mmiscPlant2 + mmiscWatercooler <- createImage nvg (FileName "assets/misc/watercooler.png") 0 + let mimgs = + [ mwallasc, mwalldesc + , mwallcornern, mwallcornere, mwallcorners, mwallcornerw + , mwalltne, mwalltse, mwalltsw, mwalltnw, mwallcross + , mmiscbox1 + , mtable1, mtable2, mtable3, mtable4, mtableC + , mtablec1, mtablec2, mtablec3, mtablec4 + , mmiscFlipchart + , mmiscPlant1, mmiscPlant2 + , mmiscWatercooler ] when (any isNothing mimgs) $ do liftIO $logIO Error "Failed to load image assets" exitFailure + modifyMVar_ progress (return . (\(p, _) -> + ( p + increment + , "Loading Animation \"intruder: standing\"" + ))) -- playerImgs <- loadPlayerSprite "assets/intruder.png" 64 74 nvg -- (zipWith (\a b -> (a, [b])) [0..] $ [ImgIntrE .. ImgIntrN] ++ [ImgIntrNE]) let imgs = zipWith (\a b -> (a, fromJust b)) [ ImgWallAsc - .. ImgMiscPlant2 + .. ImgMiscWatercooler ] mimgs directions = [E .. N] ++ [NE] diff --git a/src/Types/Collidible.hs b/src/Types/Collidible.hs index d3aed5a..0f64c70 100644 --- a/src/Types/Collidible.hs +++ b/src/Types/Collidible.hs @@ -97,6 +97,9 @@ instance Collidible ImgId where collisionObstacle ImgMiscPlant2 = [ Boundaries (9/36, 9/36) (27/36, 27/26) ] + collisionObstacle ImgMiscWatercooler = + [ Boundaries (14/36, 14/36) (22/36, 22/36) + ] collisionObstacle ImgEmptyNoWalk = [ Boundaries (0, 0) (1, 1) ] collisionObstacle _ = [] diff --git a/src/Types/ImgId.hs b/src/Types/ImgId.hs index 47a865e..ee78f84 100644 --- a/src/Types/ImgId.hs +++ b/src/Types/ImgId.hs @@ -29,6 +29,7 @@ data ImgId | ImgMiscFlipchart | ImgMiscPlant1 | ImgMiscPlant2 + | ImgMiscWatercooler -- | ImgIntrNE -- | ImgIntrE -- | ImgIntrSE diff --git a/src/Types/Interior.hs b/src/Types/Interior.hs index 2e96dc0..cb60c58 100644 --- a/src/Types/Interior.hs +++ b/src/Types/Interior.hs @@ -26,6 +26,7 @@ data Cluster | ClusterPlant1 | ClusterPlant2 | ClusterToilet + | ClusterWatercooler deriving (Enum, Bounded) clusterMat :: Cluster -> Matrix (Maybe ImgId) @@ -132,6 +133,11 @@ clusterMat ClusterPlant2 = clusterMat ClusterToilet = M.fromLists [ [ Just ImgEmpty, Just ImgEmptyNoWalk] ] +clusterMat ClusterWatercooler = + M.fromLists + [ [ Just ImgMiscWatercooler ] + , [ Just ImgEmpty ] + ] clusterRoom :: Cluster -> [TileState] clusterRoom ClusterBox1 = [Offi] @@ -148,6 +154,7 @@ clusterRoom ClusterConferenceTable2 = [Offi] clusterRoom ClusterPlant1 = [Offi] clusterRoom ClusterPlant2 = [Offi] clusterRoom ClusterToilet = [Toil] +clusterRoom ClusterWatercooler = [Kitc, Offi] clusterPoints :: Cluster -> [ReachPoint] clusterPoints ClusterBox1 = [] @@ -198,6 +205,9 @@ clusterPoints ClusterConferenceTable2 = clusterPoints ClusterToilet = [ ReachPoint Toilet (V2 1 1) NE ] +clusterPoints ClusterWatercooler = + [ ReachPoint Drink (V2 2 1) NW + ] clusterPoints _ = [] instance Size Cluster where diff --git a/src/Types/ReachPoint.hs b/src/Types/ReachPoint.hs index 9090749..b5fce05 100644 --- a/src/Types/ReachPoint.hs +++ b/src/Types/ReachPoint.hs @@ -16,4 +16,5 @@ data PointType | Copier | Computer | Toilet + | Drink deriving (Eq, Show)