Refactor ai
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
{- |
|
||||
Deals with setting a target for creatures
|
||||
-}
|
||||
module Dodge.Creature.SetTarget
|
||||
where
|
||||
import Dodge.Data
|
||||
import Dodge.Creature.AlertLevel.Data
|
||||
|
||||
import Control.Lens
|
||||
targetYouWhenCognizant
|
||||
:: World
|
||||
-> Creature
|
||||
-> Creature
|
||||
targetYouWhenCognizant w cr = case cr ^? crAwarenessLevel . ix 0 of
|
||||
Just (Cognizant _) -> cr & crTarget .~ Just 0
|
||||
_ -> cr & crTarget .~ Nothing
|
||||
Reference in New Issue
Block a user