pathfinder_deck_builder 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bc715e9f94614389f6196e0599315b892d3d01db
4
- data.tar.gz: 8a634a87016b916ad7cce40eb48e2e89d641cdcb
3
+ metadata.gz: e36c69dc10540dab7d262cb78e34d312177696b2
4
+ data.tar.gz: 2711b5d8114a0daa50622916b99cb58f35300c0e
5
5
  SHA512:
6
- metadata.gz: ccb3739470e80b8b020544fa7e0e2e21c9466b4358302e93b2674f6952227a16109207c81493bb79440902cb83868008883bb51d7078075458d4400083eb2274
7
- data.tar.gz: f268f25b6d19dd91eeece4cbc13cbaf37d65526c833e46709ea42c0614e6225523f5be0fc650657357c49d109cd262baea85b68508b696289df68734e10cb270
6
+ metadata.gz: 1a45d7522d81fe30507ef4bcb1676ada7239eb601419e4c15d19dc267309c3369a63b536a78c8f901dc0edea2537dcb4e69fe6a4f474493fe3b1691c4fd8442f
7
+ data.tar.gz: 63fb014e82ea52ba9435ae1acb27c003ea7f77f316b2bad63fe2802286e31f87c9fcf6082d778afcaeb9d66fccc4145f3235f375ddfc732851686d2a4e81cebc
data/lib/armor_card.rb CHANGED
@@ -1,41 +1,43 @@
1
1
  require_relative 'card'
2
2
 
3
- class ArmorCard < Card
3
+ module PathfinderDeckBuilder
4
+ class ArmorCard < Card
4
5
 
5
- def create_card(index=nil)
6
- super
7
- end
6
+ def create_card(index=nil)
7
+ super
8
+ end
8
9
 
9
- def set_class_path
10
- @class_path = @armor_path
11
- end
10
+ def set_class_path
11
+ @class_path = @armor_path
12
+ end
12
13
 
13
- def assembled_card(path)
14
- super
15
- end
14
+ def assembled_card(path)
15
+ super
16
+ end
16
17
 
17
- def static_content
18
- {
19
- "count": 1,
20
- "color": "grey",
21
- "title": "Armor",
22
- "icon": "anvil"
23
- }
24
- end
18
+ def static_content
19
+ {
20
+ "count": 1,
21
+ "color": "grey",
22
+ "title": "Armor",
23
+ "icon": "anvil"
24
+ }
25
+ end
25
26
 
26
- def variable_content(path)
27
- {
28
- "contents": [
29
- "subtitle | #{path["name"]}",
30
- "rule",
31
- "property | AC | #{path["ac"]}",
32
- "property | Weight | #{path["weight"]["text"]}",
33
- "property | Cost | #{path["cost"]["text"]}",
34
- "property | Quantity | #{path["quantity"]}",
35
- "fill",
36
- "section | Description",
37
- "text | #{path["description"]}"[0..500]
38
- ]
39
- }
27
+ def variable_content(path)
28
+ {
29
+ "contents": [
30
+ "subtitle | #{path["name"]}",
31
+ "rule",
32
+ "property | AC | #{path["ac"]}",
33
+ "property | Weight | #{path["weight"]["text"]}",
34
+ "property | Cost | #{path["cost"]["text"]}",
35
+ "property | Quantity | #{path["quantity"]}",
36
+ "fill",
37
+ "section | Description",
38
+ "text | #{path["description"]}"[0..500]
39
+ ]
40
+ }
41
+ end
40
42
  end
41
- end
43
+ end
data/lib/card.rb CHANGED
@@ -1,88 +1,91 @@
1
- class Card
2
- attr_accessor :class_cards, :index
3
-
4
- def initialize(xml_file=nil)
5
- @class_cards = []
6
- @xml_file = xml_file
7
- end
1
+ module PathfinderDeckBuilder
2
+ class Card
3
+ attr_accessor :class_cards, :index
4
+ attr_reader :class_path
5
+
6
+ def initialize(xml_file=nil)
7
+ @class_cards = []
8
+ @xml_file = xml_file
9
+ end
8
10
 
9
- def create_card(index=nil)
10
- @index = index
11
- set_paths
12
- set_class_path
11
+ def create_card(index=nil)
12
+ @index = index
13
+ set_paths
14
+ set_class_path
13
15
 
14
- unless @class_path.nil?
15
- if @class_path.class == Hash
16
- @class_cards.push(assembled_card(@class_path))
17
- else
18
- @class_path.each { |path| @class_cards.push(assembled_card(path)) }
16
+ unless @class_path.nil?
17
+ if @class_path.class == Hash
18
+ @class_cards.push(assembled_card(@class_path))
19
+ else
20
+ @class_path.each { |path| @class_cards.push(assembled_card(path)) }
21
+ end
19
22
  end
20
23
  end
21
- end
22
24
 
23
- def set_class_path
24
- :must_implement
25
- end
25
+ def set_class_path
26
+ :must_implement
27
+ end
26
28
 
27
- def set_paths
28
- @path_shortcut = @xml_file["document"]["public"]["character"]
29
+ def set_paths
30
+ @path_shortcut = @xml_file["document"]["public"]["character"]
29
31
 
30
- if @index
31
- set_multiple_character_path
32
- else
33
- set_single_character_path
32
+ if @index
33
+ set_multiple_character_path
34
+ else
35
+ set_single_character_path
36
+ end
34
37
  end
35
- end
36
38
 
37
- def set_single_character_path
38
- @character_path = @path_shortcut
39
- @ac_path = @path_shortcut["armorclass"]
40
- @initiative_path = @path_shortcut["armorclass"]
41
- @movement_path = @path_shortcut["movement"]
42
- @attack_path = @path_shortcut["attack"]
43
- @attribute_path = @path_shortcut["attributes"]["attribute"]
44
- @defensive_ability_path = @path_shortcut["defensive"]["special"] if @path_shortcut["defensive"] != nil
45
- @feat_path = @path_shortcut["feats"]["feat"] if @path_shortcut["feats"] != nil
46
- @armor_path = @path_shortcut["defenses"]["armor"] if @path_shortcut["defenses"]["armor"] != nil
47
- @skill_path = @path_shortcut["skills"]["skill"] if @path_shortcut["skills"]["skill"] != nil
48
- @special_ability_path = @path_shortcut["otherspecials"]["special"] if @path_shortcut["otherspecials"]["special"] != nil
49
- @trait_path = @path_shortcut["traits"]["trait"] if @path_shortcut["traits"]["trait"] != nil
50
- @tracked_resource_path = @path_shortcut["trackedresources"]["trackedresource"] if @path_shortcut["trackedresources"]["trackedresource"] != nil
51
- @spell_path = @path_shortcut["spellsmemorized"]["spell"] if @path_shortcut["spellsmemorized"] != nil
52
- @special_attack_path = @path_shortcut["attack"]["special"] if @path_shortcut["attack"]["special"] != nil
53
- @melee_weapons_path = @path_shortcut["melee"]["weapon"] if @path_shortcut["melee"] != nil
54
- @ranged_weapons_path = @path_shortcut["ranged"]["weapon"] if @path_shortcut["ranged"] != nil
55
- end
39
+ def set_single_character_path
40
+ @character_path = @path_shortcut
41
+ @ac_path = @path_shortcut["armorclass"]
42
+ @initiative_path = @path_shortcut["armorclass"]
43
+ @movement_path = @path_shortcut["movement"]
44
+ @attack_path = @path_shortcut["attack"]
45
+ @attribute_path = @path_shortcut["attributes"]["attribute"]
46
+ @defensive_ability_path = @path_shortcut["defensive"]["special"] if @path_shortcut["defensive"] != nil
47
+ @feat_path = @path_shortcut["feats"]["feat"] if @path_shortcut["feats"] != nil
48
+ @armor_path = @path_shortcut["defenses"]["armor"] if @path_shortcut["defenses"]["armor"] != nil
49
+ @skill_path = @path_shortcut["skills"]["skill"] if @path_shortcut["skills"]["skill"] != nil
50
+ @special_ability_path = @path_shortcut["otherspecials"]["special"] if @path_shortcut["otherspecials"]["special"] != nil
51
+ @trait_path = @path_shortcut["traits"]["trait"] if @path_shortcut["traits"]["trait"] != nil
52
+ @tracked_resource_path = @path_shortcut["trackedresources"]["trackedresource"] if @path_shortcut["trackedresources"]["trackedresource"] != nil
53
+ @spell_path = @path_shortcut["spellsmemorized"]["spell"] if @path_shortcut["spellsmemorized"] != nil
54
+ @special_attack_path = @path_shortcut["attack"]["special"] if @path_shortcut["attack"]["special"] != nil
55
+ @melee_weapons_path = @path_shortcut["melee"]["weapon"] if @path_shortcut["melee"] != nil
56
+ @ranged_weapons_path = @path_shortcut["ranged"]["weapon"] if @path_shortcut["ranged"] != nil
57
+ end
56
58
 
57
- def set_multiple_character_path
58
- @character_path = @path_shortcut[@index]
59
- @ac_path = @path_shortcut[@index]["armorclass"]
60
- @initiative_path = @path_shortcut[@index]["armorclass"]
61
- @movement_path = @path_shortcut[@index]["movement"]
62
- @attack_path = @path_shortcut[@index]["attack"]
63
- @attribute_path = @path_shortcut[@index]["attributes"]["attribute"]
64
- @defensive_ability_path = @path_shortcut[@index]["defensive"]["special"] if @path_shortcut[@index]["defensive"] != nil
65
- @feat_path = @path_shortcut[@index]["feats"]["feat"] if @path_shortcut[@index]["feats"] != nil
66
- @armor_path = @path_shortcut[@index]["defenses"]["armor"] if @path_shortcut[@index]["defenses"]["armor"] != nil
67
- @skill_path = @path_shortcut[@index]["skills"]["skill"] if @path_shortcut[@index]["skills"]["skill"] != nil
68
- @special_ability_path = @path_shortcut[@index]["otherspecials"]["special"] if @path_shortcut[@index]["otherspecials"]["special"] != nil
69
- @trait_path = @path_shortcut[@index]["traits"]["trait"] if @path_shortcut[@index]["traits"]["trait"] != nil
70
- @tracked_resource_path = @path_shortcut[@index]["trackedresources"]["trackedresource"] if @path_shortcut[@index]["trackedresources"]["trackedresource"] != nil
71
- @spell_path = @path_shortcut[@index]["spellsmemorized"]["spell"] if @path_shortcut[@index]["spellsmemorized"] != nil
72
- @special_attack_path = @path_shortcut[@index]["attack"]["special"] if @path_shortcut[@index]["attack"]["special"] != nil
73
- @melee_weapons_path = @path_shortcut[@index]["melee"]["weapon"] if @path_shortcut[@index]["melee"] != nil
74
- @ranged_weapons_path = @path_shortcut[@index]["ranged"]["weapon"] if @path_shortcut[@index]["ranged"] != nil
75
- end
59
+ def set_multiple_character_path
60
+ @character_path = @path_shortcut[@index]
61
+ @ac_path = @path_shortcut[@index]["armorclass"]
62
+ @initiative_path = @path_shortcut[@index]["armorclass"]
63
+ @movement_path = @path_shortcut[@index]["movement"]
64
+ @attack_path = @path_shortcut[@index]["attack"]
65
+ @attribute_path = @path_shortcut[@index]["attributes"]["attribute"]
66
+ @defensive_ability_path = @path_shortcut[@index]["defensive"]["special"] if @path_shortcut[@index]["defensive"] != nil
67
+ @feat_path = @path_shortcut[@index]["feats"]["feat"] if @path_shortcut[@index]["feats"] != nil
68
+ @armor_path = @path_shortcut[@index]["defenses"]["armor"] if @path_shortcut[@index]["defenses"]["armor"] != nil
69
+ @skill_path = @path_shortcut[@index]["skills"]["skill"] if @path_shortcut[@index]["skills"]["skill"] != nil
70
+ @special_ability_path = @path_shortcut[@index]["otherspecials"]["special"] if @path_shortcut[@index]["otherspecials"]["special"] != nil
71
+ @trait_path = @path_shortcut[@index]["traits"]["trait"] if @path_shortcut[@index]["traits"]["trait"] != nil
72
+ @tracked_resource_path = @path_shortcut[@index]["trackedresources"]["trackedresource"] if @path_shortcut[@index]["trackedresources"]["trackedresource"] != nil
73
+ @spell_path = @path_shortcut[@index]["spellsmemorized"]["spell"] if @path_shortcut[@index]["spellsmemorized"] != nil
74
+ @special_attack_path = @path_shortcut[@index]["attack"]["special"] if @path_shortcut[@index]["attack"]["special"] != nil
75
+ @melee_weapons_path = @path_shortcut[@index]["melee"]["weapon"] if @path_shortcut[@index]["melee"] != nil
76
+ @ranged_weapons_path = @path_shortcut[@index]["ranged"]["weapon"] if @path_shortcut[@index]["ranged"] != nil
77
+ end
76
78
 
77
- def assembled_card(path)
78
- static_content.merge(variable_content(path))
79
- end
79
+ def assembled_card(path)
80
+ static_content.merge(variable_content(path))
81
+ end
80
82
 
81
- def static_content
82
- #non-iterative JSON goes here
83
- end
83
+ def static_content
84
+ #non-iterative JSON goes here
85
+ end
84
86
 
85
- def variable_content
86
- #iterative JSON goes here
87
+ def variable_content
88
+ #iterative JSON goes here
89
+ end
87
90
  end
88
91
  end
@@ -1,42 +1,45 @@
1
1
  require_relative 'card'
2
- class CharacterCard < Card
3
2
 
4
- def initialize(xml_file)
5
- super
6
- end
3
+ module PathfinderDeckBuilder
4
+ class CharacterCard < PathfinderDeckBuilder::Card
7
5
 
8
- def create_card(index=nil)
9
- @index = index
10
- set_paths
11
- @class_cards.push(assembled_card)
12
- end
6
+ def initialize(xml_file)
7
+ super
8
+ end
13
9
 
14
- def set_class_path
15
- @class_path = @character_path
16
- end
10
+ def create_card(index=nil)
11
+ @index = index
12
+ set_paths
13
+ @class_cards.push(assembled_card)
14
+ end
15
+
16
+ def set_class_path
17
+ @class_path = @character_path
18
+ end
17
19
 
18
- def assembled_card
19
- {
20
- "count" => 1,
21
- "color": "blue",
22
- "title": "#{@character_path["name"]}",
23
- "icon": nil,
24
- "contents": [
25
- "subtitle | Character Info",
26
- "property | Base HP | #{@character_path["health"]["hitpoints"]}",
27
- "property | Race | #{@character_path["race"]["name"].capitalize}",
28
- "property | Ethnicity | #{@character_path["race"]["ethnicity"].capitalize}",
29
- "section | Combat",
30
- "property | AC | #{@ac_path["ac"]}",
31
- "property | Touch AC | #{@character_path["armorclass"]["touch"]}",
32
- "property | Flat-Footed AC | #{@character_path["armorclass"]["flatfooted"]}",
33
- "property | Attack Bonus | #{@attack_path["attackbonus"]}",
34
- "property | Initiative | #{@character_path["initiative"]["total"]}",
35
- "property | Movement | #{@character_path["movement"]["basespeed"]["text"]}",
36
- "fill",
37
- "rule",
38
- "dndstats | #{@attribute_path[0]["attrvalue"]["base"]} | #{@attribute_path[1]["attrvalue"]["base"]} | #{@attribute_path[2]["attrvalue"]["base"]} | #{@attribute_path[3]["attrvalue"]["base"]} | #{@attribute_path[4]["attrvalue"]["base"]} | #{@attribute_path[5]["attrvalue"]["base"]}"
39
- ]
40
- }
20
+ def assembled_card
21
+ {
22
+ "count" => 1,
23
+ "color": "blue",
24
+ "title": "#{@character_path["name"]}",
25
+ "icon": nil,
26
+ "contents": [
27
+ "subtitle | Character Info",
28
+ "property | Base HP | #{@character_path["health"]["hitpoints"]}",
29
+ "property | Race | #{@character_path["race"]["name"].capitalize}",
30
+ "property | Ethnicity | #{@character_path["race"]["ethnicity"].capitalize}",
31
+ "section | Combat",
32
+ "property | AC | #{@ac_path["ac"]}",
33
+ "property | Touch AC | #{@character_path["armorclass"]["touch"]}",
34
+ "property | Flat-Footed AC | #{@character_path["armorclass"]["flatfooted"]}",
35
+ "property | Attack Bonus | #{@attack_path["attackbonus"]}",
36
+ "property | Initiative | #{@character_path["initiative"]["total"]}",
37
+ "property | Movement | #{@character_path["movement"]["basespeed"]["text"]}",
38
+ "fill",
39
+ "rule",
40
+ "dndstats | #{@attribute_path[0]["attrvalue"]["base"]} | #{@attribute_path[1]["attrvalue"]["base"]} | #{@attribute_path[2]["attrvalue"]["base"]} | #{@attribute_path[3]["attrvalue"]["base"]} | #{@attribute_path[4]["attrvalue"]["base"]} | #{@attribute_path[5]["attrvalue"]["base"]}"
41
+ ]
42
+ }
43
+ end
41
44
  end
42
45
  end
data/lib/compiler.rb CHANGED
@@ -14,85 +14,88 @@ require_relative 'special_ability_card'
14
14
  require_relative 'special_attack_card'
15
15
  require_relative 'deck'
16
16
 
17
- class Compiler
18
- attr_accessor :deck
17
+ module PathfinderDeckBuilder
18
+ class Compiler
19
+ attr_accessor :deck
20
+ attr_reader :setup_cards, :file_path, :myXML
19
21
 
20
- def initialize(file_path)
21
- @file_path = file_path
22
- end
23
-
24
- def is_party?
25
- Crack::XML.parse(File.read(@file_path))["document"]["public"]["character"].class == Array
26
- end
27
-
28
- def compile_individual
29
- @myXML = Crack::XML.parse(File.read(@file_path))
30
- setup
22
+ def initialize(file_path)
23
+ @file_path = file_path
24
+ end
25
+
26
+ def is_party?
27
+ Crack::XML.parse(File.read(@file_path))["document"]["public"]["character"].class == Array
28
+ end
31
29
 
30
+ def compile_individual
31
+ read_file_path
32
32
 
33
- @setup_cards.each { |card| card.create_card }
33
+ build_cards
34
34
 
35
- @setup_cards.each do |card|
36
- card.class_cards.each {|class_card| @deck.cards << class_card}
35
+ save_deck("#{@deck.cards.first[:title]}"+".json")
37
36
  end
38
37
 
39
- @deck.save_deck("#{@file_path.split(".")[0]}"+".json")
38
+ def compile_party
39
+ read_file_path
40
+ @myXML["document"]["public"]["character"].each_with_index do |character, index|
40
41
 
41
- puts "Please check your current directory for a JSON file with your deck name."
42
- end
42
+ build_cards(index)
43
43
 
44
- def compile_party
45
- @myXML = Crack::XML.parse(File.read(@file_path))
46
- @myXML["document"]["public"]["character"].each_with_index do |fun_stuff, index|
47
- setup
44
+ save_deck("#{character["name"]}"+".json")
45
+ end
46
+ end
48
47
 
49
- @setup_cards.each { |card| card.create_card(index) }
48
+ def prepare_for_s3
49
+ read_file_path
50
+
51
+ build_cards
50
52
 
51
- @setup_cards.each do |card|
52
- card.class_cards.each {|class_card| @deck.cards << class_card}
53
- end
53
+ return @deck.cards
54
+ end
54
55
 
55
- @deck.save_deck("#{fun_stuff["name"]}"+".json")
56
+ def setup
57
+ @deck = PathfinderDeckBuilder::Deck.new
58
+ @setup_cards = [
59
+ @character = PathfinderDeckBuilder::CharacterCard.new(@myXML),
60
+ @melee_weapons = PathfinderDeckBuilder::MeleeWeaponCard.new(@myXML),
61
+ @ranged_weapons = PathfinderDeckBuilder::RangedWeaponCard.new(@myXML),
62
+ @armors = PathfinderDeckBuilder::ArmorCard.new(@myXML),
63
+ @tracked_resources = PathfinderDeckBuilder::TrackedResourceCard.new(@myXML),
64
+ @spells = PathfinderDeckBuilder::SpellCard.new(@myXML),
65
+ @skills = PathfinderDeckBuilder::SkillCard.new(@myXML),
66
+ @defenses = PathfinderDeckBuilder::DefensiveAbilityCard.new(@myXML),
67
+ @feats = PathfinderDeckBuilder::FeatCard.new(@myXML),
68
+ @traits = PathfinderDeckBuilder::TraitCard.new(@myXML),
69
+ @special_abilities = PathfinderDeckBuilder::SpecialAbilityCard.new(@myXML),
70
+ @special_attacks = PathfinderDeckBuilder::SpecialAttackCard.new(@myXML)
71
+ ]
72
+ end
73
+
74
+ def compile
75
+ if is_party?
76
+ compile_party
77
+ else
78
+ compile_individual
79
+ end
80
+ end
56
81
 
82
+ def save_deck(file_name)
83
+ @deck.save_deck(file_name)
57
84
  puts "Please check your current directory for a JSON file with your deck name."
58
85
  end
59
- end
60
86
 
61
- def prepare_for_s3
62
- @myXML = Crack::XML.parse(File.read(@file_path))
63
- setup
87
+ def build_cards(index=nil)
88
+ setup
64
89
 
65
- @setup_cards.each { |card| card.create_card }
90
+ @setup_cards.each { |card| card.create_card(index) }
66
91
 
67
- @setup_cards.each do |card|
68
- card.class_cards.each {|class_card| @deck.cards << class_card}
92
+ @setup_cards.each do |card|
93
+ card.class_cards.each {|class_card| @deck.cards << class_card}
94
+ end
69
95
  end
70
- return @deck.cards
71
- end
72
-
73
- def setup
74
- @deck = Deck.new
75
- @setup_cards = [
76
- @character = CharacterCard.new(@myXML),
77
- @melee_weapons = MeleeWeaponCard.new(@myXML),
78
- @ranged_weapons = RangedWeaponCard.new(@myXML),
79
- @armors = ArmorCard.new(@myXML),
80
- @tracked_resources = TrackedResourceCard.new(@myXML),
81
- @spells = SpellCard.new(@myXML),
82
- @skills = SkillCard.new(@myXML),
83
- @defenses = DefensiveAbilityCard.new(@myXML),
84
- @feats = FeatCard.new(@myXML),
85
- @traits = TraitCard.new(@myXML),
86
- @special_abilities = SpecialAbilityCard.new(@myXML),
87
- @special_attacks = SpecialAttackCard.new(@myXML)
88
- ]
89
- end
90
96
 
91
- def compile
92
- if self.is_party?
93
- compile_party
94
- else
95
- compile_individual
97
+ def read_file_path
98
+ @myXML = Crack::XML.parse(File.read(@file_path))
96
99
  end
97
100
  end
98
101
  end
data/lib/deck.rb CHANGED
@@ -1,14 +1,15 @@
1
- require 'pry'
2
- class Deck
3
- attr_accessor :cards
1
+ module PathfinderDeckBuilder
2
+ class Deck
3
+ attr_accessor :cards
4
4
 
5
- def initialize
6
- @cards = []
7
- end
5
+ def initialize
6
+ @cards = []
7
+ end
8
8
 
9
- def save_deck(to_file="new_deck.json")
10
- File.open(to_file, "w") do |file|
11
- file.puts JSON.pretty_generate(@cards)
9
+ def save_deck(to_file="new_deck.json")
10
+ File.open(to_file, "w") do |file|
11
+ file.puts JSON.pretty_generate(@cards)
12
+ end
12
13
  end
13
14
  end
14
15
  end
@@ -1,37 +1,40 @@
1
1
  require_relative 'card'
2
- class DefensiveAbilityCard < Card
3
2
 
4
- def create_card(index=nil)
5
- super
6
- end
3
+ module PathfinderDeckBuilder
4
+ class DefensiveAbilityCard < PathfinderDeckBuilder::Card
7
5
 
8
- def set_class_path
9
- @class_path = @defensive_ability_path
10
- end
6
+ def create_card(index=nil)
7
+ super
8
+ end
11
9
 
12
- def assembled_card(path)
13
- super
14
- end
10
+ def set_class_path
11
+ @class_path = @defensive_ability_path
12
+ end
15
13
 
16
- def static_content
17
- {
18
- "count": 1,
19
- "color": "green",
20
- "title": "Defensive Ability",
21
- "icon": "spiked-shell"
22
- }
23
- end
14
+ def assembled_card(path)
15
+ super
16
+ end
17
+
18
+ def static_content
19
+ {
20
+ "count": 1,
21
+ "color": "green",
22
+ "title": "Defensive Ability",
23
+ "icon": "spiked-shell"
24
+ }
25
+ end
24
26
 
25
- def variable_content(path)
26
- {
27
- "contents": [
28
- "subtitle | #{path["shortname"]}",
29
- "rule",
30
- "property | Type | #{path["type"]}",
31
- "fill",
32
- "section | Description",
33
- "text | #{path["description"]}"[0..318]
34
- ]
35
- }
27
+ def variable_content(path)
28
+ {
29
+ "contents": [
30
+ "subtitle | #{path["shortname"]}",
31
+ "rule",
32
+ "property | Type | #{path["type"]}",
33
+ "fill",
34
+ "section | Description",
35
+ "text | #{path["description"]}"[0..318]
36
+ ]
37
+ }
38
+ end
36
39
  end
37
40
  end
data/lib/feat_card.rb CHANGED
@@ -1,37 +1,39 @@
1
1
  require_relative 'card'
2
2
 
3
- class FeatCard < Card
3
+ module PathfinderDeckBuilder
4
+ class FeatCard < PathfinderDeckBuilder::Card
4
5
 
5
- def create_card(index=nil)
6
- super
7
- end
6
+ def create_card(index=nil)
7
+ super
8
+ end
8
9
 
9
- def set_class_path
10
- @class_path = @feat_path
11
- end
10
+ def set_class_path
11
+ @class_path = @feat_path
12
+ end
12
13
 
13
- def assembled_card(path)
14
- super
15
- end
14
+ def assembled_card(path)
15
+ super
16
+ end
16
17
 
17
- def static_content
18
- {
19
- "count": 1,
20
- "color": "green",
21
- "title": "Feat",
22
- "icon": "foot-trip"
23
- }
24
- end
18
+ def static_content
19
+ {
20
+ "count": 1,
21
+ "color": "green",
22
+ "title": "Feat",
23
+ "icon": "foot-trip"
24
+ }
25
+ end
25
26
 
26
- def variable_content(path)
27
- {
28
- "contents": [
29
- "subtitle | #{path["name"]}",
30
- "rule",
31
- "property | Category | #{path["categorytext"]}",
32
- "section | Description",
33
- "text | #{path["description"]}"[0..318]
34
- ]
35
- }
27
+ def variable_content(path)
28
+ {
29
+ "contents": [
30
+ "subtitle | #{path["name"]}",
31
+ "rule",
32
+ "property | Category | #{path["categorytext"]}",
33
+ "section | Description",
34
+ "text | #{path["description"]}"[0..318]
35
+ ]
36
+ }
37
+ end
36
38
  end
37
39
  end
@@ -1,39 +1,41 @@
1
1
  require_relative 'card'
2
2
 
3
- class MeleeWeaponCard < Card
3
+ module PathfinderDeckBuilder
4
+ class MeleeWeaponCard < PathfinderDeckBuilder::Card
4
5
 
5
- def create_card(index=nil)
6
- super
7
- end
6
+ def create_card(index=nil)
7
+ super
8
+ end
8
9
 
9
- def set_class_path
10
- @class_path = @melee_weapons_path
11
- end
10
+ def set_class_path
11
+ @class_path = @melee_weapons_path
12
+ end
12
13
 
13
- def assembled_card(path)
14
- super
15
- end
14
+ def assembled_card(path)
15
+ super
16
+ end
16
17
 
17
- def static_content
18
- {
19
- "count": 1,
20
- "color": "red",
21
- "title": "Melee Weapon",
22
- "icon": "battle-axe"
23
- }
24
- end
18
+ def static_content
19
+ {
20
+ "count": 1,
21
+ "color": "red",
22
+ "title": "Melee Weapon",
23
+ "icon": "battle-axe"
24
+ }
25
+ end
25
26
 
26
- def variable_content(path)
27
- {
28
- "contents": [
29
- "subtitle | #{path["name"].capitalize}",
30
- "property | Damage Type | #{path["melee"]}",
31
- "property | Attack | #{path["attack"]}",
32
- "property | Crit | #{path["crit"]}",
33
- "fill",
34
- "section | Description",
35
- "text | #{path["description"]}"[0..498]
36
- ]
37
- }
27
+ def variable_content(path)
28
+ {
29
+ "contents": [
30
+ "subtitle | #{path["name"].capitalize}",
31
+ "property | Damage Type | #{path["melee"]}",
32
+ "property | Attack | #{path["attack"]}",
33
+ "property | Crit | #{path["crit"]}",
34
+ "fill",
35
+ "section | Description",
36
+ "text | #{path["description"]}"[0..498]
37
+ ]
38
+ }
39
+ end
38
40
  end
39
41
  end
@@ -1,39 +1,41 @@
1
1
  require_relative 'card'
2
2
 
3
- class RangedWeaponCard < Card
3
+ module PathfinderDeckBuilder
4
+ class RangedWeaponCard < PathfinderDeckBuilder::Card
4
5
 
5
- def create_card(index=nil)
6
- super
7
- end
6
+ def create_card(index=nil)
7
+ super
8
+ end
8
9
 
9
- def set_class_path
10
- @class_path = @ranged_weapons_path
11
- end
10
+ def set_class_path
11
+ @class_path = @ranged_weapons_path
12
+ end
12
13
 
13
- def assembled_card(path)
14
- super
15
- end
14
+ def assembled_card(path)
15
+ super
16
+ end
16
17
 
17
- def static_content
18
- {
19
- "count": 1,
20
- "color": "green",
21
- "title": "Ranged Weapon",
22
- "icon": "bowman"
23
- }
24
- end
18
+ def static_content
19
+ {
20
+ "count": 1,
21
+ "color": "green",
22
+ "title": "Ranged Weapon",
23
+ "icon": "bowman"
24
+ }
25
+ end
25
26
 
26
- def variable_content(path)
27
- {
28
- "contents": [
29
- "subtitle | #{path["name"].capitalize}",
30
- "property | Damage Type | #{path["ranged"]}",
31
- "property | Attack | #{path["attack"]}",
32
- "property | Crit | #{path["crit"]}",
33
- "fill",
34
- "section | Description",
35
- "text | #{path["description"]}"[0..498]
36
- ]
37
- }
27
+ def variable_content(path)
28
+ {
29
+ "contents": [
30
+ "subtitle | #{path["name"].capitalize}",
31
+ "property | Damage Type | #{path["ranged"]}",
32
+ "property | Attack | #{path["attack"]}",
33
+ "property | Crit | #{path["crit"]}",
34
+ "fill",
35
+ "section | Description",
36
+ "text | #{path["description"]}"[0..498]
37
+ ]
38
+ }
39
+ end
38
40
  end
39
41
  end
data/lib/skill_card.rb CHANGED
@@ -1,39 +1,41 @@
1
1
  require_relative 'card'
2
2
 
3
- class SkillCard < Card
3
+ module PathfinderDeckBuilder
4
+ class SkillCard < PathfinderDeckBuilder::Card
4
5
 
5
- def create_card(index=nil)
6
- super
7
- end
6
+ def create_card(index=nil)
7
+ super
8
+ end
8
9
 
9
- def set_class_path
10
- @class_path = @skill_path
11
- end
10
+ def set_class_path
11
+ @class_path = @skill_path
12
+ end
12
13
 
13
- def assembled_card(path)
14
- super
15
- end
14
+ def assembled_card(path)
15
+ super
16
+ end
16
17
 
17
- def static_content
18
- {
19
- "count": 1,
20
- "color": "orange",
21
- "title": "Skill",
22
- "icon": "gears"
23
- }
24
- end
18
+ def static_content
19
+ {
20
+ "count": 1,
21
+ "color": "orange",
22
+ "title": "Skill",
23
+ "icon": "gears"
24
+ }
25
+ end
25
26
 
26
- def variable_content(path)
27
- {
28
- "contents": [
29
- "subtitle | #{path["name"]}",
30
- "rule",
31
- "property | Value | #{path["value"]}",
32
- "property | Ranks | #{path["ranks"]}",
33
- "property | #{path["attrname"]} Bonus: | #{path["attrname"]} #{path["attrbonus"]}",
34
- "section | Description",
35
- "text | #{path["description"]}"[0..500]
36
- ]
37
- }
27
+ def variable_content(path)
28
+ {
29
+ "contents": [
30
+ "subtitle | #{path["name"]}",
31
+ "rule",
32
+ "property | Value | #{path["value"]}",
33
+ "property | Ranks | #{path["ranks"]}",
34
+ "property | #{path["attrname"]} Bonus: | #{path["attrname"]} #{path["attrbonus"]}",
35
+ "section | Description",
36
+ "text | #{path["description"]}"[0..500]
37
+ ]
38
+ }
39
+ end
38
40
  end
39
- end
41
+ end
@@ -1,35 +1,37 @@
1
1
  require_relative 'card'
2
2
 
3
- class SpecialAbilityCard < Card
3
+ module PathfinderDeckBuilder
4
+ class SpecialAbilityCard < PathfinderDeckBuilder::Card
4
5
 
5
- def create_card(index=nil)
6
- super
7
- end
6
+ def create_card(index=nil)
7
+ super
8
+ end
8
9
 
9
- def set_class_path
10
- @class_path = @special_ability_path
11
- end
10
+ def set_class_path
11
+ @class_path = @special_ability_path
12
+ end
12
13
 
13
- def assembled_card(path)
14
- super
15
- end
14
+ def assembled_card(path)
15
+ super
16
+ end
16
17
 
17
- def static_content
18
- {
19
- "count": 1,
20
- "color": "green",
21
- "title": "Special Ability",
22
- "icon": "magic-swirl"
23
- }
24
- end
18
+ def static_content
19
+ {
20
+ "count": 1,
21
+ "color": "green",
22
+ "title": "Special Ability",
23
+ "icon": "magic-swirl"
24
+ }
25
+ end
25
26
 
26
- def variable_content(path)
27
- {
28
- "contents": [
29
- "subtitle | #{path["shortname"]}",
30
- "section | Description",
31
- "text | #{path["description"]}"[0..600]
32
- ]
33
- }
27
+ def variable_content(path)
28
+ {
29
+ "contents": [
30
+ "subtitle | #{path["shortname"]}",
31
+ "section | Description",
32
+ "text | #{path["description"]}"[0..600]
33
+ ]
34
+ }
35
+ end
34
36
  end
35
37
  end
@@ -1,38 +1,40 @@
1
1
  require_relative 'card'
2
2
 
3
- class SpecialAttackCard < Card
3
+ module PathfinderDeckBuilder
4
+ class SpecialAttackCard < PathfinderDeckBuilder::Card
4
5
 
5
- def create_card(index=nil)
6
- super
7
- end
6
+ def create_card(index=nil)
7
+ super
8
+ end
8
9
 
9
- def set_class_path
10
- @class_path = @special_attack_path
11
- end
10
+ def set_class_path
11
+ @class_path = @special_attack_path
12
+ end
12
13
 
13
- def assembled_card(path)
14
- super
15
- end
14
+ def assembled_card(path)
15
+ super
16
+ end
16
17
 
17
- def static_content
18
- {
19
- "count": 1,
20
- "color": "green",
21
- "title": "Special Attack",
22
- "icon": "wyvern"
23
- }
24
- end
18
+ def static_content
19
+ {
20
+ "count": 1,
21
+ "color": "green",
22
+ "title": "Special Attack",
23
+ "icon": "wyvern"
24
+ }
25
+ end
25
26
 
26
- def variable_content(path)
27
- {
28
- "contents": [
29
- "subtitle | #{path["shortname"]}",
30
- "rule",
31
- "property | Type | #{path["type"]}",
32
- "fill",
33
- "section | Description",
34
- "text | #{path["description"]}"[0..318]
35
- ]
36
- }
27
+ def variable_content(path)
28
+ {
29
+ "contents": [
30
+ "subtitle | #{path["shortname"]}",
31
+ "rule",
32
+ "property | Type | #{path["type"]}",
33
+ "fill",
34
+ "section | Description",
35
+ "text | #{path["description"]}"[0..318]
36
+ ]
37
+ }
38
+ end
37
39
  end
38
40
  end
data/lib/spell_card.rb CHANGED
@@ -1,44 +1,46 @@
1
1
  require_relative 'card'
2
2
 
3
- class SpellCard < Card
3
+ module PathfinderDeckBuilder
4
+ class SpellCard < PathfinderDeckBuilder::Card
4
5
 
5
- def create_card(index=nil)
6
- super
7
- end
6
+ def create_card(index=nil)
7
+ super
8
+ end
8
9
 
9
- def set_class_path
10
- @class_path = @spell_path
11
- end
10
+ def set_class_path
11
+ @class_path = @spell_path
12
+ end
12
13
 
13
- def assembled_card(path)
14
- super
15
- end
14
+ def assembled_card(path)
15
+ super
16
+ end
16
17
 
17
- def static_content
18
- {
19
- "count": 1,
20
- "color": "green",
21
- "title": "Spell"
22
- }
23
- end
18
+ def static_content
19
+ {
20
+ "count": 1,
21
+ "color": "green",
22
+ "title": "Spell"
23
+ }
24
+ end
24
25
 
25
- def variable_content(path)
26
- {
27
- "icon": "white-book-#{path["level"]}",
28
- "contents": [
29
- "subtitle | #{path["name"]}",
30
- "rule",
31
- "property | Class | #{path["class"]}",
32
- "property | Level | #{path["level"]}",
33
- "property | Cast Time | #{path["casttime"]}",
34
- "property | Duration | #{path["duration"]}",
35
- "property | Range | #{path["range"]}",
36
- "property | Target | #{path["target"]}",
37
- "property | Area | #{path["area"]}",
38
- "fill",
39
- "section | Description",
40
- "text | #{path["description"]}"[0..318]
41
- ]
42
- }
26
+ def variable_content(path)
27
+ {
28
+ "icon": "white-book-#{path["level"]}",
29
+ "contents": [
30
+ "subtitle | #{path["name"]}",
31
+ "rule",
32
+ "property | Class | #{path["class"]}",
33
+ "property | Level | #{path["level"]}",
34
+ "property | Cast Time | #{path["casttime"]}",
35
+ "property | Duration | #{path["duration"]}",
36
+ "property | Range | #{path["range"]}",
37
+ "property | Target | #{path["target"]}",
38
+ "property | Area | #{path["area"]}",
39
+ "fill",
40
+ "section | Description",
41
+ "text | #{path["description"]}"[0..318]
42
+ ]
43
+ }
44
+ end
43
45
  end
44
- end
46
+ end
@@ -1,36 +1,38 @@
1
1
  require_relative 'card'
2
2
 
3
- class TrackedResourceCard < Card
3
+ module PathfinderDeckBuilder
4
+ class TrackedResourceCard < PathfinderDeckBuilder::Card
4
5
 
5
- def create_card(index=nil)
6
- super
7
- end
6
+ def create_card(index=nil)
7
+ super
8
+ end
8
9
 
9
- def set_class_path
10
- @class_path = @tracked_resource_path
11
- end
10
+ def set_class_path
11
+ @class_path = @tracked_resource_path
12
+ end
12
13
 
13
- def assembled_card(path)
14
- super
15
- end
14
+ def assembled_card(path)
15
+ super
16
+ end
16
17
 
17
- def static_content
18
- {
19
- "count": 1,
20
- "color": "purple",
21
- "title": "Tracked Resource",
22
- "icon": "checkbox-tree"
23
- }
24
- end
18
+ def static_content
19
+ {
20
+ "count": 1,
21
+ "color": "purple",
22
+ "title": "Tracked Resource",
23
+ "icon": "checkbox-tree"
24
+ }
25
+ end
25
26
 
26
- def variable_content(path)
27
- {
28
- "contents": [
29
- "text | #{path["name"]}",
30
- "fill",
31
- "section | Charges",
32
- "boxes | #{path["max"]} | 2.5"
33
- ]
34
- }
27
+ def variable_content(path)
28
+ {
29
+ "contents": [
30
+ "text | #{path["name"]}",
31
+ "fill",
32
+ "section | Charges",
33
+ "boxes | #{path["max"]} | 2.5"
34
+ ]
35
+ }
36
+ end
35
37
  end
36
38
  end
data/lib/trait_card.rb CHANGED
@@ -1,37 +1,39 @@
1
1
  require_relative 'card'
2
2
 
3
- class TraitCard < Card
3
+ module PathfinderDeckBuilder
4
+ class TraitCard < PathfinderDeckBuilder::Card
4
5
 
5
- def create_card(index=nil)
6
- super
7
- end
6
+ def create_card(index=nil)
7
+ super
8
+ end
8
9
 
9
- def set_class_path
10
- @class_path = @trait_path
11
- end
10
+ def set_class_path
11
+ @class_path = @trait_path
12
+ end
12
13
 
13
- def assembled_card(path)
14
- super
15
- end
14
+ def assembled_card(path)
15
+ super
16
+ end
16
17
 
17
- def static_content
18
- {
19
- "count": 1,
20
- "color": "green",
21
- "title": "Trait",
22
- "icon": "usable"
23
- }
24
- end
18
+ def static_content
19
+ {
20
+ "count": 1,
21
+ "color": "green",
22
+ "title": "Trait",
23
+ "icon": "usable"
24
+ }
25
+ end
25
26
 
26
- def variable_content(path)
27
- {
28
- "contents": [
29
- "subtitle | #{path["name"]}",
30
- "rule",
31
- "property | Category | #{path["categorytext"]}",
32
- "section | Description",
33
- "text | #{path["description"]}"[0..318]
34
- ]
35
- }
27
+ def variable_content(path)
28
+ {
29
+ "contents": [
30
+ "subtitle | #{path["name"]}",
31
+ "rule",
32
+ "property | Category | #{path["categorytext"]}",
33
+ "section | Description",
34
+ "text | #{path["description"]}"[0..318]
35
+ ]
36
+ }
37
+ end
36
38
  end
37
- end
39
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pathfinder_deck_builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Sponheim