intficpy/room.py
def describe(self, game):
        """Generates and prints the Room description shown when the player enters this
        Room, or looks around.

        If it is too dark to see, only describe the darkness.
        Otherwise, print the Room description, and the descriptions of the Things that
        that are currently here.

        Returns False if it is too dark to see, and True otherwise.

        :param game: the current game
        :type game: IFPGame
        :rtype: bool
        """
        if self.describeDark(game):
            return False

        self.arriveFunc(game)
        self.updateDiscovered(game)

        self.fulldesc = self.desc
        desc_loc = False
        child_items = []
        for key, things in self.contains.items():
            for item in things:
                if item == game.me.location:
                    desc_loc = key
                elif item.parent_obj:
                    child_items.append(item.ix)
                # give player "knowledge" of a thing upon having it described
                if item.known_ix not in game.me.knows_about:
                    # game.me.knows_about.append(item.known_ix)
                    item.makeKnown(game.me)
            if desc_loc != key and key not in child_items and len(things) > 1:
                self.fulldesc = (
                    self.fulldesc
                    + " There are "
                    + str(len(things))
                    + " "
                    + things[0].plural
                    + " here. "
                )
            elif desc_loc != key and key not in child_items and len(things) > 0:
                self.fulldesc = self.fulldesc + things[0].desc
        if desc_loc:
            self.fulldesc = self.fulldesc + "<br>"
            if len(self.contains[desc_loc]) > 2:
                self.fulldesc = self.fulldesc + (
                    "You are "
                    + game.me.position
                    + " "
                    + game.me.location.contains_preposition
                    + " "
                    + game.me.location.getArticle()
                    + game.me.location.verbose_name
                    + ". "
                )
                self.getLocContents(game.me)
                self.fulldesc = self.fulldesc + (
                    "There are "
                    + str(len(self.contains[desc_loc]) - 1)
                    + " more "
                    + self.contains[desc_loc][0].plural
                    + " nearby. "
                )
            elif len(self.contains[desc_loc]) > 1:
                self.fulldesc = self.fulldesc + (
                    "You are "
                    + game.me.position
                    + " "
                    + game.me.location.contains_preposition
                    + " "
                    + game.me.location.getArticle()
                    + game.me.location.verbose_name
                    + ". "
                )
                self.getLocContents(game)
                self.fulldesc = self.fulldesc + (
                    "There is another "
                    + self.contains[desc_loc][0].verbose_name
                    + " nearby. "
                )
            else:
                self.fulldesc = self.fulldesc + (
                    "You are "
                    + game.me.position
                    + " "
                    + game.me.location.contains_preposition
                    + " "
                    + game.me.location.getArticle()
                    + game.me.location.verbose_name
                    + ". "
                )
                self.getLocContents(game)
        game.addTextToEvent("turn", "<b>" + self.name + "</b>")
        game.addTextToEvent("turn", self.fulldesc)
        self.descFunc(game)
        return True
Generates and prints the Room description shown when the player enters this
        Room, or looks around.

        If it is too dark to see, only describe the darkness.
        Otherwise, print the Room description, and the descriptions of the Things that
        that are currently here.

        Returns False if it is too dark to see, and True otherwise.

        :param game: the current game
        :type game: IFPGame
        :rtype: bool
        
Generates and prints the Room description shown when the player enters this
Room, or looks around.

If it is too dark to see, only describe the darkness.
Otherwise, print the Room description, and the descriptions of the Things that
that are currently here.

Returns False if it is too dark to see, and True otherwise.
Generates and prints the Room description shown when the player enters this Room or looks around . If it is too dark to see only describe the darkness . Otherwise print the Room description and the descriptions of the Things that that are currently here . Returns False if it is too dark to see and True otherwise .
def describe(self, game):
        if self.describeDark(game):
            return False
        self.arriveFunc(game)
        self.updateDiscovered(game)
        self.fulldesc = self.desc
        desc_loc = False
        child_items = []
        for key, things in self.contains.items():
            for item in things:
                if item == game.me.location:
                    desc_loc = key
                elif item.parent_obj:
                    child_items.append(item.ix)
                if item.known_ix not in game.me.knows_about:
                    item.makeKnown(game.me)
            if desc_loc != key and key not in child_items and len(things) > 1:
                self.fulldesc = (
                    self.fulldesc
                    + " There are "
                    + str(len(things))
                    + " "
                    + things[0].plural
                    + " here. "
                )
            elif desc_loc != key and key not in child_items and len(things) > 0:
                self.fulldesc = self.fulldesc + things[0].desc
        if desc_loc:
            self.fulldesc = self.fulldesc + "<br>"
            if len(self.contains[desc_loc]) > 2:
                self.fulldesc = self.fulldesc + (
                    "You are "
                    + game.me.position
                    + " "
                    + game.me.location.contains_preposition
                    + " "
                    + game.me.location.getArticle()
                    + game.me.location.verbose_name
                    + ". "
                )
                self.getLocContents(game.me)
                self.fulldesc = self.fulldesc + (
                    "There are "
                    + str(len(self.contains[desc_loc]) - 1)
                    + " more "
                    + self.contains[desc_loc][0].plural
                    + " nearby. "
                )
            elif len(self.contains[desc_loc]) > 1:
                self.fulldesc = self.fulldesc + (
                    "You are "
                    + game.me.position
                    + " "
                    + game.me.location.contains_preposition
                    + " "
                    + game.me.location.getArticle()
                    + game.me.location.verbose_name
                    + ". "
                )
                self.getLocContents(game)
                self.fulldesc = self.fulldesc + (
                    "There is another "
                    + self.contains[desc_loc][0].verbose_name
                    + " nearby. "
                )
            else:
                self.fulldesc = self.fulldesc + (
                    "You are "
                    + game.me.position
                    + " "
                    + game.me.location.contains_preposition
                    + " "
                    + game.me.location.getArticle()
                    + game.me.location.verbose_name
                    + ". "
                )
                self.getLocContents(game)
        game.addTextToEvent("turn", "<b>" + self.name + "</b>")
        game.addTextToEvent("turn", self.fulldesc)
        self.descFunc(game)
        return True
def describe ( self , game ) : if self . describeDark ( game ) : return False self . arriveFunc ( game ) self . updateDiscovered ( game ) self . fulldesc = self . desc desc_loc = False child_items = [ ] for key , things in self . contains . items ( ) : for item in things : if item == game . me . location : desc_loc = key elif item . parent_obj : child_items . append ( item . ix ) if item . known_ix not in game . me . knows_about : item . makeKnown ( game . me ) if desc_loc != key and key not in child_items and len ( things ) > 1 : self . fulldesc = ( self . fulldesc + " There are " + str ( len ( things ) ) + " " + things [ 0 ] . plural + " here. " ) elif desc_loc != key and key not in child_items and len ( things ) > 0 : self . fulldesc = self . fulldesc + things [ 0 ] . desc if desc_loc : self . fulldesc = self . fulldesc + "<br>" if len ( self . contains [ desc_loc ] ) > 2 : self . fulldesc = self . fulldesc + ( "You are " + game . me . position + " " + game . me . location . contains_preposition + " " + game . me . location . getArticle ( ) + game . me . location . verbose_name + ". " ) self . getLocContents ( game . me ) self . fulldesc = self . fulldesc + ( "There are " + str ( len ( self . contains [ desc_loc ] ) - 1 ) + " more " + self . contains [ desc_loc ] [ 0 ] . plural + " nearby. " ) elif len ( self . contains [ desc_loc ] ) > 1 : self . fulldesc = self . fulldesc + ( "You are " + game . me . position + " " + game . me . location . contains_preposition + " " + game . me . location . getArticle ( ) + game . me . location . verbose_name + ". " ) self . getLocContents ( game ) self . fulldesc = self . fulldesc + ( "There is another " + self . contains [ desc_loc ] [ 0 ] . verbose_name + " nearby. " ) else : self . fulldesc = self . fulldesc + ( "You are " + game . me . position + " " + game . me . location . contains_preposition + " " + game . me . location . getArticle ( ) + game . me . location . verbose_name + ". " ) self . getLocContents ( game ) game . addTextToEvent ( "turn" , "<b>" + self . name + "</b>" ) game . addTextToEvent ( "turn" , self . fulldesc ) self . descFunc ( game ) return True
Generates and prints the Room description shown when the player enters this
Room, or looks around.
Generates and prints the Room description shown when the player enters this Room or looks around .
"""Generates and prints the Room description shown when the player enters this
        Room, or looks around.

        If it is too dark to see, only describe the darkness.
        Otherwise, print the Room description, and the descriptions of the Things that
        that are currently here.

        Returns False if it is too dark to see, and True otherwise.

        :param game: the current game
        :type game: IFPGame
        :rtype: bool
        """ # give player "knowledge" of a thing upon having it described # game.me.knows_about.append(item.known_ix)
None
bool
self
game
the current game
the current game