Пример #1
0
    def on_yell(self, handler: Handler, player: Player, command_input: CommandInput, is_there_response=False):
        if player[EventsObject].knows_laura:
            super().on_yell(handler, player, command_input, False)
        else:
            super().on_yell(handler, player, command_input, True)
            player.send_message("You feel a hand go over your mouth.")
            player.send_message("You see a rock coming at your fa-")
            player.clear_screen()

            player.send_wait(1)
            laura = handler.get_livings(LauraPerson, 1)[0]
            laura.tell(player, "Who are you?")
            player.send_wait(0.5)
            laura.tell(player, Message("You have {}'s wallet! What did you do to them?",
                                       named_variables=[player[PlayerFriend]]))
            player.send_wait(0.3)
            player.tell(player, "He's my fri-")
            laura.tell(player, "Lies!")
            player.send_wait(1.2)
            player.clear_screen()

            player.send_wait(1)
            laura.tell(player, Message("Hi I'm {}. Sorry about that. Everything is cleared up now.",
                                       named_variables=[laura]))
            player[EventsObject].knows_laura = True  # make sure this code isn't run for the player again
            sword = Sword(SwordType.WOODEN)  # we just need this variable to reference in named_variables
            sword.change_holder(None, player.location)
            laura.tell(player, Message("How about for all your troubles I'll give you this {}. Take it.",
                                       named_variables=[sword]))
            Sword(SwordType.CHINESE_STEEL).change_holder(None, player.location)
Пример #2
0
 def send_options(player: Player, user: Target):
     options = user.get_move_options()
     rep = join_list([str(option) for option in options], use_brackets=True, use_indexes=True)
     player.send_message(Message("Options: {}".format(rep), named_variables=options))
     chooser = user.move_chooser  # should be a SetMoveChooser
     if chooser.chosen_move is not None:
         player.send_message(Message("You have already chosen: {}", named_variables=[chooser.chosen_move]))
     return InputHandleType.HANDLED
Пример #3
0
 def on_enter(self, player: Player, previous_location: Optional[Location], handler: Handler):
     self._send_welcome(player)
     if not player[EventsObject].been_introduced_to_furry:
         player.send_message("You hear screaming.")
         player.send_wait(0.3)
         player[PlayerFriend].tell(player, "H-Help me! This furry monster is chasing me!")
         player[PlayerFriend].tell(player,
                                   "Take my wallet! It's on the ground! Maybe you can distract it!")
         wallet = Wallet()
         penny = Coin.PENNY.create()
         wallet.change_holder(None, player.location)
         penny.change_holder(None, wallet)
Пример #4
0
 def on_item_use(self, handler: Handler, player: Player, item: Item):
     if isinstance(item, Sword):
         can_use = item.can_use(player)
         if not can_use[0]:
             player.send_message(can_use[1])
             return
         
         result = item.use_item(handler, player, does_custom_action=True)
         if result[0]:
             self.do_player_clear(player)
         else:
             player.send_message(result[1])
     else:
         super().on_item_use(handler, player, item)
    def on_yell(self,
                handler: Handler,
                player: Player,
                command_input: CommandInput,
                is_there_response=False) -> None:
        """
        There is a default player implementation for this

        is_there_response is only meant to be changed by inheriting classes (It shouldn't be changed by YellCommandHa..)

        :param handler: The handler object
        :param player: The player
        :param command_input: The player input object
        :param is_there_response: By default, False. If set to True, the default implementation won't
                send a message saying no one responded.
        :return: None
        """
        first_arg = command_input.get_arg(0, False)
        player.send_message(
            Message("You (Yelling): {}".format(" ".join(first_arg)),
                    MessageType.IMMEDIATE))
        player.send_message(Message("....",
                                    message_type=MessageType.TYPE_SLOW))
        if not is_there_response:
            player.send_message(self.__class__.NO_YELL_RESPONSE)
    def on_item_use(self, handler: Handler, player: Player,
                    item: Item) -> None:
        """
        Should be called by the UseCommandHandler.
        If overridden, it's recommended that you call the super method (this method)

        Note that this method should automatically check can_use, however, you should check item.can_reference\
        before you call this method

        :param handler: The handler object
        :param player: The player object
        :param item: The weapon that is being 'used'
        :return: None because the this Location should choose how it wants to handle the using of this weapon
        """
        can_use = item.can_use(player)
        if not can_use[0]:
            player.send_message(can_use[1])
            return
        result = item.use_item(handler, player, does_custom_action=False)
        if not result[0]:
            player.send_message(
                result[1]
            )  # send the player a message if they failed in some way
    def player_go(handler: Handler, player: Player, first_argument: str) -> InputHandleType:
        # note that first_argument doesn't have to be a single word
        point = get_point(handler, player, first_argument)
        if point is None:
            player.send_message("Cannot find location: \"" + first_argument + "\"")
            return InputHandleType.HANDLED
        new_location = handler.get_point_location(point)
        if new_location == player.location:
            player.send_message("You're already in that location!")
            return InputHandleType.HANDLED

        result = player.location.go_to_other_location(handler, new_location, point - player.location.point, player)
        if not result[0]:
            player.send_message(result[1])
        return InputHandleType.HANDLED
Пример #8
0
 def smell(self, handler: Handler, player: Player):
     player.send_message("You smell BO. It's yours!")
Пример #9
0
 def feel(self, handler: Handler, player: Player):
     player.send_message("You feel glad you've made it this far.")
Пример #10
0
 def listen(self, handler: Handler, player: Player):  # test
     if player[EventsObject].knows_laura or not player[EventsObject].been_introduced_to_furry:
         player.send_message(DONT_HEAR)
     else:
         player.send_message("You hear someone in the bushes. Maybe you can yell out to them.")
Пример #11
0
 def see(self, handler: Handler, player: Player):
     player.send_message("You see an old fountain and a ninja dude ")
Пример #12
0
 def see(self, handler: Handler, player: Player):
     if player not in self.ninja.entities_lost_to:
         player.send_message("You see {} waiting to fight you. There's no escaping now.".format(self.ninja))
     else:
         player.send_message("You see the path to the fountain to the west.")
Пример #13
0
 def see(self, handler: Handler, player: Player):
     player.send_message("You see double doors behind you and openings all around you.")
     player.send_message("The ground is grassy and you see trees around.")
Пример #14
0
 def see(self, handler: Handler, player: Player):
     if player[EventsObject].has_cleared_spider_webs_at_entrance:
         player.send_message("You see a lot of spider webs and an entrance north and south.")
     else:
         player.send_message("You see a lot of spider webs. It doesn't look passable.")
Пример #15
0
 def feel(self, handler: Handler, player: Player):
     if player not in self.ninja.entities_lost_to:
         player.send_message(Message("You feel scared that you have to face {}.", named_variables=[self.ninja]))
     else:
         player.send_message(Message("You feel glad that you beat {}.", named_variables=[self.ninja]))
Пример #16
0
 def listen(self, handler: Handler, player: Player):
     if player[EventsObject].been_introduced_to_furry:
         player.send_message(DONT_HEAR)
     else:
         player.send_message("You hear your friend screaming.")
Пример #17
0
 def do_player_clear(player: Player):
     if player[EventsObject].has_cleared_spider_webs_at_entrance:
         player.send_message("You've already cleared the spider webs.")
     else:
         player.send_message("You cleared the spider webs.")
         player[EventsObject].has_cleared_spider_webs_at_entrance = True
Пример #18
0
 def on_enter(self, player: Player, previous_location: Optional[Location], handler: Handler):
     self._send_welcome(player)
     if not player[EventsObject].been_introduced_to_furry:
         player.send_message("You hear your friend off in the distance screaming. "
                             "It's coming from the east of the double doors")
Пример #19
0
 def feel(self, handler: Handler, player: Player):
     if player[EventsObject].been_introduced_to_furry:
         player.send_message("You remember the moment you met the furry monster.")
     else:
         player.send_message("You feel scared. You should probably do something about the furry monster")
Пример #20
0
 def feel(self, handler: Handler, player: Player):
     player.send_message("You feel a little bit spooked.")
Пример #21
0
 def listen(self, handler: Handler, player: Player):
     player.send_message(DONT_HEAR)
Пример #22
0
 def see(self, handler: Handler, player: Player):
     if player[EventsObject].been_introduced_to_furry:
         player.send_message("You see nothing. There is just enough light to move around.")
     else:
         player.send_message("You see your friend being chased by a furry monster.")
Пример #23
0
 def taste(self, handler: Handler, player: Player):
     player.send_message(DONT_TASTE)
Пример #24
0
 def feel(self, handler: Handler, player: Player):
     player.send_message("You feel that it's cooler here than at the entrance.")
Пример #25
0
 def smell(self, handler: Handler, player: Player):
     player.send_message(DONT_SMELL)
Пример #26
0
 def _send_welcome(self, player: Player):
     player.send_line()
     player.send_message(Message("The {}.", named_variables=[self]))
     player.send_message(self.description)
     player.send_line()
Пример #27
0
 def on_enter(self, player: Player, previous_location: Optional[Location], handler: Handler):
     self._send_welcome(player)
     if player.uuid not in self.ninja.entities_lost_to:
         player.send_message(Message("It looks like you are going to have to fight {}.",
                                     named_variables=[self.ninja]))
Пример #28
0
 def listen(self, handler: Handler, player: Player):
     player.send_message("You hear nothing except for the occasional drop of water out of the fountain.")
Пример #29
0
 def listen(self, handler: Handler, player: Player):
     player.send_message("Silence. Kinda spooky.")
Пример #30
0
 def see(self, handler: Handler, player: Player):
     player.send_message("You see lots of trees and an exit back to the double doors")