pfrpg_core 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pfrpg_core/skills.rb +3 -1
- data/lib/pfrpg_core/version.rb +1 -1
- data/test/skills_test.rb +40 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d0aa9c4483f81b38ceb0950944e233824899b35
|
4
|
+
data.tar.gz: 1a5bd90ae1c93c8fe7215552d9b60217499a3b4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3d1101669ad750e0fd80ade484096476a9eda65b4c08e46469355d2272186a72e33ec17b42922ad38e78651b5a02bafe727e655ad218b6566fe1a59c3eed60b
|
7
|
+
data.tar.gz: 9b79de53a5b8f8005704d94d89b29678938f2b8501c7139e5ed1ae0a1753825c968c171efe6f64a9b3967b2608e3e3d83e005d9f08c3132c427c65c354a81d93
|
data/lib/pfrpg_core/skills.rb
CHANGED
@@ -44,7 +44,9 @@ module PfrpgCore
|
|
44
44
|
|
45
45
|
def is_class_skill?(skill, character)
|
46
46
|
found = character.levels.any? do |l|
|
47
|
-
l.heroclass.skills.find { |x| x.to_s == skill[:skill].to_s }
|
47
|
+
(l.heroclass.skills.find { |x| x.to_s == skill[:skill].to_s } ||
|
48
|
+
(l.heroclass.skills.find { |x| x.to_s.downcase['profession']} &&
|
49
|
+
skill[:skill].to_s.downcase['profession']))
|
48
50
|
end
|
49
51
|
found ||= class_skill_bonuses(character).find do |x|
|
50
52
|
if x
|
data/lib/pfrpg_core/version.rb
CHANGED
data/test/skills_test.rb
CHANGED
@@ -17,14 +17,37 @@ class SkillsTest < Minitest::Test
|
|
17
17
|
]
|
18
18
|
end
|
19
19
|
|
20
|
+
class MockSkill
|
21
|
+
attr_reader :name
|
22
|
+
def initialize(name)
|
23
|
+
@name = name
|
24
|
+
end
|
25
|
+
|
26
|
+
def ac_penalty?
|
27
|
+
0
|
28
|
+
end
|
29
|
+
|
30
|
+
def description
|
31
|
+
name
|
32
|
+
end
|
33
|
+
|
34
|
+
def attribute
|
35
|
+
'con'
|
36
|
+
end
|
37
|
+
|
38
|
+
def to_s
|
39
|
+
name
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
|
44
|
+
def make_skills
|
45
|
+
skill_list.map { |x| { char_skill: { 'trained_rank' => 0, name: x }, skill: MockSkill.new(x) }}
|
46
|
+
end
|
47
|
+
|
20
48
|
def setup
|
21
49
|
@c = plain_character
|
22
|
-
@c.base_skills =
|
23
|
-
return {
|
24
|
-
char_skill: { 'trained_rank'=> 0, name: skill },
|
25
|
-
skill: skill
|
26
|
-
}
|
27
|
-
end
|
50
|
+
@c.base_skills = make_skills
|
28
51
|
end
|
29
52
|
|
30
53
|
class MockRace
|
@@ -90,5 +113,16 @@ class SkillsTest < Minitest::Test
|
|
90
113
|
assert skills.skills_per_level(PfrpgClasses::Fighter.new(1), false) == 2
|
91
114
|
end
|
92
115
|
|
116
|
+
def test_all_professions_are_class_skills
|
117
|
+
skills = PfrpgCore::Skills.new(@c)
|
118
|
+
|
119
|
+
assert s = skills.get_skill('Acrobatics')
|
120
|
+
|
121
|
+
assert s.is_class_skill?({ skill: MockSkill.new("Profession - Butcher (wis)") } , @c)
|
122
|
+
assert s.is_class_skill?({ skill: MockSkill.new('Profession - Cook (wis)') }, @c)
|
123
|
+
assert s.is_class_skill?({ skill: MockSkill.new('Profession - Courtesan (wis)')} , @c)
|
124
|
+
assert s.is_class_skill?({ skill: MockSkill.new('Profession - Tanner (wis)')} , @c)
|
125
|
+
assert s.is_class_skill?({ skill: MockSkill.new('profession - Nonsense (wis)')}, @c)
|
126
|
+
end
|
93
127
|
|
94
128
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pfrpg_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jordan OMara
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: core
|
14
14
|
email:
|