Defines the Cast class.
The control centre from which the entire cast of characters is monitored.
| Parameter: | sprites (pygame.Surface) – An image of the sprite matrix (sprites.png). |
|---|
Add the bike to the cast.
| Parameters: |
|
|---|
Add a blackboard message to a character’s collection.
| Parameters: |
|
|---|
Add a character (other than Eric) to the cast.
| Parameters: |
|
|---|
Add a command to a command list.
| Parameters: |
|
|---|
Add a command list to a character’s personal timetable.
| Parameters: |
|
|---|
Add the conker to the cast.
| Parameters: |
|
|---|
Add the desk lid to the cast.
| Parameters: |
|
|---|
Add Eric to the cast.
| Parameters: |
|
|---|
Add a frog to the cast.
| Parameters: |
|
|---|
Add a lesson message to a character’s collection. A lesson message is something like ‘START READING AT THE NEXT CHAPTER IN YOUR BOOKS’, which will be used by a teacher during class if he’s not teaching Eric, or he has decided not to have a question-and-answer session with the swot.
| Parameters: |
|
|---|
Add a lines message to a character’s collection.
| Parameters: |
|
|---|
Add a mouse to the cast.
| Parameters: |
|
|---|
Add a pellet to the cast.
| Parameters: |
|
|---|
Add a plant to the cast.
| Parameters: |
|
|---|---|
| Returns: | The plant. |
Add the sherry drop to the cast.
| Parameters: |
|
|---|
Add a sprite (an animatory state image) to the cast.
| Parameters: |
|
|---|
Add a stinkbomb to the cast.
| Parameters: |
|
|---|
Add a jet of water or sherry to the cast.
| Parameters: |
|
|---|
Add the water drop to the cast.
| Parameters: |
|
|---|
Return whether any member of the cast can give a specific lines message.
| Parameter: | message_id – The ID of the lines message. |
|---|
Take appropriate action when a mouse is caught. If the mouse is immortal (defined in the [Mice] section of the ini file), it will be relocated (so that Eric can catch it again). If it is not immortal (Eric previously released it), it is removed from the game.
| Parameter: | mouse – The captured mouse. |
|---|
Switch a character to a new command list.
| Parameters: |
|
|---|
Check whether a frog has hit the head of anyone who holds a safe key, and hand the safe key to Eric if so.
| Parameter: | frog – The frog to check. |
|---|---|
| Returns: | True if Eric got the safe key, False otherwise. |
Drop any character at a given location. This is used by plants when they die.
| Parameters: |
|
|---|
Replace occurrences of $BLAH in a message with the name of the character whose unique ID is ‘BLAH’.
| Parameter: | message – The message. |
|---|
Replace any title macros in a message with the title of a character.
| Parameters: |
|
|---|
Set someone with the appropriate authority on their way to expel Eric.
| Parameter: | command_list_id – The ID of the command list the expeller should use. |
|---|
Attempt to freeze Eric. The attempt will fail if Eric is writing on a blackboard.
| Returns: | True if Eric was frozen, False otherwise. |
|---|
Return a member of the cast.
| Parameter: | character_id – The ID of the cast member. |
|---|
Return a tale about Eric being absent for the swot to tell a teacher.
| Parameter: | teacher – The teacher. |
|---|
Return any mouse or frog that is on the floor immediately in front of a character, or None if there is none.
| Parameter: | character (Character) – The character. |
|---|
Return a suitable character to hit with a conker at a given location, or None if there is none. A character is considered suitable if he can be knocked over by a conker.
| Parameters: |
|
|---|
Return a tale about hitting for the swot to tell a teacher.
| Parameter: | teacher – The teacher. |
|---|---|
| Returns: | A 2-tuple containing the ID of the character blamed by the swot, and the tale. |
Return a list of adults who are close enough to a target character (and are facing the right way) to be able to see him.
| Parameter: | character (Character) – The target character. |
|---|
Return a list of lines-givers who are close enough to a target character (and are facing the right way) to be able to see him.
| Parameter: | character (Character) – The target character. |
|---|
Return the potential lines recipient who is nearest to a target character, or None if there is none.
| Parameter: | character (Character) – The target character. |
|---|
Return the most suitable character to hit with a catapult pellet at a given location, or None if there is none.
| Parameters: |
|
|---|
Return the first punchable character who is facing a target character at a given distance.
| Parameters: |
|
|---|---|
| Returns: | A punchable character, or None if there is none at the given distance. |
Return a suitable character to hit with a drop of sherry at a given location, or None if there is none. A character is considered suitable if he holds a storeroom combination letter.
| Parameters: |
|
|---|
Return a suitable character to hit with a drop of water at a given location, or None if there is none. A character is considered suitable if he holds a bike combination digit.
| Parameters: |
|
|---|
Return a tale about writing on the blackboard for the swot to tell a teacher.
| Parameters: |
|
|---|---|
| Returns: | A 2-tuple containing writer_id and the tale, or (None, None) if the character who wrote on the board is not in the list of scapegoats favoured by the swot. |
Check whether a catapult pellet has hit a conker. If it has, the conker will start falling.
| Parameter: | pellet – The catapult pellet. |
|---|---|
| Returns: | True if a conker was hit, False otherwise. |
Initialise every member of the cast.
| Parameters: |
|---|
Initialise the bike combination.
| Returns: | The combination. |
|---|
Initialise the safe combination.
| Returns: | The combination. |
|---|
Initialise the storeroom combination.
| Returns: | The combination. |
|---|
Insert any frogs that have been caught by Eric into a cup.
| Parameter: | cup – The cup. |
|---|
Return whether a character is next to the bike.
| Parameter: | character (Character) – The character to check. |
|---|
Return whether a character is beside Eric (and so need go no further to find him).
| Parameter: | character (Character) – The character to check. |
|---|
Return whether every character is on the ‘home’ side of a given x-coordinate.
| Parameter: | x – The x-coordinate. |
|---|
Return whether a character is standing on a kid who’s been knocked out.
| Parameter: | character (Character) – The character to check. |
|---|
Return whether a character is in the same location as Eric.
| Parameter: | character (Character) – The character to check. |
|---|
Remove a mouse from the game.
| Parameter: | mouse – The mouse to remove. |
|---|
Make a cup spill its contents (as when hit by a catapult pellet). A cup may contain water, sherry, a frog, or nothing.
| Parameter: | cup – The cup. |
|---|
Lift any character at a given location. This is used by plants when growing.
| Parameters: |
|
|---|
Move the members of the cast.
| Returns: | -1 if the screen should scroll right, 1 if it should scroll left, or 0 if it should not scroll (after moving Eric). |
|---|
Move the bike away from a door if necessary (so that it may be closed).
| Parameter: | door – The door. |
|---|
Make a character open a desk. The desk lid will be raised.
| Parameters: |
|
|---|
Return the plant that a character is standing on, or None if he’s not standing on one.
| Parameter: | character (Character) – The character to check. |
|---|
Release some mice at a given location.
| Parameters: |
|
|---|
Make any characters near a mouse respond appropriately.
| Parameter: | mouse – The mouse. |
|---|
Set the lesson (as after the bell rings). Everybody except Eric collects a new command list from their personal timetable.
| Parameter: | lesson_id – The ID of the lesson. |
|---|
Set the location of a character.
| Parameters: |
|
|---|
Set the collection of random locations for a character.
| Parameters: |
|
|---|
Set the sit-down message for a character.
| Parameters: |
|
|---|
Set someone with the appropriate authority on their way to shadow Eric for this period.
| Parameter: | command_list_id – The ID of the command list the shadower should use. |
|---|
Return a character who can smell a stinkbomb, or None if there is none.
| Parameter: | stinkbomb – The stinkbomb. |
|---|
Return whether somebody is standing near a door.
| Parameter: | door – The door to check. |
|---|
Make a character trip people up at a given location.
| Parameters: |
|
|---|
Water (or sherry) a plant. If the liquid is water, the plant will start growing.
| Parameters: |
|
|---|