Skinney/elm-warrior/4.0.4

NOTE: the latest version is 4.0.5

Renamed to robinheghan/elm-warrior. It is published under that name, and new versions come out there.

Versions published as Skinney/elm-warrior still install under that name. 15 versions of 15 come from the new location (see their notes).

Rerouted (renamed, verified). The GitHub user or repository was renamed. The tag is still there, at the new name. The Lamdera package server serves a copy recovered from https://github.com/robinheghan/elm-warrior.

What we checked: The repo moved to github.com/robinheghan/elm-warrior. Rebuilt with git archive from commit 76835b104e88 of https://github.com/robinheghan/elm-warrior (zip prefix Skinney-elm-warrior-76835b1/, America/Los_Angeles times): the zip is byte-identical to the one package.elm-lang.org recorded, SHA-1 6146838352631f775cb4a0e89fd516e680a424bf.

The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.

Details · package.elm-lang.org's zip: https://github.com/Skinney/elm-warrior/zipball/4.0.4/

Warrior.Map.Builder

You can use this module to build your own maps!

A map in progress.

Map layout

type alias Size =
{ rows : Int
, columns : Int
}

Describes how large a map should be in rows and columns.

init : Size -> Template

Initialize an empty map of a given size where every tile is empty. Use the the following with functions to make the map more interesting.

Sets a description for the map which will be displayed above the map when the game is played.

withSpawnPoint : Coordinate -> Template -> Template

Marks a coordinate on the map where a playable warrior will spawn.

withExitPoint : Coordinate -> Template -> Template

Marks a coordinate on the map where the player needs to go to advance to the next map.

withWalledArea : Coordinate -> Coordinate -> Template -> Template

Turns every tile between two coordinates into wall tiles.

Non-playable characters (Npc's) and Items

String
-> Coordinate
-> (Warrior -> Map -> History -> Action)

Places a villain on the specific coordinate of the map, using the supplied function to know what to do each turn. You can find pre-made turn functions in the Warrior.Npc module.

Places an item into the inventory of the last villain added with the withNpc function.

withItem : Coordinate -> Item -> Template -> Template

Places an item on the map which can be picked up by warriors.

Queries

spawnPoints : Template -> List Coordinate

A list of points where warriors can spawn.

npcs : Template -> List ( Warrior, Warrior -> Map -> History -> Action )

Return a list of all non-playable characters along with their turn functions.

Finally

build : Template -> Map

Turn this template into a map