Work on debugging
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -24,6 +24,7 @@ module Dodge.Creature.Test (
|
||||
crSafeDistFromTarg,
|
||||
) where
|
||||
|
||||
--import MaybeHelp
|
||||
import Control.Lens
|
||||
import Data.List (find)
|
||||
import Data.Maybe
|
||||
|
||||
Reference in New Issue
Block a user