Tweak display, scrolling of item values
This commit is contained in:
+12
-47
@@ -284,7 +284,7 @@ functionalUpdate u =
|
||||
. over (uvWorld . cWorld . lWorld . creatures) (fmap setOldPos)
|
||||
. over uvWorld updateCreatureGroups
|
||||
. over uvWorld updateWallDamages
|
||||
. over uvWorld updateSeenWalls
|
||||
-- . over uvWorld updateSeenWalls
|
||||
. over uvWorld checkTermDist
|
||||
. over uvWorld updateRBList
|
||||
. over uvWorld updateCloseObjects
|
||||
@@ -414,19 +414,17 @@ doWorldEvents w =
|
||||
(w ^. cWorld . lWorld . worldEvents)
|
||||
|
||||
updateLasers :: World -> World
|
||||
updateLasers w =
|
||||
w'
|
||||
& cWorld . lWorld . lasers .~ []
|
||||
& cWorld . lWorld . flares <>~ concat ls
|
||||
updateLasers w = w' & cWorld . lWorld . flares <>~ concat ls
|
||||
where
|
||||
(w', ls) = mapAccumR updateLaser w (w ^. cWorld . lWorld . lasers)
|
||||
(w', ls) = mapAccumR updateLaser
|
||||
(w & cWorld . lWorld . lasers .~ [])
|
||||
(w ^. cWorld . lWorld . lasers)
|
||||
|
||||
zoneClouds :: World -> World
|
||||
zoneClouds w = w & clZoning .~ foldl' (flip zoneCloud) mempty (w ^. cWorld . lWorld . clouds)
|
||||
|
||||
displayTerminalLineString :: TerminalLineString -> World -> (String, Color)
|
||||
displayTerminalLineString tls = case tls of
|
||||
TerminalLineConst str col -> const (str, col)
|
||||
displayTerminalLineString (TerminalLineConst str col) = const (str, col)
|
||||
|
||||
tmUpdate :: Terminal -> World -> World
|
||||
tmUpdate tm w = case w ^? cWorld . lWorld . terminals . ix (_tmID tm) . tmFutureLines . ix 0 of
|
||||
@@ -523,9 +521,7 @@ updateRadarBlips = updateObjMapMaybe radarBlips updateRadarBlip
|
||||
|
||||
-- if changing, make sure that bullets can still spawn new bullets
|
||||
updateBullets :: World -> World
|
||||
updateBullets w =
|
||||
w'
|
||||
& cWorld . lWorld . bullets %~ (++ catMaybes ps)
|
||||
updateBullets w = w' & cWorld . lWorld . bullets <>~ catMaybes ps
|
||||
where
|
||||
(w', ps) =
|
||||
mapAccumR updateBullet (w & cWorld . lWorld . bullets .~ []) $
|
||||
@@ -632,44 +628,15 @@ updateClouds = updateObjCatMaybes clouds updateCloud
|
||||
-- Just
|
||||
-- (intersectSegSegss x y ass)
|
||||
--intersectSegsSegss _ _ = Nothing
|
||||
--updateInstantBullets :: World -> World
|
||||
--updateInstantBullets w = case w ^. cWorld . lWorld . instantBullets of
|
||||
-- [] -> w
|
||||
-- ps ->
|
||||
-- let (w', ps') = mapAccumR updateBullet (w & cWorld . lWorld . instantBullets .~ []) ps
|
||||
-- in updateInstantBullets $ w' & cWorld . lWorld . bullets .++~ catMaybes ps'
|
||||
|
||||
--updateInstantParticles :: World -> World
|
||||
--updateInstantParticles w = case _instantParticles w of
|
||||
-- [] -> w
|
||||
-- ps -> let (w',ps') = mapAccumR (\a b -> _ptUpdate b a b) (w {_instantParticles=[]}) ps
|
||||
-- in updateInstantParticles $ w' & particles .++~ catMaybes ps'
|
||||
|
||||
--updateMIM :: ASetter' World (IM.IntMap a) -> (a -> a -> Maybe a) -> World -> World
|
||||
--updateMIM f up = f %~ IM.mapMaybe (dbArg up)
|
||||
|
||||
-- Note that this updates the randgen
|
||||
--updateCreatures :: World -> World
|
||||
--updateCreatures w = appEndo f $ w
|
||||
-- & creatures .~ IM.mapMaybe id m
|
||||
-- & randGen .~ newg
|
||||
-- where
|
||||
-- ((f,newg),m) = mapAccumR crUp (Endo id,_randGen w) (_creatures w)
|
||||
-- crUp (f',g) cr = ((f' <> f'',g'), cr')
|
||||
-- where
|
||||
-- (f'',cr') = _crUpdate cr cr (w & randGen .~ g)
|
||||
-- (_,g') = genWord8 g
|
||||
|
||||
ppEvents :: World -> World
|
||||
ppEvents w = IM.foldl' (flip $ \pp -> doPressPlateEvent (_ppEvent pp) pp) w $ w ^. cWorld . lWorld . pressPlates
|
||||
|
||||
updateSeenWalls :: World -> World
|
||||
updateSeenWalls w = alaf Endo foldMap (markWallSeen . _wlID . snd) (allVisibleWalls w) w
|
||||
--updateSeenWalls :: World -> World
|
||||
--updateSeenWalls w = alaf Endo foldMap (markWallSeen . _wlID . snd) (allVisibleWalls w) w
|
||||
|
||||
--updateSeenWalls w = foldl' markWallSeen w (map (_wlID . snd) $ allVisibleWalls w)
|
||||
|
||||
markWallSeen :: Int -> World -> World
|
||||
markWallSeen i = cWorld . seenWalls . at i ?~ ()
|
||||
--markWallSeen :: Int -> World -> World
|
||||
--markWallSeen i = cWorld . seenWalls . at i ?~ ()
|
||||
|
||||
--markWallSeen :: World -> Int -> World
|
||||
--markWallSeen w i = w & cWorld . seenWalls . at i ?~ ()
|
||||
@@ -685,9 +652,7 @@ markWallSeen i = cWorld . seenWalls . at i ?~ ()
|
||||
|
||||
checkEndGame :: Universe -> Universe
|
||||
checkEndGame uv = case w ^? timeFlow . deathDelay of
|
||||
Just x
|
||||
| x < 0 ->
|
||||
uv & uvScreenLayers .~ [gameOverMenu uv]
|
||||
Just x | x < 0 -> uv & uvScreenLayers .~ [gameOverMenu uv]
|
||||
Just _ -> uv & uvWorld . timeFlow . deathDelay -~ 1
|
||||
_ | _crHP (you w) < 1 -> uv & uvWorld . timeFlow .~ DeathTime 50
|
||||
_ -> uv
|
||||
|
||||
Reference in New Issue
Block a user