Move toward adding multiple equipable items that are not directly usable

This commit is contained in:
2021-12-08 17:09:24 +00:00
parent 9f6e5af991
commit a9139db0a8
22 changed files with 260 additions and 137 deletions
+3 -7
View File
@@ -63,6 +63,7 @@ functionalUpdate cfig w = checkEndGame
. updateLightSources
. updateClouds
. zoneClouds
. updateMIM magnets _mgUpdate
. updateIMl _machines _mcUpdate
. updateCreatures
. updateCreatureGroups
@@ -139,10 +140,8 @@ updateInstantParticles w = case _instantParticles w of
ps -> let (w',ps') = mapAccumR (\a b -> _ptUpdate b a b) (w {_instantParticles=[]}) ps
in updateInstantParticles $ w' & particles %~ (catMaybes ps' ++)
updateMachines :: World -> World
updateMachines w = foldr f w (_machines w)
where
f mc = _mcUpdate mc mc
updateMIM :: ASetter' World (IM.IntMap a) -> (a -> a -> Maybe a) -> World -> World
updateMIM f up w = w & f %~ IM.mapMaybe (dbArg up)
-- Note that this updates the randgen
updateCreatures :: World -> World
@@ -156,9 +155,6 @@ updateCreatures w = appEndo f $ w
(f'',cr') = _crUpdate cr cr (w & randGen .~ g)
(_,g') = genWord8 g
updateDoors :: World -> World
updateDoors w = IM.foldl' (\w' dr -> _drMech dr dr w') w (_doors w)
ppEvents :: World -> World
ppEvents w = IM.foldl' (flip $ \pp -> _ppEvent pp pp) w $ _pressPlates w