Guest User

Untitled

a guest
Dec 11th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. class Character < ActiveRecord::Base
  2. attr_accessible :level, :name
  3. belongs_to :order
  4. belongs_to :user
  5. has_one :armor
  6.  
  7. [:agility, :stamina, :strength, :intellect].each do |stat|
  8. define_method stat do
  9. armor_tier.stat.stat) + stat_set.send(stat)
  10. (level.to_f * order.send(stat)).round
  11. end
  12. end
  13.  
  14. def health
  15. ((level.to_f * 10) + (order.stamina * level.to_f)).round
  16. end
  17.  
  18. end
Add Comment
Please, Sign In to add comment