Zone creatures

This commit is contained in:
2022-06-28 11:20:20 +01:00
parent f0a1e0685a
commit 61ad58c04a
10 changed files with 75 additions and 106 deletions
+1 -1
View File
@@ -70,7 +70,7 @@ mvShockwave is w pt
w'
id
hitBlocks
hitBlocks = S.map snd . overlapCircWalls p rad $ wallsAlongCirc' p rad w
hitBlocks = S.map snd . overlapCircWalls p rad $ wallsInsideCirc p rad w
-- this is not expansive enough
damCr cr
| _crID cr `elem` is || dist (_crPos cr) p >= rad + _crRad cr = cr
+2 -2
View File
@@ -35,8 +35,8 @@ crsHit sp ep
| otherwise = sortStreamOn (dist sp . fst)
. S.mapMaybe
(\cr -> (, cr) <$> listToMaybe (intersectCircSeg (_crPos cr) (_crRad cr) sp ep))
. S.each
. _creatures
-- . S.each . _creatures
. crsNearSeg sp ep
thingHit :: Point2 -> Point2 -> World -> Maybe (Point2, Either Creature Wall)
thingHit sp ep = runIdentity . S.head_ . thingsHit sp ep