 |
Crossfire Server, Trunk
1.75.0
|
Go to the documentation of this file.
52 assert(map->
map != NULL);
58 char* tmp = strdup(mapname);
164 if (!PyArg_Parse(value,
"s", &val))
182 if (!PyArg_ParseTuple(args,
"s|i", &
message, &color))
197 if (!PyArg_ParseTuple(args,
"ii", &x, &y))
214 if (!PyArg_ParseTuple(args,
"sii", &txt, &x, &y))
236 if (!PyArg_ParseTuple(args,
"s(ii)", &what, &x, &y))
292 if (!PyArg_ParseTuple(args,
"i", &change))
332 PyErr_SetString(PyExc_ReferenceError,
"No objects connected to that ID on this map.");
336 if (olp->
value == connected) {
344 PyErr_SetString(PyExc_ReferenceError,
"No objects with that connection ID on this map.");
357 return left->
map < right->
map ? -1 : (left->
map == right->
map ? 0 : 1);
366 Py_INCREF(Py_NotImplemented);
367 return Py_NotImplemented;
371 if (result == -1 && PyErr_Occurred())
376 result = (result == 0);
379 result = (result != 0);
382 result = (result <= 0);
385 result = (result >= 0);
388 result = (result == -1);
391 result = (result == 1);
394 return PyBool_FromLong(result);
415 return (PyObject *)
self;
423 if (self->map && self->valid) {
426 Py_TYPE(
self)->tp_free(obj);
447 if (wrapper != NULL) {
456 return (PyObject *)wrapper;
477 { NULL, NULL, NULL, NULL, NULL }
481 {
"Print", (PyCFunction)
Map_Message, METH_VARARGS, NULL },
484 {
"Check", (PyCFunction)
Map_Check, METH_VARARGS, NULL },
485 {
"Next", (PyCFunction)
Map_Next, METH_NOARGS, NULL },
486 {
"Insert", (PyCFunction)
Map_Insert, METH_VARARGS, NULL },
490 { NULL, NULL, 0, NULL }
499 PyObject_HashNotImplemented,
500 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
static void add_map_assoc(mapstruct *key, Crossfire_Map *value)
region * cf_map_get_region_property(mapstruct *map, int propcode)
#define MAPEXISTCHECK_INT(map)
void cf_log(LogLevel logLevel, const char *format,...)
Wrapper for LOG().
int cf_map_get_height(mapstruct *map)
static PyObject * Map_GetDifficulty(Crossfire_Map *whoptr, void *closure)
PyObject_HEAD object * obj
sstring cf_map_get_sstring_property(mapstruct *map, int propcode)
#define CFAPI_MAP_PROP_TMPNAME
static void free_map_assoc(mapstruct *key)
int cf_map_get_int_property(mapstruct *map, int property)
@ llevError
Error, serious thing.
int cf_map_get_players(mapstruct *map)
static int Map_SetPath(Crossfire_Map *whoptr, PyObject *value, void *closure)
static PyObject * Map_Insert(Crossfire_Map *map, PyObject *args)
#define CFAPI_MAP_PROP_NEXT
oblinkpt * next
Next value in the list.
oblinkpt * buttons
Linked list of linked lists of buttons.
static PyObject * Map_GetHeight(Crossfire_Map *whoptr, void *closure)
object * cf_create_object_by_name(const char *name)
Wrapper for create_archetype() and create_archetype_by_object_name().
int cf_map_get_reset_time(mapstruct *map)
static PyObject * Map_ChangeLight(Crossfire_Map *map, PyObject *args)
object * cf_map_insert_object_around(mapstruct *where, object *op, int x, int y)
Will insert op in the map where around the spot x, y.
static PyGetSetDef Map_getseters[]
#define MAP_PLAYER_UNIQUE
This map is player-specific.
Used to link together several object links.
object * cf_map_insert_object(mapstruct *where, object *op, int x, int y)
Wrapper for object_insert_in_map_at().
CF_PYTHON_OBJECT(Map, Crossfire_Map_dealloc, &MapConvert, PyObject_HashNotImplemented, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, "Crossfire maps",(richcmpfunc) Crossfire_Map_RichCompare, MapMethods, Map_getseters, NULL, Crossfire_Map_new)
#define CFAPI_MAP_PROP_UNIQUE
char path[HUGE_BUF]
Filename of the map.
void Handle_Map_Unload_Hook(Crossfire_Map *map)
#define NDI_BLUE
Actually, it is Dodger Blue.
static PyObject * Map_GetEnterY(Crossfire_Map *whoptr, void *closure)
PyObject * Crossfire_Object_wrap(object *what)
Python initialized.
static PyObject * Map_GetTempName(Crossfire_Map *whoptr, void *closure)
#define MAPEXISTCHECK(map)
#define CFAPI_MAP_PROP_REGION
static PyObject * Map_GetPath(Crossfire_Map *whoptr, void *closure)
#define MAP_IN_MEMORY
Map is fully loaded.
static PyObject * Crossfire_Map_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
Python initialized.
PyObject_HEAD mapstruct * map
Used to link together several objects.
objectlink * link
Items for this value.
object * cf_map_get_object_at(mapstruct *m, int x, int y)
Wrapper for GET_MAP_OB().
static PyObject * Map_Message(Crossfire_Map *map, PyObject *args)
#define CFAPI_MAP_PROP_MESSAGE
int cf_map_get_enter_y(mapstruct *map)
long value
Used as connected value in buttons/gates.
static PyObject * Map_GetUnique(Crossfire_Map *whoptr, void *closure)
static std::map< mapstruct *, Crossfire_Map * > map_assoc_table
TIPS on SURVIVING Crossfire is populated with a wealth of different monsters These monsters can have varying immunities and attack types In some of them can be quite a bit smarter than others It will be important for new players to learn the abilities of different monsters and learn just how much it will take to kill them This section discusses how monsters can interact with players Most monsters in the game are out to mindlessly kill and destroy the players These monsters will help boost a player s after he kills them When fighting a large amount of monsters in a single attempt to find a narrower hallway so that you are not being attacked from all sides Charging into a room full of Beholders for instance would not be open the door and fight them one at a time For there are several maps designed for them Find these areas and clear them out All throughout these a player can find signs and books which they can read by stepping onto them and hitting A to apply the book sign These messages will help the player to learn the system One more always keep an eye on your food If your food drops to your character will soon so BE CAREFUL ! NPCs Non Player Character are special monsters which have intelligence Players may be able to interact with these monsters to help solve puzzles and find items of interest To speak with a monster you suspect to be a simply move to an adjacent square to them and push the double ie Enter your message
#define CFAPI_MAP_PROP_PATH
void cf_map_message(mapstruct *m, const char *msg, int color)
Partial wrapper for ext_info_map().
int cf_map_get_reset_timeout(mapstruct *map)
PyObject * Crossfire_Region_wrap(region *what)
int cf_map_get_enter_x(mapstruct *map)
mapstruct * cf_map_get_map_property(mapstruct *map, int propcode)
int cf_map_get_flags(mapstruct *oldmap, mapstruct **newmap, int16_t x, int16_t y, int16_t *nx, int16_t *ny)
Wrapper for get_map_flags().
#define P_OUT_OF_MAP
This space is outside the map.
#define CFAPI_MAP_PROP_NAME
void cf_map_set_string_property(mapstruct *map, int propcode, const char *value)
#define NDI_UNIQUE
Print immediately, don't buffer.
static PyObject * Crossfire_Map_Long(PyObject *obj)
static PyObject * Map_GetResetTimeout(Crossfire_Map *whoptr, void *closure)
void cf_map_trigger_connected(objectlink *ol, object *cause, int state)
Wrapper for trigger_connected().
static PyObject * Map_TriggerConnected(Crossfire_Map *map, PyObject *args)
Python backend method for Map.TriggerConnected(int connected, CfObject cause, int state)
static PyObject * Map_GetPlayers(Crossfire_Map *whoptr, void *closure)
static Crossfire_Map * find_assoc_pymap(mapstruct *key)
static PyObject * Map_GetFirstObjectAt(Crossfire_Map *map, PyObject *args)
static PyObject * Map_GetResetTime(Crossfire_Map *whoptr, void *closure)
static PyObject * Map_GetRegion(Crossfire_Map *whoptr, void *closure)
uint32_t in_memory
Combination of IN_MEMORY_xxx flags.
static PyMethodDef MapMethods[]
static PyObject * Map_GetDarkness(Crossfire_Map *whoptr, void *closure)
static void ensure_map_in_memory(Crossfire_Map *map)
This makes sure the map is in memory and not swapped out.
static void Crossfire_Map_dealloc(PyObject *obj)
static PyObject * Map_Check(Crossfire_Map *map, PyObject *args)
int cf_map_get_difficulty(mapstruct *map)
static PyObject * Map_GetName(Crossfire_Map *whoptr, void *closure)
int cf_map_get_darkness(mapstruct *map)
mapstruct * cf_map_get_map(const char *name, int flags)
Wrapper for ready_map_name().
static int Map_InternalCompare(Crossfire_Map *left, Crossfire_Map *right)
static PyObject * Map_GetMessage(Crossfire_Map *whoptr, void *closure)
PyObject * Crossfire_Map_wrap(mapstruct *what)
static PyObject * Map_GetWidth(Crossfire_Map *whoptr, void *closure)
PyTypeObject Crossfire_ObjectType
object * cf_map_find_by_archetype_name(const char *str, mapstruct *map, int nx, int ny)
Kinda wrapper for map_find_by_archetype_name().
static PyObject * Map_GetEnterX(Crossfire_Map *whoptr, void *closure)
int cf_map_get_width(mapstruct *map)
int cf_map_change_light(mapstruct *m, int change)
Wrapper for change_map_light().
static PyObject * Map_Next(Crossfire_Map *map, PyObject *args)
static PyObject * Map_CreateObject(Crossfire_Map *map, PyObject *args)
@ llevDebug
Only for debugging purposes.
static PyObject * Crossfire_Map_RichCompare(Crossfire_Map *left, Crossfire_Map *right, int op)
static PyObject * Map_InsertAround(Crossfire_Map *map, PyObject *args)
CF_PYTHON_NUMBER_METHODS(Map, Crossfire_Map_Long)
PyTypeObject Crossfire_MapType