intficpy.travel module¶
-
class
intficpy.travel.DoorConnector(game, room1, direction1, room2, direction2)¶ Bases:
intficpy.travel.TravelConnectorA TravelConnector with a door that opens and closes.
A lock can be added to the door using setLock
- Parameters
game (IFPGame) – the current game
room1 (Room) – the first Room to connect
direction1 (valid direction string (n/north/se/southeast, etc.)) – the direction from room1 this connector attatches to (ex, pass in “n” to set room1.north to this connector)
room2 (Room) – the other Room to connect
direction1 – the direction from room2 this connector attatches to (ex, pass in “s” to set room2.south to this connector)
-
EntranceAType¶ alias of
intficpy.things.Door
-
EntranceBType¶ alias of
intficpy.things.Door
-
setLock(lock_obj)¶ Add a lock to this door.
- Parameters
lock_obj – the Lock to place on this door. Must not already be attached to something.
-
entrance_name= 'door'¶
-
class
intficpy.travel.LadderConnector(game, room1, room2)¶ Bases:
intficpy.travel.TravelConnectorA ladder to connect two rooms, one above, and one below.
- Parameters
-
default_description= 'A {name} leads {full_direction}. '¶
-
default_travel_msg= 'You climb {preposition} the {entrance.verbose_name}. '¶
-
entrance_a_preposition= 'up'¶
-
entrance_b_preposition= 'down'¶
-
entrance_name= 'ladder'¶
-
class
intficpy.travel.StaircaseConnector(game, room1, room2)¶ Bases:
intficpy.travel.TravelConnectorA staircase to connect two rooms, one above, and one below.
- Parameters
-
default_description= 'A {name} leads {full_direction}. '¶
-
default_travel_msg= 'You climb {preposition} the {entrance.verbose_name}. '¶
-
entrance_a_preposition= 'up'¶
-
entrance_b_preposition= 'down'¶
-
entrance_name= 'staircase'¶
-
entrance_synonyms= ['stairway', 'stairs', 'stair']¶
-
class
intficpy.travel.TravelConnector(game, room1, direction1, room2, direction2)¶ Bases:
intficpy.ifp_object.IFPObjectBase class for travel connectors. Links two rooms together, with an interactable Thing on each end.
By default, this creates a “doorway” on either end, without an opening and closing door.
- Parameters
game (IFPGame) – the current game
room1 (Room) – the first Room to connect
direction1 (valid direction string (n/north/se/southeast, etc.)) – the direction from room1 this connector attatches to (ex, pass in “n” to set room1.north to this connector)
room2 (Room) – the other Room to connect
direction1 – the direction from room2 this connector attatches to (ex, pass in “s” to set room2.south to this connector)
-
EntranceAType¶ alias of
intficpy.thing_base.Thing
-
EntranceBType¶ alias of
intficpy.thing_base.Thing
-
setFromPrototype(connector)¶
-
travel(game)¶ The player travels through this connector.
Determine if the player is able to pass, and if so, move the player.
- Parameters
game (IFPGame) – the current game
-
can_pass= True¶
-
cannot_pass_msg= 'The way is blocked. '¶
-
default_description= 'There is a {name} to the {full_direction}. '¶
-
default_travel_msg= 'You go {preposition} the {entrance.verbose_name}. '¶
-
entrance_a_msg= None¶
-
entrance_a_preposition= 'through'¶
-
entrance_b_msg= None¶
-
entrance_b_preposition= 'through'¶
-
entrance_name= 'doorway'¶
-
entrance_synonyms= []¶
-
intficpy.travel.getDirectionFromString(loc, input_string)¶ Given a direction string (n/nw/east, etc.), return the corresponding direction attribute of a given Room
- Parameters
loc (Room) – the Room we’re in
input_string (str) – the string to interpret as direction input
-
intficpy.travel.preRemovePlayer(game)¶ Remove the Player from all nested locations to prepare for travel
-
intficpy.travel.travelD(game)¶ Travel downward
-
intficpy.travel.travelDirection(game, direction)¶ Travel in the specified direction, from the player’s current location
- Parameters
game (IFPGame) – the current game
direction (str) – the direction input
-
intficpy.travel.travelE(game)¶ Travel east
-
intficpy.travel.travelIn(game)¶ Travel through entance
-
intficpy.travel.travelN(game)¶ Travel north
-
intficpy.travel.travelNE(game)¶ Travel northeast
-
intficpy.travel.travelNW(game)¶ Travel northwest
-
intficpy.travel.travelOut(game)¶ Travel out
-
intficpy.travel.travelS(game)¶ Travel south
-
intficpy.travel.travelSE(game)¶ Travel southeast
-
intficpy.travel.travelSW(game)¶ Travel southwest
-
intficpy.travel.travelU(game)¶ Travel upward
-
intficpy.travel.travelW(game)¶ Travel west