Skip to content

Instantly share code, notes, and snippets.

View benphelps's full-sized avatar
🇺🇦
Slava Ukrayini!

Ben Phelps benphelps

🇺🇦
Slava Ukrayini!
View GitHub Profile
class ArmorTier < ActiveRecord::Base
attr_accessible :agility, :deviation, :intellect, :level, :name, :stamina, :strength
belongs_to :armor_material
def agility
self.agility + rand(deviation)
end
end
class ArmorTier < ActiveRecord::Base
attr_accessible :agility, :deviation, :intellect, :level, :name, :stamina, :strength
belongs_to :armor_material
def agility
self.agility + rand(deviation)
end
end
class ArmorTier < ActiveRecord::Base
attr_accessible :agility, :deviation, :intellect, :level, :name, :stamina, :strength
belongs_to :armor_material
def agility
agility + rand(deviation)
end
end
class ArmorTier < ActiveRecord::Base
attr_accessible :agility, :deviation, :intellect, :level, :name, :stamina, :strength
belongs_to :armor_material
def agility
value + 5
end
end
class ArmorTier < ActiveRecord::Base
attr_accessible :agility, :deviation, :intellect, :level, :name, :stamina, :strength
belongs_to :armor_material
def agility
value + 5
end
end
class ArmorTier < ActiveRecord::Base
attr_accessible :agility, :deviation, :intellect, :level, :name, :stamina, :strength
belongs_to :armor_material
def agility
value + 5
end
end
class Armor < ActiveRecord::Base
attr_accessible :back_id, :character_id, :chest_id, :feet_id, :hand_id, :head_id, :legs_id, :shoulder_id, :waist_id
belongs_to :character
belongs_to :back, :class_name => 'ArmorItem'
belongs_to :chest, :class_name => 'ArmorItem'
belongs_to :feet, :class_name => 'ArmorItem'
belongs_to :hand, :class_name => 'ArmorItem'
belongs_to :head, :class_name => 'ArmorItem'
class StatSet < ActiveRecord::Base
attr_accessible :agility, :intellect, :stamina, :strength
has_many :enchants
has_many :bonuses
has_many :armor_items
end
class Armor < ActiveRecord::Base
attr_accessible :back_id, :character_id, :chest_id, :feet_id, :hand_id, :head_id, :legs_id, :shoulder_id, :waist_id
belongs_to :character
belongs_to :back, :class_name => 'ArmorItem'
belongs_to :chest, :class_name => 'ArmorItem'
belongs_to :feet, :class_name => 'ArmorItem'
belongs_to :hand, :class_name => 'ArmorItem'
belongs_to :head, :class_name => 'ArmorItem'
class Armor < ActiveRecord::Base
attr_accessible :back_id, :character_id, :chest_id, :feet_id, :hands_id, :head_id, :legs_id, :shoulder_id, :waist_id, :finger_id
belongs_to :character
attr_reader :back, :chest, :feet, :hands, :head, :legs, :shoulder, :waist, :finger
## This isn't very dry, perhaps there is a better method?
def hands
ArmorItem.find(hands_id).name