Work on debugging

This commit is contained in:
2023-04-27 11:35:48 +01:00
parent 35990c53bf
commit 9972e0fdea
17 changed files with 39 additions and 28 deletions
+2 -1
View File
@@ -3,6 +3,7 @@ module Dodge.Creature.SetTarget where
import Control.Lens
import Dodge.Data.World
--import MaybeHelp
-- | Assumes that you are id 0: if creature is cognizant of you, sets you as target
targetYouWhenCognizant ::
@@ -11,5 +12,5 @@ targetYouWhenCognizant ::
Creature
targetYouWhenCognizant w cr = case cr ^? crPerception . cpAwareness . ix 0 of
--Just (Cognizant _) -> cr & crIntention . targetCr ?~ _creatures (_cWorld w) IM.! 0
Just (Cognizant _) -> cr & crIntention . targetCr ?~ (w ^?! cWorld . lWorld . creatures . ix 0)
Just (Cognizant _) -> cr & crIntention . targetCr .~ Just (w ^?! cWorld . lWorld . creatures . ix 0)
_ -> cr & crIntention . targetCr .~ Nothing