-+-+-+-+-+-+-+-+ START OF PART 11 -+-+-+-+-+-+-+-+ Xregister inven_type *i_ptr; Xint pref; X`7B X /* base name, modifier string*/ X register char *basenm, *modstr; X bigvtype tmp_val; X vtype tmp_str, damstr; X int indexx, p1_use, modify, append_name, tmp; X X indexx = i_ptr->subval & (ITEM_SINGLE_STACK_MIN - 1); X basenm = object_list`5Bi_ptr->index`5D.name; X modstr = CNIL; X damstr`5B0`5D = '\0'; X p1_use = IGNORED; X modify = (known1_p(i_ptr) ? FALSE : TRUE); X append_name = FALSE; X switch(i_ptr->tval) X `7B X case TV_MISC: X case TV_CHEST: X break; X case TV_SLING_AMMO: X case TV_BOLT: X case TV_ARROW: X (void) sprintf(damstr, " (%dd%d)", i_ptr->damage`5B0`5D, i_ptr->damage V`5B1`5D); X break; X case TV_LIGHT: X p1_use = LIGHT; X break; X case TV_SPIKE: X break; X case TV_BOW: X if (i_ptr->p1 == 1 `7C`7C i_ptr->p1 == 2) X`09tmp = 2; X else if (i_ptr->p1 == 3 `7C`7C i_ptr->p1 == 5) X`09tmp = 3; X else if (i_ptr->p1 == 4 `7C`7C i_ptr->p1 == 6) X`09tmp = 4; X else X`09tmp = -1; X (void) sprintf (damstr, " (x%d)", tmp); X break; X case TV_HAFTED: X case TV_POLEARM: X case TV_SWORD: X (void) sprintf(damstr, " (%dd%d)", i_ptr->damage`5B0`5D, i_ptr->damage V`5B1`5D); X p1_use = FLAGS; X break; X case TV_DIGGING: X p1_use = Z_PLUSSES; X (void) sprintf(damstr, " (%dd%d)", i_ptr->damage`5B0`5D, i_ptr->damage V`5B1`5D); X break; X case TV_BOOTS: X case TV_GLOVES: X case TV_CLOAK: X case TV_HELM: X case TV_SHIELD: X case TV_HARD_ARMOR: X case TV_SOFT_ARMOR: X break; X case TV_AMULET: X if (modify) X`09`7B X`09 basenm = "& %s Amulet"; X`09 modstr = amulets`5Bindexx`5D; X`09`7D X else X`09`7B X`09 basenm = "& Amulet"; X`09 append_name = TRUE; X`09`7D X p1_use = PLUSSES; X break; X case TV_RING: X if (modify) X`09`7B X`09 basenm = "& %s Ring"; X`09 modstr = rocks`5Bindexx`5D; X`09`7D X else X`09`7B X`09 basenm = "& Ring"; X`09 append_name = TRUE; X`09`7D X p1_use = PLUSSES; X break; X case TV_STAFF: X if (modify) X`09`7B X`09 basenm = "& %s Staff"; X`09 modstr = woods`5Bindexx`5D; X`09`7D X else X`09`7B X`09 basenm = "& Staff"; X`09 append_name = TRUE; X`09`7D X p1_use = CHARGES; X break; X case TV_WAND: X if (modify) X`09`7B X`09 basenm = "& %s Wand"; X`09 modstr = metals`5Bindexx`5D; X`09`7D X else X`09`7B X`09 basenm = "& Wand"; X`09 append_name = TRUE; X`09`7D X p1_use = CHARGES; X break; X case TV_SCROLL1: X case TV_SCROLL2: X if (modify) X`09`7B X`09 basenm = "& Scroll`7E titled \"%s\""; X`09 modstr = titles`5Bindexx`5D; X`09`7D X else X`09`7B X`09 basenm = "& Scroll`7E"; X`09 append_name = TRUE; X`09`7D X break; X case TV_POTION1: X case TV_POTION2: X if (modify) X`09`7B X`09 basenm = "& %s Potion`7E"; X`09 modstr = colors`5Bindexx`5D; X`09`7D X else X`09`7B X`09 basenm = "& Potion`7E"; X`09 append_name = TRUE; X`09`7D X break; X case TV_FLASK: X break; X case TV_FOOD: X if (modify) X`09`7B X`09 if (indexx <= 15) X`09 basenm = "& %s Mushroom`7E"; X`09 else if (indexx <= 20) X`09 basenm = "& Hairy %s Mold`7E"; X`09 if (indexx <= 20) X`09 modstr = mushrooms`5Bindexx`5D; X`09`7D X else X`09`7B X`09 append_name = TRUE; X`09 if (indexx <= 15) X`09 basenm = "& Mushroom`7E"; X`09 else if (indexx <= 20) X`09 basenm = "& Hairy Mold`7E"; X`09 else X`09 /* Ordinary food does not have a name appended. */ X`09 append_name = FALSE; X`09`7D X break; X case TV_MAGIC_BOOK: X modstr = basenm; X basenm = "& Book`7E of Magic Spells %s"; X break; X case TV_PRAYER_BOOK: X modstr = basenm; X basenm = "& Holy Book`7E of Prayers %s"; X break; X case TV_OPEN_DOOR: X case TV_CLOSED_DOOR: X case TV_SECRET_DOOR: X case TV_RUBBLE: X break; X case TV_GOLD: X case TV_INVIS_TRAP: X case TV_VIS_TRAP: X case TV_UP_STAIR: X case TV_DOWN_STAIR: X (void) strcpy(out_val, object_list`5Bi_ptr->index`5D.name); X (void) strcat(out_val, "."); X return; X case TV_STORE_DOOR: X (void) sprintf(out_val, "the entrance to the %s.", X`09`09 object_list`5Bi_ptr->index`5D.name); X return; X default: X (void) strcpy(out_val, "Error in objdes()"); X return; X `7D X if (modstr != CNIL) X (void) sprintf(tmp_val, basenm, modstr); X else X (void) strcpy(tmp_val, basenm); X if (append_name) X `7B X (void) strcat(tmp_val, " of "); X (void) strcat(tmp_val, object_list`5Bi_ptr->index`5D.name); X `7D X if (i_ptr->number != 1) X `7B X insert_str(tmp_val, "ch`7E", "ches"); X insert_str(tmp_val, "`7E", "s"); X `7D X else X insert_str(tmp_val, "`7E", CNIL); X if (!pref) X `7B X if (!strncmp("some", tmp_val, 4)) X`09(void) strcpy(out_val, &tmp_val`5B5`5D); X else if (tmp_val`5B0`5D == '&') X`09/* eliminate the '& ' at the beginning */ X`09(void) strcpy(out_val, &tmp_val`5B2`5D); X else X`09(void) strcpy(out_val, tmp_val); X `7D X else X `7B X if (i_ptr->name2 != SN_NULL && known2_p(i_ptr)) X`09`7B X`09 (void) strcat(tmp_val, " "); X`09 (void) strcat(tmp_val, special_names`5Bi_ptr->name2`5D); X`09`7D X if (damstr`5B0`5D != '\0') X`09(void) strcat(tmp_val, damstr); X if (known2_p(i_ptr)) X`09`7B X`09 /* originally used %+d, but several machines don't support it */ X`09 if (i_ptr->ident & ID_SHOW_HITDAM) X`09 (void) sprintf(tmp_str, " (%c%d,%c%d)", X`09`09`09 (i_ptr->tohit < 0) ? '-' : '+', abs(i_ptr->tohit), X`09`09`09 (i_ptr->todam < 0) ? '-' : '+', abs(i_ptr->todam)); X`09 else if (i_ptr->tohit != 0) X`09 (void) sprintf(tmp_str, " (%c%d)", X`09`09`09 (i_ptr->tohit < 0) ? '-' : '+', abs(i_ptr->tohit)); X`09 else if (i_ptr->todam != 0) X`09 (void) sprintf(tmp_str, " (%c%d)", X`09`09`09 (i_ptr->todam < 0) ? '-' : '+', abs(i_ptr->todam)); X`09 else X`09 tmp_str`5B0`5D = '\0'; X`09 (void) strcat(tmp_val, tmp_str); X`09`7D X /* Crowns have a zero base AC, so make a special test for them. */ X if (i_ptr->ac != 0 `7C`7C (i_ptr->tval == TV_HELM)) X`09`7B X`09 (void) sprintf(tmp_str, " `5B%d", i_ptr->ac); X`09 (void) strcat(tmp_val, tmp_str); X`09 if (known2_p(i_ptr)) X`09 `7B X`09 /* originally used %+d, but several machines don't support it */ X`09 (void) sprintf(tmp_str, ",%c%d", X`09`09`09 (i_ptr->toac < 0) ? '-' : '+', abs(i_ptr->toac)); X`09 (void) strcat(tmp_val, tmp_str); X`09 `7D X`09 (void) strcat(tmp_val, "`5D"); X`09`7D X else if ((i_ptr->toac != 0) && known2_p(i_ptr)) X`09`7B X`09 /* originally used %+d, but several machines don't support it */ X`09 (void) sprintf(tmp_str, " `5B%c%d`5D", X`09`09`09 (i_ptr->toac < 0) ? '-' : '+', abs(i_ptr->toac)); X`09 (void) strcat(tmp_val, tmp_str); X`09`7D X X /* override defaults, check for p1 flags in the ident field */ X if (i_ptr->ident & ID_NOSHOW_P1) X`09p1_use = IGNORED; X else if (i_ptr->ident & ID_SHOW_P1) X`09p1_use = Z_PLUSSES; X tmp_str`5B0`5D = '\0'; X if (p1_use == LIGHT) X`09(void) sprintf(tmp_str, " with %d turns of light", i_ptr->p1); X else if (p1_use == IGNORED) X`09; X else if (known2_p(i_ptr)) X`09`7B X`09 if (p1_use == Z_PLUSSES) X`09 /* originally used %+d, but several machines don't support it */ X`09 (void) sprintf(tmp_str, " (%c%d)", X`09`09`09 (i_ptr->p1 < 0) ? '-' : '+', abs(i_ptr->p1)); X`09 else if (p1_use == CHARGES) X`09 (void) sprintf(tmp_str, " (%d charges)", i_ptr->p1); X`09 else if (i_ptr->p1 != 0) X`09 `7B X`09 if (p1_use == PLUSSES) X`09 (void) sprintf(tmp_str, " (%c%d)", X`09`09`09 (i_ptr->p1 < 0) ? '-' : '+', abs(i_ptr->p1)); X`09 else if (p1_use == FLAGS) X`09`09`7B X`09`09 if (i_ptr->flags & TR_STR) X`09`09 (void) sprintf(tmp_str, " (%c%d to STR)", X`09`09`09`09 (i_ptr->p1 < 0) ? '-' : '+',abs(i_ptr->p1)); X`09`09 else if (i_ptr->flags & TR_STEALTH) X`09`09 (void) sprintf(tmp_str, " (%c%d to stealth)", X`09`09`09`09 (i_ptr->p1 < 0) ? '-' : '+',abs(i_ptr->p1)); X`09`09`7D X`09 `7D X`09`7D X (void) strcat(tmp_val, tmp_str); X X /* ampersand is always the first character */ X if (tmp_val`5B0`5D == '&') X`09`7B X`09 /* use &tmp_val`5B1`5D, so that & does not appear in output */ X`09 if (i_ptr->number > 1) X`09 (void) sprintf(out_val, "%d%s", (int)i_ptr->number, &tmp_val`5B1`5D); X`09 else if (i_ptr->number < 1) X`09 (void) sprintf(out_val, "%s%s", "no more", &tmp_val`5B1`5D); X`09 else if (is_a_vowel(tmp_val`5B2`5D)) X`09 (void) sprintf(out_val, "an%s", &tmp_val`5B1`5D); X`09 else X`09 (void) sprintf(out_val, "a%s", &tmp_val`5B1`5D); X`09`7D X /* handle 'no more' case specially */ X else if (i_ptr->number < 1) X`09`7B X`09 /* check for "some" at start */ X`09 if (!strncmp("some", tmp_val, 4)) X`09 (void) sprintf(out_val, "no more %s", &tmp_val`5B5`5D); X`09 /* here if no article */ X`09 else X`09 (void) sprintf(out_val, "no more %s", tmp_val); X`09`7D X else X`09(void) strcpy(out_val, tmp_val); X X tmp_str`5B0`5D = '\0'; X if ((indexx = object_offset(i_ptr)) >= 0) X`09`7B X`09 indexx = (indexx <<= 6) + X`09 (i_ptr->subval & (ITEM_SINGLE_STACK_MIN - 1)); X`09 /* don't print tried string for store bought items */ X`09 if ((object_ident`5Bindexx`5D & OD_TRIED) && !store_bought_p(i_ptr)) X`09 (void) strcat(tmp_str, "tried "); X`09`7D X if (i_ptr->ident & (ID_MAGIK`7CID_EMPTY`7CID_DAMD)) X`09`7B X`09 if (i_ptr->ident & ID_MAGIK) X`09 (void) strcat(tmp_str, "magik "); X`09 if (i_ptr->ident & ID_EMPTY) X`09 (void) strcat(tmp_str, "empty "); X`09 if (i_ptr->ident & ID_DAMD) X`09 (void) strcat(tmp_str, "damned "); X`09`7D X if (i_ptr->inscrip`5B0`5D != '\0') X`09(void) strcat(tmp_str, i_ptr->inscrip); X else if ((indexx = strlen(tmp_str)) > 0) X`09 /* remove the extra blank at the end */ X`09 tmp_str`5Bindexx-1`5D = '\0'; X if (tmp_str`5B0`5D) X`09`7B X`09 (void) sprintf(tmp_val, " `7B%s`7D", tmp_str); X`09 (void) strcat(out_val, tmp_val); X`09`7D X (void) strcat(out_val, "."); X `7D X`7D X Xvoid invcopy(to, from_index) Xregister inven_type *to; Xint from_index; X`7B X register treasure_type *from; X X from = &object_list`5Bfrom_index`5D; X to->index`09= from_index; X to->name2 = SN_NULL; X to->inscrip`5B0`5D = '\0'; X to->flags = from->flags; X to->tval = from->tval; X to->tchar = from->tchar; X to->p1 = from->p1; X to->cost`09= from->cost; X to->subval = from->subval; X to->number = from->number; X to->weight = from->weight; X to->tohit = from->tohit; X to->todam = from->todam; X to->ac = from->ac; X to->toac = from->toac; X to->damage`5B0`5D = from->damage`5B0`5D; X to->damage`5B1`5D = from->damage`5B1`5D; X to->level = from->level; X to->ident`09= 0; X`7D X X X/* Describe number of remaining charges.`09`09-RAK-`09*/ Xvoid desc_charges(item_val) Xint item_val; X`7B X register int rem_num; X vtype out_val; X X if (known2_p(&inventory`5Bitem_val`5D)) X `7B X rem_num = inventory`5Bitem_val`5D.p1; X (void) sprintf(out_val, "You have %d charges remaining.", rem_num); X msg_print(out_val); X `7D X`7D X X X/* Describe amount of item remaining.`09`09`09-RAK-`09*/ Xvoid desc_remain(item_val) Xint item_val; X`7B X bigvtype out_val, tmp_str; X register inven_type *i_ptr; X X i_ptr = &inventory`5Bitem_val`5D; X i_ptr->number--; X objdes(tmp_str, i_ptr, TRUE); X i_ptr->number++; X /* the string already has a dot at the end. */ X (void) sprintf(out_val, "You have %s", tmp_str); X msg_print(out_val); X`7D $ CALL UNPACK DESC.C;1 190475389 $ create 'f' XMORIA.EXE : MAIN.OBJ, CREATE.OBJ, CREATURE.OBJ, DEATH.OBJ, - X DESC.OBJ, DUNGEON.OBJ, EAT.OBJ, FILES.OBJ, GENERATE.OBJ, - X GETCH.OBJ, HELP.OBJ, IO.OBJ, MAGIC.OBJ, MAIN.OBJ, MISC1.OBJ, - X MISC2.OBJ, MISC3.OBJ, MISC4.OBJ, MONSTERS.OBJ, MORIA1.OBJ, - X MORIA2.OBJ, MORIA3.OBJ, MORIA4.OBJ, PLAYER.OBJ, - X POTIONS.OBJ, PRAYER.OBJ, RECALL.OBJ, RND.OBJ, SAVE.OBJ, SCROLLS.OBJ, - X SETS.OBJ, SIGNALS.OBJ, SPELLS.OBJ, STAFFS.OBJ, STORE1.OBJ, - X STORE2.OBJ, TABLES.OBJ, TREASURE.OBJ, UEXIT.OBJ, - X VARIABLE.OBJ, WANDS.OBJ, WIZARD.OBJ X - $(link) $(linkflags) MORIA.OPT/opt X Xcreate.obj : constant.h, types.h, externs.h, config.h Xcreature.obj : constant.h, types.h, externs.h, config.h Xdeath.obj : constant.h, types.h, externs.h, config.h Xdesc.obj : constant.h, types.h, externs.h, config.h Xdungeon.obj : constant.h, types.h, externs.h, config.h Xeat.obj : constant.h, types.h, externs.h, config.h Xfiles.obj : constant.h, types.h, externs.h, config.h Xgenerate.obj : constant.h, types.h, externs.h, config.h Xhelp.obj : constant.h, types.h, externs.h, config.h Xio.obj : constant.h, types.h, externs.h, config.h Xmagic.obj : constant.h, types.h, externs.h, config.h Xmain.obj : constant.h, types.h, externs.h, config.h Xmisc1.obj : constant.h, types.h, externs.h, config.h Xmisc2.obj : constant.h, types.h, externs.h, config.h Xmisc3.obj : constant.h, types.h, externs.h, config.h Xmisc4.obj : constant.h, types.h, externs.h, config.h Xmonsters.obj : constant.h, types.h, config.h Xmoria1.obj : constant.h, types.h, externs.h, config.h Xmoria2.obj : constant.h, types.h, externs.h, config.h Xmoria3.obj : constant.h, types.h, externs.h, config.h Xmoria4.obj : constant.h, types.h, externs.h, config.h Xplayer.obj : constant.h, types.h, config.h Xpotions.obj : constant.h, types.h, externs.h, config.h Xprayer.obj : constant.h, types.h, externs.h, config.h Xrecall.obj : constant.h, config.h, types.h, externs.h Xrnd.obj : constant.h, types.h Xsave.obj : constant.h, types.h, externs.h, config.h Xscrolls.obj : constant.h, types.h, externs.h, config.h Xsets.obj : constant.h, config.h Xsignals.obj : constant.h, types.h, externs.h, config.h Xspells.obj : constant.h, types.h, externs.h, config.h Xstaffs.obj : constant.h, types.h, externs.h, config.h Xstore1.obj : constant.h, types.h, externs.h, config.h +-+-+-+-+-+-+-+- END OF PART 11 +-+-+-+-+-+-+-+-