More streaming refactoring
This commit is contained in:
@@ -91,5 +91,6 @@ makeExplosionAt p w = w
|
||||
newFs = zipWith5 mF fPs zs (fmap (3 *.*) fVs') sizes times
|
||||
addFlames w' = foldl' (flip ($)) w' newFs
|
||||
--pushAgainstWalls q = maybe q (uncurry (+.+)) $ reflectPointWalls p q wls
|
||||
pushAgainstWalls q = maybe q fst $ reflectPointWalls p q wls
|
||||
wls = wallsNearPoint p w
|
||||
--pushAgainstWalls q = maybe q fst $ reflectPointWalls p q wls
|
||||
pushAgainstWalls q = maybe q fst $ reflectPointWallsDamp (const True) 1 p q w
|
||||
-- wls = wallsNearPoint p w
|
||||
|
||||
@@ -12,6 +12,7 @@ import Geometry
|
||||
import Picture
|
||||
import LensHelp
|
||||
|
||||
import Data.Foldable
|
||||
import qualified Data.IntMap.Strict as IM
|
||||
-- currently very effective against walls
|
||||
makeShockwaveAt
|
||||
@@ -62,9 +63,9 @@ mvShockwave is w pt
|
||||
tFraction = fromIntegral t / fromIntegral (_ptMaxTime pt)
|
||||
rad = r - (3/4) * r * tFraction
|
||||
doDams = over creatures (IM.map damCr)
|
||||
. flip (IM.foldl' (flip $ damageWall (Damage EXPLOSIVE 10000 p p p NoDamageEffect)))
|
||||
. flip (foldl' (flip $ damageWall (Damage EXPLOSIVE 10000 p p p NoDamageEffect)))
|
||||
hitBlocks
|
||||
hitBlocks = wallsOnCirc p rad $ wallsNearPoint p w
|
||||
hitBlocks = wallsOnCirc' p rad $ wallsNearPoint' p w
|
||||
damCr cr
|
||||
| _crID cr `elem` is || dist (_crPos cr) p >= rad + _crRad cr = cr
|
||||
| otherwise = cr & crState . csDamage .:~
|
||||
@@ -104,7 +105,7 @@ moveInverseShockwave w pt
|
||||
t = _ptTimer pt
|
||||
rad = r - 0.1 * r * fromIntegral (10 - t)
|
||||
dams = over creatures (IM.map damCr) . flip (foldr (damageBlocksBy 1)) hitBlocks
|
||||
hitBlocks = wallsOnCirc p rad $ wallsNearPoint p w
|
||||
hitBlocks = wallsOnCirc' p rad $ wallsNearPoint' p w
|
||||
damCr cr
|
||||
| dist (_crPos cr) p >= rad + _crRad cr = cr
|
||||
| otherwise = cr & crState . csDamage .:~
|
||||
|
||||
@@ -206,7 +206,7 @@ damageInArea crt wlt pt w = damwls damcrs
|
||||
where
|
||||
p = _ptPos pt
|
||||
damcrs = foldl' (flip $ \cr -> fst . hiteff [(p,Left cr)]) w $ IM.filter crt $ _creatures w
|
||||
damwls w' = foldl' (flip $ \wl -> fst . hiteff [(p,Right wl)]) w' $ IM.filter wlt $ wallsNearPoint p w
|
||||
damwls w' = foldl' (flip $ \wl -> fst . hiteff [(p,Right wl)]) w' $ filter wlt $ wallsNearPoint' p w
|
||||
hiteff = _ptHitEff pt pt
|
||||
|
||||
-- | At writing the radius is half the size of the effect area
|
||||
|
||||
Reference in New Issue
Block a user