| 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 |
static PyObject* Object_GetName(Crossfire_Object* whoptr, void* closure); |
| 29 |
static PyObject* Object_GetNamePl(Crossfire_Object* whoptr, void* closure); |
| 30 |
static PyObject* Object_GetTitle(Crossfire_Object* whoptr, void* closure); |
| 31 |
static PyObject* Object_GetMap(Crossfire_Object* whoptr, void* closure); |
| 32 |
static PyObject* Object_GetCha(Crossfire_Object* whoptr, void* closure); |
| 33 |
static PyObject* Object_GetCon(Crossfire_Object* whoptr, void* closure); |
| 34 |
static PyObject* Object_GetDex(Crossfire_Object* whoptr, void* closure); |
| 35 |
static PyObject* Object_GetInt(Crossfire_Object* whoptr, void* closure); |
| 36 |
static PyObject* Object_GetPow(Crossfire_Object* whoptr, void* closure); |
| 37 |
static PyObject* Object_GetStr(Crossfire_Object* whoptr, void* closure); |
| 38 |
static PyObject* Object_GetWis(Crossfire_Object* whoptr, void* closure); |
| 39 |
static PyObject* Object_GetHP(Crossfire_Object* whoptr, void* closure); |
| 40 |
static PyObject* Object_GetMaxHP(Crossfire_Object* whoptr, void* closure); |
| 41 |
static PyObject* Object_GetSP(Crossfire_Object* whoptr, void* closure); |
| 42 |
static PyObject* Object_GetMaxSP(Crossfire_Object* whoptr, void* closure); |
| 43 |
static PyObject* Object_GetGrace(Crossfire_Object* whoptr, void* closure); |
| 44 |
static PyObject* Object_GetMaxGrace(Crossfire_Object* whoptr, void* closure); |
| 45 |
static PyObject* Object_GetFood(Crossfire_Object* whoptr, void* closure); |
| 46 |
static PyObject* Object_GetAC(Crossfire_Object* whoptr, void* closure); |
| 47 |
static PyObject* Object_GetWC(Crossfire_Object* whoptr, void* closure); |
| 48 |
static PyObject* Object_GetDam(Crossfire_Object* whoptr, void* closure); |
| 49 |
static PyObject* Object_GetLuck(Crossfire_Object* whoptr, void* closure); |
| 50 |
static PyObject* Object_GetMessage(Crossfire_Object* whoptr, void* closure); |
| 51 |
static PyObject* Object_GetExp(Crossfire_Object* whoptr, void* closure); |
| 52 |
static PyObject* Object_GetSlaying(Crossfire_Object* whoptr, void* closure); |
| 53 |
static PyObject* Object_GetCursed(Crossfire_Object* whoptr, void* closure); |
| 54 |
static PyObject* Object_GetDamned(Crossfire_Object* whoptr, void* closure); |
| 55 |
static PyObject* Object_GetWeight(Crossfire_Object* whoptr, void* closure); |
| 56 |
static PyObject* Object_GetWeightLimit(Crossfire_Object* whoptr, void* closure); |
| 57 |
static PyObject* Object_GetAbove(Crossfire_Object* whoptr, void* closure); |
| 58 |
static PyObject* Object_GetBelow(Crossfire_Object* whoptr, void* closure); |
| 59 |
static PyObject* Object_GetInventory(Crossfire_Object* whoptr, void* closure); |
| 60 |
static PyObject* Object_GetX(Crossfire_Object* whoptr, void* closure); |
| 61 |
static PyObject* Object_GetY(Crossfire_Object* whoptr, void* closure); |
| 62 |
static PyObject* Object_GetDirection(Crossfire_Object* whoptr, void* closure); |
| 63 |
static PyObject* Object_GetFacing(Crossfire_Object* whoptr, void* closure); |
| 64 |
static PyObject* Object_GetUnaggressive(Crossfire_Object* whoptr, void* closure); |
| 65 |
static PyObject* Object_GetGod(Crossfire_Object* whoptr, void* closure); |
| 66 |
static PyObject* Object_GetPickable(Crossfire_Object* whoptr, void* closure); |
| 67 |
static PyObject* Object_GetQuantity(Crossfire_Object* whoptr, void* closure); |
| 68 |
static PyObject* Object_GetInvisible(Crossfire_Object* whoptr, void* closure); |
| 69 |
static PyObject* Object_GetSpeed(Crossfire_Object* whoptr, void* closure); |
| 70 |
static PyObject* Object_GetLastSP(Crossfire_Object* whoptr, void* closure); |
| 71 |
static PyObject* Object_GetLastGrace(Crossfire_Object* whoptr, void* closure); |
| 72 |
static PyObject* Object_GetLevel(Crossfire_Object* whoptr, void* closure); |
| 73 |
static PyObject* Object_GetFace(Crossfire_Object* whoptr, void* closure); |
| 74 |
static PyObject* Object_GetAttackType(Crossfire_Object* whoptr, void* closure); |
| 75 |
static PyObject* Object_GetBeenApplied(Crossfire_Object* whoptr, void* closure); |
| 76 |
static PyObject* Object_GetIdentified(Crossfire_Object* whoptr, void* closure); |
| 77 |
static PyObject* Object_GetAlive(Crossfire_Object* whoptr, void* closure); |
| 78 |
static PyObject* Object_GetDM(Crossfire_Object* whoptr, void* closure); |
| 79 |
static PyObject* Object_GetWasDM(Crossfire_Object* whoptr, void* closure); |
| 80 |
static PyObject* Object_GetApplied(Crossfire_Object* whoptr, void* closure); |
| 81 |
static PyObject* Object_GetUnpaid(Crossfire_Object* whoptr, void* closure); |
| 82 |
static PyObject* Object_GetFlying(Crossfire_Object* whoptr, void* closure); |
| 83 |
static PyObject* Object_GetMonster(Crossfire_Object* whoptr, void* closure); |
| 84 |
static PyObject* Object_GetFriendly(Crossfire_Object* whoptr, void* closure); |
| 85 |
static PyObject* Object_GetGenerator(Crossfire_Object* whoptr, void* closure); |
| 86 |
static PyObject* Object_GetThrown(Crossfire_Object* whoptr, void* closure); |
| 87 |
static PyObject* Object_GetCanSeeInvisible(Crossfire_Object* whoptr, void* closure); |
| 88 |
static PyObject* Object_GetRollable(Crossfire_Object* whoptr, void* closure); |
| 89 |
static PyObject* Object_GetTurnable(Crossfire_Object* whoptr, void* closure); |
| 90 |
static PyObject* Object_GetUsedUp(Crossfire_Object* whoptr, void* closure); |
| 91 |
static PyObject* Object_GetSplitting(Crossfire_Object* whoptr, void* closure); |
| 92 |
static PyObject* Object_GetBlind(Crossfire_Object* whoptr, void* closure); |
| 93 |
static PyObject* Object_GetCanUseHorn(Crossfire_Object* whoptr, void* closure); |
| 94 |
static PyObject* Object_GetCanUseRod(Crossfire_Object* whoptr, void* closure); |
| 95 |
static PyObject* Object_GetCanUseSkill(Crossfire_Object* whoptr, void* closure); |
| 96 |
static PyObject* Object_GetKnownCursed(Crossfire_Object* whoptr, void* closure); |
| 97 |
static PyObject* Object_GetStealthy(Crossfire_Object* whoptr, void* closure); |
| 98 |
static PyObject* Object_GetConfused(Crossfire_Object* whoptr, void* closure); |
| 99 |
static PyObject* Object_GetSleeping(Crossfire_Object* whoptr, void* closure); |
| 100 |
static PyObject* Object_GetLifesaver(Crossfire_Object* whoptr, void* closure); |
| 101 |
static PyObject* Object_GetFloor(Crossfire_Object* whoptr, void* closure); |
| 102 |
static PyObject* Object_GetHasXRays(Crossfire_Object* whoptr, void* closure); |
| 103 |
static PyObject* Object_GetCanUseRing(Crossfire_Object* whoptr, void* closure); |
| 104 |
static PyObject* Object_GetCanUseBow(Crossfire_Object* whoptr, void* closure); |
| 105 |
static PyObject* Object_GetCanUseWand(Crossfire_Object* whoptr, void* closure); |
| 106 |
static PyObject* Object_GetCanSeeInDark(Crossfire_Object* whoptr, void* closure); |
| 107 |
static PyObject* Object_GetKnownMagical(Crossfire_Object* whoptr, void* closure); |
| 108 |
static PyObject* Object_GetCanUseWeapon(Crossfire_Object* whoptr, void* closure); |
| 109 |
static PyObject* Object_GetCanUseArmour(Crossfire_Object* whoptr, void* closure); |
| 110 |
static PyObject* Object_GetCanUseScroll(Crossfire_Object* whoptr, void* closure); |
| 111 |
static PyObject* Object_GetCanCastSpell(Crossfire_Object* whoptr, void* closure); |
| 112 |
static PyObject* Object_GetReflectSpells(Crossfire_Object* whoptr, void* closure); |
| 113 |
static PyObject* Object_GetReflectMissiles(Crossfire_Object* whoptr, void* closure); |
| 114 |
static PyObject* Object_GetUnique(Crossfire_Object* whoptr, void* closure); |
| 115 |
static PyObject* Object_GetCanPickUp(Crossfire_Object* whoptr, void* closure); |
| 116 |
static PyObject* Object_GetCanPassThru(Crossfire_Object* whoptr, void* closure); |
| 117 |
static PyObject* Object_GetRunAway(Crossfire_Object* whoptr, void* closure); |
| 118 |
static PyObject* Object_GetScared(Crossfire_Object* whoptr, void* closure); |
| 119 |
static PyObject* Object_GetUndead(Crossfire_Object* whoptr, void* closure); |
| 120 |
static PyObject* Object_GetBlocksView(Crossfire_Object* whoptr, void* closure); |
| 121 |
static PyObject* Object_GetHitBack(Crossfire_Object* whoptr, void* closure); |
| 122 |
static PyObject* Object_GetStandStill(Crossfire_Object* whoptr, void* closure); |
| 123 |
static PyObject* Object_GetOnlyAttack(Crossfire_Object* whoptr, void* closure); |
| 124 |
static PyObject* Object_GetMakeInvisible(Crossfire_Object* whoptr, void* closure); |
| 125 |
static PyObject* Object_GetMoney(Crossfire_Object* whoptr, void* closure); |
| 126 |
static PyObject* Object_GetType(Crossfire_Object* whoptr, void* closure); |
| 127 |
static PyObject* Object_GetValue(Crossfire_Object* whoptr, void* closure); |
| 128 |
static PyObject* Object_GetArchName(Crossfire_Object* whoptr, void* closure); |
| 129 |
static PyObject* Object_GetArchetype(Crossfire_Object* whoptr, void* closure); |
| 130 |
|
| 131 |
static int Object_SetMessage(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 132 |
static int Object_SetName(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 133 |
static int Object_SetNamePl(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 134 |
static int Object_SetTitle(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 135 |
static int Object_SetMap(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 136 |
static int Object_SetSlaying(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 137 |
static int Object_SetCursed(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 138 |
static int Object_SetDamned(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 139 |
static int Object_SetStr(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 140 |
static int Object_SetDex(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 141 |
static int Object_SetCon(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 142 |
static int Object_SetInt(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 143 |
static int Object_SetPow(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 144 |
static int Object_SetWis(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 145 |
static int Object_SetCha(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 146 |
static int Object_SetHP(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 147 |
static int Object_SetMaxHP(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 148 |
static int Object_SetSP(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 149 |
static int Object_SetMaxSP(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 150 |
static int Object_SetGrace(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 151 |
static int Object_SetMaxGrace(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 152 |
static int Object_SetDam(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 153 |
static int Object_SetFood(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 154 |
static int Object_SetAC(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 155 |
static int Object_SetWC(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 156 |
static int Object_SetWeight(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 157 |
static int Object_SetWeightLimit(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 158 |
static int Object_SetDirection(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 159 |
static int Object_SetFacing(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 160 |
static int Object_SetGod(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 161 |
static int Object_SetSpeed(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 162 |
static int Object_SetQuantity(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 163 |
static int Object_SetLastSP(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 164 |
static int Object_SetLastGrace(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 165 |
static int Object_SetAttackType(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 166 |
static int Object_SetUnaggressive(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 167 |
static int Object_SetPickable(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 168 |
static int Object_SetInvisible(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 169 |
static int Object_SetFlying(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 170 |
static int Object_SetUnpaid(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 171 |
static int Object_SetFriendly(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 172 |
static int Object_SetCanSeeInvisible(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 173 |
static int Object_SetRollable(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 174 |
static int Object_SetTurnable(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 175 |
static int Object_SetUsedUp(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 176 |
static int Object_SetBlind(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 177 |
static int Object_SetKnownCursed(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 178 |
static int Object_SetStealthy(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 179 |
static int Object_SetConfused(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 180 |
static int Object_SetSleeping(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 181 |
static int Object_SetLifesaver(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 182 |
static int Object_SetHasXRays(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 183 |
static int Object_SetCanSeeInDark(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 184 |
static int Object_SetKnownMagical(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 185 |
static int Object_SetReflectSpells(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 186 |
static int Object_SetReflectMissiles(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 187 |
static int Object_SetUnique(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 188 |
static int Object_SetCanPassThru(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 189 |
static int Object_SetRunAway(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 190 |
static int Object_SetScared(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 191 |
static int Object_SetUndead(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 192 |
static int Object_SetBlocksView(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 193 |
static int Object_SetHitBack(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 194 |
static int Object_SetStandStill(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 195 |
static int Object_SetOnlyAttack(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 196 |
static int Object_SetMakeInvisible(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 197 |
static int Object_SetValue(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 198 |
static int Object_SetFace(Crossfire_Object* whoptr, PyObject* value, void* closure); |
| 199 |
|
| 200 |
static PyObject* Crossfire_Object_Remove( Crossfire_Object* who, PyObject* args ); |
| 201 |
static PyObject* Crossfire_Object_Apply( Crossfire_Object* who, PyObject* args ); |
| 202 |
static PyObject* Crossfire_Object_Drop( Crossfire_Object* who, PyObject* args ); |
| 203 |
static PyObject* Crossfire_Object_Fix( Crossfire_Object* who, PyObject* args ); |
| 204 |
static PyObject* Crossfire_Object_Say( Crossfire_Object* who, PyObject* args ); |
| 205 |
static PyObject* Crossfire_Object_Speak( Crossfire_Object* who, PyObject* args ); |
| 206 |
static PyObject* Crossfire_Object_Pickup( Crossfire_Object* who, PyObject* args ); |
| 207 |
static PyObject* Crossfire_Object_Take( Crossfire_Object* who, PyObject* args ); |
| 208 |
static PyObject* Crossfire_Object_Teleport( Crossfire_Object* who, PyObject* args ); |
| 209 |
static PyObject* Crossfire_Object_Reposition( Crossfire_Object* who, PyObject* args ); |
| 210 |
|
| 211 |
static PyObject* Crossfire_Object_QueryName( Crossfire_Object* who, PyObject* args ); |
| 212 |
static PyObject* Crossfire_Object_GetResist( Crossfire_Object* who, PyObject* args ); |
| 213 |
static PyObject* Crossfire_Object_ActivateRune( Crossfire_Object* who, PyObject* args ); |
| 214 |
static PyObject* Crossfire_Object_CheckTrigger( Crossfire_Object* who, PyObject* args ); |
| 215 |
static PyObject* Crossfire_Object_QueryCost( Crossfire_Object* who, PyObject* args ); |
| 216 |
static PyObject* Crossfire_Object_Cast( Crossfire_Object* who, PyObject* args ); |
| 217 |
static PyObject* Crossfire_Object_LearnSpell( Crossfire_Object* who, PyObject* args ); |
| 218 |
static PyObject* Crossfire_Object_ForgetSpell( Crossfire_Object* who, PyObject* args ); |
| 219 |
static PyObject* Crossfire_Object_KnowSpell( Crossfire_Object* who, PyObject* args ); |
| 220 |
static PyObject* Crossfire_Object_CastAbility( Crossfire_Object* who, PyObject* args ); |
| 221 |
static PyObject* Crossfire_Object_PayAmount( Crossfire_Object* who, PyObject* args ); |
| 222 |
static PyObject* Crossfire_Object_Pay( Crossfire_Object* who, PyObject* args ); |
| 223 |
static PyObject* Crossfire_Object_CheckInventory( Crossfire_Object* who, PyObject* args ); |
| 224 |
static PyObject* Crossfire_Object_CheckArchInventory( Crossfire_Object* who, PyObject* args ); |
| 225 |
static PyObject* Crossfire_Object_GetOutOfMap(Crossfire_Object* whoptr, PyObject* args); |
| 226 |
static PyObject* Crossfire_Object_CreateInside(Crossfire_Object* who, PyObject* args); |
| 227 |
static PyObject* Crossfire_Object_InsertInto(Crossfire_Object* who, PyObject* args); |
| 228 |
static PyObject* Crossfire_Object_ReadKey(Crossfire_Object* who, PyObject* args); |
| 229 |
static PyObject* Crossfire_Object_WriteKey(Crossfire_Object* who, PyObject* args); |
| 230 |
|
| 231 |
static int Crossfire_Object_InternalCompare(Crossfire_Object* left, Crossfire_Object* right); |
| 232 |
|
| 233 |
static PyObject* Crossfire_Object_Long( PyObject* obj ); |
| 234 |
static PyObject* Crossfire_Object_Int( PyObject* obj ); |
| 235 |
static PyObject *Crossfire_Object_new(PyTypeObject *type, PyObject *args, PyObject *kwds); |
| 236 |
|
| 237 |
/* Python binding */ |
| 238 |
static PyGetSetDef Object_getseters[] = { |
| 239 |
{ "Name", (getter)Object_GetName, (setter)Object_SetName, NULL, NULL }, |
| 240 |
{ "NamePl", (getter)Object_GetNamePl, (setter)Object_SetNamePl, NULL, NULL }, |
| 241 |
{ "Title", (getter)Object_GetTitle, (setter)Object_SetTitle, NULL, NULL }, |
| 242 |
{ "Map", (getter)Object_GetMap, (setter)Object_SetMap, NULL, NULL }, |
| 243 |
{ "Cha", (getter)Object_GetCha, (setter)Object_SetCha, NULL, NULL }, |
| 244 |
{ "Con", (getter)Object_GetCon, (setter)Object_SetCon, NULL, NULL }, |
| 245 |
{ "Dex", (getter)Object_GetDex, (setter)Object_SetDex, NULL, NULL }, |
| 246 |
{ "Int", (getter)Object_GetInt, (setter)Object_SetInt, NULL, NULL }, |
| 247 |
{ "Pow", (getter)Object_GetPow, (setter)Object_SetPow, NULL, NULL }, |
| 248 |
{ "Str", (getter)Object_GetStr, (setter)Object_SetStr, NULL, NULL }, |
| 249 |
{ "Wis", (getter)Object_GetWis, (setter)Object_SetWis, NULL, NULL }, |
| 250 |
{ "HP", (getter)Object_GetHP, (setter)Object_SetHP, NULL, NULL }, |
| 251 |
{ "MaxHP", (getter)Object_GetMaxHP, (setter)Object_SetMaxHP, NULL, NULL }, |
| 252 |
{ "SP", (getter)Object_GetSP, (setter)Object_SetSP, NULL, NULL }, |
| 253 |
{ "MaxSP", (getter)Object_GetMaxSP, (setter)Object_SetMaxSP, NULL, NULL }, |
| 254 |
{ "Grace", (getter)Object_GetGrace, (setter)Object_SetGrace, NULL, NULL }, |
| 255 |
{ "MaxGrace", (getter)Object_GetMaxGrace, (setter)Object_SetMaxGrace, NULL, NULL }, |
| 256 |
{ "Food", (getter)Object_GetFood, (setter)Object_SetFood, NULL, NULL }, |
| 257 |
{ "AC", (getter)Object_GetAC, (setter)Object_SetAC, NULL, NULL }, |
| 258 |
{ "WC", (getter)Object_GetWC, (setter)Object_SetWC, NULL, NULL }, |
| 259 |
{ "Dam", (getter)Object_GetDam, (setter)Object_SetDam, NULL, NULL }, |
| 260 |
{ "Luck", (getter)Object_GetLuck, NULL, NULL, NULL }, |
| 261 |
{ "Exp", (getter)Object_GetExp, NULL, NULL, NULL }, |
| 262 |
{ "Message", (getter)Object_GetMessage, (setter)Object_SetMessage, NULL, NULL }, |
| 263 |
{ "Slaying", (getter)Object_GetSlaying, (setter)Object_SetSlaying, NULL, NULL }, |
| 264 |
{ "Cursed", (getter)Object_GetCursed, (setter)Object_SetCursed, NULL, NULL }, |
| 265 |
{ "Damned", (getter)Object_GetDamned, (setter)Object_SetDamned, NULL, NULL }, |
| 266 |
{ "Weight", (getter)Object_GetWeight, (setter)Object_SetWeight, NULL, NULL }, |
| 267 |
{ "WeightLimit",(getter)Object_GetWeightLimit,(setter)Object_SetWeightLimit, NULL, NULL }, |
| 268 |
{ "Above", (getter)Object_GetAbove, NULL, NULL, NULL }, |
| 269 |
{ "Below", (getter)Object_GetBelow, NULL, NULL, NULL }, |
| 270 |
{ "Inventory", (getter)Object_GetInventory,NULL, NULL, NULL }, |
| 271 |
{ "X", (getter)Object_GetX, NULL, NULL, NULL }, |
| 272 |
{ "Y", (getter)Object_GetY, NULL, NULL, NULL }, |
| 273 |
{ "Direction", (getter)Object_GetDirection,(setter)Object_SetDirection, NULL, NULL }, |
| 274 |
{ "Facing", (getter)Object_GetFacing, (setter)Object_SetFacing, NULL, NULL }, |
| 275 |
{ "Unaggressive",(getter)Object_GetUnaggressive, (setter)Object_SetUnaggressive, NULL, NULL }, |
| 276 |
{ "God", (getter)Object_GetGod, (setter)Object_SetGod, NULL, NULL }, |
| 277 |
{ "Pickable", (getter)Object_GetPickable, (setter)Object_SetPickable, NULL, NULL }, |
| 278 |
{ "Quantity", (getter)Object_GetQuantity, (setter)Object_SetQuantity, NULL, NULL }, |
| 279 |
{ "Invisible", (getter)Object_GetInvisible,(setter)Object_SetInvisible, NULL, NULL }, |
| 280 |
{ "Speed", (getter)Object_GetSpeed, (setter)Object_SetSpeed, NULL, NULL }, |
| 281 |
{ "LastSP", (getter)Object_GetLastSP, (setter)Object_SetLastSP, NULL, NULL }, |
| 282 |
{ "LastGrace", (getter)Object_GetLastGrace,(setter)Object_SetLastGrace, NULL, NULL }, |
| 283 |
{ "Level", (getter)Object_GetLevel, NULL, NULL, NULL }, |
| 284 |
{ "Face", (getter)Object_GetFace, (setter)Object_SetFace, NULL, NULL }, |
| 285 |
{ "AttackType", (getter)Object_GetAttackType, (setter)Object_SetAttackType, NULL, NULL }, |
| 286 |
{ "BeenApplied",(getter)Object_GetBeenApplied,NULL, NULL, NULL }, |
| 287 |
{ "Identified", (getter)Object_GetIdentified, NULL, NULL, NULL }, |
| 288 |
{ "Alive", (getter)Object_GetAlive, NULL, NULL, NULL }, |
| 289 |
{ "DungeonMaster",(getter)Object_GetDM, NULL, NULL, NULL }, |
| 290 |
{ "WasDungeonMaster",(getter)Object_GetWasDM, NULL, NULL, NULL }, |
| 291 |
{ "Applied", (getter)Object_GetApplied, NULL, NULL, NULL }, |
| 292 |
{ "Unpaid", (getter)Object_GetUnpaid, (setter)Object_SetUnpaid, NULL, NULL }, |
| 293 |
{ "Flying", (getter)Object_GetFlying, (setter)Object_SetFlying, NULL, NULL }, |
| 294 |
{ "Monster", (getter)Object_GetMonster, NULL, NULL, NULL }, |
| 295 |
{ "Friendly", (getter)Object_GetFriendly, (setter)Object_SetFriendly, NULL, NULL }, |
| 296 |
{ "Generator", (getter)Object_GetGenerator,NULL, NULL, NULL }, |
| 297 |
{ "Thrown", (getter)Object_GetThrown, NULL, NULL, NULL }, |
| 298 |
{ "CanSeeInvisible", (getter)Object_GetCanSeeInvisible, (setter)Object_SetCanSeeInvisible, NULL, NULL }, |
| 299 |
{ "Rollable", (getter)Object_GetRollable, (setter)Object_SetRollable, NULL, NULL }, |
| 300 |
{ "Turnable", (getter)Object_GetTurnable, (setter)Object_SetTurnable, NULL, NULL }, |
| 301 |
{ "UsedUp", (getter)Object_GetUsedUp, (setter)Object_SetUsedUp, NULL, NULL }, |
| 302 |
{ "Splitting", (getter)Object_GetSplitting, NULL, NULL, NULL }, |
| 303 |
{ "Blind", (getter)Object_GetBlind, (setter)Object_SetBlind, NULL, NULL }, |
| 304 |
{ "CanUseHorn", (getter)Object_GetCanUseHorn, NULL, NULL, NULL }, |
| 305 |
{ "CanUseRod", (getter)Object_GetCanUseRod, NULL, NULL, NULL }, |
| 306 |
{ "CanUseSkill", (getter)Object_GetCanUseSkill, NULL, NULL, NULL }, |
| 307 |
{ "KnownCursed", (getter)Object_GetKnownCursed, (setter)Object_SetKnownCursed, NULL, NULL }, |
| 308 |
{ "Stealthy", (getter)Object_GetStealthy, (setter)Object_SetStealthy, NULL, NULL }, |
| 309 |
{ "Confused", (getter)Object_GetConfused, (setter)Object_SetConfused, NULL, NULL }, |
| 310 |
{ "Sleeping", (getter)Object_GetSleeping, (setter)Object_SetSleeping, NULL, NULL }, |
| 311 |
{ "Lifesaver", (getter)Object_GetLifesaver, (setter)Object_SetLifesaver, NULL, NULL }, |
| 312 |
{ "Floor", (getter)Object_GetFloor, NULL, NULL, NULL }, |
| 313 |
{ "HasXRays", (getter)Object_GetHasXRays, (setter)Object_SetHasXRays, NULL, NULL }, |
| 314 |
{ "CanUseRing", (getter)Object_GetCanUseRing, NULL, NULL, NULL }, |
| 315 |
{ "CanUseBow", (getter)Object_GetCanUseBow, NULL, NULL, NULL }, |
| 316 |
{ "CanUseWand", (getter)Object_GetCanUseWand, NULL, NULL, NULL }, |
| 317 |
{ "CanSeeInDark", (getter)Object_GetCanSeeInDark, (setter)Object_SetCanSeeInDark, NULL, NULL }, |
| 318 |
{ "KnownMagical", (getter)Object_GetKnownMagical, (setter)Object_SetKnownMagical, NULL, NULL }, |
| 319 |
{ "CanUseWeapon", (getter)Object_GetCanUseWeapon, NULL, NULL, NULL }, |
| 320 |
{ "CanUseArmour", (getter)Object_GetCanUseArmour, NULL, NULL, NULL }, |
| 321 |
{ "CanUseScroll", (getter)Object_GetCanUseScroll, NULL, NULL, NULL }, |
| 322 |
{ "CanCastSpell", (getter)Object_GetCanCastSpell, NULL, NULL, NULL }, |
| 323 |
{ "ReflectSpells", (getter)Object_GetReflectSpells,(setter)Object_SetReflectSpells, NULL, NULL }, |
| 324 |
{ "ReflectMissiles",(getter)Object_GetReflectMissiles,(setter)Object_SetReflectMissiles, NULL, NULL }, |
| 325 |
{ "Unique", (getter)Object_GetUnique, (setter)Object_SetUnique, NULL, NULL }, |
| 326 |
{ "CanPickUp", (getter)Object_GetCanPickUp, NULL, NULL, NULL }, |
| 327 |
{ "CanPassThru", (getter)Object_GetCanPassThru, (setter)Object_SetCanPassThru, NULL, NULL }, |
| 328 |
{ "RunAway", (getter)Object_GetRunAway, (setter)Object_SetRunAway, NULL, NULL }, |
| 329 |
{ "Scared", (getter)Object_GetScared, (setter)Object_SetScared, NULL, NULL }, |
| 330 |
{ "Undead", (getter)Object_GetUndead, (setter)Object_SetUndead, NULL, NULL }, |
| 331 |
{ "BlocksView", (getter)Object_GetBlocksView, (setter)Object_SetBlocksView, NULL, NULL }, |
| 332 |
{ "HitBack", (getter)Object_GetHitBack, (setter)Object_SetHitBack, NULL, NULL }, |
| 333 |
{ "StandStill", (getter)Object_GetStandStill, (setter)Object_SetStandStill, NULL, NULL }, |
| 334 |
{ "OnlyAttack", (getter)Object_GetOnlyAttack, (setter)Object_SetOnlyAttack, NULL, NULL }, |
| 335 |
{ "MakeInvisible", (getter)Object_GetMakeInvisible,(setter)Object_SetMakeInvisible,NULL, NULL }, |
| 336 |
{ "Money", (getter)Object_GetMoney, NULL ,NULL, NULL }, |
| 337 |
{ "Type", (getter)Object_GetType, NULL ,NULL, NULL }, |
| 338 |
{ "Value", (getter)Object_GetValue, (setter)Object_SetValue ,NULL, NULL }, |
| 339 |
{ "ArchName", (getter)Object_GetArchName, NULL ,NULL, NULL }, |
| 340 |
{ "Archetype", (getter)Object_GetArchetype, NULL ,NULL, NULL }, |
| 341 |
{ NULL, NULL, NULL, NULL, NULL } |
| 342 |
}; |
| 343 |
|
| 344 |
static PyMethodDef ObjectMethods[] = { |
| 345 |
{ "Remove", (PyCFunction)Crossfire_Object_Remove, METH_VARARGS}, |
| 346 |
{ "Apply", (PyCFunction)Crossfire_Object_Apply, METH_VARARGS}, |
| 347 |
{ "Drop", (PyCFunction)Crossfire_Object_Drop, METH_VARARGS}, |
| 348 |
{ "Fix", (PyCFunction)Crossfire_Object_Fix, METH_VARARGS}, |
| 349 |
{ "Say", (PyCFunction)Crossfire_Object_Say, METH_VARARGS}, |
| 350 |
{ "Speak", (PyCFunction)Crossfire_Object_Say, METH_VARARGS}, |
| 351 |
{ "Take", (PyCFunction)Crossfire_Object_Take, METH_VARARGS}, |
| 352 |
{ "Teleport", (PyCFunction)Crossfire_Object_Teleport, METH_VARARGS}, |
| 353 |
{ "Reposition", (PyCFunction)Crossfire_Object_Reposition, METH_VARARGS}, |
| 354 |
{ "QueryName", (PyCFunction)Crossfire_Object_QueryName, METH_VARARGS}, |
| 355 |
{ "GetResist", (PyCFunction)Crossfire_Object_GetResist, METH_VARARGS}, |
| 356 |
{ "ActivateRune", (PyCFunction)Crossfire_Object_ActivateRune, METH_VARARGS}, |
| 357 |
{ "CheckTrigger", (PyCFunction)Crossfire_Object_CheckTrigger, METH_VARARGS}, |
| 358 |
{ "QueryCost", (PyCFunction)Crossfire_Object_QueryCost, METH_VARARGS}, |
| 359 |
{ "Cast", (PyCFunction)Crossfire_Object_Cast, METH_VARARGS}, |
| 360 |
{ "LearnSpell", (PyCFunction)Crossfire_Object_LearnSpell, METH_VARARGS}, |
| 361 |
{ "ForgetSpell", (PyCFunction)Crossfire_Object_ForgetSpell, METH_VARARGS}, |
| 362 |
{ "KnowSpell", (PyCFunction)Crossfire_Object_KnowSpell, METH_VARARGS}, |
| 363 |
{ "CastAbility", (PyCFunction)Crossfire_Object_CastAbility, METH_VARARGS}, |
| 364 |
{ "PayAmount", (PyCFunction)Crossfire_Object_PayAmount, METH_VARARGS}, |
| 365 |
{ "Pay", (PyCFunction)Crossfire_Object_Pay, METH_VARARGS}, |
| 366 |
{ "CheckInventory", (PyCFunction)Crossfire_Object_CheckInventory,METH_VARARGS}, |
| 367 |
{ "CheckArchInventory", (PyCFunction)Crossfire_Object_CheckArchInventory,METH_VARARGS}, |
| 368 |
{ "OutOfMap", (PyCFunction)Crossfire_Object_GetOutOfMap, METH_VARARGS}, |
| 369 |
{ "CreateObject", (PyCFunction)Crossfire_Object_CreateInside, METH_VARARGS}, |
| 370 |
{ "InsertInto", (PyCFunction)Crossfire_Object_InsertInto, METH_VARARGS}, |
| 371 |
{ "ReadKey", (PyCFunction)Crossfire_Object_ReadKey, METH_VARARGS}, |
| 372 |
{ "WriteKey", (PyCFunction)Crossfire_Object_WriteKey, METH_VARARGS}, |
| 373 |
{NULL, NULL, 0} |
| 374 |
}; |
| 375 |
|
| 376 |
static PyNumberMethods ObjectConvert[ ] = { |
| 377 |
0, /* binaryfunc nb_add; */ /* __add__ */ |
| 378 |
0, /* binaryfunc nb_subtract; */ /* __sub__ */ |
| 379 |
0, /* binaryfunc nb_multiply; */ /* __mul__ */ |
| 380 |
0, /* binaryfunc nb_divide; */ /* __div__ */ |
| 381 |
0, /* binaryfunc nb_remainder; */ /* __mod__ */ |
| 382 |
0, /* binaryfunc nb_divmod; */ /* __divmod__ */ |
| 383 |
0, /* ternaryfunc nb_power; */ /* __pow__ */ |
| 384 |
0, /* unaryfunc nb_negative; */ /* __neg__ */ |
| 385 |
0, /* unaryfunc nb_positive; */ /* __pos__ */ |
| 386 |
0, /* unaryfunc nb_absolute; */ /* __abs__ */ |
| 387 |
0, /* inquiry nb_nonzero; */ /* __nonzero__ */ |
| 388 |
0, /* unaryfunc nb_invert; */ /* __invert__ */ |
| 389 |
0, /* binaryfunc nb_lshift; */ /* __lshift__ */ |
| 390 |
0, /* binaryfunc nb_rshift; */ /* __rshift__ */ |
| 391 |
0, /* binaryfunc nb_and; */ /* __and__ */ |
| 392 |
0, /* binaryfunc nb_xor; */ /* __xor__ */ |
| 393 |
0, /* binaryfunc nb_or; */ /* __or__ */ |
| 394 |
0, /* coercion nb_coerce; */ /* __coerce__ */ |
| 395 |
Crossfire_Object_Int, /* unaryfunc nb_int; */ /* __int__ */ |
| 396 |
Crossfire_Object_Long, /* unaryfunc nb_long; */ /* __long__ */ |
| 397 |
0 |
| 398 |
}; |
| 399 |
|
| 400 |
static PyObject *Crossfire_Object_new(PyTypeObject *type, PyObject *args, PyObject *kwds); |
| 401 |
|
| 402 |
/* Our actual Python ObjectType */ |
| 403 |
PyTypeObject Crossfire_ObjectType = { |
| 404 |
PyObject_HEAD_INIT(NULL) |
| 405 |
0, /* ob_size*/ |
| 406 |
"Crossfire.Object", /* tp_name*/ |
| 407 |
sizeof(Crossfire_Object), /* tp_basicsize*/ |
| 408 |
0, /* tp_itemsize*/ |
| 409 |
0, /* tp_dealloc*/ |
| 410 |
0, /* tp_print*/ |
| 411 |
0, /* tp_getattr*/ |
| 412 |
0, /* tp_setattr*/ |
| 413 |
(cmpfunc)Crossfire_Object_InternalCompare, /* tp_compare*/ |
| 414 |
0, /* tp_repr*/ |
| 415 |
ObjectConvert, /* tp_as_number*/ |
| 416 |
0, /* tp_as_sequence*/ |
| 417 |
0, /* tp_as_mapping*/ |
| 418 |
0, /* tp_hash */ |
| 419 |
0, /* tp_call*/ |
| 420 |
0, /* tp_str*/ |
| 421 |
PyObject_GenericGetAttr, /* tp_getattro*/ |
| 422 |
PyObject_GenericSetAttr, /* tp_setattro*/ |
| 423 |
0, /* tp_as_buffer*/ |
| 424 |
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags*/ |
| 425 |
"Crossfire objects", /* tp_doc */ |
| 426 |
0, /* tp_traverse */ |
| 427 |
0, /* tp_clear */ |
| 428 |
0, /* tp_richcompare */ |
| 429 |
0, /* tp_weaklistoffset */ |
| 430 |
0, /* tp_iter */ |
| 431 |
0, /* tp_iternext */ |
| 432 |
ObjectMethods, /* tp_methods */ |
| 433 |
0, /* tp_members */ |
| 434 |
Object_getseters, /* tp_getset */ |
| 435 |
0, /* tp_base */ |
| 436 |
0, /* tp_dict */ |
| 437 |
0, /* tp_descr_get */ |
| 438 |
0, /* tp_descr_set */ |
| 439 |
0, /* tp_dictoffset */ |
| 440 |
0, /* tp_init */ |
| 441 |
0, /* tp_alloc */ |
| 442 |
Crossfire_Object_new, /* tp_new */ |
| 443 |
}; |
| 444 |
|
| 445 |
|
| 446 |
|
| 447 |
|
| 448 |
|
| 449 |
static PyObject* Player_GetIP(Crossfire_Player* whoptr, void* closure); |
| 450 |
static PyObject* Player_GetMarkedItem(Crossfire_Player* whoptr, void* closure); |
| 451 |
static int Player_SetMarkedItem(Crossfire_Player* whoptr, PyObject* value, void* closure); |
| 452 |
static PyObject* Crossfire_Player_Message( Crossfire_Player* who, PyObject* args ); |
| 453 |
static PyObject* Player_GetParty(Crossfire_Player* whoptr, void* closure); |
| 454 |
static int Player_SetParty(Crossfire_Player* whoptr, PyObject* value, void* closure); |
| 455 |
|
| 456 |
static PyGetSetDef Player_getseters[] = { |
| 457 |
{ "IP", (getter)Player_GetIP, NULL, NULL, NULL }, |
| 458 |
{ "MarkedItem", (getter)Player_GetMarkedItem, (setter)Player_SetMarkedItem, NULL, NULL }, |
| 459 |
{ "Party", (getter)Player_GetParty, (setter)Player_SetParty, NULL, NULL }, |
| 460 |
{ NULL, NULL, NULL, NULL, NULL } |
| 461 |
}; |
| 462 |
|
| 463 |
static PyMethodDef PlayerMethods[] = { |
| 464 |
{ "Message", (PyCFunction)Crossfire_Player_Message, METH_VARARGS}, |
| 465 |
{ "Write", (PyCFunction)Crossfire_Player_Message, METH_VARARGS}, |
| 466 |
{NULL, NULL } |
| 467 |
}; |
| 468 |
|
| 469 |
static PyObject *Crossfire_Player_new(PyTypeObject *type, PyObject *args, PyObject *kwds); |
| 470 |
|
| 471 |
/* Our actual Python ObjectPlayerType */ |
| 472 |
PyTypeObject Crossfire_PlayerType = { |
| 473 |
PyObject_HEAD_INIT(NULL) |
| 474 |
0, /* ob_size*/ |
| 475 |
"Crossfire.Player", /* tp_name*/ |
| 476 |
sizeof(Crossfire_Player), /* tp_basicsize*/ |
| 477 |
0, /* tp_itemsize*/ |
| 478 |
0, /* tp_dealloc*/ |
| 479 |
0, /* tp_print*/ |
| 480 |
0, /* tp_getattr*/ |
| 481 |
0, /* tp_setattr*/ |
| 482 |
0, /* tp_compare*/ |
| 483 |
0, /* tp_repr*/ |
| 484 |
0, /* tp_as_number*/ |
| 485 |
0, /* tp_as_sequence*/ |
| 486 |
0, /* tp_as_mapping*/ |
| 487 |
0, /* tp_hash */ |
| 488 |
0, /* tp_call*/ |
| 489 |
0, /* tp_str*/ |
| 490 |
PyObject_GenericGetAttr, /* tp_getattro*/ |
| 491 |
PyObject_GenericSetAttr, /* tp_setattro*/ |
| 492 |
0, /* tp_as_buffer*/ |
| 493 |
Py_TPFLAGS_DEFAULT, /* tp_flags*/ |
| 494 |
"Crossfire player", /* tp_doc */ |
| 495 |
0, /* tp_traverse */ |
| 496 |
0, /* tp_clear */ |
| 497 |
0, /* tp_richcompare */ |
| 498 |
0, /* tp_weaklistoffset */ |
| 499 |
0, /* tp_iter */ |
| 500 |
0, /* tp_iternext */ |
| 501 |
PlayerMethods, /* tp_methods */ |
| 502 |
0, /* tp_members */ |
| 503 |
Player_getseters, /* tp_getset */ |
| 504 |
&Crossfire_ObjectType, /* tp_base */ |
| 505 |
0, /* tp_dict */ |
| 506 |
0, /* tp_descr_get */ |
| 507 |
0, /* tp_descr_set */ |
| 508 |
0, /* tp_dictoffset */ |
| 509 |
0, /* tp_init */ |
| 510 |
0, /* tp_alloc */ |
| 511 |
Crossfire_Player_new, /* tp_new */ |
| 512 |
}; |