Atrinik Server  4.0
Macros | Functions | Variables
atrinik_object.c File Reference
#include <plugin_python.h>
#include <toolkit/bresenham.h>
#include <artifact.h>
#include <toolkit/packet.h>
#include <faction.h>
#include <player.h>
#include <object.h>

Go to the source code of this file.

Macros

#define SQUARES_AROUND_SKIP(m, x, y)
 

Functions

static PyObject * Atrinik_Object_ActivateRune (Atrinik_Object *self, PyObject *args)
 
static PyObject * Atrinik_Object_TeleportTo (Atrinik_Object *self, PyObject *args, PyObject *keywds)
 
static PyObject * Atrinik_Object_InsertInto (Atrinik_Object *self, PyObject *args)
 
static PyObject * Atrinik_Object_Apply (Atrinik_Object *self, PyObject *args)
 
static PyObject * Atrinik_Object_Take (Atrinik_Object *self, PyObject *what)
 
static PyObject * Atrinik_Object_Drop (Atrinik_Object *self, PyObject *what)
 
static PyObject * Atrinik_Object_Say (Atrinik_Object *self, PyObject *args)
 
static PyObject * Atrinik_Object_GetGender (Atrinik_Object *self)
 
static PyObject * Atrinik_Object_SetGender (Atrinik_Object *self, PyObject *args)
 
static PyObject * Atrinik_Object_Update (Atrinik_Object *self)
 
static PyObject * Atrinik_Object_Hit (Atrinik_Object *self, PyObject *args)
 
static PyObject * Atrinik_Object_Cast (Atrinik_Object *self, PyObject *args, PyObject *keywds)
 
static PyObject * Atrinik_Object_CreateForce (Atrinik_Object *self, PyObject *args, PyObject *keywds)
 
static PyObject * Atrinik_Object_CreateObject (Atrinik_Object *self, PyObject *args, PyObject *keywds)
 
static PyObject * common_Atrinik_Object_FindObject (Atrinik_Object *self, PyObject *args, PyObject *keywds, bool multiple)
 
static PyObject * Atrinik_Object_FindObject (Atrinik_Object *self, PyObject *args, PyObject *keywds)
 
static PyObject * Atrinik_Object_FindObjects (Atrinik_Object *self, PyObject *args, PyObject *keywds)
 
static PyObject * Atrinik_Object_Remove (Atrinik_Object *self)
 
static PyObject * Atrinik_Object_Destroy (Atrinik_Object *self)
 
static PyObject * Atrinik_Object_SetPosition (Atrinik_Object *self, PyObject *args)
 
static PyObject * Atrinik_Object_CastIdentify (Atrinik_Object *self, PyObject *args)
 
static PyObject * Atrinik_Object_Save (Atrinik_Object *self)
 
static PyObject * Atrinik_Object_GetCost (Atrinik_Object *self, PyObject *args)
 
static PyObject * Atrinik_Object_GetMoney (Atrinik_Object *self)
 
static PyObject * Atrinik_Object_PayAmount (Atrinik_Object *self, PyObject *args)
 
static PyObject * Atrinik_Object_Clone (Atrinik_Object *self, PyObject *args)
 
static PyObject * Atrinik_Object_ReadKey (Atrinik_Object *self, PyObject *args)
 
static PyObject * Atrinik_Object_WriteKey (Atrinik_Object *self, PyObject *args)
 
static PyObject * Atrinik_Object_GetName (Atrinik_Object *self, PyObject *args)
 
static PyObject * Atrinik_Object_Controller (Atrinik_Object *self)
 
static PyObject * Atrinik_Object_Protection (Atrinik_Object *self, PyObject *args)
 
static PyObject * Atrinik_Object_SetProtection (Atrinik_Object *self, PyObject *args)
 
static PyObject * Atrinik_Object_Attack (Atrinik_Object *self, PyObject *args)
 
static PyObject * Atrinik_Object_SetAttack (Atrinik_Object *self, PyObject *args)
 
static PyObject * Atrinik_Object_Decrease (Atrinik_Object *self, PyObject *args)
 
static PyObject * Atrinik_Object_SquaresAround (Atrinik_Object *self, PyObject *args, PyObject *keywds)
 
static PyObject * Atrinik_Object_GetRangeVector (Atrinik_Object *self, PyObject *args)
 
static PyObject * Atrinik_Object_CreateTreasure (Atrinik_Object *self, PyObject *args, PyObject *keywds)
 
static PyObject * Atrinik_Object_Move (Atrinik_Object *self, PyObject *args)
 
static PyObject * Atrinik_Object_ConnectionTrigger (Atrinik_Object *self, PyObject *args, PyObject *keywds)
 
static PyObject * Atrinik_Object_Artificate (Atrinik_Object *self, PyObject *args)
 
static PyObject * Atrinik_Object_Load (Atrinik_Object *self, PyObject *args)
 
static PyObject * Atrinik_Object_GetPacket (Atrinik_Object *self, PyObject *args)
 
static PyObject * Atrinik_Object_FactionIsFriend (Atrinik_Object *self, PyObject *args)
 
static PyObject * Object_GetAttribute (Atrinik_Object *obj, void *context)
 
static int Object_SetAttribute (Atrinik_Object *obj, PyObject *value, void *context)
 
static PyObject * Object_GetFlag (Atrinik_Object *obj, void *context)
 
static int Object_SetFlag (Atrinik_Object *obj, PyObject *val, void *context)
 
static PyObject * Atrinik_Object_new (PyTypeObject *type, PyObject *args, PyObject *kwds)
 
static void Atrinik_Object_dealloc (PyObject *self)
 
static PyObject * Atrinik_Object_str (Atrinik_Object *self)
 
static int Atrinik_Object_InternalCompare (Atrinik_Object *left, Atrinik_Object *right)
 
static PyObject * Atrinik_Object_RichCompare (Atrinik_Object *left, Atrinik_Object *right, int op)
 
static int atrinik_object_bool (Atrinik_Object *obj)
 
static void Atrinik_ObjectIterator_dealloc (PyObject *self)
 
static PyObject * Atrinik_ObjectIterator_str (Atrinik_ObjectIterator *self)
 
static PyObject * Atrinik_ObjectIterator_iter (PyObject *self)
 
static int Atrinik_ObjectIterator_bool (Atrinik_ObjectIterator *self)
 
static Py_ssize_t Atrinik_ObjectIterator_len (Atrinik_ObjectIterator *self)
 
static PyObject * Atrinik_ObjectIterator_getitem (Atrinik_ObjectIterator *self, Py_ssize_t idx)
 
static int Atrinik_ObjectIterator_contains (Atrinik_ObjectIterator *self, PyObject *what)
 
static PyObject * Atrinik_ObjectIterator_iternext (PyObject *self)
 
int Atrinik_Object_init (PyObject *module)
 
PyObject * wrap_object (object *what)
 
PyObject * wrap_object_iterator (object *what)
 

Variables

static fields_struct fields []
 
static char * doc_object_flag_names [NUM_FLAGS+1]
 
static const char doc_Atrinik_Object_ActivateRune []
 
static const char doc_Atrinik_Object_TeleportTo []
 
static const char doc_Atrinik_Object_InsertInto []
 
static const char doc_Atrinik_Object_Apply []
 
static const char doc_Atrinik_Object_Take []
 
static const char doc_Atrinik_Object_Drop []
 
static const char doc_Atrinik_Object_Say []
 
static const char doc_Atrinik_Object_GetGender []
 
static const char doc_Atrinik_Object_SetGender []
 
static const char doc_Atrinik_Object_Update []
 
static const char doc_Atrinik_Object_Hit []
 
static const char doc_Atrinik_Object_Cast []
 
static const char doc_Atrinik_Object_CreateForce []
 
static const char doc_Atrinik_Object_CreateObject []
 
static const char doc_Atrinik_Object_FindObject []
 
static const char doc_Atrinik_Object_FindObjects []
 
static const char doc_Atrinik_Object_Remove []
 
static const char doc_Atrinik_Object_Destroy []
 
static const char doc_Atrinik_Object_SetPosition []
 
static const char doc_Atrinik_Object_CastIdentify []
 
static const char doc_Atrinik_Object_Save []
 
static const char doc_Atrinik_Object_GetCost []
 
static const char doc_Atrinik_Object_GetMoney []
 
static const char doc_Atrinik_Object_PayAmount []
 
static const char doc_Atrinik_Object_Clone []
 
static const char doc_Atrinik_Object_ReadKey []
 
static const char doc_Atrinik_Object_WriteKey []
 
static const char doc_Atrinik_Object_GetName []
 
static const char doc_Atrinik_Object_Controller []
 
static const char doc_Atrinik_Object_Protection []
 
static const char doc_Atrinik_Object_SetProtection []
 
static const char doc_Atrinik_Object_Attack []
 
static const char doc_Atrinik_Object_SetAttack []
 
static const char doc_Atrinik_Object_Decrease []
 
static const char doc_Atrinik_Object_SquaresAround []
 
static const char doc_Atrinik_Object_GetRangeVector []
 
static const char doc_Atrinik_Object_CreateTreasure []
 
static const char doc_Atrinik_Object_Move []
 
static const char doc_Atrinik_Object_ConnectionTrigger []
 
static const char doc_Atrinik_Object_Artificate []
 
static const char doc_Atrinik_Object_Load []
 
static const char doc_Atrinik_Object_GetPacket []
 
static const char doc_Atrinik_Object_FactionIsFriend []
 
static PyMethodDef methods []
 
static PyGetSetDef getseters [NUM_FIELDS+NUM_FLAGS+1]
 
static PyNumberMethods AtrinikObjectNumber
 
PyTypeObject Atrinik_ObjectType
 
static PyNumberMethods Atrinik_ObjectIteratorNumber
 
static PySequenceMethods Atrinik_ObjectIteratorSequence
 
PyTypeObject Atrinik_ObjectIteratorType
 

Detailed Description

Atrinik Python plugin object related code.

Author
Alex Tokar
Yann Chachkoff

Definition in file atrinik_object.c.

Macro Definition Documentation

#define SQUARES_AROUND_SKIP (   m,
  x,
 
)
Value:
((type & AROUND_BLOCKSVIEW && GET_MAP_FLAGS(m, x, y) & P_BLOCKSVIEW) || \
(type & AROUND_PLAYER_ONLY && GET_MAP_FLAGS(m, x, y) & P_PLAYER_ONLY) || \
(type & AROUND_WALL && hooks->wall(m, x, y)) || (callable != NULL && \
python_call_int(callable, Py_BuildValue("(OiiO)", wrap_map(m), x, y, \
wrap_object(self->obj)))))
struct plugin_hooklist * hooks
Definition: plugin_arena.c:160
uint8_t type
One of operation types.
Definition: sound_ambient.c:45
PyObject * wrap_object(object *what)
int python_call_int(PyObject *callable, PyObject *arglist)
#define P_BLOCKSVIEW
Definition: map.h:250
PyObject * wrap_map(mapstruct *what)
Definition: atrinik_map.c:1139
#define AROUND_BLOCKSVIEW
#define P_PLAYER_ONLY
Definition: map.h:267
#define AROUND_WALL
#define AROUND_PLAYER_ONLY

Function Documentation

static PyObject* Atrinik_Object_ActivateRune ( Atrinik_Object self,
PyObject *  args 
)
static

Implements Atrinik.Object.Object.ActivateRune() Python method.

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.

Definition at line 448 of file atrinik_object.c.

static PyObject* Atrinik_Object_Apply ( Atrinik_Object self,
PyObject *  args 
)
static

Implements Atrinik.Object.Object.Apply() Python method.

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.

Definition at line 571 of file atrinik_object.c.

static PyObject* Atrinik_Object_Artificate ( Atrinik_Object self,
PyObject *  args 
)
static

Implements Atrinik.Object.Object.Artificate() Python method.

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.

Definition at line 2106 of file atrinik_object.c.

static PyObject* Atrinik_Object_Attack ( Atrinik_Object self,
PyObject *  args 
)
static

Implements Atrinik.Object.Object.Attack() Python method.

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.

Definition at line 1655 of file atrinik_object.c.

static int atrinik_object_bool ( Atrinik_Object obj)
static

Atrinik object bool check.

Parameters
objThe object.

Definition at line 2626 of file atrinik_object.c.

static PyObject* Atrinik_Object_Cast ( Atrinik_Object self,
PyObject *  args,
PyObject *  keywds 
)
static

Implements Atrinik.Object.Object.Cast() Python method.

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.
keywdsKeyword arguments.

Definition at line 830 of file atrinik_object.c.

static PyObject* Atrinik_Object_CastIdentify ( Atrinik_Object self,
PyObject *  args 
)
static

Implements Atrinik.Object.Object.CastIdentify() Python method.

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.

Definition at line 1276 of file atrinik_object.c.

static PyObject* Atrinik_Object_Clone ( Atrinik_Object self,
PyObject *  args 
)
static

Implements Atrinik.Object.Object.Clone() Python method.

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.

Definition at line 1426 of file atrinik_object.c.

static PyObject* Atrinik_Object_ConnectionTrigger ( Atrinik_Object self,
PyObject *  args,
PyObject *  keywds 
)
static

Implements Atrinik.Object.Object.ConnectionTrigger() Python method.

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.
keywdsKeyword arguments.

Definition at line 2067 of file atrinik_object.c.

static PyObject* Atrinik_Object_Controller ( Atrinik_Object self)
static

Implements Atrinik.Object.Object.Controller() Python method.

Parameters
selfSelf object for methods; module object for module functions.

Definition at line 1557 of file atrinik_object.c.

static PyObject* Atrinik_Object_CreateForce ( Atrinik_Object self,
PyObject *  args,
PyObject *  keywds 
)
static

Implements Atrinik.Object.Object.CreateForce() Python method.

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.
keywdsKeyword arguments.

Definition at line 889 of file atrinik_object.c.

static PyObject* Atrinik_Object_CreateObject ( Atrinik_Object self,
PyObject *  args,
PyObject *  keywds 
)
static

Implements Atrinik.Object.Object.CreateObject() Python method.

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.
keywdsKeyword arguments.

Definition at line 955 of file atrinik_object.c.

static PyObject* Atrinik_Object_CreateTreasure ( Atrinik_Object self,
PyObject *  args,
PyObject *  keywds 
)
static

Implements Atrinik.Object.Object.CreateTreasure() Python method.

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.
keywdsKeyword arguments.

Definition at line 1963 of file atrinik_object.c.

static void Atrinik_Object_dealloc ( PyObject *  self)
static

Free an object wrapper.

Parameters
selfThe wrapper to free.

Definition at line 2568 of file atrinik_object.c.

static PyObject* Atrinik_Object_Decrease ( Atrinik_Object self,
PyObject *  args 
)
static

Implements Atrinik.Object.Object.Decrease() Python method.

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.

Definition at line 1724 of file atrinik_object.c.

static PyObject* Atrinik_Object_Destroy ( Atrinik_Object self)
static

Implements Atrinik.Object.Object.Destroy() Python method.

Parameters
selfSelf object for methods; module object for module functions.

Definition at line 1213 of file atrinik_object.c.

static PyObject* Atrinik_Object_Drop ( Atrinik_Object self,
PyObject *  what 
)
static

Implements Atrinik.Object.Object.Drop() Python method.

Parameters
selfSelf object for methods; module object for module functions.
whatThe object.

Definition at line 629 of file atrinik_object.c.

static PyObject* Atrinik_Object_FactionIsFriend ( Atrinik_Object self,
PyObject *  args 
)
static

Implements Atrinik.Object.Object.FactionIsFriend() Python method.

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.

Definition at line 2231 of file atrinik_object.c.

static PyObject* Atrinik_Object_FindObject ( Atrinik_Object self,
PyObject *  args,
PyObject *  keywds 
)
static

Implements Atrinik.Object.Object.FindObject() Python method.

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.
keywdsKeyword arguments.

Definition at line 1137 of file atrinik_object.c.

static PyObject* Atrinik_Object_FindObjects ( Atrinik_Object self,
PyObject *  args,
PyObject *  keywds 
)
static

Implements Atrinik.Object.Object.FindObjects() Python method.

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.
keywdsKeyword arguments.

Definition at line 1169 of file atrinik_object.c.

static PyObject* Atrinik_Object_GetCost ( Atrinik_Object self,
PyObject *  args 
)
static

Implements Atrinik.Object.Object.GetCost() Python method.

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.

Definition at line 1353 of file atrinik_object.c.

static PyObject* Atrinik_Object_GetGender ( Atrinik_Object self)
static

Implements Atrinik.Object.Object.GetGender() Python method.

Parameters
selfSelf object for methods; module object for module functions.

Definition at line 692 of file atrinik_object.c.

static PyObject* Atrinik_Object_GetMoney ( Atrinik_Object self)
static

Implements Atrinik.Object.Object.GetMoney() Python method.

Parameters
selfSelf object for methods; module object for module functions.

Definition at line 1378 of file atrinik_object.c.

static PyObject* Atrinik_Object_GetName ( Atrinik_Object self,
PyObject *  args 
)
static

Implements Atrinik.Object.Object.GetName() Python method.

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.

Definition at line 1524 of file atrinik_object.c.

static PyObject* Atrinik_Object_GetPacket ( Atrinik_Object self,
PyObject *  args 
)
static

Implements Atrinik.Object.Object.GetPacket() Python method.

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.

Definition at line 2187 of file atrinik_object.c.

static PyObject* Atrinik_Object_GetRangeVector ( Atrinik_Object self,
PyObject *  args 
)
static

Implements Atrinik.Object.Object.GetRangeVector() Python method.

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.

Definition at line 1909 of file atrinik_object.c.

static PyObject* Atrinik_Object_Hit ( Atrinik_Object self,
PyObject *  args 
)
static

Implements Atrinik.Object.Object.Hit() Python method.

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.

Definition at line 778 of file atrinik_object.c.

int Atrinik_Object_init ( PyObject *  module)

Initialize the Atrinik.Object module.

Parameters
moduleThe Atrinik.Object module.
Returns
1 on success, 0 on failure.

Definition at line 3034 of file atrinik_object.c.

static PyObject* Atrinik_Object_InsertInto ( Atrinik_Object self,
PyObject *  args 
)
static

Implements Atrinik.Object.Object.InsertInto() Python method.

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.

Definition at line 529 of file atrinik_object.c.

static PyObject* Atrinik_Object_Load ( Atrinik_Object self,
PyObject *  args 
)
static

Implements Atrinik.Object.Object.Load() Python method.

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.

Definition at line 2157 of file atrinik_object.c.

static PyObject* Atrinik_Object_Move ( Atrinik_Object self,
PyObject *  args 
)
static

Implements Atrinik.Object.Object.Move() Python method.

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.

Definition at line 2036 of file atrinik_object.c.

static PyObject* Atrinik_Object_new ( PyTypeObject *  type,
PyObject *  args,
PyObject *  kwds 
)
static

Create a new object wrapper.

Parameters
typeType object.
argsUnused.
kwdsUnused.
Returns
The new wrapper.

Definition at line 2550 of file atrinik_object.c.

static PyObject* Atrinik_Object_PayAmount ( Atrinik_Object self,
PyObject *  args 
)
static

Implements Atrinik.Object.Object.PayAmount() Python method.

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.

Definition at line 1398 of file atrinik_object.c.

static PyObject* Atrinik_Object_Protection ( Atrinik_Object self,
PyObject *  args 
)
static

Implements Atrinik.Object.Object.Protection() Python method.

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.

Definition at line 1583 of file atrinik_object.c.

static PyObject* Atrinik_Object_ReadKey ( Atrinik_Object self,
PyObject *  args 
)
static

Implements Atrinik.Object.Object.ReadKey() Python method.

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.

Definition at line 1465 of file atrinik_object.c.

static PyObject* Atrinik_Object_Remove ( Atrinik_Object self)
static

Implements Atrinik.Object.Object.Remove() Python method.

Parameters
selfSelf object for methods; module object for module functions.

Definition at line 1190 of file atrinik_object.c.

static PyObject* Atrinik_Object_Save ( Atrinik_Object self)
static

Implements Atrinik.Object.Object.Save() Python method.

Parameters
selfSelf object for methods; module object for module functions.

Definition at line 1327 of file atrinik_object.c.

static PyObject* Atrinik_Object_Say ( Atrinik_Object self,
PyObject *  args 
)
static

Implements Atrinik.Object.Object.Say() Python method.

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.

Definition at line 659 of file atrinik_object.c.

static PyObject* Atrinik_Object_SetAttack ( Atrinik_Object self,
PyObject *  args 
)
static

Implements Atrinik.Object.Object.SetAttack() Python method.

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.

Definition at line 1689 of file atrinik_object.c.

static PyObject* Atrinik_Object_SetGender ( Atrinik_Object self,
PyObject *  args 
)
static

Implements Atrinik.Object.Object.SetGender() Python method.

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.

Definition at line 711 of file atrinik_object.c.

static PyObject* Atrinik_Object_SetPosition ( Atrinik_Object self,
PyObject *  args 
)
static

Implements Atrinik.Object.Object.SetPosition() Python method.

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.

Definition at line 1242 of file atrinik_object.c.

static PyObject* Atrinik_Object_SetProtection ( Atrinik_Object self,
PyObject *  args 
)
static

Implements Atrinik.Object.Object.SetProtection() Python method.

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.

Definition at line 1617 of file atrinik_object.c.

static PyObject* Atrinik_Object_SquaresAround ( Atrinik_Object self,
PyObject *  args,
PyObject *  keywds 
)
static

Implements Atrinik.Object.Object.SquaresAround() Python method.

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.
keywdsKeyword arguments.

Definition at line 1784 of file atrinik_object.c.

static PyObject* Atrinik_Object_str ( Atrinik_Object self)
static

Return a string representation of an object.

Parameters
selfThe object type.
Returns
Python object containing the arch name and name of the object.

Definition at line 2586 of file atrinik_object.c.

static PyObject* Atrinik_Object_Take ( Atrinik_Object self,
PyObject *  what 
)
static

Implements Atrinik.Object.Object.Take() Python method.

Parameters
selfSelf object for methods; module object for module functions.
whatThe object.

Definition at line 598 of file atrinik_object.c.

static PyObject* Atrinik_Object_TeleportTo ( Atrinik_Object self,
PyObject *  args,
PyObject *  keywds 
)
static

Implements Atrinik.Object.Object.TeleportTo() Python method.

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.
keywdsKeyword arguments.

Definition at line 486 of file atrinik_object.c.

static PyObject* Atrinik_Object_Update ( Atrinik_Object self)
static

Implements Atrinik.Object.Object.Update() Python method.

Parameters
selfSelf object for methods; module object for module functions.

Definition at line 752 of file atrinik_object.c.

static PyObject* Atrinik_Object_WriteKey ( Atrinik_Object self,
PyObject *  args 
)
static

Implements Atrinik.Object.Object.WriteKey() Python method.

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.

Definition at line 1496 of file atrinik_object.c.

static int Atrinik_ObjectIterator_bool ( Atrinik_ObjectIterator self)
static

Implements Atrinik.Object.ObjectIterator.__bool__() Python method.

Parameters
selfThe iterator object.
Returns
Whether there are objects in the iterator.

Definition at line 2787 of file atrinik_object.c.

static int Atrinik_ObjectIterator_contains ( Atrinik_ObjectIterator self,
PyObject *  what 
)
static

Implements Atrinik.Object.ObjectIterator.__contains__() Python method.

Parameters
selfThe iterator object.
whatObject to check.
Returns
1 if the specified obj is inside the iterated inventory, 0 otherwise.

Definition at line 2853 of file atrinik_object.c.

static void Atrinik_ObjectIterator_dealloc ( PyObject *  self)
static

Free an object iterator wrapper.

Parameters
selfThe wrapper to free.

Definition at line 2743 of file atrinik_object.c.

static PyObject* Atrinik_ObjectIterator_getitem ( Atrinik_ObjectIterator self,
Py_ssize_t  idx 
)
static

Implements Atrinik.Object.ObjectIterator.__getitem__() Python method.

Parameters
selfThe iterator object.
idxIndex to access.
Returns
Object at the specified index, NULL on failure.

Definition at line 2824 of file atrinik_object.c.

static PyObject* Atrinik_ObjectIterator_iter ( PyObject *  self)
static

Implements Atrinik.Object.ObjectIterator.__iter__() Python method.

Parameters
selfThe iterator object.
Returns
self.

Definition at line 2774 of file atrinik_object.c.

static PyObject* Atrinik_ObjectIterator_iternext ( PyObject *  self)
static

Implements Atrinik.Object.ObjectIterator.next() Python method.

Parameters
selfThe iterator object.
Returns
Next object, NULL if there is nothing left.

Definition at line 2886 of file atrinik_object.c.

static Py_ssize_t Atrinik_ObjectIterator_len ( Atrinik_ObjectIterator self)
static

Implements Atrinik.Object.ObjectIterator.__len__() Python method.

Parameters
selfThe iterator object.
Returns
Number of items in the iterator.

Definition at line 2799 of file atrinik_object.c.

static PyObject* Atrinik_ObjectIterator_str ( Atrinik_ObjectIterator self)
static

Return a string representation of an object iterator.

Parameters
selfThe object iterator.
Returns
Python object containing some data about the iterator.

Definition at line 2759 of file atrinik_object.c.

static PyObject* common_Atrinik_Object_FindObject ( Atrinik_Object self,
PyObject *  args,
PyObject *  keywds,
bool  multiple 
)
static

Common implementation for both Atrinik_Object_FindObject() and Atrinik_Object_FindObjects().

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.
keywdsKeyword arguments.
multipleIf true, will always return a list object.

Definition at line 1043 of file atrinik_object.c.

static PyObject* Object_GetAttribute ( Atrinik_Object obj,
void *  context 
)
static

Get object's attribute.

Parameters
objPython object wrapper.
contextVoid pointer to the field.
Returns
Python object with the attribute value, NULL on failure.

Definition at line 2357 of file atrinik_object.c.

static PyObject* Object_GetFlag ( Atrinik_Object obj,
void *  context 
)
static

Get object's flag.

Parameters
objPython object wrapper.
contextVoid pointer to the flag ID.
Return values
Py_TrueThe object has the flag set.
Py_FalseThe object doesn't have the flag set.
NULLAn error occurred.

Definition at line 2487 of file atrinik_object.c.

static int Object_SetAttribute ( Atrinik_Object obj,
PyObject *  value,
void *  context 
)
static

Set attribute of an object.

Parameters
objPython object wrapper.
valueValue to set.
contextVoid pointer to the field.
Returns
0 on success, -1 on failure.

Definition at line 2380 of file atrinik_object.c.

static int Object_SetFlag ( Atrinik_Object obj,
PyObject *  val,
void *  context 
)
static

Set flag for an object.

Parameters
objPython object wrapper.
valValue to set. Should be either Py_True or Py_False.
contextVoid pointer to the flag ID.
Returns
0 on success, -1 on failure.

Definition at line 2513 of file atrinik_object.c.

PyObject* wrap_object ( object what)

Utility method to wrap an object.

Parameters
whatObject to wrap.
Returns
Python object wrapping the real object.

Definition at line 3095 of file atrinik_object.c.

PyObject* wrap_object_iterator ( object what)

Utility method to wrap an object inside an object iterator.

Parameters
whatObject to wrap.
Returns
Atrinik.Object.ObjectIterator instance wrapping the object.

Definition at line 3119 of file atrinik_object.c.

Variable Documentation

PyNumberMethods Atrinik_ObjectIteratorNumber
static

The number protocol for Atrinik object iterator.

Definition at line 2926 of file atrinik_object.c.

PySequenceMethods Atrinik_ObjectIteratorSequence
static
Initial value:
= {
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
}
static Py_ssize_t Atrinik_ObjectIterator_len(Atrinik_ObjectIterator *self)
static PyObject * Atrinik_ObjectIterator_getitem(Atrinik_ObjectIterator *self, Py_ssize_t idx)
static int Atrinik_ObjectIterator_contains(Atrinik_ObjectIterator *self, PyObject *what)

The sequence protocol for Atrinik object iterator.

Definition at line 2979 of file atrinik_object.c.

PyTypeObject Atrinik_ObjectIteratorType

The Atrinik.ObjectIterator type.

Definition at line 2995 of file atrinik_object.c.

PyTypeObject Atrinik_ObjectType

Our actual Python ObjectType.

Definition at line 2695 of file atrinik_object.c.

PyNumberMethods AtrinikObjectNumber
static

The number protocol for Atrinik objects.

Definition at line 2642 of file atrinik_object.c.

const char doc_Atrinik_Object_ActivateRune[]
static
Initial value:
=
".. method:: ActivateRune(who).\n\n"
"Activate a rune.\n\n"
":param who: Who should be affected by the effects of the rune.\n"
":type who: :class:`Atrinik.Object.Object`\n"
":raises TypeError: If self is not of type :attr:`Atrinik.Type.RUNE`"

Documentation for Atrinik_Object_ActivateRune().

Definition at line 437 of file atrinik_object.c.

const char doc_Atrinik_Object_Apply[]
static
Initial value:
=
".. method:: Apply(what, flags=Atrinik.APPLY_NORMAL).\n\n"
"Makes the object apply the specified object.\n\n"
":param what: What object to apply.\n"
":type what: :class:`Atrinik.Object.Object`\n"
":param flags: Reasonable combination of :attr:`~Atrinik.APPLY_NORMAL`, "
":attr:`~Atrinik.APPLY_ALWAYS`, :attr:`~Atrinik.APPLY_ALWAYS_UNAPPLY`, "
":attr:`~Atrinik.APPLY_NO_MERGE`, :attr:`~Atrinik.APPLY_IGNORE_CURSE`, "
":attr:`~Atrinik.APPLY_NO_EVENT`.\n"
":type flags: int\n"
":returns: One of OBJECT_METHOD_xxx, eg, :attr:`~Atrinik.OBJECT_METHOD_OK`.\n"
":rtype: int"

Documentation for Atrinik_Object_Apply().

Definition at line 554 of file atrinik_object.c.

const char doc_Atrinik_Object_Artificate[]
static
Initial value:
=
".. method:: Artificate(name).\n\n"
"Copies artifact abilities to the specified object.\n\n"
":param name: Name of the artifact to copy abilities from.\n"
":type name: str\n"
":raises Atrinik.AtrinikError: If the object already has artifact "
"abilities.\n"
":raises Atrinik.AtrinikError: If the object's type doesn't match "
"any artifact list.\n"
":raises Atrinik.AtrinikError: If the artifact name is invalid."

Documentation for Atrinik_Object_Artificate().

Definition at line 2091 of file atrinik_object.c.

const char doc_Atrinik_Object_Attack[]
static
Initial value:
=
".. method:: Attack(attack).\n\n"
"Get object's attack value for the given attack ID.\n\n"
":param attack: One of the ATNR_xxx constants, eg, "
":attr:`~Atrinik.ATNR_SLASH`.\n"
":type attack: int\n"
":returns: The attack value.\n"
":rtype: int\n"
":raises IndexError: If the attack ID is invalid."

Documentation for Atrinik_Object_Attack().

Definition at line 1641 of file atrinik_object.c.

const char doc_Atrinik_Object_Cast[]
static
Initial value:
=
".. method:: Cast(spell, target=None, mode=-1, direction=0, option=None).\n\n"
"Cast the specified spell.\n\n"
":param spell: ID of the spell to cast.\n"
":type spell: int\n"
":param target: Target object for spells that require a valid target.\n"
":type target: :class:`Atrinik.Object.Object` or None\n"
":param mode: One of the CAST_xxx constants defined in :mod:`Atrinik`, eg, "
":attr:`~Atrinik.CAST_NORMAL`. If -1, will try to figure out the appropriate "
"mode automatically.\n"
":type mode: int\n"
":param direction: The direction to cast the spell in.\n"
":type direction: int\n"
":param option: Additional string option, required by some spells (create food "
"for example).\n"
":type option: str or None"

Documentation for Atrinik_Object_Cast().

Definition at line 809 of file atrinik_object.c.

const char doc_Atrinik_Object_CastIdentify[]
static
Initial value:
=
".. method:: CastIdentify(target, mode, marked=None).\n\n"
"Cast identify on target.\n\n"
":param target: The target object.\n"
":type target: :class:`Atrinik.Object.Object`\n"
":param mode: One of IDENTIFY_xxx, eg, :attr:`~Atrinik.IDENTIFY_NORMAL`.\n"
":type mode: int\n"
":param marked: Marked item.\n"
":type marked: :class:`Atrinik.Object.Object` or None\n"
":raises Atrinik.AtrinikError: If *mode* is :attr:`~Atrinik.IDENTIFY_MARKED` "
"but *marked* is None."

Documentation for Atrinik_Object_CastIdentify().

Definition at line 1260 of file atrinik_object.c.

const char doc_Atrinik_Object_Clone[]
static
Initial value:
=
".. method:: Clone(inventory=True).\n\n"
"Clone an object.\nGenerally, you should do something with the clone.\n\n"
":meth:`~Atrinik.Object.Object.TeleportTo` or "
":meth:`~Atrinik.Object.Object.InsertInto` are useful methods for that.\n\n"
":param inventory: Whether to clone the inventory of the object.\n"
":type inventory: bool\n"
":returns: Cloned object.\n"
":rtype: :class:`Atrinik.Object.Object`"

Documentation for Atrinik_Object_Clone().

Definition at line 1412 of file atrinik_object.c.

const char doc_Atrinik_Object_ConnectionTrigger[]
static
Initial value:
=
".. method:: ConnectionTrigger(push=True, button=False).\n\n"
"Triggers the object's connection, if any.\n\n"
":param push: If true, send a 'push' signal; 'release' signal otherwise.\n"
":type push: bool\n"
":param button: If true, handle the connection like a button.\n"
":type button: bool"

Documentation for Atrinik_Object_ConnectionTrigger().

Definition at line 2055 of file atrinik_object.c.

const char doc_Atrinik_Object_Controller[]
static
Initial value:
=
".. method:: Controller().\n\n"
"Get object's controller (the player).\n\n"
":returns: The controller if there is one, None otherwise.\n"
":rtype: :class:`Atrinik.Player.Player` or None\n"
":raises Atrinik.AtrinikError: If the object is not a player."

Documentation for Atrinik_Object_Controller().

Definition at line 1546 of file atrinik_object.c.

const char doc_Atrinik_Object_CreateForce[]
static
Initial value:
=
".. method:: CreateForce(name, seconds=0.0, expiration=0).\n\n"
"Create a force object in object's inventory.\n\n"
":param name: ID of the force object.\n"
":type name: str\n"
":param seconds: If non-zero, the force will be removed after the specified "
"amount of seconds have passed.\n"
":type seconds: float\n"
":param expiration: If non-zero, the force will be removed after *expiration* / "
"0.02 ticks.\n"
":type time: int\n"
":returns: The created force object.\n"
":rtype: :class:`Atrinik.Object.Object`"

Documentation for Atrinik_Object_CreateForce().

Definition at line 871 of file atrinik_object.c.

const char doc_Atrinik_Object_CreateObject[]
static
Initial value:
=
".. method:: CreateObject(archname, nrof=1, value=-1, identified=True).\n\n"
"Creates a new object from archname and inserts it into the object.\n\n"
":param archname: Name of the arch to create.\n"
":type archname: str\n"
":param nrof: Number of objects to create.\n"
":type nrof: int\n"
":param value: If not -1, will be used as value for the new object.\n"
":type value: int\n"
":param identified: If False, the object will not be identified.\n"
":type identified: bool\n"
":returns: The created (and inserted) object, None on failure.\n"
":rtype: :class:`Atrinik.Object.Object` or None\n"
":raises Atrinik.AtrinikError: If archname references an invalid "
"archetype."

Documentation for Atrinik_Object_CreateObject().

Definition at line 935 of file atrinik_object.c.

const char doc_Atrinik_Object_CreateTreasure[]
static
Initial value:
=
".. method:: CreateTreasure(treasure=None, level=0, flags=0, "
"a_chance=Atrinik.TREASURE_ARTIFACT_CHANCE).\n\n"
"Create treasure inside (or below, if :attr:`~Atrinik.GT_ENVIRONMENT` flag was "
"set) the object.\n\n"
":param treasure: Treasure list name to generate. If None, will try to "
"generate treasure based on the object's randomitems.\n"
":type treasure: str or None\n"
":param level: Level of the generated items. If 0, will try to guess the level "
"to use based on the object's level or the difficulty value of the map the "
"object is on. If neither is applicable, will use :attr:`~Atrinik.MAXLEVEL`.\n"
":type level: int\n"
":param flags: One or a combination of GT_xxx, eg, :attr:"
"`~Atrinik.GT_ENVIRONMENT`\n"
":type flags: int\n"
":param a_chance: Chance for the treasure to become artifact, if possible. A "
"value of 0 will disable any chance for artifacts.\n"
":type a_chance: int\n"
":raises ValueError: If treasure is not valid."

Documentation for Atrinik_Object_CreateTreasure().

Definition at line 1939 of file atrinik_object.c.

const char doc_Atrinik_Object_Decrease[]
static
Initial value:
=
".. method:: Decrease(num=1).\n\n"
"Decreases an object, removing it if there's nothing left to decrease.\n\n"
":param num: How much to decrease the object by.\n"
":type num: int\n"
":returns: The object if something is left, None otherwise.\n"
":rtype: :class:`Atrinik.Object.Object` or None"

Documentation for Atrinik_Object_Decrease().

Definition at line 1712 of file atrinik_object.c.

const char doc_Atrinik_Object_Destroy[]
static
Initial value:
=
".. method:: Destroy().\n\n"
"Frees all data associated with the object."

Documentation for Atrinik_Object_Destroy().

Definition at line 1205 of file atrinik_object.c.

const char doc_Atrinik_Object_Drop[]
static
Initial value:
=
".. method:: Drop(what).\n\n"
"Forces the object to drop the specified object.\n\n"
":param what: What object to drop. Can be a string instead, in which case "
"it's equivalent of the /drop command.\n"
":type what: :class:`Atrinik.Object.Object` or str"

Documentation for Atrinik_Object_Drop().

Definition at line 618 of file atrinik_object.c.

const char doc_Atrinik_Object_FactionIsFriend[]
static
Initial value:
=
".. method:: FactionIsFriend(faction).\n\n"
"Checks whether the object is a friend of the specified faction.\n\n"
":param faction: Name of the faction to check.\n"
":type faction: str\n"
":returns: Whether the object is a friend of the faction.\n"
":rtype: bool\n"
":raises Atrinik.AtrinikError: If the specified faction doesn't exist."

Documentation for Atrinik_Object_FactionIsFriend().

Definition at line 2218 of file atrinik_object.c.

const char doc_Atrinik_Object_FindObject[]
static
Initial value:
=
".. method:: FindObject(mode=Atrinik.INVENTORY_ONLY, archname=None, name=None, "
"title=None, type=-1, unpaid=False).\n\n"
"Looks for a certain object in object's inventory.\n\n"
":param mode: How to search the inventory. One of the INVENTORY_xxx constants "
"defined in the :mod:`Atrinik` module, eg, :attr:`~Atrinik.INVENTORY_ALL`.\n"
":type mode: int\n"
":param archname: Arch name of the object to search for. If None, can be any.\n"
":type archname: str or None\n"
":param name: Name of the object. If None, can be any.\n"
":type name: str or None\n"
":param title: Title of the object. If None, can be any.\n"
":type title: str or None\n"
":param type: Type of the object. If -1, can be any.\n"
":type type: int\n"
":param unpaid: Only match unpaid objects.\n"
":type unpaid: bool\n"
":returns: The object we wanted if found, None otherwise\n"
":rtype: :class:`Atrinik.Object.Object` or None\n"
":raises ValueError: If there were no conditions to search for."

Documentation for Atrinik_Object_FindObject().

Definition at line 1112 of file atrinik_object.c.

const char doc_Atrinik_Object_FindObjects[]
static
Initial value:
=
".. method:: FindObjects(mode=Atrinik.INVENTORY_ONLY, archname=None, "
"name=None, title=None, type=-1, unpaid=False).\n\n"
"Looks for certain objects in object's inventory.\n\n"
":param mode: How to search the inventory. One of the INVENTORY_xxx constants "
"defined in the :mod:`Atrinik` module, eg, :attr:`~Atrinik.INVENTORY_ALL`.\n"
":type mode: int\n"
":param archname: Arch name of the object to search for. If None, can be any.\n"
":type archname: str or None\n"
":param name: Name of the object. If None, can be any.\n"
":type name: str or None\n"
":param title: Title of the object. If None, can be any.\n"
":type title: str or None\n"
":param type: Type of the object. If -1, can be any.\n"
":type type: int\n"
":param unpaid: Only match unpaid objects.\n"
":type unpaid: bool\n"
":returns: List of all matching objects.\n"
":rtype: list of :class:`Atrinik.Object.Object`\n"
":raises ValueError: If there were no conditions to search for."

Documentation for Atrinik_Object_FindObjects().

Definition at line 1144 of file atrinik_object.c.

const char doc_Atrinik_Object_GetCost[]
static
Initial value:
=
".. method:: GetCost(flag=Atrinik.COST_TRUE).\n\n"
"Get cost of an object in integer value.\n\n"
":param flag: One of the COST_xxx constants, eg, :attr:`~Atrinik.COST_BUY`.\n"
":type flag: int\n"
":returns: The cost of the item.\n"
":rtype: int"

Documentation for Atrinik_Object_GetCost().

Definition at line 1341 of file atrinik_object.c.

const char doc_Atrinik_Object_GetGender[]
static
Initial value:
=
".. method:: GetGender().\n\n"
"Acquire object's gender.\n\n"
":returns: One of the gender constants defined in :mod:`Atrinik.Gender`.\n"
":rtype: int"

Documentation for Atrinik_Object_GetGender().

Definition at line 682 of file atrinik_object.c.

const char doc_Atrinik_Object_GetMoney[]
static
Initial value:
=
".. method:: GetMoney().\n\n"
"Get all the money the object is carrying as integer.\n\n"
"Can only be used on player or container objects.\n\n"
":returns: The amount of money the object is carrying.\n"
":rtype: int"

Documentation for Atrinik_Object_GetMoney().

Definition at line 1367 of file atrinik_object.c.

const char doc_Atrinik_Object_GetName[]
static
Initial value:
=
".. method:: GetName(caller=None).\n\n"
"Acquire verbose textual representation of the object's name.\n\n"
":param caller: Who wants to see the name.\n"
":type caller: :class:`Atrinik.Object.Object` or None\n"
":returns: Full name of the object, including material, name, title, etc.\n"
":rtype: str"

Documentation for Atrinik_Object_GetName().

Definition at line 1512 of file atrinik_object.c.

const char doc_Atrinik_Object_GetPacket[]
static
Initial value:
=
".. method:: GetPacket(pl, flags=0).\n\n"
"Constructs packet data about the object, suitable for "
":meth:`Atrinik.Player.Player.SendPacket`.\n\n"
":param pl: Player that will receive the item data.\n"
":type pl: :class:`Atrinik.Player.Player`\n"
":param flags: A combination of UPD_xxx flags, eg, :attr:`Atrinik.UPD_FACE`.\n"
":type flags: int\n"
":returns: A tuple containing the format specifier and the actual data list.\n"
":rtype: tuple"

Documentation for Atrinik_Object_GetPacket().

Definition at line 2172 of file atrinik_object.c.

const char doc_Atrinik_Object_GetRangeVector[]
static
Initial value:
=
".. method:: GetRangeVector(to, flags=0).\n\n"
"Get the distance and direction from one object to another.\n\n"
":param to: Object to which the distance is calculated.\n"
":type to: :class:`Atrinik.Object.Object`\n"
":param flags: One or a combination of RV_xxx, eg, :attr:"
"`~Atrinik.RV_MANHATTAN_DISTANCE`\n"
":type flags: int\n"
":returns: None if the distance couldn't be calculated, otherwise a tuple "
"containing:\n\n"
" * Direction *object* should head to reach *to*, eg, \n"
" :attr:`~Atrinik.NORTH`\n"
" * Distance between *object* and *to*.\n"
" * X distance.\n"
" * Y distance.\n"
" * Part of the *object* that is closest.\n"
":rtype: tuple or None"

Documentation for Atrinik_Object_GetRangeVector().

Definition at line 1887 of file atrinik_object.c.

const char doc_Atrinik_Object_Hit[]
static
Initial value:
=
".. method:: Hit(target, damage).\n\n"
"Makes the object hit the target object for the specified amount of damage.\n\n"
":param target: The target object to hit.\n"
":type target: :class:`Atrinik.Object.Object`\n"
":param damage: How much damage to deal. If -1, the target object will be "
"killed, otherwise the actual damage done is calculated depending on the "
"object's attack types, the target's protections, etc.\n"
":type damage: int\n"
":raises ValueError: If the target is not on a map or is not alive."

Documentation for Atrinik_Object_Hit().

Definition at line 763 of file atrinik_object.c.

const char doc_Atrinik_Object_InsertInto[]
static
Initial value:
=
".. method:: InsertInto(where).\n\n"
"Inserts the object into some other object.\n\n"
":param where: Where to insert the object.\n"
":type where: :class:`Atrinik.Object.Object`\n"
":returns: The inserted object, which may be different from the original (due"
"to merging, for example). None is returned on failure.\n"
":rtype: class:`Atrinik.Object.Object` or None"

Documentation for Atrinik_Object_InsertInto().

Definition at line 516 of file atrinik_object.c.

const char doc_Atrinik_Object_Load[]
static
Initial value:
=
".. method:: Load(lines).\n\n"
"Load archetype-like attribute/value pairs into the object. For example::\n\n"
" '''\n"
" attack_protect 20\n"
" dam 10\n"
" '''"
"\n\n"
":param lines: Lines to load into the object.\n"
":type lines: str"

Documentation for Atrinik_Object_Load().

Definition at line 2142 of file atrinik_object.c.

const char doc_Atrinik_Object_Move[]
static
Initial value:
=
".. method:: Move(direction).\n\n"
"Move the object in the specified direction. The object must have the correct "
"(combination of) :attr:`~Atrinik.Object.Object.terrain_flag` set in order to "
"able to move onto the new square.\n\n"
":param direction: Direction to move into, eg, :attr:`~Atrinik.EAST`.\n"
":type direction: int\n"
":returns: 0 if the object is not able to move to the desired space, -1 if the "
"object was not able to move there yet but some sort of action was performed "
"that might allow us to move there (door opening for example), direction "
"number that the object ended up moving in otherwise.\n"
":rtype: int"

Documentation for Atrinik_Object_Move().

Definition at line 2019 of file atrinik_object.c.

const char doc_Atrinik_Object_PayAmount[]
static
Initial value:
=
".. method:: PayAmount(value).\n\n"
"Makes the object pay a specified amount of money.\n\n"
":param value: The amount of money to pay.\n"
":type value: int"
":returns: Whether the value was paid successfully (had enough money).\n"
":rtype: bool"

Documentation for Atrinik_Object_PayAmount().

Definition at line 1386 of file atrinik_object.c.

const char doc_Atrinik_Object_Protection[]
static
Initial value:
=
".. method:: Protection(protection).\n\n"
"Get object's protection value for the given protection ID.\n\n"
":param protection: One of the ATNR_xxx constants, eg, "
":attr:`~Atrinik.ATNR_SLASH`.\n"
":type protection: int\n"
":returns: The protection value.\n"
":rtype: int\n"
":raises IndexError: If the protection ID is invalid."

Documentation for Atrinik_Object_Protection().

Definition at line 1569 of file atrinik_object.c.

const char doc_Atrinik_Object_ReadKey[]
static
Initial value:
=
".. method:: ReadKey(key).\n\n"
"Get key value of an object.\n\n"
":param key: Key to look for.\n"
":type key: str\n"
":returns: Value for the key if found, None otherwise.\n"
":rtype: str or None"

Documentation for Atrinik_Object_ReadKey().

Definition at line 1453 of file atrinik_object.c.

const char doc_Atrinik_Object_Remove[]
static
Initial value:
=
".. method:: Remove().\n\n"
"Takes the object out of whatever map or inventory it is in. The object can "
"then be inserted or teleported somewhere else.\n\n"
"Be careful when removing one of the objects involved in the event activation "
"(such as the activator/event/etc). It is recommended you use :meth:"
"`Atrinik.SetReturnValue(1)` or similar before the script exits if doing "
"so.\n\n"
":raises Atrinik.AtrinikError: If the object is already removed."

Documentation for Atrinik_Object_Remove().

Definition at line 1176 of file atrinik_object.c.

const char doc_Atrinik_Object_Save[]
static
Initial value:
=
".. method:: Save().\n\n"
"Dump an object, as if it was being saved to map or player file. Useful for "
"saving the object somewhere for loading later with :meth:"
"`~Atrinik.Object.Object.Save`.\n\n"
":returns: Saved object.\n"
":rtype: str"

Documentation for Atrinik_Object_Save().

Definition at line 1315 of file atrinik_object.c.

const char doc_Atrinik_Object_Say[]
static
Initial value:
=
".. method:: Say(message).\n\n"
"Makes the object object say a message to everybody in range.\n\n"
":param message: The message to say.\n"
":type message: str"

Documentation for Atrinik_Object_Say().

Definition at line 649 of file atrinik_object.c.

const char doc_Atrinik_Object_SetAttack[]
static
Initial value:
=
".. method:: SetAttack(attack, value).\n\n"
"Set object's attack value for the given attack ID.\n\n"
":param attack: One of the ATNR_xxx constants, eg, "
":attr:`~Atrinik.ATNR_SLASH`.\n"
":type attack: int\n"
":param value: The value to set.\n"
":type value: int\n"
":raises IndexError: If the attack ID is invalid.\n"
":raises OverflowError: If the value to set is not in valid range."

Documentation for Atrinik_Object_SetAttack().

Definition at line 1674 of file atrinik_object.c.

const char doc_Atrinik_Object_SetGender[]
static
Initial value:
=
".. method:: SetGender(gender).\n\n"
"Set object's gender.\n\n"
":param gender: The gender to set. One of the gender constants defined in "
":mod:`Atrinik.Gender`.\n"
":type gender: int"

Documentation for Atrinik_Object_SetGender().

Definition at line 700 of file atrinik_object.c.

const char doc_Atrinik_Object_SetPosition[]
static
Initial value:
=
".. method:: SetPosition(x, y).\n\n"
"Sets new position coordinates for the object.\n\nCannot be used to move "
"objects out of containers, use :meth:`~Atrinik.Drop` or :meth:"
"`~Atrinik.TeleportTo` for that.\n\n"
":param x: New X position on the same map.\n"
":type x: int\n"
":param y: New Y position on the same map.\n"
":type y: int"

Documentation for Atrinik_Object_SetPosition().

Definition at line 1228 of file atrinik_object.c.

const char doc_Atrinik_Object_SetProtection[]
static
Initial value:
=
".. method:: SetProtection(protection, value).\n\n"
"Set object's protection value for the given protection ID.\n\n"
":param protection: One of the ATNR_xxx constants, eg, "
":attr:`~Atrinik.ATNR_SLASH`.\n"
":type protection: int\n"
":param value: The value to set.\n"
":type value: int\n"
":raises IndexError: If the protection ID is invalid.\n"
":raises OverflowError: If the value to set is not in valid range."

Documentation for Atrinik_Object_SetProtection().

Definition at line 1602 of file atrinik_object.c.

const char doc_Atrinik_Object_SquaresAround[]
static

Documentation for Atrinik_Object_SquaresAround().

Definition at line 1738 of file atrinik_object.c.

const char doc_Atrinik_Object_Take[]
static
Initial value:
=
".. method:: Take(what).\n\n"
"Forces the object to pick up the specified object.\n\n"
":param what: What object to pick up. Can be a string instead, in which case "
"it's equivalent of the /take command.\n"
":type what: :class:`Atrinik.Object.Object` or str"

Documentation for Atrinik_Object_Take().

Definition at line 587 of file atrinik_object.c.

const char doc_Atrinik_Object_TeleportTo[]
static
Initial value:
=
".. method:: TeleportTo(path, x=0, y=0).\n\n"
"Teleports the object to the specified coordinates on a map.\n\n"
":param path: The map path.\n"
":type path: str\n"
":param x: X coordinate on the map.\n"
":type x: int\n"
":param y: Y coordinate on the map.\n"
":type y: int"

Documentation for Atrinik_Object_TeleportTo().

Definition at line 472 of file atrinik_object.c.

const char doc_Atrinik_Object_Update[]
static
Initial value:
=
".. method:: Update().\n\n"
"Recalculate player's or monster's stats depending on equipment, forces, "
"skills, etc."

Documentation for Atrinik_Object_Update().

Definition at line 743 of file atrinik_object.c.

const char doc_Atrinik_Object_WriteKey[]
static
Initial value:
=
".. method:: WriteKey(key, value=None, add_key=True).\n\n"
"Set the key value of an object.\n\n"
":param key: Key to set.\n"
":type key: str\n"
":param value: Value to set for the key. If None, will clear the key's value "
"if the key is found.\n"
":type value: str or None\n"
":param add_key: Whether to add the key if it's not found in the object.\n"
":type add_key: bool\n"
":returns: Whether the operation was successful.\n"
":rtype: bool"

Documentation for Atrinik_Object_WriteKey().

Definition at line 1479 of file atrinik_object.c.

char* doc_object_flag_names[NUM_FLAGS+1]
static

Documentation for object flag attributes.

Definition at line 299 of file atrinik_object.c.

fields_struct fields[]
static

All the possible fields of an object.

Definition at line 44 of file atrinik_object.c.

PyGetSetDef getseters[NUM_FIELDS+NUM_FLAGS+1]
static

This is filled in when we initialize our object type.

Definition at line 2637 of file atrinik_object.c.

PyMethodDef methods[]
static

Available Python methods for the Atrinik.Object.Object object

Definition at line 2258 of file atrinik_object.c.