Skip to content

Commit

Permalink
Merge pull request reedlaw#32 from jackdoe/master
Browse files Browse the repository at this point in the history
start a Horde fraction
  • Loading branch information
Reed G. Law committed Apr 12, 2012
2 parents e23f463 + c6eacc7 commit 2c924df
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion players/jack.rb
@@ -1,6 +1,9 @@
module Jack module Jack
def horde
true
end
def move def move
enemy = Game.world[:players].select{ |p| p != self && p.alive }.min { |a,b| a.stats[:health] <=> b.stats[:health] } enemy = Game.world[:players].select { |p| !p.horde && p.alive }.min { |a,b| a.stats[:health] <=> b.stats[:health] }
if enemy && self.stats[:health] > self.stats[:strength] if enemy && self.stats[:health] > self.stats[:strength]
[:attack,enemy] [:attack,enemy]
else else
Expand Down

0 comments on commit 2c924df

Please sign in to comment.