pathfinder_deck_builder 0.0.3
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 +7 -0
- data/lib/armor_card.rb +41 -0
- data/lib/card.rb +88 -0
- data/lib/character_card.rb +42 -0
- data/lib/compiler.rb +98 -0
- data/lib/deck.rb +14 -0
- data/lib/defensive_ability_card.rb +37 -0
- data/lib/feat_card.rb +37 -0
- data/lib/melee_weapon_card.rb +39 -0
- data/lib/pathfinder_deck_builder.rb +14 -0
- data/lib/ranged_weapon_card.rb +39 -0
- data/lib/skill_card.rb +39 -0
- data/lib/special_ability_card.rb +35 -0
- data/lib/special_attack_card.rb +38 -0
- data/lib/spell_card.rb +44 -0
- data/lib/tracked_resource_card.rb +36 -0
- data/lib/trait_card.rb +37 -0
- metadata +59 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: bc715e9f94614389f6196e0599315b892d3d01db
|
|
4
|
+
data.tar.gz: 8a634a87016b916ad7cce40eb48e2e89d641cdcb
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: ccb3739470e80b8b020544fa7e0e2e21c9466b4358302e93b2674f6952227a16109207c81493bb79440902cb83868008883bb51d7078075458d4400083eb2274
|
|
7
|
+
data.tar.gz: f268f25b6d19dd91eeece4cbc13cbaf37d65526c833e46709ea42c0614e6225523f5be0fc650657357c49d109cd262baea85b68508b696289df68734e10cb270
|
data/lib/armor_card.rb
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
require_relative 'card'
|
|
2
|
+
|
|
3
|
+
class ArmorCard < Card
|
|
4
|
+
|
|
5
|
+
def create_card(index=nil)
|
|
6
|
+
super
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def set_class_path
|
|
10
|
+
@class_path = @armor_path
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def assembled_card(path)
|
|
14
|
+
super
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def static_content
|
|
18
|
+
{
|
|
19
|
+
"count": 1,
|
|
20
|
+
"color": "grey",
|
|
21
|
+
"title": "Armor",
|
|
22
|
+
"icon": "anvil"
|
|
23
|
+
}
|
|
24
|
+
end
|
|
25
|
+
|
|
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
|
+
}
|
|
40
|
+
end
|
|
41
|
+
end
|
data/lib/card.rb
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
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
|
|
8
|
+
|
|
9
|
+
def create_card(index=nil)
|
|
10
|
+
@index = index
|
|
11
|
+
set_paths
|
|
12
|
+
set_class_path
|
|
13
|
+
|
|
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)) }
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def set_class_path
|
|
24
|
+
:must_implement
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def set_paths
|
|
28
|
+
@path_shortcut = @xml_file["document"]["public"]["character"]
|
|
29
|
+
|
|
30
|
+
if @index
|
|
31
|
+
set_multiple_character_path
|
|
32
|
+
else
|
|
33
|
+
set_single_character_path
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
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
|
|
56
|
+
|
|
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
|
|
76
|
+
|
|
77
|
+
def assembled_card(path)
|
|
78
|
+
static_content.merge(variable_content(path))
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
def static_content
|
|
82
|
+
#non-iterative JSON goes here
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
def variable_content
|
|
86
|
+
#iterative JSON goes here
|
|
87
|
+
end
|
|
88
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
require_relative 'card'
|
|
2
|
+
class CharacterCard < Card
|
|
3
|
+
|
|
4
|
+
def initialize(xml_file)
|
|
5
|
+
super
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def create_card(index=nil)
|
|
9
|
+
@index = index
|
|
10
|
+
set_paths
|
|
11
|
+
@class_cards.push(assembled_card)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def set_class_path
|
|
15
|
+
@class_path = @character_path
|
|
16
|
+
end
|
|
17
|
+
|
|
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
|
+
}
|
|
41
|
+
end
|
|
42
|
+
end
|
data/lib/compiler.rb
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
require 'crack'
|
|
2
|
+
require 'json'
|
|
3
|
+
require_relative 'character_card'
|
|
4
|
+
require_relative 'melee_weapon_card'
|
|
5
|
+
require_relative 'ranged_weapon_card'
|
|
6
|
+
require_relative 'armor_card'
|
|
7
|
+
require_relative 'tracked_resource_card'
|
|
8
|
+
require_relative 'spell_card'
|
|
9
|
+
require_relative 'skill_card'
|
|
10
|
+
require_relative 'defensive_ability_card'
|
|
11
|
+
require_relative 'feat_card'
|
|
12
|
+
require_relative 'trait_card'
|
|
13
|
+
require_relative 'special_ability_card'
|
|
14
|
+
require_relative 'special_attack_card'
|
|
15
|
+
require_relative 'deck'
|
|
16
|
+
|
|
17
|
+
class Compiler
|
|
18
|
+
attr_accessor :deck
|
|
19
|
+
|
|
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
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
@setup_cards.each { |card| card.create_card }
|
|
34
|
+
|
|
35
|
+
@setup_cards.each do |card|
|
|
36
|
+
card.class_cards.each {|class_card| @deck.cards << class_card}
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
@deck.save_deck("#{@file_path.split(".")[0]}"+".json")
|
|
40
|
+
|
|
41
|
+
puts "Please check your current directory for a JSON file with your deck name."
|
|
42
|
+
end
|
|
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
|
|
48
|
+
|
|
49
|
+
@setup_cards.each { |card| card.create_card(index) }
|
|
50
|
+
|
|
51
|
+
@setup_cards.each do |card|
|
|
52
|
+
card.class_cards.each {|class_card| @deck.cards << class_card}
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
@deck.save_deck("#{fun_stuff["name"]}"+".json")
|
|
56
|
+
|
|
57
|
+
puts "Please check your current directory for a JSON file with your deck name."
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def prepare_for_s3
|
|
62
|
+
@myXML = Crack::XML.parse(File.read(@file_path))
|
|
63
|
+
setup
|
|
64
|
+
|
|
65
|
+
@setup_cards.each { |card| card.create_card }
|
|
66
|
+
|
|
67
|
+
@setup_cards.each do |card|
|
|
68
|
+
card.class_cards.each {|class_card| @deck.cards << class_card}
|
|
69
|
+
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
|
+
|
|
91
|
+
def compile
|
|
92
|
+
if self.is_party?
|
|
93
|
+
compile_party
|
|
94
|
+
else
|
|
95
|
+
compile_individual
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
end
|
data/lib/deck.rb
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
require_relative 'card'
|
|
2
|
+
class DefensiveAbilityCard < Card
|
|
3
|
+
|
|
4
|
+
def create_card(index=nil)
|
|
5
|
+
super
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def set_class_path
|
|
9
|
+
@class_path = @defensive_ability_path
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def assembled_card(path)
|
|
13
|
+
super
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def static_content
|
|
17
|
+
{
|
|
18
|
+
"count": 1,
|
|
19
|
+
"color": "green",
|
|
20
|
+
"title": "Defensive Ability",
|
|
21
|
+
"icon": "spiked-shell"
|
|
22
|
+
}
|
|
23
|
+
end
|
|
24
|
+
|
|
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
|
+
}
|
|
36
|
+
end
|
|
37
|
+
end
|
data/lib/feat_card.rb
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
require_relative 'card'
|
|
2
|
+
|
|
3
|
+
class FeatCard < Card
|
|
4
|
+
|
|
5
|
+
def create_card(index=nil)
|
|
6
|
+
super
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def set_class_path
|
|
10
|
+
@class_path = @feat_path
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def assembled_card(path)
|
|
14
|
+
super
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def static_content
|
|
18
|
+
{
|
|
19
|
+
"count": 1,
|
|
20
|
+
"color": "green",
|
|
21
|
+
"title": "Feat",
|
|
22
|
+
"icon": "foot-trip"
|
|
23
|
+
}
|
|
24
|
+
end
|
|
25
|
+
|
|
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
|
+
}
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
require_relative 'card'
|
|
2
|
+
|
|
3
|
+
class MeleeWeaponCard < Card
|
|
4
|
+
|
|
5
|
+
def create_card(index=nil)
|
|
6
|
+
super
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def set_class_path
|
|
10
|
+
@class_path = @melee_weapons_path
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def assembled_card(path)
|
|
14
|
+
super
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def static_content
|
|
18
|
+
{
|
|
19
|
+
"count": 1,
|
|
20
|
+
"color": "red",
|
|
21
|
+
"title": "Melee Weapon",
|
|
22
|
+
"icon": "battle-axe"
|
|
23
|
+
}
|
|
24
|
+
end
|
|
25
|
+
|
|
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
|
+
}
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
require 'card'
|
|
2
|
+
require 'character_card'
|
|
3
|
+
require 'compiler'
|
|
4
|
+
require 'deck'
|
|
5
|
+
require 'defensive_ability_card'
|
|
6
|
+
require 'feat_card'
|
|
7
|
+
require 'melee_weapon_card'
|
|
8
|
+
require 'ranged_weapon_card'
|
|
9
|
+
require 'skill_card'
|
|
10
|
+
require 'special_ability_card'
|
|
11
|
+
require 'special_attack_card'
|
|
12
|
+
require 'spell_card'
|
|
13
|
+
require 'tracked_resource_card'
|
|
14
|
+
require 'trait_card'
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
require_relative 'card'
|
|
2
|
+
|
|
3
|
+
class RangedWeaponCard < Card
|
|
4
|
+
|
|
5
|
+
def create_card(index=nil)
|
|
6
|
+
super
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def set_class_path
|
|
10
|
+
@class_path = @ranged_weapons_path
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def assembled_card(path)
|
|
14
|
+
super
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def static_content
|
|
18
|
+
{
|
|
19
|
+
"count": 1,
|
|
20
|
+
"color": "green",
|
|
21
|
+
"title": "Ranged Weapon",
|
|
22
|
+
"icon": "bowman"
|
|
23
|
+
}
|
|
24
|
+
end
|
|
25
|
+
|
|
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
|
+
}
|
|
38
|
+
end
|
|
39
|
+
end
|
data/lib/skill_card.rb
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
require_relative 'card'
|
|
2
|
+
|
|
3
|
+
class SkillCard < Card
|
|
4
|
+
|
|
5
|
+
def create_card(index=nil)
|
|
6
|
+
super
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def set_class_path
|
|
10
|
+
@class_path = @skill_path
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def assembled_card(path)
|
|
14
|
+
super
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def static_content
|
|
18
|
+
{
|
|
19
|
+
"count": 1,
|
|
20
|
+
"color": "orange",
|
|
21
|
+
"title": "Skill",
|
|
22
|
+
"icon": "gears"
|
|
23
|
+
}
|
|
24
|
+
end
|
|
25
|
+
|
|
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
|
+
}
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
require_relative 'card'
|
|
2
|
+
|
|
3
|
+
class SpecialAbilityCard < Card
|
|
4
|
+
|
|
5
|
+
def create_card(index=nil)
|
|
6
|
+
super
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def set_class_path
|
|
10
|
+
@class_path = @special_ability_path
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def assembled_card(path)
|
|
14
|
+
super
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def static_content
|
|
18
|
+
{
|
|
19
|
+
"count": 1,
|
|
20
|
+
"color": "green",
|
|
21
|
+
"title": "Special Ability",
|
|
22
|
+
"icon": "magic-swirl"
|
|
23
|
+
}
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def variable_content(path)
|
|
27
|
+
{
|
|
28
|
+
"contents": [
|
|
29
|
+
"subtitle | #{path["shortname"]}",
|
|
30
|
+
"section | Description",
|
|
31
|
+
"text | #{path["description"]}"[0..600]
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
require_relative 'card'
|
|
2
|
+
|
|
3
|
+
class SpecialAttackCard < Card
|
|
4
|
+
|
|
5
|
+
def create_card(index=nil)
|
|
6
|
+
super
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def set_class_path
|
|
10
|
+
@class_path = @special_attack_path
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def assembled_card(path)
|
|
14
|
+
super
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def static_content
|
|
18
|
+
{
|
|
19
|
+
"count": 1,
|
|
20
|
+
"color": "green",
|
|
21
|
+
"title": "Special Attack",
|
|
22
|
+
"icon": "wyvern"
|
|
23
|
+
}
|
|
24
|
+
end
|
|
25
|
+
|
|
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
|
+
}
|
|
37
|
+
end
|
|
38
|
+
end
|
data/lib/spell_card.rb
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
require_relative 'card'
|
|
2
|
+
|
|
3
|
+
class SpellCard < Card
|
|
4
|
+
|
|
5
|
+
def create_card(index=nil)
|
|
6
|
+
super
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def set_class_path
|
|
10
|
+
@class_path = @spell_path
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def assembled_card(path)
|
|
14
|
+
super
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def static_content
|
|
18
|
+
{
|
|
19
|
+
"count": 1,
|
|
20
|
+
"color": "green",
|
|
21
|
+
"title": "Spell"
|
|
22
|
+
}
|
|
23
|
+
end
|
|
24
|
+
|
|
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
|
+
}
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
require_relative 'card'
|
|
2
|
+
|
|
3
|
+
class TrackedResourceCard < Card
|
|
4
|
+
|
|
5
|
+
def create_card(index=nil)
|
|
6
|
+
super
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def set_class_path
|
|
10
|
+
@class_path = @tracked_resource_path
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def assembled_card(path)
|
|
14
|
+
super
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def static_content
|
|
18
|
+
{
|
|
19
|
+
"count": 1,
|
|
20
|
+
"color": "purple",
|
|
21
|
+
"title": "Tracked Resource",
|
|
22
|
+
"icon": "checkbox-tree"
|
|
23
|
+
}
|
|
24
|
+
end
|
|
25
|
+
|
|
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
|
+
}
|
|
35
|
+
end
|
|
36
|
+
end
|
data/lib/trait_card.rb
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
require_relative 'card'
|
|
2
|
+
|
|
3
|
+
class TraitCard < Card
|
|
4
|
+
|
|
5
|
+
def create_card(index=nil)
|
|
6
|
+
super
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def set_class_path
|
|
10
|
+
@class_path = @trait_path
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def assembled_card(path)
|
|
14
|
+
super
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def static_content
|
|
18
|
+
{
|
|
19
|
+
"count": 1,
|
|
20
|
+
"color": "green",
|
|
21
|
+
"title": "Trait",
|
|
22
|
+
"icon": "usable"
|
|
23
|
+
}
|
|
24
|
+
end
|
|
25
|
+
|
|
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
|
+
}
|
|
36
|
+
end
|
|
37
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: pathfinder_deck_builder
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.3
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Kyle Sponheim
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2017-02-23 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description: A simple gem to turn XML into JSON
|
|
14
|
+
email: kyle.sponheim@gmail.com
|
|
15
|
+
executables: []
|
|
16
|
+
extensions: []
|
|
17
|
+
extra_rdoc_files: []
|
|
18
|
+
files:
|
|
19
|
+
- lib/armor_card.rb
|
|
20
|
+
- lib/card.rb
|
|
21
|
+
- lib/character_card.rb
|
|
22
|
+
- lib/compiler.rb
|
|
23
|
+
- lib/deck.rb
|
|
24
|
+
- lib/defensive_ability_card.rb
|
|
25
|
+
- lib/feat_card.rb
|
|
26
|
+
- lib/melee_weapon_card.rb
|
|
27
|
+
- lib/pathfinder_deck_builder.rb
|
|
28
|
+
- lib/ranged_weapon_card.rb
|
|
29
|
+
- lib/skill_card.rb
|
|
30
|
+
- lib/special_ability_card.rb
|
|
31
|
+
- lib/special_attack_card.rb
|
|
32
|
+
- lib/spell_card.rb
|
|
33
|
+
- lib/tracked_resource_card.rb
|
|
34
|
+
- lib/trait_card.rb
|
|
35
|
+
homepage:
|
|
36
|
+
licenses:
|
|
37
|
+
- MIT
|
|
38
|
+
metadata: {}
|
|
39
|
+
post_install_message:
|
|
40
|
+
rdoc_options: []
|
|
41
|
+
require_paths:
|
|
42
|
+
- lib
|
|
43
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - ">="
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '0'
|
|
48
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
49
|
+
requirements:
|
|
50
|
+
- - ">="
|
|
51
|
+
- !ruby/object:Gem::Version
|
|
52
|
+
version: '0'
|
|
53
|
+
requirements: []
|
|
54
|
+
rubyforge_project:
|
|
55
|
+
rubygems_version: 2.5.1
|
|
56
|
+
signing_key:
|
|
57
|
+
specification_version: 4
|
|
58
|
+
summary: Turn your Herolab custom output into a deck of cards
|
|
59
|
+
test_files: []
|