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 -2
View File
@@ -92,8 +92,8 @@ performTurnToA cr p
dirv = p -.- cpos
jit = _mvTurnJit $ _crMvType cr
{- | Performing an action means that a creature has some impulses for a frame, and
updates or deletes the action itself.
{- | Performing an action on a frame creates an OutAction:
adds impulses and updates or deletes the action itself.
-}
performAction :: Creature -> World -> Action -> OutAction
performAction cr w ac = case ac of
+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
+1
View File
@@ -24,6 +24,7 @@ module Dodge.Creature.Test (
crSafeDistFromTarg,
) where
--import MaybeHelp
import Control.Lens
import Data.List (find)
import Data.Maybe