def domain_pass(struct): d = find_section(struct, name="Domains", section_type='section') if d: domains = find_all_sections(struct, name=re.compile('^.*Domain$'), section_type='section') for domain in domains: remove_section(struct, domain) domain['subtype'] = 'cleric_domain' add_section(d, domain) return struct
def domain_pass(struct): d = find_section(struct, name="Domains", section_type="section") if d: domains = find_all_sections(struct, name=re.compile("^.*Domain$"), section_type="section") for domain in domains: remove_section(struct, domain) domain["subtype"] = "cleric_domain" add_section(d, domain) return struct
def bloodline_pass(struct): s = find_section(struct, name="Sorcerer Bloodlines", section_type='section') if s: collect = False bloodlines = [] for section in struct['sections']: if collect: bloodlines.append(section) elif s == section: collect = True for bloodline in bloodlines: bloodline['subtype'] = 'sorcerer_bloodline' remove_section(struct, bloodline) add_section(s, bloodline) return struct
def arcane_school_pass(struct): s = find_section(struct, name="Arcane Schools", section_type='section') if s: collect = False schools = [] for section in struct['sections']: if section.get('name') == 'Familiars': collect = False elif collect: schools.append(section) elif s == section: collect = True for school in schools: school['subtype'] = 'arcane_school' remove_section(struct, school) add_section(s, school) return struct
def arcane_school_pass(struct): s = find_section(struct, name="Arcane Schools", section_type="section") if s: collect = False schools = [] for section in struct["sections"]: if section.get("name") == "Familiars": collect = False elif collect: schools.append(section) elif s == section: collect = True for school in schools: school["subtype"] = "arcane_school" remove_section(struct, school) add_section(s, school) return struct