version 1.51 | | version 1.52 |
---|
| | |
/* | | /* |
* static char *rcsid_c_object_c = | | * static char *rcsid_c_object_c = |
* "$Id: c_object.c,v 1.51 2003/09/03 13:42:19 tchize Exp $"; | | * "$Id: c_object.c,v 1.52 2003/09/13 05:02:08 mwedel Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
*/ | | */ |
| | |
int command_build (object *pl, char *params) { | | int command_build (object *pl, char *params) { |
| | return 0; |
| | #if 0 |
object *marked, *facility, *tool, *newobj, *tmp; | | object *marked, *facility, *tool, *newobj, *tmp; |
archetype *at; | | archetype *at; |
int skillnr, obpow, number, bonus, mneed, nrof, magic, i, nummade, found; | | int skillnr, obpow, number, bonus, mneed, nrof, magic, i, nummade, found; |
| | |
materialtype_t *mt; | | materialtype_t *mt; |
| | |
/* NOTE THIS FUNCTION IS CURRENTLY DISABLED */ | | /* NOTE THIS FUNCTION IS CURRENTLY DISABLED */ |
return 0; | | |
| | |
| | /* Given this is currently disabled, I'm not going to bother updating |
| | * it with the new skill system. IT really needs to get the skill object |
| | * pointer in a better fashion than it is currently doing. |
| | */ |
if (!params) { | | if (!params) { |
new_draw_info(NDI_UNIQUE, 0, pl, "Usage:build [nr] [+magic] <object>"); | | new_draw_info(NDI_UNIQUE, 0, pl, "Usage:build [nr] [+magic] <object>"); |
return 0; | | return 0; |
| | |
return 0; | | return 0; |
} | | } |
| | |
if (!change_skill(pl, skillnr)) { | | if (!change_skill(pl, skillnr, 0)) { |
new_draw_info(NDI_UNIQUE, 0, pl, | | new_draw_info(NDI_UNIQUE, 0, pl, |
"You lack the needed skill to make that item."); | | "You lack the needed skill to make that item."); |
return 0; | | return 0; |
| | |
if (skills[skillnr].category != EXP_NONE) | | if (skills[skillnr].category != EXP_NONE) |
add_exp(pl, obpow*nummade); | | add_exp(pl, obpow*nummade); |
return 1; | | return 1; |
| | #endif |
} | | } |
| | |
| | |
| | |
} | | } |
| | |
int command_rskill ( object *pl, char *params) { | | int command_rskill ( object *pl, char *params) { |
int skillno; | | object *skill; |
| | |
if (!params) { | | if (!params) { |
new_draw_info(NDI_UNIQUE, 0, pl, "Usage: ready_skill <skill name>"); | | new_draw_info(NDI_UNIQUE, 0, pl, "Usage: ready_skill <skill name>"); |
return 0; | | return 0; |
} | | } |
skillno=lookup_skill_by_name(params); | | skill = find_skill_by_name(pl, params); |
if (skillno==-1) { | | |
new_draw_info_format(NDI_UNIQUE, 0, pl, "Couldn't find the skill %s", params); | | if (!skill) { |
| | new_draw_info_format(NDI_UNIQUE, 0, pl, "You have no knowledge of the skill %s", params); |
return 0; | | return 0; |
} | | } |
return change_skill(pl,skillno); | | return change_skill(pl,skill, 0); |
| | } |
| | |
| | |
| | /* These functions (command_search, command_disarm) are really juse wrappers for |
| | * things like 'use_skill ...'). In fact, they should really be obsoleted |
| | * and replaced with those. |
| | */ |
| | int command_search (object *op, char *params) { |
| | return command_uskill(op, skill_names[SK_FIND_TRAPS]); |
| | } |
| | |
| | int command_disarm (object *op, char *params) { |
| | return command_uskill(op, skill_names[SK_DISARM_TRAPS]); |
| | } |
| | |
| | |
| | /* A little special because we do want to pass the full params along |
| | * as it includes the object to throw. |
| | */ |
| | int command_throw (object *op, char *params) |
| | { |
| | object *skop; |
| | |
| | skop = find_skill_by_name(op, skill_names[SK_THROWING]); |
| | if (skop) return do_skill(op, op, skop, op->facing,params); |
| | else { |
| | new_draw_info(NDI_UNIQUE, 0, op, "You have no knowledge of the skill throwing."); |
| | } |
| | return 0; |
} | | } |
| | |
| | |
int command_apply (object *op, char *params) | | int command_apply (object *op, char *params) |
{ | | { |
if (!params) { | | if (!params) { |
| | |
| | |
switch(tmp->type) { | | switch(tmp->type) { |
case SPELLBOOK: | | case SPELLBOOK: |
if(QUERY_FLAG(tmp, FLAG_IDENTIFIED) && tmp->stats.sp >= 0 && tmp->stats.sp <= NROFREALSPELLS ) { | | if(QUERY_FLAG(tmp, FLAG_IDENTIFIED) && tmp->inv ) { |
if(!strcmp(tmp->arch->name,"cleric_book")) | | sprintf(buf,"%s is a %d level %s spell", |
sprintf(buf,"%s is a %d level prayer.", | | tmp->inv->name, tmp->inv->level, |
spells[tmp->stats.sp].name,spells[tmp->stats.sp].level); | | tmp->inv->skill); |
else | | |
sprintf(buf,"%s is a %d level spell.", | | |
spells[tmp->stats.sp].name,spells[tmp->stats.sp].level); | | |
} | | } |
break; | | break; |
| | |
| | |
/* Now let's find the new name */ | | /* Now let's find the new name */ |
if(!strncmp(params,"to ",3)) { | | if(!strncmp(params,"to ",3)) { |
params+=3; | | params+=3; |
while(' '==params) params++; | | while(' '==*params) params++; |
if('<'!=*params) { | | if('<'!=*params) { |
new_draw_info(NDI_UNIQUE,0,op,"Syntax error, expecting < at start of new name!"); | | new_draw_info(NDI_UNIQUE,0,op,"Syntax error, expecting < at start of new name!"); |
return 1; | | return 1; |