Add more debug info for selected creatures

This commit is contained in:
2023-04-30 13:55:54 +01:00
parent 5b1212e4f6
commit 08e71e5451
17 changed files with 116 additions and 50 deletions
-3
View File
@@ -11,6 +11,3 @@ chainCreatureUpdates ::
chainCreatureUpdates ls w cr = foldl' unf cr ls
where
unf cr' g = g w cr'
--chainCreatureUpdates ls w cr = foldr unf cr ls
-- where
-- unf g cr' = g w cr'
+2 -2
View File
@@ -45,7 +45,7 @@ translatePointToRightHand' cr
f i = negate 2 + negate 6 * fromIntegral (sLen - i) / fromIntegral sLen
translateToRightHand :: Creature -> SPic -> SPic
translateToRightHand cr = translateToRightHand' cr -- . mirrorSPxz
translateToRightHand = translateToRightHand' -- . mirrorSPxz
translateToRightHand' :: Creature -> SPic -> SPic
translateToRightHand' cr
@@ -61,7 +61,7 @@ translateToRightHand' cr
f i = negate 2 + negate 6 * fromIntegral (sLen - i) / fromIntegral sLen
translateToRightWrist :: Creature -> SPic -> SPic
translateToRightWrist cr = translateToRightWrist' cr -- . mirrorSPxz
translateToRightWrist = translateToRightWrist' -- . mirrorSPxz
translateToRightWrist' :: Creature -> SPic -> SPic
translateToRightWrist' cr
+2 -3
View File
@@ -197,8 +197,8 @@ targetYouWhenCognizant w cr = case cr ^? crPerception . cpAwareness . ix 0 of
searchIfDamaged :: Creature -> Creature
searchIfDamaged cr
| _crPastDamage cr > 0 = case _apStrategy (_crActionPlan cr) of
WatchAndWait ->
| _crPastDamage cr > 0 &&
_apStrategy (_crActionPlan cr) == WatchAndWait =
cr & crPerception . cpVigilance .~ Vigilant
& crActionPlan . apStrategy
.~ StrategyActions
@@ -206,7 +206,6 @@ searchIfDamaged cr
[ TurnToPoint (_crPos cr -.- unitVectorAtAngle (_crDir cr))
`DoActionThen` 40 `WaitThen` bfsThenReturn 500
]
_ -> cr
| otherwise = cr
bfsThenReturn :: Int -> Action
+1 -1
View File
@@ -12,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 .~ Just (w ^?! cWorld . lWorld . creatures . ix 0)
Just (Cognizant _) -> cr & crIntention . targetCr ?~ (w ^?! cWorld . lWorld . creatures . ix 0)
_ -> cr & crIntention . targetCr .~ Nothing