pass
class DivinationCardsParser(WikiTableParser):
+ reward_kinds = ("currency", "map", "unique", "links", "skillgem", "rare", "magic", "other")
+
def handle_starttag(self, tag, attrs):
super(DivinationCardsParser, self).handle_starttag(tag, attrs)
by_reward.setdefault(it.reward_kind, []).append(it)
out = open("cards.txt", "w")
- for r, il in by_reward.items():
+ for r in DivinationCardsParser.reward_kinds:
out.write('category "card.{}"\n'.format(r))
out.write('{\n\tclass "Card";\n\tor\n\t{\n')
- for it in il:
+ for it in by_reward[r]:
out.write('\t\tbase_type "{}";\n'.format(it.name))
out.write("\t};\n};\n")
sys.stdout.write(prefix)
out = open("skillgems.txt", "w")
- out.write('category "skillgem.vaal"\n{\n\tclass "Skill Gem";\n\tor\n\t{\n')
+ out.write('category "skillgem.special.vaal"\n{\n\tclass "Skill Gem";\n\tor\n\t{\n')
for g in gems:
if g.vaal:
out.write('\t\tbase_type "{}";\n'.format(g.name))
out.write("\t};\n};\n")
- out.write('category "skillgem.drop"\n{\n\tclass "Skill Gem";\n\tor\n\t{\n')
+ out.write('category "skillgem.special.drop"\n{\n\tclass "Skill Gem";\n\tor\n\t{\n')
for g in gems:
if (g.drop_only or not g.price) and not g.vaal:
out.write('\t\tbase_type "{}";\n'.format(g.name))
out.write("\t};\n};\n")
for p, n in SkillGemParser.prices:
- out.write('category "skillgem.{}"\n'.format(p))
+ out.write('category "skillgem.price.{}"\n'.format(p))
out.write('{\n\tclass "Skill Gem";\n\tor\n\t{\n')
for g in gems:
- if g.price==p:
+ if not g.drop_only and g.price==p:
out.write('\t\tbase_type "{}";\n'.format(g.name))
out.write("\t};\n};\n")
for a in ["strength", "dexterity", "intelligence"]:
- out.write('category "skillgem.{}"\n'.format(a))
+ out.write('category "skillgem.attribute.{}"\n'.format(a))
out.write('{\n\tclass "Skill Gem";\n\tor\n\t{\n')
for g in gems:
if g.primary_attribute==a: