Example #1
0
    def inventory(self, irc, msg, args, user):
        """
        Items in your inventory.
        """
        user_id = None

        try:
            user_id = self._get_user_id(irc, msg.prefix)
        except KeyError:
            log.error("SpiffyRPG: error getting user id for %s" % msg.prefix)

        dungeon = self.SpiffyWorld.get_dungeon_by_channel(GAME_CHANNEL)

        if dungeon is not None:
            player = dungeon.get_unit_by_user_id(user_id)

            if player is not None:
                announcer = PlayerAnnouncer(irc=irc,
                                            destination=msg.nick,
                                            ircutils=ircutils,
                                            ircmsgs=ircmsgs)

                announcer.inventory(player=player, irc=irc)
        else:
            irc.error("Your bags explode, blanketing you in flames!")
Example #2
0
    def fitems(self, irc, msg, args, unit_name):
        """
        Shows the items of another unit
        """
        dungeon = self.SpiffyWorld.get_dungeon_by_channel(GAME_CHANNEL)

        if dungeon is not None:
            unit = dungeon.get_unit_by_name(unit_name)

            if unit is not None:
                announcer = PlayerAnnouncer(irc=irc,
                                            destination=msg.nick,
                                            ircutils=ircutils,
                                            ircmsgs=ircmsgs)

                announcer.inventory(player=unit, irc=irc)
        else:
            log.error("SpiffyRPG: could not find dungeon %s" % msg.args[0])