2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
# File 'lib/pfrpg_utility/prerequisite/skill_prereq.rb', line 2
def match(character)
skill_name = @attribute.downcase
if ['knowledge', 'perform', 'profession', 'craft'].include?(skill_name)
vals = []
classname = "PfrpgSkills::Skill::#{skill_name.capitalize}"
clazz = Kernel.const_get(classname)
k = clazz.new("NONE")
k.supported_types.each do |s|
vals << character.skills.current_trained_ranks(clazz.new(s).description)
end
ranks = vals.max
else
ranks = character.skills.current_trained_ranks(skill_name)
end
ranks >= @value.to_i
end
|