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