feat(xanthous): Gormlaks yell in gormlak when they see the character

Add a new "greetedCharacter" field to the creature hippocampus type,
which tracks whether or not that creature has greeted the character
yet. In the gormlak AI, when the gormlak sees the character and starts
running towards them, if that field is set to False send a message that
says that the gormlak yells a single randomly-generated gormlak word at
the character, then set the field to true

The gormlak yells "gukblom"!

Change-Id: I17a388393693a322c2e09390884ed718911b2fc4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3207
Reviewed-by: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
This commit is contained in:
Griffin Smith 2021-06-13 23:03:15 -04:00 committed by grfn
parent 30d83d7c82
commit bf79617bd8
6 changed files with 98 additions and 28 deletions

View file

@ -7,6 +7,7 @@ module Xanthous.Entities.Creature.Hippocampus
, initialHippocampus
-- ** Lenses
, destination
, greetedCharacter
-- ** Destination
, Destination(..)
, destinationFromPos
@ -50,7 +51,11 @@ destinationFromPos _destinationPosition =
in Destination{..}
data Hippocampus = Hippocampus
{ _destination :: !(Maybe Destination)
{ _destination :: !(Maybe Destination)
, -- | Has this creature greeted the character in any way yet?
--
-- Some creature types ignore this field
_greetedCharacter :: !Bool
}
deriving stock (Eq, Show, Ord, Generic)
deriving anyclass (NFData, CoArbitrary, Function)
@ -61,4 +66,7 @@ data Hippocampus = Hippocampus
makeLenses ''Hippocampus
initialHippocampus :: Hippocampus
initialHippocampus = Hippocampus Nothing
initialHippocampus = Hippocampus
{ _destination = Nothing
, _greetedCharacter = False
}

View file

@ -37,6 +37,7 @@ module Xanthous.Entities.RawTypes
, HasLongDescription(..)
, HasMaxHitpoints(..)
, HasName(..)
, HasSayVerb(..)
, HasSpeed(..)
, HasWieldable(..)
) where
@ -80,6 +81,8 @@ data CreatureType = CreatureType
, _friendly :: !Bool
, _speed :: !TicksPerTile
, _language :: !(Maybe LanguageName)
, _sayVerb :: Text -- ^ The verb, in present tense, for when the creature
-- says something
}
deriving stock (Show, Eq, Ord, Generic)
deriving anyclass (NFData, CoArbitrary, Function)

View file

@ -12,3 +12,4 @@ Creature:
speed: 125
friendly: false
language: Gormlak
sayVerb: yells