Formerly Skinney/elm-warrior. Search finds this package by either name.
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.
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.
The id, or name, of the warrior.
Retrieve the current position of a warrior.
Get the health of a warrior.
Get the maximum health the warrior can have. The warrior will start a map with this much health.
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.
Calculates how much damage the warrior will do as the result of an attack. The returned value depends on the items in the inventory.
This type represents a warrior.