Zoning/streaming refactor

This commit is contained in:
2022-06-26 00:26:53 +01:00
parent 3c7ea4d73b
commit e2d09d57e9
11 changed files with 67 additions and 55 deletions
+2 -2
View File
@@ -96,7 +96,7 @@ moveFlame rotd w pt
, _ptCrIgnore = Nothing
, _ptVel = speed *.* vel }
dodamage = damageInArea closeCrs closeWls pt
closeWls wl = uncurry circOnSeg (_wlLine wl) ep 5
closeWls wl = uncurry segOnCirc (_wlLine wl) ep 5
closeCrs cr = dist ep (_crPos cr)
< _crRad cr + 10 - min 9 (max 0 (fromIntegral time - 80))
+ 5 * angleCoeff (angleVV (ep -.- _crPos cr) rotd)
@@ -197,7 +197,7 @@ damageInRadius :: Float -> Particle -> World -> World
damageInRadius size pt = damageInArea isClose closeWls pt
where
p = _ptPos pt
closeWls wl = uncurry circOnSeg (_wlLine wl) p size
closeWls wl = uncurry segOnCirc (_wlLine wl) p size
isClose cr = dist p (_crPos cr) < _crRad cr + size
damageInArea :: (Creature -> Bool) -> (Wall -> Bool) -> Particle -> World -> World