Tweak creature awareness
This commit is contained in:
@@ -147,8 +147,8 @@ awakeLevelPerception :: Creature -> Float
|
|||||||
awakeLevelPerception cr = case _crAwakeLevel $ _crPerception cr of
|
awakeLevelPerception cr = case _crAwakeLevel $ _crPerception cr of
|
||||||
Comatose -> 0
|
Comatose -> 0
|
||||||
Asleep -> 10
|
Asleep -> 10
|
||||||
Lethargic -> 100
|
Lethargic -> 200
|
||||||
Vigilant -> 1000
|
Vigilant -> 500
|
||||||
Overstrung -> 10000
|
Overstrung -> 10000
|
||||||
|
|
||||||
newSounds :: World -> [(Point2,Float)]
|
newSounds :: World -> [(Point2,Float)]
|
||||||
@@ -166,7 +166,6 @@ rememberSounds w cr = cr
|
|||||||
awakeupdate | null closesounds = id
|
awakeupdate | null closesounds = id
|
||||||
| otherwise = crPerception . crAwakeLevel .~ Vigilant
|
| otherwise = crPerception . crAwakeLevel .~ Vigilant
|
||||||
closesounds = map fst (filter (soundIsClose cr) (newSounds w))
|
closesounds = map fst (filter (soundIsClose cr) (newSounds w))
|
||||||
|
|
||||||
|
|
||||||
soundIsClose :: Creature -> (Point2,Float) -> Bool
|
soundIsClose :: Creature -> (Point2,Float) -> Bool
|
||||||
soundIsClose cr (pos,vol) = vol > (_auDist . _crAudition $ _crPerception cr) (dist pos (_crPos cr))
|
soundIsClose cr (pos,vol) = vol > (_auDist . _crAudition $ _crPerception cr) (dist pos (_crPos cr))
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ viewTarget w cr = do
|
|||||||
& crActionPlan . crAction %~ replaceNullWith (TurnToA p)
|
& crActionPlan . crAction %~ replaceNullWith (TurnToA p)
|
||||||
& crIntention . viewPoint .~ Nothing
|
& crIntention . viewPoint .~ Nothing
|
||||||
| otherwise -> cr' & crActionPlan . crAction %~ replaceNullWith (PathTo p)
|
| otherwise -> cr' & crActionPlan . crAction %~ replaceNullWith (PathTo p)
|
||||||
Nothing -> cr & crPerception . crAwakeLevel .~ Lethargic
|
Nothing -> cr-- & crPerception . crAwakeLevel .~ Lethargic
|
||||||
where
|
where
|
||||||
cr' = cr & crPerception . crAwakeLevel .~ Vigilant
|
cr' = cr & crPerception . crAwakeLevel .~ Vigilant
|
||||||
|
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ defaultIntention = Intention
|
|||||||
}
|
}
|
||||||
defaultChaseMvType :: CrMvType
|
defaultChaseMvType :: CrMvType
|
||||||
defaultChaseMvType = CrMvType
|
defaultChaseMvType = CrMvType
|
||||||
{ _mvSpeed = 3
|
{ _mvSpeed = 2
|
||||||
, _mvTurnRad = f
|
, _mvTurnRad = f
|
||||||
, _mvTurnJit = 0.2
|
, _mvTurnJit = 0.2
|
||||||
, _mvAimSpeed = g
|
, _mvAimSpeed = g
|
||||||
@@ -128,7 +128,7 @@ defaultAimingCrit :: Creature
|
|||||||
defaultAimingCrit = defaultCreature { _crMvType = defaultAimMvType }
|
defaultAimingCrit = defaultCreature { _crMvType = defaultAimMvType }
|
||||||
|
|
||||||
yourDefaultSpeed :: Float
|
yourDefaultSpeed :: Float
|
||||||
yourDefaultSpeed = 4
|
yourDefaultSpeed = 3
|
||||||
|
|
||||||
yourDefaultStrideLength :: Int
|
yourDefaultStrideLength :: Int
|
||||||
yourDefaultStrideLength = 40
|
yourDefaultStrideLength = 40
|
||||||
|
|||||||
Reference in New Issue
Block a user