Rethink damage data type, work on damage sensors
This commit is contained in:
@@ -60,13 +60,17 @@ mvShockwave is w pt
|
||||
t = _ptTimer pt
|
||||
tFraction = fromIntegral t / fromIntegral (_ptMaxTime pt)
|
||||
rad = r - (3/4) * r * tFraction
|
||||
doDams = over creatures (IM.map damCr) . flip (IM.foldl' (flip $ damageWall (Explosive 10000 p)))
|
||||
doDams = over creatures (IM.map damCr)
|
||||
. flip (IM.foldl' (flip $ damageWall (Damage Explosive 10000 p p p NoDamageEffect)))
|
||||
hitBlocks
|
||||
hitBlocks = wallsOnCirc p rad $ wallsNearPoint p w
|
||||
damCr cr
|
||||
| _crID cr `elem` is || dist (_crPos cr) p >= rad + _crRad cr = cr
|
||||
| otherwise = cr & crState . crDamage .:~
|
||||
PushDam dam (25 * push *.* squashNormalizeV (_crPos cr -.- p))
|
||||
Damage PushDam dam cpos cpos cpos
|
||||
(PushBackDamage (25 * push *.* squashNormalizeV (_crPos cr -.- p)))
|
||||
where
|
||||
cpos = _crPos cr
|
||||
{- Create a shockwave going from an outside circle into a center point. -}
|
||||
inverseShockwaveAt
|
||||
:: Point2 -- Center position
|
||||
@@ -103,7 +107,9 @@ moveInverseShockwave w pt
|
||||
damCr cr
|
||||
| dist (_crPos cr) p >= rad + _crRad cr = cr
|
||||
| otherwise = cr & crState . crDamage .:~
|
||||
PushDam 1 (25 *.* squashNormalizeV (p -.- _crPos cr))
|
||||
Damage PushDam 1 cpos cpos cpos (PushBackDamage $ 25 *.* squashNormalizeV (p -.- cpos))
|
||||
where
|
||||
cpos = _crPos cr
|
||||
|
||||
drawInverseShockwave :: Particle -> Picture
|
||||
drawInverseShockwave pt
|
||||
|
||||
Reference in New Issue
Block a user