Example #1
0
def parse_class(cl, book):
	cl = stat_block_pass(cl, book)
	cl = class_pass(cl)
	cl = domain_pass(cl)
	cl = bloodline_pass(cl)
	cl = arcane_school_pass(cl)
	cl = ability_pass(cl)
	cl = ranger_pass(cl)
	cl = mark_subtype_pass(cl, "Discovery", "ability", "alchemist_discovery")
	cl = mark_subtype_pass(cl, "Rage Powers", "ability", "barbarian_rage_power")
	cl = mark_subtype_pass(cl, "Bardic Performance", "section", "bardic_performance")
	cl = mark_subtype_pass(cl, "Deeds", "section", "gunslinger_deed")
	cl = mark_subtype_pass(cl, "Magus Arcana", "section", "magus_arcana")
	cl = mark_subtype_pass(cl, "Ninja Tricks", "section", "ninja_trick")
	cl = mark_subtype_pass(cl, "Oracle's Curse", "section", "oracle_curse")
	cl = mark_subtype_pass(cl, "Mysteries", "section", "oracle_mystery")
	cl = mark_subtype_pass(cl, "Rogue Talents", "section", "rogue_talent")
	cl = mark_subtype_pass(cl, "Advanced Talents", "section", "rogue_advanced_talent")
	cl = mark_subtype_pass(cl, "1-Point Evolutions", "section", "summoner_evolution_1")
	cl = mark_subtype_pass(cl, "2-Point Evolutions", "section", "summoner_evolution_2")
	cl = mark_subtype_pass(cl, "3-Point Evolutions", "section", "summoner_evolution_3")
	cl = mark_subtype_pass(cl, "4-Point Evolutions", "section", "summoner_evolution_4")
	cl = mark_subtype_pass(cl, "Cavalier Orders", "section", "warrior_order")
	cl = mark_subtype_pass(cl, "Samurai Orders", "section", "warrior_order")
	cl = mark_subtype_pass(cl, "Hex", "section", "witch_hex")
	cl = mark_subtype_pass(cl, "Major Hex", "section", "witch_major_hex")
	cl = mark_subtype_pass(cl, "Grand Hex", "section", "witch_grand_hex")
	cl = mark_subtype_pass(cl, "Patron Spells", "section", "witch_patron")
	cl = spell_list_pass(cl)
	#cl = entity_pass(cl)
	return cl
Example #2
0
def parse_feats(filename, output, book):
	struct = parse_universal(filename, output, book)
	#struct = entity_pass(struct)
	rules, feats = adjust_feat_structure_pass(struct, os.path.basename(filename))

	for feat in feats:
		feat_pass(feat)
		ability_pass(feat)
		section_naming_pass(feat)
		if rules['name'] == 'Monster Feats':
			monster_feat_pass(feat)

	for feat in feats:
		print "%s: %s" %(feat['source'], feat['name'])
		filename = create_feat_filename(output, book, feat)
		fp = open(filename, 'w')
		json.dump(feat, fp, indent=4)
		fp.close()
	if rules:
		write_rules(output, rules, book, "feats")
Example #3
0
def parse_rules(filename, output, book, title):
	basename = os.path.basename(filename)
	rules = parse_universal(filename, output, book)
	rules = stat_block_pass(rules, book)
	rules = structure_pass(rules, basename, book)
	if not basename in ['glossary.html']:
		rules = ability_pass(rules)
	rules = title_pass(rules, book, title)
	if not basename in ['ranger.html', 'universalMonsterRules.html', 'buildingAndModifyingConstructs.html', 'spellbooks.html']:
		rules = abbrev_pass(rules)
	print_struct(rules)
	print "%s: %s" %(rules['source'], rules['name'])
	write_rules(output, rules, book, title)
Example #4
0
def parse_feats(filename, output, book):
    struct = parse_universal(filename, output, book)
    struct = quote_pass(struct)
    struct = entity_pass(struct)
    rules, feats = adjust_feat_structure_pass(struct, os.path.basename(filename))

    for feat in feats:
        feat_pass(feat)
        ability_pass(feat)
        section_naming_pass(feat)
        prerequisite_pass(feat)
        if rules["name"] == "Monster Feats":
            monster_feat_pass(feat)

    for feat in feats:
        print "%s: %s" % (feat["source"], feat["name"])
        filename = create_feat_filename(output, book, feat)
        fp = open(filename, "w")
        json.dump(feat, fp, indent=4)
        fp.close()
    if rules:
        write_rules(output, rules, book, "feats")
Example #5
0
def parse_rules(filename, output, book, title, no_sb=False):
	basename = os.path.basename(filename)
	rules = parse_universal(filename, output, book)
	if basename in ["druid.html"]:
		rules = ultimate_magic_structure_pass(rules, basename, book)
	rules = stat_block_pass(rules, book, no_sb=no_sb)
	rules = structure_pass(rules, basename, book)
	if not basename in ['glossary.html']:
		rules = ability_pass(rules)
	rules = title_pass(rules, book, title)
	rules = quote_pass(rules)
	rules = entity_pass(rules)
	if not basename in ['ranger.html', 'universalMonsterRules.html', 'buildingAndModifyingConstructs.html', 'spellbooks.html', 'rings.html', 'massCombat.html']:
		rules = abbrev_pass(rules)
	print_struct(rules)
	print "%s: %s" %(rules['source'], rules['name'])
	write_rules(output, rules, book, title)
Example #6
0
def parse_creature(filename, output, book):
	basename = os.path.basename(filename)
	struct = parse_universal(filename, output, book, max_title=4)
	struct = stat_block_pass(struct, book)
	struct = animal_companion_pass(struct)
	struct = rule_pass(struct)
	struct = ability_pass(struct)
	struct = familiar_pass(struct, basename)
	struct = monster_race_pass(struct)
	struct = collapse_pass(struct)
	currrules = []
	if struct['type'] == 'section':
		struct['name'] = struct['sections'][0]['name']
		struct['name'] = struct['name'].split(",")[0]
		write_creature(output, book, struct)
	elif struct['type'] == 'creature':
		write_creature(output, book, struct)
	else:
		raise Exception("Uh Oh")
Example #7
0
def parse_spell(filename, output, book):
	struct = parse_universal(filename, output, book, max_title=4)
	struct = stat_block_pass(struct, book)
	struct = heading_pass(struct)
	#struct = entity_pass(struct)
	struct = ability_pass(struct)
	if struct['type'] == 'section':
		if struct.has_key('name'):
			write_rules(output, struct, book, struct['name'])
		else:
			parent_pass_in_file(struct)
			for spell in struct['sections']:
				misc_fix_pass(spell)
				cap_pass(spell)
				write_spell(output, book, spell)
	else:
		parent_pass_out_of_file(struct)
		misc_fix_pass(struct)
		cap_pass(struct)
		write_spell(output, book, struct)