Advertisement
Guest User

Untitled

a guest
May 25th, 2015
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. class Rabbit < Creature
  2. traits :bombs
  3.  
  4. life 10
  5. strength 2
  6. charisma 44
  7. weapon 4
  8. bombs 3
  9.  
  10. # little boomerang
  11. def ^( enemy )
  12. fight( enemy, 13 )
  13. end
  14. # the hero's sword is unlimited!!
  15. def /( enemy )
  16. fight( enemy, rand( 4 + ( ( enemy.life % 10 ) ** 2 ) ) )
  17. end
  18. # lettuce will build your strength and extra ruffage
  19. # will fly in the face of your opponent!!
  20. def %( enemy )
  21. lettuce = rand( charisma )
  22. puts "[Healthy lettuce gives you #{ lettuce } life points!!]"
  23. @life += lettuce
  24. fight( enemy, 0 )
  25. end
  26. # bombs, but you only have three!!
  27. def *( enemy )
  28. if @bombs.zero?
  29. puts "[UHN!! You're out of bombs!!]"
  30. return
  31. end
  32. @bombs -= 1
  33. fight( enemy, 86 )
  34. end
  35. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement