Table of Contents

Class: Wieldable mudlib/employable.py

Wieldable objects are those that can be wielded by an interactive. Wielded objects require that certain body parts be available to wield the object (commonly one or both hands), which must be specified. Interactives may not wield two items that require the same body part. Body parts are defined in the constants module.

Base Classes   
core.Object
Methods   
addRequiredBodyPart
addWieldOnBodyPart
canLeaveEnvironment
cannotUnwield
cannotWield
clearWieldOnBodyParts
createObject
createWieldable
enterEnvironment
getRequiredBodyParts
getWieldOnBodyParts
leaveEnvironment
unwield
unwieldAction
unwieldFrom
wield
wieldAction
wieldOn
  addRequiredBodyPart 
addRequiredBodyPart ( self,  bodyPart )

Sets the list of body parts required by this item to be properly wielded. Each element in the list should be a constant from the constants module. An interactive will not be able wield this item if the required body parts are not available or are in use.

arguments:

bodyPart
(string) the bodypart that is used to wield this wieldable (see mudlib.constants for constants)

  addWieldOnBodyPart 
addWieldOnBodyPart ( self,  bodyPart )

  canLeaveEnvironment 
canLeaveEnvironment ( self,  environment )

Figures out if the player can unwield the item.

see mudlib.core.Object

  cannotUnwield 
cannotUnwield ( self,  interactive )

This method is invoked when an interactive expresses a desire to unwield this item. It should return true if the interactive can unwield it, false otherwise. Note that this method need not worry about standard checks. Any checks in this method should be above and beyond the normal ones.

arguments:

interactive
(mudlib.living.Interactive) the interactive trying to unwield this wieldable

returns:

a failure string (true) if it cannot be unwielded or 0 (false)

  cannotWield 
cannotWield ( self,  interactive )

This method is invoked when an interactive expresses a desire to wield this item. It should return true if the interactive can wield it, false otherwise. Note that this method need not worry about standard checks, such as whether the required body parts are available. Any checks in this method should be above and beyond the normal ones.

arguments:

interactive
(mudlib.living.Interactive) the interactive trying to wield this wieldable.

returns:

a failure string (true) if it cannot be wielded or 0 (false)

  clearWieldOnBodyParts 
clearWieldOnBodyParts ( self )

  createObject 
createObject ( self )

  createWieldable 
createWieldable ( self )

The "constructor" for wieldable objects. You should override this method and include any required initialization, if necessary. You should NOT override __init__ or createObject.

  enterEnvironment 
enterEnvironment ( self,  newEnvironment )

Binds wield and unwield commands to the player.

  getRequiredBodyParts 
getRequiredBodyParts ( self )

Returns a list of body parts required to wield this item. Each body part is a constant from the constants module.

  getWieldOnBodyParts 
getWieldOnBodyParts ( self )

  leaveEnvironment 
leaveEnvironment ( self,  oldEnvironment )

Unbinds wield and unwield commands from the player.

  unwield 
unwield ( self )

This method is invoked when this item is actually unwielded by an interactive. If you want to do any special handling, you should override this method.

  unwieldAction 
unwieldAction (
        self,
        actionString,
        arguments,
        rawinput,
        )

Implements the unwield <wieldable> command.

  unwieldFrom 
unwieldFrom ( self,  interactive )

  wield 
wield ( self )

This method is invoked when this item is actually wielded by an interactive. If you want to do any special handling, you should override this method.

  wieldAction 
wieldAction (
        self,
        actionString,
        arguments,
        rawinput,
        )

Implements the wield <wieldable> command.

  wieldOn 
wieldOn ( self,  interactive )


Table of Contents

This document was automatically generated on Thu Jan 24 08:57:43 2002 by HappyDoc version 2.0