def unlock(self, actor: Living, item: Item = None) -> None: super().unlock(actor, item) if not self.locked: if isinstance(actor, Player): # remember a hint about unlocking this door if actor.hints.checkpoint( "unlocked_enddoor", "The way to freedom lies before you!"): actor.tell_later("<dim>(You will remember this event.)</>")
def notify_moved(self, source_container: ContainingType, target_container: ContainingType, actor: Living) -> None: # check if a player picked up this key player = None if isinstance(target_container, Player): player = target_container elif isinstance(self.contained_in, Player): player = self.contained_in if player: if player.hints.checkpoint( "got_doorkey", "You've found something that might open the exit."): actor.tell_later("<dim>(You will remember this event.)</>")