intficpy.things module

class intficpy.things.Abstract(game, name)

Bases: intficpy.thing_base.Thing

Class for abstract game items with no location, such as ideas

class intficpy.things.AbstractClimbable(game, name)

Bases: intficpy.thing_base.Thing

Represents one end of a staircase or ladder. Creators should generally use a LadderConnector or StaircaseConnector (travel.py) rather than directly creating AbstractClimbable instances.

invItem = False
class intficpy.things.Book(game, name, text="There's nothing written here. ")

Bases: intficpy.things.Openable, intficpy.things.Readable

Readable that can be opened

is_open = False
class intficpy.things.Clothing(game, name)

Bases: intficpy.thing_base.Thing

Class for Things that can be worn

wearable = True
class intficpy.things.Container(game, name)

Bases: intficpy.things.Openable

Things that can contain other Things

containsLiquid()

Returns the first Liquid found in the Container or None

giveLid()
hideContents()
liquidRoomLeft()

Returns the portion of the Container’s size not taken up by a liquid

makeClosed()
makeOpen()
revealContents()
setLock(lock_obj)
property contains_desc

Describe the contents of an item

contains_in = True
contains_preposition = 'in'
contains_preposition_inverse = 'out'
desc_reveal = True
holds_liquid = False
size = 50
xdesc_reveal = True
class intficpy.things.Door(game, name)

Bases: intficpy.things.Openable

Represents one side of a door. Always define with a twin, and set a direction. Can be open or closed. Creators should generally use DoorConnectors (travel.py) rather than defining Doors directly.

makeClosed()
makeOpen()
invItem = False
class intficpy.things.Key(game, name='key')

Bases: intficpy.thing_base.Thing

Class for keys

class intficpy.things.LightSource(game, name)

Bases: intficpy.thing_base.Thing

Class for Things that are light sources

consumeLightSourceDaemonFunc(game)

Runs every turn while a consumable light source is active, to keep track of time left.

extinguish(game)
light(game)
IS_LIT_DESC_KEY = 'is_lit_desc'
already_extinguished_msg = None
already_lit_msg = None
cannot_extinguish_msg = None
cannot_light_expired_msg = None
cannot_light_msg = None
consumable = False
expired_desc = 'It is burnt out. '
expiry_warning = None
extinguish_msg = None
extinguishing_expired_msg = None
is_lit = False
property is_lit_desc

Describe whether the light source is lit, not lit, or burnt out

light_msg = None
lit_desc = 'It is currently lit. '
not_lit_desc = 'It is currently not lit. '
player_can_extinguish = True
player_can_light = True
room_lit_msg = None
turns_left = 20
class intficpy.things.Liquid(game, name, liquid_type)

Bases: intficpy.thing_base.Thing

Can fill a container where holds_liquid is True, can be poured, and can optionally be drunk

Game creators should redefine the pressThing method for the instance to trigger events when the press/push verb is used

drinkLiquid(game)

Replace for custom effects for drinking the Liquid

dumpLiquid()

Defines what happens when the Liquid is dumped out

fillVessel(vessel)

Used for verbs fill from and pour into

getContainer()

Redirect to the Container rather than the Liquid for certain verbs (i.e. take)

mixWith(game, base_liquid, mix_in)

Replace to allow mixing of specific Liquids Return True when a mixture is allowed, False otherwise

can_drink = True
can_fill_from = True
can_pour_out = True
cannot_drink_msg = "You shouldn't drink that. "
cannot_fill_from_msg = None
cannot_pour_out_msg = "You shouldn't dump that out. "
infinite_well = False
is_numberless = True
liquid_for_transfer = None
liquid_type = None
class intficpy.things.Lock(game, is_locked, key_obj, name='lock')

Bases: intficpy.thing_base.Thing

Lock is the class for lock items in the game

makeLocked()
makeUnlocked()
IS_LOCKED_DESC_KEY = 'is_locked_desc'
invItem = False
is_locked = False
property is_locked_desc

Descripe the item’s locked/unlocked state in words

is_locked_desc__false = 'It is currently unlocked. '
is_locked_desc__true = 'It is currently locked. '
key_obj = None
class intficpy.things.Openable(game, name)

Bases: intficpy.thing_base.Thing

An item that can be opened. Inheriting from this class means that instances can be made openable

makeClosed()
makeOpen()
IS_OPEN_DESC_KEY = 'is_open_desc'
property is_locked_desc
property is_open_desc

Describes the objects open/closed state in words

is_open_desc__false = 'It is closed. '
is_open_desc__true = 'It is open. '
class intficpy.things.Pressable(game, name)

Bases: intficpy.thing_base.Thing

Things that do something when pressed Game creators should redefine the pressThing method for the instance to trigger events when the PRESS/PUSH verb is used

pressThing(game)

Game creators should redefine this method for their Pressable instances

class intficpy.things.Readable(game, name, text="There's nothing written here. ")

Bases: intficpy.thing_base.Thing

Readable Things Set the read_desc property to print the same string every time READ [instance as dobj] is used.

Replace default readText method for more complicated behaviour

readText(game)

Called when the Transparent instance is dobj for verb look through Creators should overwrite for more complex behaviour

read_desc = "There's nothing written here. "
class intficpy.things.Surface(game, name)

Bases: intficpy.thing_base.Thing

Class for Things that can have other Things placed on them

can_contain_lying_player = False
can_contain_sitting_player = False
can_contain_standing_player = False
contains_on = True
contains_preposition = 'on'
contains_preposition_inverse = 'off'
desc_reveal = True
class intficpy.things.Transparent(game, name)

Bases: intficpy.thing_base.Thing

Transparent Things Set the look_through_desc property to print the same string every time look through [instance as dobj] is used Replace default lookThrough method for more complicated behaviour

lookThrough(game)

Called when the Transparent instance is dobj for verb look through Creators should overwrite for more complex behaviour

class intficpy.things.UnderSpace(game, name)

Bases: intficpy.thing_base.Thing

Things that can have other Things underneath

moveContentsOut()
revealUnder()
property component_desc

How the item is described when it is a component of another item

UnderSpaces that are a component of another item are only described if they are given an explicit description.

This avoids descriptions like, “There is a dresser. Under the dresser is here.” being produced by default.

contains_preposition = 'under'
contains_preposition_inverse = 'out'
contains_under = True
revealed = False
size = 50
class intficpy.things.Unremarkable(*args, **kwargs)

Bases: intficpy.thing_base.Thing

An item that does not need to be explicitly brought to the Player’s attention most of the time.

property default_desc

By default, do not describe in the room description.

invItem = False