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 +4 -4
- data/lib/armor_card.rb +35 -33
- data/lib/card.rb +76 -73
- data/lib/character_card.rb +38 -35
- data/lib/compiler.rb +63 -60
- data/lib/deck.rb +10 -9
- data/lib/defensive_ability_card.rb +32 -29
- data/lib/feat_card.rb +30 -28
- data/lib/melee_weapon_card.rb +32 -30
- data/lib/ranged_weapon_card.rb +32 -30
- data/lib/skill_card.rb +33 -31
- data/lib/special_ability_card.rb +28 -26
- data/lib/special_attack_card.rb +31 -29
- data/lib/spell_card.rb +38 -36
- data/lib/tracked_resource_card.rb +29 -27
- data/lib/trait_card.rb +31 -29
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e36c69dc10540dab7d262cb78e34d312177696b2
|
|
4
|
+
data.tar.gz: 2711b5d8114a0daa50622916b99cb58f35300c0e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
3
|
+
module PathfinderDeckBuilder
|
|
4
|
+
class ArmorCard < Card
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
def create_card(index=nil)
|
|
7
|
+
super
|
|
8
|
+
end
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
def set_class_path
|
|
11
|
+
@class_path = @armor_path
|
|
12
|
+
end
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
def assembled_card(path)
|
|
15
|
+
super
|
|
16
|
+
end
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
def static_content
|
|
19
|
+
{
|
|
20
|
+
"count": 1,
|
|
21
|
+
"color": "grey",
|
|
22
|
+
"title": "Armor",
|
|
23
|
+
"icon": "anvil"
|
|
24
|
+
}
|
|
25
|
+
end
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
def create_card(index=nil)
|
|
12
|
+
@index = index
|
|
13
|
+
set_paths
|
|
14
|
+
set_class_path
|
|
13
15
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
def set_class_path
|
|
26
|
+
:must_implement
|
|
27
|
+
end
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
def set_paths
|
|
30
|
+
@path_shortcut = @xml_file["document"]["public"]["character"]
|
|
29
31
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
|
-
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
def assembled_card(path)
|
|
80
|
+
static_content.merge(variable_content(path))
|
|
81
|
+
end
|
|
80
82
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
def static_content
|
|
84
|
+
#non-iterative JSON goes here
|
|
85
|
+
end
|
|
84
86
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
+
def variable_content
|
|
88
|
+
#iterative JSON goes here
|
|
89
|
+
end
|
|
87
90
|
end
|
|
88
91
|
end
|
data/lib/character_card.rb
CHANGED
|
@@ -1,42 +1,45 @@
|
|
|
1
1
|
require_relative 'card'
|
|
2
|
-
class CharacterCard < Card
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
end
|
|
3
|
+
module PathfinderDeckBuilder
|
|
4
|
+
class CharacterCard < PathfinderDeckBuilder::Card
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
@class_cards.push(assembled_card)
|
|
12
|
-
end
|
|
6
|
+
def initialize(xml_file)
|
|
7
|
+
super
|
|
8
|
+
end
|
|
13
9
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
|
|
18
|
-
|
|
17
|
+
module PathfinderDeckBuilder
|
|
18
|
+
class Compiler
|
|
19
|
+
attr_accessor :deck
|
|
20
|
+
attr_reader :setup_cards, :file_path, :myXML
|
|
19
21
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
33
|
+
build_cards
|
|
34
34
|
|
|
35
|
-
|
|
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
|
-
|
|
38
|
+
def compile_party
|
|
39
|
+
read_file_path
|
|
40
|
+
@myXML["document"]["public"]["character"].each_with_index do |character, index|
|
|
40
41
|
|
|
41
|
-
|
|
42
|
-
end
|
|
42
|
+
build_cards(index)
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
setup
|
|
44
|
+
save_deck("#{character["name"]}"+".json")
|
|
45
|
+
end
|
|
46
|
+
end
|
|
48
47
|
|
|
49
|
-
|
|
48
|
+
def prepare_for_s3
|
|
49
|
+
read_file_path
|
|
50
|
+
|
|
51
|
+
build_cards
|
|
50
52
|
|
|
51
|
-
@
|
|
52
|
-
|
|
53
|
-
end
|
|
53
|
+
return @deck.cards
|
|
54
|
+
end
|
|
54
55
|
|
|
55
|
-
|
|
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
|
-
|
|
62
|
-
|
|
63
|
-
setup
|
|
87
|
+
def build_cards(index=nil)
|
|
88
|
+
setup
|
|
64
89
|
|
|
65
|
-
|
|
90
|
+
@setup_cards.each { |card| card.create_card(index) }
|
|
66
91
|
|
|
67
|
-
|
|
68
|
-
|
|
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
|
-
|
|
92
|
-
|
|
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
|
-
|
|
2
|
-
class Deck
|
|
3
|
-
|
|
1
|
+
module PathfinderDeckBuilder
|
|
2
|
+
class Deck
|
|
3
|
+
attr_accessor :cards
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
def initialize
|
|
6
|
+
@cards = []
|
|
7
|
+
end
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
end
|
|
3
|
+
module PathfinderDeckBuilder
|
|
4
|
+
class DefensiveAbilityCard < PathfinderDeckBuilder::Card
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
def create_card(index=nil)
|
|
7
|
+
super
|
|
8
|
+
end
|
|
11
9
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
def set_class_path
|
|
11
|
+
@class_path = @defensive_ability_path
|
|
12
|
+
end
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
3
|
+
module PathfinderDeckBuilder
|
|
4
|
+
class FeatCard < PathfinderDeckBuilder::Card
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
def create_card(index=nil)
|
|
7
|
+
super
|
|
8
|
+
end
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
def set_class_path
|
|
11
|
+
@class_path = @feat_path
|
|
12
|
+
end
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
def assembled_card(path)
|
|
15
|
+
super
|
|
16
|
+
end
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
def static_content
|
|
19
|
+
{
|
|
20
|
+
"count": 1,
|
|
21
|
+
"color": "green",
|
|
22
|
+
"title": "Feat",
|
|
23
|
+
"icon": "foot-trip"
|
|
24
|
+
}
|
|
25
|
+
end
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
data/lib/melee_weapon_card.rb
CHANGED
|
@@ -1,39 +1,41 @@
|
|
|
1
1
|
require_relative 'card'
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
module PathfinderDeckBuilder
|
|
4
|
+
class MeleeWeaponCard < PathfinderDeckBuilder::Card
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
def create_card(index=nil)
|
|
7
|
+
super
|
|
8
|
+
end
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
def set_class_path
|
|
11
|
+
@class_path = @melee_weapons_path
|
|
12
|
+
end
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
def assembled_card(path)
|
|
15
|
+
super
|
|
16
|
+
end
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
data/lib/ranged_weapon_card.rb
CHANGED
|
@@ -1,39 +1,41 @@
|
|
|
1
1
|
require_relative 'card'
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
module PathfinderDeckBuilder
|
|
4
|
+
class RangedWeaponCard < PathfinderDeckBuilder::Card
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
def create_card(index=nil)
|
|
7
|
+
super
|
|
8
|
+
end
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
def set_class_path
|
|
11
|
+
@class_path = @ranged_weapons_path
|
|
12
|
+
end
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
def assembled_card(path)
|
|
15
|
+
super
|
|
16
|
+
end
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
def static_content
|
|
19
|
+
{
|
|
20
|
+
"count": 1,
|
|
21
|
+
"color": "green",
|
|
22
|
+
"title": "Ranged Weapon",
|
|
23
|
+
"icon": "bowman"
|
|
24
|
+
}
|
|
25
|
+
end
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
3
|
+
module PathfinderDeckBuilder
|
|
4
|
+
class SkillCard < PathfinderDeckBuilder::Card
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
def create_card(index=nil)
|
|
7
|
+
super
|
|
8
|
+
end
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
def set_class_path
|
|
11
|
+
@class_path = @skill_path
|
|
12
|
+
end
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
def assembled_card(path)
|
|
15
|
+
super
|
|
16
|
+
end
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
def static_content
|
|
19
|
+
{
|
|
20
|
+
"count": 1,
|
|
21
|
+
"color": "orange",
|
|
22
|
+
"title": "Skill",
|
|
23
|
+
"icon": "gears"
|
|
24
|
+
}
|
|
25
|
+
end
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
data/lib/special_ability_card.rb
CHANGED
|
@@ -1,35 +1,37 @@
|
|
|
1
1
|
require_relative 'card'
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
module PathfinderDeckBuilder
|
|
4
|
+
class SpecialAbilityCard < PathfinderDeckBuilder::Card
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
def create_card(index=nil)
|
|
7
|
+
super
|
|
8
|
+
end
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
def set_class_path
|
|
11
|
+
@class_path = @special_ability_path
|
|
12
|
+
end
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
def assembled_card(path)
|
|
15
|
+
super
|
|
16
|
+
end
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
data/lib/special_attack_card.rb
CHANGED
|
@@ -1,38 +1,40 @@
|
|
|
1
1
|
require_relative 'card'
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
module PathfinderDeckBuilder
|
|
4
|
+
class SpecialAttackCard < PathfinderDeckBuilder::Card
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
def create_card(index=nil)
|
|
7
|
+
super
|
|
8
|
+
end
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
def set_class_path
|
|
11
|
+
@class_path = @special_attack_path
|
|
12
|
+
end
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
def assembled_card(path)
|
|
15
|
+
super
|
|
16
|
+
end
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
def static_content
|
|
19
|
+
{
|
|
20
|
+
"count": 1,
|
|
21
|
+
"color": "green",
|
|
22
|
+
"title": "Special Attack",
|
|
23
|
+
"icon": "wyvern"
|
|
24
|
+
}
|
|
25
|
+
end
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
3
|
+
module PathfinderDeckBuilder
|
|
4
|
+
class SpellCard < PathfinderDeckBuilder::Card
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
def create_card(index=nil)
|
|
7
|
+
super
|
|
8
|
+
end
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
def set_class_path
|
|
11
|
+
@class_path = @spell_path
|
|
12
|
+
end
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
def assembled_card(path)
|
|
15
|
+
super
|
|
16
|
+
end
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
def static_content
|
|
19
|
+
{
|
|
20
|
+
"count": 1,
|
|
21
|
+
"color": "green",
|
|
22
|
+
"title": "Spell"
|
|
23
|
+
}
|
|
24
|
+
end
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
3
|
+
module PathfinderDeckBuilder
|
|
4
|
+
class TrackedResourceCard < PathfinderDeckBuilder::Card
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
def create_card(index=nil)
|
|
7
|
+
super
|
|
8
|
+
end
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
def set_class_path
|
|
11
|
+
@class_path = @tracked_resource_path
|
|
12
|
+
end
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
def assembled_card(path)
|
|
15
|
+
super
|
|
16
|
+
end
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
3
|
+
module PathfinderDeckBuilder
|
|
4
|
+
class TraitCard < PathfinderDeckBuilder::Card
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
def create_card(index=nil)
|
|
7
|
+
super
|
|
8
|
+
end
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
def set_class_path
|
|
11
|
+
@class_path = @trait_path
|
|
12
|
+
end
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
def assembled_card(path)
|
|
15
|
+
super
|
|
16
|
+
end
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
def static_content
|
|
19
|
+
{
|
|
20
|
+
"count": 1,
|
|
21
|
+
"color": "green",
|
|
22
|
+
"title": "Trait",
|
|
23
|
+
"icon": "usable"
|
|
24
|
+
}
|
|
25
|
+
end
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|