Tweak creature awareness
This commit is contained in:
@@ -147,8 +147,8 @@ awakeLevelPerception :: Creature -> Float
|
||||
awakeLevelPerception cr = case _crAwakeLevel $ _crPerception cr of
|
||||
Comatose -> 0
|
||||
Asleep -> 10
|
||||
Lethargic -> 100
|
||||
Vigilant -> 1000
|
||||
Lethargic -> 200
|
||||
Vigilant -> 500
|
||||
Overstrung -> 10000
|
||||
|
||||
newSounds :: World -> [(Point2,Float)]
|
||||
@@ -166,7 +166,6 @@ rememberSounds w cr = cr
|
||||
awakeupdate | null closesounds = id
|
||||
| otherwise = crPerception . crAwakeLevel .~ Vigilant
|
||||
closesounds = map fst (filter (soundIsClose cr) (newSounds w))
|
||||
|
||||
|
||||
soundIsClose :: Creature -> (Point2,Float) -> Bool
|
||||
soundIsClose cr (pos,vol) = vol > (_auDist . _crAudition $ _crPerception cr) (dist pos (_crPos cr))
|
||||
|
||||
Reference in New Issue
Block a user