Class: Core::Game::Skills
Overview
skills and their respective levels, instanced once for every character
Instance Method Summary collapse
- #advance(skill) ⇒ Object
-
#initialize ⇒ Skills
constructor
A new instance of Skills.
- #level_to_s(skill) ⇒ Object
- #list ⇒ Object
Constructor Details
Instance Method Details
#advance(skill) ⇒ Object
38 39 40 41 42 43 44 |
# 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) ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/game/skills.rb', line 46 def level_to_s(skill) lvl = @skills[skill] case lvl when 0 return Core::Trans.(:xp_none) when 1 return Core::Trans.(:xp_vlittle) when 2 return Core::Trans.(:xp_little) when 3 return Core::Trans.(:xp_mediocre) when 4 return Core::Trans.(:xp_experienced) when 5 return Core::Trans.(:xp_vexperienced) end end |
#list ⇒ Object
34 35 36 |
# File 'lib/game/skills.rb', line 34 def list return @skills end |