version 1.3 | | version 1.4 |
---|
| | |
/* | | /* |
* static char *rcsid_check_object_c = | | * static char *rcsid_check_object_c = |
* "$Id: toolkit_common.c,v 1.3 2006/06/02 21:58:42 qal21 Exp $"; | | * "$Id: toolkit_common.c,v 1.4 2006/06/07 21:44:07 tchize Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
init_archetypes(); | | init_archetypes(); |
SET_TKFLAG(STATUS_GLOBALS|STATUS_HASHTABLE|STATUS_OBJECTS|STATUS_VARS|STATUS_BLOCK|STATUS_BMAP|STATUS_ANIM|STATUS_ARCH); | | SET_TKFLAG(STATUS_GLOBALS|STATUS_HASHTABLE|STATUS_OBJECTS|STATUS_VARS|STATUS_BLOCK|STATUS_BMAP|STATUS_ANIM|STATUS_ARCH); |
} | | } |
| | |
| | /** |
| | * Initialize a simple object. Make it appear as an actual ingame object |
| | * by setting appropriate flags (so it is part of game, not just a storage) |
| | * Requires arch and object initialized in status flag |
| | * @param archname the archetype name to use (NULL= default one) |
| | */ |
| | object* cctk_create_game_object(char* archname){ |
| | archetype *arch; |
| | object *obj; |
| | CCTK_ASSERT(STATUS_OBJECTS|STATUS_ARCH); |
| | if (archname==NULL) |
| | archname="empty_archetype"; |
| | arch = find_archetype(archname); |
| | if (arch==NULL) return NULL; |
| | obj = arch_to_object(arch); |
| | if (obj==NULL) return NULL; |
| | CLEAR_FLAG(obj,FLAG_FREED); |
| | return obj; |
| | } |
| | /** |
| | * Set all strings in given object to given parameter string, used for |
| | * checking cleaning of objects, mainly |
| | * @param op The object to initialize |
| | * @param string The string to set in all object's char* fields |
| | */ |
| | void cctk_set_object_strings(object* op, char* string){ |
| | op->name=add_string(string); |
| | op->name_pl=add_string(string); |
| | op->title=add_string(string); |
| | op->race=add_string(string); |
| | op->slaying=add_string(string); |
| | op->skill=add_string(string); |
| | op->msg=add_string(string); |
| | op->lore=add_string(string); |
| | op->materialname=add_string(string); |
| | } |
| | |