TIP: You can walk backward by passing
'backward'
as an argument towalk()
. Same goes forfeel()
,rescue()
andattack()
. Archers have a limited attack distance.
╔════════╗
║C @ S aa║
╚════════╝
C = Captive (1 HP)
@ = Monadic (20 HP)
S = Thick Sludge (24 HP)
a = Archer (7 HP)
warrior.walk()
: Move one space in the given direction (forward by default).warrior.attack()
: Attack a unit in the given direction (forward by default) dealing 5 HP of damage.warrior.rest()
: Gain 10% of max health back, but do nothing more.warrior.rescue()
: Release a unit from his chains in the given direction (forward by default).
warrior.think()
: Think about your options before choosing an action (console.log
replacement).warrior.feel()
: Return the adjacent space in the given direction (forward by default).warrior.health()
: Return an integer representing your health.
When you're done editing Player.js
, run the warriorjs
command again.