Crossfire Server, Branches 1.12  R18729
cfpython_object.c
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>
32 #include <hashtable.h>
33 
34 /* Table for keeping track of which PyObject goes with with Crossfire object */
36 
37 /* Helper functions for dealing with object_assoc_table */
40 }
41 
42 static void add_object_assoc(object *key, PyObject *value) {
43  add_ptr_assoc(object_assoc_table, key, value);
44 }
45 
46 static PyObject *find_assoc_pyobject(object *key) {
47  return (PyObject *)find_assoc_value(object_assoc_table, key);
48 }
49 
50 static void free_object_assoc(object *key) {
52 }
53 
54 static PyObject *Player_GetTitle(Crossfire_Object *whoptr, void *closure) {
55  EXISTCHECK(whoptr);
56  return Py_BuildValue("s", cf_player_get_title(whoptr->obj));
57 }
58 
59 static int Player_SetTitle(Crossfire_Object *whoptr, PyObject *value, void *closure) {
60  char *val;
61 
62  EXISTCHECK_INT(whoptr);
63  if (value == NULL) {
64  PyErr_SetString(PyExc_TypeError, "Cannot delete the Title attribute");
65  return -1;
66  }
67  if (!CF_IS_PYSTR(value)) {
68  PyErr_SetString(PyExc_TypeError, "The Title attribute must be a string");
69  return -1;
70  }
71  if (!PyArg_Parse(value, "s", &val))
72  return -1;
73 
74  cf_player_set_title(whoptr->obj, val);
75  return 0;
76 }
77 
78 static PyObject *Player_GetIP(Crossfire_Player *whoptr, void *closure) {
79  EXISTCHECK(whoptr);
80  return Py_BuildValue("s", cf_player_get_ip(whoptr->obj));
81 }
82 
83 static PyObject *Player_GetMarkedItem(Crossfire_Player *whoptr, void *closure) {
84  EXISTCHECK(whoptr);
86 }
87 
88 static int Player_SetMarkedItem(Crossfire_Player *whoptr, PyObject *value, void *closure) {
89  Crossfire_Object *ob;
90 
91  EXISTCHECK_INT(whoptr);
92  if (!PyArg_Parse(value, "O!", &Crossfire_ObjectType, &ob))
93  return -1;
94  cf_player_set_marked_item(whoptr->obj, ob->obj);
95  return 0;
96 }
97 
98 static PyObject *Crossfire_Player_Message(Crossfire_Player *who, PyObject *args) {
99  char *message;
100  int color = NDI_UNIQUE|NDI_ORANGE;
101 
102  EXISTCHECK(who);
103  if (!PyArg_ParseTuple(args, "s|i", &message, &color))
104  return NULL;
105 
106  cf_player_message(who->obj, message, color);
107  Py_INCREF(Py_None);
108  return Py_None;
109 }
110 
111 static PyObject *Player_GetParty(Crossfire_Player *whoptr, void *closure) {
112  EXISTCHECK(whoptr);
114 }
115 
116 static int Player_SetParty(Crossfire_Player *whoptr, PyObject *value, void *closure) {
117  Crossfire_Party *ob;
118 
119  EXISTCHECK_INT(whoptr);
120  if (!PyArg_Parse(value, "O!", &Crossfire_PartyType, &ob))
121  return -1;
122  cf_player_set_party(whoptr->obj, ob->party);
123  return 0;
124 }
125 
126 static PyObject *Crossfire_Player_CanPay(Crossfire_Player *who, PyObject *args) {
127  EXISTCHECK(who);
128  return Py_BuildValue("i", cf_player_can_pay(who->obj));
129 }
130 
131 static PyObject *Player_GetBedMap(Crossfire_Player *whoptr, void *closure) {
132  char bed[200];
133 
134  EXISTCHECK(whoptr);
135  return Py_BuildValue("s", cf_object_get_string_property(whoptr->obj, CFAPI_PLAYER_PROP_BED_MAP, bed, sizeof(bed)));
136 }
137 
138 static int Player_SetBedMap(Crossfire_Player *whoptr, PyObject *value, void *closure) {
139  char *location;
140 
141  EXISTCHECK_INT(whoptr);
142  if (!PyArg_Parse(value, "s", &location))
143  return -1;
145  return 0;
146 }
147 
148 static PyObject *Player_GetBedX(Crossfire_Player *whoptr, void *closure) {
149  EXISTCHECK(whoptr);
150  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_PLAYER_PROP_BED_X));
151 }
152 
153 static int Player_SetBedX(Crossfire_Player *whoptr, PyObject *value, void *closure) {
154  int x;
155 
156  EXISTCHECK_INT(whoptr);
157  if (!PyArg_Parse(value, "i", &x))
158  return -1;
160  return 0;
161 }
162 
163 static PyObject *Player_GetBedY(Crossfire_Player *whoptr, void *closure) {
164  EXISTCHECK(whoptr);
165  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_PLAYER_PROP_BED_Y));
166 }
167 
168 static int Player_SetBedY(Crossfire_Player *whoptr, PyObject *value, void *closure) {
169  int y;
170 
171  EXISTCHECK_INT(whoptr);
172  if (!PyArg_Parse(value, "i", &y))
173  return -1;
175  return 0;
176 }
177 
178 /* Object properties. Get and maybe set. */
179 static PyObject *Object_GetName(Crossfire_Object *whoptr, void *closure) {
180  char name[200];
181 
182  EXISTCHECK(whoptr);
183  return Py_BuildValue("s", cf_query_name(whoptr->obj, name, sizeof(name)));
184 }
185 
186 static PyObject *Object_GetNamePl(Crossfire_Object *whoptr, void *closure) {
187  EXISTCHECK(whoptr);
188  return Py_BuildValue("s", (char *)cf_query_name_pl(whoptr->obj));
189 }
190 
191 static PyObject *Object_GetTitle(Crossfire_Object *whoptr, void *closure) {
192  EXISTCHECK(whoptr);
193  return Py_BuildValue("s", cf_object_get_sstring_property(whoptr->obj, CFAPI_OBJECT_PROP_TITLE));
194 }
195 
196 static PyObject *Object_GetRace(Crossfire_Object *whoptr, void *closure) {
197  EXISTCHECK(whoptr);
198  return Py_BuildValue("s", cf_object_get_sstring_property(whoptr->obj, CFAPI_OBJECT_PROP_RACE));
199 }
200 
201 static PyObject *Object_GetMap(Crossfire_Object *whoptr, void *closure) {
202  mapstruct *m;
203 
204  EXISTCHECK(whoptr);
206  return Crossfire_Map_wrap(m);
207 }
208 
209 static PyObject *Object_GetCha(Crossfire_Object *whoptr, void *closure) {
210  EXISTCHECK(whoptr);
211  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_CHA));
212 }
213 
214 static PyObject *Object_GetCon(Crossfire_Object *whoptr, void *closure) {
215  EXISTCHECK(whoptr);
216  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_CON));
217 }
218 
219 static PyObject *Object_GetDex(Crossfire_Object *whoptr, void *closure) {
220  EXISTCHECK(whoptr);
221  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_DEX));
222 }
223 
224 static PyObject *Object_GetInt(Crossfire_Object *whoptr, void *closure) {
225  EXISTCHECK(whoptr);
226  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_INT));
227 }
228 
229 static PyObject *Object_GetPow(Crossfire_Object *whoptr, void *closure) {
230  EXISTCHECK(whoptr);
231  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_POW));
232 }
233 
234 static PyObject *Object_GetStr(Crossfire_Object *whoptr, void *closure) {
235  EXISTCHECK(whoptr);
236  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_STR));
237 }
238 
239 static PyObject *Object_GetWis(Crossfire_Object *whoptr, void *closure) {
240  EXISTCHECK(whoptr);
241  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_WIS));
242 }
243 
244 static PyObject *Object_GetHP(Crossfire_Object *whoptr, void *closure) {
245  EXISTCHECK(whoptr);
246  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_HP));
247 }
248 
249 static PyObject *Object_GetMaxHP(Crossfire_Object *whoptr, void *closure) {
250  EXISTCHECK(whoptr);
251  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_MAXHP));
252 }
253 
254 static PyObject *Object_GetSP(Crossfire_Object *whoptr, void *closure) {
255  EXISTCHECK(whoptr);
256  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_SP));
257 }
258 
259 static PyObject *Object_GetMaxSP(Crossfire_Object *whoptr, void *closure) {
260  EXISTCHECK(whoptr);
261  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_MAXSP));
262 }
263 
264 static PyObject *Object_GetGrace(Crossfire_Object *whoptr, void *closure) {
265  EXISTCHECK(whoptr);
266  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_GP));
267 }
268 
269 static PyObject *Object_GetMaxGrace(Crossfire_Object *whoptr, void *closure) {
270  EXISTCHECK(whoptr);
271  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_MAXGP));
272 }
273 
274 static PyObject *Object_GetFood(Crossfire_Object *whoptr, void *closure) {
275  EXISTCHECK(whoptr);
276  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_FP));
277 }
278 
279 static PyObject *Object_GetAC(Crossfire_Object *whoptr, void *closure) {
280  EXISTCHECK(whoptr);
281  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_AC));
282 }
283 
284 static PyObject *Object_GetWC(Crossfire_Object *whoptr, void *closure) {
285  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_WC));
286 }
287 
288 static PyObject *Object_GetDam(Crossfire_Object *whoptr, void *closure) {
289  EXISTCHECK(whoptr);
290  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_DAM));
291 }
292 
293 static PyObject *Object_GetLuck(Crossfire_Object *whoptr, void *closure) {
294  EXISTCHECK(whoptr);
295  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_LUCK));
296 }
297 
298 static PyObject *Object_GetMessage(Crossfire_Object *whoptr, void *closure) {
299  EXISTCHECK(whoptr);
300  return Py_BuildValue("s", cf_object_get_sstring_property(whoptr->obj, CFAPI_OBJECT_PROP_MESSAGE));
301 }
302 
303 static PyObject *Object_GetSkill(Crossfire_Object *whoptr, void *closure) {
304  EXISTCHECK(whoptr);
305  return Py_BuildValue("s", cf_object_get_sstring_property(whoptr->obj, CFAPI_OBJECT_PROP_SKILL));
306 }
307 
308 static PyObject *Object_GetExp(Crossfire_Object *whoptr, void *closure) {
309  EXISTCHECK(whoptr);
310  return Py_BuildValue("L", cf_object_get_int64_property(whoptr->obj, CFAPI_OBJECT_PROP_EXP));
311 }
312 
313 static PyObject *Object_GetPermExp(Crossfire_Object *whoptr, void *closure) {
314  EXISTCHECK(whoptr);
315  return Py_BuildValue("L", cf_object_get_int64_property(whoptr->obj, CFAPI_OBJECT_PROP_PERM_EXP));
316 }
317 
318 static PyObject *Object_GetExpMul(Crossfire_Object *whoptr, void *closure) {
319  EXISTCHECK(whoptr);
320  return Py_BuildValue("d", cf_object_get_double_property(whoptr->obj, CFAPI_OBJECT_PROP_EXP_MULTIPLIER));
321 }
322 
323 static PyObject *Object_GetSlaying(Crossfire_Object *whoptr, void *closure) {
324  EXISTCHECK(whoptr);
325  return Py_BuildValue("s", cf_object_get_sstring_property(whoptr->obj, CFAPI_OBJECT_PROP_SLAYING));
326 }
327 
328 static PyObject *Object_GetCursed(Crossfire_Object *whoptr, void *closure) {
329  EXISTCHECK(whoptr);
330  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_CURSED));
331 }
332 
333 static PyObject *Object_GetDamned(Crossfire_Object *whoptr, void *closure) {
334  EXISTCHECK(whoptr);
335  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_DAMNED));
336 }
337 
338 static PyObject *Object_GetWeight(Crossfire_Object *whoptr, void *closure) {
339  EXISTCHECK(whoptr);
340  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_WEIGHT));
341 }
342 
343 static PyObject *Object_GetWeightLimit(Crossfire_Object *whoptr, void *closure) {
344  EXISTCHECK(whoptr);
345  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_WEIGHT_LIMIT));
346 }
347 
348 static PyObject *Object_GetAbove(Crossfire_Object *whoptr, void *closure) {
349  object *op;
350 
351  EXISTCHECK(whoptr);
353  return Crossfire_Object_wrap(op);
354 }
355 
356 static PyObject *Object_GetBelow(Crossfire_Object *whoptr, void *closure) {
357  object *op;
358 
359  EXISTCHECK(whoptr);
361  return Crossfire_Object_wrap(op);
362 }
363 
364 static PyObject *Object_GetInventory(Crossfire_Object *whoptr, void *closure) {
365  object *op;
366 
367  EXISTCHECK(whoptr);
369  return Crossfire_Object_wrap(op);
370 }
371 
372 static PyObject *Object_GetX(Crossfire_Object *whoptr, void *closure) {
373  EXISTCHECK(whoptr);
374  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_X));
375 }
376 
377 static PyObject *Object_GetY(Crossfire_Object *whoptr, void *closure) {
378  EXISTCHECK(whoptr);
379  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_Y));
380 }
381 
382 static PyObject *Object_GetDirection(Crossfire_Object *whoptr, void *closure) {
383  EXISTCHECK(whoptr);
384  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_DIRECTION));
385 }
386 
387 static PyObject *Object_GetFacing(Crossfire_Object *whoptr, void *closure) {
388  EXISTCHECK(whoptr);
389  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_FACING));
390 }
391 
392 static PyObject *Object_GetUnaggressive(Crossfire_Object *whoptr, void *closure) {
393  EXISTCHECK(whoptr);
394  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_UNAGGRESSIVE));
395 }
396 
397 static PyObject *Object_GetGod(Crossfire_Object *whoptr, void *closure) {
398  EXISTCHECK(whoptr);
399  return Py_BuildValue("s", cf_object_get_sstring_property(whoptr->obj, CFAPI_OBJECT_PROP_GOD));
400 }
401 
402 static PyObject *Object_GetPickable(Crossfire_Object *whoptr, void *closure) {
403  EXISTCHECK(whoptr);
404  return Py_BuildValue("i", !cf_object_get_flag(whoptr->obj, FLAG_NO_PICK));
405 }
406 
407 static PyObject *Object_GetQuantity(Crossfire_Object *whoptr, void *closure) {
408  EXISTCHECK(whoptr);
409  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_NROF));
410 }
411 
412 static PyObject *Object_GetInvisible(Crossfire_Object *whoptr, void *closure) {
413  EXISTCHECK(whoptr);
414  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_INVISIBLE));
415 }
416 
417 static PyObject *Object_GetSpeed(Crossfire_Object *whoptr, void *closure) {
418  EXISTCHECK(whoptr);
419  return Py_BuildValue("f", cf_object_get_float_property(whoptr->obj, CFAPI_OBJECT_PROP_SPEED));
420 }
421 
422 static PyObject *Object_GetSpeedLeft(Crossfire_Object *whoptr, void *closure) {
423  EXISTCHECK(whoptr);
424  return Py_BuildValue("f", cf_object_get_float_property(whoptr->obj, CFAPI_OBJECT_PROP_SPEED_LEFT));
425 }
426 
427 static PyObject *Object_GetLastSP(Crossfire_Object *whoptr, void *closure) {
428  EXISTCHECK(whoptr);
429  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_LAST_SP));
430 }
431 
432 static PyObject *Object_GetLastGrace(Crossfire_Object *whoptr, void *closure) {
433  EXISTCHECK(whoptr);
434  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_LAST_GRACE));
435 }
436 
437 static PyObject *Object_GetLastEat(Crossfire_Object *whoptr, void *closure) {
438  EXISTCHECK(whoptr);
439  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_LAST_EAT));
440 }
441 
442 static PyObject *Object_GetLevel(Crossfire_Object *whoptr, void *closure) {
443  EXISTCHECK(whoptr);
444  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_LEVEL));
445 }
446 
447 static PyObject *Object_GetFace(Crossfire_Object *whoptr, void *closure) {
448  EXISTCHECK(whoptr);
449  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_FACE));
450 }
451 
452 static PyObject *Object_GetAnim(Crossfire_Object *whoptr, void *closure) {
453  EXISTCHECK(whoptr);
454  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_ANIMATION));
455 }
456 
457 static PyObject *Object_GetAnimSpeed(Crossfire_Object *whoptr, void *closure) {
458  EXISTCHECK(whoptr);
459  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_ANIM_SPEED));
460 }
461 
462 static PyObject *Object_GetAttackType(Crossfire_Object *whoptr, void *closure) {
463  EXISTCHECK(whoptr);
464  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_ATTACK_TYPE));
465 }
466 
467 static PyObject *Object_GetBeenApplied(Crossfire_Object *whoptr, void *closure) {
468  EXISTCHECK(whoptr);
469  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_BEEN_APPLIED));
470 }
471 
472 static PyObject *Object_GetIdentified(Crossfire_Object *whoptr, void *closure) {
473  EXISTCHECK(whoptr);
474  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_IDENTIFIED));
475 }
476 
477 static PyObject *Object_GetAlive(Crossfire_Object *whoptr, void *closure) {
478  EXISTCHECK(whoptr);
479  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_ALIVE));
480 }
481 
482 static PyObject *Object_GetDM(Crossfire_Object *whoptr, void *closure) {
483  EXISTCHECK(whoptr);
484  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_WIZ));
485 }
486 
487 static PyObject *Object_GetWasDM(Crossfire_Object *whoptr, void *closure) {
488  EXISTCHECK(whoptr);
489  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_WAS_WIZ));
490 }
491 
492 static PyObject *Object_GetApplied(Crossfire_Object *whoptr, void *closure) {
493  EXISTCHECK(whoptr);
494  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_APPLIED));
495 }
496 
497 static PyObject *Object_GetUnpaid(Crossfire_Object *whoptr, void *closure) {
498  EXISTCHECK(whoptr);
499  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_UNPAID));
500 }
501 
502 static PyObject *Object_GetMonster(Crossfire_Object *whoptr, void *closure) {
503  EXISTCHECK(whoptr);
504  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_MONSTER));
505 }
506 
507 static PyObject *Object_GetFriendly(Crossfire_Object *whoptr, void *closure) {
508  EXISTCHECK(whoptr);
509  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_FRIENDLY));
510 }
511 
512 static PyObject *Object_GetGenerator(Crossfire_Object *whoptr, void *closure) {
513  EXISTCHECK(whoptr);
514  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_GENERATOR));
515 }
516 
517 static PyObject *Object_GetThrown(Crossfire_Object *whoptr, void *closure) {
518  EXISTCHECK(whoptr);
519  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_IS_THROWN));
520 }
521 
522 static PyObject *Object_GetCanSeeInvisible(Crossfire_Object *whoptr, void *closure) {
523  EXISTCHECK(whoptr);
524  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_SEE_INVISIBLE));
525 }
526 
527 static PyObject *Object_GetRollable(Crossfire_Object *whoptr, void *closure) {
528  EXISTCHECK(whoptr);
529  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_CAN_ROLL));
530 }
531 
532 static PyObject *Object_GetTurnable(Crossfire_Object *whoptr, void *closure) {
533  EXISTCHECK(whoptr);
534  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_IS_TURNABLE));
535 }
536 
537 static PyObject *Object_GetUsedUp(Crossfire_Object *whoptr, void *closure) {
538  EXISTCHECK(whoptr);
539  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_IS_USED_UP));
540 }
541 
542 static PyObject *Object_GetSplitting(Crossfire_Object *whoptr, void *closure) {
543  EXISTCHECK(whoptr);
544  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_SPLITTING));
545 }
546 
547 static PyObject *Object_GetBlind(Crossfire_Object *whoptr, void *closure) {
548  EXISTCHECK(whoptr);
549  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_BLIND));
550 }
551 
552 static PyObject *Object_GetCanUseHorn(Crossfire_Object *whoptr, void *closure) {
553  EXISTCHECK(whoptr);
554  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_USE_HORN));
555 }
556 
557 static PyObject *Object_GetCanUseRod(Crossfire_Object *whoptr, void *closure) {
558  EXISTCHECK(whoptr);
559  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_USE_ROD));
560 }
561 
562 static PyObject *Object_GetCanUseSkill(Crossfire_Object *whoptr, void *closure) {
563  EXISTCHECK(whoptr);
564  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_CAN_USE_SKILL));
565 }
566 
567 static PyObject *Object_GetKnownCursed(Crossfire_Object *whoptr, void *closure) {
568  EXISTCHECK(whoptr);
569  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_KNOWN_CURSED));
570 }
571 
572 static PyObject *Object_GetStealthy(Crossfire_Object *whoptr, void *closure) {
573  EXISTCHECK(whoptr);
574  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_STEALTH));
575 }
576 
577 static PyObject *Object_GetConfused(Crossfire_Object *whoptr, void *closure) {
578  EXISTCHECK(whoptr);
579  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_CONFUSED));
580 }
581 
582 static PyObject *Object_GetSleeping(Crossfire_Object *whoptr, void *closure) {
583  EXISTCHECK(whoptr);
584  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_SLEEP));
585 }
586 
587 static PyObject *Object_GetLifesaver(Crossfire_Object *whoptr, void *closure) {
588  EXISTCHECK(whoptr);
589  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_LIFESAVE));
590 }
591 
592 static PyObject *Object_GetFloor(Crossfire_Object *whoptr, void *closure) {
593  EXISTCHECK(whoptr);
594  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_IS_FLOOR));
595 }
596 
597 static PyObject *Object_GetHasXRays(Crossfire_Object *whoptr, void *closure) {
598  EXISTCHECK(whoptr);
599  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_XRAYS));
600 }
601 
602 static PyObject *Object_GetCanUseRing(Crossfire_Object *whoptr, void *closure) {
603  EXISTCHECK(whoptr);
604  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_USE_RING));
605 }
606 
607 static PyObject *Object_GetCanUseBow(Crossfire_Object *whoptr, void *closure) {
608  EXISTCHECK(whoptr);
609  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_USE_BOW));
610 }
611 
612 static PyObject *Object_GetCanUseWand(Crossfire_Object *whoptr, void *closure) {
613  EXISTCHECK(whoptr);
614  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_USE_RANGE));
615 }
616 
617 static PyObject *Object_GetCanSeeInDark(Crossfire_Object *whoptr, void *closure) {
618  EXISTCHECK(whoptr);
619  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_SEE_IN_DARK));
620 }
621 
622 static PyObject *Object_GetKnownMagical(Crossfire_Object *whoptr, void *closure) {
623  EXISTCHECK(whoptr);
624  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_KNOWN_MAGICAL));
625 }
626 
627 static PyObject *Object_GetCanUseWeapon(Crossfire_Object *whoptr, void *closure) {
628  EXISTCHECK(whoptr);
629  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_USE_WEAPON));
630 }
631 
632 static PyObject *Object_GetCanUseArmour(Crossfire_Object *whoptr, void *closure) {
633  EXISTCHECK(whoptr);
634  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_USE_ARMOUR));
635 }
636 
637 static PyObject *Object_GetCanUseScroll(Crossfire_Object *whoptr, void *closure) {
638  EXISTCHECK(whoptr);
639  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_USE_SCROLL));
640 }
641 
642 static PyObject *Object_GetCanCastSpell(Crossfire_Object *whoptr, void *closure) {
643  EXISTCHECK(whoptr);
644  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_CAST_SPELL));
645 }
646 
647 static PyObject *Object_GetReflectSpells(Crossfire_Object *whoptr, void *closure) {
648  EXISTCHECK(whoptr);
649  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_REFL_SPELL));
650 }
651 
652 static PyObject *Object_GetReflectMissiles(Crossfire_Object *whoptr, void *closure) {
653  EXISTCHECK(whoptr);
654  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_REFL_MISSILE));
655 }
656 
657 static PyObject *Object_GetUnique(Crossfire_Object *whoptr, void *closure) {
658  EXISTCHECK(whoptr);
659  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_UNIQUE));
660 }
661 
662 static PyObject *Object_GetRunAway(Crossfire_Object *whoptr, void *closure) {
663  EXISTCHECK(whoptr);
664  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_RUN_AWAY));
665 }
666 
667 static PyObject *Object_GetScared(Crossfire_Object *whoptr, void *closure) {
668  EXISTCHECK(whoptr);
669  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_SCARED));
670 }
671 
672 static PyObject *Object_GetUndead(Crossfire_Object *whoptr, void *closure) {
673  EXISTCHECK(whoptr);
674  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_UNDEAD));
675 }
676 
677 static PyObject *Object_GetBlocksView(Crossfire_Object *whoptr, void *closure) {
678  EXISTCHECK(whoptr);
679  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_BLOCKSVIEW));
680 }
681 
682 static PyObject *Object_GetHitBack(Crossfire_Object *whoptr, void *closure) {
683  EXISTCHECK(whoptr);
684  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_HITBACK));
685 }
686 
687 static PyObject *Object_GetStandStill(Crossfire_Object *whoptr, void *closure) {
688  EXISTCHECK(whoptr);
689  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_STAND_STILL));
690 }
691 
692 static PyObject *Object_GetOnlyAttack(Crossfire_Object *whoptr, void *closure) {
693  EXISTCHECK(whoptr);
694  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_ONLY_ATTACK));
695 }
696 
697 static PyObject *Object_GetMakeInvisible(Crossfire_Object *whoptr, void *closure) {
698  EXISTCHECK(whoptr);
699  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_MAKE_INVIS));
700 }
701 
702 static PyObject *Object_GetMoney(Crossfire_Object *whoptr, void *closure) {
703  EXISTCHECK(whoptr);
704  return Py_BuildValue("i", cf_object_query_money(whoptr->obj));
705 }
706 
707 static PyObject *Object_GetType(Crossfire_Object *whoptr, void *closure) {
708  EXISTCHECK(whoptr);
709  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_TYPE));
710 }
711 
712 static PyObject *Object_GetSubtype(Crossfire_Object *whoptr, void *closure) {
713  EXISTCHECK(whoptr);
714  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_SUBTYPE));
715 }
716 
717 static PyObject *Object_GetValue(Crossfire_Object *whoptr, void *closure) {
718  EXISTCHECK(whoptr);
719  return Py_BuildValue("l", cf_object_get_long_property(whoptr->obj, CFAPI_OBJECT_PROP_VALUE));
720 }
721 
722 static PyObject *Object_GetArchName(Crossfire_Object *whoptr, void *closure) {
723  EXISTCHECK(whoptr);
724  return Py_BuildValue("s", cf_object_get_sstring_property(whoptr->obj, CFAPI_OBJECT_PROP_ARCH_NAME));
725 }
726 
727 static PyObject *Object_GetArchetype(Crossfire_Object *whoptr, void *closure) {
728  EXISTCHECK(whoptr);
730 }
731 
732 static PyObject *Object_GetNoSave(Crossfire_Object *whoptr, void *closure) {
733  EXISTCHECK(whoptr);
734  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_NO_SAVE));
735 }
736 
737 static PyObject *Object_GetExists(Crossfire_Object *whoptr, void *closure) {
738  if (!was_destroyed(whoptr->obj, whoptr->obj->count)) {
739  Py_INCREF(Py_True);
740  return Py_True;
741  } else {
742  Py_INCREF(Py_False);
743  return Py_False;
744  }
745 }
746 
747 static PyObject *Object_GetEnv(Crossfire_Object *whoptr, void *closure) {
748  EXISTCHECK(whoptr);
750 }
751 
752 static PyObject *Object_GetMoveType(Crossfire_Object *whoptr, void *closure) {
753  EXISTCHECK(whoptr);
754  return Py_BuildValue("i", cf_object_get_movetype_property(whoptr->obj, CFAPI_OBJECT_PROP_MOVE_TYPE));
755 }
756 
757 static PyObject *Object_GetMoveBlock(Crossfire_Object *whoptr, void *closure) {
758  EXISTCHECK(whoptr);
759  return Py_BuildValue("i", cf_object_get_movetype_property(whoptr->obj, CFAPI_OBJECT_PROP_MOVE_BLOCK));
760 }
761 
762 static PyObject *Object_GetMoveAllow(Crossfire_Object *whoptr, void *closure) {
763  EXISTCHECK(whoptr);
764  return Py_BuildValue("i", cf_object_get_movetype_property(whoptr->obj, CFAPI_OBJECT_PROP_MOVE_ALLOW));
765 }
766 
767 static PyObject *Object_GetMoveOn(Crossfire_Object *whoptr, void *closure) {
768  EXISTCHECK(whoptr);
769  return Py_BuildValue("i", cf_object_get_movetype_property(whoptr->obj, CFAPI_OBJECT_PROP_MOVE_ON));
770 }
771 
772 static PyObject *Object_GetMoveOff(Crossfire_Object *whoptr, void *closure) {
773  EXISTCHECK(whoptr);
774  return Py_BuildValue("i", cf_object_get_movetype_property(whoptr->obj, CFAPI_OBJECT_PROP_MOVE_OFF));
775 }
776 
777 static PyObject *Object_GetMoveSlow(Crossfire_Object *whoptr, void *closure) {
778  EXISTCHECK(whoptr);
779  return Py_BuildValue("i", cf_object_get_movetype_property(whoptr->obj, CFAPI_OBJECT_PROP_MOVE_SLOW));
780 }
781 
782 static PyObject *Object_GetMoveSlowPenalty(Crossfire_Object *whoptr, void *closure) {
783  EXISTCHECK(whoptr);
784  return Py_BuildValue("f", cf_object_get_float_property(whoptr->obj, CFAPI_OBJECT_PROP_MOVE_SLOW_PENALTY));
785 }
786 
787 static PyObject *Object_GetOwner(Crossfire_Object *whoptr, void *closure) {
788  EXISTCHECK(whoptr);
790 }
791 
792 static PyObject *Object_GetEnemy(Crossfire_Object *whoptr, void *closure) {
793  EXISTCHECK(whoptr);
795 }
796 
797 static PyObject *Object_GetCount(Crossfire_Object *whoptr, void *closure) {
798  EXISTCHECK(whoptr);
799  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_COUNT));
800 }
801 
802 static PyObject *Object_GetGodGiven(Crossfire_Object *whoptr, void *closure) {
803  EXISTCHECK(whoptr);
804  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_STARTEQUIP));
805 }
806 
807 static PyObject *Object_GetNoDamage(Crossfire_Object *whoptr, void *closure) {
808  EXISTCHECK(whoptr);
809  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_NO_DAMAGE));
810 }
811 
812 static PyObject *Object_GetRandomMovement(Crossfire_Object *whoptr, void *closure) {
813  EXISTCHECK(whoptr);
814  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_RANDOM_MOVE));
815 }
816 
817 static PyObject *Object_GetIsPet(Crossfire_Object *whoptr, void *closure) {
818  EXISTCHECK(whoptr);
819  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_FRIENDLY));
820 }
821 
822 static PyObject *Object_GetAttackMovement(Crossfire_Object *whoptr, void *closure) {
823  EXISTCHECK(whoptr);
824  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_ATTACK_MOVEMENT));
825 }
826 
827 static PyObject *Object_GetDuration(Crossfire_Object *whoptr, void *closure) {
828  EXISTCHECK(whoptr);
829  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_DURATION));
830 }
831 
832 static PyObject *Object_GetGlowRadius(Crossfire_Object *whoptr, void *closure) {
833  EXISTCHECK(whoptr);
834  return Py_BuildValue("i", cf_object_get_int_property(whoptr->obj, CFAPI_OBJECT_PROP_GLOW_RADIUS));
835 }
836 
837 static PyObject *Object_GetAnimated(Crossfire_Object *whoptr, void *closure) {
838  EXISTCHECK(whoptr);
839  return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_ANIMATE));
840 }
841 
843 static int Object_SetMessage(Crossfire_Object *whoptr, PyObject *value, void *closure) {
844  char *val;
845 
846  EXISTCHECK_INT(whoptr);
847  if (value == NULL) {
848  PyErr_SetString(PyExc_TypeError, "Cannot delete the Message attribute");
849  return -1;
850  }
851  if (!CF_IS_PYSTR(value)) {
852  PyErr_SetString(PyExc_TypeError, "The Message attribute must be a string");
853  return -1;
854  }
855  if (!PyArg_Parse(value, "s", &val))
856  return -1;
857 
859  return 0;
860 }
861 
862 static int Object_SetName(Crossfire_Object *whoptr, PyObject *value, void *closure) {
863  char *val;
864 
865  EXISTCHECK_INT(whoptr);
866  if (value == NULL) {
867  PyErr_SetString(PyExc_TypeError, "Cannot delete the Name attribute");
868  return -1;
869  }
870  if (!CF_IS_PYSTR(value)) {
871  PyErr_SetString(PyExc_TypeError, "The Name attribute must be a string");
872  return -1;
873  }
874  if (!PyArg_Parse(value, "s", &val))
875  return -1;
876 
879  return 0;
880 }
881 
882 static int Object_SetNamePl(Crossfire_Object *whoptr, PyObject *value, void *closure) {
883  char *val;
884 
885  EXISTCHECK_INT(whoptr);
886  if (value == NULL) {
887  PyErr_SetString(PyExc_TypeError, "Cannot delete the NamePl attribute");
888  return -1;
889  }
890  if (!CF_IS_PYSTR(value)) {
891  PyErr_SetString(PyExc_TypeError, "The NamePl attribute must be a string");
892  return -1;
893  }
894  if (!PyArg_Parse(value, "s", &val))
895  return -1;
896 
898  return 0;
899 }
900 
901 static int Object_SetTitle(Crossfire_Object *whoptr, PyObject *value, void *closure) {
902  char *val;
903 
904  EXISTCHECK_INT(whoptr);
905  if (value == NULL) {
906  PyErr_SetString(PyExc_TypeError, "Cannot delete the Title attribute");
907  return -1;
908  }
909  if (!CF_IS_PYSTR(value)) {
910  PyErr_SetString(PyExc_TypeError, "The Title attribute must be a string");
911  return -1;
912  }
913  if (!PyArg_Parse(value, "s", &val))
914  return -1;
915 
917  return 0;
918 }
919 
920 static int Object_SetRace(Crossfire_Object *whoptr, PyObject *value, void *closure) {
921  char *val;
922 
923  EXISTCHECK_INT(whoptr);
924  if (value == NULL) {
925  PyErr_SetString(PyExc_TypeError, "Cannot delete the Race attribute");
926  return -1;
927  }
928  if (!CF_IS_PYSTR(value)) {
929  PyErr_SetString(PyExc_TypeError, "The Race attribute must be a string");
930  return -1;
931  }
932  if (!PyArg_Parse(value, "s", &val))
933  return -1;
934 
936  return 0;
937 }
938 
939 static int Object_SetMap(Crossfire_Object *whoptr, PyObject *value, void *closure) {
940  Crossfire_Map *val;
941 
942  EXISTCHECK_INT(whoptr);
943  if (!PyArg_Parse(value, "O!", &Crossfire_MapType, &val))
944  return -1;
945 
946  cf_object_change_map(whoptr->obj, val->map, NULL, 0, -1, -1);
947  return 0;
948 }
949 
950 static int Object_SetSlaying(Crossfire_Object *whoptr, PyObject *value, void *closure) {
951  char *val;
952 
953  EXISTCHECK_INT(whoptr);
954  if (value == NULL) {
955  PyErr_SetString(PyExc_TypeError, "Cannot delete the Slaying attribute");
956  return -1;
957  }
958  if (!CF_IS_PYSTR(value)) {
959  PyErr_SetString(PyExc_TypeError, "The Slaying attribute must be a string");
960  return -1;
961  }
962  if (!PyArg_Parse(value, "s", &val))
963  return -1;
964 
966  return 0;
967 }
968 
969 static int Object_SetSkill(Crossfire_Object *whoptr, PyObject *value, void *closure) {
970  char *val;
971 
972  EXISTCHECK_INT(whoptr);
973  if (value == NULL) {
974  PyErr_SetString(PyExc_TypeError, "Cannot delete the Skill attribute");
975  return -1;
976  }
977  if (!CF_IS_PYSTR(value)) {
978  PyErr_SetString(PyExc_TypeError, "The Skill attribute must be a string");
979  return -1;
980  }
981  if (!PyArg_Parse(value, "s", &val))
982  return -1;
983 
985  return 0;
986 }
987 
988 static int Object_SetCursed(Crossfire_Object *whoptr, PyObject *value, void *closure) {
989  int val;
990 
991  EXISTCHECK_INT(whoptr);
992  if (!PyArg_Parse(value, "i", &val))
993  return -1;
994 
995  cf_object_set_flag(whoptr->obj, FLAG_CURSED, val);
996  return 0;
997 }
998 
999 static int Object_SetDamned(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1000  int val;
1001 
1002  EXISTCHECK_INT(whoptr);
1003  if (!PyArg_Parse(value, "i", &val))
1004  return -1;
1005 
1006  cf_object_set_flag(whoptr->obj, FLAG_DAMNED, val);
1007  return 0;
1008 }
1009 
1010 static int Object_SetApplied(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1011  int val;
1012 
1013  EXISTCHECK_INT(whoptr);
1014  if (!PyArg_Parse(value, "i", &val))
1015  return -1;
1016 
1017  cf_object_set_flag(whoptr->obj, FLAG_APPLIED, val);
1018  return 0;
1019 }
1020 
1021 static int Object_SetStr(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1022  int val;
1023 
1024  EXISTCHECK_INT(whoptr);
1025  if (!PyArg_Parse(value, "i", &val))
1026  return -1;
1027 
1029 /* cf_fix_object(whoptr->obj);*/
1030  return 0;
1031 }
1032 
1033 static int Object_SetDex(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1034  int val;
1035 
1036  EXISTCHECK_INT(whoptr);
1037  if (!PyArg_Parse(value, "i", &val))
1038  return -1;
1039 
1041  /*cf_fix_object(whoptr->obj);*/
1042  return 0;
1043 }
1044 
1045 static int Object_SetCon(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1046  int val;
1047 
1048  EXISTCHECK_INT(whoptr);
1049  if (!PyArg_Parse(value, "i", &val))
1050  return -1;
1051 
1053  /*cf_fix_object(whoptr->obj);*/
1054  return 0;
1055 }
1056 
1057 static int Object_SetInt(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1058  int val;
1059 
1060  EXISTCHECK_INT(whoptr);
1061  if (!PyArg_Parse(value, "i", &val))
1062  return -1;
1063 
1065  /*cf_fix_object(whoptr->obj);*/
1066  return 0;
1067 }
1068 
1069 static int Object_SetPow(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1070  int val;
1071 
1072  EXISTCHECK_INT(whoptr);
1073  if (!PyArg_Parse(value, "i", &val))
1074  return -1;
1075 
1077  /*cf_fix_object(whoptr->obj);*/
1078  return 0;
1079 }
1080 
1081 static int Object_SetWis(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1082  int val;
1083 
1084  EXISTCHECK_INT(whoptr);
1085  if (!PyArg_Parse(value, "i", &val))
1086  return -1;
1087 
1089  /*cf_fix_object(whoptr->obj);*/
1090  return 0;
1091 }
1092 
1093 static int Object_SetCha(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1094  int val;
1095 
1096  EXISTCHECK_INT(whoptr);
1097  if (!PyArg_Parse(value, "i", &val))
1098  return -1;
1099 
1101  /*cf_fix_object(whoptr->obj);*/
1102  return 0;
1103 }
1104 
1105 static int Object_SetHP(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1106  int val;
1107 
1108  EXISTCHECK_INT(whoptr);
1109  if (!PyArg_Parse(value, "i", &val))
1110  return -1;
1111 
1113  return 0;
1114 }
1115 
1116 static int Object_SetMaxHP(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1117  int val;
1118 
1119  EXISTCHECK_INT(whoptr);
1120  if (!PyArg_Parse(value, "i", &val))
1121  return -1;
1122 
1124  return 0;
1125 }
1126 
1127 static int Object_SetSP(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1128  int val;
1129 
1130  EXISTCHECK_INT(whoptr);
1131  if (!PyArg_Parse(value, "i", &val))
1132  return -1;
1133 
1135  return 0;
1136 }
1137 
1138 static int Object_SetMaxSP(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1139  int val;
1140 
1141  EXISTCHECK_INT(whoptr);
1142  if (!PyArg_Parse(value, "i", &val))
1143  return -1;
1144 
1146  return 0;
1147 }
1148 
1149 static int Object_SetGrace(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1150  int val;
1151 
1152  EXISTCHECK_INT(whoptr);
1153  if (!PyArg_Parse(value, "i", &val))
1154  return -1;
1155 
1157  return 0;
1158 }
1159 
1160 static int Object_SetMaxGrace(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1161  int val;
1162 
1163  EXISTCHECK_INT(whoptr);
1164  if (!PyArg_Parse(value, "i", &val))
1165  return -1;
1166 
1168  return 0;
1169 }
1170 
1171 static int Object_SetAC(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1172  int val;
1173 
1174  EXISTCHECK_INT(whoptr);
1175  if (!PyArg_Parse(value, "i", &val))
1176  return -1;
1177 
1179  return 0;
1180 }
1181 
1182 static int Object_SetWC(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1183  int val;
1184 
1185  EXISTCHECK_INT(whoptr);
1186  if (!PyArg_Parse(value, "i", &val))
1187  return -1;
1188 
1190  return 0;
1191 }
1192 
1193 static int Object_SetDam(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1194  int val;
1195 
1196  EXISTCHECK_INT(whoptr);
1197  if (!PyArg_Parse(value, "i", &val))
1198  return -1;
1199 
1201  return 0;
1202 }
1203 
1204 static int Object_SetFood(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1205  int val;
1206 
1207  EXISTCHECK_INT(whoptr);
1208  if (!PyArg_Parse(value, "i", &val))
1209  return -1;
1210 
1212  return 0;
1213 }
1214 
1215 static int Object_SetWeight(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1216  int val;
1217 
1218  EXISTCHECK_INT(whoptr);
1219  if (!PyArg_Parse(value, "i", &val))
1220  return -1;
1221 
1223  return 0;
1224 }
1225 
1226 static int Object_SetWeightLimit(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1227  int val;
1228 
1229  EXISTCHECK_INT(whoptr);
1230  if (!PyArg_Parse(value, "i", &val))
1231  return -1;
1232 
1234  return 0;
1235 }
1236 
1237 static int Object_SetDirection(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1238  int val;
1239 
1240  EXISTCHECK_INT(whoptr);
1241  if (!PyArg_Parse(value, "i", &val))
1242  return -1;
1243 
1245  return 0;
1246 }
1247 
1248 static int Object_SetFacing(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1249  int val;
1250 
1251  EXISTCHECK_INT(whoptr);
1252  if (!PyArg_Parse(value, "i", &val))
1253  return -1;
1254 
1256  return 0;
1257 }
1258 
1259 static int Object_SetGod(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1260  char *val;
1261 
1262  EXISTCHECK_INT(whoptr);
1263  if (!PyArg_Parse(value, "s", &val))
1264  return -1;
1265 
1267  return 0;
1268 }
1269 
1270 static int Object_SetSpeed(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1271  float val;
1272 
1273  EXISTCHECK_INT(whoptr);
1274  if (!PyArg_Parse(value, "f", &val))
1275  return -1;
1276 
1278 /* cf_fix_object(whoptr->obj);*/
1279  return 0;
1280 }
1281 
1282 static int Object_SetSpeedLeft(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1283  float val;
1284 
1285  EXISTCHECK_INT(whoptr);
1286  if (!PyArg_Parse(value, "f", &val))
1287  return -1;
1288 
1290 /* cf_fix_object(whoptr->obj);*/
1291  return 0;
1292 }
1293 
1294 static int Object_SetQuantity(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1295  int val;
1296 
1297  EXISTCHECK_INT(whoptr);
1298  if (!PyArg_Parse(value, "i", &val))
1299  return -1;
1300 
1301  if (cf_object_set_nrof(whoptr->obj, val) != 0) {
1302  PyErr_SetString(PyExc_TypeError, "Invalid quantity");
1303  return -1;
1304  }
1305 
1306 /* cf_fix_object(whoptr->obj);*/
1307  return 0;
1308 }
1309 
1310 static int Object_SetLastSP(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1311  int val;
1312 
1313  EXISTCHECK_INT(whoptr);
1314  if (!PyArg_Parse(value, "i", &val))
1315  return -1;
1316 
1318 /* cf_fix_object(whoptr->obj);*/
1319  return 0;
1320 }
1321 
1322 static int Object_SetLastGrace(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1323  int val;
1324 
1325  EXISTCHECK_INT(whoptr);
1326  if (!PyArg_Parse(value, "i", &val))
1327  return -1;
1328 
1330 /* cf_fix_object(whoptr->obj);*/
1331  return 0;
1332 }
1333 
1334 static int Object_SetLastEat(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1335  int val;
1336 
1337  EXISTCHECK_INT(whoptr);
1338  if (!PyArg_Parse(value, "i", &val))
1339  return -1;
1340 
1342  return 0;
1343 }
1344 
1345 static int Object_SetFace(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1346  char *txt;
1347  int face;
1348 
1349  EXISTCHECK_INT(whoptr);
1350  if (!PyArg_Parse(value, "s", &txt))
1351  return -1;
1352 
1353  face = cf_find_face(txt, -1);
1354  if (face == -1) {
1355  PyErr_SetString(PyExc_TypeError, "Unknown face.");
1356  return -1;
1357  }
1358 
1360  return 0;
1361 }
1362 
1363 static int Object_SetAnim(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1364  char *txt;
1365  int anim;
1366 
1367  EXISTCHECK_INT(whoptr);
1368  if (!PyArg_Parse(value, "s", &txt))
1369  return -1;
1370 
1371  anim = cf_find_animation(txt);
1372  if (anim == 0) {
1373  PyErr_SetString(PyExc_TypeError, "Unknown animation.");
1374  return -1;
1375  }
1376 
1378  return 0;
1379 }
1380 
1381 static int Object_SetAnimSpeed(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1382  int val;
1383 
1384  EXISTCHECK_INT(whoptr);
1385  if (!PyArg_Parse(value, "i", &val))
1386  return -1;
1387 
1389  return 0;
1390 }
1391 
1392 static int Object_SetAttackType(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1393  int val;
1394 
1395  EXISTCHECK_INT(whoptr);
1396  if (!PyArg_Parse(value, "i", &val))
1397  return -1;
1398 
1400 /* cf_fix_object(whoptr->obj);*/
1401  return 0;
1402 }
1403 
1404 static int Object_SetIdentified(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1405  int val;
1406 
1407  EXISTCHECK_INT(whoptr);
1408  if (!PyArg_Parse(value, "i", &val))
1409  return -1;
1410 
1411  cf_object_set_flag(whoptr->obj, FLAG_IDENTIFIED, val);
1412  return 0;
1413 }
1414 
1415 static int Object_SetUnaggressive(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1416  int val;
1417 
1418  EXISTCHECK_INT(whoptr);
1419  if (!PyArg_Parse(value, "i", &val))
1420  return -1;
1421 
1422  cf_object_set_flag(whoptr->obj, FLAG_UNAGGRESSIVE, val);
1423  return 0;
1424 }
1425 
1426 static int Object_SetPickable(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1427  int val;
1428 
1429  EXISTCHECK_INT(whoptr);
1430  if (!PyArg_Parse(value, "i", &val))
1431  return -1;
1432 
1433  cf_object_set_flag(whoptr->obj, FLAG_NO_PICK, !val);
1434  return 0;
1435 }
1436 
1437 static int Object_SetInvisible(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1438  int val;
1439 
1440  EXISTCHECK_INT(whoptr);
1441  if (!PyArg_ParseTuple(value, "i", &val))
1442  return -1;
1443 
1445  return 0;
1446 }
1447 
1448 static int Object_SetUnpaid(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1449  int val;
1450 
1451  EXISTCHECK_INT(whoptr);
1452  if (!PyArg_Parse(value, "i", &val))
1453  return -1;
1454 
1455  cf_object_set_flag(whoptr->obj, FLAG_UNPAID, val);
1456  return 0;
1457 }
1458 
1459 static int Object_SetFriendly(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1460  int val;
1461 
1462  EXISTCHECK_INT(whoptr);
1463  if (!PyArg_Parse(value, "i", &val))
1464  return -1;
1465 
1466  cf_object_set_flag(whoptr->obj, FLAG_FRIENDLY, val);
1467  return 0;
1468 }
1469 
1470 static int Object_SetCanSeeInvisible(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1471  int val;
1472 
1473  EXISTCHECK_INT(whoptr);
1474  if (!PyArg_Parse(value, "i", &val))
1475  return -1;
1476 
1477  cf_object_set_flag(whoptr->obj, FLAG_SEE_INVISIBLE, val);
1478  return 0;
1479 }
1480 
1481 static int Object_SetRollable(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1482  int val;
1483 
1484  EXISTCHECK_INT(whoptr);
1485  if (!PyArg_Parse(value, "i", &val))
1486  return -1;
1487 
1488  cf_object_set_flag(whoptr->obj, FLAG_CAN_ROLL, val);
1489  return 0;
1490 }
1491 
1492 static int Object_SetTurnable(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1493  int val;
1494 
1495  EXISTCHECK_INT(whoptr);
1496  if (!PyArg_Parse(value, "i", &val))
1497  return -1;
1498 
1499  cf_object_set_flag(whoptr->obj, FLAG_IS_TURNABLE, val);
1500  return 0;
1501 }
1502 
1503 static int Object_SetUsedUp(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1504  int val;
1505 
1506  EXISTCHECK_INT(whoptr);
1507  if (!PyArg_Parse(value, "i", &val))
1508  return -1;
1509 
1510  cf_object_set_flag(whoptr->obj, FLAG_IS_USED_UP, val);
1511  return 0;
1512 }
1513 
1514 static int Object_SetBlind(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1515  int val;
1516 
1517  EXISTCHECK_INT(whoptr);
1518  if (!PyArg_Parse(value, "i", &val))
1519  return -1;
1520 
1521  cf_object_set_flag(whoptr->obj, FLAG_BLIND, val);
1522  return 0;
1523 }
1524 
1525 static int Object_SetKnownCursed(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1526  int val;
1527 
1528  EXISTCHECK_INT(whoptr);
1529  if (!PyArg_Parse(value, "i", &val))
1530  return -1;
1531 
1532  cf_object_set_flag(whoptr->obj, FLAG_KNOWN_CURSED, val);
1533  return 0;
1534 }
1535 
1536 static int Object_SetStealthy(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1537  int val;
1538 
1539  EXISTCHECK_INT(whoptr);
1540  if (!PyArg_Parse(value, "i", &val))
1541  return -1;
1542 
1543  cf_object_set_flag(whoptr->obj, FLAG_STEALTH, val);
1544  return 0;
1545 }
1546 
1547 static int Object_SetConfused(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1548  int val;
1549 
1550  EXISTCHECK_INT(whoptr);
1551  if (!PyArg_Parse(value, "i", &val))
1552  return -1;
1553 
1554  cf_object_set_flag(whoptr->obj, FLAG_CONFUSED, val);
1555  return 0;
1556 }
1557 
1558 static int Object_SetSleeping(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1559  int val;
1560 
1561  EXISTCHECK_INT(whoptr);
1562  if (!PyArg_Parse(value, "i", &val))
1563  return -1;
1564 
1565  cf_object_set_flag(whoptr->obj, FLAG_SLEEP, val);
1566  return 0;
1567 }
1568 
1569 static int Object_SetLifesaver(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1570  int val;
1571 
1572  EXISTCHECK_INT(whoptr);
1573  if (!PyArg_Parse(value, "i", &val))
1574  return -1;
1575 
1576  cf_object_set_flag(whoptr->obj, FLAG_LIFESAVE, val);
1577  return 0;
1578 }
1579 
1580 static int Object_SetHasXRays(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1581  int val;
1582 
1583  EXISTCHECK_INT(whoptr);
1584  if (!PyArg_Parse(value, "i", &val))
1585  return -1;
1586 
1587  cf_object_set_flag(whoptr->obj, FLAG_XRAYS, val);
1588  return 0;
1589 }
1590 
1591 static int Object_SetCanSeeInDark(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1592  int val;
1593 
1594  EXISTCHECK_INT(whoptr);
1595  if (!PyArg_Parse(value, "i", &val))
1596  return -1;
1597 
1598  cf_object_set_flag(whoptr->obj, FLAG_SEE_IN_DARK, val);
1599  return 0;
1600 }
1601 
1602 static int Object_SetKnownMagical(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1603  int val;
1604 
1605  EXISTCHECK_INT(whoptr);
1606  if (!PyArg_Parse(value, "i", &val))
1607  return -1;
1608 
1609  cf_object_set_flag(whoptr->obj, FLAG_KNOWN_MAGICAL, val);
1610  return 0;
1611 }
1612 
1613 static int Object_SetReflectSpells(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1614  int val;
1615 
1616  EXISTCHECK_INT(whoptr);
1617  if (!PyArg_Parse(value, "i", &val))
1618  return -1;
1619 
1620  cf_object_set_flag(whoptr->obj, FLAG_REFL_SPELL, val);
1621  return 0;
1622 }
1623 
1624 static int Object_SetReflectMissiles(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1625  int val;
1626 
1627  EXISTCHECK_INT(whoptr);
1628  if (!PyArg_Parse(value, "i", &val))
1629  return -1;
1630 
1631  cf_object_set_flag(whoptr->obj, FLAG_REFL_MISSILE, val);
1632  return 0;
1633 }
1634 
1635 static int Object_SetUnique(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1636  int val;
1637 
1638  EXISTCHECK_INT(whoptr);
1639  if (!PyArg_Parse(value, "i", &val))
1640  return -1;
1641 
1642  cf_object_set_flag(whoptr->obj, FLAG_UNIQUE, val);
1643  return 0;
1644 }
1645 
1646 static int Object_SetCanPassThru(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1647  int val;
1648 
1649  EXISTCHECK_INT(whoptr);
1650  if (!PyArg_Parse(value, "i", &val))
1651  return -1;
1652  /* FIXME */
1653  /*cf_object_set_flag(whoptr->obj, FLAG_CAN_PASS_THRU, val);*/
1654  return 0;
1655 }
1656 
1657 static int Object_SetRunAway(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1658  int val;
1659 
1660  EXISTCHECK_INT(whoptr);
1661  if (!PyArg_Parse(value, "i", &val))
1662  return -1;
1663 
1664  cf_object_set_flag(whoptr->obj, FLAG_RUN_AWAY, val);
1665  return 0;
1666 }
1667 
1668 static int Object_SetScared(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1669  int val;
1670 
1671  EXISTCHECK_INT(whoptr);
1672  if (!PyArg_Parse(value, "i", &val))
1673  return -1;
1674 
1675  cf_object_set_flag(whoptr->obj, FLAG_SCARED, val);
1676  return 0;
1677 }
1678 
1679 static int Object_SetUndead(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1680  int val;
1681 
1682  EXISTCHECK_INT(whoptr);
1683  if (!PyArg_Parse(value, "i", &val))
1684  return -1;
1685 
1686  cf_object_set_flag(whoptr->obj, FLAG_UNDEAD, val);
1687  return 0;
1688 }
1689 
1690 static int Object_SetBlocksView(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1691  int val;
1692 
1693  EXISTCHECK_INT(whoptr);
1694  if (!PyArg_Parse(value, "i", &val))
1695  return -1;
1696 
1697  cf_object_set_flag(whoptr->obj, FLAG_BLOCKSVIEW, val);
1698  return 0;
1699 }
1700 
1701 static int Object_SetHitBack(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1702  int val;
1703 
1704  EXISTCHECK_INT(whoptr);
1705  if (!PyArg_Parse(value, "i", &val))
1706  return -1;
1707 
1708  cf_object_set_flag(whoptr->obj, FLAG_HITBACK, val);
1709  return 0;
1710 }
1711 
1712 static int Object_SetStandStill(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1713  int val;
1714 
1715  EXISTCHECK_INT(whoptr);
1716  if (!PyArg_Parse(value, "i", &val))
1717  return -1;
1718 
1719  cf_object_set_flag(whoptr->obj, FLAG_STAND_STILL, val);
1720  return 0;
1721 }
1722 
1723 static int Object_SetOnlyAttack(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1724  int val;
1725 
1726  EXISTCHECK_INT(whoptr);
1727  if (!PyArg_Parse(value, "i", &val))
1728  return -1;
1729 
1730  cf_object_set_flag(whoptr->obj, FLAG_ONLY_ATTACK, val);
1731  return 0;
1732 }
1733 
1734 static int Object_SetMakeInvisible(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1735  int val;
1736 
1737  EXISTCHECK_INT(whoptr);
1738  if (!PyArg_Parse(value, "i", &val))
1739  return -1;
1740 
1741  cf_object_set_flag(whoptr->obj, FLAG_MAKE_INVIS, val);
1742  return 0;
1743 }
1744 
1745 static int Object_SetValue(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1746  long val;
1747 
1748  EXISTCHECK_INT(whoptr);
1749  if (!PyArg_Parse(value, "l", &val))
1750  return -1;
1751 
1753  return 0;
1754 }
1755 
1756 static int Object_SetNoSave(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1757  long val;
1758 
1759  EXISTCHECK_INT(whoptr);
1760  if (!PyArg_Parse(value, "i", &val))
1761  return -1;
1762 
1764  return 0;
1765 }
1766 
1767 static int Object_SetOwner(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1768  Crossfire_Object *ob;
1769 
1770  EXISTCHECK_INT(whoptr);
1771  if (!PyArg_Parse(value, "O!", &Crossfire_ObjectType, &ob))
1772  return -1;
1774  return 0;
1775 }
1776 
1777 static int Object_SetEnemy(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1778  Crossfire_Object *ob;
1779 
1780  EXISTCHECK_INT(whoptr);
1781  if (!PyArg_Parse(value, "O!", &Crossfire_ObjectType, &ob))
1782  return -1;
1784  return 0;
1785 }
1786 
1787 static int Object_SetGodGiven(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1788  int val;
1789 
1790  EXISTCHECK_INT(whoptr);
1791  if (!PyArg_Parse(value, "i", &val))
1792  return -1;
1793 
1794  cf_object_set_flag(whoptr->obj, FLAG_STARTEQUIP, val);
1795  return 0;
1796 }
1797 
1798 static int Object_SetNoDamage(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1799  int val;
1800 
1801  EXISTCHECK_INT(whoptr);
1802  if (!PyArg_Parse(value, "i", &val))
1803  return -1;
1804 
1805  cf_object_set_flag(whoptr->obj, FLAG_NO_DAMAGE, val);
1806  return 0;
1807 }
1808 
1809 static int Object_SetRandomMovement(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1810  int val;
1811 
1812  EXISTCHECK_INT(whoptr);
1813  if (!PyArg_Parse(value, "i", &val))
1814  return -1;
1815 
1816  cf_object_set_flag(whoptr->obj, FLAG_RANDOM_MOVE, val);
1817  return 0;
1818 }
1819 
1820 static int Object_SetIsPet(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1821  int val;
1822 
1823  EXISTCHECK_INT(whoptr);
1824  if (!PyArg_Parse(value, "i", &val))
1825  return -1;
1826 
1828  return 0;
1829 }
1830 
1831 static int Object_SetAttackMovement(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1832  int val;
1833 
1834  EXISTCHECK_INT(whoptr);
1835  if (!PyArg_Parse(value, "i", &val))
1836  return -1;
1837 
1839  return 0;
1840 }
1841 
1842 static int Object_SetExp(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1843  sint64 val;
1844 
1845  EXISTCHECK_INT(whoptr);
1846  if (!PyArg_Parse(value, "L", &val))
1847  return -1;
1848 
1850  return 0;
1851 }
1852 
1853 static int Object_SetDuration(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1854  int val;
1855 
1856  EXISTCHECK_INT(whoptr);
1857  if (!PyArg_Parse(value, "i", &val))
1858  return -1;
1859 
1861  return 0;
1862 }
1863 
1864 static int Object_SetGlowRadius(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1865  int val;
1866 
1867  EXISTCHECK_INT(whoptr);
1868  if (!PyArg_Parse(value, "i", &val))
1869  return -1;
1870 
1872  return 0;
1873 }
1874 
1875 static int Object_SetAnimated(Crossfire_Object *whoptr, PyObject *value, void *closure) {
1876  int val;
1877 
1878  EXISTCHECK_INT(whoptr);
1879  if (!PyArg_Parse(value, "i", &val))
1880  return -1;
1881  cf_object_set_flag(whoptr->obj, FLAG_ANIMATE, val);
1882  return 0;
1883 }
1884 
1885 /* Methods. */
1886 
1887 static PyObject *Crossfire_Object_Remove(Crossfire_Object *who, PyObject *args) {
1888  EXISTCHECK(who);
1889 
1890  if ((current_context->who != NULL) && (((Crossfire_Object *)current_context->who)->obj == who->obj))
1891  current_context->who = NULL;
1892 
1893  if (!cf_object_get_flag(who->obj, FLAG_REMOVED)) {
1894  cf_object_remove(who->obj);
1895  }
1896 
1897  cf_object_free(who->obj);
1898  Py_INCREF(Py_None);
1899  return Py_None;
1900 }
1901 
1902 static PyObject *Crossfire_Object_Apply(Crossfire_Object *who, PyObject *args) {
1903  Crossfire_Object *whoptr;
1904  int flags;
1905 
1906  if (!PyArg_ParseTuple(args, "O!i", &Crossfire_ObjectType, &whoptr, &flags))
1907  return NULL;
1908  EXISTCHECK(who);
1909  EXISTCHECK(whoptr);
1910 
1911  return Py_BuildValue("i", cf_object_apply(whoptr->obj, who->obj, flags));
1912 }
1913 
1914 static PyObject *Crossfire_Object_Drop(Crossfire_Object *who, PyObject *args) {
1915  /* Note that this function uses the METH_O calling convention. */
1916  Crossfire_Object *whoptr = (Crossfire_Object*)args;
1917 
1918  EXISTCHECK(who);
1919  TYPEEXISTCHECK(whoptr);
1920 
1921  cf_object_drop(whoptr->obj, who->obj);
1922  Py_INCREF(Py_None);
1923  return Py_None;
1924 }
1925 
1926 static PyObject *Crossfire_Object_Fix(Crossfire_Object *who, PyObject *args) {
1927  cf_fix_object(who->obj);
1928  Py_INCREF(Py_None);
1929  return Py_None;
1930 }
1931 
1932 static PyObject *Crossfire_Object_Take(Crossfire_Object *who, PyObject *args) {
1933  /* Note that this function uses the METH_O calling convention. */
1934  Crossfire_Object *whoptr = (Crossfire_Object*)args;
1935 
1936  EXISTCHECK(who);
1937  TYPEEXISTCHECK(whoptr);
1938 
1939  cf_object_pickup(whoptr->obj, who->obj);
1940  Py_INCREF(Py_None);
1941  return Py_None;
1942 }
1943 
1944 static PyObject *Crossfire_Object_Teleport(Crossfire_Object *who, PyObject *args) {
1945  Crossfire_Map *where;
1946  int x, y;
1947  int val;
1948 
1949  EXISTCHECK(who);
1950  if (!PyArg_ParseTuple(args, "O!ii", &Crossfire_MapType, &where, &x, &y))
1951  return NULL;
1952 
1953  val = cf_object_teleport(who->obj, where->map, x, y);
1954 
1955  return Py_BuildValue("i", val);
1956 }
1957 
1958 static PyObject *Crossfire_Object_ActivateRune(Crossfire_Object *who, PyObject *args) {
1959  /* Note that this function uses the METH_O calling convention. */
1960  object *trap;
1961  object *victim;
1962  Crossfire_Object *pcause = (Crossfire_Object*)args;
1963 
1964  EXISTCHECK(who);
1965  TYPEEXISTCHECK(pcause);
1966  trap = who->obj;
1967  victim = pcause->obj;
1968  cf_spring_trap(trap, victim);
1969  Py_INCREF(Py_None);
1970  return Py_None;
1971 }
1972 
1973 static PyObject *Crossfire_Object_CheckTrigger(Crossfire_Object *who, PyObject *args) {
1974  /* Note that this function uses the METH_O calling convention. */
1975  object *trigger;
1976  object *cause;
1977  int result;
1978  Crossfire_Object *pcause = (Crossfire_Object*)args;
1979 
1980  EXISTCHECK(who);
1981  TYPEEXISTCHECK(pcause);
1982  trigger = who->obj;
1983  cause = pcause->obj;
1984  result = cf_object_check_trigger(trigger, cause);
1985 
1986  return Py_BuildValue("i", result);
1987 }
1988 
1989 static PyObject *Crossfire_Object_Say(Crossfire_Object *who, PyObject *args) {
1990  char *message;
1991 
1992  EXISTCHECK(who);
1993  if (!PyArg_ParseTuple(args, "s", &message))
1994  return NULL;
1995  cf_object_say(who->obj, message);
1996  Py_INCREF(Py_None);
1997  return Py_None;
1998 }
1999 
2000 static PyObject *Crossfire_Object_Reposition(Crossfire_Object *who, PyObject *args) {
2001  int x, y;
2002 
2003  EXISTCHECK(who);
2004  if (!PyArg_ParseTuple(args, "ii", &x, &y))
2005  return NULL;
2006 
2007  cf_object_transfer(who->obj, x, y, 0, NULL);
2008  Py_INCREF(Py_None);
2009  return Py_None;
2010 }
2011 
2012 static PyObject *Crossfire_Object_QueryName(Crossfire_Object *who, PyObject *args) {
2013  char name[200];
2014 
2015  EXISTCHECK(who);
2016  return Py_BuildValue("s", cf_query_name(who->obj, name, sizeof(name)));
2017 }
2018 
2019 static PyObject *Crossfire_Object_GetResist(Crossfire_Object *who, PyObject *args) {
2020  int resist;
2021 
2022  EXISTCHECK(who);
2023  if (!PyArg_ParseTuple(args, "i", &resist))
2024  return NULL;
2025  if ((resist < 0) || (resist >= NROFATTACKS)) {
2026  return Py_BuildValue("l", 0);
2027  }
2028  return Py_BuildValue("i", cf_object_get_resistance(who->obj, resist));
2029 }
2030 
2031 static PyObject *Crossfire_Object_SetResist(Crossfire_Object *who, PyObject *args) {
2032  int resist, value;
2033 
2034  EXISTCHECK(who);
2035  if (!PyArg_ParseTuple(args, "ii", &resist, &value))
2036  return NULL;
2037  if ((resist >= 0) && (resist < NROFATTACKS))
2038  cf_object_set_resistance(who->obj, resist, value);
2039  Py_INCREF(Py_None);
2040  return Py_None;
2041 }
2042 
2043 static PyObject *Crossfire_Object_QueryCost(Crossfire_Object *who, PyObject *args) {
2044  int flags;
2045  Crossfire_Object *pcause;
2046 
2047  if (!PyArg_ParseTuple(args, "O!i", &Crossfire_ObjectType, &pcause, &flags))
2048  return NULL;
2049  EXISTCHECK(who);
2050  EXISTCHECK(pcause);
2051  return Py_BuildValue("i", cf_object_query_cost(who->obj, pcause->obj, flags));
2052 }
2053 
2054 static PyObject *Crossfire_Object_Cast(Crossfire_Object *who, PyObject *args) {
2055  int dir;
2056  char *op;
2057  Crossfire_Object *pspell;
2058 
2059  if (!PyArg_ParseTuple(args, "O!is", &Crossfire_ObjectType, &pspell, &dir, &op))
2060  return NULL;
2061  EXISTCHECK(who);
2062  EXISTCHECK(pspell);
2063 
2064  cf_object_cast_spell(who->obj, who->obj, dir, pspell->obj, op);
2065 
2066  Py_INCREF(Py_None);
2067  return Py_None;
2068 }
2069 
2070 static PyObject *Crossfire_Object_LearnSpell(Crossfire_Object *who, PyObject *args) {
2071  /* Note that this function uses the METH_O calling convention. */
2072  Crossfire_Object *pspell = (Crossfire_Object*)args;
2073 
2074  EXISTCHECK(who);
2075  TYPEEXISTCHECK(pspell);
2076 
2077  cf_object_learn_spell(who->obj, pspell->obj, 0);
2078 
2079  Py_INCREF(Py_None);
2080  return Py_None;
2081 }
2082 
2083 static PyObject *Crossfire_Object_ForgetSpell(Crossfire_Object *who, PyObject *args) {
2084  /* Note that this function uses the METH_O calling convention. */
2085  Crossfire_Object *pspell = (Crossfire_Object*)args;
2086 
2087  EXISTCHECK(who);
2088  TYPEEXISTCHECK(pspell);
2089 
2090  cf_object_forget_spell(who->obj, pspell->obj);
2091  Py_INCREF(Py_None);
2092  return Py_None;
2093 }
2094 
2095 static PyObject *Crossfire_Object_KnowSpell(Crossfire_Object *who, PyObject *args) {
2096  char *spellname;
2097  object *op;
2098 
2099  EXISTCHECK(who);
2100  if (!PyArg_ParseTuple(args, "s", &spellname))
2101  return NULL;
2102 
2103  op = cf_object_check_for_spell(who->obj, spellname);
2104 
2105  return Crossfire_Object_wrap(op);
2106 }
2107 
2108 static PyObject *Crossfire_Object_CastAbility(Crossfire_Object *who, PyObject *args) {
2109  Crossfire_Object *pspell;
2110  int dir;
2111  char *str;
2112 
2113  if (!PyArg_ParseTuple(args, "O!is", &Crossfire_ObjectType, &pspell, &dir, &str))
2114  return NULL;
2115  EXISTCHECK(who);
2116  EXISTCHECK(pspell);
2117 
2118  cf_object_cast_ability(who->obj, who->obj, dir, pspell->obj, str);
2119 
2120  Py_INCREF(Py_None);
2121  return Py_None;
2122 }
2123 
2124 static PyObject *Crossfire_Object_PayAmount(Crossfire_Object *who, PyObject *args) {
2125  uint64 to_pay;
2126  int val;
2127 
2128  EXISTCHECK(who);
2129  if (!PyArg_ParseTuple(args, "L", &to_pay))
2130  return NULL;
2131 
2132  val = cf_object_pay_amount(who->obj, to_pay);
2133 
2134  return Py_BuildValue("i", val);
2135 }
2136 
2137 static PyObject *Crossfire_Object_Pay(Crossfire_Object *who, PyObject *args) {
2138  /* Note that this function uses the METH_O calling convention. */
2139  Crossfire_Object *op = (Crossfire_Object*)args;
2140  int val;
2141 
2142  EXISTCHECK(who);
2143  TYPEEXISTCHECK(op);
2144 
2145  val = cf_object_pay_item(who->obj, op->obj);
2146 
2147  return Py_BuildValue("i", val);
2148 }
2149 
2150 static PyObject *Crossfire_Object_ReadKey(Crossfire_Object *who, PyObject *args) {
2151  const char *val;
2152  char *keyname;
2153 
2154  EXISTCHECK(who);
2155  if (!PyArg_ParseTuple(args, "s", &keyname))
2156  return NULL;
2157 
2158  val = cf_object_get_key(who->obj, keyname);
2159 
2160  return Py_BuildValue("s", val ? val : "");
2161 }
2162 
2163 static PyObject *Crossfire_Object_WriteKey(Crossfire_Object *who, PyObject *args) {
2164  char *keyname;
2165  char *value;
2166  int add_key = 0;
2167 
2168  EXISTCHECK(who);
2169  if (!PyArg_ParseTuple(args, "ss|i", &keyname, &value, &add_key))
2170  return NULL;
2171 
2172  return Py_BuildValue("i", cf_object_set_key(who->obj, keyname, value, add_key));
2173 }
2174 
2175 static PyObject *Crossfire_Object_CreateTimer(Crossfire_Object *who, PyObject *args) {
2176  int mode;
2177  long delay;
2178 
2179  EXISTCHECK(who);
2180  if (!PyArg_ParseTuple(args, "li", &delay, &mode))
2181  return NULL;
2182 
2183  return Py_BuildValue("i", cf_timer_create(who->obj, delay, mode));
2184 }
2185 
2186 static PyObject *Crossfire_Object_CheckInventory(Crossfire_Object *who, PyObject *args) {
2187  char *whatstr;
2188  object *foundob;
2189 
2190  EXISTCHECK(who);
2191  if (!PyArg_ParseTuple(args, "s", &whatstr))
2192  return NULL;
2193 
2194  foundob = cf_object_present_archname_inside(who->obj, whatstr);
2195 
2196  return Crossfire_Object_wrap(foundob);
2197 /* for (tmp = WHO->inv; tmp; tmp = tmp->below) {
2198  if (!strncmp(PyQueryName(tmp), whatstr, strlen(whatstr))) {
2199  return Py_BuildValue("l", (long)(tmp));
2200  }
2201  if (!strncmp(tmp->name, whatstr, strlen(whatstr))) {
2202  return Py_BuildValue("l", (long)(tmp));
2203  }
2204  }
2205 
2206  return Py_BuildValue("l", (long)0);*/
2207 }
2208 
2209 static PyObject *Crossfire_Object_CheckArchInventory(Crossfire_Object *who, PyObject *args) {
2210  char *whatstr;
2211  object *tmp;
2212 
2213  EXISTCHECK(who);
2214  if (!PyArg_ParseTuple(args, "s", &whatstr))
2215  return NULL;
2216 
2217  for (tmp = who->obj->inv; tmp != NULL; tmp = tmp->below) {
2218  if (!strcmp(tmp->arch->name, whatstr))
2219  break;
2220  }
2221  return Crossfire_Object_wrap(tmp);
2222 }
2223 
2224 static PyObject *Crossfire_Object_GetOutOfMap(Crossfire_Object *who, PyObject *args) {
2225  int x, y;
2226 
2227  EXISTCHECK(who);
2228  if (!PyArg_ParseTuple(args, "ii", &x, &y))
2229  return NULL;
2230 
2231  return Py_BuildValue("i", cf_object_out_of_map(who->obj, x, y));
2232 }
2233 
2234 static PyObject *Crossfire_Object_CreateInside(Crossfire_Object *who, PyObject *args) {
2235  char *txt;
2236  object *myob;
2237 
2238  EXISTCHECK(who);
2239  if (!PyArg_ParseTuple(args, "s", &txt))
2240  return NULL;
2241 
2242  myob = cf_create_object_by_name(txt);
2243  if (myob)
2244  myob = cf_object_insert_object(myob, who->obj);
2245 
2246  return Crossfire_Object_wrap(myob);
2247 }
2248 
2249 static PyObject *Crossfire_Object_InsertInto(Crossfire_Object *who, PyObject *args) {
2250  /* Note that this function uses the METH_O calling convention. */
2251  Crossfire_Object *op = (Crossfire_Object*)args;
2252  object *myob;
2253 
2254  EXISTCHECK(who);
2255  TYPEEXISTCHECK(op);
2256 
2257  /* we can only insert removed object, so first remove it
2258  * from it's current container
2259  */
2260  if (!cf_object_get_flag(who->obj, FLAG_REMOVED)) {
2261  cf_object_remove(who->obj);
2262  }
2263  myob = cf_object_insert_in_ob(who->obj, op->obj);
2264 
2265  return Crossfire_Object_wrap(myob);
2266 }
2267 
2268 static PyObject *Crossfire_Object_ChangeAbil(Crossfire_Object *who, PyObject *args) {
2269  /* Note that this function uses the METH_O calling convention. */
2270  Crossfire_Object *op = (Crossfire_Object*)args;
2271 
2272  EXISTCHECK(who);
2273  TYPEEXISTCHECK(op);
2274 
2275  return Py_BuildValue("i", cf_object_change_abil(who->obj, op->obj));
2276 }
2277 
2278 static PyObject *Crossfire_Object_AddExp(Crossfire_Object *who, PyObject *args) {
2279  sint64 exp;
2280  const char *skill = NULL;
2281  int arg = 0;
2282 
2283  if (!PyArg_ParseTuple(args, "L|si", &exp, &skill, &arg))
2284  return NULL;
2285  EXISTCHECK(who);
2286  cf_object_change_exp(who->obj, exp, skill, arg);
2287  Py_INCREF(Py_None);
2288  return Py_None;
2289 }
2290 
2291 static PyObject *Crossfire_Object_Move(Crossfire_Object *who, PyObject *args) {
2292  int dir;
2293 
2294  if (!PyArg_ParseTuple(args, "i", &dir))
2295  return NULL;
2296  EXISTCHECK(who);
2297  return Py_BuildValue("i", cf_object_move(who->obj, dir, who->obj));
2298 }
2299 
2300 static PyObject *Crossfire_Object_Event(Crossfire_Object *who, PyObject *args) {
2301  int fix;
2302  const char *message = NULL;
2303  object *op1 = NULL;
2304  object *op2 = NULL;
2305  object *op3 = NULL;
2306  Crossfire_Object *activator = NULL;
2307  Crossfire_Object *third = NULL;
2308 
2309  if (!PyArg_ParseTuple(args, "O!O!si", &Crossfire_ObjectType, &activator, &Crossfire_ObjectType, &third, &message, &fix))
2310  return NULL;
2311  EXISTCHECK(who);
2312  EXISTCHECK(activator);
2313  EXISTCHECK(third);
2314  op1 = who->obj;
2315  op2 = activator->obj;
2316  op3 = third->obj;
2317  return Py_BuildValue("i", cf_object_user_event(op1, op2, op3, message, fix));
2318 }
2319 
2321  EXISTCHECK_INT(left);
2322  EXISTCHECK_INT(right);
2323  return (left->obj < right->obj ? -1 : (left->obj == right->obj ? 0 : 1));
2324 }
2325 
2326 /* Legacy code: convert to long so that non-object functions work correctly */
2327 static PyObject *Crossfire_Object_Long(PyObject *obj) {
2328  return Py_BuildValue("l", ((Crossfire_Object *)obj)->obj);
2329 }
2330 
2331 #ifndef IS_PY3K
2332 static PyObject *Crossfire_Object_Int(PyObject *obj) {
2333  return Py_BuildValue("i", ((Crossfire_Object *)obj)->obj);
2334 }
2335 #endif
2336 
2340 static PyObject *Crossfire_Object_new(PyTypeObject *type, PyObject *args, PyObject *kwds) {
2341  Crossfire_Object *self;
2342 
2343  self = (Crossfire_Object *)type->tp_alloc(type, 0);
2344  if (self) {
2345  self->obj = NULL;
2346  self->count = 0;
2347  }
2348 
2349  return (PyObject *)self;
2350 }
2351 
2352 static PyObject *Crossfire_Player_new(PyTypeObject *type, PyObject *args, PyObject *kwds) {
2353  Crossfire_Player *self;
2354 
2355  self = (Crossfire_Player *)type->tp_alloc(type, 0);
2356  if (self) {
2357  self->obj = NULL;
2358  self->count = 0;
2359  }
2360 
2361  return (PyObject *)self;
2362 }
2363 
2364 static void Crossfire_Object_dealloc(PyObject *obj) {
2365  Crossfire_Object *self;
2366 
2367  self = (Crossfire_Object *)obj;
2368  if (self) {
2369  if (self->obj) {
2370  free_object_assoc(self->obj);
2371  }
2372  Py_TYPE(self)->tp_free(obj);
2373  }
2374 }
2375 
2376 static void Crossfire_Player_dealloc(PyObject *obj) {
2377  Crossfire_Player *self;
2378 
2379  self = (Crossfire_Player *)obj;
2380  if (self) {
2381  if (self->obj) {
2382  free_object_assoc(self->obj);
2383  }
2384  Py_TYPE(self)->tp_free(obj);
2385  }
2386 }
2387 
2388 PyObject *Crossfire_Object_wrap(object *what) {
2389  Crossfire_Object *wrapper;
2390  Crossfire_Player *plwrap;
2391  PyObject *pyobj;
2392 
2393  /* return None if no object was to be wrapped */
2394  if (what == NULL) {
2395  Py_INCREF(Py_None);
2396  return Py_None;
2397  }
2398 
2399  pyobj = find_assoc_pyobject(what);
2400  if ((!pyobj) || (was_destroyed(((Crossfire_Object *)pyobj)->obj, ((Crossfire_Object *)pyobj)->count))) {
2401  if (what->type == PLAYER) {
2402  plwrap = PyObject_NEW(Crossfire_Player, &Crossfire_PlayerType);
2403  if (plwrap != NULL) {
2404  plwrap->obj = what;
2405  plwrap->count = what->count;
2406  }
2407  pyobj = (PyObject *)plwrap;
2408  } else {
2409  wrapper = PyObject_NEW(Crossfire_Object, &Crossfire_ObjectType);
2410  if (wrapper != NULL) {
2411  wrapper->obj = what;
2412  wrapper->count = what->count;
2413  }
2414  pyobj = (PyObject *)wrapper;
2415  }
2416  add_object_assoc(what, pyobj);
2417  } else {
2418  Py_INCREF(pyobj);
2419  }
2420  return pyobj;
2421 }
#define CFAPI_OBJECT_PROP_STR
Definition: plugin.h:243
#define CFAPI_OBJECT_PROP_MAP
Definition: plugin.h:174
static int Object_SetExp(Crossfire_Object *whoptr, PyObject *value, void *closure)
int cf_object_set_nrof(object *, int nrof)
#define EXISTCHECK(ob)
static PyObject * Object_GetMessage(Crossfire_Object *whoptr, void *closure)
static int Object_SetUsedUp(Crossfire_Object *whoptr, PyObject *value, void *closure)
Definition: object.h:132
static PyObject * Crossfire_Object_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
sint64 cf_object_get_int64_property(object *op, int propcode)
static PyObject * Object_GetMaxGrace(Crossfire_Object *whoptr, void *closure)
static PyObject * Crossfire_Object_Event(Crossfire_Object *who, PyObject *args)
static PyObject * Object_GetSP(Crossfire_Object *whoptr, void *closure)
static PyObject * Object_GetBelow(Crossfire_Object *whoptr, void *closure)
#define FLAG_SEE_IN_DARK
Definition: define.h:634
static void add_object_assoc(object *key, PyObject *value)
long cf_object_get_long_property(object *op, long propcode)
static PyObject * Object_GetWis(Crossfire_Object *whoptr, void *closure)
static PyObject * Crossfire_Object_AddExp(Crossfire_Object *who, PyObject *args)
#define CFAPI_OBJECT_PROP_NO_SAVE
Definition: plugin.h:265
#define CFAPI_OBJECT_PROP_ANIMATION
Definition: plugin.h:264
#define FLAG_DAMNED
Definition: define.h:614
#define FLAG_IS_FLOOR
Definition: define.h:599
#define FLAG_UNPAID
Definition: define.h:532
#define CFAPI_OBJECT_PROP_SP
Definition: plugin.h:253
static PyObject * Object_GetRunAway(Crossfire_Object *whoptr, void *closure)
PyObject_HEAD object * obj
CFPContext * current_context
Definition: cfpython.c:186
static int Object_SetWeightLimit(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Object_GetDuration(Crossfire_Object *whoptr, void *closure)
#define CFAPI_OBJECT_PROP_NAME
Definition: plugin.h:176
#define CFAPI_OBJECT_PROP_OB_BELOW
Definition: plugin.h:167
static PyObject * Crossfire_Object_Pay(Crossfire_Object *who, PyObject *args)
object * cf_object_change_map(object *op, mapstruct *m, object *originator, int flag, int x, int y)
static PyObject * Player_GetBedX(Crossfire_Player *whoptr, void *closure)
static int Object_SetScared(Crossfire_Object *whoptr, PyObject *value, void *closure)
PyObject * Crossfire_Party_wrap(partylist *what)
static PyObject * Object_GetAbove(Crossfire_Object *whoptr, void *closure)
static int Object_SetLastSP(Crossfire_Object *whoptr, PyObject *value, void *closure)
#define CFAPI_OBJECT_PROP_RACE
Definition: plugin.h:179
static PyObject * Crossfire_Object_CreateInside(Crossfire_Object *who, PyObject *args)
static PyObject * Object_GetFace(Crossfire_Object *whoptr, void *closure)
#define FLAG_SLEEP
Definition: define.h:604
static int Object_SetCha(Crossfire_Object *whoptr, PyObject *value, void *closure)
static int Crossfire_Object_InternalCompare(Crossfire_Object *left, Crossfire_Object *right)
void cf_spring_trap(object *trap, object *victim)
static int Object_SetHitBack(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Object_GetCanUseScroll(Crossfire_Object *whoptr, void *closure)
static int Object_SetMaxGrace(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Crossfire_Object_CastAbility(Crossfire_Object *who, PyObject *args)
#define FLAG_HITBACK
Definition: define.h:563
#define CFAPI_OBJECT_PROP_ARCHETYPE
Definition: plugin.h:227
#define CFAPI_OBJECT_PROP_WEIGHT
Definition: plugin.h:212
static PyObject * Object_GetStealthy(Crossfire_Object *whoptr, void *closure)
static PyObject * find_assoc_pyobject(object *key)
#define CFAPI_OBJECT_PROP_ATTACK_TYPE
Definition: plugin.h:195
#define FLAG_USE_SCROLL
Definition: define.h:588
static int Object_SetMap(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Crossfire_Object_Apply(Crossfire_Object *who, PyObject *args)
#define CFAPI_OBJECT_PROP_FACE
Definition: plugin.h:263
int cf_object_cast_ability(object *caster, object *ctoo, int dir, object *sp, char *flags)
const char * cf_object_get_key(object *op, const char *keyname)
static int Object_SetQuantity(Crossfire_Object *whoptr, PyObject *value, void *closure)
PyObject * Crossfire_Map_wrap(mapstruct *what)
Definition: cfpython_map.c:336
static PyObject * Crossfire_Object_Drop(Crossfire_Object *who, PyObject *args)
static PyObject * Object_GetSlaying(Crossfire_Object *whoptr, void *closure)
static PyObject * Object_GetInventory(Crossfire_Object *whoptr, void *closure)
static int Object_SetApplied(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Object_GetCanUseWeapon(Crossfire_Object *whoptr, void *closure)
static PyObject * Crossfire_Object_CreateTimer(Crossfire_Object *who, PyObject *args)
static int Object_SetInvisible(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Crossfire_Player_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
static int Object_SetNoSave(Crossfire_Object *whoptr, PyObject *value, void *closure)
#define CFAPI_OBJECT_PROP_GOD
Definition: plugin.h:260
static PyObject * Object_GetInvisible(Crossfire_Object *whoptr, void *closure)
PyObject_HEAD partylist * party
#define CFAPI_OBJECT_PROP_DIRECTION
Definition: plugin.h:189
static int Object_SetFood(Crossfire_Object *whoptr, PyObject *value, void *closure)
#define FLAG_USE_ARMOUR
Definition: define.h:592
static int Object_SetAC(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Object_GetAC(Crossfire_Object *whoptr, void *closure)
#define FLAG_IS_USED_UP
Definition: define.h:556
static PyObject * Crossfire_Object_Take(Crossfire_Object *who, PyObject *args)
static int Player_SetBedY(Crossfire_Player *whoptr, PyObject *value, void *closure)
#define FLAG_STAND_STILL
Definition: define.h:605
static PyObject * Object_GetMoveOn(Crossfire_Object *whoptr, void *closure)
void cf_object_set_flag(object *ob, int flag, int value)
#define CFAPI_OBJECT_PROP_MAXGP
Definition: plugin.h:258
#define NDI_ORANGE
Definition: newclient.h:199
static PyObject * Object_GetTurnable(Crossfire_Object *whoptr, void *closure)
#define FLAG_FRIENDLY
Definition: define.h:542
static PyObject * Player_GetBedMap(Crossfire_Player *whoptr, void *closure)
static PyObject * Object_GetFacing(Crossfire_Object *whoptr, void *closure)
static int Player_SetParty(Crossfire_Player *whoptr, PyObject *value, void *closure)
static PyObject * Object_GetArchetype(Crossfire_Object *whoptr, void *closure)
static PyObject * Crossfire_Object_Remove(Crossfire_Object *who, PyObject *args)
PyTypeObject Crossfire_MapType
static PyObject * Object_GetThrown(Crossfire_Object *whoptr, void *closure)
static int Object_SetSlaying(Crossfire_Object *whoptr, PyObject *value, void *closure)
static int Object_SetNoDamage(Crossfire_Object *whoptr, PyObject *value, void *closure)
object * cf_object_insert_in_ob(object *op, object *where)
static PyObject * Object_GetLastEat(Crossfire_Object *whoptr, void *closure)
partylist * cf_player_get_party(object *op)
static int Object_SetReflectMissiles(Crossfire_Object *whoptr, PyObject *value, void *closure)
ptr_assoc * ptr_assoc_table[PTR_ASSOC_TABLESIZE]
Definition: hashtable.h:15
#define CFAPI_OBJECT_PROP_SUBTYPE
Definition: plugin.h:192
static PyObject * Object_GetCanUseHorn(Crossfire_Object *whoptr, void *closure)
static int Object_SetHP(Crossfire_Object *whoptr, PyObject *value, void *closure)
static int Object_SetBlocksView(Crossfire_Object *whoptr, PyObject *value, void *closure)
static int Object_SetBlind(Crossfire_Object *whoptr, PyObject *value, void *closure)
#define CFAPI_OBJECT_PROP_INVENTORY
Definition: plugin.h:170
static int Object_SetAttackType(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Object_GetFood(Crossfire_Object *whoptr, void *closure)
#define CFAPI_OBJECT_PROP_NAME_PLURAL
Definition: plugin.h:177
static PyObject * Object_GetMonster(Crossfire_Object *whoptr, void *closure)
static PyObject * Crossfire_Object_Cast(Crossfire_Object *who, PyObject *args)
static PyObject * Object_GetMoveOff(Crossfire_Object *whoptr, void *closure)
sint16 cf_object_get_resistance(object *op, int rtype)
int cf_object_pay_item(object *op, object *pl)
#define FLAG_CONFUSED
Definition: define.h:608
static PyObject * Object_GetUnaggressive(Crossfire_Object *whoptr, void *closure)
#define FLAG_STEALTH
Definition: define.h:609
#define CFAPI_OBJECT_PROP_OWNER
Definition: plugin.h:237
static PyObject * Object_GetNoDamage(Crossfire_Object *whoptr, void *closure)
static PyObject * Crossfire_Object_GetResist(Crossfire_Object *who, PyObject *args)
static PyObject * Object_GetLevel(Crossfire_Object *whoptr, void *closure)
static PyObject * Crossfire_Object_Long(PyObject *obj)
#define FLAG_USE_WEAPON
Definition: define.h:593
#define CFAPI_OBJECT_PROP_MOVE_ON
Definition: plugin.h:269
static PyObject * Object_GetCanSeeInvisible(Crossfire_Object *whoptr, void *closure)
static int Object_SetSP(Crossfire_Object *whoptr, PyObject *value, void *closure)
#define FLAG_SPLITTING
Definition: define.h:562
#define CFAPI_OBJECT_PROP_MESSAGE
Definition: plugin.h:182
static PyObject * Object_GetUndead(Crossfire_Object *whoptr, void *closure)
#define CFAPI_OBJECT_PROP_EXP_MULTIPLIER
Definition: plugin.h:226
static PyObject * Crossfire_Object_ReadKey(Crossfire_Object *who, PyObject *args)
void cf_fix_object(object *op)
static PyObject * Object_GetWeightLimit(Crossfire_Object *whoptr, void *closure)
static int Object_SetUnique(Crossfire_Object *whoptr, PyObject *value, void *closure)
static int Object_SetDuration(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Crossfire_Object_KnowSpell(Crossfire_Object *who, PyObject *args)
static PyObject * Crossfire_Player_CanPay(Crossfire_Player *who, PyObject *args)
static PyObject * Object_GetAttackType(Crossfire_Object *whoptr, void *closure)
object * cf_player_get_marked_item(object *op)
static PyObject * Object_GetCanSeeInDark(Crossfire_Object *whoptr, void *closure)
char * cf_object_get_string_property(object *op, int propcode, char *buf, int size)
static int Object_SetOwner(Crossfire_Object *whoptr, PyObject *value, void *closure)
PyTypeObject Crossfire_PlayerType
static PyObject * Object_GetPow(Crossfire_Object *whoptr, void *closure)
static PyObject * Crossfire_Object_SetResist(Crossfire_Object *who, PyObject *args)
static PyObject * Object_GetQuantity(Crossfire_Object *whoptr, void *closure)
#define CFAPI_OBJECT_PROP_SLAYING
Definition: plugin.h:180
int cf_object_get_int_property(object *op, int propcode)
static int Object_SetStealthy(Crossfire_Object *whoptr, PyObject *value, void *closure)
static int Object_SetPow(Crossfire_Object *whoptr, PyObject *value, void *closure)
#define FLAG_USE_RING
Definition: define.h:594
static int Object_SetIsPet(Crossfire_Object *whoptr, PyObject *value, void *closure)
#define FLAG_USE_HORN
Definition: define.h:624
static int Object_SetUnpaid(Crossfire_Object *whoptr, PyObject *value, void *closure)
#define PLAYER
Definition: define.h:113
static PyObject * Object_GetInt(Crossfire_Object *whoptr, void *closure)
#define CFAPI_OBJECT_PROP_LAST_SP
Definition: plugin.h:205
#define FLAG_REMOVED
Definition: define.h:528
static PyObject * Player_GetParty(Crossfire_Player *whoptr, void *closure)
static PyObject * Object_GetBlocksView(Crossfire_Object *whoptr, void *closure)
#define CFAPI_OBJECT_PROP_LAST_GRACE
Definition: plugin.h:206
int cf_object_transfer(object *op, int x, int y, int randomly, object *originator)
void cf_object_forget_spell(object *op, object *sp)
#define CFAPI_OBJECT_PROP_COUNT
Definition: plugin.h:175
#define FLAG_CAN_ROLL
Definition: define.h:550
int cf_find_animation(const char *txt)
#define FLAG_KNOWN_MAGICAL
Definition: define.h:616
static PyObject * Object_GetRollable(Crossfire_Object *whoptr, void *closure)
static PyObject * Object_GetMoveBlock(Crossfire_Object *whoptr, void *closure)
float cf_object_get_float_property(object *op, int propcode)
void cf_object_learn_spell(object *op, object *spell, int special_prayer)
static PyObject * Object_GetStr(Crossfire_Object *whoptr, void *closure)
static int Object_SetNamePl(Crossfire_Object *whoptr, PyObject *value, void *closure)
int cf_object_check_trigger(object *op, object *cause)
static int Object_SetWC(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Crossfire_Object_QueryCost(Crossfire_Object *who, PyObject *args)
#define FLAG_SEE_INVISIBLE
Definition: define.h:549
sstring cf_object_get_sstring_property(object *op, int propcode)
static PyObject * Object_GetUsedUp(Crossfire_Object *whoptr, void *closure)
static PyObject * Object_GetType(Crossfire_Object *whoptr, void *closure)
#define FLAG_UNDEAD
Definition: define.h:566
int cf_object_pay_amount(object *pl, uint64 to_pay)
#define CFAPI_PLAYER_PROP_BED_X
Definition: plugin.h:279
static int Object_SetGod(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Object_GetGrace(Crossfire_Object *whoptr, void *closure)
static PyObject * Crossfire_Object_InsertInto(Crossfire_Object *who, PyObject *args)
static PyObject * Crossfire_Object_WriteKey(Crossfire_Object *who, PyObject *args)
static PyObject * Crossfire_Object_CheckInventory(Crossfire_Object *who, PyObject *args)
MoveType cf_object_get_movetype_property(object *op, int propcode)
void cf_player_set_marked_item(object *op, object *ob)
static int Object_SetDam(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Object_GetReflectSpells(Crossfire_Object *whoptr, void *closure)
int cf_player_can_pay(object *op)
PyObject_HEAD object * obj
#define CFAPI_OBJECT_PROP_FACING
Definition: plugin.h:190
static int Object_SetUndead(Crossfire_Object *whoptr, PyObject *value, void *closure)
static int Object_SetMakeInvisible(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Crossfire_Object_ActivateRune(Crossfire_Object *who, PyObject *args)
int cf_timer_create(object *ob, long delay, int mode)
#define FLAG_ALIVE
Definition: define.h:526
#define CFAPI_OBJECT_PROP_ENVIRONMENT
Definition: plugin.h:171
#define FLAG_REFL_SPELL
Definition: define.h:571
static PyObject * Crossfire_Object_ForgetSpell(Crossfire_Object *who, PyObject *args)
#define CFAPI_OBJECT_PROP_GP
Definition: plugin.h:254
static int Object_SetTitle(Crossfire_Object *whoptr, PyObject *value, void *closure)
#define CFAPI_OBJECT_PROP_CHA
Definition: plugin.h:249
static PyObject * Object_GetMaxHP(Crossfire_Object *whoptr, void *closure)
static void Crossfire_Object_dealloc(PyObject *obj)
static int Player_SetTitle(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Object_GetConfused(Crossfire_Object *whoptr, void *closure)
static PyObject * Object_GetMakeInvisible(Crossfire_Object *whoptr, void *closure)
static ptr_assoc_table object_assoc_table
#define CFAPI_OBJECT_PROP_MOVE_SLOW_PENALTY
Definition: plugin.h:272
static PyObject * Object_GetY(Crossfire_Object *whoptr, void *closure)
static PyObject * Object_GetCanUseSkill(Crossfire_Object *whoptr, void *closure)
#define CFAPI_OBJECT_PROP_INT
Definition: plugin.h:247
void cf_object_set_int_property(object *op, int propcode, int value)
static int Object_SetHasXRays(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Crossfire_Object_CheckTrigger(Crossfire_Object *who, PyObject *args)
int cf_object_query_cost(const object *tmp, object *who, int flag)
#define FLAG_CAN_USE_SKILL
Definition: define.h:618
#define CFAPI_OBJECT_PROP_LEVEL
Definition: plugin.h:203
#define CFAPI_PLAYER_PROP_BED_MAP
Definition: plugin.h:278
#define FLAG_UNAGGRESSIVE
Definition: define.h:568
static PyObject * Crossfire_Player_Message(Crossfire_Player *who, PyObject *args)
#define CFAPI_OBJECT_PROP_MOVE_ALLOW
Definition: plugin.h:268
#define EXISTCHECK_INT(ob)
static PyObject * Player_GetBedY(Crossfire_Player *whoptr, void *closure)
void cf_object_set_float_property(object *op, int propcode, float value)
int cf_object_user_event(object *op, object *activator, object *third, const char *message, int fix)
static PyObject * Object_GetDamned(Crossfire_Object *whoptr, void *closure)
static int Object_SetLastEat(Crossfire_Object *whoptr, PyObject *value, void *closure)
static int Object_SetIdentified(Crossfire_Object *whoptr, PyObject *value, void *closure)
static int Player_SetBedMap(Crossfire_Player *whoptr, PyObject *value, void *closure)
static int Object_SetCursed(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Object_GetMoveType(Crossfire_Object *whoptr, void *closure)
double cf_object_get_double_property(object *op, int propcode)
#define FLAG_IDENTIFIED
Definition: define.h:557
static PyObject * Object_GetCanUseRod(Crossfire_Object *whoptr, void *closure)
static PyObject * Object_GetGodGiven(Crossfire_Object *whoptr, void *closure)
static int Object_SetReflectSpells(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Object_GetIdentified(Crossfire_Object *whoptr, void *closure)
static PyObject * Object_GetMap(Crossfire_Object *whoptr, void *closure)
static int Object_SetInt(Crossfire_Object *whoptr, PyObject *value, void *closure)
static int Object_SetLastGrace(Crossfire_Object *whoptr, PyObject *value, void *closure)
#define CFAPI_OBJECT_PROP_FP
Definition: plugin.h:255
static int Object_SetKnownCursed(Crossfire_Object *whoptr, PyObject *value, void *closure)
#define FLAG_BLOCKSVIEW
Definition: define.h:565
static PyObject * Object_GetCursed(Crossfire_Object *whoptr, void *closure)
static int Object_SetRandomMovement(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Object_GetCount(Crossfire_Object *whoptr, void *closure)
static PyObject * Object_GetFloor(Crossfire_Object *whoptr, void *closure)
static int Object_SetSkill(Crossfire_Object *whoptr, PyObject *value, void *closure)
sstring cf_query_name_pl(object *ob)
void cf_object_set_int64_property(object *op, int propcode, sint64 value)
static int Object_SetAttackMovement(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Object_GetArchName(Crossfire_Object *whoptr, void *closure)
static int Player_SetBedX(Crossfire_Player *whoptr, PyObject *value, void *closure)
static int Object_SetGlowRadius(Crossfire_Object *whoptr, PyObject *value, void *closure)
struct obj * below
Definition: object.h:145
static PyObject * Object_GetExpMul(Crossfire_Object *whoptr, void *closure)
static PyObject * Object_GetOwner(Crossfire_Object *whoptr, void *closure)
#define CFAPI_OBJECT_PROP_LAST_EAT
Definition: plugin.h:207
static int Object_SetLifesaver(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Player_GetTitle(Crossfire_Object *whoptr, void *closure)
static PyObject * Object_GetGlowRadius(Crossfire_Object *whoptr, void *closure)
static PyObject * Crossfire_Object_Int(PyObject *obj)
PyObject * Crossfire_Object_wrap(object *what)
#define CFAPI_OBJECT_PROP_MOVE_OFF
Definition: plugin.h:270
#define CFAPI_OBJECT_PROP_WEIGHT_LIMIT
Definition: plugin.h:213
static PyObject * Object_GetNamePl(Crossfire_Object *whoptr, void *closure)
object * cf_object_insert_object(object *op, object *container)
static int Object_SetRace(Crossfire_Object *whoptr, PyObject *value, void *closure)
static int Object_SetCanPassThru(Crossfire_Object *whoptr, PyObject *value, void *closure)
void cf_object_say(object *op, char *msg)
static PyObject * Object_GetHP(Crossfire_Object *whoptr, void *closure)
PyObject_HEAD mapstruct * map
Definition: cfpython_map.h:34
static PyObject * Object_GetDirection(Crossfire_Object *whoptr, void *closure)
#define CFAPI_OBJECT_PROP_X
Definition: plugin.h:184
static PyObject * Object_GetScared(Crossfire_Object *whoptr, void *closure)
static PyObject * Object_GetExists(Crossfire_Object *whoptr, void *closure)
static PyObject * Object_GetEnemy(Crossfire_Object *whoptr, void *closure)
static PyObject * Object_GetCha(Crossfire_Object *whoptr, void *closure)
#define FLAG_SCARED
Definition: define.h:567
static PyObject * Object_GetAnimated(Crossfire_Object *whoptr, void *closure)
static PyObject * Object_GetFriendly(Crossfire_Object *whoptr, void *closure)
void * find_assoc_value(ptr_assoc **hash_table, void *key)
Definition: hashtable.c:205
#define CFAPI_OBJECT_PROP_ENEMY
Definition: plugin.h:218
static PyObject * Object_GetExp(Crossfire_Object *whoptr, void *closure)
int cf_object_query_money(const object *op)
#define FLAG_ONLY_ATTACK
Definition: define.h:607
#define FLAG_XRAYS
Definition: define.h:597
static int Object_SetKnownMagical(Crossfire_Object *whoptr, PyObject *value, void *closure)
static int Object_SetSpeed(Crossfire_Object *whoptr, PyObject *value, void *closure)
static int Object_SetStandStill(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Object_GetMoney(Crossfire_Object *whoptr, void *closure)
static int Object_SetDirection(Crossfire_Object *whoptr, PyObject *value, void *closure)
object * cf_object_present_archname_inside(object *op, char *whatstr)
static PyObject * Object_GetUnpaid(Crossfire_Object *whoptr, void *closure)
static int Object_SetConfused(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Object_GetName(Crossfire_Object *whoptr, void *closure)
#define FLAG_WIZ
Definition: define.h:527
#define FLAG_BEEN_APPLIED
Definition: define.h:620
static PyObject * Object_GetAnimSpeed(Crossfire_Object *whoptr, void *closure)
static int Object_SetGodGiven(Crossfire_Object *whoptr, PyObject *value, void *closure)
static int Object_SetEnemy(Crossfire_Object *whoptr, PyObject *value, void *closure)
static int Object_SetPickable(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Object_GetLastGrace(Crossfire_Object *whoptr, void *closure)
PyTypeObject Crossfire_PartyType
static int Object_SetFace(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Object_GetAnim(Crossfire_Object *whoptr, void *closure)
static PyObject * Crossfire_Object_Reposition(Crossfire_Object *who, PyObject *args)
static PyObject * Object_GetSpeed(Crossfire_Object *whoptr, void *closure)
#define FLAG_CAST_SPELL
Definition: define.h:587
#define CFAPI_OBJECT_PROP_EXP
Definition: plugin.h:236
int cf_find_face(const char *name, int error)
mapstruct * cf_object_get_map_property(object *op, int propcode)
PyObject * who
Definition: cfpython.h:118
static PyObject * Object_GetDam(Crossfire_Object *whoptr, void *closure)
void cf_object_remove(object *op)
static PyObject * Crossfire_Object_Move(Crossfire_Object *who, PyObject *args)
#define FLAG_RUN_AWAY
Definition: define.h:576
static PyObject * Object_GetApplied(Crossfire_Object *whoptr, void *closure)
#define FLAG_IS_THROWN
Definition: define.h:545
void add_ptr_assoc(ptr_assoc **hash_table, void *key, void *value)
Definition: hashtable.c:109
static const flag_definition flags[]
int cf_object_apply(object *op, object *author, int flags)
void init_ptr_assoc_table(ptr_assoc **hash_table)
Definition: hashtable.c:57
#define CFAPI_OBJECT_PROP_PERM_EXP
Definition: plugin.h:216
static PyObject * Object_GetReflectMissiles(Crossfire_Object *whoptr, void *closure)
#define TYPEEXISTCHECK(ob)
static PyObject * Object_GetKnownCursed(Crossfire_Object *whoptr, void *closure)
#define FLAG_KNOWN_CURSED
Definition: define.h:617
void cf_player_set_party(object *op, partylist *party)
object * cf_object_get_object_property(object *op, int propcode)
static PyObject * Object_GetHitBack(Crossfire_Object *whoptr, void *closure)
static int Player_SetMarkedItem(Crossfire_Player *whoptr, PyObject *value, void *closure)
#define FLAG_CURSED
Definition: define.h:613
#define CFAPI_OBJECT_PROP_DAM
Definition: plugin.h:259
#define CFAPI_OBJECT_PROP_MOVE_TYPE
Definition: plugin.h:266
#define CFAPI_OBJECT_PROP_SKILL
Definition: plugin.h:181
static int Object_SetRunAway(Crossfire_Object *whoptr, PyObject *value, void *closure)
static int Object_SetWeight(Crossfire_Object *whoptr, PyObject *value, void *closure)
void cf_player_message(object *op, char *txt, int flags)
#define CFAPI_OBJECT_PROP_AC
Definition: plugin.h:251
static int Object_SetFacing(Crossfire_Object *whoptr, PyObject *value, void *closure)
#define FLAG_ANIMATE
Definition: define.h:538
#define FLAG_NO_DAMAGE
Definition: define.h:660
static PyObject * Object_GetPickable(Crossfire_Object *whoptr, void *closure)
static int Object_SetName(Crossfire_Object *whoptr, PyObject *value, void *closure)
#define FLAG_GENERATOR
Definition: define.h:544
static PyObject * Crossfire_Object_PayAmount(Crossfire_Object *who, PyObject *args)
static PyObject * Object_GetMoveSlowPenalty(Crossfire_Object *whoptr, void *closure)
#define FLAG_BLIND
Definition: define.h:633
static PyObject * Object_GetMoveAllow(Crossfire_Object *whoptr, void *closure)
static PyObject * Object_GetMoveSlow(Crossfire_Object *whoptr, void *closure)
int cf_object_get_flag(object *ob, int flag)
static int Object_SetValue(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Crossfire_Object_Fix(Crossfire_Object *who, PyObject *args)
#define CFAPI_OBJECT_PROP_SPEED_LEFT
Definition: plugin.h:187
int cf_object_move(object *op, int dir, object *originator)
static PyObject * Object_GetCanUseBow(Crossfire_Object *whoptr, void *closure)
static int Object_SetSpeedLeft(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Crossfire_Object_LearnSpell(Crossfire_Object *who, PyObject *args)
static PyObject * Object_GetAttackMovement(Crossfire_Object *whoptr, void *closure)
static PyObject * Object_GetLastSP(Crossfire_Object *whoptr, void *closure)
tag_t count
Definition: object.h:157
sstring cf_player_get_ip(object *op)
struct archt * arch
Definition: object.h:263
static PyObject * Object_GetCanCastSpell(Crossfire_Object *whoptr, void *closure)
#define CFAPI_OBJECT_PROP_HP
Definition: plugin.h:252
#define CFAPI_OBJECT_PROP_TITLE
Definition: plugin.h:178
static int Object_SetGrace(Crossfire_Object *whoptr, PyObject *value, void *closure)
#define CFAPI_PLAYER_PROP_BED_Y
Definition: plugin.h:280
static PyObject * Object_GetWeight(Crossfire_Object *whoptr, void *closure)
#define CFAPI_OBJECT_PROP_SPEED
Definition: plugin.h:186
#define CFAPI_OBJECT_PROP_FRIENDLY
Definition: plugin.h:231
static PyObject * Object_GetSubtype(Crossfire_Object *whoptr, void *closure)
static PyObject * Object_GetWasDM(Crossfire_Object *whoptr, void *closure)
#define CFAPI_OBJECT_PROP_ANIM_SPEED
Definition: plugin.h:230
void cf_object_pickup(object *op, object *what)
void cf_object_drop(object *op, object *author)
#define CFAPI_OBJECT_PROP_LUCK
Definition: plugin.h:235
#define FLAG_APPLIED
Definition: define.h:531
#define NROFATTACKS
Definition: attack.h:45
#define CFAPI_OBJECT_PROP_ARCH_NAME
Definition: plugin.h:261
static PyObject * Object_GetBlind(Crossfire_Object *whoptr, void *closure)
#define FLAG_LIFESAVE
Definition: define.h:602
#define CFAPI_OBJECT_PROP_DEX
Definition: plugin.h:244
void cf_object_change_exp(object *op, sint64 exp, const char *skill_name, int flag)
static PyObject * Object_GetSpeedLeft(Crossfire_Object *whoptr, void *closure)
#define CFAPI_OBJECT_PROP_ATTACK_MOVEMENT
Definition: plugin.h:224
static int Object_SetTurnable(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Crossfire_Object_Say(Crossfire_Object *who, PyObject *args)
void free_ptr_assoc(ptr_assoc **hash_table, void *key)
Definition: hashtable.c:222
#define FLAG_MAKE_INVIS
Definition: define.h:625
#define CFAPI_OBJECT_PROP_CON
Definition: plugin.h:245
static PyObject * Object_GetSleeping(Crossfire_Object *whoptr, void *closure)
static PyObject * Object_GetDM(Crossfire_Object *whoptr, void *closure)
#define FLAG_STARTEQUIP
Definition: define.h:564
static void Crossfire_Player_dealloc(PyObject *obj)
PyTypeObject Crossfire_ObjectType
void init_object_assoc_table(void)
static PyObject * Object_GetBeenApplied(Crossfire_Object *whoptr, void *closure)
static PyObject * Object_GetRace(Crossfire_Object *whoptr, void *closure)
static int Object_SetCanSeeInDark(Crossfire_Object *whoptr, PyObject *value, void *closure)
#define Py_TYPE(ob)
Definition: cfpython.h:66
#define CFAPI_OBJECT_PROP_NROF
Definition: plugin.h:188
static PyObject * Object_GetKnownMagical(Crossfire_Object *whoptr, void *closure)
static PyObject * Object_GetSkill(Crossfire_Object *whoptr, void *closure)
void cf_player_set_title(object *op, const char *title)
static PyObject * Object_GetPermExp(Crossfire_Object *whoptr, void *closure)
#define CFAPI_OBJECT_PROP_MAXSP
Definition: plugin.h:257
static PyObject * Object_GetGod(Crossfire_Object *whoptr, void *closure)
static PyObject * Object_GetNoSave(Crossfire_Object *whoptr, void *closure)
#define FLAG_MONSTER
Definition: define.h:541
struct obj * inv
Definition: object.h:148
#define NDI_UNIQUE
Definition: newclient.h:219
PyObject * Crossfire_Archetype_wrap(archetype *what)
object * cf_object_check_for_spell(object *op, const char *name)
static PyObject * Object_GetCanUseRing(Crossfire_Object *whoptr, void *closure)
sstring cf_player_get_title(object *op)
#define CFAPI_OBJECT_PROP_INVISIBLE
Definition: plugin.h:262
static int Object_SetStr(Crossfire_Object *whoptr, PyObject *value, void *closure)
void cf_object_set_resistance(object *op, int rtype, sint16 value)
int cf_object_teleport(object *ob, mapstruct *map, int x, int y)
static PyObject * Crossfire_Object_GetOutOfMap(Crossfire_Object *who, PyObject *args)
#define CFAPI_OBJECT_PROP_TYPE
Definition: plugin.h:191
static int Object_SetUnaggressive(Crossfire_Object *whoptr, PyObject *value, void *closure)
#define CFAPI_OBJECT_PROP_POW
Definition: plugin.h:248
#define FLAG_USE_RANGE
Definition: define.h:589
#define FLAG_RANDOM_MOVE
Definition: define.h:606
static int Object_SetMaxHP(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Object_GetDex(Crossfire_Object *whoptr, void *closure)
#define FLAG_WAS_WIZ
Definition: define.h:530
static int Object_SetDamned(Crossfire_Object *whoptr, PyObject *value, void *closure)
#define was_destroyed(op, old_tag)
Definition: object.h:94
static int Object_SetMaxSP(Crossfire_Object *whoptr, PyObject *value, void *closure)
#define CFAPI_OBJECT_PROP_GLOW_RADIUS
Definition: plugin.h:215
static PyObject * Object_GetLifesaver(Crossfire_Object *whoptr, void *closure)
archetype * cf_object_get_archetype_property(object *op, int propcode)
static int Object_SetDex(Crossfire_Object *whoptr, PyObject *value, void *closure)
static int Object_SetAnim(Crossfire_Object *whoptr, PyObject *value, void *closure)
void cf_object_set_string_property(object *op, int propcode, const char *value)
#define CFAPI_OBJECT_PROP_WC
Definition: plugin.h:250
static int Object_SetOnlyAttack(Crossfire_Object *whoptr, PyObject *value, void *closure)
static void free_object_assoc(object *key)
void cf_object_set_long_property(object *op, int propcode, long value)
static int Object_SetAnimated(Crossfire_Object *whoptr, PyObject *value, void *closure)
static int Object_SetFriendly(Crossfire_Object *whoptr, PyObject *value, void *closure)
#define CFAPI_OBJECT_PROP_MOVE_SLOW
Definition: plugin.h:271
static PyObject * Player_GetIP(Crossfire_Player *whoptr, void *closure)
static int Object_SetRollable(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Object_GetCanUseWand(Crossfire_Object *whoptr, void *closure)
static PyObject * Object_GetHasXRays(Crossfire_Object *whoptr, void *closure)
Definition: map.h:346
#define CF_IS_PYSTR(cfpy_obj)
Definition: cfpython.h:80
#define CFAPI_OBJECT_PROP_MAXHP
Definition: plugin.h:256
static PyObject * Object_GetLuck(Crossfire_Object *whoptr, void *closure)
static PyObject * Object_GetEnv(Crossfire_Object *whoptr, void *closure)
void cf_object_free(object *ob)
static PyObject * Object_GetCanUseArmour(Crossfire_Object *whoptr, void *closure)
int cf_object_out_of_map(object *op, int x, int y)
#define FLAG_UNIQUE
Definition: define.h:584
#define FLAG_NO_PICK
Definition: define.h:535
int cf_object_change_abil(object *op, object *tmp)
static PyObject * Crossfire_Object_QueryName(Crossfire_Object *who, PyObject *args)
#define FLAG_USE_ROD
Definition: define.h:622
static int Object_SetCon(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Crossfire_Object_Teleport(Crossfire_Object *who, PyObject *args)
#define CFAPI_OBJECT_PROP_VALUE
Definition: plugin.h:202
static PyObject * Player_GetMarkedItem(Crossfire_Player *whoptr, void *closure)
#define FLAG_REFL_MISSILE
Definition: define.h:569
static PyObject * Object_GetUnique(Crossfire_Object *whoptr, void *closure)
static int Object_SetCanSeeInvisible(Crossfire_Object *whoptr, PyObject *value, void *closure)
static int Object_SetMessage(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Object_GetValue(Crossfire_Object *whoptr, void *closure)
#define CFAPI_OBJECT_PROP_WIS
Definition: plugin.h:246
#define CFAPI_OBJECT_PROP_DURATION
Definition: plugin.h:273
static PyObject * Object_GetRandomMovement(Crossfire_Object *whoptr, void *closure)
#define CFAPI_OBJECT_PROP_OB_ABOVE
Definition: plugin.h:166
object * cf_create_object_by_name(const char *name)
char * cf_query_name(object *ob, char *name, int size)
static PyObject * Crossfire_Object_CheckArchInventory(Crossfire_Object *who, PyObject *args)
#define CFAPI_OBJECT_PROP_Y
Definition: plugin.h:185
static PyObject * Object_GetCon(Crossfire_Object *whoptr, void *closure)
const char * name
Definition: object.h:322
#define FLAG_USE_BOW
Definition: define.h:590
int cf_object_cast_spell(object *op, object *caster, int dir, object *spell_ob, char *stringarg)
static PyObject * Object_GetOnlyAttack(Crossfire_Object *whoptr, void *closure)
static PyObject * Object_GetMaxSP(Crossfire_Object *whoptr, void *closure)
static int Object_SetWis(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Object_GetIsPet(Crossfire_Object *whoptr, void *closure)
static int Object_SetSleeping(Crossfire_Object *whoptr, PyObject *value, void *closure)
uint8 type
Definition: object.h:189
static int Object_SetAnimSpeed(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Object_GetGenerator(Crossfire_Object *whoptr, void *closure)
static PyObject * Object_GetAlive(Crossfire_Object *whoptr, void *closure)
static PyObject * Object_GetX(Crossfire_Object *whoptr, void *closure)
#define CFAPI_OBJECT_PROP_MOVE_BLOCK
Definition: plugin.h:267
static PyObject * Object_GetTitle(Crossfire_Object *whoptr, void *closure)
void cf_object_set_object_property(object *op, int propcode, object *value)
static PyObject * Crossfire_Object_ChangeAbil(Crossfire_Object *who, PyObject *args)
static PyObject * Object_GetWC(Crossfire_Object *whoptr, void *closure)
static PyObject * Object_GetStandStill(Crossfire_Object *whoptr, void *closure)
int cf_object_set_key(object *op, const char *keyname, const char *value, int add_key)
static PyObject * Object_GetSplitting(Crossfire_Object *whoptr, void *closure)
#define FLAG_IS_TURNABLE
Definition: define.h:552