1 |
root |
1.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 |
|
|
#include <cfpython.h> |
29 |
|
|
#include <cfpython_object_private.h> |
30 |
|
|
|
31 |
|
|
static PyObject* Player_GetIP(Crossfire_Player* whoptr, void* closure) |
32 |
|
|
{ |
33 |
|
|
return Py_BuildValue("s",( char* )cf_player_get_ip(whoptr->obj)); |
34 |
|
|
} |
35 |
|
|
static PyObject* Player_GetMarkedItem(Crossfire_Player* whoptr, void* closure) |
36 |
|
|
{ |
37 |
|
|
return Crossfire_Object_wrap(cf_player_get_marked_item(whoptr->obj)); |
38 |
|
|
} |
39 |
|
|
static int Player_SetMarkedItem(Crossfire_Player* whoptr, PyObject* value, void* closure) |
40 |
|
|
{ |
41 |
|
|
Crossfire_Object* ob; |
42 |
|
|
if (!PyArg_Parse(value,"O!",&Crossfire_ObjectType,&ob)) |
43 |
|
|
return -1; |
44 |
|
|
cf_player_set_marked_item(whoptr->obj,ob->obj); |
45 |
|
|
return 0; |
46 |
|
|
} |
47 |
|
|
static PyObject* Crossfire_Player_Message( Crossfire_Player* who, PyObject* args ) |
48 |
|
|
{ |
49 |
|
|
char* message; |
50 |
|
|
int color = NDI_UNIQUE | NDI_ORANGE; |
51 |
|
|
|
52 |
|
|
if (!PyArg_ParseTuple(args,"s|i",&message,&color)) |
53 |
|
|
return NULL; |
54 |
|
|
|
55 |
|
|
cf_player_message(who->obj, message, color); |
56 |
|
|
Py_INCREF(Py_None); |
57 |
|
|
return Py_None; |
58 |
|
|
} |
59 |
|
|
static PyObject* Player_GetParty(Crossfire_Player* whoptr, void* closure) |
60 |
|
|
{ |
61 |
|
|
return Crossfire_Party_wrap(cf_player_get_party(whoptr->obj)); |
62 |
|
|
} |
63 |
|
|
static int Player_SetParty(Crossfire_Player* whoptr, PyObject* value, void* closure) |
64 |
|
|
{ |
65 |
|
|
Crossfire_Party* ob; |
66 |
|
|
if (!PyArg_Parse(value,"O!",&Crossfire_PartyType,&ob)) |
67 |
|
|
return -1; |
68 |
|
|
cf_player_set_party(whoptr->obj,ob->party); |
69 |
|
|
return 0; |
70 |
|
|
} |
71 |
|
|
|
72 |
|
|
/* Object properties. Get and maybe set. */ |
73 |
|
|
static PyObject* Object_GetName(Crossfire_Object* whoptr, void* closure) |
74 |
|
|
{ |
75 |
|
|
return Py_BuildValue("s",( char* )cf_query_name(whoptr->obj)); |
76 |
|
|
} |
77 |
|
|
|
78 |
|
|
static PyObject* Object_GetNamePl(Crossfire_Object* whoptr, void* closure) |
79 |
|
|
{ |
80 |
|
|
return Py_BuildValue("s",( char* )cf_query_name_pl(whoptr->obj)); |
81 |
|
|
} |
82 |
|
|
|
83 |
|
|
static PyObject* Object_GetTitle(Crossfire_Object* whoptr, void* closure) |
84 |
|
|
{ |
85 |
|
|
return Py_BuildValue("s",( char* )cf_object_get_property( whoptr->obj, CFAPI_OBJECT_PROP_TITLE )); |
86 |
|
|
} |
87 |
|
|
|
88 |
|
|
static PyObject* Object_GetMap(Crossfire_Object* whoptr, void* closure) |
89 |
|
|
{ |
90 |
|
|
mapstruct* m; |
91 |
|
|
m = cf_object_get_property( whoptr->obj, CFAPI_OBJECT_PROP_MAP ); |
92 |
|
|
return Crossfire_Map_wrap(m); |
93 |
|
|
} |
94 |
|
|
|
95 |
|
|
static PyObject* Object_GetCha(Crossfire_Object* whoptr, void* closure) |
96 |
|
|
{ |
97 |
|
|
return Py_BuildValue("i",*( int* )cf_object_get_property( whoptr->obj, CFAPI_OBJECT_PROP_CHA)); |
98 |
|
|
} |
99 |
|
|
|
100 |
|
|
static PyObject* Object_GetCon(Crossfire_Object* whoptr, void* closure) |
101 |
|
|
{ |
102 |
|
|
return Py_BuildValue("i",*( int* )cf_object_get_property( whoptr->obj, CFAPI_OBJECT_PROP_CON)); |
103 |
|
|
} |
104 |
|
|
|
105 |
|
|
static PyObject* Object_GetDex(Crossfire_Object* whoptr, void* closure) |
106 |
|
|
{ |
107 |
|
|
return Py_BuildValue("i",*( int* )cf_object_get_property( whoptr->obj, CFAPI_OBJECT_PROP_DEX)); |
108 |
|
|
} |
109 |
|
|
|
110 |
|
|
static PyObject* Object_GetInt(Crossfire_Object* whoptr, void* closure) |
111 |
|
|
{ |
112 |
|
|
return Py_BuildValue("i",*( int* )cf_object_get_property( whoptr->obj, CFAPI_OBJECT_PROP_INT)); |
113 |
|
|
} |
114 |
|
|
|
115 |
|
|
static PyObject* Object_GetPow(Crossfire_Object* whoptr, void* closure) |
116 |
|
|
{ |
117 |
|
|
return Py_BuildValue("i",*( int* )cf_object_get_property( whoptr->obj, CFAPI_OBJECT_PROP_POW)); |
118 |
|
|
} |
119 |
|
|
|
120 |
|
|
static PyObject* Object_GetStr(Crossfire_Object* whoptr, void* closure) |
121 |
|
|
{ |
122 |
|
|
return Py_BuildValue("i",*( int* )cf_object_get_property( whoptr->obj, CFAPI_OBJECT_PROP_STR)); |
123 |
|
|
} |
124 |
|
|
|
125 |
|
|
static PyObject* Object_GetWis(Crossfire_Object* whoptr, void* closure) |
126 |
|
|
{ |
127 |
|
|
return Py_BuildValue("i",*( int* )cf_object_get_property( whoptr->obj, CFAPI_OBJECT_PROP_WIS)); |
128 |
|
|
} |
129 |
|
|
|
130 |
|
|
static PyObject* Object_GetHP(Crossfire_Object* whoptr, void* closure) |
131 |
|
|
{ |
132 |
|
|
return Py_BuildValue("i",*( int* )cf_object_get_property( whoptr->obj, CFAPI_OBJECT_PROP_HP)); |
133 |
|
|
} |
134 |
|
|
|
135 |
|
|
static PyObject* Object_GetMaxHP(Crossfire_Object* whoptr, void* closure) |
136 |
|
|
{ |
137 |
|
|
return Py_BuildValue("i",*( int* )cf_object_get_property( whoptr->obj, CFAPI_OBJECT_PROP_MAXHP)); |
138 |
|
|
} |
139 |
|
|
|
140 |
|
|
static PyObject* Object_GetSP(Crossfire_Object* whoptr, void* closure) |
141 |
|
|
{ |
142 |
|
|
return Py_BuildValue("i",*( int* )cf_object_get_property( whoptr->obj, CFAPI_OBJECT_PROP_SP)); |
143 |
|
|
} |
144 |
|
|
|
145 |
|
|
static PyObject* Object_GetMaxSP(Crossfire_Object* whoptr, void* closure) |
146 |
|
|
{ |
147 |
|
|
return Py_BuildValue("i",*( int* )cf_object_get_property( whoptr->obj, CFAPI_OBJECT_PROP_MAXSP)); |
148 |
|
|
} |
149 |
|
|
|
150 |
|
|
static PyObject* Object_GetGrace(Crossfire_Object* whoptr, void* closure) |
151 |
|
|
{ |
152 |
|
|
return Py_BuildValue("i",*( int* )cf_object_get_property( whoptr->obj, CFAPI_OBJECT_PROP_GP)); |
153 |
|
|
} |
154 |
|
|
|
155 |
|
|
static PyObject* Object_GetMaxGrace(Crossfire_Object* whoptr, void* closure) |
156 |
|
|
{ |
157 |
|
|
return Py_BuildValue("i",*( int* )cf_object_get_property( whoptr->obj, CFAPI_OBJECT_PROP_MAXGP)); |
158 |
|
|
} |
159 |
|
|
|
160 |
|
|
static PyObject* Object_GetFood(Crossfire_Object* whoptr, void* closure) |
161 |
|
|
{ |
162 |
|
|
return Py_BuildValue("i",*( int* )cf_object_get_property( whoptr->obj, CFAPI_OBJECT_PROP_FP)); |
163 |
|
|
} |
164 |
|
|
|
165 |
|
|
static PyObject* Object_GetAC(Crossfire_Object* whoptr, void* closure) |
166 |
|
|
{ |
167 |
|
|
return Py_BuildValue("i",*( int* )cf_object_get_property( whoptr->obj, CFAPI_OBJECT_PROP_AC)); |
168 |
|
|
} |
169 |
|
|
|
170 |
|
|
static PyObject* Object_GetWC(Crossfire_Object* whoptr, void* closure) |
171 |
|
|
{ |
172 |
|
|
return Py_BuildValue("i",*( int* )cf_object_get_property( whoptr->obj, CFAPI_OBJECT_PROP_WC)); |
173 |
|
|
} |
174 |
|
|
|
175 |
|
|
static PyObject* Object_GetDam(Crossfire_Object* whoptr, void* closure) |
176 |
|
|
{ |
177 |
|
|
return Py_BuildValue("i",*( int* )cf_object_get_property( whoptr->obj, CFAPI_OBJECT_PROP_DAM)); |
178 |
|
|
} |
179 |
|
|
|
180 |
|
|
static PyObject* Object_GetLuck(Crossfire_Object* whoptr, void* closure) |
181 |
|
|
{ |
182 |
|
|
return Py_BuildValue("i",*( int* )cf_object_get_property( whoptr->obj, CFAPI_OBJECT_PROP_LUCK)); |
183 |
|
|
} |
184 |
|
|
|
185 |
|
|
static PyObject* Object_GetMessage(Crossfire_Object* whoptr, void* closure) |
186 |
|
|
{ |
187 |
|
|
return Py_BuildValue("s",( char* )cf_object_get_property( whoptr->obj, CFAPI_OBJECT_PROP_MESSAGE)); |
188 |
|
|
} |
189 |
|
|
|
190 |
|
|
static PyObject* Object_GetExp(Crossfire_Object* whoptr, void* closure) |
191 |
|
|
{ |
192 |
|
|
return Py_BuildValue("L",*( sint64* )cf_object_get_property( whoptr->obj, CFAPI_OBJECT_PROP_EXP)); |
193 |
|
|
} |
194 |
|
|
|
195 |
|
|
static PyObject* Object_GetSlaying(Crossfire_Object* whoptr, void* closure) |
196 |
|
|
{ |
197 |
|
|
return Py_BuildValue("s",( char* )cf_object_get_property( whoptr->obj, CFAPI_OBJECT_PROP_SLAYING)); |
198 |
|
|
} |
199 |
|
|
static PyObject* Object_GetCursed(Crossfire_Object* whoptr, void* closure) |
200 |
|
|
{ |
201 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_CURSED)); |
202 |
|
|
} |
203 |
|
|
static PyObject* Object_GetDamned(Crossfire_Object* whoptr, void* closure) |
204 |
|
|
{ |
205 |
|
|
return Py_BuildValue("i", cf_object_get_flag(whoptr->obj, FLAG_DAMNED)); |
206 |
|
|
} |
207 |
|
|
static PyObject* Object_GetWeight(Crossfire_Object* whoptr, void* closure) |
208 |
|
|
{ |
209 |
|
|
return Py_BuildValue("i", *(int*)cf_object_get_property(whoptr->obj, CFAPI_OBJECT_PROP_WEIGHT)); |
210 |
|
|
} |
211 |
|
|
static PyObject* Object_GetWeightLimit(Crossfire_Object* whoptr, void* closure) |
212 |
|
|
{ |
213 |
|
|
return Py_BuildValue("i", *(int*)cf_object_get_property(whoptr->obj, CFAPI_OBJECT_PROP_WEIGHT_LIMIT)); |
214 |
|
|
} |
215 |
|
|
static PyObject* Object_GetAbove(Crossfire_Object* whoptr, void* closure) |
216 |
|
|
{ |
217 |
|
|
object* op; |
218 |
|
|
op = cf_object_get_property(whoptr->obj, CFAPI_OBJECT_PROP_OB_ABOVE); |
219 |
|
|
return Crossfire_Object_wrap(op); |
220 |
|
|
} |
221 |
|
|
static PyObject* Object_GetBelow(Crossfire_Object* whoptr, void* closure) |
222 |
|
|
{ |
223 |
|
|
object* op; |
224 |
|
|
op = cf_object_get_property(whoptr->obj, CFAPI_OBJECT_PROP_OB_BELOW); |
225 |
|
|
return Crossfire_Object_wrap(op); |
226 |
|
|
} |
227 |
|
|
static PyObject* Object_GetInventory(Crossfire_Object* whoptr, void* closure) |
228 |
|
|
{ |
229 |
|
|
object* op; |
230 |
|
|
op = cf_object_get_property(whoptr->obj, CFAPI_OBJECT_PROP_INVENTORY); |
231 |
|
|
return Crossfire_Object_wrap(op); |
232 |
|
|
} |
233 |
|
|
static PyObject* Object_GetX(Crossfire_Object* whoptr, void* closure) |
234 |
|
|
{ |
235 |
|
|
return Py_BuildValue("i", *(int*)cf_object_get_property(whoptr->obj, CFAPI_OBJECT_PROP_X)); |
236 |
|
|
} |
237 |
|
|
static PyObject* Object_GetY(Crossfire_Object* whoptr, void* closure) |
238 |
|
|
{ |
239 |
|
|
return Py_BuildValue("i", *(int*)cf_object_get_property(whoptr->obj, CFAPI_OBJECT_PROP_Y)); |
240 |
|
|
} |
241 |
|
|
static PyObject* Object_GetDirection(Crossfire_Object* whoptr, void* closure) |
242 |
|
|
{ |
243 |
|
|
return Py_BuildValue("i", *(char*)cf_object_get_property(whoptr->obj, CFAPI_OBJECT_PROP_DIRECTION)); |
244 |
|
|
} |
245 |
|
|
static PyObject* Object_GetFacing(Crossfire_Object* whoptr, void* closure) |
246 |
|
|
{ |
247 |
|
|
return Py_BuildValue("i", *(char*)cf_object_get_property(whoptr->obj, CFAPI_OBJECT_PROP_FACING)); |
248 |
|
|
} |
249 |
|
|
static PyObject* Object_GetUnaggressive(Crossfire_Object* whoptr, void* closure) |
250 |
|
|
{ |
251 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_UNAGGRESSIVE)); |
252 |
|
|
} |
253 |
|
|
static PyObject* Object_GetGod(Crossfire_Object* whoptr, void* closure) |
254 |
|
|
{ |
255 |
|
|
return Py_BuildValue("s",cf_object_get_property(whoptr->obj, CFAPI_OBJECT_PROP_GOD)); |
256 |
|
|
} |
257 |
|
|
static PyObject* Object_GetPickable(Crossfire_Object* whoptr, void* closure) |
258 |
|
|
{ |
259 |
|
|
return Py_BuildValue("i",!cf_object_get_flag(whoptr->obj, FLAG_NO_PICK)); |
260 |
|
|
} |
261 |
|
|
static PyObject* Object_GetQuantity(Crossfire_Object* whoptr, void* closure) |
262 |
|
|
{ |
263 |
|
|
return Py_BuildValue("i", *(int*)cf_object_get_property(whoptr->obj, CFAPI_OBJECT_PROP_NROF)); |
264 |
|
|
} |
265 |
|
|
static PyObject* Object_GetInvisible(Crossfire_Object* whoptr, void* closure) |
266 |
|
|
{ |
267 |
|
|
return Py_BuildValue("i", *(int*)cf_object_get_property(whoptr->obj, |
268 |
|
|
CFAPI_OBJECT_PROP_INVISIBLE)); |
269 |
|
|
} |
270 |
|
|
static PyObject* Object_GetSpeed(Crossfire_Object* whoptr, void* closure) |
271 |
|
|
{ |
272 |
|
|
return Py_BuildValue("d", cf_object_get_property(whoptr->obj, CFAPI_OBJECT_PROP_SPEED)); |
273 |
|
|
} |
274 |
|
|
static PyObject* Object_GetLastSP(Crossfire_Object* whoptr, void* closure) |
275 |
|
|
{ |
276 |
|
|
return Py_BuildValue("i", *(sint16*)cf_object_get_property(whoptr->obj, CFAPI_OBJECT_PROP_LAST_SP)); |
277 |
|
|
} |
278 |
|
|
static PyObject* Object_GetLastGrace(Crossfire_Object* whoptr, void* closure) |
279 |
|
|
{ |
280 |
|
|
return Py_BuildValue("i", *(sint16*)cf_object_get_property(whoptr->obj, CFAPI_OBJECT_PROP_LAST_GRACE)); |
281 |
|
|
} |
282 |
|
|
static PyObject* Object_GetLevel(Crossfire_Object* whoptr, void* closure) |
283 |
|
|
{ |
284 |
|
|
return Py_BuildValue("i", *(int*)cf_object_get_property(whoptr->obj, CFAPI_OBJECT_PROP_LEVEL)); |
285 |
|
|
} |
286 |
|
|
static PyObject* Object_GetFace(Crossfire_Object* whoptr, void* closure) |
287 |
|
|
{ |
288 |
|
|
return Py_BuildValue("i", *(int*)cf_object_get_property(whoptr->obj, CFAPI_OBJECT_PROP_FACE)); |
289 |
|
|
} |
290 |
|
|
static PyObject* Object_GetAttackType(Crossfire_Object* whoptr, void* closure) |
291 |
|
|
{ |
292 |
|
|
return Py_BuildValue("i", cf_object_get_property(whoptr->obj, CFAPI_OBJECT_PROP_ATTACK_TYPE)); |
293 |
|
|
} |
294 |
|
|
static PyObject* Object_GetBeenApplied(Crossfire_Object* whoptr, void* closure) |
295 |
|
|
{ |
296 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_BEEN_APPLIED)); |
297 |
|
|
} |
298 |
|
|
static PyObject* Object_GetIdentified(Crossfire_Object* whoptr, void* closure) |
299 |
|
|
{ |
300 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_IDENTIFIED)); |
301 |
|
|
} |
302 |
|
|
static PyObject* Object_GetAlive(Crossfire_Object* whoptr, void* closure) |
303 |
|
|
{ |
304 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_ALIVE)); |
305 |
|
|
} |
306 |
|
|
static PyObject* Object_GetDM(Crossfire_Object* whoptr, void* closure) |
307 |
|
|
{ |
308 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_WIZ)); |
309 |
|
|
} |
310 |
|
|
static PyObject* Object_GetWasDM(Crossfire_Object* whoptr, void* closure) |
311 |
|
|
{ |
312 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_WAS_WIZ)); |
313 |
|
|
} |
314 |
|
|
static PyObject* Object_GetApplied(Crossfire_Object* whoptr, void* closure) |
315 |
|
|
{ |
316 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_APPLIED)); |
317 |
|
|
} |
318 |
|
|
static PyObject* Object_GetUnpaid(Crossfire_Object* whoptr, void* closure) |
319 |
|
|
{ |
320 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_UNPAID)); |
321 |
|
|
} |
322 |
|
|
static PyObject* Object_GetFlying(Crossfire_Object* whoptr, void* closure) |
323 |
|
|
{ |
324 |
|
|
/* FIXME */ |
325 |
|
|
/*return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_FLYING));*/ |
326 |
|
|
} |
327 |
|
|
static PyObject* Object_GetMonster(Crossfire_Object* whoptr, void* closure) |
328 |
|
|
{ |
329 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_MONSTER)); |
330 |
|
|
} |
331 |
|
|
static PyObject* Object_GetFriendly(Crossfire_Object* whoptr, void* closure) |
332 |
|
|
{ |
333 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_FRIENDLY)); |
334 |
|
|
} |
335 |
|
|
static PyObject* Object_GetGenerator(Crossfire_Object* whoptr, void* closure) |
336 |
|
|
{ |
337 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_GENERATOR)); |
338 |
|
|
} |
339 |
|
|
static PyObject* Object_GetThrown(Crossfire_Object* whoptr, void* closure) |
340 |
|
|
{ |
341 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_IS_THROWN)); |
342 |
|
|
} |
343 |
|
|
static PyObject* Object_GetCanSeeInvisible(Crossfire_Object* whoptr, void* closure) |
344 |
|
|
{ |
345 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_SEE_INVISIBLE)); |
346 |
|
|
} |
347 |
|
|
static PyObject* Object_GetRollable(Crossfire_Object* whoptr, void* closure) |
348 |
|
|
{ |
349 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_CAN_ROLL)); |
350 |
|
|
} |
351 |
|
|
static PyObject* Object_GetTurnable(Crossfire_Object* whoptr, void* closure) |
352 |
|
|
{ |
353 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_IS_TURNABLE)); |
354 |
|
|
} |
355 |
|
|
static PyObject* Object_GetUsedUp(Crossfire_Object* whoptr, void* closure) |
356 |
|
|
{ |
357 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_IS_USED_UP)); |
358 |
|
|
} |
359 |
|
|
static PyObject* Object_GetSplitting(Crossfire_Object* whoptr, void* closure) |
360 |
|
|
{ |
361 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_SPLITTING)); |
362 |
|
|
} |
363 |
|
|
static PyObject* Object_GetBlind(Crossfire_Object* whoptr, void* closure) |
364 |
|
|
{ |
365 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_BLIND)); |
366 |
|
|
} |
367 |
|
|
static PyObject* Object_GetCanUseHorn(Crossfire_Object* whoptr, void* closure) |
368 |
|
|
{ |
369 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_USE_HORN)); |
370 |
|
|
} |
371 |
|
|
static PyObject* Object_GetCanUseRod(Crossfire_Object* whoptr, void* closure) |
372 |
|
|
{ |
373 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_USE_ROD)); |
374 |
|
|
} |
375 |
|
|
static PyObject* Object_GetCanUseSkill(Crossfire_Object* whoptr, void* closure) |
376 |
|
|
{ |
377 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_CAN_USE_SKILL)); |
378 |
|
|
} |
379 |
|
|
static PyObject* Object_GetKnownCursed(Crossfire_Object* whoptr, void* closure) |
380 |
|
|
{ |
381 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_KNOWN_CURSED)); |
382 |
|
|
} |
383 |
|
|
static PyObject* Object_GetStealthy(Crossfire_Object* whoptr, void* closure) |
384 |
|
|
{ |
385 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_STEALTH)); |
386 |
|
|
} |
387 |
|
|
static PyObject* Object_GetConfused(Crossfire_Object* whoptr, void* closure) |
388 |
|
|
{ |
389 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_CONFUSED)); |
390 |
|
|
} |
391 |
|
|
static PyObject* Object_GetSleeping(Crossfire_Object* whoptr, void* closure) |
392 |
|
|
{ |
393 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_SLEEP)); |
394 |
|
|
} |
395 |
|
|
static PyObject* Object_GetLifesaver(Crossfire_Object* whoptr, void* closure) |
396 |
|
|
{ |
397 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_LIFESAVE)); |
398 |
|
|
} |
399 |
|
|
static PyObject* Object_GetFloor(Crossfire_Object* whoptr, void* closure) |
400 |
|
|
{ |
401 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_IS_FLOOR)); |
402 |
|
|
} |
403 |
|
|
static PyObject* Object_GetHasXRays(Crossfire_Object* whoptr, void* closure) |
404 |
|
|
{ |
405 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_XRAYS)); |
406 |
|
|
} |
407 |
|
|
static PyObject* Object_GetCanUseRing(Crossfire_Object* whoptr, void* closure) |
408 |
|
|
{ |
409 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_USE_RING)); |
410 |
|
|
} |
411 |
|
|
static PyObject* Object_GetCanUseBow(Crossfire_Object* whoptr, void* closure) |
412 |
|
|
{ |
413 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_USE_BOW)); |
414 |
|
|
} |
415 |
|
|
static PyObject* Object_GetCanUseWand(Crossfire_Object* whoptr, void* closure) |
416 |
|
|
{ |
417 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_USE_RANGE)); |
418 |
|
|
} |
419 |
|
|
static PyObject* Object_GetCanSeeInDark(Crossfire_Object* whoptr, void* closure) |
420 |
|
|
{ |
421 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_SEE_IN_DARK)); |
422 |
|
|
} |
423 |
|
|
static PyObject* Object_GetKnownMagical(Crossfire_Object* whoptr, void* closure) |
424 |
|
|
{ |
425 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_KNOWN_MAGICAL)); |
426 |
|
|
} |
427 |
|
|
static PyObject* Object_GetCanUseWeapon(Crossfire_Object* whoptr, void* closure) |
428 |
|
|
{ |
429 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_USE_WEAPON)); |
430 |
|
|
} |
431 |
|
|
static PyObject* Object_GetCanUseArmour(Crossfire_Object* whoptr, void* closure) |
432 |
|
|
{ |
433 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_USE_ARMOUR)); |
434 |
|
|
} |
435 |
|
|
static PyObject* Object_GetCanUseScroll(Crossfire_Object* whoptr, void* closure) |
436 |
|
|
{ |
437 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_USE_SCROLL)); |
438 |
|
|
} |
439 |
|
|
static PyObject* Object_GetCanCastSpell(Crossfire_Object* whoptr, void* closure) |
440 |
|
|
{ |
441 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_CAST_SPELL)); |
442 |
|
|
} |
443 |
|
|
static PyObject* Object_GetReflectSpells(Crossfire_Object* whoptr, void* closure) |
444 |
|
|
{ |
445 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_REFL_SPELL)); |
446 |
|
|
} |
447 |
|
|
static PyObject* Object_GetReflectMissiles(Crossfire_Object* whoptr, void* closure) |
448 |
|
|
{ |
449 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_REFL_MISSILE)); |
450 |
|
|
} |
451 |
|
|
static PyObject* Object_GetUnique(Crossfire_Object* whoptr, void* closure) |
452 |
|
|
{ |
453 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_UNIQUE)); |
454 |
|
|
} |
455 |
|
|
static PyObject* Object_GetCanPickUp(Crossfire_Object* whoptr, void* closure) |
456 |
|
|
{ |
457 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_PICK_UP)); |
458 |
|
|
} |
459 |
|
|
static PyObject* Object_GetCanPassThru(Crossfire_Object* whoptr, void* closure) |
460 |
|
|
{ |
461 |
|
|
/* FIXME */ |
462 |
|
|
/*return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_CAN_PASS_THRU));*/ |
463 |
|
|
} |
464 |
|
|
static PyObject* Object_GetRunAway(Crossfire_Object* whoptr, void* closure) |
465 |
|
|
{ |
466 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_RUN_AWAY)); |
467 |
|
|
} |
468 |
|
|
static PyObject* Object_GetScared(Crossfire_Object* whoptr, void* closure) |
469 |
|
|
{ |
470 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_SCARED)); |
471 |
|
|
} |
472 |
|
|
static PyObject* Object_GetUndead(Crossfire_Object* whoptr, void* closure) |
473 |
|
|
{ |
474 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_UNDEAD)); |
475 |
|
|
} |
476 |
|
|
static PyObject* Object_GetBlocksView(Crossfire_Object* whoptr, void* closure) |
477 |
|
|
{ |
478 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_BLOCKSVIEW)); |
479 |
|
|
} |
480 |
|
|
static PyObject* Object_GetHitBack(Crossfire_Object* whoptr, void* closure) |
481 |
|
|
{ |
482 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_HITBACK)); |
483 |
|
|
} |
484 |
|
|
static PyObject* Object_GetStandStill(Crossfire_Object* whoptr, void* closure) |
485 |
|
|
{ |
486 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_STAND_STILL)); |
487 |
|
|
} |
488 |
|
|
static PyObject* Object_GetOnlyAttack(Crossfire_Object* whoptr, void* closure) |
489 |
|
|
{ |
490 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_ONLY_ATTACK)); |
491 |
|
|
} |
492 |
|
|
static PyObject* Object_GetMakeInvisible(Crossfire_Object* whoptr, void* closure) |
493 |
|
|
{ |
494 |
|
|
return Py_BuildValue("i",cf_object_get_flag(whoptr->obj, FLAG_MAKE_INVIS)); |
495 |
|
|
} |
496 |
|
|
static PyObject* Object_GetMoney(Crossfire_Object* whoptr, void* closure) |
497 |
|
|
{ |
498 |
|
|
return Py_BuildValue("i",cf_object_query_money(whoptr->obj)); |
499 |
|
|
} |
500 |
|
|
static PyObject* Object_GetType(Crossfire_Object* whoptr, void* closure) |
501 |
|
|
{ |
502 |
|
|
return Py_BuildValue("i",*(int*)cf_object_get_property(whoptr->obj, CFAPI_OBJECT_PROP_TYPE)); |
503 |
|
|
} |
504 |
|
|
static PyObject* Object_GetValue(Crossfire_Object* whoptr, void* closure) |
505 |
|
|
{ |
506 |
|
|
return Py_BuildValue("l",*(int*)cf_object_get_property(whoptr->obj, CFAPI_OBJECT_PROP_VALUE)); |
507 |
|
|
} |
508 |
|
|
static PyObject* Object_GetArchName(Crossfire_Object* whoptr, void* closure) |
509 |
|
|
{ |
510 |
|
|
return Py_BuildValue("s",cf_object_get_property(whoptr->obj, CFAPI_OBJECT_PROP_ARCH_NAME)); |
511 |
|
|
} |
512 |
|
|
static PyObject* Object_GetArchetype(Crossfire_Object* whoptr, void* closure) |
513 |
|
|
{ |
514 |
|
|
return Crossfire_Archetype_wrap(cf_object_get_property(whoptr->obj, CFAPI_OBJECT_PROP_ARCHETYPE)); |
515 |
|
|
} |
516 |
|
|
|
517 |
|
|
|
518 |
|
|
static int Object_SetMessage(Crossfire_Object* whoptr, PyObject* value, void* closure) |
519 |
|
|
{ |
520 |
|
|
char* val; |
521 |
|
|
if (value==NULL) |
522 |
|
|
{ |
523 |
|
|
PyErr_SetString(PyExc_TypeError, "Cannot delete the Message attribute"); |
524 |
|
|
return -1; |
525 |
|
|
} |
526 |
|
|
if (!PyString_Check(value)) |
527 |
|
|
{ |
528 |
|
|
PyErr_SetString(PyExc_TypeError, "The Message attribute must be a string"); |
529 |
|
|
return -1; |
530 |
|
|
} |
531 |
|
|
if (!PyArg_Parse(value,"s",&val)) |
532 |
|
|
return -1; |
533 |
|
|
|
534 |
|
|
cf_object_set_string_property(whoptr->obj, CFAPI_OBJECT_PROP_MESSAGE, val); |
535 |
|
|
return 0; |
536 |
|
|
} |
537 |
|
|
static int Object_SetName(Crossfire_Object* whoptr, PyObject* value, void* closure) |
538 |
|
|
{ |
539 |
|
|
char* val; |
540 |
|
|
if (value==NULL) |
541 |
|
|
{ |
542 |
|
|
PyErr_SetString(PyExc_TypeError, "Cannot delete the Name attribute"); |
543 |
|
|
return -1; |
544 |
|
|
} |
545 |
|
|
if (!PyString_Check(value)) |
546 |
|
|
{ |
547 |
|
|
PyErr_SetString(PyExc_TypeError, "The Name attribute must be a string"); |
548 |
|
|
return -1; |
549 |
|
|
} |
550 |
|
|
if (!PyArg_Parse(value,"s",&val)) |
551 |
|
|
return -1; |
552 |
|
|
|
553 |
|
|
cf_object_set_string_property(whoptr->obj, CFAPI_OBJECT_PROP_NAME, val); |
554 |
|
|
cf_object_set_string_property(whoptr->obj, CFAPI_OBJECT_PROP_NAME_PLURAL, val); |
555 |
|
|
return 0; |
556 |
|
|
} |
557 |
|
|
static int Object_SetNamePl(Crossfire_Object* whoptr, PyObject* value, void* closure) |
558 |
|
|
{ |
559 |
|
|
char* val; |
560 |
|
|
if (value==NULL) |
561 |
|
|
{ |
562 |
|
|
PyErr_SetString(PyExc_TypeError, "Cannot delete the NamePl attribute"); |
563 |
|
|
return -1; |
564 |
|
|
} |
565 |
|
|
if (!PyString_Check(value)) |
566 |
|
|
{ |
567 |
|
|
PyErr_SetString(PyExc_TypeError, "The NamePl attribute must be a string"); |
568 |
|
|
return -1; |
569 |
|
|
} |
570 |
|
|
if (!PyArg_Parse(value,"s",&val)) |
571 |
|
|
return -1; |
572 |
|
|
|
573 |
|
|
cf_object_set_string_property(whoptr->obj, CFAPI_OBJECT_PROP_NAME_PLURAL, val); |
574 |
|
|
return 0; |
575 |
|
|
} |
576 |
|
|
static int Object_SetTitle(Crossfire_Object* whoptr, PyObject* value, void* closure) |
577 |
|
|
{ |
578 |
|
|
char* val; |
579 |
|
|
if (value==NULL) |
580 |
|
|
{ |
581 |
|
|
PyErr_SetString(PyExc_TypeError, "Cannot delete the Title attribute"); |
582 |
|
|
return -1; |
583 |
|
|
} |
584 |
|
|
if (!PyString_Check(value)) |
585 |
|
|
{ |
586 |
|
|
PyErr_SetString(PyExc_TypeError, "The Title attribute must be a string"); |
587 |
|
|
return -1; |
588 |
|
|
} |
589 |
|
|
if (!PyArg_Parse(value,"s",&val)) |
590 |
|
|
return -1; |
591 |
|
|
|
592 |
|
|
cf_object_set_string_property(whoptr->obj, CFAPI_OBJECT_PROP_TITLE, val); |
593 |
|
|
return 0; |
594 |
|
|
} |
595 |
|
|
static int Object_SetMap(Crossfire_Object* whoptr, PyObject* value, void* closure) |
596 |
|
|
{ |
597 |
|
|
Crossfire_Map* val; |
598 |
|
|
|
599 |
|
|
if (!PyArg_Parse(value,"O",&val)) |
600 |
|
|
return -1; |
601 |
|
|
|
602 |
|
|
cf_object_change_map(whoptr->obj, -1, -1, val->map); |
603 |
|
|
return 0; |
604 |
|
|
} |
605 |
|
|
static int Object_SetSlaying(Crossfire_Object* whoptr, PyObject* value, void* closure) |
606 |
|
|
{ |
607 |
|
|
char* val; |
608 |
|
|
if (value==NULL) |
609 |
|
|
{ |
610 |
|
|
PyErr_SetString(PyExc_TypeError, "Cannot delete the Slaying attribute"); |
611 |
|
|
return -1; |
612 |
|
|
} |
613 |
|
|
if (!PyString_Check(value)) |
614 |
|
|
{ |
615 |
|
|
PyErr_SetString(PyExc_TypeError, "The Slaying attribute must be a string"); |
616 |
|
|
return -1; |
617 |
|
|
} |
618 |
|
|
if (!PyArg_Parse(value,"s",&val)) |
619 |
|
|
return -1; |
620 |
|
|
|
621 |
|
|
cf_object_set_string_property(whoptr->obj, CFAPI_OBJECT_PROP_SLAYING, val); |
622 |
|
|
return 0; |
623 |
|
|
} |
624 |
|
|
static int Object_SetCursed(Crossfire_Object* whoptr, PyObject* value, void* closure) |
625 |
|
|
{ |
626 |
|
|
int val; |
627 |
|
|
|
628 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
629 |
|
|
return -1; |
630 |
|
|
|
631 |
|
|
cf_object_set_flag(whoptr->obj, FLAG_CURSED, val); |
632 |
|
|
return 0; |
633 |
|
|
} |
634 |
|
|
static int Object_SetDamned(Crossfire_Object* whoptr, PyObject* value, void* closure) |
635 |
|
|
{ |
636 |
|
|
int val; |
637 |
|
|
|
638 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
639 |
|
|
return -1; |
640 |
|
|
|
641 |
|
|
cf_object_set_flag(whoptr->obj, FLAG_DAMNED, val); |
642 |
|
|
return 0; |
643 |
|
|
} |
644 |
|
|
static int Object_SetStr(Crossfire_Object* whoptr, PyObject* value, void* closure) |
645 |
|
|
{ |
646 |
|
|
int val; |
647 |
|
|
|
648 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
649 |
|
|
return -1; |
650 |
|
|
|
651 |
|
|
cf_object_set_int_property(whoptr->obj, CFAPI_OBJECT_PROP_STR, val); |
652 |
|
|
/* cf_fix_object(whoptr->obj);*/ |
653 |
|
|
return 0; |
654 |
|
|
} |
655 |
|
|
static int Object_SetDex(Crossfire_Object* whoptr, PyObject* value, void* closure) |
656 |
|
|
{ |
657 |
|
|
int val; |
658 |
|
|
|
659 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
660 |
|
|
return -1; |
661 |
|
|
|
662 |
|
|
cf_object_set_int_property(whoptr->obj, CFAPI_OBJECT_PROP_DEX, val); |
663 |
|
|
/*cf_fix_object(whoptr->obj);*/ |
664 |
|
|
return 0; |
665 |
|
|
} |
666 |
|
|
static int Object_SetCon(Crossfire_Object* whoptr, PyObject* value, void* closure) |
667 |
|
|
{ |
668 |
|
|
int val; |
669 |
|
|
|
670 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
671 |
|
|
return -1; |
672 |
|
|
|
673 |
|
|
cf_object_set_int_property(whoptr->obj, CFAPI_OBJECT_PROP_CON, val); |
674 |
|
|
/*cf_fix_object(whoptr->obj);*/ |
675 |
|
|
return 0; |
676 |
|
|
} |
677 |
|
|
static int Object_SetInt(Crossfire_Object* whoptr, PyObject* value, void* closure) |
678 |
|
|
{ |
679 |
|
|
int val; |
680 |
|
|
|
681 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
682 |
|
|
return -1; |
683 |
|
|
|
684 |
|
|
cf_object_set_int_property(whoptr->obj, CFAPI_OBJECT_PROP_INT, val); |
685 |
|
|
/*cf_fix_object(whoptr->obj);*/ |
686 |
|
|
return 0; |
687 |
|
|
} |
688 |
|
|
static int Object_SetPow(Crossfire_Object* whoptr, PyObject* value, void* closure) |
689 |
|
|
{ |
690 |
|
|
int val; |
691 |
|
|
|
692 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
693 |
|
|
return -1; |
694 |
|
|
|
695 |
|
|
cf_object_set_int_property(whoptr->obj, CFAPI_OBJECT_PROP_POW, val); |
696 |
|
|
/*cf_fix_object(whoptr->obj);*/ |
697 |
|
|
return 0; |
698 |
|
|
} |
699 |
|
|
static int Object_SetWis(Crossfire_Object* whoptr, PyObject* value, void* closure) |
700 |
|
|
{ |
701 |
|
|
int val; |
702 |
|
|
|
703 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
704 |
|
|
return -1; |
705 |
|
|
|
706 |
|
|
cf_object_set_int_property(whoptr->obj, CFAPI_OBJECT_PROP_WIS, val); |
707 |
|
|
/*cf_fix_object(whoptr->obj);*/ |
708 |
|
|
return 0; |
709 |
|
|
} |
710 |
|
|
static int Object_SetCha(Crossfire_Object* whoptr, PyObject* value, void* closure) |
711 |
|
|
{ |
712 |
|
|
int val; |
713 |
|
|
|
714 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
715 |
|
|
return -1; |
716 |
|
|
|
717 |
|
|
cf_object_set_int_property(whoptr->obj, CFAPI_OBJECT_PROP_CHA, val); |
718 |
|
|
/*cf_fix_object(whoptr->obj);*/ |
719 |
|
|
return 0; |
720 |
|
|
} |
721 |
|
|
static int Object_SetHP(Crossfire_Object* whoptr, PyObject* value, void* closure) |
722 |
|
|
{ |
723 |
|
|
int val; |
724 |
|
|
|
725 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
726 |
|
|
return -1; |
727 |
|
|
|
728 |
|
|
cf_object_set_int_property(whoptr->obj, CFAPI_OBJECT_PROP_HP, val); |
729 |
|
|
return 0; |
730 |
|
|
} |
731 |
|
|
static int Object_SetMaxHP(Crossfire_Object* whoptr, PyObject* value, void* closure) |
732 |
|
|
{ |
733 |
|
|
int val; |
734 |
|
|
|
735 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
736 |
|
|
return -1; |
737 |
|
|
|
738 |
|
|
cf_object_set_int_property(whoptr->obj, CFAPI_OBJECT_PROP_MAXHP, val); |
739 |
|
|
return 0; |
740 |
|
|
} |
741 |
|
|
static int Object_SetSP(Crossfire_Object* whoptr, PyObject* value, void* closure) |
742 |
|
|
{ |
743 |
|
|
int val; |
744 |
|
|
|
745 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
746 |
|
|
return -1; |
747 |
|
|
|
748 |
|
|
cf_object_set_int_property(whoptr->obj, CFAPI_OBJECT_PROP_SP, val); |
749 |
|
|
return 0; |
750 |
|
|
} |
751 |
|
|
static int Object_SetMaxSP(Crossfire_Object* whoptr, PyObject* value, void* closure) |
752 |
|
|
{ |
753 |
|
|
int val; |
754 |
|
|
|
755 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
756 |
|
|
return -1; |
757 |
|
|
|
758 |
|
|
cf_object_set_int_property(whoptr->obj, CFAPI_OBJECT_PROP_MAXSP, val); |
759 |
|
|
return 0; |
760 |
|
|
} |
761 |
|
|
static int Object_SetGrace(Crossfire_Object* whoptr, PyObject* value, void* closure) |
762 |
|
|
{ |
763 |
|
|
int val; |
764 |
|
|
|
765 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
766 |
|
|
return -1; |
767 |
|
|
|
768 |
|
|
cf_object_set_int_property(whoptr->obj, CFAPI_OBJECT_PROP_GP, val); |
769 |
|
|
return 0; |
770 |
|
|
} |
771 |
|
|
static int Object_SetMaxGrace(Crossfire_Object* whoptr, PyObject* value, void* closure) |
772 |
|
|
{ |
773 |
|
|
int val; |
774 |
|
|
|
775 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
776 |
|
|
return -1; |
777 |
|
|
|
778 |
|
|
cf_object_set_int_property(whoptr->obj, CFAPI_OBJECT_PROP_MAXGP, val); |
779 |
|
|
return 0; |
780 |
|
|
} |
781 |
|
|
static int Object_SetAC(Crossfire_Object* whoptr, PyObject* value, void* closure) |
782 |
|
|
{ |
783 |
|
|
int val; |
784 |
|
|
|
785 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
786 |
|
|
return -1; |
787 |
|
|
|
788 |
|
|
cf_object_set_int_property(whoptr->obj, CFAPI_OBJECT_PROP_AC, val); |
789 |
|
|
return 0; |
790 |
|
|
} |
791 |
|
|
static int Object_SetWC(Crossfire_Object* whoptr, PyObject* value, void* closure) |
792 |
|
|
{ |
793 |
|
|
int val; |
794 |
|
|
|
795 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
796 |
|
|
return -1; |
797 |
|
|
|
798 |
|
|
cf_object_set_int_property(whoptr->obj, CFAPI_OBJECT_PROP_WC, val); |
799 |
|
|
return 0; |
800 |
|
|
} |
801 |
|
|
static int Object_SetDam(Crossfire_Object* whoptr, PyObject* value, void* closure) |
802 |
|
|
{ |
803 |
|
|
int val; |
804 |
|
|
|
805 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
806 |
|
|
return -1; |
807 |
|
|
|
808 |
|
|
cf_object_set_int_property(whoptr->obj, CFAPI_OBJECT_PROP_DAM, val); |
809 |
|
|
return 0; |
810 |
|
|
} |
811 |
|
|
static int Object_SetFood(Crossfire_Object* whoptr, PyObject* value, void* closure) |
812 |
|
|
{ |
813 |
|
|
int val; |
814 |
|
|
|
815 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
816 |
|
|
return -1; |
817 |
|
|
|
818 |
|
|
cf_object_set_int_property(whoptr->obj, CFAPI_OBJECT_PROP_FP, val); |
819 |
|
|
return 0; |
820 |
|
|
} |
821 |
|
|
static int Object_SetWeight(Crossfire_Object* whoptr, PyObject* value, void* closure) |
822 |
|
|
{ |
823 |
|
|
int val; |
824 |
|
|
|
825 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
826 |
|
|
return -1; |
827 |
|
|
|
828 |
|
|
cf_object_set_int_property(whoptr->obj, CFAPI_OBJECT_PROP_WEIGHT, val); |
829 |
|
|
return 0; |
830 |
|
|
} |
831 |
|
|
static int Object_SetWeightLimit(Crossfire_Object* whoptr, PyObject* value, void* closure) |
832 |
|
|
{ |
833 |
|
|
int val; |
834 |
|
|
|
835 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
836 |
|
|
return -1; |
837 |
|
|
|
838 |
|
|
cf_object_set_int_property(whoptr->obj, CFAPI_OBJECT_PROP_WEIGHT_LIMIT, val); |
839 |
|
|
return 0; |
840 |
|
|
} |
841 |
|
|
static int Object_SetDirection(Crossfire_Object* whoptr, PyObject* value, void* closure) |
842 |
|
|
{ |
843 |
|
|
int val; |
844 |
|
|
|
845 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
846 |
|
|
return -1; |
847 |
|
|
|
848 |
|
|
cf_object_set_int_property(whoptr->obj, CFAPI_OBJECT_PROP_DIRECTION, val); |
849 |
|
|
return 0; |
850 |
|
|
} |
851 |
|
|
static int Object_SetFacing(Crossfire_Object* whoptr, PyObject* value, void* closure) |
852 |
|
|
{ |
853 |
|
|
int val; |
854 |
|
|
|
855 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
856 |
|
|
return -1; |
857 |
|
|
|
858 |
|
|
cf_object_set_int_property(whoptr->obj, CFAPI_OBJECT_PROP_FACING, val); |
859 |
|
|
return 0; |
860 |
|
|
} |
861 |
|
|
static int Object_SetGod(Crossfire_Object* whoptr, PyObject* value, void* closure) |
862 |
|
|
{ |
863 |
|
|
char* val; |
864 |
|
|
|
865 |
|
|
if (!PyArg_Parse(value,"s",&val)) |
866 |
|
|
return -1; |
867 |
|
|
|
868 |
|
|
cf_object_set_string_property(whoptr->obj, CFAPI_OBJECT_PROP_GOD, val); |
869 |
|
|
return 0; |
870 |
|
|
} |
871 |
|
|
static int Object_SetSpeed(Crossfire_Object* whoptr, PyObject* value, void* closure) |
872 |
|
|
{ |
873 |
|
|
int val; |
874 |
|
|
|
875 |
|
|
if (!PyArg_Parse(value,"d",&val)) |
876 |
|
|
return -1; |
877 |
|
|
|
878 |
|
|
cf_object_set_int_property(whoptr->obj, CFAPI_OBJECT_PROP_SPEED, val); |
879 |
|
|
/* cf_fix_object(whoptr->obj);*/ |
880 |
|
|
return 0; |
881 |
|
|
} |
882 |
|
|
static int Object_SetQuantity(Crossfire_Object* whoptr, PyObject* value, void* closure) |
883 |
|
|
{ |
884 |
|
|
int val; |
885 |
|
|
|
886 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
887 |
|
|
return -1; |
888 |
|
|
|
889 |
|
|
if (cf_object_set_nrof(whoptr->obj, val) != 0) { |
890 |
|
|
PyErr_SetString(PyExc_TypeError, "Invalid quantity"); |
891 |
|
|
return -1; |
892 |
|
|
} |
893 |
|
|
|
894 |
|
|
/* cf_fix_object(whoptr->obj);*/ |
895 |
|
|
return 0; |
896 |
|
|
} |
897 |
|
|
static int Object_SetLastSP(Crossfire_Object* whoptr, PyObject* value, void* closure) |
898 |
|
|
{ |
899 |
|
|
int val; |
900 |
|
|
|
901 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
902 |
|
|
return -1; |
903 |
|
|
|
904 |
|
|
cf_object_set_int_property(whoptr->obj, CFAPI_OBJECT_PROP_LAST_SP, val); |
905 |
|
|
/* cf_fix_object(whoptr->obj);*/ |
906 |
|
|
return 0; |
907 |
|
|
} |
908 |
|
|
static int Object_SetLastGrace(Crossfire_Object* whoptr, PyObject* value, void* closure) |
909 |
|
|
{ |
910 |
|
|
int val; |
911 |
|
|
|
912 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
913 |
|
|
return -1; |
914 |
|
|
|
915 |
|
|
cf_object_set_int_property(whoptr->obj, CFAPI_OBJECT_PROP_LAST_GRACE, val); |
916 |
|
|
/* cf_fix_object(whoptr->obj);*/ |
917 |
|
|
return 0; |
918 |
|
|
} |
919 |
|
|
static int Object_SetFace(Crossfire_Object* whoptr, PyObject* value, void* closure) |
920 |
|
|
{ |
921 |
|
|
char* txt; |
922 |
|
|
|
923 |
|
|
if (!PyArg_ParseTuple(value,"s",&txt)) |
924 |
|
|
return -1; |
925 |
|
|
|
926 |
|
|
cf_object_set_int_property(whoptr->obj, CFAPI_OBJECT_PROP_FACE, cf_find_animation(txt)); |
927 |
|
|
return 0; |
928 |
|
|
} |
929 |
|
|
static int Object_SetAttackType(Crossfire_Object* whoptr, PyObject* value, void* closure) |
930 |
|
|
{ |
931 |
|
|
int val; |
932 |
|
|
|
933 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
934 |
|
|
return -1; |
935 |
|
|
|
936 |
|
|
cf_object_set_int_property(whoptr->obj, CFAPI_OBJECT_PROP_ATTACK_TYPE, val); |
937 |
|
|
/* cf_fix_object(whoptr->obj);*/ |
938 |
|
|
return 0; |
939 |
|
|
} |
940 |
|
|
static int Object_SetUnaggressive(Crossfire_Object* whoptr, PyObject* value, void* closure) |
941 |
|
|
{ |
942 |
|
|
int val; |
943 |
|
|
|
944 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
945 |
|
|
return -1; |
946 |
|
|
|
947 |
|
|
cf_object_set_flag(whoptr->obj, FLAG_UNAGGRESSIVE, val); |
948 |
|
|
return 0; |
949 |
|
|
} |
950 |
|
|
static int Object_SetPickable(Crossfire_Object* whoptr, PyObject* value, void* closure) |
951 |
|
|
{ |
952 |
|
|
int val; |
953 |
|
|
|
954 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
955 |
|
|
return -1; |
956 |
|
|
|
957 |
|
|
cf_object_set_flag(whoptr->obj, FLAG_NO_PICK, !val); |
958 |
|
|
return 0; |
959 |
|
|
} |
960 |
|
|
static int Object_SetInvisible(Crossfire_Object* whoptr, PyObject* value, void* closure) |
961 |
|
|
{ |
962 |
|
|
int val; |
963 |
|
|
|
964 |
|
|
if (!PyArg_ParseTuple(value,"i",&val)) |
965 |
|
|
return -1; |
966 |
|
|
|
967 |
|
|
cf_object_set_int_property(whoptr->obj, CFAPI_OBJECT_PROP_INVISIBLE, val); |
968 |
|
|
return 0; |
969 |
|
|
} |
970 |
|
|
static int Object_SetFlying(Crossfire_Object* whoptr, PyObject* value, void* closure) |
971 |
|
|
{ |
972 |
|
|
int val; |
973 |
|
|
|
974 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
975 |
|
|
return -1; |
976 |
|
|
/* FIXME */ |
977 |
|
|
/*cf_object_set_flag(whoptr->obj, FLAG_FLYING, val);*/ |
978 |
|
|
return 0; |
979 |
|
|
} |
980 |
|
|
static int Object_SetUnpaid(Crossfire_Object* whoptr, PyObject* value, void* closure) |
981 |
|
|
{ |
982 |
|
|
int val; |
983 |
|
|
|
984 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
985 |
|
|
return -1; |
986 |
|
|
|
987 |
|
|
cf_object_set_flag(whoptr->obj, FLAG_UNPAID, val); |
988 |
|
|
return 0; |
989 |
|
|
} |
990 |
|
|
static int Object_SetFriendly(Crossfire_Object* whoptr, PyObject* value, void* closure) |
991 |
|
|
{ |
992 |
|
|
int val; |
993 |
|
|
|
994 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
995 |
|
|
return -1; |
996 |
|
|
|
997 |
|
|
cf_object_set_flag(whoptr->obj, FLAG_FRIENDLY, val); |
998 |
|
|
return 0; |
999 |
|
|
} |
1000 |
|
|
static int Object_SetCanSeeInvisible(Crossfire_Object* whoptr, PyObject* value, void* closure) |
1001 |
|
|
{ |
1002 |
|
|
int val; |
1003 |
|
|
|
1004 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
1005 |
|
|
return -1; |
1006 |
|
|
|
1007 |
|
|
cf_object_set_flag(whoptr->obj, FLAG_SEE_INVISIBLE, val); |
1008 |
|
|
return 0; |
1009 |
|
|
} |
1010 |
|
|
static int Object_SetRollable(Crossfire_Object* whoptr, PyObject* value, void* closure) |
1011 |
|
|
{ |
1012 |
|
|
int val; |
1013 |
|
|
|
1014 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
1015 |
|
|
return -1; |
1016 |
|
|
|
1017 |
|
|
cf_object_set_flag(whoptr->obj, FLAG_CAN_ROLL, val); |
1018 |
|
|
return 0; |
1019 |
|
|
} |
1020 |
|
|
static int Object_SetTurnable(Crossfire_Object* whoptr, PyObject* value, void* closure) |
1021 |
|
|
{ |
1022 |
|
|
int val; |
1023 |
|
|
|
1024 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
1025 |
|
|
return -1; |
1026 |
|
|
|
1027 |
|
|
cf_object_set_flag(whoptr->obj, FLAG_IS_TURNABLE, val); |
1028 |
|
|
return 0; |
1029 |
|
|
} |
1030 |
|
|
static int Object_SetUsedUp(Crossfire_Object* whoptr, PyObject* value, void* closure) |
1031 |
|
|
{ |
1032 |
|
|
int val; |
1033 |
|
|
|
1034 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
1035 |
|
|
return -1; |
1036 |
|
|
|
1037 |
|
|
cf_object_set_flag(whoptr->obj, FLAG_IS_USED_UP, val); |
1038 |
|
|
return 0; |
1039 |
|
|
} |
1040 |
|
|
static int Object_SetBlind(Crossfire_Object* whoptr, PyObject* value, void* closure) |
1041 |
|
|
{ |
1042 |
|
|
int val; |
1043 |
|
|
|
1044 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
1045 |
|
|
return -1; |
1046 |
|
|
|
1047 |
|
|
cf_object_set_flag(whoptr->obj, FLAG_BLIND, val); |
1048 |
|
|
return 0; |
1049 |
|
|
} |
1050 |
|
|
static int Object_SetKnownCursed(Crossfire_Object* whoptr, PyObject* value, void* closure) |
1051 |
|
|
{ |
1052 |
|
|
int val; |
1053 |
|
|
|
1054 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
1055 |
|
|
return -1; |
1056 |
|
|
|
1057 |
|
|
cf_object_set_flag(whoptr->obj, FLAG_KNOWN_CURSED, val); |
1058 |
|
|
return 0; |
1059 |
|
|
} |
1060 |
|
|
static int Object_SetStealthy(Crossfire_Object* whoptr, PyObject* value, void* closure) |
1061 |
|
|
{ |
1062 |
|
|
int val; |
1063 |
|
|
|
1064 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
1065 |
|
|
return -1; |
1066 |
|
|
|
1067 |
|
|
cf_object_set_flag(whoptr->obj, FLAG_STEALTH, val); |
1068 |
|
|
return 0; |
1069 |
|
|
} |
1070 |
|
|
static int Object_SetConfused(Crossfire_Object* whoptr, PyObject* value, void* closure) |
1071 |
|
|
{ |
1072 |
|
|
int val; |
1073 |
|
|
|
1074 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
1075 |
|
|
return -1; |
1076 |
|
|
|
1077 |
|
|
cf_object_set_flag(whoptr->obj, FLAG_CONFUSED, val); |
1078 |
|
|
return 0; |
1079 |
|
|
} |
1080 |
|
|
static int Object_SetSleeping(Crossfire_Object* whoptr, PyObject* value, void* closure) |
1081 |
|
|
{ |
1082 |
|
|
int val; |
1083 |
|
|
|
1084 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
1085 |
|
|
return -1; |
1086 |
|
|
|
1087 |
|
|
cf_object_set_flag(whoptr->obj, FLAG_SLEEP, val); |
1088 |
|
|
return 0; |
1089 |
|
|
} |
1090 |
|
|
static int Object_SetLifesaver(Crossfire_Object* whoptr, PyObject* value, void* closure) |
1091 |
|
|
{ |
1092 |
|
|
int val; |
1093 |
|
|
|
1094 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
1095 |
|
|
return -1; |
1096 |
|
|
|
1097 |
|
|
cf_object_set_flag(whoptr->obj, FLAG_LIFESAVE, val); |
1098 |
|
|
return 0; |
1099 |
|
|
} |
1100 |
|
|
static int Object_SetHasXRays(Crossfire_Object* whoptr, PyObject* value, void* closure) |
1101 |
|
|
{ |
1102 |
|
|
int val; |
1103 |
|
|
|
1104 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
1105 |
|
|
return -1; |
1106 |
|
|
|
1107 |
|
|
cf_object_set_flag(whoptr->obj, FLAG_XRAYS, val); |
1108 |
|
|
return 0; |
1109 |
|
|
} |
1110 |
|
|
static int Object_SetCanSeeInDark(Crossfire_Object* whoptr, PyObject* value, void* closure) |
1111 |
|
|
{ |
1112 |
|
|
int val; |
1113 |
|
|
|
1114 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
1115 |
|
|
return -1; |
1116 |
|
|
|
1117 |
|
|
cf_object_set_flag(whoptr->obj, FLAG_SEE_IN_DARK, val); |
1118 |
|
|
return 0; |
1119 |
|
|
} |
1120 |
|
|
static int Object_SetKnownMagical(Crossfire_Object* whoptr, PyObject* value, void* closure) |
1121 |
|
|
{ |
1122 |
|
|
int val; |
1123 |
|
|
|
1124 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
1125 |
|
|
return -1; |
1126 |
|
|
|
1127 |
|
|
cf_object_set_flag(whoptr->obj, FLAG_KNOWN_MAGICAL, val); |
1128 |
|
|
return 0; |
1129 |
|
|
} |
1130 |
|
|
static int Object_SetReflectSpells(Crossfire_Object* whoptr, PyObject* value, void* closure) |
1131 |
|
|
{ |
1132 |
|
|
int val; |
1133 |
|
|
|
1134 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
1135 |
|
|
return -1; |
1136 |
|
|
|
1137 |
|
|
cf_object_set_flag(whoptr->obj, FLAG_REFL_SPELL, val); |
1138 |
|
|
return 0; |
1139 |
|
|
} |
1140 |
|
|
static int Object_SetReflectMissiles(Crossfire_Object* whoptr, PyObject* value, void* closure) |
1141 |
|
|
{ |
1142 |
|
|
int val; |
1143 |
|
|
|
1144 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
1145 |
|
|
return -1; |
1146 |
|
|
|
1147 |
|
|
cf_object_set_flag(whoptr->obj, FLAG_REFL_MISSILE, val); |
1148 |
|
|
return 0; |
1149 |
|
|
} |
1150 |
|
|
static int Object_SetUnique(Crossfire_Object* whoptr, PyObject* value, void* closure) |
1151 |
|
|
{ |
1152 |
|
|
int val; |
1153 |
|
|
|
1154 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
1155 |
|
|
return -1; |
1156 |
|
|
|
1157 |
|
|
cf_object_set_flag(whoptr->obj, FLAG_UNIQUE, val); |
1158 |
|
|
return 0; |
1159 |
|
|
} |
1160 |
|
|
static int Object_SetCanPassThru(Crossfire_Object* whoptr, PyObject* value, void* closure) |
1161 |
|
|
{ |
1162 |
|
|
int val; |
1163 |
|
|
|
1164 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
1165 |
|
|
return -1; |
1166 |
|
|
/* FIXME */ |
1167 |
|
|
/*cf_object_set_flag(whoptr->obj, FLAG_CAN_PASS_THRU, val);*/ |
1168 |
|
|
return 0; |
1169 |
|
|
} |
1170 |
|
|
static int Object_SetRunAway(Crossfire_Object* whoptr, PyObject* value, void* closure) |
1171 |
|
|
{ |
1172 |
|
|
int val; |
1173 |
|
|
|
1174 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
1175 |
|
|
return -1; |
1176 |
|
|
|
1177 |
|
|
cf_object_set_flag(whoptr->obj, FLAG_RUN_AWAY, val); |
1178 |
|
|
return 0; |
1179 |
|
|
} |
1180 |
|
|
static int Object_SetScared(Crossfire_Object* whoptr, PyObject* value, void* closure) |
1181 |
|
|
{ |
1182 |
|
|
int val; |
1183 |
|
|
|
1184 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
1185 |
|
|
return -1; |
1186 |
|
|
|
1187 |
|
|
cf_object_set_flag(whoptr->obj, FLAG_SCARED, val); |
1188 |
|
|
return 0; |
1189 |
|
|
} |
1190 |
|
|
static int Object_SetUndead(Crossfire_Object* whoptr, PyObject* value, void* closure) |
1191 |
|
|
{ |
1192 |
|
|
int val; |
1193 |
|
|
|
1194 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
1195 |
|
|
return -1; |
1196 |
|
|
|
1197 |
|
|
cf_object_set_flag(whoptr->obj, FLAG_UNDEAD, val); |
1198 |
|
|
return 0; |
1199 |
|
|
} |
1200 |
|
|
static int Object_SetBlocksView(Crossfire_Object* whoptr, PyObject* value, void* closure) |
1201 |
|
|
{ |
1202 |
|
|
int val; |
1203 |
|
|
|
1204 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
1205 |
|
|
return -1; |
1206 |
|
|
|
1207 |
|
|
cf_object_set_flag(whoptr->obj, FLAG_BLOCKSVIEW, val); |
1208 |
|
|
return 0; |
1209 |
|
|
} |
1210 |
|
|
static int Object_SetHitBack(Crossfire_Object* whoptr, PyObject* value, void* closure) |
1211 |
|
|
{ |
1212 |
|
|
int val; |
1213 |
|
|
|
1214 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
1215 |
|
|
return -1; |
1216 |
|
|
|
1217 |
|
|
cf_object_set_flag(whoptr->obj, FLAG_HITBACK, val); |
1218 |
|
|
return 0; |
1219 |
|
|
} |
1220 |
|
|
static int Object_SetStandStill(Crossfire_Object* whoptr, PyObject* value, void* closure) |
1221 |
|
|
{ |
1222 |
|
|
int val; |
1223 |
|
|
|
1224 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
1225 |
|
|
return -1; |
1226 |
|
|
|
1227 |
|
|
cf_object_set_flag(whoptr->obj, FLAG_STAND_STILL, val); |
1228 |
|
|
return 0; |
1229 |
|
|
} |
1230 |
|
|
static int Object_SetOnlyAttack(Crossfire_Object* whoptr, PyObject* value, void* closure) |
1231 |
|
|
{ |
1232 |
|
|
int val; |
1233 |
|
|
|
1234 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
1235 |
|
|
return -1; |
1236 |
|
|
|
1237 |
|
|
cf_object_set_flag(whoptr->obj, FLAG_ONLY_ATTACK, val); |
1238 |
|
|
return 0; |
1239 |
|
|
} |
1240 |
|
|
static int Object_SetMakeInvisible(Crossfire_Object* whoptr, PyObject* value, void* closure) |
1241 |
|
|
{ |
1242 |
|
|
int val; |
1243 |
|
|
|
1244 |
|
|
if (!PyArg_Parse(value,"i",&val)) |
1245 |
|
|
return -1; |
1246 |
|
|
|
1247 |
|
|
cf_object_set_flag(whoptr->obj, FLAG_MAKE_INVIS, val); |
1248 |
|
|
return 0; |
1249 |
|
|
} |
1250 |
|
|
static int Object_SetValue(Crossfire_Object* whoptr, PyObject* value, void* closure) |
1251 |
|
|
{ |
1252 |
|
|
long val; |
1253 |
|
|
|
1254 |
|
|
if (!PyArg_Parse(value,"l",&val)) |
1255 |
|
|
return -1; |
1256 |
|
|
|
1257 |
|
|
cf_object_set_long_property(whoptr->obj, CFAPI_OBJECT_PROP_VALUE, val); |
1258 |
|
|
return 0; |
1259 |
|
|
} |
1260 |
|
|
|
1261 |
|
|
/* Methods. */ |
1262 |
|
|
|
1263 |
|
|
static PyObject* Crossfire_Object_Remove( Crossfire_Object* who, PyObject* args ) |
1264 |
|
|
{ |
1265 |
|
|
if (!PyArg_ParseTuple(args,"",NULL)) |
1266 |
|
|
return NULL; |
1267 |
|
|
|
1268 |
|
|
if (((Crossfire_Object*)current_context->who)->obj == who->obj) |
1269 |
|
|
current_context->who = NULL; |
1270 |
|
|
|
1271 |
|
|
cf_object_remove(who->obj); |
1272 |
|
|
|
1273 |
|
|
if (current_context->activator != NULL && |
1274 |
|
|
((Crossfire_Object*)current_context->activator)->obj->type == PLAYER) |
1275 |
|
|
cf_player_send_inventory(((Crossfire_Object*)current_context->activator)->obj); |
1276 |
|
|
|
1277 |
|
|
cf_object_free(who->obj); |
1278 |
|
|
Py_INCREF(Py_None); |
1279 |
|
|
return Py_None; |
1280 |
|
|
} |
1281 |
|
|
static PyObject* Crossfire_Object_Apply( Crossfire_Object* who, PyObject* args ) |
1282 |
|
|
{ |
1283 |
|
|
Crossfire_Object* whoptr; |
1284 |
|
|
int flags; |
1285 |
|
|
|
1286 |
|
|
if (!PyArg_ParseTuple(args,"Oi",&whoptr,&flags)) |
1287 |
|
|
return NULL; |
1288 |
|
|
|
1289 |
|
|
cf_object_apply(whoptr->obj, who->obj, flags); |
1290 |
|
|
|
1291 |
|
|
Py_INCREF(Py_None); |
1292 |
|
|
return Py_None; |
1293 |
|
|
} |
1294 |
|
|
static PyObject* Crossfire_Object_Drop( Crossfire_Object* who, PyObject* args ) |
1295 |
|
|
{ |
1296 |
|
|
Crossfire_Object* whoptr; |
1297 |
|
|
|
1298 |
|
|
if (!PyArg_ParseTuple(args,"O",&whoptr)) |
1299 |
|
|
return NULL; |
1300 |
|
|
|
1301 |
|
|
cf_object_drop(whoptr->obj, who->obj); |
1302 |
|
|
Py_INCREF(Py_None); |
1303 |
|
|
return Py_None; |
1304 |
|
|
} |
1305 |
|
|
static PyObject* Crossfire_Object_Fix( Crossfire_Object* who, PyObject* args ) |
1306 |
|
|
{ |
1307 |
|
|
cf_fix_object(who->obj); |
1308 |
|
|
Py_INCREF(Py_None); |
1309 |
|
|
return Py_None; |
1310 |
|
|
} |
1311 |
|
|
static PyObject* Crossfire_Object_Pickup( Crossfire_Object* who, PyObject* args ) |
1312 |
|
|
{ |
1313 |
|
|
Crossfire_Object* what; |
1314 |
|
|
|
1315 |
|
|
if (!PyArg_ParseTuple(args,"O",&what)) |
1316 |
|
|
return NULL; |
1317 |
|
|
|
1318 |
|
|
cf_object_pickup(who->obj, what->obj); |
1319 |
|
|
Py_INCREF(Py_None); |
1320 |
|
|
return Py_None; |
1321 |
|
|
} |
1322 |
|
|
static PyObject* Crossfire_Object_Take( Crossfire_Object* who, PyObject* args ) |
1323 |
|
|
{ |
1324 |
|
|
Crossfire_Object* whoptr; |
1325 |
|
|
|
1326 |
|
|
if (!PyArg_ParseTuple(args,"O",&whoptr)) |
1327 |
|
|
return NULL; |
1328 |
|
|
|
1329 |
|
|
cf_object_take(whoptr->obj, who->obj); |
1330 |
|
|
Py_INCREF(Py_None); |
1331 |
|
|
return Py_None; |
1332 |
|
|
} |
1333 |
|
|
static PyObject* Crossfire_Object_Teleport( Crossfire_Object* who, PyObject* args ) |
1334 |
|
|
{ |
1335 |
|
|
Crossfire_Map* where; |
1336 |
|
|
int x, y; |
1337 |
|
|
int val; |
1338 |
|
|
|
1339 |
|
|
if (!PyArg_ParseTuple(args,"Oii",&where,&x,&y)) |
1340 |
|
|
return NULL; |
1341 |
|
|
|
1342 |
|
|
val = cf_object_teleport(who->obj, where->map, x, y); |
1343 |
|
|
|
1344 |
|
|
return Py_BuildValue("i",val); |
1345 |
|
|
} |
1346 |
|
|
static PyObject* Crossfire_Object_ActivateRune( Crossfire_Object* who, PyObject* args ) |
1347 |
|
|
{ |
1348 |
|
|
object* trap; |
1349 |
|
|
object* victim; |
1350 |
|
|
Crossfire_Object* pcause; |
1351 |
|
|
|
1352 |
|
|
if (!PyArg_ParseTuple(args,"O",&pcause)) |
1353 |
|
|
return NULL; |
1354 |
|
|
trap = who->obj; |
1355 |
|
|
victim = pcause->obj; |
1356 |
|
|
cf_object_activate_rune(trap, victim); |
1357 |
|
|
Py_INCREF(Py_None); |
1358 |
|
|
return Py_None; |
1359 |
|
|
} |
1360 |
|
|
|
1361 |
|
|
static PyObject* Crossfire_Object_CheckTrigger( Crossfire_Object* who, PyObject* args ) |
1362 |
|
|
{ |
1363 |
|
|
object* trigger; |
1364 |
|
|
object* cause; |
1365 |
|
|
int result; |
1366 |
|
|
Crossfire_Object* pcause; |
1367 |
|
|
|
1368 |
|
|
if (!PyArg_ParseTuple(args,"O",&pcause)) |
1369 |
|
|
return NULL; |
1370 |
|
|
trigger = who->obj; |
1371 |
|
|
cause = pcause->obj; |
1372 |
|
|
result = cf_object_check_trigger(trigger, cause); |
1373 |
|
|
|
1374 |
|
|
return Py_BuildValue("i", result); |
1375 |
|
|
} |
1376 |
|
|
|
1377 |
|
|
static PyObject* Crossfire_Object_Say( Crossfire_Object* who, PyObject* args ) |
1378 |
|
|
{ |
1379 |
|
|
char* message; |
1380 |
|
|
if ( !PyArg_ParseTuple( args, "s", &message ) ) |
1381 |
|
|
return NULL; |
1382 |
|
|
cf_object_say(who->obj, message); |
1383 |
|
|
Py_INCREF(Py_None); |
1384 |
|
|
return Py_None; |
1385 |
|
|
} |
1386 |
|
|
|
1387 |
|
|
static PyObject* Crossfire_Object_Speak( Crossfire_Object* who, PyObject* args ) |
1388 |
|
|
{ |
1389 |
|
|
char* message; |
1390 |
|
|
if ( !PyArg_ParseTuple( args, "s", &message ) ) |
1391 |
|
|
return NULL; |
1392 |
|
|
cf_object_speak(who->obj, message); |
1393 |
|
|
Py_INCREF(Py_None); |
1394 |
|
|
return Py_None; |
1395 |
|
|
} |
1396 |
|
|
|
1397 |
|
|
static PyObject* Crossfire_Object_Reposition( Crossfire_Object* who, PyObject* args ) |
1398 |
|
|
{ |
1399 |
|
|
int x, y; |
1400 |
|
|
|
1401 |
|
|
if (!PyArg_ParseTuple(args,"ii",&x,&y)) |
1402 |
|
|
return NULL; |
1403 |
|
|
|
1404 |
|
|
cf_object_transfer(who->obj,x,y,0,NULL); |
1405 |
|
|
Py_INCREF(Py_None); |
1406 |
|
|
return Py_None; |
1407 |
|
|
} |
1408 |
|
|
|
1409 |
|
|
static PyObject* Crossfire_Object_QueryName( Crossfire_Object* who, PyObject* args ) |
1410 |
|
|
{ |
1411 |
|
|
return Py_BuildValue("s",cf_query_name(who->obj)); |
1412 |
|
|
} |
1413 |
|
|
|
1414 |
|
|
static PyObject* Crossfire_Object_GetResist( Crossfire_Object* who, PyObject* args ) |
1415 |
|
|
{ |
1416 |
|
|
int resist; |
1417 |
|
|
if ( !PyArg_ParseTuple( args, "l", &resist ) ) |
1418 |
|
|
return NULL; |
1419 |
|
|
if ( ( resist < 0 ) || ( resist >= NROFATTACKS ) ) |
1420 |
|
|
{ |
1421 |
|
|
return Py_BuildValue("l",0); |
1422 |
|
|
} |
1423 |
|
|
return Py_BuildValue("i",*( sint16* )cf_object_get_resistance( who->obj, resist)); |
1424 |
|
|
} |
1425 |
|
|
static PyObject* Crossfire_Object_QueryCost( Crossfire_Object* who, PyObject* args ) |
1426 |
|
|
{ |
1427 |
|
|
int flags; |
1428 |
|
|
Crossfire_Object* pcause; |
1429 |
|
|
|
1430 |
|
|
if (!PyArg_ParseTuple(args,"Oi",&pcause,&flags)) |
1431 |
|
|
return NULL; |
1432 |
|
|
return Py_BuildValue("i",cf_object_query_cost(who->obj, pcause->obj, flags)); |
1433 |
|
|
} |
1434 |
|
|
static PyObject* Crossfire_Object_Cast( Crossfire_Object* who, PyObject* args ) |
1435 |
|
|
{ |
1436 |
|
|
int dir; |
1437 |
|
|
char* op; |
1438 |
|
|
Crossfire_Object* pspell; |
1439 |
|
|
|
1440 |
|
|
if (!PyArg_ParseTuple(args,"Ois",&pspell, &dir,&op)) |
1441 |
|
|
return NULL; |
1442 |
|
|
|
1443 |
|
|
cf_object_cast_spell(who->obj, who->obj, dir, pspell->obj, op); |
1444 |
|
|
|
1445 |
|
|
Py_INCREF(Py_None); |
1446 |
|
|
return Py_None; |
1447 |
|
|
} |
1448 |
|
|
static PyObject* Crossfire_Object_LearnSpell( Crossfire_Object* who, PyObject* args ) |
1449 |
|
|
{ |
1450 |
|
|
|
1451 |
|
|
Crossfire_Object* pspell; |
1452 |
|
|
|
1453 |
|
|
if (!PyArg_ParseTuple(args,"O",&pspell)) |
1454 |
|
|
return NULL; |
1455 |
|
|
|
1456 |
|
|
cf_object_learn_spell(who->obj, pspell->obj); |
1457 |
|
|
|
1458 |
|
|
Py_INCREF(Py_None); |
1459 |
|
|
return Py_None; |
1460 |
|
|
} |
1461 |
|
|
static PyObject* Crossfire_Object_ForgetSpell( Crossfire_Object* who, PyObject* args ) |
1462 |
|
|
{ |
1463 |
|
|
Crossfire_Object* pspell; |
1464 |
|
|
|
1465 |
|
|
if (!PyArg_ParseTuple(args,"O",&pspell)) |
1466 |
|
|
return NULL; |
1467 |
|
|
|
1468 |
|
|
cf_object_forget_spell(who->obj, pspell->obj); |
1469 |
|
|
Py_INCREF(Py_None); |
1470 |
|
|
return Py_None; |
1471 |
|
|
} |
1472 |
|
|
static PyObject* Crossfire_Object_KnowSpell( Crossfire_Object* who, PyObject* args ) |
1473 |
|
|
{ |
1474 |
|
|
char *spellname; |
1475 |
|
|
object *op; |
1476 |
|
|
|
1477 |
|
|
if (!PyArg_ParseTuple(args,"s",&spellname)) |
1478 |
|
|
return NULL; |
1479 |
|
|
|
1480 |
|
|
op = cf_object_check_for_spell(who->obj, spellname); |
1481 |
|
|
|
1482 |
|
|
if (op != NULL) |
1483 |
|
|
return Crossfire_Object_wrap(op); |
1484 |
|
|
else |
1485 |
|
|
{ |
1486 |
|
|
Py_INCREF(Py_None); |
1487 |
|
|
return Py_None; |
1488 |
|
|
} |
1489 |
|
|
} |
1490 |
|
|
|
1491 |
|
|
static PyObject* Crossfire_Object_CastAbility( Crossfire_Object* who, PyObject* args ) |
1492 |
|
|
{ |
1493 |
|
|
Crossfire_Object* pspell; |
1494 |
|
|
int dir; |
1495 |
|
|
char* str; |
1496 |
|
|
|
1497 |
|
|
if (!PyArg_ParseTuple(args,"Ois",&pspell,&dir,&str)) |
1498 |
|
|
return NULL; |
1499 |
|
|
|
1500 |
|
|
cf_object_cast_ability(who->obj,who->obj,dir,pspell->obj,str); |
1501 |
|
|
|
1502 |
|
|
Py_INCREF(Py_None); |
1503 |
|
|
return Py_None; |
1504 |
|
|
} |
1505 |
|
|
|
1506 |
|
|
static PyObject* Crossfire_Object_PayAmount( Crossfire_Object* who, PyObject* args ) |
1507 |
|
|
{ |
1508 |
|
|
uint64 to_pay; |
1509 |
|
|
int val; |
1510 |
|
|
|
1511 |
|
|
if (!PyArg_ParseTuple(args,"L",&to_pay)) |
1512 |
|
|
return NULL; |
1513 |
|
|
|
1514 |
|
|
val = cf_object_pay_amount(who->obj, to_pay); |
1515 |
|
|
|
1516 |
|
|
return Py_BuildValue("i",val); |
1517 |
|
|
} |
1518 |
|
|
static PyObject* Crossfire_Object_Pay( Crossfire_Object* who, PyObject* args ) |
1519 |
|
|
{ |
1520 |
|
|
Crossfire_Object* op; |
1521 |
|
|
int val; |
1522 |
|
|
|
1523 |
|
|
if (!PyArg_ParseTuple(args,"O",&op)) |
1524 |
|
|
return NULL; |
1525 |
|
|
|
1526 |
|
|
val = cf_object_pay_item(who->obj, op->obj); |
1527 |
|
|
|
1528 |
|
|
return Py_BuildValue("i",val); |
1529 |
|
|
} |
1530 |
|
|
static PyObject* Crossfire_Object_ReadKey( Crossfire_Object* who, PyObject* args ) |
1531 |
|
|
{ |
1532 |
|
|
char* val; |
1533 |
|
|
char* keyname; |
1534 |
|
|
|
1535 |
|
|
if (!PyArg_ParseTuple(args,"s",&keyname)) |
1536 |
|
|
return NULL; |
1537 |
|
|
|
1538 |
|
|
val = cf_object_get_key(who->obj, keyname); |
1539 |
|
|
|
1540 |
|
|
return Py_BuildValue("s",val); |
1541 |
|
|
} |
1542 |
|
|
static PyObject* Crossfire_Object_WriteKey( Crossfire_Object* who, PyObject* args ) |
1543 |
|
|
{ |
1544 |
|
|
char* keyname; |
1545 |
|
|
char* value; |
1546 |
|
|
|
1547 |
|
|
if (!PyArg_ParseTuple(args,"ss",&keyname,&value)) |
1548 |
|
|
return NULL; |
1549 |
|
|
|
1550 |
|
|
cf_object_set_key(who->obj, keyname, value); |
1551 |
|
|
Py_INCREF(Py_None); |
1552 |
|
|
return Py_None; |
1553 |
|
|
} |
1554 |
|
|
static PyObject* Crossfire_Object_CheckInventory( Crossfire_Object* who, PyObject* args ) |
1555 |
|
|
{ |
1556 |
|
|
char* whatstr; |
1557 |
|
|
object* foundob; |
1558 |
|
|
|
1559 |
|
|
if (!PyArg_ParseTuple(args,"s",&whatstr)) |
1560 |
|
|
return NULL; |
1561 |
|
|
|
1562 |
|
|
foundob = cf_object_present_archname_inside(who->obj, whatstr); |
1563 |
|
|
|
1564 |
|
|
if (foundob != NULL) |
1565 |
|
|
return Crossfire_Object_wrap(foundob); |
1566 |
|
|
/* for(tmp = WHO->inv; tmp; tmp = tmp->below) |
1567 |
|
|
{ |
1568 |
|
|
if (!strncmp(PyQueryName(tmp),whatstr,strlen(whatstr))) |
1569 |
|
|
{ |
1570 |
|
|
return Py_BuildValue("l",(long)(tmp)); |
1571 |
|
|
}; |
1572 |
|
|
if (!strncmp(tmp->name,whatstr,strlen(whatstr))) |
1573 |
|
|
{ |
1574 |
|
|
return Py_BuildValue("l",(long)(tmp)); |
1575 |
|
|
}; |
1576 |
|
|
}; |
1577 |
|
|
|
1578 |
|
|
return Py_BuildValue("l",(long)0);*/ |
1579 |
|
|
|
1580 |
|
|
Py_INCREF(Py_None); |
1581 |
|
|
return Py_None; |
1582 |
|
|
} |
1583 |
|
|
|
1584 |
|
|
static PyObject* Crossfire_Object_CheckArchInventory( Crossfire_Object* who, PyObject* args ) |
1585 |
|
|
{ |
1586 |
|
|
char* whatstr; |
1587 |
|
|
object* tmp; |
1588 |
|
|
|
1589 |
|
|
if (!PyArg_ParseTuple(args,"s",&whatstr)) |
1590 |
|
|
return NULL; |
1591 |
|
|
|
1592 |
|
|
for(tmp = who->obj->inv; tmp != NULL; tmp = tmp->below) |
1593 |
|
|
{ |
1594 |
|
|
if (!strcmp(tmp->arch->name,whatstr)) |
1595 |
|
|
break; |
1596 |
|
|
} |
1597 |
|
|
if (tmp != NULL) |
1598 |
|
|
return Crossfire_Object_wrap(tmp); |
1599 |
|
|
Py_INCREF(Py_None); |
1600 |
|
|
return Py_None; |
1601 |
|
|
} |
1602 |
|
|
static PyObject* Crossfire_Object_GetOutOfMap(Crossfire_Object* who, PyObject* args) |
1603 |
|
|
{ |
1604 |
|
|
int x, y; |
1605 |
|
|
|
1606 |
|
|
if (!PyArg_ParseTuple(args,"ii",&x,&y)) |
1607 |
|
|
return NULL; |
1608 |
|
|
|
1609 |
|
|
return Py_BuildValue("i", cf_object_out_of_map(who->obj,x,y)); |
1610 |
|
|
} |
1611 |
|
|
static PyObject* Crossfire_Object_CreateInside(Crossfire_Object* who, PyObject* args) |
1612 |
|
|
{ |
1613 |
|
|
char* txt; |
1614 |
|
|
object* myob; |
1615 |
|
|
|
1616 |
|
|
if (!PyArg_ParseTuple(args,"s",&txt)) |
1617 |
|
|
return NULL; |
1618 |
|
|
|
1619 |
|
|
myob = cf_create_object_by_name(txt); |
1620 |
|
|
myob = cf_object_insert_object(myob, who->obj); |
1621 |
|
|
|
1622 |
|
|
return Crossfire_Object_wrap(myob); |
1623 |
|
|
|
1624 |
|
|
} |
1625 |
|
|
static PyObject* Crossfire_Object_InsertInto(Crossfire_Object* who, PyObject* args) |
1626 |
|
|
{ |
1627 |
|
|
Crossfire_Object* op; |
1628 |
|
|
object* myob; |
1629 |
|
|
|
1630 |
|
|
if (!PyArg_ParseTuple(args,"O",&op)) |
1631 |
|
|
return NULL; |
1632 |
|
|
|
1633 |
|
|
myob = cf_object_insert_in_ob(who->obj, op->obj); |
1634 |
|
|
|
1635 |
|
|
return Crossfire_Object_wrap(myob); |
1636 |
|
|
} |
1637 |
|
|
|
1638 |
|
|
static int Crossfire_Object_InternalCompare(Crossfire_Object* left, Crossfire_Object* right) |
1639 |
|
|
{ |
1640 |
|
|
return ((int)left->obj - (int)right->obj); |
1641 |
|
|
} |
1642 |
|
|
|
1643 |
|
|
/* Legacy code: convert to long so that non-object functions work correctly */ |
1644 |
|
|
static PyObject* Crossfire_Object_Long( PyObject* obj ) |
1645 |
|
|
{ |
1646 |
|
|
return Py_BuildValue("l", ((Crossfire_Object*)obj)->obj); |
1647 |
|
|
} |
1648 |
|
|
|
1649 |
|
|
static PyObject* Crossfire_Object_Int( PyObject* obj ) |
1650 |
|
|
{ |
1651 |
|
|
return Py_BuildValue("i", ((Crossfire_Object*)obj)->obj); |
1652 |
|
|
} |
1653 |
|
|
|
1654 |
|
|
/** |
1655 |
|
|
* Python initialized. |
1656 |
|
|
**/ |
1657 |
|
|
static PyObject * |
1658 |
|
|
Crossfire_Object_new(PyTypeObject *type, PyObject *args, PyObject *kwds) |
1659 |
|
|
{ |
1660 |
|
|
Crossfire_Object *self; |
1661 |
|
|
|
1662 |
|
|
self = (Crossfire_Object *)type->tp_alloc(type, 0); |
1663 |
|
|
if(self) |
1664 |
|
|
self->obj = NULL; |
1665 |
|
|
|
1666 |
|
|
return (PyObject *)self; |
1667 |
|
|
} |
1668 |
|
|
static PyObject * |
1669 |
|
|
Crossfire_Player_new(PyTypeObject *type, PyObject *args, PyObject *kwds) |
1670 |
|
|
{ |
1671 |
|
|
Crossfire_Player *self; |
1672 |
|
|
|
1673 |
|
|
self = (Crossfire_Player *)type->tp_alloc(type, 0); |
1674 |
|
|
if(self) |
1675 |
|
|
self->obj = NULL; |
1676 |
|
|
|
1677 |
|
|
return (PyObject *)self; |
1678 |
|
|
} |
1679 |
|
|
|
1680 |
|
|
PyObject *Crossfire_Object_wrap(object *what) |
1681 |
|
|
{ |
1682 |
|
|
Crossfire_Object *wrapper; |
1683 |
|
|
Crossfire_Player *plwrap; |
1684 |
|
|
|
1685 |
|
|
/* return None if no object was to be wrapped */ |
1686 |
|
|
if(what == NULL) { |
1687 |
|
|
Py_INCREF(Py_None); |
1688 |
|
|
return Py_None; |
1689 |
|
|
} |
1690 |
|
|
|
1691 |
|
|
if (what->type == PLAYER) |
1692 |
|
|
{ |
1693 |
|
|
plwrap = PyObject_NEW(Crossfire_Player, &Crossfire_PlayerType); |
1694 |
|
|
if(plwrap != NULL) |
1695 |
|
|
plwrap->obj = what; |
1696 |
|
|
return (PyObject *)plwrap; |
1697 |
|
|
} |
1698 |
|
|
else |
1699 |
|
|
{ |
1700 |
|
|
wrapper = PyObject_NEW(Crossfire_Object, &Crossfire_ObjectType); |
1701 |
|
|
if(wrapper != NULL) |
1702 |
|
|
wrapper->obj = what; |
1703 |
|
|
return (PyObject *)wrapper; |
1704 |
|
|
} |
1705 |
|
|
} |