LambdaHack-0.2.1: A roguelike game engine in early and very active development

Safe HaskellSafe-Infered

Game.LambdaHack.Grammar

Contents

Description

Construct English sentences from content.

Synopsis

Grammar types

type Verb = StringSource

The type of verbs.

type Object = StringSource

The grammatical object type.

General operations

capitalize :: Object -> ObjectSource

Capitalize a string.

addIndefinite :: Object -> ObjectSource

Add the indefinite article (a, an) to a word (h is too hard).

Objects from content

objectItemCheat :: Ops ItemKind -> Bool -> State -> Item -> ObjectSource

How to refer to an item in object position of a sentence. If cheating is allowed, full identity of the object is revealed together with its flavour (e.g. at game over screen).

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.

capActor :: Ops ActorKind -> Actor -> ObjectSource

Capitalized actor object.

Sentences

actorVerb :: Ops ActorKind -> Actor -> Verb -> String -> StringSource

Sentences such as "Dog barks loudly."

actorVerbItem :: COps -> State -> Actor -> Verb -> Item -> String -> StringSource

Sentences such as "Dog quaffs a red potion fast."

actorVerbActor :: Ops ActorKind -> Actor -> Verb -> Actor -> String -> StringSource

Sentences such as "Dog bites goblin furiously."

actorVerbExtraItem :: COps -> State -> Actor -> Verb -> String -> Item -> String -> StringSource

Sentences such as "Dog gulps down a red potion fast."

Scenery description

lookAtSource

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.