scripts :: objects :: actors :: PlayerCharacter :: Class PlayerCharacter
[hide private]
[frames] | no frames]

Class PlayerCharacter

source code

     object --+                
              |                
base.BaseObject --+            
                  |            
 base.DynamicObject --+        
                      |        
        base.GameObject --+    
                          |    
         object --+       |    
                  |       |    
    base.BaseObject --+   |    
                      |   |    
            base.Living --+    
                          |    
         object --+       |    
                  |       |    
    base.BaseObject --+   |    
                      |   |    
         base.CharStats --+    
                          |    
              CharacterBase --+
                              |
                             PlayerCharacter

PC class

Instance Methods [hide private]
 
__init__(self, ID, agent_layer=None, inventory=None, text="Its you. Who would've thought that?", **kwargs)
Set the basic values that are shared by all game objects.
source code
 
getStateForSaving(self)
Returns state for saving
source code
 
meet(self, npc)
Record that the PC has met a certain NPC
source code
 
met(self, npc)
Indicate whether the PC has met this npc before
source code
 
createBehaviour(self, layer)
Creates the behaviour for this actor.
source code
 
approach(self, location, action=None)
Approaches a location and then perform an action (if set).
source code

Inherited from CharacterBase: getLocation, give, hasItem, itemCount, run, setup, start, teleport, walk

Inherited from CharacterBase (private): _getCoords, _setCoords

Inherited from base.GameObject: __repr__

Inherited from base.DynamicObject: __getstate__, __setstate__, prepareStateForSaving, restoreState

Inherited from base.Living: die

Inherited from base.BaseObject: trueAttr

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from CharacterBase: coords

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, ID, agent_layer=None, inventory=None, text="Its you. Who would've thought that?", **kwargs)
(Constructor)

source code 

Set the basic values that are shared by all game objects.

Parameters:
  • ID - Unique object identifier. Must be present.
  • gfx - Dictionary with graphics for the different contexts @type coords 2-item tuple
  • coords - Initial coordinates of the object.
  • map_id - Identifier of the map where the object is located
  • blocking - Whether the object blocks character movement
  • name - The display name of this object (e.g. 'Dirty crate')
  • text - A longer description of the item
  • desc - A long description of the item that is displayed when it is examined
Overrides: object.__init__
(inherited documentation)

getStateForSaving(self)

source code 

Returns state for saving

Overrides: base.BaseObject.getStateForSaving

meet(self, npc)

source code 

Record that the PC has met a certain NPC

Parameters:
  • npc (str) - The NPC's name or id

met(self, npc)

source code 

Indicate whether the PC has met this npc before

Parameters:
  • npc (str) - The NPC's name or id
Returns:
None

createBehaviour(self, layer)

source code 

Creates the behaviour for this actor.

Returns:
None
Overrides: CharacterBase.createBehaviour

approach(self, location, action=None)

source code 

Approaches a location and then perform an action (if set).

Parameters:
  • loc (fife.Location) - the location to approach
  • action (Action) - The action to schedule for execution after the approach.
Returns:
None