Cleanup warnings

This commit is contained in:
jgk
2021-05-17 22:39:18 +02:00
parent d7fcdbf550
commit 69f915a894
102 changed files with 1243 additions and 1185 deletions
+16
View File
@@ -0,0 +1,16 @@
module Dodge.WorldEvent.DamageBlock
( damageBlocksBy
)
where
import Dodge.Data
import Data.Maybe
import Control.Lens
{- | Given a wall, if it is a damageable block
- then damage it and connecting walls by a certain amount. -}
damageBlocksBy :: Int -> Wall -> World -> World
{-# INLINE damageBlocksBy #-}
damageBlocksBy x wall w
| isJust (wall ^? blHP) = foldr (\j -> walls . ix j . blHP -~ x) w (_blIDs wall)
| otherwise = w