class Player

Attributes

health[R]
name[RW]
role[R]

Public Class Methods

new(name) click to toggle source
# File lib/studio_game/rubynotes.rb, line 89
def initialize(name)
  @name = name.capitalize
  @health = rand(50..100)
  @role = role_names.sample
end

Public Instance Methods

role_names() click to toggle source
# File lib/studio_game/rubynotes.rb, line 95
def role_names
 [
  "Barbarian",
  "Bard",
  "Cleric",
  "Druid",
  "Fighter",
  "Monk",
  "Paladin",
  "Ranger",
  "Rogue",
  "Sorcerer",
  "Wizard",
]
end