Crossfire Server, Trunk
cfpython_object.cpp
Go to the documentation of this file.
1 /*****************************************************************************/
2 /* CFPython - A Python module for Crossfire RPG. */
3 /* Version: 2.0beta8 (also known as "Alexander") */
4 /* Contact: yann.chachkoff@myrealbox.com */
5 /*****************************************************************************/
6 /* That code is placed under the GNU General Public Licence (GPL) */
7 /* (C)2001-2005 by Chachkoff Yann (Feel free to deliver your complaints) */
8 /*****************************************************************************/
9 /* CrossFire, A Multiplayer game for X-windows */
10 /* */
11 /* Copyright (C) 2000 Mark Wedel */
12 /* Copyright (C) 1992 Frank Tore Johansen */
13 /* */
14 /* This program is free software; you can redistribute it and/or modify */
15 /* it under the terms of the GNU General Public License as published by */
16 /* the Free Software Foundation; either version 2 of the License, or */
17 /* (at your option) any later version. */
18 /* */
19 /* This program is distributed in the hope that it will be useful, */
20 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
21 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
22 /* GNU General Public License for more details. */
23 /* */
24 /* You should have received a copy of the GNU General Public License */
25 /* along with this program; if not, write to the Free Software */
26 /* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
27 /* */
28 /*****************************************************************************/
29 
30 #include <cfpython.h>
31 #include <hashtable.h>
32 
33 #define EXISTCHECK(ob) { \
34  if (!ob || !ob->obj || (object_was_destroyed(ob->obj, ob->obj->count))) { \
35  PyErr_SetString(PyExc_ReferenceError, "Crossfire object no longer exists"); \
36  return NULL; \
37  } }
38 
44 #define TYPEEXISTCHECK(ob) { \
45  if (!ob || !PyObject_TypeCheck((PyObject*)ob, &Crossfire_ObjectType) || !ob->obj || (object_was_destroyed(ob->obj, ob->obj->count))) { \
46  PyErr_SetString(PyExc_ReferenceError, "Not a Crossfire object or Crossfire object no longer exists"); \
47  return NULL; \
48  } }
49 
50 #define EXISTCHECK_INT(ob) { \
51  if (!ob || !ob->obj || (object_was_destroyed(ob->obj, ob->obj->count))) { \
52  PyErr_SetString(PyExc_ReferenceError, "Crossfire object no longer exists"); \
53  return -1; \
54  } }
55 
56 /* Table for keeping track of which PyObject goes with with Crossfire object */
58 
59 /* Helper functions for dealing with object_assoc_table */
62 }
63 
64 static void add_object_assoc(object *key, PyObject *value) {
66 }
67 
68 static PyObject *find_assoc_pyobject(object *key) {
69  return (PyObject *)find_assoc_value(object_assoc_table, key);
70 }
71 
72 static void free_object_assoc(object *key) {
74 }
75 
76 static PyObject *Player_GetTitle(Crossfire_Object *whoptr, void *closure) {
77  char title[MAX_NAME];
78  (void)closure;
79  EXISTCHECK(whoptr);
80  return Py_BuildValue("s", cf_player_get_title(whoptr->obj, title, MAX_NAME));
81 }
82 
83 static int Player_SetTitle(Crossfire_Object *whoptr, PyObject *value, void *closure) {
84  char *val;
85  (void)closure;
86 
87  EXISTCHECK_INT(whoptr);
88  if (value == NULL) {
89  PyErr_SetString(PyExc_TypeError, "Cannot delete the Title attribute");
90  return -1;
91  }
92  if (!CF_IS_PYSTR(value)) {
93  PyErr_SetString(PyExc_TypeError, "The Title attribute must be a string");
94  return -1;
95  }
96  if (!PyArg_Parse(value, "s", &val))
97  return -1;
98 
99  cf_player_set_title(whoptr->obj, val);
100  return 0;
101 }
102 
103 static PyObject *Player_GetIP(Crossfire_Player *whoptr, void *closure) {
104  (void)closure;
105  EXISTCHECK(whoptr);
106  return Py_BuildValue("s", cf_player_get_ip(whoptr->obj));
107 }
108 
109 static PyObject *Player_GetMarkedItem(Crossfire_Player *whoptr, void *closure) {
110  (void)closure;
111  EXISTCHECK(whoptr);
113 }
114 
115 static int Player_SetMarkedItem(Crossfire_Player *whoptr, PyObject *value, void *closure) {
117  (void)closure;
118 
119  EXISTCHECK_INT(whoptr);
120  if (value == Py_None)
121  cf_player_set_marked_item(whoptr->obj, NULL);
122  else if (!PyArg_Parse(value, "O!", &Crossfire_ObjectType, &ob))
123  return -1;
124  else
125  cf_player_set_marked_item(whoptr->obj, ob->obj);
126  return 0;
127 }
128 
129 static PyObject *Crossfire_Player_Message(Crossfire_Player *who, PyObject *args) {
130  char *message;
132 
133  EXISTCHECK(who);
134  if (!PyArg_ParseTuple(args, "s|i", &message, &color))
135  return NULL;
136 
138  Py_INCREF(Py_None);
139  return Py_None;
140 }
141 
142 static PyObject *Player_KnowledgeKnown(Crossfire_Player *who, PyObject *args) {
143  const char *knowledge;
144 
145  EXISTCHECK(who);
146  if (!PyArg_ParseTuple(args, "s", &knowledge))
147  return NULL;
148 
149  return Py_BuildValue("i", cf_player_knowledge_has(who->obj, knowledge));
150 }
151 
152 static PyObject *Player_GiveKnowledge(Crossfire_Player *who, PyObject *args) {
153  const char *knowledge;
154 
155  EXISTCHECK(who);
156  if (!PyArg_ParseTuple(args, "s", &knowledge))
157  return NULL;
158 
160 
161  Py_INCREF(Py_None);
162  return Py_None;
163 }
164 
165 static PyObject *Player_GetParty(Crossfire_Player *whoptr, void *closure) {
166  (void)closure;
167  EXISTCHECK(whoptr);
169 }
170 
171 static int Player_SetParty(Crossfire_Player *whoptr, PyObject *value, void *closure) {
173  (void)closure;
174 
175  EXISTCHECK_INT(whoptr);
176  if (!PyArg_Parse(value, "O!", &Crossfire_PartyType, &ob))
177  return -1;
178  cf_player_set_party(whoptr->obj, ob->party);
179  return 0;
180 }
181 
182 static PyObject *Crossfire_Player_CanPay(Crossfire_Player *who, PyObject *args) {
183  (void)args;
184  EXISTCHECK(who);
185  return Py_BuildValue("i", cf_player_can_pay(who->obj));
186 }
187 
188 static PyObject *Player_GetBedMap(Crossfire_Player *whoptr, void *closure) {
189  char bed[200];
190  (void)closure;
191 
192  EXISTCHECK(whoptr);
193  return Py_BuildValue("s", cf_object_get_string_property(whoptr->obj, CFAPI_PLAYER_PROP_BED_MAP, bed, sizeof(bed)));
194 }
195 
196 static int Player_SetBedMap(Crossfire_Player *whoptr, PyObject *value, void *closure) {
197  char *location;
198  (void)closure;
199 
200  EXISTCHECK_INT(whoptr);
201  if (!PyArg_Parse(value, "s", &location))
202  return -1;
204  return 0;
205 }
206 
207 static PyObject *Player_GetBedX(Crossfire_Player *whoptr, void *closure) {
208  (void)closure;
209  EXISTCHECK(whoptr);
210  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_PLAYER_PROP_BED_X));
211 }
212 
213 static int Player_SetBedX(Crossfire_Player *whoptr, PyObject *value, void *closure) {
214  int x;
215  (void)closure;
216 
217  EXISTCHECK_INT(whoptr);
218  if (!PyArg_Parse(value, "i", &x))
219  return -1;
221  return 0;
222 }
223 
224 static PyObject *Player_GetBedY(Crossfire_Player *whoptr, void *closure) {
225  (void)closure;
226  EXISTCHECK(whoptr);
227  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_PLAYER_PROP_BED_Y));
228 }
229 
230 static int Player_SetBedY(Crossfire_Player *whoptr, PyObject *value, void *closure) {
231  int y;
232  (void)closure;
233 
234  EXISTCHECK_INT(whoptr);
235  if (!PyArg_Parse(value, "i", &y))
236  return -1;
238  return 0;
239 }
240 
241 static PyObject *Player_QuestStart(Crossfire_Player *whoptr, PyObject *args) {
242  char *code;
243  int state;
244  sstring quest_code;
245 
246  EXISTCHECK(whoptr);
247  if (!PyArg_ParseTuple(args, "si", &code, &state))
248  return NULL;
249 
250  quest_code = cf_add_string(code);
251  cf_quest_start(whoptr->obj, quest_code, state);
252  cf_free_string(quest_code);
253 
254  Py_INCREF(Py_None);
255  return Py_None;
256 }
257 
258 static PyObject *Player_QuestGetState(Crossfire_Player *whoptr, PyObject *args) {
259  char *code;
260  int state;
261  sstring quest_code;
262 
263  EXISTCHECK(whoptr);
264  if (!PyArg_ParseTuple(args, "s", &code))
265  return NULL;
266 
267  quest_code = cf_add_string(code);
268  state = cf_quest_get_player_state(whoptr->obj, quest_code);
269  cf_free_string(quest_code);
270 
271  return Py_BuildValue("i", state);
272 }
273 
274 static PyObject *Player_QuestSetState(Crossfire_Player *whoptr, PyObject *args) {
275  char *code;
276  int state;
277  sstring quest_code;
278 
279  EXISTCHECK(whoptr);
280  if (!PyArg_ParseTuple(args, "si", &code, &state))
281  return NULL;
282 
283  quest_code = cf_add_string(code);
284  cf_quest_set_player_state(whoptr->obj, quest_code, state);
285  cf_free_string(quest_code);
286 
287  Py_INCREF(Py_None);
288  return Py_None;
289 }
290 
291 static PyObject *Player_QuestWasCompleted(Crossfire_Player *whoptr, PyObject *args) {
292  char *code;
293  int completed;
294  sstring quest_code;
295 
296  EXISTCHECK(whoptr);
297  if (!PyArg_ParseTuple(args, "s", &code))
298  return NULL;
299 
300  quest_code = cf_add_string(code);
301  completed = cf_quest_was_completed(whoptr->obj, quest_code);
302  cf_free_string(quest_code);
303 
304  return Py_BuildValue("i", completed);
305 }
306 
307 /* Object properties. Get and maybe set. */
308 static PyObject *Object_GetSStringProperty(Crossfire_Object *whoptr, void *closure) {
309  (void)closure;
310  EXISTCHECK(whoptr);
311  return Py_BuildValue("s", cf_object_get_sstring_property(whoptr->obj, (int)(intptr_t)closure));
312 }
313 
314 static PyObject *Object_GetIntProperty(Crossfire_Object *whoptr, void *closure) {
315  (void)closure;
316  EXISTCHECK(whoptr);
317  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, (int)(intptr_t)closure));
318 }
319 
320 static PyObject *Object_GetFloatProperty(Crossfire_Object *whoptr, void *closure) {
321  (void)closure;
322  EXISTCHECK(whoptr);
323  return Py_BuildValue("f", cf_object_get_float_property(whoptr->obj, (int)(intptr_t)closure));
324 }
325 
326 static PyObject *Object_GetFlagProperty(Crossfire_Object *whoptr, void *closure) {
327  (void)closure;
328  EXISTCHECK(whoptr);
329  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, (int)(intptr_t)closure));
330 }
331 
332 static PyObject *Object_GetObjectProperty(Crossfire_Object *whoptr, void *closure) {
333  object *op;
334  (void)closure;
335 
336  EXISTCHECK(whoptr);
337  op = cf_object_get_object_property(whoptr->obj, (int)(intptr_t)closure);
338  return Crossfire_Object_wrap(op);
339 }
340 
341 static PyObject *Object_GetName(Crossfire_Object *whoptr, void *closure) {
342  char name[200];
343  (void)closure;
344 
345  EXISTCHECK(whoptr);
346  return Py_BuildValue("s", cf_query_name(whoptr->obj, name, sizeof(name)));
347 }
348 
349 static PyObject *Object_GetNamePl(Crossfire_Object *whoptr, void *closure) {
350  (void)closure;
351  EXISTCHECK(whoptr);
352  return Py_BuildValue("s", (char *)cf_query_name_pl(whoptr->obj));
353 }
354 
355 static PyObject *Object_GetMap(Crossfire_Object *whoptr, void *closure) {
356  mapstruct *m;
357  (void)closure;
358 
359  EXISTCHECK(whoptr);
361  return Crossfire_Map_wrap(m);
362 }
363 
364 static PyObject *Object_GetExp(Crossfire_Object *whoptr, void *closure) {
365  (void)closure;
366  EXISTCHECK(whoptr);
367  return Py_BuildValue("L", cf_object_get_int64_property(whoptr->obj, CFAPI_OBJECT_PROP_EXP));
368 }
369 
370 static PyObject *Object_GetTotalExp(Crossfire_Object *whoptr, void *closure) {
371  (void)closure;
372  EXISTCHECK(whoptr);
373  return Py_BuildValue("L", cf_object_get_int64_property(whoptr->obj, CFAPI_OBJECT_PROP_TOTAL_EXP));
374 }
375 
376 static PyObject *Object_GetExpMul(Crossfire_Object *whoptr, void *closure) {
377  (void)closure;
378  EXISTCHECK(whoptr);
379  return Py_BuildValue("d", cf_object_get_double_property(whoptr->obj, CFAPI_OBJECT_PROP_EXP_MULTIPLIER));
380 }
381 
382 static PyObject *Object_GetPickable(Crossfire_Object *whoptr, void *closure) {
383  (void)closure;
384  EXISTCHECK(whoptr);
385  return Py_BuildValue("i", !cf_object_get_flag(whoptr->obj, FLAG_NO_PICK));
386 }
387 
388 static PyObject *Object_GetMoney(Crossfire_Object *whoptr, void *closure) {
389  (void)closure;
390  EXISTCHECK(whoptr);
391  return Py_BuildValue("i", cf_object_query_money(whoptr->obj));
392 }
393 
394 static PyObject *Object_GetValue(Crossfire_Object *whoptr, void *closure) {
395  (void)closure;
396  EXISTCHECK(whoptr);
397  return Py_BuildValue("l", cf_object_get_long_property(whoptr->obj, CFAPI_OBJECT_PROP_VALUE));
398 }
399 
400 static PyObject *Object_GetArchetype(Crossfire_Object *whoptr, void *closure) {
401  (void)closure;
402  EXISTCHECK(whoptr);
404 }
405 
406 static PyObject *Object_GetOtherArchetype(Crossfire_Object *whoptr, void *closure) {
407  (void)closure;
408  EXISTCHECK(whoptr);
410 }
411 
412 static PyObject *Object_GetExists(Crossfire_Object *whoptr, void *closure) {
413  (void)closure;
414  if (!object_was_destroyed(whoptr->obj, whoptr->obj->count)) {
415  Py_INCREF(Py_True);
416  return Py_True;
417  } else {
418  Py_INCREF(Py_False);
419  return Py_False;
420  }
421 }
422 
423 static PyObject *Object_GetMoveType(Crossfire_Object *whoptr, void *closure) {
424  (void)closure;
425  EXISTCHECK(whoptr);
426  return Py_BuildValue("i", cf_object_get_movetype_property(whoptr->obj, CFAPI_OBJECT_PROP_MOVE_TYPE));
427 }
428 
429 static PyObject *Object_GetMoveBlock(Crossfire_Object *whoptr, void *closure) {
430  (void)closure;
431  EXISTCHECK(whoptr);
432  return Py_BuildValue("i", cf_object_get_movetype_property(whoptr->obj, CFAPI_OBJECT_PROP_MOVE_BLOCK));
433 }
434 
435 static PyObject *Object_GetMoveAllow(Crossfire_Object *whoptr, void *closure) {
436  (void)closure;
437  EXISTCHECK(whoptr);
438  return Py_BuildValue("i", cf_object_get_movetype_property(whoptr->obj, CFAPI_OBJECT_PROP_MOVE_ALLOW));
439 }
440 
441 static PyObject *Object_GetMoveOn(Crossfire_Object *whoptr, void *closure) {
442  (void)closure;
443  EXISTCHECK(whoptr);
444  return Py_BuildValue("i", cf_object_get_movetype_property(whoptr->obj, CFAPI_OBJECT_PROP_MOVE_ON));
445 }
446 
447 static PyObject *Object_GetMoveOff(Crossfire_Object *whoptr, void *closure) {
448  (void)closure;
449  EXISTCHECK(whoptr);
450  return Py_BuildValue("i", cf_object_get_movetype_property(whoptr->obj, CFAPI_OBJECT_PROP_MOVE_OFF));
451 }
452 
453 static PyObject *Object_GetMoveSlow(Crossfire_Object *whoptr, void *closure) {
454  (void)closure;
455  EXISTCHECK(whoptr);
456  return Py_BuildValue("i", cf_object_get_movetype_property(whoptr->obj, CFAPI_OBJECT_PROP_MOVE_SLOW));
457 }
458 
459 static PyObject *Object_GetMaterial(Crossfire_Object *whoptr, void *closure) {
460  (void)closure;
461  EXISTCHECK(whoptr);
462  return Py_BuildValue("{s:s,s:i}", "Name", cf_object_get_sstring_property(whoptr->obj, CFAPI_OBJECT_PROP_MATERIAL_NAME), "Number", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_MATERIAL));
463 }
464 
466 static int Object_SetStringProperty(Crossfire_Object *whoptr, PyObject *value, void *closure) {
467  char *val;
468 
469  EXISTCHECK_INT(whoptr);
470  if (value == NULL) {
471  PyErr_SetString(PyExc_TypeError, "Cannot delete the attribute");
472  return -1;
473  }
474  if (!CF_IS_PYSTR(value)) {
475  PyErr_SetString(PyExc_TypeError, "The attribute must be a string");
476  return -1;
477  }
478  if (!PyArg_Parse(value, "s", &val))
479  return -1;
480 
481  cf_object_set_string_property(whoptr->obj, (int)(intptr_t)closure, val);
482  return 0;
483 }
484 
485 static int Object_SetIntProperty(Crossfire_Object *whoptr, PyObject *value, void *closure) {
486  int val;
487 
488  EXISTCHECK_INT(whoptr);
489  if (!PyArg_Parse(value, "i", &val))
490  return -1;
491 
492  cf_object_set_int_property(whoptr->obj, (int)(intptr_t)closure, val);
493  return 0;
494 }
495 
496 static int Object_SetFloatProperty(Crossfire_Object *whoptr, PyObject *value, void *closure) {
497  float val;
498 
499  EXISTCHECK_INT(whoptr);
500  if (!PyArg_Parse(value, "f", &val))
501  return -1;
502 
503  cf_object_set_float_property(whoptr->obj, (int)(intptr_t)closure, val);
504  return 0;
505 }
506 
507 static int Object_SetFlagProperty(Crossfire_Object *whoptr, PyObject *value, void *closure) {
508  int val;
509 
510  EXISTCHECK_INT(whoptr);
511  if (!PyArg_Parse(value, "i", &val))
512  return -1;
513 
514  cf_object_set_flag(whoptr->obj, (int)(intptr_t)closure, val);
515  return 0;
516 }
517 
518 static int Object_SetName(Crossfire_Object *whoptr, PyObject *value, void *closure) {
519  char *val;
520  (void)closure;
521 
522  EXISTCHECK_INT(whoptr);
523  if (value == NULL) {
524  PyErr_SetString(PyExc_TypeError, "Cannot delete the Name attribute");
525  return -1;
526  }
527  if (!CF_IS_PYSTR(value)) {
528  PyErr_SetString(PyExc_TypeError, "The Name attribute must be a string");
529  return -1;
530  }
531  if (!PyArg_Parse(value, "s", &val))
532  return -1;
533 
536  return 0;
537 }
538 
539 static int Object_SetNamePl(Crossfire_Object *whoptr, PyObject *value, void *closure) {
540  char *val;
541  (void)closure;
542 
543  EXISTCHECK_INT(whoptr);
544  if (value == NULL) {
545  PyErr_SetString(PyExc_TypeError, "Cannot delete the NamePl attribute");
546  return -1;
547  }
548  if (!CF_IS_PYSTR(value)) {
549  PyErr_SetString(PyExc_TypeError, "The NamePl attribute must be a string");
550  return -1;
551  }
552  if (!PyArg_Parse(value, "s", &val))
553  return -1;
554 
556  return 0;
557 }
558 
559 static int Object_SetPickable(Crossfire_Object *whoptr, PyObject *value, void *closure) {
560  int val;
561  (void)closure;
562 
563  EXISTCHECK_INT(whoptr);
564  if (!PyArg_Parse(value, "i", &val))
565  return -1;
566 
567  cf_object_set_flag(whoptr->obj, FLAG_NO_PICK, !val);
568  return 0;
569 }
570 
571 static int Object_SetMap(Crossfire_Object *whoptr, PyObject *value, void *closure) {
572  Crossfire_Map *val;
573  (void)closure;
574 
575  EXISTCHECK_INT(whoptr);
576  if (!PyArg_Parse(value, "O!", &Crossfire_MapType, &val))
577  return -1;
578 
579  cf_object_change_map(whoptr->obj, val->map, NULL, 0, -1, -1);
580  return 0;
581 }
582 
583 static int Object_SetQuantity(Crossfire_Object *whoptr, PyObject *value, void *closure) {
584  int val;
585  (void)closure;
586 
587  EXISTCHECK_INT(whoptr);
588  if (!PyArg_Parse(value, "i", &val))
589  return -1;
590 
591  if (cf_object_set_nrof(whoptr->obj, val) != 0) {
592  PyErr_SetString(PyExc_TypeError, "Invalid quantity");
593  return -1;
594  }
595 
596 /* cf_fix_object(whoptr->obj);*/
597  return 0;
598 }
599 
600 static int Object_SetFace(Crossfire_Object *whoptr, PyObject *value, void *closure) {
601  char *face;
602  (void)closure;
603 
604  EXISTCHECK_INT(whoptr);
605  if (!PyArg_Parse(value, "s", &face))
606  return -1;
607 
608  if (!cf_object_set_face(whoptr->obj, face)) {
609  PyErr_SetString(PyExc_TypeError, "Unknown face.");
610  return -1;
611  }
612  return 0;
613 }
614 
615 static int Object_SetAnim(Crossfire_Object *whoptr, PyObject *value, void *closure) {
616  char *anim;
617  (void)closure;
618 
619  EXISTCHECK_INT(whoptr);
620  if (!PyArg_Parse(value, "s", &anim))
621  return -1;
622 
623  if (!cf_object_set_animation(whoptr->obj, anim)) {
624  PyErr_SetString(PyExc_TypeError, "Unknown animation.");
625  return -1;
626  }
627 
628  return 0;
629 }
630 
631 static int Object_SetValue(Crossfire_Object *whoptr, PyObject *value, void *closure) {
632  long val;
633  (void)closure;
634 
635  EXISTCHECK_INT(whoptr);
636  if (!PyArg_Parse(value, "l", &val))
637  return -1;
638 
640  return 0;
641 }
642 
643 static int Object_SetOwner(Crossfire_Object *whoptr, PyObject *value, void *closure) {
645  (void)closure;
646 
647  EXISTCHECK_INT(whoptr);
648  if (!PyArg_Parse(value, "O!", &Crossfire_ObjectType, &ob))
649  return -1;
651  return 0;
652 }
653 
654 static int Object_SetEnemy(Crossfire_Object *whoptr, PyObject *value, void *closure) {
656  (void)closure;
657 
658  EXISTCHECK_INT(whoptr);
659  if (!PyArg_Parse(value, "O!", &Crossfire_ObjectType, &ob))
660  return -1;
662  return 0;
663 }
664 
665 static int Object_SetExp(Crossfire_Object *whoptr, PyObject *value, void *closure) {
666  int64_t val;
667  (void)closure;
668 
669  EXISTCHECK_INT(whoptr);
670  if (!PyArg_Parse(value, "L", &val))
671  return -1;
672 
674  return 0;
675 }
676 
677 static int Object_SetMoveType(Crossfire_Object *whoptr, PyObject *value, void *closure) {
678  MoveType move;
679  (void)closure;
680 
681  EXISTCHECK_INT(whoptr);
682  if (!PyArg_Parse(value, "B", &move))
683  return -1;
685  return 0;
686 }
687 
688 static int Object_SetMoveBlock(Crossfire_Object *whoptr, PyObject *value, void *closure) {
689  MoveType move;
690  (void)closure;
691 
692  EXISTCHECK_INT(whoptr);
693  if (!PyArg_Parse(value, "B", &move))
694  return -1;
696  return 0;
697 }
698 
699 static int Object_SetMoveAllow(Crossfire_Object *whoptr, PyObject *value, void *closure) {
700  MoveType move;
701  (void)closure;
702 
703  EXISTCHECK_INT(whoptr);
704  if (!PyArg_Parse(value, "B", &move))
705  return -1;
707  return 0;
708 }
709 
710 static int Object_SetMoveOn(Crossfire_Object *whoptr, PyObject *value, void *closure) {
711  MoveType move;
712  (void)closure;
713 
714  EXISTCHECK_INT(whoptr);
715  if (!PyArg_Parse(value, "B", &move))
716  return -1;
718  return 0;
719 }
720 
721 static int Object_SetMoveOff(Crossfire_Object *whoptr, PyObject *value, void *closure) {
722  MoveType move;
723  (void)closure;
724 
725  EXISTCHECK_INT(whoptr);
726  if (!PyArg_Parse(value, "B", &move))
727  return -1;
729  return 0;
730 }
731 
732 static int Object_SetMoveSlow(Crossfire_Object *whoptr, PyObject *value, void *closure) {
733  MoveType move;
734  (void)closure;
735 
736  EXISTCHECK_INT(whoptr);
737  if (!PyArg_Parse(value, "B", &move))
738  return -1;
740  return 0;
741 }
742 
743 /* Methods. */
744 
745 static PyObject *Crossfire_Object_Remove(Crossfire_Object *who, PyObject *args) {
746  (void)args;
747  EXISTCHECK(who);
748 
749  if ((current_context->who != NULL) && (((Crossfire_Object *)current_context->who)->obj == who->obj))
750  current_context->who = NULL;
751 
752  if (!cf_object_get_flag(who->obj, FLAG_REMOVED)) {
753  cf_object_remove(who->obj);
754  }
755 
757  Py_INCREF(Py_None);
758  return Py_None;
759 }
760 
761 static PyObject *Crossfire_Object_Apply(Crossfire_Object *who, PyObject *args) {
762  Crossfire_Object *whoptr;
763  int flags;
764 
765  if (!PyArg_ParseTuple(args, "O!i", &Crossfire_ObjectType, &whoptr, &flags))
766  return NULL;
767  EXISTCHECK(who);
768  EXISTCHECK(whoptr);
769 
770  return Py_BuildValue("i", cf_object_apply(whoptr->obj, who->obj, flags));
771 }
772 
773 static PyObject *Crossfire_Object_Drop(Crossfire_Object *who, PyObject *args) {
774  /* Note that this function uses the METH_O calling convention. */
776 
777  EXISTCHECK(who);
778  TYPEEXISTCHECK(whoptr);
779 
780  cf_object_drop(whoptr->obj, who->obj);
781  Py_INCREF(Py_None);
782  return Py_None;
783 }
784 
785 static PyObject *Crossfire_Object_Clone(Crossfire_Object *who, PyObject *args) {
786  int clone_type;
787  object *clone;
788 
789  if (!PyArg_ParseTuple(args, "i", &clone_type))
790  return NULL;
791 
792  if (clone_type != 0 && clone_type != 1)
793  {
794  PyErr_SetString(PyExc_ValueError, "Clone type must be 0 (object_create_clone) or 1 (object_copy).");
795  return NULL;
796  }
797 
798  clone = cf_object_clone(who->obj, clone_type);
799 
800  if (clone == NULL)
801  {
802  PyErr_SetString(PyExc_RuntimeError, "Clone failed.");
803  return NULL;
804  }
805 
806  return Crossfire_Object_wrap(clone);
807 }
808 
809 static PyObject *Crossfire_Object_Split(Crossfire_Object *who, PyObject *args) {
810  int count;
811  char err[255];
812  object *split;
813 
814  err[0] = '\0'; /* Just in case. */
815 
816  if (!PyArg_ParseTuple(args, "i", &count))
817  return NULL;
818 
819  split = cf_object_split(who->obj, count, err, 255);
820 
821  if (split == NULL)
822  {
823  PyErr_SetString(PyExc_ValueError, err);
824  return NULL;
825  }
826 
828 }
829 
830 static PyObject *Crossfire_Object_Fix(Crossfire_Object *who, PyObject *args) {
831  (void)args;
832  cf_fix_object(who->obj);
833  Py_INCREF(Py_None);
834  return Py_None;
835 }
836 
837 static PyObject *Crossfire_Object_Take(Crossfire_Object *who, PyObject *args) {
838  /* Note that this function uses the METH_O calling convention. */
840 
841  EXISTCHECK(who);
842  TYPEEXISTCHECK(whoptr);
843 
844  cf_object_pickup(who->obj, whoptr->obj);
845  Py_INCREF(Py_None);
846  return Py_None;
847 }
848 
849 static PyObject *Crossfire_Object_Teleport(Crossfire_Object *who, PyObject *args) {
851  int x, y;
852  int val;
853 
854  EXISTCHECK(who);
855  if (!PyArg_ParseTuple(args, "O!ii", &Crossfire_MapType, &where, &x, &y))
856  return NULL;
857 
858  val = cf_object_teleport(who->obj, where->map, x, y);
859 
860  return Py_BuildValue("i", val);
861 }
862 
864  /* Note that this function uses the METH_O calling convention. */
865  object *trap;
866  object *victim;
868 
869  EXISTCHECK(who);
870  TYPEEXISTCHECK(pcause);
871  trap = who->obj;
872  victim = pcause->obj;
873  cf_spring_trap(trap, victim);
874  Py_INCREF(Py_None);
875  return Py_None;
876 }
877 
879  /* Note that this function uses the METH_O calling convention. */
880  object *trigger;
881  object *cause;
882  int result;
884 
885  EXISTCHECK(who);
886  TYPEEXISTCHECK(pcause);
887  trigger = who->obj;
888  cause = pcause->obj;
890 
891  return Py_BuildValue("i", result);
892 }
893 
894 static PyObject *Crossfire_Object_Say(Crossfire_Object *who, PyObject *args) {
895  char *message, buf[2048];
896 
897  EXISTCHECK(who);
898  if (!PyArg_ParseTuple(args, "s", &message))
899  return NULL;
900 
901  /* compatibility */
902  if (current_context->talk == NULL) {
903  cf_object_say(who->obj, message);
904  Py_INCREF(Py_None);
905  return Py_None;
906  }
907 
909  PyErr_SetString(PyExc_ValueError, "too many NPCs");
910  return NULL;
911  }
912 
913  if (strlen(message) >= sizeof(buf) - 1)
914  cf_log(llevError, "warning, too long message in npcSay, will be truncated");
916  snprintf(buf, sizeof(buf), "%s says: %s", who->obj->name, message);
917 
920 
921  Py_INCREF(Py_None);
922  return Py_None;
923 
924 }
925 
926 static PyObject *Crossfire_Object_Reposition(Crossfire_Object *who, PyObject *args) {
927  int x, y;
928 
929  EXISTCHECK(who);
930  if (!PyArg_ParseTuple(args, "ii", &x, &y))
931  return NULL;
932 
933  cf_object_transfer(who->obj, x, y, 0, NULL);
934  Py_INCREF(Py_None);
935  return Py_None;
936 }
937 
938 static PyObject *Crossfire_Object_QueryName(Crossfire_Object *who, PyObject *args) {
939  char name[200];
940  (void)args;
941 
942  EXISTCHECK(who);
943  return Py_BuildValue("s", cf_query_name(who->obj, name, sizeof(name)));
944 }
945 
946 static PyObject *Crossfire_Object_GetResist(Crossfire_Object *who, PyObject *args) {
947  int resist;
948 
949  EXISTCHECK(who);
950  if (!PyArg_ParseTuple(args, "i", &resist))
951  return NULL;
952  if ((resist < 0) || (resist >= NROFATTACKS)) {
953  return Py_BuildValue("l", 0);
954  }
955  return Py_BuildValue("i", cf_object_get_resistance(who->obj, resist));
956 }
957 
958 static PyObject *Crossfire_Object_SetResist(Crossfire_Object *who, PyObject *args) {
959  int resist, value;
960 
961  EXISTCHECK(who);
962  if (!PyArg_ParseTuple(args, "ii", &resist, &value))
963  return NULL;
964  if ((resist >= 0) && (resist < NROFATTACKS))
965  cf_object_set_resistance(who->obj, resist, value);
966  Py_INCREF(Py_None);
967  return Py_None;
968 }
969 
970 static PyObject *Crossfire_Object_Cast(Crossfire_Object *who, PyObject *args) {
971  int dir;
972  char *op;
973  Crossfire_Object *pspell;
974 
975  if (!PyArg_ParseTuple(args, "O!is", &Crossfire_ObjectType, &pspell, &dir, &op))
976  return NULL;
977  EXISTCHECK(who);
978  EXISTCHECK(pspell);
979 
980  cf_object_cast_spell(who->obj, who->obj, dir, pspell->obj, op);
981 
982  Py_INCREF(Py_None);
983  return Py_None;
984 }
985 
986 static PyObject *Crossfire_Object_LearnSpell(Crossfire_Object *who, PyObject *args) {
987  /* Note that this function uses the METH_O calling convention. */
989 
990  EXISTCHECK(who);
991  TYPEEXISTCHECK(pspell);
992 
993  cf_object_learn_spell(who->obj, pspell->obj, 0);
994 
995  Py_INCREF(Py_None);
996  return Py_None;
997 }
998 
999 static PyObject *Crossfire_Object_ForgetSpell(Crossfire_Object *who, PyObject *args) {
1000  /* Note that this function uses the METH_O calling convention. */
1002 
1003  EXISTCHECK(who);
1004  TYPEEXISTCHECK(pspell);
1005 
1006  cf_object_forget_spell(who->obj, pspell->obj);
1007  Py_INCREF(Py_None);
1008  return Py_None;
1009 }
1010 
1011 static PyObject *Crossfire_Object_KnowSpell(Crossfire_Object *who, PyObject *args) {
1012  char *spellname;
1013  object *op;
1014 
1015  EXISTCHECK(who);
1016  if (!PyArg_ParseTuple(args, "s", &spellname))
1017  return NULL;
1018 
1019  op = cf_object_check_for_spell(who->obj, spellname);
1020 
1021  return Crossfire_Object_wrap(op);
1022 }
1023 
1025  Crossfire_Object *pspell;
1026  int dir;
1027  char *str;
1028 
1029  if (!PyArg_ParseTuple(args, "O!is", &Crossfire_ObjectType, &pspell, &dir, &str))
1030  return NULL;
1031  EXISTCHECK(who);
1032  EXISTCHECK(pspell);
1033 
1034  cf_log_plain(llevError, "CastAbility is deprecated and will be removed, use 'Cast'.\n");
1035  cf_object_cast_spell(who->obj, who->obj, dir, pspell->obj, str);
1036 
1037  Py_INCREF(Py_None);
1038  return Py_None;
1039 }
1040 
1041 static PyObject *Crossfire_Object_PayAmount(Crossfire_Object *who, PyObject *args) {
1042  uint64_t to_pay;
1043  int val;
1044 
1045  EXISTCHECK(who);
1046  if (!PyArg_ParseTuple(args, "L", &to_pay))
1047  return NULL;
1048 
1049  val = cf_object_pay_amount(who->obj, to_pay);
1050 
1051  return Py_BuildValue("i", val);
1052 }
1053 
1054 static PyObject *Crossfire_Object_Pay(Crossfire_Object *who, PyObject *args) {
1055  /* Note that this function uses the METH_O calling convention. */
1057  int val;
1058 
1059  EXISTCHECK(who);
1060  TYPEEXISTCHECK(op);
1061 
1062  val = cf_object_pay_item(who->obj, op->obj);
1063 
1064  return Py_BuildValue("i", val);
1065 }
1066 
1067 static PyObject *Crossfire_Object_ReadKey(Crossfire_Object *who, PyObject *args) {
1068  const char *val;
1069  char *keyname;
1070 
1071  EXISTCHECK(who);
1072  if (!PyArg_ParseTuple(args, "s", &keyname))
1073  return NULL;
1074 
1075  val = cf_object_get_key(who->obj, keyname);
1076 
1077  return Py_BuildValue("s", val ? val : "");
1078 }
1079 
1080 static PyObject *Crossfire_Object_WriteKey(Crossfire_Object *who, PyObject *args) {
1081  char *keyname;
1082  char *value;
1083  int add_key = 0;
1084 
1085  EXISTCHECK(who);
1086  if (!PyArg_ParseTuple(args, "sz|i", &keyname, &value, &add_key))
1087  return NULL;
1088 
1089  return Py_BuildValue("i", cf_object_set_key(who->obj, keyname, value, add_key));
1090 }
1091 
1093  int mode;
1094  long delay;
1095 
1096  EXISTCHECK(who);
1097  if (!PyArg_ParseTuple(args, "li", &delay, &mode))
1098  return NULL;
1099 
1100  return Py_BuildValue("i", cf_timer_create(who->obj, delay, mode));
1101 }
1102 
1104  char *whatstr;
1105  object *foundob;
1106 
1107  EXISTCHECK(who);
1108  if (!PyArg_ParseTuple(args, "s", &whatstr))
1109  return NULL;
1110 
1111  foundob = cf_object_present_archname_inside(who->obj, whatstr);
1112 
1113  return Crossfire_Object_wrap(foundob);
1114 /* FOR_INV_PREPARE(WHO, tmp) {
1115  if (!strncmp(PyQueryName(tmp), whatstr, strlen(whatstr))) {
1116  return Py_BuildValue("l", (long)(tmp));
1117  }
1118  if (!strncmp(tmp->name, whatstr, strlen(whatstr))) {
1119  return Py_BuildValue("l", (long)(tmp));
1120  }
1121  } FOR_INV_FINISH();
1122 
1123  return Py_BuildValue("l", (long)0);*/
1124 }
1125 
1127  char *whatstr;
1128  object *tmp;
1129 
1130  EXISTCHECK(who);
1131  if (!PyArg_ParseTuple(args, "s", &whatstr))
1132  return NULL;
1133 
1134  tmp = cf_object_find_by_arch_name(who->obj, whatstr);
1135  return Crossfire_Object_wrap(tmp);
1136 }
1137 
1139  int x, y;
1140 
1141  EXISTCHECK(who);
1142  if (!PyArg_ParseTuple(args, "ii", &x, &y))
1143  return NULL;
1144 
1145  return Py_BuildValue("i", cf_object_out_of_map(who->obj, x, y));
1146 }
1147 
1149  char *txt;
1150  object *myob;
1151 
1152  EXISTCHECK(who);
1153  if (!PyArg_ParseTuple(args, "s", &txt))
1154  return NULL;
1155 
1156  myob = cf_create_object_by_name(txt);
1157  if (myob)
1158  myob = cf_object_insert_object(myob, who->obj);
1159 
1160  return Crossfire_Object_wrap(myob);
1161 }
1162 
1163 static PyObject *Crossfire_Object_InsertInto(Crossfire_Object *who, PyObject *args) {
1164  /* Note that this function uses the METH_O calling convention. */
1166  object *myob;
1167 
1168  EXISTCHECK(who);
1169  TYPEEXISTCHECK(op);
1170 
1171  /* we can only insert removed object, so first remove it
1172  * from it's current container
1173  */
1174  if (!cf_object_get_flag(who->obj, FLAG_REMOVED)) {
1175  cf_object_remove(who->obj);
1176  }
1177  myob = cf_object_insert_in_ob(who->obj, op->obj);
1178 
1179  return Crossfire_Object_wrap(myob);
1180 }
1181 
1182 static PyObject *Crossfire_Object_ChangeAbil(Crossfire_Object *who, PyObject *args) {
1183  /* Note that this function uses the METH_O calling convention. */
1185 
1186  EXISTCHECK(who);
1187  TYPEEXISTCHECK(op);
1188 
1189  return Py_BuildValue("i", cf_object_change_abil(who->obj, op->obj));
1190 }
1191 
1192 static PyObject *Crossfire_Object_AddExp(Crossfire_Object *who, PyObject *args) {
1193  int64_t exp;
1194  const char *skill = NULL;
1195  int arg = 0;
1196 
1197  if (!PyArg_ParseTuple(args, "L|si", &exp, &skill, &arg))
1198  return NULL;
1199  EXISTCHECK(who);
1200  cf_object_change_exp(who->obj, exp, skill, arg);
1201  Py_INCREF(Py_None);
1202  return Py_None;
1203 }
1204 
1205 static PyObject *Crossfire_Object_PermExp(Crossfire_Object *who, PyObject *args) {
1206  (void)args;
1207  EXISTCHECK(who);
1208  return Py_BuildValue("L", cf_object_perm_exp(who->obj));
1209 }
1210 
1211 static PyObject *Crossfire_Object_Move(Crossfire_Object *who, PyObject *args) {
1212  int dir;
1213 
1214  if (!PyArg_ParseTuple(args, "i", &dir))
1215  return NULL;
1216  EXISTCHECK(who);
1217  return Py_BuildValue("i", cf_object_move(who->obj, dir, who->obj));
1218 }
1219 
1220 static PyObject *Crossfire_Object_MoveTo(Crossfire_Object *who, PyObject *args) {
1221  int x,y;
1222 
1223  if (!PyArg_ParseTuple(args, "ii", &x, &y))
1224  return NULL;
1225  EXISTCHECK(who);
1226  return Py_BuildValue("i", cf_object_move_to(who->obj, x, y));
1227 }
1228 
1229 static PyObject *Crossfire_Object_Event(Crossfire_Object *who, PyObject *args) {
1230  int fix;
1231  const char *message = NULL;
1232  object *op1 = NULL;
1233  object *op2 = NULL;
1234  object *op3 = NULL;
1235  Crossfire_Object *activator = NULL;
1236  Crossfire_Object *third = NULL;
1237 
1238  if (!PyArg_ParseTuple(args, "O!O!si", &Crossfire_ObjectType, &activator, &Crossfire_ObjectType, &third, &message, &fix))
1239  return NULL;
1240  EXISTCHECK(who);
1242  EXISTCHECK(third);
1243  op1 = who->obj;
1244  op2 = activator->obj;
1245  op3 = third->obj;
1246  return Py_BuildValue("i", cf_object_user_event(op1, op2, op3, message, fix));
1247 }
1248 
1250  int level;
1251 
1252  if (!PyArg_ParseTuple(args, "i", &level))
1253  return NULL;
1254  EXISTCHECK(who);
1255 
1256  return Py_BuildValue("i", cf_object_remove_depletion(who->obj, level));
1257 }
1258 
1259 static PyObject *Crossfire_Object_Arrest(Crossfire_Object *who, PyObject *args) {
1260  (void)args;
1261  EXISTCHECK(who);
1262  return Py_BuildValue("i", cf_player_arrest(who->obj));
1263 }
1264 
1266  EXISTCHECK_INT(left);
1267  EXISTCHECK_INT(right);
1268  return (left->obj < right->obj ? -1 : (left->obj == right->obj ? 0 : 1));
1269 }
1270 
1272  int result;
1273  if (!left
1274  || !right
1275  || !PyObject_TypeCheck((PyObject*)left, &Crossfire_ObjectType)
1276  || !PyObject_TypeCheck((PyObject*)right, &Crossfire_ObjectType)) {
1277  Py_INCREF(Py_NotImplemented);
1278  return Py_NotImplemented;
1279  }
1281  /* Handle removed objects. */
1282  if (result == -1 && PyErr_Occurred())
1283  return NULL;
1284  /* Based on how Python 3.0 (GPL compatible) implements it for internal types: */
1285  switch (op) {
1286  case Py_EQ:
1287  result = (result == 0);
1288  break;
1289  case Py_NE:
1290  result = (result != 0);
1291  break;
1292  case Py_LE:
1293  result = (result <= 0);
1294  break;
1295  case Py_GE:
1296  result = (result >= 0);
1297  break;
1298  case Py_LT:
1299  result = (result == -1);
1300  break;
1301  case Py_GT:
1302  result = (result == 1);
1303  break;
1304  }
1305  return PyBool_FromLong(result);
1306 }
1307 
1308 /* Legacy code: convert to long so that non-object functions work correctly */
1309 static PyObject *Crossfire_Object_Long(PyObject *obj) {
1310  return Py_BuildValue("l", ((Crossfire_Object *)obj)->obj);
1311 }
1312 
1313 /* Python binding */
1314 static PyGetSetDef Object_getseters[] = {
1315  { "Name", (getter)Object_GetName, (setter)Object_SetName, NULL, NULL },
1316  { "NamePl", (getter)Object_GetNamePl, (setter)Object_SetNamePl, NULL, NULL },
1317  { "Title", (getter)Object_GetSStringProperty, (setter)Object_SetStringProperty, NULL, (void*)CFAPI_OBJECT_PROP_TITLE },
1318  { "Race", (getter)Object_GetSStringProperty, (setter)Object_SetStringProperty, NULL, (void*)CFAPI_OBJECT_PROP_RACE },
1319  { "Skill", (getter)Object_GetSStringProperty, (setter)Object_SetStringProperty, NULL, (void*)CFAPI_OBJECT_PROP_SKILL },
1320  { "Map", (getter)Object_GetMap, (setter)Object_SetMap, NULL, NULL },
1321  { "Cha", (getter)Object_GetIntProperty, (setter)Object_SetIntProperty, NULL, (void*)CFAPI_OBJECT_PROP_CHA },
1322  { "Con", (getter)Object_GetIntProperty, (setter)Object_SetIntProperty, NULL, (void*)CFAPI_OBJECT_PROP_CON },
1323  { "Dex", (getter)Object_GetIntProperty, (setter)Object_SetIntProperty, NULL, (void*)CFAPI_OBJECT_PROP_DEX },
1324  { "Int", (getter)Object_GetIntProperty, (setter)Object_SetIntProperty, NULL, (void*)CFAPI_OBJECT_PROP_INT },
1325  { "Pow", (getter)Object_GetIntProperty, (setter)Object_SetIntProperty, NULL, (void*)CFAPI_OBJECT_PROP_POW },
1326  { "Str", (getter)Object_GetIntProperty, (setter)Object_SetIntProperty, NULL, (void*)CFAPI_OBJECT_PROP_STR },
1327  { "Wis", (getter)Object_GetIntProperty, (setter)Object_SetIntProperty, NULL, (void*)CFAPI_OBJECT_PROP_WIS },
1328  { "HP", (getter)Object_GetIntProperty, (setter)Object_SetIntProperty, NULL, (void*)CFAPI_OBJECT_PROP_HP },
1329  { "MaxHP", (getter)Object_GetIntProperty, (setter)Object_SetIntProperty, NULL, (void*)CFAPI_OBJECT_PROP_MAXHP },
1330  { "SP", (getter)Object_GetIntProperty, (setter)Object_SetIntProperty, NULL, (void*)CFAPI_OBJECT_PROP_SP },
1331  { "MaxSP", (getter)Object_GetIntProperty, (setter)Object_SetIntProperty, NULL, (void*)CFAPI_OBJECT_PROP_MAXSP },
1332  { "Grace", (getter)Object_GetIntProperty, (setter)Object_SetIntProperty, NULL, (void*)CFAPI_OBJECT_PROP_GP },
1333  { "MaxGrace", (getter)Object_GetIntProperty, (setter)Object_SetIntProperty, NULL, (void*)CFAPI_OBJECT_PROP_MAXGP },
1334  { "Food", (getter)Object_GetIntProperty, (setter)Object_SetIntProperty, NULL, (void*)CFAPI_OBJECT_PROP_FP },
1335  { "AC", (getter)Object_GetIntProperty, (setter)Object_SetIntProperty, NULL, (void*)CFAPI_OBJECT_PROP_AC },
1336  { "WC", (getter)Object_GetIntProperty, (setter)Object_SetIntProperty, NULL, (void*)CFAPI_OBJECT_PROP_WC },
1337  { "Dam", (getter)Object_GetIntProperty, (setter)Object_SetIntProperty, NULL, (void*)CFAPI_OBJECT_PROP_DAM },
1338  { "Luck", (getter)Object_GetIntProperty, NULL, NULL, (void*)CFAPI_OBJECT_PROP_LUCK },
1339  { "Exp", (getter)Object_GetExp, (setter)Object_SetExp, NULL, NULL },
1340  { "ExpMul", (getter)Object_GetExpMul, NULL, NULL, NULL },
1341  { "TotalExp", (getter)Object_GetTotalExp, NULL, NULL, NULL },
1342  { "Message", (getter)Object_GetSStringProperty, (setter)Object_SetStringProperty, NULL, (void*)CFAPI_OBJECT_PROP_MESSAGE },
1343  { "Slaying", (getter)Object_GetSStringProperty, (setter)Object_SetStringProperty, NULL, (void*)CFAPI_OBJECT_PROP_SLAYING },
1344  { "Cursed", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_CURSED },
1345  { "Damned", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_DAMNED },
1346  { "Weight", (getter)Object_GetIntProperty, (setter)Object_SetIntProperty, NULL, (void*)CFAPI_OBJECT_PROP_WEIGHT },
1347  { "WeightLimit", (getter)Object_GetIntProperty, (setter)Object_SetIntProperty, NULL, (void*)CFAPI_OBJECT_PROP_WEIGHT_LIMIT },
1348  { "Above", (getter)Object_GetObjectProperty, NULL, NULL, (void*)CFAPI_OBJECT_PROP_OB_ABOVE },
1349  { "Below", (getter)Object_GetObjectProperty, NULL, NULL, (void*)CFAPI_OBJECT_PROP_OB_BELOW },
1350  { "Inventory", (getter)Object_GetObjectProperty, NULL, NULL, (void*)CFAPI_OBJECT_PROP_INVENTORY },
1351  { "X", (getter)Object_GetIntProperty, NULL, NULL, (void*)CFAPI_OBJECT_PROP_X },
1352  { "Y", (getter)Object_GetIntProperty, NULL, NULL, (void*)CFAPI_OBJECT_PROP_Y },
1353  { "Direction", (getter)Object_GetIntProperty, (setter)Object_SetIntProperty, NULL, (void*)CFAPI_OBJECT_PROP_DIRECTION },
1354  { "Facing", (getter)Object_GetIntProperty, (setter)Object_SetIntProperty, NULL, (void*)CFAPI_OBJECT_PROP_FACING },
1355  { "Unaggressive", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_UNAGGRESSIVE },
1356  { "God", (getter)Object_GetSStringProperty, (setter)Object_SetFlagProperty, NULL, (void*)CFAPI_OBJECT_PROP_GOD },
1357  { "Pickable", (getter)Object_GetPickable, (setter)Object_SetPickable, NULL, NULL },
1358  { "Quantity", (getter)Object_GetIntProperty, (setter)Object_SetQuantity, NULL, (void*)CFAPI_OBJECT_PROP_NROF },
1359  { "Invisible", (getter)Object_GetIntProperty, (setter)Object_SetIntProperty, NULL, (void*)CFAPI_OBJECT_PROP_INVISIBLE },
1360  { "Speed", (getter)Object_GetFloatProperty, (setter)Object_SetFloatProperty, NULL, (void*)CFAPI_OBJECT_PROP_SPEED },
1361  { "SpeedLeft", (getter)Object_GetFloatProperty, (setter)Object_SetFloatProperty, NULL, (void*)CFAPI_OBJECT_PROP_SPEED_LEFT },
1362  { "LastSP", (getter)Object_GetIntProperty, (setter)Object_SetIntProperty, NULL, (void*)CFAPI_OBJECT_PROP_LAST_SP },
1363  { "LastGrace", (getter)Object_GetIntProperty, (setter)Object_SetIntProperty, NULL, (void*)CFAPI_OBJECT_PROP_LAST_GRACE },
1364  { "LastEat", (getter)Object_GetIntProperty, (setter)Object_SetIntProperty, NULL, (void*)CFAPI_OBJECT_PROP_LAST_EAT },
1365  { "Level", (getter)Object_GetIntProperty, (setter)Object_SetIntProperty, NULL, (void*)CFAPI_OBJECT_PROP_LEVEL },
1366  { "Face", (getter)Object_GetSStringProperty, (setter)Object_SetFace, NULL, (void*)CFAPI_OBJECT_PROP_FACE },
1367  { "Anim", (getter)Object_GetSStringProperty, (setter)Object_SetAnim, NULL, (void*)CFAPI_OBJECT_PROP_ANIMATION },
1368  { "AnimSpeed", (getter)Object_GetIntProperty, (setter)Object_SetIntProperty, NULL, (void*)CFAPI_OBJECT_PROP_ANIM_SPEED },
1369  { "AttackType", (getter)Object_GetIntProperty, (setter)Object_SetIntProperty, NULL, (void*)CFAPI_OBJECT_PROP_ATTACK_TYPE },
1370  { "BeenApplied", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_BEEN_APPLIED },
1371  { "Identified", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_IDENTIFIED },
1372  { "Alive", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_ALIVE },
1373  { "DungeonMaster", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_WIZ },
1374  { "WasDungeonMaster", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_WAS_WIZ },
1375  { "Applied", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_APPLIED },
1376  { "Unpaid", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_UNPAID },
1377  { "Monster", (getter)Object_GetFlagProperty, NULL, NULL, (void*)FLAG_MONSTER },
1378  { "Friendly", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_FRIENDLY },
1379  { "Generator", (getter)Object_GetFlagProperty, NULL, NULL, (void*)FLAG_GENERATOR },
1380  { "Thrown", (getter)Object_GetFlagProperty, NULL, NULL, (void*)FLAG_IS_THROWN },
1381  { "CanSeeInvisible", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_SEE_INVISIBLE },
1382  { "Rollable", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_CAN_ROLL },
1383  { "Turnable", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_IS_TURNABLE },
1384  { "UsedUp", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_IS_USED_UP },
1385  { "Splitting", (getter)Object_GetFlagProperty, NULL, NULL, (void*)FLAG_SPLITTING },
1386  { "Blind", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_BLIND },
1387  { "CanUseSkill", (getter)Object_GetFlagProperty, NULL, NULL, (void*)FLAG_CAN_USE_SKILL },
1388  { "KnownCursed", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_KNOWN_CURSED },
1389  { "Stealthy", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_STEALTH },
1390  { "Confused", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_CONFUSED },
1391  { "Sleeping", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_SLEEP },
1392  { "Lifesaver", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_LIFESAVE },
1393  { "Floor", (getter)Object_GetFlagProperty, NULL, NULL, (void*)FLAG_IS_FLOOR },
1394  { "HasXRays", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_XRAYS },
1395  { "CanUseRing", (getter)Object_GetFlagProperty, NULL, NULL, (void*)FLAG_USE_RING },
1396  { "CanUseBow", (getter)Object_GetFlagProperty, NULL, NULL, (void*)FLAG_USE_BOW },
1397  { "CanUseWand", (getter)Object_GetFlagProperty, NULL, NULL, (void*)FLAG_USE_RANGE },
1398  { "CanSeeInDark", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_SEE_IN_DARK },
1399  { "KnownMagical", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_KNOWN_MAGICAL },
1400  { "CanUseWeapon", (getter)Object_GetFlagProperty, NULL, NULL, (void*)FLAG_USE_WEAPON },
1401  { "CanUseArmour", (getter)Object_GetFlagProperty, NULL, NULL, (void*)FLAG_USE_ARMOUR },
1402  { "CanUseScroll", (getter)Object_GetFlagProperty, NULL, NULL, (void*)FLAG_USE_SCROLL },
1403  { "CanCastSpell", (getter)Object_GetFlagProperty, NULL, NULL, (void*)FLAG_CAST_SPELL },
1404  { "ReflectSpells", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_REFL_SPELL },
1405  { "ReflectMissiles", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_REFL_MISSILE },
1406  { "Unique", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_UNIQUE },
1407  { "RunAway", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_RUN_AWAY },
1408  { "Scared", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_SCARED },
1409  { "Undead", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_UNDEAD },
1410  { "BlocksView", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_BLOCKSVIEW },
1411  { "HitBack", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_HITBACK },
1412  { "StandStill", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_STAND_STILL },
1413  { "OnlyAttack", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_ONLY_ATTACK },
1414  { "MakeInvisible", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_MAKE_INVIS },
1415  { "Money", (getter)Object_GetMoney, NULL, NULL, NULL },
1416  { "Type", (getter)Object_GetIntProperty, NULL, NULL, (void*)CFAPI_OBJECT_PROP_TYPE },
1417  { "Subtype", (getter)Object_GetIntProperty, NULL, NULL, (void*)CFAPI_OBJECT_PROP_SUBTYPE },
1418  { "Value", (getter)Object_GetValue, (setter)Object_SetValue, NULL, NULL },
1419  { "ArchName", (getter)Object_GetSStringProperty, NULL, NULL, (void*)CFAPI_OBJECT_PROP_ARCH_NAME },
1420  { "Archetype", (getter)Object_GetArchetype, NULL, NULL, NULL },
1421  { "OtherArchetype", (getter)Object_GetOtherArchetype,NULL, NULL, NULL },
1422  { "Exists", (getter)Object_GetExists, NULL, NULL, NULL },
1423  { "NoSave", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_NO_SAVE },
1424  { "Env", (getter)Object_GetObjectProperty, NULL, NULL, (void*)CFAPI_OBJECT_PROP_ENVIRONMENT },
1425  { "MoveType", (getter)Object_GetMoveType, (setter)Object_SetMoveType, NULL, NULL },
1426  { "MoveBlock", (getter)Object_GetMoveBlock, (setter)Object_SetMoveBlock, NULL, NULL },
1427  { "MoveAllow", (getter)Object_GetMoveAllow, (setter)Object_SetMoveAllow, NULL, NULL },
1428  { "MoveOn", (getter)Object_GetMoveOn, (setter)Object_SetMoveOn, NULL, NULL },
1429  { "MoveOff", (getter)Object_GetMoveOff, (setter)Object_SetMoveOff, NULL, NULL },
1430  { "MoveSlow", (getter)Object_GetMoveSlow, (setter)Object_SetMoveSlow, NULL, NULL },
1431  { "MoveSlowPenalty", (getter)Object_GetFloatProperty, NULL, NULL, (void*)CFAPI_OBJECT_PROP_MOVE_SLOW_PENALTY },
1432  { "Owner", (getter)Object_GetObjectProperty, (setter)Object_SetOwner, NULL, (void*)CFAPI_OBJECT_PROP_OWNER },
1433  { "Enemy", (getter)Object_GetObjectProperty, (setter)Object_SetEnemy, NULL, (void*)CFAPI_OBJECT_PROP_ENEMY },
1434  { "Count", (getter)Object_GetIntProperty, NULL, NULL, (void*)CFAPI_OBJECT_PROP_COUNT },
1435  { "GodGiven", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_STARTEQUIP },
1436  { "IsPet", (getter)Object_GetIntProperty, (setter)Object_SetIntProperty, NULL, (void*)CFAPI_OBJECT_PROP_FRIENDLY },
1437  { "AttackMovement", (getter)Object_GetIntProperty, (setter)Object_SetIntProperty, NULL, (void*)CFAPI_OBJECT_PROP_ATTACK_MOVEMENT },
1438  { "Duration", (getter)Object_GetIntProperty, (setter)Object_SetIntProperty, NULL, (void*)CFAPI_OBJECT_PROP_DURATION },
1439  { "GlowRadius", (getter)Object_GetIntProperty, (setter)Object_SetIntProperty, NULL, (void*)CFAPI_OBJECT_PROP_GLOW_RADIUS },
1440  { "Animated", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_ANIMATE },
1441  { "NoDamage", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_NO_DAMAGE },
1442  { "RandomMovement", (getter)Object_GetFlagProperty, (setter)Object_SetFlagProperty, NULL, (void*)FLAG_RANDOM_MOVE },
1443  { "Material", (getter)Object_GetMaterial, NULL, NULL, NULL },
1444  { "Container", (getter)Object_GetObjectProperty, NULL, NULL, (void*)CFAPI_OBJECT_PROP_CONTAINER },
1445  { "ItemPower", (getter)Object_GetIntProperty, (setter)Object_SetIntProperty, NULL, (void*)CFAPI_OBJECT_PROP_ITEM_POWER },
1446  { "CurrentWeapon", (getter)Object_GetObjectProperty, NULL, NULL, (void*)CFAPI_OBJECT_PROP_CURRENT_WEAPON },
1447  { NULL, NULL, NULL, NULL, NULL }
1448 };
1449 
1450 static PyMethodDef ObjectMethods[] = {
1451  { "Remove", (PyCFunction)Crossfire_Object_Remove, METH_NOARGS, NULL },
1452  { "Apply", (PyCFunction)Crossfire_Object_Apply, METH_VARARGS, NULL },
1453  { "Drop", (PyCFunction)Crossfire_Object_Drop, METH_O, NULL },
1454  { "Clone", (PyCFunction)Crossfire_Object_Clone, METH_VARARGS, NULL },
1455  { "Split", (PyCFunction)Crossfire_Object_Split, METH_VARARGS, NULL },
1456  { "Fix", (PyCFunction)Crossfire_Object_Fix, METH_NOARGS, NULL },
1457  { "Say", (PyCFunction)Crossfire_Object_Say, METH_VARARGS, NULL },
1458  { "Speak", (PyCFunction)Crossfire_Object_Say, METH_VARARGS, NULL },
1459  { "Take", (PyCFunction)Crossfire_Object_Take, METH_O, NULL },
1460  { "Teleport", (PyCFunction)Crossfire_Object_Teleport, METH_VARARGS, NULL },
1461  { "Reposition", (PyCFunction)Crossfire_Object_Reposition, METH_VARARGS, NULL },
1462  { "QueryName", (PyCFunction)Crossfire_Object_QueryName, METH_NOARGS, NULL },
1463  { "GetResist", (PyCFunction)Crossfire_Object_GetResist, METH_VARARGS, NULL },
1464  { "SetResist", (PyCFunction)Crossfire_Object_SetResist, METH_VARARGS, NULL },
1465  { "ActivateRune", (PyCFunction)Crossfire_Object_ActivateRune, METH_O, NULL },
1466  { "CheckTrigger", (PyCFunction)Crossfire_Object_CheckTrigger, METH_O, NULL },
1467  { "Cast", (PyCFunction)Crossfire_Object_Cast, METH_VARARGS, NULL },
1468  { "LearnSpell", (PyCFunction)Crossfire_Object_LearnSpell, METH_O, NULL },
1469  { "ForgetSpell", (PyCFunction)Crossfire_Object_ForgetSpell, METH_O, NULL },
1470  { "KnowSpell", (PyCFunction)Crossfire_Object_KnowSpell, METH_VARARGS, NULL },
1471  { "CastAbility", (PyCFunction)Crossfire_Object_CastAbility, METH_VARARGS, NULL },
1472  { "PayAmount", (PyCFunction)Crossfire_Object_PayAmount, METH_VARARGS, NULL },
1473  { "Pay", (PyCFunction)Crossfire_Object_Pay, METH_O, NULL },
1474  { "CheckInventory", (PyCFunction)Crossfire_Object_CheckInventory, METH_VARARGS, NULL },
1475  { "CheckArchInventory", (PyCFunction)Crossfire_Object_CheckArchInventory, METH_VARARGS, NULL },
1476  { "OutOfMap", (PyCFunction)Crossfire_Object_GetOutOfMap, METH_VARARGS, NULL },
1477  { "CreateObject", (PyCFunction)Crossfire_Object_CreateInside, METH_VARARGS, NULL },
1478  { "InsertInto", (PyCFunction)Crossfire_Object_InsertInto, METH_O, NULL },
1479  { "ReadKey", (PyCFunction)Crossfire_Object_ReadKey, METH_VARARGS, NULL },
1480  { "WriteKey", (PyCFunction)Crossfire_Object_WriteKey, METH_VARARGS, NULL },
1481  { "CreateTimer", (PyCFunction)Crossfire_Object_CreateTimer, METH_VARARGS, NULL },
1482  { "AddExp", (PyCFunction)Crossfire_Object_AddExp, METH_VARARGS, NULL },
1483  { "Move", (PyCFunction)Crossfire_Object_Move, METH_VARARGS, NULL },
1484  { "MoveTo", (PyCFunction)Crossfire_Object_MoveTo, METH_VARARGS, NULL },
1485  { "ChangeAbil", (PyCFunction)Crossfire_Object_ChangeAbil, METH_O, NULL },
1486  { "Event", (PyCFunction)Crossfire_Object_Event, METH_VARARGS, NULL },
1487  { "RemoveDepletion",(PyCFunction)Crossfire_Object_RemoveDepletion, METH_VARARGS, NULL },
1488  { "Arrest", (PyCFunction)Crossfire_Object_Arrest, METH_VARARGS, NULL },
1489  { "PermExp", (PyCFunction)Crossfire_Object_PermExp, METH_NOARGS, NULL },
1490  { NULL, NULL, 0, NULL }
1491 };
1492 
1494 
1495 static PyObject *Crossfire_Object_new(PyTypeObject *type, PyObject *args, PyObject *kwds) {
1496  Crossfire_Object *self;
1497  (void)args;
1498  (void)kwds;
1499 
1500  self = (Crossfire_Object *)type->tp_alloc(type, 0);
1501  if (self) {
1502  self->obj = NULL;
1503  self->count = 0;
1504  }
1505 
1506  return (PyObject *)self;
1507 }
1508 
1509 static void Crossfire_Object_dealloc(PyObject *obj) {
1510  Crossfire_Object *self;
1511 
1512  self = (Crossfire_Object *)obj;
1513  if (self) {
1514  if (self->obj) {
1515  free_object_assoc(self->obj);
1516  }
1517  Py_TYPE(self)->tp_free(obj);
1518  }
1519 }
1520 
1521 static PyObject *Crossfire_Player_new(PyTypeObject *type, PyObject *args, PyObject *kwds) {
1522  Crossfire_Player *self;
1523  (void)args;
1524  (void)kwds;
1525 
1526  self = (Crossfire_Player *)type->tp_alloc(type, 0);
1527  if (self) {
1528  self->obj = NULL;
1529  self->count = 0;
1530  }
1531 
1532  return (PyObject *)self;
1533 }
1534 
1535 static void Crossfire_Player_dealloc(PyObject *obj) {
1536  Crossfire_Player *self;
1537 
1538  self = (Crossfire_Player *)obj;
1539  if (self) {
1540  if (self->obj) {
1541  free_object_assoc(self->obj);
1542  }
1543  Py_TYPE(self)->tp_free(obj);
1544  }
1545 }
1546 
1547 static PyObject *Player_GetObjectProperty(Crossfire_Player *whoptr, void *closure) {
1548  EXISTCHECK(whoptr);
1549  object *ob = cf_object_get_object_property(whoptr->obj, (int)(intptr_t)closure);
1550  return Crossfire_Object_wrap(ob);
1551 }
1552 
1553 /* Our actual Python ObjectType */
1554 CF_PYTHON_OBJECT(Object,
1556  &ObjectConvert,
1557  PyObject_HashNotImplemented,
1558  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1559  "Crossfire objects",
1560  (richcmpfunc) Crossfire_Object_RichCompare,
1561  ObjectMethods,
1563  NULL,
1565  );
1566 
1567 static PyGetSetDef Player_getseters[] = {
1568  { "Title", (getter)Player_GetTitle, (setter)Player_SetTitle, NULL, NULL },
1569  { "IP", (getter)Player_GetIP, NULL, NULL, NULL },
1570  { "MarkedItem", (getter)Player_GetMarkedItem, (setter)Player_SetMarkedItem, NULL, NULL },
1571  { "Party", (getter)Player_GetParty, (setter)Player_SetParty, NULL, NULL },
1572  { "BedMap", (getter)Player_GetBedMap, (setter)Player_SetBedMap, NULL, NULL },
1573  { "BedX", (getter)Player_GetBedX, (setter)Player_SetBedX, NULL, NULL },
1574  { "BedY", (getter)Player_GetBedY, (setter)Player_SetBedY, NULL, NULL },
1575  { "Transport", (getter)Player_GetObjectProperty,NULL, NULL, (void*)CFAPI_PLAYER_PROP_TRANSPORT},
1576  { NULL, NULL, NULL, NULL, NULL }
1577 };
1578 
1579 static PyMethodDef PlayerMethods[] = {
1580  { "Message", (PyCFunction)Crossfire_Player_Message, METH_VARARGS, NULL },
1581  { "Write", (PyCFunction)Crossfire_Player_Message, METH_VARARGS, NULL },
1582  { "CanPay", (PyCFunction)Crossfire_Player_CanPay, METH_NOARGS, NULL },
1583  { "QuestStart", (PyCFunction)Player_QuestStart, METH_VARARGS, NULL },
1584  { "QuestGetState", (PyCFunction)Player_QuestGetState, METH_VARARGS, NULL },
1585  { "QuestSetState", (PyCFunction)Player_QuestSetState, METH_VARARGS, NULL },
1586  { "QuestWasCompleted", (PyCFunction)Player_QuestWasCompleted, METH_VARARGS, NULL },
1587  { "KnowledgeKnown", (PyCFunction)Player_KnowledgeKnown, METH_VARARGS, NULL },
1588  { "GiveKnowledge", (PyCFunction)Player_GiveKnowledge, METH_VARARGS, NULL },
1589  { NULL, NULL, 0, NULL }
1590 };
1591 
1592 /* Our actual Python ObjectPlayerType */
1593 CF_PYTHON_OBJECT(Player,
1595  NULL,
1596  NULL,
1597  Py_TPFLAGS_DEFAULT,
1598  "Crossfire player",
1599  NULL,
1600  PlayerMethods,
1604  );
1605 
1609 PyObject *Crossfire_Object_wrap(object *what) {
1610  Crossfire_Object *wrapper;
1611  Crossfire_Player *plwrap;
1612  PyObject *pyobj;
1613 
1614  /* return None if no object was to be wrapped */
1615  if (what == NULL) {
1616  Py_INCREF(Py_None);
1617  return Py_None;
1618  }
1619 
1620  pyobj = find_assoc_pyobject(what);
1621  if ((!pyobj) || (object_was_destroyed(((Crossfire_Object *)pyobj)->obj, ((Crossfire_Object *)pyobj)->count))) {
1622  if (what->type == PLAYER) {
1623  plwrap = PyObject_NEW(Crossfire_Player, &Crossfire_PlayerType);
1624  if (plwrap != NULL) {
1625  plwrap->obj = what;
1626  plwrap->count = what->count;
1627  }
1628  pyobj = (PyObject *)plwrap;
1629  } else {
1630  wrapper = PyObject_NEW(Crossfire_Object, &Crossfire_ObjectType);
1631  if (wrapper != NULL) {
1632  wrapper->obj = what;
1633  wrapper->count = what->count;
1634  }
1635  pyobj = (PyObject *)wrapper;
1636  }
1637  add_object_assoc(what, pyobj);
1638  } else {
1639  Py_INCREF(pyobj);
1640  }
1641  return pyobj;
1642 }
object_was_destroyed
#define object_was_destroyed(op, old_tag)
Definition: object.h:68
FLAG_USE_BOW
#define FLAG_USE_BOW
Definition: define.h:293
Player_GetObjectProperty
static PyObject * Player_GetObjectProperty(Crossfire_Player *whoptr, void *closure)
Definition: cfpython_object.cpp:1547
npc_dialog.location
string location
Definition: npc_dialog.py:49
Object_SetMoveOn
static int Object_SetMoveOn(Crossfire_Object *whoptr, PyObject *value, void *closure)
Definition: cfpython_object.cpp:710
CFAPI_OBJECT_PROP_TITLE
#define CFAPI_OBJECT_PROP_TITLE
Definition: plugin.h:136
Player_getseters
static PyGetSetDef Player_getseters[]
Definition: cfpython_object.cpp:1567
PLAYER
@ PLAYER
Definition: object.h:110
cf_log
void cf_log(LogLevel logLevel, const char *format,...)
Definition: plugin_common.cpp:1512
Crossfire_Object_Drop
static PyObject * Crossfire_Object_Drop(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:773
Crossfire_Object_CastAbility
static PyObject * Crossfire_Object_CastAbility(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:1024
cf_query_name_pl
sstring cf_query_name_pl(object *ob)
Definition: plugin_common.cpp:1199
Crossfire_Object_Move
static PyObject * Crossfire_Object_Move(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:1211
CFAPI_OBJECT_PROP_X
#define CFAPI_OBJECT_PROP_X
Definition: plugin.h:142
Crossfire_Object_Teleport
static PyObject * Crossfire_Object_Teleport(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:849
cf_object_check_for_spell
object * cf_object_check_for_spell(object *op, const char *name)
Definition: plugin_common.cpp:768
Crossfire_Object::obj
PyObject_HEAD object * obj
Definition: cfpython_object.h:34
Crossfire_Object_CheckTrigger
static PyObject * Crossfire_Object_CheckTrigger(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:878
cf_add_string
sstring cf_add_string(const char *str)
Definition: plugin_common.cpp:1157
Crossfire_Object_ForgetSpell
static PyObject * Crossfire_Object_ForgetSpell(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:999
Object_GetExpMul
static PyObject * Object_GetExpMul(Crossfire_Object *whoptr, void *closure)
Definition: cfpython_object.cpp:376
CFAPI_OBJECT_PROP_CHA
#define CFAPI_OBJECT_PROP_CHA
Definition: plugin.h:207
CFAPI_OBJECT_PROP_ARCH_NAME
#define CFAPI_OBJECT_PROP_ARCH_NAME
Definition: plugin.h:219
FLAG_STAND_STILL
#define FLAG_STAND_STILL
Definition: define.h:308
Crossfire_Object_WriteKey
static PyObject * Crossfire_Object_WriteKey(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:1080
FLAG_CONFUSED
#define FLAG_CONFUSED
Definition: define.h:311
CFAPI_OBJECT_PROP_ATTACK_MOVEMENT
#define CFAPI_OBJECT_PROP_ATTACK_MOVEMENT
Definition: plugin.h:182
llevError
@ llevError
Definition: logger.h:11
cf_player_set_marked_item
void cf_player_set_marked_item(object *op, object *ob)
Definition: plugin_common.cpp:856
MOVE_ALL
#define MOVE_ALL
Definition: define.h:398
cf_object_teleport
int cf_object_teleport(object *ob, mapstruct *map, int x, int y)
Definition: plugin_common.cpp:1350
cf_object_out_of_map
int cf_object_out_of_map(object *op, int x, int y)
Definition: plugin_common.cpp:1025
FLAG_USE_RING
#define FLAG_USE_RING
Definition: define.h:297
FLAG_UNDEAD
#define FLAG_UNDEAD
Definition: define.h:270
Object_GetNamePl
static PyObject * Object_GetNamePl(Crossfire_Object *whoptr, void *closure)
Definition: cfpython_object.cpp:349
cf_object_get_string_property
char * cf_object_get_string_property(object *op, int propcode, char *buf, int size)
Definition: plugin_common.cpp:438
talk_info::npc_msg_count
int npc_msg_count
Definition: dialog.h:60
cf_object_get_long_property
long cf_object_get_long_property(object *op, long propcode)
Definition: plugin_common.cpp:332
CFAPI_OBJECT_PROP_LEVEL
#define CFAPI_OBJECT_PROP_LEVEL
Definition: plugin.h:161
FLAG_GENERATOR
#define FLAG_GENERATOR
Definition: define.h:248
Object_GetMoveAllow
static PyObject * Object_GetMoveAllow(Crossfire_Object *whoptr, void *closure)
Definition: cfpython_object.cpp:435
CFAPI_PLAYER_PROP_BED_X
#define CFAPI_PLAYER_PROP_BED_X
Definition: plugin.h:238
diamondslots.x
x
Definition: diamondslots.py:15
FLAG_STARTEQUIP
#define FLAG_STARTEQUIP
Definition: define.h:268
Object_GetFlagProperty
static PyObject * Object_GetFlagProperty(Crossfire_Object *whoptr, void *closure)
Definition: cfpython_object.cpp:326
cf_object_get_sstring_property
sstring cf_object_get_sstring_property(object *op, int propcode)
Definition: plugin_common.cpp:430
obj::count
tag_t count
Definition: object.h:305
cf_player_knowledge_has
int cf_player_knowledge_has(object *op, const char *knowledge)
Definition: plugin_common.cpp:890
add_object_assoc
static void add_object_assoc(object *key, PyObject *value)
Definition: cfpython_object.cpp:64
Crossfire_Party
Definition: cfpython_party.h:33
Player_SetParty
static int Player_SetParty(Crossfire_Player *whoptr, PyObject *value, void *closure)
Definition: cfpython_object.cpp:171
Object_SetName
static int Object_SetName(Crossfire_Object *whoptr, PyObject *value, void *closure)
Definition: cfpython_object.cpp:518
FLAG_REFL_MISSILE
#define FLAG_REFL_MISSILE
Definition: define.h:273
Object_SetMap
static int Object_SetMap(Crossfire_Object *whoptr, PyObject *value, void *closure)
Definition: cfpython_object.cpp:571
cf_object_get_object_property
object * cf_object_get_object_property(object *op, int propcode)
Definition: plugin_common.cpp:355
Crossfire_Object_InternalCompare
static int Crossfire_Object_InternalCompare(Crossfire_Object *left, Crossfire_Object *right)
Definition: cfpython_object.cpp:1265
Object_SetMoveSlow
static int Object_SetMoveSlow(Crossfire_Object *whoptr, PyObject *value, void *closure)
Definition: cfpython_object.cpp:732
cf_object_cast_spell
int cf_object_cast_spell(object *op, object *caster, int dir, object *spell_ob, char *stringarg)
Definition: plugin_common.cpp:734
cf_fix_object
void cf_fix_object(object *op)
Definition: plugin_common.cpp:1146
Crossfire_Object_CreateTimer
static PyObject * Crossfire_Object_CreateTimer(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:1092
Crossfire_Object_KnowSpell
static PyObject * Crossfire_Object_KnowSpell(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:1011
FLAG_IS_TURNABLE
#define FLAG_IS_TURNABLE
Definition: define.h:256
TYPEEXISTCHECK
#define TYPEEXISTCHECK(ob)
Definition: cfpython_object.cpp:44
CFAPI_OBJECT_PROP_SLAYING
#define CFAPI_OBJECT_PROP_SLAYING
Definition: plugin.h:138
FLAG_SEE_IN_DARK
#define FLAG_SEE_IN_DARK
Definition: define.h:337
Crossfire_Object
Definition: cfpython_object.h:32
CFAPI_OBJECT_PROP_FRIENDLY
#define CFAPI_OBJECT_PROP_FRIENDLY
Definition: plugin.h:189
CFAPI_OBJECT_PROP_DEX
#define CFAPI_OBJECT_PROP_DEX
Definition: plugin.h:202
cf_player_knowledge_give
void cf_player_knowledge_give(object *op, const char *knowledge)
Definition: plugin_common.cpp:903
CFAPI_OBJECT_PROP_ARCHETYPE
#define CFAPI_OBJECT_PROP_ARCHETYPE
Definition: plugin.h:185
Player_GetIP
static PyObject * Player_GetIP(Crossfire_Player *whoptr, void *closure)
Definition: cfpython_object.cpp:103
Crossfire_Object_CreateInside
static PyObject * Crossfire_Object_CreateInside(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:1148
Player_KnowledgeKnown
static PyObject * Player_KnowledgeKnown(Crossfire_Player *who, PyObject *args)
Definition: cfpython_object.cpp:142
FLAG_UNIQUE
#define FLAG_UNIQUE
Definition: define.h:287
Object_SetPickable
static int Object_SetPickable(Crossfire_Object *whoptr, PyObject *value, void *closure)
Definition: cfpython_object.cpp:559
cf_create_object_by_name
object * cf_create_object_by_name(const char *name)
Definition: plugin_common.cpp:1083
CFAPI_OBJECT_PROP_LAST_EAT
#define CFAPI_OBJECT_PROP_LAST_EAT
Definition: plugin.h:165
CFAPI_OBJECT_PROP_MOVE_ON
#define CFAPI_OBJECT_PROP_MOVE_ON
Definition: plugin.h:227
Crossfire_Object_AddExp
static PyObject * Crossfire_Object_AddExp(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:1192
CFAPI_OBJECT_PROP_STR
#define CFAPI_OBJECT_PROP_STR
Definition: plugin.h:201
CFAPI_OBJECT_PROP_GOD
#define CFAPI_OBJECT_PROP_GOD
Definition: plugin.h:218
MoveType
unsigned char MoveType
Definition: define.h:417
Crossfire_Player_CanPay
static PyObject * Crossfire_Player_CanPay(Crossfire_Player *who, PyObject *args)
Definition: cfpython_object.cpp:182
guildjoin.ob
ob
Definition: guildjoin.py:42
cf_query_name
char * cf_query_name(object *ob, char *name, int size)
Definition: plugin_common.cpp:1191
cf_object_set_float_property
void cf_object_set_float_property(object *op, int propcode, float value)
Definition: plugin_common.cpp:386
Crossfire_Object_InsertInto
static PyObject * Crossfire_Object_InsertInto(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:1163
Object_SetOwner
static int Object_SetOwner(Crossfire_Object *whoptr, PyObject *value, void *closure)
Definition: cfpython_object.cpp:643
FLAG_SEE_INVISIBLE
#define FLAG_SEE_INVISIBLE
Definition: define.h:253
cf_object_apply
int cf_object_apply(object *op, object *author, int flags)
Definition: plugin_common.cpp:532
giveknowledge.knowledge
knowledge
DIALOGCHECK MINARGS 1 MAXARGS 1
Definition: giveknowledge.py:15
CFAPI_OBJECT_PROP_MAXSP
#define CFAPI_OBJECT_PROP_MAXSP
Definition: plugin.h:215
Crossfire_Object_Event
static PyObject * Crossfire_Object_Event(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:1229
Object_SetFace
static int Object_SetFace(Crossfire_Object *whoptr, PyObject *value, void *closure)
Definition: cfpython_object.cpp:600
PlayerMethods
static PyMethodDef PlayerMethods[]
Definition: cfpython_object.cpp:1579
cf_object_get_int64_property
int64_t cf_object_get_int64_property(object *op, int propcode)
Definition: plugin_common.cpp:371
cf_object_move_to
int cf_object_move_to(object *op, int x, int y)
Definition: plugin_common.cpp:620
Crossfire_Party_wrap
PyObject * Crossfire_Party_wrap(partylist *what)
Definition: cfpython_party.cpp:61
cf_object_free_drop_inventory
void cf_object_free_drop_inventory(object *ob)
Definition: plugin_common.cpp:561
CFAPI_OBJECT_PROP_Y
#define CFAPI_OBJECT_PROP_Y
Definition: plugin.h:143
CFAPI_OBJECT_PROP_ENEMY
#define CFAPI_OBJECT_PROP_ENEMY
Definition: plugin.h:176
cf_player_can_pay
int cf_player_can_pay(object *op)
Definition: plugin_common.cpp:876
CFAPI_OBJECT_PROP_MOVE_TYPE
#define CFAPI_OBJECT_PROP_MOVE_TYPE
Definition: plugin.h:224
FLAG_SCARED
#define FLAG_SCARED
Definition: define.h:271
cf_object_set_string_property
void cf_object_set_string_property(object *op, int propcode, const char *value)
Definition: plugin_common.cpp:446
Ice.tmp
int tmp
Definition: Ice.py:207
FLAG_ONLY_ATTACK
#define FLAG_ONLY_ATTACK
Definition: define.h:310
cf_object_perm_exp
int64_t cf_object_perm_exp(object *op)
Definition: plugin_common.cpp:505
CFAPI_OBJECT_PROP_FACE
#define CFAPI_OBJECT_PROP_FACE
Definition: plugin.h:221
CFAPI_OBJECT_PROP_ENVIRONMENT
#define CFAPI_OBJECT_PROP_ENVIRONMENT
Definition: plugin.h:129
cf_quest_set_player_state
void cf_quest_set_player_state(object *pl, sstring quest_code, int state)
Definition: plugin_common.cpp:2065
Player_GetParty
static PyObject * Player_GetParty(Crossfire_Player *whoptr, void *closure)
Definition: cfpython_object.cpp:165
cf_player_arrest
int cf_player_arrest(object *who)
Definition: plugin_common.cpp:914
flags
static const flag_definition flags[]
Definition: gridarta-types-convert.c:101
Crossfire_Object_SetResist
static PyObject * Crossfire_Object_SetResist(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:958
NROFATTACKS
#define NROFATTACKS
Definition: attack.h:17
Crossfire_Object_Remove
static PyObject * Crossfire_Object_Remove(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:745
FLAG_BLOCKSVIEW
#define FLAG_BLOCKSVIEW
Definition: define.h:269
Object_GetTotalExp
static PyObject * Object_GetTotalExp(Crossfire_Object *whoptr, void *closure)
Definition: cfpython_object.cpp:370
CFAPI_OBJECT_PROP_ITEM_POWER
#define CFAPI_OBJECT_PROP_ITEM_POWER
Definition: plugin.h:168
smoking_pipe.color
color
Definition: smoking_pipe.py:5
FLAG_APPLIED
#define FLAG_APPLIED
Definition: define.h:235
CFAPI_OBJECT_PROP_CURRENT_WEAPON
#define CFAPI_OBJECT_PROP_CURRENT_WEAPON
Definition: plugin.h:175
FLAG_STEALTH
#define FLAG_STEALTH
Definition: define.h:312
current_context
CFPContext * current_context
Definition: cfpython.cpp:106
FLAG_BLIND
#define FLAG_BLIND
Definition: define.h:336
buf
StringBuffer * buf
Definition: readable.cpp:1611
Player_SetTitle
static int Player_SetTitle(Crossfire_Object *whoptr, PyObject *value, void *closure)
Definition: cfpython_object.cpp:83
cf_player_set_title
void cf_player_set_title(object *op, const char *title)
Definition: plugin_common.cpp:832
cf_spring_trap
void cf_spring_trap(object *trap, object *victim)
Definition: plugin_common.cpp:995
Crossfire_Object_Pay
static PyObject * Crossfire_Object_Pay(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:1054
Object_GetMoveOn
static PyObject * Object_GetMoveOn(Crossfire_Object *whoptr, void *closure)
Definition: cfpython_object.cpp:441
cf_object_pay_amount
int cf_object_pay_amount(object *pl, uint64_t to_pay)
Definition: plugin_common.cpp:722
CFAPI_OBJECT_PROP_INVISIBLE
#define CFAPI_OBJECT_PROP_INVISIBLE
Definition: plugin.h:220
FLAG_NO_PICK
#define FLAG_NO_PICK
Definition: define.h:239
Crossfire_Object_wrap
PyObject * Crossfire_Object_wrap(object *what)
Definition: cfpython_object.cpp:1609
Object_GetMap
static PyObject * Object_GetMap(Crossfire_Object *whoptr, void *closure)
Definition: cfpython_object.cpp:355
NDI_ORANGE
#define NDI_ORANGE
Definition: newclient.h:246
cf_object_change_abil
int cf_object_change_abil(object *op, object *tmp)
Definition: plugin_common.cpp:1661
cf_object_set_key
int cf_object_set_key(object *op, const char *keyname, const char *value, int add_key)
Definition: plugin_common.cpp:1649
Object_SetFloatProperty
static int Object_SetFloatProperty(Crossfire_Object *whoptr, PyObject *value, void *closure)
Definition: cfpython_object.cpp:496
Player_SetMarkedItem
static int Player_SetMarkedItem(Crossfire_Player *whoptr, PyObject *value, void *closure)
Definition: cfpython_object.cpp:115
CFAPI_OBJECT_PROP_SKILL
#define CFAPI_OBJECT_PROP_SKILL
Definition: plugin.h:139
Crossfire_Object_CheckInventory
static PyObject * Crossfire_Object_CheckInventory(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:1103
obj
Definition: object.h:280
FLAG_ALIVE
#define FLAG_ALIVE
Definition: define.h:230
Crossfire_Player::obj
PyObject_HEAD object * obj
Definition: cfpython_object.h:42
Player_QuestSetState
static PyObject * Player_QuestSetState(Crossfire_Player *whoptr, PyObject *args)
Definition: cfpython_object.cpp:274
cf_quest_start
void cf_quest_start(object *pl, sstring quest_code, int state)
Definition: plugin_common.cpp:2054
Crossfire_PlayerType
PyTypeObject Crossfire_PlayerType
Object_SetValue
static int Object_SetValue(Crossfire_Object *whoptr, PyObject *value, void *closure)
Definition: cfpython_object.cpp:631
CFAPI_OBJECT_PROP_ANIM_SPEED
#define CFAPI_OBJECT_PROP_ANIM_SPEED
Definition: plugin.h:188
m
static event_registration m
Definition: citylife.cpp:425
CFAPI_OBJECT_PROP_AC
#define CFAPI_OBJECT_PROP_AC
Definition: plugin.h:209
autojail.who
who
Definition: autojail.py:3
cf_object_set_animation
int cf_object_set_animation(object *op, const char *animation)
Definition: plugin_common.cpp:476
titlestruct
Definition: readable.cpp:108
CFAPI_OBJECT_PROP_MOVE_OFF
#define CFAPI_OBJECT_PROP_MOVE_OFF
Definition: plugin.h:228
FLAG_WAS_WIZ
#define FLAG_WAS_WIZ
Definition: define.h:234
cf_log_plain
void cf_log_plain(LogLevel logLevel, const char *message)
Definition: plugin_common.cpp:1532
Crossfire_Map::map
PyObject_HEAD mapstruct * map
Definition: cfpython_map.h:34
CF_IS_PYSTR
#define CF_IS_PYSTR(cfpy_obj)
Definition: cfpython.h:62
CFAPI_OBJECT_PROP_HP
#define CFAPI_OBJECT_PROP_HP
Definition: plugin.h:210
CFAPI_OBJECT_PROP_MAXHP
#define CFAPI_OBJECT_PROP_MAXHP
Definition: plugin.h:214
cf_player_get_party
partylist * cf_player_get_party(object *op)
Definition: plugin_common.cpp:862
cf_object_say
void cf_object_say(object *op, const char *msg)
Definition: plugin_common.cpp:1039
diamondslots.activator
activator
Definition: diamondslots.py:10
make_face_from_files.args
args
Definition: make_face_from_files.py:31
Player_QuestWasCompleted
static PyObject * Player_QuestWasCompleted(Crossfire_Player *whoptr, PyObject *args)
Definition: cfpython_object.cpp:291
rotate-tower.result
bool result
Definition: rotate-tower.py:13
CFAPI_OBJECT_PROP_OB_BELOW
#define CFAPI_OBJECT_PROP_OB_BELOW
Definition: plugin.h:125
cf_timer_create
int cf_timer_create(object *ob, long delay, int mode)
Definition: plugin_common.cpp:1594
CFAPI_OBJECT_PROP_TOTAL_EXP
#define CFAPI_OBJECT_PROP_TOTAL_EXP
Definition: plugin.h:174
Object_GetFloatProperty
static PyObject * Object_GetFloatProperty(Crossfire_Object *whoptr, void *closure)
Definition: cfpython_object.cpp:320
Object_GetExp
static PyObject * Object_GetExp(Crossfire_Object *whoptr, void *closure)
Definition: cfpython_object.cpp:364
CFAPI_PLAYER_PROP_BED_Y
#define CFAPI_PLAYER_PROP_BED_Y
Definition: plugin.h:239
Player_SetBedY
static int Player_SetBedY(Crossfire_Player *whoptr, PyObject *value, void *closure)
Definition: cfpython_object.cpp:230
object_assoc_table
static ptr_assoc_table object_assoc_table
Definition: cfpython_object.cpp:57
FLAG_USE_RANGE
#define FLAG_USE_RANGE
Definition: define.h:292
cf_object_set_int64_property
void cf_object_set_int64_property(object *op, int propcode, int64_t value)
Definition: plugin_common.cpp:392
FLAG_RUN_AWAY
#define FLAG_RUN_AWAY
Definition: define.h:280
Crossfire_Object_QueryName
static PyObject * Crossfire_Object_QueryName(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:938
FLAG_KNOWN_CURSED
#define FLAG_KNOWN_CURSED
Definition: define.h:320
Crossfire_Object_new
static PyObject * Crossfire_Object_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
Definition: cfpython_object.cpp:1495
_cfpcontext::who
PyObject * who
Definition: cfpython.h:93
CFAPI_OBJECT_PROP_RACE
#define CFAPI_OBJECT_PROP_RACE
Definition: plugin.h:137
CFAPI_OBJECT_PROP_MOVE_BLOCK
#define CFAPI_OBJECT_PROP_MOVE_BLOCK
Definition: plugin.h:225
CFAPI_OBJECT_PROP_FACING
#define CFAPI_OBJECT_PROP_FACING
Definition: plugin.h:148
Player_SetBedX
static int Player_SetBedX(Crossfire_Player *whoptr, PyObject *value, void *closure)
Definition: cfpython_object.cpp:213
CFAPI_OBJECT_PROP_WEIGHT
#define CFAPI_OBJECT_PROP_WEIGHT
Definition: plugin.h:170
ObjectMethods
static PyMethodDef ObjectMethods[]
Definition: cfpython_object.cpp:1450
Player_GetBedX
static PyObject * Player_GetBedX(Crossfire_Player *whoptr, void *closure)
Definition: cfpython_object.cpp:207
cf_object_get_movetype_property
MoveType cf_object_get_movetype_property(object *op, int propcode)
Definition: plugin_common.cpp:347
cf_object_find_by_arch_name
object * cf_object_find_by_arch_name(const object *who, const char *name)
Definition: plugin_common.cpp:582
cf_object_get_map_property
mapstruct * cf_object_get_map_property(object *op, int propcode)
Definition: plugin_common.cpp:363
CFAPI_OBJECT_PROP_DAM
#define CFAPI_OBJECT_PROP_DAM
Definition: plugin.h:217
cf_object_query_money
int cf_object_query_money(const object *op)
Definition: plugin_common.cpp:973
Crossfire_Object_Clone
static PyObject * Crossfire_Object_Clone(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:785
make_face_from_files.str
str
Definition: make_face_from_files.py:24
Crossfire_Object_Say
static PyObject * Crossfire_Object_Say(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:894
cfpython.h
Object_GetValue
static PyObject * Object_GetValue(Crossfire_Object *whoptr, void *closure)
Definition: cfpython_object.cpp:394
FLAG_MAKE_INVIS
#define FLAG_MAKE_INVIS
Definition: define.h:328
Object_SetAnim
static int Object_SetAnim(Crossfire_Object *whoptr, PyObject *value, void *closure)
Definition: cfpython_object.cpp:615
Object_GetPickable
static PyObject * Object_GetPickable(Crossfire_Object *whoptr, void *closure)
Definition: cfpython_object.cpp:382
FLAG_NO_DAMAGE
#define FLAG_NO_DAMAGE
Definition: define.h:356
MAX_NPC
#define MAX_NPC
Definition: dialog.h:47
Crossfire_Player::count
tag_t count
Definition: cfpython_object.h:43
Crossfire_Object_RemoveDepletion
static PyObject * Crossfire_Object_RemoveDepletion(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:1249
Object_GetMoveOff
static PyObject * Object_GetMoveOff(Crossfire_Object *whoptr, void *closure)
Definition: cfpython_object.cpp:447
cf_object_clone
object * cf_object_clone(object *op, int clonetype)
Definition: plugin_common.cpp:673
Player_GetTitle
static PyObject * Player_GetTitle(Crossfire_Object *whoptr, void *closure)
Definition: cfpython_object.cpp:76
CF_PYTHON_OBJECT
CF_PYTHON_OBJECT(Object, Crossfire_Object_dealloc, &ObjectConvert, PyObject_HashNotImplemented, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, "Crossfire objects",(richcmpfunc) Crossfire_Object_RichCompare, ObjectMethods, Object_getseters, NULL, Crossfire_Object_new)
FLAG_DAMNED
#define FLAG_DAMNED
Definition: define.h:317
CFAPI_OBJECT_PROP_EXP
#define CFAPI_OBJECT_PROP_EXP
Definition: plugin.h:194
CFAPI_OBJECT_PROP_SPEED
#define CFAPI_OBJECT_PROP_SPEED
Definition: plugin.h:144
CFAPI_OBJECT_PROP_TYPE
#define CFAPI_OBJECT_PROP_TYPE
Definition: plugin.h:149
CFAPI_OBJECT_PROP_NROF
#define CFAPI_OBJECT_PROP_NROF
Definition: plugin.h:146
free_object_assoc
static void free_object_assoc(object *key)
Definition: cfpython_object.cpp:72
cf_object_get_double_property
double cf_object_get_double_property(object *op, int propcode)
Definition: plugin_common.cpp:422
Crossfire_Archetype_wrap
PyObject * Crossfire_Archetype_wrap(archetype *what)
Definition: cfpython_archetype.cpp:62
MAX_NAME
#define MAX_NAME
Definition: define.h:41
Object_SetMoveType
static int Object_SetMoveType(Crossfire_Object *whoptr, PyObject *value, void *closure)
Definition: cfpython_object.cpp:677
FLAG_CAN_ROLL
#define FLAG_CAN_ROLL
Definition: define.h:254
Crossfire_Object_RichCompare
static PyObject * Crossfire_Object_RichCompare(Crossfire_Object *left, Crossfire_Object *right, int op)
Definition: cfpython_object.cpp:1271
Object_SetMoveBlock
static int Object_SetMoveBlock(Crossfire_Object *whoptr, PyObject *value, void *closure)
Definition: cfpython_object.cpp:688
init_object_assoc_table
void init_object_assoc_table(void)
Definition: cfpython_object.cpp:60
sstring
const typedef char * sstring
Definition: global.h:43
FLAG_UNAGGRESSIVE
#define FLAG_UNAGGRESSIVE
Definition: define.h:272
disinfect.count
int count
Definition: disinfect.py:7
Object_SetExp
static int Object_SetExp(Crossfire_Object *whoptr, PyObject *value, void *closure)
Definition: cfpython_object.cpp:665
CFAPI_OBJECT_PROP_ATTACK_TYPE
#define CFAPI_OBJECT_PROP_ATTACK_TYPE
Definition: plugin.h:153
FLAG_USE_WEAPON
#define FLAG_USE_WEAPON
Definition: define.h:296
FLAG_NO_SAVE
#define FLAG_NO_SAVE
Definition: define.h:244
Object_GetMaterial
static PyObject * Object_GetMaterial(Crossfire_Object *whoptr, void *closure)
Definition: cfpython_object.cpp:459
FLAG_CAN_USE_SKILL
#define FLAG_CAN_USE_SKILL
Definition: define.h:321
cf_object_get_flag
int cf_object_get_flag(object *ob, int flag)
Definition: plugin_common.cpp:1267
animate.anim
string anim
Definition: animate.py:20
mapdef
Definition: map.h:317
Crossfire_Object_GetOutOfMap
static PyObject * Crossfire_Object_GetOutOfMap(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:1138
CFAPI_OBJECT_PROP_OWNER
#define CFAPI_OBJECT_PROP_OWNER
Definition: plugin.h:195
cf_object_drop
void cf_object_drop(object *op, object *author)
Definition: plugin_common.cpp:1033
nlohmann::detail::void
j template void())
Definition: json.hpp:4099
cf_object_transfer
int cf_object_transfer(object *op, int x, int y, int randomly, object *originator)
Definition: plugin_common.cpp:608
cf_object_set_movetype_property
void cf_object_set_movetype_property(object *op, int propcode, MoveType value)
Definition: plugin_common.cpp:340
CFAPI_OBJECT_PROP_NAME_PLURAL
#define CFAPI_OBJECT_PROP_NAME_PLURAL
Definition: plugin.h:135
FLAG_SPLITTING
#define FLAG_SPLITTING
Definition: define.h:266
Crossfire_Object_Apply
static PyObject * Crossfire_Object_Apply(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:761
FLAG_MONSTER
#define FLAG_MONSTER
Definition: define.h:245
FLAG_RANDOM_MOVE
#define FLAG_RANDOM_MOVE
Definition: define.h:309
cf_free_string
void cf_free_string(sstring str)
Definition: plugin_common.cpp:1172
FLAG_HITBACK
#define FLAG_HITBACK
Definition: define.h:267
cf_object_present_archname_inside
object * cf_object_present_archname_inside(object *op, char *whatstr)
Definition: plugin_common.cpp:569
CFAPI_OBJECT_PROP_WIS
#define CFAPI_OBJECT_PROP_WIS
Definition: plugin.h:204
cf_object_pickup
void cf_object_pickup(object *op, object *what)
Definition: plugin_common.cpp:1424
CFAPI_OBJECT_PROP_POW
#define CFAPI_OBJECT_PROP_POW
Definition: plugin.h:206
cf_object_get_archetype_property
archetype * cf_object_get_archetype_property(object *op, int propcode)
Definition: plugin_common.cpp:406
Object_GetMoveSlow
static PyObject * Object_GetMoveSlow(Crossfire_Object *whoptr, void *closure)
Definition: cfpython_object.cpp:453
cf_player_get_marked_item
object * cf_player_get_marked_item(object *op)
Definition: plugin_common.cpp:847
_cfpcontext::talk
struct talk_info * talk
Definition: cfpython.h:102
hashtable.h
CFAPI_OBJECT_PROP_CONTAINER
#define CFAPI_OBJECT_PROP_CONTAINER
Definition: plugin.h:131
FLAG_KNOWN_MAGICAL
#define FLAG_KNOWN_MAGICAL
Definition: define.h:319
Crossfire_Object_Fix
static PyObject * Crossfire_Object_Fix(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:830
cf_object_insert_in_ob
object * cf_object_insert_in_ob(object *op, object *where)
Definition: plugin_common.cpp:1288
Crossfire_Player
Definition: cfpython_object.h:40
CFAPI_OBJECT_PROP_INVENTORY
#define CFAPI_OBJECT_PROP_INVENTORY
Definition: plugin.h:128
CFAPI_OBJECT_PROP_MAP
#define CFAPI_OBJECT_PROP_MAP
Definition: plugin.h:132
find_assoc_value
void * find_assoc_value(ptr_assoc **hash_table, void *key)
Definition: hashtable.cpp:204
cf_object_user_event
int cf_object_user_event(object *op, object *activator, object *third, const char *message, int fix)
Definition: plugin_common.cpp:252
cf_object_move
int cf_object_move(object *op, int dir, object *originator)
Definition: plugin_common.cpp:521
Crossfire_Object_PayAmount
static PyObject * Crossfire_Object_PayAmount(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:1041
diamondslots.message
string message
Definition: diamondslots.py:57
Crossfire_Object_ChangeAbil
static PyObject * Crossfire_Object_ChangeAbil(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:1182
FLAG_REMOVED
#define FLAG_REMOVED
Definition: define.h:232
cf_object_split
object * cf_object_split(object *orig_ob, uint32_t nr, char *err, size_t size)
Definition: plugin_common.cpp:687
cf_player_set_party
void cf_player_set_party(object *op, partylist *party)
Definition: plugin_common.cpp:866
FLAG_REFL_SPELL
#define FLAG_REFL_SPELL
Definition: define.h:275
FLAG_WIZ
#define FLAG_WIZ
Definition: define.h:231
CFAPI_PLAYER_PROP_TRANSPORT
#define CFAPI_PLAYER_PROP_TRANSPORT
Definition: plugin.h:242
obj::type
uint8_t type
Definition: object.h:346
Crossfire_Object_GetResist
static PyObject * Crossfire_Object_GetResist(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:946
Crossfire_Object_ReadKey
static PyObject * Crossfire_Object_ReadKey(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:1067
NDI_UNIQUE
#define NDI_UNIQUE
Definition: newclient.h:262
FLAG_FRIENDLY
#define FLAG_FRIENDLY
Definition: define.h:246
Crossfire_PartyType
PyTypeObject Crossfire_PartyType
ptr_assoc_table
ptr_assoc * ptr_assoc_table[PTR_ASSOC_TABLESIZE]
Definition: hashtable.h:15
CFAPI_OBJECT_PROP_ANIMATION
#define CFAPI_OBJECT_PROP_ANIMATION
Definition: plugin.h:222
CFAPI_OBJECT_PROP_INT
#define CFAPI_OBJECT_PROP_INT
Definition: plugin.h:205
CFAPI_OBJECT_PROP_SP
#define CFAPI_OBJECT_PROP_SP
Definition: plugin.h:211
Object_SetMoveOff
static int Object_SetMoveOff(Crossfire_Object *whoptr, PyObject *value, void *closure)
Definition: cfpython_object.cpp:721
Object_GetOtherArchetype
static PyObject * Object_GetOtherArchetype(Crossfire_Object *whoptr, void *closure)
Definition: cfpython_object.cpp:406
CFAPI_OBJECT_PROP_NAME
#define CFAPI_OBJECT_PROP_NAME
Definition: plugin.h:134
CFAPI_OBJECT_PROP_EXP_MULTIPLIER
#define CFAPI_OBJECT_PROP_EXP_MULTIPLIER
Definition: plugin.h:184
FLAG_USE_ARMOUR
#define FLAG_USE_ARMOUR
Definition: define.h:295
FLAG_CAST_SPELL
#define FLAG_CAST_SPELL
Definition: define.h:290
Crossfire_Object_LearnSpell
static PyObject * Crossfire_Object_LearnSpell(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:986
reputation.victim
victim
Definition: reputation.py:14
cf_object_set_flag
void cf_object_set_flag(object *ob, int flag, int value)
Definition: plugin_common.cpp:1278
Object_GetMoveBlock
static PyObject * Object_GetMoveBlock(Crossfire_Object *whoptr, void *closure)
Definition: cfpython_object.cpp:429
Crossfire_Object_CheckArchInventory
static PyObject * Crossfire_Object_CheckArchInventory(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:1126
give.op
op
Definition: give.py:33
autojail.value
value
Definition: autojail.py:6
EXISTCHECK
#define EXISTCHECK(ob)
Definition: cfpython_object.cpp:33
Player_GetMarkedItem
static PyObject * Player_GetMarkedItem(Crossfire_Player *whoptr, void *closure)
Definition: cfpython_object.cpp:109
Player_GetBedMap
static PyObject * Player_GetBedMap(Crossfire_Player *whoptr, void *closure)
Definition: cfpython_object.cpp:188
CFAPI_PLAYER_PROP_BED_MAP
#define CFAPI_PLAYER_PROP_BED_MAP
Definition: plugin.h:237
cf_object_set_nrof
int cf_object_set_nrof(object *, int nrof)
Definition: plugin_common.cpp:1250
CFAPI_OBJECT_PROP_WC
#define CFAPI_OBJECT_PROP_WC
Definition: plugin.h:208
CFAPI_OBJECT_PROP_GLOW_RADIUS
#define CFAPI_OBJECT_PROP_GLOW_RADIUS
Definition: plugin.h:173
Player_QuestStart
static PyObject * Player_QuestStart(Crossfire_Player *whoptr, PyObject *args)
Definition: cfpython_object.cpp:241
cf_object_check_trigger
int cf_object_check_trigger(object *op, object *cause)
Definition: plugin_common.cpp:1006
Player_GetBedY
static PyObject * Player_GetBedY(Crossfire_Player *whoptr, void *closure)
Definition: cfpython_object.cpp:224
CF_PYTHON_NUMBER_METHODS
CF_PYTHON_NUMBER_METHODS(Object, Crossfire_Object_Long)
CFAPI_OBJECT_PROP_CON
#define CFAPI_OBJECT_PROP_CON
Definition: plugin.h:203
cf_quest_get_player_state
int cf_quest_get_player_state(object *pl, sstring quest_code)
Definition: plugin_common.cpp:2041
find_assoc_pyobject
static PyObject * find_assoc_pyobject(object *key)
Definition: cfpython_object.cpp:68
cf_object_set_long_property
void cf_object_set_long_property(object *op, int propcode, long value)
Definition: plugin_common.cpp:380
Object_GetMoveType
static PyObject * Object_GetMoveType(Crossfire_Object *whoptr, void *closure)
Definition: cfpython_object.cpp:423
Object_SetFlagProperty
static int Object_SetFlagProperty(Crossfire_Object *whoptr, PyObject *value, void *closure)
Definition: cfpython_object.cpp:507
diamondslots.y
y
Definition: diamondslots.py:16
FLAG_BEEN_APPLIED
#define FLAG_BEEN_APPLIED
Definition: define.h:323
python_pickup.where
where
Definition: python_pickup.py:7
cf_object_get_key
const char * cf_object_get_key(object *op, const char *keyname)
Definition: plugin_common.cpp:1627
CFAPI_OBJECT_PROP_GP
#define CFAPI_OBJECT_PROP_GP
Definition: plugin.h:212
Crossfire_Object_dealloc
static void Crossfire_Object_dealloc(PyObject *obj)
Definition: cfpython_object.cpp:1509
CFAPI_OBJECT_PROP_LAST_SP
#define CFAPI_OBJECT_PROP_LAST_SP
Definition: plugin.h:163
Object_getseters
static PyGetSetDef Object_getseters[]
Definition: cfpython_object.cpp:1314
CFAPI_OBJECT_PROP_MATERIAL
#define CFAPI_OBJECT_PROP_MATERIAL
Definition: plugin.h:157
CFAPI_OBJECT_PROP_DURATION
#define CFAPI_OBJECT_PROP_DURATION
Definition: plugin.h:231
CFAPI_OBJECT_PROP_OTHER_ARCH
#define CFAPI_OBJECT_PROP_OTHER_ARCH
Definition: plugin.h:186
Object_GetIntProperty
static PyObject * Object_GetIntProperty(Crossfire_Object *whoptr, void *closure)
Definition: cfpython_object.cpp:314
level
int level
Definition: readable.cpp:1609
CFAPI_OBJECT_PROP_OB_ABOVE
#define CFAPI_OBJECT_PROP_OB_ABOVE
Definition: plugin.h:124
Crossfire_Object_MoveTo
static PyObject * Crossfire_Object_MoveTo(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:1220
Crossfire_Object_Reposition
static PyObject * Crossfire_Object_Reposition(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:926
EXISTCHECK_INT
#define EXISTCHECK_INT(ob)
Definition: cfpython_object.cpp:50
castle_read.key
key
Definition: castle_read.py:64
talk_info::npc_msgs
sstring npc_msgs[MAX_NPC]
Definition: dialog.h:61
FLAG_IS_USED_UP
#define FLAG_IS_USED_UP
Definition: define.h:260
FLAG_ANIMATE
#define FLAG_ANIMATE
Definition: define.h:242
CFAPI_OBJECT_PROP_MOVE_ALLOW
#define CFAPI_OBJECT_PROP_MOVE_ALLOW
Definition: plugin.h:226
Crossfire_Object_Long
static PyObject * Crossfire_Object_Long(PyObject *obj)
Definition: cfpython_object.cpp:1309
Object_SetStringProperty
static int Object_SetStringProperty(Crossfire_Object *whoptr, PyObject *value, void *closure)
Definition: cfpython_object.cpp:466
Object_SetIntProperty
static int Object_SetIntProperty(Crossfire_Object *whoptr, PyObject *value, void *closure)
Definition: cfpython_object.cpp:485
cf_player_get_title
char * cf_player_get_title(object *op, char *title, int size)
Definition: plugin_common.cpp:824
Player_SetBedMap
static int Player_SetBedMap(Crossfire_Player *whoptr, PyObject *value, void *closure)
Definition: cfpython_object.cpp:196
Object_GetMoney
static PyObject * Object_GetMoney(Crossfire_Object *whoptr, void *closure)
Definition: cfpython_object.cpp:388
Object_SetMoveAllow
static int Object_SetMoveAllow(Crossfire_Object *whoptr, PyObject *value, void *closure)
Definition: cfpython_object.cpp:699
Crossfire_Object_Split
static PyObject * Crossfire_Object_Split(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:809
cf_object_set_face
int cf_object_set_face(object *op, const char *face)
Definition: plugin_common.cpp:464
CFAPI_OBJECT_PROP_MOVE_SLOW
#define CFAPI_OBJECT_PROP_MOVE_SLOW
Definition: plugin.h:229
FLAG_UNPAID
#define FLAG_UNPAID
Definition: define.h:236
quest.state
state
Definition: quest.py:13
Player_QuestGetState
static PyObject * Player_QuestGetState(Crossfire_Player *whoptr, PyObject *args)
Definition: cfpython_object.cpp:258
Object_GetArchetype
static PyObject * Object_GetArchetype(Crossfire_Object *whoptr, void *closure)
Definition: cfpython_object.cpp:400
Player_GiveKnowledge
static PyObject * Player_GiveKnowledge(Crossfire_Player *who, PyObject *args)
Definition: cfpython_object.cpp:152
cf_object_change_map
object * cf_object_change_map(object *op, mapstruct *m, object *originator, int flag, int x, int y)
Definition: plugin_common.cpp:632
CFAPI_OBJECT_PROP_LUCK
#define CFAPI_OBJECT_PROP_LUCK
Definition: plugin.h:193
cf_object_forget_spell
void cf_object_forget_spell(object *op, object *sp)
Definition: plugin_common.cpp:758
cf_object_pay_item
int cf_object_pay_item(object *op, object *pl)
Definition: plugin_common.cpp:710
cf_object_insert_object
object * cf_object_insert_object(object *op, object *container)
Definition: plugin_common.cpp:1046
FLAG_XRAYS
#define FLAG_XRAYS
Definition: define.h:300
cf_object_get_resistance
int16_t cf_object_get_resistance(object *op, int rtype)
Definition: plugin_common.cpp:303
cf_object_set_int_property
void cf_object_set_int_property(object *op, int propcode, int value)
Definition: plugin_common.cpp:319
Crossfire_Object_Cast
static PyObject * Crossfire_Object_Cast(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:970
Object_SetEnemy
static int Object_SetEnemy(Crossfire_Object *whoptr, PyObject *value, void *closure)
Definition: cfpython_object.cpp:654
split
static std::vector< std::string > split(const std::string &field, const std::string &by)
Definition: mapper.cpp:2671
free_ptr_assoc
void free_ptr_assoc(ptr_assoc **hash_table, void *key)
Definition: hashtable.cpp:221
CFAPI_OBJECT_PROP_VALUE
#define CFAPI_OBJECT_PROP_VALUE
Definition: plugin.h:160
CFAPI_OBJECT_PROP_MESSAGE
#define CFAPI_OBJECT_PROP_MESSAGE
Definition: plugin.h:140
CFAPI_OBJECT_PROP_MOVE_SLOW_PENALTY
#define CFAPI_OBJECT_PROP_MOVE_SLOW_PENALTY
Definition: plugin.h:230
Crossfire_Object_ActivateRune
static PyObject * Crossfire_Object_ActivateRune(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:863
CFAPI_OBJECT_PROP_MAXGP
#define CFAPI_OBJECT_PROP_MAXGP
Definition: plugin.h:216
CFAPI_OBJECT_PROP_COUNT
#define CFAPI_OBJECT_PROP_COUNT
Definition: plugin.h:133
Crossfire_Player_dealloc
static void Crossfire_Player_dealloc(PyObject *obj)
Definition: cfpython_object.cpp:1535
Object_GetExists
static PyObject * Object_GetExists(Crossfire_Object *whoptr, void *closure)
Definition: cfpython_object.cpp:412
init_ptr_assoc_table
void init_ptr_assoc_table(ptr_assoc **hash_table)
Definition: hashtable.cpp:56
CFAPI_OBJECT_PROP_SUBTYPE
#define CFAPI_OBJECT_PROP_SUBTYPE
Definition: plugin.h:150
cf_object_remove
void cf_object_remove(object *op)
Definition: plugin_common.cpp:552
Crossfire_Object_Arrest
static PyObject * Crossfire_Object_Arrest(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:1259
cf_object_change_exp
void cf_object_change_exp(object *op, int64_t exp, const char *skill_name, int flag)
Definition: plugin_common.cpp:494
Object_SetNamePl
static int Object_SetNamePl(Crossfire_Object *whoptr, PyObject *value, void *closure)
Definition: cfpython_object.cpp:539
Object_SetQuantity
static int Object_SetQuantity(Crossfire_Object *whoptr, PyObject *value, void *closure)
Definition: cfpython_object.cpp:583
Crossfire_Object_PermExp
static PyObject * Crossfire_Object_PermExp(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:1205
Object_GetSStringProperty
static PyObject * Object_GetSStringProperty(Crossfire_Object *whoptr, void *closure)
Definition: cfpython_object.cpp:308
FLAG_USE_SCROLL
#define FLAG_USE_SCROLL
Definition: define.h:291
FLAG_CURSED
#define FLAG_CURSED
Definition: define.h:316
Crossfire_Object_Take
static PyObject * Crossfire_Object_Take(Crossfire_Object *who, PyObject *args)
Definition: cfpython_object.cpp:837
cf_player_get_ip
sstring cf_player_get_ip(object *op)
Definition: plugin_common.cpp:838
Crossfire_Map_wrap
PyObject * Crossfire_Map_wrap(mapstruct *what)
Definition: cfpython_map.cpp:439
CFAPI_OBJECT_PROP_FP
#define CFAPI_OBJECT_PROP_FP
Definition: plugin.h:213
Crossfire_Map
Definition: cfpython_map.h:32
FLAG_IS_THROWN
#define FLAG_IS_THROWN
Definition: define.h:249
Crossfire_Player_new
static PyObject * Crossfire_Player_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
Definition: cfpython_object.cpp:1521
FLAG_SLEEP
#define FLAG_SLEEP
Definition: define.h:307
cf_player_message
void cf_player_message(object *op, char *txt, int flags)
Definition: plugin_common.cpp:777
cf_object_set_object_property
void cf_object_set_object_property(object *op, int propcode, object *value)
Definition: plugin_common.cpp:483
Crossfire_ObjectType
PyTypeObject Crossfire_ObjectType
CFAPI_OBJECT_PROP_LAST_GRACE
#define CFAPI_OBJECT_PROP_LAST_GRACE
Definition: plugin.h:164
cf_object_learn_spell
void cf_object_learn_spell(object *op, object *spell, int special_prayer)
Definition: plugin_common.cpp:746
Crossfire_Player_Message
static PyObject * Crossfire_Player_Message(Crossfire_Player *who, PyObject *args)
Definition: cfpython_object.cpp:129
cf_object_get_int_property
int cf_object_get_int_property(object *op, int propcode)
Definition: plugin_common.cpp:325
cf_quest_was_completed
int cf_quest_was_completed(object *pl, sstring quest_code)
Definition: plugin_common.cpp:2076
Object_GetObjectProperty
static PyObject * Object_GetObjectProperty(Crossfire_Object *whoptr, void *closure)
Definition: cfpython_object.cpp:332
cf_object_get_float_property
float cf_object_get_float_property(object *op, int propcode)
Definition: plugin_common.cpp:398
CFAPI_OBJECT_PROP_DIRECTION
#define CFAPI_OBJECT_PROP_DIRECTION
Definition: plugin.h:147
add_ptr_assoc
void add_ptr_assoc(ptr_assoc **hash_table, void *key, void *value)
Definition: hashtable.cpp:108
cf_object_set_resistance
void cf_object_set_resistance(object *op, int rtype, int16_t value)
Definition: plugin_common.cpp:311
FLAG_LIFESAVE
#define FLAG_LIFESAVE
Definition: define.h:305
Object_GetName
static PyObject * Object_GetName(Crossfire_Object *whoptr, void *closure)
Definition: cfpython_object.cpp:341
cf_object_remove_depletion
int cf_object_remove_depletion(object *op, int level)
Definition: plugin_common.cpp:788
CFAPI_OBJECT_PROP_MATERIAL_NAME
#define CFAPI_OBJECT_PROP_MATERIAL_NAME
Definition: plugin.h:158
is_valid_types_gen.type
list type
Definition: is_valid_types_gen.py:25
FLAG_IS_FLOOR
#define FLAG_IS_FLOOR
Definition: define.h:302
FLAG_IDENTIFIED
#define FLAG_IDENTIFIED
Definition: define.h:261
CFAPI_OBJECT_PROP_WEIGHT_LIMIT
#define CFAPI_OBJECT_PROP_WEIGHT_LIMIT
Definition: plugin.h:171
give.name
name
Definition: give.py:27
CFAPI_OBJECT_PROP_SPEED_LEFT
#define CFAPI_OBJECT_PROP_SPEED_LEFT
Definition: plugin.h:145
Crossfire_Object::count
tag_t count
Definition: cfpython_object.h:35
Crossfire_MapType
PyTypeObject Crossfire_MapType
QuestTriggerConnect.trigger
def trigger()
Definition: QuestTriggerConnect.py:40
level
Definition: level.py:1