Safe Haskell | None |
---|
Game.LambdaHack.Grammar
Description
Construct English sentences from content.
- type Verb = String
- type Object = String
- capitalize :: Object -> Object
- suffixS :: String -> String
- addIndefinite :: Object -> Object
- objectItem :: Ops ItemKind -> State -> Item -> Object
- objectActor :: Ops ActorKind -> Actor -> Object
- capActor :: Ops ActorKind -> Actor -> Object
- actorVerb :: Ops ActorKind -> Actor -> Verb -> String
- actorVerbExtra :: Ops ActorKind -> Actor -> Verb -> String -> String
- actorVerbItemExtra :: COps -> State -> Actor -> Verb -> Item -> String -> String
- actorVerbActorExtra :: Ops ActorKind -> Actor -> Verb -> Actor -> String -> String
- actorVerbExtraItemExtra :: COps -> State -> Actor -> Verb -> String -> Item -> String -> String
- lookAt :: COps -> Bool -> Bool -> State -> Level -> Point -> String -> String
Grammar types
General operations
capitalize :: Object -> ObjectSource
Capitalize a string.
suffixS :: String -> StringSource
Adds the plural (s
, es
, ies
) suffix to a word.
See http:en.wikipedia.orgwikiEnglish_plural.
addIndefinite :: Object -> ObjectSource
Add the indefinite article (a
, an
) to a word (h
is too hard).
Objects from content
objectItem :: Ops ItemKind -> State -> Item -> ObjectSource
How to refer to an item in object position of a sentence.
objectActor :: Ops ActorKind -> Actor -> ObjectSource
How to refer to an actor in object position of a sentence.
Sentences
actorVerbExtra :: Ops ActorKind -> Actor -> Verb -> String -> StringSource
Sentences such as "Dog barks loudly."
actorVerbItemExtra :: COps -> State -> Actor -> Verb -> Item -> String -> StringSource
Sentences such as "Dog quaffs a red potion fast."
actorVerbActorExtra :: Ops ActorKind -> Actor -> Verb -> Actor -> String -> StringSource
Sentences such as "Dog bites goblin furiously."
actorVerbExtraItemExtra :: COps -> State -> Actor -> Verb -> String -> Item -> String -> StringSource
Sentences such as "Dog gulps down a red potion fast."
Scenery description
Arguments
:: COps | game content |
-> Bool | detailed? |
-> Bool | can be seen right now? |
-> State | game state |
-> Level | current level |
-> Point | location to describe |
-> String | an extra sentence to print |
-> String |
Produces a textual description of the terrain and items at an already explored location. Mute for unknown locations. The detailed variant is for use in the targeting mode.