示例#1
0
    def __init__(self, ruin):
        self.lines = []

        room_name = "this place"
        try:
            md_writer.phrase_as_anchor_link(random.choice(ruin.rooms).full_name)
        except AttributeError:
            pass

        if random.random() < 0.5:
            self.lines.append(
                templates.Template("I {{verb_phrase}}.").render(
                    verb_phrase="{{place_phrase}} {{place}}|{{artifact_verb}} {{artifact}}|am lost in {{this_place}}|am {{state}}",
                    place="{{ruin_name}}|{{room_name}}",
                    this_place="{{ruin_name}}",
                    state="old|young|free|starving|afraid|powerful|a coward|alone|lonely|lost|sneaky|the best|cruel|lovely|hidden",
                    ruin_name=ruin.name,
                    artifact=md_writer.phrase_as_anchor_link(ruin.artifact.name),
                    room_name=room_name,
                    artifact_verb="found|lost|discovered|am seeking|can not find|want to find|worship",
                    place_phrase="was injured in|hid something in|discovered|found|am looting|am defending|am hiding in|am worshipping|am fleeing",
                )
            )

        if random.random() < 0.5:
            self.lines.append(self.generate_advice())

        if len(self.lines) == 0:
            self.lines.append(self.generate_advice())
示例#2
0
    def describeRacialEnemyActivity(self):
        enemy_is_or_are = "is"
        enemy_name = self.enemies[0].name
        villain_name = md_writer.phrase_as_anchor_link(self.ruin.villain.name)
        if len(self.enemies) > 1:
            enemy_is_or_are = "are"
            enemy_name = self.ruin.race

        return (templates.Template("{{sentence}}").render(
                sentence="{{negotiation}}|{{in_a_state}}|{{one_sleep}}|{{ritual}}|{{one_calls_for_help}}|{{one_deadly}}|{{fight_to_death}}",
                negotiation="The {{enemy_name}} {{is_or_are}} willing to negotiate.",
                in_a_state="The {{enemy_name}} {{is_or_are}} {{state}}.",
                state="drunk|celebrating|sleeping|feasting|fighting amongst themselves|meditating|caring for babies",
                one_sleep="One of the {{enemy_name}} is on watch, the rest are {{state}}.",
                one_deadly="One of the {{enemy_name}} is {{deadly}}.",
                deadly="pointing a ballista at the entrance|working a mechanism that can {{mechanism_result}}",
                mechanism_result="flood the room|engulf the room in a fiery blaze|launch acid at the Ruin Dogs|lock the exits|open a trapodoor in the floor|pour {{drop}} from the ceiling",
                drop="acid|liquid flames|a torrent of water|snakes|rats|bees|hornets|noxious gases",
                ritual="The {{enemy_name}} {{is_or_are}} performing a ritual. If not interrupted, {{ritual_result}}.",
                one_calls_for_help="If the {{enemy_name}} notice the Ruin Dogs, one of them will retreat and alert {{alerted}}.",
                ritual_result="{{villain_name}} will be magically alarmed|a powerful monster will be summoned|the {{enemy_name}} will become more powerful|the ruin dogs will be weakened",
                alerted="the others|{{villain_name}}",
                fight_to_death="The {{enemy_name}} {{is_or_are}} {{fight}}.",
                fight="berserk with rage|willing to fight to the death|defending this room from intruders|crazy with bloodlust",
                enemy_name=enemy_name,
                is_or_are=enemy_is_or_are,
                villain_name=villain_name

            ))
示例#3
0
 def generate_standard_opening(self):
     artifact_name = md_writer.phrase_as_anchor_link(self.ruin.artifact.name)
     return templates.Template("{{line}}").render(
         line="{{metaphor}}|{{people}}|{{artifact}}",
         artifact=artifact_name,
         metaphor="A_or_an {{metone}} is a_or_an {{mettwo}}",
         lament="{{poor_word}} {{poor_verb}} {{object}}",
         object="world|us|you|we|fate|cruelty|suffering|sadness|coldness|stars",
         metone=vocab.get_ogden_basic_noun(),
         mettwo=vocab.get_noun(),
         people="{{peoplephrase}} {{peopleare}}",
         peoplephrase="We are|You are|They are|All of us are",
         peopleare="cursed|dying|corrupted|free|joyful|sorrowful|lost|frozen|damned|hidden|love|maddened|envious",
     )
示例#4
0
 def __init__(self, ruin):
     self.ruin = ruin
     self.race = ruin_race.get_ruin_race()
     self.monster = monsters.get_monster(self.ruin.challenge_rating, 1, True)
     self.gender = random.choice(["male", "female"])
     self.name = names.get_name(self.gender)
     self.quality = random.choice([vocab.get_negative_quality(), vocab.get_negative_quality()]).title()
     self.motivation_description = templates.Template("He_or_she {{gender}} {{motivation}}.").render(
         motivation="{{religion}}|{{artifact}}",
         religion="is founding a new religion",
         artifact="is trying to {{relation}} {{artifact_name}}",
         artifact_name=md_writer.phrase_as_anchor_link(self.ruin.artifact.name),
         relation="research|find|discover|understand|exploit|use|hide|destroy|steal|recover",
         gender=self.gender,
     )
示例#5
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(" ","-")+")"))