-+-+-+-+-+-+-+-+ START OF PART 37 -+-+-+-+-+-+-+-+ X && (new_col >= 0) && (new_col < cur_width)) X `7B X *y = new_row; X *x = new_col; X bool = TRUE; X `7D X return(bool); X`7D X X/* Saving throws for player character.`09`09-RAK-`09*/ Xint player_saves() X`7B X /* MPW C couldn't handle the expression, so split it into two parts */ X int16 temp = class_level_adj`5Bpy.misc.pclass`5D`5BCLA_SAVE`5D; X X if (randint(100) <= (py.misc.save + stat_adj(A_WIS) X`09`09 + (temp * py.misc.lev / 3))) X return(TRUE); X else X return(FALSE); X`7D X X X/* Finds range of item in inventory list`09`09-RAK-`09*/ Xint find_range(item1, item2, j, k) Xint item1, item2; Xregister int *j, *k; X`7B X register int i; X register inven_type *i_ptr; X int flag; X X i = 0; X *j = -1; X *k = -1; X flag = FALSE; X i_ptr = &inventory`5B0`5D; X while (i < inven_ctr) X `7B X if (!flag) X`09`7B X`09 if ((i_ptr->tval == item1) `7C`7C (i_ptr->tval == item2)) X`09 `7B X`09 flag = TRUE; X`09 *j = i; X`09 `7D X`09`7D X else X`09`7B X`09 if ((i_ptr->tval != item1) && (i_ptr->tval != item2)) X`09 `7B X`09 *k = i - 1; X`09 break; X`09 `7D X`09`7D X i++; X i_ptr++; X `7D X if (flag && (*k == -1)) X *k = inven_ctr - 1; X return(flag); X`7D X X X/* Teleport the player to a new location`09`09-RAK-`09*/ Xvoid teleport(dis) Xint dis; X`7B X register int y, x, i, j; X X do X `7B X y = randint(cur_height) - 1; X x = randint(cur_width) - 1; X while (distance(y, x, char_row, char_col) > dis) X`09`7B X`09 y += ((char_row-y)/2); X`09 x += ((char_col-x)/2); X`09`7D X `7D X while ((cave`5By`5D`5Bx`5D.fval >= MIN_CLOSED_SPACE) `7C`7C (cave`5By`5D`5 VBx`5D.cptr >= 2)); X move_rec(char_row, char_col, y, x); X for (i = char_row-1; i <= char_row+1; i++) X for (j = char_col-1; j <= char_col+1; j++) X `7B X`09cave`5Bi`5D`5Bj`5D.tl = FALSE; X`09lite_spot(i, j); X `7D X lite_spot(char_row, char_col); X char_row = y; X char_col = x; X check_view(); X creatures(FALSE); X teleport_flag = FALSE; X`7D $ CALL UNPACK MISC3.C;1 1164155385 $ create 'f' X/* source/misc4.c: misc code for maintaining the dungeon, printing player in Vfo X X Copyright (c) 1989-92 James E. Wilson, Robert A. Koeneke X X This software may be copied and distributed for educational, research, an Vd X not for profit purposes provided that this copyright and statement are X included in all such copies. */ X X#ifdef __TURBOC__ X#include`09 X#endif X X#include "config.h" X#include "constant.h" X#include "types.h" X#include "externs.h" X X#ifndef USG X#include X#include X#endif X X#ifdef USG X#ifndef ATARIST_MWC X#include X#endif X#else X#include X#endif X X X/* Add a comment to an object description.`09`09-CJS- */ Xvoid scribe_object() X`7B X int item_val, j; X vtype out_val, tmp_str; X X if (inven_ctr > 0 `7C`7C equip_ctr > 0) X `7B X if (get_item(&item_val, "Which one? ", 0, INVEN_ARRAY_SIZE, CNIL, CNIL V)) X`09`7B X`09 objdes(tmp_str, &inventory`5Bitem_val`5D, TRUE); X`09 (void) sprintf(out_val, "Inscribing %s", tmp_str); X`09 msg_print(out_val); X`09 if (inventory`5Bitem_val`5D.inscrip`5B0`5D != '\0') X`09 (void) sprintf(out_val, "Replace %s New inscription:", X`09`09`09 inventory`5Bitem_val`5D.inscrip); X`09 else X`09 (void) strcpy(out_val, "Inscription: "); X`09 j = 78 - strlen(tmp_str); X`09 if (j > 24) X`09 j = 12; X`09 prt(out_val, 0, 0); X`09 if (get_string(out_val, 0, (int)strlen(out_val), j)) X`09 inscribe(&inventory`5Bitem_val`5D, out_val); X`09`7D X `7D X else X msg_print("You are not carrying anything to inscribe."); X`7D X X/* Append an additional comment to an object description.`09-CJS- */ Xvoid add_inscribe(i_ptr, type) Xinven_type *i_ptr; Xint8u type; X`7B X i_ptr->ident `7C= type; X`7D X X/* Replace any existing comment in an object description with a new one. CJS V*/ Xvoid inscribe(i_ptr, str) Xinven_type *i_ptr; Xchar *str; X`7B X (void) strcpy(i_ptr->inscrip, str); X`7D X X X/* We need to reset the view of things.`09`09`09-CJS- */ Xvoid check_view() X`7B X register int i, j; X register cave_type *c_ptr, *d_ptr; X X c_ptr = &cave`5Bchar_row`5D`5Bchar_col`5D; X /* Check for new panel`09`09 */ X if (get_panel(char_row, char_col, FALSE)) X prt_map(); X /* Move the light source`09`09 */ X move_light(char_row, char_col, char_row, char_col); X /* A room of light should be lit.`09 */ X if (c_ptr->fval == LIGHT_FLOOR) X `7B X if ((py.flags.blind < 1) && !c_ptr->pl) X`09light_room(char_row, char_col); X `7D X /* In doorway of light-room?`09`09 */ X else if (c_ptr->lr && (py.flags.blind < 1)) X `7B X for (i = (char_row - 1); i <= (char_row + 1); i++) X`09for (j = (char_col - 1); j <= (char_col + 1); j++) X`09 `7B X`09 d_ptr = &cave`5Bi`5D`5Bj`5D; X`09 if ((d_ptr->fval == LIGHT_FLOOR) && !d_ptr->pl) X`09 light_room(i, j); X`09 `7D X `7D X`7D $ CALL UNPACK MISC4.C;1 2122199669 $ create 'f' X/* source/monsters.c: monster definitions X X Copyright (c) 1989-92 James E. Wilson, Robert A. Koeneke X X This software may be copied and distributed for educational, research, an Vd X not for profit purposes provided that this copyright and statement are X included in all such copies. */ X X#include "config.h" X#include "constant.h" X#include "types.h" X X/* Following are creature arrays and variables`09`09`09*/ X`09/* Creatures must be defined here`09`09`09`09*/ X`09/*`09See types.h under creature_type for a complete list X`09`09of all variables for creatures.`09 Some of the less obvious X`09`09are explained below. X X`09Hit points:`09#1, #2: where #2 is the range of each roll and X`09`09`09#1 is the number of added up rolls to make. X`09`09`09Example: a creature with 5 eight-sided hit die X`09`09`09is given `7B5,8`7D. X X`09`09Attack types: X`09`091`09Normal attack X`09`092`09Poison Strength X`09`093`09Confusion attack X`09`094`09Fear attack X`09`095`09Fire attack X`09`096`09Acid attack X`09`097`09Cold attack X`09`098`09Lightning attack X`09`099`09Corrosion attack X`09`0910`09Blindness attack X`09`0911`09Paralysis attack X`09`0912`09Steal Money X`09`0913`09Steal Object X`09`0914`09Poison X`09`0915`09Lose dexterity X`09`0916`09Lose constitution X`09`0917`09Lose intelligence X`09`0918`09Lose wisdom X`09`0919`09Lose experience X`09`0920`09Aggravation X`09`0921`09Disenchants X`09`0922`09Eats food X`09`0923`09Eats light X`09`0924`09Eats charges X`09`0999`09Blank X X`09`09Attack descriptions: X`09`091`09hits you. X`09`092`09bites you. X`09`093`09claws you. X`09`094`09stings you. X`09`095`09touches you. X`09`096`09kicks you. X`09`097`09gazes at you. X`09`098`09breathes on you. X`09`099`09spits on you. X`09`0910`09makes a horrible wail. X`09`0911`09embraces you. X`09`0912`09crawls on you. X`09`0913`09releases a cloud of spores. X`09`0914`09begs you for money. X`09`0915`09You've been slimed. X`09`0916`09crushes you. X`09`0917`09tramples you. X`09`0918`09drools on you. X`09`0919`09insults you. X`09`0999`09is repelled. X X`09Example: For a creature which bites for 1d6, then stings for X`09`09 2d4 and loss of dex you would use: X`09`09`09`7B1,2,1,6`7D,`7B15,4,2,4`7D X X`09`09CMOVE flags: XMovement.`0900000001`09Move only to attack X`09.`0900000002`09Move, attack normal X`09.`0900000008`0920% random movement X`09.`0900000010`0940% random movement X`09.`0900000020`0975% random movement XSpecial +`0900010000`09Invisible movement X`09+`0900020000`09Move through door X`09+`0900040000`09Move through wall X`09+`0900080000`09Move through creatures X`09+`0900100000`09Picks up objects X`09+`0900200000`09Multiply monster XCarries =`0901000000`09Carries objects. X`09=`0902000000`09Carries gold. X`09=`0904000000`09Has 60% of time. X`09=`0908000000`09Has 90% of time. X`09=`0910000000`091d2 objects/gold. X`09=`0920000000`092d2 objects/gold. X`09=`0940000000`094d2 objects/gold. XSpecial `7E`0980000000`09Win-the-Game creature. X X`09`09SPELL Flags: XFrequency`09000001`09 1`09These add up to x. Then X(1 in x).`09000002`09 2`09if RANDINT(X) = 1 the X`09.`09000004`09 4`09creature casts a spell. X`09.`09000008`09 8 XSpells`09=`09000010`09Teleport short (blink) X`09=`09000020`09Teleport long X`09=`09000040`09Teleport player to monster X`09=`09000080`09Cause light wound X`09=`09000100`09Cause serious wound X`09=`09000200`09Hold person (Paralysis) X`09=`09000400`09Cause blindness X`09=`09000800`09Cause confusion X`09=`09001000`09Cause fear X`09=`09002000`09Summon monster X`09=`09004000`09Summon undead X`09=`09008000`09Slow Person X`09=`09010000`09Drain Mana X`09=`09020000`09Not Used X`09=`09040000`09Not Used XBreaths +`09080000`09Breath Lightning X`09+`09100000`09Breath Gas X`09+`09200000`09Breath Acid X`09+`09400000`09Breath Frost X`09+`09800000`09Breath Fire X X`09`09CDEFENSE flags: X`09`090001`09Hurt by Slay Dragon. X`09`090002`09Hurt by Slay Animal. X`09`090004`09Hurt by Slay Evil. X`09`090008`09Hurt by Slay Undead. X`09`090010`09Hurt by Frost. X`09`090020`09Hurt by Fire. X`09`090040`09Hurt by Poison. X`09`090080`09Hurt by Acid. X`09`090100`09Hurt by Light-Wand. X`09`090200`09Hurt by Stone-to-Mud. X`09`090400`09Not used. X`09`090800`09Not used. X`09`091000`09Cannot be charmed or slept. X`09`092000`09Can be seen with infra-vision. X`09`094000`09Max Hit points. X`09`098000`09Not used. X X X`09Sleep (sleep)`09:`09A measure in turns of how fast creature X`09`09`09`09will notice player (on the average). X`09Area of affect (aaf) :`09Max range that creature is able to "notice" X`09`09`09`09the player. X`09`09`09`09`09`09`09`09`09*/ X X#ifdef MACGAME Xcreature_type *c_list; X#else Xcreature_type c_list`5BMAX_CREATURES`5D = `7B X`7B"Filthy Street Urchin"`09 ,0x0012000AL,0x00000000L,0x2034, 0, 40, X 4,`091, 11, 'p', `7B1,4`7D , `7B72,148,0,0`7D`09`09, 0`7D, X`7B"Blubbering Idiot"`09 ,0x0012000AL,0x00000000L,0x2030, 0, 0, X 6,`091, 11, 'p', `7B1,2`7D , `7B79,0,0,0`7D`09`09, 0`7D, X`7B"Pitiful-Looking Beggar" ,0x0012000AL,0x00000000L,0x2030, 0, 40, X 10,`091, 11, 'p', `7B1,4`7D , `7B72,0,0,0`7D`09`09, 0`7D, X`7B"Mangy-Looking Leper"`09 ,0x0012000AL,0x00000000L,0x2030, 0, 50, X 10,`091, 11, 'p', `7B1,1`7D , `7B72,0,0,0`7D`09`09, 0`7D, X`7B"Squint-Eyed Rogue"`09 ,0x07120002L,0x00000000L,0x2034, 0, 99, X 10,`098, 11, 'p', `7B2,8`7D , `7B5,149,0,0`7D`09`09, 0`7D, X`7B"Singing, Happy Drunk"`09 ,0x06120038L,0x00000000L,0x2030, 0, 0, X 10,`091, 11, 'p', `7B2,3`7D , `7B72,0,0,0`7D`09`09, 0`7D, X`7B"Mean-Looking Mercenary" ,0x0B12000AL,0x00000000L,0x2034, 0, 250, X 10, 20, 11, 'p', `7B5,8`7D , `7B9,0,0,0`7D`09`09`09, 0`7D, X`7B"Battle-Scarred Veteran" ,0x0B12000AL,0x00000000L,0x2030, 0, 250, X 10, 30, 11, 'p', `7B7,8`7D , `7B15,0,0,0`7D`09`09, 0`7D, X`7B"Grey Mushroom patch"`09 ,0x00000001L,0x00000000L,0x10A0, 1, 0, X 2,`091, 11, ',', `7B1,2`7D , `7B91,0,0,0`7D`09`09, 1`7D, X`7B"Giant Yellow Centipede" ,0x00000002L,0x00000000L,0x0002, 2, 30, X 8, 12, 11, 'c', `7B2,6`7D , `7B26,60,0,0`7D`09`09, 1`7D, X`7B"Giant White Centipede" ,0x0000000AL,0x00000000L,0x0002, 2, 40, X 7, 10, 11, 'c', `7B3,5`7D , `7B25,59,0,0`7D`09`09, 1`7D, X`7B"White Icky-Thing"`09 ,0x00000012L,0x00000000L,0x0020, 2, 10, X 12,`097, 11, 'i', `7B3,5`7D , `7B63,0,0,0`7D`09`09, 1`7D, X`7B"Clear Icky-Thing"`09 ,0x00010012L,0x00000000L,0x0020, 1, 10, X 12,`096, 11, 'i', `7B2,5`7D , `7B63,0,0,0`7D`09`09, 1`7D, X`7B"Giant White Mouse"`09 ,0x0020000AL,0x00000000L,0x2072, 1, 20, X 8,`094, 11, 'r', `7B1,3`7D , `7B25,0,0,0`7D`09`09, 1`7D, X`7B"Large Brown Snake"`09 ,0x0000000AL,0x00000000L,0x00B2, 3, 99, X 4, 35, 10, 'R', `7B4,6`7D , `7B26,73,0,0`7D`09`09, 1`7D, X`7B"Large White Snake"`09 ,0x00000012L,0x00000000L,0x00B2, 2, 99, X 4, 30, 11, 'R', `7B3,6`7D , `7B24,0,0,0`7D`09`09, 1`7D, X`7B"Kobold"`09`09 ,0x07020002L,0x00000000L,0x2030, 5, 10, X 20, 16, 11, 'k', `7B3,7`7D , `7B5,0,0,0`7D`09`09`09, 1`7D, X`7B"White Worm mass"`09 ,0x00200022L,0x00000000L,0x01B2, 2, 10, X 7,`091, 10, 'w', `7B4,4`7D , `7B173,0,0,0`7D`09`09, 1`7D, X`7B"Floating Eye"`09`09 ,0x00000001L,0x0001000DL,0x2100, 1, 10, X 2,`096, 11, 'e', `7B3,6`7D , `7B146,0,0,0`7D`09`09, 1`7D, X`7B"Shrieker Mushroom patch" ,0x00000001L,0x00000000L,0x10A0, 1, 0, X 2,`091, 11, ',', `7B1,1`7D , `7B203,0,0,0`7D`09`09, 2`7D, X`7B"Blubbering Icky-Thing" ,0x0B180012L,0x00000000L,0x0020, 8, 10, X 14,`094, 11, 'i', `7B5,8`7D , `7B174,210,0,0`7D`09`09, 2`7D, X`7B"Metallic Green Centipede" ,0x00000012L,0x00000000L,0x0002, 3, 10, X 5,`094, 12, 'c', `7B4,4`7D , `7B68,0,0,0`7D`09`09, 2`7D, X`7B"Novice Warrior"`09 ,0x07020002L,0x00000000L,0x2030, 6, 5, X 20, 16, 11, 'p', `7B9,4`7D , `7B6,0,0,0`7D`09`09`09, 2`7D, X`7B"Novice Rogue"`09`09 ,0x07020002L,0x00000000L,0x2034, 6, 5, X 20, 12, 11, 'p', `7B8,4`7D , `7B5,148,0,0`7D`09`09, 2`7D, X`7B"Novice Priest"`09 ,0x07020002L,0x0000108CL,0x2030, 7, 5, X 20, 10, 11, 'p', `7B7,4`7D , `7B4,0,0,0`7D`09`09`09, 2`7D, X`7B"Novice Mage"`09`09 ,0x07020002L,0x0000089CL,0x2030, 7, 5, X 20,`096, 11, 'p', `7B6,4`7D , `7B3,0,0,0`7D`09`09`09, 2`7D, X`7B"Yellow Mushroom patch" ,0x00000001L,0x00000000L,0x10A0, 2, 0, X 2,`091, 11, ',', `7B1,1`7D , `7B100,0,0,0`7D`09`09, 2`7D, X`7B"White Jelly"`09`09 ,0x00000001L,0x00000000L,0x11A0, 10, 99, X 2,`091, 12, 'J', `7B8,8`7D , `7B168,0,0,0`7D`09`09, 2`7D, X`7B"Giant Green Frog"`09 ,0x0000000AL,0x00000000L,0x00A2, 6, 30, X 12,`098, 11, 'f', `7B2,8`7D , `7B26,0,0,0`7D`09`09, 2`7D, X`7B"Giant Black Ant"`09 ,0x0000000AL,0x00000000L,0x0002, 8, 80, X 8, 20, 11, 'a', `7B3,6`7D , `7B27,0,0,0`7D`09`09, 2`7D, X`7B"White Harpy"`09`09 ,0x00000012L,0x00000000L,0x2034, 5, 10, X 16, 17, 11, 'h', `7B2,5`7D , `7B49,49,25,0`7D`09`09, 2`7D, X`7B"Blue Yeek"`09`09 ,0x07020002L,0x00000000L,0x2030, 4, 10, X 18, 14, 11, 'y', `7B2,6`7D , `7B4,0,0,0`7D`09`09`09, 2`7D, X`7B"Green Worm mass"`09 ,0x00200022L,0x00000000L,0x0132, 3, 10, +-+-+-+-+-+-+-+- END OF PART 37 +-+-+-+-+-+-+-+-