Get rid of warnings

This commit is contained in:
2025-06-07 19:14:56 +01:00
parent 81a7dcd962
commit faa3c4cde4
12 changed files with 85 additions and 96 deletions
+52 -51
View File
@@ -24,20 +24,20 @@ damageWallEffect dm wl = (,dm) . case _wlMaterial wl of
stoneWallDamage :: Damage -> Wall -> World -> World
stoneWallDamage dm wl = case dm of
Piercing d p t -> a d $ makeSpark NormalSpark (outTo p t)
Piercing _ p t -> makeSpark NormalSpark (outTo p t)
(reflDirWall p (p+t) wl) . wlDustAt wl (outTo p t)
Lasering d p t -> a 0 $ makeSpark FireSpark (outTo p t) (reflDirWall p (p+t) wl)
Blunt d p t -> a d $ wlDustAt wl (outTo p t)
Shattering d p t -> a d $ muchWlDustAt wl (outTo p t)
Crushing d _ -> a d id
Explosive d _ -> a d id
Sparking {} -> a 0 id
Flaming {} -> a 0 id
Electrical {} -> a 0 id
Poison {} -> a 0 id
Enterrement {} -> a 0 id
Lasering _ p t -> makeSpark FireSpark (outTo p t) (reflDirWall p (p+t) wl)
Blunt _ p t -> wlDustAt wl (outTo p t)
Shattering _ p t -> muchWlDustAt wl (outTo p t)
Crushing {} -> id
Explosive {} -> id
Sparking {} -> id
Flaming {} -> id
Electrical {} -> id
Poison {} -> id
Enterrement {} -> id
Flashing {} -> id
where
a x f w = (f w)
outTo x y = x -.- squashNormalizeV y
-- d = _dmAmount dm
-- sp = _dmFrom dm
@@ -47,25 +47,24 @@ stoneWallDamage dm wl = case dm of
glassWallDamage :: Damage -> Wall -> World -> World
glassWallDamage dm wl w =
w & case dm of
Lasering d p t -> a 0 $ makeSpark FireSpark (outTo p t) (reflDirWall p (p+t) wl)
Piercing d p t -> a d $ dosplint . makeSpark NormalSpark (outTo p t) (reflDirWall p (p+t) wl) . wlDustAt wl (outTo p t)
Blunt d p t -> a d $ dosplint . wlDustAt wl (outTo p t)
Shattering d p t -> a d $ dosplint . muchWlDustAt wl (outTo p t)
Crushing {} -> a d dosplint
Explosive {} -> a d dosplint
Sparking {} -> a 0 id
Flaming {} -> a 0 id
Electrical {} -> a 0 id
Poison {} -> a 0 id
Enterrement {} -> a 0 id
Lasering _ p t -> makeSpark FireSpark (outTo p t) (reflDirWall p (p+t) wl)
Piercing _ p t -> dosplint . makeSpark NormalSpark (outTo p t) (reflDirWall p (p+t) wl) . wlDustAt wl (outTo p t)
Blunt _ p t -> dosplint . wlDustAt wl (outTo p t)
Shattering _ p t -> dosplint . muchWlDustAt wl (outTo p t)
Crushing {} -> dosplint
Explosive {} -> dosplint
Sparking {} -> id
Flaming {} -> id
Electrical {} -> id
Poison {} -> id
Enterrement {} -> id
Flashing {} -> id
where
mbl = do
blid <- wl ^? wlStructure . wsBlock
w ^? cWorld . lWorld . blocks . ix blid
d :: Int
d = max 1 $ maybe 1 (subtract 1 . _blHP) mbl
a :: Int -> (World -> World) -> World -> (World)
a x f w' = (f w')
-- d :: Int
-- d = max 1 $ maybe 1 (subtract 1 . _blHP) mbl
dosplint = maybe id splinterBlock mbl
-- sp = _dmFrom dm
-- p = _dmAt dm
@@ -74,19 +73,20 @@ glassWallDamage dm wl w =
crystalWallDamage :: Damage -> Wall -> World -> World
crystalWallDamage dm wl = case dm of
Lasering d p t -> a 0 $ makeSpark FireSpark (outTo p t) (reflDirWall p (p+t) wl)
Piercing d p t -> a 0 $ makeSpark NormalSpark (outTo p t) (reflDirWall p (p+t) wl) . wlDustAt wl (outTo p t)
Blunt d p t -> a 0 $ wlDustAt wl (outTo p t)
Shattering d p t -> a d $ muchWlDustAt wl (outTo p t)
Crushing {} -> a 0 id
Explosive {} -> a 0 id
Sparking {} -> a 0 id
Flaming {} -> a 0 id
Electrical {} -> a 0 id
Poison {} -> a 0 id
Enterrement {} -> a 0 id
Lasering _ p t -> makeSpark FireSpark (outTo p t) (reflDirWall p (p+t) wl)
Piercing _ p t -> makeSpark NormalSpark (outTo p t) (reflDirWall p (p+t) wl) . wlDustAt wl (outTo p t)
Blunt _ p t -> wlDustAt wl (outTo p t)
Shattering _ p t -> muchWlDustAt wl (outTo p t)
Crushing {} -> id
Explosive {} -> id
Sparking {} -> id
Flaming {} -> id
Electrical {} -> id
Poison {} -> id
Enterrement {} -> id
Flashing {} -> id
where
a x f w = (f w)
-- a x f w = (f w)
--d = _dmAmount dm
--sp = _dmFrom dm
--p = _dmAt dm
@@ -95,19 +95,20 @@ crystalWallDamage dm wl = case dm of
dirtWallDamage :: Damage -> Wall -> World -> World
dirtWallDamage dm wl = case dm of
Lasering d p t -> a d $ wlDustAt wl (outTo p t)
Piercing d p t -> a d $ wlDustAt wl (outTo p t)
Blunt d p t -> a d $ wlDustAt wl (outTo p t)
Shattering d p t -> a d $ muchWlDustAt wl (outTo p t)
Crushing d _ -> a d id
Explosive d _ -> a d id
Sparking {} -> a 0 id
Flaming {} -> a 0 id
Electrical {} -> a 0 id
Poison {} -> a 0 id
Enterrement {} -> a 0 id
Lasering _ p t -> wlDustAt wl (outTo p t)
Piercing _ p t -> wlDustAt wl (outTo p t)
Blunt _ p t -> wlDustAt wl (outTo p t)
Shattering _ p t -> muchWlDustAt wl (outTo p t)
Crushing _ _ -> id
Explosive _ _ -> id
Sparking {} -> id
Flaming {} -> id
Electrical {} -> id
Poison {} -> id
Enterrement {} -> id
Flashing {} -> id
where
a x f w = (f w)
--a x f w = (f w)
--d = _dmAmount dm
--sp = _dmFrom dm
--p = _dmAt dm