drpedia_lite 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/Builder.rb +5 -1
- data/lib/RawReader.rb +37 -2
- data/lib/Validator.rb +15 -1
- data/lib/input/input.txt +155 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c74786751d402d4638cc8a4174e640618dc13f6
|
4
|
+
data.tar.gz: 0a817a22450a94a1926047d60bfa4c81cf3e6fe1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3bc12c2ff4e48972b82ef4b1a706d957df33a8a2b5e8b97def49758e4d6de40566ffa734b34a3c3023faa21e8e6e33f8fa209305a4ef99cd756fa4f61addda8d
|
7
|
+
data.tar.gz: 13c176bffa38a49722bc7a0ac9fc4c8dd4fc000f0b275b22f039456d3edfcd80341b682c94e2d4511b9340f9ab1a6aab4381d5ee5741c443209417514c7da59f
|
data/lib/Builder.rb
CHANGED
@@ -12,7 +12,9 @@ class Builder
|
|
12
12
|
strains: raw_reader.strains,
|
13
13
|
professions: raw_reader.professions,
|
14
14
|
strain_stats: raw_reader.strain_stats,
|
15
|
-
strain_specs: raw_reader.strain_specs
|
15
|
+
strain_specs: raw_reader.strain_specs,
|
16
|
+
profession_concentrations: raw_reader.profession_concentrations,
|
17
|
+
profession_advanced: raw_reader.profession_advanced
|
16
18
|
|
17
19
|
File.open(File.join(base_output_path, 'strains.json'), 'w') { |f| f.write raw_reader.strains.to_a.to_json }
|
18
20
|
File.open(File.join(base_output_path, 'professions.json'), 'w') { |f| f.write raw_reader.professions.to_a.to_json }
|
@@ -22,5 +24,7 @@ class Builder
|
|
22
24
|
File.open(File.join(base_output_path, 'skill_list.json'), 'w') { |f| f.write raw_reader.skill_list.to_json }
|
23
25
|
File.open(File.join(base_output_path, 'strain_stats.json'), 'w') { |f| f.write raw_reader.strain_stats.to_json }
|
24
26
|
File.open(File.join(base_output_path, 'strain_specs.json'), 'w') { |f| f.write raw_reader.strain_specs.to_json }
|
27
|
+
File.open(File.join(base_output_path, 'profession_concentrations.json'), 'w') { |f| f.write raw_reader.profession_concentrations.to_json }
|
28
|
+
File.open(File.join(base_output_path, 'profession_advanced.json'), 'w') { |f| f.write raw_reader.profession_advanced.to_json }
|
25
29
|
end
|
26
30
|
end
|
data/lib/RawReader.rb
CHANGED
@@ -1,12 +1,17 @@
|
|
1
1
|
require 'set'
|
2
2
|
|
3
3
|
class RawReader
|
4
|
-
attr_reader :skill_list, :skill_cat, :
|
4
|
+
attr_reader :skill_list, :skill_cat, :skill_group,
|
5
|
+
:strains, :strain_restrictions, :strain_stats, :strain_specs,
|
6
|
+
:professions, :profession_concentrations, :profession_advanced
|
7
|
+
|
5
8
|
STATE_TRANSITION = {
|
6
9
|
:undef => { pattern: /== Advantage Skill ==/, next: :innate },
|
7
10
|
:innate => { pattern: /== Disadvantage Skill ==/, next: :strain_disadv },
|
8
11
|
:strain_disadv => { pattern: /== Innate Skill Prerequisite ==/, next: :innate_preq },
|
9
|
-
:innate_preq => { pattern: /==
|
12
|
+
:innate_preq => { pattern: /== Profession Concentration ==/, next: :prof_concent },
|
13
|
+
:prof_concent => { pattern: /== Advanced Profession ==/, next: :adv_prof },
|
14
|
+
:adv_prof => { pattern: /== Strain Profession Restriction ==/, next: :strain_rtrs },
|
10
15
|
:strain_rtrs => { pattern: /== Strain Stats ==/, next: :strain_stats },
|
11
16
|
:strain_stats => { pattern: /== Strain Specific Skills ==/, next: :strain_specs },
|
12
17
|
:strain_specs => { pattern: /== Open Skill ==/, next: :open },
|
@@ -26,6 +31,10 @@ class RawReader
|
|
26
31
|
@strain_specs = Hash.new
|
27
32
|
@strain_stats = Hash.new
|
28
33
|
@professions = Set.new
|
34
|
+
@profession_concentrations = Hash.new
|
35
|
+
@profession_advanced = Hash.new
|
36
|
+
|
37
|
+
@mutiline_state = nil
|
29
38
|
|
30
39
|
begin
|
31
40
|
f = File.read(filepath)
|
@@ -87,6 +96,8 @@ private
|
|
87
96
|
when :innate then process_innate_skills line: line
|
88
97
|
when :strain_disadv then process_innate_skills line: line, disadvantage: true
|
89
98
|
when :innate_preq then process_innate_preqs line: line
|
99
|
+
when :prof_concent then process_profession_concentration line: line
|
100
|
+
when :adv_prof then process_advanced_professions line: line
|
90
101
|
when :strain_rtrs then process_strain_restrictions line: line
|
91
102
|
when :strain_stats then process_strain_stats line: line
|
92
103
|
when :strain_specs then process_strain_specs line: line
|
@@ -129,6 +140,30 @@ private
|
|
129
140
|
end
|
130
141
|
end
|
131
142
|
|
143
|
+
def process_profession_concentration line:
|
144
|
+
clusters = line.split(/:/)
|
145
|
+
right_cluster = clusters[1].split(/\,/)
|
146
|
+
|
147
|
+
@profession_concentrations[clusters[0].strip.to_sym] = right_cluster.collect{ |x| x.strip.to_sym }
|
148
|
+
end
|
149
|
+
|
150
|
+
def process_advanced_professions line:
|
151
|
+
if line.strip.length == 0
|
152
|
+
@multiline_state = nil
|
153
|
+
else
|
154
|
+
clusters = line.split(/:/)
|
155
|
+
case clusters.length
|
156
|
+
when 2
|
157
|
+
@multiline_state = clusters[0].strip.to_sym
|
158
|
+
@profession_advanced[@multiline_state] = ''
|
159
|
+
when 1
|
160
|
+
@profession_advanced[@multiline_state] += clusters[0]
|
161
|
+
else
|
162
|
+
raise RuntimeError, "#{clusters.length} clusters in multiline processing. Expected 1 or 2: #{line}"
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
132
167
|
def process_strain_specs line:
|
133
168
|
clusters = line.split(/:/)
|
134
169
|
right_cluster = clusters[1].split(/\|/)
|
data/lib/Validator.rb
CHANGED
@@ -8,7 +8,9 @@ class Validator
|
|
8
8
|
strains:,
|
9
9
|
professions:,
|
10
10
|
strain_stats:,
|
11
|
-
strain_specs
|
11
|
+
strain_specs:,
|
12
|
+
profession_concentrations:,
|
13
|
+
profession_advanced:
|
12
14
|
@skill_list = skill_list
|
13
15
|
@skill_group = skill_group
|
14
16
|
@skill_cat = skill_cat
|
@@ -16,14 +18,26 @@ class Validator
|
|
16
18
|
@professions = professions
|
17
19
|
@strain_stats = strain_stats
|
18
20
|
@strain_specs = strain_specs
|
21
|
+
@profession_concentrations = profession_concentrations
|
22
|
+
@profession_advanced = profession_advanced
|
19
23
|
|
20
24
|
validate_non_empty
|
21
25
|
validate_skill_name_matches
|
22
26
|
validate_stats
|
23
27
|
validate_strain_specs
|
28
|
+
validate_profession_concentrations
|
29
|
+
validate_profession_advanced
|
24
30
|
end
|
25
31
|
|
26
32
|
private
|
33
|
+
def validate_profession_concentrations
|
34
|
+
assert(@profession_concentrations.length > 0)
|
35
|
+
end
|
36
|
+
|
37
|
+
def validate_profession_advanced
|
38
|
+
assert(@profession_advanced.length > 0)
|
39
|
+
end
|
40
|
+
|
27
41
|
def validate_non_empty
|
28
42
|
assert(@skill_list.length > 0, "Empty skill list")
|
29
43
|
assert(@skill_cat.length > 0, "Empty processed skills")
|
data/lib/input/input.txt
CHANGED
@@ -27,6 +27,160 @@ Natural Ones: Bolt Action
|
|
27
27
|
== Innate Skill Prerequisite ==
|
28
28
|
Iron Slaves: Iron Fists: Brawling
|
29
29
|
|
30
|
+
== Profession Concentration ==
|
31
|
+
Combat: Assassin, Guard, Gun Slinger, Hunter, Martial Artist, Officer, Primitive, Pugilist, Sniper, Solider, Thug
|
32
|
+
Civilized Society: Caravan Driver, Charlatan, Doctor, Entertainer, Gambler, Hookup, Merchant, Politician, Priest, Publican, Ring Leader, Sawbones, Scoundrel, Spy, Teacher, Thief
|
33
|
+
Crafting and Production: Cook, Distiller, Engineer, Mad Scientist, Printer, Scavenger, Tinker
|
34
|
+
|
35
|
+
== Advanced Profession ==
|
36
|
+
Apocatastian Templar:
|
37
|
+
(and ((xp_sum 100)
|
38
|
+
(stat_sum hp_or_mp 50)
|
39
|
+
(p Priest)
|
40
|
+
(p (Guard Officer))))
|
41
|
+
|
42
|
+
Avontuur:
|
43
|
+
(and ((xp_sum 100)
|
44
|
+
(stat_sum hp_or_mp 50)
|
45
|
+
(p (Gambler Scavenger Teacher Jones))))
|
46
|
+
|
47
|
+
Bone Breaker:
|
48
|
+
(and ((xp_sum 100)
|
49
|
+
(stat_sum hp_or_mp 50)
|
50
|
+
(p (Thug Pugilist))))
|
51
|
+
|
52
|
+
Entrepreneur:
|
53
|
+
(and ((not (s "The Red Star"))
|
54
|
+
(xp_sum 100)
|
55
|
+
(stat_sum hp_or_mp 50)
|
56
|
+
(p (Caravan Driver "Hook-Up" Merchant Publican))))
|
57
|
+
|
58
|
+
Free Radical:
|
59
|
+
(and ((s Retrograde)
|
60
|
+
(xp_sum 100)
|
61
|
+
(stat_sum hp_or_mp 50)))
|
62
|
+
|
63
|
+
G-Man:
|
64
|
+
(and ((or ((s "Pure Blood")
|
65
|
+
(k "Lore - Strain - Pure Blood")))
|
66
|
+
(xp_sum 100)
|
67
|
+
(stat_sum hp_or_mp 50)
|
68
|
+
(k Literacy)
|
69
|
+
(k "Lore - Pre-Fall History Modern")
|
70
|
+
(k (Torture Interrogate))))
|
71
|
+
|
72
|
+
Gear Head:
|
73
|
+
(and ((xp_sum 100)
|
74
|
+
(stat_sum hp_or_mp 50)
|
75
|
+
((or (p (Caravan Driver "Hook-Up" Merchant Engineer "Mad Scientist"))
|
76
|
+
(s ("Diesel Jock" Rover))))
|
77
|
+
(k ("Building Tomorrow" Brewing "Forging the Future"))))
|
78
|
+
|
79
|
+
Grave Robber:
|
80
|
+
(and ((xp_sum 100)
|
81
|
+
(stat_sum hp_or_mp 50)
|
82
|
+
(p (Doctor Sawbones))
|
83
|
+
(p (Scavenger Thief Assassin Jones))))
|
84
|
+
|
85
|
+
Marksman:
|
86
|
+
(and ((xp_sum 100)
|
87
|
+
(stat_sum hp_or_mp 50)
|
88
|
+
(p (Sniper "Gun Slinger"))))
|
89
|
+
|
90
|
+
Mercenary:
|
91
|
+
(and ((xp_sum 100)
|
92
|
+
(stat_sum hp_or_mp 50)
|
93
|
+
(p (Soldier Guard Officer Hunter))))
|
94
|
+
|
95
|
+
Merican Ba-das:
|
96
|
+
(and ((xp_sum 100)
|
97
|
+
(stat_sum hp 50)
|
98
|
+
(s Merican)
|
99
|
+
(p Priest)
|
100
|
+
(p (Guard Officer "Gun Slinger" Hunter Primitive Pugilist Soldier Thug))))
|
101
|
+
|
102
|
+
Mind Killer:
|
103
|
+
(and ((xp_sum 200)
|
104
|
+
(stat_sum hp_or_mp 50)
|
105
|
+
(k "Mind Resistance")))
|
106
|
+
|
107
|
+
Monk:
|
108
|
+
(and ((xp_sum 100)
|
109
|
+
(stat_sum hp_or_mp 50)
|
110
|
+
(p ("Martial Artist" Priest))))
|
111
|
+
|
112
|
+
Mountebank:
|
113
|
+
(and ((xp_sum 100)
|
114
|
+
(stat_sum mp 100)
|
115
|
+
(p (Charlatan Gambler Merchant Politician))))
|
116
|
+
|
117
|
+
Nephilim:
|
118
|
+
(and ((xp_sum 200)
|
119
|
+
(stat_sum mp 50)
|
120
|
+
(s ("Nation of Accensor" Remnant))))
|
121
|
+
|
122
|
+
Oni:
|
123
|
+
(and ((xp_sum 100)
|
124
|
+
(stat_sum hp_or_mp 50)
|
125
|
+
(s "Red Star")
|
126
|
+
(p Priest)
|
127
|
+
(p (Guard Officer "Gun Slinger" Primitive Soldier))))
|
128
|
+
|
129
|
+
Overlord:
|
130
|
+
(and ((xp_sum 100)
|
131
|
+
(stat_sum hp_or_mp 50)
|
132
|
+
(p (Assassin Doctor Gambler "Mad Scientist" "Ring Leader" Engineer))
|
133
|
+
(p (Charlatan Entertainer Politician Priest Teacher))))
|
134
|
+
|
135
|
+
Reaper:
|
136
|
+
(and ((xp_sum 100)
|
137
|
+
(p ("Gun Slinger" Hunter Primitive Soldier))))
|
138
|
+
|
139
|
+
Sage:
|
140
|
+
(and ((xp_sum 100)
|
141
|
+
(stat_sum mp 50)
|
142
|
+
(p (Jones Printer Teacher))
|
143
|
+
(k (lore_type 4))))
|
144
|
+
Saint:
|
145
|
+
(and ((xp_sum 100)
|
146
|
+
(or ((p (Cook Doctor Priest Teacher))
|
147
|
+
(s "Nation of Accensor")))
|
148
|
+
((not (s "The Red Star")))))
|
149
|
+
|
150
|
+
Shadow:
|
151
|
+
(and ((xp_sum 200)
|
152
|
+
(stat_sum hp_or_mp 50)
|
153
|
+
(p (Assassin Thief Spy))))
|
154
|
+
|
155
|
+
Shepherd of the Land:
|
156
|
+
(and ((xp_sum 200)
|
157
|
+
(stat_sum hp_or_mp 100)
|
158
|
+
(p (Cook Brewer Teacher Entertainer Farmer Fishmonger))))
|
159
|
+
|
160
|
+
Survivor:
|
161
|
+
(and ((xp_sum 200)
|
162
|
+
(stat_sum hp_and_mp 100)))
|
163
|
+
|
164
|
+
Techno Savant:
|
165
|
+
(and ((xp_sum 100)
|
166
|
+
(stat_sum hp_or_mp 50)
|
167
|
+
(p ("Mad Scientist" Tinker Engineer))))
|
168
|
+
|
169
|
+
Thought Bender:
|
170
|
+
(and ((xp_sum 100)
|
171
|
+
(stat_sum mp 50)
|
172
|
+
(p Psionist)
|
173
|
+
(k (psionic_type advanced 2))))
|
174
|
+
|
175
|
+
Veteran:
|
176
|
+
(and ((xp_sum 200)
|
177
|
+
(k "Lore - Local Area")))
|
178
|
+
|
179
|
+
Villon:
|
180
|
+
(and ((xp_sum 100)
|
181
|
+
(p (Thief Assassin Spy))))
|
182
|
+
|
183
|
+
|
30
184
|
== Strain Profession Restriction ==
|
31
185
|
Baywalkers: Sawbones, Primitive, Thug
|
32
186
|
Diesel Jocks: Farmer, Politician, Publican
|
@@ -1034,4 +1188,4 @@ HM Trap Making
|
|
1034
1188
|
HN Unlock
|
1035
1189
|
HO Vanish
|
1036
1190
|
HP Weld
|
1037
|
-
HQ Wide Strike
|
1191
|
+
HQ Wide Strike
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: drpedia_lite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gloria Budiman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Extracts skills, strains, profession, and requirement trees into JSON
|
14
14
|
email: wahyu.g@gmail.com
|