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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b896cbfb1969af6749f9b6e61d6d5df237c42b9d
4
- data.tar.gz: 121370686bde5673d186111d3dea6f6d9eba9ccf
3
+ metadata.gz: 0d0aa9c4483f81b38ceb0950944e233824899b35
4
+ data.tar.gz: 1a5bd90ae1c93c8fe7215552d9b60217499a3b4e
5
5
  SHA512:
6
- metadata.gz: a5e95d55cae5d19d28398a3961bd8f2d66428d7ff8bd430dc443ed9e9699afd328e17512173df2e052f98f560bc03fcae7556327b42395d98b8864b677874d55
7
- data.tar.gz: 3b85e8ed12a562b030ead797f95fa992ef7cb27874b43d9b558c401be81453d12a540e75976131eaeb5cadcb2f747d9cb2a8ce290f619d48167e60db80b78838
6
+ metadata.gz: a3d1101669ad750e0fd80ade484096476a9eda65b4c08e46469355d2272186a72e33ec17b42922ad38e78651b5a02bafe727e655ad218b6566fe1a59c3eed60b
7
+ data.tar.gz: 9b79de53a5b8f8005704d94d89b29678938f2b8501c7139e5ed1ae0a1753825c968c171efe6f64a9b3967b2608e3e3d83e005d9f08c3132c427c65c354a81d93
@@ -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
@@ -1,3 +1,3 @@
1
1
  module PfrpgCore
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
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 = skill_list.map do |skill|
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.6
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-23 00:00:00.000000000 Z
11
+ date: 2015-03-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: core
14
14
  email: