Get rid of warnings
This commit is contained in:
@@ -118,6 +118,7 @@ useBulletPayload bu = case _buPayload bu of
|
||||
BulBall ExplosiveBall -> \p -> cWorld . lWorld . shockwaves .:~ concBall p
|
||||
BulBall ElectricalBall -> makeStaticBall
|
||||
BulBall FlashBall -> makeFlashBall
|
||||
BulBall (FlameletBall x) -> \p -> makeFlamelet p 0 x 10
|
||||
|
||||
makeFragBullets :: Point2 -> World -> World
|
||||
makeFragBullets p w = w & cWorld . lWorld . bullets .++~ bus
|
||||
|
||||
@@ -36,7 +36,7 @@ data BulletEffect
|
||||
|
||||
data BulletPayload
|
||||
= BulBall {_spawnEBT :: EnergyBallType}
|
||||
| BulPlain {_sparkDam :: Int}
|
||||
| BulPlain {_buDam :: Int}
|
||||
| BulFlak
|
||||
| BulFrag
|
||||
| BulGas
|
||||
|
||||
@@ -8,7 +8,6 @@ module Dodge.Data.EnergyBall (
|
||||
module Dodge.Data.EnergyBall.Type,
|
||||
) where
|
||||
|
||||
import Color
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
@@ -17,10 +16,8 @@ import Geometry.Data
|
||||
|
||||
data EnergyBall = EnergyBall
|
||||
{ _ebVel :: Point2
|
||||
, -- , _ebColor :: Color
|
||||
_ebPos :: Point2
|
||||
, -- , _ebWidth :: Float
|
||||
_ebTimer :: Int
|
||||
, _ebPos :: Point2
|
||||
, _ebTimer :: Int
|
||||
, _ebEff :: EnergyBallType
|
||||
, _ebRot :: Float
|
||||
}
|
||||
|
||||
@@ -5,10 +5,8 @@
|
||||
|
||||
module Dodge.Data.EnergyBall.Type where
|
||||
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
import Geometry.Data
|
||||
|
||||
data EnergyBallType
|
||||
= FlamingBall
|
||||
|
||||
@@ -114,7 +114,7 @@ damageCircle sp dt w =
|
||||
wlstodam = wlsHitRadial sp r w
|
||||
wldam p = ebtToDamage p dt
|
||||
addcreaturedamages crs = foldl' (damageCrCircle crdam) crs crstodam
|
||||
crdam p cr = ebtToDamage sp dt
|
||||
crdam = ebtToDamage sp dt
|
||||
crstodam = crsHitRadial sp r w
|
||||
|
||||
ebtToDamage :: Point2 -> EnergyBallType -> Damage
|
||||
@@ -132,9 +132,5 @@ damageWlCircle ::
|
||||
IM.IntMap [Damage]
|
||||
damageWlCircle f wldams (p, wl) = IM.insertWith (++) (_wlID wl) [f p] wldams
|
||||
|
||||
damageCrCircle ::
|
||||
(Point2 -> Creature -> Damage) ->
|
||||
IM.IntMap Creature ->
|
||||
(Point2, Creature) ->
|
||||
IM.IntMap Creature
|
||||
damageCrCircle crdam crs (p, cr) = crs & ix (_crID cr) . crState . csDamage .:~ crdam p cr
|
||||
damageCrCircle :: Damage -> IM.IntMap Creature -> (Point2, Creature) -> IM.IntMap Creature
|
||||
damageCrCircle crdam crs (_, cr) = crs & ix (_crID cr) . crState . csDamage .:~ crdam
|
||||
|
||||
+4
-4
@@ -45,14 +45,14 @@ expireAndDamageFL ::
|
||||
(World, Maybe Flame)
|
||||
expireAndDamageFL bt things w = case List.safeHead things of
|
||||
Nothing -> (w, Just $ bt & flTimer -~ 1)
|
||||
Just x -> (doDamagesFL x bt w, Nothing)
|
||||
Just (_,x) -> (doDamagesFL x w, Nothing)
|
||||
|
||||
doDamagesFL ::
|
||||
(Point2, Either Creature Wall) ->
|
||||
Flame ->
|
||||
Either Creature Wall ->
|
||||
-- Flame ->
|
||||
World ->
|
||||
World
|
||||
doDamagesFL (p, thhit) bt = case thhit of
|
||||
doDamagesFL thhit = case thhit of
|
||||
Left cr ->
|
||||
cWorld . lWorld . creatures . ix (_crID cr) . crState . csDamage
|
||||
.:~ Flaming 1
|
||||
|
||||
@@ -16,7 +16,7 @@ updateLaser w pt =
|
||||
( case _lpType pt of
|
||||
DamageLaser dam ->
|
||||
damThingHitWith
|
||||
(\p1 p2 p3 -> Lasering dam p2 (p3 - p2))
|
||||
(\p1 p2 p3 -> Lasering dam p2 (p3 - p1))
|
||||
sp
|
||||
xp
|
||||
thHit
|
||||
|
||||
@@ -19,7 +19,7 @@ defDamageMaterial dm _ w = (_dmAmount dm, w)
|
||||
|
||||
damageStone :: Damage -> Float -> World -> (Int, World)
|
||||
damageStone dm dir = case dm of
|
||||
Lasering x p t -> a 0 $ makeSpark FireSpark (outTo p t) (argV $ reflectIn t v)
|
||||
Lasering _ p t -> a 0 $ makeSpark FireSpark (outTo p t) (argV $ reflectIn t v)
|
||||
Piercing x p t -> a x $ makeSpark NormalSpark (outTo p t) (argV $ reflectIn t v)
|
||||
Blunt x p t -> a x $ makeSpark NormalSpark (outTo p t) (argV $ reflectIn t v)
|
||||
Shattering {} -> a 0 id
|
||||
@@ -30,6 +30,7 @@ damageStone dm dir = case dm of
|
||||
Electrical {} -> a 0 id
|
||||
Poison {} -> a 0 id
|
||||
Enterrement {} -> a 0 id
|
||||
Flashing {} -> a 0 id
|
||||
where
|
||||
v = unitVectorAtAngle dir
|
||||
a x f w = (x, f w)
|
||||
|
||||
@@ -40,9 +40,9 @@ moveShockwave w sw
|
||||
| otherwise =
|
||||
cr & crState . csDamage
|
||||
.:~ Explosive dam p
|
||||
where
|
||||
cpos = _crPos cr
|
||||
v = normalizeV (cpos -.- p)
|
||||
--where
|
||||
-- cpos = _crPos cr
|
||||
-- v = normalizeV (cpos -.- p)
|
||||
|
||||
moveInverseShockwave ::
|
||||
World ->
|
||||
@@ -63,6 +63,6 @@ moveInverseShockwave w sw
|
||||
| otherwise =
|
||||
cr & crState . csDamage
|
||||
.:~ Explosive 1 p
|
||||
where
|
||||
cpos = _crPos cr
|
||||
v = normalizeV (cpos -.- p)
|
||||
--where
|
||||
-- cpos = _crPos cr
|
||||
-- v = normalizeV (cpos -.- p)
|
||||
|
||||
+4
-9
@@ -22,24 +22,19 @@ updateSpark w sk
|
||||
| otherwise = case thingHit sp ep w of
|
||||
Nothing -> (w, Just $ sk & skPos .~ ep & skVel *~ 0.9 & skOldPos .~ sp)
|
||||
Just (hp, hthing) ->
|
||||
( sparkDam' sk sp ep (hp, hthing) w
|
||||
( sparkDam sk hthing w
|
||||
, Just $ sk & skPos .~ hp & skOldPos .~ sp & skVel .~ 0
|
||||
)
|
||||
where
|
||||
sp = _skPos sk
|
||||
ep = sp + _skVel sk
|
||||
|
||||
sparkDam' ::
|
||||
sparkDam ::
|
||||
Spark ->
|
||||
Point2 ->
|
||||
Point2 ->
|
||||
(Point2, Either Creature Wall) ->
|
||||
Either Creature Wall ->
|
||||
World ->
|
||||
World
|
||||
sparkDam' sk sp ep mayEiCrWl = case mayEiCrWl of
|
||||
(hitp, eicrwl) -> damageCrWl (thedam hitp) eicrwl
|
||||
where
|
||||
thedam hitp = sparkToDamage sk
|
||||
sparkDam sk x = damageCrWl (sparkToDamage sk) x
|
||||
|
||||
sparkToDamage :: Spark -> Damage
|
||||
sparkToDamage sp = case _skType sp of
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user