Implement basic attention and awareness
This commit is contained in:
@@ -7,6 +7,7 @@ module Dodge.Creature.Picture
|
||||
) where
|
||||
import Dodge.Data
|
||||
import Dodge.Creature.State.Data
|
||||
import Dodge.Creature.AlertLevel.Data
|
||||
import Dodge.Picture.Layer
|
||||
import Picture
|
||||
import Geometry
|
||||
@@ -18,7 +19,11 @@ basicCrPict
|
||||
:: Color -- ^ Creature color
|
||||
-> Creature
|
||||
-> Picture
|
||||
basicCrPict col cr = pictures [ onLayer CrLayer . piercingMod $ bluntScale naked , drawEquipment cr]
|
||||
basicCrPict col cr = pictures
|
||||
[ onLayer CrLayer . piercingMod $ bluntScale naked
|
||||
, drawAwakeLevel cr
|
||||
, drawEquipment cr
|
||||
]
|
||||
where
|
||||
cdir = _crDir cr
|
||||
naked
|
||||
@@ -46,6 +51,15 @@ basicCrPict col cr = pictures [ onLayer CrLayer . piercingMod $ bluntScale naked
|
||||
Nothing -> False
|
||||
Just x -> x > 5
|
||||
|
||||
drawAwakeLevel
|
||||
:: Creature
|
||||
-> Picture
|
||||
drawAwakeLevel cr = case cr ^? crAttentionDir of
|
||||
Just (AttentiveTo [0]) -> setPos . color red $ circleSolid 5
|
||||
_ -> setPos . color blue $ circleSolid 5
|
||||
where
|
||||
setPos = translate 0 (_crRad cr)
|
||||
|
||||
drawEquipment
|
||||
:: Creature
|
||||
-> Picture
|
||||
|
||||
Reference in New Issue
Block a user