Turns
The game is played in turns. At every turn, the playTurn method is executed to determine what action the warrior will take. It's your responsibility to define the behavior using this function.
Actions
An action is something that the warrior can do. You can perform one action per turn
Method | Description |
---|
warrior.walk() | Walks in the direction the warrior is currently facing. |
warrior.attack() | Attack one step in the direction that you're facing. An attack deals 3 points of damage. |
warrior.rest() | Gain back 3 points of health back, but do nothing more. |
Senses
A sense is something which gathers information about the floor. You can perform senses as often as you want per turn to gather information about your surroundings and to aid you in choosing the proper action.
Method | Description |
---|
warrior.health() | Return an integer representing your current health. |
warrior.feel().isEnemy() | Determine if an enemy unit is facing the warrior |
warrior.feel().isEmpty() | If true, this means that nothing (except maybe stairs) is at this location and you can walk here. |