Atrinik Server  4.0
Macros | Functions | Variables
atrinik_map.c File Reference
#include <plugin_python.h>
#include <player.h>

Go to the source code of this file.

Macros

#define NUM_MAPFLAGS   (sizeof(mapflag_names) / sizeof(mapflag_names[0]))
 

Functions

static PyObject * Atrinik_Map_Objects (Atrinik_Map *self, PyObject *args)
 
static PyObject * Atrinik_Map_ObjectsReversed (Atrinik_Map *self, PyObject *args)
 
static PyObject * Atrinik_Map_GetLayer (Atrinik_Map *self, PyObject *args)
 
static PyObject * Atrinik_Map_GetMapFromCoord (Atrinik_Map *self, PyObject *args)
 
static PyObject * Atrinik_Map_PlaySound (Atrinik_Map *self, PyObject *args, PyObject *keywds)
 
static PyObject * Atrinik_Map_DrawInfo (Atrinik_Map *self, PyObject *args, PyObject *keywds)
 
static PyObject * Atrinik_Map_CreateObject (Atrinik_Map *self, PyObject *args)
 
static PyObject * Atrinik_Map_CountPlayers (Atrinik_Map *self)
 
static PyObject * Atrinik_Map_GetPlayers (Atrinik_Map *self)
 
static PyObject * Atrinik_Map_Insert (Atrinik_Map *self, PyObject *args)
 
static PyObject * Atrinik_Map_Wall (Atrinik_Map *self, PyObject *args)
 
static PyObject * Atrinik_Map_Blocked (Atrinik_Map *self, PyObject *args)
 
static PyObject * Atrinik_Map_FreeSpot (Atrinik_Map *self, PyObject *args)
 
static PyObject * Atrinik_Map_GetDarkness (Atrinik_Map *self, PyObject *args)
 
static PyObject * Atrinik_Map_GetPath (Atrinik_Map *self, PyObject *args, PyObject *keywds)
 
static PyObject * Atrinik_Map_LocateBeacon (Atrinik_Map *self, PyObject *args)
 
static PyObject * Atrinik_Map_Redraw (Atrinik_Map *self, PyObject *args)
 
static PyObject * Atrinik_Map_Save (Atrinik_Map *self)
 
static PyObject * get_attribute (Atrinik_Map *map, void *context)
 
static int set_attribute (Atrinik_Map *map, PyObject *value, void *context)
 
static PyObject * Map_GetFlag (Atrinik_Map *map, void *context)
 
static int Map_SetFlag (Atrinik_Map *map, PyObject *val, void *context)
 
static PyObject * Atrinik_Map_new (PyTypeObject *type, PyObject *args, PyObject *kwds)
 
static void Atrinik_Map_dealloc (Atrinik_Map *self)
 
static PyObject * Atrinik_Map_str (Atrinik_Map *self)
 
static int Atrinik_Map_InternalCompare (Atrinik_Map *left, Atrinik_Map *right)
 
static PyObject * Atrinik_Map_RichCompare (Atrinik_Map *left, Atrinik_Map *right, int op)
 
int Atrinik_Map_init (PyObject *module)
 
PyObject * wrap_map (mapstruct *what)
 

Variables

static fields_struct fields []
 
static char * mapflag_names []
 
static char * mapflag_docs []
 
static const char doc_Atrinik_Map_Objects []
 
static const char doc_Atrinik_Map_ObjectsReversed []
 
static const char doc_Atrinik_Map_GetLayer []
 
static const char doc_Atrinik_Map_GetMapFromCoord []
 
static const char doc_Atrinik_Map_PlaySound []
 
static const char doc_Atrinik_Map_DrawInfo []
 
static const char doc_Atrinik_Map_CreateObject []
 
static const char doc_Atrinik_Map_CountPlayers []
 
static const char doc_Atrinik_Map_GetPlayers []
 
static const char doc_Atrinik_Map_Insert []
 
static const char doc_Atrinik_Map_Wall []
 
static const char doc_Atrinik_Map_Blocked []
 
static const char doc_Atrinik_Map_FreeSpot []
 
static const char doc_Atrinik_Map_GetDarkness []
 
static const char doc_Atrinik_Map_GetPath []
 
static const char doc_Atrinik_Map_LocateBeacon []
 
static const char doc_Atrinik_Map_Redraw []
 
static const char doc_Atrinik_Map_Save []
 
static PyMethodDef MapMethods []
 
static PyGetSetDef getseters [NUM_FIELDS+NUM_MAPFLAGS+1]
 
PyTypeObject Atrinik_MapType
 

Detailed Description

Atrinik Python plugin map related code.

Author
Alex Tokar
Yann Chachkoff

Definition in file atrinik_map.c.

Macro Definition Documentation

#define NUM_MAPFLAGS   (sizeof(mapflag_names) / sizeof(mapflag_names[0]))

Number of map flags

Definition at line 116 of file atrinik_map.c.

Function Documentation

static PyObject* Atrinik_Map_Blocked ( Atrinik_Map self,
PyObject *  args 
)
static

Implements Atrinik.Map.Map.Blocked() Python method.

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

Definition at line 554 of file atrinik_map.c.

static PyObject* Atrinik_Map_CountPlayers ( Atrinik_Map self)
static

Implements Atrinik.Map.Map.CountPlayers() Python method.

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

Definition at line 434 of file atrinik_map.c.

static PyObject* Atrinik_Map_CreateObject ( Atrinik_Map self,
PyObject *  args 
)
static

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

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

Definition at line 400 of file atrinik_map.c.

static void Atrinik_Map_dealloc ( Atrinik_Map self)
static

Free a map wrapper.

Parameters
selfThe wrapper to free.

Definition at line 994 of file atrinik_map.c.

static PyObject* Atrinik_Map_DrawInfo ( Atrinik_Map self,
PyObject *  args,
PyObject *  keywds 
)
static

Implements Atrinik.Map.Map.DrawInfo() Python method.

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

Definition at line 355 of file atrinik_map.c.

static PyObject* Atrinik_Map_FreeSpot ( Atrinik_Map self,
PyObject *  args 
)
static

Implements Atrinik.Map.Map.FreeSpot() Python method.

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

Definition at line 601 of file atrinik_map.c.

static PyObject* Atrinik_Map_GetDarkness ( Atrinik_Map self,
PyObject *  args 
)
static

Implements Atrinik.Map.Map.GetDarkness() Python method.

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

Definition at line 657 of file atrinik_map.c.

static PyObject* Atrinik_Map_GetLayer ( Atrinik_Map self,
PyObject *  args 
)
static

Implements Atrinik.Map.Map.GetLayer() Python method.

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

Definition at line 220 of file atrinik_map.c.

static PyObject* Atrinik_Map_GetMapFromCoord ( Atrinik_Map self,
PyObject *  args 
)
static

Implements Atrinik.Map.Map.GetMapFromCoord() Python method.

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

Definition at line 267 of file atrinik_map.c.

static PyObject* Atrinik_Map_GetPath ( Atrinik_Map self,
PyObject *  args,
PyObject *  keywds 
)
static

Implements Atrinik.Map.Map.GetPath() Python method.

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

Definition at line 693 of file atrinik_map.c.

static PyObject* Atrinik_Map_GetPlayers ( Atrinik_Map self)
static

Implements Atrinik.Map.Map.GetPlayers() Python method.

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

Definition at line 450 of file atrinik_map.c.

int Atrinik_Map_init ( PyObject *  module)

Initialize the map wrapper.

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

Definition at line 1086 of file atrinik_map.c.

static PyObject* Atrinik_Map_Insert ( Atrinik_Map self,
PyObject *  args 
)
static

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

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

Definition at line 480 of file atrinik_map.c.

static PyObject* Atrinik_Map_LocateBeacon ( Atrinik_Map self,
PyObject *  args 
)
static

Implements Atrinik.Map.Map.LocateBeacon() Python method.

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

Definition at line 729 of file atrinik_map.c.

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

Create a new map wrapper.

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

Definition at line 978 of file atrinik_map.c.

static PyObject* Atrinik_Map_Objects ( Atrinik_Map self,
PyObject *  args 
)
static

Implements Atrinik.Map.Map.Objects() Python method.

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

Definition at line 136 of file atrinik_map.c.

static PyObject* Atrinik_Map_ObjectsReversed ( Atrinik_Map self,
PyObject *  args 
)
static

Implements Atrinik.Map.Map.ObjectsReversed() Python method.

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

Definition at line 172 of file atrinik_map.c.

static PyObject* Atrinik_Map_PlaySound ( Atrinik_Map self,
PyObject *  args,
PyObject *  keywds 
)
static

Implements Atrinik.Map.Map.PlaySound() Python method.

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

Definition at line 307 of file atrinik_map.c.

static PyObject* Atrinik_Map_Redraw ( Atrinik_Map self,
PyObject *  args 
)
static

Implements Atrinik.Map.Map.Redraw() Python method.

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

Definition at line 780 of file atrinik_map.c.

static PyObject* Atrinik_Map_Save ( Atrinik_Map self)
static

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

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

Definition at line 822 of file atrinik_map.c.

static PyObject* Atrinik_Map_str ( Atrinik_Map self)
static

Return a string representation of a map.

Parameters
selfThe map object.
Returns
Python object containing the map path and name of the map.

Definition at line 1011 of file atrinik_map.c.

static PyObject* Atrinik_Map_Wall ( Atrinik_Map self,
PyObject *  args 
)
static

Implements Atrinik.Map.Map.Wall() Python method.

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

Definition at line 516 of file atrinik_map.c.

static PyObject* get_attribute ( Atrinik_Map map,
void *  context 
)
static

Get map's attribute.

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

Definition at line 881 of file atrinik_map.c.

static PyObject* Map_GetFlag ( Atrinik_Map map,
void *  context 
)
static

Get map's flag.

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

Definition at line 920 of file atrinik_map.c.

static int Map_SetFlag ( Atrinik_Map map,
PyObject *  val,
void *  context 
)
static

Set map's flag.

Parameters
mapPython map 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 944 of file atrinik_map.c.

static int set_attribute ( Atrinik_Map map,
PyObject *  value,
void *  context 
)
static

Set attribute of a map.

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

Definition at line 897 of file atrinik_map.c.

PyObject* wrap_map ( mapstruct what)

Utility method to wrap a map.

Parameters
whatMap to wrap.
Returns
Python object wrapping the real map.

Definition at line 1139 of file atrinik_map.c.

Variable Documentation

PyTypeObject Atrinik_MapType

Our actual Python MapType.

Definition at line 1040 of file atrinik_map.c.

const char doc_Atrinik_Map_Blocked[]
static
Initial value:
=
".. method:: Blocked(obj, x, y, terrain).\n\n"
"Check if specified square is blocked for *obj*.\n\nIf you simply need to "
"check if there's a wall on a square, you should use :meth:"
"`~Atrinik.Map.Map.Wall` instead.\n\n"
":param obj: Object to check.\n"
":type obj: :class:`Atrinik.Object.Object`\n"
":param x: X position on the map.\n"
":type x: int\n"
":param y: Y position on the map.\n"
":type y: int\n"
":param terrain: Terrain the object is allowed to go to. One (or a "
"combination) of the TERRAIN_xxx constants, eg, :attr:"
"`~Atrinik.TERRAIN_AIRBREATH`. The object's :attr:"
"`~Atrinik.Object.Object.terrain_flag` can be used for this purpose.\n"
":type terrain: int\n"
":returns: A combination of P_xxx, eg, :attr:`~Atrinik.P_NO_PASS`. Zero means "
"the square is not blocked for the object.\n"
":rtype: int\n"
":raises: Atrinik.AtrinikError: If there was a problem resolving the specified "
"X/Y coordinates to a tiled map (if they were outside the map)."

Documentation for Atrinik_Map_Blocked().

Definition at line 528 of file atrinik_map.c.

const char doc_Atrinik_Map_CountPlayers[]
static
Initial value:
=
".. method:: CountPlayers().\n\n"
"Count number of players on map.\n\n"
":returns: The number of players on the map.\n"
":rtype: int"

Documentation for Atrinik_Map_CountPlayers().

Definition at line 424 of file atrinik_map.c.

const char doc_Atrinik_Map_CreateObject[]
static
Initial value:
=
".. method:: CreateObject(archname, x, y).\n\n"
"Create an object on the map.\n\n"
":param archname: Arch name of the object to create.\n"
":type archname: str\n"
":param x: X position on the map.\n"
":type x: int\n"
":param y: Y position on the map.\n"
":type y: int\n"
":returns: The created object.\n"
":rtype: :class:`Atrinik.Object.Object`\n"
":raises Atrinik.AtrinikError: If *archname* is not a valid archetype."

Documentation for Atrinik_Map_CreateObject().

Definition at line 383 of file atrinik_map.c.

const char doc_Atrinik_Map_DrawInfo[]
static
Initial value:
=
".. method:: DrawInfo(x, y, message, color=Atrinik.COLOR_BLUE, "
"type=Atrinik.CHAT_TYPE_GAME, name=None, distance=Atrinik.MAP_INFO_NORMAL).\n\n"
"Send a message to all players on the map.\n\n"
":param x: X position on the map.\n"
":type x: int\n"
":param y: Y position on the map.\n"
":type y: int\n"
":param message: The message to send.\n"
":type message: str\n"
":param color: Color to use for the message. Can be one of the COLOR_xxx "
"constants (eg, :attr:`~Atrinik.COLOR_RED`) or a regular HTML color notation "
"(eg, '00ff00')\n"
":type color: str\n"
":param type: One of the CHAT_TYPE_xxx constants, eg, :attr:"
"`~Atrinik.CHAT_TYPE_CHAT`.\n"
":type type: int\n"
":param name: Player name that is the source of this message, if applicable.\n"
":type name: str or None\n"
":param distance: Maximum distance for players to be away from *x*, *y* to "
"hear the message.\n"
":type distance: int"

Documentation for Atrinik_Map_DrawInfo().

Definition at line 328 of file atrinik_map.c.

const char doc_Atrinik_Map_FreeSpot[]
static
Initial value:
=
".. method:: FreeSpot(obj, x, y, start, stop).\n\n"
"Find first free spot around map at *x*, *y*. The resulting value can be used "
"as an index to both free spot arrays; :attr:`Atrinik.freearr_x` and "
":attr:`Atrinik.freearr_y`.\n\n"
":param obj: Involved object - will be used to find the spot this object could "
"move onto.\n"
":type obj: :class:`Atrinik.Object.Object`\n"
":param x: X position on the map.\n"
":type x: int\n"
":param y: Y position on the map.\n"
":type y: int\n"
":param start: Start in the free spot arrays; 0 will also check the tile at "
"*x*, *y*, whereas 1 will start searching only around *x*, *y*.\n"
":type start: int\n"
":param stop: Where to stop in the free spot arrays; one of the SIZEOFFREEx "
"constants, eg, :attr:`~Atrinik.SIZEOFFREE1`."
":type stop: int\n"
":returns: -1 on error, index to the free spot arrays otherwise.\n"
":rtype: int\n"
":raises: ValueError: If either *start* or *stop* are not in a valid range."

Documentation for Atrinik_Map_FreeSpot().

Definition at line 575 of file atrinik_map.c.

const char doc_Atrinik_Map_GetDarkness[]
static
Initial value:
=
".. method:: GetDarkness(x, y).\n\n"
"Gets the darkness value of the specified square.\n\n"
":param x: X position on the map.\n"
":type x: int\n"
":param y: Y position on the map.\n"
":type y: int\n"
":returns: The darkness value.\n"
":rtype: int\n"
":raises: Atrinik.AtrinikError: If there was a problem resolving the specified "
"X/Y coordinates to a tiled map (if they were outside the map)."

Documentation for Atrinik_Map_GetDarkness().

Definition at line 641 of file atrinik_map.c.

const char doc_Atrinik_Map_GetLayer[]
static
Initial value:
=
".. method:: GetLayer(x, y, layer, sub_layer=-1).\n\n"
"Construct a list containing objects with the specified layer on the specified "
"square.\n\nNote that there is another way to loop through objects on a "
"square, which is less memory intensive, and can be stopped at any time with a "
"break::\n\n"
" for obj in Atrinik.WhoIsActivator().map.Objects(0, 0):\n"
" print(obj)"
"\n\n"
":param x: X coordinate on the map.\n"
":type x: int\n"
":param y: Y coordinate on the map.\n"
":type y: int\n"
":param layer: Layer to look for - one of LAYER_xxx constants, eg, :attr:"
"`~Atrinik.LAYER_WALL`.\n"
":type layer: int\n"
":param sub_layer: Sub-layer to look for; if -1, will look for all "
"sub-layers.\n"
":type sub_layer: int\n"
":returns: A list containing objects on the square with the specified layer.\n"
":rtype: list of :class:`Atrinik.Object.Object`\n"
":raises ValueError: If invalid layer ID was specified.\n"
":raises Atrinik.AtrinikError: If there was an error trying to get the "
"objects (invalid X/Y, or not on a nearby tiled map, for example)."

Documentation for Atrinik_Map_GetLayer().

Definition at line 191 of file atrinik_map.c.

const char doc_Atrinik_Map_GetMapFromCoord[]
static
Initial value:
=
".. method:: GetMapFromCoord(x, y).\n\n"
"Get real coordinates from map, taking tiling into consideration.\n\n"
":param x: X coordinate on the map.\n"
":type x: int\n"
":param y: Y coordinate on the map.\n"
":type y: int\n"
":returns: A tuple containing new map, new X, and new Y to use. The new map "
"can be None.\n"
":rtype: tuple"

Documentation for Atrinik_Map_GetMapFromCoord().

Definition at line 252 of file atrinik_map.c.

const char doc_Atrinik_Map_GetPath[]
static
Initial value:
=
".. method:: GetPath(path=None, unique=None, name=None).\n\n"
"Construct a path based on the path of the map, with *path* appended.\n\n"
":param path: Path to append. If None, will append the filename of the map "
"instead.\n"
":type path: str or None\n"
":param unique: Whether to construct a unique path. If None, unique flag of "
"the map will be used.\n"
":type unique: bool or None\n"
":param name: If the map is not unique and *unique* is True, this is required "
"to determine which player the unique map path should belong to.\n"
":type name: str or None\n"
":returns: The created path.\n"
":rtype: str"

Documentation for Atrinik_Map_GetPath().

Definition at line 674 of file atrinik_map.c.

const char doc_Atrinik_Map_GetPlayers[]
static
Initial value:
=
".. method:: GetPlayers().\n\n"
"Get all the players on a specified map.\n\n"
":returns: List containing player objects on the map.\n"
":rtype: :attr:`list` of :class:`Atrinik.Object.Object`"

Documentation for Atrinik_Map_GetPlayers().

Definition at line 440 of file atrinik_map.c.

const char doc_Atrinik_Map_Insert[]
static
Initial value:
=
".. method:: Insert(obj, x, y).\n\n"
"Insert the specified object on map, removing it first if necessary.\n\n"
":param obj: Object to insert.\n"
":type obj: :class:`Atrinik.Object.Object`\n"
":param x: X position on the map.\n"
":type x: int\n"
":param y: Y position on the map.\n"
":type y: int\n"
":returns: The inserted object. Can be None on failure, or different from "
"*obj* in case of merging.\n"
":rtype: :class:`Atrinik.Object.Object` or None"

Documentation for Atrinik_Map_Insert().

Definition at line 463 of file atrinik_map.c.

const char doc_Atrinik_Map_LocateBeacon[]
static
Initial value:
=
".. method:: LocateBeacon(name).\n\n"
"Locate a beacon.\n\n"
":param name: The beacon name to find.\n"
":type name: str\n"
":returns: The beacon object if found, None otherwise.\n"
":rtype: :class:`Atrinik.Object.Object` or None"

Documentation for Atrinik_Map_LocateBeacon().

Definition at line 717 of file atrinik_map.c.

const char doc_Atrinik_Map_Objects[]
static
Initial value:
=
".. method:: Objects(x, y).\n\n"
"Iterate objects on the specified map square, from first to last, eg::\n\n"
" for obj in Atrinik.WhoIsActivator().map.Objects(0, 0):\n"
" print(obj)"
"\n\n"
":param x: X coordinate on the map.\n"
":type x: int\n"
":param y: Y coordinate on the map.\n"
":type y: int\n"
":returns: Iterator object.\n"
":rtype: :class:`Atrinik.Object.ObjectIterator`"

Documentation for Atrinik_Map_Objects().

Definition at line 119 of file atrinik_map.c.

const char doc_Atrinik_Map_ObjectsReversed[]
static
Initial value:
=
".. method:: ObjectsReversed(x, y).\n\n"
"Iterate objects on the specified map square, from last to first, eg::\n\n"
" for obj in Atrinik.WhoIsActivator().map.ObjectsReversed(0, 0):\n"
" print(obj)"
"\n\n"
":param x: X coordinate on the map.\n"
":type x: int\n"
":param y: Y coordinate on the map.\n"
":type y: int\n"
":returns: Iterator object.\n"
":rtype: :class:`Atrinik.Object.ObjectIterator`"

Documentation for Atrinik_Map_ObjectsReversed().

Definition at line 155 of file atrinik_map.c.

const char doc_Atrinik_Map_PlaySound[]
static
Initial value:
=
".. method:: PlaySound(filename, x, y, type=Atrinik.CMD_SOUND_EFFECT, loop=0, "
"volume=0).\n\n"
"Play a sound on the map.\n\n"
":param filename: Sound file to play.\n"
":type filename: str\n"
":param x: X position where the sound is playing from.\n"
":type x: int\n"
":param y: Y position where the sound is playing from.\n"
":type y: int\n"
":param type: Sound type to play, one of the CMD_SOUND_xxx constants, eg, "
":attr:`~Atrinik.CMD_SOUND_BACKGROUND`.\n"
":type type: int\n"
":param loop: How many times to loop the sound, -1 to loop infinitely.\n"
":type loop: int\n"
":param volume: Volume adjustment.\n"
":type volume: int"

Documentation for Atrinik_Map_PlaySound().

Definition at line 285 of file atrinik_map.c.

const char doc_Atrinik_Map_Redraw[]
static
Initial value:
=
".. method:: Redraw(x, y, layer=-1, sub_layer=-1).\n\n"
"Redraw the specified tile for all players.\n\n"
":param x: X position on the map.\n"
":type x: int\n"
":param y: Y position on the map.\n"
":type y: int\n"
":param layer: Layer to redraw. If -1, will redraw all layers.\n"
":type layer: int\n"
":param sub_layer: Sub-layer to redraw. If -1, will redraw all sub-layers.\n"
":type sub_layer: int\n"
":raises Atrinik.AtrinikError: If either coordinates are not within the map.\n"
":raises Atrinik.AtrinikError: If *layer* is not within a valid range.\n"
":raises Atrinik.AtrinikError: If *sub_layer* is not within a valid range."

Documentation for Atrinik_Map_Redraw().

Definition at line 761 of file atrinik_map.c.

const char doc_Atrinik_Map_Save[]
static
Initial value:
=
".. method:: Save().\n\n"
"Saves the specified map.\n\n"

Documentation for Atrinik_Map_Save().

Definition at line 814 of file atrinik_map.c.

const char doc_Atrinik_Map_Wall[]
static
Initial value:
=
".. method:: Wall(x, y).\n\n"
"Checks if there's a wall on the specified square.\n\n"
":param x: X position on the map.\n"
":type x: int\n"
":param y: Y position on the map.\n"
":type y: int\n"
":returns: A combination of P_xxx, eg, :attr:`~Atrinik.P_NO_PASS`. Zero means "
"the square is not blocked by anything.\n"
":rtype: int"

Documentation for Atrinik_Map_Wall().

Definition at line 501 of file atrinik_map.c.

fields_struct fields[]
static

Map fields.

Definition at line 39 of file atrinik_map.c.

PyGetSetDef getseters[NUM_FIELDS+NUM_MAPFLAGS+1]
static

This is filled in when we initialize our map type.

Definition at line 1037 of file atrinik_map.c.

char* mapflag_docs[]
static
Initial value:
= {
"Whether the map is an outdoor map.",
"Special unique map.",
"If true, reset time is not affected by players entering/leaving the map.",
"No spells.",
"Height difference will be taken into account when rendering the map.",
"No harmful spells like fireball, magic bullet, etc.",
"Don't allow any summoning spells.",
"When set, a player login on this map will force the player to enter the "
"specified :attr:`~Atrinik.Map.enter_x` "
":attr:`~Atrinik.Map.enter_y` coordinates",
"Players cannot save on this map.",
NULL, NULL, NULL,
"PvP is possible on this map.",
"Don't save the map - only used with unique maps.",
}

Docstrings for mapflag_names.

Definition at line 98 of file atrinik_map.c.

char* mapflag_names[]
static
Initial value:
= {
"f_outdoor", "f_unique", "f_fixed_rtime", "f_nomagic",
"f_height_diff", "f_noharm", "f_nosummon", "f_fixed_login",
"f_player_no_save", NULL, NULL, NULL, "f_pvp",
"f_no_save"
}

Map flags.

Note
These must be in same order as map flags.

Definition at line 90 of file atrinik_map.c.

PyMethodDef MapMethods[]
static

Available Python methods for the AtrinikMap object

Definition at line 831 of file atrinik_map.c.