Module Name: crossfire
Committed By: tchize
Date: Thu Apr 6 21:18:36 UTC 2006
Modified Files:
crossfire/common: arch.c living.c loader.c loader.l object.c quest.c
readable.c recipe.c treasure.c
crossfire/include: define.h libproto.h sproto.h
crossfire/plugins/cfpython/include: cfpython_proto.h
crossfire/random_maps: exit.c special.c treasure.c
crossfire/server: alchemy.c apply.c attack.c build_map.c disease.c
gods.c player.c plugins.c rune.c spell_attack.c spell_effect.c
spell_util.c time.c
crossfire/test/unit/common: Makefile.am Makefile.in check_arch.c
Log Message:
finished common/arch.c unit test, fixed a few bugs, moved function around and renamed other
The following files had too many changes to show the context diffs here:
cvs rdiff -r1.38 -r1.39 crossfire/common/arch.c
cvs rdiff -r1.81 -r1.82 crossfire/common/loader.c
cvs rdiff -r1.151 -r1.152 crossfire/server/spell_effect.c
Start of context diffs
Index: crossfire/common/living.c
diff -c crossfire/common/living.c:1.77 crossfire/common/living.c:1.78
*** crossfire/common/living.c:1.77 Tue Mar 7 10:46:23 2006
--- crossfire/common/living.c Thu Apr 6 14:18:34 2006
***************
*** 1,6 ****
/*
* static char *rcsid_living_c =
! * "$Id: living.c,v 1.77 2006/03/07 18:46:23 cavesomething Exp $";
*/
/*
--- 1,6 ----
/*
* static char *rcsid_living_c =
! * "$Id: living.c,v 1.78 2006/04/06 21:18:34 tchize Exp $";
*/
/*
***************
*** 1502,1513 ****
object *give_skill_by_name(object *op, const char *skill_name)
{
object *skill_obj;
! skill_obj = get_archetype_by_skill_name(skill_name, SKILL);
! if (!skill_obj) {
LOG(llevError, "add_player_exp: couldn't find skill %s\n", skill_name);
return NULL;
}
/* clear the flag - exp goes into this bucket, but player
* still doesn't know it.
*/
--- 1502,1519 ----
object *give_skill_by_name(object *op, const char *skill_name)
{
object *skill_obj;
+ archetype *skill_arch;
! skill_arch = get_archetype_by_skill_name(skill_name, SKILL);
! if (!skill_arch) {
LOG(llevError, "add_player_exp: couldn't find skill %s\n", skill_name);
return NULL;
}
+ skill_obj = arch_to_object(skill_arch);
+ if (!skill_obj) {
+ LOG(llevError, "add_player_exp: couldn't instanciate skill %s\n", skill_name);
+ return NULL;
+ }
/* clear the flag - exp goes into this bucket, but player
* still doesn't know it.
*/
Index: crossfire/common/object.c
diff -c crossfire/common/object.c:1.123 crossfire/common/object.c:1.124
*** crossfire/common/object.c:1.123 Sat Mar 18 07:05:31 2006
--- crossfire/common/object.c Thu Apr 6 14:18:34 2006
***************
*** 1,6 ****
/*
* static char *rcsid_object_c =
! * "$Id: object.c,v 1.123 2006/03/18 15:05:31 ryo_saeba Exp $";
*/
/*
--- 1,6 ----
/*
* static char *rcsid_object_c =
! * "$Id: object.c,v 1.124 2006/04/06 21:18:34 tchize Exp $";
*/
/*
***************
*** 2782,2784 ****
--- 2782,2930 ----
return ret;
}
+
+
+ /*
+ * Gros has put find_best_weapon_used_match in arch.c but it manipulates
+ * only objects so i moved it here. -tchize
+ */
+ object *find_best_weapon_used_match(object *pl, const char *params)
+ {
+ object *tmp, *best=NULL;
+ int match_val=0,tmpmatch;
+
+ for (tmp=pl->inv; tmp; tmp=tmp->below) {
+ if (tmp->invisible) continue;
+ if ((tmpmatch=item_matched_string(pl, tmp, params))>match_val)
+ {
+ if ((QUERY_FLAG(tmp, FLAG_APPLIED))&&(tmp->type==WEAPON))
+ {
+ match_val=tmpmatch;
+ best=tmp;
+ };
+ }
+ }
+ return best;
+ }
+
+ /** This is a subset of the parse_id command. Basically, name can be
+ * a string seperated lists of things to match, with certain keywords.
+ * pl is the player (only needed to set count properly)
+ * op is the item we are trying to match. Calling function takes care
+ * of what action might need to be done and if it is valid
+ * (pickup, drop, etc.) Return NONZERO if we have a match. A higher
+ * value means a better match. 0 means no match.
+ *
+ * Brief outline of the procedure:
+ * We take apart the name variable into the individual components.
+ * cases for 'all' and unpaid are pretty obvious.
+ * Next, we check for a count (either specified in name, or in the
+ * player object.)
+ * If count is 1, make a quick check on the name.
+ * IF count is >1, we need to make plural name. Return if match.
+ * Last, make a check on the full name.
+ *
+ * Details on values output (highest is output):
+ * match type return value
+ * ---------------------------------------
+ * nothing 0
+ * 'all' 1
+ * 'unpaid' 2
+ * 'cursed' 2
+ * 'unlocked' 2
+ * partial custom name 3
+ * op->name with count >1 4
+ * op->name with count <2 6
+ * op->name_pl with count >1 6
+ * inside base name 12
+ * inside short name 12
+ * begin of base name 14
+ * custom name 15
+ * base name 16
+ * short name 18
+ * full name 20
+ * (note, count is extracted from begin of name parameter or
+ * from pl->contr->count, name has priority)
+ */
+ int item_matched_string(object *pl, object *op, const char *name)
+ {
+ char *cp, local_name[MAX_BUF];
+ int count,retval=0;
+ strcpy(local_name, name); /* strtok is destructive to name */
+
+ for (cp=strtok(local_name,","); cp; cp=strtok(NULL,",")) {
+ while (cp[0]==' ') ++cp; /* get rid of spaces */
+
+ /* LOG(llevDebug,"Trying to match %s\n", cp);*/
+ /* All is a very generic match - low match value */
+ if (!strcmp(cp,"all")) return 1;
+
+ /* unpaid is a little more specific */
+ if (!strcmp(cp,"unpaid") && QUERY_FLAG(op,FLAG_UNPAID)) return 2;
+ if (!strcmp(cp,"cursed") && QUERY_FLAG(op,FLAG_KNOWN_CURSED) &&
+ (QUERY_FLAG(op,FLAG_CURSED) ||QUERY_FLAG(op,FLAG_DAMNED)))
+ return 2;
+
+ if (!strcmp(cp,"unlocked") && !QUERY_FLAG(op, FLAG_INV_LOCKED))
+ return 2;
+
+ /* Allow for things like '100 arrows' */
+ if ((count=atoi(cp))!=0) {
+ cp=strchr(cp, ' ');
+ while (cp && cp[0]==' ') ++cp; /* get rid of spaces */
+ }
+ else {
+ if (pl->type==PLAYER)
+ count=pl->contr->count;
+ else
+ count = 0;
+ }
+
+ if (!cp || cp[0]=='\0' || count<0) return 0;
+
+
+ /* The code here should go from highest retval to lowest. That
+ * is because of the 'else' handling - we don't want to match on
+ * something and set a low retval, even though it may match a higher retcal
+ * later. So keep it in descending order here, so we try for the best
+ * match first, and work downward.
+ */
+ if (!strcasecmp(cp,query_name(op))) retval=20;
+ else if (!strcasecmp(cp,query_short_name(op))) retval=18;
+ else if (!strcasecmp(cp,query_base_name(op,0))) retval=16;
+ else if (!strcasecmp(cp,query_base_name(op,1))) retval=16;
+ else if (op->custom_name && !strcasecmp(cp,op->custom_name)) retval=15;
+ else if (!strncasecmp(cp,query_base_name(op,0),
+ strlen(cp))) retval=14;
+ else if (!strncasecmp(cp,query_base_name(op,1),
+ strlen(cp))) retval=14;
+
+ /* Do substring checks, so things like 'Str+1' will match.
+ * retval of these should perhaps be lower - they are lower
+ * then the specific strcasecmp aboves, but still higher than
+ * some other match criteria.
+ */
+ else if (strstr(query_base_name(op,1), cp)) retval = 12;
+ else if (strstr(query_base_name(op,0), cp)) retval = 12;
+ else if (strstr(query_short_name(op), cp)) retval = 12;
+
+ /* Check against plural/non plural based on count. */
+ else if (count>1 && !strcasecmp(cp,op->name_pl)) {
+ retval=6;
+ }
+ else if (count==1 && !strcasecmp(op->name,cp)) {
+ retval=6;
+ }
+ /* base name matched - not bad */
+ else if (strcasecmp(cp,op->name)==0 && !count) retval=4;
+ /* Check for partial custom name, but give a real low priority */
+ else if (op->custom_name && strstr(op->custom_name, cp)) retval = 3;
+
+ if (retval) {
+ if (pl->type == PLAYER)
+ pl->contr->count=count;
+ return retval;
+ }
+ }
+ return 0;
+ }
Index: crossfire/common/quest.c
diff -c crossfire/common/quest.c:1.6 crossfire/common/quest.c:1.7
*** crossfire/common/quest.c:1.6 Wed Feb 8 16:48:36 2006
--- crossfire/common/quest.c Thu Apr 6 14:18:34 2006
***************
*** 1,6 ****
/*
* static char *rcsid_quest_c =
! * "$Id: quest.c,v 1.6 2006/02/09 00:48:36 akirschbaum Exp $";
*/
/*
--- 1,6 ----
/*
* static char *rcsid_quest_c =
! * "$Id: quest.c,v 1.7 2006/04/06 21:18:34 tchize Exp $";
*/
/*
***************
*** 341,347 ****
case QUEST_START_QUEST:
if ( quest_get_player_quest( pl->ob, QUEST_NAME(item), NULL ) )
return;
! qm = get_archetype("quest_in_progress");
FREE_AND_COPY(QUEST_NAME(qm), QUEST_NAME(item));
if ( item->lore )
{
--- 341,347 ----
case QUEST_START_QUEST:
if ( quest_get_player_quest( pl->ob, QUEST_NAME(item), NULL ) )
return;
! qm = create_archetype("quest_in_progress");
FREE_AND_COPY(QUEST_NAME(qm), QUEST_NAME(item));
if ( item->lore )
{
***************
*** 353,359 ****
case QUEST_END_QUEST:
if ( !quest_get_player_quest( pl->ob, QUEST_NAME(item), NULL ) )
return;
! qm = get_archetype("quest_done_quest");
FREE_AND_COPY(QUEST_NAME(qm), QUEST_NAME(item));
if ( item->lore )
{
--- 353,359 ----
case QUEST_END_QUEST:
if ( !quest_get_player_quest( pl->ob, QUEST_NAME(item), NULL ) )
return;
! qm = create_archetype("quest_done_quest");
FREE_AND_COPY(QUEST_NAME(qm), QUEST_NAME(item));
if ( item->lore )
{
***************
*** 366,372 ****
case QUEST_START_TASK:
if ( quest_get_player_quest( pl->ob, QUEST_NAME(item), TASK_NAME(item) ) )
return;
! qm = get_archetype("quest_in_progress");
FREE_AND_COPY(QUEST_NAME(qm), QUEST_NAME(item));
FREE_AND_COPY(TASK_NAME(qm), TASK_NAME(item));
if ( item->lore )
--- 366,372 ----
case QUEST_START_TASK:
if ( quest_get_player_quest( pl->ob, QUEST_NAME(item), TASK_NAME(item) ) )
return;
! qm = create_archetype("quest_in_progress");
FREE_AND_COPY(QUEST_NAME(qm), QUEST_NAME(item));
FREE_AND_COPY(TASK_NAME(qm), TASK_NAME(item));
if ( item->lore )
***************
*** 379,385 ****
case QUEST_END_TASK:
if ( !quest_get_player_quest( pl->ob, QUEST_NAME(item), TASK_NAME(item) ) )
return;
! qm = get_archetype("quest_done_task");
FREE_AND_COPY(QUEST_NAME(qm), QUEST_NAME(item));
FREE_AND_COPY(TASK_NAME(qm), TASK_NAME(item));
if ( item->lore )
--- 379,385 ----
case QUEST_END_TASK:
if ( !quest_get_player_quest( pl->ob, QUEST_NAME(item), TASK_NAME(item) ) )
return;
! qm = create_archetype("quest_done_task");
FREE_AND_COPY(QUEST_NAME(qm), QUEST_NAME(item));
FREE_AND_COPY(TASK_NAME(qm), TASK_NAME(item));
if ( item->lore )
Index: crossfire/common/readable.c
diff -c crossfire/common/readable.c:1.30 crossfire/common/readable.c:1.31
*** crossfire/common/readable.c:1.30 Sat Mar 18 09:15:24 2006
--- crossfire/common/readable.c Thu Apr 6 14:18:34 2006
***************
*** 1,6 ****
/*
* static char *rcsid_readable_c =
! * "$Id: readable.c,v 1.30 2006/03/18 17:15:24 ryo_saeba Exp $";
*/
/*
--- 1,6 ----
/*
* static char *rcsid_readable_c =
! * "$Id: readable.c,v 1.31 2006/04/06 21:18:34 tchize Exp $";
*/
/*
***************
*** 1116,1122 ****
object *tmpbook;
/* alter book properties */
! if ((tmpbook = get_archetype (t->archname)) != NULL)
{
if (tmpbook->msg)
free_string (book->msg);
--- 1116,1122 ----
object *tmpbook;
/* alter book properties */
! if ((tmpbook = create_archetype (t->archname)) != NULL)
{
if (tmpbook->msg)
free_string (book->msg);
Index: crossfire/common/recipe.c
diff -c crossfire/common/recipe.c:1.15 crossfire/common/recipe.c:1.16
*** crossfire/common/recipe.c:1.15 Wed Feb 8 16:48:36 2006
--- crossfire/common/recipe.c Thu Apr 6 14:18:34 2006
***************
*** 526,532 ****
}
artifact * locate_recipe_artifact(const recipe *rp, size_t idx) {
! object *item=get_archetype(rp->arch_name[idx]);
artifactlist *at=NULL;
artifact *art=NULL;
--- 526,532 ----
}
artifact * locate_recipe_artifact(const recipe *rp, size_t idx) {
! object *item=create_archetype(rp->arch_name[idx]);
artifactlist *at=NULL;
artifact *art=NULL;
Index: crossfire/common/treasure.c
diff -c crossfire/common/treasure.c:1.64 crossfire/common/treasure.c:1.65
*** crossfire/common/treasure.c:1.64 Wed Feb 8 16:48:36 2006
--- crossfire/common/treasure.c Thu Apr 6 14:18:34 2006
***************
*** 1,7 ****
/*
* static char *rcs_treasure_c =
! * "$Id: treasure.c,v 1.64 2006/02/09 00:48:36 akirschbaum Exp $";
*/
/*
--- 1,7 ----
/*
* static char *rcs_treasure_c =
! * "$Id: treasure.c,v 1.65 2006/04/06 21:18:34 tchize Exp $";
*/
/*
***************
*** 827,833 ****
if (op->stats.sp && !op->randomitems) {
object *tmp;
! tmp = get_archetype(spell_mapping[op->stats.sp]);
insert_ob_in_ob(tmp, op);
op->stats.sp=0;
}
--- 827,833 ----
if (op->stats.sp && !op->randomitems) {
object *tmp;
! tmp = create_archetype(spell_mapping[op->stats.sp]);
insert_ob_in_ob(tmp, op);
op->stats.sp=0;
}
***************
*** 858,864 ****
if (op->stats.sp && !op->randomitems) {
object *tmp;
! tmp = get_archetype(spell_mapping[op->stats.sp]);
insert_ob_in_ob(tmp, op);
op->stats.sp=0;
}
--- 858,864 ----
if (op->stats.sp && !op->randomitems) {
object *tmp;
! tmp = create_archetype(spell_mapping[op->stats.sp]);
insert_ob_in_ob(tmp, op);
op->stats.sp=0;
}
Index: crossfire/include/define.h
diff -c crossfire/include/define.h:1.106 crossfire/include/define.h:1.107
*** crossfire/include/define.h:1.106 Wed Feb 22 01:47:35 2006
--- crossfire/include/define.h Thu Apr 6 14:18:35 2006
***************
*** 1,6 ****
/*
* static char *rcsid_define_h =
! * "$Id: define.h,v 1.106 2006/02/22 09:47:35 akirschbaum Exp $";
*/
/*
--- 1,6 ----
/*
* static char *rcsid_define_h =
! * "$Id: define.h,v 1.107 2006/04/06 21:18:35 tchize Exp $";
*/
/*
***************
*** 290,295 ****
--- 290,297 ----
/* #define GPS 162 Ground positionning system, moved to Python plugin */
#define ITEM_TRANSFORMER 163 /* Transforming one item with another */
#define QUEST 164 /* See below for subtypes */
+
+ #define OBJECT_TYPE_MAX 164 /* update if you add new types */
/* END TYPE DEFINE */
/* Subtypes for BUILDER */
Index: crossfire/include/libproto.h
diff -c crossfire/include/libproto.h:1.91 crossfire/include/libproto.h:1.92
*** crossfire/include/libproto.h:1.91 Sat Mar 18 09:15:24 2006
--- crossfire/include/libproto.h Thu Apr 6 14:18:35 2006
***************
*** 6,14 ****
/* arch.c */
extern archetype *find_archetype_by_object_name(const char *name);
extern archetype *find_archetype_by_object_type_name(int type, const char *name);
! extern object *get_archetype_by_skill_name(const char *skill, int type);
extern archetype *get_archetype_by_type_subtype(int type, int subtype);
! extern object *get_archetype_by_object_name(const char *name);
extern object *find_best_weapon_used_match(object *pl, const char *params);
extern int item_matched_string(object *pl, object *op, const char *name);
extern void init_archetypes(void);
--- 6,14 ----
/* arch.c */
extern archetype *find_archetype_by_object_name(const char *name);
extern archetype *find_archetype_by_object_type_name(int type, const char *name);
! extern archetype *get_archetype_by_skill_name(const char *skill, int type);
extern archetype *get_archetype_by_type_subtype(int type, int subtype);
! extern object *create_archetype_by_object_name(const char *name);
extern object *find_best_weapon_used_match(object *pl, const char *params);
extern int item_matched_string(object *pl, object *op, const char *name);
extern void init_archetypes(void);
***************
*** 19,35 ****
extern void dump_all_archetypes(void);
extern void free_all_archs(void);
extern archetype *get_archetype_struct(void);
- extern void first_arch_pass(FILE *fp);
- extern void second_arch_pass(FILE *fp);
extern void check_generators(void);
- extern void load_archetypes(void);
extern object *arch_to_object(archetype *at);
extern object *create_singularity(const char *name);
! extern object *get_archetype(const char *name);
extern unsigned long hasharch(const char *str, int tablesize);
extern archetype *find_archetype(const char *name);
extern archetype *type_to_archetype(int type);
- extern object *clone_arch(int type);
extern object *object_create_arch(archetype *at);
/* button.c */
extern void push_button(object *op);
--- 19,31 ----
extern void dump_all_archetypes(void);
extern void free_all_archs(void);
extern archetype *get_archetype_struct(void);
extern void check_generators(void);
extern object *arch_to_object(archetype *at);
extern object *create_singularity(const char *name);
! extern object *create_archetype(const char *name);
extern unsigned long hasharch(const char *str, int tablesize);
extern archetype *find_archetype(const char *name);
extern archetype *type_to_archetype(int type);
extern object *object_create_arch(archetype *at);
/* button.c */
extern void push_button(object *op);
***************
*** 399,405 ****
/* loader.c */
extern int lex_load(object *op, int map_flags);
extern void yyrestart(FILE *input_file);
! extern void yy_load_buffer_state(void);
extern int yyerror(char *s);
extern int load_object(FILE *fp, object *op, int bufstate, int map_flags);
extern int set_variable(object *op, char *buf);
--- 395,413 ----
/* loader.c */
extern int lex_load(object *op, int map_flags);
extern void yyrestart(FILE *input_file);
! extern void yypop_buffer_state(void);
! extern int yyget_lineno(void);
! extern FILE *yyget_in(void);
! extern FILE *yyget_out(void);
! extern int yyget_leng(void);
! extern char *yyget_text(void);
! extern void yyset_lineno(int line_number);
! extern void yyset_in(FILE *in_str);
! extern void yyset_out(FILE *out_str);
! extern int yyget_debug(void);
! extern void yyset_debug(int bdebug);
! extern int yylex_destroy(void);
! extern void yyfree(void *ptr);
extern int yyerror(char *s);
extern int load_object(FILE *fp, object *op, int bufstate, int map_flags);
extern int set_variable(object *op, char *buf);
Index: crossfire/include/sproto.h
diff -c crossfire/include/sproto.h:1.166 crossfire/include/sproto.h:1.167
*** crossfire/include/sproto.h:1.166 Sat Mar 18 07:05:32 2006
--- crossfire/include/sproto.h Thu Apr 6 14:18:35 2006
***************
*** 429,456 ****
int save_player(object *op, int flag);
void copy_file(const char *filename, FILE *fpout);
void check_login(object *op);
- /* main.c */
- void version(object *op);
- void info_keys(object *op);
- void start_info(object *op);
- char *crypt_string(char *str, char *salt);
- int check_password(char *typed, char *crypted);
- void enter_player_savebed(object *op);
- void leave_map(object *op);
- void set_map_timeout(mapstruct *oldmap);
- char *clean_path(const char *file);
- char *unclean_path(const char *src);
- void enter_exit(object *op, object *exit_ob);
- void process_active_maps(void);
- void process_players1(mapstruct *map);
- void process_players2(mapstruct *map);
- void process_events(mapstruct *map);
- void clean_tmp_files(void);
- void cleanup(void);
- void leave(player *pl, int draw_exit);
- int forbid_play(void);
- void do_specials(void);
- int main(int argc, char **argv);
/* monster.c */
object *check_enemy(object *npc, rv_vector *rv);
object *find_nearest_living_creature(object *npc);
--- 429,434 ----
***************
*** 671,677 ****
int trap_disarm(object *disarmer, object *trap, int risk, object *skill);
void trap_adjust(object *trap, int difficulty);
/* shop.c */
- double shopkeeper_approval(const mapstruct *map, const object *player);
uint64 query_cost(const object *tmp, object *who, int flag);
const char *query_cost_string(const object *tmp, object *who, int flag);
uint64 query_money(const object *op);
--- 649,654 ----
***************
*** 680,685 ****
--- 657,663 ----
int can_pay(object *pl);
int get_payment(object *pl, object *op);
void sell_item(object *op, object *pl);
+ double shopkeeper_approval(const mapstruct *map, const object *player);
int describe_shop(const object *op);
void shop_listing(object *op);
/* skills.c */
***************
*** 859,861 ****
--- 837,861 ----
int worldmap_to_weathermap(int x, int y, int *wx, int *wy, mapstruct *m);
int real_world_temperature(int x, int y, mapstruct *m);
int similar_direction(int a, int b);
+ /* main.c */
+ void version(object *op);
+ void info_keys(object *op);
+ void start_info(object *op);
+ char *crypt_string(char *str, char *salt);
+ int check_password(char *typed, char *crypted);
+ void enter_player_savebed(object *op);
+ void leave_map(object *op);
+ void set_map_timeout(mapstruct *oldmap);
+ char *clean_path(const char *file);
+ char *unclean_path(const char *src);
+ void enter_exit(object *op, object *exit_ob);
+ void process_active_maps(void);
+ void process_players1(mapstruct *map);
+ void process_players2(mapstruct *map);
+ void process_events(mapstruct *map);
+ void clean_tmp_files(void);
+ void cleanup(void);
+ void leave(player *pl, int draw_exit);
+ int forbid_play(void);
+ void do_specials(void);
+ int main(int argc, char **argv);
Index: crossfire/plugins/cfpython/include/cfpython_proto.h
diff -c crossfire/plugins/cfpython/include/cfpython_proto.h:1.2 crossfire/plugins/cfpython/include/cfpython_proto.h:1.3
*** crossfire/plugins/cfpython/include/cfpython_proto.h:1.2 Tue Oct 18 15:08:11 2005
--- crossfire/plugins/cfpython/include/cfpython_proto.h Thu Apr 6 14:18:35 2006
***************
*** 1,8 ****
/* cfpython.c */
! CF_PLUGIN void * getPluginProperty(int *type, ...);
! CF_PLUGIN int postInitPlugin(void);
! CF_PLUGIN void *globalEventListener(int *type, ...);
! CF_PLUGIN void *eventListener(int *type, ...);
! CF_PLUGIN int closePlugin(void);
! CF_PLUGIN int runPluginCommand(object* op, char* params);
PyObject *Crossfire_Object_wrap(object *what);
--- 1,22 ----
/* cfpython.c */
! void initContextStack(void);
! void pushContext(CFPContext *context);
! CFPContext *popContext(void);
! void freeContext(CFPContext *context);
! int initPlugin(const char *iversion, f_plug_api gethooksptr);
! void *getPluginProperty(int *type, ...);
! int runPluginCommand(object *op, char *params);
! int postInitPlugin(void);
! void *globalEventListener(int *type, ...);
! void *eventListener(int *type, ...);
! int closePlugin(void);
! /* cfpython_archetype.c */
! PyObject *Crossfire_Archetype_wrap(archetype *what);
! /* cfpython_object.c */
PyObject *Crossfire_Object_wrap(object *what);
+ /* cfpython_party.c */
+ PyObject *Crossfire_Party_wrap(partylist *what);
+ /* cfpython_region.c */
+ PyObject *Crossfire_Region_wrap(region *what);
+ /* cfpython_map.c */
+ PyObject *Crossfire_Map_wrap(mapstruct *what);
Index: crossfire/random_maps/exit.c
diff -c crossfire/random_maps/exit.c:1.20 crossfire/random_maps/exit.c:1.21
*** crossfire/random_maps/exit.c:1.20 Sat Mar 4 09:37:19 2006
--- crossfire/random_maps/exit.c Thu Apr 6 14:18:35 2006
***************
*** 1,6 ****
/*
* static char *rcsid_exit_c =
! * "$Id: exit.c,v 1.20 2006/03/04 17:37:19 akirschbaum Exp $";
*/
/*
--- 1,6 ----
/*
* static char *rcsid_exit_c =
! * "$Id: exit.c,v 1.21 2006/04/06 21:18:35 tchize Exp $";
*/
/*
***************
*** 207,213 ****
/* surround the exits with notices that this is a random map. */
for(j=1;j<9;j++) {
if(!wall_blocked(map,the_exit_up->x+freearr_x[j],the_exit_up->y+freearr_y[j])) {
! random_sign = get_archetype("sign");
random_sign->x = the_exit_up->x+freearr_x[j];
random_sign->y = the_exit_up->y+freearr_y[j];
--- 207,213 ----
/* surround the exits with notices that this is a random map. */
for(j=1;j<9;j++) {
if(!wall_blocked(map,the_exit_up->x+freearr_x[j],the_exit_up->y+freearr_y[j])) {
! random_sign = create_archetype("sign");
random_sign->x = the_exit_up->x+freearr_x[j];
random_sign->y = the_exit_up->y+freearr_y[j];
Index: crossfire/random_maps/special.c
diff -c crossfire/random_maps/special.c:1.23 crossfire/random_maps/special.c:1.24
*** crossfire/random_maps/special.c:1.23 Wed Nov 16 00:16:08 2005
--- crossfire/random_maps/special.c Thu Apr 6 14:18:35 2006
***************
*** 1,6 ****
/*
* static char *rcsid_special_c =
! * "$Id: special.c,v 1.23 2005/11/16 08:16:08 mwedel Exp $";
*/
/*
--- 1,6 ----
/*
* static char *rcsid_special_c =
! * "$Id: special.c,v 1.24 2006/04/06 21:18:35 tchize Exp $";
*/
/*
***************
*** 140,146 ****
void place_fountain_with_specials(mapstruct *map) {
int ix,iy,i=-1,tries=0;
mapstruct *fountain_style=find_style("/styles/misc","fountains",-1);
! object *fountain=get_archetype("fountain");
object *potion=get_object();
copy_object(pick_random_object(fountain_style),potion);
while(i<0 && tries<10) {
--- 140,146 ----
void place_fountain_with_specials(mapstruct *map) {
int ix,iy,i=-1,tries=0;
mapstruct *fountain_style=find_style("/styles/misc","fountains",-1);
! object *fountain=create_archetype("fountain");
object *potion=get_object();
copy_object(pick_random_object(fountain_style),potion);
while(i<0 && tries<10) {
Index: crossfire/random_maps/treasure.c
diff -c crossfire/random_maps/treasure.c:1.26 crossfire/random_maps/treasure.c:1.27
*** crossfire/random_maps/treasure.c:1.26 Sat Mar 18 09:15:25 2006
--- crossfire/random_maps/treasure.c Thu Apr 6 14:18:35 2006
***************
*** 1,6 ****
/*
* static char *rcsid_treasure_c =
! * "$Id: treasure.c,v 1.26 2006/03/18 17:15:25 ryo_saeba Exp $";
*/
/*
--- 1,6 ----
/*
* static char *rcsid_treasure_c =
! * "$Id: treasure.c,v 1.27 2006/04/06 21:18:35 tchize Exp $";
*/
/*
***************
*** 176,182 ****
object *the_chest;
int i,xl,yl;
! the_chest = get_archetype("chest"); /* was "chest_2" */
/* first, find a place to put the chest. */
i = find_first_free_spot(the_chest,map,x,y);
--- 176,182 ----
object *the_chest;
int i,xl,yl;
! the_chest = create_archetype("chest"); /* was "chest_2" */
/* first, find a place to put the chest. */
i = find_first_free_spot(the_chest,map,x,y);
***************
*** 290,296 ****
object *the_key;
/* get a key and set its keycode */
! the_key = get_archetype("key2");
the_key->slaying = add_string(keycode);
--- 290,296 ----
object *the_key;
/* get a key and set its keycode */
! the_key = create_archetype("key2");
the_key->slaying = add_string(keycode);
***************
*** 596,602 ****
if(!wall_blocked(map,x1,y1)
|| layout[x1][y1]=='>') {/* place a door */
! object * new_door=get_archetype( (freearr_x[i]==0)?doors[1]:doors[0]);
new_door->x = x + freearr_x[i];
new_door->y = y + freearr_y[i];
remove_monsters(new_door->x,new_door->y,map);
--- 596,602 ----
if(!wall_blocked(map,x1,y1)
|| layout[x1][y1]=='>') {/* place a door */
! object * new_door=create_archetype( (freearr_x[i]==0)?doors[1]:doors[0]);
new_door->x = x + freearr_x[i];
new_door->y = y + freearr_y[i];
remove_monsters(new_door->x,new_door->y,map);
***************
*** 694,700 ****
if(opts & DOORED) {
for(i=0,door=doorlist[0];doorlist[i]!=NULL;i++) {
! object *new_door=get_archetype("locked_door1");
char keybuf[256];
door=doorlist[i];
new_door->face = door->face;
--- 694,700 ----
if(opts & DOORED) {
for(i=0,door=doorlist[0];doorlist[i]!=NULL;i++) {
! object *new_door=create_archetype("locked_door1");
char keybuf[256];
door=doorlist[i];
new_door->face = door->face;
Index: crossfire/server/alchemy.c
diff -c crossfire/server/alchemy.c:1.26 crossfire/server/alchemy.c:1.27
*** crossfire/server/alchemy.c:1.26 Fri Feb 10 15:59:27 2006
--- crossfire/server/alchemy.c Thu Apr 6 14:18:35 2006
***************
*** 1,6 ****
/*
* static char *rcsid_alchemy_c =
! * "$Id: alchemy.c,v 1.26 2006/02/10 23:59:27 akirschbaum Exp $";
*/
/*
--- 1,6 ----
/*
* static char *rcsid_alchemy_c =
! * "$Id: alchemy.c,v 1.27 2006/04/06 21:18:35 tchize Exp $";
*/
/*
***************
*** 414,420 ****
* allow players to create massive amounts of artifacts easily */
if(create_item && (!item || item->nrof > 1)) {
*rp_arch_index = RANDOM()%rp->arch_names;
! item = get_archetype(rp->arch_name[*rp_arch_index]);
}
#ifdef ALCHEMY_DEBUG
--- 414,420 ----
* allow players to create massive amounts of artifacts easily */
if(create_item && (!item || item->nrof > 1)) {
*rp_arch_index = RANDOM()%rp->arch_names;
! item = create_archetype(rp->arch_name[*rp_arch_index]);
}
#ifdef ALCHEMY_DEBUG
***************
*** 463,469 ****
material |= tmp->material;
tmp=tmp->below;
}
! tmp = get_archetype("rock");
tmp->weight=weight;
tmp->value=0;
tmp->material=material;
--- 463,469 ----
material |= tmp->material;
tmp=tmp->below;
}
! tmp = create_archetype("rock");
tmp->weight=weight;
tmp->value=0;
tmp->material=material;
***************
*** 531,537 ****
remove_contents(cauldron->inv,NULL);
switch(rndm(0, 2)) {
case 0:
! tmp=get_archetype("bomb");
tmp->stats.dam=random_roll(1, level, op, PREFER_LOW);
tmp->stats.hp=random_roll(1, level, op, PREFER_LOW);
new_draw_info_format(NDI_UNIQUE,0,op,"The %s creates a bomb!",
--- 531,537 ----
remove_contents(cauldron->inv,NULL);
switch(rndm(0, 2)) {
case 0:
! tmp=create_archetype("bomb");
tmp->stats.dam=random_roll(1, level, op, PREFER_LOW);
tmp->stats.hp=random_roll(1, level, op, PREFER_LOW);
new_draw_info_format(NDI_UNIQUE,0,op,"The %s creates a bomb!",
***************
*** 539,545 ****
break;
default:
! tmp=get_archetype("fireball");
tmp->stats.dam=random_roll(1, level, op, PREFER_LOW)/5+1;
tmp->stats.hp=random_roll(1, level, op, PREFER_LOW)/10+2;
new_draw_info_format(NDI_UNIQUE,0,op,"The %s erupts in flame!",
--- 539,545 ----
break;
default:
! tmp=create_archetype("fireball");
tmp->stats.dam=random_roll(1, level, op, PREFER_LOW)/5+1;
tmp->stats.hp=random_roll(1, level, op, PREFER_LOW)/10+2;
new_draw_info_format(NDI_UNIQUE,0,op,"The %s erupts in flame!",
***************
*** 556,562 ****
remove_contents(cauldron->inv,NULL);
return;
} else if (level<80) { /* MAJOR FIRE */
! object *fb = get_archetype(SP_MED_FIREBALL);
remove_contents(cauldron->inv,NULL);
fire_arch_from_position(cauldron, cauldron,cauldron->x, cauldron->y,
0, fb);
--- 556,562 ----
remove_contents(cauldron->inv,NULL);
return;
} else if (level<80) { /* MAJOR FIRE */
! object *fb = create_archetype(SP_MED_FIREBALL);
remove_contents(cauldron->inv,NULL);
fire_arch_from_position(cauldron, cauldron,cauldron->x, cauldron->y,
0, fb);
***************
*** 606,612 ****
* to be made (rather than only those on the given
* formulalist) */
if(!rp) rp=get_random_recipe((recipelist *) NULL);
! if(rp && (tmp=get_archetype(rp->arch_name[RANDOM()%rp->arch_names]))) {
generate_artifact(tmp,random_roll(1, op->level/2+1, op, PREFER_HIGH)+1);
if((tmp=insert_ob_in_ob(tmp,cauldron))) {
remove_contents(cauldron->inv,tmp);
--- 606,612 ----
* to be made (rather than only those on the given
* formulalist) */
if(!rp) rp=get_random_recipe((recipelist *) NULL);
! if(rp && (tmp=create_archetype(rp->arch_name[RANDOM()%rp->arch_names]))) {
generate_artifact(tmp,random_roll(1, op->level/2+1, op, PREFER_HIGH)+1);
if((tmp=insert_ob_in_ob(tmp,cauldron))) {
remove_contents(cauldron->inv,tmp);
***************
*** 616,622 ****
}
return;
} else { /* MANA STORM - watch out!! */
! object *tmp = get_archetype(LOOSE_MANA);
new_draw_info(NDI_UNIQUE,0,op,"You unwisely release potent forces!");
remove_contents (cauldron->inv,NULL);
cast_magic_storm(op,tmp, level);
--- 616,622 ----
}
return;
} else { /* MANA STORM - watch out!! */
! object *tmp = create_archetype(LOOSE_MANA);
new_draw_info(NDI_UNIQUE,0,op,"You unwisely release potent forces!");
remove_contents (cauldron->inv,NULL);
cast_magic_storm(op,tmp, level);
Index: crossfire/server/apply.c
diff -c crossfire/server/apply.c:1.165 crossfire/server/apply.c:1.166
*** crossfire/server/apply.c:1.165 Sat Mar 18 07:05:36 2006
--- crossfire/server/apply.c Thu Apr 6 14:18:35 2006
***************
*** 1,6 ****
/*
* static char *rcsid_apply_c =
! * "$Id: apply.c,v 1.165 2006/03/18 15:05:36 ryo_saeba Exp $";
*/
/*
CrossFire, A Multiplayer game for X-windows
--- 1,6 ----
/*
* static char *rcsid_apply_c =
! * "$Id: apply.c,v 1.166 2006/04/06 21:18:35 tchize Exp $";
*/
/*
CrossFire, A Multiplayer game for X-windows
***************
*** 314,320 ****
yield = get_ob_key_value(tmp,"on_use_yield");
if (yield != NULL)
{
! object* drop = get_archetype(yield);
if (tmp->env)
{
drop = insert_ob_in_ob(drop,tmp->env);
--- 314,320 ----
yield = get_ob_key_value(tmp,"on_use_yield");
if (yield != NULL)
{
! object* drop = create_archetype(yield);
if (tmp->env)
{
drop = insert_ob_in_ob(drop,tmp->env);
***************
*** 446,452 ****
new_draw_info(NDI_UNIQUE,0,op, "Yech! Your lungs are on fire!");
/* Explodes a fireball centered at player */
! fball = get_archetype(EXPLODING_FIREBALL);
fball->dam_modifier=random_roll(1, op->level, op, PREFER_LOW)/5+1;
fball->stats.maxhp=random_roll(1, op->level, op, PREFER_LOW)/10+2;
fball->x = op->x;
--- 446,452 ----
new_draw_info(NDI_UNIQUE,0,op, "Yech! Your lungs are on fire!");
/* Explodes a fireball centered at player */
! fball = create_archetype(EXPLODING_FIREBALL);
fball->dam_modifier=random_roll(1, op->level, op, PREFER_LOW)/5+1;
fball->stats.maxhp=random_roll(1, op->level, op, PREFER_LOW)/10+2;
fball->x = op->x;
***************
*** 465,471 ****
force=NULL;
for (i=0; i<NROFATTACKS; i++) {
if (tmp->resist[i]) {
! if (!force) force=get_archetype(FORCE_NAME);
memcpy(force->resist, tmp->resist, sizeof(tmp->resist));
force->type=POTION_EFFECT;
break; /* Only need to find one protection since we copy entire batch */
--- 465,471 ----
force=NULL;
for (i=0; i<NROFATTACKS; i++) {
if (tmp->resist[i]) {
! if (!force) force=create_archetype(FORCE_NAME);
memcpy(force->resist, tmp->resist, sizeof(tmp->resist));
force->type=POTION_EFFECT;
break; /* Only need to find one protection since we copy entire batch */
***************
*** 1632,1638 ****
new_draw_info_format(NDI_UNIQUE, 0, originator, "The %s seems to be broken!", query_name(trap));
! op = get_archetype("burnout");
if (op != NULL) {
op->x = trap->x;
op->y = trap->y;
--- 1632,1638 ----
new_draw_info_format(NDI_UNIQUE, 0, originator, "The %s seems to be broken!", query_name(trap));
! op = create_archetype("burnout");
if (op != NULL) {
op->x = trap->x;
op->y = trap->y;
***************
*** 2440,2447 ****
* A valid 2 way exit means:
* -You can come back (there is another exit at the other side)
* -You are
! * ° the owner of the exit
! * ° or in the same party as the owner
*
* Note: a owner in a 2 way exit is saved as the owner's name
* in the field exit->name cause the field exit->owner doesn't
--- 2440,2447 ----
* A valid 2 way exit means:
* -You can come back (there is another exit at the other side)
* -You are
! * the owner of the exit
! * or in the same party as the owner
*
* Note: a owner in a 2 way exit is saved as the owner's name
* in the field exit->name cause the field exit->owner doesn't
***************
*** 3698,3704 ****
int i, did_one=0;
sint8 k;
! force = get_archetype(FORCE_NAME);
for (i=0; i < NUM_STATS; i++) {
k = get_attr_value(&food->stats, i);
--- 3698,3704 ----
int i, did_one=0;
sint8 k;
! force = create_archetype(FORCE_NAME);
for (i=0; i < NUM_STATS; i++) {
k = get_attr_value(&food->stats, i);
***************
*** 3840,3846 ****
object *tmp;
new_draw_info(NDI_UNIQUE, 0,op,"Your spell warps!.");
! tmp=get_archetype(SPELL_WONDER);
cast_wonder(op, op, 0, tmp);
free_object(tmp);
} else if (failure <= -15&&failure > -35) {/* drain mana */
--- 3840,3846 ----
object *tmp;
new_draw_info(NDI_UNIQUE, 0,op,"Your spell warps!.");
! tmp=create_archetype(SPELL_WONDER);
cast_wonder(op, op, 0, tmp);
free_object(tmp);
} else if (failure <= -15&&failure > -35) {/* drain mana */
***************
*** 3860,3866 ****
blind_player(op,op,power);
} else if (failure <= -80) {/* blast the immediate area */
object *tmp;
! tmp=get_archetype(LOOSE_MANA);
cast_magic_storm(op,tmp, power);
new_draw_info(NDI_UNIQUE, 0,op,"You unlease uncontrolled mana!");
free_object(tmp);
--- 3860,3866 ----
blind_player(op,op,power);
} else if (failure <= -80) {/* blast the immediate area */
object *tmp;
! tmp=create_archetype(LOOSE_MANA);
cast_magic_storm(op,tmp, power);
new_draw_info(NDI_UNIQUE, 0,op,"You unlease uncontrolled mana!");
free_object(tmp);
***************
*** 4017,4023 ****
got[len] = '\0';
/* Now create new item, remove used ones when required. */
! new_item = get_archetype( got );
if ( !new_item )
{
new_draw_info_format( NDI_UNIQUE, 0, pl, "This %s is strange, better to not use it.", query_base_name( marked, 0 ) );
--- 4017,4023 ----
got[len] = '\0';
/* Now create new item, remove used ones when required. */
! new_item = create_archetype( got );
if ( !new_item )
{
new_draw_info_format( NDI_UNIQUE, 0, pl, "This %s is strange, better to not use it.", query_base_name( marked, 0 ) );
Index: crossfire/server/attack.c
diff -c crossfire/server/attack.c:1.122 crossfire/server/attack.c:1.123
*** crossfire/server/attack.c:1.122 Sat Mar 18 07:05:37 2006
--- crossfire/server/attack.c Thu Apr 6 14:18:35 2006
***************
*** 1,6 ****
/*
* static char *rcsid_attack_c =
! * "$Id: attack.c,v 1.122 2006/03/18 15:05:37 ryo_saeba Exp $";
*/
/*
CrossFire, A Multiplayer game for X-windows
--- 1,6 ----
/*
* static char *rcsid_attack_c =
! * "$Id: attack.c,v 1.123 2006/04/06 21:18:35 tchize Exp $";
*/
/*
CrossFire, A Multiplayer game for X-windows
***************
*** 171,177 ****
op = decrease_ob_nr (op, 1);
if (op)
fix_stopped_item (op, m, originator);
! if((op = get_archetype(arch))!=NULL) {
if(env) {
op->x=env->x,op->y=env->y;
insert_ob_in_ob(op,env);
--- 171,177 ----
op = decrease_ob_nr (op, 1);
if (op)
fix_stopped_item (op, m, originator);
! if((op = create_archetype(arch))!=NULL) {
if(env) {
op->x=env->x,op->y=env->y;
insert_ob_in_ob(op,env);
***************
*** 207,213 ****
}
if(type&(AT_FIRE|AT_ELECTRICITY)) {
if(env) {
! op=get_archetype("burnout");
op->x=env->x,op->y=env->y;
insert_ob_in_ob(op,env);
} else {
--- 207,213 ----
}
if(type&(AT_FIRE|AT_ELECTRICITY)) {
if(env) {
! op=create_archetype("burnout");
op->x=env->x,op->y=env->y;
insert_ob_in_ob(op,env);
} else {
***************
*** 1984,1990 ****
tmp = present_in_ob_by_name(FORCE,"confusion", op);
if(!tmp) {
! tmp = get_archetype(FORCE_NAME);
tmp = insert_ob_in_ob(tmp,op);
}
--- 1984,1990 ----
tmp = present_in_ob_by_name(FORCE,"confusion", op);
if(!tmp) {
! tmp = create_archetype(FORCE_NAME);
tmp = insert_ob_in_ob(tmp,op);
}
***************
*** 2014,2020 ****
tmp = present_in_ob(BLINDNESS,op);
if(!tmp) {
! tmp = get_archetype("blindness");
SET_FLAG(tmp, FLAG_BLIND);
SET_FLAG(tmp, FLAG_APPLIED);
/* use floats so we don't lose too much precision due to rounding errors.
--- 2014,2020 ----
tmp = present_in_ob(BLINDNESS,op);
if(!tmp) {
! tmp = create_archetype("blindness");
SET_FLAG(tmp, FLAG_BLIND);
SET_FLAG(tmp, FLAG_APPLIED);
/* use floats so we don't lose too much precision due to rounding errors.
Index: crossfire/server/build_map.c
diff -c crossfire/server/build_map.c:1.10 crossfire/server/build_map.c:1.11
*** crossfire/server/build_map.c:1.10 Sat Nov 5 13:32:17 2005
--- crossfire/server/build_map.c Thu Apr 6 14:18:35 2006
***************
*** 1,6 ****
/*
* static char *rcsid_build_map =
! * "$Id: build_map.c,v 1.10 2005/11/05 21:32:17 ryo_saeba Exp $";
*/
/*
CrossFire, A Multiplayer game for X-windows
--- 1,6 ----
/*
* static char *rcsid_build_map =
! * "$Id: build_map.c,v 1.11 2006/04/06 21:18:35 tchize Exp $";
*/
/*
CrossFire, A Multiplayer game for X-windows
***************
*** 157,163 ****
return -1;
}
! force = get_archetype( FORCE_NAME );
force->speed = 0;
update_ob_speed( force );
force->slaying = add_string( pl->map->path );
--- 157,163 ----
return -1;
}
! force = create_archetype( FORCE_NAME );
force->speed = 0;
update_ob_speed( force );
force->slaying = add_string( pl->map->path );
Index: crossfire/server/disease.c
diff -c crossfire/server/disease.c:1.34 crossfire/server/disease.c:1.35
*** crossfire/server/disease.c:1.34 Wed Nov 16 00:16:08 2005
--- crossfire/server/disease.c Thu Apr 6 14:18:35 2006
***************
*** 1,6 ****
/*
* static char *rcsid_disease_c =
! * "$Id: disease.c,v 1.34 2005/11/16 08:16:08 mwedel Exp $";
*/
/*
CrossFire, A Multiplayer game for X-windows
--- 1,6 ----
/*
* static char *rcsid_disease_c =
! * "$Id: disease.c,v 1.35 2006/04/06 21:18:35 tchize Exp $";
*/
/*
CrossFire, A Multiplayer game for X-windows
***************
*** 401,407 ****
return 0; /*Immune! */
}
! new_symptom = get_archetype(ARCH_SYMPTOM);
/* Something special done with dam. We want diseases to be more
* random in what they'll kill, so we'll make the damage they
--- 401,407 ----
return 0; /*Immune! */
}
! new_symptom = create_archetype(ARCH_SYMPTOM);
/* Something special done with dam. We want diseases to be more
* random in what they'll kill, so we'll make the damage they
***************
*** 500,506 ****
return 1; /* just update the existing immunity. */
}
}
! immunity = get_archetype("immunity");
immunity->name = add_string(disease->name);
immunity->level = disease->level;
immunity->move_block = 0;
--- 500,506 ----
return 1; /* just update the existing immunity. */
}
}
! immunity = create_archetype("immunity");
immunity->name = add_string(disease->name);
immunity->level = disease->level;
immunity->move_block = 0;
Index: crossfire/server/gods.c
diff -c crossfire/server/gods.c:1.58 crossfire/server/gods.c:1.59
*** crossfire/server/gods.c:1.58 Sat Jan 7 10:56:51 2006
--- crossfire/server/gods.c Thu Apr 6 14:18:35 2006
***************
*** 1,6 ****
/*
* static char *rcsid_gods_c =
! * "$Id: gods.c,v 1.58 2006/01/07 18:56:51 akirschbaum Exp $";
*/
/*
--- 1,6 ----
/*
* static char *rcsid_gods_c =
! * "$Id: gods.c,v 1.59 2006/04/06 21:18:35 tchize Exp $";
*/
/*
***************
*** 297,303 ****
angry=3;
new_draw_info_format(NDI_UNIQUE|NDI_NAVY,0,pl,
"Foul Priest! %s punishes you!",pl_god->name);
! tmp=get_archetype(LOOSE_MANA);
cast_magic_storm(pl,tmp, pl_god->level+20);
} else
new_draw_info_format(NDI_UNIQUE|NDI_NAVY,0,pl,
--- 297,303 ----
angry=3;
new_draw_info_format(NDI_UNIQUE|NDI_NAVY,0,pl,
"Foul Priest! %s punishes you!",pl_god->name);
! tmp=create_archetype(LOOSE_MANA);
cast_magic_storm(pl,tmp, pl_god->level+20);
} else
new_draw_info_format(NDI_UNIQUE|NDI_NAVY,0,pl,
***************
*** 437,443 ****
new_draw_info_format(NDI_UNIQUE|NDI_NAVY,0,op,"Fool! %s detests your kind!",
new_god->name);
if(random_roll(0, op->level-1, op, PREFER_LOW)-5>0) {
! object *tmp = get_archetype(LOOSE_MANA);
cast_magic_storm(op,tmp, new_god->level+10);
}
return;
--- 437,443 ----
new_draw_info_format(NDI_UNIQUE|NDI_NAVY,0,op,"Fool! %s detests your kind!",
new_god->name);
if(random_roll(0, op->level-1, op, PREFER_LOW)-5>0) {
! object *tmp = create_archetype(LOOSE_MANA);
cast_magic_storm(op,tmp, new_god->level+10);
}
return;
***************
*** 798,804 ****
/* Follower lacks the required grace for the following
* treasure list items. */
! tmp = get_archetype(HOLY_POSSESSION);
cast_change_ability(op, op, tmp, 0, 1);
free_object(tmp);
return;
--- 798,804 ----
/* Follower lacks the required grace for the following
* treasure list items. */
! tmp = create_archetype(HOLY_POSSESSION);
cast_change_ability(op, op, tmp, 0, 1);
free_object(tmp);
return;
***************
*** 851,857 ****
object *tmp;
int success;
! tmp = get_archetype_by_object_name(item->slaying);
success = cast_heal (op, op, tmp, 0);
free_object(tmp);
--- 851,857 ----
object *tmp;
int success;
! tmp = create_archetype_by_object_name(item->slaying);
success = cast_heal (op, op, tmp, 0);
free_object(tmp);
***************
*** 990,996 ****
change_exp(op, -random_roll(0, loss*angry-1, op, PREFER_LOW),
skop?skop->skill:"none", SK_SUBTRACT_SKILL_EXP);
if(random_roll(0, angry, op, PREFER_LOW)) {
! object *tmp = get_archetype(LOOSE_MANA);
cast_magic_storm(op,tmp,op->level+(angry*3));
}
new_draw_info_format(NDI_UNIQUE|NDI_NAVY,0,op,
--- 990,996 ----
change_exp(op, -random_roll(0, loss*angry-1, op, PREFER_LOW),
skop?skop->skill:"none", SK_SUBTRACT_SKILL_EXP);
if(random_roll(0, angry, op, PREFER_LOW)) {
! object *tmp = create_archetype(LOOSE_MANA);
cast_magic_storm(op,tmp,op->level+(angry*3));
}
new_draw_info_format(NDI_UNIQUE|NDI_NAVY,0,op,
Index: crossfire/server/player.c
diff -c crossfire/server/player.c:1.195 crossfire/server/player.c:1.196
*** crossfire/server/player.c:1.195 Sat Mar 18 07:05:37 2006
--- crossfire/server/player.c Thu Apr 6 14:18:35 2006
***************
*** 1,6 ****
/*
* static char *rcsid_player_c =
! * "$Id: player.c,v 1.195 2006/03/18 15:05:37 ryo_saeba Exp $";
*/
/*
--- 1,6 ----
/*
* static char *rcsid_player_c =
! * "$Id: player.c,v 1.196 2006/04/06 21:18:35 tchize Exp $";
*/
/*
***************
*** 2886,2892 ****
object *force;
int at;
! force=get_archetype(FORCE_NAME);
/* 50 ticks should be enough time for the spell to abate */
force->speed=0.1;
force->speed_left=-5.0;
--- 2886,2892 ----
object *force;
int at;
! force=create_archetype(FORCE_NAME);
/* 50 ticks should be enough time for the spell to abate */
force->speed=0.1;
force->speed_left=-5.0;
Index: crossfire/server/plugins.c
diff -c crossfire/server/plugins.c:1.69 crossfire/server/plugins.c:1.70
*** crossfire/server/plugins.c:1.69 Sat Mar 18 08:27:15 2006
--- crossfire/server/plugins.c Thu Apr 6 14:18:35 2006
***************
*** 1,6 ****
/*
* static char *rcsid_plugins_c =
! * "$Id: plugins.c,v 1.69 2006/03/18 16:27:15 ryo_saeba Exp $";
*/
/*****************************************************************************/
--- 1,6 ----
/*
* static char *rcsid_plugins_c =
! * "$Id: plugins.c,v 1.70 2006/04/06 21:18:35 tchize Exp $";
*/
/*****************************************************************************/
***************
*** 2693,2704 ****
object* op;
sval = va_arg(args, char*);
! op = get_archetype_by_object_name(sval);
if (strncmp(query_name(op), ARCH_SINGULARITY, ARCH_SINGULARITY_LEN) == 0) {
free_object(op);
/* Try with archetype names... */
! op = get_archetype(sval);
if (strncmp(query_name(op), ARCH_SINGULARITY, ARCH_SINGULARITY_LEN) == 0) {
free_object(op);
*type = CFAPI_NONE;
--- 2693,2704 ----
object* op;
sval = va_arg(args, char*);
! op = create_archetype_by_object_name(sval);
if (strncmp(query_name(op), ARCH_SINGULARITY, ARCH_SINGULARITY_LEN) == 0) {
free_object(op);
/* Try with archetype names... */
! op = create_archetype(sval);
if (strncmp(query_name(op), ARCH_SINGULARITY, ARCH_SINGULARITY_LEN) == 0) {
free_object(op);
*type = CFAPI_NONE;
Index: crossfire/server/rune.c
diff -c crossfire/server/rune.c:1.45 crossfire/server/rune.c:1.46
*** crossfire/server/rune.c:1.45 Tue Nov 1 02:08:17 2005
--- crossfire/server/rune.c Thu Apr 6 14:18:36 2006
***************
*** 1,6 ****
/*
* static char *rcsid_rune_c =
! * "$Id: rune.c,v 1.45 2005/11/01 10:08:17 akirschbaum Exp $";
*/
/*
--- 1,6 ----
/*
* static char *rcsid_rune_c =
! * "$Id: rune.c,v 1.46 2006/04/06 21:18:36 tchize Exp $";
*/
/*
***************
*** 136,142 ****
if (rune_spell->type == RUNE) {
rune = rune_spell;
} else {
! rune = get_archetype(GENERIC_RUNE);
sprintf(buf,"You set off a rune of %s\n",rune_spell->name);
rune->msg=add_string(buf);
tmp = get_object();
--- 136,142 ----
if (rune_spell->type == RUNE) {
rune = rune_spell;
} else {
! rune = create_archetype(GENERIC_RUNE);
sprintf(buf,"You set off a rune of %s\n",rune_spell->name);
rune->msg=add_string(buf);
tmp = get_object();
***************
*** 372,378 ****
object *tmp2;
if(where==NULL) return 0;
! tmp2=get_archetype("runedet");
tmp2->face=&new_faces[GET_ANIMATION(trap, 0)];
tmp2->x=where->x;tmp2->y=where->y;tmp2->map=where->map;
insert_ob_in_map(tmp2,where->map,NULL,0);
--- 372,378 ----
object *tmp2;
if(where==NULL) return 0;
! tmp2=create_archetype("runedet");
tmp2->face=&new_faces[GET_ANIMATION(trap, 0)];
tmp2->x=where->x;tmp2->y=where->y;tmp2->map=where->map;
insert_ob_in_map(tmp2,where->map,NULL,0);
Index: crossfire/server/spell_util.c
diff -c crossfire/server/spell_util.c:1.103 crossfire/server/spell_util.c:1.104
*** crossfire/server/spell_util.c:1.103 Mon Jan 9 11:35:13 2006
--- crossfire/server/spell_util.c Thu Apr 6 14:18:36 2006
***************
*** 1,6 ****
/*
* static char *rcsid_spell_util_c =
! * "$Id: spell_util.c,v 1.103 2006/01/09 19:35:13 cavesomething Exp $";
*/
--- 1,6 ----
/*
* static char *rcsid_spell_util_c =
! * "$Id: spell_util.c,v 1.104 2006/04/06 21:18:36 tchize Exp $";
*/
***************
*** 722,728 ****
insert_ob_in_map(head,op->map,op,0);
/* thought it'd be cool to insert a burnout, too.*/
! tmp=get_archetype("burnout");
tmp->map = op->map;
tmp->x=op->x+freearr_x[dir];
tmp->y=op->y+freearr_y[dir];
--- 722,728 ----
insert_ob_in_map(head,op->map,op,0);
/* thought it'd be cool to insert a burnout, too.*/
! tmp=create_archetype("burnout");
tmp->map = op->map;
tmp->x=op->x+freearr_x[dir];
tmp->y=op->y+freearr_y[dir];
***************
*** 829,835 ****
if(failure<= -20 && failure > -40) /* wonder */
{
new_draw_info_format(NDI_UNIQUE, 0,op,"%s gives a sign to renew your faith.",godname);
! tmp = get_archetype(SPELL_WONDER);
cast_cone(op,op,0,tmp);
free_object(tmp);
}
--- 829,835 ----
if(failure<= -20 && failure > -40) /* wonder */
{
new_draw_info_format(NDI_UNIQUE, 0,op,"%s gives a sign to renew your faith.",godname);
! tmp = create_archetype(SPELL_WONDER);
cast_cone(op,op,0,tmp);
free_object(tmp);
}
***************
*** 847,853 ****
}
else if (failure <= -150) /* blast the immediate area */
{
! tmp = get_archetype(GOD_POWER);
new_draw_info_format(NDI_UNIQUE, 0,op,"%s smites you!",godname);
cast_magic_storm(op,tmp, power);
}
--- 847,853 ----
}
else if (failure <= -150) /* blast the immediate area */
{
! tmp = create_archetype(GOD_POWER);
new_draw_info_format(NDI_UNIQUE, 0,op,"%s smites you!",godname);
cast_magic_storm(op,tmp, power);
}
***************
*** 872,878 ****
if (failure<=-20 && failure > -40) /* wonder */
{
new_draw_info(NDI_UNIQUE, 0,op,"Your spell causes an unexpected effect.");
! tmp = get_archetype(SPELL_WONDER);
cast_cone(op,op,0,tmp);
free_object(tmp);
}
--- 872,878 ----
if (failure<=-20 && failure > -40) /* wonder */
{
new_draw_info(NDI_UNIQUE, 0,op,"Your spell causes an unexpected effect.");
! tmp = create_archetype(SPELL_WONDER);
cast_cone(op,op,0,tmp);
free_object(tmp);
}
***************
*** 897,903 ****
} else {
new_draw_info(NDI_UNIQUE, 0,op,"You lose control of the mana! The uncontrolled magic blasts you!");
! tmp=get_archetype(LOOSE_MANA);
tmp->level=skill->level;
tmp->x=op->x;
tmp->y=op->y;
--- 897,903 ----
} else {
new_draw_info(NDI_UNIQUE, 0,op,"You lose control of the mana! The uncontrolled magic blasts you!");
! tmp=create_archetype(LOOSE_MANA);
tmp->level=skill->level;
tmp->x=op->x;
tmp->y=op->y;
Index: crossfire/server/time.c
diff -c crossfire/server/time.c:1.87 crossfire/server/time.c:1.88
*** crossfire/server/time.c:1.87 Sat Mar 18 07:05:37 2006
--- crossfire/server/time.c Thu Apr 6 14:18:36 2006
***************
*** 1,6 ****
/*
* static char *rcsid_time_c =
! * "$Id: time.c,v 1.87 2006/03/18 15:05:37 ryo_saeba Exp $";
*/
/*
--- 1,6 ----
/*
* static char *rcsid_time_c =
! * "$Id: time.c,v 1.88 2006/04/06 21:18:36 tchize Exp $";
*/
/*
***************
*** 1176,1182 ****
/* if we didn't find our own MARK */
if(tmp2==NULL) {
! object *force = get_archetype(FORCE_NAME);
force->speed = 0;
if(op->stats.food) {
--- 1176,1182 ----
/* if we didn't find our own MARK */
if(tmp2==NULL) {
! object *force = create_archetype(FORCE_NAME);
force->speed = 0;
if(op->stats.food) {
Index: crossfire/test/unit/common/Makefile.am
diff -c crossfire/test/unit/common/Makefile.am:1.1 crossfire/test/unit/common/Makefile.am:1.2
*** crossfire/test/unit/common/Makefile.am:1.1 Tue Mar 21 14:46:08 2006
--- crossfire/test/unit/common/Makefile.am Thu Apr 6 14:18:36 2006
***************
*** 2,8 ****
noinst_LIBRARIES = libstubs.a
libstubs_a_SOURCES=stubs_common.c
INCLUDES = -I../../../include -I../../include
! AM_CPPFLAGS = -DRESSOURCES=\"$(srcdir)/../../resources\" -DLOGDIR=\"$(srcdir)/../../logs\"
LDADD = ../../../common/libcross.a libstubs.a $(LIBDL) @CHECK_LIBS@
../../logs/unit/common:
--- 2,8 ----
noinst_LIBRARIES = libstubs.a
libstubs_a_SOURCES=stubs_common.c
INCLUDES = -I../../../include -I../../include
! AM_CPPFLAGS = -DRESSOURCES=\"$(srcdir)/../../resources\" -DLOGDIR=\"$(srcdir)/../../logs\" -DSOURCE_ROOT=\"$(srcdir)/../../../\"
LDADD = ../../../common/libcross.a libstubs.a $(LIBDL) @CHECK_LIBS@
../../logs/unit/common:
Index: crossfire/test/unit/common/Makefile.in
diff -c crossfire/test/unit/common/Makefile.in:1.2 crossfire/test/unit/common/Makefile.in:1.3
*** crossfire/test/unit/common/Makefile.in:1.2 Wed Mar 22 15:06:48 2006
--- crossfire/test/unit/common/Makefile.in Thu Apr 6 14:18:36 2006
***************
*** 360,366 ****
noinst_LIBRARIES = libstubs.a
libstubs_a_SOURCES = stubs_common.c
INCLUDES = -I../../../include -I../../include
! AM_CPPFLAGS = -DRESSOURCES=\"$(srcdir)/../../resources\" -DLOGDIR=\"$(srcdir)/../../logs\"
LDADD = ../../../common/libcross.a libstubs.a $(LIBDL) @CHECK_LIBS@
TESTS = check_anim check_arch check_button check_exp check_friend check_glue check_holy check_image check_info check_init check_item check_links check_living check_loader check_logger check_los check_map check_object check_path check_player check_porting check_quest check_readable check_recipe check_re-cmp check_region check_shstr check_time check_treasure check_utils
all: $(BUILT_SOURCES)
--- 360,366 ----
noinst_LIBRARIES = libstubs.a
libstubs_a_SOURCES = stubs_common.c
INCLUDES = -I../../../include -I../../include
! AM_CPPFLAGS = -DRESSOURCES=\"$(srcdir)/../../resources\" -DLOGDIR=\"$(srcdir)/../../logs\" -DSOURCE_ROOT=\"$(srcdir)/../../../\"
LDADD = ../../../common/libcross.a libstubs.a $(LIBDL) @CHECK_LIBS@
TESTS = check_anim check_arch check_button check_exp check_friend check_glue check_holy check_image check_info check_init check_item check_links check_living check_loader check_logger check_los check_map check_object check_path check_player check_porting check_quest check_readable check_recipe check_re-cmp check_region check_shstr check_time check_treasure check_utils
all: $(BUILT_SOURCES)
|