Refactor crPos to be a V3

This commit is contained in:
2025-10-10 13:47:31 +01:00
parent 98ece551c7
commit 49fb982877
58 changed files with 375 additions and 307 deletions
+3 -2
View File
@@ -3,16 +3,17 @@ module Dodge.Creature.ChooseTarget where
import Control.Lens
import Dodge.Base
import Dodge.Data.World
import Linear
targetYouLOS :: Creature -> World -> Maybe Creature
{-# INLINE targetYouLOS #-}
targetYouLOS cr w
| hasLOS (_crPos cr) (_crPos $ you w) w = Just $ you w
| hasLOS (cr ^. crPos . _xy) ( you w ^. crPos . _xy) w = Just $ you w
| otherwise = Nothing
targetYouCognizant :: Creature -> World -> Maybe Creature
targetYouCognizant cr w
| hasLOS (_crPos cr) (_crPos $ you w) w
| hasLOS (cr ^. crPos . _xy) (you w ^. crPos . _xy) w
&& isCog (cr ^? crPerception . cpAwareness . ix 0) =
Just $ you w
| otherwise = Nothing