Add file, fix lamp doDamage space leak
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
module Dodge.Creature.Action.Flee
|
||||
where
|
||||
import Dodge.Data
|
||||
import Geometry
|
||||
|
||||
import Data.List
|
||||
import Data.Maybe
|
||||
|
||||
retreatPointForFrom
|
||||
:: Float -> World -> Creature -> Point2 -> Maybe Point2
|
||||
retreatPointForFrom d w cr p
|
||||
= listToMaybe
|
||||
. sortOn (dist cpos)
|
||||
$ divideCircle 10 p d
|
||||
where
|
||||
cpos = _crPos cr
|
||||
-- = head $ sortBy (compare `on` (\p -> dist p ypos < 300)) $ retreatP'' : retreatPs
|
||||
-- where
|
||||
-- retreatPs = sortBy (compare `on` dist cpos) $ map f $ nRaysRad 8 400
|
||||
-- where f p = fromMaybe (ypos +.+ p) $ fmap fst
|
||||
-- $ reflectPointWalls ypos (ypos +.+ p) (wallsAlongLine ypos (ypos +.+ p) w)
|
||||
-- retreatP' = cpos +.+ 300 *.* (cpos -.- ypos)
|
||||
-- retreatP'' = fromMaybe retreatP' $ fmap fst
|
||||
-- $ reflectPointWalls ypos retreatP'
|
||||
-- $ wallsAlongLine ypos retreatP' w
|
||||
Reference in New Issue
Block a user