 |
Crossfire Server, Trunk
1.75.0
|
Go to the documentation of this file.
33 #define EXISTCHECK(ob) { \
34 if (!ob || !ob->obj || (object_was_destroyed(ob->obj, ob->obj->count))) { \
35 PyErr_SetString(PyExc_ReferenceError, "Crossfire object no longer exists"); \
44 #define TYPEEXISTCHECK(ob) { \
45 if (!ob || !PyObject_TypeCheck((PyObject*)ob, &Crossfire_ObjectType) || !ob->obj || (object_was_destroyed(ob->obj, ob->obj->count))) { \
46 PyErr_SetString(PyExc_ReferenceError, "Not a Crossfire object or Crossfire object no longer exists"); \
50 #define EXISTCHECK_INT(ob) { \
51 if (!ob || !ob->obj || (object_was_destroyed(ob->obj, ob->obj->count))) { \
52 PyErr_SetString(PyExc_ReferenceError, "Crossfire object no longer exists"); \
85 PyErr_SetString(PyExc_TypeError,
"Cannot delete the Title attribute");
89 PyErr_SetString(PyExc_TypeError,
"The Title attribute must be a string");
92 if (!PyArg_Parse(value,
"s", &val))
116 if (value == Py_None)
130 if (!PyArg_ParseTuple(args,
"s|i", &
message, &color))
139 const char *knowledge;
142 if (!PyArg_ParseTuple(args,
"s", &knowledge))
149 const char *knowledge;
152 if (!PyArg_ParseTuple(args,
"s", &knowledge))
197 if (!PyArg_Parse(value,
"s", &location))
214 if (!PyArg_Parse(value,
"i", &x))
231 if (!PyArg_Parse(value,
"i", &y))
243 if (!PyArg_ParseTuple(args,
"si", &
code, &state))
260 if (!PyArg_ParseTuple(args,
"s", &
code))
267 return Py_BuildValue(
"i", state);
276 if (!PyArg_ParseTuple(args,
"si", &
code, &state))
293 if (!PyArg_ParseTuple(args,
"s", &
code))
300 return Py_BuildValue(
"i", completed);
467 PyErr_SetString(PyExc_TypeError,
"Cannot delete the attribute");
471 PyErr_SetString(PyExc_TypeError,
"The attribute must be a string");
474 if (!PyArg_Parse(value,
"s", &val))
485 if (!PyArg_Parse(value,
"i", &val))
496 if (!PyArg_Parse(value,
"f", &val))
507 if (!PyArg_Parse(value,
"i", &val))
520 PyErr_SetString(PyExc_TypeError,
"Cannot delete the Name attribute");
524 PyErr_SetString(PyExc_TypeError,
"The Name attribute must be a string");
527 if (!PyArg_Parse(value,
"s", &val))
541 PyErr_SetString(PyExc_TypeError,
"Cannot delete the NamePl attribute");
545 PyErr_SetString(PyExc_TypeError,
"The NamePl attribute must be a string");
548 if (!PyArg_Parse(value,
"s", &val))
560 if (!PyArg_Parse(value,
"i", &val))
584 if (!PyArg_Parse(value,
"i", &val))
588 PyErr_SetString(PyExc_TypeError,
"Invalid quantity");
601 if (!PyArg_Parse(value,
"s", &
face))
605 PyErr_SetString(PyExc_TypeError,
"Unknown face.");
616 if (!PyArg_Parse(value,
"s", &anim))
620 PyErr_SetString(PyExc_TypeError,
"Unknown animation.");
632 if (!PyArg_Parse(value,
"l", &val))
666 if (!PyArg_Parse(value,
"L", &val))
678 if (!PyArg_Parse(value,
"B", &move))
689 if (!PyArg_Parse(value,
"B", &move))
700 if (!PyArg_Parse(value,
"B", &move))
711 if (!PyArg_Parse(value,
"B", &move))
722 if (!PyArg_Parse(value,
"B", &move))
733 if (!PyArg_Parse(value,
"B", &move))
785 if (!PyArg_ParseTuple(args,
"i", &clone_type))
788 if (clone_type != 0 && clone_type != 1)
790 PyErr_SetString(PyExc_ValueError,
"Clone type must be 0 (object_create_clone) or 1 (object_copy).");
798 PyErr_SetString(PyExc_RuntimeError,
"Clone failed.");
812 if (!PyArg_ParseTuple(args,
"i", &count))
819 PyErr_SetString(PyExc_ValueError, err);
856 return Py_BuildValue(
"i", val);
868 victim = pcause->
obj;
887 return Py_BuildValue(
"i", result);
894 if (!PyArg_ParseTuple(args,
"s", &
message))
905 PyErr_SetString(PyExc_ValueError,
"too many NPCs");
910 cf_log(
llevError,
"warning, too long message in npcSay, will be truncated");
926 if (!PyArg_ParseTuple(args,
"ii", &x, &y))
946 if (!PyArg_ParseTuple(args,
"i", &resist))
949 return Py_BuildValue(
"l", 0);
958 if (!PyArg_ParseTuple(args,
"ii", &resist, &value))
1012 if (!PyArg_ParseTuple(args,
"s", &spellname))
1042 if (!PyArg_ParseTuple(args,
"L", &to_pay))
1047 return Py_BuildValue(
"i", val);
1060 return Py_BuildValue(
"i", val);
1068 if (!PyArg_ParseTuple(args,
"s", &keyname))
1073 return Py_BuildValue(
"s", val ? val :
"");
1082 if (!PyArg_ParseTuple(args,
"sz|i", &keyname, &value, &add_key))
1093 if (!PyArg_ParseTuple(args,
"li", &delay, &mode))
1104 if (!PyArg_ParseTuple(args,
"s", &whatstr))
1127 if (!PyArg_ParseTuple(args,
"s", &whatstr))
1138 if (!PyArg_ParseTuple(args,
"ii", &x, &y))
1149 if (!PyArg_ParseTuple(args,
"s", &txt))
1190 const char *
skill = NULL;
1193 if (!PyArg_ParseTuple(args,
"L|si", &exp, &
skill, &arg))
1210 if (!PyArg_ParseTuple(args,
"i", &dir))
1219 if (!PyArg_ParseTuple(args,
"ii", &x, &y))
1240 op2 = activator->
obj;
1248 if (!PyArg_ParseTuple(args,
"i", &
level))
1264 return (left->
obj < right->
obj ? -1 : (left->
obj == right->
obj ? 0 : 1));
1273 Py_INCREF(Py_NotImplemented);
1274 return Py_NotImplemented;
1278 if (result == -1 && PyErr_Occurred())
1283 result = (result == 0);
1286 result = (result != 0);
1289 result = (result <= 0);
1292 result = (result >= 0);
1295 result = (result == -1);
1298 result = (result == 1);
1301 return PyBool_FromLong(result);
1444 { NULL, NULL, NULL, NULL, NULL }
1487 { NULL, NULL, 0, NULL }
1503 return (PyObject *)
self;
1514 Py_TYPE(
self)->tp_free(obj);
1529 return (PyObject *)
self;
1540 Py_TYPE(
self)->tp_free(obj);
1560 PyObject_HashNotImplemented,
1561 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1562 "Crossfire objects",
1580 { NULL, NULL, NULL, NULL, NULL }
1593 { NULL, NULL, 0, NULL }
1628 if (plwrap != NULL) {
1632 pyobj = (PyObject *)plwrap;
1635 if (wrapper != NULL) {
1636 wrapper->
obj = what;
1639 pyobj = (PyObject *)wrapper;
#define object_was_destroyed(op, old_tag)
Checks if an object still exists.
#define FLAG_USE_BOW
(Monster) can apply and fire bows
static PyObject * Player_GetObjectProperty(Crossfire_Player *whoptr, void *closure)
static int Object_SetMoveOn(Crossfire_Object *whoptr, PyObject *value, void *closure)
#define CFAPI_OBJECT_PROP_TITLE
static PyGetSetDef Player_getseters[]
void cf_log(LogLevel logLevel, const char *format,...)
Wrapper for LOG().
static PyObject * Crossfire_Object_Drop(Crossfire_Object *who, PyObject *args)
static PyObject * Crossfire_Object_CastAbility(Crossfire_Object *who, PyObject *args)
sstring cf_query_name_pl(object *ob)
static PyObject * Crossfire_Object_Move(Crossfire_Object *who, PyObject *args)
#define CFAPI_OBJECT_PROP_X
static PyObject * Crossfire_Object_Teleport(Crossfire_Object *who, PyObject *args)
object * cf_object_check_for_spell(object *op, const char *name)
Wrapper for check_spell_known().
PyObject_HEAD object * obj
static PyObject * Crossfire_Object_CheckTrigger(Crossfire_Object *who, PyObject *args)
sstring cf_add_string(const char *str)
Wrapper for add_string().
static PyObject * Crossfire_Object_ForgetSpell(Crossfire_Object *who, PyObject *args)
static PyObject * Object_GetExpMul(Crossfire_Object *whoptr, void *closure)
#define CFAPI_OBJECT_PROP_CHA
#define CFAPI_OBJECT_PROP_ARCH_NAME
#define FLAG_STAND_STILL
NPC will not (ever) move.
static PyObject * Crossfire_Object_WriteKey(Crossfire_Object *who, PyObject *args)
#define FLAG_CONFUSED
Will also be unable to cast spells.
#define CFAPI_OBJECT_PROP_ATTACK_MOVEMENT
@ llevError
Error, serious thing.
void cf_player_set_marked_item(object *op, object *ob)
#define MOVE_ALL
Mask of all movement types.
int cf_object_teleport(object *ob, mapstruct *map, int x, int y)
int cf_object_out_of_map(object *op, int x, int y)
#define FLAG_USE_RING
(Monster) can use rings, boots, gauntlets, etc
PyObject_HEAD partylist * party
#define FLAG_UNDEAD
Monster is undead.
static PyObject * Object_GetNamePl(Crossfire_Object *whoptr, void *closure)
char * cf_object_get_string_property(object *op, int propcode, char *buf, int size)
int npc_msg_count
How many NPCs reacted to the text being said.
long cf_object_get_long_property(object *op, long propcode)
#define CFAPI_OBJECT_PROP_LEVEL
#define FLAG_GENERATOR
Will generate type ob->stats.food.
static PyObject * Object_GetMoveAllow(Crossfire_Object *whoptr, void *closure)
#define CFAPI_PLAYER_PROP_BED_X
#define FLAG_STARTEQUIP
Object was given to player at start.
static PyObject * Object_GetFlagProperty(Crossfire_Object *whoptr, void *closure)
sstring cf_object_get_sstring_property(object *op, int propcode)
int cf_player_knowledge_has(object *op, const char *knowledge)
Wrapper for knowledge_player_has().
static void add_object_assoc(object *key, PyObject *value)
static int Player_SetParty(Crossfire_Player *whoptr, PyObject *value, void *closure)
static int Object_SetName(Crossfire_Object *whoptr, PyObject *value, void *closure)
#define FLAG_REFL_MISSILE
Arrows will reflect from object.
static int Object_SetMap(Crossfire_Object *whoptr, PyObject *value, void *closure)
object * cf_object_get_object_property(object *op, int propcode)
static int Crossfire_Object_InternalCompare(Crossfire_Object *left, Crossfire_Object *right)
static int Object_SetMoveSlow(Crossfire_Object *whoptr, PyObject *value, void *closure)
int cf_object_cast_spell(object *op, object *caster, int dir, object *spell_ob, char *stringarg)
Wrapper for cast_spell().
void cf_fix_object(object *op)
Wrapper for fix_object().
static PyObject * Crossfire_Object_CreateTimer(Crossfire_Object *who, PyObject *args)
static PyObject * Crossfire_Object_KnowSpell(Crossfire_Object *who, PyObject *args)
#define FLAG_IS_TURNABLE
Object can change face with direction.
#define TYPEEXISTCHECK(ob)
This is meant to be used for parameters where you don't know if the type of the object is correct.
#define CFAPI_OBJECT_PROP_SLAYING
#define FLAG_SEE_IN_DARK
if set ob not effected by darkness
#define CFAPI_OBJECT_PROP_FRIENDLY
#define CFAPI_OBJECT_PROP_DEX
void cf_player_knowledge_give(object *op, const char *knowledge)
Wrapper for knowledge_give();.
#define CFAPI_OBJECT_PROP_ARCHETYPE
static PyObject * Player_GetIP(Crossfire_Player *whoptr, void *closure)
#define CFAPI_PLAYER_PROP_COUNT
static PyObject * Crossfire_Object_CreateInside(Crossfire_Object *who, PyObject *args)
static PyObject * Player_KnowledgeKnown(Crossfire_Player *who, PyObject *args)
#define FLAG_UNIQUE
Item is really unique (UNIQUE_ITEMS)
static int Object_SetPickable(Crossfire_Object *whoptr, PyObject *value, void *closure)
object * cf_create_object_by_name(const char *name)
Wrapper for create_archetype() and create_archetype_by_object_name().
#define CFAPI_OBJECT_PROP_LAST_EAT
#define CFAPI_OBJECT_PROP_MOVE_ON
static PyObject * Crossfire_Object_AddExp(Crossfire_Object *who, PyObject *args)
#define CFAPI_OBJECT_PROP_STR
#define CFAPI_OBJECT_PROP_GOD
unsigned char MoveType
Typdef here to define type large enough to hold bitmask of all movement types.
static PyObject * Crossfire_Player_CanPay(Crossfire_Player *who, PyObject *args)
char * cf_query_name(object *ob, char *name, int size)
void cf_object_set_float_property(object *op, int propcode, float value)
static PyObject * Crossfire_Object_InsertInto(Crossfire_Object *who, PyObject *args)
static int Object_SetOwner(Crossfire_Object *whoptr, PyObject *value, void *closure)
#define FLAG_SEE_INVISIBLE
Will see invisible player.
int cf_object_apply(object *op, object *author, int flags)
Wrapper for apply_manual().
#define CFAPI_OBJECT_PROP_MAXSP
#define CFAPI_OBJECT_PROP_RAW_NAME
static PyObject * Crossfire_Object_Event(Crossfire_Object *who, PyObject *args)
static int Object_SetFace(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyMethodDef PlayerMethods[]
int64_t cf_object_get_int64_property(object *op, int propcode)
int cf_object_move_to(object *op, int x, int y)
Wrapper for move_to().
PyObject * Crossfire_Party_wrap(partylist *what)
void cf_object_free_drop_inventory(object *ob)
Wrapper for object_free_drop_inventory().
#define CFAPI_OBJECT_PROP_Y
static const flag_definition flags[]
Flag mapping.
tag_t count
Unique object number for this object.
#define CFAPI_OBJECT_PROP_ENEMY
int cf_player_can_pay(object *op)
Wrapper for can_pay().
#define CFAPI_OBJECT_PROP_MOVE_TYPE
#define FLAG_SCARED
Monster is scared (mb player in future)
void cf_object_set_string_property(object *op, int propcode, const char *value)
#define FLAG_ONLY_ATTACK
NPC will evaporate if there is no enemy.
int64_t cf_object_perm_exp(object *op)
Wrapper for PERM_EXP macro.
#define CFAPI_OBJECT_PROP_FACE
#define CFAPI_OBJECT_PROP_ENVIRONMENT
void cf_quest_set_player_state(object *pl, sstring quest_code, int state)
Wrapper for quest_set_player_state();.
static PyObject * Player_GetParty(Crossfire_Player *whoptr, void *closure)
static PyObject * Player_GetIntProperty(Crossfire_Player *whoptr, void *closure)
int cf_player_arrest(object *who)
Wrapper for player_arrest().
static PyObject * Crossfire_Object_SetResist(Crossfire_Object *who, PyObject *args)
static PyObject * Crossfire_Object_Remove(Crossfire_Object *who, PyObject *args)
#define FLAG_BLOCKSVIEW
Object blocks view.
static PyObject * Object_GetTotalExp(Crossfire_Object *whoptr, void *closure)
#define CFAPI_OBJECT_PROP_ITEM_POWER
#define FLAG_APPLIED
Object is ready for use by living.
#define CFAPI_OBJECT_PROP_CURRENT_WEAPON
#define FLAG_STEALTH
Will wake monsters with less range.
CFPContext * current_context
static int Player_SetTitle(Crossfire_Object *whoptr, PyObject *value, void *closure)
void cf_player_set_title(object *op, const char *title)
void cf_spring_trap(object *trap, object *victim)
Wrapper for spring_trap().
static PyObject * Crossfire_Object_Pay(Crossfire_Object *who, PyObject *args)
static PyObject * Object_GetMoveOn(Crossfire_Object *whoptr, void *closure)
int cf_object_pay_amount(object *pl, uint64_t to_pay)
Wrapper for pay_for_amount().
#define CFAPI_OBJECT_PROP_INVISIBLE
#define FLAG_NO_PICK
Object can't be picked up.
PyObject * Crossfire_Object_wrap(object *what)
Python initialized.
Plugin animator file specs[Config] name
static PyObject * Object_GetMap(Crossfire_Object *whoptr, void *closure)
int cf_object_change_abil(object *op, object *tmp)
Wrapper for change_abil().
int cf_object_set_key(object *op, const char *keyname, const char *value, int add_key)
Sets a value for specified key, equivalent to object_set_value().
#define FLAG_IS_FLOOR
Can't see what's underneath this object.
static int Object_SetFloatProperty(Crossfire_Object *whoptr, PyObject *value, void *closure)
static int Player_SetMarkedItem(Crossfire_Player *whoptr, PyObject *value, void *closure)
#define CFAPI_OBJECT_PROP_SKILL
static PyObject * Crossfire_Object_CheckInventory(Crossfire_Object *who, PyObject *args)
#define FLAG_ALIVE
Object can fight (or be fought)
PyObject_HEAD object * obj
static PyObject * Player_QuestSetState(Crossfire_Player *whoptr, PyObject *args)
void cf_quest_start(object *pl, sstring quest_code, int state)
Wrapper for quest_start().
PyTypeObject Crossfire_PlayerType
static int Object_SetValue(Crossfire_Object *whoptr, PyObject *value, void *closure)
#define CFAPI_OBJECT_PROP_ANIM_SPEED
static event_registration m
#define CFAPI_OBJECT_PROP_AC
int cf_object_set_animation(object *op, const char *animation)
Set the object's animation.
#define CFAPI_OBJECT_PROP_MOVE_OFF
#define FLAG_WAS_WIZ
Player was once a wiz.
void cf_log_plain(LogLevel logLevel, const char *message)
Wrapper for LOG() that uses directly a buffer, without format.
PyObject_HEAD mapstruct * map
#define CF_IS_PYSTR(cfpy_obj)
#define CFAPI_OBJECT_PROP_HP
#define CFAPI_OBJECT_PROP_MAXHP
partylist * cf_player_get_party(object *op)
void cf_object_say(object *op, const char *msg)
static PyObject * Player_QuestWasCompleted(Crossfire_Player *whoptr, PyObject *args)
#define CFAPI_OBJECT_PROP_OB_BELOW
int cf_timer_create(object *ob, long delay, int mode)
Creates a timer, equivalent of calling cftimer_create().
#define CFAPI_OBJECT_PROP_TOTAL_EXP
static PyObject * Object_GetFloatProperty(Crossfire_Object *whoptr, void *closure)
static PyObject * Object_GetExp(Crossfire_Object *whoptr, void *closure)
#define CFAPI_PLAYER_PROP_BED_Y
static int Player_SetBedY(Crossfire_Player *whoptr, PyObject *value, void *closure)
#define FLAG_USE_RANGE
(Monster) can apply and use range items
void cf_object_set_int64_property(object *op, int propcode, int64_t value)
#define FLAG_RUN_AWAY
Object runs away from nearest player \ but can still attack at a distance.
static PyObject * Crossfire_Object_QueryName(Crossfire_Object *who, PyObject *args)
#define FLAG_KNOWN_CURSED
The object is known to be cursed.
static PyObject * Crossfire_Object_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
#define CFAPI_OBJECT_PROP_RACE
#define CFAPI_OBJECT_PROP_MOVE_BLOCK
#define CFAPI_OBJECT_PROP_FACING
static int Player_SetBedX(Crossfire_Player *whoptr, PyObject *value, void *closure)
#define CFAPI_OBJECT_PROP_WEIGHT
static PyMethodDef ObjectMethods[]
static PyObject * Player_GetBedX(Crossfire_Player *whoptr, void *closure)
MoveType cf_object_get_movetype_property(object *op, int propcode)
object * cf_object_find_by_arch_name(const object *who, const char *name)
Wrapper for object_find_by_arch_name().
mapstruct * cf_object_get_map_property(object *op, int propcode)
#define CFAPI_OBJECT_PROP_DAM
int cf_object_query_money(const object *op)
Wrapper for query_money().
static PyObject * Crossfire_Object_Clone(Crossfire_Object *who, PyObject *args)
static PyObject * Crossfire_Object_Say(Crossfire_Object *who, PyObject *args)
#define FLAG_BLIND
If set, object cannot see (visually)
static PyObject * Object_GetValue(Crossfire_Object *whoptr, void *closure)
#define FLAG_MAKE_INVIS
(Item) gives invisibility when applied
static int Object_SetAnim(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Object_GetPickable(Crossfire_Object *whoptr, void *closure)
#define FLAG_NO_DAMAGE
monster can't be damaged
#define MAX_NPC
How many NPCs maximum will reply to the player.
static PyObject * Crossfire_Object_RemoveDepletion(Crossfire_Object *who, PyObject *args)
static PyObject * Object_GetMoveOff(Crossfire_Object *whoptr, void *closure)
uint8_t type
PLAYER, BULLET, etc.
object * cf_object_clone(object *op, int clonetype)
Clone an object.
TIPS on SURVIVING Crossfire is populated with a wealth of different monsters These monsters can have varying immunities and attack types In some of them can be quite a bit smarter than others It will be important for new players to learn the abilities of different monsters and learn just how much it will take to kill them This section discusses how monsters can interact with players Most monsters in the game are out to mindlessly kill and destroy the players These monsters will help boost a player s after he kills them When fighting a large amount of monsters in a single attempt to find a narrower hallway so that you are not being attacked from all sides Charging into a room full of Beholders for instance would not be open the door and fight them one at a time For there are several maps designed for them Find these areas and clear them out All throughout these a player can find signs and books which they can read by stepping onto them and hitting A to apply the book sign These messages will help the player to learn the system One more always keep an eye on your food If your food drops to your character will soon so BE CAREFUL ! NPCs Non Player Character are special monsters which have intelligence Players may be able to interact with these monsters to help solve puzzles and find items of interest To speak with a monster you suspect to be a simply move to an adjacent square to them and push the double ie Enter your message
static PyObject * Player_GetTitle(Crossfire_Object *whoptr, void *closure)
CF_PYTHON_OBJECT(Object, Crossfire_Object_dealloc, &ObjectConvert, PyObject_HashNotImplemented, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, "Crossfire objects",(richcmpfunc) Crossfire_Object_RichCompare, ObjectMethods, Object_getseters, NULL, Crossfire_Object_new)
#define FLAG_DAMNED
The object is very cursed.
#define CFAPI_OBJECT_PROP_EXP
#define CFAPI_OBJECT_PROP_SPEED
#define CFAPI_OBJECT_PROP_TYPE
#define CFAPI_OBJECT_PROP_NROF
static void free_object_assoc(object *key)
double cf_object_get_double_property(object *op, int propcode)
PyObject * Crossfire_Archetype_wrap(archetype *what)
Information on one title.
static int Object_SetMoveType(Crossfire_Object *whoptr, PyObject *value, void *closure)
#define FLAG_CAN_ROLL
Object can be rolled.
static PyObject * Crossfire_Object_RichCompare(Crossfire_Object *left, Crossfire_Object *right, int op)
static int Object_SetMoveBlock(Crossfire_Object *whoptr, PyObject *value, void *closure)
#define FLAG_UNAGGRESSIVE
Monster doesn't attack players.
static int Object_SetExp(Crossfire_Object *whoptr, PyObject *value, void *closure)
#define CFAPI_OBJECT_PROP_ATTACK_TYPE
#define FLAG_USE_WEAPON
(Monster) can wield weapons
#define FLAG_NO_SAVE
If set (through plugins), the object is not saved on maps.
static PyObject * Object_GetMaterial(Crossfire_Object *whoptr, void *closure)
#define FLAG_CAN_USE_SKILL
The monster can use skills.
int cf_object_get_flag(object *ob, int flag)
static PyObject * Crossfire_Object_GetOutOfMap(Crossfire_Object *who, PyObject *args)
#define CFAPI_OBJECT_PROP_OWNER
void cf_object_drop(object *op, object *author)
int cf_object_transfer(object *op, int x, int y, int randomly, object *originator)
Wrapper for transfer_ob().
void cf_object_set_movetype_property(object *op, int propcode, MoveType value)
#define CFAPI_OBJECT_PROP_NAME_PLURAL
#define FLAG_SPLITTING
Object splits into stats.food other objs.
static PyObject * Crossfire_Object_Apply(Crossfire_Object *who, PyObject *args)
static std::map< object *, PyObject * > object_assoc_table
#define FLAG_MONSTER
Will attack players.
#define FLAG_RANDOM_MOVE
NPC will move randomly.
void cf_free_string(sstring str)
Wrapper for free_string().
#define FLAG_HITBACK
Object will hit back when hit.
object * cf_object_present_archname_inside(object *op, char *whatstr)
Kinda wrapper for arch_present_in_ob().
#define CFAPI_OBJECT_PROP_WIS
void cf_object_pickup(object *op, object *what)
#define CFAPI_OBJECT_PROP_POW
archetype * cf_object_get_archetype_property(object *op, int propcode)
static PyObject * Object_GetMoveSlow(Crossfire_Object *whoptr, void *closure)
object * cf_player_get_marked_item(object *op)
#define CFAPI_OBJECT_PROP_CONTAINER
#define FLAG_KNOWN_MAGICAL
The object is known to be magical.
static PyObject * Crossfire_Object_Fix(Crossfire_Object *who, PyObject *args)
object * cf_object_insert_in_ob(object *op, object *where)
Wrapper for object_insert_in_ob().
#define CFAPI_OBJECT_PROP_INVENTORY
#define CFAPI_OBJECT_PROP_MAP
int cf_object_user_event(object *op, object *activator, object *third, const char *message, int fix)
int cf_object_move(object *op, int dir, object *originator)
static PyObject * Crossfire_Object_PayAmount(Crossfire_Object *who, PyObject *args)
static PyObject * Crossfire_Object_ChangeAbil(Crossfire_Object *who, PyObject *args)
#define FLAG_REMOVED
Object is not in any map or invenory.
object * cf_object_split(object *orig_ob, uint32_t nr, char *err, size_t size)
Wrapper for object_split().
void cf_player_set_party(object *op, partylist *party)
#define FLAG_REFL_SPELL
Spells (some) will reflect from object.
#define FLAG_WIZ
Object has special privilegies.
#define CFAPI_PLAYER_PROP_TRANSPORT
static PyObject * Crossfire_Object_GetResist(Crossfire_Object *who, PyObject *args)
static PyObject * Crossfire_Object_ReadKey(Crossfire_Object *who, PyObject *args)
#define NDI_UNIQUE
Print immediately, don't buffer.
#define FLAG_FRIENDLY
Will help players.
sstring name
The name of the object, obviously...
PyTypeObject Crossfire_PartyType
#define CFAPI_OBJECT_PROP_ANIMATION
#define CFAPI_OBJECT_PROP_INT
#define CFAPI_OBJECT_PROP_SP
static int Object_SetMoveOff(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Object_GetOtherArchetype(Crossfire_Object *whoptr, void *closure)
#define CFAPI_OBJECT_PROP_NAME
#define CFAPI_OBJECT_PROP_EXP_MULTIPLIER
#define FLAG_USE_ARMOUR
(Monster) can wear armour/shield/helmet
#define FLAG_CAST_SPELL
(Monster) can learn and cast spells
static PyObject * Crossfire_Object_LearnSpell(Crossfire_Object *who, PyObject *args)
void cf_object_set_flag(object *ob, int flag, int value)
static PyObject * Object_GetMoveBlock(Crossfire_Object *whoptr, void *closure)
const typedef char * sstring
static PyObject * Crossfire_Object_CheckArchInventory(Crossfire_Object *who, PyObject *args)
static PyObject * Player_GetMarkedItem(Crossfire_Player *whoptr, void *closure)
static PyObject * Player_GetBedMap(Crossfire_Player *whoptr, void *closure)
#define CFAPI_PLAYER_PROP_BED_MAP
int cf_object_set_nrof(object *, int nrof)
#define CFAPI_OBJECT_PROP_WC
#define CFAPI_OBJECT_PROP_GLOW_RADIUS
static PyObject * Player_QuestStart(Crossfire_Player *whoptr, PyObject *args)
int cf_object_check_trigger(object *op, object *cause)
Wrapper for check_trigger().
static PyObject * Player_GetBedY(Crossfire_Player *whoptr, void *closure)
CF_PYTHON_NUMBER_METHODS(Object, Crossfire_Object_Long)
#define CFAPI_OBJECT_PROP_CON
int cf_quest_get_player_state(object *pl, sstring quest_code)
Wrapper for quest_get_player_state().
static PyObject * find_assoc_pyobject(object *key)
void cf_object_set_long_property(object *op, int propcode, long value)
static PyObject * Object_GetMoveType(Crossfire_Object *whoptr, void *closure)
static int Object_SetFlagProperty(Crossfire_Object *whoptr, PyObject *value, void *closure)
#define FLAG_BEEN_APPLIED
The object has been applied.
const char * cf_object_get_key(object *op, const char *keyname)
Gets value for specified key, equivalent of object_get_value().
#define CFAPI_OBJECT_PROP_GP
static void Crossfire_Object_dealloc(PyObject *obj)
#define CFAPI_OBJECT_PROP_LAST_SP
static PyGetSetDef Object_getseters[]
#define CFAPI_OBJECT_PROP_MATERIAL
#define CFAPI_OBJECT_PROP_DURATION
#define CFAPI_OBJECT_PROP_OTHER_ARCH
static PyObject * Object_GetIntProperty(Crossfire_Object *whoptr, void *closure)
#define CFAPI_OBJECT_PROP_OB_ABOVE
static PyObject * Crossfire_Object_MoveTo(Crossfire_Object *who, PyObject *args)
static PyObject * Crossfire_Object_Reposition(Crossfire_Object *who, PyObject *args)
#define EXISTCHECK_INT(ob)
sstring npc_msgs[MAX_NPC]
What the NPCs will say.
#define FLAG_IS_USED_UP
When (–food<0) the object will exit.
#define FLAG_ANIMATE
The object looks at archetype for faces.
#define CFAPI_OBJECT_PROP_MOVE_ALLOW
static PyObject * Crossfire_Object_Long(PyObject *obj)
static int Object_SetStringProperty(Crossfire_Object *whoptr, PyObject *value, void *closure)
Setters.
static int Object_SetIntProperty(Crossfire_Object *whoptr, PyObject *value, void *closure)
char * cf_player_get_title(object *op, char *title, int size)
static int Player_SetBedMap(Crossfire_Player *whoptr, PyObject *value, void *closure)
static PyObject * Object_GetMoney(Crossfire_Object *whoptr, void *closure)
static int Object_SetMoveAllow(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Crossfire_Object_Split(Crossfire_Object *who, PyObject *args)
int cf_object_set_face(object *op, const char *face)
Set the object's face.
#define CFAPI_OBJECT_PROP_MOVE_SLOW
#define FLAG_UNPAID
Object hasn't been paid for yet.
static PyObject * Player_QuestGetState(Crossfire_Player *whoptr, PyObject *args)
void cf_player_message(object *op, const char *txt, int flags)
static PyObject * Object_GetArchetype(Crossfire_Object *whoptr, void *closure)
static PyObject * Player_GiveKnowledge(Crossfire_Player *who, PyObject *args)
object * cf_object_change_map(object *op, mapstruct *m, object *originator, int flag, int x, int y)
Wrapper for object_insert_in_map_at().
#define CFAPI_OBJECT_PROP_LUCK
void cf_object_forget_spell(object *op, object *sp)
Wrapper for do_forget_spell(), except takes an object, not a string.
int cf_object_pay_item(object *op, object *pl)
Wrapper for pay_for_item().
Crossfire Architecture the general intention is to enhance the enjoyability and playability of CF In this code
object * cf_object_insert_object(object *op, object *container)
#define FLAG_XRAYS
X-ray vision.
int16_t cf_object_get_resistance(object *op, int rtype)
void cf_object_set_int_property(object *op, int propcode, int value)
static PyObject * Crossfire_Object_Cast(Crossfire_Object *who, PyObject *args)
static int Object_SetEnemy(Crossfire_Object *whoptr, PyObject *value, void *closure)
static std::vector< std::string > split(const std::string &field, const std::string &by)
#define CFAPI_OBJECT_PROP_VALUE
#define CFAPI_OBJECT_PROP_MESSAGE
#define CFAPI_OBJECT_PROP_MOVE_SLOW_PENALTY
static PyObject * Crossfire_Object_ActivateRune(Crossfire_Object *who, PyObject *args)
#define CFAPI_OBJECT_PROP_MAXGP
#define CFAPI_OBJECT_PROP_COUNT
static void Crossfire_Player_dealloc(PyObject *obj)
static PyObject * Object_GetExists(Crossfire_Object *whoptr, void *closure)
#define CFAPI_OBJECT_PROP_SUBTYPE
void cf_object_remove(object *op)
Wrapper for object_remove().
static PyObject * Crossfire_Object_Arrest(Crossfire_Object *who, PyObject *args)
void cf_object_change_exp(object *op, int64_t exp, const char *skill_name, int flag)
Wrapper for change_exp().
static int Object_SetNamePl(Crossfire_Object *whoptr, PyObject *value, void *closure)
static int Object_SetQuantity(Crossfire_Object *whoptr, PyObject *value, void *closure)
static PyObject * Crossfire_Object_PermExp(Crossfire_Object *who, PyObject *args)
static PyObject * Object_GetSStringProperty(Crossfire_Object *whoptr, void *closure)
#define FLAG_USE_SCROLL
(Monster) can read scroll
#define FLAG_CURSED
The object is cursed.
static PyObject * Crossfire_Object_Take(Crossfire_Object *who, PyObject *args)
sstring cf_player_get_ip(object *op)
PyObject * Crossfire_Map_wrap(mapstruct *what)
#define CFAPI_OBJECT_PROP_FP
#define FLAG_IS_THROWN
Object is designed to be thrown.
static PyObject * Crossfire_Player_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
#define FLAG_SLEEP
NPC is sleeping.
void cf_object_set_object_property(object *op, int propcode, object *value)
PyTypeObject Crossfire_ObjectType
#define CFAPI_OBJECT_PROP_LAST_GRACE
void cf_object_learn_spell(object *op, object *spell, int special_prayer)
Wrapper for do_learn_spell().
static PyObject * Crossfire_Player_Message(Crossfire_Player *who, PyObject *args)
int cf_object_get_int_property(object *op, int propcode)
int cf_quest_was_completed(object *pl, sstring quest_code)
Wrapper for quest_was_completed().
static PyObject * Object_GetObjectProperty(Crossfire_Object *whoptr, void *closure)
float cf_object_get_float_property(object *op, int propcode)
#define CFAPI_OBJECT_PROP_DIRECTION
void cf_object_set_resistance(object *op, int rtype, int16_t value)
#define FLAG_LIFESAVE
Saves a players' life once, then destr.
static PyObject * Object_GetName(Crossfire_Object *whoptr, void *closure)
int cf_object_remove_depletion(object *op, int level)
Wrapper for remove_depletion().
#define CFAPI_OBJECT_PROP_MATERIAL_NAME
#define FLAG_IDENTIFIED
Player knows full info about item.
#define CFAPI_OBJECT_PROP_WEIGHT_LIMIT
in that case they will be relative to whatever the PWD of the crossfire server process is You probably shouldn though Notes on Specific and settings file datadir Usually usr share crossfire Contains data that the server does not need to modify while such as the etc A default install will pack the and treasurelist definitions into a single or trs file and the graphics into a face(metadata) and .tar(bitmaps) file
#define CFAPI_OBJECT_PROP_SPEED_LEFT
PyTypeObject Crossfire_MapType