Add objects based on walls, called machines

This commit is contained in:
2021-10-31 22:55:02 +00:00
parent 08fa84c1fd
commit 86fdfd260e
23 changed files with 183 additions and 90 deletions
+3 -3
View File
@@ -6,9 +6,9 @@ import Dodge.Data
import Control.Lens
damageBlocksBy :: Int -> Wall -> World -> World
damageBlocksBy x wl = case _wlBlockID wl of
Just' blid -> blocks . ix blid . blHPs %~ reduceHeadBy x
Nothing' -> id
damageBlocksBy x wl = case wl ^? wlStructure . wlStBlock of
Just blid -> blocks . ix blid . blHPs %~ reduceHeadBy x
Nothing -> id
where
reduceHeadBy y (z:zs) = z - y : zs
reduceHeadBy _ [] = []