Exemplo n.º 1
0
 def test_input(self):
     player = Player("julie", "f")
     with WrappedConsoleIO(None) as io:
         pc = PlayerConnection(player, io)
         player.tell("first this text")
         player.store_input_line("      input text     \n")
         x = pc.input_direct("inputprompt")
         self.assertEqual("input text", x)
         self.assertEqual("  first this text\ninputprompt ", sys.stdout.getvalue())  # should have outputted the buffered text
Exemplo n.º 2
0
Arquivo: story.py Projeto: irmen/Tale
 def welcome(self, player: Player) -> str:
     """
     Welcome text when player enters a new game
     If you return a string, it is used as an input prompt before continuing (a pause).
     """
     player.tell("<bright>Hello, %s!</> Welcome to the land of `%s'.  May your visit here be... interesting."
                 % (player.title, self.config.name), end=True)
     player.tell("--", end=True)
     return ""
Exemplo n.º 3
0
 def test_peek_output(self):
     player = Player("fritz", "m")
     player.io = ConsoleIo(None)
     player.set_screen_sizes(0, 100)
     player.tell("line1")
     player.tell("line2", 42)
     self.assertEqual(["line1\nline2\n42\n"], player.peek_output_paragraphs_raw())
     self.assertEqual("line1 line2 42\n", player.get_output())
     self.assertEqual([], player.peek_output_paragraphs_raw())
Exemplo n.º 4
0
 def test_tell_sep(self):
     player = Player("fritz", "m")
     pc = PlayerConnection(player, ConsoleIo(None))
     player.set_screen_sizes(0, 10)
     player.tell("apple", "bee", "zinc", "rose")
     self.assertEqual(["apple bee zinc rose\n"], player.test_get_output_paragraphs())
     pc.get_output()
     player.tell("apple", "bee", "zinc", "rose", format=False)
     self.assertEqual("apple\nbee\nzinc\nrose\n", pc.get_output())
Exemplo n.º 5
0
 def test_peek_output(self):
     player = Player("fritz", "m")
     pc = PlayerConnection(player, ConsoleIo(None))
     player.set_screen_sizes(0, 100)
     player.tell("line1")
     player.tell("line2", 42)
     self.assertEqual(["line1\nline2 42\n"], player.test_peek_output_paragraphs())
     self.assertEqual("line1 line2 42\n", pc.get_output())
     self.assertEqual([], player.test_peek_output_paragraphs())
Exemplo n.º 6
0
 def test_write_output(self):
     player = Player("julie", "f")
     with WrappedConsoleIO(None) as io:
         pc = PlayerConnection(player, io)
         player.tell("hello 1", end=True)
         player.tell("hello 2", end=True)
         pc.write_output()
         self.assertEqual("  hello 2", pc.last_output_line)
         self.assertEqual("  hello 1\n  hello 2\n", sys.stdout.getvalue())
Exemplo n.º 7
0
 def welcome(self, player: Player) -> str:
     """
     Welcome text when player enters a new game
     If you return a string, it is used as an input prompt before continuing (a pause).
     """
     player.tell(
         "<bright>Hello, %s!</> Welcome to the land of `%s'.  May your visit here be... interesting."
         % (player.title, self.config.name),
         end=True)
     player.tell("--", end=True)
     return ""
Exemplo n.º 8
0
 def test_write_output(self):
     player = Player("julie", "f")
     player.io = ConsoleIo(None)
     old_stdout = sys.stdout
     sys.stdout = StringIO()
     try:
         player.tell("hello 1", end=True)
         player.tell("hello 2", end=True)
         player.write_output()
         self.assertEqual("  hello 1\n  hello 2\n", sys.stdout.getvalue())
     finally:
         sys.stdout = old_stdout
Exemplo n.º 9
0
 def test_input(self):
     player = Player("julie", "f")
     player.prompt_toolkit_enabled = False
     with WrappedConsoleIO(None) as io:
         pc = PlayerConnection(player, io)
         player.tell("first this text")
         player.store_input_line("      input text     \n")
         x = pc.input_direct("inputprompt")
         self.assertEqual("input text", x)
         self.assertEqual("  first this text\ninputprompt ",
                          sys.stdout.getvalue()
                          )  # should have outputted the buffered text
Exemplo n.º 10
0
 def test_input(self):
     player = Player("julie", "f")
     player.io = ConsoleIo(None)
     old_stdout = sys.stdout
     sys.stdout = StringIO()
     try:
         player.tell("first this text")
         player.store_input_line("input text\n")
         x = player.input("inputprompt")
         self.assertEqual("input text", x)
         self.assertEqual("  first this text\ninputprompt", sys.stdout.getvalue())  # should have outputted the buffered text
     finally:
         sys.stdout = old_stdout
Exemplo n.º 11
0
 def welcome(self, player: Player) -> Optional[str]:
     """welcome text when player enters a new game"""
     player.tell("<bright>Hello, %s! Welcome to %s.</>" % (player.title, self.config.name), end=True)
     player.tell("\n")
     player.tell(self.driver.resources["messages/welcome.txt"].text)
     player.tell("\n")
     return None
Exemplo n.º 12
0
 def welcome_savegame(self, player: Player) -> Optional[str]:
     """welcome text when player enters the game after loading a saved game"""
     player.tell("<bright>Hello %s, welcome back to %s.</>" % (player.title, self.config.name), end=True)
     player.tell("\n")
     player.tell(self.driver.resources["messages/welcome.txt"].text)
     player.tell("\n")
     return None
Exemplo n.º 13
0
Arquivo: story.py Projeto: irmen/Tale
 def welcome(self, player: Player) -> str:
     player.tell("<bright>Welcome to `%s'.</>" % self.config.name, end=True)
     player.tell("This is a tiny embedded story to check out a running Tale environment.")
     player.tell("Try to communicate with your pet, and exit the house to win the game.")
     player.tell("\n")
     player.tell("\n")
     return ""
Exemplo n.º 14
0
 def welcome(self, player: Player) -> str:
     player.tell("<bright>Welcome to `%s'.</>" % self.config.name, end=True)
     player.tell(
         "This is a tiny embedded story to check out a running Tale environment."
     )
     player.tell(
         "Try to communicate with your pet, and exit the house to win the game."
     )
     player.tell("\n")
     player.tell("\n")
     return ""
Exemplo n.º 15
0
 def test_tell_emptystring(self):
     player = Player("fritz", "m")
     player.tell("", end=False)
     self.assertEqual([], player.test_get_output_paragraphs())
     player.tell("", end=True)
     self.assertEqual(["\n"], player.test_get_output_paragraphs())
     player.tell("", end=True)
     player.tell("", end=True)
     self.assertEqual(["\n", "\n"], player.test_get_output_paragraphs())
Exemplo n.º 16
0
 def test_tell_emptystring(self):
     player = Player("fritz", "m")
     player.tell("", end=False)
     self.assertEqual([], player.test_get_output_paragraphs())
     player.tell("", end=True)
     self.assertEqual(["\n"], player.test_get_output_paragraphs())
     player.tell("", end=True)
     player.tell("", end=True)
     self.assertEqual(["\n", "\n"], player.test_get_output_paragraphs())
Exemplo n.º 17
0
 def welcome(self, player: Player) -> str:
     """
     Welcome text when player enters a new game
     If you return a string, it is used as an input prompt before continuing (a pause).
     """
     player.tell("<bright>Welcome to `%s'.</>" % self.config.name, end=True)
     player.tell("\n")
     player.tell_text_file(self.driver.resources["messages/welcome.txt"])
     player.tell("\n")
     return "<bright>Press enter to continue.</>"
Exemplo n.º 18
0
Arquivo: story.py Projeto: irmen/Tale
 def welcome_savegame(self, player: Player) -> str:
     """
     Welcome text when player enters the game after loading a saved game
     If you return a string, it is used as an input prompt before continuing (a pause).
     """
     player.tell("<bright>Welcome back to `%s'.</>" % self.config.name, end=True)
     player.tell("\n")
     player.tell_text_file(self.driver.resources["messages/welcome.txt"])
     player.tell("\n")
     return "<bright>Press enter to continue where you were before.</>"
Exemplo n.º 19
0
def spawn_cvnum(player: Player, parsed: ParseResult, ctx: util.Context) -> None:
    """Spawn an item or monster with the given circle-vnum (or both if the circle-vnum is the same)."""
    if len(parsed.args) != 1:
        raise ParseError("You have to give the item or monster's circle-vnum.")
    vnum = int(parsed.args[0])
    try:
        item = make_item(vnum)
    except KeyError:
        player.tell("There's no item with that circle-vnum.")
    else:
        player.tell("Spawned " + repr(item) + " (into your inventory)")
        item.move(player, actor=player)
    try:
        mob = make_mob(vnum)
    except KeyError:
        player.tell("There's no monster with that circle-vnum.")
    else:
        player.tell("Spawned " + repr(mob) + " (into your current location)")
        mob.move(player.location, actor=player)
Exemplo n.º 20
0
 def welcome_savegame(self, player: Player) -> str:
     """
     Welcome text when player enters the game after loading a saved game
     If you return a string, it is used as an input prompt before continuing (a pause).
     """
     player.tell("<bright>Welcome back to `%s'.</>" % self.config.name,
                 end=True)
     player.tell("\n")
     # player.tell_text_file(self.driver.resources["messages/welcome.txt"])
     # player.tell_text_file(self.driver.resources["messages/motd.txt"])
     player.tell("\n")
     return "<bright>Press enter to continue where you were before.</>"
Exemplo n.º 21
0
def show_cvnum(player: Player, parsed: ParseResult, ctx: util.Context) -> None:
    """Show the circle-vnum of a location (.) or an object/living,
    or when you provide a circle-vnum as arg, show the object(s) with that circle-vnum."""
    if not parsed.args:
        raise ParseError("From what should I show the circle-vnum?")
    name = parsed.args[0]
    obj = None  # type: Union[Location, Living, Item, Exit]
    if name == ".":
        obj = player.location
    elif parsed.who_info:
        obj = parsed.who_1
    else:
        try:
            vnum = int(parsed.args[0])
        except ValueError as x:
            raise ActionRefused(str(x))
        objects = []   # type: List[Union[Location, Living, Item, Exit]]
        try:
            objects.append(make_item(vnum))
        except KeyError:
            pass
        try:
            objects.append(make_location(vnum))
        except KeyError:
            pass
        try:
            objects.append(make_mob(vnum))
        except KeyError:
            pass
        player.tell("Objects with circle-vnum %d:" % vnum + " " + (lang.join(str(o) for o in objects) or "none"))
        return
    try:
        vnum = obj.circle_vnum
        player.tell("Circle-Vnum of %s = %d." % (obj, vnum))
    except AttributeError:
        player.tell(str(obj) + " has no circle-vnum.")
Exemplo n.º 22
0
 def test_tell_formats(self):
     player = Player("fritz", "m")
     pc = PlayerConnection(player, ConsoleIo(None))
     player.set_screen_sizes(0, 100)
     player.tell("a b c", format=True)
     player.tell("d e f", format=True)
     self.assertEqual(["a b c\nd e f\n"], player.test_get_output_paragraphs())
     player.tell("a b c", format=True)
     player.tell("d e f", format=True)
     self.assertEqual("a b c d e f\n", pc.get_output())
     player.tell("a b c", format=False)
     player.tell("d e f", format=False)
     self.assertEqual(["a b c\nd e f\n"], player.test_get_output_paragraphs())
     player.tell("a b c", format=False)
     player.tell("d e f", format=False)
     self.assertEqual("a b c\nd e f\n", pc.get_output())
     player.tell("a b c", format=True)
     player.tell("d e f", format=False)
     self.assertEqual(["a b c\n", "d e f\n"], player.test_get_output_paragraphs())
     player.tell("a b c", format=True)
     player.tell("d e f", format=False)
     self.assertEqual("a b c\nd e f\n", pc.get_output())
Exemplo n.º 23
0
def do_score(player: Player, parsed: ParseResult, ctx: Context) -> None:
    """Show your current score in the game."""
    player.tell("You have taken %d turns so far." % player.turns)
Exemplo n.º 24
0
 def goodbye(self, player: Player) -> None:
     """goodbye text when player quits the game"""
     player.tell("Goodbye, %s. Please come back again soon." % player.title)
     player.tell("\n")
Exemplo n.º 25
0
def do_demo2(player: Player, parsed: ParseResult, ctx: Context) -> None:
    """demo command"""
    player.tell("DEMO COMMAND")
Exemplo n.º 26
0
def do_coin(player: Player, parsed: ParseResult, ctx: Context) -> None:
    """coin command that overwrites the default version"""
    player.tell("COIN OVERRIDE")
Exemplo n.º 27
0
def do_demo2(player: Player, parsed: ParseResult, ctx: Context) -> None:
    """demo command"""
    player.tell("DEMO COMMAND")
Exemplo n.º 28
0
def do_demo(player: Player, parsed: ParseResult, ctx: Context) -> None:
    """demo wizard command"""
    player.tell("DEMO WIZARD COMMAND")
Exemplo n.º 29
0
Arquivo: town.py Projeto: irmen/Tale
 def notify_player_arrived(self, player: Player, previous_location: Location) -> None:
     if previous_location is self:
         player.tell("...Weird... The door you just entered seems to go back to the same place you came from...")
Exemplo n.º 30
0
 def test_tell_chain(self):
     player = Player("fritz", "m")
     player.tell("hi").tell("there")
     self.assertEqual(["hi\nthere\n"], player.test_get_output_paragraphs())
Exemplo n.º 31
0
 def test_tell_chain(self):
     player = Player("fritz", "m")
     player.tell("hi").tell("there")
     self.assertEqual(["hi\nthere\n"], player.test_get_output_paragraphs())
Exemplo n.º 32
0
 def test_tell(self) -> None:
     player = Player("fritz", "m")
     player.tell("5")
     self.assertEqual(["5\n"], player.test_get_output_paragraphs())
     player.tell("")
     self.assertEqual([], player.test_get_output_paragraphs())
     player.tell("")
     player.tell("")
     self.assertEqual([], player.test_get_output_paragraphs())
     player.tell("")
     player.tell("line1")
     player.tell("line2")
     player.tell("")
     self.assertEqual(["line1\nline2\n"],
                      player.test_get_output_paragraphs())
     player.tell("", format=False)
     player.tell("line1", format=False)
     player.tell("", format=False)
     player.tell("line2", format=False)
     player.tell("", format=False)
     self.assertEqual(["\nline1\n\nline2\n\n"],
                      player.test_get_output_paragraphs())
     player.tell("\n")
     self.assertEqual(["\n"], player.test_get_output_paragraphs())
     player.tell("line1")
     player.tell("line2")
     player.tell("hello\nnewline")
     player.tell("\n")
     player.tell("ints")
     player.tell("42")
     player.tell("999")
     self.assertEqual(["line1\nline2\nhello\nnewline\n", "ints\n42\n999\n"],
                      player.test_get_output_paragraphs())
     self.assertEqual([], player.test_get_output_paragraphs())
     player.tell("para1", end=False)
     player.tell("para2", end=True)
     player.tell("para3")
     player.tell("\n")
     player.tell("para4")
     player.tell("\n")
     player.tell("para5")
     self.assertEqual(["para1\npara2\n", "para3\n", "para4\n", "para5\n"],
                      player.test_get_output_paragraphs())
     player.tell("   xyz   \n  123", format=False)
     self.assertEqual(["   xyz   \n  123\n"],
                      player.test_get_output_paragraphs())
     player.tell("line1", end=True)
     player.tell("\n")
     player.tell("line2", end=True)
     player.tell("\n")
     player.tell("\n")
     self.assertEqual(["line1\n", "\n", "line2\n", "\n", "\n"],
                      player.test_get_output_paragraphs())
     player.tell("one two three", format=False)
     self.assertEqual(["one two three\n"],
                      player.test_get_output_paragraphs())
Exemplo n.º 33
0
 def test_tell(self):
     player = Player("fritz", "m")
     player.tell(5)
     self.assertEqual(["5\n"], player.test_get_output_paragraphs())
     player.tell("")
     self.assertEqual([], player.test_get_output_paragraphs())
     player.tell("")
     player.tell("")
     self.assertEqual([], player.test_get_output_paragraphs())
     player.tell("")
     player.tell("line1")
     player.tell("line2")
     player.tell("")
     self.assertEqual(["line1\nline2\n"],
                      player.test_get_output_paragraphs())
     player.tell("", format=False)
     player.tell("line1", format=False)
     player.tell("", format=False)
     player.tell("line2", format=False)
     player.tell("", format=False)
     self.assertEqual(["\nline1\n\nline2\n\n"],
                      player.test_get_output_paragraphs())
     player.tell("\n")
     self.assertEqual(["\n"], player.test_get_output_paragraphs())
     player.tell("line1")
     player.tell("line2")
     player.tell("hello\nnewline")
     player.tell("\n")
     player.tell("ints", 42, 999)
     self.assertEqual(["line1\nline2\nhello\nnewline\n", "ints 42 999\n"],
                      player.test_get_output_paragraphs())
     self.assertEqual([], player.test_get_output_paragraphs())
     player.tell("para1", end=False)
     player.tell("para2", end=True)
     player.tell("para3")
     player.tell("\n")
     player.tell("para4", "\n", "para5")
     self.assertEqual(["para1\npara2\n", "para3\n", "para4 \n para5\n"],
                      player.test_get_output_paragraphs())
     player.tell("   xyz   \n  123", format=False)
     self.assertEqual(["   xyz   \n  123\n"],
                      player.test_get_output_paragraphs())
     player.tell("line1", end=True)
     player.tell("\n")
     player.tell("line2", end=True)
     player.tell("\n")
     player.tell("\n")
     self.assertEqual(["line1\n", "\n", "line2\n", "\n", "\n"],
                      player.test_get_output_paragraphs())
Exemplo n.º 34
0
 def test_tell_formatted(self):
     player = Player("fritz", "m")
     pc = PlayerConnection(player, ConsoleIo(None))
     player.set_screen_sizes(0, 100)
     player.tell("line1")
     player.tell("line2", "\n")
     player.tell("hello\nnewline")
     player.tell("\n")  # paragraph separator
     player.tell("ints", 42, 999)
     self.assertEqual("line1 line2 hello newline\nints 42 999\n",
                      pc.get_output())
     player.tell("para1", end=False)
     player.tell("para2", end=True)
     player.tell("para3")
     player.tell("\n")
     player.tell("para4", "\n", "para5")
     self.assertEqual("para1 para2\npara3\npara4   para5\n",
                      pc.get_output())
     player.tell("word " * 30)
     self.assertNotEqual(("word " * 30).strip(), pc.get_output())
     player.tell("word " * 30, format=False)
     self.assertEqual(
         ("word " * 30) + "\n",
         pc.get_output())  # when format=False output should be unformatted
     player.tell("   xyz   \n  123", format=False)
     self.assertEqual("   xyz   \n  123\n", pc.get_output())
     player.tell("line1", end=True)
     player.tell("\n")
     player.tell("line2", end=True)
     player.tell("\n")
     player.tell("\n")
     self.assertEqual(["line1\n", "\n", "line2\n", "\n", "\n"],
                      player.test_get_output_paragraphs())
     player.tell("line1", end=True)
     player.tell("\n")
     player.tell("line2", end=True)
     player.tell("\n")
     player.tell("\n")
     self.assertEqual("line1\n\nline2\n\n\n", pc.get_output())
Exemplo n.º 35
0
 def test_tell_formats(self):
     player = Player("fritz", "m")
     pc = PlayerConnection(player, ConsoleIo(None))
     player.set_screen_sizes(0, 100)
     player.tell("a b c", format=True)
     player.tell("d e f", format=True)
     self.assertEqual(["a b c\nd e f\n"],
                      player.test_get_output_paragraphs())
     player.tell("a b c", format=True)
     player.tell("d e f", format=True)
     self.assertEqual("a b c d e f\n", pc.get_output())
     player.tell("a b c", format=False)
     player.tell("d e f", format=False)
     self.assertEqual(["a b c\nd e f\n"],
                      player.test_get_output_paragraphs())
     player.tell("a b c", format=False)
     player.tell("d e f", format=False)
     self.assertEqual("a b c\nd e f\n", pc.get_output())
     player.tell("a b c", format=True)
     player.tell("d e f", format=False)
     self.assertEqual(["a b c\n", "d e f\n"],
                      player.test_get_output_paragraphs())
     player.tell("a b c", format=True)
     player.tell("d e f", format=False)
     self.assertEqual("a b c\nd e f\n", pc.get_output())
Exemplo n.º 36
0
 def test_tell_formatted(self):
     player = Player("fritz", "m")
     pc = PlayerConnection(player, ConsoleIo(None))
     player.set_screen_sizes(0, 100)
     player.tell("line1")
     player.tell("line2", "\n")
     player.tell("hello\nnewline")
     player.tell("\n")  # paragraph separator
     player.tell("ints", 42, 999)
     self.assertEqual("line1 line2 hello newline\nints 42 999\n", pc.get_output())
     player.tell("para1", end=False)
     player.tell("para2", end=True)
     player.tell("para3")
     player.tell("\n")
     player.tell("para4", "\n", "para5")
     self.assertEqual("para1 para2\npara3\npara4   para5\n", pc.get_output())
     player.tell("word " * 30)
     self.assertNotEqual(("word " * 30).strip(), pc.get_output())
     player.tell("word " * 30, format=False)
     self.assertEqual(("word " * 30) + "\n", pc.get_output())  # when format=False output should be unformatted
     player.tell("   xyz   \n  123", format=False)
     self.assertEqual("   xyz   \n  123\n", pc.get_output())
     player.tell("line1", end=True)
     player.tell("\n")
     player.tell("line2", end=True)
     player.tell("\n")
     player.tell("\n")
     self.assertEqual(["line1\n", "\n", "line2\n", "\n", "\n"], player.test_get_output_paragraphs())
     player.tell("line1", end=True)
     player.tell("\n")
     player.tell("line2", end=True)
     player.tell("\n")
     player.tell("\n")
     self.assertEqual("line1\n\nline2\n\n\n", pc.get_output())
Exemplo n.º 37
0
def do_score(player: Player, parsed: ParseResult, ctx: Context) -> None:
    """Show your current score in the game."""
    player.tell("You have taken %d turns so far." % player.turns)
Exemplo n.º 38
0
Arquivo: story.py Projeto: irmen/Tale
 def goodbye(self, player: Player) -> None:
     player.tell("Thanks for trying out Tale!")
Exemplo n.º 39
0
def do_demo(player: Player, parsed: ParseResult, ctx: Context) -> None:
    """demo wizard command"""
    player.tell("DEMO WIZARD COMMAND")
Exemplo n.º 40
0
 def notify_player_arrived(self, player: Player,
                           previous_location: Location) -> None:
     if previous_location is self:
         player.tell(
             "...Weird... The door you just entered seems to go back to the same place you came from..."
         )
Exemplo n.º 41
0
 def goodbye(self, player: Player) -> None:
     player.tell("Thanks for trying out Tale!")
Exemplo n.º 42
0
 def test_tell(self):
     player = Player("fritz", "m")
     player.tell(5)
     self.assertEqual(["5\n"], player.test_get_output_paragraphs())
     player.tell("")
     self.assertEqual([], player.test_get_output_paragraphs())
     player.tell("")
     player.tell("")
     self.assertEqual([], player.test_get_output_paragraphs())
     player.tell("")
     player.tell("line1")
     player.tell("line2")
     player.tell("")
     self.assertEqual(["line1\nline2\n"], player.test_get_output_paragraphs())
     player.tell("", format=False)
     player.tell("line1", format=False)
     player.tell("", format=False)
     player.tell("line2", format=False)
     player.tell("", format=False)
     self.assertEqual(["\nline1\n\nline2\n\n"], player.test_get_output_paragraphs())
     player.tell("\n")
     self.assertEqual(["\n"], player.test_get_output_paragraphs())
     player.tell("line1")
     player.tell("line2")
     player.tell("hello\nnewline")
     player.tell("\n")
     player.tell("ints", 42, 999)
     self.assertEqual(["line1\nline2\nhello\nnewline\n", "ints 42 999\n"], player.test_get_output_paragraphs())
     self.assertEqual([], player.test_get_output_paragraphs())
     player.tell("para1", end=False)
     player.tell("para2", end=True)
     player.tell("para3")
     player.tell("\n")
     player.tell("para4", "\n", "para5")
     self.assertEqual(["para1\npara2\n", "para3\n", "para4 \n para5\n"], player.test_get_output_paragraphs())
     player.tell("   xyz   \n  123", format=False)
     self.assertEqual(["   xyz   \n  123\n"], player.test_get_output_paragraphs())
     player.tell("line1", end=True)
     player.tell("\n")
     player.tell("line2", end=True)
     player.tell("\n")
     player.tell("\n")
     self.assertEqual(["line1\n", "\n", "line2\n", "\n", "\n"], player.test_get_output_paragraphs())
Exemplo n.º 43
0
 def notify_player_arrived(self, player: Player, previous_location: Location) -> None:
     # player has entered, and thus the story ends
     player.tell("\n")
     player.tell("\n")
     player.tell("<bright>Congratulations on escaping the house!</> Someone else has to look after the parakeet now though...")
     raise StoryCompleted
Exemplo n.º 44
0
 def notify_player_arrived(self, player: Player, previous_location: Location) -> None:
     # player has entered, and thus the story ends
     player.tell("\n")
     player.tell("\n")
     player.tell("<bright>Congratulations on escaping the house!</> Someone else has to look after Garfield now though...")
     raise StoryCompleted
Exemplo n.º 45
0
def do_coin(player: Player, parsed: ParseResult, ctx: Context) -> None:
    """coin command that overwrites the default version"""
    player.tell("COIN OVERRIDE")