Refactor creature zoning

This commit is contained in:
2022-07-22 17:53:08 +01:00
parent 43e7d20b21
commit 39f4555697
17 changed files with 209 additions and 85 deletions
+5 -3
View File
@@ -18,6 +18,8 @@ module Dodge.Item.Weapon.ExtraEffect
, targetCursorUpdate
-- , rbSetTarget
) where
import Dodge.Zoning.Creature
import FoldableHelp
import Dodge.Data
import Dodge.Base
import Dodge.Zone
@@ -93,9 +95,9 @@ targetRBCreatureUp it cr w t
& tgActive .~ False
)
where
newtarg = minStreamOn (dist mwp . _crPos)
. S.filter (canseepos . _crPos)
$ crsInsideCirc mwp 40 w
newtarg = safeMinimumOn (dist mwp . _crPos)
. filter (canseepos . _crPos)
$ crsNearCirc mwp 40 w
canseepos p = hasLOS (_crPos cr) p w
mwp = mouseWorldPos w
updatePos t' = t' & tgPos .~ posFromMaybeID (_tgID t')