Implement basic attention and awareness

This commit is contained in:
jgk
2021-05-08 17:34:25 +02:00
parent 1aa59cc205
commit 86faf9fd01
12 changed files with 243 additions and 135 deletions
+22 -18
View File
@@ -19,6 +19,7 @@ import Dodge.Creature.Data
import Dodge.Creature.State.Data
import Dodge.Creature.Stance.Data
import Dodge.Creature.Rationality.Data
import Dodge.Creature.AlertLevel.Data
import Dodge.Data.Menu
import Dodge.Data.SoundOrigin
import Dodge.Data.DamageType
@@ -129,29 +130,32 @@ data TempLightSource = TLS
, _tlsUpdate :: World -> TempLightSource -> (World, Maybe TempLightSource)
}
data Creature = Creature
{ _crPos :: Point2
, _crOldPos :: Point2
, _crVel :: Point2
, _crDir :: Float
, _crID :: Int
, _crPict :: Creature -> Picture
{ _crPos :: Point2
, _crOldPos :: Point2
, _crVel :: Point2
, _crDir :: Float
, _crID :: Int
, _crPict :: Creature -> Picture
, _crUpdate
:: World
-> (World -> World,StdGen)
-> Creature
-> ((World -> World,StdGen), Maybe Creature)
, _crRad :: Float
, _crMass :: Float
, _crHP :: Int
, _crMaxHP :: Int
, _crInv :: IM.IntMap Item
, _crInvSel :: Int
, _crState :: CreatureState
, _crCorpse :: Picture
, _crApplyDamage :: [DamageType] -> Creature -> (World -> World,Creature)
, _crStance :: Stance
, _crRationality :: Rationality
, _crMeleeCooldown :: Maybe Int
, _crRad :: Float
, _crMass :: Float
, _crHP :: Int
, _crMaxHP :: Int
, _crInv :: IM.IntMap Item
, _crInvSel :: Int
, _crState :: CreatureState
, _crCorpse :: Picture
, _crApplyDamage :: [DamageType] -> Creature -> (World -> World,Creature)
, _crStance :: Stance
, _crRationality :: Rationality
, _crMeleeCooldown :: Maybe Int
, _crAwakeLevel :: AwakeLevel
, _crAttentionDir :: AttentionDir
, _crAwarenessLevel :: IM.IntMap AwarenessLevel
}
data WorldState
= DoorNumOpen Int