Split off StreamingHelp module
This commit is contained in:
@@ -20,13 +20,14 @@ import Dodge.Creature.Volition
|
||||
import Dodge.Base
|
||||
import Dodge.Zone
|
||||
import Geometry
|
||||
import FoldableHelp
|
||||
|
||||
import qualified Data.IntMap.Strict as IM
|
||||
import Control.Lens
|
||||
import Control.Applicative
|
||||
import Data.Maybe
|
||||
import Data.Bifunctor
|
||||
--import StreamingHelp
|
||||
import qualified Streaming.Prelude as S
|
||||
|
||||
overrideMeleeCloseTarget :: Creature -> Creature
|
||||
overrideMeleeCloseTarget cr = maybe cr (tryMeleeAttack cr) (_targetCr $ _crIntention cr)
|
||||
@@ -76,8 +77,7 @@ flockACC w cr = case cr ^? crIntention . targetCr . _Just of
|
||||
isFarACC cr' = _crGroup cr' == _crGroup cr
|
||||
&& _crID cr' /= _crID cr
|
||||
&& dist (_crPos cr') tpos > dist cpos tpos
|
||||
nearACCs = IM.filter isFarACC $ creaturesNearPointI 5 cpos w
|
||||
macr = safeMinimumOn (dist cpos . _crPos) nearACCs
|
||||
macr = minStreamOn (dist cpos . _crPos) . S.filter isFarACC $ crsInsideCirc cpos 50 w
|
||||
in case macr of
|
||||
Nothing -> cr
|
||||
Just acr ->
|
||||
|
||||
Reference in New Issue
Block a user