Add objects based on walls, called machines
This commit is contained in:
@@ -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 _ [] = []
|
||||
|
||||
Reference in New Issue
Block a user