class Core::Game::Skills
skills and their respective levels, instanced once for every character
Public Class Methods
new()
click to toggle source
# File lib/game/skills.rb, line 27 def initialize @skills = {} Core::Game.skills.each { |skill| @skills.store(skill, 0) } end
Public Instance Methods
advance(skill)
click to toggle source
# File lib/game/skills.rb, line 38 def advance(skill) @skills.each { |s| if skill.class == s.class @skills[s] += 1 end } end
level_to_s(skill)
click to toggle source
# File lib/game/skills.rb, line 46 def level_to_s(skill) lvl = @skills[skill] case lvl when 0 return Core::Trans.menu(:xp_none) when 1 return Core::Trans.menu(:xp_vlittle) when 2 return Core::Trans.menu(:xp_little) when 3 return Core::Trans.menu(:xp_mediocre) when 4 return Core::Trans.menu(:xp_experienced) when 5 return Core::Trans.menu(:xp_vexperienced) end end
list()
click to toggle source
# File lib/game/skills.rb, line 34 def list return @skills end