pfrpg_races 0.0.1 → 0.1.0

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: 09d9d388d43b7d693fb9cff7beeab07635ce90ec
4
- data.tar.gz: f100b530288b5aa9e829a9cb1bbe62494f9f3e60
3
+ metadata.gz: 7fbb6b970e029ab80a95f62a22d090b5463c9613
4
+ data.tar.gz: 333b37eef11f62a2631db7390d22e1052ff02429
5
5
  SHA512:
6
- metadata.gz: e2a96c0bf23452347078fc5457dc5f822a143231dfc42d6009ee9dfccd380bdca448d71e9551756b547b8d8860e3f9799899402ab7f2e25094b84950164303f0
7
- data.tar.gz: 8ffa2812d75838b631fe93bffd30eef5ccb2ea3616f94e73196c49d95c7a3642c1523b5f49ce0876871cb2e8837a96ac93304f9d36bda0bddcca7148f1d28f74
6
+ metadata.gz: 73f656976e9efbb2eb6633d7050e072ba3d1114877d47c561823dd6f0c8b2066e8229d12801bd1296d1b775ea16f313d7070afdd06071ab1e2fc8299cef5734e
7
+ data.tar.gz: 9b697f6ff4f7328a1cb95f2c4964b552e13904bc55494df8ca63f5a402d4042e84c03e976ce2a571a878d2fd870133c17dea4fcadd8e366b680a043c4fcfdd56
data/Rakefile ADDED
@@ -0,0 +1,7 @@
1
+ require 'rake/testtask'
2
+
3
+ Rake::TestTask.new do |t|
4
+ t.libs.push "lib"
5
+ t.test_files = FileList['test/*_test.rb']
6
+ t.verbose = true
7
+ end
@@ -3,6 +3,7 @@ module PfrpgRaces
3
3
 
4
4
  def self.fetch(race_str)
5
5
  begin
6
+ race_str = "PfrpgRaces::Race::#{race_str}" unless race_str['PfrpgRaces::Race']
6
7
  return Object::const_get(race_str).new
7
8
  rescue Exception
8
9
  return nil
@@ -11,13 +12,13 @@ module PfrpgRaces
11
12
 
12
13
  def self.race_list
13
14
  [
14
- Dwarf.new,
15
- Human.new,
16
- Gnome.new,
17
- HalfElf.new,
18
- Elf.new,
19
- HalfOrc.new,
20
- Halfling.new
15
+ PfrpgRaces::Race::Dwarf.new,
16
+ PfrpgRaces::Race::Human.new,
17
+ PfrpgRaces::Race::Gnome.new,
18
+ PfrpgRaces::Race::HalfElf.new,
19
+ PfrpgRaces::Race::Elf.new,
20
+ PfrpgRaces::Race::HalfOrc.new,
21
+ PfrpgRaces::Race::Halfling.new
21
22
  ]
22
23
  end
23
24
 
@@ -1,4 +1,4 @@
1
- class Dwarf < PfrpgRaces::Race
1
+ class PfrpgRaces::Race::Dwarf < PfrpgRaces::Race
2
2
 
3
3
  def name
4
4
  "Dwarf"
@@ -17,9 +17,9 @@ class Dwarf < PfrpgRaces::Race
17
17
  end
18
18
 
19
19
  def attribute_bonuses
20
- [ RacialStatBonus.dangling('CON', 2),
21
- RacialStatBonus.dangling('WIS', 2),
22
- RacialStatBonus.dangling('CHA',-2)
20
+ [ PfrpgRaces::StatBonus.new('CON', 2),
21
+ PfrpgRaces::StatBonus.new('WIS', 2),
22
+ PfrpgRaces::StatBonus.new('CHA',-2)
23
23
  ]
24
24
  end
25
25
 
@@ -65,7 +65,7 @@ class Dwarf < PfrpgRaces::Race
65
65
 
66
66
  def traits
67
67
  [
68
- RacialTrait.new( :name => "Slow and Steady",
68
+ PfrpgRaces::RacialTrait.new( :name => "Slow and Steady",
69
69
  :description =>
70
70
  "20FT base speed / not modified by encumbrance or armor",
71
71
  :effects =>
@@ -73,22 +73,22 @@ class Dwarf < PfrpgRaces::Race
73
73
  noarmor_effect
74
74
  ]
75
75
  ),
76
- RacialTrait.new( :name => "Defensive Training",
76
+ PfrpgRaces::RacialTrait.new( :name => "Defensive Training",
77
77
  :description => "+4 dodge AC bonus vs. Giants"
78
78
  ),
79
- RacialTrait.new( :name => "Greed",
79
+ PfrpgRaces::RacialTrait.new( :name => "Greed",
80
80
  :description => "+2 appraise checks w/ precious metals or gemstones"
81
81
  ),
82
- RacialTrait.new( :name => "Hatred",
82
+ PfrpgRaces::RacialTrait.new( :name => "Hatred",
83
83
  :description => "+1 attack bonus vs/ orc & goblinoid"
84
84
  ),
85
- RacialTrait.new( :name => "Hardy",
85
+ PfrpgRaces::RacialTrait.new( :name => "Hardy",
86
86
  :description => "+2 save vs poison, spells and spell-like abilities"
87
87
  ),
88
- RacialTrait.new( :name => "Stabililty",
88
+ PfrpgRaces::RacialTrait.new( :name => "Stabililty",
89
89
  :description => "+4 CMD vs bull rush or trip"
90
90
  ),
91
- RacialTrait.new( :name => "Stonecunning",
91
+ PfrpgRaces::RacialTrait.new( :name => "Stonecunning",
92
92
  :description => "+2 perception check vs unusual stonework"
93
93
  )
94
94
  ]
@@ -1,78 +1,76 @@
1
- module PfrpgRaces
2
- class Elf < Race
1
+ class PfrpgRaces::Race::Elf < PfrpgRaces::Race
3
2
 
4
- def name
5
- "Elf"
6
- end
3
+ def name
4
+ "Elf"
5
+ end
7
6
 
8
- def description
9
- "Elves are nimble, both in body and mind, but their form is frail. They gain +2 Dexterity, +2 Intelligence, and –2 Constitution."
10
- end
7
+ def description
8
+ "Elves are nimble, both in body and mind, but their form is frail. They gain +2 Dexterity, +2 Intelligence, and –2 Constitution."
9
+ end
11
10
 
12
- def source
13
- "PFRPG"
14
- end
11
+ def source
12
+ "PFRPG"
13
+ end
15
14
 
16
- def attribute_bonuses
17
- [
18
- { 'DEX' => 2 },
19
- { 'INT' => 2 },
20
- { 'CON' => -2 }
21
- ]
22
- end
15
+ def attribute_bonuses
16
+ [
17
+ PfrpgRaces::StatBonus.new('DEX',2),
18
+ PfrpgRaces::StatBonus.new('INT',2),
19
+ PfrpgRaces::StatBonus.new('CON',-2)
20
+ ]
21
+ end
23
22
 
24
- def bonus_choices
25
- []
26
- end
23
+ def bonus_choices
24
+ []
25
+ end
27
26
 
28
- def languages
29
- ["Common", "Elven"]
30
- end
27
+ def languages
28
+ ["Common", "Elven"]
29
+ end
31
30
 
32
- def speed
33
- 30
34
- end
31
+ def speed
32
+ 30
33
+ end
35
34
 
36
- def int_languages
37
- ["Celestial", "Draconic", "Gnoll", "Gnome", "Goblin", "Orc", "Sylvan"]
38
- end
35
+ def int_languages
36
+ ["Celestial", "Draconic", "Gnoll", "Gnome", "Goblin", "Orc", "Sylvan"]
37
+ end
39
38
 
40
- def size
41
- "MEDIUM"
42
- end
39
+ def size
40
+ "MEDIUM"
41
+ end
43
42
 
44
- def choose_ability_bonus?
45
- false
46
- end
43
+ def choose_ability_bonus?
44
+ false
45
+ end
47
46
 
48
- def weapon_familiarity
49
- [ "Longbow", "Composite Longbow", "Longsword", "Rapier", "Shortbow", "Composite Shortbow"]
50
- end
47
+ def weapon_familiarity
48
+ [ "Longbow", "Composite Longbow", "Longsword", "Rapier", "Shortbow", "Composite Shortbow"]
49
+ end
51
50
 
52
- def martial_weapons
53
- "elf"
54
- end
51
+ def martial_weapons
52
+ "elf"
53
+ end
55
54
 
56
- def traits
57
- [
58
- RacialTrait.new( :name => "Low-Light Vision",
59
- :description => "See 2x as far in dim light"
60
- ),
61
- RacialTrait.new( :name => "Elven Immunities",
62
- :description => "Immune to Magic Sleep, +2 save vs enchantments"
63
- ),
64
- RacialTrait.new( :name => "Elven Magic",
65
- :description => "+2 racial bonus on caster level checks for spell resistance,\n
66
- +2 racial bonus on Spellcraft to identify magic items"
67
- ),
68
- RacialTrait.new( :name => "Keen Senses",
69
- :description => "+2 Perception",
70
- :effects =>
71
- [
72
- PfrpgCore::Effect.new("skill", "perception", 2)
73
- ]
74
- )
75
- ]
76
- end
55
+ def traits
56
+ [
57
+ PfrpgRaces::RacialTrait.new( :name => "Low-Light Vision",
58
+ :description => "See 2x as far in dim light"
59
+ ),
60
+ PfrpgRaces::RacialTrait.new( :name => "Elven Immunities",
61
+ :description => "Immune to Magic Sleep, +2 save vs enchantments"
62
+ ),
63
+ PfrpgRaces::RacialTrait.new( :name => "Elven Magic",
64
+ :description => "+2 racial bonus on caster level checks for spell resistance,\n
65
+ +2 racial bonus on Spellcraft to identify magic items"
66
+ ),
67
+ PfrpgRaces::RacialTrait.new( :name => "Keen Senses",
68
+ :description => "+2 Perception",
69
+ :effects =>
70
+ [
71
+ PfrpgCore::Effect.new("skill", "perception", 2)
72
+ ]
73
+ )
74
+ ]
77
75
  end
78
76
  end
@@ -1,92 +1,90 @@
1
- module PfrpgRaces
2
- class Gnome < Race
1
+ class PfrpgRaces::Race::Gnome < PfrpgRaces::Race
3
2
 
4
- def name
5
- "Gnome"
6
- end
3
+ def name
4
+ "Gnome"
5
+ end
7
6
 
8
- def description
9
- "Gnomes are physically weak but surprisingly hardy, and their attitude makes them naturally agreeable. They gain +2 Constitution, +2 Charisma, and –2 Strength."
10
- end
7
+ def description
8
+ "Gnomes are physically weak but surprisingly hardy, and their attitude makes them naturally agreeable. They gain +2 Constitution, +2 Charisma, and –2 Strength."
9
+ end
11
10
 
12
- def source
13
- "PFRPG"
14
- end
11
+ def source
12
+ "PFRPG"
13
+ end
15
14
 
16
- def attribute_bonuses
17
- [
18
- { 'CON' => 2 },
19
- { 'CHA' => 2 },
20
- { 'STR' => -2 }
21
- ]
22
- end
15
+ def attribute_bonuses
16
+ [
17
+ PfrpgRaces::StatBonus.new('CON',2),
18
+ PfrpgRaces::StatBonus.new('CHA',2),
19
+ PfrpgRaces::StatBonus.new('STR',-2),
20
+ ]
21
+ end
23
22
 
24
- def bonus_choices
25
- []
26
- end
23
+ def bonus_choices
24
+ []
25
+ end
27
26
 
28
- def languages
29
- ["Common", "Gnome", "Sylvan"]
30
- end
27
+ def languages
28
+ ["Common", "Gnome", "Sylvan"]
29
+ end
31
30
 
32
- def speed
33
- 20
34
- end
31
+ def speed
32
+ 20
33
+ end
35
34
 
36
- def int_languages
37
- ["Draconic", "Dwarven", "Elven", "Giant", "Goblin", "Orc"]
38
- end
35
+ def int_languages
36
+ ["Draconic", "Dwarven", "Elven", "Giant", "Goblin", "Orc"]
37
+ end
39
38
 
40
- def size
41
- "SMALL"
42
- end
39
+ def size
40
+ "SMALL"
41
+ end
43
42
 
44
- def choose_ability_bonus?
45
- false
46
- end
43
+ def choose_ability_bonus?
44
+ false
45
+ end
47
46
 
48
- def weapon_familiarity
49
- [ ]
50
- end
47
+ def weapon_familiarity
48
+ [ ]
49
+ end
51
50
 
52
- def martial_weapons
53
- "gnome"
54
- end
51
+ def martial_weapons
52
+ "gnome"
53
+ end
55
54
 
56
- def traits
57
- [
58
- RacialTrait.new( :name => "Low-Light Vision",
59
- :description => "See 2x as far in dim light"
60
- ),
61
- RacialTrait.new( :name => "Defensive Training",
62
- :description => "+4 dodge AC vs giant monsters"
63
- ),
64
- RacialTrait.new( :name => "Hatred",
65
- :description => "+1 ATK Bonus vs reptilian humanoids and goblinoid subtypes"
66
- ),
67
- RacialTrait.new( :name => "Illusion Resistance",
68
- :description => "+2 save vs illusion spells and effects"
69
- ),
70
- RacialTrait.new( :name => "Obsessive",
71
- :description => "+2 to Craft or Profession skill of your choice"
72
- ),
73
- RacialTrait.new( :name => "Gnome Magic",
74
- :description => "+1 to DC of any saving throws against illusions they cast, \n
75
- with >= 11 Charisma, gain spell-like abilities once per day:\n
76
- \tdancing lights,\n
77
- \tghost sound,\n
78
- \tprestidigitation,\n
79
- \tspeak with animals\n
80
- The DC for these spells is 10 + spell level + CHA mod",
81
- ),
82
- RacialTrait.new( :name => "Keen Senses",
83
- :description => "+2 Perception",
84
- :effects =>
85
- [
86
- PfrpgCore::Effect.new("skill", "perception", 2)
87
- ]
88
- )
89
- ]
90
- end
55
+ def traits
56
+ [
57
+ PfrpgRaces::RacialTrait.new( :name => "Low-Light Vision",
58
+ :description => "See 2x as far in dim light"
59
+ ),
60
+ PfrpgRaces::RacialTrait.new( :name => "Defensive Training",
61
+ :description => "+4 dodge AC vs giant monsters"
62
+ ),
63
+ PfrpgRaces::RacialTrait.new( :name => "Hatred",
64
+ :description => "+1 ATK Bonus vs reptilian humanoids and goblinoid subtypes"
65
+ ),
66
+ PfrpgRaces::RacialTrait.new( :name => "Illusion Resistance",
67
+ :description => "+2 save vs illusion spells and effects"
68
+ ),
69
+ PfrpgRaces::RacialTrait.new( :name => "Obsessive",
70
+ :description => "+2 to Craft or Profession skill of your choice"
71
+ ),
72
+ PfrpgRaces::RacialTrait.new( :name => "Gnome Magic",
73
+ :description => "+1 to DC of any saving throws against illusions they cast, \n
74
+ with >= 11 Charisma, gain spell-like abilities once per day:\n
75
+ \tdancing lights,\n
76
+ \tghost sound,\n
77
+ \tprestidigitation,\n
78
+ \tspeak with animals\n
79
+ The DC for these spells is 10 + spell level + CHA mod",
80
+ ),
81
+ PfrpgRaces::RacialTrait.new( :name => "Keen Senses",
82
+ :description => "+2 Perception",
83
+ :effects =>
84
+ [
85
+ PfrpgCore::Effect.new("skill", "perception", 2)
86
+ ]
87
+ )
88
+ ]
91
89
  end
92
90
  end
@@ -1,76 +1,74 @@
1
- module PfrpgRaces
2
- class HalfElf < Race
1
+ class PfrpgRaces::Race::HalfElf < PfrpgRaces::Race
3
2
 
4
- def name
5
- "HalfElf"
6
- end
3
+ def name
4
+ "HalfElf"
5
+ end
7
6
 
8
- def description
9
- "Half-elf characters gain a +2 bonus to one ability score of their choice at creation to represent their varied nature."
10
- end
7
+ def description
8
+ "Half-elf characters gain a +2 bonus to one ability score of their choice at creation to represent their varied nature."
9
+ end
11
10
 
12
- def source
13
- "PFRPG"
14
- end
11
+ def source
12
+ "PFRPG"
13
+ end
15
14
 
16
- def attribute_bonuses
17
- nil
18
- end
15
+ def attribute_bonuses
16
+ nil
17
+ end
19
18
 
20
- def bonus_feat
21
- [ "Skill Focus" ]
22
- end
19
+ def bonus_feat
20
+ [ "Skill Focus" ]
21
+ end
23
22
 
24
- def bonus_choices
25
- []
26
- end
23
+ def bonus_choices
24
+ []
25
+ end
27
26
 
28
- def languages
29
- ["Common", "Elven"]
30
- end
27
+ def languages
28
+ ["Common", "Elven"]
29
+ end
31
30
 
32
- def speed
33
- 30
34
- end
31
+ def speed
32
+ 30
33
+ end
35
34
 
36
- def int_languages
37
- PfrpgTables::Tables::Languages.int_languages
38
- end
35
+ def int_languages
36
+ PfrpgTables::Tables::Languages.int_languages
37
+ end
39
38
 
40
- def size
41
- "MEDIUM"
42
- end
39
+ def size
40
+ "MEDIUM"
41
+ end
43
42
 
44
- def choose_ability_bonus?
45
- true
46
- end
43
+ def choose_ability_bonus?
44
+ true
45
+ end
47
46
 
48
- def weapon_familiarity
49
- []
50
- end
47
+ def weapon_familiarity
48
+ []
49
+ end
51
50
 
52
- def traits
53
- [
54
- RacialTrait.new( :name => "Low-Light Vision",
55
- :description => "See 2x as far in dim light"
56
- ),
57
- RacialTrait.new( :name => "Elven Immunities",
58
- :description => "Immune to Magic Sleep, +2 save vs enchantments"
59
- ),
60
- RacialTrait.new( :name => "Elf Blood",
61
- :description => "Count as both Elves and Humans for effects"
62
- ),
63
- RacialTrait.new( :name => "Multitalented",
64
- :description => "You have two, instead of one, favored class"
65
- ),
66
- RacialTrait.new( :name => "Keen Senses",
67
- :description => "+2 Perception",
68
- :effects =>
69
- [
70
- PfrpgCore::Effect.new("skill", "perception", 2)
71
- ]
72
- )
73
- ]
74
- end
51
+ def traits
52
+ [
53
+ PfrpgRaces::RacialTrait.new( :name => "Low-Light Vision",
54
+ :description => "See 2x as far in dim light"
55
+ ),
56
+ PfrpgRaces::RacialTrait.new( :name => "Elven Immunities",
57
+ :description => "Immune to Magic Sleep, +2 save vs enchantments"
58
+ ),
59
+ PfrpgRaces::RacialTrait.new( :name => "Elf Blood",
60
+ :description => "Count as both Elves and Humans for effects"
61
+ ),
62
+ PfrpgRaces::RacialTrait.new( :name => "Multitalented",
63
+ :description => "You have two, instead of one, favored class"
64
+ ),
65
+ PfrpgRaces::RacialTrait.new( :name => "Keen Senses",
66
+ :description => "+2 Perception",
67
+ :effects =>
68
+ [
69
+ PfrpgCore::Effect.new("skill", "perception", 2)
70
+ ]
71
+ )
72
+ ]
75
73
  end
76
74
  end
@@ -1,75 +1,73 @@
1
- module PfrpgRaces
2
- class HalfOrc < Race
1
+ class PfrpgRaces::Race::HalfOrc < PfrpgRaces::Race
3
2
 
4
- def name
5
- "HalfOrc"
6
- end
3
+ def name
4
+ "HalfOrc"
5
+ end
7
6
 
8
- def description
9
- "Half-orcs average around 6 feet tall, with powerful builds and greenish or grayish skin. Their canine teeth often grow long enough to protrude from their mouths, and these “tusks,” combined with heavy brows and slightly pointed ears, give them their notoriously bestial appearance. While half-orcs may be impressive, few ever describe them as beautiful. Despite these obvious orc traits, half-orcs are as varied as their human parents."
10
- end
7
+ def description
8
+ "Half-orcs average around 6 feet tall, with powerful builds and greenish or grayish skin. Their canine teeth often grow long enough to protrude from their mouths, and these “tusks,” combined with heavy brows and slightly pointed ears, give them their notoriously bestial appearance. While half-orcs may be impressive, few ever describe them as beautiful. Despite these obvious orc traits, half-orcs are as varied as their human parents."
9
+ end
11
10
 
12
- def source
13
- "PFRPG"
14
- end
11
+ def source
12
+ "PFRPG"
13
+ end
15
14
 
16
- def attribute_bonuses
17
- nil
18
- end
15
+ def attribute_bonuses
16
+ nil
17
+ end
19
18
 
20
- def bonus_choices
21
- []
22
- end
19
+ def bonus_choices
20
+ []
21
+ end
23
22
 
24
- def languages
25
- ["Common", "Orc"]
26
- end
23
+ def languages
24
+ ["Common", "Orc"]
25
+ end
27
26
 
28
- def speed
29
- 30
30
- end
27
+ def speed
28
+ 30
29
+ end
31
30
 
32
- def int_languages
33
- ["Abyssal", "Draconic", "Giant", "Gnoll", "Goblin"]
34
- end
31
+ def int_languages
32
+ ["Abyssal", "Draconic", "Giant", "Gnoll", "Goblin"]
33
+ end
35
34
 
36
- def size
37
- "MEDIUM"
38
- end
35
+ def size
36
+ "MEDIUM"
37
+ end
39
38
 
40
- def choose_ability_bonus?
41
- true
42
- end
39
+ def choose_ability_bonus?
40
+ true
41
+ end
43
42
 
44
- def weapon_familiarity
45
- [ "Greataxe", 'Falchion']
46
- end
43
+ def weapon_familiarity
44
+ [ "Greataxe", 'Falchion']
45
+ end
47
46
 
48
- def martial_weapons
49
- "orc"
50
- end
47
+ def martial_weapons
48
+ "orc"
49
+ end
51
50
 
52
- def traits
53
- [
54
- RacialTrait.new( :name => "Darkvision",
55
- :description => "See in the dark up to 60 feet"
56
- ),
57
- RacialTrait.new( :name => "Intimidating",
58
- :description => "+2 racial bonus to intimidate skill checks",
59
- :effects =>
60
- [
61
- PfrpgCore::Effect.new("skill", "intimidate", 2)
62
- ]
63
- ),
64
- RacialTrait.new( :name => "Orc Blood",
65
- :description => "Count as both Orc and Human"
66
- ),
67
- RacialTrait.new( :name => "Orc Ferocity",
68
- :description => "1/day, if you are brought below 0 HP but not killed,\n
69
- you can fight on for one round as if disabled. You begin\n
70
- dying and fall unconscious if are not brought above 0 HP."
71
- )
72
- ]
73
- end
51
+ def traits
52
+ [
53
+ PfrpgRaces::RacialTrait.new( :name => "Darkvision",
54
+ :description => "See in the dark up to 60 feet"
55
+ ),
56
+ PfrpgRaces::RacialTrait.new( :name => "Intimidating",
57
+ :description => "+2 racial bonus to intimidate skill checks",
58
+ :effects =>
59
+ [
60
+ PfrpgCore::Effect.new("skill", "intimidate", 2)
61
+ ]
62
+ ),
63
+ PfrpgRaces::RacialTrait.new( :name => "Orc Blood",
64
+ :description => "Count as both Orc and Human"
65
+ ),
66
+ PfrpgRaces::RacialTrait.new( :name => "Orc Ferocity",
67
+ :description => "1/day, if you are brought below 0 HP but not killed,\n
68
+ you can fight on for one round as if disabled. You begin\n
69
+ dying and fall unconscious if are not brought above 0 HP."
70
+ )
71
+ ]
74
72
  end
75
73
  end
@@ -1,87 +1,86 @@
1
- module PfrpgRaces
2
- class Halfling < Race
1
+ class PfrpgRaces::Race::Halfling < PfrpgRaces::Race
3
2
 
4
- def name
5
- "Halfling"
6
- end
3
+ def name
4
+ "Halfling"
5
+ end
7
6
 
8
- def description
9
- "Halflings are nimble and strong-willed, but their small stature makes them weaker than other races. They gain +2 Dexterity, +2 Charisma, and –2 Strength."
10
- end
7
+ def description
8
+ "Halflings are nimble and strong-willed, but their small stature makes them weaker than other races. They gain +2 Dexterity, +2 Charisma, and –2 Strength."
9
+ end
11
10
 
12
- def source
13
- "PFRPG"
14
- end
11
+ def source
12
+ "PFRPG"
13
+ end
15
14
 
16
- def attribute_bonuses
17
- [ { 'DEX' => 2 },
18
- { 'CHA' => 2 },
19
- { 'STR' => -2 }
20
- ]
21
- end
15
+ def attribute_bonuses
16
+ [
17
+ PfrpgRaces::StatBonus.new('DEX',2),
18
+ PfrpgRaces::StatBonus.new('CHA',2),
19
+ PfrpgRaces::StatBonus.new('STR',-2)
20
+ ]
21
+ end
22
22
 
23
- def bonus_choices
24
- []
25
- end
23
+ def bonus_choices
24
+ []
25
+ end
26
26
 
27
- def languages
28
- ["Common", "Halfling"]
29
- end
27
+ def languages
28
+ ["Common", "Halfling"]
29
+ end
30
30
 
31
- def speed
32
- 20
33
- end
31
+ def speed
32
+ 20
33
+ end
34
34
 
35
- def int_languages
36
- ["Dwarven", "Elven", "Gnome", "Goblin"]
37
- end
35
+ def int_languages
36
+ ["Dwarven", "Elven", "Gnome", "Goblin"]
37
+ end
38
38
 
39
- def size
40
- "SMALL"
41
- end
39
+ def size
40
+ "SMALL"
41
+ end
42
42
 
43
- def choose_ability_bonus?
44
- false
45
- end
43
+ def choose_ability_bonus?
44
+ false
45
+ end
46
46
 
47
- def weapon_familiarity
48
- [ "Sling" ]
49
- end
47
+ def weapon_familiarity
48
+ [ "Sling" ]
49
+ end
50
50
 
51
- def martial_weapons
52
- "halfling"
53
- end
51
+ def martial_weapons
52
+ "halfling"
53
+ end
54
54
 
55
- def traits
56
- [
57
- RacialTrait.new( :name => "Fearless",
58
- :description => "+2 racial bonus save vs fear (This stacks with Luck)"
59
- ),
60
- RacialTrait.new( :name => "Halfling Luck",
61
- :description => "+1 racial bonus to all saving throws",
62
- :effects =>
63
- [
64
- PfrpgCore::Effect.new("racial", "fort_save", 1),
65
- PfrpgCore::Effect.new("racial", "will_save", 1),
66
- PfrpgCore::Effect.new("racial", "ref_save", 1)
67
- ]
68
- ),
69
- RacialTrait.new( :name => "Sure Footed",
70
- :description => "+2 racial bonus on Acrobatic & Climb skill checks",
71
- :effects =>
72
- [
73
- PfrpgCore::Effect.new("skill", "climb", 2),
74
- PfrpgCore::Effect.new("skill", "acrobatics", 2)
75
- ]
76
- ),
77
- RacialTrait.new( :name => "Keen Senses",
78
- :description => "+2 Perception",
79
- :effects =>
80
- [
81
- PfrpgCore::Effect.new("skill", "perception", 2)
82
- ]
83
- )
84
- ]
85
- end
55
+ def traits
56
+ [
57
+ PfrpgRaces::RacialTrait.new( :name => "Fearless",
58
+ :description => "+2 racial bonus save vs fear (This stacks with Luck)"
59
+ ),
60
+ PfrpgRaces::RacialTrait.new( :name => "Halfling Luck",
61
+ :description => "+1 racial bonus to all saving throws",
62
+ :effects =>
63
+ [
64
+ PfrpgCore::Effect.new("racial", "fort_save", 1),
65
+ PfrpgCore::Effect.new("racial", "will_save", 1),
66
+ PfrpgCore::Effect.new("racial", "ref_save", 1)
67
+ ]
68
+ ),
69
+ PfrpgRaces::RacialTrait.new( :name => "Sure Footed",
70
+ :description => "+2 racial bonus on Acrobatic & Climb skill checks",
71
+ :effects =>
72
+ [
73
+ PfrpgCore::Effect.new("skill", "climb", 2),
74
+ PfrpgCore::Effect.new("skill", "acrobatics", 2)
75
+ ]
76
+ ),
77
+ PfrpgRaces::RacialTrait.new( :name => "Keen Senses",
78
+ :description => "+2 Perception",
79
+ :effects =>
80
+ [
81
+ PfrpgCore::Effect.new("skill", "perception", 2)
82
+ ]
83
+ )
84
+ ]
86
85
  end
87
86
  end
@@ -1,4 +1,4 @@
1
- class Human < PfrpgRaces::Race
1
+ class PfrpgRaces::Race::Human < PfrpgRaces::Race
2
2
 
3
3
  def name
4
4
  "Human"
@@ -29,7 +29,7 @@ class Human < PfrpgRaces::Race
29
29
  end
30
30
 
31
31
  def int_languages
32
- Tables::Languages.int_languages
32
+ PfrpgTables::Tables::Languages.int_languages
33
33
  end
34
34
 
35
35
  def size
@@ -1,5 +1,5 @@
1
1
  module PfrpgRaces
2
- class RacialTrait
2
+ class PfrpgRaces::RacialTrait
3
3
 
4
4
  attr_accessor :name, :description, :effects
5
5
  def initialize(args)
@@ -0,0 +1,13 @@
1
+ class PfrpgRaces::StatBonus
2
+ include ::PfrpgCore::Affectable
3
+ attr_reader :stat, :bonus
4
+ def initialize(stat, bonus)
5
+ @stat = stat
6
+ @bonus = bonus
7
+ end
8
+
9
+ def effects
10
+ "attribute:#{stat.downcase}:#{bonus}"
11
+ end
12
+
13
+ end
@@ -1,3 +1,3 @@
1
1
  module PfrpgRaces
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.0"
3
3
  end
data/lib/pfrpg_races.rb CHANGED
@@ -1,4 +1,8 @@
1
+ module PfrpgRules
2
+ end
3
+
1
4
  require 'pfrpg_races/race'
5
+ require 'pfrpg_races/stat_bonus'
2
6
  require 'pfrpg_races/racial_trait'
3
7
  require 'pfrpg_races/raced'
4
8
  require 'pfrpg_races/races/elf'
@@ -7,7 +11,4 @@ require 'pfrpg_races/races/halfling'
7
11
  require 'pfrpg_races/races/half_orc'
8
12
  require 'pfrpg_races/races/half_elf'
9
13
  require 'pfrpg_races/races/gnome'
10
- require 'pfrpg_races/races/human'
11
-
12
- module PfrpgRules
13
- end
14
+ require 'pfrpg_races/races/human'
data/test/race_test.rb ADDED
@@ -0,0 +1,16 @@
1
+ require 'minitest/autorun'
2
+ require 'pfrpg_races'
3
+
4
+ class RaceTest < Minitest::Test
5
+
6
+ def test_trivial_race
7
+ assert PfrpgRaces::Race.fetch('Elf')
8
+ assert PfrpgRaces::Race.fetch('Dwarf')
9
+ assert PfrpgRaces::Race.fetch('Halfling')
10
+ assert PfrpgRaces::Race.fetch('Human')
11
+ assert PfrpgRaces::Race.fetch('Gnome')
12
+ assert PfrpgRaces::Race.fetch('HalfElf')
13
+ assert PfrpgRaces::Race.fetch('HalfOrf')
14
+ end
15
+
16
+ end
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pfrpg_races
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordan OMara
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-11 00:00:00.000000000 Z
11
+ date: 2014-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: 4.1.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: 4.1.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: sqlite3
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  description: races
@@ -45,7 +45,6 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
- - lib/pfrpg_races.rb
49
48
  - lib/pfrpg_races/race.rb
50
49
  - lib/pfrpg_races/raced.rb
51
50
  - lib/pfrpg_races/races/dwarf.rb
@@ -56,8 +55,12 @@ files:
56
55
  - lib/pfrpg_races/races/halfling.rb
57
56
  - lib/pfrpg_races/races/human.rb
58
57
  - lib/pfrpg_races/racial_trait.rb
58
+ - lib/pfrpg_races/stat_bonus.rb
59
59
  - lib/pfrpg_races/tickle.rb
60
60
  - lib/pfrpg_races/version.rb
61
+ - lib/pfrpg_races.rb
62
+ - Rakefile
63
+ - test/race_test.rb
61
64
  homepage: http://herosheets.com
62
65
  licenses: []
63
66
  metadata: {}
@@ -67,18 +70,19 @@ require_paths:
67
70
  - lib
68
71
  required_ruby_version: !ruby/object:Gem::Requirement
69
72
  requirements:
70
- - - ">="
73
+ - - '>='
71
74
  - !ruby/object:Gem::Version
72
75
  version: '0'
73
76
  required_rubygems_version: !ruby/object:Gem::Requirement
74
77
  requirements:
75
- - - ">="
78
+ - - '>='
76
79
  - !ruby/object:Gem::Version
77
80
  version: '0'
78
81
  requirements: []
79
82
  rubyforge_project:
80
- rubygems_version: 2.2.2
83
+ rubygems_version: 2.0.14
81
84
  signing_key:
82
85
  specification_version: 4
83
86
  summary: PFRPG races
84
- test_files: []
87
+ test_files:
88
+ - test/race_test.rb