Methods
|
|
|
|
addAliasedCommand
|
addAliasedCommand (
self,
alias,
command,
)
Adds an alias -> command mapping.
arguments:
-
alias
- (string) the alias
-
command
- (string) what the alias expands to
|
|
addAnsiset
|
addAnsiset (
self,
var,
color,
)
Adds a new ansiset var -> color mapping.
arguments:
-
var
- (string) the identifier
-
color
- (string) see
mudlib.constants for colors
|
|
addDefaultAliases
|
addDefaultAliases ( self )
FIXME: Default aliases should probably come from some kind of
configuration file or something so that they can be modified
or added to without having to touch the mudlib. At the very
least, if it's going to be in code, it should be at the
world level, not the mudlib level. |
|
addKnownInteractive
|
addKnownInteractive ( self, knownInteractive )
Adds a name to the list of known interactives this interactive knows.
arguments:
-
knownInteractive
- (mudlib.living.Interactive) the interactive
to add to the list
|
|
addWieldedObject
|
addWieldedObject ( self, wieldableObject )
Wields an object.
Sets up the interactive so that it's not wielding this object.
arguments:
-
wieldableObject
- (mudlib.employable.Wieldable) the object
in question
|
|
addWornObject
|
addWornObject ( self, wearableObject )
Wears an object.
arguments:
-
wearableObject
- (mudlib.employable.wearableObject) the object
being worn
|
|
canWear
|
canWear ( self, wearableObject )
Returns whether or not this object can be worn.
It takes into account what else we're wearing.
arguments:
-
wearableObject
- (mudlib.employable.Wearable) the object
in question
returns:
(int) 1 if we can wear it, 0 if not |
|
canWield
|
canWield ( self, wieldableObject )
Says whether this interactive can wield this object.
This is figured out by first checking to see if we're already
wielding an object using the body part required.
It then checks to see if the bodypart is covered?
arguments:
-
wieldableObject
- (mudlib.employable.Wieldable)
returns:
(int) 1 if they can wield it, 0 if not |
|
createInteractive
|
createInteractive ( self )
|
|
createLiving
|
createLiving ( self )
|
|
destroyInteractive
|
destroyInteractive ( self )
|
|
destroyLiving
|
destroyLiving ( self )
|
|
getActionManager
|
getActionManager ( self )
Returns the action manager.
returns:
(mudlib.living.ActionManager) |
|
getAliasList
|
getAliasList ( self )
Returns all the aliases we have.
returns:
(list of strings) |
|
getAliasedCommand
|
getAliasedCommand ( self, alias )
Returns an aliased command or None.
arguments:
-
alias
- (string) the alias to return (if it exists)
returns:
(string or None) |
|
getAliases
|
getAliases ( self )
Returns the alias -> command mapping.
returns:
(hash) |
|
getAnsimode
|
getAnsimode ( self )
Returns the current ansimode setting.
returns:
(int) 1 if they like ansi, 0 if not |
|
getAnsiset
|
getAnsiset ( self )
Returns the entire ansiset hashmap.
returns:
(hash) the keys are ansi identifiers and the values are the color
to set that text |
|
getAnsisetColor
|
getAnsisetColor ( self, var )
Retrieves an ansiset color from the hash via a var.
returns:
(string) see mudlib.constants for color constants |
|
getAnsisetList
|
getAnsisetList ( self )
Returns a complete list of all the ansiset vars in the hash.
returns:
(list of strings) all the ansiset identifiers we have set |
|
getKnownInteractives
|
getKnownInteractives ( self )
Returns all the names of the interactives that this interactive
knows. returns:
(list of strings)
|
|
getMind
|
getMind ( self )
Returns the mind of this interactive.
returns:
(mudlib.mind.Mind) |
|
getNames
|
getNames ( self )
Returns the list of names belonging to this interactive.
If the interactive is the same as the current player, it
also returns me and myself allowing players to refer
to themselves.
returns:
(list of strings) all the names for this Interactive |
|
getPluralShortDescription
|
getPluralShortDescription ( self )
Returns the plural short description.
returns:
(string) |
|
getShortDescription
|
getShortDescription ( self )
Returns the short description of this interactive.
This is composed of the name of the interactive
plus adjectives. and the race name.
returns:
(string) the short description |
|
getTitle
|
getTitle ( self )
Returns the full title of this interactive.
The title is composed of a series of subtitles plus the
name of the interactive.
returns:
(string) the complete title |
|
getWieldedObjects
|
getWieldedObjects ( self )
Returns the list of wielded objects.
returns:
list of mudlib.employable.Wieldable objects |
|
getWornObjects
|
getWornObjects ( self )
Returns the list of worn objects.
returns:
list of mudlib.employable.Wearable objects |
|
inBriefMode
|
inBriefMode ( self )
Returns whether we're in brief mode or not.
returns:
(int) 1 if we're in brief mode, 0 if not |
|
introducedTo
|
introducedTo ( self, blah )
|
|
knowsInteractive
|
knowsInteractive ( self, potentialKnownInteractive )
Returns whether this interactive knows another interactive.
arguments:
-
potentialKnownInteractive
- (mudlib.living.Interactive)
returns:
(int) 1 if they know them, 0 if not |
|
move
|
move ( self, container )
Handles movement from one container (probably a room) to another
in the mud world for this interactive. arguments:
-
container
- (mudlib.core.Container) probably a room, but the
destination container
|
|
rawwrite
|
rawwrite ( self, message )
Rawwrite is a bit different from write in that we just want to
write a raw unadulterated string to the socket. arguments:
-
message
- (string) the raw message to write to the socket
|
|
removeAliasedCommand
|
removeAliasedCommand ( self, alias )
Removes an alias -> command mapping
arguments:
-
alias
- (string) the alias to remove
|
|
removeAnsiset
|
removeAnsiset ( self, var )
Removes an ansiset var -> color mapping.
arguments:
-
var
- (string) the identifier mapping to remove
|
|
removeKnownInteractive
|
removeKnownInteractive ( self, knownInteractive )
Removes an interactive from the list of known interactives.
arguments:
-
knownInteractive
- (string) the name of the interactive
to remove from the list
|
|
removeSubTitle
|
removeSubTitle ( self, titleIdentifier )
Removes a subtitle from this interactive.
arguments:
-
titleIdentifier
- (string) the identifier to remove
|
|
removeWieldedObject
|
removeWieldedObject ( self, wieldableObject )
Unwields an object.
arguments:
-
wieldableObject
- (mudlib.employable.Wieldable)
|
|
removeWornObject
|
removeWornObject ( self, wearableObject )
Removes a worn object.
arguments:
-
wearableObject
- (mudlib.employable.Wearable)
|
|
setAliases
|
setAliases ( self, aliases )
Initializes the _aliases hash.
This replaces the _aliases hash with a new one.
arguments:
-
aliases
- (hash)
|
|
setAnsimode
|
setAnsimode ( self, yesno )
Sets the ansimode to either 0 or 1.
arguments:
-
yesno
- (int) what to set ansimode to
|
|
setAnsiset
|
setAnsiset ( self, ansiset )
Sets self._ansiset to the ansiset hashmap.
arguments:
-
ansiset
- (hash) of identifier -> color mappings
|
|
setBriefMode
|
setBriefMode ( self, briefModeDesired )
Sets the brief mode (as opposed to verbose).
This affects whether the player sees the long description (verbose)
or just the short description (brief) of a room when they initially
walk in.
arguments:
-
briefModeDesired
- (int) 1 if brief mode, 0 if not (verobse)
|
|
setKnownInteractives
|
setKnownInteractives ( self, knownInteractives )
Sets the known interactives to the given list of interactives.
This isn't additive--it replaces the existing list.
arguments:
-
knownInteractives
- (list of strings) the new list of
names of interactives this interactive knows
|
|
setMind
|
setMind ( self, mind )
Sets the mind for this interactive.
arguments:
-
mind
- (mudlib.mind.Mind) the mind to set
|
|
setSubTitle
|
setSubTitle (
self,
titleIdentifier,
subTitle,
)
Adds a subtitle to this interactive.
Titles apply to specific groupings and that's why
_titles is a hashmap. For example, if you were in the
blacksmith guild, the titleIdentifier would be blacksmith
and the subTitle would be whatever ranking you had in
the blacksmith guild--perhaps Apprentice Blacksmith .
arguments:
-
titleIdentifier
- (string) the key for the title
-
subTitle
- (string) the actual title
|
|
setTitles
|
setTitles ( self, titleMapping )
Allows you to set a series of titles and identifiers
en masse. This is not additive, the new hash replaces the old one.
arguments:
-
titleMapping
- (hash) identifier -> title mapping
|
|
wieldedCharacteristic
|
wieldedCharacteristic ( self )
Returns a string description of what the interactive is
wielding. returns:
(string)
|
|
wornCharacteristic
|
wornCharacteristic ( self )
Returns a string description of what the interactive is
wearing. returns:
(string)
|
|
write
|
write ( self, *message )
Writes a message to this interactive. The message can consist
of one or more strings or VBFCs (which will all be concatenated
together). arguments:
-
*message
- (list of VBFCs and strings)
|