Skinney/elm-warrior/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 e31d20f0d74b of https://github.com/robinheghan/elm-warrior (zip prefix Skinney-elm-warrior-e31d20f/, America/Los_Angeles times): the zip is byte-identical to the one package.elm-lang.org recorded, SHA-1 2c94d034e1ed55c0eff743cf2ec5ddd2c48d8e34.

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.5/

Warrior

You'll need the functions and Action type in this module to implement a turn function. The Map module can also be of some assistance.

type alias Warrior =
Warrior

This type represents a warrior.

type Action
= Wait
| Heal
| Pickup
| Move Direction
| Attack Direction

The different actions which can be performed on a given turn. Wait will simply skip your turn. Heal let's the warrior recover some health. How much is influenced by the existence of potions in your inventory. Pickup will pick an item from the tile you are on, and place it on your inventory. Move let's you move one tile in any direction. Attack will make you attack in any direction. If another warrior is there that warrior will lose health. How much is influenced by the existance of a sword in your inventory.

id : Warrior -> String

The id, or name, of the warrior.

position : Warrior -> Coordinate

Retrieve the current position of a warrior.

health : Warrior -> Int

Get the health of a warrior.

maxHealth : Warrior -> Int

Get the maximum health the warrior can have. The warrior will start a map with this much health.

healingPotential : Warrior -> Int

Calculates much health the warrior could potentially recover as the result of a heal action. This function doesn't consider your current health; you will never heal past your maxHealth.

attackDamage : Warrior -> Int

Calculates how much damage the warrior will do as the result of an attack. The returned value depends on the items in the inventory.

inventory : Warrior -> List Item

A list of all the items a warrior has in its possession.