Beispiel #1
0
    def render(self):
        md_writer.print_chapter_subheading(md_writer.phrase_with_anchor(self.full_name))

        for sentence in self.details:
            md_writer.print_chapter_sentence(sentence)

        md_writer.end_chapter()

        if self.engraving is not None:
            md_writer.print_chapter_sentence(templates.Template("There is an engraving on {{location}} written in {{language}}.")
                                             .render(location=self.engraving_location,
                                                     language=self.ruin.race + " Script|common"))
            md_writer.end_paragraph()
            self.engraving.render()
        md_writer.end_chapter()

        for prop in self.props:
            md_writer.print_list_item(templates.Template("There is a_or_an {{prop}} here.").render(prop=prop) + "\n")
        if self.artifact is not None:
            md_writer.print_list_item(templates.Template("{{artifact}} is here.").render(artifact=md_writer.phrase_as_anchor_link(self.artifact.name)) + "\n")
        if self.villain is not None:
            md_writer.print_list_item(templates.Template("{{villain}} is here.").render(villain=md_writer.phrase_as_anchor_link(self.villain.__str__())) + "\n")

        for key, val in self.connections.items():
            if val is None:
                pass
            elif val == 'entrance':
                 md_writer.print_list_item(templates.Template("To the {{direction}} is the entrance.").render(direction=key) + "\n")
            else:
                connection = val[0]
                connected_room = val[1]
                md_writer.print_list_item(templates.Template("To the {{direction}} {{connection}} {{leadsto}} {{room}}.\n").render(
                    direction=key, connection=connection.description,
                    leadsto="leads to|connects to|opens to",
                    room="["+connected_room.full_name+"]"+"(#"+connected_room.full_name.replace(" ","-")+")"))
Beispiel #2
0
 def render(self):
     ruin_save_name = self.name.replace(" ", "-")
     ruin_map_file_name = ruin_save_name + ".png"
     grapher.save_graph(self, ruin_map_file_name)
     md_writer.print_title("Ruin Dogs")
     md_writer.print_sub_title(self.name)
     md_writer.print_chapter_heading("Overview")
     md_writer.print_chapter_sentence(self.location_description)
     md_writer.print_chapter_sentence(self.parts_description)
     md_writer.print_chapter_sentence(self.circumstances_description)
     md_writer.print_chapter_sentence(self.race_description)
     md_writer.print_chapter_sentence(self.villain_sentence)
     md_writer.print_chapter_sentence(self.race_villain_relation_sentence)
     md_writer.print_chapter_sentence(self.villain.motivation_description)
     md_writer.end_paragraph()
     md_writer.end_chapter()
     md_writer.print_chapter_heading("Artifact")
     self.artifact.render()
     md_writer.end_paragraph()
     md_writer.end_chapter()
     md_writer.print_chapter_heading("Locations")
     md_writer.end_chapter()
     md_writer.insert_image('../'+md_writer.output_folder+'/images/' + ruin_map_file_name, 'layout')
     for room in self.rooms:
         room.render()
         md_writer.end_paragraph()
     md_writer.end_novel(css='http://mattfister.github.io/ruindogs/base.css')