ryanb / ruby-warrior

Game written in Ruby for learning Ruby.
MIT License
3.83k stars 838 forks source link

Add distance_of ability #21

Closed ryanb closed 14 years ago

ryanb commented 14 years ago

The warrior should be able to tell the distance of a given unit. This will help in bomb throwing to tell if a captive or ticking unit will be effected by the bomb.

captives = warrior.listen.map { |s| s.captive? }
warrior.throw! unless captives.any? { |s| warrior.distance_of(s) == 3 }
ryanb commented 14 years ago

adding distance_of ability - closed by c44b6ba11344d7ec478a113409114b1b95437655