def handle_verb(self, parsed: ParseResult, actor: Living) -> bool: if parsed.verb in ("drive", "open", "enter", "sit", "use", "start"): if not parsed.args: raise ParseError("%s what?" % parsed.verb) if "yellow" not in parsed.args and "convertible" not in parsed.args: if "car" in parsed.args or "engine" in parsed.args: raise ActionRefused("Most of the cars are locked. You should look for one that isn't.") raise ActionRefused("You cannot do that.") # check if Peter is with you if not self.search_living("Peter"): raise ActionRefused("Surely you wouldn't leave the town without your friend Peter! " "You should find him and get out here together!") # player drives the yellow car away from here together with her friend Peter, and thus the story ends! actor.tell_text_file(mud_context.resources["messages/completion_success.txt"]) # type: ignore raise StoryCompleted return False
def handle_verb(self, parsed: ParseResult, actor: Living) -> bool: if parsed.verb in ("drive", "open", "enter", "sit", "use", "start"): if not parsed.args: raise ParseError("%s what?" % parsed.verb) if "yellow" not in parsed.args and "convertible" not in parsed.args: if "car" in parsed.args or "engine" in parsed.args: raise ActionRefused("Most of the cars are locked. You should look for one that isn't.") raise ActionRefused("You cannot do that.") # check if Peter is with you if not self.search_living("Peter"): raise ActionRefused("Surely you wouldn't leave the town without your friend Peter! " "You should find him and get out here together!") # player drives the yellow car away from here together with her friend Peter, and thus the story ends! actor.tell_text_file(mud_context.resources["messages/completion_success.txt"]) raise StoryCompleted return False