games@tekred.TEK.COM (07/29/88)
Submitted by: "James E. Wilson" <wilson@ji.berkeley.edu> Comp.sources.games: Volume 5, Issue 47 Archive-name: umoria2/Part13 #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh <file", e.g.. If this archive is complete, you # will see the following message at the end: # "End of archive 13 (of 18)." # Contents: Int16bit.patch treasure2.c # Wrapped by billr@saab on Wed Jul 13 11:16:32 1988 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'Int16bit.patch' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Int16bit.patch'\" else echo shar: Extracting \"'Int16bit.patch'\" \(25036 characters\) sed "s/^X//" >'Int16bit.patch' <<'END_OF_FILE' X XThis is a first attempt to eliminate all 32 bit integer dependencies in umoria. XIt is not guaranteed to work, but should provide a good starting point for X16 bit OSes such as Xenix. X XJim Wilson Xwilson@ji.Berkeley.EDU X XFrom kneller@cgl.ucsf.EDU Sun Jun 26 18:46:23 1988 XReceived: from socrates.ucsf.EDU by ji.Berkeley.EDU (5.59/1.28) X id AA03277; Sun, 26 Jun 88 18:46:09 PDT XReceived: by socrates.ucsf.EDU (5.59/GSC4.6) X id AA00847; Sun, 26 Jun 88 18:44:13 PDT XDate: Sun, 26 Jun 88 18:44:13 PDT XFrom: kneller@cgl.ucsf.EDU XMessage-Id: <8806270144.AA00847@socrates.ucsf.EDU> XTo: wilson@ji.Berkeley.EDU XSubject: Oops, wrong diffs XStatus: RO X X XJim, X XThe diffs were the wrong sense. They can be used with "patch -R", but Xhere is a new set anyway. X X- don X X*** orig/config.h Thu Jun 9 14:51:01 1988 X--- config.h Sun Jun 26 18:16:58 1988 X*************** X*** 69,71 **** X--- 69,82 ---- X #define USG X #endif X #endif X+ X+ /* Detect 16-bit integers by wrapping of most positive int. */ X+ #if (32767 + 1) < 0 X+ /* # include "16.bit.integers" */ X+ #define INT16 X+ #define MAXINT 0x7FFF X+ #else X+ /* # include "32.bit.integers" */ X+ #define INT32 X+ #define MAXINT 10000000 /*0x7FFFFFFF*/ X+ #endif X*** orig/externs.h Thu May 26 18:51:44 1988 X--- externs.h Wed Jun 22 10:28:38 1988 X*************** X*** 1,7 **** X extern int character_generated; /* don't save score until char gen finished */ X extern int character_saved; /* prevents save on kill after save_char() */ X extern int highscore_fd; /* High score file descriptor */ X! extern int player_max_exp; /* Max exp possible */ X extern char norm_state[STATE_SIZE]; /* Contains seed # */ X extern char randes_state[STATE_SIZE]; X extern int randes_seed; /* For encoding colors */ X--- 1,7 ---- X extern int character_generated; /* don't save score until char gen finished */ X extern int character_saved; /* prevents save on kill after save_char() */ X extern int highscore_fd; /* High score file descriptor */ X! extern bigint_t player_max_exp; /* Max exp possible */ X extern char norm_state[STATE_SIZE]; /* Contains seed # */ X extern char randes_state[STATE_SIZE]; X extern int randes_seed; /* For encoding colors */ X*************** X*** 34,40 **** X extern int closing_flag; /* Used for closing */ X X /* Bit testing array */ X! extern unsigned int bit_array[32]; X X /* Following are calculated from max dungeon sizes */ X extern int max_panel_rows, max_panel_cols; X--- 34,40 ---- X extern int closing_flag; /* Used for closing */ X X /* Bit testing array */ X! extern bitset_t bit_array[32]; X X /* Following are calculated from max dungeon sizes */ X extern int max_panel_rows, max_panel_cols; X*************** X*** 60,66 **** X /* Following are player variables */ X extern player_type py; X extern btype player_title[MAX_CLASS][MAX_PLAYER_LEVEL]; X! extern int player_exp[MAX_PLAYER_LEVEL]; X extern double acc_exp; /* Accumulator for fractional exp*/ X extern dtype bare_hands; X extern int char_row; X--- 60,66 ---- X /* Following are player variables */ X extern player_type py; X extern btype player_title[MAX_CLASS][MAX_PLAYER_LEVEL]; X! extern bigint_t player_exp[MAX_PLAYER_LEVEL]; X extern double acc_exp; /* Accumulator for fractional exp*/ X extern dtype bare_hands; X extern int char_row; X*** orig/types.h Wed Jun 1 19:50:19 1988 X--- types.h Wed Jun 22 11:28:34 1988 X*************** X*** 1,3 **** X--- 1,5 ---- X+ typedef unsigned long bitset_t; X+ typedef long bigint_t; X typedef unsigned char byteint; X #ifdef NO_SIGNED_CHARS X typedef short bytlint; X*************** X*** 19,26 **** X typedef struct creature_type X { X ctype name; /* Descrip of creature */ X! unsigned int cmove; /* Bit field */ X! unsigned int spells; /* Creature spells */ X wordint cdefense; /* Bit field */ X worlint sleep; /* Inactive counter */ X wordint mexp; /* Exp value for kill */ X--- 21,28 ---- X typedef struct creature_type X { X ctype name; /* Descrip of creature */ X! bitset_t cmove; /* Bit field */ X! bitset_t spells; /* Creature spells */ X wordint cdefense; /* Bit field */ X worlint sleep; /* Inactive counter */ X wordint mexp; /* Exp value for kill */ X*************** X*** 54,60 **** X ttype name; /* Object name */ X byteint tval; /* Category number */ X char tchar; /* Character representation*/ X! unsigned int flags; /* Special flags */ X int p1; /* Misc. use variable */ X int cost; /* Cost of item */ X int subval; /* Sub-category number */ X--- 56,62 ---- X ttype name; /* Object name */ X byteint tval; /* Category number */ X char tchar; /* Character representation*/ X! bitset_t flags; /* Special flags */ X int p1; /* Misc. use variable */ X int cost; /* Cost of item */ X int subval; /* Sub-category number */ X*************** X*** 77,84 **** X vtype sex; /* Sex of character */ X vtype title; /* Character's title */ X vtype tclass; /* Character's class */ X! int max_exp; /* Max experience*/ X! int exp; /* Cur experience */ X int au; /* Gold */ X wordint age; /* Characters age*/ X wordint ht; /* Height */ X--- 79,86 ---- X vtype sex; /* Sex of character */ X vtype title; /* Character's title */ X vtype tclass; /* Character's class */ X! bigint_t max_exp; /* Max experience*/ X! bigint_t exp; /* Cur experience */ X int au; /* Gold */ X wordint age; /* Characters age*/ X wordint ht; /* Height */ X*************** X*** 128,134 **** X } stats; X struct flags X { X! unsigned int status; /* Status of player */ X int rest; /* Rest counter */ X int blind; /* Blindness counter */ X int paralysis; /* Paralysis counter */ X--- 130,136 ---- X } stats; X struct flags X { X! bitset_t status; /* Status of player */ X int rest; /* Rest counter */ X int blind; /* Blindness counter */ X int paralysis; /* Paralysis counter */ X*************** X*** 221,227 **** X bytlint bsav; /* Race base for saving throw */ X bytlint bhitdie; /* Base hit points for race */ X bytlint infra; /* See infra-red */ X! unsigned int tclass; /* Bit field for class types */ X } race_type; X X typedef struct class_type X--- 223,229 ---- X bytlint bsav; /* Race base for saving throw */ X bytlint bhitdie; /* Base hit points for race */ X bytlint infra; /* See infra-red */ X! bitset_t tclass; /* Bit field for class types */ X } race_type; X X typedef struct class_type X*** orig/creature.c Sat May 28 22:09:02 1988 X--- creature.c Sun Jun 26 17:37:30 1988 X*************** X*** 275,280 **** X--- 275,283 ---- X register struct flags *f_ptr; X register treasure_type *i_ptr; X char *string; X+ #ifdef INT16 X+ bigint_t m; X+ #endif X X m_ptr = &m_list[monptr]; X c_ptr = &c_list[m_ptr->mptr]; X*************** X*** 676,683 **** X--- 679,691 ---- X break; X case 19: /*Lose experience */ X msg_print("You feel your life draining away!"); X+ #ifdef INT16 X+ m = damroll(damstr) + (py.misc.exp / 100)*MON_DRAIN_LIFE; X+ lose_exp(m); X+ #else X i = damroll(damstr) + (py.misc.exp / 100)*MON_DRAIN_LIFE; X lose_exp(i); X+ #endif X break; X case 20: /*Aggravate monster*/ X (void) aggravate_monster(5); X*************** X*** 765,771 **** X int *mm; X { X int i, j, newy, newx; X! unsigned int movebits; X int flag, tflag; X int res; X register cave_type *c_ptr; X--- 773,779 ---- X int *mm; X { X int i, j, newy, newx; X! bitset_t movebits; X int flag, tflag; X int res; X register cave_type *c_ptr; X*************** X*** 980,986 **** X int monptr; X int *took_turn; X { X! unsigned int i; X int y, x; X register int k; X int chance, thrown_spell; X--- 988,994 ---- X int monptr; X int *took_turn; X { X! bitset_t i; X int y, x; X register int k; X int chance, thrown_spell; X*** orig/death.c Sat May 28 21:13:14 1988 X--- death.c Fri Jun 24 11:27:49 1988 X*************** X*** 174,180 **** X--- 174,184 ---- X (void) strcpy(str3, fill_str(py.misc.tclass)); X (void) sprintf(str4, "Level : %d", (int)py.misc.lev); X (void) strcpy(str4, fill_str(str4)); X+ #ifdef INT16 X+ (void) sprintf(str5, "%ld Exp", (long)py.misc.exp); X+ #else X (void) sprintf(str5, "%d Exp", py.misc.exp); X+ #endif X (void) strcpy(str5, fill_str(str5)); X (void) sprintf(str6, "%d Au", py.misc.au); X (void) strcpy(str6, fill_str(str6)); X*************** X*** 248,254 **** X X X /* Calculates the total number of points earned -JWT- */ X! int total_points() X { X return (py.misc.max_exp + (100 * py.misc.max_lev)); X } X--- 252,258 ---- X X X /* Calculates the total number of points earned -JWT- */ X! long total_points() X { X return (py.misc.max_exp + (100 * py.misc.max_lev)); X } X*************** X*** 275,281 **** X exit_game(); X } X X! myscore.points = (long)total_points(); X myscore.dun_level = dun_level; X myscore.lev = py.misc.lev; X myscore.max_lev = py.misc.max_lev; X--- 279,285 ---- X exit_game(); X } X X! myscore.points = total_points(); X myscore.dun_level = dun_level; X myscore.lev = py.misc.lev; X myscore.max_lev = py.misc.max_lev; X*** orig/eat.c Sat May 28 21:10:44 1988 X--- eat.c Tue Jun 21 16:54:53 1988 X*************** X*** 7,13 **** X /* Eat some food... -RAK- */ X eat() X { X! unsigned int i; X int j, k, item_val; X int redraw, ident; X register struct flags *f_ptr; X--- 7,13 ---- X /* Eat some food... -RAK- */ X eat() X { X! bitset_t i; X int j, k, item_val; X int redraw, ident; X register struct flags *f_ptr; X*** orig/files.c Sat May 28 21:13:53 1988 X--- files.c Sun Jun 26 17:22:19 1988 X*************** X*** 313,320 **** X--- 313,325 ---- X (void) strcpy(out_val, c_ptr->name); X (void) strcat(out_val, " "); X (void) fprintf(file1, "%d %s (%c)\n", i, out_val, c_ptr->cchar); X+ #ifdef INT16 X+ (void) fprintf(file1," Speed ==%d Level ==%d Exp ==%ld\n", X+ c_ptr->speed, c_ptr->level, (long) c_ptr->mexp); X+ #else X (void) fprintf(file1, " Speed ==%d Level ==%d Exp ==%d\n", X c_ptr->speed, c_ptr->level, (int)c_ptr->mexp); X+ #endif X (void) fprintf(file1, " AC ==%d Eye-sight ==%d HD ==%s\n", X c_ptr->ac, c_ptr->aaf, c_ptr->hd); X if (0x80000000 & c_ptr->cmove) X*************** X*** 674,680 **** X--- 679,689 ---- X (void) fprintf(file1, " Level :%6d", (int)py.misc.lev); X (void) fprintf(file1, " Max Hit Points :%6d\n", py.misc.mhp); X (void) fprintf(file1, " + To Damage :%6d", py.misc.dis_td); X+ #ifdef INT16 X+ (void) fprintf(file1, " Experience :%6ld", py.misc.exp); X+ #else X (void) fprintf(file1, " Experience :%6d", py.misc.exp); X+ #endif X (void) fprintf(file1, " Cur Hit Points :%6d\n", (int) (py.misc.chp)); X (void) fprintf(file1, " + To AC :%6d", py.misc.dis_tac); X (void) fprintf(file1, " Gold :%6d", py.misc.au); X*** orig/misc1.c Tue Jun 14 18:14:27 1988 X--- misc1.c Sun Jun 26 17:05:38 1988 X*************** X*** 207,214 **** X int mean; X int stand; X { X! return ((int)((sqrt(-2.0*log(randint((int)9999999)/10000000.0))* X! cos(6.283*(randint((int)9999999)/10000000.0))*stand) + mean)); X } X X X--- 207,215 ---- X int mean; X int stand; X { X! return (int) ((sqrt(-2.0 * log(randint(MAXINT - 1) / (double) MAXINT)) X! * cos(6.283 * (randint(MAXINT - 1) / (double) MAXINT)) * stand) X! + mean); X } X X X*************** X*** 215,226 **** X /* Returns position of first set bit -RAK- */ X /* and clears that bit */ X int bit_pos(test) X! unsigned int *test; X { X register int i; X register int mask = 0x1; X X! for (i = 0; i < sizeof(int)*8; i++) { X if (*test & mask) { X *test &= ~mask; X return(i); X--- 216,227 ---- X /* Returns position of first set bit -RAK- */ X /* and clears that bit */ X int bit_pos(test) X! bitset_t *test; X { X register int i; X register int mask = 0x1; X X! for (i = 0; i < sizeof(*test)*8; i++) { X if (*test & mask) { X *test &= ~mask; X return(i); X*** orig/misc2.c Mon Jun 6 16:28:36 1988 X--- misc2.c Sun Jun 26 18:18:43 1988 X*************** X*** 461,466 **** X--- 461,479 ---- X put_buffer(pad(info, " ", 13), row, column); X } X X+ #ifdef INT16 X+ /* Print long number with header at given row, column -RAK- */ X+ static void X+ prt_lnum(header, num, row, column) X+ vtype header; X+ long num; X+ int row, column; X+ { X+ vtype out_val; X+ (void) sprintf(out_val, "%s%6ld ", header, num); X+ put_buffer(out_val, row, column); X+ } X+ #endif X X /* Print number with header at given row, column -RAK- */ X prt_num(header, num, row, column) X*************** X*** 954,960 **** X--- 967,977 ---- X prt_stat("CON : ", s_ptr->ccon, 10, stat_column); X prt_stat("CHR : ", s_ptr->cchr, 11, stat_column); X prt_num( "LEV : ", (int)m_ptr->lev, 13, stat_column); X+ #ifdef INT16 X+ prt_lnum( "EXP : ", m_ptr->exp, 14, stat_column); X+ #else X prt_num( "EXP : ", m_ptr->exp, 14, stat_column); X+ #endif X prt_num( "MANA: ", (int)(m_ptr->cmana), 15, stat_column); X prt_num( "MHP : ", m_ptr->mhp, 16, stat_column); X prt_num( "CHP : ", (int)(m_ptr->chp), 17, stat_column); X*************** X*** 1063,1069 **** X--- 1080,1090 ---- X X m_ptr = &py.misc; X prt_num("Level : ", (int)m_ptr->lev, 9, 30); X+ #ifdef INT16 X+ prt_lnum("Experience : ", m_ptr->exp, 10, 30); X+ #else X prt_num("Experience : ", m_ptr->exp, 10, 30); X+ #endif X prt_num("Gold : ", m_ptr->au, 11, 30); X prt_num("Max Hit Points : ", m_ptr->mhp, 9, 53); X prt_num("Cur Hit Points : ", (int)m_ptr->chp, 10, 53); X*************** X*** 1440,1449 **** X int learn_spell(redraw) X int *redraw; X { X! unsigned int j; X register int i, k, new_spells; X int sn, sc; X! unsigned int spell_flag; X spl_type spell; X int learn; X register spell_type *s_ptr; X--- 1461,1470 ---- X int learn_spell(redraw) X int *redraw; X { X! bitset_t j; X register int i, k, new_spells; X int sn, sc; X! bitset_t spell_flag; X spl_type spell; X int learn; X register spell_type *s_ptr; X*************** X*** 1515,1521 **** X register int i, j, k, l; X int new_spell; X int test_array[32]; X! unsigned int spell_flag; X int learn; X register spell_type *s_ptr; X X--- 1536,1542 ---- X register int i, j, k, l; X int new_spell; X int test_array[32]; X! bitset_t int spell_flag; X int learn; X register spell_type *s_ptr; X X*************** X*** 1631,1637 **** X /* Increases hit points and level -RAK- */ X gain_level() X { X! int nhp, dif_exp, need_exp; X int redraw; X vtype out_val; X register struct misc *p_ptr; X--- 1652,1659 ---- X /* Increases hit points and level -RAK- */ X gain_level() X { X! int nhp; X! bigint_t dif_exp, need_exp; X int redraw; X vtype out_val; X register struct misc *p_ptr; X*************** X*** 1691,1697 **** X--- 1713,1723 ---- X if (p_ptr->exp > p_ptr->max_exp) X p_ptr->max_exp = p_ptr->exp; X } X+ #ifdef INT16 X+ prt_lnum("", py.misc.exp, 14, stat_column+6); X+ #else X prt_num("", py.misc.exp, 14, stat_column+6); X+ #endif X } X X X*** orig/moria1.c Tue Jun 14 17:49:33 1988 X--- moria1.c Wed Jun 22 10:42:52 1988 X*************** X*** 73,79 **** X treasure_type tobj; X int factor; X { X! register unsigned int item_flags; X int old_dis_ac; X register struct flags *p_ptr; X register struct misc *m_ptr; X--- 73,79 ---- X treasure_type tobj; X int factor; X { X! register bitset_t item_flags; X int old_dis_ac; X register struct flags *p_ptr; X register struct misc *m_ptr; X*** orig/moria2.c Tue Jun 14 17:49:31 1988 X--- moria2.c Wed Jun 22 10:46:25 1988 X*************** X*** 266,272 **** X int *sn, *sc; X int *redraw; X { X! unsigned int j; X register int i, k; X spl_type spell; X int cast; X--- 266,272 ---- X int *sn, *sc; X int *redraw; X { X! bitset_t j; X register int i, k; X spl_type spell; X int cast; X*************** X*** 336,342 **** X /* Examine a Book -RAK- */ X examine_book() X { X! unsigned int j; X int i, k, item_val; X int redraw, flag; X char dummy; X--- 336,342 ---- X /* Examine a Book -RAK- */ X examine_book() X { X! bitset_t j; X int i, k, item_val; X int redraw, flag; X char dummy; X*************** X*** 678,684 **** X /* based on flags set in the main creature record */ X monster_death(y, x, flags) X int y, x; X! register unsigned int flags; X { X register int i; X X--- 678,684 ---- X /* based on flags set in the main creature record */ X monster_death(y, x, flags) X int y, x; X! register bitset_t flags; X { X register int i; X X*** orig/potions.c Sat May 28 21:10:33 1988 X--- potions.c Sun Jun 26 17:38:44 1988 X*************** X*** 7,14 **** X /* Potions for the quaffing -RAK- */ X quaff() X { X! unsigned int i; X! int j, k, l, item_val; X int redraw, ident; X register treasure_type *i_ptr; X register struct misc *m_ptr; X--- 7,16 ---- X /* Potions for the quaffing -RAK- */ X quaff() X { X! bitset_t i; X! int j, k; X! bigint_t l; X! int item_val; X int redraw, ident; X register treasure_type *i_ptr; X register struct misc *m_ptr; X*************** X*** 254,262 **** X /* avoid randint(0) call */ X l = (py.misc.exp/5.0); X if (l == 0) X! lose_exp(1); X else X! lose_exp(randint(l)+l); X ident = TRUE; X break; X case 34: X--- 256,264 ---- X /* avoid randint(0) call */ X l = (py.misc.exp/5.0); X if (l == 0) X! lose_exp((bigint_t) 1); X else X! lose_exp((bigint_t) randint((int) l)+l); X ident = TRUE; X break; X case 34: X*************** X*** 359,365 **** X if (i_ptr->flags != 0) X { X m_ptr = &py.misc; X! m_ptr->exp += (int)(i_ptr->level/m_ptr->lev + 0.5); X prt_experience(); X } X add_food(i_ptr->p1); X--- 361,367 ---- X if (i_ptr->flags != 0) X { X m_ptr = &py.misc; X! m_ptr->exp += (bigint_t)(i_ptr->level/m_ptr->lev + 0.5); X prt_experience(); X } X add_food(i_ptr->p1); X*** orig/scrolls.c Sat May 28 21:10:31 1988 X--- scrolls.c Tue Jun 21 16:55:03 1988 X*************** X*** 15,21 **** X /* Scrolls for the reading -RAK- */ X read_scroll() X { X! unsigned int i; X int j, k, l, item_val; X int y, x; X int tmp[6]; X--- 15,21 ---- X /* Scrolls for the reading -RAK- */ X read_scroll() X { X! bitset_t i; X int j, k, l, item_val; X int y, x; X int tmp[6]; X*** orig/spells.c Tue Jun 14 17:49:28 1988 X--- spells.c Tue Jun 21 16:55:06 1988 X*************** X*** 687,693 **** X /* Return flags for given type area affect -RAK- */ X get_flags(typ, weapon_type, harm_type, destroy) X int typ; X! int *weapon_type, *harm_type; X int (**destroy)(); X { X int set_null(), set_fire_destroy(), set_frost_destroy(); X--- 687,694 ---- X /* Return flags for given type area affect -RAK- */ X get_flags(typ, weapon_type, harm_type, destroy) X int typ; X! bitset_t *weapon_type; X! int *harm_type; X int (**destroy)(); X { X int set_null(), set_fire_destroy(), set_frost_destroy(); X*************** X*** 739,745 **** X ctype bolt_typ; X { X int i, oldy, oldx, dist; X! int weapon_type, harm_type; X int flag; X int (*dummy)(); X register cave_type *c_ptr; X--- 740,747 ---- X ctype bolt_typ; X { X int i, oldy, oldx, dist; X! bitset_t weapon_type; X! int harm_type; X int flag; X int (*dummy)(); X register cave_type *c_ptr; X*************** X*** 834,840 **** X register int i, j; X int dam, max_dis, thit, tkill, k; X int oldy, oldx, dist; X! int weapon_type, harm_type; X int flag; X int (*destroy)(); X register cave_type *c_ptr; X--- 836,843 ---- X register int i, j; X int dam, max_dis, thit, tkill, k; X int oldy, oldx, dist; X! bitset_t weapon_type; X! int harm_type; X int flag; X int (*destroy)(); X register cave_type *c_ptr; X*************** X*** 979,985 **** X { X register int i, j; X int dam, max_dis; X! int weapon_type, harm_type; X int (*destroy)(); X register cave_type *c_ptr; X register monster_type *m_ptr; X--- 982,989 ---- X { X register int i, j; X int dam, max_dis; X! bitset_t weapon_type; X! int harm_type; X int (*destroy)(); X register cave_type *c_ptr; X register monster_type *m_ptr; X*************** X*** 2338,2344 **** X X /* Lose experience -RAK- */ X lose_exp(amount) X! int amount; X { X register int i, j; X int av_hp, lose_hp; X--- 2342,2348 ---- X X /* Lose experience -RAK- */ X lose_exp(amount) X! bigint_t amount; X { X register int i, j; X int av_hp, lose_hp; X*** orig/staffs.c Tue Jun 14 17:49:26 1988 X--- staffs.c Tue Jun 21 16:55:06 1988 X*************** X*** 7,13 **** X /* Use a staff... -RAK- */ X use() X { X! unsigned int i; X int j, k, item_val, chance; X int y, x; X int redraw, ident; X--- 7,13 ---- X /* Use a staff... -RAK- */ X use() X { X! bitset_t i; X int j, k, item_val, chance; X int y, x; X int redraw, ident; X*** orig/store2.c Tue Jun 14 17:49:38 1988 X--- store2.c Tue Jun 21 16:55:07 1988 X*************** X*** 959,965 **** X msg_print(out_val); X /* make sure player sees the message */ X msg_print(" "); X! if ((store_buy[store_num])(inventory[INVEN_MAX].tval)) X if (store_check_num(store_num)) X switch(sell_haggle(store_num, &price, inventory[INVEN_MAX])) X { X--- 959,965 ---- X msg_print(out_val); X /* make sure player sees the message */ X msg_print(" "); X! if ((*store_buy[store_num])(inventory[INVEN_MAX].tval)) X if (store_check_num(store_num)) X switch(sell_haggle(store_num, &price, inventory[INVEN_MAX])) X { X*** orig/variables.c Sat May 28 21:10:24 1988 X--- variables.c Wed Jun 22 11:02:36 1988 X*************** X*** 5,11 **** X int character_generated = 0; /* don't save score until char gen finished */ X int character_saved = 0; /* prevents save on kill after save_char() */ X int highscore_fd; /* File descriptor to high score file */ X! int player_max_exp; /* Max exp possible */ X char norm_state[STATE_SIZE]; /* normal seed */ X char randes_state[STATE_SIZE]; /* For encoding colors */ X int randes_seed; /* for restarting randes_state */ X--- 5,11 ---- X int character_generated = 0; /* don't save score until char gen finished */ X int character_saved = 0; /* prevents save on kill after save_char() */ X int highscore_fd; /* File descriptor to high score file */ X! bigint_t player_max_exp; /* Max exp possible */ X char norm_state[STATE_SIZE]; /* normal seed */ X char randes_state[STATE_SIZE]; /* For encoding colors */ X int randes_seed; /* for restarting randes_state */ X*************** X*** 51,57 **** X int closing_flag = 0; /* Used for closing */ X X /* Bit testing array */ X! unsigned int bit_array[32] = {0x00000001, 0x00000002, 0x00000004, 0x00000008, X 0x00000010, 0x00000020, 0x00000040, 0x00000080, X 0x00000100, 0x00000200, 0x00000400, 0x00000800, X 0x00001000, 0x00002000, 0x00004000, 0x00008000, X--- 51,57 ---- X int closing_flag = 0; /* Used for closing */ X X /* Bit testing array */ X! bitset_t bit_array[32] = {0x00000001, 0x00000002, 0x00000004, 0x00000008, X 0x00000010, 0x00000020, 0x00000040, 0x00000080, X 0x00000100, 0x00000200, 0x00000400, 0x00000800, X 0x00001000, 0x00002000, 0x00004000, 0x00008000, X*************** X*** 157,163 **** X }; X X /* Base experience levels, may be adjusted up for race and/or class*/ X! int player_exp[MAX_PLAYER_LEVEL] = { X 10, 25, 45, 70, 100, 140, 200, 280, 380, 500, X 650, 850, 1100, 1400, 1800, 2300, 2900, 3600, 4400, 5400, X 6800, 8400, 10200, 12500, 17500, 25000, 35000, 50000, 75000,100000, X--- 157,163 ---- X }; X X /* Base experience levels, may be adjusted up for race and/or class*/ X! bigint_t player_exp[MAX_PLAYER_LEVEL] = { X 10, 25, 45, 70, 100, 140, 200, 280, 380, 500, X 650, 850, 1100, 1400, 1800, 2300, 2900, 3600, 4400, 5400, X 6800, 8400, 10200, 12500, 17500, 25000, 35000, 50000, 75000,100000, X*** orig/wands.c Tue Jun 14 17:49:25 1988 X--- wands.c Tue Jun 21 16:55:10 1988 X*************** X*** 7,13 **** X /* Wands for the aiming... */ X aim() X { X! unsigned int i; X int j, k, l, chance; X int dir, item_val; X int dumy, y_dumy, x_dumy; X--- 7,13 ---- X /* Wands for the aiming... */ X aim() X { X! bitset_t i; X int j, k, l, chance; X int dir, item_val; X int dumy, y_dumy, x_dumy; X END_OF_FILE if test 25036 -ne `wc -c <'Int16bit.patch'`; then echo shar: \"'Int16bit.patch'\" unpacked with wrong size! fi # end of 'Int16bit.patch' fi if test -f 'treasure2.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'treasure2.c'\" else echo shar: Extracting \"'treasure2.c'\" \(28070 characters\) sed "s/^X//" >'treasure2.c' <<'END_OF_FILE' X#include "constants.h" X#include "config.h" X#include "types.h" X X/* Identified objects flags */ Xint object_ident[MAX_OBJECTS] = { X FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, X FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, X FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, X FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, X FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, X FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, X FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, X FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, X FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, X FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, X FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, X FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, X FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, X FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, X FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, X FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, X FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, X FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, X FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, X FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, X FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, X FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, X FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, X FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, X FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, X FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, X FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, X FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, X FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, X FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, X FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, X FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, X FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, X FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, X FALSE, FALSE, FALSE, FALSE X}; X Xint t_level[MAX_OBJ_LEVEL+1]; X X/* Gold list (All types of gold and gems are defined here) */ Xtreasure_type gold_list[MAX_GOLD] = { X{"copper" , 100, '$',0x00000000, X 0, 3, 1, 0, 1, 0, 0, 0, 0, "0d0" , 1}, X{"copper" , 100, '$',0x00000000, X 0, 4, 2, 0, 1, 0, 0, 0, 0, "0d0" , 1}, X{"copper" , 100, '$',0x00000000, X 0, 5, 3, 0, 1, 0, 0, 0, 0, "0d0" , 1}, X{"silver" , 100, '$',0x00000000, X 0, 6, 4, 0, 1, 0, 0, 0, 0, "0d0" , 1}, X{"silver" , 100, '$',0x00000000, X 0, 7, 5, 0, 1, 0, 0, 0, 0, "0d0" , 1}, X{"silver" , 100, '$',0x00000000, X 0, 8, 6, 0, 1, 0, 0, 0, 0, "0d0" , 1}, X{"garnets" , 100, '*',0x00000000, X 0, 9, 7, 0, 1, 0, 0, 0, 0, "0d0" , 1}, X{"garnets" , 100, '*',0x00000000, X 0, 10, 8, 0, 1, 0, 0, 0, 0, "0d0" , 1}, X{"gold" , 100, '$',0x00000000, X 0, 12, 9, 0, 1, 0, 0, 0, 0, "0d0" , 1}, X{"gold" , 100, '$',0x00000000, X 0, 14, 10, 0, 1, 0, 0, 0, 0, "0d0" , 1}, X{"gold" , 100, '$',0x00000000, X 0, 16, 11, 0, 1, 0, 0, 0, 0, "0d0" , 1}, X{"opals" , 100, '*',0x00000000, X 0, 18, 12, 0, 1, 0, 0, 0, 0, "0d0" , 1}, X{"sapphires" , 100, '*',0x00000000, X 0, 20, 13, 0, 1, 0, 0, 0, 0, "0d0" , 1}, X{"gold" , 100, '$',0x00000000, X 0, 24, 14, 0, 1, 0, 0, 0, 0, "0d0" , 1}, X{"rubies" , 100, '*',0x00000000, X 0, 28, 15, 0, 1, 0, 0, 0, 0, "0d0" , 1}, X{"diamonds" , 100, '*',0x00000000, X 0, 32, 16, 0, 1, 0, 0, 0, 0, "0d0" , 1}, X{"emeralds" , 100, '*',0x00000000, X 0, 40, 17, 0, 1, 0, 0, 0, 0, "0d0" , 1}, X{"mithril" , 100, '$',0x00000000, X 0, 80, 18, 0, 1, 0, 0, 0, 0, "0d0" , 1} X}; X Xtreasure_type t_list[MAX_TALLOC]; Xtreasure_type inventory[INVEN_ARRAY_SIZE]; X X/* Items which are sold in the stores are different from dungeon */ X/* items so that identify works properly. Note that the players */ X/* receive their initial items from this list, so position is */ X/* very important... */ Xtreasure_type inventory_init[INVEN_INIT_MAX] = { X{"& Ration~ of Food" , 80, ',',0x00000000, X 5000, 3, 307, 10, 5, 0, 0, 0, 0, "0d0" , 0}, /* 1*/ X{"& Hard Biscuit~" , 80, ',',0x00000000, X 500, 1, 309, 2, 5, 0, 0, 0, 0, "0d0" , 0}, /* 2*/ X{"& Strip~ of Beef Jerky" , 80, ',',0x00000000, X 1750, 2, 310, 2, 5, 0, 0, 0, 0, "0d0" , 0}, /* 3*/ X{"& Pint of Fine Ale" , 80, ',',0x00000000, X 500, 1, 311, 10, 3, 0, 0, 0, 0, "0d0" , 0}, /* 4*/ X{"& Pint of Fine Wine" , 80, ',',0x00000000, X 400, 2, 312, 10, 1, 0, 0, 0, 0, "0d0" , 0}, /* 5*/ X{"& Dagger (Misericorde) (%P2,%P3)" , 23, '|',0x00000000, X 0, 10, 2, 15, 1, 0, 0, 0, 0, "1d4" , 0}, /* 6*/ X{"& Dagger (Stiletto) (%P2,%P3)" , 23, '|',0x00000000, X 0, 10, 3, 12, 1, 0, 0, 0, 0, "1d4" , 0}, /* 7*/ X{"& Bastard Sword (%P2,%P3)" , 23, '|',0x00000000, X 0, 350, 7, 140, 1, 0, 0, 0, 0, "3d4" , 0}, /* 8*/ X{"& Broadsword (%P2,%P3)" , 23, '|',0x00000000, X 0, 255, 10, 150, 1, 0, 0, 0, 0, "2d5" , 0}, /* 9*/ X{"& Longsword (%P2,%P3)" , 23, '|',0x00000000, X 0, 300, 18, 130, 1, 0, 0, 0, 0, "1d10" , 0}, /* 10*/ X{"& Small Sword (%P2,%P3)" , 23, '|',0x00000000, X 0, 48, 22, 75, 1, 0, 0, 0, 0, "1d6" , 0}, /* 11*/ X{"& Broad Axe (%P2,%P3)" , 21, '\\',0x00000000, X 0, 304, 4, 160, 1, 0, 0, 0, 0, "2d5" , 0}, /* 12*/ X{"& Morningstar (%P2,%P3)" , 21, '\\',0x00000000, X 0, 396, 9, 150, 1, 0, 0, 0, 0, "2d6" , 0}, /* 13*/ X{"& Mace (%P2,%P3)" , 21, '\\',0x00000000, X 0, 130, 10, 120, 1, 0, 0, 0, 0, "2d4" , 0}, /* 14*/ X{"& War Hammer (%P2,%P3)" , 21, '\\',0x00000000, X 0, 225, 11, 120, 1, 0, 0, 0, 0, "3d3" , 0}, /* 15*/ X{"& Halberd (%P2,%P3)" , 22, '/',0x00000000, X 0, 430, 5, 190, 1, 0, 0, 0, 0, "3d4" , 0}, /* 16*/ X{"& Pike (%P2,%P3)" , 22, '/',0x00000000, X 0, 358, 7, 160, 1, 0, 0, 0, 0, "2d5" , 0}, /* 17*/ X{"& Spear (%P2,%P3)" , 22, '/',0x00000000, X 0, 36, 8, 50, 1, 0, 0, 0, 0, "1d6" , 0}, /* 18*/ X{"& Short Bow (%P2)" , 20, '}',0x00000000, X 2, 50, 1, 30, 1, 0, 0, 0, 0, "0d0" , 0}, /* 19*/ X{"& Long Bow (%P2)" , 20, '}',0x00000000, X 3, 120, 2, 40, 1, 0, 0, 0, 0, "0d0" , 0}, /* 20*/ X{"& Light Crossbow (%P2)" , 20, '}',0x00000000, X 5, 160, 10, 110, 1, 0, 0, 0, 0, "0d0" , 0}, /* 21*/ X{"& Sling (%P2)" , 20, '}',0x00000000, X 1, 5, 20, 5, 1, 0, 0, 0, 0, "0d0" , 0}, /* 22*/ X{"& Arrow~ (%P2,%P3)" , 12, '{',0x00000000, X 0, 1, 1, 2, 1, 0, 0, 0, 0, "1d4" , 0}, /* 23*/ X{"& Bolt~ (%P2,%P3)" , 11, '{',0x00000000, X 0, 2, 1, 3, 1, 0, 0, 0, 0, "1d5" , 0}, /* 24*/ X{"& Iron Shot~ (%P2,%P3)" , 10, '{',0x00000000, X 0, 2, 1, 5, 1, 0, 0, 0, 0, "1d3" , 0}, /* 25*/ X{"& Pick (%P1) (%P2,%P3)" , 25, '\\',0x20000000, X 1, 50, 1, 150, 1, 0, 0, 0, 0, "1d3" , 0}, /* 26*/ X{"& Shovel (%P1) (%P2,%P3)" , 25, '\\',0x20000000, X 0, 15, 2, 60, 1, 0, 0, 0, 0, "1d2" , 0}, /* 27*/ X{"& Pair of Soft Leather Boots [%P6,%P4]" , 30, ']',0x00000000, X 0, 7, 2, 30, 1, 0, 0, 2, 0, "1d1" , 0}, /* 28*/ X{"& Pair of Hard Leather Boots [%P6,%P4]" , 30, ']',0x00000000, X 0, 12, 3, 40, 1, 0, 0, 3, 0, "1d1" , 0}, /* 29*/ X{"& Hard Leather Cap [%P6,%P4]" , 33, ']',0x00000000, X 0, 12, 2, 15, 1, 0, 0, 2, 0, "0d0" , 0}, /* 30*/ X{"& Metal Cap [%P6,%P4]" , 33, ']',0x00000000, X 0, 30, 3, 20, 1, 0, 0, 3, 0, "1d1" , 0}, /* 31*/ X{"& Iron Helm [%P6,%P4]" , 33, ']',0x00000000, X 0, 75, 4, 75, 1, 0, 0, 5, 0, "1d3" , 0}, /* 32*/ X{"Soft Leather Armor [%P6,%P4]" , 36, '(',0x00000000, X 0, 18, 2, 80, 1, 0, 0, 4, 0, "0d0" , 0}, /* 33*/ X{"Soft Studded Leather [%P6,%P4]" , 36, '(',0x00000000, X 0, 35, 3, 90, 1, 0, 0, 5, 0, "1d1" , 0}, /* 34*/ X{"Hard Leather Armor [%P6,%P4]" , 36, '(',0x00000000, X 0, 55, 4, 100, 1, -1, 0, 6, 0, "1d1" , 0}, /* 35*/ X{"Hard Studded Leather [%P6,%P4]" , 36, '(',0x00000000, X 0, 100, 5, 110, 1, -1, 0, 7, 0, "1d2" , 0}, /* 36*/ X{"Leather Scale Mail [%P6,%P4]" , 36, '(',0x00000000, X 0, 330, 9, 140, 1, -1, 0, 11, 0, "1d1" , 0}, /* 37*/ X{"Metal Scale Mail [%P6,%P4]" , 35, '[',0x00000000, X 0, 430, 1, 250, 1, -2, 0, 13, 0, "1d4" , 0}, /* 38*/ X{"Chain Mail [%P6,%P4]" , 35, '[',0x00000000, X 0, 530, 2, 220, 1, -2, 0, 14, 0, "1d4" , 0}, /* 39*/ X{"Partial Plate Armor [%P6,%P4]" , 35, '[',0x00000000, X 0, 900, 9, 260, 1, -3, 0, 22, 0, "1d6" , 0}, /* 40*/ X{"Full Plate Armor [%P6,%P4]" , 35, '[',0x00000000, X 0, 1050, 11, 380, 1, -3, 0, 25, 0, "2d4" , 0}, /* 41*/ X{"& Cloak [%P6,%P4]" , 32, '(',0x00000000, X 0, 3, 1, 10, 1, 0, 0, 1, 0, "0d0" , 0}, /* 42*/ X{"& Set of Leather Gloves [%P6,%P4]" , 31, ']',0x00000000, X 0, 3, 1, 5, 1, 0, 0, 1, 0, "0d0" , 0}, /* 43*/ X{"& Set of Gauntlets [%P6,%P4]" , 31, ']',0x00000000, X 0, 35, 2, 25, 1, 0, 0, 2, 0, "1d1" , 0}, /* 44*/ X{"& Small Leather Shield [%P6,%P4]" , 34, ')',0x00000000, X 0, 30, 1, 50, 1, 0, 0, 2, 0, "1d1" , 0}, /* 45*/ X{"& Medium Leather Shield [%P6,%P4]" , 34, ')',0x00000000, X 0, 60, 2, 75, 1, 0, 0, 3, 0, "1d2" , 0}, /* 46*/ X{"& Small Metal Shield [%P6,%P4]" , 34, ')',0x00000000, X 0, 50, 4, 65, 1, 0, 0, 3, 0, "1d3" , 0}, /* 47*/ X{"& Ring of Resist Fire" , 45, '=',0x00080000, X 0, 250, 11, 2, 1, 0, 0, 0, 0, "0d0" , 0}, /* 48*/ X{"& Ring of Resist Cold" , 45, '=',0x00200000, X 0, 250, 12, 2, 1, 0, 0, 0, 0, "0d0" , 0}, /* 49*/ X{"& Ring of Feather Falling" , 45, '=',0x04000000, X 0, 250, 13, 2, 1, 0, 0, 0, 0, "0d0" , 0}, /* 50*/ X{"& Ring of Protection [%P4]" , 45, '=',0x00000000, X 0, 100, 24, 2, 1, 0, 0, 0, 0, "0d0" , 0}, /* 51*/ X{"& Amulet of Charisma (%P1)" , 40, '"',0x00000020, X 0, 250, 6, 3, 1, 0, 0, 0, 0, "0d0" , 0}, /* 52*/ X{"& Amulet of Slow Digestion" , 40, '"',0x00000080, X 0, 200, 9, 3, 1, 0, 0, 0, 0, "0d0" , 0}, /* 53*/ X{"& Amulet of Resist Acid" , 40, '"',0x00100000, X 0, 300, 10, 3, 1, 0, 0, 0, 0, "0d0" , 0}, /* 54*/ X{"& Scroll~ of Enchant Weapon To-Hit" , 70, '?',0x00000001, X 0, 125, 300, 5, 1, 0, 0, 0, 0, "0d0" , 0}, /* 55*/ X{"& Scroll~ of Enchant Weapon To-Dam" , 70, '?',0x00000002, X 0, 125, 301, 5, 1, 0, 0, 0, 0, "0d0" , 0}, /* 56*/ X{"& Scroll~ of Enchant Armor" , 70, '?',0x00000004, X 0, 125, 302, 5, 1, 0, 0, 0, 0, "0d0" , 0}, /* 57*/ X{"& Scroll~ of Identify" , 70, '?',0x00000008, X 0, 50, 303, 5, 2, 0, 0, 0, 0, "0d0" , 0}, /* 58*/ X{"& Scroll~ of Remove Curse" , 70, '?',0x00000010, X 0, 100, 304, 5, 1, 0, 0, 0, 0, "0d0" , 0}, /* 59*/ X{"& Scroll~ of Light" , 70, '?',0x00000020, X 0, 15, 305, 5, 3, 0, 0, 0, 0, "0d0" , 0}, /* 60*/ X{"& Scroll~ of Phase Door" , 70, '?',0x00000080, X 0, 15, 306, 5, 2, 0, 0, 0, 0, "0d0" , 0}, /* 61*/ X{"& Scroll~ of Magic Mapping" , 70, '?',0x00000800, X 0, 40, 307, 5, 2, 0, 0, 0, 0, "0d0" , 0}, /* 62*/ X{"& Scroll~ of Treasure Detection" , 70, '?',0x00004000, X 0, 15, 308, 5, 2, 0, 0, 0, 0, "0d0" , 0}, /* 63*/ X{"& Scroll~ of Object Detection" , 70, '?',0x00008000, X 0, 15, 309, 5, 2, 0, 0, 0, 0, "0d0" , 0}, /* 64*/ X{"& Scroll~ of Detect Invisible" , 70, '?',0x00080000, X 0, 15, 310, 5, 2, 0, 0, 0, 0, "0d0" , 0}, /* 65*/ X{"& Scroll~ of Recharging" , 70, '?',0x01000000, X 0, 200, 311, 5, 1, 0, 0, 0, 0, "0d0" , 0}, /* 66*/ X{"& Book of Magic Spells [Beginners-Magik]" , 90, '?',0x0000007F, X 0, 25, 257, 30, 1,-100, 0, 0, 0, "1d1" , 0}, /* 67*/ X{"& Book of Magic Spells [Magik I]" , 90, '?',0x0000FF80, X 0, 100, 258, 30, 1,-100, 0, 0, 0, "1d1" , 0}, /* 68*/ X{"& Book of Magic Spells [Magik II]" , 90, '?',0x00FF0000, X 0, 400, 259, 30, 1,-100, 0, 0, 0, "1d1" , 0}, /* 69*/ X{"& Book of Magic Spells [The Mage's Guide to Power]", 90, '?',0x7F000000, X 0, 800, 261, 30, 1,-100, 0, 0, 0, "1d1" , 0}, /* 70*/ X{"& Holy Book of Prayers [Beginners Handbook]" , 91, '?',0x000000FF, X 0, 25, 258, 30, 1,-100, 0, 0, 0, "1d1" , 0}, /* 71*/ X{"& Holy Book of Prayers [Words of Wisdom]" , 91, '?',0x0000FF00, X 0, 100, 259, 30, 1,-100, 0, 0, 0, "1d1" , 0}, /* 72*/ X{"& Holy Book of Prayers [Chants and Blessings]" , 91, '?',0x01FF0000, X 0, 300, 260, 30, 1,-100, 0, 0, 0, "1d1" , 0}, /* 73*/ X{"& Holy Book of Prayers [Exorcism and Dispelling]", 91, '?',0x7E000000, X 0, 900, 261, 30, 1,-100, 0, 0, 0, "1d1" , 0}, /* 74*/ X{"& Potion~ of Restore Strength" , 75, '!',0x00000004, X 0, 300, 310, 4, 1, 0, 0, 0, 0, "1d1" , 0}, /* 75*/ X{"& Potion~ of Restore Intelligence" , 75, '!',0x00000020, X 0, 300, 311, 4, 1, 0, 0, 0, 0, "1d1" , 0}, /* 76*/ X{"& Potion~ of Restore Wisdom" , 75, '!',0x00000100, X 0, 300, 312, 4, 1, 0, 0, 0, 0, "1d1" , 0}, /* 77*/ X{"& Potion~ of Restore Charisma" , 75, '!',0x00000800, X 0, 300, 313, 4, 1, 0, 0, 0, 0, "1d1" , 0}, /* 78*/ X{"& Potion~ of Cure Light Wounds" , 75, '!',0x10001000, X 50, 15, 314, 4, 2, 0, 0, 0, 0, "1d1" , 0}, /* 79*/ X{"& Potion~ of Cure Serious Wounds" , 75, '!',0x30002000, X 100, 40, 315, 4, 1, 0, 0, 0, 0, "1d1" , 0}, /* 80*/ X{"& Potion~ of Cure Critical Wounds" , 75, '!',0x70004000, X 100, 100, 316, 4, 1, 0, 0, 0, 0, "1d1" , 0}, /* 81*/ X{"& Potion~ of Restore Dexterity" , 75, '!',0x04000000, X 0, 300, 317, 4, 1, 0, 0, 0, 0, "1d1" , 0}, /* 82*/ X{"& Potion~ of Restore Constitution" , 75, '!',0x68000000, X 0, 300, 318, 4, 1, 0, 0, 0, 0, "1d1" , 0}, /* 83*/ X{"& Potion~ of Heroism" , 76, '!',0x00000010, X 0, 35, 319, 4, 2, 0, 0, 0, 0, "1d1" , 0}, /* 84*/ X{"& Potion~ of Boldness" , 76, '!',0x00000040, X 0, 10, 320, 4, 2, 0, 0, 0, 0, "1d1" , 0}, /* 85*/ X{"& Wand of Light (%P1 charges)" , 65, '-',0x00000001, X 0, 200, 1, 10, 1, 0, 0, 0, 0, "1d1" , 2}, /* 86*/ X{"& Wand of Lightning Bolts (%P1 charges)" , 65, '-',0x00000002, X 0, 600, 2, 10, 1, 0, 0, 0, 0, "1d1" , 6}, /* 87*/ X{"& Wand of Magic Missile (%P1 charges)" , 65, '-',0x00002000, X 0, 200, 14, 10, 1, 0, 0, 0, 0, "1d1" , 2}, /* 88*/ X{"& Wand of Disarming (%P1 charges)" , 65, '-',0x00020000, X 0, 700, 18, 10, 1, 0, 0, 0, 0, "1d1" , 12}, /* 89*/ X{"& Wand of Lightning Balls (%P1 charges)" , 65, '-',0x00040000, X 0, 1200, 19, 10, 1, 0, 0, 0, 0, "1d1" , 20}, /* 90*/ X{"& Wand of Wonder (%P1 charges)" , 65, '-',0x00800000, X 0, 250, 24, 10, 1, 0, 0, 0, 0, "1d1" , 10}, /* 91*/ X{"& Staff of Light (%P1 charges)" , 55, '_',0x00000001, X 0, 250, 1, 50, 1, 0, 0, 0, 0, "1d2" , 3}, /* 92*/ X{"& Staff of Door/Stair Location (%P1 charges)" , 55, '_',0x00000002, X 0, 350, 2, 50, 1, 0, 0, 0, 0, "1d2" , 7}, /* 93*/ X{"& Staff of Trap Location (%P1 charges)" , 55, '_',0x00000004, X 0, 350, 3, 50, 1, 0, 0, 0, 0, "1d2" , 7}, /* 94*/ X{"& Staff of Detect Invisible (%P1 charges)" , 55, '_',0x00008000, X 0, 200, 16, 50, 1, 0, 0, 0, 0, "1d2" , 3}, /* 95*/ X{"& Potion~ of Restore Life Levels" , 76, '!',0x00000080, X 0, 400, 321, 4, 1, 0, 0, 0, 0, "1d1" , 0}, /* 96*/ X{"& Scroll~ of Blessing" , 71, '?',0x00000020, X 0, 15, 312, 5, 2, 0, 0, 0, 0, "0d0" , 0}, /* 97*/ X{"& Scroll~ of Word-of-Recall" , 71, '?',0x00000100, X 0, 150, 313, 5, 3, 0, 0, 0, 0, "0d0" , 0}, /* 98*/ X{"& Potion~ of Slow Poison" , 76, '!',0x00000800, X 0, 25, 322, 4, 2, 0, 0, 0, 0, "1d1" , 0}, /* 99*/ X{"& Potion~ of Neutralize Poison" , 76, '!',0x00001000, X 0, 75, 323, 4, 1, 0, 0, 0, 0, "1d1" , 0}, /*100*/ X{"& Wand of Stinking Cloud (%P1 charges)" , 65, '-',0x00200000, X 0, 400, 22, 10, 1, 0, 0, 0, 0, "1d1" , 5}, /*101*/ X{"& Iron Spike~" , 13, '~',0x00000000, X 0, 1, 1, 10, 1, 0, 0, 0, 0, "1d1" , 1}, /*102*/ X{"& Brass Lantern~ with %P5 turns of light" , 15, '~',0x00000000, X 7500, 35, 2, 50, 1, 0, 0, 0, 0, "1d1" , 1}, /*103*/ X{"& Wooden Torch~ with %P5 turns of light" , 15, '~',0x00000000, X 4000, 2, 270, 30, 5, 0, 0, 0, 0, "1d1" , 1}, /*104*/ X{"& Flask~ of oil" , 77, '!',0x00040000, X 7500, 3, 257, 10, 5, 0, 0, 0, 0, "2d6" , 1} /*105*/ X}; X Xtreasure_type blank_treasure = {"nothing", 0, ' ', 0, 0, 0, 0, 0, 0, 0, 0, 0, X 0, "0d0", 0}; X X/* Treasure related values */ Xint inven_ctr = 0; /* Total different obj's */ Xint inven_weight = 0; /* Cur carried weight */ Xint equip_ctr = 0; /* Cur equipment ctr */ Xint tcptr; /* Cur treasure heap ptr */ X X/* Following are feature objects defined for dungeon */ X X/* Traps are just Nasty treasures... */ Xtreasure_type trap_lista[MAX_TRAPA] = { X{"an open pit" , 102, ' ',0x00000000, X 0, 0, 1, 0, 1, 0, 0, 0, 0, "2d6" ,-50}, X{"an arrow trap" , 101, '.',0x00000000, X 0, 0, 2, 0, 1, 0, 0, 0, 0, "1d8" , 0}, X{"a covered pit" , 101, '.',0x00000000, X 0, 0, 3, 0, 1, 0, 0, 0, 0, "2d6" , 0}, X{"a trap door" , 101, '.',0x00000000, X 0, 0, 4, 0, 1, 0, 0, 0, 0, "2d8" , 0}, X{"a gas trap" , 101, '.',0x00000000, X 0, 0, 5, 0, 1, 0, 0, 0, 0, "1d4" , 0}, X{"a loose rock" , 101, '.',0x00000000, X 0, 0, 6, 0, 1, 0, 0, 0, 0, "0d0" , 0}, X{"a dart trap" , 101, '.',0x00000000, X 0, 0, 7, 0, 1, 0, 0, 0, 0, "1d4" , 0}, X{"a strange rune" , 101, '.',0x00000000, X 0, 0, 8, 0, 1, 0, 0, 0, 0, "0d0" , 0}, X{"some loose rock" , 101, '.',0x00000000, X 0, 0, 9, 0, 1, 0, 0, 0, 0, "2d6" , 0}, X{"a gas trap" , 101, '.',0x00000000, X 0, 0, 10, 0, 1, 0, 0, 0, 0, "1d4" , 0}, X{"a strange rune" , 101, '.',0x00000000, X 0, 0, 11, 0, 1, 0, 0, 0, 0, "0d0" , 0}, X{"a blackened spot" , 101, '.',0x00000000, X 0, 0, 12, 0, 1, 0, 0, 0, 0, "4d6" , 0}, X{"some corroded rock" , 101, '.',0x00000000, X 0, 0, 13, 0, 1, 0, 0, 0, 0, "4d6" , 0}, X{"a gas trap" , 101, '.',0x00000000, X 0, 0, 14, 0, 1, 0, 0, 0, 0, "2d6" , 0}, X{"a gas trap" , 101, '.',0x00000000, X 5, 0, 15, 0, 1, 0, 0, 0, 0, "1d4" , 10}, X{"a gas trap" , 101, '.',0x00000000, X 5, 0, 16, 0, 1, 0, 0, 0, 0, "1d8" , 5}, X{"a dart trap" , 101, '.',0x00000000, X 5, 0, 17, 0, 1, 0, 0, 0, 0, "1d8" , 10}, X{"a dart trap" , 101, '.',0x00000000, X 5, 0, 18, 0, 1, 0, 0, 0, 0, "1d8" , 10} X}; X X/* Traps: Level represents the difficulty of disarming; */ X/* and P1 represents the experienced gained when disarmed*/ Xtreasure_type trap_listb[MAX_TRAPB] = { X{"an open pit" , 102, ' ',0x00000000, X 1, 0, 1, 0, 1, 0, 0, 0, 0, "2d6" ,-50}, X{"an arrow trap" , 102, '^',0x00000000, X 3, 0, 2, 0, 1, 0, 0, 0, 0, "1d8" ,-10}, X{"a covered pit" , 102, '^',0x00000000, X 2, 0, 3, 0, 1, 0, 0, 0, 0, "2d6" ,-40}, X{"a trap door" , 102, '^',0x00000000, X 5, 0, 4, 0, 1, 0, 0, 0, 0, "2d8" ,-25}, X{"a gas trap" , 102, '^',0x00000000, X 3, 0, 5, 0, 1, 0, 0, 0, 0, "1d4" , 5}, X{"a loose rock" , 102, ';',0x00000000, X 0, 0, 6, 0, 1, 0, 0, 0, 0, "0d0" ,-90}, X{"a dart trap" , 102, '^',0x00000000, X 5, 0, 7, 0, 1, 0, 0, 0, 0, "1d4" , 10}, X{"a strange rune" , 102, '^',0x00000000, X 5, 0, 8, 0, 1, 0, 0, 0, 0, "0d0" ,-10}, X{"some loose rock" , 102, '^',0x00000000, X 5, 0, 9, 0, 1, 0, 0, 0, 0, "2d6" ,-10}, X{"a gas trap" , 102, '^',0x00000000, X 10, 0, 10, 0, 1, 0, 0, 0, 0, "1d4" , 5}, X{"a strange rune" , 102, '^',0x00000000, X 5, 0, 11, 0, 1, 0, 0, 0, 0, "0d0" ,-10}, X{"a blackened spot" , 102, '^',0x00000000, X 10, 0, 12, 0, 1, 0, 0, 0, 0, "4d6" , 10}, X{"some corroded rock" , 102, '^',0x00000000, X 10, 0, 13, 0, 1, 0, 0, 0, 0, "4d6" , 10}, X{"a gas trap" , 102, '^',0x00000000, X 5, 0, 14, 0, 1, 0, 0, 0, 0, "2d6" , 5}, X{"a gas trap" , 102, '^',0x00000000, X 5, 0, 15, 0, 1, 0, 0, 0, 0, "1d4" , 10}, X{"a gas trap" , 102, '^',0x00000000, X 5, 0, 16, 0, 1, 0, 0, 0, 0, "1d8" , 5}, X{"a dart trap" , 102, '^',0x00000000, X 5, 0, 17, 0, 1, 0, 0, 0, 0, "1d8" , 10}, X{"a dart trap" , 102, '^',0x00000000, X 5, 0, 18, 0, 1, 0, 0, 0, 0, "1d8" , 10}, X /* Special case, see DOOR_LIST below (subvals must agree) */ X{"a closed door" , 105, '+',0x00000000, X 0, 0, 19, 0, 1, 0, 0, 0, 0, "1d1" , 0} X}; X X/* Special trap */ Xtreasure_type scare_monster = X{"a strange rune" , 102, '^',0x00000000, X 0, 0, 99, 0, 1, 0, 0, 0, 0, "0d0" ,-90}; X Xtreasure_type rubble = X{"some rubble" , 103, ':',0x00000000, X 0, 0, 1, 0, 1, 0, 0, 0, 0, "0d0" , 0}; X X/* Secret door must have same subval as closed door in */ X/* TRAP_LISTB. See CHANGE_TRAP */ Xtreasure_type door_list[3] = { X{"an open door" , 104,'\'',0x00000000, X 0, 0, 1, 0, 1, 0, 0, 0, 0, "1d1" , 0}, X{"a closed door" , 105, '+',0x00000000, X 0, 0, 19, 0, 1, 0, 0, 0, 0, "1d1" , 0}, X{"a secret door" , 109, '#',0x00000000, X 0, 0, 19, 0, 1, 0, 0, 0, 0, "1d1" , 0} X}; X Xtreasure_type up_stair = X{"an up staircase " , 107, '<',0x00000000, X 0, 0, 1, 0, 1, 0, 0, 0, 0, "1d1" , 0}; X Xtreasure_type down_stair = X{"a down staircase" , 108, '>',0x00000000, X 0, 0, 1, 0, 1, 0, 0, 0, 0, "1d1" , 0}; X END_OF_FILE if test 28070 -ne `wc -c <'treasure2.c'`; then echo shar: \"'treasure2.c'\" unpacked with wrong size! fi # end of 'treasure2.c' fi echo shar: End of archive 13 \(of 18\). cp /dev/null ark13isdone MISSING="" for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 18 archives. rm -f ark[1-9]isdone ark[1-9][0-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0