version 1.10 | | version 1.11 |
---|
| | |
/* | | /* |
* static char *rcsid_sock_info_c = | | * static char *rcsid_sock_info_c = |
* "$Id: info.c,v 1.10 2002/11/13 00:49:47 garbled Exp $"; | | * "$Id: info.c,v 1.11 2002/11/30 04:17:41 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
| | |
void rangetostring(object *pl,char *obuf) | | void rangetostring(object *pl,char *obuf) |
{ | | { |
int chosen_spell; | | |
| | |
chosen_spell = (pl->contr->shoottype==range_magic)? pl->contr->chosen_spell : | | |
pl->contr->chosen_item_spell; | | |
switch(pl->contr->shoottype) { | | switch(pl->contr->shoottype) { |
case range_none: | | case range_none: |
strcpy(obuf,"Range: nothing"); | | strcpy(obuf,"Range: nothing"); |
break; | | break; |
case range_bow: { | | |
char *s; | | case range_bow: |
| | { |
object *op; | | object *op; |
| | |
for (op = pl->inv; op; op=op->below) | | for (op = pl->inv; op; op=op->below) |
if (op->type == BOW && QUERY_FLAG (op, FLAG_APPLIED)) | | if (op->type == BOW && QUERY_FLAG (op, FLAG_APPLIED)) |
break; | | break; |
if(op==NULL) break; | | if(op==NULL) break; |
s = query_name(op); | | |
#if 1 /* Hack to remove (readied) from a bow description */ | | sprintf (obuf, "Range: %s (%s)", query_base_name(op, 0), |
if (strcmp (s + strlen (s) - 10, " (readied)") == 0) | | op->race ? op->race : "nothing"); |
s[strlen (s) - 10] = 0; | | |
#endif | | |
sprintf (obuf, "Range: %s (%s)", s, | | |
op && op->race ? op->race : "nothing"); | | |
} | | } |
break; | | break; |
| | |
case range_magic: | | case range_magic: |
if (settings.casting_time == TRUE) { | | if (settings.casting_time == TRUE) { |
if (pl->casting > -1) { | | if (pl->casting > -1) { |
| | |
| | |
case range_misc: | | case range_misc: |
sprintf(obuf,"Range: %s", | | sprintf(obuf,"Range: %s", |
pl->contr->ranges[range_misc]?query_base_name(pl->contr->ranges[range_misc],0): "none"); | | pl->contr->ranges[range_misc]? |
| | query_base_name(pl->contr->ranges[range_misc],0): "none"); |
break; | | break; |
| | |
/* range_scroll is only used for controlling golems. If the | | /* range_scroll is only used for controlling golems. If the |
| | |
strcpy(obuf,"Range: nothing"); | | strcpy(obuf,"Range: nothing"); |
} | | } |
break; | | break; |
| | |
case range_skill: | | case range_skill: |
sprintf(obuf,"Skill: %s", pl->chosen_skill!=NULL ? | | sprintf(obuf,"Skill: %s", pl->chosen_skill!=NULL ? |
skills[pl->chosen_skill->stats.sp].name : "none"); | | skills[pl->chosen_skill->stats.sp].name : "none"); |
break; | | break; |
| | |
default: | | default: |
strcpy(obuf,"Range: illegal"); | | strcpy(obuf,"Range: illegal"); |
} | | } |