Only in ick-279: A-mac-h.c Only in ick-279: A-mac-h.pch Only in ick-279: A-win-h.pch Only in ick-279: Makefile Only in ick-279: Makefile.acn Only in ick-279: Makefile.ami Only in ick-279: Makefile.emx Only in ick-279: Makefile.ibm Only in ick-279: Makefile.lsl Only in ick-279: Makefile.old Only in ick-279: Makefile.wat Only in ick-279: Makefile.win Only in utumno: a-mac-h.c Only in utumno: a-mac-h.pch Only in utumno: a-win-h.pch diff -w -c -r ick-279/angband.h utumno/angband.h No differences encountered diff -w -c -r ick-279/birth.c utumno/birth.c *** ick-279/birth.c Thu May 15 17:12:07 1997 --- utumno/birth.c Thu May 15 17:45:46 1997 *************** *** 14,27 **** /* ! * Forward declare */ ! typedef struct birther birther; /* * A structure to hold "rolled" information */ ! struct birther { s16b age; s16b wt; --- 14,53 ---- /* ! * Base stats array */ ! int base_stats[6]; /* + * Costs of various stats -- MJC + */ + int stat_points[18] = + { + 0, /* 0 */ + 0, /* 1 */ + 0, /* 2 */ + 0, /* 3 */ + 0, /* 4 */ + 0, /* 5 */ + 0, /* 6 */ + 0, /* 7 */ + -4, /* 8 */ + -3, /* 9 */ + -2, /* 10 */ + -1, /* 11 */ + 0, /* 12 */ + 2, /* 13 */ + 4, /* 14 */ + 6, /* 15 */ + 9, /* 16 */ + 12, /* 17 */ + }; + + + /* * A structure to hold "rolled" information */ ! typedef struct { s16b age; s16b wt; *************** *** 33,58 **** s16b stat[6]; char history[4][60]; ! }; /* - * The last character displayed - */ - static birther prev; - - - - /* - * Forward declare - */ - typedef struct hist_type hist_type; - - /* * Player background information */ ! struct hist_type { cptr info; /* Textual History */ --- 59,72 ---- s16b stat[6]; char history[4][60]; ! } birther; /* * Player background information */ ! typedef struct { cptr info; /* Textual History */ *************** *** 60,66 **** byte chart; /* Chart index */ byte next; /* Next chart index */ byte bonus; /* Social Class Bonus + 50 */ ! }; /* --- 74,80 ---- byte chart; /* Chart index */ byte next; /* Next chart index */ byte bonus; /* Social Class Bonus + 50 */ ! } hist_type; /* *************** *** 75,80 **** --- 89,95 ---- * Dwarf --> 16 --> 17 --> 18 --> 57 --> 58 --> 59 --> 60 --> 61 * Half-Orc --> 19 --> 20 --> 2 --> 3 --> 50 --> 51 --> 52 --> 53 * Half-Troll --> 22 --> 23 --> 62 --> 63 --> 64 --> 65 --> 66 + * High-Elf --> 25 --> 26 --> 27 --> 54 --> 55 --> 56 * * XXX XXX XXX This table *must* be correct or drastic errors may occur! */ *************** *** 97,115 **** {"You are a credit to the family. ", 80, 3,50, 55}, {"You are a well liked child. ", 100, 3,50, 60}, ! {"Your mother was of the Teleri. ", 40, 4, 1, 50}, ! {"Your father was of the Teleri. ", 75, 4, 1, 55}, ! {"Your mother was of the Noldor. ", 90, 4, 1, 55}, ! {"Your father was of the Noldor. ", 95, 4, 1, 60}, ! {"Your mother was of the Vanyar. ", 98, 4, 1, 65}, ! {"Your father was of the Vanyar. ", 100, 4, 1, 70}, {"You are one of several children ", 60, 7, 8, 50}, {"You are the only child ", 100, 7, 8, 55}, ! {"of a Teleri ", 75, 8, 9, 50}, ! {"of a Noldor ", 95, 8, 9, 55}, ! {"of a Vanyar ", 100, 8, 9, 60}, {"Ranger. ", 40, 9,54, 80}, {"Archer. ", 70, 9,54, 90}, --- 112,127 ---- {"You are a credit to the family. ", 80, 3,50, 55}, {"You are a well liked child. ", 100, 3,50, 60}, ! {"Your mother was a Silvan Elf. ", 40, 4, 1, 50}, ! {"Your father was a Silvan Elf. ", 75, 4, 1, 55}, ! {"Your mother was a Sinda Elf. ", 90, 4, 1, 55}, ! {"Your father was a Sinda Elf. ", 100, 4, 1, 60}, {"You are one of several children ", 60, 7, 8, 50}, {"You are the only child ", 100, 7, 8, 55}, ! {"of a Silvan Elf ", 75, 8, 9, 50}, ! {"of a Sinda Elf ", 100, 8, 9, 55}, {"Ranger. ", 40, 9,54, 80}, {"Archer. ", 70, 9,54, 90}, *************** *** 170,175 **** --- 182,201 ---- {"Shaman. ", 99,23,62, 65}, {"Clan Chief. ", 100,23,62, 80}, + {"You are one of several children ", 60,25,26, 50}, + {"You are the only child ", 100,25,26, 55}, + + {"of a Teleri ", 75,26,27, 50}, + {"of a Noldo ", 95,26,27, 55}, + {"of a Vanya ", 100,26,27, 60}, + + {"Ranger. ", 40,27,54, 80}, + {"Archer. ", 70,27,54, 90}, + {"Warrior. ", 87,27,54,110}, + {"Mage. ", 95,27,54,125}, + {"Prince. ", 99,27,54,140}, + {"King. ", 100,27,54,145}, + {"You have dark brown eyes, ", 20,50,51, 50}, {"You have brown eyes, ", 60,50,51, 50}, {"You have hazel eyes, ", 70,50,51, 50}, *************** *** 246,401 **** ! /* ! * Current stats ! */ static s16b stat_use[6]; - #ifdef ALLOW_AUTOROLLER /* ! * Use the autoroller */ ! static bool autoroll; ! ! /* ! * Requested minimum stats ! */ ! static s16b stat_limit[6]; ! ! /* ! * Number of times each stat matched ! */ ! static s32b stat_match[6]; ! ! /* ! * Current "round" in the auto-roller ! */ ! static s32b auto_round; ! ! /* ! * Last time the auto-roller stopped ! */ ! static s32b last_round; ! ! #endif ! ! ! ! ! /* ! * Save the current data for later ! */ ! static void save_prev_data() { ! int i; ! ! ! /*** Save the current data ***/ ! ! /* Save the data */ ! prev.age = p_ptr->age; ! prev.wt = p_ptr->wt; ! prev.ht = p_ptr->ht; ! prev.sc = p_ptr->sc; ! prev.au = p_ptr->au; ! ! /* Save the stats */ ! for (i = 0; i < 6; i++) ! { ! prev.stat[i] = p_ptr->stat_max[i]; } - /* Save the history */ - for (i = 0; i < 4; i++) - { - strcpy(prev.history[i], history[i]); - } - } - /* - * Load the previous data - */ - static void load_prev_data() - { - int i; - - birther temp; - - - /*** Save the current data ***/ - - /* Save the data */ - temp.age = p_ptr->age; - temp.wt = p_ptr->wt; - temp.ht = p_ptr->ht; - temp.sc = p_ptr->sc; - temp.au = p_ptr->au; - - /* Save the stats */ - for (i = 0; i < 6; i++) - { - temp.stat[i] = p_ptr->stat_max[i]; - } - - /* Save the history */ - for (i = 0; i < 4; i++) - { - strcpy(temp.history[i], history[i]); - } - - - /*** Load the previous data ***/ - - /* Load the data */ - p_ptr->age = prev.age; - p_ptr->wt = prev.wt; - p_ptr->ht = prev.ht; - p_ptr->sc = prev.sc; - p_ptr->au = prev.au; - - /* Load the stats */ - for (i = 0; i < 6; i++) - { - p_ptr->stat_max[i] = prev.stat[i]; - p_ptr->stat_cur[i] = prev.stat[i]; - } - - /* Load the history */ - for (i = 0; i < 4; i++) - { - strcpy(history[i], prev.history[i]); - } - - - /*** Save the current data ***/ - - /* Save the data */ - prev.age = temp.age; - prev.wt = temp.wt; - prev.ht = temp.ht; - prev.sc = temp.sc; - prev.au = temp.au; - - /* Save the stats */ - for (i = 0; i < 6; i++) - { - prev.stat[i] = temp.stat[i]; - } - - /* Save the history */ - for (i = 0; i < 4; i++) - { - strcpy(prev.history[i], temp.history[i]); - } - } - - - - - /* * Choose the character's sex -JWT- */ static void choose_sex(void) --- 272,292 ---- ! /* Current stats */ static s16b stat_use[6]; /* ! * Display the character creation title header. */ ! static void show_create_header() { ! put_str("Character Creation", 0, 30); } /* * Choose the character's sex -JWT- */ static void choose_sex(void) *************** *** 425,431 **** } else if (c == '?') { ! do_cmd_help("help.hlp"); } else { --- 316,322 ---- } else if (c == '?') { ! do_cmd_help("birth.txt"); } else { *************** *** 482,488 **** } else if (c == '?') { ! do_cmd_help("help.hlp"); } else { --- 373,379 ---- } else if (c == '?') { ! do_cmd_help("race.txt"); } else { *************** *** 552,558 **** } else if (c == '?') { ! do_cmd_help("help.hlp"); } else { --- 443,449 ---- } else if (c == '?') { ! do_cmd_help("class.txt"); } else { *************** *** 576,582 **** * * The "p_ptr->maximize" code is important -BEN- */ ! static int adjust_stat(int value, s16b amount, int auto_roll) { int i; --- 467,473 ---- * * The "p_ptr->maximize" code is important -BEN- */ ! static int adjust_stat(int value, s16b amount) { int i; *************** *** 617,627 **** } else if (value < 18+70) { ! value += ((auto_roll ? 15 : randint(15)) + 5); } else if (value < 18+90) { ! value += ((auto_roll ? 6 : randint(6)) + 2); } else if (value < 18+100) { --- 508,518 ---- } else if (value < 18+70) { ! value += 15; } else if (value < 18+90) { ! value += 6; } else if (value < 18+100) { *************** *** 671,681 **** /* Acquire the stats */ for (i = 0; i < 6; i++) { - /* Extract 5 + 1d3 + 1d4 + 1d5 */ - j = 5 + dice[3*i] + dice[3*i+1] + dice[3*i+2]; - /* Save that value */ ! p_ptr->stat_max[i] = j; /* Obtain a "bonus" for "race" and "class" */ bonus = rp_ptr->r_adj[i] + cp_ptr->c_adj[i]; --- 562,569 ---- /* Acquire the stats */ for (i = 0; i < 6; i++) { /* Save that value */ ! p_ptr->stat_max[i] = base_stats[i]; /* Obtain a "bonus" for "race" and "class" */ bonus = rp_ptr->r_adj[i] + cp_ptr->c_adj[i]; *************** *** 694,700 **** else { /* Apply the bonus to the stat (somewhat randomly) */ ! stat_use[i] = adjust_stat(p_ptr->stat_max[i], bonus, FALSE); /* Save the resulting stat maximum */ p_ptr->stat_cur[i] = p_ptr->stat_max[i] = stat_use[i]; --- 582,588 ---- else { /* Apply the bonus to the stat (somewhat randomly) */ ! stat_use[i] = adjust_stat(p_ptr->stat_max[i], bonus); /* Save the resulting stat maximum */ p_ptr->stat_cur[i] = p_ptr->stat_max[i] = stat_use[i]; *************** *** 720,729 **** /* Hitdice */ p_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp; - /* Assume base hitpoints (fully healed) */ - p_ptr->chp = p_ptr->mhp = p_ptr->hitdie; - /* Minimum hitpoints at highest level */ min_value = (PY_MAX_LEVEL * (p_ptr->hitdie - 1) * 3) / 8; min_value += PY_MAX_LEVEL; --- 608,614 ---- *************** *** 793,799 **** break; case RACE_ELF: - case RACE_HIGH_ELF: chart = 7; break; --- 678,683 ---- *************** *** 817,822 **** --- 701,710 ---- chart = 22; break; + case RACE_HIGH_ELF: + chart = 25; + break; + default: chart = 0; } *************** *** 928,1006 **** /* - * Get the player's starting money - */ - static void get_money(void) - { - int i, gold; - - /* Social Class determines starting gold */ - gold = (p_ptr->sc * 6) + randint(100) + 300; - - /* Process the stats */ - for (i = 0; i < 6; i++) - { - /* Mega-Hack -- reduce gold for high stats */ - if (stat_use[i] >= 18+50) gold -= 300; - else if (stat_use[i] >= 18+20) gold -= 200; - else if (stat_use[i] > 18) gold -= 150; - else gold -= (stat_use[i] - 8) * 10; - } - - /* Minimum 100 gold */ - if (gold < 100) gold = 100; - - /* She charmed the banker into it! -CJS- */ - /* She slept with the banker.. :) -GDH- */ - if (!p_ptr->male) gold += 50; - - /* Save the gold */ - p_ptr->au = gold; - } - - - - #ifdef ALLOW_AUTOROLLER - - /* - * Display stat values, subset of "put_stats()" - */ - static void birth_put_stats() - { - int i, p; - byte attr; - - char buf[80]; - - - /* Put the stats (and percents) */ - for (i = 0; i < 6; i++) - { - /* Put the stat */ - cnv_stat(stat_use[i], buf); - c_put_str(TERM_L_GREEN, buf, 2 + i, 66); - - /* Put the percent */ - if (stat_match[i]) - { - p = 1000L * stat_match[i] / auto_round; - attr = (p < 100) ? TERM_YELLOW : TERM_L_GREEN; - sprintf(buf, "%3d.%d%%", p/10, p%10); - c_put_str(attr, buf, 2 + i, 73); - } - - /* Never happened */ - else - { - c_put_str(TERM_RED, "(NONE)", 2 + i, 73); - } - } - } - - #endif - - - /* * Clear all the global "character" data */ static void player_wipe() --- 816,821 ---- *************** *** 1046,1058 **** q_list[i].level = 0; } ! /* Add a special quest */ ! q_list[0].level = 99; ! /* Add a second quest */ ! q_list[1].level = 100; /* Reset the "objects" */ for (i = 1; i < MAX_K_IDX; i++) { --- 861,879 ---- q_list[i].level = 0; } ! /* Add the first quest */ ! q_list[0].level = 50; ! /* Add the second quest */ ! q_list[1].level = 80; + /* Add the third quest */ + q_list[2].level = 99; + /* Add the final quest */ + q_list[3].level = 100; + + /* Reset the "objects" */ for (i = 1; i < MAX_K_IDX; i++) { *************** *** 1094,1103 **** /* Wipe the spells */ ! spell_learned1 = spell_learned2 = 0L; ! spell_worked1 = spell_worked2 = 0L; ! spell_forgotten1 = spell_forgotten2 = 0L; ! for (i = 0; i < 64; i++) spell_order[i] = 99; /* Assume no winning game */ --- 915,927 ---- /* Wipe the spells */ ! for (i = 0; i < 64; i++) ! { ! spell_learned[i] = FALSE; ! spell_worked[i] = FALSE; ! spell_forgotten[i] = FALSE; ! spell_order[i] = 99; ! } /* Assume no winning game */ *************** *** 1108,1113 **** --- 932,945 ---- /* Assume no cheating */ noscore = 0; + + /* Unset the cheating options */ + cheat_peek = FALSE; + cheat_hear = FALSE; + cheat_room = FALSE; + cheat_xtra = FALSE; + cheat_know = FALSE; + cheat_live = FALSE; } *************** *** 1122,1128 **** { { /* Warrior */ ! { TV_POTION, SV_POTION_BESERK_STRENGTH }, { TV_SWORD, SV_BROAD_SWORD }, { TV_HARD_ARMOR, SV_CHAIN_MAIL } }, --- 954,960 ---- { { /* Warrior */ ! { TV_SHIELD, SV_SMALL_METAL_SHIELD }, { TV_SWORD, SV_BROAD_SWORD }, { TV_HARD_ARMOR, SV_CHAIN_MAIL } }, *************** *** 1173,1197 **** static void player_outfit() { int i, tv, sv; - object_type forge; - object_type *i_ptr = &forge; /* Hack -- Give the player some food */ ! invcopy(i_ptr, lookup_kind(TV_FOOD, SV_FOOD_RATION)); ! i_ptr->number = rand_range(3,7); ! object_aware(i_ptr); ! object_known(i_ptr); ! (void)inven_carry(i_ptr); /* Hack -- Give the player some torches */ ! invcopy(i_ptr, lookup_kind(TV_LITE, SV_LITE_TORCH)); ! i_ptr->number = rand_range(3,7); ! i_ptr->pval = rand_range(3,7) * 500; ! object_known(i_ptr); ! (void)inven_carry(i_ptr); /* Hack -- Give the player three useful objects */ for (i = 0; i < 3; i++) --- 1005,1028 ---- static void player_outfit() { int i, tv, sv; object_type forge; object_type *i_ptr = &forge; /* Hack -- Give the player some food */ ! i_ptr->invcopy(lookup_kind(TV_FOOD, SV_FOOD_RATION)); ! i_ptr->set_number(5); ! i_ptr->object_aware(); ! i_ptr->object_known(); ! inven_carry(i_ptr); /* Hack -- Give the player some torches */ ! i_ptr->invcopy(lookup_kind(TV_LITE, SV_LITE_TORCH)); ! i_ptr->set_number(5); ! i_ptr->set_pval(2500); ! i_ptr->object_aware(); ! i_ptr->object_known(); ! inven_carry(i_ptr); /* Hack -- Give the player three useful objects */ for (i = 0; i < 3; i++) *************** *** 1198,1207 **** { tv = player_init[p_ptr->pclass][i][0]; sv = player_init[p_ptr->pclass][i][1]; ! invcopy(i_ptr, lookup_kind(tv, sv)); ! object_aware(i_ptr); ! object_known(i_ptr); ! (void)inven_carry(i_ptr); } } --- 1029,1038 ---- { tv = player_init[p_ptr->pclass][i][0]; sv = player_init[p_ptr->pclass][i][1]; ! i_ptr->invcopy(lookup_kind(tv, sv)); ! i_ptr->object_aware(); ! i_ptr->object_known(); ! inven_carry(i_ptr); } } *************** *** 1210,1219 **** /* * Create a character. Then wait for a moment. * - * The delay may be reduced, but is recommended to keep players - * from continuously rolling up characters, which can be VERY - * expensive CPU wise. - * * Note that we may be called with "junk" leftover in the various * fields, so we must be sure to clear them first. */ --- 1041,1046 ---- *************** *** 1220,1236 **** void player_birth() { int i; ! ! char c; ! ! bool flag; ! ! bool prev_ready; bool use_history; - char buf[80]; - start_over: --- 1047,1057 ---- void player_birth() { int i; ! char c, out_val[40]; bool use_history; + int points_used; start_over: *************** *** 1239,1245 **** /* Clear some flags */ use_history = FALSE; - prev_ready = FALSE; /* Clear the screen */ --- 1060,1065 ---- *************** *** 1246,1255 **** --- 1066,1078 ---- clear_screen(); /* Title everything */ + show_create_header(); put_str("Name :", 2, 1); put_str("Sex :", 3, 1); put_str("Race :", 4, 1); put_str("Class :", 5, 1); + put_str("Preserve :", 6, 1); + put_str("Maximize :", 7, 1); /* Dump the default name */ c_put_str(TERM_L_BLUE, player_name, 2, 15); *************** *** 1258,1637 **** /* Display some helpful information XXX XXX XXX */ ! /* Choose a sex */ choose_sex(); - - - /* Choose a race */ choose_race(); - - - /* Choose a class */ choose_class(); ! /* Ask about "maximize" mode */ while (1) { ! put_str("Use 'maximize' mode? (Y/N/S/Q/?) ", 20, 2); c = inkey(); if (c == ESCAPE) break; else if (strchr("ynYN", c)) break; else if (c == 'S') goto start_over; else if (c == 'Q') quit(NULL); ! else if (c == '?') do_cmd_help("help.hlp"); else bell(); } ! /* XXX XXX Accept "maximize" mode */ ! p_ptr->maximize = ((c == 'Y') || (c == 'y')); ! /* Clear */ ! clear_from(20); ! ! ! /* Ask about "preserve" mode */ ! while (1) { ! put_str("Use 'preserve' mode? (Y/N/S/Q/?) ", 20, 2); ! c = inkey(); ! if (c == ESCAPE) break; ! else if (strchr("ynYN", c)) break; ! else if (c == 'S') goto start_over; ! else if (c == 'Q') quit(NULL); ! else if (c == '?') do_cmd_help("help.hlp"); ! else bell(); } - /* XXX XXX Accept "preserve" mode */ - p_ptr->preserve = ((c == 'Y') || (c == 'y')); - /* Clear */ clear_from(20); ! #ifdef ALLOW_AUTOROLLER ! ! /* Ask about "auto-roller" mode */ while (1) { ! put_str("Use the Auto-Roller? (Y/N/S/Q/?) ", 20, 2); c = inkey(); if (c == ESCAPE) break; else if (strchr("ynYN", c)) break; else if (c == 'S') goto start_over; else if (c == 'Q') quit(NULL); ! else if (c == '?') do_cmd_help("help.hlp"); else bell(); } ! /* Prepare the autoroller */ ! autoroll = ((c == 'Y') || (c == 'y')); ! /* Clear */ ! clear_from(20); ! ! ! /* Initialize autoroller */ ! if (autoroll) { ! int mval[6]; ! ! char inp[80]; ! ! ! /* Clear fields */ ! auto_round = 0L; ! last_round = 0L; ! ! /* Prompt for the minimum stats */ ! clear_from(15); ! put_str("Enter minimum attribute for: ", 15, 2); ! ! /* Output the maximum stats */ ! for (i = 0; i < 6; i++) ! { ! int k, m; ! ! /* Reset the "success" counter */ ! stat_match[i] = 0; ! ! /* Race/Class bonus */ ! k = rp_ptr->r_adj[i] + cp_ptr->c_adj[i]; ! ! /* Obtain the "maximal" stat */ ! m = adjust_stat(17, k, TRUE); ! ! /* Save the maximum */ ! mval[i] = m; ! ! /* Extract a textual format */ ! /* cnv_stat(m, inp); */ ! ! /* Above 18 */ ! if (m > 18) ! { ! sprintf(inp, "(Max of 18/%02d):", (m - 18)); } - - /* From 3 to 18 */ else { ! sprintf(inp, "(Max of %2d):", m); } ! /* Prepare a prompt */ ! sprintf(buf, "%-5s%-20s", stat_names[i], inp); ! /* Dump the prompt */ ! put_str(buf, 16 + i, 5); ! } - /* Input the minimum stats */ - for (i = 0; i < 6; i++) - { - int v; ! /* Get a minimum stat */ ! while (TRUE) ! { ! char *s; ! /* Move the cursor */ ! put_str("", 16 + i, 30); ! /* Default */ ! strcpy(inp, ""); ! /* Get a response (or escape) */ ! if (!askfor_aux(inp, 8)) inp[0] = '\0'; ! /* Hack -- add a fake slash */ ! strcat(inp, "/"); - /* Hack -- look for the "slash" */ - s = strchr(inp, '/'); - /* Hack -- Nuke the slash */ - *s++ = '\0'; - - /* Hack -- Extract an input */ - v = atoi(inp) + atoi(s); - - /* Break on valid input */ - if (v <= mval[i]) break; - } - - /* Save the minimum stat */ - stat_limit[i] = (v > 0) ? v : 0; - } - - /* Dump results */ - Term_fresh(); - } - - #endif - - /* Actually Generate */ while (TRUE) { ! #ifdef ALLOW_AUTOROLLER ! /* Autoroller needs some feedback */ ! if (autoroll) ! { ! clear_screen(); ! put_str("Name :", 2, 1); ! put_str("Sex :", 3, 1); ! put_str("Race :", 4, 1); ! put_str("Class :", 5, 1); ! c_put_str(TERM_L_BLUE, player_name, 2, 15); ! c_put_str(TERM_L_BLUE, (p_ptr->male ? "Male" : "Female"), 3, 15); ! c_put_str(TERM_L_BLUE, rp_ptr->title, 4, 15); ! c_put_str(TERM_L_BLUE, cp_ptr->title, 5, 15); ! /* Label stats */ ! put_str("STR:", 2 + A_STR, 61); ! put_str("INT:", 2 + A_INT, 61); ! put_str("WIS:", 2 + A_WIS, 61); ! put_str("DEX:", 2 + A_DEX, 61); ! put_str("CON:", 2 + A_CON, 61); ! put_str("CHR:", 2 + A_CHR, 61); ! /* Note when we started */ ! last_round = auto_round; ! /* Indicate the state */ ! put_str("(Hit ESC to abort)", 11, 61); ! /* Label count */ ! put_str("Round:", 9, 61); ! } ! /* Otherwise just get a character */ ! else { ! /* Get a new character */ ! get_stats(); ! } ! ! ! /* Start of AUTOROLLing loop */ ! while (autoroll) ! { ! bool accept = TRUE; ! ! /* Get a new character */ ! get_stats(); ! ! /* Advance the round */ ! auto_round++; ! ! /* Hack -- Prevent overflow */ ! if (auto_round >= 1000000L) break; ! ! /* Check and count acceptable stats */ ! for (i = 0; i < 6; i++) ! { ! /* This stat is okay */ ! if (stat_use[i] >= stat_limit[i]) ! { ! stat_match[i]++; ! } ! ! /* This stat is not okay */ else { ! accept = FALSE; } } ! /* Break if "happy" */ ! if (accept) break; ! ! /* Take note every 25 rolls */ ! flag = (!(auto_round % 25L)); ! ! /* Update display occasionally */ ! if (flag || (auto_round < last_round + 100)) { ! /* Dump data */ ! birth_put_stats(); ! /* Dump round */ ! put_str(format("%6ld", auto_round), 9, 73); ! /* Make sure they see everything */ ! Term_fresh(); ! /* Delay 1/10 second */ ! if (flag) delay(100); ! /* Do not wait for a key */ ! inkey_scan = TRUE; ! /* Check for a keypress */ ! if (inkey()) break; ! } ! } - /* Flush input */ - flush(); - - #else - - /* No autoroller */ - get_stats(); - - #endif - - /* Start with the "Misc" data */ - use_history = FALSE; - - /* Roll for base hitpoints */ - get_extra(); - - /* Roll for age/height/weight */ - get_ahw(); - - /* Roll for social class */ - get_history(); - - /* Roll for gold */ - get_money(); - - /* Input loop */ - while (TRUE) - { - /* Calculate the bonuses and hitpoints */ - p_ptr->update |= (PU_BONUS | PU_HP); - - /* Update stuff */ - update_stuff(); - - /* Display the player */ - display_player(use_history); - - /* Prepare a prompt (must squeeze everything in) */ - Term_putstr(2, 21, -1, TERM_WHITE, "Hit "); - if (prev_ready) Term_addstr(-1, TERM_WHITE, "'P' for Previous, "); - else Term_addstr(-1, TERM_WHITE, "'S' to start over, "); - if (use_history) Term_addstr(-1, TERM_WHITE, "'H' for Misc., "); - else Term_addstr(-1, TERM_WHITE, "'H' for History, "); - Term_addstr(-1, TERM_WHITE, "'R' to Reroll, or ESC to Accept: "); - - /* Prompt and get a command */ - c = inkey(); - - /* Escape accepts the roll */ - if (c == ESCAPE) break; - - /* Space (or 'R') rerolls */ - if ((c == ' ') || (c == 'R') || (c == 'r')) break; - - /* Go back to last character with 'P' */ - if (prev_ready && ((c == 'P') || (c == 'p'))) - { - load_prev_data(); - continue; - } - /* Print the History/MiscData */ ! if ((c == 'H') || (c == 'h')) ! { use_history = !use_history; ! continue; ! } ! /* Hack -- help */ ! if (c == '?') ! { ! do_cmd_help("help.hlp"); ! continue; ! } ! /* Hack -- start over */ ! if (c == 'S') goto start_over; ! /* Hack -- quit */ ! if (c == 'Q') quit(NULL); ! /* Warning */ bell(); } - - /* Are we done? */ - if (c == ESCAPE) break; - - /* Save this for the "previous" character */ - save_prev_data(); - - /* Note that a previous roll exists */ - prev_ready = TRUE; } /* Clear from line 20 down */ --- 1081,1296 ---- /* Display some helpful information XXX XXX XXX */ ! /* Choose sex, race, class */ choose_sex(); choose_race(); choose_class(); ! /* Ask about "preserve" mode */ while (1) { ! put_str("Use preserve mode? (Y/N/S/Q/?) ", 20, 2); c = inkey(); if (c == ESCAPE) break; else if (strchr("ynYN", c)) break; else if (c == 'S') goto start_over; else if (c == 'Q') quit(NULL); ! else if (c == '?') do_cmd_help("maxpres.txt"); else bell(); } ! /* XXX Accept preserve mode */ ! p_ptr->preserve = ((c == 'Y') || (c == 'y')); ! /* Add it to the screen */ ! if (p_ptr->preserve) { ! c_put_str(TERM_L_BLUE, "Yes", 6, 15); } + else + { + c_put_str(TERM_L_BLUE, "No", 6, 15); + } /* Clear */ clear_from(20); ! /* Ask about maximize mode */ while (1) { ! put_str("Use maximize mode? (Y/N/S/Q/?) ", 20, 2); c = inkey(); if (c == ESCAPE) break; else if (strchr("ynYN", c)) break; else if (c == 'S') goto start_over; else if (c == 'Q') quit(NULL); ! else if (c == '?') do_cmd_help("maxpres.txt"); else bell(); } ! /* XXX Accept maximize mode */ ! p_ptr->maximize = ((c == 'Y') || (c == 'y')); ! /* Add it to the screen */ ! if (p_ptr->maximize) { ! c_put_str(TERM_L_BLUE, "Yes", 7, 15); } else { ! c_put_str(TERM_L_BLUE, "No", 7, 15); } ! /* Clear */ ! clear_from(20); ! /* Set up base stats */ ! for (i = 0; i < 6; i++) base_stats[i] = 12; ! /* Roll for base hitpoints */ ! get_extra(); ! /* Roll for age/height/weight */ ! get_ahw(); ! /* Roll for social class */ ! get_history(); ! /* Set gold */ ! p_ptr->au = 100; ! /* Start with the "Misc" data */ ! use_history = FALSE; /* Actually Generate */ while (TRUE) { + /* No autoroller */ + get_stats(); ! /* Calculate the bonuses, hitpoints, and mana */ ! p_ptr->update |= PU_BONUS | PU_HP | PU_MANA; ! /* Update stuff */ ! update_stuff(); ! /* "Heal up" the player */ ! p_ptr->csp = p_ptr->msp; ! p_ptr->chp = p_ptr->mhp; ! /* Display the player */ ! display_player(use_history, FALSE); ! /* Add "character creation" header */ ! show_create_header(); ! /* Calculate points used */ ! points_used = 0; ! for (i = 0; i < 6; i++) points_used += stat_points[base_stats[i]]; ! sprintf(out_val, "Points used: %d of 20", points_used); ! /* Prepare a prompt (must squeeze everything in) */ ! Term_putstr(2, 21, -1, TERM_WHITE, "'S'/'s' to modify STR; "); ! Term_addstr(-1, TERM_WHITE, "'I'/'i' to modify INT; "); ! Term_addstr(-1, TERM_WHITE, "'W'/'w' to modify WIS"); ! Term_putstr(2, 22, -1, TERM_WHITE, "'D'/'d' to modify DEX; "); ! Term_addstr(-1, TERM_WHITE, "'C'/'c' to modify CON; "); ! Term_addstr(-1, TERM_WHITE, "'R'/'r' to modify CHR"); ! Term_putstr(2, 23, -1, (points_used <= 20) ? TERM_WHITE : TERM_YELLOW, ! out_val); ! Term_putstr(29, 23, -1, TERM_WHITE, "Hit "); ! if (use_history) Term_addstr(-1, TERM_WHITE, "'H' for Misc., "); ! else Term_addstr(-1, TERM_WHITE, "'H' for History, "); ! Term_addstr(-1, TERM_WHITE, "or ESC to Accept: "); ! /* Prompt and get a command */ ! c = inkey(); ! /* Escape accepts the roll */ ! if (c == ESCAPE) { ! if (points_used <= 20) break; else { ! bell(); ! continue; } } ! /* Other things */ ! switch (c) { ! /* Modify STR */ ! case 'S': ! if (base_stats[0] < 17) base_stats[0]++; ! break; ! case 's': ! if (base_stats[0] > 8) base_stats[0]--; ! break; ! /* Modify INT */ ! case 'I': ! if (base_stats[1] < 17) base_stats[1]++; ! break; ! case 'i': ! if (base_stats[1] > 8) base_stats[1]--; ! break; ! /* Modify WIS */ ! case 'W': ! if (base_stats[2] < 17) base_stats[2]++; ! break; ! case 'w': ! if (base_stats[2] > 8) base_stats[2]--; ! break; ! /* Modify DEX */ ! case 'D': ! if (base_stats[3] < 17) base_stats[3]++; ! break; ! case 'd': ! if (base_stats[3] > 8) base_stats[3]--; ! break; ! /* Modify CON */ ! case 'C': ! if (base_stats[4] < 17) base_stats[4]++; ! break; ! case 'c': ! if (base_stats[4] > 8) base_stats[4]--; ! break; ! /* Modify CHR */ ! case 'R': ! if (base_stats[5] < 17) base_stats[5]++; ! break; ! case 'r': ! if (base_stats[5] > 8) base_stats[5]--; ! break; /* Print the History/MiscData */ ! case 'H': case 'h': use_history = !use_history; ! break; ! /* Help */ ! case '?': ! do_cmd_help("birth.txt"); ! break; ! /* Abort game */ ! case 'Q': ! quit(NULL); ! break; ! default: /* Warning */ bell(); } } /* Clear from line 20 down */ diff -w -c -r ick-279/cave.c utumno/cave.c *** ick-279/cave.c Thu May 15 17:12:07 1997 --- utumno/cave.c Thu May 15 17:45:46 1997 *************** *** 8,14 **** --- 8,71 ---- + /* XXX write function: memorize all objects at (x, y) */ + /* + * Is a given location "valid" for placing things? + * + * Permanent walls, stairs, store doors are never "valid". + * + * A grid with an artifact in it is never valid. + * + * This function is often "combined" with "floor_grid_bold(y,x)" + * or one of the other similar "functions". + * + * Forbid perma-walls + * Forbid stairs and store doors + * Forbid artifact grids + */ + bool valid_grid(int y, int x) + { + cave_type *c_ptr; + object_type *i_ptr; + int i_idx; + + /* Must be in bounds */ + if (!in_bounds(y, x)) return FALSE; + + /* Get the pointer */ + c_ptr = &cave[y][x]; + + /* No permawalls */ + if (c_ptr->feat >= CF_PERMANENT_BASIC) return FALSE; + + /* No stairs/store doors */ + if ((c_ptr->feat >= CF_STAIRS_UP) && (c_ptr->feat <= CF_SHOP_HOME)) + { + return FALSE; + } + + /* Scan all the objects */ + i_idx = c_ptr->i_idx; + while (i_idx) + { + /* Get object pointer */ + i_ptr = &i_list[i_idx]; + + /* Is it an artifact? */ + if (i_ptr->is_artifact()) return FALSE; + + /* Get next object */ + i_idx = i_ptr->next_i_idx; + } + + /* Must be valid */ + return TRUE; + } + + + + /* * Approximate Distance between two points. * * When either the X or Y component dwarfs the other component, *************** *** 22,35 **** int dy, dx, d; /* Find the absolute y/x distance components */ - dy = (y1 > y2) ? (y1 - y2) : (y2 - y1); dx = (x1 > x2) ? (x1 - x2) : (x2 - x1); /* Hack -- approximate the distance */ d = (dy > dx) ? (dy + (dx>>1)) : (dx + (dy>>1)); /* Return the distance */ ! return (d); } --- 79,92 ---- int dy, dx, d; /* Find the absolute y/x distance components */ dx = (x1 > x2) ? (x1 - x2) : (x2 - x1); + dy = (y1 > y2) ? (y1 - y2) : (y2 - y1); /* Hack -- approximate the distance */ d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1)); /* Return the distance */ ! return d; } *************** *** 422,428 **** * Hack -- Legal object codes */ static cptr image_object_hack = \ ! "?/|\\\"!$()_-=[]{},~"; /* * Mega-Hack -- Hallucinatory object --- 479,486 ---- * Hack -- Legal object codes */ static cptr image_object_hack = \ ! "?/|\\\"!$()_-=[] ! {},~"; /* * Mega-Hack -- Hallucinatory object *************** *** 448,454 **** static void image_random(byte *ap, char *cp) { /* Normally, assume monsters */ ! if (rand_int(100) < 75) { image_monster(ap, cp); } --- 506,512 ---- static void image_random(byte *ap, char *cp) { /* Normally, assume monsters */ ! if (percent(75)) { image_monster(ap, cp); } *************** *** 574,580 **** if (c_ptr->m_idx) { monster_type *m_ptr = &m_list[c_ptr->m_idx]; ! monster_race *r_ptr = &r_info[m_ptr->r_idx]; /* Invisible monster */ if (!m_ptr->ml) --- 632,638 ---- if (c_ptr->m_idx) { monster_type *m_ptr = &m_list[c_ptr->m_idx]; ! monster_race *r_ptr = m_ptr->r_ptr; /* Invisible monster */ if (!m_ptr->ml) *************** *** 887,893 **** if (player_can_see_bold(y, x)) { /* Memorize */ ! i_ptr->marked = TRUE; } } } --- 945,951 ---- if (player_can_see_bold(y, x)) { /* Memorize */ ! i_ptr->set_marked(TRUE); } } } *************** *** 2112,2119 **** /*** Step 1 -- adjacent grids ***/ /* Now start on the player */ - y = py; x = px; /* Access the grid */ c_ptr = &cave[y][x]; --- 2170,2177 ---- /*** Step 1 -- adjacent grids ***/ /* Now start on the player */ x = px; + y = py; /* Access the grid */ c_ptr = &cave[y][x]; *************** *** 2779,2785 **** object_type *i_ptr = &i_list[c_ptr->i_idx]; /* Memorize */ ! i_ptr->marked = TRUE; } /* Process all non-walls */ --- 2837,2843 ---- object_type *i_ptr = &i_list[c_ptr->i_idx]; /* Memorize */ ! i_ptr->set_marked(TRUE); } /* Process all non-walls */ *************** *** 2821,2836 **** /* * Forget the dungeon map (ala "Thinking of Maud..."). */ ! void wiz_dark(void) { ! int y, x; /* Forget every grid */ - for (y = 0; y < cur_hgt; y++) - { for (x = 0; x < cur_wid; x++) { cave_type *c_ptr = &cave[y][x]; /* Process the grid */ --- 2879,2894 ---- /* * Forget the dungeon map (ala "Thinking of Maud..."). */ ! void forget_map(void) { ! int x, y; /* Forget every grid */ for (x = 0; x < cur_wid; x++) { + for (y = 0; y < cur_hgt; y++) + { cave_type *c_ptr = &cave[y][x]; /* Process the grid */ *************** *** 2842,2848 **** object_type *i_ptr = &i_list[c_ptr->i_idx]; /* Forget the object */ ! i_ptr->marked = FALSE; } } } --- 2900,2906 ---- object_type *i_ptr = &i_list[c_ptr->i_idx]; /* Forget the object */ ! i_ptr->set_marked(FALSE); } } } Only in utumno: chars.c diff -w -c -r ick-279/cmd1.c utumno/cmd1.c *** ick-279/cmd1.c Thu May 15 17:12:08 1997 --- utumno/cmd1.c Thu May 15 17:45:47 1997 *************** *** 116,122 **** * * Factor in weapon weight, total plusses, player level. */ ! s16b critical_norm(int weight, int plus, int dam) { int i, k; --- 116,122 ---- * * Factor in weapon weight, total plusses, player level. */ ! s16b critical_norm(int weight, int plus, int dam, monster_type *m_ptr) { int i, k; *************** *** 124,130 **** i = (weight + ((p_ptr->to_h + plus) * 5) + (p_ptr->lev * 3)); /* Chance */ ! if (randint(5000) <= i) { k = weight + randint(650); --- 124,131 ---- i = (weight + ((p_ptr->to_h + plus) * 5) + (p_ptr->lev * 3)); /* Chance */ ! if (((p_ptr->pclass == CLASS_ROGUE) && (m_ptr->csleep > 0)) || ! (randint(5000) <= i)) { k = weight + randint(650); *************** *** 321,326 **** --- 322,343 ---- } } + /* Brand (Poison */ + if (f1 & TR1_BRAND_POIS) + { + /* Notice immunity */ + if (r_ptr->flags3 & RF3_IM_POIS) + { + if (m_ptr->ml) r_ptr->r_flags3 |= RF3_IM_POIS; + } + + /* Otherwise, take the damage */ + else + { + if (mult < 3) mult = 3; + } + } + /* Brand (Cold) */ if (f1 & TR1_BRAND_COLD) { *************** *** 363,374 **** if (p_ptr->confused || p_ptr->image) chance = chance / 10; /* Search the nearby grids, which are always in bounds */ ! for (y = (py - 1); y <= (py + 1); y++) { ! for (x = (px - 1); x <= (px + 1); x++) { /* Sometimes, notice things */ ! if (rand_int(100) < chance) { /* Access the grid */ c_ptr = &cave[y][x]; --- 380,391 ---- if (p_ptr->confused || p_ptr->image) chance = chance / 10; /* Search the nearby grids, which are always in bounds */ ! for (x = px - 1; x <= px + 1; x++) { ! for (y = py - 1; y <= py + 1; y++) { /* Sometimes, notice things */ ! if (percent(chance)) { /* Access the grid */ c_ptr = &cave[y][x]; *************** *** 412,418 **** else if (i_ptr->tval == TV_CHEST) { /* Examine chests for traps */ ! if (!object_known_p(i_ptr) && (chest_traps[i_ptr->pval])) { /* Message */ --- 429,436 ---- else if (i_ptr->tval == TV_CHEST) { /* Examine chests for traps */ ! if (!i_ptr->is_known() && ! (chest_traps[i_ptr->pval])) { /* Message */ *************** *** 419,425 **** msg_print("You have discovered a trap on the chest!"); /* Know the trap */ ! object_known(i_ptr); /* Notice it */ disturb(0, 0); --- 437,443 ---- msg_print("You have discovered a trap on the chest!"); /* Know the trap */ ! i_ptr->object_known(); /* Notice it */ disturb(0, 0); *************** *** 441,457 **** void carry(int pickup) { cave_type *c_ptr = &cave[py][px]; ! object_type *i_ptr; char i_name[80]; ! /* Hack -- nothing here to pick up */ ! if (!(c_ptr->i_idx)) return; ! /* Get the object */ ! i_ptr = &i_list[c_ptr->i_idx]; /* Describe the object */ object_desc(i_name, i_ptr, TRUE, 3); --- 459,476 ---- void carry(int pickup) { cave_type *c_ptr = &cave[py][px]; ! int i_idx = c_ptr->i_idx, next_i_idx; object_type *i_ptr; char i_name[80]; ! /* Loop through all objects in this pile */ ! while (i_idx) ! { /* Get the object */ ! i_ptr = &i_list[i_idx]; ! next_i_idx = i_ptr->next_i_idx; /* Describe the object */ object_desc(i_name, i_ptr, TRUE, 3); *************** *** 473,485 **** p_ptr->redraw |= (PR_GOLD); /* Delete gold */ ! delete_object(py, px); } /* Pick it up */ else { ! /* Hack -- disturb */ disturb(0, 0); /* Describe the object */ --- 492,504 ---- p_ptr->redraw |= (PR_GOLD); /* Delete gold */ ! delete_object_idx(i_idx); } /* Pick it up */ else { ! /* Disturb */ disturb(0, 0); /* Describe the object */ *************** *** 525,535 **** msg_format("You have %s (%c).", i_name, index_to_label(slot)); /* Delete original */ ! delete_object(py, px); } } } } --- 544,557 ---- msg_format("You have %s (%c).", i_name, index_to_label(slot)); /* Delete original */ ! delete_object_idx(i_idx); } } } + + i_idx = next_i_idx; } + } *************** *** 586,592 **** /* Examine the trap sub-val */ switch (c_ptr->feat) { ! case 0x10: msg_print("You fell through a trap door!"); if (p_ptr->ffall) { --- 608,614 ---- /* Examine the trap sub-val */ switch (c_ptr->feat) { ! case CF_TRAP_TRAP_DOOR: msg_print("You fell through a trap door!"); if (p_ptr->ffall) { *************** *** 601,607 **** dun_level++; break; ! case 0x11: msg_print("You fell into a pit!"); if (p_ptr->ffall) { --- 623,629 ---- dun_level++; break; ! case CF_TRAP_OPEN_PIT: msg_print("You fell into a pit!"); if (p_ptr->ffall) { *************** *** 614,620 **** } break; ! case 0x12: msg_print("You fall into a spiked pit!"); --- 636,642 ---- } break; ! case CF_TRAP_SPIKED_PIT: msg_print("You fall into a spiked pit!"); *************** *** 630,642 **** dam = damroll(2,6); /* Extra spike damage */ ! if (rand_int(100) < 50) { - msg_print("You are impaled!"); dam = dam * 2; ! (void)set_cut(p_ptr->cut + randint(dam)); } /* Take the damage */ --- 652,663 ---- dam = damroll(2,6); /* Extra spike damage */ ! if (percent(50)) { msg_print("You are impaled!"); dam = dam * 2; ! set_cut(p_ptr->cut + randint(dam)); } /* Take the damage */ *************** *** 644,650 **** } break; ! case 0x13: msg_print("You fall into a spiked pit!"); --- 665,671 ---- } break; ! case CF_TRAP_POISON_PIT: msg_print("You fall into a spiked pit!"); *************** *** 660,671 **** dam = damroll(2,6); /* Extra spike damage */ ! if (rand_int(100) < 50) { msg_print("You are impaled on poisonous spikes!"); dam = dam * 2; ! (void)set_cut(p_ptr->cut + randint(dam)); if (p_ptr->resist_pois || p_ptr->oppose_pois) { --- 681,692 ---- dam = damroll(2,6); /* Extra spike damage */ ! if (percent(50)) { msg_print("You are impaled on poisonous spikes!"); dam = dam * 2; ! set_cut(p_ptr->cut + randint(dam)); if (p_ptr->resist_pois || p_ptr->oppose_pois) { *************** *** 675,681 **** else { dam = dam * 2; ! (void)set_poisoned(p_ptr->poisoned + randint(dam)); } } --- 696,702 ---- else { dam = dam * 2; ! set_poisoned(p_ptr->poisoned + randint(dam)); } } *************** *** 685,693 **** break; ! case 0x14: msg_print("You are enveloped in a cloud of smoke!"); ! c_ptr->feat = 0x01; c_ptr->info &= ~CAVE_MARK; note_spot(py,px); lite_spot(py,px); --- 706,714 ---- break; ! case CF_TRAP_SUMMON: msg_print("You are enveloped in a cloud of smoke!"); ! c_ptr->feat = CF_FLOOR; c_ptr->info &= ~CAVE_MARK; note_spot(py, px); lite_spot(py, px); *************** *** 694,727 **** num = 2 + randint(3); for (i = 0; i < num; i++) { ! (void)summon_specific(py, px, dun_level, 0); } break; ! case 0x15: msg_print("You hit a teleport trap!"); teleport_player(100); break; ! case 0x16: msg_print("You are enveloped in flames!"); dam = damroll(4, 6); fire_dam(dam, "a fire trap"); break; ! case 0x17: msg_print("You are splashed with acid!"); dam = damroll(4, 6); acid_dam(dam, "an acid trap"); break; ! case 0x18: if (check_hit(125)) { msg_print("A small dart hits you!"); dam = damroll(1,4); take_hit(dam, name); ! (void)set_slow(p_ptr->slow + rand_int(20) + 20); } else { --- 715,748 ---- num = 2 + randint(3); for (i = 0; i < num; i++) { ! summon_specific(py, px, dun_level, 0); } break; ! case CF_TRAP_TELEPORT: msg_print("You hit a teleport trap!"); teleport_player(100); break; ! case CF_TRAP_FIRE: msg_print("You are enveloped in flames!"); dam = damroll(4, 6); fire_dam(dam, "a fire trap"); break; ! case CF_TRAP_ACID: msg_print("You are splashed with acid!"); dam = damroll(4, 6); acid_dam(dam, "an acid trap"); break; ! case CF_TRAP_DART_SLOW: if (check_hit(125)) { msg_print("A small dart hits you!"); dam = damroll(1,4); take_hit(dam, name); ! set_slow(p_ptr->slow + rand_int(20) + 20); } else { *************** *** 729,741 **** } break; ! case 0x19: if (check_hit(125)) { msg_print("A small dart hits you!"); dam = damroll(1,4); take_hit(dam, name); ! (void)do_dec_stat(A_STR); } else { --- 750,762 ---- } break; ! case CF_TRAP_DART_STR: if (check_hit(125)) { msg_print("A small dart hits you!"); dam = damroll(1,4); take_hit(dam, name); ! do_dec_stat(A_STR); } else { *************** *** 743,755 **** } break; ! case 0x1A: if (check_hit(125)) { msg_print("A small dart hits you!"); dam = damroll(1,4); take_hit(dam, name); ! (void)do_dec_stat(A_DEX); } else { --- 764,776 ---- } break; ! case CF_TRAP_DART_DEX: if (check_hit(125)) { msg_print("A small dart hits you!"); dam = damroll(1,4); take_hit(dam, name); ! do_dec_stat(A_DEX); } else { *************** *** 757,769 **** } break; ! case 0x1B: if (check_hit(125)) { msg_print("A small dart hits you!"); dam = damroll(1,4); take_hit(dam, name); ! (void)do_dec_stat(A_CON); } else { --- 778,790 ---- } break; ! case CF_TRAP_DART_CON: if (check_hit(125)) { msg_print("A small dart hits you!"); dam = damroll(1,4); take_hit(dam, name); ! do_dec_stat(A_CON); } else { *************** *** 771,805 **** } break; ! case 0x1C: msg_print("A black gas surrounds you!"); if (!p_ptr->resist_blind) { ! (void)set_blind(p_ptr->blind + rand_int(50) + 25); } break; ! case 0x1D: msg_print("A gas of scintillating colors surrounds you!"); if (!p_ptr->resist_conf) { ! (void)set_confused(p_ptr->confused + rand_int(20) + 10); } break; ! case 0x1E: msg_print("A pungent green gas surrounds you!"); if (!p_ptr->resist_pois && !p_ptr->oppose_pois) { ! (void)set_poisoned(p_ptr->poisoned + rand_int(20) + 10); } break; ! case 0x1F: msg_print("A strange white mist surrounds you!"); if (!p_ptr->free_act) { ! (void)set_paralyzed(p_ptr->paralyzed + rand_int(10) + 5); } break; } --- 792,826 ---- } break; ! case CF_TRAP_GAS_BLIND: msg_print("A black gas surrounds you!"); if (!p_ptr->resist_blind) { ! set_blind(p_ptr->blind + rand_int(50) + 25); } break; ! case CF_TRAP_GAS_CONFUSE: msg_print("A gas of scintillating colors surrounds you!"); if (!p_ptr->resist_conf) { ! set_confused(p_ptr->confused + rand_int(20) + 10); } break; ! case CF_TRAP_GAS_POISON: msg_print("A pungent green gas surrounds you!"); if (!p_ptr->resist_pois && !p_ptr->oppose_pois) { ! set_poisoned(p_ptr->poisoned + rand_int(20) + 10); } break; ! case CF_TRAP_GAS_SLEEP: msg_print("A strange white mist surrounds you!"); if (!p_ptr->free_act) { ! set_paralyzed(p_ptr->paralyzed + rand_int(10) + 5); } break; } *************** *** 834,843 **** disturb(0, 0); - /* Disturb the monster */ - m_ptr->csleep = 0; - - /* Extract monster name (or "it") */ monster_desc(m_name, m_ptr, 0); --- 855,860 ---- *************** *** 875,881 **** if (test_hit_norm(chance, r_ptr->ac, m_ptr->ml)) { /* Sound */ ! sound(SOUND_HIT); /* Message */ msg_format("You hit %s.", m_name); --- 892,898 ---- if (test_hit_norm(chance, r_ptr->ac, m_ptr->ml)) { /* Sound */ ! game_sound(SOUND_HIT); /* Message */ msg_format("You hit %s.", m_name); *************** *** 884,895 **** k = 1; /* Handle normal weapon */ ! if (i_ptr->k_idx) { ! k = damroll(i_ptr->dd, i_ptr->ds); k = tot_dam_aux(i_ptr, k, m_ptr); if (p_ptr->impact && (k > 50)) do_quake = TRUE; ! k = critical_norm(i_ptr->weight, i_ptr->to_h, k); k += i_ptr->to_d; } --- 901,913 ---- k = 1; /* Handle normal weapon */ ! if (i_ptr->exists()) { ! k = i_ptr->damroll; k = tot_dam_aux(i_ptr, k, m_ptr); if (p_ptr->impact && (k > 50)) do_quake = TRUE; ! k = critical_norm(i_ptr->weight, i_ptr->to_h, k, ! m_ptr); k += i_ptr->to_d; } *************** *** 908,913 **** --- 926,934 ---- /* Damage, check for fear and death */ if (mon_take_hit(c_ptr->m_idx, k, &fear, NULL)) break; + /* Disturb monster */ + m_ptr->set_csleep(0); + /* Confusion attack */ if (p_ptr->confusing) { *************** *** 923,929 **** if (m_ptr->ml) r_ptr->r_flags3 |= RF3_NO_CONF; msg_format("%^s is unaffected.", m_name); } ! else if (rand_int(100) < r_ptr->level) { msg_format("%^s is unaffected.", m_name); } --- 944,950 ---- if (m_ptr->ml) r_ptr->r_flags3 |= RF3_NO_CONF; msg_format("%^s is unaffected.", m_name); } ! else if (percent(r_ptr->level)) { msg_format("%^s is unaffected.", m_name); } *************** *** 930,936 **** else { msg_format("%^s appears confused.", m_name); ! m_ptr->confused += 10 + rand_int(p_ptr->lev) / 5; } } } --- 951,958 ---- else { msg_format("%^s appears confused.", m_name); ! m_ptr->set_confused(m_ptr->confused + ! 10 + rand_int(p_ptr->lev) / 5); } } } *************** *** 939,945 **** else { /* Sound */ ! sound(SOUND_MISS); /* Message */ msg_format("You miss %s.", m_name); --- 961,967 ---- else { /* Sound */ ! game_sound(SOUND_MISS); /* Message */ msg_format("You miss %s.", m_name); *************** *** 951,957 **** if (fear && m_ptr->ml) { /* Sound */ ! sound(SOUND_FLEE); /* Message */ msg_format("%^s flees in terror!", m_name); --- 973,979 ---- if (fear && m_ptr->ml) { /* Sound */ ! game_sound(SOUND_FLEE); /* Message */ msg_format("%^s flees in terror!", m_name); *************** *** 1016,1022 **** (p_ptr->blind || !(c_ptr->info & CAVE_LITE))) { /* Rubble */ ! if (c_ptr->feat == 0x31) { msg_print("You feel some rubble blocking your way."); c_ptr->info |= CAVE_MARK; --- 1038,1044 ---- (p_ptr->blind || !(c_ptr->info & CAVE_LITE))) { /* Rubble */ ! if (c_ptr->feat == CF_RUBBLE) { msg_print("You feel some rubble blocking your way."); c_ptr->info |= CAVE_MARK; *************** *** 1044,1050 **** else { /* Rubble */ ! if (c_ptr->feat == 0x31) { msg_print("There is rubble blocking your way."); } --- 1066,1072 ---- else { /* Rubble */ ! if (c_ptr->feat == CF_RUBBLE) { msg_print("There is rubble blocking your way."); } *************** *** 1120,1126 **** } /* Discover invisible traps */ ! else if (c_ptr->feat == 0x02) { /* Disturb */ disturb(0, 0); --- 1142,1148 ---- } /* Discover invisible traps */ ! else if (c_ptr->feat == CF_TRAP_INVIS) { /* Disturb */ disturb(0, 0); *************** *** 1336,1347 **** /* * Hack -- allow quick "cycling" through the legal directions */ ! static byte cycle[] = { 1, 2, 3, 6, 9, 8, 7, 4, 1, 2, 3, 6, 9, 8, 7, 4, 1 }; /* * Hack -- map each direction into the "middle" of the "cycle[]" array */ ! static byte chome[] = { 0, 8, 9, 10, 7, 0, 11, 6, 5, 4 }; /* * The direction we are running --- 1358,1371 ---- /* * Hack -- allow quick "cycling" through the legal directions */ ! static byte cycle[] = ! { 1, 2, 3, 6, 9, 8, 7, 4, 1, 2, 3, 6, 9, 8, 7, 4, 1 }; /* * Hack -- map each direction into the "middle" of the "cycle[]" array */ ! static byte chome[] = ! { 0, 8, 9, 10, 7, 0, 11, 6, 5, 4 }; /* * The direction we are running *************** *** 1513,1519 **** monster_type *m_ptr = &m_list[c_ptr->m_idx]; /* Visible monster */ ! if (m_ptr->ml) return (TRUE); } /* Visible objects abort running */ --- 1537,1543 ---- monster_type *m_ptr = &m_list[c_ptr->m_idx]; /* Visible monster */ ! if (m_ptr->ml) return TRUE; } /* Visible objects abort running */ *************** *** 1522,1528 **** object_type *i_ptr = &i_list[c_ptr->i_idx]; /* Visible object */ ! if (i_ptr->marked) return (TRUE); } --- 1546,1552 ---- object_type *i_ptr = &i_list[c_ptr->i_idx]; /* Visible object */ ! if (i_ptr->marked) return TRUE; } *************** *** 1538,1568 **** switch (c_ptr->feat) { /* Floors */ ! case 0x01: /* Invis traps */ ! case 0x02: /* Secret doors */ ! case 0x30: /* Normal veins */ ! case 0x32: ! case 0x33: /* Hidden treasure */ ! case 0x34: ! case 0x35: /* Walls */ ! case 0x38: ! case 0x39: ! case 0x3A: ! case 0x3B: ! case 0x3C: ! case 0x3D: ! case 0x3E: ! case 0x3F: /* Ignore */ notice = FALSE; --- 1562,1592 ---- switch (c_ptr->feat) { /* Floors */ ! case CF_FLOOR: /* Invis traps */ ! case CF_TRAP_INVIS: /* Secret doors */ ! case CF_DOOR_SECRET: /* Normal veins */ ! case CF_MAGMA: ! case CF_QUARTZ: /* Hidden treasure */ ! case CF_MAGMA_TREASURE: ! case CF_QUARTZ_TREASURE: /* Walls */ ! case CF_GRANITE_BASIC: ! case CF_GRANITE_INNER: ! case CF_GRANITE_OUTER: ! case CF_GRANITE_SOLID: ! case CF_PERMANENT_BASIC: ! case CF_PERMANENT_INNER: ! case CF_PERMANENT_OUTER: ! case CF_PERMANENT_SOLID: /* Ignore */ notice = FALSE; *************** *** 1571,1578 **** break; /* Stairs */ ! case 0x06: ! case 0x07: /* Option -- ignore */ if (find_ignore_stairs) notice = FALSE; --- 1595,1602 ---- break; /* Stairs */ ! case CF_STAIRS_UP: ! case CF_STAIRS_DOWN: /* Option -- ignore */ if (find_ignore_stairs) notice = FALSE; *************** *** 1581,1588 **** break; /* Open doors */ ! case 0x04: ! case 0x05: /* Option -- ignore */ if (find_ignore_doors) notice = FALSE; --- 1605,1612 ---- break; /* Open doors */ ! case CF_DOOR_OPEN: ! case CF_DOOR_BROKEN: /* Option -- ignore */ if (find_ignore_doors) notice = FALSE; diff -w -c -r ick-279/cmd2.c utumno/cmd2.c *** ick-279/cmd2.c Thu May 15 17:12:08 1997 --- utumno/cmd2.c Thu May 15 17:45:47 1997 *************** *** 174,189 **** scatter(&ny, &nx, y, x, d, 0); /* Must be a clean floor grid */ ! if (!clean_grid_bold(ny, nx)) continue; /* Opening a chest */ opening_chest = TRUE; ! /* The "pval" of a chest is how "good" it is */ ! object_level = ABS(i_ptr->pval); ! /* Small chests often drop gold */ ! if (small && (rand_int(100) < 75)) { place_gold(ny, nx); } --- 174,189 ---- scatter(&ny, &nx, y, x, d, 0); /* Must be a clean floor grid */ ! if (!clean_stackable_grid_bold(ny, nx)) continue; /* Opening a chest */ opening_chest = TRUE; ! /* Make it better than the current level */ ! object_level = dun_level + 5; ! /* Small chests sometimes drop gold */ ! if (small && percent(50)) { place_gold(ny, nx); } *************** *** 207,213 **** lite_spot(ny, nx); /* Under the player */ ! if ((ny == py) && (nx == px)) { msg_print("You feel something roll beneath your feet."); } --- 207,213 ---- lite_spot(ny, nx); /* Under the player */ ! if ((nx == px) && (ny == py)) { msg_print("You feel something roll beneath your feet."); } *************** *** 219,228 **** } /* Empty */ ! i_ptr->pval = 0; /* Known */ ! object_known(i_ptr); } --- 219,228 ---- } /* Empty */ ! i_ptr->set_pval(0); /* Known */ ! i_ptr->object_known(); } *************** *** 251,257 **** { msg_print("A small needle has pricked you!"); take_hit(damroll(1, 4), "a poison needle"); ! (void)do_dec_stat(A_STR); } /* Lose constitution */ --- 251,257 ---- { msg_print("A small needle has pricked you!"); take_hit(damroll(1, 4), "a poison needle"); ! do_dec_stat(A_STR); } /* Lose constitution */ *************** *** 259,265 **** { msg_print("A small needle has pricked you!"); take_hit(damroll(1, 4), "a poison needle"); ! (void)do_dec_stat(A_CON); } /* Poison */ --- 259,265 ---- { msg_print("A small needle has pricked you!"); take_hit(damroll(1, 4), "a poison needle"); ! do_dec_stat(A_CON); } /* Poison */ *************** *** 268,274 **** msg_print("A puff of green gas surrounds you!"); if (!(p_ptr->resist_pois || p_ptr->oppose_pois)) { ! (void)set_poisoned(p_ptr->poisoned + 10 + randint(20)); } } --- 268,274 ---- msg_print("A puff of green gas surrounds you!"); if (!(p_ptr->resist_pois || p_ptr->oppose_pois)) { ! set_poisoned(p_ptr->poisoned + 10 + randint(20)); } } *************** *** 298,304 **** { msg_print("There is a sudden explosion!"); msg_print("Everything inside the chest is destroyed!"); ! i_ptr->pval = 0; take_hit(damroll(5, 8), "an exploding chest"); } } --- 298,304 ---- { msg_print("There is a sudden explosion!"); msg_print("Everything inside the chest is destroyed!"); ! i_ptr->set_pval(0); take_hit(damroll(5, 8), "an exploding chest"); } } *************** *** 496,501 **** --- 496,504 ---- /* Closed door */ else { + /* Use energy */ + energy_use = 100; + /* Open the door */ c_ptr->feat = 0x04; *************** *** 952,958 **** if (j < 2) j = 2; /* Must find the trap first. */ ! if (!object_known_p(i_ptr)) { msg_print("I don't see any traps."); } --- 955,961 ---- if (j < 2) j = 2; /* Must find the trap first. */ ! if (!i_ptr->is_known()) { msg_print("I don't see any traps."); } *************** *** 974,980 **** { msg_print("You have disarmed the chest."); gain_exp(i_ptr->pval); ! i_ptr->pval = (0 - i_ptr->pval); } /* Failure -- Keep trying */ --- 977,983 ---- { msg_print("You have disarmed the chest."); gain_exp(i_ptr->pval); ! i_ptr->set_pval(-i_ptr->pval); } /* Failure -- Keep trying */ *************** *** 1085,1091 **** * A closed door can be opened - harder if locked. Any door might be * bashed open (and thereby broken). Bashing a door is (potentially) * faster! You move into the door way. To open a stuck door, it must ! * be bashed. A closed door can be jammed (see do_cmd_spike()). * * Creatures can also open or bash doors, see elsewhere. * --- 1088,1094 ---- * A closed door can be opened - harder if locked. Any door might be * bashed open (and thereby broken). Bashing a door is (potentially) * faster! You move into the door way. To open a stuck door, it must ! * be bashed. * * Creatures can also open or bash doors, see elsewhere. * *************** *** 1095,1101 **** void do_cmd_bash() { int y, x, dir; - int bash, temp; cave_type *c_ptr; --- 1098,1103 ---- *************** *** 1127,1134 **** c_ptr = &cave[y][x]; /* Nothing useful */ ! if ((c_ptr->feat < 0x20) || ! (c_ptr->feat > 0x2F)) { /* Message */ msg_print("You see nothing there to bash."); --- 1129,1135 ---- c_ptr = &cave[y][x]; /* Nothing useful */ ! if ((c_ptr->feat < 0x20) || (c_ptr->feat > 0x2F)) { /* Message */ msg_print("You see nothing there to bash."); *************** *** 1216,1222 **** msg_print("You are off-balance."); /* Hack -- Lose balance ala paralysis */ ! (void)set_paralyzed(p_ptr->paralyzed + 2 + rand_int(2)); } } } --- 1217,1223 ---- msg_print("You are off-balance."); /* Hack -- Lose balance ala paralysis */ ! set_paralyzed(p_ptr->paralyzed + 2 + rand_int(2)); } } } *************** *** 1228,1339 **** /* - * Find the index of some "spikes", if possible. - * - * XXX XXX XXX Let user choose a pile of spikes, perhaps? - */ - static bool get_spike(int *ip) - { - int i; - - /* Check every item in the pack */ - for (i = 0; i < INVEN_PACK; i++) - { - object_type *i_ptr = &inventory[i]; - - /* Check the "tval" code */ - if (i_ptr->tval == TV_SPIKE) - { - /* Save the spike index */ - (*ip) = i; - - /* Success */ - return (TRUE); - } - } - - /* Oops */ - return (FALSE); - } - - - - /* - * Jam a closed door with a spike - * - * This command may NOT be repeated - */ - void do_cmd_spike() - { - int y, x, dir, item; - - cave_type *c_ptr; - - - /* Get a "repeated" direction */ - if (get_rep_dir(&dir)) - { - /* Get location */ - y = py + ddy[dir]; - x = px + ddx[dir]; - - /* Get grid and contents */ - c_ptr = &cave[y][x]; - - /* Require closed door */ - if ((c_ptr->feat < 0x20) || - (c_ptr->feat > 0x2F)) - { - /* Message */ - msg_print("You see nothing there to spike."); - } - - /* Get a spike */ - else if (!get_spike(&item)) - { - /* Message */ - msg_print("You have no spikes!"); - } - - /* Is a monster in the way? */ - else if (c_ptr->m_idx) - { - /* Take a turn */ - energy_use = 100; - - /* Message */ - msg_print("There is a monster in the way!"); - - /* Attack */ - py_attack(y, x); - } - - /* Go for it */ - else - { - /* Take a turn */ - energy_use = 100; - - /* Successful jamming */ - msg_print("You jam the door with a spike."); - - /* Convert "locked" to "stuck" XXX XXX XXX */ - if (c_ptr->feat < 0x28) c_ptr->feat |= 0x08; - - /* Add one spike to the door XXX XXX XXX */ - if ((c_ptr->feat & 0x07) < 0x07) c_ptr->feat++; - - /* Use up, and describe, a single spike, from the bottom */ - inven_item_increase(item, -1); - inven_item_describe(item); - inven_item_optimize(item); - } - } - } - - - - /* * Support code for the "Walk" and "Jump" commands */ void do_cmd_walk(int pickup) --- 1229,1234 ---- *************** *** 1548,1561 **** { /* Burning flasks */ case TV_FLASK: ! return (100); /* Very breakable objects */ case TV_POTION: case TV_BOTTLE: case TV_FOOD: ! case TV_JUNK: ! return (50); /* Somewhat breakable objects */ case TV_LITE: --- 1443,1455 ---- { /* Burning flasks */ case TV_FLASK: ! return 100; /* Very breakable objects */ case TV_POTION: case TV_BOTTLE: case TV_FOOD: ! return 50; /* Somewhat breakable objects */ case TV_LITE: *************** *** 1562,1579 **** case TV_SCROLL: case TV_ARROW: case TV_SKELETON: ! return (30); /* Slightly breakable objects */ case TV_WAND: case TV_SHOT: case TV_BOLT: ! case TV_SPIKE: ! return (20); } /* Normal objects */ ! return (10); } --- 1456,1472 ---- case TV_SCROLL: case TV_ARROW: case TV_SKELETON: ! return 30; /* Slightly breakable objects */ case TV_WAND: case TV_SHOT: case TV_BOLT: ! return 20; } /* Normal objects */ ! return 10; } *************** *** 1664,1670 **** /* Create a "local missile object" */ throw_obj = *i_ptr; ! throw_obj.number = 1; /* Reduce and describe inventory */ if (item >= 0) --- 1557,1563 ---- /* Create a "local missile object" */ throw_obj = *i_ptr; ! throw_obj.set_number(1); /* Reduce and describe inventory */ if (item >= 0) *************** *** 1699,1708 **** tdis = 10; /* Base damage from thrown object plus launcher bonus */ ! tdam = damroll(i_ptr->dd, i_ptr->ds) + i_ptr->to_d + j_ptr->to_d; /* Actually "fire" the object */ ! bonus = (p_ptr->to_h + i_ptr->to_h + j_ptr->to_h); chance = (p_ptr->skill_thb + (bonus * BTH_PLUS_ADJ)); /* Assume a base multiplier */ --- 1592,1601 ---- tdis = 10; /* Base damage from thrown object plus launcher bonus */ ! tdam = i_ptr->damroll + i_ptr->to_d + j_ptr->to_d; /* Actually "fire" the object */ ! bonus = p_ptr->to_h + i_ptr->to_h + j_ptr->to_h; chance = (p_ptr->skill_thb + (bonus * BTH_PLUS_ADJ)); /* Assume a base multiplier */ *************** *** 1874,1880 **** /* Apply special damage XXX XXX XXX */ tdam = tot_dam_aux(i_ptr, tdam, m_ptr); ! tdam = critical_shot(i_ptr->weight, i_ptr->to_h, tdam); /* No negative damage */ if (tdam < 0) tdam = 0; --- 1767,1774 ---- /* Apply special damage XXX XXX XXX */ tdam = tot_dam_aux(i_ptr, tdam, m_ptr); ! tdam = critical_shot(i_ptr->weight, i_ptr->to_h, ! tdam); /* No negative damage */ if (tdam < 0) tdam = 0; *************** *** 1904,1910 **** char m_name[80]; /* Sound */ ! sound(SOUND_FLEE); /* Get the monster name (or "it") */ monster_desc(m_name, m_ptr, 0); --- 1798,1804 ---- char m_name[80]; /* Sound */ ! game_sound(SOUND_FLEE); /* Get the monster name (or "it") */ monster_desc(m_name, m_ptr, 0); *************** *** 1957,1964 **** object_type throw_obj; object_type *i_ptr; - bool ok_throw = FALSE; - bool hit_body = FALSE; int missile_attr; --- 1851,1856 ---- *************** *** 1967,1973 **** char i_name[80]; - /* Get an item (from inven or floor) */ if (!get_item(&item, "Throw which item? ", FALSE, TRUE, TRUE)) { --- 1859,1864 ---- *************** *** 1982,1988 **** } else { ! i_ptr = &i_list[0 - item]; } --- 1873,1879 ---- } else { ! i_ptr = &i_list[-item]; } *************** *** 1992,1998 **** /* Create a "local missile object" */ throw_obj = *i_ptr; ! throw_obj.number = 1; /* Reduce and describe inventory */ if (item >= 0) --- 1883,1889 ---- /* Create a "local missile object" */ throw_obj = *i_ptr; ! throw_obj.set_number(1); /* Reduce and describe inventory */ if (item >= 0) *************** *** 2033,2039 **** if (tdis > 10) tdis = 10; /* Hack -- Base damage from thrown object */ ! tdam = damroll(i_ptr->dd, i_ptr->ds) + i_ptr->to_d; /* Chance of hitting */ chance = (p_ptr->skill_tht + (p_ptr->to_h * BTH_PLUS_ADJ)); --- 1924,1930 ---- if (tdis > 10) tdis = 10; /* Hack -- Base damage from thrown object */ ! tdam = i_ptr->damroll + i_ptr->to_d; /* Chance of hitting */ chance = (p_ptr->skill_tht + (p_ptr->to_h * BTH_PLUS_ADJ)); *************** *** 2044,2051 **** /* Start at the player */ - y = py; x = px; /* Predict the "target" location */ tx = px + 99 * ddx[dir]; --- 1935,1942 ---- /* Start at the player */ x = px; + y = py; /* Predict the "target" location */ tx = px + 99 * ddx[dir]; *************** *** 2067,2077 **** for (cur_dis = 0; cur_dis < tdis; ) { /* Hack -- Stop at the target */ ! if ((y == ty) && (x == tx)) break; /* Calculate the new location (see "project()") */ - ny = y; nx = x; mmove2(&ny, &nx, py, px, ty, tx); /* Stopped by walls/doors */ --- 1958,1968 ---- for (cur_dis = 0; cur_dis < tdis; ) { /* Hack -- Stop at the target */ ! if ((x == tx) && (y == ty)) break; /* Calculate the new location (see "project()") */ nx = x; + ny = y; mmove2(&ny, &nx, py, px, ty, tx); /* Stopped by walls/doors */ *************** *** 2166,2172 **** /* Apply special damage XXX XXX XXX */ tdam = tot_dam_aux(i_ptr, tdam, m_ptr); ! tdam = critical_shot(i_ptr->weight, i_ptr->to_h, tdam); /* No negative damage */ if (tdam < 0) tdam = 0; --- 2057,2064 ---- /* Apply special damage XXX XXX XXX */ tdam = tot_dam_aux(i_ptr, tdam, m_ptr); ! tdam = critical_shot(i_ptr->weight, i_ptr->to_h, ! tdam); /* No negative damage */ if (tdam < 0) tdam = 0; *************** *** 2196,2202 **** char m_name[80]; /* Sound */ ! sound(SOUND_FLEE); /* Get the monster name (or "it") */ monster_desc(m_name, m_ptr, 0); --- 2088,2094 ---- char m_name[80]; /* Sound */ ! game_sound(SOUND_FLEE); /* Get the monster name (or "it") */ monster_desc(m_name, m_ptr, 0); diff -w -c -r ick-279/cmd3.c utumno/cmd3.c *** ick-279/cmd3.c Thu May 15 17:12:08 1997 --- utumno/cmd3.c Thu May 15 17:45:47 1997 *************** *** 44,50 **** /* Make a copy to carry */ tmp_obj = *i_ptr; ! tmp_obj.number = amt; /* What are we "doing" with the object */ if (amt < i_ptr->number) --- 44,50 ---- /* Make a copy to carry */ tmp_obj = *i_ptr; ! tmp_obj.set_number(amt); /* What are we "doing" with the object */ if (amt < i_ptr->number) *************** *** 112,118 **** /* Make a "fake" object */ tmp_obj = *i_ptr; ! tmp_obj.number = amt; /* What are we "doing" with the object */ if (amt < i_ptr->number) --- 112,118 ---- /* Make a "fake" object */ tmp_obj = *i_ptr; ! tmp_obj.set_number(amt); /* What are we "doing" with the object */ if (amt < i_ptr->number) *************** *** 323,329 **** slot = wield_slot(i_ptr); /* Prevent wielding into a cursed slot */ ! if (cursed_p(&inventory[slot])) { /* Describe it */ --- 323,329 ---- slot = wield_slot(i_ptr); /* Prevent wielding into a cursed slot */ ! if (inventory[slot].is_cursed()) { /* Describe it */ *************** *** 339,345 **** /* Verify potential overflow */ if ((inven_cnt >= INVEN_PACK) && ! ((item < 0) || (i_ptr->number > 1))) { /* Verify with the player */ if (other_query_flag && --- 339,345 ---- /* Verify potential overflow */ if ((inven_cnt >= INVEN_PACK) && ! ((item < 0) || i_ptr->is_plural())) { /* Verify with the player */ if (other_query_flag && *************** *** 352,358 **** /* Get a copy of the object to wield */ tmp_obj = *i_ptr; ! tmp_obj.number = 1; /* Decrease the item (from the pack) */ if (item >= 0) --- 352,358 ---- /* Get a copy of the object to wield */ tmp_obj = *i_ptr; ! tmp_obj.set_number(1); /* Decrease the item (from the pack) */ if (item >= 0) *************** *** 372,378 **** i_ptr = &inventory[slot]; /* Take off the "entire" item if one is there */ ! if (inventory[slot].k_idx) inven_takeoff(slot, 255); /*** Could make procedure "inven_wield()" ***/ --- 372,378 ---- i_ptr = &inventory[slot]; /* Take off the "entire" item if one is there */ ! if (inventory[slot].exists()) inven_takeoff(slot, 255); /*** Could make procedure "inven_wield()" ***/ *************** *** 410,422 **** msg_format("%^s %s (%c).", act, i_name, index_to_label(slot)); /* Cursed! */ ! if (cursed_p(i_ptr)) { /* Warn the player */ msg_print("Oops! It feels deathly cold!"); /* Note the curse */ ! i_ptr->ident |= ID_SENSE; } /* Recalculate bonuses */ --- 410,422 ---- msg_format("%^s %s (%c).", act, i_name, index_to_label(slot)); /* Cursed! */ ! if (i_ptr->is_cursed()) { /* Warn the player */ msg_print("Oops! It feels deathly cold!"); /* Note the curse */ ! i_ptr->set_ident_flag(ID_SENSE); } /* Recalculate bonuses */ *************** *** 474,480 **** /* Item is cursed */ ! if (cursed_p(i_ptr)) { /* Oops */ msg_print("Hmmm, it seems to be cursed."); --- 474,480 ---- /* Item is cursed */ ! if (i_ptr->is_cursed()) { /* Oops */ msg_print("Hmmm, it seems to be cursed."); *************** *** 523,529 **** /* Cannot remove cursed items */ ! if ((item >= INVEN_WIELD) && cursed_p(i_ptr)) { /* Oops */ msg_print("Hmmm, it seems to be cursed."); --- 523,529 ---- /* Cannot remove cursed items */ ! if ((item >= INVEN_WIELD) && i_ptr->is_cursed()) { /* Oops */ msg_print("Hmmm, it seems to be cursed."); *************** *** 534,540 **** /* See how many items */ ! if (i_ptr->number > 1) { /* Get a quantity */ amt = get_quantity(NULL, i_ptr->number); --- 534,540 ---- /* See how many items */ ! if (i_ptr->is_plural()) { /* Get a quantity */ amt = get_quantity(NULL, i_ptr->number); *************** *** 598,604 **** /* See how many items */ ! if (i_ptr->number > 1) { /* Get a quantity */ amt = get_quantity(NULL, i_ptr->number); --- 598,604 ---- /* See how many items */ ! if (i_ptr->is_plural()) { /* Get a quantity */ amt = get_quantity(NULL, i_ptr->number); *************** *** 610,618 **** /* Describe the object */ old_number = i_ptr->number; ! i_ptr->number = amt; object_desc(i_name, i_ptr, TRUE, 3); ! i_ptr->number = old_number; /* Make a verification */ sprintf(out_val, "Really destroy %s? ", i_name); --- 610,618 ---- /* Describe the object */ old_number = i_ptr->number; ! i_ptr->set_number(amt); object_desc(i_name, i_ptr, TRUE, 3); ! i_ptr->set_number(old_number); /* Make a verification */ sprintf(out_val, "Really destroy %s? ", i_name); *************** *** 623,629 **** energy_use = 100; /* Artifacts cannot be destroyed */ ! if (artifact_p(i_ptr)) { cptr feel = "special"; --- 623,629 ---- energy_use = 100; /* Artifacts cannot be destroyed */ ! if (i_ptr->is_artifact()) { cptr feel = "special"; *************** *** 631,643 **** msg_format("You cannot destroy %s.", i_name); /* Hack -- Handle icky artifacts */ ! if (cursed_p(i_ptr) || broken_p(i_ptr)) feel = "terrible"; /* Hack -- inscribe the artifact */ ! i_ptr->note = quark_add(feel); /* We have "felt" it (again) */ ! i_ptr->ident |= (ID_SENSE); /* Redraw the choice window */ p_ptr->redraw |= (PR_CHOOSE); --- 631,643 ---- msg_format("You cannot destroy %s.", i_name); /* Hack -- Handle icky artifacts */ ! if (i_ptr->is_cursed() || i_ptr->is_cursed()) feel = "terrible"; /* Hack -- inscribe the artifact */ ! i_ptr->set_note(quark_add(feel)); /* We have "felt" it (again) */ ! i_ptr->set_ident_flag(ID_SENSE); /* Redraw the choice window */ p_ptr->redraw |= (PR_CHOOSE); *************** *** 698,709 **** /* Get the item (on the floor) */ else { ! i_ptr = &i_list[0 - item]; } /* Require full knowledge */ ! if (!(i_ptr->ident & ID_MENTAL)) { msg_print("You have no special knowledge about that item."); return; --- 698,709 ---- /* Get the item (on the floor) */ else { ! i_ptr = &i_list[-item]; } /* Require full knowledge */ ! if (!i_ptr->test_ident_flag(ID_MENTAL)) { msg_print("You have no special knowledge about that item."); return; *************** *** 725,730 **** --- 725,731 ---- /* * Remove the inscription from an object * XXX Mention item (when done)? + * XXX get_item only allows items with inscriptions? */ void do_cmd_uninscribe(void) { *************** *** 755,761 **** /* Nothing to remove */ if (!i_ptr->note) { ! msg_print("That item had no inscription to remove."); return; } --- 756,762 ---- /* Nothing to remove */ if (!i_ptr->note) { ! msg_print("That item has no inscription to remove."); return; } *************** *** 763,769 **** msg_print("Inscription removed."); /* Remove the incription */ ! i_ptr->note = 0; /* Redraw the choice window */ p_ptr->redraw |= (PR_CHOOSE); --- 764,770 ---- msg_print("Inscription removed."); /* Remove the incription */ ! i_ptr->set_note(0); /* Redraw the choice window */ p_ptr->redraw |= (PR_CHOOSE); *************** *** 783,789 **** object_type *i_ptr; char i_name[80]; - char out_val[80]; --- 784,789 ---- *************** *** 827,839 **** if (get_string("Inscription: ", out_val, 80)) { /* Save the inscription */ ! i_ptr->note = quark_add(out_val); /* Redraw the choice window */ ! p_ptr->redraw |= (PR_CHOOSE); /* Combine the pack */ ! p_ptr->notice |= (PN_COMBINE); } } --- 827,839 ---- if (get_string("Inscription: ", out_val, 80)) { /* Save the inscription */ ! i_ptr->set_note(quark_add(out_val)); /* Redraw the choice window */ ! p_ptr->redraw |= PR_CHOOSE; /* Combine the pack */ ! p_ptr->notice |= PN_COMBINE; } } *************** *** 897,903 **** j_ptr = &inventory[INVEN_LITE]; /* Refuel */ ! j_ptr->pval += i_ptr->pval; /* Message */ msg_print("You fuel your lamp."); --- 897,903 ---- j_ptr = &inventory[INVEN_LITE]; /* Refuel */ ! j_ptr->set_pval(j_ptr->pval + i_ptr->pval); /* Message */ msg_print("You fuel your lamp."); *************** *** 905,911 **** /* Comment */ if (j_ptr->pval >= FUEL_LAMP) { ! j_ptr->pval = FUEL_LAMP; msg_print("Your lamp is full."); } --- 905,911 ---- /* Comment */ if (j_ptr->pval >= FUEL_LAMP) { ! j_ptr->set_pval(FUEL_LAMP); msg_print("Your lamp is full."); } *************** *** 938,947 **** { /* Torches are okay */ if ((i_ptr->tval == TV_LITE) && ! (i_ptr->sval == SV_LITE_TORCH)) return (TRUE); /* Assume not okay */ ! return (FALSE); } --- 938,947 ---- { /* Torches are okay */ if ((i_ptr->tval == TV_LITE) && ! (i_ptr->sval == SV_LITE_TORCH)) return TRUE; /* Assume not okay */ ! return FALSE; } *************** *** 975,981 **** /* Get the item (on the floor) */ else { ! i_ptr = &i_list[0 - item]; } --- 975,981 ---- /* Get the item (on the floor) */ else { ! i_ptr = &i_list[-item]; } *************** *** 986,992 **** j_ptr = &inventory[INVEN_LITE]; /* Refuel */ ! j_ptr->pval += i_ptr->pval + 5; /* Message */ msg_print("You combine the torches."); --- 986,992 ---- j_ptr = &inventory[INVEN_LITE]; /* Refuel */ ! j_ptr->set_pval(j_ptr->pval + i_ptr->pval + 5); /* Message */ msg_print("You combine the torches."); *************** *** 994,1000 **** /* Over-fuel message */ if (j_ptr->pval >= FUEL_TORCH) { ! j_ptr->pval = FUEL_TORCH; msg_print("Your torch is fully fueled."); } --- 994,1000 ---- /* Over-fuel message */ if (j_ptr->pval >= FUEL_TORCH) { ! j_ptr->set_pval(FUEL_TORCH); msg_print("Your torch is fully fueled."); } *************** *** 1257,1263 **** prep = TRUE; /* Ignore floors */ ! if (f == 0x01) f = 0; } --- 1257,1263 ---- prep = TRUE; /* Ignore floors */ ! if (f == CF_FLOOR) f = 0; } *************** *** 1264,1271 **** /* Actual items */ if (c_ptr->i_idx && i_ptr->marked) { /* Obtain an object description */ ! object_desc(i_name, i_ptr, TRUE, 3); /* Describe the object */ sprintf(out_val, "%s%s%s. --pause--", s1, s2, i_name); --- 1264,1275 ---- /* Actual items */ if (c_ptr->i_idx && i_ptr->marked) { + object_type *j_ptr = i_ptr; + + for (;;) + { /* Obtain an object description */ ! object_desc(i_name, j_ptr, TRUE, 3); /* Describe the object */ sprintf(out_val, "%s%s%s. --pause--", s1, s2, i_name); *************** *** 1276,1287 **** /* Use "space" to advance */ if (query != ' ') return (query); ! /* Change the intro */ s1 = "It is "; - /* Plurals */ - if (i_ptr->number > 1) s1 = "They are "; - /* Use a preposition with terrain */ prep = TRUE; --- 1280,1300 ---- /* Use "space" to advance */ if (query != ' ') return (query); ! /* Get next or break */ ! if (!j_ptr->next_i_idx) break; ! j_ptr = &i_list[j_ptr->next_i_idx]; ! } ! ! /* Change intro -- based on plural status */ ! if (i_ptr->is_plural()) ! { ! s1 = "They are "; ! } ! else ! { s1 = "It is "; + } /* Use a preposition with terrain */ prep = TRUE; *************** *** 1306,1312 **** if (is_a_vowel(name[0])) p2 = "an "; /* Hack -- store doors */ ! if ((f >= 0x08) && (f <= 0x0F)) p2 = "the entrance to the "; /* Display a message */ sprintf(out_val, "%s%s%s%s. --pause--", s1, p1, p2, name); --- 1319,1325 ---- if (is_a_vowel(name[0])) p2 = "an "; /* Hack -- store doors */ ! if ((f >= 0x08) && (f <= 0x0F)) p2 = "at the entrance to the "; /* Display a message */ sprintf(out_val, "%s%s%s%s. --pause--", s1, p1, p2, name); *************** *** 1669,1675 **** "?:A scroll", "@:You", "A:Angel", ! "B:Bird", "C:Canine", "D:Ancient Dragon/Wyrm", "E:Elemental", --- 1682,1688 ---- "?:A scroll", "@:You", "A:Angel", ! "B:Bat/Bird", "C:Canine", "D:Ancient Dragon/Wyrm", "E:Elemental", *************** *** 1678,1684 **** "H:Hybrid", "I:Insect", "J:Snake", ! "K:Killer Beetle", "L:Lich", "M:Multi-Headed Reptile", /* "N:unused", */ --- 1691,1697 ---- "H:Hybrid", "I:Insect", "J:Snake", ! /* "K:unused", */ "L:Lich", "M:Multi-Headed Reptile", /* "N:unused", */ *************** *** 1699,1707 **** "]:Misc. armor", "^:A trap", "_:A staff", ! /* "`:unused", */ "a:Ant", ! "b:Bat", "c:Centipede", "d:Dragon", "e:Floating Eye", --- 1712,1721 ---- "]:Misc. armor", "^:A trap", "_:A staff", ! /* " ! :unused", */ "a:Ant", ! "b:Beetle", "c:Centipede", "d:Dragon", "e:Floating Eye", *************** *** 1711,1717 **** "i:Icky Thing", "j:Jelly", "k:Kobold", ! "l:Louse", "m:Mold", "n:Naga", "o:Orc", --- 1725,1731 ---- "i:Icky Thing", "j:Jelly", "k:Kobold", ! /* "l:unused", */ "m:Mold", "n:Naga", "o:Orc", *************** *** 1726,1732 **** /* "x:unused", */ "y:Yeek", "z:Zombie/Mummy", ! "{:A missile (arrow/bolt/shot)", "|:An edged weapon (sword/dagger/etc)", "}:A launcher (bow/crossbow/sling)", "~:A tool (or miscellaneous item)", --- 1740,1747 ---- /* "x:unused", */ "y:Yeek", "z:Zombie/Mummy", ! " ! {:A missile (arrow/bolt/shot)", "|:An edged weapon (sword/dagger/etc)", "}:A launcher (bow/crossbow/sling)", "~:A tool (or miscellaneous item)", diff -w -c -r ick-279/cmd4.c utumno/cmd4.c *** ick-279/cmd4.c Thu May 15 17:12:08 1997 --- utumno/cmd4.c Thu May 15 17:45:47 1997 *************** *** 75,85 **** /* Combine and Reorder the pack (later) */ ! p_ptr->notice |= (PN_COMBINE | PN_REORDER); /* Update torch */ ! p_ptr->update |= (PU_TORCH); /* Update stuff */ p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS); --- 75,85 ---- /* Combine and Reorder the pack (later) */ ! p_ptr->notice |= PN_COMBINE | PN_REORDER; /* Update torch */ ! p_ptr->update |= PU_TORCH; /* Update stuff */ p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS); *************** *** 137,143 **** for (flag = FALSE; !flag; ) { /* Display the player */ ! display_player(history); /* Prompt */ prt("['C' to change name, 'F' to dump file, 'H' for history, or ESCAPE]", 21, 2); --- 137,143 ---- for (flag = FALSE; !flag; ) { /* Display the player */ ! display_player(history, FALSE); /* Prompt */ prt("['C' to change name, 'F' to dump file, 'H' for history, or ESCAPE]", 21, 2); *************** *** 343,350 **** /* Display the options */ for (i = 0; i < n; i++) { ! sprintf(buf, "%-48s: %s ", options[opt[i]].o_desc, ! (*options[opt[i]].o_var ? "yes" : "no ")); prt(buf, i + 2, 0); } --- 343,350 ---- /* Display the options */ for (i = 0; i < n; i++) { ! sprintf(buf, "[%c] %-48s ", (*options[opt[i]].o_var) ? 'X' : ' ', ! options[opt[i]].o_desc); prt(buf, i + 2, 0); } *************** *** 355,361 **** /* Interact with the player */ while (TRUE) { ! move_cursor(i + 2, 50); ch = inkey(); --- 355,361 ---- /* Interact with the player */ while (TRUE) { ! move_cursor(i + 2, 1); ch = inkey(); *************** *** 379,395 **** case 'y': case 'Y': case '6': ! put_str("yes ", i + 2, 50); (*options[opt[i]].o_var) = TRUE; - i = (i + 1) % n; break; case 'n': case 'N': case '4': ! put_str("no ", i + 2, 50); (*options[opt[i]].o_var) = FALSE; - i = (i + 1) % n; break; default: --- 379,393 ---- case 'y': case 'Y': case '6': ! put_str("X", i + 2, 1); (*options[opt[i]].o_var) = TRUE; break; case 'n': case 'N': case '4': ! put_str(" ", i + 2, 1); (*options[opt[i]].o_var) = FALSE; break; default: *************** *** 494,500 **** } /* Cheating Options XXX XXX XXX */ ! else if ((k == 'C') && can_be_wizard) { /* Process the cheating options */ do_cmd_options_aux(255, "Cheating Options"); --- 492,498 ---- } /* Cheating Options XXX XXX XXX */ ! else if (((k == 'C') || (k == 'c')) && can_be_wizard) { /* Process the cheating options */ do_cmd_options_aux(255, "Cheating Options"); *************** *** 509,515 **** } /* Hack -- Delay Speed */ ! else if (k == 'D') { /* Prompt */ prt("Command: Base Delay Speed", 14, 0); --- 507,513 ---- } /* Hack -- Delay Speed */ ! else if ((k == 'D') || (k == 'd')) { /* Prompt */ prt("Command: Base Delay Speed", 14, 0); *************** *** 528,534 **** } /* Hack -- hitpoint warning factor */ ! else if (k == 'H') { /* Prompt */ prt("Command: Hitpoint Warning", 14, 0); --- 526,532 ---- } /* Hack -- hitpoint warning factor */ ! else if ((k == 'H') || (k == 'h')) { /* Prompt */ prt("Command: Hitpoint Warning", 14, 0); *************** *** 536,543 **** /* Get a new value */ while (1) { ! prt(format("Current hitpoint warning: %d0%%", ! hitpoint_warn), 18, 0); prt("Hitpoint Warning (0-9 or ESC to accept): ", 16, 0); k = inkey(); if (k == ESCAPE) break; --- 534,541 ---- /* Get a new value */ while (1) { ! prt(format("Current hitpoint warning: %d%%", ! hitpoint_warn*10), 18, 0); prt("Hitpoint Warning (0-9 or ESC to accept): ", 16, 0); k = inkey(); if (k == ESCAPE) break; *************** *** 1755,1763 **** */ void do_cmd_version(void) { ! /* Silly message */ ! msg_format("You are playing Angband %d.%d.%d. Type '?' for more info.", ! VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH); } --- 1753,1760 ---- */ void do_cmd_version(void) { ! msg_format("You are playing Utumno %s. Type '?' for more info.", ! VERSION_STRING); } *************** *** 2081,2090 **** object_type *i_ptr = &i_list[c_ptr->i_idx]; /* Ignore non-artifacts */ ! if (!artifact_p(i_ptr)) continue; /* Ignore known items */ ! if (object_known_p(i_ptr)) continue; /* Note the artifact */ okay[i_ptr->name1] = FALSE; --- 2078,2087 ---- object_type *i_ptr = &i_list[c_ptr->i_idx]; /* Ignore non-artifacts */ ! if (!i_ptr->is_artifact()) continue; /* Ignore known items */ ! if (i_ptr->is_known()) continue; /* Note the artifact */ okay[i_ptr->name1] = FALSE; *************** *** 2093,2110 **** } /* Check the inventory */ ! for (i = 0; i < INVEN_PACK; i++) { object_type *i_ptr = &inventory[i]; /* Ignore non-objects */ ! if (!i_ptr->k_idx) continue; /* Ignore non-artifacts */ ! if (!artifact_p(i_ptr)) continue; /* Ignore known items */ ! if (object_known_p(i_ptr)) continue; /* Note the artifact */ okay[i_ptr->name1] = FALSE; --- 2090,2107 ---- } /* Check the inventory */ ! for (i = 0; i < INVEN_TOTAL; i++) { object_type *i_ptr = &inventory[i]; /* Ignore non-objects */ ! if (!i_ptr->exists()) continue; /* Ignore non-artifacts */ ! if (!i_ptr->is_artifact()) continue; /* Ignore known items */ ! if (i_ptr->is_known()) continue; /* Note the artifact */ okay[i_ptr->name1] = FALSE; *************** *** 2130,2139 **** object_type forge; /* Create the object */ ! invcopy(&forge, z); /* Create the artifact */ ! forge.name1 = k; /* Describe the artifact */ object_desc_store(base_name, &forge, FALSE, 0); --- 2127,2136 ---- object_type forge; /* Create the object */ ! forge.invcopy(z); /* Create the artifact */ ! forge.set_name1(k); /* Describe the artifact */ object_desc_store(base_name, &forge, FALSE, 0); *************** *** 2190,2196 **** if (dead || cheat_know || r_ptr->r_sights) { /* Print a message */ ! fprintf(fff, " %s is %s\n", (r_name + r_ptr->name), (dead ? "dead" : "alive")); } --- 2187,2193 ---- if (dead || cheat_know || r_ptr->r_sights) { /* Print a message */ ! fprintf(fff, " %s is %s.\n", (r_name + r_ptr->name), (dead ? "dead" : "alive")); } diff -w -c -r ick-279/cmd5.c utumno/cmd5.c *** ick-279/cmd5.c Thu May 15 17:12:09 1997 --- utumno/cmd5.c Thu May 15 17:45:48 1997 *************** *** 49,61 **** minfail = adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]]; /* Non mage/priest characters never get too good */ ! if ((p_ptr->pclass != 1) && (p_ptr->pclass != 2)) { if (minfail < 5) minfail = 5; } /* Hack -- Priest prayer penalty for "edged" weapons -DGK */ ! if ((p_ptr->pclass == 2) && (p_ptr->icky_wield)) chance += 25; /* Minimum failure rate */ if (chance < minfail) chance = minfail; --- 49,61 ---- minfail = adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]]; /* Non mage/priest characters never get too good */ ! if ((p_ptr->pclass != CLASS_MAGE) && (p_ptr->pclass != CLASS_PRIEST)) { if (minfail < 5) minfail = 5; } /* Hack -- Priest prayer penalty for "edged" weapons -DGK */ ! if ((p_ptr->pclass == CLASS_PRIEST) && (p_ptr->icky_wield)) chance += 25; /* Minimum failure rate */ if (chance < minfail) chance = minfail; *************** *** 89,106 **** if (s_ptr->slevel > p_ptr->lev) return (FALSE); /* Spell is forgotten */ ! if ((j < 32) ? ! (spell_forgotten1 & (1L << j)) : ! (spell_forgotten2 & (1L << (j - 32)))) ! { ! /* Never okay */ ! return (FALSE); ! } /* Spell is learned */ ! if ((j < 32) ? ! (spell_learned1 & (1L << j)) : ! (spell_learned2 & (1L << (j - 32)))) { /* Okay to cast, not to study */ return (known); --- 89,98 ---- if (s_ptr->slevel > p_ptr->lev) return (FALSE); /* Spell is forgotten */ ! if (spell_forgotten[j]) return FALSE; /* Spell is learned */ ! if (spell_learned[j]) { /* Okay to cast, not to study */ return (known); *************** *** 152,158 **** case 40: sprintf(p, " dam %d", 40 + plev); break; case 41: sprintf(p, " dam %d", 70 + plev); break; case 42: sprintf(p, " dam %d", 65 + plev); break; ! case 43: sprintf(p, " dam %d", 300 + plev*2); break; case 49: strcpy(p, " dur 20+d20"); break; case 50: strcpy(p, " dur 20+d20"); break; case 51: strcpy(p, " dur 20+d20"); break; --- 144,150 ---- case 40: sprintf(p, " dam %d", 40 + plev); break; case 41: sprintf(p, " dam %d", 70 + plev); break; case 42: sprintf(p, " dam %d", 65 + plev); break; ! case 43: sprintf(p, " dam %dd17", plev); break; case 49: strcpy(p, " dur 20+d20"); break; case 50: strcpy(p, " dur 20+d20"); break; case 51: strcpy(p, " dur 20+d20"); break; *************** *** 172,178 **** int plev = p_ptr->lev; /* See below */ ! int orb = (plev / ((p_ptr->pclass == 2) ? 2 : 4)); /* Analyze the spell */ switch (j) --- 164,170 ---- int plev = p_ptr->lev; /* See below */ ! int orb = (p_ptr->pclass == CLASS_PRIEST) ? (plev/4) : 0; /* Analyze the spell */ switch (j) *************** *** 183,189 **** case 10: strcpy(p, " heal 4d10"); break; case 11: strcpy(p, " dur 24+d24"); break; case 15: strcpy(p, " dur 10+d10"); break; ! case 17: sprintf(p, " %d+3d6", plev + orb); break; case 18: strcpy(p, " heal 6d10"); break; case 19: strcpy(p, " dur 24+d24"); break; case 20: sprintf(p, " dur %d+d25", 3*plev); break; --- 175,181 ---- case 10: strcpy(p, " heal 4d10"); break; case 11: strcpy(p, " dur 24+d24"); break; case 15: strcpy(p, " dur 10+d10"); break; ! case 17: sprintf(p, " %d+2d6", plev + orb); break; case 18: strcpy(p, " heal 6d10"); break; case 19: strcpy(p, " dur 24+d24"); break; case 20: sprintf(p, " dur %d+d25", 3*plev); break; *************** *** 198,204 **** case 38: strcpy(p, " heal 2000"); break; case 41: sprintf(p, " dam d%d", 4*plev); break; case 42: sprintf(p, " dam d%d", 4*plev); break; ! case 45: strcpy(p, " dam 200"); break; case 52: strcpy(p, " range 10"); break; case 53: sprintf(p, " range %d", 8*plev); break; } --- 190,196 ---- case 38: strcpy(p, " heal 2000"); break; case 41: sprintf(p, " dam d%d", 4*plev); break; case 42: sprintf(p, " dam d%d", 4*plev); break; ! case 45: strcpy(p, " dam 150"); break; case 52: strcpy(p, " range 10"); break; case 53: sprintf(p, " range %d", 8*plev); break; } *************** *** 215,230 **** static void print_spells(byte *spell, int num) { int i, j, col; - magic_type *s_ptr; - cptr comment; - char info[80]; - char out_val[160]; - - /* Print column */ col = 20; --- 207,218 ---- static void print_spells(byte *spell, int num) { int i, j, col; magic_type *s_ptr; cptr comment; + char info[80], out_val[160]; + byte attr; /* Print column */ col = 20; *************** *** 246,252 **** if (s_ptr->slevel >= 99) { sprintf(out_val, " %c) %-30s", I2A(i), "(illegible)"); ! prt(out_val, 2 + i, col); continue; } --- 234,240 ---- if (s_ptr->slevel >= 99) { sprintf(out_val, " %c) %-30s", I2A(i), "(illegible)"); ! c_prt(TERM_SLATE, out_val, 2 + i, col); continue; } *************** *** 258,288 **** /* Use that info */ comment = info; /* Analyze the spell */ ! if ((j < 32) ? ! ((spell_forgotten1 & (1L << j))) : ! ((spell_forgotten2 & (1L << (j - 32))))) { comment = " forgotten"; } ! else if (!((j < 32) ? ! (spell_learned1 & (1L << j)) : ! (spell_learned2 & (1L << (j - 32))))) { comment = " unknown"; } ! else if (!((j < 32) ? ! (spell_worked1 & (1L << j)) : ! (spell_worked2 & (1L << (j - 32))))) { comment = " untried"; } /* Dump the spell --(-- */ sprintf(out_val, " %c) %-30s%2d %4d %3d%%%s", I2A(i), spell_names[mp_ptr->spell_type][j], s_ptr->slevel, s_ptr->smana, spell_chance(j), comment); ! prt(out_val, 2 + i, col); } /* Clear the bottom line */ --- 246,279 ---- /* Use that info */ comment = info; + /* Set the color */ + attr = TERM_L_GREEN; + /* Analyze the spell */ ! if (spell_forgotten[j]) { comment = " forgotten"; + attr = TERM_ORANGE; } ! else if (!spell_learned[j]) { comment = " unknown"; + attr = TERM_ORANGE; } ! else if (!spell_worked[j]) { comment = " untried"; + attr = TERM_YELLOW; } + /* Check the option */ + if (!color_browse) attr = TERM_WHITE; + /* Dump the spell --(-- */ sprintf(out_val, " %c) %-30s%2d %4d %3d%%%s", I2A(i), spell_names[mp_ptr->spell_type][j], s_ptr->slevel, s_ptr->smana, spell_chance(j), comment); ! c_prt(attr, out_val, 2 + i, col); } /* Clear the bottom line */ *************** *** 345,365 **** comment = info; /* Analyze the spell */ ! if ((j < 32) ? ! ((spell_forgotten1 & (1L << j))) : ! ((spell_forgotten2 & (1L << (j - 32))))) { comment = " forgotten"; } ! else if (!((j < 32) ? ! (spell_learned1 & (1L << j)) : ! (spell_learned2 & (1L << (j - 32))))) { comment = " unknown"; } ! else if (!((j < 32) ? ! (spell_worked1 & (1L << j)) : ! (spell_worked2 & (1L << (j - 32))))) { comment = " untried"; } --- 336,350 ---- comment = info; /* Analyze the spell */ ! if (spell_forgotten[j]) { comment = " forgotten"; } ! else if (!spell_learned[j]) { comment = " unknown"; } ! else if (!spell_worked[j]) { comment = " untried"; } *************** *** 739,749 **** void do_cmd_study(void) { int i, item, sval; - int j = -1; cptr p = ((mp_ptr->spell_book == TV_MAGIC_BOOK) ? "spell" : "prayer"); - object_type *i_ptr; --- 724,732 ---- *************** *** 845,858 **** energy_use = 100; /* Learn the spell */ ! if (j < 32) ! { ! spell_learned1 |= (1L << j); ! } ! else ! { ! spell_learned2 |= (1L << (j - 32)); ! } /* Find the next open entry in "spell_order[]" */ for (i = 0; i < 64; i++) --- 828,834 ---- energy_use = 100; /* Learn the spell */ ! spell_learned[j] = TRUE; /* Find the next open entry in "spell_order[]" */ for (i = 0; i < 64; i++) *************** *** 975,981 **** chance = spell_chance(j); /* Failed spell */ ! if (rand_int(100) < chance) { if (flush_failure) flush(); msg_print("You failed to get the spell off!"); --- 951,957 ---- chance = spell_chance(j); /* Failed spell */ ! if (percent(chance)) { if (flush_failure) flush(); msg_print("You failed to get the spell off!"); *************** *** 1074,1105 **** case 17: if (!get_aim_dir(&dir)) return; ! (void)wall_to_mud(dir); break; case 18: ! (void)set_food(PY_FOOD_MAX - 1); break; case 19: ! (void)recharge(5); break; case 20: ! (void)sleep_monsters_touch(); break; case 21: if (!get_aim_dir(&dir)) return; ! (void)poly_monster(dir); break; case 22: ! (void)ident_spell(); break; case 23: ! (void)sleep_monsters(); break; case 24: --- 1050,1081 ---- case 17: if (!get_aim_dir(&dir)) return; ! wall_to_mud(dir); break; case 18: ! set_food(PY_FOOD_MAX - 1); break; case 19: ! recharge(5); break; case 20: ! sleep_monsters_touch(); break; case 21: if (!get_aim_dir(&dir)) return; ! poly_monster(dir); break; case 22: ! ident_spell(); break; case 23: ! sleep_monsters(); break; case 24: *************** *** 1110,1116 **** case 25: if (!get_aim_dir(&dir)) return; ! (void)slow_monster(dir); break; case 26: --- 1086,1092 ---- case 25: if (!get_aim_dir(&dir)) return; ! slow_monster(dir); break; case 26: *************** *** 1120,1131 **** break; case 27: ! (void)recharge(40); break; case 28: if (!get_aim_dir(&dir)) return; ! (void)teleport_monster(dir); break; case 29: --- 1096,1107 ---- break; case 27: ! recharge(40); break; case 28: if (!get_aim_dir(&dir)) return; ! teleport_monster(dir); break; case 29: *************** *** 1150,1168 **** break; case 32: ! (void)genocide(); break; case 33: ! (void)door_creation(); break; case 34: ! (void)stair_creation(); break; case 35: ! (void)teleport_player_level(); break; case 36: --- 1126,1144 ---- break; case 32: ! genocide(); break; case 33: ! door_creation(); break; case 34: ! stair_creation(); break; case 35: ! teleport_player_level(); break; case 36: *************** *** 1215,1229 **** case 43: if (!get_aim_dir(&dir)) return; fire_ball(GF_MANA, dir, ! 300 + (plev * 2), 3); break; case 44: ! (void)detect_evil(); break; case 45: ! (void)detect_magic(); break; case 46: --- 1191,1205 ---- case 43: if (!get_aim_dir(&dir)) return; fire_ball(GF_MANA, dir, ! damroll(plev,17), 3); break; case 44: ! detect_evil(); break; case 45: ! detect_magic(); break; case 46: *************** *** 1231,1296 **** break; case 47: ! (void)genocide(); break; case 48: ! (void)mass_genocide(); break; case 49: ! (void)set_oppose_fire(p_ptr->oppose_fire + randint(20) + 20); break; case 50: ! (void)set_oppose_cold(p_ptr->oppose_cold + randint(20) + 20); break; case 51: ! (void)set_oppose_acid(p_ptr->oppose_acid + randint(20) + 20); break; case 52: ! (void)set_oppose_pois(p_ptr->oppose_pois + randint(20) + 20); break; case 53: ! (void)set_oppose_acid(p_ptr->oppose_acid + randint(20) + 20); ! (void)set_oppose_elec(p_ptr->oppose_elec + randint(20) + 20); ! (void)set_oppose_fire(p_ptr->oppose_fire + randint(20) + 20); ! (void)set_oppose_cold(p_ptr->oppose_cold + randint(20) + 20); ! (void)set_oppose_pois(p_ptr->oppose_pois + randint(20) + 20); break; case 54: ! (void)hp_player(10); ! (void)set_hero(p_ptr->hero + randint(25) + 25); ! (void)set_afraid(0); break; case 55: ! (void)set_shield(p_ptr->shield + randint(20) + 30); break; case 56: ! (void)hp_player(30); ! (void)set_shero(p_ptr->shero + randint(25) + 25); ! (void)set_afraid(0); break; case 57: if (!p_ptr->fast) { ! (void)set_fast(randint(30) + 30 + plev); } else { ! (void)set_fast(p_ptr->fast + randint(10)); } break; case 58: ! (void)set_invuln(p_ptr->invuln + randint(8) + 8); break; default: --- 1207,1272 ---- break; case 47: ! genocide(); break; case 48: ! mass_genocide(); break; case 49: ! set_oppose_fire(p_ptr->oppose_fire + randint(20) + 20); break; case 50: ! set_oppose_cold(p_ptr->oppose_cold + randint(20) + 20); break; case 51: ! set_oppose_acid(p_ptr->oppose_acid + randint(20) + 20); break; case 52: ! set_oppose_pois(p_ptr->oppose_pois + randint(20) + 20); break; case 53: ! set_oppose_acid(p_ptr->oppose_acid + randint(20) + 20); ! set_oppose_elec(p_ptr->oppose_elec + randint(20) + 20); ! set_oppose_fire(p_ptr->oppose_fire + randint(20) + 20); ! set_oppose_cold(p_ptr->oppose_cold + randint(20) + 20); ! set_oppose_pois(p_ptr->oppose_pois + randint(20) + 20); break; case 54: ! hp_player(10); ! set_hero(p_ptr->hero + randint(25) + 25); ! set_afraid(0); break; case 55: ! set_shield(p_ptr->shield + randint(20) + 30); break; case 56: ! hp_player(30); ! set_shero(p_ptr->shero + randint(25) + 25); ! set_afraid(0); break; case 57: if (!p_ptr->fast) { ! set_fast(randint(30) + 30 + plev); } else { ! set_fast(p_ptr->fast + randint(10)); } break; case 58: ! set_invuln(p_ptr->invuln + randint(8) + 8); break; default: *************** *** 1298,1318 **** } /* A spell was cast */ ! if (!((j < 32) ? ! (spell_worked1 & (1L << j)) : ! (spell_worked2 & (1L << (j - 32))))) { int e = s_ptr->sexp; /* The spell worked */ ! if (j < 32) ! { ! spell_worked1 |= (1L << j); ! } ! else ! { ! spell_worked2 |= (1L << (j - 32)); ! } /* Gain experience */ gain_exp(e * s_ptr->slevel); --- 1274,1285 ---- } /* A spell was cast */ ! if (!spell_worked[j]) { int e = s_ptr->sexp; /* The spell worked */ ! spell_worked[j] = TRUE; /* Gain experience */ gain_exp(e * s_ptr->slevel); *************** *** 1342,1353 **** msg_print("You faint from the effort!"); /* Hack -- Bypass free action */ ! (void)set_paralyzed(p_ptr->paralyzed + randint(5 * oops + 1)); /* Damage CON (possibly permanently) */ ! if (rand_int(100) < 50) { ! bool perm = (rand_int(100) < 25); /* Message */ msg_print("You have damaged your health!"); --- 1309,1320 ---- msg_print("You faint from the effort!"); /* Hack -- Bypass free action */ ! set_paralyzed(p_ptr->paralyzed + randint(5 * oops + 1)); /* Damage CON (possibly permanently) */ ! if (percent(50)) { ! bool perm = percent(25); /* Message */ msg_print("You have damaged your health!"); *************** *** 1373,1396 **** /* you can never modify artifacts / ego-items */ /* you can never modify broken / cursed items */ ! if ((i_ptr->k_idx) && ! (!artifact_p(i_ptr)) && (!ego_item_p(i_ptr)) && ! (!broken_p(i_ptr)) && (!cursed_p(i_ptr))) { cptr act = NULL; char i_name[80]; ! if (rand_int(100) < 25) { act = "is covered in a fiery shield!"; ! i_ptr->name2 = EGO_BRAND_FIRE; } else { act = "glows deep, icy blue!"; ! i_ptr->name2 = EGO_BRAND_COLD; } object_desc(i_name, i_ptr, FALSE, 0); --- 1340,1363 ---- /* you can never modify artifacts / ego-items */ /* you can never modify broken / cursed items */ ! if (i_ptr->exists() && ! !i_ptr->is_artifact() && !i_ptr->is_ego_item() && ! !i_ptr->is_cursed() && !i_ptr->is_broken()) { cptr act = NULL; char i_name[80]; ! if (percent(50)) { act = "is covered in a fiery shield!"; ! i_ptr->set_name2(EGO_BRAND_FIRE); } else { act = "glows deep, icy blue!"; ! i_ptr->set_name2(EGO_BRAND_COLD); } object_desc(i_name, i_ptr, FALSE, 0); *************** *** 1462,1468 **** /* Get the item (on the floor) */ else { ! i_ptr = &i_list[0 - item]; } /* Access the item's sval */ --- 1429,1435 ---- /* Get the item (on the floor) */ else { ! i_ptr = &i_list[-item]; } /* Access the item's sval */ *************** *** 1496,1502 **** chance = spell_chance(j); /* Check for failure */ ! if (rand_int(100) < chance) { if (flush_failure) flush(); msg_print("You failed to concentrate hard enough!"); --- 1463,1469 ---- chance = spell_chance(j); /* Check for failure */ ! if (percent(chance)) { if (flush_failure) flush(); msg_print("You failed to concentrate hard enough!"); *************** *** 1582,1589 **** case 17: if (!get_aim_dir(&dir)) return; fire_ball(GF_HOLY_ORB, dir, ! (damroll(3,6) + plev + ! (plev / ((p_ptr->pclass == 2) ? 2 : 4))), ((plev < 30) ? 2 : 3)); break; --- 1549,1556 ---- case 17: if (!get_aim_dir(&dir)) return; fire_ball(GF_HOLY_ORB, dir, ! damroll(2,6) + plev + ! (p_ptr->pclass == CLASS_PRIEST) ? (plev/4) : 0, ((plev < 30) ? 2 : 3)); break; *************** *** 1627,1635 **** break; case 27: ! (void)hp_player(300); ! (void)set_stun(0); ! (void)set_cut(0); break; case 28: --- 1594,1603 ---- break; case 27: ! hp_player(300); ! set_stun(0); ! set_cut(0); ! set_poisoned(0); break; case 28: *************** *** 1641,1668 **** break; case 30: ! (void)dispel_evil(plev * 4); ! (void)hp_player(1000); ! (void)set_afraid(0); ! (void)set_poisoned(0); ! (void)set_stun(0); ! (void)set_cut(0); break; case 31: ! (void)detect_monsters(); break; case 32: ! (void)detection(); break; case 33: ! (void)ident_spell(); break; case 34: ! (void)probing(); break; case 35: --- 1609,1636 ---- break; case 30: ! dispel_evil(plev * 4); ! hp_player(1000); ! set_afraid(0); ! set_poisoned(0); ! set_stun(0); ! set_cut(0); break; case 31: ! detect_monsters(); break; case 32: ! detection(); break; case 33: ! ident_spell(); break; case 34: ! probing(); break; case 35: *************** *** 1681,1689 **** break; case 38: ! (void)hp_player(2000); ! (void)set_stun(0); ! (void)set_cut(0); break; case 39: --- 1649,1658 ---- break; case 38: ! hp_player(2000); ! set_stun(0); ! set_cut(0); ! set_poisoned(0); break; case 39: *************** *** 1700,1710 **** break; case 41: ! (void)dispel_undead(plev * 4); break; case 42: ! (void)dispel_evil(plev * 4); break; case 43: --- 1669,1679 ---- break; case 41: ! dispel_undead(plev * 4); break; case 42: ! dispel_evil(plev * 4); break; case 43: *************** *** 1720,1734 **** case 45: if (!get_aim_dir(&dir)) return; ! drain_life(dir, 200); break; case 46: ! (void)destroy_doors_touch(); break; case 47: ! (void)recharge(15); break; case 48: --- 1689,1703 ---- case 45: if (!get_aim_dir(&dir)) return; ! fire_bolt(GF_HOLY_ORB, dir, 150); break; case 46: ! destroy_doors_touch(); break; case 47: ! recharge(15); break; case 48: *************** *** 1787,1807 **** } /* A prayer was prayed */ ! if (!((j < 32) ? ! (spell_worked1 & (1L << j)) : ! (spell_worked2 & (1L << (j - 32))))) { int e = s_ptr->sexp; /* The spell worked */ ! if (j < 32) ! { ! spell_worked1 |= (1L << j); ! } ! else ! { ! spell_worked2 |= (1L << (j - 32)); ! } /* Gain experience */ gain_exp(e * s_ptr->slevel); --- 1756,1767 ---- } /* A prayer was prayed */ ! if (!spell_worked[j]) { int e = s_ptr->sexp; /* The spell worked */ ! spell_worked[j] = TRUE; /* Gain experience */ gain_exp(e * s_ptr->slevel); *************** *** 1834,1842 **** (void)set_paralyzed(p_ptr->paralyzed + randint(5 * oops + 1)); /* Damage CON (possibly permanently) */ ! if (rand_int(100) < 50) { ! bool perm = (rand_int(100) < 25); /* Message */ msg_print("You have damaged your health!"); --- 1794,1802 ---- (void)set_paralyzed(p_ptr->paralyzed + randint(5 * oops + 1)); /* Damage CON (possibly permanently) */ ! if (percent(50)) { ! bool perm = percent(25); /* Message */ msg_print("You have damaged your health!"); diff -w -c -r ick-279/cmd6.c utumno/cmd6.c *** ick-279/cmd6.c Thu May 15 17:12:09 1997 --- utumno/cmd6.c Thu May 15 17:45:48 1997 *************** *** 99,105 **** ident = FALSE; /* Object level */ ! lev = k_info[i_ptr->k_idx].level; /* Analyze the food */ switch (i_ptr->sval) --- 99,105 ---- ident = FALSE; /* Object level */ ! lev = i_ptr->obj_level; /* Analyze the food */ switch (i_ptr->sval) *************** *** 248,255 **** case SV_FOOD_WAYBREAD: msg_print("That tastes good."); ! (void)set_poisoned(0); ! (void)hp_player(damroll(4, 8)); ident = TRUE; break; --- 248,255 ---- case SV_FOOD_WAYBREAD: msg_print("That tastes good."); ! set_poisoned(0); ! hp_player(damroll(4, 8)); ident = TRUE; break; *************** *** 266,280 **** /* Combine / Reorder the pack (later) */ ! p_ptr->notice |= (PN_COMBINE | PN_REORDER); /* We have tried it */ ! object_tried(i_ptr); /* The player is now aware of the object */ ! if (ident && !object_aware_p(i_ptr)) { ! object_aware(i_ptr); gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev); } --- 266,280 ---- /* Combine / Reorder the pack (later) */ ! p_ptr->notice |= PN_COMBINE | PN_REORDER; /* We have tried it */ ! i_ptr->object_tried(); /* The player is now aware of the object */ ! if (ident && !i_ptr->is_aware()) { ! i_ptr->object_aware(); gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev); } *************** *** 335,341 **** /* Get the item (on the floor) */ else { ! i_ptr = &i_list[0 - item]; } --- 335,341 ---- /* Get the item (on the floor) */ else { ! i_ptr = &i_list[-item]; } *************** *** 346,352 **** ident = FALSE; /* Object level */ ! lev = k_info[i_ptr->k_idx].level; /* Analyze the potion */ switch (i_ptr->sval) --- 346,352 ---- ident = FALSE; /* Object level */ ! lev = i_ptr->obj_level; /* Analyze the potion */ switch (i_ptr->sval) *************** *** 364,372 **** case SV_POTION_SALT_WATER: msg_print("The potion makes you vomit!"); ! (void)set_food(PY_FOOD_STARVE - 1); ! (void)set_poisoned(0); ! (void)set_paralyzed(p_ptr->paralyzed + 4); ident = TRUE; break; --- 364,372 ---- case SV_POTION_SALT_WATER: msg_print("The potion makes you vomit!"); ! set_food(PY_FOOD_STARVE - 1); ! set_poisoned(0); ! set_paralyzed(p_ptr->paralyzed + 4); ident = TRUE; break; *************** *** 422,433 **** case SV_POTION_RUINATION: msg_print("Your nerves and muscles feel weak and lifeless!"); take_hit(damroll(10, 10), "a potion of Ruination"); ! (void)dec_stat(A_DEX, 25, TRUE); ! (void)dec_stat(A_WIS, 25, TRUE); ! (void)dec_stat(A_CON, 25, TRUE); ! (void)dec_stat(A_STR, 25, TRUE); ! (void)dec_stat(A_CHR, 25, TRUE); ! (void)dec_stat(A_INT, 25, TRUE); ident = TRUE; case SV_POTION_DEC_STR: --- 422,433 ---- case SV_POTION_RUINATION: msg_print("Your nerves and muscles feel weak and lifeless!"); take_hit(damroll(10, 10), "a potion of Ruination"); ! dec_stat(A_DEX, 25, TRUE); ! dec_stat(A_WIS, 25, TRUE); ! dec_stat(A_CON, 25, TRUE); ! dec_stat(A_STR, 25, TRUE); ! dec_stat(A_CHR, 25, TRUE); ! dec_stat(A_INT, 25, TRUE); ident = TRUE; case SV_POTION_DEC_STR: *************** *** 501,507 **** } else { ! (void)set_fast(p_ptr->fast + 5); } break; --- 501,507 ---- } else { ! set_fast(p_ptr->fast + 5); } break; *************** *** 575,592 **** msg_print("You feel life flow through your body!"); restore_level(); hp_player(5000); ! (void)set_poisoned(0); ! (void)set_blind(0); ! (void)set_confused(0); ! (void)set_image(0); ! (void)set_stun(0); ! (void)set_cut(0); ! (void)do_res_stat(A_STR); ! (void)do_res_stat(A_CON); ! (void)do_res_stat(A_DEX); ! (void)do_res_stat(A_WIS); ! (void)do_res_stat(A_INT); ! (void)do_res_stat(A_CHR); ident = TRUE; break; --- 575,592 ---- msg_print("You feel life flow through your body!"); restore_level(); hp_player(5000); ! set_poisoned(0); ! set_blind(0); ! set_confused(0); ! set_image(0); ! set_stun(0); ! set_cut(0); ! do_res_stat(A_STR); ! do_res_stat(A_CON); ! do_res_stat(A_DEX); ! do_res_stat(A_WIS); ! do_res_stat(A_INT); ! do_res_stat(A_CHR); ident = TRUE; break; *************** *** 672,683 **** msg_print("You begin to feel more enlightened..."); msg_print(NULL); wiz_lite(); ! (void)do_inc_stat(A_INT); ! (void)do_inc_stat(A_WIS); ! (void)detect_treasure(); ! (void)detect_object(); ! (void)detect_sdoor(); ! (void)detect_trap(); identify_pack(); self_knowledge(); ident = TRUE; --- 672,683 ---- msg_print("You begin to feel more enlightened..."); msg_print(NULL); wiz_lite(); ! do_inc_stat(A_INT); ! do_inc_stat(A_WIS); ! detect_treasure(); ! detect_object(); ! detect_sdoor(); ! detect_trap(); identify_pack(); self_knowledge(); ident = TRUE; *************** *** 708,722 **** /* Combine / Reorder the pack (later) */ ! p_ptr->notice |= (PN_COMBINE | PN_REORDER); /* The item has been tried */ ! object_tried(i_ptr); /* An identification was made */ ! if (ident && !object_aware_p(i_ptr)) { ! object_aware(i_ptr); gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev); } --- 708,722 ---- /* Combine / Reorder the pack (later) */ ! p_ptr->notice |= PN_COMBINE | PN_REORDER; /* The item has been tried */ ! i_ptr->object_tried(); /* An identification was made */ ! if (ident && !i_ptr->is_aware()) { ! i_ptr->object_aware(); gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev); } *************** *** 739,747 **** /* Destroy a potion on the floor */ else { ! floor_item_increase(0 - item, -1); ! floor_item_describe(0 - item); ! floor_item_optimize(0 - item); } } --- 739,747 ---- /* Destroy a potion on the floor */ else { ! floor_item_increase(-item, -1); ! floor_item_describe(-item); ! floor_item_optimize(-item); } } *************** *** 760,766 **** j_ptr = &inventory[INVEN_BODY]; /* Nothing to curse */ ! if (!j_ptr->k_idx) return (FALSE); /* Describe */ --- 760,766 ---- j_ptr = &inventory[INVEN_BODY]; /* Nothing to curse */ ! if (!j_ptr->exists()) return FALSE; /* Describe */ *************** *** 767,777 **** object_desc(i_name, j_ptr, FALSE, 3); /* Attempt a saving throw for artifacts */ ! if (artifact_p(j_ptr) && (rand_int(100) < 50)) { /* Cool */ ! msg_format("A %s tries to %s, but your %s resists the effects!", ! "terrible black aura", "surround your armor", i_name); } /* not artifact or failed save... */ --- 767,777 ---- object_desc(i_name, j_ptr, FALSE, 3); /* Attempt a saving throw for artifacts */ ! if (j_ptr->is_artifact() && percent(50)) { /* Cool */ ! msg_format("A %s aura tries to %s, but your %s resists the effects!", ! "terrible black", "surround your armor", i_name); } /* not artifact or failed save... */ *************** *** 781,812 **** msg_format("A terrible black aura blasts your %s!", i_name); /* Blast the armor */ ! j_ptr->name1 = 0; ! j_ptr->name2 = EGO_BLASTED; ! j_ptr->to_a = 0 - randint(5) - randint(5); ! j_ptr->to_h = 0; ! j_ptr->to_d = 0; ! j_ptr->ac = 0; ! j_ptr->dd = 0; ! j_ptr->ds = 0; ! /* Curse it */ ! j_ptr->ident |= ID_CURSED; - /* Break it */ - j_ptr->ident |= ID_BROKEN; - /* Recalculate bonuses */ ! p_ptr->update |= (PU_BONUS); /* Recalculate mana */ ! p_ptr->update |= (PU_MANA); /* Redraw the choice window */ p_ptr->redraw |= (PR_CHOOSE); } ! return (TRUE); } --- 781,810 ---- msg_format("A terrible black aura blasts your %s!", i_name); /* Blast the armor */ ! j_ptr->set_name1(0); ! j_ptr->set_name2(EGO_BLASTED); ! j_ptr->set_to_a(0 - randint(5) - randint(5)); ! j_ptr->set_to_h(0); ! j_ptr->set_to_d(0); ! j_ptr->set_ac(0); ! j_ptr->set_dd(0); ! j_ptr->set_ds(0); ! /* Curse and break it */ ! j_ptr->set_ident_flag(ID_CURSED); ! j_ptr->set_ident_flag(ID_BROKEN); /* Recalculate bonuses */ ! p_ptr->update |= PU_BONUS; /* Recalculate mana */ ! p_ptr->update |= PU_MANA; /* Redraw the choice window */ p_ptr->redraw |= (PR_CHOOSE); } ! return TRUE; } *************** *** 824,830 **** j_ptr = &inventory[INVEN_WIELD]; /* Nothing to curse */ ! if (!j_ptr->k_idx) return (FALSE); /* Describe */ --- 822,828 ---- j_ptr = &inventory[INVEN_WIELD]; /* Nothing to curse */ ! if (!j_ptr->exists()) return FALSE; /* Describe */ *************** *** 831,837 **** object_desc(i_name, j_ptr, FALSE, 3); /* Attempt a saving throw */ ! if (artifact_p(j_ptr) && (rand_int(100) < 50)) { /* Cool */ msg_format("A %s tries to %s, but your %s resists the effects!", --- 829,835 ---- object_desc(i_name, j_ptr, FALSE, 3); /* Attempt a saving throw */ ! if (j_ptr->is_artifact() && percent(50)) { /* Cool */ msg_format("A %s tries to %s, but your %s resists the effects!", *************** *** 845,865 **** msg_format("A terrible black aura blasts your %s!", i_name); /* Shatter the weapon */ ! j_ptr->name1 = 0; ! j_ptr->name2 = EGO_SHATTERED; ! j_ptr->to_h = 0 - randint(5) - randint(5); ! j_ptr->to_d = 0 - randint(5) - randint(5); ! j_ptr->to_a = 0; ! j_ptr->ac = 0; ! j_ptr->dd = 0; ! j_ptr->ds = 0; ! /* Curse it */ ! j_ptr->ident |= ID_CURSED; - /* Break it */ - j_ptr->ident |= ID_BROKEN; - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); --- 843,861 ---- msg_format("A terrible black aura blasts your %s!", i_name); /* Shatter the weapon */ ! j_ptr->set_name1(0); ! j_ptr->set_name2(EGO_SHATTERED); ! j_ptr->set_to_h(0 - randint(5) - randint(5)); ! j_ptr->set_to_d(0 - randint(5) - randint(5)); ! j_ptr->set_to_a(0); ! j_ptr->set_ac(0); ! j_ptr->set_dd(0); ! j_ptr->set_ds(0); ! /* Curse and break it */ ! j_ptr->set_ident_flag(ID_CURSED); ! j_ptr->set_ident_flag(ID_BROKEN); /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); *************** *** 871,877 **** } /* Notice */ ! return (TRUE); } --- 867,873 ---- } /* Notice */ ! return TRUE; } *************** *** 937,943 **** ident = FALSE; /* Object level */ ! lev = k_info[i_ptr->k_idx].level; /* Assume the scroll will get used up */ used_up = TRUE; --- 933,939 ---- ident = FALSE; /* Object level */ ! lev = i_ptr->obj_level; /* Assume the scroll will get used up */ used_up = TRUE; *************** *** 1187,1201 **** /* Combine / Reorder the pack (later) */ ! p_ptr->notice |= (PN_COMBINE | PN_REORDER); /* The item was tried */ ! object_tried(i_ptr); /* An identification was made */ ! if (ident && !object_aware_p(i_ptr)) { ! object_aware(i_ptr); gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev); } --- 1183,1197 ---- /* Combine / Reorder the pack (later) */ ! p_ptr->notice |= PN_COMBINE | PN_REORDER; /* The item was tried */ ! i_ptr->object_tried(); /* An identification was made */ ! if (ident && !i_ptr->is_aware()) { ! i_ptr->object_aware(); gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev); } *************** *** 1266,1277 **** /* Get the item (on the floor) */ else { ! i_ptr = &i_list[0 - item]; } /* Mega-Hack -- refuse to use a pile from the ground */ ! if ((item < 0) && (i_ptr->number > 1)) { msg_print("You must first pick up the staffs."); return; --- 1262,1273 ---- /* Get the item (on the floor) */ else { ! i_ptr = &i_list[-item]; } /* Mega-Hack -- refuse to use a pile from the ground */ ! if ((item < 0) && i_ptr->is_plural()) { msg_print("You must first pick up the staffs."); return; *************** *** 1278,1285 **** } /* Verify potential overflow */ ! if ((inven_cnt >= INVEN_PACK) && ! (i_ptr->number > 1)) { /* Verify with the player */ if (other_query_flag && --- 1274,1280 ---- } /* Verify potential overflow */ ! if ((inven_cnt >= INVEN_PACK) && i_ptr->is_plural()) { /* Verify with the player */ if (other_query_flag && *************** *** 1294,1300 **** ident = FALSE; /* Extract the item level */ ! lev = k_info[i_ptr->k_idx].level; /* Base chance of success */ chance = p_ptr->skill_dev; --- 1289,1295 ---- ident = FALSE; /* Extract the item level */ ! lev = i_ptr->obj_level; /* Base chance of success */ chance = p_ptr->skill_dev; *************** *** 1324,1330 **** { if (flush_failure) flush(); msg_print("The staff has no charges left."); ! i_ptr->ident |= ID_EMPTY; return; } --- 1319,1325 ---- { if (flush_failure) flush(); msg_print("The staff has no charges left."); ! i_ptr->set_ident_flag(ID_EMPTY); return; } *************** *** 1466,1472 **** } else { ! (void)set_fast(p_ptr->fast + 5); } break; --- 1461,1467 ---- } else { ! set_fast(p_ptr->fast + 5); } break; *************** *** 1520,1531 **** p_ptr->notice |= (PN_COMBINE | PN_REORDER); /* Tried the item */ ! object_tried(i_ptr); /* An identification was made */ ! if (ident && !object_aware_p(i_ptr)) { ! object_aware(i_ptr); gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev); } --- 1515,1526 ---- p_ptr->notice |= (PN_COMBINE | PN_REORDER); /* Tried the item */ ! i_ptr->object_tried(); /* An identification was made */ ! if (ident && !i_ptr->is_aware()) { ! i_ptr->object_aware(); gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev); } *************** *** 1538,1559 **** /* Use a single charge */ ! i_ptr->pval--; /* XXX Hack -- unstack if necessary */ ! if ((item >= 0) && (i_ptr->number > 1)) { /* Make a fake item */ object_type tmp_obj; tmp_obj = *i_ptr; ! tmp_obj.number = 1; /* Restore the charges */ ! i_ptr->pval++; /* Unstack the used item */ ! i_ptr->number--; ! total_weight -= tmp_obj.weight; item = inven_carry(&tmp_obj); /* Message */ --- 1533,1554 ---- /* Use a single charge */ ! i_ptr->set_pval(i_ptr->pval - 1); /* XXX Hack -- unstack if necessary */ ! if ((item >= 0) && i_ptr->is_plural()) { /* Make a fake item */ object_type tmp_obj; tmp_obj = *i_ptr; ! tmp_obj.set_number(1); /* Restore the charges */ ! i_ptr->set_pval(i_ptr->pval + 1); /* Unstack the used item */ ! i_ptr->set_number(i_ptr->number - 1); ! total_weight -= tmp_obj.get_weight(); item = inven_carry(&tmp_obj); /* Message */ *************** *** 1620,1631 **** /* Get the item (on the floor) */ else { ! i_ptr = &i_list[0 - item]; } /* Mega-Hack -- refuse to aim a pile from the ground */ ! if ((item < 0) && (i_ptr->number > 1)) { msg_print("You must first pick up the wands."); return; --- 1615,1626 ---- /* Get the item (on the floor) */ else { ! i_ptr = &i_list[-item]; } /* Mega-Hack -- refuse to aim a pile from the ground */ ! if ((item < 0) && i_ptr->is_plural()) { msg_print("You must first pick up the wands."); return; *************** *** 1632,1639 **** } /* Hack -- verify potential overflow */ ! if ((inven_cnt >= INVEN_PACK) && ! (i_ptr->number > 1)) { /* Verify with the player */ if (other_query_flag && --- 1627,1633 ---- } /* Hack -- verify potential overflow */ ! if ((inven_cnt >= INVEN_PACK) && i_ptr->is_plural()) { /* Verify with the player */ if (other_query_flag && *************** *** 1652,1658 **** ident = FALSE; /* Get the level */ ! lev = k_info[i_ptr->k_idx].level; /* Base chance of success */ chance = p_ptr->skill_dev; --- 1646,1652 ---- ident = FALSE; /* Get the level */ ! lev = i_ptr->obj_level; /* Base chance of success */ chance = p_ptr->skill_dev; *************** *** 1682,1688 **** { if (flush_failure) flush(); msg_print("The wand has no charges left."); ! i_ptr->ident |= ID_EMPTY; return; } --- 1676,1682 ---- { if (flush_failure) flush(); msg_print("The wand has no charges left."); ! i_ptr->set_ident_flag(ID_EMPTY); return; } *************** *** 1855,1866 **** p_ptr->notice |= (PN_COMBINE | PN_REORDER); /* Mark it as tried */ ! object_tried(i_ptr); /* Apply identification */ ! if (ident && !object_aware_p(i_ptr)) { ! object_aware(i_ptr); gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev); } --- 1849,1860 ---- p_ptr->notice |= (PN_COMBINE | PN_REORDER); /* Mark it as tried */ ! i_ptr->object_tried(); /* Apply identification */ ! if (ident && !i_ptr->is_aware()) { ! i_ptr->object_aware(); gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev); } *************** *** 1869,1890 **** /* Use a single charge */ ! i_ptr->pval--; /* Hack -- unstack if necessary */ ! if ((item >= 0) && (i_ptr->number > 1)) { /* Make a fake item */ object_type tmp_obj; tmp_obj = *i_ptr; ! tmp_obj.number = 1; /* Restore the charges */ ! i_ptr->pval++; /* Unstack the used item */ ! i_ptr->number--; ! total_weight -= tmp_obj.weight; item = inven_carry(&tmp_obj); /* Message */ --- 1863,1884 ---- /* Use a single charge */ ! i_ptr->set_pval(i_ptr->pval - 1); /* Hack -- unstack if necessary */ ! if ((item >= 0) && i_ptr->is_plural()) { /* Make a fake item */ object_type tmp_obj; tmp_obj = *i_ptr; ! tmp_obj.set_number(1); /* Restore the charges */ ! i_ptr->set_pval(i_ptr->pval + 1); /* Unstack the used item */ ! i_ptr->set_number(i_ptr->number - 1); ! total_weight -= tmp_obj.get_weight(); item = inven_carry(&tmp_obj); /* Message */ *************** *** 1950,1956 **** /* Mega-Hack -- refuse to zap a pile from the ground */ ! if ((item < 0) && (i_ptr->number > 1)) { msg_print("You must first pick up the rods."); return; --- 1944,1950 ---- /* Mega-Hack -- refuse to zap a pile from the ground */ ! if ((item < 0) && i_ptr->is_plural()) { msg_print("You must first pick up the rods."); return; *************** *** 1957,1964 **** } /* Hack -- verify potential overflow */ ! if ((inven_cnt >= INVEN_PACK) && ! (i_ptr->number > 1)) { /* Verify with the player */ if (other_query_flag && --- 1951,1957 ---- } /* Hack -- verify potential overflow */ ! if ((inven_cnt >= INVEN_PACK) && i_ptr->is_plural()) { /* Verify with the player */ if (other_query_flag && *************** *** 1966,1972 **** } /* Get a direction (unless KNOWN not to need it) */ ! if ((i_ptr->sval >= SV_ROD_MIN_DIRECTION) || !object_aware_p(i_ptr)) { /* Get a direction, allow cancel */ if (!get_aim_dir(&dir)) return; --- 1959,1965 ---- } /* Get a direction (unless KNOWN not to need it) */ ! if ((i_ptr->sval >= SV_ROD_MIN_DIRECTION) || !i_ptr->is_aware()) { /* Get a direction, allow cancel */ if (!get_aim_dir(&dir)) return; *************** *** 1980,1986 **** ident = FALSE; /* Extract the item level */ ! lev = k_info[i_ptr->k_idx].level; /* Base chance of success */ chance = p_ptr->skill_dev; --- 1973,1979 ---- ident = FALSE; /* Extract the item level */ ! lev = i_ptr->obj_level; /* Base chance of success */ chance = p_ptr->skill_dev; *************** *** 2019,2036 **** { case SV_ROD_DETECT_TRAP: if (detect_trap()) ident = TRUE; ! i_ptr->pval = 50; break; case SV_ROD_DETECT_DOOR: if (detect_sdoor()) ident = TRUE; ! i_ptr->pval = 70; break; case SV_ROD_IDENTIFY: ident = TRUE; if (!ident_spell()) use_charge = FALSE; ! i_ptr->pval = 10; break; case SV_ROD_RECALL: --- 2012,2029 ---- { case SV_ROD_DETECT_TRAP: if (detect_trap()) ident = TRUE; ! i_ptr->set_pval(50); break; case SV_ROD_DETECT_DOOR: if (detect_sdoor()) ident = TRUE; ! i_ptr->set_pval(70); break; case SV_ROD_IDENTIFY: ident = TRUE; if (!ident_spell()) use_charge = FALSE; ! i_ptr->set_pval(10); break; case SV_ROD_RECALL: *************** *** 2045,2074 **** p_ptr->word_recall = 0; } ident = TRUE; ! i_ptr->pval = 60; break; case SV_ROD_ILLUMINATION: if (lite_area(damroll(2, 8), 2)) ident = TRUE; ! i_ptr->pval = 30; break; case SV_ROD_MAPPING: map_area(); ident = TRUE; ! i_ptr->pval = 99; break; case SV_ROD_DETECTION: detection(); ident = TRUE; ! i_ptr->pval = 99; break; case SV_ROD_PROBING: probing(); ident = TRUE; ! i_ptr->pval = 50; break; case SV_ROD_CURING: --- 2038,2067 ---- p_ptr->word_recall = 0; } ident = TRUE; ! i_ptr->set_pval(60); break; case SV_ROD_ILLUMINATION: if (lite_area(damroll(2, 8), 2)) ident = TRUE; ! i_ptr->set_pval(30); break; case SV_ROD_MAPPING: map_area(); ident = TRUE; ! i_ptr->set_pval(99); break; case SV_ROD_DETECTION: detection(); ident = TRUE; ! i_ptr->set_pval(99); break; case SV_ROD_PROBING: probing(); ident = TRUE; ! i_ptr->set_pval(50); break; case SV_ROD_CURING: *************** *** 2077,2083 **** if (set_confused(0)) ident = TRUE; if (set_stun(0)) ident = TRUE; if (set_cut(0)) ident = TRUE; ! i_ptr->pval = 999; break; case SV_ROD_HEALING: --- 2070,2076 ---- if (set_confused(0)) ident = TRUE; if (set_stun(0)) ident = TRUE; if (set_cut(0)) ident = TRUE; ! i_ptr->set_pval(999); break; case SV_ROD_HEALING: *************** *** 2084,2090 **** if (hp_player(500)) ident = TRUE; if (set_stun(0)) ident = TRUE; if (set_cut(0)) ident = TRUE; ! i_ptr->pval = 999; break; case SV_ROD_RESTORATION: --- 2077,2083 ---- if (hp_player(500)) ident = TRUE; if (set_stun(0)) ident = TRUE; if (set_cut(0)) ident = TRUE; ! i_ptr->set_pval(999); break; case SV_ROD_RESTORATION: *************** *** 2095,2101 **** if (do_res_stat(A_DEX)) ident = TRUE; if (do_res_stat(A_CON)) ident = TRUE; if (do_res_stat(A_CHR)) ident = TRUE; ! i_ptr->pval = 999; break; case SV_ROD_SPEED: --- 2088,2094 ---- if (do_res_stat(A_DEX)) ident = TRUE; if (do_res_stat(A_CON)) ident = TRUE; if (do_res_stat(A_CHR)) ident = TRUE; ! i_ptr->set_pval(999); break; case SV_ROD_SPEED: *************** *** 2105,2123 **** } else { ! (void)set_fast(p_ptr->fast + 5); } ! i_ptr->pval = 99; break; case SV_ROD_TELEPORT_AWAY: if (teleport_monster(dir)) ident = TRUE; ! i_ptr->pval = 25; break; case SV_ROD_DISARMING: if (disarm_trap(dir)) ident = TRUE; ! i_ptr->pval = 30; break; case SV_ROD_LITE: --- 2098,2116 ---- } else { ! set_fast(p_ptr->fast + 5); } ! i_ptr->set_pval(99); break; case SV_ROD_TELEPORT_AWAY: if (teleport_monster(dir)) ident = TRUE; ! i_ptr->set_pval(25); break; case SV_ROD_DISARMING: if (disarm_trap(dir)) ident = TRUE; ! i_ptr->set_pval(30); break; case SV_ROD_LITE: *************** *** 2124,2198 **** msg_print("A line of blue shimmering light appears."); lite_line(dir); ident = TRUE; ! i_ptr->pval = 9; break; case SV_ROD_SLEEP_MONSTER: if (sleep_monster(dir)) ident = TRUE; ! i_ptr->pval = 18; break; case SV_ROD_SLOW_MONSTER: if (slow_monster(dir)) ident = TRUE; ! i_ptr->pval = 20; break; case SV_ROD_DRAIN_LIFE: if (drain_life(dir, 75)) ident = TRUE; ! i_ptr->pval = 23; break; case SV_ROD_POLYMORPH: if (poly_monster(dir)) ident = TRUE; ! i_ptr->pval = 25; break; case SV_ROD_ACID_BOLT: fire_bolt_or_beam(10, GF_ACID, dir, damroll(6,8)); ident = TRUE; ! i_ptr->pval = 12; break; case SV_ROD_ELEC_BOLT: fire_bolt_or_beam(10, GF_ELEC, dir, damroll(3,8)); ident = TRUE; ! i_ptr->pval = 11; break; case SV_ROD_FIRE_BOLT: fire_bolt_or_beam(10, GF_FIRE, dir, damroll(8,8)); ident = TRUE; ! i_ptr->pval = 15; break; case SV_ROD_COLD_BOLT: fire_bolt_or_beam(10, GF_COLD, dir, damroll(5,8)); ident = TRUE; ! i_ptr->pval = 13; break; case SV_ROD_ACID_BALL: fire_ball(GF_ACID, dir, 60, 2); ident = TRUE; ! i_ptr->pval = 27; break; case SV_ROD_ELEC_BALL: fire_ball(GF_ELEC, dir, 32, 2); ident = TRUE; ! i_ptr->pval = 23; break; case SV_ROD_FIRE_BALL: fire_ball(GF_FIRE, dir, 72, 2); ident = TRUE; ! i_ptr->pval = 30; break; case SV_ROD_COLD_BALL: fire_ball(GF_COLD, dir, 48, 2); ident = TRUE; ! i_ptr->pval = 25; break; default: --- 2117,2191 ---- msg_print("A line of blue shimmering light appears."); lite_line(dir); ident = TRUE; ! i_ptr->set_pval(9); break; case SV_ROD_SLEEP_MONSTER: if (sleep_monster(dir)) ident = TRUE; ! i_ptr->set_pval(18); break; case SV_ROD_SLOW_MONSTER: if (slow_monster(dir)) ident = TRUE; ! i_ptr->set_pval(20); break; case SV_ROD_DRAIN_LIFE: if (drain_life(dir, 75)) ident = TRUE; ! i_ptr->set_pval(23); break; case SV_ROD_POLYMORPH: if (poly_monster(dir)) ident = TRUE; ! i_ptr->set_pval(25); break; case SV_ROD_ACID_BOLT: fire_bolt_or_beam(10, GF_ACID, dir, damroll(6,8)); ident = TRUE; ! i_ptr->set_pval(12); break; case SV_ROD_ELEC_BOLT: fire_bolt_or_beam(10, GF_ELEC, dir, damroll(3,8)); ident = TRUE; ! i_ptr->set_pval(11); break; case SV_ROD_FIRE_BOLT: fire_bolt_or_beam(10, GF_FIRE, dir, damroll(8,8)); ident = TRUE; ! i_ptr->set_pval(15); break; case SV_ROD_COLD_BOLT: fire_bolt_or_beam(10, GF_COLD, dir, damroll(5,8)); ident = TRUE; ! i_ptr->set_pval(13); break; case SV_ROD_ACID_BALL: fire_ball(GF_ACID, dir, 60, 2); ident = TRUE; ! i_ptr->set_pval(27); break; case SV_ROD_ELEC_BALL: fire_ball(GF_ELEC, dir, 32, 2); ident = TRUE; ! i_ptr->set_pval(23); break; case SV_ROD_FIRE_BALL: fire_ball(GF_FIRE, dir, 72, 2); ident = TRUE; ! i_ptr->set_pval(30); break; case SV_ROD_COLD_BALL: fire_ball(GF_COLD, dir, 48, 2); ident = TRUE; ! i_ptr->set_pval(25); break; default: *************** *** 2205,2216 **** p_ptr->notice |= (PN_COMBINE | PN_REORDER); /* Tried the object */ ! object_tried(i_ptr); /* Successfully determined the object function */ ! if (ident && !object_aware_p(i_ptr)) { ! object_aware(i_ptr); gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev); } --- 2198,2209 ---- p_ptr->notice |= (PN_COMBINE | PN_REORDER); /* Tried the object */ ! i_ptr->object_tried(); /* Successfully determined the object function */ ! if (ident && !i_ptr->is_aware()) { ! i_ptr->object_aware(); gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev); } *************** *** 2221,2245 **** /* Hack -- deal with cancelled zap */ if (!use_charge) { ! i_ptr->pval = 0; return; } /* XXX Hack -- unstack if necessary */ ! if ((item >= 0) && (i_ptr->number > 1)) { /* Make a fake item */ object_type tmp_obj; tmp_obj = *i_ptr; ! tmp_obj.number = 1; /* Restore "charge" */ ! i_ptr->pval = 0; /* Unstack the used item */ ! i_ptr->number--; ! total_weight -= tmp_obj.weight; item = inven_carry(&tmp_obj); /* Message */ --- 2214,2238 ---- /* Hack -- deal with cancelled zap */ if (!use_charge) { ! i_ptr->set_pval(0); return; } /* XXX Hack -- unstack if necessary */ ! if ((item >= 0) && i_ptr->is_plural()) { /* Make a fake item */ object_type tmp_obj; tmp_obj = *i_ptr; ! tmp_obj.set_number(1); /* Restore "charge" */ ! i_ptr->set_pval(0); /* Unstack the used item */ ! i_ptr->set_number(i_ptr->number - 1); ! total_weight -= tmp_obj.get_weight(); item = inven_carry(&tmp_obj); /* Message */ *************** *** 2258,2273 **** u32b f1, f2, f3; /* Not known */ ! if (!object_known_p(i_ptr)) return (FALSE); /* Extract the flags */ object_flags(i_ptr, &f1, &f2, &f3); /* Check activation flag */ ! if (f3 & TR3_ACTIVATE) return (TRUE); /* Assume not */ ! return (FALSE); } --- 2251,2266 ---- u32b f1, f2, f3; /* Not known */ ! if (!i_ptr->is_known()) return FALSE; /* Extract the flags */ object_flags(i_ptr, &f1, &f2, &f3); /* Check activation flag */ ! if (f3 & TR3_ACTIVATE) return TRUE; /* Assume not */ ! return FALSE; } *************** *** 2287,2298 **** msg_print("You are surrounded by a malignant aura."); /* Decrease all stats (permanently) */ ! (void)dec_stat(A_STR, 50, TRUE); ! (void)dec_stat(A_INT, 50, TRUE); ! (void)dec_stat(A_WIS, 50, TRUE); ! (void)dec_stat(A_DEX, 50, TRUE); ! (void)dec_stat(A_CON, 50, TRUE); ! (void)dec_stat(A_CHR, 50, TRUE); /* Lose some experience (permanently) */ p_ptr->exp -= (p_ptr->exp / 4); --- 2280,2291 ---- msg_print("You are surrounded by a malignant aura."); /* Decrease all stats (permanently) */ ! dec_stat(A_STR, 50, TRUE); ! dec_stat(A_INT, 50, TRUE); ! dec_stat(A_WIS, 50, TRUE); ! dec_stat(A_DEX, 50, TRUE); ! dec_stat(A_CON, 50, TRUE); ! dec_stat(A_CHR, 50, TRUE); /* Lose some experience (permanently) */ p_ptr->exp -= (p_ptr->exp / 4); *************** *** 2366,2372 **** /* Get the item (on the floor) */ else { ! i_ptr = &i_list[0 - item]; } --- 2359,2365 ---- /* Get the item (on the floor) */ else { ! i_ptr = &i_list[-item]; } *************** *** 2374,2383 **** energy_use = 100; /* Extract the item level */ ! lev = k_info[i_ptr->k_idx].level; /* Hack -- use artifact level instead */ ! if (artifact_p(i_ptr)) lev = a_info[i_ptr->name1].level; /* Base chance of success */ chance = p_ptr->skill_dev; --- 2367,2376 ---- energy_use = 100; /* Extract the item level */ ! lev = i_ptr->obj_level; /* Hack -- use artifact level instead */ ! if (i_ptr->is_artifact()) lev = (i_ptr->a_ptr)->level; /* Base chance of success */ chance = p_ptr->skill_dev; *************** *** 2415,2421 **** /* Artifacts activate by name */ ! if (i_ptr->name1) { /* This needs to be changed */ switch (i_ptr->name1) --- 2408,2414 ---- /* Artifacts activate by name */ ! if (i_ptr->is_artifact()) { /* This needs to be changed */ switch (i_ptr->name1) *************** *** 2424,2430 **** msg_print("Your dagger is covered in fire..."); if (!get_aim_dir(&dir)) return; fire_bolt(GF_FIRE, dir, damroll(9, 8)); ! i_ptr->timeout = rand_int(8) + 8; break; case ART_NIMTHANC: --- 2417,2423 ---- msg_print("Your dagger is covered in fire..."); if (!get_aim_dir(&dir)) return; fire_bolt(GF_FIRE, dir, damroll(9, 8)); ! i_ptr->set_timeout(rand_int(8) + 8); break; case ART_NIMTHANC: *************** *** 2431,2437 **** msg_print("Your dagger is covered in frost..."); if (!get_aim_dir(&dir)) return; fire_bolt(GF_COLD, dir, damroll(6, 8)); ! i_ptr->timeout = rand_int(7) + 7; break; case ART_DETHANC: --- 2424,2430 ---- msg_print("Your dagger is covered in frost..."); if (!get_aim_dir(&dir)) return; fire_bolt(GF_COLD, dir, damroll(6, 8)); ! i_ptr->set_timeout(rand_int(7) + 7); break; case ART_DETHANC: *************** *** 2438,2444 **** msg_print("Your dagger is covered in sparks..."); if (!get_aim_dir(&dir)) return; fire_bolt(GF_ELEC, dir, damroll(4, 8)); ! i_ptr->timeout = rand_int(6) + 6; break; case ART_RILIA: --- 2431,2437 ---- msg_print("Your dagger is covered in sparks..."); if (!get_aim_dir(&dir)) return; fire_bolt(GF_ELEC, dir, damroll(4, 8)); ! i_ptr->set_timeout(rand_int(6) + 6); break; case ART_RILIA: *************** *** 2445,2451 **** msg_print("Your dagger throbs deep green..."); if (!get_aim_dir(&dir)) return; fire_ball(GF_POIS, dir, 12, 3); ! i_ptr->timeout = rand_int(4) + 4; break; case ART_BELANGIL: --- 2438,2444 ---- msg_print("Your dagger throbs deep green..."); if (!get_aim_dir(&dir)) return; fire_ball(GF_POIS, dir, 12, 3); ! i_ptr->set_timeout(rand_int(4) + 4); break; case ART_BELANGIL: *************** *** 2452,2465 **** msg_print("Your dagger is covered in frost..."); if (!get_aim_dir(&dir)) return; fire_ball(GF_COLD, dir, 48, 2); ! i_ptr->timeout = rand_int(5) + 5; break; case ART_DAL: msg_print("You feel energy flow through your feet..."); ! (void)set_afraid(0); ! (void)set_poisoned(0); ! i_ptr->timeout = 5; break; case ART_RINGIL: --- 2445,2458 ---- msg_print("Your dagger is covered in frost..."); if (!get_aim_dir(&dir)) return; fire_ball(GF_COLD, dir, 48, 2); ! i_ptr->set_timeout(rand_int(5) + 5); break; case ART_DAL: msg_print("You feel energy flow through your feet..."); ! set_afraid(0); ! set_poisoned(0); ! i_ptr->set_timeout(5); break; case ART_RINGIL: *************** *** 2466,2472 **** msg_print("Your sword glows an intense blue..."); if (!get_aim_dir(&dir)) return; fire_ball(GF_COLD, dir, 100, 2); ! i_ptr->timeout = 300; break; case ART_ANDURIL: --- 2459,2465 ---- msg_print("Your sword glows an intense blue..."); if (!get_aim_dir(&dir)) return; fire_ball(GF_COLD, dir, 100, 2); ! i_ptr->set_timeout(300); break; case ART_ANDURIL: *************** *** 2473,2479 **** msg_print("Your sword glows an intense red..."); if (!get_aim_dir(&dir)) return; fire_ball(GF_FIRE, dir, 72, 2); ! i_ptr->timeout = 400; break; case ART_FIRESTAR: --- 2466,2472 ---- msg_print("Your sword glows an intense red..."); if (!get_aim_dir(&dir)) return; fire_ball(GF_FIRE, dir, 72, 2); ! i_ptr->set_timeout(400); break; case ART_FIRESTAR: *************** *** 2480,2498 **** msg_print("Your morningstar rages in fire..."); if (!get_aim_dir(&dir)) return; fire_ball(GF_FIRE, dir, 72, 3); ! i_ptr->timeout = 100; break; case ART_FEANOR: if (!p_ptr->fast) { ! (void)set_fast(randint(20) + 20); } else { ! (void)set_fast(p_ptr->fast + 5); } ! i_ptr->timeout = 200; break; case ART_THEODEN: --- 2473,2491 ---- msg_print("Your morningstar rages in fire..."); if (!get_aim_dir(&dir)) return; fire_ball(GF_FIRE, dir, 72, 3); ! i_ptr->set_timeout(100); break; case ART_FEANOR: if (!p_ptr->fast) { ! set_fast(randint(20) + 20); } else { ! set_fast(p_ptr->fast + 5); } ! i_ptr->set_timeout(200); break; case ART_THEODEN: *************** *** 2499,2505 **** msg_print("The blade of your axe glows black..."); if (!get_aim_dir(&dir)) return; drain_life(dir, 120); ! i_ptr->timeout = 400; break; case ART_TURMIL: --- 2492,2498 ---- msg_print("The blade of your axe glows black..."); if (!get_aim_dir(&dir)) return; drain_life(dir, 120); ! i_ptr->set_timeout(400); break; case ART_TURMIL: *************** *** 2506,2518 **** msg_print("The head of your hammer glows white..."); if (!get_aim_dir(&dir)) return; drain_life(dir, 90); ! i_ptr->timeout = 70; break; case ART_CASPANION: msg_print("Your armor glows bright red..."); destroy_doors_touch(); ! i_ptr->timeout = 10; break; case ART_AVAVIR: --- 2499,2511 ---- msg_print("The head of your hammer glows white..."); if (!get_aim_dir(&dir)) return; drain_life(dir, 90); ! i_ptr->set_timeout(70); break; case ART_CASPANION: msg_print("Your armor glows bright red..."); destroy_doors_touch(); ! i_ptr->set_timeout(10); break; case ART_AVAVIR: *************** *** 2526,2569 **** p_ptr->word_recall = 0; msg_print("A tension leaves the air around you..."); } ! i_ptr->timeout = 200; break; case ART_TARATOL: if (!p_ptr->fast) { ! (void)set_fast(randint(20) + 20); } else { ! (void)set_fast(p_ptr->fast + 5); } ! i_ptr->timeout = rand_int(100) + 100; break; case ART_ERIRIL: /* Identify and combine pack */ ! (void)ident_spell(); /* XXX Note that the artifact is always de-charged */ ! i_ptr->timeout = 10; break; case ART_OLORIN: probing(); ! i_ptr->timeout = 20; break; case ART_EONWE: msg_print("Your axe lets out a long, shrill note..."); ! (void)mass_genocide(); ! i_ptr->timeout = 1000; break; case ART_LOTHARANG: msg_print("Your battle axe radiates deep purple..."); hp_player(damroll(4, 8)); ! (void)set_cut((p_ptr->cut / 2) - 50); ! i_ptr->timeout = rand_int(3) + 3; break; case ART_CUBRAGOL: --- 2519,2562 ---- p_ptr->word_recall = 0; msg_print("A tension leaves the air around you..."); } ! i_ptr->set_timeout(200); break; case ART_TARATOL: if (!p_ptr->fast) { ! set_fast(randint(20) + 20); } else { ! set_fast(p_ptr->fast + 5); } ! i_ptr->set_timeout(rand_int(100) + 100); break; case ART_ERIRIL: /* Identify and combine pack */ ! ident_spell(); /* XXX Note that the artifact is always de-charged */ ! i_ptr->set_timeout(10); break; case ART_OLORIN: probing(); ! i_ptr->set_timeout(20); break; case ART_EONWE: msg_print("Your axe lets out a long, shrill note..."); ! mass_genocide(); ! i_ptr->set_timeout(1000); break; case ART_LOTHARANG: msg_print("Your battle axe radiates deep purple..."); hp_player(damroll(4, 8)); ! set_cut((p_ptr->cut / 2) - 50); ! i_ptr->set_timeout(rand_int(3) + 3); break; case ART_CUBRAGOL: *************** *** 2573,2580 **** { object_type *j_ptr = &inventory[a]; if ((j_ptr->tval == TV_BOLT) && ! (!artifact_p(j_ptr)) && (!ego_item_p(j_ptr)) && ! (!cursed_p(j_ptr) && !broken_p(j_ptr))) break; } /* Enchant the bolts (or fail) */ --- 2566,2573 ---- { object_type *j_ptr = &inventory[a]; if ((j_ptr->tval == TV_BOLT) && ! !j_ptr->is_artifact() && !j_ptr->is_ego_item() && ! !j_ptr->is_cursed() && !j_ptr->is_broken()) break; } /* Enchant the bolts (or fail) */ *************** *** 2582,2588 **** { object_type *j_ptr = &inventory[a]; msg_print("Your bolts are covered in a fiery aura!"); ! j_ptr->name2 = EGO_FLAME; enchant(j_ptr, rand_int(3) + 4, ENCH_TOHIT | ENCH_TODAM); } else --- 2575,2581 ---- { object_type *j_ptr = &inventory[a]; msg_print("Your bolts are covered in a fiery aura!"); ! j_ptr->set_name2(EGO_FLAME); enchant(j_ptr, rand_int(3) + 4, ENCH_TOHIT | ENCH_TODAM); } else *************** *** 2591,2604 **** msg_print("The fiery enchantment failed."); } ! i_ptr->timeout = 999; break; ! case ART_ARUNRUTH: msg_print("Your sword glows a pale blue..."); if (!get_aim_dir(&dir)) return; fire_bolt(GF_COLD, dir, damroll(12, 8)); ! i_ptr->timeout = 500; break; case ART_AEGLOS: --- 2584,2597 ---- msg_print("The fiery enchantment failed."); } ! i_ptr->set_timeout(999); break; ! case ART_ARANRUTH: msg_print("Your sword glows a pale blue..."); if (!get_aim_dir(&dir)) return; fire_bolt(GF_COLD, dir, damroll(12, 8)); ! i_ptr->set_timeout(500); break; case ART_AEGLOS: *************** *** 2605,2611 **** msg_print("Your spear glows a bright white..."); if (!get_aim_dir(&dir)) return; fire_ball(GF_COLD, dir, 100, 2); ! i_ptr->timeout = 500; break; case ART_OROME: --- 2598,2604 ---- msg_print("Your spear glows a bright white..."); if (!get_aim_dir(&dir)) return; fire_ball(GF_COLD, dir, 100, 2); ! i_ptr->set_timeout(500); break; case ART_OROME: *************** *** 2612,2641 **** msg_print("Your spear pulsates..."); if (!get_aim_dir(&dir)) return; wall_to_mud(dir); ! i_ptr->timeout = 5; break; case ART_SOULKEEPER: msg_print("Your armor glows a bright white..."); msg_print("You feel much better..."); ! (void)hp_player(1000); ! (void)set_cut(0); ! i_ptr->timeout = 888; break; case ART_BELEGENNON: teleport_player(10); ! i_ptr->timeout = 2; break; case ART_CELEBORN: ! (void)genocide(); ! i_ptr->timeout = 500; break; case ART_LUTHIEN: restore_level(); ! i_ptr->timeout = 450; break; case ART_ULMO: --- 2605,2634 ---- msg_print("Your spear pulsates..."); if (!get_aim_dir(&dir)) return; wall_to_mud(dir); ! i_ptr->set_timeout(5); break; case ART_SOULKEEPER: msg_print("Your armor glows a bright white..."); msg_print("You feel much better..."); ! hp_player(1000); ! set_cut(0); ! i_ptr->set_timeout(888); break; case ART_BELEGENNON: teleport_player(10); ! i_ptr->set_timeout(2); break; case ART_CELEBORN: ! genocide(); ! i_ptr->set_timeout(500); break; case ART_LUTHIEN: restore_level(); ! i_ptr->set_timeout(450); break; case ART_ULMO: *************** *** 2642,2675 **** msg_print("Your trident glows deep red..."); if (!get_aim_dir(&dir)) return; teleport_monster(dir); ! i_ptr->timeout = 150; break; case ART_COLLUIN: ! msg_print("Your cloak glows many colours..."); ! (void)set_oppose_acid(p_ptr->oppose_acid + randint(20) + 20); ! (void)set_oppose_elec(p_ptr->oppose_elec + randint(20) + 20); ! (void)set_oppose_fire(p_ptr->oppose_fire + randint(20) + 20); ! (void)set_oppose_cold(p_ptr->oppose_cold + randint(20) + 20); ! (void)set_oppose_pois(p_ptr->oppose_pois + randint(20) + 20); ! i_ptr->timeout = 111; break; case ART_HOLCOLLETH: msg_print("Your cloak glows deep blue..."); sleep_monsters_touch(); ! i_ptr->timeout = 55; break; case ART_THINGOL: msg_print("You hear a low humming noise..."); recharge(60); ! i_ptr->timeout = 70; break; case ART_COLANNON: teleport_player(100); ! i_ptr->timeout = 45; break; case ART_TOTILA: --- 2635,2668 ---- msg_print("Your trident glows deep red..."); if (!get_aim_dir(&dir)) return; teleport_monster(dir); ! i_ptr->set_timeout(150); break; case ART_COLLUIN: ! msg_print("Your cloak glows many colors..."); ! set_oppose_acid(p_ptr->oppose_acid + randint(20) + 20); ! set_oppose_elec(p_ptr->oppose_elec + randint(20) + 20); ! set_oppose_fire(p_ptr->oppose_fire + randint(20) + 20); ! set_oppose_cold(p_ptr->oppose_cold + randint(20) + 20); ! set_oppose_pois(p_ptr->oppose_pois + randint(20) + 20); ! i_ptr->set_timeout(111); break; case ART_HOLCOLLETH: msg_print("Your cloak glows deep blue..."); sleep_monsters_touch(); ! i_ptr->set_timeout(55); break; case ART_THINGOL: msg_print("You hear a low humming noise..."); recharge(60); ! i_ptr->set_timeout(70); break; case ART_COLANNON: teleport_player(100); ! i_ptr->set_timeout(45); break; case ART_TOTILA: *************** *** 2676,2689 **** msg_print("Your flail glows in scintillating colours..."); if (!get_aim_dir(&dir)) return; confuse_monster(dir, 20); ! i_ptr->timeout = 15; break; case ART_CAMMITHRIM: msg_print("Your gloves glow extremely brightly..."); if (!get_aim_dir(&dir)) return; ! fire_bolt(GF_MISSILE, dir, damroll(2, 6)); ! i_ptr->timeout = 2; break; case ART_PAURHACH: --- 2669,2682 ---- msg_print("Your flail glows in scintillating colours..."); if (!get_aim_dir(&dir)) return; confuse_monster(dir, 20); ! i_ptr->set_timeout(15); break; case ART_CAMMITHRIM: msg_print("Your gloves glow extremely brightly..."); if (!get_aim_dir(&dir)) return; ! fire_bolt(GF_MISSILE, dir, damroll(3, 4)); ! i_ptr->set_timeout(2); break; case ART_PAURHACH: *************** *** 2690,2696 **** msg_print("Your gauntlets are covered in fire..."); if (!get_aim_dir(&dir)) return; fire_bolt(GF_FIRE, dir, damroll(9,8)); ! i_ptr->timeout = rand_int(8) + 8; break; case ART_PAURNIMMEN: --- 2683,2689 ---- msg_print("Your gauntlets are covered in fire..."); if (!get_aim_dir(&dir)) return; fire_bolt(GF_FIRE, dir, damroll(9,8)); ! i_ptr->set_timeout(rand_int(8) + 8); break; case ART_PAURNIMMEN: *************** *** 2697,2703 **** msg_print("Your gauntlets are covered in frost..."); if (!get_aim_dir(&dir)) return; fire_bolt(GF_COLD, dir, damroll(6, 8)); ! i_ptr->timeout = rand_int(7) + 7; break; case ART_PAURAEGEN: --- 2690,2696 ---- msg_print("Your gauntlets are covered in frost..."); if (!get_aim_dir(&dir)) return; fire_bolt(GF_COLD, dir, damroll(6, 8)); ! i_ptr->set_timeout(rand_int(7) + 7); break; case ART_PAURAEGEN: *************** *** 2704,2710 **** msg_print("Your gauntlets are covered in sparks..."); if (!get_aim_dir(&dir)) return; fire_bolt(GF_ELEC, dir, damroll(4, 8)); ! i_ptr->timeout = rand_int(6) + 6; break; case ART_PAURNEN: --- 2697,2703 ---- msg_print("Your gauntlets are covered in sparks..."); if (!get_aim_dir(&dir)) return; fire_bolt(GF_ELEC, dir, damroll(4, 8)); ! i_ptr->set_timeout(rand_int(6) + 6); break; case ART_PAURNEN: *************** *** 2711,2717 **** msg_print("Your gauntlets look very acidic..."); if (!get_aim_dir(&dir)) return; fire_bolt(GF_ACID, dir, damroll(5, 8)); ! i_ptr->timeout = rand_int(5) + 5; break; case ART_FINGOLFIN: --- 2704,2710 ---- msg_print("Your gauntlets look very acidic..."); if (!get_aim_dir(&dir)) return; fire_bolt(GF_ACID, dir, damroll(5, 8)); ! i_ptr->set_timeout(rand_int(5) + 5); break; case ART_FINGOLFIN: *************** *** 2718,2757 **** msg_print("Magical spikes appear on your cesti..."); if (!get_aim_dir(&dir)) return; fire_bolt(GF_ARROW, dir, 150); ! i_ptr->timeout = rand_int(90) + 90; break; case ART_HOLHENNETH: msg_print("An image forms in your mind..."); detection(); ! i_ptr->timeout = rand_int(55) + 55; break; case ART_GONDOR: msg_print("You feel a warm tingling inside..."); ! (void)hp_player(500); ! (void)set_cut(0); ! i_ptr->timeout = 500; break; case ART_RAZORBACK: msg_print("You are surrounded by lightning!"); for (i = 0; i < 8; i++) fire_ball(GF_ELEC, ddd[i], 150, 3); ! i_ptr->timeout = 1000; break; case ART_BLADETURNER: msg_print("Your armor glows many colours..."); ! (void)hp_player(30); ! (void)set_afraid(0); ! (void)set_shero(p_ptr->shero + randint(50) + 50); ! (void)set_blessed(p_ptr->blessed + randint(50) + 50); ! (void)set_oppose_acid(p_ptr->oppose_acid + randint(50) + 50); ! (void)set_oppose_elec(p_ptr->oppose_elec + randint(50) + 50); ! (void)set_oppose_fire(p_ptr->oppose_fire + randint(50) + 50); ! (void)set_oppose_cold(p_ptr->oppose_cold + randint(50) + 50); ! (void)set_oppose_pois(p_ptr->oppose_pois + randint(50) + 50); ! i_ptr->timeout = 400; break; --- 2711,2750 ---- msg_print("Magical spikes appear on your cesti..."); if (!get_aim_dir(&dir)) return; fire_bolt(GF_ARROW, dir, 150); ! i_ptr->set_timeout(rand_int(90) + 90); break; case ART_HOLHENNETH: msg_print("An image forms in your mind..."); detection(); ! i_ptr->set_timeout(rand_int(55) + 55); break; case ART_GONDOR: msg_print("You feel a warm tingling inside..."); ! hp_player(500); ! set_cut(0); ! i_ptr->set_timeout(500); break; case ART_RAZORBACK: msg_print("You are surrounded by lightning!"); for (i = 0; i < 8; i++) fire_ball(GF_ELEC, ddd[i], 150, 3); ! i_ptr->set_timeout(1000); break; case ART_BLADETURNER: msg_print("Your armor glows many colours..."); ! hp_player(30); ! set_afraid(0); ! set_shero(p_ptr->shero + randint(50) + 50); ! set_blessed(p_ptr->blessed + randint(50) + 50); ! set_oppose_acid(p_ptr->oppose_acid + randint(50) + 50); ! set_oppose_elec(p_ptr->oppose_elec + randint(50) + 50); ! set_oppose_fire(p_ptr->oppose_fire + randint(50) + 50); ! set_oppose_cold(p_ptr->oppose_cold + randint(50) + 50); ! set_oppose_pois(p_ptr->oppose_pois + randint(50) + 50); ! i_ptr->set_timeout(400); break; *************** *** 2758,2778 **** case ART_GALADRIEL: msg_print("The phial wells with clear light..."); lite_area(damroll(2, 15), 3); ! i_ptr->timeout = rand_int(10) + 10; break; case ART_ELENDIL: msg_print("The star shines brightly..."); map_area(); ! i_ptr->timeout = rand_int(50) + 50; break; case ART_THRAIN: msg_print("The stone glows a deep green..."); wiz_lite(); ! (void)detect_sdoor(); ! (void)detect_trap(); ! i_ptr->timeout = rand_int(100) + 100; break; --- 2751,2771 ---- case ART_GALADRIEL: msg_print("The phial wells with clear light..."); lite_area(damroll(2, 15), 3); ! i_ptr->set_timeout(rand_int(10) + 10); break; case ART_ELENDIL: msg_print("The star shines brightly..."); map_area(); ! i_ptr->set_timeout(rand_int(50) + 50); break; case ART_THRAIN: msg_print("The stone glows a deep green..."); wiz_lite(); ! detect_sdoor(); ! detect_trap(); ! i_ptr->set_timeout(rand_int(100) + 100); break; *************** *** 2779,2792 **** case ART_INGWE: msg_print("An aura of good floods the area..."); dispel_evil(p_ptr->lev * 5); ! i_ptr->timeout = rand_int(300) + 300; break; case ART_CARLAMMAS: msg_print("The amulet lets out a shrill wail..."); k = 3 * p_ptr->lev; ! (void)set_protevil(p_ptr->protevil + randint(25) + k); ! i_ptr->timeout = rand_int(225) + 225; break; --- 2772,2785 ---- case ART_INGWE: msg_print("An aura of good floods the area..."); dispel_evil(p_ptr->lev * 5); ! i_ptr->set_timeout(rand_int(300) + 300); break; case ART_CARLAMMAS: msg_print("The amulet lets out a shrill wail..."); k = 3 * p_ptr->lev; ! set_protevil(p_ptr->protevil + randint(25) + k); ! i_ptr->set_timeout(rand_int(225) + 225); break; *************** *** 2794,2806 **** msg_print("The ring glows brightly..."); if (!p_ptr->fast) { ! (void)set_fast(randint(75) + 75); } else { ! (void)set_fast(p_ptr->fast + 5); } ! i_ptr->timeout = rand_int(150) + 150; break; case ART_NARYA: --- 2787,2799 ---- msg_print("The ring glows brightly..."); if (!p_ptr->fast) { ! set_fast(randint(75) + 75); } else { ! set_fast(p_ptr->fast + 5); } ! i_ptr->set_timeout(rand_int(150) + 150); break; case ART_NARYA: *************** *** 2807,2813 **** msg_print("The ring glows deep red..."); if (!get_aim_dir(&dir)) return; fire_ball(GF_FIRE, dir, 120, 3); ! i_ptr->timeout = rand_int(225) + 225; break; case ART_NENYA: --- 2800,2806 ---- msg_print("The ring glows deep red..."); if (!get_aim_dir(&dir)) return; fire_ball(GF_FIRE, dir, 120, 3); ! i_ptr->set_timeout(rand_int(225) + 225); break; case ART_NENYA: *************** *** 2814,2820 **** msg_print("The ring glows bright white..."); if (!get_aim_dir(&dir)) return; fire_ball(GF_COLD, dir, 200, 3); ! i_ptr->timeout = rand_int(325) + 325; break; case ART_VILYA: --- 2807,2813 ---- msg_print("The ring glows bright white..."); if (!get_aim_dir(&dir)) return; fire_ball(GF_COLD, dir, 200, 3); ! i_ptr->set_timeout(rand_int(325) + 325); break; case ART_VILYA: *************** *** 2821,2827 **** msg_print("The ring glows deep blue..."); if (!get_aim_dir(&dir)) return; fire_ball(GF_ELEC, dir, 250, 3); ! i_ptr->timeout = rand_int(425) + 425; break; case ART_POWER: --- 2814,2820 ---- msg_print("The ring glows deep blue..."); if (!get_aim_dir(&dir)) return; fire_ball(GF_ELEC, dir, 250, 3); ! i_ptr->set_timeout(rand_int(425) + 425); break; case ART_POWER: *************** *** 2828,2834 **** msg_print("The ring glows intensely black..."); if (!get_aim_dir(&dir)) return; ring_of_power(dir); ! i_ptr->timeout = rand_int(450) + 450; break; --- 2821,2827 ---- msg_print("The ring glows intensely black..."); if (!get_aim_dir(&dir)) return; ring_of_power(dir); ! i_ptr->set_timeout(rand_int(450) + 450); break; *************** *** 2856,2886 **** case SV_DRAGON_BLUE: msg_print("You breathe lightning."); fire_ball(GF_ELEC, dir, 100, 2); ! i_ptr->timeout = rand_int(450) + 450; break; case SV_DRAGON_WHITE: msg_print("You breathe frost."); fire_ball(GF_COLD, dir, 110, 2); ! i_ptr->timeout = rand_int(450) + 450; break; case SV_DRAGON_BLACK: msg_print("You breathe acid."); fire_ball(GF_ACID, dir, 130, 2); ! i_ptr->timeout = rand_int(450) + 450; break; case SV_DRAGON_GREEN: msg_print("You breathe poison gas."); fire_ball(GF_POIS, dir, 150, 2); ! i_ptr->timeout = rand_int(450) + 450; break; case SV_DRAGON_RED: msg_print("You breathe fire."); fire_ball(GF_FIRE, dir, 200, 2); ! i_ptr->timeout = rand_int(450) + 450; break; case SV_DRAGON_MULTIHUED: --- 2849,2879 ---- case SV_DRAGON_BLUE: msg_print("You breathe lightning."); fire_ball(GF_ELEC, dir, 100, 2); ! i_ptr->set_timeout(rand_int(450) + 450); break; case SV_DRAGON_WHITE: msg_print("You breathe frost."); fire_ball(GF_COLD, dir, 110, 2); ! i_ptr->set_timeout(rand_int(450) + 450); break; case SV_DRAGON_BLACK: msg_print("You breathe acid."); fire_ball(GF_ACID, dir, 130, 2); ! i_ptr->set_timeout(rand_int(450) + 450); break; case SV_DRAGON_GREEN: msg_print("You breathe poison gas."); fire_ball(GF_POIS, dir, 150, 2); ! i_ptr->set_timeout(rand_int(450) + 450); break; case SV_DRAGON_RED: msg_print("You breathe fire."); fire_ball(GF_FIRE, dir, 200, 2); ! i_ptr->set_timeout(rand_int(450) + 450); break; case SV_DRAGON_MULTIHUED: *************** *** 2895,2913 **** ((chance == 3) ? GF_ACID : ((chance == 4) ? GF_POIS : GF_FIRE)))), dir, 250, 2); ! i_ptr->timeout = rand_int(225) + 225; break; case SV_DRAGON_BRONZE: msg_print("You breathe confusion."); fire_ball(GF_CONFUSION, dir, 120, 2); ! i_ptr->timeout = rand_int(450) + 450; break; case SV_DRAGON_GOLD: msg_print("You breathe sound."); fire_ball(GF_SOUND, dir, 130, 2); ! i_ptr->timeout = rand_int(450) + 450; break; case SV_DRAGON_CHAOS: --- 2888,2906 ---- ((chance == 3) ? GF_ACID : ((chance == 4) ? GF_POIS : GF_FIRE)))), dir, 250, 2); ! i_ptr->set_timeout(rand_int(225) + 225); break; case SV_DRAGON_BRONZE: msg_print("You breathe confusion."); fire_ball(GF_CONFUSION, dir, 120, 2); ! i_ptr->set_timeout(rand_int(450) + 450); break; case SV_DRAGON_GOLD: msg_print("You breathe sound."); fire_ball(GF_SOUND, dir, 130, 2); ! i_ptr->set_timeout(rand_int(450) + 450); break; case SV_DRAGON_CHAOS: *************** *** 2916,2922 **** ((chance == 1 ? "chaos" : "disenchantment"))); fire_ball((chance == 1 ? GF_CHAOS : GF_DISENCHANT), dir, 220, 2); ! i_ptr->timeout = rand_int(300) + 300; break; case SV_DRAGON_LAW: --- 2909,2915 ---- ((chance == 1 ? "chaos" : "disenchantment"))); fire_ball((chance == 1 ? GF_CHAOS : GF_DISENCHANT), dir, 220, 2); ! i_ptr->set_timeout(rand_int(300) + 300); break; case SV_DRAGON_LAW: *************** *** 2925,2931 **** ((chance == 1 ? "sound" : "shards"))); fire_ball((chance == 1 ? GF_SOUND : GF_SHARDS), dir, 230, 2); ! i_ptr->timeout = rand_int(300) + 300; break; case SV_DRAGON_BALANCE: --- 2918,2924 ---- ((chance == 1 ? "sound" : "shards"))); fire_ball((chance == 1 ? GF_SOUND : GF_SHARDS), dir, 230, 2); ! i_ptr->set_timeout(rand_int(300) + 300); break; case SV_DRAGON_BALANCE: *************** *** 2938,2944 **** ((chance == 2) ? GF_DISENCHANT : ((chance == 3) ? GF_SOUND : GF_SHARDS))), dir, 250, 2); ! i_ptr->timeout = rand_int(300) + 300; break; case SV_DRAGON_SHINING: --- 2931,2937 ---- ((chance == 2) ? GF_DISENCHANT : ((chance == 3) ? GF_SOUND : GF_SHARDS))), dir, 250, 2); ! i_ptr->set_timeout(rand_int(300) + 300); break; case SV_DRAGON_SHINING: *************** *** 2946,2958 **** msg_format("You breathe %s.", ((chance == 0 ? "light" : "darkness"))); fire_ball((chance == 0 ? GF_LITE : GF_DARK), dir, 200, 2); ! i_ptr->timeout = rand_int(300) + 300; break; case SV_DRAGON_POWER: msg_print("You breathe the elements."); fire_ball(GF_MISSILE, dir, 300, 2); ! i_ptr->timeout = rand_int(300) + 300; break; default: --- 2939,2951 ---- msg_format("You breathe %s.", ((chance == 0 ? "light" : "darkness"))); fire_ball((chance == 0 ? GF_LITE : GF_DARK), dir, 200, 2); ! i_ptr->set_timeout(rand_int(300) + 300); break; case SV_DRAGON_POWER: msg_print("You breathe the elements."); fire_ball(GF_MISSILE, dir, 300, 2); ! i_ptr->set_timeout(rand_int(300) + 300); break; default: diff -w -c -r ick-279/config.h utumno/config.h *** ick-279/config.h Sat Apr 13 11:24:29 1996 --- utumno/config.h Wed May 14 03:13:54 1997 *************** *** 139,152 **** /* - * OPTION: Verify savefile Checksums (Angband 2.7.0 and up) - * This option can help prevent "corruption" of savefiles, and also - * stop intentional modification by amateur users. - */ - #define VERIFY_CHECKSUMS - - - /* * OPTION: Forbid the use of "fiddled" savefiles. As far as I can tell, * a fiddled savefile is one with an internal timestamp different from * the actual timestamp. Thus, turning this option on forbids one from --- 139,144 ---- *************** *** 178,184 **** /* * OPTION: Hack -- Compile in support for "Wizard Commands" */ ! /* #define ALLOW_WIZARD */ /* * OPTION: Hack -- Compile in support for "Spoiler Generation" --- 170,176 ---- /* * OPTION: Hack -- Compile in support for "Wizard Commands" */ ! #define ALLOW_WIZARD /* * OPTION: Hack -- Compile in support for "Spoiler Generation" *************** *** 203,214 **** /* - * OPTION: Allow characteres to be "auto-rolled" - */ - #define ALLOW_AUTOROLLER - - - /* * OPTION: Allow monsters to "flee" when hit hard */ #define ALLOW_FEAR --- 195,200 ---- *************** *** 314,353 **** */ #define DRS_SHOW_SPELL_INFO - /* - * OPTION: Allow use of the monster health bar -DRS- - */ - #define DRS_SHOW_HEALTH_BAR - /* - * OPTION: Enable the "smart_learn" and "smart_cheat" options. - * They let monsters make more "intelligent" choices about attacks - * (including spell attacks) based on their observations of the - * player's reactions to previous attacks. The "smart_cheat" option - * lets the monster know how the player would react to an attack - * without actually needing to make the attack. The "smart_learn" - * option requires that a monster make a "failed" attack before - * learning that the player is not harmed by that attack. - * - * This adds about 3K to the memory and about 5K to the executable. - */ - #define DRS_SMART_OPTIONS - - - - /* - * OPTION: Enable the "track_follow" and "track_target" options. - * They let monsters follow the player's foot-prints, or remember - * the player's recent locations. This code has been removed from - * the current version because it is being rewritten by Billy, and - * until it is ready, it will not work. Do not define this option. - */ - /* #define WDT_TRACK_OPTIONS */ - - - - /* * OPTION: Allow the use of "color" in various places. Disabling this * flag will remove some code, and auto-cast all colors to "White". * This will almost certainly speed up the program. Note that there --- 300,307 ---- *************** *** 432,444 **** /* * OPTION: Check the "time" against "lib/file/hours.txt" */ ! /* #define CHECK_TIME */ /* * OPTION: Check the "load" against "lib/file/load.txt" * This may require the 'rpcsvs' library */ ! /* #define CHECK_LOAD */ /* --- 386,398 ---- /* * OPTION: Check the "time" against "lib/file/hours.txt" */ ! // #define CHECK_TIME /* * OPTION: Check the "load" against "lib/file/load.txt" * This may require the 'rpcsvs' library */ ! // #define CHECK_LOAD /* *************** *** 491,497 **** /* * OPTION: Person to bother if something goes wrong. */ ! #define MAINTAINER "benh@voicenet.com" /* --- 445,451 ---- /* * OPTION: Person to bother if something goes wrong. */ ! #define MAINTAINER "craighea@citilink.com" /* *************** *** 531,537 **** /* * OPTION: Attempt to minimize the size of the game */ ! /* #define ANGBAND_LITE */ /* * Hack -- React to the "ANGBAND_LITE" flag --- 485,491 ---- /* * OPTION: Attempt to minimize the size of the game */ ! // #define ANGBAND_LITE /* * Hack -- React to the "ANGBAND_LITE" flag *************** *** 544,551 **** # undef ALLOW_VISUALS # undef ALLOW_MACROS # undef MONSTER_FLOW - # undef WDT_TRACK_OPTIONS - # undef DRS_SMART_OPTIONS # undef ALLOW_OLD_SAVEFILES # undef ALLOW_BORG # undef ALLOW_WIZARD --- 498,503 ---- *************** *** 557,563 **** /* * OPTION: Attempt to prevent all "cheating" */ ! /* #define VERIFY_HONOR */ /* --- 509,515 ---- /* * OPTION: Attempt to prevent all "cheating" */ ! // #define VERIFY_HONOR /* *************** *** 565,571 **** */ #ifdef VERIFY_HONOR # define VERIFY_SAVEFILE - # define VERIFY_CHECKSUMS # define VERIFY_TIMESTAMPS #endif --- 517,522 ---- diff -w -c -r ick-279/defines.h utumno/defines.h *** ick-279/defines.h Sun Apr 14 20:10:27 1996 --- utumno/defines.h Wed May 14 21:24:28 1997 *************** *** 33,50 **** /* ! * Current version number of Angband: 2.7.9 */ ! #define VERSION_MAJOR 2 ! #define VERSION_MINOR 7 ! #define VERSION_PATCH 9 - /* - * This value is not currently used - */ - #define VERSION_EXTRA 0 - /* * Number of grids used to display the dungeon (vertically). * Must be a multiple of 11, probably hard-coded to 22. --- 33,47 ---- /* ! * Current version number of Utumno: 0.1a1 */ ! #define VERSION_MAJOR 0 ! #define VERSION_MINOR 1 ! #define VERSION_PATCH 2 ! #define VERSION_TYPE 0 // 0 = alpha, 1 = beta, 2 = minor, 3 = major ! #define VERSION_STRING "v0.1a2" /* * Number of grids used to display the dungeon (vertically). * Must be a multiple of 11, probably hard-coded to 22. *************** *** 113,119 **** /* * Hack -- Maximum number of quests */ ! #define MAX_Q_IDX 4 /* * Maximum number of high scores in the high score file --- 110,116 ---- /* * Hack -- Maximum number of quests */ ! #define MAX_Q_IDX 8 /* * Maximum number of high scores in the high score file *************** *** 201,207 **** #define STORE_TURNOVER 9 /* Normal shop turnover, per day */ #define STORE_MIN_KEEP 6 /* Min slots to "always" keep full */ #define STORE_MAX_KEEP 18 /* Max slots to "always" keep full */ ! #define STORE_SHUFFLE 100 /* 1/Chance (per day) of an owner changing */ #define STORE_TURNS 1000 /* Number of turns between turnovers */ --- 198,204 ---- #define STORE_TURNOVER 9 /* Normal shop turnover, per day */ #define STORE_MIN_KEEP 6 /* Min slots to "always" keep full */ #define STORE_MAX_KEEP 18 /* Max slots to "always" keep full */ ! #define STORE_SHUFFLE 25 /* 1/Chance (per day) of an owner changing */ #define STORE_TURNS 1000 /* Number of turns between turnovers */ *************** *** 488,494 **** #define ART_RAZORBACK 16 #define ART_BLADETURNER 17 ! /* Hard Armour */ #define ART_SOULKEEPER 19 #define ART_ISILDUR 20 #define ART_ROHIRRIM 21 --- 485,491 ---- #define ART_RAZORBACK 16 #define ART_BLADETURNER 17 ! /* Hard Armor */ #define ART_SOULKEEPER 19 #define ART_ISILDUR 20 #define ART_ROHIRRIM 21 *************** *** 497,503 **** #define ART_ARVEDUI 24 #define ART_CASPANION 25 ! /* Soft Armour */ #define ART_HITHLOMIR 27 #define ART_THALKETTOTH 28 --- 494,500 ---- #define ART_ARVEDUI 24 #define ART_CASPANION 25 ! /* Soft Armor */ #define ART_HITHLOMIR 27 #define ART_THALKETTOTH 28 *************** *** 550,556 **** #define ART_RILIA 69 #define ART_BELANGIL 70 #define ART_CALRIS 71 ! #define ART_ARUNRUTH 72 #define ART_GLAMDRING 73 #define ART_AEGLIN 74 #define ART_ORCRIST 75 --- 547,553 ---- #define ART_RILIA 69 #define ART_BELANGIL 70 #define ART_CALRIS 71 ! #define ART_ARANRUTH 72 #define ART_GLAMDRING 73 #define ART_AEGLIN 74 #define ART_ORCRIST 75 *************** *** 716,733 **** #define EGO_SLAY_TROLL 85 #define EGO_SLAY_GIANT 86 #define EGO_SLAY_DRAGON 87 - #define EGO_KILL_ANIMAL 88 - #define EGO_KILL_EVIL 89 - #define EGO_KILL_UNDEAD 90 - #define EGO_KILL_DEMON 83 - #define EGO_KILL_ORC 84 - #define EGO_KILL_TROLL 85 - #define EGO_KILL_GIANT 86 - #define EGO_KILL_DRAGON 95 /* xxx */ /* xxx */ /* xxx */ /* xxx */ #define EGO_DIGGING 100 /* xxx */ #define EGO_MORGUL 102 --- 713,730 ---- #define EGO_SLAY_TROLL 85 #define EGO_SLAY_GIANT 86 #define EGO_SLAY_DRAGON 87 /* xxx */ /* xxx */ /* xxx */ /* xxx */ + /* xxx */ + /* xxx */ + /* xxx */ + /* xxx */ + /* xxx */ + /* xxx */ + /* xxx */ + /* xxx */ #define EGO_DIGGING 100 /* xxx */ #define EGO_MORGUL 102 *************** *** 753,759 **** /* xxx */ #define EGO_HURT_DRAGON 119 /* xxx */ ! /* xxx */ #define EGO_FLAME 122 #define EGO_FROST 123 #define EGO_WOUNDING 124 --- 750,756 ---- /* xxx */ #define EGO_HURT_DRAGON 119 /* xxx */ ! #define EGO_VENOM 121 #define EGO_FLAME 122 #define EGO_FROST 123 #define EGO_WOUNDING 124 *************** *** 762,767 **** --- 759,832 ---- #define EGO_BLASTED 127 + /*** Cave Features ***/ + + #define CF_NOTHING 0x00 + #define CF_FLOOR 0x01 + #define CF_TRAP_INVIS 0x02 + #define CF_GLYPH 0x03 + #define CF_DOOR_OPEN 0x04 + #define CF_DOOR_BROKEN 0x05 + #define CF_STAIRS_UP 0x06 + #define CF_STAIRS_DOWN 0x07 + #define CF_SHOP_GENERAL 0x08 + #define CF_SHOP_ARMORER 0x09 + #define CF_SHOP_WEAPON 0x0A + #define CF_SHOP_TEMPLE 0x0B + #define CF_SHOP_ALCHEMIST 0x0C + #define CF_SHOP_MAGIC 0x0D + #define CF_SHOP_BLACK 0x0E + #define CF_SHOP_HOME 0x0F + #define CF_TRAP_TRAP_DOOR 0x10 + #define CF_TRAP_OPEN_PIT 0x11 + #define CF_TRAP_SPIKED_PIT 0x12 + #define CF_TRAP_POISON_PIT 0x13 + #define CF_TRAP_SUMMON 0x14 + #define CF_TRAP_TELEPORT 0x15 + #define CF_TRAP_FIRE 0x16 + #define CF_TRAP_ACID 0x17 + #define CF_TRAP_DART_SLOW 0x18 + #define CF_TRAP_DART_STR 0x19 + #define CF_TRAP_DART_DEX 0x1A + #define CF_TRAP_DART_CON 0x1B + #define CF_TRAP_GAS_BLIND 0x1C + #define CF_TRAP_GAS_CONFUSE 0x1D + #define CF_TRAP_GAS_POISON 0x1E + #define CF_TRAP_GAS_SLEEP 0x1F + #define CF_DOOR_LOCKED_0 0x20 + #define CF_DOOR_LOCKED_1 0x21 + #define CF_DOOR_LOCKED_2 0x22 + #define CF_DOOR_LOCKED_3 0x23 + #define CF_DOOR_LOCKED_4 0x24 + #define CF_DOOR_LOCKED_5 0x25 + #define CF_DOOR_LOCKED_6 0x26 + #define CF_DOOR_LOCKED_7 0x27 + #define CF_DOOR_JAMMED_0 0x28 + #define CF_DOOR_JAMMED_1 0x29 + #define CF_DOOR_JAMMED_2 0x2A + #define CF_DOOR_JAMMED_3 0x2B + #define CF_DOOR_JAMMED_4 0x2C + #define CF_DOOR_JAMMED_5 0x2D + #define CF_DOOR_JAMMED_6 0x2E + #define CF_DOOR_JAMMED_7 0x2F + #define CF_DOOR_SECRET 0x30 + #define CF_RUBBLE 0x31 + #define CF_MAGMA 0x32 + #define CF_QUARTZ 0x33 + #define CF_MAGMA_TREASURE 0x34 + #define CF_QUARTZ_TREASURE 0x35 + #define CF_MAGMA_KNOWN 0x36 + #define CF_QUARTZ_KNOWN 0x37 + #define CF_GRANITE_BASIC 0x38 + #define CF_GRANITE_INNER 0x39 + #define CF_GRANITE_OUTER 0x3A + #define CF_GRANITE_SOLID 0x3B + #define CF_PERMANENT_BASIC 0x3C + #define CF_PERMANENT_INNER 0x3D + #define CF_PERMANENT_OUTER 0x3E + #define CF_PERMANENT_SOLID 0x3F + + /*** Object "tval" and "sval" codes ***/ *************** *** 782,789 **** #define TV_NOTHING 0 /* Nothing */ #define TV_SKELETON 1 /* Skeletons ('s') */ #define TV_BOTTLE 2 /* Empty bottles ('!') */ - #define TV_JUNK 3 /* Sticks, Pottery, etc ('~') */ - #define TV_SPIKE 5 /* Spikes ('~') */ #define TV_CHEST 7 /* Chests ('~') */ #define TV_SHOT 16 /* Ammo for slings */ #define TV_ARROW 17 /* Ammo for bows */ --- 847,852 ---- *************** *** 912,918 **** /* The "sval" codes for TV_CLOAK */ #define SV_CLOAK 1 ! #define SV_SHADOW_CLOAK 6 /* The "sval" codes for TV_GLOVES */ #define SV_SET_OF_LEATHER_GLOVES 1 --- 975,981 ---- /* The "sval" codes for TV_CLOAK */ #define SV_CLOAK 1 ! #define SV_ELVEN_CLOAK 6 /* The "sval" codes for TV_GLOVES */ #define SV_SET_OF_LEATHER_GLOVES 1 *************** *** 935,945 **** #define SV_AUGMENTED_CHAIN_MAIL 6 /* 16 */ #define SV_DOUBLE_CHAIN_MAIL 7 /* 16 */ #define SV_BAR_CHAIN_MAIL 8 /* 18 */ ! #define SV_METAL_BRIGANDINE_ARMOUR 9 /* 19 */ ! #define SV_PARTIAL_PLATE_ARMOUR 12 /* 22 */ ! #define SV_METAL_LAMELLAR_ARMOUR 13 /* 23 */ ! #define SV_FULL_PLATE_ARMOUR 15 /* 25 */ ! #define SV_RIBBED_PLATE_ARMOUR 18 /* 28 */ #define SV_MITHRIL_CHAIN_MAIL 20 /* 28+ */ #define SV_MITHRIL_PLATE_MAIL 25 /* 35+ */ #define SV_ADAMANTITE_PLATE_MAIL 30 /* 40+ */ --- 998,1008 ---- #define SV_AUGMENTED_CHAIN_MAIL 6 /* 16 */ #define SV_DOUBLE_CHAIN_MAIL 7 /* 16 */ #define SV_BAR_CHAIN_MAIL 8 /* 18 */ ! #define SV_METAL_BRIGANDINE_ARMOR 9 /* 19 */ ! #define SV_PARTIAL_PLATE_ARMOR 12 /* 22 */ ! #define SV_METAL_LAMELLAR_ARMOR 13 /* 23 */ ! #define SV_FULL_PLATE_ARMOR 15 /* 25 */ ! #define SV_RIBBED_PLATE_ARMOR 18 /* 28 */ #define SV_MITHRIL_CHAIN_MAIL 20 /* 28+ */ #define SV_MITHRIL_PLATE_MAIL 25 /* 35+ */ #define SV_ADAMANTITE_PLATE_MAIL 30 /* 40+ */ *************** *** 984,991 **** /* The sval codes for TV_RING */ #define SV_RING_WOE 0 #define SV_RING_AGGRAVATION 1 ! #define SV_RING_WEAKNESS 2 ! #define SV_RING_STUPIDITY 3 #define SV_RING_TELEPORTATION 4 /* xxx */ #define SV_RING_SLOW_DIGESTION 6 --- 1047,1054 ---- /* The sval codes for TV_RING */ #define SV_RING_WOE 0 #define SV_RING_AGGRAVATION 1 ! /* xxx */ ! /* xxx */ #define SV_RING_TELEPORTATION 4 /* xxx */ #define SV_RING_SLOW_DIGESTION 6 *************** *** 1593,1601 **** /* - * As of 2.7.8, the "object flags" are valid for all objects, and as - * of 2.7.9, these flags are not actually stored with the object. - * * Note that "flags1" contains all flags dependant on "pval" (including * stat bonuses, but NOT stat sustainers), plus all "extra attack damage" * flags (SLAY_XXX and BRAND_XXX). --- 1656,1661 ---- *************** *** 1641,1647 **** #define TR1_KILL_DRAGON 0x01000000L /* Execute Dragon */ #define TR1_XXX5 0x02000000L /* Later */ #define TR1_IMPACT 0x04000000L /* Cause Earthquakes */ ! #define TR1_XXX6 0x08000000L /* Later */ #define TR1_BRAND_ACID 0x10000000L #define TR1_BRAND_ELEC 0x20000000L #define TR1_BRAND_FIRE 0x40000000L --- 1701,1707 ---- #define TR1_KILL_DRAGON 0x01000000L /* Execute Dragon */ #define TR1_XXX5 0x02000000L /* Later */ #define TR1_IMPACT 0x04000000L /* Cause Earthquakes */ ! #define TR1_BRAND_POIS 0x08000000L #define TR1_BRAND_ACID 0x10000000L #define TR1_BRAND_ELEC 0x20000000L #define TR1_BRAND_FIRE 0x40000000L *************** *** 1893,1904 **** #define RF3_IM_COLD 0x00080000 /* Resist cold a lot */ #define RF3_IM_POIS 0x00100000 /* Resist poison a lot */ #define RF3_XXX5 0x00200000 /* Immune to (?) */ ! #define RF3_RES_NETH 0x00400000 /* Resist nether a lot */ ! #define RF3_RES_WATE 0x00800000 /* Resist water */ ! #define RF3_RES_PLAS 0x01000000 /* Resist plasma */ ! #define RF3_RES_NEXU 0x02000000 /* Resist nexus */ ! #define RF3_RES_DISE 0x04000000 /* Resist disenchantment */ ! #define RF3_XXX6 0x08000000 /* Resist (?) */ #define RF3_NO_FEAR 0x10000000 /* Cannot be scared */ #define RF3_NO_STUN 0x20000000 /* Cannot be stunned */ #define RF3_NO_CONF 0x40000000 /* Cannot be confused */ --- 1953,1964 ---- #define RF3_IM_COLD 0x00080000 /* Resist cold a lot */ #define RF3_IM_POIS 0x00100000 /* Resist poison a lot */ #define RF3_XXX5 0x00200000 /* Immune to (?) */ ! #define RF3_RES_NETHER 0x00400000 /* Resist nether */ ! #define RF3_RES_WATER 0x00800000 /* Resist water */ ! #define RF3_RES_PLASMA 0x01000000 /* Resist plasma */ ! #define RF3_RES_NEXUS 0x02000000 /* Resist nexus */ ! #define RF3_RES_DISEN 0x04000000 /* Resist disenchantment */ ! #define RF3_RES_MAGIC 0x08000000 /* Resist magic */ #define RF3_NO_FEAR 0x10000000 /* Cannot be scared */ #define RF3_NO_STUN 0x20000000 /* Cannot be stunned */ #define RF3_NO_CONF 0x40000000 /* Cannot be confused */ *************** *** 2060,2066 **** * do not, allowing an abusively fast single bit check below. */ #define floor_grid_bold(Y,X) \ ! (!(cave[Y][X].ftyp & 0x20)) /* * Determine if a "legal" grid is a "clean" floor grid --- 2120,2126 ---- * do not, allowing an abusively fast single bit check below. */ #define floor_grid_bold(Y,X) \ ! (!(cave[Y][X].feat & 0x20)) /* * Determine if a "legal" grid is a "clean" floor grid *************** *** 2071,2080 **** */ #define clean_grid_bold(Y,X) \ (floor_grid_bold(Y,X) && \ ! (cave[Y][X].ftyp == 0x01) && \ (!cave[Y][X].i_idx)) /* * Determine if a "legal" grid is an "empty" floor grid * * Line 1 -- forbid doors, rubble, seams, walls --- 2131,2150 ---- */ #define clean_grid_bold(Y,X) \ (floor_grid_bold(Y,X) && \ ! (cave[Y][X].feat == CF_FLOOR) && \ (!cave[Y][X].i_idx)) /* + * Determine if a "legal" grid is a "clean stackable" floor grid + * + * Line 1 -- forbid doors, rubble, seams, walls + * Line 2 -- forbid terrain features + */ + #define clean_stackable_grid_bold(Y,X) \ + (floor_grid_bold(Y,X) && \ + (cave[Y][X].feat == CF_FLOOR)) + + /* * Determine if a "legal" grid is an "empty" floor grid * * Line 1 -- forbid doors, rubble, seams, walls *************** *** 2084,2090 **** #define empty_grid_bold(Y,X) \ (floor_grid_bold(Y,X) && \ !(cave[Y][X].m_idx) && \ ! !(((Y) == py) && ((X) == px))) /* * Determine if a "legal" grid is an "naked" floor grid --- 2154,2160 ---- #define empty_grid_bold(Y,X) \ (floor_grid_bold(Y,X) && \ !(cave[Y][X].m_idx) && \ ! !(((Y) == p_ptr->py) && ((X) == p_ptr->px))) /* * Determine if a "legal" grid is an "naked" floor grid *************** *** 2097,2106 **** */ #define naked_grid_bold(Y,X) \ (floor_grid_bold(Y,X) && \ ! (cave[Y][X].ftyp == 0x01) && \ !(cave[Y][X].i_idx) && \ !(cave[Y][X].m_idx) && \ ! !(((Y) == py) && ((X) == px))) /* --- 2167,2176 ---- */ #define naked_grid_bold(Y,X) \ (floor_grid_bold(Y,X) && \ ! (cave[Y][X].feat == CF_FLOOR) && \ !(cave[Y][X].i_idx) && \ !(cave[Y][X].m_idx) && \ ! !(((Y) == p_ptr->py) && ((X) == p_ptr->px))) /* *************** *** 2109,2149 **** * Note the use of comparison to zero to force a "boolean" result */ #define player_has_los_bold(Y,X) \ ! ((cave[Y][X].fdat & CAVE_VIEW) != 0) /* - * Is a given location "valid" for placing things? - * - * Permanent walls, stairs, store doors are never "valid". - * - * Hack -- a grid with an artifact in it is never valid. - * - * This function is often "combined" with "floor_grid_bold(y,x)" - * or one of the other similar "functions". - * - * Line 1 -- forbid perma-walls - * Line 2 -- forbid stairs and store doors - * Line 3 -- forbid stairs and store doors - * Line 4 -- forbid artifact grids - */ - #define valid_grid_bold(Y,X) \ - ((cave[Y][X].ftyp < 0x3C) && \ - ((cave[Y][X].ftyp < 0x06) || \ - (cave[Y][X].ftyp > 0x0F)) && \ - !(artifact_p(&i_list[cave[Y][X].i_idx]))) - - /* - * Same as above, but also require that the grid be "legal" - */ - #define valid_grid(Y,X) \ - (in_bounds(Y,X) && valid_grid_bold(Y,X)) - - - - /* * Determines if a map location is currently "on screen" -RAK- * Note that "panel_contains(y,x)" always implies "in_bounds2(y,x)". */ --- 2179,2190 ---- * Note the use of comparison to zero to force a "boolean" result */ #define player_has_los_bold(Y,X) \ ! ((cave[Y][X].info & CAVE_VIEW) != 0) /* * Determines if a map location is currently "on screen" -RAK- * Note that "panel_contains(y,x)" always implies "in_bounds2(y,x)". */ *************** *** 2153,2189 **** /* - * Determine if a given inventory item is "aware" - */ - #define object_aware_p(T) \ - (k_info[(T)->k_idx].aware) - - /* - * Determine if a given inventory item is "tried" - */ - #define object_tried_p(T) \ - (k_info[(T)->k_idx].tried) - - - /* - * Determine if a given inventory item is "known" - * Test One -- Check for special "known" tag - * Test Two -- Check for "Easy Know" + "Aware" - */ - #define object_known_p(T) \ - (((T)->ident & ID_KNOWN) || \ - (k_info[(T)->k_idx].easy_know && k_info[(T)->k_idx].aware)) - - - /* * Return the "attr" for a given item. * Allow user redefinition of "aware" items. * Default to the "base" attr for unaware items */ #define object_attr(T) \ ! ((k_info[(T)->k_idx].aware) ? \ ! (k_info[(T)->k_idx].x_attr) : \ ! (k_info[(T)->k_idx].i_attr)) /* * Return the "char" for a given item. --- 2194,2207 ---- /* * Return the "attr" for a given item. * Allow user redefinition of "aware" items. * Default to the "base" attr for unaware items */ #define object_attr(T) \ ! ((k_info[(T)->get_k_idx()].aware) ? \ ! (k_info[(T)->get_k_idx()].x_attr) : \ ! (k_info[(T)->get_k_idx()].i_attr)) /* * Return the "char" for a given item. *************** *** 2191,2229 **** * Default to the "base" char for unaware items */ #define object_char(T) \ ! ((k_info[(T)->k_idx].aware) ? \ ! (k_info[(T)->k_idx].x_char) : \ ! (k_info[(T)->k_idx].i_char)) - - /* - * Artifacts use the "name1" field - */ - #define artifact_p(T) \ - ((T)->name1 ? TRUE : FALSE) - - /* - * Ego-Items use the "name2" field - */ - #define ego_item_p(T) \ - ((T)->name2 ? TRUE : FALSE) - - - /* - * Broken items. - */ - #define broken_p(T) \ - ((T)->ident & ID_BROKEN) - - /* - * Cursed items. - */ - #define cursed_p(T) \ - ((T)->ident & ID_CURSED) - - /* * Hack -- Prepare to use the "Secure" routines --- 2209,2220 ---- * Default to the "base" char for unaware items */ #define object_char(T) \ ! ((k_info[(T)->get_k_idx()].aware) ? \ ! (k_info[(T)->get_k_idx()].x_char) : \ ! (k_info[(T)->get_k_idx()].i_char)) /* * Hack -- Prepare to use the "Secure" routines diff -w -c -r ick-279/dungeon.c utumno/dungeon.c *** ick-279/dungeon.c Thu May 15 17:12:09 1997 --- utumno/dungeon.c Thu May 15 17:45:48 1997 *************** *** 21,30 **** static cptr value_check_aux1(object_type *i_ptr) { /* Artifacts */ ! if (artifact_p(i_ptr)) { /* Cursed/Broken */ ! if (cursed_p(i_ptr) || broken_p(i_ptr)) return "terrible"; /* Normal */ return "special"; --- 21,30 ---- static cptr value_check_aux1(object_type *i_ptr) { /* Artifacts */ ! if (i_ptr->is_artifact()) { /* Cursed/Broken */ ! if (i_ptr->is_cursed() || i_ptr->is_broken()) return "terrible"; /* Normal */ return "special"; *************** *** 31,40 **** } /* Ego-Items */ ! if (ego_item_p(i_ptr)) { /* Cursed/Broken */ ! if (cursed_p(i_ptr) || broken_p(i_ptr)) return "worthless"; /* Normal */ return "excellent"; --- 31,40 ---- } /* Ego-Items */ ! if (i_ptr->is_ego_item()) { /* Cursed/Broken */ ! if (i_ptr->is_cursed() || i_ptr->is_broken()) return "worthless"; /* Normal */ return "excellent"; *************** *** 41,50 **** } /* Cursed items */ ! if (cursed_p(i_ptr)) return "cursed"; /* Broken items */ ! if (broken_p(i_ptr)) return "broken"; /* Good "armor" bonus */ if (i_ptr->to_a > 0) return "good"; --- 41,50 ---- } /* Cursed items */ ! if (i_ptr->is_cursed()) return "cursed"; /* Broken items */ ! if (i_ptr->is_broken()) return "broken"; /* Good "armor" bonus */ if (i_ptr->to_a > 0) return "good"; *************** *** 63,78 **** static cptr value_check_aux2(object_type *i_ptr) { /* Cursed items (all of them) */ ! if (cursed_p(i_ptr)) return "cursed"; /* Broken items (all of them) */ ! if (broken_p(i_ptr)) return "broken"; /* Artifacts -- except cursed/broken ones */ ! if (artifact_p(i_ptr)) return "good"; /* Ego-Items -- except cursed/broken ones */ ! if (ego_item_p(i_ptr)) return "good"; /* Good armor bonus */ if (i_ptr->to_a > 0) return "good"; --- 63,78 ---- static cptr value_check_aux2(object_type *i_ptr) { /* Cursed items (all of them) */ ! if (i_ptr->is_cursed()) return "cursed"; /* Broken items (all of them) */ ! if (i_ptr->is_broken()) return "broken"; /* Artifacts -- except cursed/broken ones */ ! if (i_ptr->is_artifact()) return "good"; /* Ego-Items -- except cursed/broken ones */ ! if (i_ptr->is_ego_item()) return "good"; /* Good armor bonus */ if (i_ptr->to_a > 0) return "good"; *************** *** 91,114 **** * Sense the inventory * * Class 0 = Warrior --> fast and heavy ! * Class 1 = Mage --> slow and light * Class 2 = Priest --> fast but light ! * Class 3 = Rogue --> okay and heavy ! * Class 4 = Ranger --> slow and light * Class 5 = Paladin --> slow but heavy */ static void sense_inventory(void) { ! int i; ! ! int plev = p_ptr->lev; ! bool heavy = FALSE; - cptr feel; - object_type *i_ptr; - char i_name[80]; --- 91,108 ---- * Sense the inventory * * Class 0 = Warrior --> fast and heavy ! * Class 1 = Mage --> very slow and light * Class 2 = Priest --> fast but light ! * Class 3 = Rogue --> medium and heavy ! * Class 4 = Ranger --> very slow and light * Class 5 = Paladin --> slow but heavy */ static void sense_inventory(void) { ! int i, plev = p_ptr->lev; bool heavy = FALSE; cptr feel; object_type *i_ptr; char i_name[80]; *************** *** 120,186 **** /* Analyze the class */ switch (p_ptr->pclass) { ! /* Warriors */ ! case 0: ! ! /* Good sensing */ if (0 != rand_int(9000L / (plev * plev + 40))) return; - - /* Heavy sensing */ heavy = TRUE; - - /* Done */ break; ! /* Mages */ ! case 1: ! ! /* Very bad (light) sensing */ if (0 != rand_int(240000L / (plev + 5))) return; - - /* Done */ break; ! /* Priests */ ! case 2: ! ! /* Good (light) sensing */ if (0 != rand_int(10000L / (plev * plev + 40))) return; - - /* Done */ break; ! /* Rogues */ ! case 3: ! ! /* Okay sensing */ if (0 != rand_int(20000L / (plev * plev + 40))) return; - - /* Heavy sensing */ heavy = TRUE; - - /* Done */ break; ! /* Rangers */ ! case 4: ! ! /* Very bad (light) sensing */ if (0 != rand_int(120000L / (plev + 5))) return; - - /* Done */ break; ! /* Paladins */ ! case 5: ! ! /* Bad sensing */ if (0 != rand_int(80000L / (plev * plev + 40))) return; - - /* Heavy sensing */ heavy = TRUE; - - /* Done */ break; } --- 114,150 ---- /* Analyze the class */ switch (p_ptr->pclass) { ! /* Warriors -- fast and heavy */ ! case CLASS_WARRIOR: if (0 != rand_int(9000L / (plev * plev + 40))) return; heavy = TRUE; break; ! /* Mages -- very slow and light */ ! case CLASS_MAGE: if (0 != rand_int(240000L / (plev + 5))) return; break; ! /* Priests -- fast but light */ ! case CLASS_PRIEST: if (0 != rand_int(10000L / (plev * plev + 40))) return; break; ! /* Rogues -- medium and heavy */ ! case CLASS_ROGUE: if (0 != rand_int(20000L / (plev * plev + 40))) return; heavy = TRUE; break; ! /* Rangers -- very slow and light */ ! case CLASS_RANGER: if (0 != rand_int(120000L / (plev + 5))) return; break; ! /* Paladins -- slow but heavy */ ! case CLASS_PALADIN: if (0 != rand_int(80000L / (plev * plev + 40))) return; heavy = TRUE; break; } *************** *** 195,201 **** i_ptr = &inventory[i]; /* Skip empty slots */ ! if (!i_ptr->k_idx) continue; /* Valid "tval" codes */ switch (i_ptr->tval) --- 159,165 ---- i_ptr = &inventory[i]; /* Skip empty slots */ ! if (!i_ptr->exists()) continue; /* Valid "tval" codes */ switch (i_ptr->tval) *************** *** 225,237 **** if (!okay) continue; /* We know about it already, do not tell us again */ ! if (i_ptr->ident & ID_SENSE) continue; /* It is fully known, no information needed */ ! if (object_known_p(i_ptr)) continue; ! /* Occasional failure on inventory items */ ! if ((i < INVEN_WIELD) && (0 != rand_int(5))) continue; /* Check for a feeling */ feel = (heavy ? value_check_aux1(i_ptr) : value_check_aux2(i_ptr)); --- 189,201 ---- if (!okay) continue; /* We know about it already, do not tell us again */ ! if (i_ptr->test_ident_flag(ID_SENSE)) continue; /* It is fully known, no information needed */ ! if (i_ptr->is_known()) continue; ! /* Frequent failure on inventory items */ ! if ((i < INVEN_WIELD) && percent(80)) continue; /* Check for a feeling */ feel = (heavy ? value_check_aux1(i_ptr) : value_check_aux2(i_ptr)); *************** *** 262,271 **** } /* We have "felt" it */ ! i_ptr->ident |= (ID_SENSE); /* Inscribe it textually */ ! if (!i_ptr->note) i_ptr->note = quark_add(feel); /* Redraw the choice window */ p_ptr->redraw |= (PR_CHOOSE); --- 226,235 ---- } /* We have "felt" it */ ! i_ptr->set_ident_flag(ID_SENSE); /* Inscribe it textually */ ! if (!i_ptr->note) i_ptr->set_note(quark_add(feel)); /* Redraw the choice window */ p_ptr->redraw |= (PR_CHOOSE); *************** *** 328,333 **** --- 292,298 ---- old_csp = p_ptr->csp; new_mana = ((long)p_ptr->msp) * percent + PY_REGEN_MNBASE; p_ptr->csp += new_mana >> 16; /* div 65536 */ + /* check for overflow */ if ((p_ptr->csp < 0) && (old_csp > 0)) { *************** *** 392,401 **** if (r_ptr->flags2 & RF2_REGENERATE) frac *= 2; /* Hack -- Regenerate */ ! m_ptr->hp += frac; /* Do not over-regenerate */ ! if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp; /* Redraw (later) if needed */ if (health_who == i) p_ptr->redraw |= (PR_HEALTH); --- 357,369 ---- if (r_ptr->flags2 & RF2_REGENERATE) frac *= 2; /* Hack -- Regenerate */ ! m_ptr->set_hp(m_ptr->hp + frac); /* Do not over-regenerate */ ! if (m_ptr->hp > m_ptr->maxhp) ! { ! m_ptr->set_hp(m_ptr->maxhp); ! } /* Redraw (later) if needed */ if (health_who == i) p_ptr->redraw |= (PR_HEALTH); *************** *** 411,425 **** static void process_world(void) { int x, y, i, j; - int regen_amount; - cave_type *c_ptr; - object_type *i_ptr; - /* Every 10 game turns */ if (turn % 10) return; --- 379,389 ---- *************** *** 579,585 **** if (p_ptr->poisoned) { /* Take damage */ ! take_hit(1, "poison"); } /* Take damage from cuts */ --- 543,549 ---- if (p_ptr->poisoned) { /* Take damage */ ! take_hit_no_invuln(1, "poison"); } /* Take damage from cuts */ *************** *** 604,610 **** } /* Take damage */ ! take_hit(i, "a fatal wound"); } --- 568,574 ---- } /* Take damage */ ! take_hit_no_invuln(i, "a fatal wound"); } *************** *** 623,632 **** if (p_ptr->regenerate) i += 30; /* Slow digestion takes less food */ ! if (p_ptr->slow_digest) i -= 10; /* Digest some food */ ! (void)set_food(p_ptr->food - i); } } --- 587,596 ---- if (p_ptr->regenerate) i += 30; /* Slow digestion takes less food */ ! if (p_ptr->slow_digest) i /= 2; /* Digest some food */ ! set_food(p_ptr->food - i); } } *************** *** 634,640 **** else { /* Digest a lot of food */ ! (void)set_food(p_ptr->food - 100); } /* Starve to death (slowly) */ --- 598,604 ---- else { /* Digest a lot of food */ ! set_food(p_ptr->food - 100); } /* Starve to death (slowly) */ *************** *** 671,677 **** if (p_ptr->food < PY_FOOD_FAINT) { /* Faint occasionally */ ! if (!p_ptr->paralyzed && (rand_int(100) < 10)) { /* Message */ msg_print("You faint from the lack of food."); --- 635,641 ---- if (p_ptr->food < PY_FOOD_FAINT) { /* Faint occasionally */ ! if (!p_ptr->paralyzed && percent(10)) { /* Message */ msg_print("You faint from the lack of food."); *************** *** 877,887 **** /* Burn some fuel in the current lite */ if (i_ptr->tval == TV_LITE) { ! /* Hack -- Use some fuel (except on artifacts) */ ! if (!artifact_p(i_ptr) && (i_ptr->pval > 0)) { /* Decrease life-span */ ! i_ptr->pval--; /* Hack -- notice interesting fuel steps */ if ((i_ptr->pval < 100) || (!(i_ptr->pval % 100))) --- 841,851 ---- /* Burn some fuel in the current lite */ if (i_ptr->tval == TV_LITE) { ! /* Hack -- Use some fuel (except on artifacts) (save light if blind */ ! if (!i_ptr->is_artifact() && (i_ptr->pval > 0) && !p_ptr->blind) { /* Decrease life-span */ ! i_ptr->set_pval(i_ptr->pval - 1); /* Hack -- notice interesting fuel steps */ if ((i_ptr->pval < 100) || (!(i_ptr->pval % 100))) *************** *** 890,902 **** p_ptr->redraw |= (PR_CHOOSE); } - /* Hack -- Special treatment when blind */ - if (p_ptr->blind) - { - /* Hack -- save some light for later */ - if (i_ptr->pval == 0) i_ptr->pval++; - } - /* The light is now out */ else if (i_ptr->pval == 0) { --- 854,859 ---- *************** *** 922,928 **** /* Handle experience draining */ if (p_ptr->exp_drain) { ! if ((rand_int(100) < 10) && (p_ptr->exp > 0)) { p_ptr->exp--; p_ptr->max_exp--; --- 879,885 ---- /* Handle experience draining */ if (p_ptr->exp_drain) { ! if (percent(10) && (p_ptr->exp > 0)) { p_ptr->exp--; p_ptr->max_exp--; *************** *** 940,952 **** i_ptr = &inventory[i]; /* Skip non-objects */ ! if (!i_ptr->k_idx) continue; /* Recharge activatable objects */ if (i_ptr->timeout > 0) { /* Recharge */ ! i_ptr->timeout--; /* Notice changes */ /* if (!(i_ptr->timeout)) j++; */ --- 897,909 ---- i_ptr = &inventory[i]; /* Skip non-objects */ ! if (!i_ptr->exists()) continue; /* Recharge activatable objects */ if (i_ptr->timeout > 0) { /* Recharge */ ! i_ptr->set_timeout(i_ptr->timeout - 1); /* Notice changes */ /* if (!(i_ptr->timeout)) j++; */ *************** *** 959,968 **** i_ptr = &inventory[i]; /* Examine all charging rods */ ! if ((i_ptr->tval == TV_ROD) && (i_ptr->pval)) { /* Charge it */ ! i_ptr->pval--; /* Notice changes */ if (!(i_ptr->pval)) j++; --- 916,925 ---- i_ptr = &inventory[i]; /* Examine all charging rods */ ! if ((i_ptr->tval == TV_ROD) && i_ptr->pval) { /* Charge it */ ! i_ptr->set_pval(i_ptr->pval - 1); /* Notice changes */ if (!(i_ptr->pval)) j++; *************** *** 1210,1220 **** /*** Inventory Commands ***/ /* Wear/wield equipment */ ! case '[': do_cmd_wield(); break; /* Take off equipment */ ! case ']': do_cmd_takeoff(); break; /* Drop an item */ --- 1167,1177 ---- /*** Inventory Commands ***/ /* Wear/wield equipment */ ! case 'w': do_cmd_wield(); break; /* Take off equipment */ ! case 't': do_cmd_takeoff(); break; /* Drop an item */ *************** *** 1309,1318 **** case 'c': do_cmd_close(); break; - /* Jam a door with spikes */ - case 'j': - do_cmd_spike(); break; - /* Bash a door */ case 'B': do_cmd_bash(); break; --- 1266,1271 ---- *************** *** 1344,1350 **** /*** Use various objects ***/ /* Inscribe an object */ ! case '{': do_cmd_inscribe(); break; /* Uninscribe an object */ --- 1297,1304 ---- /*** Use various objects ***/ /* Inscribe an object */ ! case ' ! {': do_cmd_inscribe(); break; /* Uninscribe an object */ *************** *** 1613,1619 **** /* Mega-Hack -- Random teleportation XXX XXX XXX */ ! if ((p_ptr->teleport) && (rand_int(100) < 1)) { /* Teleport player */ teleport_player(40); --- 1567,1573 ---- /* Mega-Hack -- Random teleportation XXX XXX XXX */ ! if ((p_ptr->teleport) && percent(1)) { /* Teleport player */ teleport_player(40); *************** *** 1704,1710 **** if (p_ptr->notice) notice_stuff(); /* XXX XXX XXX Pack Overflow */ ! if (inventory[INVEN_PACK].k_idx) { int amt; --- 1658,1664 ---- if (p_ptr->notice) notice_stuff(); /* XXX XXX XXX Pack Overflow */ ! if (inventory[INVEN_PACK].exists()) { int amt; *************** *** 1784,1790 **** /* Remember deepest dungeon level visited */ ! if (dun_level > (unsigned)(p_ptr->max_dlv)) { p_ptr->max_dlv = dun_level; } --- 1738,1744 ---- /* Remember deepest dungeon level visited */ ! if (dun_level > p_ptr->max_dlv) { p_ptr->max_dlv = dun_level; } *************** *** 1816,1826 **** /* Make stairs */ if (create_down_stair) { ! c_ptr->feat = 0x07; } else { ! c_ptr->feat = 0x06; } } --- 1770,1780 ---- /* Make stairs */ if (create_down_stair) { ! c_ptr->feat = CF_STAIRS_DOWN; } else { ! c_ptr->feat = CF_STAIRS_UP; } } *************** *** 2219,2228 **** /* Redraw the recall window */ ! p_ptr->redraw |= (PR_RECENT); /* Redraw the choice window */ ! p_ptr->redraw |= (PR_CHOOSE); /* Redraw stuff */ redraw_stuff(); --- 2173,2182 ---- /* Redraw the recall window */ ! p_ptr->redraw |= PR_RECENT; /* Redraw the choice window */ ! p_ptr->redraw |= PR_CHOOSE; /* Redraw stuff */ redraw_stuff(); *************** *** 2231,2240 **** /* Load the "pref" files */ load_all_pref_files(); - /* Set or clear "rogue_like_commands" if requested */ - if (arg_force_original) rogue_like_commands = FALSE; - if (arg_force_roguelike) rogue_like_commands = TRUE; - /* Verify the keymap */ keymap_init(); --- 2185,2190 ---- *************** *** 2254,2259 **** --- 2204,2215 ---- character_icky = FALSE; + /* Tell player to read online help */ + if (new_game) + { + msg_print("Be sure to read the online help with '?'."); + } + /* Start game */ alive = TRUE; *************** *** 2298,2314 **** p_ptr->csp_frac = 0; /* Hack -- Healing */ ! (void)set_blind(0); ! (void)set_confused(0); ! (void)set_poisoned(0); ! (void)set_afraid(0); ! (void)set_paralyzed(0); ! (void)set_image(0); ! (void)set_stun(0); ! (void)set_cut(0); /* Hack -- Prevent starvation */ ! (void)set_food(PY_FOOD_MAX - 1); /* XXX XXX XXX */ if (p_ptr->word_recall) --- 2254,2270 ---- p_ptr->csp_frac = 0; /* Hack -- Healing */ ! set_blind(0); ! set_confused(0); ! set_poisoned(0); ! set_afraid(0); ! set_paralyzed(0); ! set_image(0); ! set_stun(0); ! set_cut(0); /* Hack -- Prevent starvation */ ! set_food(PY_FOOD_MAX - 1); /* XXX XXX XXX */ if (p_ptr->word_recall) diff -w -c -r ick-279/externs.h utumno/externs.h *** ick-279/externs.h Sat Apr 13 11:25:12 1996 --- utumno/externs.h Wed May 14 20:27:42 1997 *************** *** 64,70 **** extern byte version_major; extern byte version_minor; extern byte version_patch; ! extern byte version_extra; extern byte sf_major; extern byte sf_minor; extern byte sf_patch; --- 64,70 ---- extern byte version_major; extern byte version_minor; extern byte version_patch; ! extern byte version_type; extern byte sf_major; extern byte sf_minor; extern byte sf_patch; *************** *** 75,82 **** extern u16b sf_saves; extern bool arg_wizard; extern bool arg_fiddle; - extern bool arg_force_original; - extern bool arg_force_roguelike; extern bool character_generated; extern bool character_dungeon; extern bool character_loaded; --- 75,80 ---- *************** *** 190,200 **** extern bool view_reduce_view; extern bool optimize_display; extern bool optimize_various; ! extern bool scum_always; ! extern bool scum_sometimes; extern bool dungeon_align; extern bool dungeon_stair; extern bool show_health_bar; extern bool smart_learn; extern bool smart_cheat; extern bool recall_show_desc; --- 188,199 ---- extern bool view_reduce_view; extern bool optimize_display; extern bool optimize_various; ! extern bool autoscum; ! extern bool generate_artifacts; extern bool dungeon_align; extern bool dungeon_stair; extern bool show_health_bar; + extern bool color_browse; extern bool smart_learn; extern bool smart_cheat; extern bool recall_show_desc; *************** *** 235,242 **** extern s16b panel_row_min, panel_row_max; extern s16b panel_col_min, panel_col_max; extern s16b panel_col_prt, panel_row_prt; - extern s16b py; - extern s16b px; extern s16b target_who; extern s16b target_col; extern s16b target_row; --- 234,239 ---- *************** *** 295,306 **** extern player_race *rp_ptr; extern player_class *cp_ptr; extern player_magic *mp_ptr; ! extern u32b spell_learned1; ! extern u32b spell_learned2; ! extern u32b spell_worked1; ! extern u32b spell_worked2; ! extern u32b spell_forgotten1; ! extern u32b spell_forgotten2; extern byte spell_order[64]; extern s16b player_hp[PY_MAX_LEVEL]; extern header *v_head; --- 292,300 ---- extern player_race *rp_ptr; extern player_class *cp_ptr; extern player_magic *mp_ptr; ! extern bool spell_learned[64]; ! extern bool spell_worked[64]; ! extern bool spell_forgotten[64]; extern byte spell_order[64]; extern s16b player_hp[PY_MAX_LEVEL]; extern header *v_head; *************** *** 358,363 **** --- 352,358 ---- extern void player_birth(void); /* cave.c */ + extern bool valid_grid(int y, int x); extern int distance(int y1, int x1, int y2, int x2); extern bool los(int y1, int x1, int y2, int x2); extern bool player_can_see_bold(int y, int x); *************** *** 378,384 **** extern void update_flow(void); extern void map_area(void); extern void wiz_lite(void); ! extern void wiz_dark(void); extern void mmove2(int *y, int *x, int y1, int x1, int y2, int x2); extern bool projectable(int y1, int x1, int y2, int x2); extern void scatter(int *yp, int *xp, int y, int x, int d, int m); --- 373,379 ---- extern void update_flow(void); extern void map_area(void); extern void wiz_lite(void); ! extern void forget_map(void); extern void mmove2(int *y, int *x, int y1, int x1, int y2, int x2); extern bool projectable(int y1, int x1, int y2, int x2); extern void scatter(int *yp, int *xp, int y, int x, int d, int m); *************** *** 391,397 **** extern bool test_hit_fire(int chance, int ac, int vis); extern bool test_hit_norm(int chance, int ac, int vis); extern s16b critical_shot(int weight, int plus, int dam); ! extern s16b critical_norm(int weight, int plus, int dam); extern s16b tot_dam_aux(object_type *i_ptr, int tdam, monster_type *m_ptr); extern void search(void); extern void carry(int pickup); --- 386,392 ---- extern bool test_hit_fire(int chance, int ac, int vis); extern bool test_hit_norm(int chance, int ac, int vis); extern s16b critical_shot(int weight, int plus, int dam); ! extern s16b critical_norm(int weight, int plus, int dam, monster_type *m_ptr); extern s16b tot_dam_aux(object_type *i_ptr, int tdam, monster_type *m_ptr); extern void search(void); extern void carry(int pickup); *************** *** 409,415 **** extern void do_cmd_tunnel(void); extern void do_cmd_disarm(void); extern void do_cmd_bash(void); - extern void do_cmd_spike(void); extern void do_cmd_walk(int pickup); extern void do_cmd_stay(int pickup); extern void do_cmd_run(void); --- 404,409 ---- *************** *** 474,480 **** extern void safe_setuid_drop(void); extern void safe_setuid_grab(void); extern s16b tokenize(char *buf, s16b num, char **tokens); ! extern void display_player(bool do_hist); extern errr file_character(cptr name, bool full); extern errr process_pref_file_aux(char *buf); extern errr process_pref_file(cptr name); --- 468,474 ---- extern void safe_setuid_drop(void); extern void safe_setuid_grab(void); extern s16b tokenize(char *buf, s16b num, char **tokens); ! extern void display_player(bool do_hist, bool char_dump); extern errr file_character(cptr name, bool full); extern errr process_pref_file_aux(char *buf); extern errr process_pref_file(cptr name); *************** *** 512,522 **** /* init.c */ extern void init_file_paths(char *path); extern void init_some_arrays(void); ! /* load1.c */ ! extern errr rd_savefile_old(void); ! ! /* load2.c */ extern errr rd_savefile_new(void); /* melee1.c */ --- 506,514 ---- /* init.c */ extern void init_file_paths(char *path); extern void init_some_arrays(void); + extern void init_leftover(void); ! /* load.c */ extern errr rd_savefile_new(void); /* melee1.c */ *************** *** 546,555 **** extern bool alloc_monster(int dis, int slp); extern bool summon_specific(int y1, int x1, int lev, int type); extern bool multiply_monster(int m_idx); ! extern void update_smart_learn(int m_idx, int what); ! /* object1.c */ ! /* object2.c */ extern void flavor_init(void); extern void reset_visuals(void); extern void object_flags(object_type *i_ptr, u32b *f1, u32b *f2, u32b *f3); --- 538,547 ---- extern bool alloc_monster(int dis, int slp); extern bool summon_specific(int y1, int x1, int lev, int type); extern bool multiply_monster(int m_idx); ! extern bool monster_saves(int mlev, int plev); ! /* obj-desc.cpp */ ! /* object.cpp */ extern void flavor_init(void); extern void reset_visuals(void); extern void object_flags(object_type *i_ptr, u32b *f1, u32b *f2, u32b *f3); *************** *** 584,598 **** extern void wipe_i_list(void); extern s16b i_pop(void); extern s16b get_obj_num(int level); - extern void object_known(object_type *i_ptr); - extern void object_aware(object_type *i_ptr); - extern void object_tried(object_type *i_ptr); - extern s32b object_value(object_type *i_ptr); extern bool object_similar(object_type *i_ptr, object_type *j_ptr); extern void object_absorb(object_type *i_ptr, object_type *j_ptr); extern s16b lookup_kind(int tval, int sval); extern void invwipe(object_type *i_ptr); - extern void invcopy(object_type *i_ptr, int k_idx); extern void apply_magic(object_type *i_ptr, int lev, bool okay, bool good, bool great); extern void place_object(int y, int x, bool good, bool great); extern void acquirement(int y1, int x1, int num, bool great); --- 576,585 ---- *************** *** 605,615 **** extern void combine_pack(void); extern void reorder_pack(void); ! /* save.c */ extern bool save_player(void); extern bool load_player(void); ! /* spells1.c */ extern s16b poly_r_idx(int r_idx); extern void teleport_away(int m_idx, int dis); extern void teleport_player(int dis); --- 592,602 ---- extern void combine_pack(void); extern void reorder_pack(void); ! /* save.cpp */ extern bool save_player(void); extern bool load_player(void); ! /* spells1.cpp */ extern s16b poly_r_idx(int r_idx); extern void teleport_away(int m_idx, int dis); extern void teleport_player(int dis); *************** *** 616,621 **** --- 603,609 ---- extern void teleport_player_to(int ny, int nx); extern void teleport_player_level(void); extern void take_hit(int damage, cptr kb_str); + extern void take_hit_no_invuln(int damage, cptr kb_str); extern void acid_dam(int dam, cptr kb_str); extern void elec_dam(int dam, cptr kb_str); extern void fire_dam(int dam, cptr kb_str); *************** *** 626,632 **** extern bool apply_disenchant(int mode); extern bool project(int who, int rad, int y, int x, int dam, int typ, int flg); ! /* spells2.c */ extern bool hp_player(int num); extern void warding_glyph(void); extern bool do_dec_stat(int stat); --- 614,620 ---- extern bool apply_disenchant(int mode); extern bool project(int who, int rad, int y, int x, int dam, int typ, int flg); ! /* spells2.cpp */ extern bool hp_player(int num); extern void warding_glyph(void); extern bool do_dec_stat(int stat); *************** *** 702,708 **** extern void store_init(void); /* util.c */ ! extern void delay(int t); extern errr path_parse(char *buf, int max, cptr file); extern errr path_temp(char *buf, int max); extern FILE *my_fopen(cptr file, cptr mode); --- 690,696 ---- extern void store_init(void); /* util.c */ ! extern "C" void delay(unsigned t); extern errr path_parse(char *buf, int max, cptr file); extern errr path_temp(char *buf, int max); extern FILE *my_fopen(cptr file, cptr mode); *************** *** 722,728 **** extern errr fd_close(int fd); extern void flush(void); extern void bell(void); ! extern void sound(int num); extern void move_cursor(int row, int col); extern void text_to_ascii(char *buf, cptr str); extern void ascii_to_text(char *buf, cptr str); --- 710,716 ---- extern errr fd_close(int fd); extern void flush(void); extern void bell(void); ! extern void game_sound(int num); extern void move_cursor(int row, int col); extern void text_to_ascii(char *buf, cptr str); extern void ascii_to_text(char *buf, cptr str); *************** *** 741,746 **** --- 729,735 ---- extern void c_put_str(byte attr, cptr str, int row, int col); extern void put_str(cptr str, int row, int col); extern void prt(cptr str, int row, int col); + extern void c_prt(byte attr, cptr str, int row, int col); extern bool askfor_aux(char *buf, int len); extern bool get_string(cptr prompt, char *buf, int len); extern bool get_check(cptr prompt); *************** *** 783,788 **** --- 772,780 ---- extern bool set_stun(int v); extern bool set_cut(int v); extern bool set_food(int v); + extern bool add_blind(int v); + extern bool add_confused(int v); + extern bool add_poisoned(int v); extern void check_experience(void); extern void gain_exp(s32b amount); extern void lose_exp(s32b amount); diff -w -c -r ick-279/files.c utumno/files.c *** ick-279/files.c Thu May 15 17:12:10 1997 --- utumno/files.c Thu May 15 17:45:49 1997 *************** *** 777,783 **** * For this to look right, the following should be spaced the * same as in the prt_lnum code... -CFT */ ! static void display_player_middle(void) { int show_tohit = p_ptr->dis_to_h; int show_todam = p_ptr->dis_to_d; --- 777,783 ---- * For this to look right, the following should be spaced the * same as in the prt_lnum code... -CFT */ ! static void display_player_middle(bool char_dump) { int show_tohit = p_ptr->dis_to_h; int show_todam = p_ptr->dis_to_d; *************** *** 785,794 **** object_type *i_ptr = &inventory[INVEN_WIELD]; /* Hack -- add in weapon info if known */ ! if (object_known_p(i_ptr)) show_tohit += i_ptr->to_h; ! if (object_known_p(i_ptr)) show_todam += i_ptr->to_d; /* Dump the bonuses to hit/dam */ prt_num("+ To Hit ", show_tohit, 9, 1, TERM_L_BLUE); prt_num("+ To Damage ", show_todam, 10, 1, TERM_L_BLUE); --- 785,808 ---- object_type *i_ptr = &inventory[INVEN_WIELD]; /* Hack -- add in weapon info if known */ ! if (i_ptr->is_known()) show_tohit += i_ptr->to_h; ! if (i_ptr->is_known()) show_todam += i_ptr->to_d; + if (char_dump) + { /* Dump the bonuses to hit/dam */ + prt_num("+ To Hit ", show_tohit, 9, 0, TERM_L_BLUE); + prt_num("+ To Damage ", show_todam, 10, 0, TERM_L_BLUE); + + /* Dump the armor class bonus */ + prt_num("+ To AC ", p_ptr->dis_to_a, 11, 0, TERM_L_BLUE); + + /* Dump the total armor class */ + prt_num(" Base AC ", p_ptr->dis_ac, 12, 0, TERM_L_BLUE); + } + else + { + /* Dump the bonuses to hit/dam */ prt_num("+ To Hit ", show_tohit, 9, 1, TERM_L_BLUE); prt_num("+ To Damage ", show_todam, 10, 1, TERM_L_BLUE); *************** *** 797,830 **** /* Dump the total armor class */ prt_num(" Base AC ", p_ptr->dis_ac, 12, 1, TERM_L_BLUE); ! prt_num("Level ", (int)p_ptr->lev, 9, 28, TERM_L_GREEN); if (p_ptr->exp >= p_ptr->max_exp) { ! prt_lnum("Experience ", p_ptr->exp, 10, 28, TERM_L_GREEN); } else { ! prt_lnum("Experience ", p_ptr->exp, 10, 28, TERM_YELLOW); } ! prt_lnum("Max Exp ", p_ptr->max_exp, 11, 28, TERM_L_GREEN); if (p_ptr->lev >= PY_MAX_LEVEL) { ! put_str("Exp to Adv.", 12, 28); ! c_put_str(TERM_L_GREEN, " *****", 12, 28+11); } else { prt_lnum("Exp to Adv.", (s32b)(player_exp[p_ptr->lev - 1] * p_ptr->expfact / 100L), ! 12, 28, TERM_L_GREEN); } ! prt_lnum("Gold ", p_ptr->au, 13, 28, TERM_L_GREEN); prt_num("Max Hit Points ", p_ptr->mhp, 9, 52, TERM_L_GREEN); if (p_ptr->chp >= p_ptr->mhp) --- 811,860 ---- /* Dump the total armor class */ prt_num(" Base AC ", p_ptr->dis_ac, 12, 1, TERM_L_BLUE); + } ! prt_num("Level ", (int)p_ptr->lev, 9, char_dump ? 24 : 28, ! TERM_L_GREEN); if (p_ptr->exp >= p_ptr->max_exp) { ! prt_lnum("Experience ", p_ptr->exp, 10, char_dump ? 24 : 28, ! TERM_L_GREEN); } else { ! prt_lnum("Experience ", p_ptr->exp, 10, char_dump ? 24 : 28, ! TERM_YELLOW); } ! prt_lnum("Max Exp ", p_ptr->max_exp, 11, char_dump ? 24 : 28, ! TERM_L_GREEN); if (p_ptr->lev >= PY_MAX_LEVEL) { ! put_str("Exp to Adv.", 12, char_dump ? 24 : 28); ! c_put_str(TERM_L_GREEN, " *****", 12, char_dump ? 24+11 : 28+11); } else { prt_lnum("Exp to Adv.", (s32b)(player_exp[p_ptr->lev - 1] * p_ptr->expfact / 100L), ! 12, char_dump ? 24 : 28, TERM_L_GREEN); } ! prt_lnum("Gold ", p_ptr->au, 13, char_dump ? 24 : 28, ! TERM_L_GREEN); + if (char_dump) + { + prt_num("Max Hit Points", p_ptr->mhp, 9, 47, TERM_L_GREEN); + prt_num("Cur Hit Points", p_ptr->chp, 10, 47, TERM_L_GREEN); + + prt_num("Max SP (Mana) ", p_ptr->msp, 11, 47, TERM_L_GREEN); + prt_num("Cur SP (Mana) ", p_ptr->csp, 12, 47, TERM_L_GREEN); + } + else + { prt_num("Max Hit Points ", p_ptr->mhp, 9, 52, TERM_L_GREEN); if (p_ptr->chp >= p_ptr->mhp) *************** *** 855,860 **** --- 885,891 ---- prt_num("Cur SP (Mana) ", p_ptr->csp, 12, 52, TERM_RED); } } + } *************** *** 888,894 **** likert_color = TERM_RED; return ("Bad"); case 2: ! likert_color = TERM_RED; return ("Poor"); case 3: case 4: --- 919,925 ---- likert_color = TERM_RED; return ("Bad"); case 2: ! likert_color = TERM_ORANGE; return ("Poor"); case 3: case 4: *************** *** 926,935 **** /* * Prints ratings on certain abilities - * - * This code is "imitated" elsewhere to "dump" a character sheet. */ ! static void display_player_various(void) { int tmp; int xthn, xthb, xfos, xsrh; --- 957,964 ---- /* * Prints ratings on certain abilities */ ! static void display_player_various(bool char_dump) { int tmp; int xthn, xthb, xfos, xsrh; *************** *** 958,963 **** --- 987,1039 ---- xfos = p_ptr->skill_fos; + if (char_dump) + { + put_str("Fighting :", 16, 0); + desc = likert(xthn, 12); + c_put_str(likert_color, desc, 16, 14); + + put_str("Bows/Throw :", 17, 0); + desc = likert(xthb, 12); + c_put_str(likert_color, desc, 17, 14); + + put_str("Saving Throw:", 18, 0); + desc = likert(xsav, 6); + c_put_str(likert_color, desc, 18, 14); + + put_str("Stealth :", 19, 0); + desc = likert(xstl, 1); + c_put_str(likert_color, desc, 19, 14); + + + put_str("Perception :", 16, 25); + desc = likert(xfos, 6); + c_put_str(likert_color, desc, 16, 39); + + put_str("Searching :", 17, 25); + desc = likert(xsrh, 6); + c_put_str(likert_color, desc, 17, 39); + + put_str("Disarming :", 18, 25); + desc = likert(xdis, 8); + c_put_str(likert_color, desc, 18, 39); + + put_str("Magic Device:", 19, 25); + desc = likert(xdev, 6); + c_put_str(likert_color, desc, 19, 39); + + + put_str("Blows/Round:", 16, 50); + put_str(format("%d", p_ptr->num_blow), 16, 64); + + put_str("Shots/Round:", 17, 50); + put_str(format("%d", p_ptr->num_fire), 17, 64); + + put_str("Infra-Vision:", 19, 50); + put_str(format("%d ft", p_ptr->see_infra * 10), 19, 64); + } + else + { put_str("Fighting :", 16, 1); desc = likert(xthn, 12); c_put_str(likert_color, desc, 16, 15); *************** *** 1001,1006 **** --- 1077,1083 ---- put_str("Infra-Vision:", 19, 55); put_str(format("%d feet", p_ptr->see_infra * 10), 19, 69); } + } *************** *** 1009,1015 **** * * The top two and bottom two lines are left blank. */ ! void display_player(bool do_hist) { int i; --- 1086,1092 ---- * * The top two and bottom two lines are left blank. */ ! void display_player(bool do_hist, bool char_dump) { int i; *************** *** 1019,1040 **** /* Clear the screen */ clear_screen(); ! /* Name, Sex, Race, Class */ put_str("Name :", 2, 1); put_str("Sex :", 3, 1); put_str("Race :", 4, 1); put_str("Class :", 5, 1); c_put_str(TERM_L_BLUE, player_name, 2, 15); c_put_str(TERM_L_BLUE, (p_ptr->male ? "Male" : "Female"), 3, 15); c_put_str(TERM_L_BLUE, rp_ptr->title, 4, 15); c_put_str(TERM_L_BLUE, cp_ptr->title, 5, 15); /* Age, Height, Weight, Social */ prt_num("Age ", (int)p_ptr->age, 2, 32, TERM_L_BLUE); prt_num("Height ", (int)p_ptr->ht, 3, 32, TERM_L_BLUE); prt_num("Weight ", (int)p_ptr->wt, 4, 32, TERM_L_BLUE); prt_num("Social Class ", (int)p_ptr->sc, 5, 32, TERM_L_BLUE); /* Display the stats */ for (i = 0; i < 6; i++) --- 1096,1150 ---- /* Clear the screen */ clear_screen(); ! /* Name, Sex, Race, Class, Preserve, Maximize */ ! if (char_dump) ! { ! put_str("Name :", 2, 0); ! put_str("Sex :", 3, 0); ! put_str("Race :", 4, 0); ! put_str("Class :", 5, 0); ! put_str("Preserve :", 6, 0); ! put_str("Maximize :", 7, 0); ! ! c_put_str(TERM_L_BLUE, player_name, 2, 14); ! c_put_str(TERM_L_BLUE, (p_ptr->male ? "Male" : "Female"), 3, 14); ! c_put_str(TERM_L_BLUE, rp_ptr->title, 4, 14); ! c_put_str(TERM_L_BLUE, cp_ptr->title, 5, 14); ! c_put_str(TERM_L_BLUE, (p_ptr->preserve ? "Yes" : "No"), 6, 14); ! c_put_str(TERM_L_BLUE, (p_ptr->maximize ? "Yes" : "No"), 7, 14); ! } ! else ! { put_str("Name :", 2, 1); put_str("Sex :", 3, 1); put_str("Race :", 4, 1); put_str("Class :", 5, 1); + put_str("Preserve :", 6, 1); + put_str("Maximize :", 7, 1); c_put_str(TERM_L_BLUE, player_name, 2, 15); c_put_str(TERM_L_BLUE, (p_ptr->male ? "Male" : "Female"), 3, 15); c_put_str(TERM_L_BLUE, rp_ptr->title, 4, 15); c_put_str(TERM_L_BLUE, cp_ptr->title, 5, 15); + c_put_str(TERM_L_BLUE, (p_ptr->preserve ? "Yes" : "No"), 6, 15); + c_put_str(TERM_L_BLUE, (p_ptr->maximize ? "Yes" : "No"), 7, 15); + } /* Age, Height, Weight, Social */ + if (char_dump) + { + prt_num("Age ", (int)p_ptr->age, 2, 31, TERM_L_BLUE); + prt_num("Height ", (int)p_ptr->ht, 3, 31, TERM_L_BLUE); + prt_num("Weight ", (int)p_ptr->wt, 4, 31, TERM_L_BLUE); + prt_num("Social Class ", (int)p_ptr->sc, 5, 31, TERM_L_BLUE); + } + else + { prt_num("Age ", (int)p_ptr->age, 2, 32, TERM_L_BLUE); prt_num("Height ", (int)p_ptr->ht, 3, 32, TERM_L_BLUE); prt_num("Weight ", (int)p_ptr->wt, 4, 32, TERM_L_BLUE); prt_num("Social Class ", (int)p_ptr->sc, 5, 32, TERM_L_BLUE); + } /* Display the stats */ for (i = 0; i < 6; i++) *************** *** 1045,1051 **** int value; /* Use lowercase stat name */ ! put_str(stat_names_reduced[i], 2 + i, 61); /* Get the current stat */ value = p_ptr->stat_use[i]; --- 1155,1161 ---- int value; /* Use lowercase stat name */ ! put_str(stat_names_reduced[i], 2 + i, char_dump ? 55 : 61); /* Get the current stat */ value = p_ptr->stat_use[i]; *************** *** 1054,1060 **** cnv_stat(value, buf); /* Display the current stat (modified) */ ! c_put_str(TERM_YELLOW, buf, 2 + i, 66); /* Acquire the max stat */ value = p_ptr->stat_top[i]; --- 1164,1170 ---- cnv_stat(value, buf); /* Display the current stat (modified) */ ! c_put_str(TERM_YELLOW, buf, 2 + i, char_dump ? 60 : 66); /* Acquire the max stat */ value = p_ptr->stat_top[i]; *************** *** 1063,1069 **** cnv_stat(value, buf); /* Display the maximum stat (modified) */ ! c_put_str(TERM_L_GREEN, buf, 2 + i, 73); } /* Normal treatment of "normal" stats */ --- 1173,1179 ---- cnv_stat(value, buf); /* Display the maximum stat (modified) */ ! c_put_str(TERM_L_GREEN, buf, 2 + i, char_dump ? 67 : 73); } /* Normal treatment of "normal" stats */ *************** *** 1070,1087 **** else { /* Assume uppercase stat name */ ! put_str(stat_names[i], 2 + i, 61); /* Obtain the current stat (modified) */ cnv_stat(p_ptr->stat_use[i], buf); /* Display the current stat (modified) */ ! c_put_str(TERM_L_GREEN, buf, 2 + i, 66); } } /* Extra info */ ! display_player_middle(); /* Display "history" info */ if (do_hist) --- 1180,1197 ---- else { /* Assume uppercase stat name */ ! put_str(stat_names[i], 2 + i, char_dump ? 55 : 61); /* Obtain the current stat (modified) */ cnv_stat(p_ptr->stat_use[i], buf); /* Display the current stat (modified) */ ! c_put_str(TERM_L_GREEN, buf, 2 + i, char_dump ? 60 : 66); } } /* Extra info */ ! display_player_middle(char_dump); /* Display "history" info */ if (do_hist) *************** *** 1097,1105 **** /* Display "various" info */ else { ! put_str("(Miscellaneous Abilities)", 15, 25); ! display_player_various(); } } --- 1207,1215 ---- /* Display "various" info */ else { ! if (!char_dump) put_str("(Miscellaneous Abilities)", 15, 25); ! display_player_various(char_dump); } } *************** *** 1167,1173 **** } /* Open the non-existing file */ ! if (fd < 0) fff = my_fopen(buf, "w"); /* Grab priv's */ safe_setuid_grab(); --- 1277,1283 ---- } /* Open the non-existing file */ ! if (fd < 0) fff = my_fopen(buf, "wt"); /* Grab priv's */ safe_setuid_grab(); *************** *** 1186,1193 **** /* Begin dump */ ! fprintf(fff, " [Angband %d.%d.%d Character Dump]\n\n", ! VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH); /* Save screen */ --- 1296,1302 ---- /* Begin dump */ ! fprintf(fff, " [Utumno %s Character Dump]\n\n", VERSION_STRING); /* Save screen */ *************** *** 1194,1203 **** Term_save(); /* Display the player (with various) */ ! display_player(FALSE); /* Dump part of the screen */ ! for (y = 2; y < 22; y++) { /* Dump each row */ for (x = 0; x < 79; x++) --- 1303,1312 ---- Term_save(); /* Display the player (with various) */ ! display_player(FALSE, TRUE); /* Dump part of the screen */ ! for (y = 2; y < 20; y++) { /* Dump each row */ for (x = 0; x < 79; x++) *************** *** 1212,1240 **** /* Terminate */ buf[x] = '\0'; ! /* End the row */ ! fprintf(fff, "%s\n", buf); ! } ! ! /* Display the player (with history) */ ! display_player(TRUE); ! ! /* Dump part of the screen */ ! for (y = 15; y < 20; y++) { ! /* Dump each row */ ! for (x = 0; x < 79; x++) ! { ! /* Get the attr/char */ ! (void)(Term_what(x, y, &a, &c)); ! ! /* Dump it */ ! buf[x] = c; } - /* Terminate */ - buf[x] = '\0'; - /* End the row */ fprintf(fff, "%s\n", buf); } --- 1321,1333 ---- /* Terminate */ buf[x] = '\0'; ! /* Eliminate trailing spaces */ ! for (x--; x >= 0; x--) { ! if (buf[x] != ' ') break; ! buf[x] = '\0'; } /* End the row */ fprintf(fff, "%s\n", buf); } *************** *** 1263,1268 **** --- 1356,1362 ---- fprintf(fff, " [Character Inventory]\n\n"); for (i = 0; i < INVEN_PACK; i++) { + if (!inventory[i].exists()) break; object_desc(i_name, &inventory[i], TRUE, 3); fprintf(fff, "%c%s %s\n", index_to_label(i), paren, i_name); *************** *** 1271,1286 **** /* Dump the Home (page 1) */ ! fprintf(fff, " [Home Inventory (page 1)]\n\n"); for (i = 0; i < 12; i++) { object_desc(i_name, &st_ptr->stock[i], TRUE, 3); fprintf(fff, "%c%s %s\n", I2A(i%12), paren, i_name); } - fprintf(fff, "\n\n"); /* Dump the Home (page 2) */ ! fprintf(fff, " [Home Inventory (page 2)]\n\n"); for (i = 12; i < 24; i++) { object_desc(i_name, &st_ptr->stock[i], TRUE, 3); --- 1365,1379 ---- /* Dump the Home (page 1) */ ! fprintf(fff, " [Home Inventory]\n\n"); for (i = 0; i < 12; i++) { object_desc(i_name, &st_ptr->stock[i], TRUE, 3); fprintf(fff, "%c%s %s\n", I2A(i%12), paren, i_name); } /* Dump the Home (page 2) */ ! fprintf(fff, "\n"); for (i = 12; i < 24; i++) { object_desc(i_name, &st_ptr->stock[i], TRUE, 3); *************** *** 1372,1380 **** /* Look in "help" */ if (!fff) { - /* Caption */ - sprintf(caption, "Help file '%s'", name); - /* Access the "help" file */ strcpy(path, ANGBAND_DIR_HELP); strcat(path, name); --- 1465,1470 ---- *************** *** 1381,1387 **** --- 1471,1535 ---- /* Open the file */ fff = my_fopen(path, "r"); + + /* Caption */ + sprintf(caption, "Help file '%s'", name); + if (fff) + { + if (strcmp(name,"help.hlp") == 0) + { + strcpy(caption, "Help Index"); } + else if (strcmp(name,"attack.txt") == 0) + { + strcpy(caption, "Help -- Fighting"); + } + else if (strcmp(name,"autoroll.txt") == 0) + { + strcpy(caption, "Help -- The Autoroller"); + } + else if (strcmp(name,"birth.txt") == 0) + { + strcpy(caption, "Help -- Character Creation"); + } + else if (strcmp(name,"class.txt") == 0) + { + strcpy(caption, "Help -- Classes"); + } + else if (strcmp(name,"command.txt") == 0) + { + strcpy(caption, "Help -- Commands"); + } + else if (strcmp(name,"dungeon.txt") == 0) + { + strcpy(caption, "Help -- The Dungeon"); + } + else if (strcmp(name,"general.txt") == 0) + { + strcpy(caption, "Help -- General Stuff"); + } + else if (strcmp(name,"maxpres.txt") == 0) + { + strcpy(caption, "Help -- Maximize and Preserve Modes"); + } + else if (strcmp(name,"option.txt") == 0) + { + strcpy(caption, "Help -- Options"); + } + else if (strcmp(name,"race.txt") == 0) + { + strcpy(caption, "Help -- Races"); + } + else if (strcmp(name,"version.txt") == 0) + { + strcpy(caption, "Version History"); + } + else if (strcmp(name,"using.txt") == 0) + { + strcpy(caption, "Using Help"); + } + } + } /* Look in "info" */ if (!fff) *************** *** 1405,1411 **** msg_print(NULL); /* Oops */ ! return (TRUE); } --- 1553,1559 ---- msg_print(NULL); /* Oops */ ! return TRUE; } *************** *** 1521,1528 **** /* Show a general "title" */ ! prt(format("[Angband %d.%d.%d, %s, Line %d/%d]", ! VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, caption, line, size), 0, 0); --- 1669,1675 ---- /* Show a general "title" */ ! prt(format("[%s, Line %d/%d]", caption, line, size), 0, 0); *************** *** 1857,1866 **** else { /* Verify */ ! if (!get_check("Do you really want to quit? ")) return; /* Special Verification for suicide */ ! prt("Please verify QUITTING by typing the '@' sign: ", 0, 0); flush(); i = inkey(); prt("", 0, 0); --- 2004,2013 ---- else { /* Verify */ ! if (!get_check("Do you really want to commit suicide? ")) return; /* Special Verification for suicide */ ! prt("Please verify SUICIDE by typing the '@' sign: ", 0, 0); flush(); i = inkey(); prt("", 0, 0); *************** *** 1874,1880 **** death = TRUE; /* Cause of death */ ! (void)strcpy(died_from, "Quitting"); } --- 2021,2027 ---- death = TRUE; /* Cause of death */ ! (void)strcpy(died_from, "suicide"); } *************** *** 2090,2096 **** center_string(buf, tmp); put_str(buf, 12, 11); ! (void)sprintf(tmp, "AU: %ld", (long)p_ptr->au); center_string(buf, tmp); put_str(buf, 13, 11); --- 2237,2243 ---- center_string(buf, tmp); put_str(buf, 12, 11); ! (void)sprintf(tmp, "Gold: %ld", (long)p_ptr->au); center_string(buf, tmp); put_str(buf, 13, 11); *************** *** 2115,2136 **** static void show_info(void) { int i, j, k; - object_type *i_ptr; - store_type *st_ptr = &store[7]; - char p1 = '(', p2 = ')'; - /* Hack -- Know everything in the inven/equip */ for (i = 0; i < INVEN_TOTAL; i++) { i_ptr = &inventory[i]; ! if (i_ptr->k_idx) { ! object_aware(i_ptr); ! object_known(i_ptr); } } --- 2262,2279 ---- static void show_info(void) { int i, j, k; object_type *i_ptr; store_type *st_ptr = &store[7]; /* Hack -- Know everything in the inven/equip */ for (i = 0; i < INVEN_TOTAL; i++) { i_ptr = &inventory[i]; ! if (i_ptr->exists()) { ! i_ptr->object_aware(); ! i_ptr->object_known(); } } *************** *** 2138,2152 **** for (i = 0; i < st_ptr->stock_num; i++) { i_ptr = &st_ptr->stock[i]; ! if (i_ptr->k_idx) { ! object_aware(i_ptr); ! object_known(i_ptr); } } /* Hack -- Recalculate bonuses */ ! p_ptr->update |= (PU_BONUS); /* Handle stuff */ handle_stuff(); --- 2281,2295 ---- for (i = 0; i < st_ptr->stock_num; i++) { i_ptr = &st_ptr->stock[i]; ! if (i_ptr->exists()) { ! i_ptr->object_aware(); ! i_ptr->object_known(); } } /* Hack -- Recalculate bonuses */ ! p_ptr->update |= PU_BONUS; /* Handle stuff */ handle_stuff(); *************** *** 2185,2191 **** /* Show player on screen */ ! display_player(FALSE); /* Prompt for inventory */ prt("Hit any key to see more information (ESC to abort): ", 23, 0); --- 2328,2334 ---- /* Show player on screen */ ! display_player(FALSE, FALSE); /* Prompt for inventory */ prt("Hit any key to see more information (ESC to abort): ", 23, 0); *************** *** 2685,2692 **** WIPE(&the_score, high_score); /* Save the version */ ! sprintf(the_score.what, "%u.%u.%u", ! VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH); /* Calculate and save the points */ sprintf(the_score.pts, "%9lu", (long)total_points()); --- 2828,2834 ---- WIPE(&the_score, high_score); /* Save the version */ ! strcpy(the_score.what, VERSION_STRING); /* Calculate and save the points */ sprintf(the_score.pts, "%9lu", (long)total_points()); *************** *** 2776,2783 **** /* Save the version */ ! sprintf(the_score.what, "%u.%u.%u", ! VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH); /* Calculate and save the points */ sprintf(the_score.pts, "%9lu", (long)total_points()); --- 2918,2924 ---- /* Save the version */ ! strcpy(the_score.what, VERSION_STRING); /* Calculate and save the points */ sprintf(the_score.pts, "%9lu", (long)total_points()); *************** *** 2859,2874 **** /* Check the experience */ /* check_experience(); */ - /* Mega-Hack -- Instant Experience */ - p_ptr->exp += 5000000L; - p_ptr->max_exp += 5000000L; - - /* Mega-Hack -- Instant Gold */ - p_ptr->au += 250000L; - - /* Automatic level 50 */ - /* p_ptr->lev = 50; */ - /* Display a crown */ clear_screen(); put_str("#", 1, 34); --- 3000,3005 ---- diff -w -c -r ick-279/generate.c utumno/generate.c *** ick-279/generate.c Thu May 15 17:12:10 1997 --- utumno/generate.c Thu May 15 17:45:49 1997 *************** *** 186,198 **** * Simple structure to hold a map location */ ! typedef struct coord coord; ! ! struct coord { byte y; byte x; ! }; /* --- 186,196 ---- * Simple structure to hold a map location */ ! typedef struct { byte y; byte x; ! } coord; /* *************** *** 199,207 **** * Room type information */ ! typedef struct room_data room_data; ! ! struct room_data { /* Required size in blocks */ int dy1, dy2, dx1, dx2; --- 197,203 ---- * Room type information */ ! typedef struct room_data { /* Required size in blocks */ int dy1, dy2, dx1, dx2; *************** *** 208,214 **** /* Hack -- minimum level */ int level; ! }; /* --- 204,210 ---- /* Hack -- minimum level */ int level; ! } room_data; /* *************** *** 215,223 **** * Structure to hold all "dungeon generation" data */ ! typedef struct dun_data dun_data; ! ! struct dun_data { /* Array of centers of rooms */ int cent_n; --- 211,217 ---- * Structure to hold all "dungeon generation" data */ ! typedef struct { /* Array of centers of rooms */ int cent_n; *************** *** 244,250 **** /* Hack -- there is a pit/nest on this level */ bool crowded; ! }; /* --- 238,244 ---- /* Hack -- there is a pit/nest on this level */ bool crowded; ! } dun_data; /* *************** *** 369,375 **** cave_type *c_ptr = &cave[y][x]; /* Clear previous contents, add rubble */ ! c_ptr->feat = 0x31; } --- 363,369 ---- cave_type *c_ptr = &cave[y][x]; /* Clear previous contents, add rubble */ ! c_ptr->feat = CF_RUBBLE; } *************** *** 382,388 **** cave_type *c_ptr = &cave[y][x]; /* Clear previous contents, add up stairs */ ! c_ptr->feat = 0x06; } --- 376,382 ---- cave_type *c_ptr = &cave[y][x]; /* Clear previous contents, add up stairs */ ! c_ptr->feat = CF_STAIRS_UP; } *************** *** 394,400 **** cave_type *c_ptr = &cave[y][x]; /* Clear previous contents, add down stairs */ ! c_ptr->feat = 0x07; } --- 388,394 ---- cave_type *c_ptr = &cave[y][x]; /* Clear previous contents, add down stairs */ ! c_ptr->feat = CF_STAIRS_DOWN; } *************** *** 448,455 **** { cave_type *c_ptr = &cave[y][x]; ! /* Clear previous contents, add up stairs */ ! c_ptr->feat = 0x30; } --- 442,449 ---- { cave_type *c_ptr = &cave[y][x]; ! /* Clear previous contents, add secret door */ ! c_ptr->feat = CF_DOOR_SECRET; } *************** *** 469,475 **** if (tmp < 300) { /* Clear previous contents, add open door */ ! c_ptr->feat = 0x04; } /* Broken doors (100/1000) */ --- 463,469 ---- if (tmp < 300) { /* Clear previous contents, add open door */ ! c_ptr->feat = CF_DOOR_OPEN; } /* Broken doors (100/1000) */ *************** *** 476,482 **** else if (tmp < 400) { /* Clear previous contents, add broken door */ ! c_ptr->feat = 0x05; } /* Secret doors (200/1000) */ --- 470,476 ---- else if (tmp < 400) { /* Clear previous contents, add broken door */ ! c_ptr->feat = CF_DOOR_BROKEN; } /* Secret doors (200/1000) */ *************** *** 483,489 **** else if (tmp < 600) { /* Clear previous contents, add secret door */ ! c_ptr->feat = 0x30; } /* Closed doors (300/1000) */ --- 477,483 ---- else if (tmp < 600) { /* Clear previous contents, add secret door */ ! c_ptr->feat = CF_DOOR_SECRET; } /* Closed doors (300/1000) */ *************** *** 546,552 **** if (!dun_level) { /* Clear previous contents, add down stairs */ ! c_ptr->feat = 0x07; } /* Quest -- must go up */ --- 540,546 ---- if (!dun_level) { /* Clear previous contents, add down stairs */ ! c_ptr->feat = CF_STAIRS_DOWN; } /* Quest -- must go up */ *************** *** 553,559 **** else if (is_quest(dun_level) || (dun_level >= MAX_DEPTH-1)) { /* Clear previous contents, add up stairs */ ! c_ptr->feat = 0x06; } /* Requested type */ --- 547,553 ---- else if (is_quest(dun_level) || (dun_level >= MAX_DEPTH-1)) { /* Clear previous contents, add up stairs */ ! c_ptr->feat = CF_STAIRS_UP; } /* Requested type */ *************** *** 750,756 **** if (t < 20) { /* Clear previous contents, add granite wall */ ! c_ptr->feat = 0x38; } /* Quartz */ --- 744,750 ---- if (t < 20) { /* Clear previous contents, add granite wall */ ! c_ptr->feat = CF_GRANITE_BASIC; } /* Quartz */ *************** *** 757,763 **** else if (t < 70) { /* Clear previous contents, add quartz vein */ ! c_ptr->feat = 0x33; } /* Magma */ --- 751,757 ---- else if (t < 70) { /* Clear previous contents, add quartz vein */ ! c_ptr->feat = CF_QUARTZ; } /* Magma */ *************** *** 764,770 **** else if (t < 100) { /* Clear previous contents, add magma vein */ ! c_ptr->feat = 0x32; } /* Floor */ --- 758,764 ---- else if (t < 100) { /* Clear previous contents, add magma vein */ ! c_ptr->feat = CF_MAGMA; } /* Floor */ *************** *** 771,777 **** else { /* Clear previous contents, add floor */ ! c_ptr->feat = 0x01; } /* No longer part of a room or vault */ --- 765,771 ---- else { /* Clear previous contents, add floor */ ! c_ptr->feat = CF_FLOOR; } /* No longer part of a room or vault */ *************** *** 954,960 **** for (x = x1 - 1; x <= x2 + 1; x++) { c_ptr = &cave[y][x]; ! c_ptr->feat = 0x01; c_ptr->info |= CAVE_ROOM; if (light) c_ptr->info |= CAVE_GLOW; } --- 948,954 ---- for (x = x1 - 1; x <= x2 + 1; x++) { c_ptr = &cave[y][x]; ! c_ptr->feat = CF_FLOOR; c_ptr->info |= CAVE_ROOM; if (light) c_ptr->info |= CAVE_GLOW; } *************** *** 964,979 **** for (y = y1 - 1; y <= y2 + 1; y++) { c_ptr = &cave[y][x1-1]; ! c_ptr->feat = 0x3A; c_ptr = &cave[y][x2+1]; ! c_ptr->feat = 0x3A; } for (x = x1 - 1; x <= x2 + 1; x++) { c_ptr = &cave[y1-1][x]; ! c_ptr->feat = 0x3A; c_ptr = &cave[y2+1][x]; ! c_ptr->feat = 0x3A; } --- 958,973 ---- for (y = y1 - 1; y <= y2 + 1; y++) { c_ptr = &cave[y][x1-1]; ! c_ptr->feat = CF_GRANITE_OUTER; c_ptr = &cave[y][x2+1]; ! c_ptr->feat = CF_GRANITE_OUTER; } for (x = x1 - 1; x <= x2 + 1; x++) { c_ptr = &cave[y1-1][x]; ! c_ptr->feat = CF_GRANITE_OUTER; c_ptr = &cave[y2+1][x]; ! c_ptr->feat = CF_GRANITE_OUTER; } *************** *** 985,991 **** for (x = x1; x <= x2; x += 2) { c_ptr = &cave[y][x]; ! c_ptr->feat = 0x39; } } } --- 979,985 ---- for (x = x1; x <= x2; x += 2) { c_ptr = &cave[y][x]; ! c_ptr->feat = CF_GRANITE_INNER; } } } *************** *** 996,1011 **** for (y = y1 + 2; y <= y2 - 2; y += 2) { c_ptr = &cave[y][x1]; ! c_ptr->feat = 0x39; c_ptr = &cave[y][x2]; ! c_ptr->feat = 0x39; } for (x = x1 + 2; x <= x2 - 2; x += 2) { c_ptr = &cave[y1][x]; ! c_ptr->feat = 0x39; c_ptr = &cave[y2][x]; ! c_ptr->feat = 0x39; } } } --- 990,1005 ---- for (y = y1 + 2; y <= y2 - 2; y += 2) { c_ptr = &cave[y][x1]; ! c_ptr->feat = CF_GRANITE_INNER; c_ptr = &cave[y][x2]; ! c_ptr->feat = CF_GRANITE_INNER; } for (x = x1 + 2; x <= x2 - 2; x += 2) { c_ptr = &cave[y1][x]; ! c_ptr->feat = CF_GRANITE_INNER; c_ptr = &cave[y2][x]; ! c_ptr->feat = CF_GRANITE_INNER; } } } *************** *** 1049,1055 **** for (x = x1a - 1; x <= x2a + 1; x++) { c_ptr = &cave[y][x]; ! c_ptr->feat = 0x01; c_ptr->info |= CAVE_ROOM; if (light) c_ptr->info |= CAVE_GLOW; } --- 1043,1049 ---- for (x = x1a - 1; x <= x2a + 1; x++) { c_ptr = &cave[y][x]; ! c_ptr->feat = CF_FLOOR; c_ptr->info |= CAVE_ROOM; if (light) c_ptr->info |= CAVE_GLOW; } *************** *** 1061,1067 **** for (x = x1b - 1; x <= x2b + 1; x++) { c_ptr = &cave[y][x]; ! c_ptr->feat = 0x01; c_ptr->info |= CAVE_ROOM; if (light) c_ptr->info |= CAVE_GLOW; } --- 1055,1061 ---- for (x = x1b - 1; x <= x2b + 1; x++) { c_ptr = &cave[y][x]; ! c_ptr->feat = CF_FLOOR; c_ptr->info |= CAVE_ROOM; if (light) c_ptr->info |= CAVE_GLOW; } *************** *** 1072,1087 **** for (y = y1a - 1; y <= y2a + 1; y++) { c_ptr = &cave[y][x1a-1]; ! c_ptr->feat = 0x3A; c_ptr = &cave[y][x2a+1]; ! c_ptr->feat = 0x3A; } for (x = x1a - 1; x <= x2a + 1; x++) { c_ptr = &cave[y1a-1][x]; ! c_ptr->feat = 0x3A; c_ptr = &cave[y2a+1][x]; ! c_ptr->feat = 0x3A; } /* Place the walls around room "b" */ --- 1066,1081 ---- for (y = y1a - 1; y <= y2a + 1; y++) { c_ptr = &cave[y][x1a-1]; ! c_ptr->feat = CF_GRANITE_OUTER; c_ptr = &cave[y][x2a+1]; ! c_ptr->feat = CF_GRANITE_OUTER; } for (x = x1a - 1; x <= x2a + 1; x++) { c_ptr = &cave[y1a-1][x]; ! c_ptr->feat = CF_GRANITE_OUTER; c_ptr = &cave[y2a+1][x]; ! c_ptr->feat = CF_GRANITE_OUTER; } /* Place the walls around room "b" */ *************** *** 1088,1103 **** for (y = y1b - 1; y <= y2b + 1; y++) { c_ptr = &cave[y][x1b-1]; ! c_ptr->feat = 0x3A; c_ptr = &cave[y][x2b+1]; ! c_ptr->feat = 0x3A; } for (x = x1b - 1; x <= x2b + 1; x++) { c_ptr = &cave[y1b-1][x]; ! c_ptr->feat = 0x3A; c_ptr = &cave[y2b+1][x]; ! c_ptr->feat = 0x3A; } --- 1082,1097 ---- for (y = y1b - 1; y <= y2b + 1; y++) { c_ptr = &cave[y][x1b-1]; ! c_ptr->feat = CF_GRANITE_OUTER; c_ptr = &cave[y][x2b+1]; ! c_ptr->feat = CF_GRANITE_OUTER; } for (x = x1b - 1; x <= x2b + 1; x++) { c_ptr = &cave[y1b-1][x]; ! c_ptr->feat = CF_GRANITE_OUTER; c_ptr = &cave[y2b+1][x]; ! c_ptr->feat = CF_GRANITE_OUTER; } *************** *** 1108,1114 **** for (x = x1a; x <= x2a; x++) { c_ptr = &cave[y][x]; ! c_ptr->feat = 0x01; } } --- 1102,1108 ---- for (x = x1a; x <= x2a; x++) { c_ptr = &cave[y][x]; ! c_ptr->feat = CF_FLOOR; } } *************** *** 1118,1124 **** for (x = x1b; x <= x2b; x++) { c_ptr = &cave[y][x]; ! c_ptr->feat = 0x01; } } } --- 1112,1118 ---- for (x = x1b; x <= x2b; x++) { c_ptr = &cave[y][x]; ! c_ptr->feat = CF_FLOOR; } } } *************** *** 1182,1188 **** for (x = x1a - 1; x <= x2a + 1; x++) { c_ptr = &cave[y][x]; ! c_ptr->feat = 0x01; c_ptr->info |= CAVE_ROOM; if (light) c_ptr->info |= CAVE_GLOW; } --- 1176,1182 ---- for (x = x1a - 1; x <= x2a + 1; x++) { c_ptr = &cave[y][x]; ! c_ptr->feat = CF_FLOOR; c_ptr->info |= CAVE_ROOM; if (light) c_ptr->info |= CAVE_GLOW; } *************** *** 1194,1200 **** for (x = x1b - 1; x <= x2b + 1; x++) { c_ptr = &cave[y][x]; ! c_ptr->feat = 0x01; c_ptr->info |= CAVE_ROOM; if (light) c_ptr->info |= CAVE_GLOW; } --- 1188,1194 ---- for (x = x1b - 1; x <= x2b + 1; x++) { c_ptr = &cave[y][x]; ! c_ptr->feat = CF_FLOOR; c_ptr->info |= CAVE_ROOM; if (light) c_ptr->info |= CAVE_GLOW; } *************** *** 1205,1220 **** for (y = y1a - 1; y <= y2a + 1; y++) { c_ptr = &cave[y][x1a-1]; ! c_ptr->feat = 0x3A; c_ptr = &cave[y][x2a+1]; ! c_ptr->feat = 0x3A; } for (x = x1a - 1; x <= x2a + 1; x++) { c_ptr = &cave[y1a-1][x]; ! c_ptr->feat = 0x3A; c_ptr = &cave[y2a+1][x]; ! c_ptr->feat = 0x3A; } /* Place the walls around room "b" */ --- 1199,1214 ---- for (y = y1a - 1; y <= y2a + 1; y++) { c_ptr = &cave[y][x1a-1]; ! c_ptr->feat = CF_GRANITE_OUTER; c_ptr = &cave[y][x2a+1]; ! c_ptr->feat = CF_GRANITE_OUTER; } for (x = x1a - 1; x <= x2a + 1; x++) { c_ptr = &cave[y1a-1][x]; ! c_ptr->feat = CF_GRANITE_OUTER; c_ptr = &cave[y2a+1][x]; ! c_ptr->feat = CF_GRANITE_OUTER; } /* Place the walls around room "b" */ *************** *** 1221,1236 **** for (y = y1b - 1; y <= y2b + 1; y++) { c_ptr = &cave[y][x1b-1]; ! c_ptr->feat = 0x3A; c_ptr = &cave[y][x2b+1]; ! c_ptr->feat = 0x3A; } for (x = x1b - 1; x <= x2b + 1; x++) { c_ptr = &cave[y1b-1][x]; ! c_ptr->feat = 0x3A; c_ptr = &cave[y2b+1][x]; ! c_ptr->feat = 0x3A; } --- 1215,1230 ---- for (y = y1b - 1; y <= y2b + 1; y++) { c_ptr = &cave[y][x1b-1]; ! c_ptr->feat = CF_GRANITE_OUTER; c_ptr = &cave[y][x2b+1]; ! c_ptr->feat = CF_GRANITE_OUTER; } for (x = x1b - 1; x <= x2b + 1; x++) { c_ptr = &cave[y1b-1][x]; ! c_ptr->feat = CF_GRANITE_OUTER; c_ptr = &cave[y2b+1][x]; ! c_ptr->feat = CF_GRANITE_OUTER; } *************** *** 1240,1246 **** for (x = x1a; x <= x2a; x++) { c_ptr = &cave[y][x]; ! c_ptr->feat = 0x01; } } --- 1234,1240 ---- for (x = x1a; x <= x2a; x++) { c_ptr = &cave[y][x]; ! c_ptr->feat = CF_FLOOR; } } *************** *** 1250,1256 **** for (x = x1b; x <= x2b; x++) { c_ptr = &cave[y][x]; ! c_ptr->feat = 0x01; } } --- 1244,1250 ---- for (x = x1b; x <= x2b; x++) { c_ptr = &cave[y][x]; ! c_ptr->feat = CF_FLOOR; } } *************** *** 1266,1272 **** for (x = x1a; x <= x2a; x++) { c_ptr = &cave[y][x]; ! c_ptr->feat = 0x39; } } break; --- 1260,1266 ---- for (x = x1a; x <= x2a; x++) { c_ptr = &cave[y][x]; ! c_ptr->feat = CF_GRANITE_INNER; } } break; *************** *** 1278,1293 **** for (y = y1b; y <= y2b; y++) { c_ptr = &cave[y][x1a]; ! c_ptr->feat = 0x39; c_ptr = &cave[y][x2a]; ! c_ptr->feat = 0x39; } for (x = x1a; x <= x2a; x++) { c_ptr = &cave[y1b][x]; ! c_ptr->feat = 0x39; c_ptr = &cave[y2b][x]; ! c_ptr->feat = 0x39; } /* Place a secret door on the inner room */ --- 1272,1287 ---- for (y = y1b; y <= y2b; y++) { c_ptr = &cave[y][x1a]; ! c_ptr->feat = CF_GRANITE_INNER; c_ptr = &cave[y][x2a]; ! c_ptr->feat = CF_GRANITE_INNER; } for (x = x1a; x <= x2a; x++) { c_ptr = &cave[y1b][x]; ! c_ptr->feat = CF_GRANITE_INNER; c_ptr = &cave[y2b][x]; ! c_ptr->feat = CF_GRANITE_INNER; } /* Place a secret door on the inner room */ *************** *** 1322,1330 **** { if (y == yval) continue; c_ptr = &cave[y][x1a - 1]; ! c_ptr->feat = 0x39; c_ptr = &cave[y][x2a + 1]; ! c_ptr->feat = 0x39; } /* Pinch the north/south sides */ --- 1316,1324 ---- { if (y == yval) continue; c_ptr = &cave[y][x1a - 1]; ! c_ptr->feat = CF_GRANITE_INNER; c_ptr = &cave[y][x2a + 1]; ! c_ptr->feat = CF_GRANITE_INNER; } /* Pinch the north/south sides */ *************** *** 1332,1340 **** { if (x == xval) continue; c_ptr = &cave[y1b - 1][x]; ! c_ptr->feat = 0x39; c_ptr = &cave[y2b + 1][x]; ! c_ptr->feat = 0x39; } /* Sometimes shut using secret doors */ --- 1326,1334 ---- { if (x == xval) continue; c_ptr = &cave[y1b - 1][x]; ! c_ptr->feat = CF_GRANITE_INNER; c_ptr = &cave[y2b + 1][x]; ! c_ptr->feat = CF_GRANITE_INNER; } /* Sometimes shut using secret doors */ *************** *** 1351,1365 **** else if (rand_int(3) == 0) { c_ptr = &cave[yval][xval]; ! c_ptr->feat = 0x39; c_ptr = &cave[y1b][xval]; ! c_ptr->feat = 0x39; c_ptr = &cave[y2b][xval]; ! c_ptr->feat = 0x39; c_ptr = &cave[yval][x1a]; ! c_ptr->feat = 0x39; c_ptr = &cave[yval][x2a]; ! c_ptr->feat = 0x39; } /* Occasionally put a pillar in the center */ --- 1345,1359 ---- else if (rand_int(3) == 0) { c_ptr = &cave[yval][xval]; ! c_ptr->feat = CF_GRANITE_INNER; c_ptr = &cave[y1b][xval]; ! c_ptr->feat = CF_GRANITE_INNER; c_ptr = &cave[y2b][xval]; ! c_ptr->feat = CF_GRANITE_INNER; c_ptr = &cave[yval][x1a]; ! c_ptr->feat = CF_GRANITE_INNER; c_ptr = &cave[yval][x2a]; ! c_ptr->feat = CF_GRANITE_INNER; } /* Occasionally put a pillar in the center */ *************** *** 1366,1372 **** else if (rand_int(3) == 0) { c_ptr = &cave[yval][xval]; ! c_ptr->feat = 0x39; } break; --- 1360,1366 ---- else if (rand_int(3) == 0) { c_ptr = &cave[yval][xval]; ! c_ptr->feat = CF_GRANITE_INNER; } break; *************** *** 1412,1418 **** for (x = x1 - 1; x <= x2 + 1; x++) { c_ptr = &cave[y][x]; ! c_ptr->feat = 0x01; c_ptr->info |= CAVE_ROOM; if (light) c_ptr->info |= CAVE_GLOW; } --- 1406,1412 ---- for (x = x1 - 1; x <= x2 + 1; x++) { c_ptr = &cave[y][x]; ! c_ptr->feat = CF_FLOOR; c_ptr->info |= CAVE_ROOM; if (light) c_ptr->info |= CAVE_GLOW; } *************** *** 1422,1437 **** for (y = y1 - 1; y <= y2 + 1; y++) { c_ptr = &cave[y][x1-1]; ! c_ptr->feat = 0x3A; c_ptr = &cave[y][x2+1]; ! c_ptr->feat = 0x3A; } for (x = x1 - 1; x <= x2 + 1; x++) { c_ptr = &cave[y1-1][x]; ! c_ptr->feat = 0x3A; c_ptr = &cave[y2+1][x]; ! c_ptr->feat = 0x3A; } --- 1416,1431 ---- for (y = y1 - 1; y <= y2 + 1; y++) { c_ptr = &cave[y][x1-1]; ! c_ptr->feat = CF_GRANITE_OUTER; c_ptr = &cave[y][x2+1]; ! c_ptr->feat = CF_GRANITE_OUTER; } for (x = x1 - 1; x <= x2 + 1; x++) { c_ptr = &cave[y1-1][x]; ! c_ptr->feat = CF_GRANITE_OUTER; c_ptr = &cave[y2+1][x]; ! c_ptr->feat = CF_GRANITE_OUTER; } *************** *** 1445,1460 **** for (y = y1 - 1; y <= y2 + 1; y++) { c_ptr = &cave[y][x1-1]; ! c_ptr->feat = 0x39; c_ptr = &cave[y][x2+1]; ! c_ptr->feat = 0x39; } for (x = x1 - 1; x <= x2 + 1; x++) { c_ptr = &cave[y1-1][x]; ! c_ptr->feat = 0x39; c_ptr = &cave[y2+1][x]; ! c_ptr->feat = 0x39; } --- 1439,1454 ---- for (y = y1 - 1; y <= y2 + 1; y++) { c_ptr = &cave[y][x1-1]; ! c_ptr->feat = CF_GRANITE_INNER; c_ptr = &cave[y][x2+1]; ! c_ptr->feat = CF_GRANITE_INNER; } for (x = x1 - 1; x <= x2 + 1; x++) { c_ptr = &cave[y1-1][x]; ! c_ptr->feat = CF_GRANITE_INNER; c_ptr = &cave[y2+1][x]; ! c_ptr->feat = CF_GRANITE_INNER; } *************** *** 1499,1505 **** { if ((x == xval) && (y == yval)) continue; c_ptr = &cave[y][x]; ! c_ptr->feat = 0x39; } } --- 1493,1499 ---- { if ((x == xval) && (y == yval)) continue; c_ptr = &cave[y][x]; ! c_ptr->feat = CF_GRANITE_INNER; } } *************** *** 1551,1557 **** for (x = xval - 1; x <= xval + 1; x++) { c_ptr = &cave[y][x]; ! c_ptr->feat = 0x39; } } --- 1545,1551 ---- for (x = xval - 1; x <= xval + 1; x++) { c_ptr = &cave[y][x]; ! c_ptr->feat = CF_GRANITE_INNER; } } *************** *** 1564,1575 **** for (x = xval - 5 - tmp; x <= xval - 3 - tmp; x++) { c_ptr = &cave[y][x]; ! c_ptr->feat = 0x39; } for (x = xval + 3 + tmp; x <= xval + 5 + tmp; x++) { c_ptr = &cave[y][x]; ! c_ptr->feat = 0x39; } } } --- 1558,1569 ---- for (x = xval - 5 - tmp; x <= xval - 3 - tmp; x++) { c_ptr = &cave[y][x]; ! c_ptr->feat = CF_GRANITE_INNER; } for (x = xval + 3 + tmp; x <= xval + 5 + tmp; x++) { c_ptr = &cave[y][x]; ! c_ptr->feat = CF_GRANITE_INNER; } } } *************** *** 1581,1596 **** for (x = xval - 5; x <= xval + 5; x++) { c_ptr = &cave[yval-1][x]; ! c_ptr->feat = 0x39; c_ptr = &cave[yval+1][x]; ! c_ptr->feat = 0x39; } /* Close off the left/right edges */ c_ptr = &cave[yval][xval-5]; ! c_ptr->feat = 0x39; c_ptr = &cave[yval][xval+5]; ! c_ptr->feat = 0x39; /* Secret doors (random top/bottom) */ place_secret_door(yval - 3 + (randint(2) * 2), xval - 3); --- 1575,1590 ---- for (x = xval - 5; x <= xval + 5; x++) { c_ptr = &cave[yval-1][x]; ! c_ptr->feat = CF_GRANITE_INNER; c_ptr = &cave[yval+1][x]; ! c_ptr->feat = CF_GRANITE_INNER; } /* Close off the left/right edges */ c_ptr = &cave[yval][xval-5]; ! c_ptr->feat = CF_GRANITE_INNER; c_ptr = &cave[yval][xval+5]; ! c_ptr->feat = CF_GRANITE_INNER; /* Secret doors (random top/bottom) */ place_secret_door(yval - 3 + (randint(2) * 2), xval - 3); *************** *** 1628,1634 **** if (0x1 & (x + y)) { c_ptr = &cave[y][x]; ! c_ptr->feat = 0x39; } } } --- 1622,1628 ---- if (0x1 & (x + y)) { c_ptr = &cave[y][x]; ! c_ptr->feat = CF_GRANITE_INNER; } } } *************** *** 1654,1665 **** for (y = y1; y <= y2; y++) { c_ptr = &cave[y][xval]; ! c_ptr->feat = 0x39; } for (x = x1; x <= x2; x++) { c_ptr = &cave[yval][x]; ! c_ptr->feat = 0x39; } /* Doors into the rooms */ --- 1648,1659 ---- for (y = y1; y <= y2; y++) { c_ptr = &cave[y][xval]; ! c_ptr->feat = CF_GRANITE_INNER; } for (x = x1; x <= x2; x++) { c_ptr = &cave[yval][x]; ! c_ptr->feat = CF_GRANITE_INNER; } /* Doors into the rooms */ *************** *** 1719,1731 **** monster_race *r_ptr = &r_info[r_idx]; /* Require icky thing, jelly, mold, or mushroom */ ! if (!strchr("ijm,", r_ptr->r_char)) return (FALSE); /* Hack -- Skip unique monsters */ ! if (r_ptr->flags1 & RF1_UNIQUE) return (FALSE); /* Okay */ ! return (TRUE); } --- 1713,1725 ---- monster_race *r_ptr = &r_info[r_idx]; /* Require icky thing, jelly, mold, or mushroom */ ! if (!strchr("ijm,", r_ptr->r_char)) return FALSE; /* Hack -- Skip unique monsters */ ! if (r_ptr->flags1 & RF1_UNIQUE) return FALSE; /* Okay */ ! return TRUE; } *************** *** 1737,1749 **** monster_race *r_ptr = &r_info[r_idx]; /* Require "animal" flag */ ! if (!(r_ptr->flags3 & RF3_ANIMAL)) return (FALSE); /* Hack -- Skip unique monsters */ ! if (r_ptr->flags1 & RF1_UNIQUE) return (FALSE); /* Okay */ ! return (TRUE); } --- 1731,1743 ---- monster_race *r_ptr = &r_info[r_idx]; /* Require "animal" flag */ ! if (!(r_ptr->flags3 & RF3_ANIMAL)) return FALSE; /* Hack -- Skip unique monsters */ ! if (r_ptr->flags1 & RF1_UNIQUE) return FALSE; /* Okay */ ! return TRUE; } *************** *** 1755,1767 **** monster_race *r_ptr = &r_info[r_idx]; /* Require Undead */ ! if (!(r_ptr->flags3 & RF3_UNDEAD)) return (FALSE); /* Hack -- Skip unique monsters */ ! if (r_ptr->flags1 & RF1_UNIQUE) return (FALSE); /* Okay */ ! return (TRUE); } --- 1749,1761 ---- monster_race *r_ptr = &r_info[r_idx]; /* Require Undead */ ! if (!(r_ptr->flags3 & RF3_UNDEAD)) return FALSE; /* Hack -- Skip unique monsters */ ! if (r_ptr->flags1 & RF1_UNIQUE) return FALSE; /* Okay */ ! return TRUE; } *************** *** 1773,1782 **** monster_race *r_ptr = &r_info[r_idx]; /* Hack -- Require "o" monsters */ ! if (!strchr("o", r_ptr->r_char)) return (FALSE); /* Hack -- Skip unique monsters */ ! if (r_ptr->flags1 & RF1_UNIQUE) return (FALSE); /* Okay */ return (TRUE); --- 1767,1776 ---- monster_race *r_ptr = &r_info[r_idx]; /* Hack -- Require "o" monsters */ ! if (!strchr("o", r_ptr->r_char)) return FALSE; /* Hack -- Skip unique monsters */ ! if (r_ptr->flags1 & RF1_UNIQUE) return FALSE; /* Okay */ return (TRUE); *************** *** 1914,1920 **** for (x = x1 - 1; x <= x2 + 1; x++) { c_ptr = &cave[y][x]; ! c_ptr->feat = 0x01; c_ptr->info |= CAVE_ROOM; } } --- 1908,1914 ---- for (x = x1 - 1; x <= x2 + 1; x++) { c_ptr = &cave[y][x]; ! c_ptr->feat = CF_FLOOR; c_ptr->info |= CAVE_ROOM; } } *************** *** 1923,1938 **** for (y = y1 - 1; y <= y2 + 1; y++) { c_ptr = &cave[y][x1-1]; ! c_ptr->feat = 0x3A; c_ptr = &cave[y][x2+1]; ! c_ptr->feat = 0x3A; } for (x = x1 - 1; x <= x2 + 1; x++) { c_ptr = &cave[y1-1][x]; ! c_ptr->feat = 0x3A; c_ptr = &cave[y2+1][x]; ! c_ptr->feat = 0x3A; } --- 1917,1932 ---- for (y = y1 - 1; y <= y2 + 1; y++) { c_ptr = &cave[y][x1-1]; ! c_ptr->feat = CF_GRANITE_OUTER; c_ptr = &cave[y][x2+1]; ! c_ptr->feat = CF_GRANITE_OUTER; } for (x = x1 - 1; x <= x2 + 1; x++) { c_ptr = &cave[y1-1][x]; ! c_ptr->feat = CF_GRANITE_OUTER; c_ptr = &cave[y2+1][x]; ! c_ptr->feat = CF_GRANITE_OUTER; } *************** *** 1946,1961 **** for (y = y1 - 1; y <= y2 + 1; y++) { c_ptr = &cave[y][x1-1]; ! c_ptr->feat = 0x39; c_ptr = &cave[y][x2+1]; ! c_ptr->feat = 0x39; } for (x = x1 - 1; x <= x2 + 1; x++) { c_ptr = &cave[y1-1][x]; ! c_ptr->feat = 0x39; c_ptr = &cave[y2+1][x]; ! c_ptr->feat = 0x39; } --- 1940,1955 ---- for (y = y1 - 1; y <= y2 + 1; y++) { c_ptr = &cave[y][x1-1]; ! c_ptr->feat = CF_GRANITE_INNER; c_ptr = &cave[y][x2+1]; ! c_ptr->feat = CF_GRANITE_INNER; } for (x = x1 - 1; x <= x2 + 1; x++) { c_ptr = &cave[y1-1][x]; ! c_ptr->feat = CF_GRANITE_INNER; c_ptr = &cave[y2+1][x]; ! c_ptr->feat = CF_GRANITE_INNER; } *************** *** 2117,2123 **** for (x = x1 - 1; x <= x2 + 1; x++) { c_ptr = &cave[y][x]; ! c_ptr->feat = 0x01; c_ptr->info |= CAVE_ROOM; } } --- 2111,2117 ---- for (x = x1 - 1; x <= x2 + 1; x++) { c_ptr = &cave[y][x]; ! c_ptr->feat = CF_FLOOR; c_ptr->info |= CAVE_ROOM; } } *************** *** 2126,2141 **** for (y = y1 - 1; y <= y2 + 1; y++) { c_ptr = &cave[y][x1-1]; ! c_ptr->feat = 0x3A; c_ptr = &cave[y][x2+1]; ! c_ptr->feat = 0x3A; } for (x = x1 - 1; x <= x2 + 1; x++) { c_ptr = &cave[y1-1][x]; ! c_ptr->feat = 0x3A; c_ptr = &cave[y2+1][x]; ! c_ptr->feat = 0x3A; } --- 2120,2135 ---- for (y = y1 - 1; y <= y2 + 1; y++) { c_ptr = &cave[y][x1-1]; ! c_ptr->feat = CF_GRANITE_OUTER; c_ptr = &cave[y][x2+1]; ! c_ptr->feat = CF_GRANITE_OUTER; } for (x = x1 - 1; x <= x2 + 1; x++) { c_ptr = &cave[y1-1][x]; ! c_ptr->feat = CF_GRANITE_OUTER; c_ptr = &cave[y2+1][x]; ! c_ptr->feat = CF_GRANITE_OUTER; } *************** *** 2149,2164 **** for (y = y1 - 1; y <= y2 + 1; y++) { c_ptr = &cave[y][x1-1]; ! c_ptr->feat = 0x39; c_ptr = &cave[y][x2+1]; ! c_ptr->feat = 0x39; } for (x = x1 - 1; x <= x2 + 1; x++) { c_ptr = &cave[y1-1][x]; ! c_ptr->feat = 0x39; c_ptr = &cave[y2+1][x]; ! c_ptr->feat = 0x39; } --- 2143,2158 ---- for (y = y1 - 1; y <= y2 + 1; y++) { c_ptr = &cave[y][x1-1]; ! c_ptr->feat = CF_GRANITE_INNER; c_ptr = &cave[y][x2+1]; ! c_ptr->feat = CF_GRANITE_INNER; } for (x = x1 - 1; x <= x2 + 1; x++) { c_ptr = &cave[y1-1][x]; ! c_ptr->feat = CF_GRANITE_INNER; c_ptr = &cave[y2+1][x]; ! c_ptr->feat = CF_GRANITE_INNER; } *************** *** 2555,2561 **** c_ptr = &cave[y][x]; /* Lay down a floor */ ! c_ptr->feat = 0x01; /* Part of a vault */ c_ptr->info |= (CAVE_ROOM | CAVE_ICKY); --- 2549,2555 ---- c_ptr = &cave[y][x]; /* Lay down a floor */ ! c_ptr->feat = CF_FLOOR; /* Part of a vault */ c_ptr->info |= (CAVE_ROOM | CAVE_ICKY); *************** *** 2565,2581 **** { /* Granite wall (outer) */ case '%': ! c_ptr->feat = 0x3A; break; /* Granite wall (inner) */ case '#': ! c_ptr->feat = 0x39; break; /* Permanent wall (inner) */ case 'X': ! c_ptr->feat = 0x3D; break; /* Treasure/trap */ --- 2559,2575 ---- { /* Granite wall (outer) */ case '%': ! c_ptr->feat = CF_GRANITE_OUTER; break; /* Granite wall (inner) */ case '#': ! c_ptr->feat = CF_GRANITE_INNER; break; /* Permanent wall (inner) */ case 'X': ! c_ptr->feat = CF_PERMANENT_INNER; break; /* Treasure/trap */ *************** *** 2718,2724 **** { vault_type *v_ptr; ! /* Pick a lesser vault */ while (TRUE) { /* Access a random vault record */ --- 2712,2718 ---- { vault_type *v_ptr; ! /* Pick a greater vault */ while (TRUE) { /* Access a random vault record */ *************** *** 2842,2857 **** /* Avoid the edge of the dungeon */ ! if (c_ptr->feat == 0x3F) continue; /* Avoid the edge of vaults */ ! if (c_ptr->feat == 0x3E) continue; /* Avoid "solid" granite walls */ ! if (c_ptr->feat == 0x3B) continue; /* Pierce "outer" walls of rooms */ ! if (c_ptr->feat == 0x3A) { /* Acquire the "next" location */ y = tmp_row + row_dir; --- 2836,2851 ---- /* Avoid the edge of the dungeon */ ! if (c_ptr->feat == CF_PERMANENT_SOLID) continue; /* Avoid the edge of vaults */ ! if (c_ptr->feat == CF_PERMANENT_OUTER) continue; /* Avoid "solid" granite walls */ ! if (c_ptr->feat == CF_GRANITE_SOLID) continue; /* Pierce "outer" walls of rooms */ ! if (c_ptr->feat == CF_GRANITE_OUTER) { /* Acquire the "next" location */ y = tmp_row + row_dir; *************** *** 2858,2869 **** x = tmp_col + col_dir; /* Hack -- Avoid outer/solid permanent walls */ ! if (cave[y][x].feat == 0x3F) continue; ! if (cave[y][x].feat == 0x3E) continue; /* Hack -- Avoid outer/solid granite walls */ ! if (cave[y][x].feat == 0x3A) continue; ! if (cave[y][x].feat == 0x3B) continue; /* Accept this location */ row1 = tmp_row; --- 2852,2863 ---- x = tmp_col + col_dir; /* Hack -- Avoid outer/solid permanent walls */ ! if (cave[y][x].feat == CF_PERMANENT_SOLID) continue; ! if (cave[y][x].feat == CF_PERMANENT_OUTER) continue; /* Hack -- Avoid outer/solid granite walls */ ! if (cave[y][x].feat == CF_GRANITE_OUTER) continue; ! if (cave[y][x].feat == CF_GRANITE_SOLID) continue; /* Accept this location */ row1 = tmp_row; *************** *** 2883,2892 **** for (x = col1 - 1; x <= col1 + 1; x++) { /* Convert adjacent "outer" walls as "solid" walls */ ! if (cave[y][x].feat == 0x3A) { /* Change the wall to a "solid" wall */ ! cave[y][x].feat = 0x3B; } } } --- 2877,2886 ---- for (x = col1 - 1; x <= col1 + 1; x++) { /* Convert adjacent "outer" walls as "solid" walls */ ! if (cave[y][x].feat == CF_GRANITE_OUTER) { /* Change the wall to a "solid" wall */ ! cave[y][x].feat = CF_GRANITE_SOLID; } } } *************** *** 2970,2976 **** c_ptr = &cave[y][x]; /* Clear previous contents, add a floor */ ! c_ptr->feat = 0x01; } --- 2964,2970 ---- c_ptr = &cave[y][x]; /* Clear previous contents, add a floor */ ! c_ptr->feat = CF_FLOOR; } *************** *** 2985,2991 **** c_ptr = &cave[y][x]; /* Clear previous contents, add up floor */ ! c_ptr->feat = 0x01; /* Occasional doorway */ if (rand_int(100) < DUN_TUN_PEN) --- 2979,2985 ---- c_ptr = &cave[y][x]; /* Clear previous contents, add up floor */ ! c_ptr->feat = CF_FLOOR; /* Occasional doorway */ if (rand_int(100) < DUN_TUN_PEN) *************** *** 3028,3034 **** c_ptr = &cave[y][x]; /* Skip non "empty floor" grids */ ! if (c_ptr->feat != 0x01) continue; /* Skip grids inside rooms */ if (c_ptr->info & CAVE_ROOM) continue; --- 3022,3028 ---- c_ptr = &cave[y][x]; /* Skip non "empty floor" grids */ ! if (c_ptr->feat != CF_FLOOR) continue; /* Skip grids inside rooms */ if (c_ptr->info & CAVE_ROOM) continue; *************** *** 3054,3068 **** if (next_to_corr(y, x) >= 2) { /* Check Vertical */ ! if ((cave[y-1][x].feat >= 0x32) && ! (cave[y+1][x].feat >= 0x32)) { return (TRUE); } /* Check Horizontal */ ! if ((cave[y][x-1].feat >= 0x32) && ! (cave[y][x+1].feat >= 0x32)) { return (TRUE); } --- 3048,3060 ---- if (next_to_corr(y, x) >= 2) { /* Check Vertical */ ! if ((cave[y-1][x].feat >= 0x32) && (cave[y+1][x].feat >= 0x32)) { return (TRUE); } /* Check Horizontal */ ! if ((cave[y][x-1].feat >= 0x32) && (cave[y][x+1].feat >= 0x32)) { return (TRUE); } *************** *** 3202,3208 **** cave_type *c_ptr = &cave[y][x]; /* Clear all features, set to granite */ ! c_ptr->feat = 0x38; } } --- 3194,3200 ---- cave_type *c_ptr = &cave[y][x]; /* Clear all features, set to granite */ ! c_ptr->feat = CF_GRANITE_BASIC; } } *************** *** 3309,3315 **** cave_type *c_ptr = &cave[0][x]; /* Clear previous contents, add "solid" perma-wall */ ! c_ptr->feat = 0x3F; } /* Special boundary walls -- Bottom */ --- 3301,3307 ---- cave_type *c_ptr = &cave[0][x]; /* Clear previous contents, add "solid" perma-wall */ ! c_ptr->feat = CF_PERMANENT_SOLID; } /* Special boundary walls -- Bottom */ *************** *** 3318,3324 **** cave_type *c_ptr = &cave[cur_hgt-1][x]; /* Clear previous contents, add "solid" perma-wall */ ! c_ptr->feat = 0x3F; } /* Special boundary walls -- Left */ --- 3310,3316 ---- cave_type *c_ptr = &cave[cur_hgt-1][x]; /* Clear previous contents, add "solid" perma-wall */ ! c_ptr->feat = CF_PERMANENT_SOLID; } /* Special boundary walls -- Left */ *************** *** 3327,3333 **** cave_type *c_ptr = &cave[y][0]; /* Clear previous contents, add "solid" perma-wall */ ! c_ptr->feat = 0x3F; } /* Special boundary walls -- Right */ --- 3319,3325 ---- cave_type *c_ptr = &cave[y][0]; /* Clear previous contents, add "solid" perma-wall */ ! c_ptr->feat = CF_PERMANENT_SOLID; } /* Special boundary walls -- Right */ *************** *** 3336,3342 **** cave_type *c_ptr = &cave[y][cur_wid-1]; /* Clear previous contents, add "solid" perma-wall */ ! c_ptr->feat = 0x3F; } --- 3328,3334 ---- cave_type *c_ptr = &cave[y][cur_wid-1]; /* Clear previous contents, add "solid" perma-wall */ ! c_ptr->feat = CF_PERMANENT_SOLID; } *************** *** 3393,3405 **** /* Hack -- Add some magma streamers */ for (i = 0; i < DUN_STR_MAG; i++) { ! build_streamer(0x32, DUN_STR_MC); } /* Hack -- Add some quartz streamers */ for (i = 0; i < DUN_STR_QUA; i++) { ! build_streamer(0x33, DUN_STR_QC); } --- 3385,3397 ---- /* Hack -- Add some magma streamers */ for (i = 0; i < DUN_STR_MAG; i++) { ! build_streamer(CF_MAGMA, DUN_STR_MC); } /* Hack -- Add some quartz streamers */ for (i = 0; i < DUN_STR_QUA; i++) { ! build_streamer(CF_QUARTZ, DUN_STR_QC); } *************** *** 3408,3417 **** /* Place 3 or 4 down stairs near some walls */ ! alloc_stairs(0x07, rand_range(3,4), 3); /* Place 1 or 2 up stairs near some walls */ ! alloc_stairs(0x06, rand_range(1,2), 3); /* Determine the character location */ --- 3400,3409 ---- /* Place 3 or 4 down stairs near some walls */ ! alloc_stairs(CF_STAIRS_DOWN, rand_range(3,4), 3); /* Place 1 or 2 up stairs near some walls */ ! alloc_stairs(CF_STAIRS_UP, rand_range(1,2), 3); /* Determine the character location */ *************** *** 3489,3495 **** c_ptr = &cave[y][x]; /* Clear previous contents, add "basic" perma-wall */ ! c_ptr->feat = 0x3C; /* Hack -- The buildings are illuminated and known */ c_ptr->info |= (CAVE_GLOW | CAVE_MARK); --- 3481,3487 ---- c_ptr = &cave[y][x]; /* Clear previous contents, add "basic" perma-wall */ ! c_ptr->feat = CF_PERMANENT_BASIC; /* Hack -- The buildings are illuminated and known */ c_ptr->info |= (CAVE_GLOW | CAVE_MARK); *************** *** 3607,3613 **** c_ptr = &cave[y][x]; /* Clear previous contents, add down stairs */ ! c_ptr->feat = 0x07; /* Memorize the stairs */ c_ptr->info |= CAVE_MARK; --- 3599,3605 ---- c_ptr = &cave[y][x]; /* Clear previous contents, add down stairs */ ! c_ptr->feat = CF_STAIRS_DOWN; /* Memorize the stairs */ c_ptr->info |= CAVE_MARK; *************** *** 3654,3660 **** cave_type *c_ptr = &cave[y][x]; /* Clear all features, set to "empty floor" */ ! c_ptr->feat = 0x01; } } --- 3646,3652 ---- cave_type *c_ptr = &cave[y][x]; /* Clear all features, set to "empty floor" */ ! c_ptr->feat = CF_FLOOR; } } *************** *** 3666,3672 **** c_ptr = &cave[0][x]; /* Clear previous contents, add "solid" perma-wall */ ! c_ptr->feat = 0x3F; /* Illuminate and memorize the walls */ c_ptr->info |= (CAVE_GLOW | CAVE_MARK); --- 3658,3664 ---- c_ptr = &cave[0][x]; /* Clear previous contents, add "solid" perma-wall */ ! c_ptr->feat = CF_PERMANENT_SOLID; /* Illuminate and memorize the walls */ c_ptr->info |= (CAVE_GLOW | CAVE_MARK); *************** *** 3675,3681 **** c_ptr = &cave[cur_hgt-1][x]; /* Clear previous contents, add "solid" perma-wall */ ! c_ptr->feat = 0x3F; /* Illuminate and memorize the walls */ c_ptr->info |= (CAVE_GLOW | CAVE_MARK); --- 3667,3673 ---- c_ptr = &cave[cur_hgt-1][x]; /* Clear previous contents, add "solid" perma-wall */ ! c_ptr->feat = CF_PERMANENT_SOLID; /* Illuminate and memorize the walls */ c_ptr->info |= (CAVE_GLOW | CAVE_MARK); *************** *** 3688,3694 **** c_ptr = &cave[y][0]; /* Clear previous contents, add "solid" perma-wall */ ! c_ptr->feat = 0x3F; /* Illuminate and memorize the walls */ c_ptr->info |= (CAVE_GLOW | CAVE_MARK); --- 3680,3686 ---- c_ptr = &cave[y][0]; /* Clear previous contents, add "solid" perma-wall */ ! c_ptr->feat = CF_PERMANENT_SOLID; /* Illuminate and memorize the walls */ c_ptr->info |= (CAVE_GLOW | CAVE_MARK); *************** *** 3697,3703 **** c_ptr = &cave[y][cur_wid-1]; /* Clear previous contents, add "solid" perma-wall */ ! c_ptr->feat = 0x3F; /* Illuminate and memorize the walls */ c_ptr->info |= (CAVE_GLOW | CAVE_MARK); --- 3689,3695 ---- c_ptr = &cave[y][cur_wid-1]; /* Clear previous contents, add "solid" perma-wall */ ! c_ptr->feat = CF_PERMANENT_SOLID; /* Illuminate and memorize the walls */ c_ptr->info |= (CAVE_GLOW | CAVE_MARK); *************** *** 3733,3739 **** /* Night Time */ else { - /* Make some night-time residents */ for (i = 0; i < MIN_M_ALLOC_TN; i++) (void)alloc_monster(3, TRUE); } --- 3725,3730 ---- *************** *** 3880,3886 **** } /* Mega-Hack -- allow "auto-scum" */ ! if (scum_always || (scum_sometimes && (num < 100))) { /* Require "goodness" */ if ((feeling > 9) || --- 3871,3877 ---- } /* Mega-Hack -- allow "auto-scum" */ ! if (autoscum) { /* Require "goodness" */ if ((feeling > 9) || *************** *** 3890,3899 **** ((dun_level >= 40) && (feeling > 5))) { /* Give message to cheaters */ ! if (cheat_room || cheat_hear || ! cheat_peek || cheat_xtra) { - /* Message */ why = "boring level"; } --- 3881,3888 ---- ((dun_level >= 40) && (feeling > 5))) { /* Give message to cheaters */ ! if (cheat_room || cheat_hear || cheat_peek || cheat_xtra) { why = "boring level"; } diff -w -c -r ick-279/h-config.h utumno/h-config.h No differences encountered diff -w -c -r ick-279/h-define.h utumno/h-define.h No differences encountered diff -w -c -r ick-279/h-system.h utumno/h-system.h *** ick-279/h-system.h Sat Apr 13 11:26:10 1996 --- utumno/h-system.h Sat May 3 22:34:28 1997 *************** *** 20,25 **** --- 20,29 ---- #include #include + #ifdef USE_IBM + #include + #endif + #if defined(NeXT) # include #else diff -w -c -r ick-279/h-type.h utumno/h-type.h *** ick-279/h-type.h Sat Apr 13 11:26:13 1996 --- utumno/h-type.h Sat May 10 23:36:28 1997 *************** *** 95,101 **** /* Note that a bool is smaller than a full "int" */ /* Simple True/False type */ ! typedef char bool; /* A signed, standard integer (at least 2 bytes) */ --- 95,101 ---- /* Note that a bool is smaller than a full "int" */ /* Simple True/False type */ ! typedef byte bool; /* A signed, standard integer (at least 2 bytes) */ diff -w -c -r ick-279/init1.c utumno/init1.c *** ick-279/init1.c Thu May 15 17:12:10 1997 --- utumno/init1.c Thu May 15 17:45:49 1997 *************** *** 232,243 **** "IM_COLD", "IM_POIS", "XXX5X3", ! "RES_NETH", ! "RES_WATE", ! "RES_PLAS", ! "RES_NEXU", ! "RES_DISE", ! "XXX6X3", "NO_FEAR", "NO_STUN", "NO_CONF", --- 232,243 ---- "IM_COLD", "IM_POIS", "XXX5X3", ! "RES_NETHER", ! "RES_WATER", ! "RES_PLASMA", ! "RES_NEXUS", ! "RES_DISEN", ! "RES_MAGIC", "NO_FEAR", "NO_STUN", "NO_CONF", *************** *** 394,400 **** "KILL_DRAGON", "XXX5", "IMPACT", ! "XXX6", "BRAND_ACID", "BRAND_ELEC", "BRAND_FIRE", --- 394,400 ---- "KILL_DRAGON", "XXX5", "IMPACT", ! "BRAND_POIS", "BRAND_ACID", "BRAND_ELEC", "BRAND_FIRE", *************** *** 558,572 **** /* Hack -- Process 'V' for "Version" */ if (buf[0] == 'V') { ! int v1, v2, v3; ! ! /* Scan for the values */ ! if ((3 != sscanf(buf, "V:%d.%d.%d", &v1, &v2, &v3)) || ! (v1 != v_head->v_major) || ! (v2 != v_head->v_minor) || ! (v3 != v_head->v_patch)) { ! return (2); } /* Okay to proceed */ --- 558,567 ---- /* Hack -- Process 'V' for "Version" */ if (buf[0] == 'V') { ! /* Verify the string */ ! if (strcmp(buf+2, VERSION_STRING)) { ! return 2; } /* Okay to proceed */ *************** *** 736,750 **** /* Hack -- Process 'V' for "Version" */ if (buf[0] == 'V') { ! int v1, v2, v3; ! ! /* Scan for the values */ ! if ((3 != sscanf(buf+2, "%d.%d.%d", &v1, &v2, &v3)) || ! (v1 != f_head->v_major) || ! (v2 != f_head->v_minor) || ! (v3 != f_head->v_patch)) { ! return (2); } /* Okay to proceed */ --- 731,740 ---- /* Hack -- Process 'V' for "Version" */ if (buf[0] == 'V') { ! /* Verify the string */ ! if (strcmp(buf+2, VERSION_STRING)) { ! return 2; } /* Okay to proceed */ *************** *** 974,988 **** /* Hack -- Process 'V' for "Version" */ if (buf[0] == 'V') { ! int v1, v2, v3; ! ! /* Scan for the values */ ! if ((3 != sscanf(buf+2, "%d.%d.%d", &v1, &v2, &v3)) || ! (v1 != k_head->v_major) || ! (v2 != k_head->v_minor) || ! (v3 != k_head->v_patch)) { ! return (2); } /* Okay to proceed */ --- 964,973 ---- /* Hack -- Process 'V' for "Version" */ if (buf[0] == 'V') { ! /* Verify the string */ ! if (strcmp(buf+2, VERSION_STRING)) { ! return 2; } /* Okay to proceed */ *************** *** 1324,1338 **** /* Hack -- Process 'V' for "Version" */ if (buf[0] == 'V') { ! int v1, v2, v3; ! ! /* Scan for the values */ ! if ((3 != sscanf(buf+2, "%d.%d.%d", &v1, &v2, &v3)) || ! (v1 != a_head->v_major) || ! (v2 != a_head->v_minor) || ! (v3 != a_head->v_patch)) { ! return (2); } /* Okay to proceed */ --- 1309,1318 ---- /* Hack -- Process 'V' for "Version" */ if (buf[0] == 'V') { ! /* Verify the string */ ! if (strcmp(buf+2, VERSION_STRING)) { ! return 2; } /* Okay to proceed */ *************** *** 1629,1643 **** /* Hack -- Process 'V' for "Version" */ if (buf[0] == 'V') { ! int v1, v2, v3; ! ! /* Scan for the values */ ! if ((3 != sscanf(buf+2, "%d.%d.%d", &v1, &v2, &v3)) || ! (v1 != e_head->v_major) || ! (v2 != e_head->v_minor) || ! (v3 != e_head->v_patch)) { ! return (2); } /* Okay to proceed */ --- 1609,1618 ---- /* Hack -- Process 'V' for "Version" */ if (buf[0] == 'V') { ! /* Verify the string */ ! if (strcmp(buf+2, VERSION_STRING)) { ! return 2; } /* Okay to proceed */ *************** *** 1989,2003 **** /* Hack -- Process 'V' for "Version" */ if (buf[0] == 'V') { ! int v1, v2, v3; ! ! /* Scan for the values */ ! if ((3 != sscanf(buf+2, "%d.%d.%d", &v1, &v2, &v3)) || ! (v1 != r_head->v_major) || ! (v2 != r_head->v_minor) || ! (v3 != r_head->v_patch)) { ! return (2); } /* Okay to proceed */ --- 1964,1973 ---- /* Hack -- Process 'V' for "Version" */ if (buf[0] == 'V') { ! /* Verify the string */ ! if (strcmp(buf+2, VERSION_STRING)) { ! return 2; } /* Okay to proceed */ diff -w -c -r ick-279/init2.c utumno/init2.c *** ick-279/init2.c Thu May 15 17:12:11 1997 --- utumno/init2.c Thu May 15 17:45:49 1997 *************** *** 496,502 **** f_head->v_major = VERSION_MAJOR; f_head->v_minor = VERSION_MINOR; f_head->v_patch = VERSION_PATCH; ! f_head->v_extra = 0; /* Save the "record" information */ f_head->info_num = MAX_F_IDX; --- 496,502 ---- f_head->v_major = VERSION_MAJOR; f_head->v_minor = VERSION_MINOR; f_head->v_patch = VERSION_PATCH; ! f_head->v_extra = VERSION_TYPE; /* Save the "record" information */ f_head->info_num = MAX_F_IDX; *************** *** 752,758 **** k_head->v_major = VERSION_MAJOR; k_head->v_minor = VERSION_MINOR; k_head->v_patch = VERSION_PATCH; ! k_head->v_extra = 0; /* Save the "record" information */ k_head->info_num = MAX_K_IDX; --- 752,758 ---- k_head->v_major = VERSION_MAJOR; k_head->v_minor = VERSION_MINOR; k_head->v_patch = VERSION_PATCH; ! k_head->v_extra = VERSION_TYPE; /* Save the "record" information */ k_head->info_num = MAX_K_IDX; *************** *** 1008,1014 **** a_head->v_major = VERSION_MAJOR; a_head->v_minor = VERSION_MINOR; a_head->v_patch = VERSION_PATCH; ! a_head->v_extra = 0; /* Save the "record" information */ a_head->info_num = MAX_A_IDX; --- 1008,1014 ---- a_head->v_major = VERSION_MAJOR; a_head->v_minor = VERSION_MINOR; a_head->v_patch = VERSION_PATCH; ! a_head->v_extra = VERSION_TYPE; /* Save the "record" information */ a_head->info_num = MAX_A_IDX; *************** *** 1264,1270 **** e_head->v_major = VERSION_MAJOR; e_head->v_minor = VERSION_MINOR; e_head->v_patch = VERSION_PATCH; ! e_head->v_extra = 0; /* Save the "record" information */ e_head->info_num = MAX_E_IDX; --- 1264,1270 ---- e_head->v_major = VERSION_MAJOR; e_head->v_minor = VERSION_MINOR; e_head->v_patch = VERSION_PATCH; ! e_head->v_extra = VERSION_TYPE; /* Save the "record" information */ e_head->info_num = MAX_E_IDX; *************** *** 1520,1526 **** r_head->v_major = VERSION_MAJOR; r_head->v_minor = VERSION_MINOR; r_head->v_patch = VERSION_PATCH; ! r_head->v_extra = 0; /* Save the "record" information */ r_head->info_num = MAX_R_IDX; --- 1520,1526 ---- r_head->v_major = VERSION_MAJOR; r_head->v_minor = VERSION_MINOR; r_head->v_patch = VERSION_PATCH; ! r_head->v_extra = VERSION_TYPE; /* Save the "record" information */ r_head->info_num = MAX_R_IDX; *************** *** 1775,1781 **** v_head->v_major = VERSION_MAJOR; v_head->v_minor = VERSION_MINOR; v_head->v_patch = VERSION_PATCH; ! v_head->v_extra = 0; /* Save the "record" information */ v_head->info_num = MAX_V_IDX; --- 1775,1781 ---- v_head->v_major = VERSION_MAJOR; v_head->v_minor = VERSION_MINOR; v_head->v_patch = VERSION_PATCH; ! v_head->v_extra = VERSION_TYPE; /* Save the "record" information */ v_head->info_num = MAX_V_IDX; *************** *** 1970,1980 **** { TV_CLOAK, SV_CLOAK }, { TV_CLOAK, SV_CLOAK }, { TV_CLOAK, SV_CLOAK }, { TV_POTION, SV_POTION_WATER }, { TV_POTION, SV_POTION_APPLE_JUICE }, - { TV_SPIKE, 0 }, - { TV_SPIKE, 0 }, - { TV_SPIKE, 0 }, { TV_LITE, SV_LITE_TORCH }, { TV_LITE, SV_LITE_TORCH }, { TV_LITE, SV_LITE_TORCH }, --- 1970,1980 ---- { TV_CLOAK, SV_CLOAK }, { TV_CLOAK, SV_CLOAK }, { TV_CLOAK, SV_CLOAK }, + { TV_CLOAK, SV_CLOAK }, { TV_POTION, SV_POTION_WATER }, + { TV_POTION, SV_POTION_WATER }, + { TV_POTION, SV_POTION_WATER }, { TV_POTION, SV_POTION_APPLE_JUICE }, { TV_LITE, SV_LITE_TORCH }, { TV_LITE, SV_LITE_TORCH }, { TV_LITE, SV_LITE_TORCH }, *************** *** 1990,1996 **** }, { ! /* Armoury */ { TV_BOOTS, SV_PAIR_OF_SOFT_LEATHER_BOOTS }, { TV_BOOTS, SV_PAIR_OF_SOFT_LEATHER_BOOTS }, { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS }, --- 1990,1996 ---- }, { ! /* Armory */ { TV_BOOTS, SV_PAIR_OF_SOFT_LEATHER_BOOTS }, { TV_BOOTS, SV_PAIR_OF_SOFT_LEATHER_BOOTS }, { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS }, *************** *** 2013,2019 **** { TV_HARD_ARMOR, SV_CHAIN_MAIL }, { TV_HARD_ARMOR, SV_AUGMENTED_CHAIN_MAIL }, { TV_HARD_ARMOR, SV_BAR_CHAIN_MAIL }, ! { TV_HARD_ARMOR, SV_METAL_BRIGANDINE_ARMOUR }, { TV_HARD_ARMOR, SV_DOUBLE_CHAIN_MAIL }, { TV_GLOVES, SV_SET_OF_LEATHER_GLOVES }, { TV_GLOVES, SV_SET_OF_LEATHER_GLOVES }, --- 2013,2019 ---- { TV_HARD_ARMOR, SV_CHAIN_MAIL }, { TV_HARD_ARMOR, SV_AUGMENTED_CHAIN_MAIL }, { TV_HARD_ARMOR, SV_BAR_CHAIN_MAIL }, ! { TV_HARD_ARMOR, SV_METAL_BRIGANDINE_ARMOR }, { TV_HARD_ARMOR, SV_DOUBLE_CHAIN_MAIL }, { TV_GLOVES, SV_SET_OF_LEATHER_GLOVES }, { TV_GLOVES, SV_SET_OF_LEATHER_GLOVES }, *************** *** 2431,2450 **** /*** Pre-allocate the basic "auto-inscriptions" ***/ /* The "basic" feelings */ ! (void)quark_add("cursed"); ! (void)quark_add("broken"); ! (void)quark_add("average"); ! (void)quark_add("good"); /* The "extra" feelings */ ! (void)quark_add("excellent"); ! (void)quark_add("worthless"); ! (void)quark_add("special"); ! (void)quark_add("terrible"); /* Some extra strings */ ! (void)quark_add("uncursed"); ! (void)quark_add("on sale"); /*** Set the "default" options ***/ --- 2431,2450 ---- /*** Pre-allocate the basic "auto-inscriptions" ***/ /* The "basic" feelings */ ! quark_add("cursed"); ! quark_add("broken"); ! quark_add("average"); ! quark_add("good"); /* The "extra" feelings */ ! quark_add("excellent"); ! quark_add("worthless"); ! quark_add("special"); ! quark_add("terrible"); /* Some extra strings */ ! quark_add("uncursed"); ! quark_add("on sale"); /*** Set the "default" options ***/ *************** *** 2460,2466 **** /*** Pre-allocate space for the "format()" buffer ***/ /* Hack -- Just call the "format()" function */ ! (void)format("%s (%s).", "Ben Harrison", MAINTAINER); /*** Pre-allocate space for save/restore screen ***/ --- 2460,2466 ---- /*** Pre-allocate space for the "format()" buffer ***/ /* Hack -- Just call the "format()" function */ ! format("%s (%s).", "Matt Craighead", MAINTAINER); /*** Pre-allocate space for save/restore screen ***/ Only in utumno: load.c Only in ick-279: load1.c Only in ick-279: load2.c diff -w -c -r ick-279/main-acn.c utumno/main-acn.c *** ick-279/main-acn.c Thu May 15 17:12:12 1997 --- utumno/main-acn.c Thu May 15 17:45:50 1997 *************** *** 1363,1370 **** int x0, x1, y0, y1, x, y, rx, ry, c; int ox; int nodither = solid_colours || ncolours > 255; ! static char olddef[10]={23,135}; ! const static char blockdef[10]={23,135,255,255,255,255,255,255,255,255}; char **ch=t->t.old->c; byte **a=t->t.old->a; char buf[80]; --- 1363,1372 ---- int x0, x1, y0, y1, x, y, rx, ry, c; int ox; int nodither = solid_colours || ncolours > 255; ! static char olddef[10]= ! {23,135}; ! const static char blockdef[10]= ! {23,135,255,255,255,255,255,255,255,255}; char **ch=t->t.old->c; byte **a=t->t.old->a; char buf[80]; *************** *** 1853,1859 **** os_error *r; const ! static wimp_MESSAGE_LIST(7) messages={message_PREQUIT, message_PALETTE_CHANGE, message_MODE_CHANGE, message_DATA_LOAD, --- 1855,1862 ---- os_error *r; const ! static wimp_MESSAGE_LIST(7) messages= ! {message_PREQUIT, message_PALETTE_CHANGE, message_MODE_CHANGE, message_DATA_LOAD, *************** *** 1862,1868 **** 0}; const ! static toolbox_ACTION_LIST(27) action_nos={action_ERROR, action_OBJECT_AUTO_CREATED, action_MENU_ABOUT_TO_BE_SHOWN, action_MENU_SELECTION, --- 1865,1872 ---- 0}; const ! static toolbox_ACTION_LIST(27) action_nos= ! {action_ERROR, action_OBJECT_AUTO_CREATED, action_MENU_ABOUT_TO_BE_SHOWN, action_MENU_SELECTION, diff -w -c -r ick-279/main-ami.c utumno/main-ami.c *** ick-279/main-ami.c Thu May 15 17:12:12 1997 --- utumno/main-ami.c Thu May 15 17:45:50 1997 *************** *** 8,14 **** Author: Lars Haugseth Email: larshau@ifi.uio.no ! WWW: http://www.ifi.uio.no/~larshau */ --- 8,14 ---- Author: Lars Haugseth Email: larshau@ifi.uio.no ! WWW: http:/* www.ifi.uio.no/~larshau */ */ *************** *** 16,22 **** #define VERSION "Angband 2.7.9v4" ! ///{ "includes" #include "angband.h" #include #include --- 16,23 ---- #define VERSION "Angband 2.7.9v4" ! /* / ! { "includes" */ #include "angband.h" #include #include *************** *** 33,45 **** #include #include #include ! ///} ! ///{ "macros" #define PEN(p) ((usewb||use_graphics)?penconv[p]:p) #define GPEN(p) (usewb?wbpens[16+p]:p) #define FAIL(str) return(amiga_fail(str)) ! ///} ! ///{ "defines" #define CURSOR_PEN 4 #define TILEW 8 --- 34,48 ---- #include #include #include ! /* /} */ ! /* / ! { "macros" */ #define PEN(p) ((usewb||use_graphics)?penconv[p]:p) #define GPEN(p) (usewb?wbpens[16+p]:p) #define FAIL(str) return(amiga_fail(str)) ! /* /} */ ! /* / ! { "defines" */ #define CURSOR_PEN 4 #define TILEW 8 *************** *** 53,65 **** #define MY 2 #define MGFX "Angband:xtra/gfx-ami.raw" ! ///} ! ///{ "globals" ! // Are we active? Not really needed. static int active = FALSE; ! // The main screen static term term_screen_body; ! // Amiga specific stuff struct Library *DiskfontBase = NULL; struct Library *KeymapBase = NULL; static struct Screen *amiscr = NULL; --- 56,69 ---- #define MY 2 #define MGFX "Angband:xtra/gfx-ami.raw" ! /* /} */ ! /* / ! { "globals" */ ! /* Are we active? Not really needed. */ static int active = FALSE; ! /* The main screen */ static term term_screen_body; ! /* Amiga specific stuff */ struct Library *DiskfontBase = NULL; struct Library *KeymapBase = NULL; static struct Screen *amiscr = NULL; *************** *** 101,110 **** static int v39 = FALSE; static int usewb = FALSE; static int wblock = FALSE; ! static __chip UWORD blankpointer[] = {0,0,0,0,0,0,0,0}; ! static UWORD amipens[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0xffff}; ! static UWORD penconv[] = {0,1,2,4,11,15,9,6,3,1,13,4,11,15,8,5,0xffff}; ! static LONG wbpens[] = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}; static ULONG default_colors[] = { 0x000000, 0xffffff, 0xc7c7c7, 0xff9200, --- 105,118 ---- static int v39 = FALSE; static int usewb = FALSE; static int wblock = FALSE; ! static __chip UWORD blankpointer[] = ! {0,0,0,0,0,0,0,0}; ! static UWORD amipens[] = ! {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0xffff}; ! static UWORD penconv[] = ! {0,1,2,4,11,15,9,6,3,1,13,4,11,15,8,5,0xffff}; ! static LONG wbpens[] = ! {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}; static ULONG default_colors[] = { 0x000000, 0xffffff, 0xc7c7c7, 0xff9200, *************** *** 127,134 **** static int tmp_w; static int pointer_visible = TRUE; static char ver[] = "$VER: " VERSION " (" __DATE__ ")"; ! ///} ! ///{ "prototypes" extern void map_info(int y, int x, byte *ap, char *cp); errr init_ami(void); static void amiga_open(term *t); --- 135,143 ---- static int tmp_w; static int pointer_visible = TRUE; static char ver[] = "$VER: " VERSION " (" __DATE__ ")"; ! /* /} */ ! /* / ! { "prototypes" */ extern void map_info(int y, int x, byte *ap, char *cp); errr init_ami(void); static void amiga_open(term *t); *************** *** 149,157 **** void put_gfx(int x, int y, int chr, int col); void cursor_anim(void); void load_palette(void); ! ///} ! ///{ "init_ami()" - Initialize all Amiga specific stuff errr init_ami(void) { term *t = &term_screen_body; --- 158,167 ---- void put_gfx(int x, int y, int chr, int col); void cursor_anim(void); void load_palette(void); ! /* /} */ ! /* / ! { "init_ami()" - Initialize all Amiga specific stuff */ errr init_ami(void) { term *t = &term_screen_body; *************** *** 160,175 **** int i; LONG pen; ! // We *must* have kickstart 37 or later if(IntuitionBase->LibNode.lib_Version < 37) { FAIL("Sorry, this program requires KickStart 2.04 or later."); } ! // Check if we have kickstart 39 or later v39 = (IntuitionBase->LibNode.lib_Version >=39); ! // Initialize keyboard stuff ie.ie_NextEvent = NULL; ie.ie_Class = IECLASS_RAWKEY; ie.ie_SubClass = 0; --- 170,185 ---- int i; LONG pen; ! /* We *must* have kickstart 37 or later */ if(IntuitionBase->LibNode.lib_Version < 37) { FAIL("Sorry, this program requires KickStart 2.04 or later."); } ! /* Check if we have kickstart 39 or later */ v39 = (IntuitionBase->LibNode.lib_Version >=39); ! /* Initialize keyboard stuff */ ie.ie_NextEvent = NULL; ie.ie_Class = IECLASS_RAWKEY; ie.ie_SubClass = 0; *************** *** 176,182 **** if((KeymapBase=OpenLibrary("keymap.library",36))==NULL) FAIL("Unable to open keymap.library v36+\n"); ! // Check if user want to use graphics if(GetVar("ANGBAND_NOGFX",tmpstr,256,0)>=0) { use_graphics=FALSE; --- 186,192 ---- if((KeymapBase=OpenLibrary("keymap.library",36))==NULL) FAIL("Unable to open keymap.library v36+\n"); ! /* Check if user want to use graphics */ if(GetVar("ANGBAND_NOGFX",tmpstr,256,0)>=0) { use_graphics=FALSE; *************** *** 186,195 **** use_graphics=TRUE; } ! // Initialize color palette for(i=0; i<32; i++) { ! // If undefined, use default palette if(color_table[i][0]==0 && color_table[i][1]==0 && color_table[i][2]==0 && color_table[i][3]==0) { color_table[i][0] = 1; --- 196,205 ---- use_graphics=TRUE; } ! /* Initialize color palette */ for(i=0; i<32; i++) { ! /* If undefined, use default palette */ if(color_table[i][0]==0 && color_table[i][1]==0 && color_table[i][2]==0 && color_table[i][3]==0) { color_table[i][0] = 1; *************** *** 199,208 **** } } ! // Search for prefered screenmode if(GetVar("ANGBAND_MODEID",tmpstr,256,0)>0) { ! // Use workbench if(!stricmp(tmpstr,"workbench")) { if(!v39) --- 209,218 ---- } } ! /* Search for prefered screenmode */ if(GetVar("ANGBAND_MODEID",tmpstr,256,0)>0) { ! /* Use workbench */ if(!stricmp(tmpstr,"workbench")) { if(!v39) *************** *** 212,224 **** scr_m=-1; usewb=TRUE; use_chunky=use_graphics; ! // Get a lock on the workbench screen if((wbscr=LockPubScreen("Workbench"))==NULL) { FAIL("Unable to get a lock on the Workbench screen.\n"); } wblock=TRUE; ! // Find suitable pens to use on public screen for(i=0; i<32; i++) { pen=ObtainBestPen(wbscr->ViewPort.ColorMap, --- 222,234 ---- scr_m=-1; usewb=TRUE; use_chunky=use_graphics; ! /* Get a lock on the workbench screen */ if((wbscr=LockPubScreen("Workbench"))==NULL) { FAIL("Unable to get a lock on the Workbench screen.\n"); } wblock=TRUE; ! /* Find suitable pens to use on public screen */ for(i=0; i<32; i++) { pen=ObtainBestPen(wbscr->ViewPort.ColorMap, *************** *** 233,239 **** wbpens[i]=pen; } for(i=0; i<16; i++) penconv[i]=(UWORD)wbpens[i]; ! // Use specified screenmode } else { --- 243,249 ---- wbpens[i]=pen; } for(i=0; i<16; i++) penconv[i]=(UWORD)wbpens[i]; ! /* Use specified screenmode */ } else { *************** *** 242,248 **** } } ! // Search for prefered font, and open it if(GetVar("ANGBAND_FONT",tmpstr,256,0)>0) { if(s=strchr(tmpstr,' ')) --- 252,258 ---- } } ! /* Search for prefered font, and open it */ if(GetVar("ANGBAND_FONT",tmpstr,256,0)>0) { if(s=strchr(tmpstr,' ')) *************** *** 267,273 **** } } ! // If font not available, use default font if(font==NULL) { font=GfxBase->DefaultFont; --- 277,283 ---- } } ! /* If font not available, use default font */ if(font==NULL) { font=GfxBase->DefaultFont; *************** *** 278,300 **** font_h = font->tf_YSize; font_b = font->tf_Baseline; ! // Calculate screen/window dimensions scr_w = 80*font_w; if(!usewb && scr_w<640) scr_w = 640; scr_h = 24*font_h; if(!usewb && scr_h<200) scr_h = 200; ! // Find a nice screenmode if(scr_m==0 && v39) { scr_m = BestModeID(BIDTAG_NominalWidth, scr_w, BIDTAG_NominalHeight, scr_h, BIDTAG_Depth, 4, TAG_END); } ! // Use default screenmode if(scr_m==0 || scr_m==INVALID_ID) { scr_m = (DEFAULT_MONITOR_ID | HIRES_KEY); } ! // Open intuition screen if(!usewb) { if((amiscr=OpenScreenTags(NULL, --- 288,310 ---- font_h = font->tf_YSize; font_b = font->tf_Baseline; ! /* Calculate screen/window dimensions */ scr_w = 80*font_w; if(!usewb && scr_w<640) scr_w = 640; scr_h = 24*font_h; if(!usewb && scr_h<200) scr_h = 200; ! /* Find a nice screenmode */ if(scr_m==0 && v39) { scr_m = BestModeID(BIDTAG_NominalWidth, scr_w, BIDTAG_NominalHeight, scr_h, BIDTAG_Depth, 4, TAG_END); } ! /* Use default screenmode */ if(scr_m==0 || scr_m==INVALID_ID) { scr_m = (DEFAULT_MONITOR_ID | HIRES_KEY); } ! /* Open intuition screen */ if(!usewb) { if((amiscr=OpenScreenTags(NULL, *************** *** 318,328 **** } else { ! // Check if it is large enough if(wbscr->Width < scr_w || wbscr->Height < scr_h) FAIL("Workbench screen is too small.\n"); } ! // Open intuition backdrop window if((amiwin=OpenWindowTags(NULL, WA_Left, 0, WA_Top, 0, --- 328,338 ---- } else { ! /* Check if it is large enough */ if(wbscr->Width < scr_w || wbscr->Height < scr_h) FAIL("Workbench screen is too small.\n"); } ! /* Open intuition backdrop window */ if((amiwin=OpenWindowTags(NULL, WA_Left, 0, WA_Top, 0, *************** *** 345,351 **** FAIL("Unable to open window."); } ! // Unlock public screen if(wblock) { UnlockPubScreen(NULL,wbscr); --- 355,361 ---- FAIL("Unable to open window."); } ! /* Unlock public screen */ if(wblock) { UnlockPubScreen(NULL,wbscr); *************** *** 352,361 **** wblock=FALSE; } ! // Create palette for screen load_palette(); ! // Initialize rastport rp=amiwin->RPort; SetAPen(rp,1); SetBPen(rp,0); --- 362,371 ---- wblock=FALSE; } ! /* Create palette for screen */ load_palette(); ! /* Initialize rastport */ rp=amiwin->RPort; SetAPen(rp,1); SetBPen(rp,0); *************** *** 362,368 **** SetDrMd(rp,JAM2); if(ownfont && font) SetFont(rp,font); ! // Initialize chunky graphics if(use_chunky) { tmp_w = ((font_w+15)>>4)<<4; --- 372,378 ---- SetDrMd(rp,JAM2); if(ownfont && font) SetFont(rp,font); ! /* Initialize chunky graphics */ if(use_chunky) { tmp_w = ((font_w+15)>>4)<<4; *************** *** 375,381 **** for(i=0; i<8; i++) tmpRastPort.BitMap->Planes[i]=tmpPlanes[i]; } ! // Load graphics if(use_graphics) { if(!load_gfx()) --- 385,391 ---- for(i=0; i<8; i++) tmpRastPort.BitMap->Planes[i]=tmpPlanes[i]; } ! /* Load graphics */ if(use_graphics) { if(!load_gfx()) *************** *** 384,390 **** } } ! // Convert graphics to chunky format if(use_chunky) { if(!conv_gfx()) --- 394,400 ---- } } ! /* Convert graphics to chunky format */ if(use_chunky) { if(!conv_gfx()) *************** *** 393,405 **** } } ! // Fill window with color 0 if(usewb) { SetAPen(rp,PEN(0)); RectFill(rp,0,0,scr_w-1,scr_h-1); } ! // Clear display memory for(x=0; x<80; x++) { for(y=0; y<24; y++) --- 403,415 ---- } } ! /* Fill window with color 0 */ if(usewb) { SetAPen(rp,PEN(0)); RectFill(rp,0,0,scr_w-1,scr_h-1); } ! /* Clear display memory */ for(x=0; x<80; x++) { for(y=0; y<24; y++) *************** *** 409,467 **** } } ! // Bring screen to front if(usewb) WBenchToFront(); else ScreenToFront(amiscr); ! // Initialize the term term_init(t,80,24,64); ! // Hack -- shutdown hook t->init_hook = amiga_open; t->nuke_hook = amiga_nuke; ! // Stick in some hooks t->text_hook = amiga_text; t->wipe_hook = amiga_wipe; t->curs_hook = amiga_curs; t->xtra_hook = amiga_xtra; ! // Save the term term_screen = t; ! // Activate it Term_activate(term_screen); ! // Success return(0); } ! ///} ! ///{ "amiga_nuke()" - Free all allocated resources static void amiga_nuke(term *t) { amiga_fail(NULL); ! // Flush the output fflush(stdout); ! // No longer active active=FALSE; } ! ///} ! ///{ "amiga_open()" - Initialize terminal static void amiga_open(term *t) { ! // Assume active active=TRUE; } ! ///} ! ///{ "amiga_curs()" - Move the cursor to a new location static errr amiga_curs(int x, int y) { ! // Literally move the cursor cursor_off(); cursor_xpos = x; cursor_ypos = y; cursor_frame = 0; if(cursor_visible) cursor_on(); ! // Success return(0); } ! ///} ! ///{ "amiga_wipe()" - Erase a rectangular area static errr amiga_wipe(int x, int y, int n) { int xx; --- 419,481 ---- } } ! /* Bring screen to front */ if(usewb) WBenchToFront(); else ScreenToFront(amiscr); ! /* Initialize the term */ term_init(t,80,24,64); ! /* Hack -- shutdown hook */ t->init_hook = amiga_open; t->nuke_hook = amiga_nuke; ! /* Stick in some hooks */ t->text_hook = amiga_text; t->wipe_hook = amiga_wipe; t->curs_hook = amiga_curs; t->xtra_hook = amiga_xtra; ! /* Save the term */ term_screen = t; ! /* Activate it */ Term_activate(term_screen); ! /* Success */ return(0); } ! /* /} */ ! /* / ! { "amiga_nuke()" - Free all allocated resources */ static void amiga_nuke(term *t) { amiga_fail(NULL); ! /* Flush the output */ fflush(stdout); ! /* No longer active */ active=FALSE; } ! /* /} */ ! /* / ! { "amiga_open()" - Initialize terminal */ static void amiga_open(term *t) { ! /* Assume active */ active=TRUE; } ! /* /} */ ! /* / ! { "amiga_curs()" - Move the cursor to a new location */ static errr amiga_curs(int x, int y) { ! /* Literally move the cursor */ cursor_off(); cursor_xpos = x; cursor_ypos = y; cursor_frame = 0; if(cursor_visible) cursor_on(); ! /* Success */ return(0); } ! /* /} */ ! /* / ! { "amiga_wipe()" - Erase a rectangular area */ static errr amiga_wipe(int x, int y, int n) { int xx; *************** *** 468,474 **** if((n>0) && !iconified) { ! // Erase rectangular area on screen if(usewb) { SetAPen(rp,PEN(0)); --- 482,488 ---- if((n>0) && !iconified) { ! /* Erase rectangular area on screen */ if(usewb) { SetAPen(rp,PEN(0)); *************** *** 475,481 **** RectFill(rp,x*font_w,y*font_h,(x+n)*font_w-1,(y+1)*font_h-1); } else EraseRect(rp,x*font_w,y*font_h,(x+n)*font_w-1,(y+1)*font_h-1); ! // Erase memory for(xx=x; xx<(x+n); xx++) { chrmem[xx][y]=' '; --- 489,495 ---- RectFill(rp,x*font_w,y*font_h,(x+n)*font_w-1,(y+1)*font_h-1); } else EraseRect(rp,x*font_w,y*font_h,(x+n)*font_w-1,(y+1)*font_h-1); ! /* Erase memory */ for(xx=x; xx<(x+n); xx++) { chrmem[xx][y]=' '; *************** *** 482,499 **** colmem[xx][y]=0; } } ! // Success return(0); } ! ///} ! ///{ "amiga_clear()" - Clear whole window static errr amiga_clear(void) { int x,y; ! // Fill window with background color SetRast(rp,PEN(0)); ! // Fill screen memory with blanks for(x=0; x<80; x++) { for(y=0; y<24; y++) --- 496,514 ---- colmem[xx][y]=0; } } ! /* Success */ return(0); } ! /* /} */ ! /* / ! { "amiga_clear()" - Clear whole window */ static errr amiga_clear(void) { int x,y; ! /* Fill window with background color */ SetRast(rp,PEN(0)); ! /* Fill screen memory with blanks */ for(x=0; x<80; x++) { for(y=0; y<24; y++) *************** *** 502,512 **** colmem[x][y]=0; } } ! // Success return(0); } ! ///} ! ///{ "amiga_text()" - Place some text on the screen using an attribute static errr amiga_text(int x, int y, int n, byte a, cptr s) { int i; --- 517,528 ---- colmem[x][y]=0; } } ! /* Success */ return(0); } ! /* /} */ ! /* / ! { "amiga_text()" - Place some text on the screen using an attribute */ static errr amiga_text(int x, int y, int n, byte a, cptr s) { int i; *************** *** 513,524 **** if(x>=0 && y>=0 && n>0 && !iconified) { ! // Clear cursor cursor_off(); ! // Update cursor position cursor_xpos = x; cursor_ypos = y; ! // Draw gfx one char at a time if(a&0xc0 && use_graphics) { for(i=0; i=0 && y>=0 && n>0 && !iconified) { ! /* Clear cursor */ cursor_off(); ! /* Update cursor position */ cursor_xpos = x; cursor_ypos = y; ! /* Draw gfx one char at a time */ if(a&0xc0 && use_graphics) { for(i=0; iUserPort)) ReplyMsg((struct Message *)imsg); return(1); } ! ///} ! ///{ "amiga_event()" - Wait for an event, and handle it. static errr amiga_event(int v) { struct IntuiMessage *imsg; --- 587,624 ---- cursor_visible=FALSE; } return(0); ! /* Wait for event */ case TERM_XTRA_EVENT: return(amiga_event(v)); ! /* Flush input */ case TERM_XTRA_FLUSH: return(amiga_flush(v)); ! /* Flush input */ case TERM_XTRA_REACT: return(amiga_react(v)); ! /* Unknown request type */ default: return(1); } ! /* Shouldn't be able to get here */ return(1); } ! /* /} */ ! /* / ! { "amiga_flush()" - Flush input buffer */ static errr amiga_flush(int v) { struct IntuiMessage *imsg; ! /* Ignore all messages at the port */ while(imsg=(struct IntuiMessage *)GetMsg(amiwin->UserPort)) ReplyMsg((struct Message *)imsg); return(1); } ! /* /} */ ! /* / ! { "amiga_event()" - Wait for an event, and handle it. */ static errr amiga_event(int v) { struct IntuiMessage *imsg; *************** *** 610,648 **** char buf[80]; int i,len; ! // Check for messages to the window if((imsg=(struct IntuiMessage *)GetMsg(amiwin->UserPort))==NULL) { ! // If we don't want blocking, return if(!v) return(0); ! // No messages, so wait for one Wait(1<UserPort->mp_SigBit); imsg=(struct IntuiMessage *)GetMsg(amiwin->UserPort); } if(imsg) { ! // Get message attributes iclass=imsg->Class; icode=imsg->Code; iqual=imsg->Qualifier; iaddr=imsg->IAddress; ! // Reply the message ReplyMsg((struct Message *)imsg); ! // Do we have a keypress? if(iclass==IDCMP_RAWKEY) { ! // Use a blank mouse-pointer on this window if(!usewb && pointer_visible) { SetPointer(amiwin,blankpointer,2,16,0,0); pointer_visible=FALSE; } ! // Convert raw keycode to ANSI sequence ie.ie_Code = icode; ie.ie_Qualifier = iqual; ie.ie_EventAddress = (APTR *) *((ULONG *)iaddr); len=MapRawKey(&ie,buf,80,NULL); ! // Send ANSI sequence to meta-terminal for(i=0; iUserPort))==NULL) { ! /* If we don't want blocking, return */ if(!v) return(0); ! /* No messages, so wait for one */ Wait(1<UserPort->mp_SigBit); imsg=(struct IntuiMessage *)GetMsg(amiwin->UserPort); } if(imsg) { ! /* Get message attributes */ iclass=imsg->Class; icode=imsg->Code; iqual=imsg->Qualifier; iaddr=imsg->IAddress; ! /* Reply the message */ ReplyMsg((struct Message *)imsg); ! /* Do we have a keypress? */ if(iclass==IDCMP_RAWKEY) { ! /* Use a blank mouse-pointer on this window */ if(!usewb && pointer_visible) { SetPointer(amiwin,blankpointer,2,16,0,0); pointer_visible=FALSE; } ! /* Convert raw keycode to ANSI sequence */ ie.ie_Code = icode; ie.ie_Qualifier = iqual; ie.ie_EventAddress = (APTR *) *((ULONG *)iaddr); len=MapRawKey(&ie,buf,80,NULL); ! /* Send ANSI sequence to meta-terminal */ for(i=0; i 8) mpt_w = 8; --- 765,775 ---- struct BitMap *tmpbm; struct BitScaleArgs bsa; ! /* Calculate tile bitmap dimensions */ gfx_w = 32 * font_w; gfx_h = 32 * font_h; ! /* Calculate map bitmap dimensions */ mpt_w = (80 * font_w) / MAX_WID; mpt_h = (24 * font_h) / MAX_HGT; if(mpt_w > 8) mpt_w = 8; *************** *** 754,775 **** map_w = mpt_w * 32; map_h = mpt_h * 32; ! // Allocate bitmap and bitplanes if(v39) { ! // Allocate temp bitmap with bitplanes if((tmpbm=AllocBitMap(GFXW,GFXH,5,BMF_INTERLEAVED,rp->BitMap))==NULL) { fprintf(stderr,"Unable to allocate temp bitmap.\n"); return(FALSE); } ! // Allocate tile bitmap with bitplanes if((gfxbm=AllocBitMap(gfx_w,gfx_h,5,BMF_INTERLEAVED,rp->BitMap))==NULL) { fprintf(stderr,"Unable to allocate tile bitmap.\n"); return(FALSE); } ! // Allocate map bitmap with bitplanes if((mapbm=AllocBitMap(map_w,map_h,5,BMF_INTERLEAVED,rp->BitMap))==NULL) { fprintf(stderr,"Unable to allocate map bitmap.\n"); --- 777,798 ---- map_w = mpt_w * 32; map_h = mpt_h * 32; ! /* Allocate bitmap and bitplanes */ if(v39) { ! /* Allocate temp bitmap with bitplanes */ if((tmpbm=AllocBitMap(GFXW,GFXH,5,BMF_INTERLEAVED,rp->BitMap))==NULL) { fprintf(stderr,"Unable to allocate temp bitmap.\n"); return(FALSE); } ! /* Allocate tile bitmap with bitplanes */ if((gfxbm=AllocBitMap(gfx_w,gfx_h,5,BMF_INTERLEAVED,rp->BitMap))==NULL) { fprintf(stderr,"Unable to allocate tile bitmap.\n"); return(FALSE); } ! /* Allocate map bitmap with bitplanes */ if((mapbm=AllocBitMap(map_w,map_h,5,BMF_INTERLEAVED,rp->BitMap))==NULL) { fprintf(stderr,"Unable to allocate map bitmap.\n"); *************** *** 778,793 **** } else { ! // Allocate temp bitmap structure if((tmpbm=AllocMem(sizeof(struct BitMap), MEMF_PUBLIC))==NULL) { fprintf(stderr,"Unable to allocate temp bitmap.\n"); return(FALSE); } ! // Initialize temp bitmap structure InitBitMap(tmpbm,5,GFXW,GFXH); for(plane=0; plane<5; tmpbm->Planes[plane++]=0); ! // Allocate bitplanes for the bitmap for(plane=0; plane<5; plane++) { if((p=AllocRaster(GFXW,GFXH))==NULL) --- 801,816 ---- } else { ! /* Allocate temp bitmap structure */ if((tmpbm=AllocMem(sizeof(struct BitMap), MEMF_PUBLIC))==NULL) { fprintf(stderr,"Unable to allocate temp bitmap.\n"); return(FALSE); } ! /* Initialize temp bitmap structure */ InitBitMap(tmpbm,5,GFXW,GFXH); for(plane=0; plane<5; tmpbm->Planes[plane++]=0); ! /* Allocate bitplanes for the bitmap */ for(plane=0; plane<5; plane++) { if((p=AllocRaster(GFXW,GFXH))==NULL) *************** *** 797,812 **** } tmpbm->Planes[plane]=p; } ! // Allocate tile bitmap structure if((gfxbm=AllocMem(sizeof(struct BitMap), MEMF_PUBLIC))==NULL) { fprintf(stderr,"Unable to allocate tile bitmap.\n"); return(FALSE); } ! // Initialize tile bitmap structure InitBitMap(gfxbm,5,gfx_w,gfx_h); for(plane=0; plane<5; gfxbm->Planes[plane++]=0); ! // Allocate bitplanes for the bitmap for(plane=0; plane<5; plane++) { if((p=AllocRaster(gfx_w,gfx_h))==NULL) --- 820,835 ---- } tmpbm->Planes[plane]=p; } ! /* Allocate tile bitmap structure */ if((gfxbm=AllocMem(sizeof(struct BitMap), MEMF_PUBLIC))==NULL) { fprintf(stderr,"Unable to allocate tile bitmap.\n"); return(FALSE); } ! /* Initialize tile bitmap structure */ InitBitMap(gfxbm,5,gfx_w,gfx_h); for(plane=0; plane<5; gfxbm->Planes[plane++]=0); ! /* Allocate bitplanes for the bitmap */ for(plane=0; plane<5; plane++) { if((p=AllocRaster(gfx_w,gfx_h))==NULL) *************** *** 816,831 **** } gfxbm->Planes[plane]=p; } ! // Allocate map bitmap structure if((mapbm=AllocMem(sizeof(struct BitMap), MEMF_PUBLIC))==NULL) { fprintf(stderr,"Unable to allocate tile bitmap.\n"); return(FALSE); } ! // Initialize tile bitmap structure InitBitMap(mapbm,5,map_w,map_h); for(plane=0; plane<5; mapbm->Planes[plane++]=0); ! // Allocate bitplanes for the bitmap for(plane=0; plane<5; plane++) { if((p=AllocRaster(map_w,map_h))==NULL) --- 839,854 ---- } gfxbm->Planes[plane]=p; } ! /* Allocate map bitmap structure */ if((mapbm=AllocMem(sizeof(struct BitMap), MEMF_PUBLIC))==NULL) { fprintf(stderr,"Unable to allocate tile bitmap.\n"); return(FALSE); } ! /* Initialize tile bitmap structure */ InitBitMap(mapbm,5,map_w,map_h); for(plane=0; plane<5; mapbm->Planes[plane++]=0); ! /* Allocate bitplanes for the bitmap */ for(plane=0; plane<5; plane++) { if((p=AllocRaster(map_w,map_h))==NULL) *************** *** 837,843 **** } } ! // Open file if((file=Open(MGFX,MODE_OLDFILE))==NULL) { fprintf(stderr,"Unable to open graphics file.\n"); --- 860,866 ---- } } ! /* Open file */ if((file=Open(MGFX,MODE_OLDFILE))==NULL) { fprintf(stderr,"Unable to open graphics file.\n"); *************** *** 844,850 **** return(FALSE); } ! // Read file into bitmap for(plane=0; plane<5 && !error; plane++) { p=tmpbm->Planes[plane]; --- 867,873 ---- return(FALSE); } ! /* Read file into bitmap */ for(plane=0; plane<5 && !error; plane++) { p=tmpbm->Planes[plane]; *************** *** 855,864 **** } } ! // Close file Close(file); ! // Did we get any errors while reading? if(error) { fprintf(stderr,"Error while reading graphics file.\n"); --- 878,887 ---- } } ! /* Close file */ Close(file); ! /* Did we get any errors while reading? */ if(error) { fprintf(stderr,"Error while reading graphics file.\n"); *************** *** 865,871 **** return(FALSE); } ! // Scale bitmap to fit font size bsa.bsa_SrcBitMap = tmpbm; bsa.bsa_DestBitMap = gfxbm; bsa.bsa_SrcX = 0; --- 888,894 ---- return(FALSE); } ! /* Scale bitmap to fit font size */ bsa.bsa_SrcBitMap = tmpbm; bsa.bsa_DestBitMap = gfxbm; bsa.bsa_SrcX = 0; *************** *** 881,887 **** bsa.bsa_Flags = 0; BitMapScale(&bsa); ! // Scale bitmap to map size bsa.bsa_SrcBitMap = tmpbm; bsa.bsa_DestBitMap = mapbm; bsa.bsa_SrcX = 0; --- 904,910 ---- bsa.bsa_Flags = 0; BitMapScale(&bsa); ! /* Scale bitmap to map size */ bsa.bsa_SrcBitMap = tmpbm; bsa.bsa_DestBitMap = mapbm; bsa.bsa_SrcX = 0; *************** *** 897,903 **** bsa.bsa_Flags = 0; BitMapScale(&bsa); ! // Free temp bitmap if(v39) { FreeBitMap(tmpbm); --- 920,926 ---- bsa.bsa_Flags = 0; BitMapScale(&bsa); ! /* Free temp bitmap */ if(v39) { FreeBitMap(tmpbm); *************** *** 909,921 **** } tmpbm=NULL; ! // Initialize pointer to mask plane gfxmask = gfxbm->Planes[4]; return(TRUE); } ! ///} ! ///{ "conv_gfx()" int conv_gfx(void) { int x,y,ox,sm,b,p; --- 932,945 ---- } tmpbm=NULL; ! /* Initialize pointer to mask plane */ gfxmask = gfxbm->Planes[4]; return(TRUE); } ! /* /} */ ! /* / ! { "conv_gfx()" */ int conv_gfx(void) { int x,y,ox,sm,b,p; *************** *** 927,933 **** s4 = gfxbm->Planes[3]; s5 = gfxbm->Planes[4]; ! // Allocate memory for chunky graphics if((chunkygfx=AllocMem(gfx_w*gfx_h, MEMF_PUBLIC))==NULL) { fprintf(stderr,"Couldn't allocate chunky gfx buffer.\n"); --- 951,957 ---- s4 = gfxbm->Planes[3]; s5 = gfxbm->Planes[4]; ! /* Allocate memory for chunky graphics */ if((chunkygfx=AllocMem(gfx_w*gfx_h, MEMF_PUBLIC))==NULL) { fprintf(stderr,"Couldn't allocate chunky gfx buffer.\n"); *************** *** 976,982 **** } ! // Free planar graphics if(v39) { FreeBitMap(gfxbm); --- 1000,1006 ---- } ! /* Free planar graphics */ if(v39) { FreeBitMap(gfxbm); *************** *** 990,997 **** return(TRUE); } ! ///} ! ///{ "put_gfx()" void put_gfx(int x, int y, int chr, int col) { UBYTE tmp; --- 1014,1022 ---- return(TRUE); } ! /* /} */ ! /* / ! { "put_gfx()" */ void put_gfx(int x, int y, int chr, int col) { UBYTE tmp; *************** *** 1005,1011 **** int a = col&0x1f; int c = chr&0x1f; ! // Just a black tile if(a==0 && c==0) { SetAPen(rp,PEN(0)); --- 1030,1036 ---- int a = col&0x1f; int c = chr&0x1f; ! /* Just a black tile */ if(a==0 && c==0) { SetAPen(rp,PEN(0)); *************** *** 1013,1019 **** return; } ! // Player - Remap for race and class if(a==12 && c==0) { a = ((p_ptr->pclass * 10 + p_ptr->prace) >> 5) + 12; --- 1038,1044 ---- return; } ! /* Player - Remap for race and class */ if(a==12 && c==0) { a = ((p_ptr->pclass * 10 + p_ptr->prace) >> 5) + 12; *************** *** 1020,1032 **** c = ((p_ptr->pclass * 10 + p_ptr->prace) & 0x1f); } ! // Use chunky graphics if(use_chunky) { ! // Draw tile with black background (inventory, equipment, store) if(col & 0x40) { ! // Copy from chunky buffer to temp buffer for(j=0; jpclass * 10 + p_ptr->prace) & 0x1f); } ! /* Use chunky graphics */ if(use_chunky) { ! /* Draw tile with black background (inventory, equipment, store) */ if(col & 0x40) { ! /* Copy from chunky buffer to temp buffer */ for(j=0; jViewPort.ColorMap,wbpens[i]); } ! // Close intuition screen if(amiscr) { CloseScreen(amiscr); amiscr=NULL; } ! // Free chunky gfx buffer if(chunkygfx) { FreeMem(chunkygfx, font_w*font_h); --- 1158,1181 ---- wblock=FALSE; } ! /* Close intuition window */ if(amiwin) { CloseWindow(amiwin); amiwin=NULL; } ! /* Free obtained pens */ if(wbscr) { for(i=0; i<32; i++) ReleasePen(wbscr->ViewPort.ColorMap,wbpens[i]); } ! /* Close intuition screen */ if(amiscr) { CloseScreen(amiscr); amiscr=NULL; } ! /* Free chunky gfx buffer */ if(chunkygfx) { FreeMem(chunkygfx, font_w*font_h); *************** *** 1159,1165 **** FreeMem(chunkytmp, tmp_w*font_h); chunkytmp=NULL; } ! // Free bitmap and its bitplanes if(gfxbm) { if(v39) --- 1186,1192 ---- FreeMem(chunkytmp, tmp_w*font_h); chunkytmp=NULL; } ! /* Free bitmap and its bitplanes */ if(gfxbm) { if(v39) *************** *** 1186,1192 **** } mapbm=NULL; } ! // Close font if(ownfont && font) { CloseFont(font); --- 1213,1219 ---- } mapbm=NULL; } ! /* Close font */ if(ownfont && font) { CloseFont(font); *************** *** 1193,1250 **** font=NULL; ownfont=FALSE; } ! // Close keymap.library if(KeymapBase) { CloseLibrary(KeymapBase); KeymapBase=NULL; } ! // Return failure return(-1); } ! ///} ! ///{ "amiga_map()" void amiga_map(void) { int i,j; byte ta,tc; ! // Only in planar graphics mode if(!use_graphics || use_chunky) return; ! // Save screen Term_save(); ! // Clear screen Term_clear(); Term_fresh(); ! // Calculate offset values map_x = ((font_w * 80) - (mpt_w * cur_wid)) / 2; map_y = ((font_h * 24) - (mpt_h * cur_hgt)) / 2; ! // Draw all "interesting" features for(i=0; ipclass * 10 + p_ptr->prace) >> 5) + 12; --- 1220,1278 ---- font=NULL; ownfont=FALSE; } ! /* Close keymap.library */ if(KeymapBase) { CloseLibrary(KeymapBase); KeymapBase=NULL; } ! /* Return failure */ return(-1); } ! /* /} */ ! /* / ! { "amiga_map()" */ void amiga_map(void) { int i,j; byte ta,tc; ! /* Only in planar graphics mode */ if(!use_graphics || use_chunky) return; ! /* Save screen */ Term_save(); ! /* Clear screen */ Term_clear(); Term_fresh(); ! /* Calculate offset values */ map_x = ((font_w * 80) - (mpt_w * cur_wid)) / 2; map_y = ((font_h * 24) - (mpt_h * cur_hgt)) / 2; ! /* Draw all "interesting" features */ for(i=0; ipclass * 10 + p_ptr->prace) >> 5) + 12; *************** *** 1255,1273 **** } } ! // Wait for a keypress, flush key buffer cursor_map=TRUE; Term_inkey(&tc,TRUE,TRUE); Term_flush(); cursor_map=FALSE; ! // Restore screen Term_clear(); Term_fresh(); Term_load(); } ! ///} ! ///{ "load_palette()" void load_palette(void) { int i; --- 1283,1302 ---- } } ! /* Wait for a keypress, flush key buffer */ cursor_map=TRUE; Term_inkey(&tc,TRUE,TRUE); Term_flush(); cursor_map=FALSE; ! /* Restore screen */ Term_clear(); Term_fresh(); Term_load(); } ! /* /} */ ! /* / ! { "load_palette()" */ void load_palette(void) { int i; *************** *** 1298,1304 **** } } } ! ///} #endif /* USE_AMI */ --- 1327,1333 ---- } } } ! /* /} */ #endif /* USE_AMI */ diff -w -c -r ick-279/main-cap.c utumno/main-cap.c *** ick-279/main-cap.c Thu May 15 17:12:12 1997 --- utumno/main-cap.c Thu May 15 17:45:50 1997 *************** *** 324,331 **** else if ((y2 >= rows-1) && ll) tp(ll); else if ((y2 == y1) && cr) tp(cr); #if 0 ! else if ((y2 == y1+1) && cr && dn) { tp(cr); tp(dn); } ! else if ((y2 == y1-1) && cr && up) { tp(cr); tp(up); } #endif else do_cm(x2,y2); } --- 324,333 ---- else if ((y2 >= rows-1) && ll) tp(ll); else if ((y2 == y1) && cr) tp(cr); #if 0 ! else if ((y2 == y1+1) && cr && dn) ! { tp(cr); tp(dn); } ! else if ((y2 == y1-1) && cr && up) ! { tp(cr); tp(up); } #endif else do_cm(x2,y2); } diff -w -c -r ick-279/main-emx.c utumno/main-emx.c *** ick-279/main-emx.c Thu May 15 17:12:12 1997 --- utumno/main-emx.c Thu May 15 17:45:51 1997 *************** *** 34,41 **** * I use EMX 0.9b, but every EMX compiler since 0.8g or so should work * fine. EMX is available at ftp-os2.cdrom.com ("Hobbes"), as is dmake. * ! * dmake: ftp://ftp-os2.cdrom.com/all/program/dmake38X.zip ! * EMX: ftp://ftp-os2.cdrom.com/2_x/unix/emx???/ (most probably) * * Old savefiles must be renamed to follow the new "savefile" naming * conventions. Either rename the savefile to "PLAYER", or start the --- 34,41 ---- * I use EMX 0.9b, but every EMX compiler since 0.8g or so should work * fine. EMX is available at ftp-os2.cdrom.com ("Hobbes"), as is dmake. * ! * dmake: ftp:/* ftp-os2.cdrom.com/all/program/dmake38X.zip */ ! * EMX: ftp:/* ftp-os2.cdrom.com/2_x/unix/emx???/ (most probably) */ * * Old savefiles must be renamed to follow the new "savefile" naming * conventions. Either rename the savefile to "PLAYER", or start the diff -w -c -r ick-279/main-gcu.c utumno/main-gcu.c No differences encountered diff -w -c -r ick-279/main-ibm.c utumno/main-ibm.c *** ick-279/main-ibm.c Thu May 15 17:12:13 1997 --- utumno/main-ibm.c Thu May 15 17:45:51 1997 *************** *** 4,18 **** /* ! * Original code by "Billy Tanksley (wtanksle@ucsd.edu)" * Use "Makefile.ibm" to compile Angband using this file. * ! * Support for DJGPP v2 by "Scott Egashira (egashira@u.washington.edu)" * ! * Extensive modifications by "Ben Harrison (benh@voicenet.com)", * including "collation" of the Watcom C/C++ and DOS-286 patches. * ! * Watcom C/C++ changes by "David Boeren (akemi@netcom.com)" * Use "Makefile.wat" to compile this file with Watcom C/C++, and * be sure to define "USE_IBM" and "USE_WAT". * --- 4,18 ---- /* ! * Original code by Billy Tanksley (wtanksle@ucsd.edu) * Use "Makefile.ibm" to compile Angband using this file. * ! * Support for DJGPP v2 by Scott Egashira (egashira@u.washington.edu) * ! * Extensive modifications by Ben Harrison (benh@voicenet.com), * including "collation" of the Watcom C/C++ and DOS-286 patches. * ! * Watcom C/C++ changes by David Boeren (akemi@netcom.com) * Use "Makefile.wat" to compile this file with Watcom C/C++, and * be sure to define "USE_IBM" and "USE_WAT". * *************** *** 21,27 **** * and be sure to define "USE_IBM", "USE_WAT", and "USE_286". Also, * depending on your compiler, you may need to define "USE_CONIO". * ! * True color palette support by "Mike Marcelais (mrmarcel@eos.ncsu.edu)", * with interface to the "color_table" array by Ben Harrison. * * Both "shift" keys are treated as "identical", and all the modifier keys --- 21,27 ---- * and be sure to define "USE_IBM", "USE_WAT", and "USE_286". Also, * depending on your compiler, you may need to define "USE_CONIO". * ! * True color palette support by Mike Marcelais (mrmarcel@eos.ncsu.edu), * with interface to the "color_table" array by Ben Harrison. * * Both "shift" keys are treated as "identical", and all the modifier keys *************** *** 33,39 **** * alternative color set definitions. The "lib/user/font-ibm.prf" contains * attr/char mappings for walls and floors and such. * ! * Note the "Term_user_ibm()" function hook, which could allow the user * to interact with the "main-ibm.c" visual system. Currently this hook * is unused, but, for example, it could allow the user to toggle "sound" * or "graphics" modes, or to select the number of screen rows, with the --- 33,39 ---- * alternative color set definitions. The "lib/user/font-ibm.prf" contains * attr/char mappings for walls and floors and such. * ! * Note the Term_user_ibm() function hook, which could allow the user * to interact with the "main-ibm.c" visual system. Currently this hook * is unused, but, for example, it could allow the user to toggle "sound" * or "graphics" modes, or to select the number of screen rows, with the *************** *** 242,256 **** 0x3f3f3fL, /* 4 4 4 White */ 0x232323L, /* 2 2 2 Slate */ 0x00233fL, /* 4 2 0 Orange */ ! 0x000035L, /* 3 0 0 Red */ 0x112300L, /* 0 2 1 Green */ 0x3f0000L, /* 0 0 4 Blue */ 0x001123L, /* 2 1 0 Umber */ 0x111111L, /* 1 1 1 Lt. Dark */ 0x353535L, /* 3 3 3 Lt. Slate */ ! 0x3f003fL, /* 4 0 4 Purple */ 0x003f3fL, /* 4 4 0 Yellow */ ! 0x00003fL, /* 4 0 0 Lt. Red */ 0x003f00L, /* 0 4 0 Lt. Green */ 0x3f3f00L, /* 0 4 4 Lt. Blue */ 0x112335L /* 3 2 1 Lt. Umber */ --- 242,256 ---- 0x3f3f3fL, /* 4 4 4 White */ 0x232323L, /* 2 2 2 Slate */ 0x00233fL, /* 4 2 0 Orange */ ! 0x000023L, /* 3 0 0 Red */ 0x112300L, /* 0 2 1 Green */ 0x3f0000L, /* 0 0 4 Blue */ 0x001123L, /* 2 1 0 Umber */ 0x111111L, /* 1 1 1 Lt. Dark */ 0x353535L, /* 3 3 3 Lt. Slate */ ! 0x230023L, /* 4 0 4 Purple */ 0x003f3fL, /* 4 4 0 Yellow */ ! 0x35113fL, /* 4 0 0 Lt. Red */ 0x003f00L, /* 0 4 0 Lt. Green */ 0x3f3f00L, /* 0 4 4 Lt. Blue */ 0x112335L /* 3 2 1 Lt. Umber */ *************** *** 301,307 **** * to the EGA and VGA video cards" [Farraro]. * * On VGA cards, colors go through a double-indirection when looking ! * up the `real' color when in 16 color mode. The color value in the * attribute is looked up in the EGA color registers. Then that value * is looked up in the VGA color registers. Then the color is displayed. * This is done for compatability. However, the EGA registers are --- 301,308 ---- * to the EGA and VGA video cards" [Farraro]. * * On VGA cards, colors go through a double-indirection when looking ! * up the ! real' color when in 16 color mode. The color value in the * attribute is looked up in the EGA color registers. Then that value * is looked up in the VGA color registers. Then the color is displayed. * This is done for compatability. However, the EGA registers are *************** *** 912,918 **** */ void enable_graphic_font(void *font) { ! union REGPACK regs = {0}; regs.h.ah = 0x11; /* Text font function */ regs.h.bh = 0x10; /* Size of a character -- 16 bytes */ --- 913,920 ---- */ void enable_graphic_font(void *font) { ! union REGPACK regs = ! {0}; regs.h.ah = 0x11; /* Text font function */ regs.h.bh = 0x10; /* Size of a character -- 16 bytes */ *************** *** 932,939 **** * header file). */ ! typedef union { ! struct { unsigned long edi; unsigned long esi; unsigned long ebp; --- 934,943 ---- * header file). */ ! typedef union ! { ! struct ! { unsigned long edi; unsigned long esi; unsigned long ebp; *************** *** 943,949 **** unsigned long ecx; unsigned long eax; } d; ! struct { unsigned short di, di_hi; unsigned short si, si_hi; unsigned short bp, bp_hi; --- 947,954 ---- unsigned long ecx; unsigned long eax; } d; ! struct ! { unsigned short di, di_hi; unsigned short si, si_hi; unsigned short bp, bp_hi; *************** *** 962,968 **** unsigned short sp; unsigned short ss; } x; ! struct { unsigned char edi[4]; unsigned char esi[4]; unsigned char ebp[4]; --- 967,974 ---- unsigned short sp; unsigned short ss; } x; ! struct ! { unsigned char edi[4]; unsigned char esi[4]; unsigned char ebp[4]; *************** *** 976,982 **** unsigned __dpmi_allocate_dos_memory(int size, unsigned *selector) { ! union REGPACK regs = {0}; regs.w.ax = 0x100; /* DPMI function -- allocate low memory */ regs.w.bx = size; /* Number of Paragraphs to allocate */ --- 982,989 ---- unsigned __dpmi_allocate_dos_memory(int size, unsigned *selector) { ! union REGPACK regs = ! {0}; regs.w.ax = 0x100; /* DPMI function -- allocate low memory */ regs.w.bx = size; /* Number of Paragraphs to allocate */ *************** *** 988,994 **** void __dpmi_free_dos_memory(unsigned sel) { ! union REGPACK regs = {0}; regs.w.ax = 0x101; /* DPMI function -- free low memory */ regs.x.edx = sel; /* PM selector for memory block */ --- 995,1002 ---- void __dpmi_free_dos_memory(unsigned sel) { ! union REGPACK regs = ! {0}; regs.w.ax = 0x101; /* DPMI function -- free low memory */ regs.x.edx = sel; /* PM selector for memory block */ *************** *** 997,1003 **** void __dpmi_int(int intno, __dpmi_regs *dblock) { ! union REGPACK regs = {0}; regs.w.ax = 0x300; /* DPMI function -- real mode interrupt */ regs.h.bl = intno; /* interrupt 0x10 */ --- 1005,1012 ---- void __dpmi_int(int intno, __dpmi_regs *dblock) { ! union REGPACK regs = ! {0}; regs.w.ax = 0x300; /* DPMI function -- real mode interrupt */ regs.h.bl = intno; /* interrupt 0x10 */ *************** *** 1035,1046 **** */ void enable_graphic_font(const char *font) { ! __dpmi_regs dblock = {{0}}; ! unsigned seg, sel, i; /* ! * Allocate a block of memory 4096 bytes big in `low memory' so a real * mode interrupt can access it. Real mode pointer is returned as seg:0 * Protected mode pointer is sel:0. */ --- 1044,1058 ---- */ void enable_graphic_font(const char *font) { ! __dpmi_regs dblock = ! {{0}}; ! unsigned seg, i; ! int sel; /* ! * Allocate a block of memory 4096 bytes big in ! low memory' so a real * mode interrupt can access it. Real mode pointer is returned as seg:0 * Protected mode pointer is sel:0. */ *************** *** 1058,1064 **** /* * Now we use DPMI as a jumper to call the real mode interrupt. This ! * is needed because loading `es' while in protected mode with a real * mode pointer will cause an Protection Fault and calling the interrupt * directly using the protected mode pointer will result in garbage * being received by the interrupt routine --- 1070,1077 ---- /* * Now we use DPMI as a jumper to call the real mode interrupt. This ! * is needed because loading ! es' while in protected mode with a real * mode pointer will cause an Protection Fault and calling the interrupt * directly using the protected mode pointer will result in garbage * being received by the interrupt routine *************** *** 1102,1107 **** --- 1115,1123 ---- union REGS r; + /* Hack -- fix file modes */ + _fmode = O_BINARY; + /* Check for "Windows" */ if (getenv("windir")) { *************** *** 1109,1115 **** r.h.al = 0x8B; /* Causes Dos boxes to become fullscreen */ r.h.bh = r.h.bl = 0x00; /* 0x0000 = current Dos box */ int86(0x2F,&r,&r); /* Call the Windows API */ ! }; #ifdef USE_WAT --- 1125,1131 ---- r.h.al = 0x8B; /* Causes Dos boxes to become fullscreen */ r.h.bh = r.h.bl = 0x00; /* 0x0000 = current Dos box */ int86(0x2F,&r,&r); /* Call the Windows API */ ! } #ifdef USE_WAT diff -w -c -r ick-279/main-lsl.c utumno/main-lsl.c *** ick-279/main-lsl.c Thu May 15 17:12:14 1997 --- utumno/main-lsl.c Thu May 15 17:45:52 1997 *************** *** 52,58 **** * The BITMAPFILEHEADER data structure contains information about the type, * size, and layout of a device-independent bitmap (DIB) file. */ ! typedef struct BITMAPFILEHEADER { short bfType; int bfSize; short bfReserved1; --- 52,59 ---- * The BITMAPFILEHEADER data structure contains information about the type, * size, and layout of a device-independent bitmap (DIB) file. */ ! typedef struct BITMAPFILEHEADER ! { short bfType; int bfSize; short bfReserved1; *************** *** 60,66 **** int bfOffBits; } BITMAPFILEHEADER; ! typedef struct BITMAPINFOHEADER{ unsigned int biSize; unsigned int biWidth; unsigned int biHeight; --- 61,68 ---- int bfOffBits; } BITMAPFILEHEADER; ! typedef struct BITMAPINFOHEADER ! { unsigned int biSize; unsigned int biWidth; unsigned int biHeight; *************** *** 74,80 **** unsigned int biClrImportant; } BITMAPINFOHEADER; ! typedef struct BITMAPCOREHEADER{ unsigned int bcSize; unsigned short bcWidth; unsigned short bcHeight; --- 76,83 ---- unsigned int biClrImportant; } BITMAPINFOHEADER; ! typedef struct BITMAPCOREHEADER ! { unsigned int bcSize; unsigned short bcWidth; unsigned short bcHeight; *************** *** 82,88 **** unsigned short bcBitCount; } BITMAPCOREHEADER; ! typedef struct { int width,height,bpp,numcols; char type[4]; } PICINFO; --- 85,92 ---- unsigned short bcBitCount; } BITMAPCOREHEADER; ! typedef struct ! { int width,height,bpp,numcols; char type[4]; } PICINFO; *************** *** 471,477 **** } /* Translates raw palette index to Angband color index */ ! const char pal_trans[16]={0,3,13,11,2,7,12,5,1,10,15,4,14,6,9,8}; /**************************************************************************** --- 475,482 ---- } /* Translates raw palette index to Angband color index */ ! const char pal_trans[16]= ! {0,3,13,11,2,7,12,5,1,10,15,4,14,6,9,8}; /**************************************************************************** diff -w -c -r ick-279/main-mac.c utumno/main-mac.c *** ick-279/main-mac.c Thu May 15 17:12:15 1997 --- utumno/main-mac.c Thu May 15 17:45:52 1997 *************** *** 2038,2048 **** /* * Prepare the menus ! * File (129) = { New,Open,Import,Close,Save,-,Exit,Quit } ! * Edit (130) = { Cut, Copy, Paste, Clear } (?) ! * Font (131) = { Bold, Extend, -, Monaco, Courier, ... } ! * Size (132) = { 9, 10, ..., 18 } ! * Window (133) = { Angband, -, Recall, Choice } */ static void setup_menus() { --- 2038,2053 ---- /* * Prepare the menus ! * File (129) = ! { New,Open,Import,Close,Save,-,Exit,Quit } ! * Edit (130) = ! { Cut, Copy, Paste, Clear } (?) ! * Font (131) = ! { Bold, Extend, -, Monaco, Courier, ... } ! * Size (132) = ! { 9, 10, ..., 18 } ! * Window (133) = ! { Angband, -, Recall, Choice } */ static void setup_menus() { *************** *** 2276,2282 **** /* Branch on the menu */ switch (menuid) { ! /* Apple Menu {About,-,...} */ case 128: /* About Angband... */ --- 2281,2288 ---- /* Branch on the menu */ switch (menuid) { ! /* Apple Menu ! {About,-,...} */ case 128: /* About Angband... */ *************** *** 2303,2309 **** OpenDeskAcc(s); break; ! /* File Menu {New,Open,Import,Close,Save,-,Exit,Quit} */ case 129: switch (selection) --- 2309,2316 ---- OpenDeskAcc(s); break; ! /* File Menu ! {New,Open,Import,Close,Save,-,Exit,Quit} */ case 129: switch (selection) *************** *** 2462,2468 **** } break; ! /* Edit menu {Undo,-,Cut,Copy,Paste,Clear} */ case 130: /* Unused */ --- 2469,2476 ---- } break; ! /* Edit menu ! {Undo,-,Cut,Copy,Paste,Clear} */ case 130: /* Unused */ *************** *** 2469,2475 **** break; ! /* Font menu {Bold,Extend,-,...} */ case 131: /* Require a window */ --- 2477,2484 ---- break; ! /* Font menu ! {Bold,Extend,-,...} */ case 131: /* Require a window */ *************** *** 2587,2593 **** break; ! /* Size menu {...} */ case 132: if (!td) break; --- 2596,2603 ---- break; ! /* Size menu ! {...} */ case 132: if (!td) break; *************** *** 2618,2624 **** break; ! /* Window menu {Angband,-,Mirror,-,Recall,Choice} */ case 133: switch (selection) --- 2628,2635 ---- break; ! /* Window menu ! {Angband,-,Mirror,-,Recall,Choice} */ case 133: switch (selection) *************** *** 3421,3427 **** /* check for error when mounting the disk */ if (HiWord(event.message) != noErr) { ! Point p = {120, 120}; DILoad(); DIBadMount(p, event.message); --- 3432,3439 ---- /* check for error when mounting the disk */ if (HiWord(event.message) != noErr) { ! Point p = ! {120, 120}; DILoad(); DIBadMount(p, event.message); diff -w -c -r ick-279/main-vme.c utumno/main-vme.c *** ick-279/main-vme.c Thu May 15 17:12:16 1997 --- utumno/main-vme.c Thu May 15 17:45:53 1997 *************** *** 41,47 **** /* * Convert EBCDIC to ASCII */ ! char e2a[]={ 0x00,0x01,0x02,0x03,0x1A,0x09,0x1A,0x7F,0x1A,0x1A,0x1A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x1A,0x0A,0x08,0x1A,0x18,0x19,0x1A,0x1A,0x1C,0x1D,0x1E,0x1F, 0x1A,0x1A,0x1C,0x1A,0x1A,0x0A,0x17,0x1B,0x1A,0x1A,0x1A,0x1A,0x1A,0x05,0x06,0x07, --- 41,48 ---- /* * Convert EBCDIC to ASCII */ ! char e2a[]= ! { 0x00,0x01,0x02,0x03,0x1A,0x09,0x1A,0x7F,0x1A,0x1A,0x1A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x1A,0x0A,0x08,0x1A,0x18,0x19,0x1A,0x1A,0x1C,0x1D,0x1E,0x1F, 0x1A,0x1A,0x1C,0x1A,0x1A,0x0A,0x17,0x1B,0x1A,0x1A,0x1A,0x1A,0x1A,0x05,0x06,0x07, *************** *** 64,70 **** /* * Convert ASCII to EBCDIC */ ! char a2e[]={ 0x00,0x01,0x02,0x03,0x37,0x2D,0x2E,0x2F,0x16,0x05,0x25,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x3C,0x3D,0x32,0x26,0x18,0x19,0x3F,0x27,0x22,0x1D,0x35,0x1F, 0x40,0x5A,0x7F,0x7B,0x5B,0x6C,0x50,0x7D,0x4D,0x5D,0x5C,0x4E,0x6B,0x60,0x4B,0x61, --- 65,72 ---- /* * Convert ASCII to EBCDIC */ ! char a2e[]= ! { 0x00,0x01,0x02,0x03,0x37,0x2D,0x2E,0x2F,0x16,0x05,0x25,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x3C,0x3D,0x32,0x26,0x18,0x19,0x3F,0x27,0x22,0x1D,0x35,0x1F, 0x40,0x5A,0x7F,0x7B,0x5B,0x6C,0x50,0x7D,0x4D,0x5D,0x5C,0x4E,0x6B,0x60,0x4B,0x61, *************** *** 207,213 **** * Gray to Blue, Light White to WhiteB, Violet to PinkB, Yellow to Yellow * Light colors: Red to RedB,Green to Green,Blue to Cyan, Umber to YellB */ ! static const byte vm_color[] = { 0xF1, 0xF1, 0xF1, 0xF3, 0xF2, 0xF4-0x80, 0xF1-0x80, 0xF6, --- 209,216 ---- * Gray to Blue, Light White to WhiteB, Violet to PinkB, Yellow to Yellow * Light colors: Red to RedB,Green to Green,Blue to Cyan, Umber to YellB */ ! static const byte vm_color[] = ! { 0xF1, 0xF1, 0xF1, 0xF3, 0xF2, 0xF4-0x80, 0xF1-0x80, 0xF6, *************** *** 236,242 **** dest2 = ScreenAttr + ((cols * y) + x); /* Virtually write the string */ ! for (i = 0; (i < n) && s[i]; i++) { *dest++ = s[i]; *dest2++ = attr; } --- 239,246 ---- dest2 = ScreenAttr + ((cols * y) + x); /* Virtually write the string */ ! for (i = 0; (i < n) && s[i]; i++) ! { *dest++ = s[i]; *dest2++ = attr; } *************** *** 277,283 **** char tmp; /* Analyze the request */ ! switch (n) { /* Make a noise */ case TERM_XTRA_NOISE: --- 281,288 ---- char tmp; /* Analyze the request */ ! switch (n) ! { /* Make a noise */ case TERM_XTRA_NOISE: *************** *** 475,481 **** /* This array is used to clean up input field. ** Comment: erase everything user entered after we accepted it. */ ! static char wiping[]={0,0,0,0,0,0,0,0,0,0,0,0}; /* Flag: should we wipe input field ? */ static int wipe=0; /* Counter: how many times did game checked if we pressed any key. --- 480,487 ---- /* This array is used to clean up input field. ** Comment: erase everything user entered after we accepted it. */ ! static char wiping[]= ! {0,0,0,0,0,0,0,0,0,0,0,0}; /* Flag: should we wipe input field ? */ static int wipe=0; /* Counter: how many times did game checked if we pressed any key. *************** *** 489,501 **** /* Define array which will be used to bring actual cursor ** (not game cursor!!!) back to the beginning of input field. */ ! static char CursorHome[]={0,0,0,0x13}; /* Define array to make fields on the screen. ** Comment: 2 fields: input field(writable), and game field(protected). ** Comment2: We will change PSS settings into dumb repeating of color ** setting if PSS fonts are not abailable. */ ! static char ScrField[]={0,0,0,0x29,0x03,0xC0,0xC1,0x42,0xF3,0x43,0xC1,\ 0,0,0,0x29,0x03,0xC0,0x60,0x42,0xF1,0x43,0xC1}; /* Last command user entered (for repeating purposes */ static char LastCmd[256]; --- 495,509 ---- /* Define array which will be used to bring actual cursor ** (not game cursor!!!) back to the beginning of input field. */ ! static char CursorHome[]= ! {0,0,0,0x13}; /* Define array to make fields on the screen. ** Comment: 2 fields: input field(writable), and game field(protected). ** Comment2: We will change PSS settings into dumb repeating of color ** setting if PSS fonts are not abailable. */ ! static char ScrField[]= ! {0,0,0,0x29,0x03,0xC0,0xC1,0x42,0xF3,0x43,0xC1,\ 0,0,0,0x29,0x03,0xC0,0x60,0x42,0xF1,0x43,0xC1}; /* Last command user entered (for repeating purposes */ static char LastCmd[256]; *************** *** 509,515 **** /* Use this to activate full screen mode after console has been ** initialized. */ ! unsigned char init[6] = {0xC2,0x11,0x40,0x40,0,0}; int i; /* Array for checking is PSS fonts are loaded */ char pss[256]; --- 517,524 ---- /* Use this to activate full screen mode after console has been ** initialized. */ ! unsigned char init[6] = ! {0xC2,0x11,0x40,0x40,0,0}; int i; /* Array for checking is PSS fonts are loaded */ char pss[256]; diff -w -c -r ick-279/main-win.c utumno/main-win.c No differences encountered diff -w -c -r ick-279/main-x11.c utumno/main-x11.c No differences encountered diff -w -c -r ick-279/main-xxx.c utumno/main-xxx.c No differences encountered diff -w -c -r ick-279/main.c utumno/main.c *** ick-279/main.c Thu May 15 17:12:18 1997 --- utumno/main.c Thu May 15 17:45:55 1997 *************** *** 304,319 **** new_game = TRUE; break; - case 'R': - case 'r': - arg_force_roguelike = TRUE; - break; - - case 'O': - case 'o': - arg_force_original = TRUE; - break; - case 'V': case 'v': use_sound = TRUE; --- 304,309 ---- *************** *** 363,370 **** /* Note -- the Term is NOT initialized */ puts("Usage: angband [options]"); puts(" -n Start a new character"); - puts(" -o Use the original keyset"); - puts(" -r Use the rogue-like keyset"); puts(" -v Activate the use_sound flag"); puts(" -g Activate the use_graphics flag"); puts(" -f Activate 'fiddle' mode"); --- 353,358 ---- Only in utumno: makefile Only in utumno: makefile.acn Only in utumno: makefile.ami Only in utumno: makefile.emx Only in utumno: makefile.lsl Only in utumno: makefile.old Only in utumno: makefile.unx Only in utumno: makefile.wat Only in utumno: makefile.win diff -w -c -r ick-279/melee1.c utumno/melee1.c *** ick-279/melee1.c Thu May 15 17:12:19 1997 --- utumno/melee1.c Thu May 15 17:45:55 1997 *************** *** 94,100 **** "defiles you!", "dances around you!", "makes obscene gestures!", ! "moons you!!!" }; --- 94,100 ---- "defiles you!", "dances around you!", "makes obscene gestures!", ! "moons you!" }; *************** *** 117,128 **** bool make_attack_normal(int m_idx) { monster_type *m_ptr = &m_list[m_idx]; - monster_race *r_ptr = &r_info[m_ptr->r_idx]; int ap_cnt; ! int i, j, k, tmp, ac, rlev; int do_cut, do_stun; s32b gold; --- 117,127 ---- bool make_attack_normal(int m_idx) { monster_type *m_ptr = &m_list[m_idx]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; int ap_cnt; ! int i, k, tmp, ac, rlev; int do_cut, do_stun; s32b gold; *************** *** 224,230 **** --- 223,232 ---- case RBE_EXP_80: power = 5; break; } + /* Monster is stunned */ + if (m_ptr->stunned) power -= 50; + /* Monster hits player */ if (!effect || check_hit(power, rlev)) { *************** *** 369,374 **** --- 371,379 ---- /* Roll out the damage */ damage = damroll(d_dice, d_side); + /* Monster is stunned */ + if (m_ptr->stunned) damage -= (damage / 10); + /* Apply appropriate damage */ switch (effect) { *************** *** 403,417 **** /* Take "poison" effect */ if (!(p_ptr->resist_pois || p_ptr->oppose_pois)) { ! if (set_poisoned(p_ptr->poisoned + randint(rlev) + 5)) { obvious = TRUE; } } - /* Learn about the player */ - update_smart_learn(m_idx, DRS_POIS); - break; case RBE_UN_BONUS: --- 408,419 ---- /* Take "poison" effect */ if (!(p_ptr->resist_pois || p_ptr->oppose_pois)) { ! if (add_poisoned(randint(rlev) + 5)) { obvious = TRUE; } } break; case RBE_UN_BONUS: *************** *** 426,434 **** if (apply_disenchant(0)) obvious = TRUE; } - /* Learn about the player */ - update_smart_learn(m_idx, DRS_DISEN); - break; case RBE_UN_POWER: --- 428,433 ---- *************** *** 457,463 **** obvious = TRUE; /* Uncharge */ ! i_ptr->pval = 0; /* Redraw the choice window */ p_ptr->redraw |= (PR_CHOOSE); --- 456,462 ---- obvious = TRUE; /* Uncharge */ ! i_ptr->set_pval(0); /* Redraw the choice window */ p_ptr->redraw |= (PR_CHOOSE); *************** *** 466,474 **** p_ptr->notice |= (PN_COMBINE | PN_REORDER); /* Heal */ ! j = rlev; ! m_ptr->hp += j * i_ptr->pval * i_ptr->number; ! if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp; /* Redraw (later) if needed */ if (health_who == m_idx) p_ptr->redraw |= (PR_HEALTH); --- 465,476 ---- p_ptr->notice |= (PN_COMBINE | PN_REORDER); /* Heal */ ! m_ptr->set_hp(m_ptr->hp + ! rlev * i_ptr->pval * i_ptr->number); ! if (m_ptr->hp > m_ptr->maxhp) ! { ! m_ptr->set_hp(m_ptr->maxhp); ! } /* Redraw (later) if needed */ if (health_who == m_idx) p_ptr->redraw |= (PR_HEALTH); *************** *** 561,570 **** i_ptr = &inventory[i]; /* Accept real items */ ! if (!i_ptr->k_idx) continue; /* Don't steal artifacts -CFT */ ! if (artifact_p(i_ptr)) continue; /* Get a description */ object_desc(i_name, i_ptr, FALSE, 3); --- 563,572 ---- i_ptr = &inventory[i]; /* Accept real items */ ! if (!i_ptr->exists()) continue; /* Don't steal artifacts -CFT */ ! if (i_ptr->is_artifact()) continue; /* Get a description */ object_desc(i_name, i_ptr, FALSE, 3); *************** *** 571,577 **** /* Message */ msg_format("%sour %s (%c) was stolen!", ! ((i_ptr->number > 1) ? "One of y" : "Y"), i_name, index_to_label(i)); /* Steal the items */ --- 573,579 ---- /* Message */ msg_format("%sour %s (%c) was stolen!", ! i_ptr->is_plural() ? "One of y" : "Y", i_name, index_to_label(i)); /* Steal the items */ *************** *** 605,611 **** i_ptr = &inventory[i]; /* Accept real items */ ! if (!i_ptr->k_idx) continue; /* Only eat food */ if (i_ptr->tval != TV_FOOD) continue; --- 607,613 ---- i_ptr = &inventory[i]; /* Accept real items */ ! if (!i_ptr->exists()) continue; /* Only eat food */ if (i_ptr->tval != TV_FOOD) continue; *************** *** 615,621 **** /* Message */ msg_format("%sour %s (%c) was eaten!", ! ((i_ptr->number > 1) ? "One of y" : "Y"), i_name, index_to_label(i)); /* Steal the items */ --- 617,623 ---- /* Message */ msg_format("%sour %s (%c) was eaten!", ! i_ptr->is_plural() ? "One of y" : "Y", i_name, index_to_label(i)); /* Steal the items */ *************** *** 640,650 **** i_ptr = &inventory[INVEN_LITE]; /* Drain fuel */ ! if ((i_ptr->pval > 0) && (!artifact_p(i_ptr))) { /* Reduce fuel */ ! i_ptr->pval -= (250 + randint(250)); ! if (i_ptr->pval < 1) i_ptr->pval = 1; /* Notice */ if (!p_ptr->blind) --- 642,652 ---- i_ptr = &inventory[INVEN_LITE]; /* Drain fuel */ ! if ((i_ptr->pval > 0) && !i_ptr->is_artifact()) { /* Reduce fuel */ ! i_ptr->set_pval(i_ptr->pval - 250 - randint(250)); ! if (i_ptr->pval < 1) i_ptr->set_pval(1); /* Notice */ if (!p_ptr->blind) *************** *** 670,678 **** /* Special damage */ acid_dam(damage, ddesc); - /* Learn about the player */ - update_smart_learn(m_idx, DRS_ACID); - break; case RBE_ELEC: --- 672,677 ---- *************** *** 686,694 **** /* Special damage */ elec_dam(damage, ddesc); - /* Learn about the player */ - update_smart_learn(m_idx, DRS_ELEC); - break; case RBE_FIRE: --- 685,690 ---- *************** *** 702,710 **** /* Special damage */ fire_dam(damage, ddesc); - /* Learn about the player */ - update_smart_learn(m_idx, DRS_FIRE); - break; case RBE_COLD: --- 698,703 ---- *************** *** 718,726 **** /* Special damage */ cold_dam(damage, ddesc); - /* Learn about the player */ - update_smart_learn(m_idx, DRS_COLD); - break; case RBE_BLIND: --- 711,716 ---- *************** *** 731,745 **** /* Increase "blind" */ if (!p_ptr->resist_blind) { ! if (set_blind(p_ptr->blind + 10 + randint(rlev))) { obvious = TRUE; } } - /* Learn about the player */ - update_smart_learn(m_idx, DRS_BLIND); - break; case RBE_CONFUSE: --- 721,732 ---- /* Increase "blind" */ if (!p_ptr->resist_blind) { ! if (add_blind(10 + randint(rlev))) { obvious = TRUE; } } break; case RBE_CONFUSE: *************** *** 756,764 **** } } - /* Learn about the player */ - update_smart_learn(m_idx, DRS_CONF); - break; case RBE_TERRIFY: --- 743,748 ---- *************** *** 785,793 **** } } - /* Learn about the player */ - update_smart_learn(m_idx, DRS_FEAR); - break; case RBE_PARALYZE: --- 769,774 ---- *************** *** 814,822 **** } } - /* Learn about the player */ - update_smart_learn(m_idx, DRS_FREE); - break; case RBE_LOSE_STR: --- 795,800 ---- *************** *** 906,912 **** take_hit(damage, ddesc); /* Radius 8 earthquake centered at the monster */ ! if (damage > 23) earthquake(m_ptr->fy, m_ptr->fx, 8); break; --- 884,893 ---- take_hit(damage, ddesc); /* Radius 8 earthquake centered at the monster */ ! if (damage > 23) ! { ! earthquake(m_ptr->fy, m_ptr->fx, 8); ! } break; *************** *** 946,952 **** /* Take damage */ take_hit(damage, ddesc); ! if (p_ptr->hold_life && (rand_int(100) < 90)) { msg_print("You keep hold of your life force!"); } --- 927,933 ---- /* Take damage */ take_hit(damage, ddesc); ! if (p_ptr->hold_life && percent(90)) { msg_print("You keep hold of your life force!"); } *************** *** 974,980 **** /* Take damage */ take_hit(damage, ddesc); ! if (p_ptr->hold_life && (rand_int(100) < 75)) { msg_print("You keep hold of your life force!"); } --- 955,961 ---- /* Take damage */ take_hit(damage, ddesc); ! if (p_ptr->hold_life && percent(75)) { msg_print("You keep hold of your life force!"); } *************** *** 1082,1089 **** case 3: k = randint(20) + 20; break; case 4: k = randint(30) + 30; break; case 5: k = randint(40) + 40; break; ! case 6: k = 100; break; ! default: k = 200; break; } /* Apply the stun */ --- 1063,1070 ---- case 3: k = randint(20) + 20; break; case 4: k = randint(30) + 30; break; case 5: k = randint(40) + 40; break; ! case 6: k = randint(60) + 60; break; ! default: k = randint(80) + 80; break; } /* Apply the stun */ diff -w -c -r ick-279/melee2.c utumno/melee2.c *** ick-279/melee2.c Thu May 15 17:12:19 1997 --- utumno/melee2.c Thu May 15 17:45:55 1997 *************** *** 14,331 **** - #ifdef DRS_SMART_OPTIONS - - /* - * And now for Intelligent monster attacks (including spells). - * - * Original idea and code by "DRS" (David Reeves Sward). - * Major modifications by "BEN" (Ben Harrison). - * - * Give monsters more intelligent attack/spell selection based on - * observations of previous attacks on the player, and/or by allowing - * the monster to "cheat" and know the player status. - * - * Maintain an idea of the player status, and use that information - * to occasionally eliminate "ineffective" spell attacks. We could - * also eliminate ineffective normal attacks, but there is no reason - * for the monster to do this, since he gains no benefit. - * Note that MINDLESS monsters are not allowed to use this code. - * And non-INTELLIGENT monsters only use it partially effectively. - * - * Actually learn what the player resists, and use that information - * to remove attacks or spells before using them. This will require - * much less space, if I am not mistaken. Thus, each monster gets a - * set of 32 bit flags, "smart", build from the various "SM_*" flags. - * - * This has the added advantage that attacks and spells are related. - * The "smart_learn" option means that the monster "learns" the flags - * that should be set, and "smart_cheat" means that he "knows" them. - * So "smart_cheat" means that the "smart" field is always up to date, - * while "smart_learn" means that the "smart" field is slowly learned. - * Both of them have the same effect on the "choose spell" routine. - */ - - - - - /* - * Internal probablility routine - */ - static bool int_outof(monster_race *r_ptr, int prob) - { - /* Non-Smart monsters are half as "smart" */ - if (!(r_ptr->flags2 & RF2_SMART)) prob = prob / 2; - - /* Roll the dice */ - return (rand_int(100) < prob); - } - - - - /* - * Remove the "bad" spells from a spell list - */ - static void remove_bad_spells(int m_idx, u32b *f4p, u32b *f5p, u32b *f6p) - { - monster_type *m_ptr = &m_list[m_idx]; - monster_race *r_ptr = &r_info[m_ptr->r_idx]; - - u32b f4 = (*f4p); - u32b f5 = (*f5p); - u32b f6 = (*f6p); - - u32b smart = 0L; - - - /* Too stupid to know anything */ - if (r_ptr->flags2 & RF2_STUPID) return; - - - /* Must be cheating or learning */ - if (!smart_cheat && !smart_learn) return; - - - /* Update acquired knowledge */ - if (smart_learn) - { - /* Hack -- Occasionally forget player status */ - if (m_ptr->smart && (rand_int(100) < 1)) m_ptr->smart = 0L; - - /* Use the memorized flags */ - smart = m_ptr->smart; - } - - - /* Cheat if requested */ - if (smart_cheat) - { - /* Know basic info */ - if (p_ptr->resist_acid) smart |= SM_RES_ACID; - if (p_ptr->oppose_acid) smart |= SM_OPP_ACID; - if (p_ptr->immune_acid) smart |= SM_IMM_ACID; - if (p_ptr->resist_elec) smart |= SM_RES_ELEC; - if (p_ptr->oppose_elec) smart |= SM_OPP_ELEC; - if (p_ptr->immune_elec) smart |= SM_IMM_ELEC; - if (p_ptr->resist_fire) smart |= SM_RES_FIRE; - if (p_ptr->oppose_fire) smart |= SM_OPP_FIRE; - if (p_ptr->immune_fire) smart |= SM_IMM_FIRE; - if (p_ptr->resist_cold) smart |= SM_RES_COLD; - if (p_ptr->oppose_cold) smart |= SM_OPP_COLD; - if (p_ptr->immune_cold) smart |= SM_IMM_COLD; - - /* Know poison info */ - if (p_ptr->resist_pois) smart |= SM_RES_POIS; - if (p_ptr->oppose_pois) smart |= SM_OPP_POIS; - - /* Know special resistances */ - if (p_ptr->resist_neth) smart |= SM_RES_NETH; - if (p_ptr->resist_lite) smart |= SM_RES_LITE; - if (p_ptr->resist_dark) smart |= SM_RES_DARK; - if (p_ptr->resist_fear) smart |= SM_RES_FEAR; - if (p_ptr->resist_conf) smart |= SM_RES_CONF; - if (p_ptr->resist_chaos) smart |= SM_RES_CHAOS; - if (p_ptr->resist_disen) smart |= SM_RES_DISEN; - if (p_ptr->resist_blind) smart |= SM_RES_BLIND; - if (p_ptr->resist_nexus) smart |= SM_RES_NEXUS; - if (p_ptr->resist_sound) smart |= SM_RES_SOUND; - if (p_ptr->resist_shard) smart |= SM_RES_SHARD; - - /* Know bizarre "resistances" */ - if (p_ptr->free_act) smart |= SM_IMM_FREE; - if (!p_ptr->msp) smart |= SM_IMM_MANA; - } - - - /* Nothing known */ - if (!smart) return; - - - if (smart & SM_IMM_ACID) - { - if (int_outof(r_ptr, 100)) f4 &= ~RF4_BR_ACID; - if (int_outof(r_ptr, 100)) f5 &= ~RF5_BA_ACID; - if (int_outof(r_ptr, 100)) f5 &= ~RF5_BO_ACID; - } - else if ((smart & SM_OPP_ACID) && (smart & SM_RES_ACID)) - { - if (int_outof(r_ptr, 80)) f4 &= ~RF4_BR_ACID; - if (int_outof(r_ptr, 80)) f5 &= ~RF5_BA_ACID; - if (int_outof(r_ptr, 80)) f5 &= ~RF5_BO_ACID; - } - else if ((smart & SM_OPP_ACID) || (smart & SM_RES_ACID)) - { - if (int_outof(r_ptr, 30)) f4 &= ~RF4_BR_ACID; - if (int_outof(r_ptr, 30)) f5 &= ~RF5_BA_ACID; - if (int_outof(r_ptr, 30)) f5 &= ~RF5_BO_ACID; - } - - - if (smart & SM_IMM_ELEC) - { - if (int_outof(r_ptr, 100)) f4 &= ~RF4_BR_ELEC; - if (int_outof(r_ptr, 100)) f5 &= ~RF5_BA_ELEC; - if (int_outof(r_ptr, 100)) f5 &= ~RF5_BO_ELEC; - } - else if ((smart & SM_OPP_ELEC) && (smart & SM_RES_ELEC)) - { - if (int_outof(r_ptr, 80)) f4 &= ~RF4_BR_ELEC; - if (int_outof(r_ptr, 80)) f5 &= ~RF5_BA_ELEC; - if (int_outof(r_ptr, 80)) f5 &= ~RF5_BO_ELEC; - } - else if ((smart & SM_OPP_ELEC) || (smart & SM_RES_ELEC)) - { - if (int_outof(r_ptr, 30)) f4 &= ~RF4_BR_ELEC; - if (int_outof(r_ptr, 30)) f5 &= ~RF5_BA_ELEC; - if (int_outof(r_ptr, 30)) f5 &= ~RF5_BO_ELEC; - } - - - if (smart & SM_IMM_FIRE) - { - if (int_outof(r_ptr, 100)) f4 &= ~RF4_BR_FIRE; - if (int_outof(r_ptr, 100)) f5 &= ~RF5_BA_FIRE; - if (int_outof(r_ptr, 100)) f5 &= ~RF5_BO_FIRE; - } - else if ((smart & SM_OPP_FIRE) && (smart & SM_RES_FIRE)) - { - if (int_outof(r_ptr, 80)) f4 &= ~RF4_BR_FIRE; - if (int_outof(r_ptr, 80)) f5 &= ~RF5_BA_FIRE; - if (int_outof(r_ptr, 80)) f5 &= ~RF5_BO_FIRE; - } - else if ((smart & SM_OPP_FIRE) || (smart & SM_RES_FIRE)) - { - if (int_outof(r_ptr, 30)) f4 &= ~RF4_BR_FIRE; - if (int_outof(r_ptr, 30)) f5 &= ~RF5_BA_FIRE; - if (int_outof(r_ptr, 30)) f5 &= ~RF5_BO_FIRE; - } - - - if (smart & SM_IMM_COLD) - { - if (int_outof(r_ptr, 100)) f4 &= ~RF4_BR_COLD; - if (int_outof(r_ptr, 100)) f5 &= ~RF5_BA_COLD; - if (int_outof(r_ptr, 100)) f5 &= ~RF5_BO_COLD; - if (int_outof(r_ptr, 100)) f5 &= ~RF5_BO_ICEE; - } - else if ((smart & SM_OPP_COLD) && (smart & SM_RES_COLD)) - { - if (int_outof(r_ptr, 80)) f4 &= ~RF4_BR_COLD; - if (int_outof(r_ptr, 80)) f5 &= ~RF5_BA_COLD; - if (int_outof(r_ptr, 80)) f5 &= ~RF5_BO_COLD; - if (int_outof(r_ptr, 80)) f5 &= ~RF5_BO_ICEE; - } - else if ((smart & SM_OPP_COLD) || (smart & SM_RES_COLD)) - { - if (int_outof(r_ptr, 30)) f4 &= ~RF4_BR_COLD; - if (int_outof(r_ptr, 30)) f5 &= ~RF5_BA_COLD; - if (int_outof(r_ptr, 30)) f5 &= ~RF5_BO_COLD; - if (int_outof(r_ptr, 30)) f5 &= ~RF5_BO_ICEE; - } - - - if ((smart & SM_OPP_POIS) && (smart & SM_RES_POIS)) - { - if (int_outof(r_ptr, 80)) f4 &= ~RF4_BR_POIS; - if (int_outof(r_ptr, 80)) f5 &= ~RF5_BA_POIS; - } - else if ((smart & SM_OPP_POIS) || (smart & SM_RES_POIS)) - { - if (int_outof(r_ptr, 30)) f4 &= ~RF4_BR_POIS; - if (int_outof(r_ptr, 30)) f5 &= ~RF5_BA_POIS; - } - - - if (smart & SM_RES_NETH) - { - if (int_outof(r_ptr, 50)) f4 &= ~RF4_BR_NETH; - if (int_outof(r_ptr, 50)) f5 &= ~RF5_BA_NETH; - if (int_outof(r_ptr, 50)) f5 &= ~RF5_BO_NETH; - } - - if (smart & SM_RES_LITE) - { - if (int_outof(r_ptr, 50)) f4 &= ~RF4_BR_LITE; - } - - if (smart & SM_RES_DARK) - { - if (int_outof(r_ptr, 50)) f4 &= ~RF4_BR_DARK; - if (int_outof(r_ptr, 50)) f5 &= ~RF5_BA_DARK; - } - - if (smart & SM_RES_FEAR) - { - if (int_outof(r_ptr, 100)) f5 &= ~RF5_SCARE; - } - - if (smart & SM_RES_CONF) - { - if (int_outof(r_ptr, 100)) f5 &= ~RF5_CONF; - if (int_outof(r_ptr, 50)) f4 &= ~RF4_BR_CONF; - } - - if (smart & SM_RES_CHAOS) - { - if (int_outof(r_ptr, 100)) f5 &= ~RF5_CONF; - if (int_outof(r_ptr, 50)) f4 &= ~RF4_BR_CONF; - if (int_outof(r_ptr, 50)) f4 &= ~RF4_BR_CHAO; - } - - if (smart & SM_RES_DISEN) - { - if (int_outof(r_ptr, 100)) f4 &= ~RF4_BR_DISE; - } - - if (smart & SM_RES_BLIND) - { - if (int_outof(r_ptr, 100)) f5 &= ~RF5_BLIND; - } - - if (smart & SM_RES_NEXUS) - { - if (int_outof(r_ptr, 50)) f4 &= ~RF4_BR_NEXU; - if (int_outof(r_ptr, 50)) f6 &= ~RF6_TELE_LEVEL; - } - - if (smart & SM_RES_SOUND) - { - if (int_outof(r_ptr, 50)) f4 &= ~RF4_BR_SOUN; - } - - if (smart & SM_RES_SHARD) - { - if (int_outof(r_ptr, 50)) f4 &= ~RF4_BR_SHAR; - } - - - if (smart & SM_IMM_FREE) - { - if (int_outof(r_ptr, 100)) f5 &= ~RF5_HOLD; - if (int_outof(r_ptr, 100)) f5 &= ~RF5_SLOW; - } - - if (smart & SM_IMM_MANA) - { - if (int_outof(r_ptr, 100)) f5 &= ~RF5_DRAIN_MANA; - } - - - /* XXX XXX XXX No spells left? */ - /* if (!f4 && !f5 && !f6) ... */ - - - (*f4p) = f4; - (*f5p) = f5; - (*f6p) = f6; - } - - - #endif - - - /* * Cast a bolt at the player * Stop if we hit a monster * Affect monsters and the player --- 14,20 ---- *************** *** 459,468 **** if (!chance) return (FALSE); /* Cannot cast spells when confused */ ! if (m_ptr->confused) return (FALSE); /* Only do spells occasionally */ ! if (rand_int(100) >= chance) return (FALSE); /* XXX XXX XXX Handle "track_target" option (?) */ --- 148,157 ---- if (!chance) return (FALSE); /* Cannot cast spells when confused */ ! if (m_ptr->confused) return FALSE; /* Only do spells occasionally */ ! if (!percent(chance)) return FALSE; /* XXX XXX XXX Handle "track_target" option (?) */ *************** *** 475,482 **** if (m_ptr->cdis > MAX_RANGE) return (FALSE); /* Check path */ ! if (!projectable(m_ptr->fy, m_ptr->fx, py, px)) return (FALSE); } /* Extract the monster level */ --- 164,175 ---- if (m_ptr->cdis > MAX_RANGE) return (FALSE); /* Check path */ ! if (!projectable(m_ptr->fy, m_ptr->fx, ! py, px)) ! { ! return (FALSE); } + } /* Extract the monster level */ *************** *** 492,498 **** /* Hack -- allow "desperate" spells */ if ((r_ptr->flags2 & RF2_SMART) && (m_ptr->hp < m_ptr->maxhp / 10) && ! (rand_int(100) < 50)) { /* Require intelligent spells */ f4 &= RF4_INT_MASK; --- 185,191 ---- /* Hack -- allow "desperate" spells */ if ((r_ptr->flags2 & RF2_SMART) && (m_ptr->hp < m_ptr->maxhp / 10) && ! percent(50)) { /* Require intelligent spells */ f4 &= RF4_INT_MASK; *************** *** 504,520 **** } - #ifdef DRS_SMART_OPTIONS - - /* Remove the "ineffective" spells */ - remove_bad_spells(m_idx, &f4, &f5, &f6); - - /* No spells left */ - if (!f4 && !f5 && !f6) return (FALSE); - - #endif - - /* Extract the "inate" spells */ for (k = 0; k < 32; k++) { --- 197,202 ---- *************** *** 538,546 **** /* Stop if player is dead or gone */ ! if (!alive || death || new_level_flag) return (FALSE); /* Get the monster name (or "it") */ monster_desc(m_name, m_ptr, 0x00); --- 220,237 ---- /* Stop if player is dead or gone */ ! if (!alive || death || new_level_flag) return FALSE; + /* XXX The spell can fail if monster is stunned */ + if (m_ptr->stunned && percent(25)) + { + /* XXX this message isn't great for unchanting monsters */ + msg_format("%^s begins chanting but the spell fizzles!", m_name); + return TRUE; + } + + /* Get the monster name (or "it") */ monster_desc(m_name, m_ptr, 0x00); *************** *** 608,614 **** else msg_format("%^s breathes acid.", m_name); breath(m_idx, GF_ACID, ((m_ptr->hp / 3) > 1600 ? 1600 : (m_ptr->hp / 3))); - update_smart_learn(m_idx, DRS_ACID); break; case 96+9: /* RF4_BR_ELEC */ --- 299,304 ---- *************** *** 617,623 **** else msg_format("%^s breathes lightning.", m_name); breath(m_idx, GF_ELEC, ((m_ptr->hp / 3) > 1600 ? 1600 : (m_ptr->hp / 3))); - update_smart_learn(m_idx, DRS_ELEC); break; case 96+10: /* RF4_BR_FIRE */ --- 307,312 ---- *************** *** 626,632 **** else msg_format("%^s breathes fire.", m_name); breath(m_idx, GF_FIRE, ((m_ptr->hp / 3) > 1600 ? 1600 : (m_ptr->hp / 3))); - update_smart_learn(m_idx, DRS_FIRE); break; case 96+11: /* RF4_BR_COLD */ --- 315,320 ---- *************** *** 635,641 **** else msg_format("%^s breathes frost.", m_name); breath(m_idx, GF_COLD, ((m_ptr->hp / 3) > 1600 ? 1600 : (m_ptr->hp / 3))); - update_smart_learn(m_idx, DRS_COLD); break; case 96+12: /* RF4_BR_POIS */ --- 323,328 ---- *************** *** 644,650 **** else msg_format("%^s breathes gas.", m_name); breath(m_idx, GF_POIS, ((m_ptr->hp / 3) > 800 ? 800 : (m_ptr->hp / 3))); - update_smart_learn(m_idx, DRS_POIS); break; case 96+13: /* RF4_BR_NETH */ --- 331,336 ---- *************** *** 653,659 **** else msg_format("%^s breathes nether.", m_name); breath(m_idx, GF_NETHER, ((m_ptr->hp / 6) > 550 ? 550 : (m_ptr->hp / 6)) ); - update_smart_learn(m_idx, DRS_NETH); break; case 96+14: /* RF4_BR_LITE */ --- 339,344 ---- *************** *** 662,668 **** else msg_format("%^s breathes light.", m_name); breath(m_idx, GF_LITE, ((m_ptr->hp / 6) > 400 ? 400 : (m_ptr->hp / 6))); - update_smart_learn(m_idx, DRS_LITE); break; case 96+15: /* RF4_BR_DARK */ --- 347,352 ---- *************** *** 671,677 **** else msg_format("%^s breathes darkness.", m_name); breath(m_idx, GF_DARK, ((m_ptr->hp / 6) > 400 ? 400 : (m_ptr->hp / 6))); - update_smart_learn(m_idx, DRS_DARK); break; case 96+16: /* RF4_BR_CONF */ --- 355,360 ---- *************** *** 680,686 **** else msg_format("%^s breathes confusion.", m_name); breath(m_idx, GF_CONFUSION, ((m_ptr->hp / 6) > 400 ? 400 : (m_ptr->hp / 6))); - update_smart_learn(m_idx, DRS_CONF); break; case 96+17: /* RF4_BR_SOUN */ --- 363,368 ---- *************** *** 689,695 **** else msg_format("%^s breathes sound.", m_name); breath(m_idx, GF_SOUND, ((m_ptr->hp / 6) > 400 ? 400 : (m_ptr->hp / 6))); - update_smart_learn(m_idx, DRS_SOUND); break; case 96+18: /* RF4_BR_CHAO */ --- 371,376 ---- *************** *** 698,704 **** else msg_format("%^s breathes chaos.", m_name); breath(m_idx, GF_CHAOS, ((m_ptr->hp / 6) > 600 ? 600 : (m_ptr->hp / 6))); - update_smart_learn(m_idx, DRS_CHAOS); break; case 96+19: /* RF4_BR_DISE */ --- 379,384 ---- *************** *** 707,713 **** else msg_format("%^s breathes disenchantment.", m_name); breath(m_idx, GF_DISENCHANT, ((m_ptr->hp / 6) > 500 ? 500 : (m_ptr->hp / 6))); - update_smart_learn(m_idx, DRS_DISEN); break; case 96+20: /* RF4_BR_NEXU */ --- 387,392 ---- *************** *** 716,722 **** else msg_format("%^s breathes nexus.", m_name); breath(m_idx, GF_NEXUS, ((m_ptr->hp / 3) > 250 ? 250 : (m_ptr->hp / 3))); - update_smart_learn(m_idx, DRS_NEXUS); break; case 96+21: /* RF4_BR_TIME */ --- 395,400 ---- *************** *** 749,755 **** else msg_format("%^s breathes shards.", m_name); breath(m_idx, GF_SHARDS, ((m_ptr->hp / 6) > 400 ? 400 : (m_ptr->hp / 6))); - update_smart_learn(m_idx, DRS_SHARD); break; case 96+25: /* RF4_BR_PLAS */ --- 427,432 ---- *************** *** 792,798 **** else msg_format("%^s casts an acid ball.", m_name); breath(m_idx, GF_ACID, randint(rlev * 3) + 15); - update_smart_learn(m_idx, DRS_ACID); break; case 128+1: /* RF5_BA_ELEC */ --- 469,474 ---- *************** *** 801,807 **** else msg_format("%^s casts a lightning ball.", m_name); breath(m_idx, GF_ELEC, randint(rlev * 3 / 2) + 8); - update_smart_learn(m_idx, DRS_ELEC); break; case 128+2: /* RF5_BA_FIRE */ --- 477,482 ---- *************** *** 810,816 **** else msg_format("%^s casts a fire ball.", m_name); breath(m_idx, GF_FIRE, randint(rlev * 7 / 2) + 10); - update_smart_learn(m_idx, DRS_FIRE); break; case 128+3: /* RF5_BA_COLD */ --- 485,490 ---- *************** *** 819,825 **** else msg_format("%^s casts a frost ball.", m_name); breath(m_idx, GF_COLD, randint(rlev * 3 / 2) + 10); - update_smart_learn(m_idx, DRS_COLD); break; case 128+4: /* RF5_BA_POIS */ --- 493,498 ---- *************** *** 828,834 **** else msg_format("%^s casts a stinking cloud.", m_name); breath(m_idx, GF_POIS, damroll(12, 2)); - update_smart_learn(m_idx, DRS_POIS); break; case 128+5: /* RF5_BA_NETH */ --- 501,506 ---- *************** *** 837,843 **** else msg_format("%^s casts a nether ball.", m_name); breath(m_idx, GF_NETHER, (50 + damroll(10, 10) + rlev)); - update_smart_learn(m_idx, DRS_NETH); break; case 128+6: /* RF5_BA_WATE */ --- 509,514 ---- *************** *** 863,869 **** else msg_format("%^s invokes a darkness storm.", m_name); breath(m_idx, GF_DARK, (rlev * 5) + damroll(10, 10)); - update_smart_learn(m_idx, DRS_DARK); break; case 128+9: /* RF5_DRAIN_MANA */ --- 534,539 ---- *************** *** 902,909 **** if (m_ptr->hp < m_ptr->maxhp) { /* Heal */ ! m_ptr->hp += (6 * r1); ! if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp; /* Redraw (later) if needed */ if (health_who == m_idx) p_ptr->redraw |= (PR_HEALTH); --- 572,582 ---- if (m_ptr->hp < m_ptr->maxhp) { /* Heal */ ! m_ptr->set_hp(m_ptr->hp + 6 * r1); ! if (m_ptr->hp > m_ptr->maxhp) ! { ! m_ptr->set_hp(m_ptr->maxhp); ! } /* Redraw (later) if needed */ if (health_who == m_idx) p_ptr->redraw |= (PR_HEALTH); *************** *** 915,921 **** } } } - update_smart_learn(m_idx, DRS_MANA); break; case 128+10: /* RF5_MIND_BLAST */ --- 588,593 ---- *************** *** 1047,1053 **** else msg_format("%^s casts a acid bolt.", m_name); bolt(m_idx, GF_ACID, damroll(7, 8) + (rlev / 3)); - update_smart_learn(m_idx, DRS_ACID); break; case 128+17: /* RF5_BO_ELEC */ --- 719,724 ---- *************** *** 1056,1062 **** else msg_format("%^s casts a lightning bolt.", m_name); bolt(m_idx, GF_ELEC, damroll(4, 8) + (rlev / 3)); - update_smart_learn(m_idx, DRS_ELEC); break; case 128+18: /* RF5_BO_FIRE */ --- 727,732 ---- *************** *** 1065,1071 **** else msg_format("%^s casts a fire bolt.", m_name); bolt(m_idx, GF_FIRE, damroll(9, 8) + (rlev / 3)); - update_smart_learn(m_idx, DRS_FIRE); break; case 128+19: /* RF5_BO_COLD */ --- 735,740 ---- *************** *** 1074,1080 **** else msg_format("%^s casts a frost bolt.", m_name); bolt(m_idx, GF_COLD, damroll(6, 8) + (rlev / 3)); - update_smart_learn(m_idx, DRS_COLD); break; case 128+20: /* RF5_BO_POIS */ --- 743,748 ---- *************** *** 1087,1093 **** else msg_format("%^s casts a nether bolt.", m_name); bolt(m_idx, GF_NETHER, 30 + damroll(5, 5) + (rlev * 3) / 2); - update_smart_learn(m_idx, DRS_NETH); break; case 128+22: /* RF5_BO_WATE */ --- 755,760 ---- *************** *** 1120,1126 **** else msg_format("%^s casts an ice bolt.", m_name); bolt(m_idx, GF_ICE, damroll(6, 6) + (rlev)); - update_smart_learn(m_idx, DRS_COLD); break; case 128+26: /* RF5_MISSILE */ --- 787,792 ---- *************** *** 1138,1154 **** else msg_format("%^s casts a fearful illusion.", m_name); if (p_ptr->resist_fear) { ! msg_print("You refuse to be frightened."); } else if (rand_int(100) < p_ptr->skill_sav) { ! msg_print("You refuse to be frightened."); } else { ! (void)set_afraid(p_ptr->afraid + rand_int(4) + 4); } - update_smart_learn(m_idx, DRS_FEAR); break; case 128+28: /* RF5_BLIND */ --- 804,819 ---- else msg_format("%^s casts a fearful illusion.", m_name); if (p_ptr->resist_fear) { ! msg_print("You are not frightened."); } else if (rand_int(100) < p_ptr->skill_sav) { ! msg_print("You are not frightened."); } else { ! set_afraid(p_ptr->afraid + rand_int(4) + 4); } break; case 128+28: /* RF5_BLIND */ *************** *** 1168,1174 **** { (void)set_blind(12 + rand_int(4)); } - update_smart_learn(m_idx, DRS_BLIND); break; case 128+29: /* RF5_CONF */ --- 833,838 ---- *************** *** 1188,1194 **** { (void)set_confused(p_ptr->confused + rand_int(4) + 4); } - update_smart_learn(m_idx, DRS_CONF); break; case 128+30: /* RF5_SLOW */ --- 852,857 ---- *************** *** 1207,1213 **** { (void)set_slow(p_ptr->slow + rand_int(4) + 4); } - update_smart_learn(m_idx, DRS_FREE); break; case 128+31: /* RF5_HOLD */ --- 870,875 ---- *************** *** 1227,1233 **** { (void)set_paralyzed(p_ptr->paralyzed + rand_int(4) + 4); } - update_smart_learn(m_idx, DRS_FREE); break; --- 889,894 ---- *************** *** 1243,1260 **** msg_format("%^s concentrates on %s body.", m_name, m_poss); } ! /* Allow quick speed increases to base+10 */ ! if (m_ptr->mspeed < r_ptr->speed + 10) { ! msg_format("%^s starts moving faster.", m_name); ! m_ptr->mspeed += 10; } ! /* Allow small speed increases to base+20 */ ! else if (m_ptr->mspeed < r_ptr->speed + 20) { msg_format("%^s starts moving faster.", m_name); ! m_ptr->mspeed += 2; } break; --- 904,920 ---- msg_format("%^s concentrates on %s body.", m_name, m_poss); } ! /* Already hasted */ ! if (m_ptr->temp_speed) { ! m_ptr->set_temp_speed(m_ptr->temp_speed + 5); } ! /* Not already hasted */ ! else { msg_format("%^s starts moving faster.", m_name); ! m_ptr->set_temp_speed(10 + randint(10)); } break; *************** *** 1277,1289 **** } /* Heal some */ ! m_ptr->hp += (rlev * 6); /* Fully healed */ if (m_ptr->hp >= m_ptr->maxhp) { /* Fully healed */ ! m_ptr->hp = m_ptr->maxhp; /* Message */ if (seen) --- 937,949 ---- } /* Heal some */ ! m_ptr->set_hp(m_ptr->hp + rlev * 6); /* Fully healed */ if (m_ptr->hp >= m_ptr->maxhp) { /* Fully healed */ ! m_ptr->set_hp(m_ptr->maxhp); /* Message */ if (seen) *************** *** 1317,1323 **** if (m_ptr->monfear) { /* Cancel fear */ ! m_ptr->monfear = 0; /* Message */ msg_format("%^s recovers %s courage.", m_name, m_poss); --- 977,983 ---- if (m_ptr->monfear) { /* Cancel fear */ ! m_ptr->set_monfear(0); /* Message */ msg_format("%^s recovers %s courage.", m_name, m_poss); *************** *** 1377,1383 **** { teleport_player_level(); } - update_smart_learn(m_idx, DRS_NEXUS); break; case 160+11: /* RF6_XXX5 */ --- 1037,1042 ---- *************** *** 1668,1677 **** #endif /* Keep monsters from running too far away */ ! if (m_ptr->cdis > MAX_SIGHT + 5) return (FALSE); /* All "afraid" monsters will run away */ ! if (m_ptr->monfear) return (TRUE); #ifdef ALLOW_TERROR --- 1327,1336 ---- #endif /* Keep monsters from running too far away */ ! if (m_ptr->cdis > MAX_SIGHT + 5) return FALSE; /* All "afraid" monsters will run away */ ! if (m_ptr->monfear) return TRUE; #ifdef ALLOW_TERROR *************** *** 1706,1712 **** #endif /* Assume no terror */ ! return (FALSE); } --- 1365,1371 ---- #endif /* Assume no terror */ ! return FALSE; } *************** *** 1753,1760 **** if (r_ptr->flags2 & RF2_KILL_WALL) return (FALSE); /* Monster location */ - y1 = m_ptr->fy; x1 = m_ptr->fx; /* Monster grid */ c_ptr = &cave[y1][x1]; --- 1412,1419 ---- if (r_ptr->flags2 & RF2_KILL_WALL) return (FALSE); /* Monster location */ x1 = m_ptr->fx; + y1 = m_ptr->fy; /* Monster grid */ c_ptr = &cave[y1][x1]; *************** *** 1836,1843 **** #endif /* Extract the "pseudo-direction" */ - y = m_ptr->fy - y2; x = m_ptr->fx - x2; /* Apply fear if possible and necessary */ --- 1495,1502 ---- #endif /* Extract the "pseudo-direction" */ x = m_ptr->fx - x2; + y = m_ptr->fy - y2; /* Apply fear if possible and necessary */ *************** *** 1844,1850 **** if (mon_will_run(m_idx)) { /* XXX XXX Not very "smart" */ ! y = (-y), x = (-x); } --- 1503,1510 ---- if (mon_will_run(m_idx)) { /* XXX XXX Not very "smart" */ ! x = -x; ! y = -y; } *************** *** 2089,2095 **** int d = 1; /* Wake up faster near the player */ ! if (m_ptr->cdis < 50) d = (100 / m_ptr->cdis); /* Hack -- handle aggravation */ if (p_ptr->aggravate) d = m_ptr->csleep; --- 1749,1755 ---- int d = 1; /* Wake up faster near the player */ ! if (m_ptr->cdis < 50) d = 100 / m_ptr->cdis; /* Hack -- handle aggravation */ if (p_ptr->aggravate) d = m_ptr->csleep; *************** *** 2098,2104 **** if (m_ptr->csleep > d) { /* Monster wakes up "a little bit" */ ! m_ptr->csleep -= d; /* Notice the "not waking up" */ if (m_ptr->ml) --- 1758,1764 ---- if (m_ptr->csleep > d) { /* Monster wakes up "a little bit" */ ! m_ptr->set_csleep(m_ptr->csleep - d); /* Notice the "not waking up" */ if (m_ptr->ml) *************** *** 2112,2118 **** else { /* Reset sleep counter */ ! m_ptr->csleep = 0; /* Notice the "waking up" */ if (m_ptr->ml) --- 1772,1778 ---- else { /* Reset sleep counter */ ! m_ptr->set_csleep(0); /* Notice the "waking up" */ if (m_ptr->ml) *************** *** 2152,2158 **** if (m_ptr->stunned > d) { /* Recover somewhat */ ! m_ptr->stunned -= d; } /* Fully recover */ --- 1812,1818 ---- if (m_ptr->stunned > d) { /* Recover somewhat */ ! m_ptr->set_stunned(m_ptr->stunned - d); } /* Fully recover */ *************** *** 2159,2165 **** else { /* Recover fully */ ! m_ptr->stunned = 0; /* Message if visible */ if (m_ptr->ml) --- 1819,1825 ---- else { /* Recover fully */ ! m_ptr->set_stunned(0); /* Message if visible */ if (m_ptr->ml) *************** *** 2173,2181 **** msg_format("%^s is no longer stunned.", m_name); } } - - /* Still stunned */ - if (m_ptr->stunned) return; } --- 1833,1838 ---- *************** *** 2189,2195 **** if (m_ptr->confused > d) { /* Reduce the confusion */ ! m_ptr->confused -= d; } /* Recovered */ --- 1846,1852 ---- if (m_ptr->confused > d) { /* Reduce the confusion */ ! m_ptr->set_confused(m_ptr->confused - d); } /* Recovered */ *************** *** 2196,2202 **** else { /* No longer confused */ ! m_ptr->confused = 0; /* Message if visible */ if (m_ptr->ml) --- 1853,1859 ---- else { /* No longer confused */ ! m_ptr->set_confused(0); /* Message if visible */ if (m_ptr->ml) *************** *** 2223,2229 **** if (m_ptr->monfear > d) { /* Reduce the fear */ ! m_ptr->monfear -= d; } /* Recover from fear, take note if seen */ --- 1880,1886 ---- if (m_ptr->monfear > d) { /* Reduce the fear */ ! m_ptr->set_monfear(m_ptr->monfear - d); } /* Recover from fear, take note if seen */ *************** *** 2230,2236 **** else { /* No longer afraid */ ! m_ptr->monfear = 0; /* Visual note */ if (m_ptr->ml) --- 1887,1893 ---- else { /* No longer afraid */ ! m_ptr->set_monfear(0); /* Visual note */ if (m_ptr->ml) *************** *** 2250,2257 **** /* Get the origin */ - oy = m_ptr->fy; ox = m_ptr->fx; /* Attempt to "mutiply" if able and allowed */ --- 1907,1914 ---- /* Get the origin */ ox = m_ptr->fx; + oy = m_ptr->fy; /* Attempt to "mutiply" if able and allowed */ *************** *** 2301,2310 **** } /* 75% random movement */ ! else if ((r_ptr->flags1 & RF1_RAND_50) && ! (r_ptr->flags1 & RF1_RAND_25) && ! (rand_int(100) < 75)) { /* Memorize flags */ if (m_ptr->ml) r_ptr->r_flags1 |= RF1_RAND_50; if (m_ptr->ml) r_ptr->r_flags1 |= RF1_RAND_25; --- 1958,1968 ---- } /* 75% random movement */ ! else if ((r_ptr->flags1 & RF1_RAND_50) && (r_ptr->flags1 & RF1_RAND_25)) { + /* Move randomly? */ + if (percent(75)) + { /* Memorize flags */ if (m_ptr->ml) r_ptr->r_flags1 |= RF1_RAND_50; if (m_ptr->ml) r_ptr->r_flags1 |= RF1_RAND_25; *************** *** 2312,2322 **** /* Try four "random" directions */ mm[0] = mm[1] = mm[2] = mm[3] = 5; } /* 50% random movement */ ! else if ((r_ptr->flags1 & RF1_RAND_50) && ! (rand_int(100) < 50)) { /* Memorize flags */ if (m_ptr->ml) r_ptr->r_flags1 |= RF1_RAND_50; --- 1970,1984 ---- /* Try four "random" directions */ mm[0] = mm[1] = mm[2] = mm[3] = 5; } + else get_moves(m_idx, mm); + } /* 50% random movement */ ! else if (r_ptr->flags1 & RF1_RAND_50) { + /* Move randomly? */ + if (percent(50)) + { /* Memorize flags */ if (m_ptr->ml) r_ptr->r_flags1 |= RF1_RAND_50; *************** *** 2323,2333 **** /* Try four "random" directions */ mm[0] = mm[1] = mm[2] = mm[3] = 5; } /* 25% random movement */ ! else if ((r_ptr->flags1 & RF1_RAND_25) && ! (rand_int(100) < 25)) { /* Memorize flags */ if (m_ptr->ml) r_ptr->r_flags1 |= RF1_RAND_25; --- 1985,1999 ---- /* Try four "random" directions */ mm[0] = mm[1] = mm[2] = mm[3] = 5; } + else get_moves(m_idx, mm); + } /* 25% random movement */ ! else if (r_ptr->flags1 & RF1_RAND_25) { + /* Move randomly? */ + if (percent(25)) + { /* Memorize flags */ if (m_ptr->ml) r_ptr->r_flags1 |= RF1_RAND_25; *************** *** 2334,2339 **** --- 2000,2007 ---- /* Try four "random" directions */ mm[0] = mm[1] = mm[2] = mm[3] = 5; } + else get_moves(m_idx, mm); + } /* Normal movement */ else *************** *** 2415,2421 **** did_kill_wall = TRUE; /* Clear the wall code, if any */ ! c_ptr->feat = 0x01; /* Forget the "field mark", if any */ c_ptr->info &= ~CAVE_MARK; --- 2083,2089 ---- did_kill_wall = TRUE; /* Clear the wall code, if any */ ! c_ptr->feat = CF_FLOOR; /* Forget the "field mark", if any */ c_ptr->info &= ~CAVE_MARK; *************** *** 2506,2512 **** if (did_open_door || did_bash_door) { /* Break down the door */ ! if (did_bash_door && (rand_int(100) < 50)) { c_ptr->feat = 0x05; } --- 2174,2180 ---- if (did_open_door || did_bash_door) { /* Break down the door */ ! if (did_bash_door && percent(50)) { c_ptr->feat = 0x05; } *************** *** 2545,2551 **** } /* Break the rune */ ! c_ptr->feat = 0x01; /* Allow movement */ do_move = TRUE; --- 2213,2219 ---- } /* Break the rune */ ! c_ptr->feat = CF_FLOOR; /* Allow movement */ do_move = TRUE; *************** *** 2644,2653 **** /* Mega-Hack -- move the old monster, if any */ if (c_ptr->m_idx) { - /* Move the old monster */ ! y_ptr->fy = oy; ! y_ptr->fx = ox; /* Update the old monster */ update_mon(c_ptr->m_idx, TRUE); --- 2312,2319 ---- /* Mega-Hack -- move the old monster, if any */ if (c_ptr->m_idx) { /* Move the old monster */ ! y_ptr->set_location(ox, oy); /* Update the old monster */ update_mon(c_ptr->m_idx, TRUE); *************** *** 2657,2664 **** c_ptr->m_idx = m_idx; /* Move the monster */ ! m_ptr->fy = ny; ! m_ptr->fx = nx; /* Update the monster */ update_mon(m_idx, TRUE); --- 2323,2329 ---- c_ptr->m_idx = m_idx; /* Move the monster */ ! m_ptr->set_location(nx, ny); /* Update the monster */ update_mon(m_idx, TRUE); *************** *** 2671,2679 **** /* Possible disturb */ if (m_ptr->ml && ! (disturb_move || ! (m_ptr->los && ! disturb_near))) { /* Disturb */ disturb(0, 0); --- 2336,2342 ---- /* Possible disturb */ if (m_ptr->ml && ! (disturb_move || (m_ptr->los && disturb_near))) { /* Disturb */ disturb(0, 0); *************** *** 2683,2689 **** /* XXX XXX XXX Change for Angband 2.8.0 */ /* Take or Kill objects (not "gold") on the floor */ ! if (i_ptr->k_idx && (i_ptr->tval != TV_GOLD) && ((r_ptr->flags2 & RF2_TAKE_ITEM) || (r_ptr->flags2 & RF2_KILL_ITEM))) { --- 2346,2353 ---- /* XXX XXX XXX Change for Angband 2.8.0 */ /* Take or Kill objects (not "gold") on the floor */ ! /* XXX fix now */ ! if (i_ptr->exists() && (i_ptr->tval != TV_GOLD) && ((r_ptr->flags2 & RF2_TAKE_ITEM) || (r_ptr->flags2 & RF2_KILL_ITEM))) { *************** *** 2718,2724 **** if (f1 & TR1_SLAY_EVIL) flg3 |= RF3_EVIL; /* The object cannot be picked up by the monster */ ! if (artifact_p(i_ptr) || (r_ptr->flags3 & flg3)) { /* Only give a message for "take_item" */ if (r_ptr->flags2 & RF2_TAKE_ITEM) --- 2382,2388 ---- if (f1 & TR1_SLAY_EVIL) flg3 |= RF3_EVIL; /* The object cannot be picked up by the monster */ ! if (i_ptr->is_artifact() || (r_ptr->flags3 & flg3)) { /* Only give a message for "take_item" */ if (r_ptr->flags2 & RF2_TAKE_ITEM) *************** *** 2818,2824 **** if (!do_turn && !do_move && m_ptr->monfear) { /* No longer afraid */ ! m_ptr->monfear = 0; /* Message if seen */ if (m_ptr->ml) --- 2482,2488 ---- if (!do_turn && !do_move && m_ptr->monfear) { /* No longer afraid */ ! m_ptr->set_monfear(0); /* Message if seen */ if (m_ptr->ml) *************** *** 2874,2879 **** --- 2538,2544 ---- int fx, fy; bool test; + byte speed; monster_type *m_ptr; monster_race *r_ptr; *************** *** 2904,2914 **** } /* Obtain the energy boost */ ! e = extract_energy[m_ptr->mspeed]; /* Give this monster some energy */ ! m_ptr->energy += e; /* Not enough energy to move */ --- 2569,2584 ---- } + /* Obtain the monster's speed */ + speed = m_ptr->mspeed; + if (m_ptr->temp_speed) speed += 10; + if (m_ptr->temp_slow) speed -= 10; + /* Obtain the energy boost */ ! e = extract_energy[speed]; /* Give this monster some energy */ ! m_ptr->set_energy(m_ptr->energy + e); /* Not enough energy to move */ *************** *** 2915,2921 **** if (m_ptr->energy < 100) continue; /* Use up "some" energy */ ! m_ptr->energy -= 100; /* Hack -- Require proximity */ --- 2585,2591 ---- if (m_ptr->energy < 100) continue; /* Use up "some" energy */ ! m_ptr->set_energy(m_ptr->energy - 100); /* Hack -- Require proximity */ Only in utumno: mon-desc.c Only in utumno: monster.c Only in ick-279: monster1.c Only in ick-279: monster2.c Only in utumno: obj-desc.c Only in utumno: object.c Only in ick-279: object1.c Only in ick-279: object2.c diff -w -c -r ick-279/save.c utumno/save.c *** ick-279/save.c Thu May 15 17:12:22 1997 --- utumno/save.c Thu May 15 17:45:57 1997 *************** *** 312,318 **** fake[0] = (byte)(VERSION_MAJOR); fake[1] = (byte)(VERSION_MINOR); fake[2] = (byte)(VERSION_PATCH); ! fake[3] = (byte)(VERSION_EXTRA); /* Dump the data */ err = fd_write(data_fd, (char*)&fake, 4); --- 312,318 ---- fake[0] = (byte)(VERSION_MAJOR); fake[1] = (byte)(VERSION_MINOR); fake[2] = (byte)(VERSION_PATCH); ! fake[3] = (byte)(VERSION_TYPE); /* Dump the data */ err = fd_write(data_fd, (char*)&fake, 4); *************** *** 432,443 **** /* Write spell data */ ! wr_u32b(spell_learned1); ! wr_u32b(spell_learned2); ! wr_u32b(spell_worked1); ! wr_u32b(spell_worked2); ! wr_u32b(spell_forgotten1); ! wr_u32b(spell_forgotten2); /* Dump the ordered spells */ for (i = 0; i < 64; i++) --- 432,443 ---- /* Write spell data */ ! for (i = 0; i < 64; i++) ! { ! wr_byte(spell_learned[i]); ! wr_byte(spell_worked[i]); ! wr_byte(spell_forgotten[i]); ! } /* Dump the ordered spells */ for (i = 0; i < 64; i++) *************** *** 697,706 **** sf_put(v); } ! static void wr_char(char v) { wr_byte((byte)v); ! } static void wr_u16b(u16b v) { --- 697,706 ---- sf_put(v); } ! /*static void wr_char(char v) { wr_byte((byte)v); ! }*/ static void wr_u16b(u16b v) { *************** *** 752,764 **** wr_byte(i_ptr->iy); wr_byte(i_ptr->ix); - wr_byte(i_ptr->tval); - wr_byte(i_ptr->sval); wr_s16b(i_ptr->pval); wr_byte(i_ptr->discount); wr_byte(i_ptr->number); - wr_s16b(i_ptr->weight); wr_byte(i_ptr->name1); wr_byte(i_ptr->name2); --- 752,761 ---- *************** *** 793,798 **** --- 790,797 ---- { wr_string(""); } + + wr_s16b(i_ptr->next_i_idx); } *************** *** 812,817 **** --- 811,819 ---- wr_byte(m_ptr->stunned); wr_byte(m_ptr->confused); wr_byte(m_ptr->monfear); + wr_byte(m_ptr->temp_speed); + wr_byte(m_ptr->temp_slow); + wr_byte(m_ptr->spawned); wr_byte(0); } *************** *** 1130,1442 **** } - /* - * Mega-Hack -- Initialize a fake object from a terrain feature - * - * This function picks random traps for invisible traps, losing - * invisible trap doors, and converts embedded gold into copper - * worth 50 gold pieces. Locked and Jammed doors get a decent - * guess at the lock/jam value. - * - * XXX XXX XXX This function helps make a fake "2.7.9" savefile. - */ - static bool wr_dungeon_aux(object_type *i_ptr, int y, int x) - { - int f; - bool invis = FALSE; - - cave_type *c_ptr = &cave[y][x]; - - - /* Skip weirdness */ - if (c_ptr->feat == 0x00) return (FALSE); - - /* Skip empty floors */ - if (c_ptr->feat == 0x01) return (FALSE); - - /* Skip empty magma/quartz */ - if (c_ptr->feat == 0x32) return (FALSE); - if (c_ptr->feat == 0x33) return (FALSE); - - /* Skip walls */ - if (c_ptr->feat >= 0x38) return (FALSE); - - /* Wipe the object */ - WIPE(i_ptr, object_type); - - /* A single object */ - i_ptr->number = 1; - - /* Hack -- worthless */ - i_ptr->ident |= ID_BROKEN; - - /* Save the actual feature */ - f = (c_ptr->feat); - - /* Mega-Hack -- invisible traps */ - if (c_ptr->feat == 0x02) - { - /* Make invisible */ - invis = TRUE; - - /* XXX XXX Hack -- assume any trap (except a trap door) */ - c_ptr->feat = 0x10 + randint(15); - } - - /* Analyze the terrain feature */ - switch (c_ptr->feat) - { - /* Invisible trap */ - case 0x02: - /* See above */ - break; - - /* Glyph of warding */ - case 0x03: - i_ptr->k_idx = 459; - i_ptr->tval = 102; - i_ptr->sval = 63; - break; - - /* Open door */ - case 0x04: - i_ptr->k_idx = 446; - i_ptr->tval = 104; - break; - - /* Broken door */ - case 0x05: - i_ptr->k_idx = 446; - i_ptr->tval = 104; - i_ptr->pval = 1; - break; - - /* Up stairs */ - case 0x06: - i_ptr->k_idx = 449; - i_ptr->tval = 107; - break; - - /* Down stairs */ - case 0x07: - i_ptr->k_idx = 450; - i_ptr->tval = 108; - break; - - /* Shops */ - case 0x08: - case 0x09: - case 0x0A: - case 0x0B: - case 0x0C: - case 0x0D: - case 0x0E: - case 0x0F: - i_ptr->k_idx = 451 + (c_ptr->feat & 0x07); - i_ptr->tval = 110; - i_ptr->sval = 1 + (c_ptr->feat & 0x07); - break; - - /* Visible trap -- trap door */ - case 0x10: - i_ptr->k_idx = 462; - i_ptr->tval = 102; - i_ptr->sval = 2; - i_ptr->pval = 20; - break; - - /* Visible trap -- pit */ - case 0x11: - i_ptr->k_idx = 460; - i_ptr->tval = 102; - i_ptr->sval = 0; - i_ptr->pval = 1; - break; - - /* Visible trap -- spiked pit */ - case 0x12: - i_ptr->k_idx = 461; - i_ptr->tval = 102; - i_ptr->sval = 1; - i_ptr->pval = 10; - break; - - /* Visible trap -- poison pit -> spiked pit */ - case 0x13: - i_ptr->k_idx = 461; - i_ptr->tval = 102; - i_ptr->sval = 1; - i_ptr->pval = 10; - break; - - /* Visible trap -- rune -- summon */ - case 0x14: - i_ptr->k_idx = 469; - i_ptr->tval = 102; - i_ptr->sval = 15; - i_ptr->pval = 5; - break; - - /* Visible trap -- rune -- teleport */ - case 0x15: - i_ptr->k_idx = 466; - i_ptr->tval = 102; - i_ptr->sval = 14; - i_ptr->pval = 5; - break; - - /* Visible trap -- spot -- fire */ - case 0x16: - i_ptr->k_idx = 470; - i_ptr->tval = 102; - i_ptr->sval = 12; - i_ptr->pval = 10; - break; - - /* Visible trap -- spot -- acid */ - case 0x17: - i_ptr->k_idx = 471; - i_ptr->tval = 102; - i_ptr->sval = 13; - i_ptr->pval = 10; - break; - - /* Visible trap -- dart -- slow */ - case 0x18: - i_ptr->k_idx = 475; - i_ptr->tval = 102; - i_ptr->sval = 4; - i_ptr->pval = 5; - break; - - /* Visible trap -- dart -- str */ - case 0x19: - i_ptr->k_idx = 465; - i_ptr->tval = 102; - i_ptr->sval = 6; - i_ptr->pval = 5; - break; - - /* Visible trap -- dart -- dex */ - case 0x1A: - i_ptr->k_idx = 468; - i_ptr->tval = 102; - i_ptr->sval = 5; - i_ptr->pval = 5; - break; - - /* Visible trap -- dart -- con */ - case 0x1B: - i_ptr->k_idx = 476; - i_ptr->tval = 102; - i_ptr->sval = 7; - i_ptr->pval = 5; - break; - - /* Visible trap -- gas -- blind */ - case 0x1C: - i_ptr->k_idx = 473; - i_ptr->tval = 102; - i_ptr->sval = 9; - i_ptr->pval = 10; - break; - - /* Visible trap -- gas -- confuse */ - case 0x1D: - i_ptr->k_idx = 474; - i_ptr->tval = 102; - i_ptr->sval = 10; - i_ptr->pval = 10; - break; - - /* Visible trap -- gas -- poison */ - case 0x1E: - i_ptr->k_idx = 472; - i_ptr->tval = 102; - i_ptr->sval = 8; - i_ptr->pval = 10; - break; - - /* Visible trap -- gas -- sleep */ - case 0x1F: - i_ptr->k_idx = 463; - i_ptr->tval = 102; - i_ptr->sval = 11; - i_ptr->pval = 10; - break; - - /* Doors -- locked */ - case 0x20: - case 0x21: - case 0x22: - case 0x23: - case 0x24: - case 0x25: - case 0x26: - case 0x27: - i_ptr->k_idx = 447; - i_ptr->tval = 118; - i_ptr->pval = ((int)(c_ptr->feat & 0x07)) * 2; - break; - - /* Doors -- jammed */ - case 0x28: - case 0x29: - case 0x2A: - case 0x2B: - case 0x2C: - case 0x2D: - case 0x2E: - case 0x2F: - i_ptr->k_idx = 447; - i_ptr->tval = 118; - i_ptr->pval = -1 - ((int)(c_ptr->feat & 0x07)) * 2; - break; - - /* Secret doors */ - case 0x30: - i_ptr->k_idx = 448; - i_ptr->tval = 117; - break; - - /* Rubble */ - case 0x31: - i_ptr->k_idx = 445; - i_ptr->tval = 119; - break; - - /* Hack -- Vein + treasure */ - case 0x34: - case 0x35: - case 0x36: - case 0x37: - i_ptr->k_idx = 480; - i_ptr->tval = 100; - i_ptr->sval = 1; - i_ptr->pval = 50; - break; - } - - /* Hack -- invisible traps */ - if (invis) i_ptr->tval = 101; - - /* Restore the feature */ - c_ptr->feat = f; - - /* Paranoia -- Nothing made */ - if (!i_ptr->k_idx) return (FALSE); - - /* Set the position */ - i_ptr->iy = y; - i_ptr->ix = x; - - /* Success */ - return (TRUE); - } - - - /* * New "cave grid" flags -- saved in savefile */ --- 1132,1138 ---- *************** *** 1473,1486 **** */ static void wr_dungeon() { ! int i, j, y, x; ! byte count, prev_char; ! byte tmp8u; object_type forge; cave_type *c_ptr; - object_type *i_ptr; --- 1169,1179 ---- */ static void wr_dungeon() { ! int i, j, x, y; object_type forge; cave_type *c_ptr; object_type *i_ptr; *************** *** 1495,1511 **** wr_u16b(max_panel_cols); - /*** Simple "Run-Length-Encoding" of cave ***/ - - /* Note that this will induce two wasted bytes */ - count = 0; - prev_char = 0; - /* Dump the cave */ - for (y = 0; y < cur_hgt; y++) - { for (x = 0; x < cur_wid; x++) { /* Get the cave */ c_ptr = &cave[y][x]; --- 1188,1198 ---- wr_u16b(max_panel_cols); /* Dump the cave */ for (x = 0; x < cur_wid; x++) { + for (y = 0; y < cur_hgt; y++) + { /* Get the cave */ c_ptr = &cave[y][x]; *************** *** 1513,1520 **** if (c_ptr->i_idx) { object_type *i_ptr = &i_list[c_ptr->i_idx]; ! i_ptr->iy = y; ! i_ptr->ix = x; } /* Paranoia */ --- 1200,1206 ---- if (c_ptr->i_idx) { object_type *i_ptr = &i_list[c_ptr->i_idx]; ! i_ptr->set_location(x, y); } /* Paranoia */ *************** *** 1521,1617 **** if (c_ptr->m_idx) { monster_type *m_ptr = &m_list[c_ptr->m_idx]; ! m_ptr->fy = y; ! m_ptr->fx = x; } ! /* Start with nothing */ ! tmp8u = 0; ! ! /* The old "vault" flag */ ! if (c_ptr->info & CAVE_ICKY) tmp8u |= OLD_GRID_ICKY; ! ! /* The old "room" flag */ ! if (c_ptr->info & CAVE_ROOM) tmp8u |= OLD_GRID_ROOM; ! ! /* The old "glow" flag */ ! if (c_ptr->info & CAVE_GLOW) tmp8u |= OLD_GRID_GLOW; ! ! /* The old "mark" flag */ ! if (c_ptr->info & CAVE_MARK) tmp8u |= OLD_GRID_MARK; ! ! /* Convert the terrain type */ ! switch (c_ptr->feat) ! { ! case 0x06: ! case 0x07: ! tmp8u |= OLD_GRID_PERM; ! break; ! ! case 0x08: ! case 0x09: ! case 0x0A: ! case 0x0B: ! case 0x0C: ! case 0x0D: ! case 0x0E: ! case 0x0F: ! tmp8u |= OLD_GRID_PERM; ! break; ! ! case 0x32: ! case 0x34: ! case 0x36: ! tmp8u |= OLD_GRID_WALL_MAGMA; ! break; ! ! case 0x33: ! case 0x35: ! case 0x37: ! tmp8u |= OLD_GRID_WALL_QUARTZ; ! break; ! ! case 0x38: ! case 0x39: ! case 0x3A: ! case 0x3B: ! tmp8u |= OLD_GRID_WALL_GRANITE; ! break; ! ! case 0x3C: ! case 0x3D: ! case 0x3E: ! case 0x3F: ! tmp8u |= OLD_GRID_WALL_GRANITE; ! tmp8u |= OLD_GRID_PERM; ! break; } - - /* If the run is broken, or too full, flush it */ - if ((tmp8u != prev_char) || (count == MAX_UCHAR)) - { - wr_byte((byte)count); - wr_byte((byte)prev_char); - prev_char = tmp8u; - count = 1; } - /* Continue the run */ - else - { - count++; - } - } - } - /* Flush the data (if any) */ - if (count) - { - wr_byte((byte)count); - wr_byte((byte)prev_char); - } - - /* Compact the objects */ compact_objects(0); --- 1207,1222 ---- if (c_ptr->m_idx) { monster_type *m_ptr = &m_list[c_ptr->m_idx]; ! m_ptr->set_location(x, y); } ! /* Write features/flags */ ! wr_byte(c_ptr->feat); ! wr_byte(c_ptr->info); } } /* Compact the objects */ compact_objects(0); *************** *** 1622,1637 **** /* Point at the object */ i_ptr = &forge; - /* Fake objects */ - for (y = 0; y < cur_hgt; y++) - { - for (x = 0; x < cur_wid; x++) - { - /* Count "fake objects" */ - if (wr_dungeon_aux(i_ptr, y, x)) j++; - } - } - /* Total objects */ wr_u16b(i_max + j); --- 1227,1232 ---- *************** *** 1645,1661 **** /* Point at the object */ i_ptr = &forge; - /* Fake objects */ - for (y = 0; y < cur_hgt; y++) - { - for (x = 0; x < cur_wid; x++) - { - /* Dump the "fake objects" */ - if (wr_dungeon_aux(i_ptr, y, x)) wr_item(i_ptr); - } - } - /* Compact the monsters */ compact_monsters(0); --- 1240,1246 ---- *************** *** 1679,1685 **** u32b now; - byte tmp8u; u16b tmp16u; --- 1264,1269 ---- *************** *** 1707,1714 **** xor_byte = 0; wr_byte(VERSION_PATCH); xor_byte = 0; ! tmp8u = rand_int(256); ! wr_byte(tmp8u); /* Reset the checksum */ --- 1291,1297 ---- xor_byte = 0; wr_byte(VERSION_PATCH); xor_byte = 0; ! wr_byte(VERSION_TYPE); /* Reset the checksum */ *************** *** 1802,1813 **** /* Write spell data */ ! wr_u32b(spell_learned1); ! wr_u32b(spell_learned2); ! wr_u32b(spell_worked1); ! wr_u32b(spell_worked2); ! wr_u32b(spell_forgotten1); ! wr_u32b(spell_forgotten2); /* Dump the ordered spells */ for (i = 0; i < 64; i++) --- 1385,1396 ---- /* Write spell data */ ! for (i = 0; i < 64; i++) ! { ! wr_byte(spell_learned[i]); ! wr_byte(spell_worked[i]); ! wr_byte(spell_forgotten[i]); ! } /* Dump the ordered spells */ for (i = 0; i < 64; i++) *************** *** 1819,1825 **** /* Write the inventory */ for (i = 0; i < INVEN_TOTAL; i++) { ! if (inventory[i].k_idx) { wr_u16b(i); wr_item(&inventory[i]); --- 1402,1408 ---- /* Write the inventory */ for (i = 0; i < INVEN_TOTAL; i++) { ! if (inventory[i].exists()) { wr_u16b(i); wr_item(&inventory[i]); *************** *** 1888,1893 **** --- 1471,1479 ---- #endif + /* Compress monsters */ + compact_monsters(0); + /* Create the savefile */ fd = fd_make(name, mode); *************** *** 2182,2239 **** sf_patch = vvv[2]; sf_extra = vvv[3]; - /* XXX XXX XXX */ - /* Really old files */ - if ((sf_major == 5) && (sf_minor == 2)) - { - sf_major = 2; - sf_minor = 5; - } - - /* XXX XXX XXX */ - /* Really old files */ - if (sf_major > 2) - { - sf_major = 1; - } - /* Clear screen */ clear_screen(); ! /* Parse "ancient" savefiles */ ! if (sf_major < 2) { ! /* Attempt to load */ ! err = rd_savefile_old(); } ! /* Parse "old" savefiles */ ! else if ((sf_major == 2) && (sf_minor < 7)) { /* Attempt to load */ - err = rd_savefile_old(); - } - - /* Parse "recent" savefiles */ - else if ((sf_major == 2) && (sf_minor == 7)) - { - /* Attempt to load */ err = rd_savefile_new(); } - /* Parse "future" savefiles */ - else - { - - #if 0 - /* Attempt to load */ - err = rd_savefile(); - #endif - - /* Error XXX XXX XXX */ - err = -1; - } - /* Message (below) */ if (err) what = "Cannot parse savefile"; } --- 1768,1792 ---- sf_patch = vvv[2]; sf_extra = vvv[3]; /* Clear screen */ clear_screen(); ! /* Check version */ ! if ((sf_major != version_major) || ! (sf_minor != version_minor) || ! (sf_patch != version_patch) || ! (sf_extra != version_type)) { ! err = -1; } ! /* Parse modern savefiles */ ! else { /* Attempt to load */ err = rd_savefile_new(); } /* Message (below) */ if (err) what = "Cannot parse savefile"; } *************** *** 2269,2285 **** /* Okay */ if (!err) { - /* Give a conversion warning */ - if ((version_major != sf_major) || - (version_minor != sf_minor) || - (version_patch != sf_patch)) - { - /* Message */ - msg_format("Converted a %d.%d.%d savefile.", - sf_major, sf_minor, sf_patch); - msg_print(NULL); - } - /* Player is dead */ if (death) { --- 1822,1827 ---- *************** *** 2333,2340 **** /* Message */ ! msg_format("Error (%s) reading %d.%d.%d savefile.", ! what, sf_major, sf_minor, sf_patch); msg_print(NULL); /* Oops */ --- 1875,1899 ---- /* Message */ ! if (sf_extra == 0) ! { ! msg_format("Error (%s) reading v%d.%da%d savefile.", what, ! sf_major, sf_minor, sf_patch); ! } ! else if (sf_extra == 1) ! { ! msg_format("Error (%s) reading v%d.%db%d savefile.", what, ! sf_major, sf_minor, sf_patch); ! } ! else if (sf_extra == 2) ! { ! msg_format("Error (%s) reading v%d.%d savefile.", what, ! sf_major, sf_minor); ! } ! else ! { ! msg_format("Error (%s) reading v%d savefile.", what, sf_major); ! } msg_print(NULL); /* Oops */ diff -w -c -r ick-279/spells1.c utumno/spells1.c *** ick-279/spells1.c Thu May 15 17:12:22 1997 --- utumno/spells1.c Thu May 15 17:45:57 1997 *************** *** 89,96 **** if (!m_ptr->r_idx) return; /* Save the old location */ - oy = m_ptr->fy; ox = m_ptr->fx; /* Minimum distance */ min = dis / 2; --- 89,96 ---- if (!m_ptr->r_idx) return; /* Save the old location */ ox = m_ptr->fx; + oy = m_ptr->fy; /* Minimum distance */ min = dis / 2; *************** *** 120,126 **** if (!empty_grid_bold(ny, nx)) continue; /* Hack -- no teleport onto glyph of warding */ ! if (cave[ny][nx].feat == 0x03) continue; /* No teleporting into vaults and such */ /* if (cave[ny][nx].info & CAVE_ICKY) continue; */ --- 120,126 ---- if (!empty_grid_bold(ny, nx)) continue; /* Hack -- no teleport onto glyph of warding */ ! if (cave[ny][nx].feat == CF_GLYPH) continue; /* No teleporting into vaults and such */ /* if (cave[ny][nx].info & CAVE_ICKY) continue; */ *************** *** 146,153 **** cave[oy][ox].m_idx = 0; /* Move the monster */ ! m_ptr->fy = ny; ! m_ptr->fx = nx; /* Update the monster (new location) */ update_mon(m_idx, TRUE); --- 146,152 ---- cave[oy][ox].m_idx = 0; /* Move the monster */ ! m_ptr->set_location(nx, ny); /* Update the monster (new location) */ update_mon(m_idx, TRUE); *************** *** 168,174 **** */ void teleport_player(int dis) { ! int d, i, min, ox, oy, x = py, y = px; bool look = TRUE; --- 167,173 ---- */ void teleport_player(int dis) { ! int d, i, min, ox, oy, y = py, x = px; bool look = TRUE; *************** *** 352,369 **** { switch (randint(9)) { ! case 1: return (TERM_RED); ! case 2: return (TERM_GREEN); ! case 3: return (TERM_BLUE); ! case 4: return (TERM_YELLOW); ! case 5: return (TERM_ORANGE); ! case 6: return (TERM_VIOLET); ! case 7: return (TERM_L_RED); ! case 8: return (TERM_L_GREEN); ! case 9: return (TERM_L_BLUE); } ! return (TERM_WHITE); } #endif --- 351,368 ---- { switch (randint(9)) { ! case 1: return TERM_RED; ! case 2: return TERM_GREEN; ! case 3: return TERM_BLUE; ! case 4: return TERM_YELLOW; ! case 5: return TERM_ORANGE; ! case 6: return TERM_VIOLET; ! case 7: return TERM_L_RED; ! case 8: return TERM_L_GREEN; ! case 9: return TERM_L_BLUE; } ! return TERM_WHITE; } #endif *************** *** 377,383 **** #ifdef USE_COLOR ! if (!use_color) return (TERM_WHITE); switch (type) { --- 376,382 ---- #ifdef USE_COLOR ! if (!use_color) return TERM_WHITE; switch (type) { *************** *** 423,437 **** /* ! * Decreases players hit points and sets death flag if necessary * - * XXX XXX XXX Invulnerability needs to be changed into a "shield" - * * XXX XXX XXX Hack -- this function allows the user to save (or quit) * the game when he dies, since the "You die." message is shown before * setting the player to "dead". */ ! void take_hit(int damage, cptr hit_from) { int old_chp = p_ptr->chp; --- 422,457 ---- /* ! * Checks for invulnerability and then calls take_hit_no_invuln(). ! */ ! void take_hit(int damage, cptr hit_from) ! { ! /* Paranoia */ ! if (death) return; ! ! /* Disturb */ ! disturb(1, 0); ! ! /* Mega-Hack -- Apply "invulnerability" */ ! if (p_ptr->invuln && (damage < 9000)) return; ! ! /* Call other function */ ! take_hit_no_invuln(damage, hit_from); ! } ! ! ! ! ! ! /* ! * Decreases players hit points and sets death flag if necessary. Does ! * not permit Globe of Invulnerability to have an effect. * * XXX XXX XXX Hack -- this function allows the user to save (or quit) * the game when he dies, since the "You die." message is shown before * setting the player to "dead". */ ! void take_hit_no_invuln(int damage, cptr hit_from) { int old_chp = p_ptr->chp; *************** *** 445,453 **** /* Disturb */ disturb(1, 0); - /* Mega-Hack -- Apply "invulnerability" */ - if (p_ptr->invuln && (damage < 9000)) return; - /* Hurt the player */ p_ptr->chp -= damage; --- 465,470 ---- *************** *** 458,464 **** if (p_ptr->chp < 0) { /* Sound */ ! sound(SOUND_DEATH); /* Hack -- Note death */ msg_print("You die."); --- 475,481 ---- if (p_ptr->chp < 0) { /* Sound */ ! game_sound(SOUND_DEATH); /* Hack -- Note death */ msg_print("You die."); *************** *** 503,512 **** * Does a given class of objects (usually) hate acid? * Note that acid can either melt or corrode something. */ ! static bool hates_acid(object_type *i_ptr) { /* Analyze the type */ ! switch (i_ptr->tval) { /* Wearable items */ case TV_ARROW: --- 520,529 ---- * Does a given class of objects (usually) hate acid? * Note that acid can either melt or corrode something. */ ! bool object_type::hates_acid(void) { /* Analyze the type */ ! switch (get_tval()) { /* Wearable items */ case TV_ARROW: *************** *** 529,546 **** case TV_STAFF: case TV_SCROLL: ! /* Ouch */ case TV_CHEST: /* Junk is useless */ case TV_SKELETON: case TV_BOTTLE: - case TV_JUNK: ! return (TRUE); } ! return (FALSE); } --- 546,562 ---- case TV_STAFF: case TV_SCROLL: ! /* Ouch (?) */ case TV_CHEST: /* Junk is useless */ case TV_SKELETON: case TV_BOTTLE: ! return TRUE; } ! return FALSE; } *************** *** 547,564 **** /* * Does a given object (usually) hate electricity? */ ! static bool hates_elec(object_type *i_ptr) { ! switch (i_ptr->tval) { case TV_RING: - case TV_WAND: ! ! return (TRUE); } ! return (FALSE); } --- 563,578 ---- /* * Does a given object (usually) hate electricity? */ ! bool object_type::hates_elec(void) { ! switch (get_tval()) { case TV_RING: case TV_WAND: ! return TRUE; } ! return FALSE; } *************** *** 567,576 **** * Hafted/Polearm weapons have wooden shafts. * Arrows/Bows are mostly wooden. */ ! static bool hates_fire(object_type *i_ptr) { /* Analyze the type */ ! switch (i_ptr->tval) { /* Wearable */ case TV_LITE: --- 581,590 ---- * Hafted/Polearm weapons have wooden shafts. * Arrows/Bows are mostly wooden. */ ! bool object_type::hates_fire(void) { /* Analyze the type */ ! switch (get_tval()) { /* Wearable */ case TV_LITE: *************** *** 593,603 **** /* Staffs/Scrolls burn */ case TV_STAFF: case TV_SCROLL: ! ! return (TRUE); } ! return (FALSE); } --- 607,616 ---- /* Staffs/Scrolls burn */ case TV_STAFF: case TV_SCROLL: ! return TRUE; } ! return FALSE; } *************** *** 604,623 **** /* * Does a given object (usually) hate cold? */ ! static bool hates_cold(object_type *i_ptr) { ! switch (i_ptr->tval) { case TV_POTION: - case TV_FLASK: - case TV_BOTTLE: ! ! return (TRUE); } ! ! return (FALSE); } --- 617,632 ---- /* * Does a given object (usually) hate cold? */ ! bool object_type::hates_cold(void) { ! switch (get_tval()) { case TV_POTION: case TV_FLASK: case TV_BOTTLE: ! return TRUE; } ! return FALSE; } *************** *** 634,643 **** static int set_acid_destroy(object_type *i_ptr) { u32b f1, f2, f3; ! if (!hates_acid(i_ptr)) return (FALSE); object_flags(i_ptr, &f1, &f2, &f3); ! if (f3 & TR3_IGNORE_ACID) return (FALSE); ! return (TRUE); } --- 643,652 ---- static int set_acid_destroy(object_type *i_ptr) { u32b f1, f2, f3; ! if (!i_ptr->hates_acid()) return FALSE; object_flags(i_ptr, &f1, &f2, &f3); ! if (f3 & TR3_IGNORE_ACID) return FALSE; ! return TRUE; } *************** *** 647,656 **** static int set_elec_destroy(object_type *i_ptr) { u32b f1, f2, f3; ! if (!hates_elec(i_ptr)) return (FALSE); object_flags(i_ptr, &f1, &f2, &f3); ! if (f3 & TR3_IGNORE_ELEC) return (FALSE); ! return (TRUE); } --- 656,665 ---- static int set_elec_destroy(object_type *i_ptr) { u32b f1, f2, f3; ! if (!i_ptr->hates_elec()) return FALSE; object_flags(i_ptr, &f1, &f2, &f3); ! if (f3 & TR3_IGNORE_ELEC) return FALSE; ! return TRUE; } *************** *** 660,666 **** static int set_fire_destroy(object_type *i_ptr) { u32b f1, f2, f3; ! if (!hates_fire(i_ptr)) return (FALSE); object_flags(i_ptr, &f1, &f2, &f3); if (f3 & TR3_IGNORE_FIRE) return (FALSE); return (TRUE); --- 669,675 ---- static int set_fire_destroy(object_type *i_ptr) { u32b f1, f2, f3; ! if (!i_ptr->hates_fire()) return (FALSE); object_flags(i_ptr, &f1, &f2, &f3); if (f3 & TR3_IGNORE_FIRE) return (FALSE); return (TRUE); *************** *** 673,682 **** static int set_cold_destroy(object_type *i_ptr) { u32b f1, f2, f3; ! if (!hates_cold(i_ptr)) return (FALSE); object_flags(i_ptr, &f1, &f2, &f3); if (f3 & TR3_IGNORE_COLD) return (FALSE); ! return (TRUE); } --- 682,691 ---- static int set_cold_destroy(object_type *i_ptr) { u32b f1, f2, f3; ! if (!i_ptr->hates_cold()) return (FALSE); object_flags(i_ptr, &f1, &f2, &f3); if (f3 & TR3_IGNORE_COLD) return (FALSE); ! return TRUE; } *************** *** 712,718 **** i_ptr = &inventory[i]; /* Hack -- for now, skip artifacts */ ! if (artifact_p(i_ptr)) continue; /* Give this item slot a shot at death */ if ((*typ)(i_ptr)) --- 721,727 ---- i_ptr = &inventory[i]; /* Hack -- for now, skip artifacts */ ! if (i_ptr->is_artifact()) continue; /* Give this item slot a shot at death */ if ((*typ)(i_ptr)) *************** *** 731,737 **** /* Message */ msg_format("%sour %s (%c) %s destroyed!", ! ((i_ptr->number > 1) ? ((amt == i_ptr->number) ? "All of y" : (amt > 1 ? "Some of y" : "One of y")) : "Y"), i_name, index_to_label(i), --- 740,746 ---- /* Message */ msg_format("%sour %s (%c) %s destroyed!", ! (i_ptr->is_plural() ? ((amt == i_ptr->number) ? "All of y" : (amt > 1 ? "Some of y" : "One of y")) : "Y"), i_name, index_to_label(i), *************** *** 769,793 **** char i_name[80]; /* Pick a (possibly empty) inventory slot */ switch (randint(6)) { ! case 1: i_ptr = &inventory[INVEN_BODY]; break; ! case 2: i_ptr = &inventory[INVEN_ARM]; break; ! case 3: i_ptr = &inventory[INVEN_OUTER]; break; ! case 4: i_ptr = &inventory[INVEN_HANDS]; break; ! case 5: i_ptr = &inventory[INVEN_HEAD]; break; ! case 6: i_ptr = &inventory[INVEN_FEET]; break; } /* Nothing to damage */ ! if (!i_ptr->k_idx) return (FALSE); - /* No damage left to be done */ - if (i_ptr->ac + i_ptr->to_a <= 0) return (FALSE); - - /* Describe */ object_desc(i_name, i_ptr, FALSE, 0); --- 778,801 ---- char i_name[80]; + int slot = 0; + /* Pick a (possibly empty) inventory slot */ switch (randint(6)) { ! case 1: slot = INVEN_BODY; break; ! case 2: slot = INVEN_ARM; break; ! case 3: slot = INVEN_OUTER; break; ! case 4: slot = INVEN_HANDS; break; ! case 5: slot = INVEN_HEAD; break; ! case 6: slot = INVEN_FEET; break; } + i_ptr = &inventory[slot]; /* Nothing to damage */ ! if (!i_ptr->exists()) return FALSE; /* Describe */ object_desc(i_name, i_ptr, FALSE, 0); *************** *** 798,812 **** if (f3 & TR3_IGNORE_ACID) { msg_format("Your %s is unaffected!", i_name); ! ! return (TRUE); } /* Message */ msg_format("Your %s is damaged!", i_name); /* Damage the item */ ! i_ptr->to_a--; /* Redraw the choice window */ p_ptr->redraw |= (PR_CHOOSE); --- 806,832 ---- if (f3 & TR3_IGNORE_ACID) { msg_format("Your %s is unaffected!", i_name); ! return TRUE; } + /* Is it destroyed? */ + if (i_ptr->ac + i_ptr->to_a <= 0) + { /* Message */ + msg_format("Your %s is destroyed!", i_name); + + /* Destroy the item */ + inven_item_increase(slot, -1); + inven_item_optimize(slot); + } + else + { + /* Message */ msg_format("Your %s is damaged!", i_name); /* Damage the item */ ! i_ptr->set_to_a(i_ptr->to_a - 1); ! } /* Redraw the choice window */ p_ptr->redraw |= (PR_CHOOSE); *************** *** 815,821 **** p_ptr->update |= (PU_BONUS); /* Item was damaged */ ! return (TRUE); } --- 835,841 ---- p_ptr->update |= (PU_BONUS); /* Item was damaged */ ! return TRUE; } *************** *** 1021,1029 **** /* Handle "high" values */ else { ! /* Hack -- Decrement by a random amount between one-quarter */ ! /* and one-half of the stat bonus times the percentage, with a */ ! /* minimum damage of half the percentage. -CWS */ loss = (((cur-18) / 2 + 1) / 2 + 1); /* Paranoia */ --- 1041,1050 ---- /* Handle "high" values */ else { ! /* Hack -- Decrement by a random amount between one-quarter ! * and one-half of the stat bonus times the percentage, with a ! * minimum damage of half the percentage. -CWS ! */ loss = (((cur-18) / 2 + 1) / 2 + 1); /* Paranoia */ *************** *** 1064,1072 **** /* Handle "high" values */ else { ! /* Hack -- Decrement by a random amount between one-quarter */ ! /* and one-half of the stat bonus times the percentage, with a */ ! /* minimum damage of half the percentage. -CWS */ loss = (((max-18) / 2 + 1) / 2 + 1); loss = ((randint(loss) + loss) * amount) / 100; if (loss < amount/2) loss = amount/2; --- 1085,1094 ---- /* Handle "high" values */ else { ! /* Hack -- Decrement by a random amount between one-quarter ! * and one-half of the stat bonus times the percentage, with a ! * minimum damage of half the percentage. -CWS ! */ loss = (((max-18) / 2 + 1) / 2 + 1); loss = ((randint(loss) + loss) * amount) / 100; if (loss < amount/2) loss = amount/2; *************** *** 1093,1103 **** p_ptr->stat_max[stat] = max; /* Recalculate bonuses */ ! p_ptr->update |= (PU_BONUS); } /* Done */ ! return (res); } --- 1115,1125 ---- p_ptr->stat_max[stat] = max; /* Recalculate bonuses */ ! p_ptr->update |= PU_BONUS; } /* Done */ ! return res; } *************** *** 1116,1126 **** p_ptr->update |= (PU_BONUS); /* Success */ ! return (TRUE); } /* Nothing to restore */ ! return (FALSE); } --- 1138,1148 ---- p_ptr->update |= (PU_BONUS); /* Success */ ! return TRUE; } /* Nothing to restore */ ! return FALSE; } *************** *** 1165,1178 **** i_ptr = &inventory[t]; /* No item, nothing happens */ ! if (!i_ptr->k_idx) return (FALSE); /* Nothing to disenchant */ ! if ((i_ptr->to_h <= 0) && (i_ptr->to_d <= 0) && (i_ptr->to_a <= 0)) { /* Nothing to notice */ ! return (FALSE); } --- 1187,1201 ---- i_ptr = &inventory[t]; /* No item, nothing happens */ ! if (!i_ptr->exists()) return FALSE; /* Nothing to disenchant */ ! if ((i_ptr->to_h <= 0) && (i_ptr->to_d <= 0) && ! (i_ptr->to_a <= 0)) { /* Nothing to notice */ ! return FALSE; } *************** *** 1181,1187 **** /* Artifacts have 60% chance to resist */ ! if (artifact_p(i_ptr) && (rand_int(100) < 60)) { /* Message */ msg_format("Your %s (%c) resist%s disenchantment!", --- 1204,1210 ---- /* Artifacts have 60% chance to resist */ ! if (i_ptr->is_artifact() && percent(60)) { /* Message */ msg_format("Your %s (%c) resist%s disenchantment!", *************** *** 1194,1209 **** /* Disenchant tohit */ ! if (i_ptr->to_h > 0) i_ptr->to_h--; ! if ((i_ptr->to_h > 5) && (rand_int(100) < 20)) i_ptr->to_h--; /* Disenchant todam */ ! if (i_ptr->to_d > 0) i_ptr->to_d--; ! if ((i_ptr->to_d > 5) && (rand_int(100) < 20)) i_ptr->to_d--; /* Disenchant toac */ ! if (i_ptr->to_a > 0) i_ptr->to_a--; ! if ((i_ptr->to_a > 5) && (rand_int(100) < 20)) i_ptr->to_a--; /* Message */ msg_format("Your %s (%c) %s disenchanted!", --- 1217,1241 ---- /* Disenchant tohit */ ! if (i_ptr->to_h > 0) i_ptr->set_to_h(i_ptr->to_h - 1); ! if ((i_ptr->to_h > 5) && (rand_int(100) < 20)) ! { ! i_ptr->set_to_h(i_ptr->to_h - 1); ! } /* Disenchant todam */ ! if (i_ptr->to_d > 0) i_ptr->set_to_d(i_ptr->to_d - 1); ! if ((i_ptr->to_d > 5) && (rand_int(100) < 20)) ! { ! i_ptr->set_to_d(i_ptr->to_d - 1); ! } /* Disenchant toac */ ! if (i_ptr->to_a > 0) i_ptr->set_to_a(i_ptr->to_a - 1); ! if ((i_ptr->to_a > 5) && (rand_int(100) < 20)) ! { ! i_ptr->set_to_a(i_ptr->to_a - 1); ! } /* Message */ msg_format("Your %s (%c) %s disenchanted!", *************** *** 1231,1247 **** switch (randint(7)) { case 1: case 2: case 3: - teleport_player(200); break; case 4: case 5: - teleport_player_to(m_ptr->fy, m_ptr->fx); break; case 6: - if (rand_int(100) < p_ptr->skill_sav) { msg_print("You resist the effects!"); --- 1263,1276 ---- *************** *** 1253,1270 **** break; case 7: - if (rand_int(100) < p_ptr->skill_sav) { msg_print("You resist the effects!"); break; } - msg_print("Your body starts to scramble..."); /* Pick a pair of stats */ ii = rand_int(6); ! for (jj = ii; jj == ii; jj = rand_int(6)) ; max1 = p_ptr->stat_max[ii]; cur1 = p_ptr->stat_cur[ii]; --- 1282,1300 ---- break; case 7: if (rand_int(100) < p_ptr->skill_sav) { msg_print("You resist the effects!"); break; } msg_print("Your body starts to scramble..."); /* Pick a pair of stats */ ii = rand_int(6); ! do ! { ! jj = rand_int(6); ! } while (ii == jj); max1 = p_ptr->stat_max[ii]; cur1 = p_ptr->stat_cur[ii]; *************** *** 1308,1322 **** * We return "TRUE" if the effect of the projection is "obvious". * * XXX XXX XXX We also "see" grids which are "memorized", probably a hack - * - * XXX XXX XXX Perhaps we should affect doors? */ static bool project_f(int who, int r, int y, int x, int dam, int typ) { cave_type *c_ptr = &cave[y][x]; - bool obvious = FALSE; - int div; --- 1338,1348 ---- *************** *** 1334,1351 **** /* Analyze the type */ switch (typ) { ! /* Ignore most effects */ case GF_ACID: - case GF_ELEC: case GF_FIRE: - case GF_COLD: case GF_PLASMA: case GF_METEOR: case GF_ICE: case GF_SHARDS: case GF_FORCE: case GF_SOUND: - case GF_MANA: case GF_HOLY_ORB: break; --- 1360,1380 ---- /* Analyze the type */ switch (typ) { ! /* XXX XXX XXX should destroy doors */ case GF_ACID: case GF_FIRE: case GF_PLASMA: case GF_METEOR: + case GF_MANA: + break; + + /* Ignore most effects */ + case GF_ELEC: + case GF_COLD: case GF_ICE: case GF_SHARDS: case GF_FORCE: case GF_SOUND: case GF_HOLY_ORB: break; *************** *** 1363,1369 **** } /* Destroy the trap */ ! c_ptr->feat = 0x01; /* Notice */ note_spot(y, x); --- 1392,1398 ---- } /* Destroy the trap */ ! c_ptr->feat = CF_FLOOR; /* Notice */ note_spot(y, x); *************** *** 1470,1477 **** } /* Destroy all closed doors */ ! if ((c_ptr->feat >= 0x20) && ! (c_ptr->feat <= 0x2F)) { /* Hack -- special message */ if (c_ptr->info & CAVE_MARK) --- 1499,1505 ---- } /* Destroy all closed doors */ ! if ((c_ptr->feat >= 0x20) && (c_ptr->feat <= 0x2F)) { /* Hack -- special message */ if (c_ptr->info & CAVE_MARK) *************** *** 1519,1525 **** } /* Destroy the wall */ ! c_ptr->feat = 0x01; } /* Quartz / Magma with treasure */ --- 1547,1553 ---- } /* Destroy the wall */ ! c_ptr->feat = CF_FLOOR; } /* Quartz / Magma with treasure */ *************** *** 1766,1775 **** object_flags(i_ptr, &f1, &f2, &f3); /* Get the "plural"-ness */ ! if (i_ptr->number > 1) plural = TRUE; /* Check for artifact */ ! if (artifact_p(i_ptr)) is_art = TRUE; /* Analyze the type */ switch (typ) --- 1794,1803 ---- object_flags(i_ptr, &f1, &f2, &f3); /* Get the "plural"-ness */ ! if (i_ptr->is_plural()) plural = TRUE; /* Check for artifact */ ! if (i_ptr->is_artifact()) is_art = TRUE; /* Analyze the type */ switch (typ) *************** *** 1776,1782 **** { /* Acid -- Lots of things */ case GF_ACID: ! if (hates_acid(i_ptr)) { do_kill = TRUE; note_kill = (plural ? " melt!" : " melts!"); --- 1804,1810 ---- { /* Acid -- Lots of things */ case GF_ACID: ! if (i_ptr->hates_acid()) { do_kill = TRUE; note_kill = (plural ? " melt!" : " melts!"); *************** *** 1786,1792 **** /* Elec -- Rings and Wands */ case GF_ELEC: ! if (hates_elec(i_ptr)) { do_kill = TRUE; note_kill= (plural ? " is destroyed!" : " is destroyed!"); --- 1814,1820 ---- /* Elec -- Rings and Wands */ case GF_ELEC: ! if (i_ptr->hates_elec()) { do_kill = TRUE; note_kill= (plural ? " is destroyed!" : " is destroyed!"); *************** *** 1796,1802 **** /* Fire -- Flammable objects */ case GF_FIRE: ! if (hates_fire(i_ptr)) { do_kill = TRUE; note_kill = (plural ? " burn up!" : " burns up!"); --- 1824,1830 ---- /* Fire -- Flammable objects */ case GF_FIRE: ! if (i_ptr->hates_fire()) { do_kill = TRUE; note_kill = (plural ? " burn up!" : " burns up!"); *************** *** 1806,1812 **** /* Cold -- potions and flasks */ case GF_COLD: ! if (hates_cold(i_ptr)) { note_kill = (plural ? " shatter!" : " shatters!"); do_kill = TRUE; --- 1834,1840 ---- /* Cold -- potions and flasks */ case GF_COLD: ! if (i_ptr->hates_cold()) { note_kill = (plural ? " shatter!" : " shatters!"); do_kill = TRUE; *************** *** 1816,1828 **** /* Fire + Elec */ case GF_PLASMA: ! if (hates_fire(i_ptr)) { do_kill = TRUE; note_kill = (plural ? " burn up!" : " burns up!"); if (f3 & TR3_IGNORE_FIRE) ignore = TRUE; } ! if (hates_elec(i_ptr)) { ignore = FALSE; do_kill = TRUE; --- 1844,1856 ---- /* Fire + Elec */ case GF_PLASMA: ! if (i_ptr->hates_fire()) { do_kill = TRUE; note_kill = (plural ? " burn up!" : " burns up!"); if (f3 & TR3_IGNORE_FIRE) ignore = TRUE; } ! if (i_ptr->hates_elec()) { ignore = FALSE; do_kill = TRUE; *************** *** 1833,1845 **** /* Fire + Cold */ case GF_METEOR: ! if (hates_fire(i_ptr)) { do_kill = TRUE; note_kill = (plural ? " burn up!" : " burns up!"); if (f3 & TR3_IGNORE_FIRE) ignore = TRUE; } ! if (hates_cold(i_ptr)) { ignore = FALSE; do_kill = TRUE; --- 1861,1873 ---- /* Fire + Cold */ case GF_METEOR: ! if (i_ptr->hates_fire()) { do_kill = TRUE; note_kill = (plural ? " burn up!" : " burns up!"); if (f3 & TR3_IGNORE_FIRE) ignore = TRUE; } ! if (i_ptr->hates_cold()) { ignore = FALSE; do_kill = TRUE; *************** *** 1853,1859 **** case GF_SHARDS: case GF_FORCE: case GF_SOUND: ! if (hates_cold(i_ptr)) { note_kill = (plural ? " shatter!" : " shatters!"); do_kill = TRUE; --- 1881,1887 ---- case GF_SHARDS: case GF_FORCE: case GF_SOUND: ! if (i_ptr->hates_cold()) { note_kill = (plural ? " shatter!" : " shatters!"); do_kill = TRUE; *************** *** 1867,1873 **** /* Holy Orb -- destroys cursed non-artifacts */ case GF_HOLY_ORB: ! if (cursed_p(i_ptr)) { do_kill = TRUE; note_kill= (plural ? " is destroyed!" : " is destroyed!"); --- 1895,1901 ---- /* Holy Orb -- destroys cursed non-artifacts */ case GF_HOLY_ORB: ! if (i_ptr->is_cursed()) { do_kill = TRUE; note_kill= (plural ? " is destroyed!" : " is destroyed!"); *************** *** 1885,1894 **** if (i_ptr->pval > 0) { /* Disarm or Unlock */ ! i_ptr->pval = (0 - i_ptr->pval); /* Identify */ ! object_known(i_ptr); /* Notice */ if (i_ptr->marked) --- 1913,1922 ---- if (i_ptr->pval > 0) { /* Disarm or Unlock */ ! i_ptr->set_pval(-i_ptr->pval); /* Identify */ ! i_ptr->object_known(); /* Notice */ if (i_ptr->marked) *************** *** 2007,2013 **** cave_type *c_ptr = &cave[y][x]; monster_type *m_ptr = &m_list[c_ptr->m_idx]; - monster_race *r_ptr = &r_info[m_ptr->r_idx]; cptr name = (r_name + r_ptr->name); --- 2035,2040 ---- *************** *** 2020,2026 **** /* Polymorph setting (true or false) */ ! int do_poly = 0; /* Teleport setting (max distance) */ int do_dist = 0; --- 2047,2053 ---- /* Polymorph setting (true or false) */ ! int do_poly = FALSE; /* Teleport setting (max distance) */ int do_dist = 0; *************** *** 2090,2095 **** --- 2117,2128 ---- /* Magic Missile -- pure damage */ case GF_MISSILE: if (seen) obvious = TRUE; + if (r_ptr->flags3 & RF3_RES_MAGIC) + { + note = " is unaffected!"; + dam = 0; + if (seen) r_ptr->r_flags3 |= RF3_RES_MAGIC; + } break; /* Acid */ *************** *** 2147,2157 **** } break; ! /* Holy Orb -- hurts Evil */ case GF_HOLY_ORB: if (seen) obvious = TRUE; ! if (r_ptr->flags3 & RF3_EVIL) { dam *= 2; note = " is hit hard."; if (seen) r_ptr->r_flags3 |= RF3_EVIL; --- 2180,2196 ---- } break; ! /* Holy Orb -- hurts evil, undead */ case GF_HOLY_ORB: if (seen) obvious = TRUE; ! if (r_ptr->flags3 & RF3_UNDEAD) { + dam *= 3; + note = " is hit very hard."; + if (seen) r_ptr->r_flags3 |= RF3_UNDEAD; + } + else if (r_ptr->flags3 & RF3_EVIL) + { dam *= 2; note = " is hit hard."; if (seen) r_ptr->r_flags3 |= RF3_EVIL; *************** *** 2166,2176 **** /* Plasma -- XXX perhaps check ELEC or FIRE */ case GF_PLASMA: if (seen) obvious = TRUE; ! if (prefix(name, "Plasma") || ! (r_ptr->flags4 & RF4_BR_PLAS)) { note = " resists."; dam *= 3; dam /= (randint(6)+6); } break; --- 2205,2215 ---- /* Plasma -- XXX perhaps check ELEC or FIRE */ case GF_PLASMA: if (seen) obvious = TRUE; ! if (r_ptr->flags3 & RF3_RES_PLASMA) { note = " resists."; dam *= 3; dam /= (randint(6)+6); + if (seen) r_ptr->r_flags3 |= RF3_RES_PLASMA; } break; *************** *** 2199,2208 **** /* Water (acid) damage -- Water spirits/elementals are immune */ case GF_WATER: if (seen) obvious = TRUE; ! if ((r_ptr->r_char == 'E') && prefix(name, "W")) { note = " is immune."; dam = 0; } break; --- 2238,2248 ---- /* Water (acid) damage -- Water spirits/elementals are immune */ case GF_WATER: if (seen) obvious = TRUE; ! if (r_ptr->flags3 & RF3_RES_WATER) { note = " is immune."; dam = 0; + if (seen) r_ptr->r_flags3 |= RF3_RES_WATER; } break; *************** *** 2209,2222 **** /* Chaos -- Chaos breathers resist */ case GF_CHAOS: if (seen) obvious = TRUE; - do_poly = TRUE; do_conf = (5 + randint(11)) / div; if (r_ptr->flags4 & RF4_BR_CHAO) { note = " resists."; dam *= 3; dam /= (randint(6)+6); - do_poly = FALSE; } break; /* Shards -- Shard breathers resist */ --- 2249,2267 ---- /* Chaos -- Chaos breathers resist */ case GF_CHAOS: if (seen) obvious = TRUE; do_conf = (5 + randint(11)) / div; if (r_ptr->flags4 & RF4_BR_CHAO) { note = " resists."; dam *= 3; dam /= (randint(6)+6); } + else if (percent(60)) + { + if (rand_int(3000) > r_ptr->level * r_ptr->level) + { + do_poly = TRUE; + } + } break; /* Shards -- Shard breathers resist */ *************** *** 2260,2266 **** case GF_DISENCHANT: if (seen) obvious = TRUE; if ((r_ptr->flags4 & RF4_BR_DISE) || ! prefix(name, "Disen")) { note = " resists."; dam *= 3; dam /= (randint(6)+6); --- 2305,2311 ---- case GF_DISENCHANT: if (seen) obvious = TRUE; if ((r_ptr->flags4 & RF4_BR_DISE) || ! prefix(name, "disen")) { note = " resists."; dam *= 3; dam /= (randint(6)+6); *************** *** 2270,2277 **** /* Nexus -- Breathers and Existers resist */ case GF_NEXUS: if (seen) obvious = TRUE; ! if ((r_ptr->flags4 & RF4_BR_NEXU) || ! prefix(name, "Nexus")) { note = " resists."; dam *= 3; dam /= (randint(6)+6); --- 2315,2321 ---- /* Nexus -- Breathers and Existers resist */ case GF_NEXUS: if (seen) obvious = TRUE; ! if ((r_ptr->flags4 & RF4_BR_NEXU) || prefix(name, "nexus")) { note = " resists."; dam *= 3; dam /= (randint(6)+6); *************** *** 2377,2384 **** /* Powerful monsters can resist */ if ((r_ptr->flags1 & RF1_UNIQUE) || ! (r_ptr->level > randint((dam - 10) < 1 ? 1 : (dam - 10)) + 10)) { note = " is unaffected!"; do_poly = FALSE; obvious = FALSE; --- 2421,2434 ---- /* Powerful monsters can resist */ if ((r_ptr->flags1 & RF1_UNIQUE) || ! (r_ptr->flags3 & RF3_RES_MAGIC) || ! monster_saves(r_ptr->level, dam-10)) { + if (r_ptr->flags3 & RF3_RES_MAGIC) + { + if (seen) r_ptr->r_flags3 |= RF3_RES_MAGIC; + } + note = " is unaffected!"; do_poly = FALSE; obvious = FALSE; *************** *** 2396,2405 **** if (seen) obvious = TRUE; /* Heal fully */ ! m_ptr->hp = m_ptr->maxhp; /* Speed up */ ! if (m_ptr->mspeed < 150) m_ptr->mspeed += 10; /* Attempt to clone. */ if (multiply_monster(c_ptr->m_idx)) --- 2446,2458 ---- if (seen) obvious = TRUE; /* Heal fully */ ! m_ptr->set_hp(m_ptr->maxhp); /* Speed up */ ! if (m_ptr->temp_speed < 30) ! { ! m_ptr->set_temp_speed(30); ! } /* Attempt to clone. */ if (multiply_monster(c_ptr->m_idx)) *************** *** 2419,2431 **** if (seen) obvious = TRUE; /* Wake up */ ! m_ptr->csleep = 0; /* Heal */ ! m_ptr->hp += dam; /* No overflow */ ! if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp; /* Redraw (later) if needed */ if (health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH); --- 2472,2487 ---- if (seen) obvious = TRUE; /* Wake up */ ! m_ptr->set_csleep(0); /* Heal */ ! m_ptr->set_hp(m_ptr->hp + dam); /* No overflow */ ! if (m_ptr->hp > m_ptr->maxhp) ! { ! m_ptr->set_hp(m_ptr->maxhp); ! } /* Redraw (later) if needed */ if (health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH); *************** *** 2444,2450 **** if (seen) obvious = TRUE; /* Speed up */ ! if (m_ptr->mspeed < 150) m_ptr->mspeed += 10; note = " starts moving faster."; /* No "real" damage */ --- 2500,2507 ---- if (seen) obvious = TRUE; /* Speed up */ ! m_ptr->set_temp_speed(m_ptr->temp_speed + 10 + randint(10)); ! if (m_ptr->temp_speed > 200) m_ptr->set_temp_speed(200); note = " starts moving faster."; /* No "real" damage */ *************** *** 2459,2466 **** /* Powerful monsters can resist */ if ((r_ptr->flags1 & RF1_UNIQUE) || ! (r_ptr->level > randint((dam - 10) < 1 ? 1 : (dam - 10)) + 10)) { note = " is unaffected!"; obvious = FALSE; } --- 2516,2529 ---- /* Powerful monsters can resist */ if ((r_ptr->flags1 & RF1_UNIQUE) || ! (r_ptr->flags3 & RF3_RES_MAGIC) || ! monster_saves(r_ptr->level, dam)) { + if (r_ptr->flags3 & RF3_RES_MAGIC) + { + if (seen) r_ptr->r_flags3 |= RF3_RES_MAGIC; + } + note = " is unaffected!"; obvious = FALSE; } *************** *** 2468,2474 **** /* Normal monsters slow down */ else { ! if (m_ptr->mspeed > 60) m_ptr->mspeed -= 10; note = " starts moving slower."; } --- 2531,2538 ---- /* Normal monsters slow down */ else { ! m_ptr->set_temp_slow(m_ptr->temp_slow + 10 + randint(10)); ! if (m_ptr->temp_slow > 200) m_ptr->set_temp_slow(200); note = " starts moving slower."; } *************** *** 2485,2491 **** /* Attempt a saving throw */ if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags3 & RF3_NO_SLEEP) || ! (r_ptr->level > randint((dam - 10) < 1 ? 1 : (dam - 10)) + 10)) { /* Memorize a flag */ if (r_ptr->flags3 & RF3_NO_SLEEP) --- 2549,2556 ---- /* Attempt a saving throw */ if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags3 & RF3_NO_SLEEP) || ! (r_ptr->flags3 & RF3_RES_MAGIC) || ! monster_saves(r_ptr->level, dam)) { /* Memorize a flag */ if (r_ptr->flags3 & RF3_NO_SLEEP) *************** *** 2492,2497 **** --- 2557,2566 ---- { if (seen) r_ptr->r_flags3 |= RF3_NO_SLEEP; } + if (r_ptr->flags3 & RF3_RES_MAGIC) + { + if (seen) r_ptr->r_flags3 |= RF3_RES_MAGIC; + } /* No obvious effect */ note = " is unaffected!"; *************** *** 2520,2526 **** /* Attempt a saving throw */ if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags3 & RF3_NO_CONF) || ! (r_ptr->level > randint((dam - 10) < 1 ? 1 : (dam - 10)) + 10)) { /* Memorize a flag */ if (r_ptr->flags3 & RF3_NO_CONF) --- 2589,2596 ---- /* Attempt a saving throw */ if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags3 & RF3_NO_CONF) || ! (r_ptr->flags3 & RF3_RES_MAGIC) || ! monster_saves(r_ptr->level, dam)) { /* Memorize a flag */ if (r_ptr->flags3 & RF3_NO_CONF) *************** *** 2527,2532 **** --- 2597,2606 ---- { if (seen) r_ptr->r_flags3 |= RF3_NO_CONF; } + if (r_ptr->flags3 & RF3_RES_MAGIC) + { + if (seen) r_ptr->r_flags3 |= RF3_RES_MAGIC; + } /* Resist */ do_conf = 0; *************** *** 2688,2694 **** do_fear = damroll(3, (dam / 2)) + 1; /* Attempt a saving throw */ ! if (r_ptr->level > randint((dam - 10) < 1 ? 1 : (dam - 10)) + 10) { /* No obvious effect */ note = " is unaffected!"; --- 2762,2768 ---- do_fear = damroll(3, (dam / 2)) + 1; /* Attempt a saving throw */ ! if (monster_saves(r_ptr->level, dam)) { /* No obvious effect */ note = " is unaffected!"; *************** *** 2718,2724 **** do_fear = damroll(3, (dam / 2)) + 1; /* Attempt a saving throw */ ! if (r_ptr->level > randint((dam - 10) < 1 ? 1 : (dam - 10)) + 10) { /* No obvious effect */ note = " is unaffected!"; --- 2792,2798 ---- do_fear = damroll(3, (dam / 2)) + 1; /* Attempt a saving throw */ ! if (monster_saves(r_ptr->level, dam)) { /* No obvious effect */ note = " is unaffected!"; *************** *** 2744,2750 **** /* Attempt a saving throw */ if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags3 & RF3_NO_FEAR) || ! (r_ptr->level > randint((dam - 10) < 1 ? 1 : (dam - 10)) + 10)) { /* No obvious effect */ note = " is unaffected!"; --- 2818,2824 ---- /* Attempt a saving throw */ if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags3 & RF3_NO_FEAR) || ! monster_saves(r_ptr->level, dam)) { /* No obvious effect */ note = " is unaffected!"; *************** *** 2854,2861 **** note = note_dies; } ! /* Mega-Hack -- Handle "polymorph" -- monsters get a saving throw */ ! else if (do_poly && (randint(90) > r_ptr->level)) { /* Default -- assume no polymorph */ note = " is unaffected!"; --- 2928,2935 ---- note = note_dies; } ! /* Mega-Hack -- Handle "polymorph" */ ! else if (do_poly) { /* Default -- assume no polymorph */ note = " is unaffected!"; *************** *** 2904,2911 **** teleport_away(c_ptr->m_idx, do_dist); /* Hack -- get new location */ - y = m_ptr->fy; x = m_ptr->fx; /* Hack -- get new grid */ c_ptr = &cave[y][x]; --- 2978,2985 ---- teleport_away(c_ptr->m_idx, do_dist); /* Hack -- get new location */ x = m_ptr->fx; + y = m_ptr->fy; /* Hack -- get new grid */ c_ptr = &cave[y][x]; *************** *** 2932,2938 **** } /* Apply stun */ ! m_ptr->stunned = (i < 200) ? i : 200; } /* Confusion and Chaos breathers (and sleepers) never confuse */ --- 3006,3012 ---- } /* Apply stun */ ! m_ptr->set_stunned((i < 200) ? i : 200); } /* Confusion and Chaos breathers (and sleepers) never confuse */ *************** *** 2959,2965 **** } /* Apply confusion */ ! m_ptr->confused = (i < 200) ? i : 200; } --- 3033,3039 ---- } /* Apply confusion */ ! m_ptr->set_confused((i < 200) ? i : 200); } *************** *** 2970,2976 **** i = m_ptr->monfear + do_fear; /* Set fear */ ! m_ptr->monfear = (i < 200) ? i : 200; } --- 3044,3050 ---- i = m_ptr->monfear + do_fear; /* Set fear */ ! m_ptr->set_monfear((i < 200) ? i : 200); } *************** *** 2981,2990 **** if (health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH); /* Wake the monster up */ ! m_ptr->csleep = 0; /* Hurt the monster */ ! m_ptr->hp -= dam; /* Dead monster */ if (m_ptr->hp < 0) --- 3055,3064 ---- if (health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH); /* Wake the monster up */ ! m_ptr->set_csleep(0); /* Hurt the monster */ ! m_ptr->set_hp(m_ptr->hp - dam); /* Dead monster */ if (m_ptr->hp < 0) *************** *** 3009,3015 **** else if (dam > 0) message_pain(c_ptr->m_idx, dam); /* Hack -- handle sleep */ ! if (do_sleep) m_ptr->csleep = do_sleep; } } --- 3083,3089 ---- else if (dam > 0) message_pain(c_ptr->m_idx, dam); /* Hack -- handle sleep */ ! if (do_sleep) m_ptr->set_csleep(do_sleep); } } *************** *** 3034,3043 **** else if (dam > 0) message_pain(c_ptr->m_idx, dam); /* Take note */ ! if ((fear || do_fear) && (m_ptr->ml)) { /* Sound */ ! sound(SOUND_FLEE); /* Message */ msg_format("%^s flees in terror!", m_name); --- 3108,3117 ---- else if (dam > 0) message_pain(c_ptr->m_idx, dam); /* Take note */ ! if ((fear || do_fear) && m_ptr->ml) { /* Sound */ ! game_sound(SOUND_FLEE); /* Message */ msg_format("%^s flees in terror!", m_name); *************** *** 3044,3050 **** } /* Hack -- handle sleep */ ! if (do_sleep) m_ptr->csleep = do_sleep; } } --- 3118,3124 ---- } /* Hack -- handle sleep */ ! if (do_sleep) m_ptr->set_csleep(do_sleep); } } *************** *** 3082,3091 **** */ static bool project_p(int who, int r, int y, int x, int dam, int typ) { ! int k = 0; - int div; - /* Hack -- assume obvious */ bool obvious = TRUE; --- 3156,3163 ---- */ static bool project_p(int who, int r, int y, int x, int dam, int typ) { ! int k = 0, div; /* Hack -- assume obvious */ bool obvious = TRUE; *************** *** 3178,3184 **** take_hit(dam, killer); if (!(p_ptr->resist_pois || p_ptr->oppose_pois)) { ! (void)set_poisoned(p_ptr->poisoned + rand_int(dam) + 10); } break; --- 3250,3256 ---- take_hit(dam, killer); if (!(p_ptr->resist_pois || p_ptr->oppose_pois)) { ! set_poisoned(p_ptr->poisoned + rand_int(dam) + 10); } break; *************** *** 3205,3214 **** case GF_PLASMA: if (fuzzy) msg_print("You are hit by something!"); take_hit(dam, killer); ! if (!p_ptr->resist_sound) { int k = (randint((dam > 40) ? 35 : (dam * 3 / 4 + 5))); ! (void)set_stun(p_ptr->stun + k); } break; --- 3277,3286 ---- case GF_PLASMA: if (fuzzy) msg_print("You are hit by something!"); take_hit(dam, killer); ! if (!p_ptr->resist_sound && !p_ptr->invuln) { int k = (randint((dam > 40) ? 35 : (dam * 3 / 4 + 5))); ! set_stun(p_ptr->stun + k); } break; *************** *** 3242,3254 **** /* Water -- stun/confuse */ case GF_WATER: if (fuzzy) msg_print("You are hit by something!"); ! if (!p_ptr->resist_sound) { ! (void)set_stun(p_ptr->stun + randint(40)); } if (!p_ptr->resist_conf) { ! (void)set_confused(p_ptr->confused + randint(5) + 5); } take_hit(dam, killer); break; --- 3314,3326 ---- /* Water -- stun/confuse */ case GF_WATER: if (fuzzy) msg_print("You are hit by something!"); ! if (!p_ptr->resist_sound && !p_ptr->invuln) { ! set_stun(p_ptr->stun + randint(40)); } if (!p_ptr->resist_conf) { ! set_confused(p_ptr->confused + randint(5) + 5); } take_hit(dam, killer); break; *************** *** 3295,3303 **** { dam *= 6; dam /= (randint(6) + 6); } ! else { ! (void)set_cut(p_ptr->cut + dam); } take_hit(dam, killer); break; --- 3367,3375 ---- { dam *= 6; dam /= (randint(6) + 6); } ! else if (!p_ptr->invuln) { ! set_cut(p_ptr->cut + dam); } take_hit(dam, killer); break; *************** *** 3309,3318 **** { dam *= 5; dam /= (randint(6) + 6); } ! else { int k = (randint((dam > 90) ? 35 : (dam / 3 + 5))); ! (void)set_stun(p_ptr->stun + k); } take_hit(dam, killer); break; --- 3381,3390 ---- { dam *= 5; dam /= (randint(6) + 6); } ! else if (!p_ptr->invuln) { int k = (randint((dam > 90) ? 35 : (dam / 3 + 5))); ! set_stun(p_ptr->stun + k); } take_hit(dam, killer); break; *************** *** 3326,3332 **** } if (!p_ptr->resist_conf) { ! (void)set_confused(p_ptr->confused + randint(20) + 10); } take_hit(dam, killer); break; --- 3398,3404 ---- } if (!p_ptr->resist_conf) { ! set_confused(p_ptr->confused + randint(20) + 10); } take_hit(dam, killer); break; *************** *** 3340,3346 **** } else { ! (void)apply_disenchant(0); } take_hit(dam, killer); break; --- 3412,3418 ---- } else { ! apply_disenchant(0); } take_hit(dam, killer); break; *************** *** 3362,3370 **** /* Force -- mostly stun */ case GF_FORCE: if (fuzzy) msg_print("You are hit by something!"); ! if (!p_ptr->resist_sound) { ! (void)set_stun(p_ptr->stun + randint(20)); } take_hit(dam, killer); break; --- 3434,3442 ---- /* Force -- mostly stun */ case GF_FORCE: if (fuzzy) msg_print("You are hit by something!"); ! if (!p_ptr->resist_sound && !p_ptr->invuln) { ! set_stun(p_ptr->stun + randint(20)); } take_hit(dam, killer); break; *************** *** 3385,3391 **** } else if (!blind && !p_ptr->resist_blind) { ! (void)set_blind(p_ptr->blind + randint(5) + 2); } take_hit(dam, killer); break; --- 3457,3463 ---- } else if (!blind && !p_ptr->resist_blind) { ! add_blind(randint(5) + 2); } take_hit(dam, killer); break; *************** *** 3399,3405 **** } else if (!blind && !p_ptr->resist_blind) { ! (void)set_blind(p_ptr->blind + randint(5) + 2); } take_hit(dam, killer); break; --- 3471,3477 ---- } else if (!blind && !p_ptr->resist_blind) { ! add_blind(randint(5) + 2); } take_hit(dam, killer); break; *************** *** 3453,3463 **** if (fuzzy) msg_print("You are hit by something strange!"); msg_print("Gravity warps around you."); teleport_player(5); ! (void)set_slow(p_ptr->slow + rand_int(4) + 4); ! if (!p_ptr->resist_sound) { int k = (randint((dam > 90) ? 35 : (dam / 3 + 5))); ! (void)set_stun(p_ptr->stun + k); } take_hit(dam, killer); break; --- 3525,3535 ---- if (fuzzy) msg_print("You are hit by something strange!"); msg_print("Gravity warps around you."); teleport_player(5); ! set_slow(p_ptr->slow + rand_int(4) + 4); ! if (!p_ptr->resist_sound && !p_ptr->invuln) { int k = (randint((dam > 90) ? 35 : (dam / 3 + 5))); ! set_stun(p_ptr->stun + k); } take_hit(dam, killer); break; *************** *** 3478,3490 **** case GF_ICE: if (fuzzy) msg_print("You are hit by something sharp!"); cold_dam(dam, killer); ! if (!p_ptr->resist_shard) { ! (void)set_cut(p_ptr->cut + damroll(5, 8)); } ! if (!p_ptr->resist_sound) { ! (void)set_stun(p_ptr->stun + randint(15)); } break; --- 3550,3562 ---- case GF_ICE: if (fuzzy) msg_print("You are hit by something sharp!"); cold_dam(dam, killer); ! if (!p_ptr->resist_shard && !p_ptr->invuln) { ! set_cut(p_ptr->cut + damroll(5, 8)); } ! if (!p_ptr->resist_sound && !p_ptr->invuln) { ! set_stun(p_ptr->stun + randint(15)); } break; *************** *** 3699,3706 **** /* Location of player */ - y0 = py; x0 = px; /* Hack -- Jump to target */ --- 3771,3778 ---- /* Location of player */ x0 = px; + y0 = py; /* Hack -- Jump to target */ *************** *** 3720,3727 **** /* Start at a monster */ else { ! x1 = m_list[who].fx; ! y1 = m_list[who].fy; } --- 3792,3799 ---- /* Start at a monster */ else { ! x1 = m_list[who].get_fx(); ! y1 = m_list[who].get_fy(); } *************** *** 3894,3901 **** x = gx[i]; /* The player can see it */ ! if (player_has_los_bold(y, x) && ! panel_contains(y, x)) { drawn = TRUE; print_rel('*', spell_color(typ), y, x); --- 3966,3972 ---- x = gx[i]; /* The player can see it */ ! if (player_has_los_bold(y, x) && panel_contains(y, x)) { drawn = TRUE; print_rel('*', spell_color(typ), y, x); *************** *** 3923,3930 **** x = gx[i]; /* Erase if needed */ ! if (player_has_los_bold(y, x) && ! panel_contains(y, x)) { lite_spot(y, x); } --- 3994,4000 ---- x = gx[i]; /* Erase if needed */ ! if (player_has_los_bold(y, x) && panel_contains(y, x)) { lite_spot(y, x); } *************** *** 4023,4036 **** { monster_type *m_ptr = &m_list[cave[y][x].m_idx]; /* Hack -- auto-recall */ ! if (m_ptr->ml) recent_track(m_ptr->r_idx); /* Hack - auto-track */ ! if (m_ptr->ml) health_track(cave[y][x].m_idx); } } } /* Check player */ --- 4093,4109 ---- { monster_type *m_ptr = &m_list[cave[y][x].m_idx]; + if (m_ptr->ml) + { /* Hack -- auto-recall */ ! recent_track(m_ptr->r_idx); /* Hack - auto-track */ ! health_track(cave[y][x].m_idx); } } } + } /* Check player */ *************** *** 4058,4065 **** /* Return "something was noticed" */ return (notice); } - - - - --- 4131,4134 ---- diff -w -c -r ick-279/spells2.c utumno/spells2.c *** ick-279/spells2.c Thu May 15 17:12:23 1997 --- utumno/spells2.c Thu May 15 17:45:58 1997 *************** *** 31,38 **** p_ptr->chp_frac = 0; } ! p_ptr->redraw |= (PR_HP); num = num / 5; if (num < 3) { --- 31,39 ---- p_ptr->chp_frac = 0; } ! p_ptr->redraw |= PR_HP; + /* XXX base on percentages */ num = num / 5; if (num < 3) { *************** *** 57,66 **** } } ! return (TRUE); } ! return (FALSE); } --- 58,67 ---- } } ! return TRUE; } ! return FALSE; } *************** *** 79,85 **** c_ptr = &cave[py][px]; /* Create a glyph of warding */ ! c_ptr->feat = 0x03; } --- 80,86 ---- c_ptr = &cave[py][px]; /* Create a glyph of warding */ ! c_ptr->feat = CF_GLYPH; } *************** *** 226,235 **** for (i = 0; i < INVEN_TOTAL; i++) { i_ptr = &inventory[i]; ! if (i_ptr->k_idx) { ! object_aware(i_ptr); ! object_known(i_ptr); } } } --- 227,236 ---- for (i = 0; i < INVEN_TOTAL; i++) { i_ptr = &inventory[i]; ! if (i_ptr->exists()) { ! i_ptr->object_aware(); ! i_ptr->object_known(); } } } *************** *** 250,256 **** --- 251,265 ---- 1000 }; + static int enchant_table_dam[20] = + { + 0, 10, 50, 100, 100, + 100, 200, 300, 400, 500, + 600, 700, 700, 700, 800, + 800, 850, 900, 950, 975, + }; + /* * Removes curses from items in inventory * *************** *** 273,279 **** object_type *i_ptr = &inventory[i]; /* Uncursed already */ ! if (!cursed_p(i_ptr)) continue; /* Extract the flags */ object_flags(i_ptr, &f1, &f2, &f3); --- 282,288 ---- object_type *i_ptr = &inventory[i]; /* Uncursed already */ ! if (!i_ptr->is_cursed()) continue; /* Extract the flags */ object_flags(i_ptr, &f1, &f2, &f3); *************** *** 285,303 **** if (f3 & TR3_PERMA_CURSE) continue; /* Uncurse it */ ! i_ptr->ident &= ~ID_CURSED; /* Hack -- Assume felt */ ! i_ptr->ident |= ID_SENSE; /* Take note */ ! i_ptr->note = quark_add("uncursed"); /* Redraw the choice window */ ! p_ptr->redraw |= (PR_CHOOSE); /* Recalculate the bonuses */ ! p_ptr->update |= (PU_BONUS); /* Count the uncursings */ cnt++; --- 294,312 ---- if (f3 & TR3_PERMA_CURSE) continue; /* Uncurse it */ ! i_ptr->clear_ident_flag(ID_CURSED); /* Hack -- Assume felt */ ! i_ptr->set_ident_flag(ID_SENSE); /* Take note */ ! i_ptr->set_note(quark_add("uncursed")); /* Redraw the choice window */ ! p_ptr->redraw |= PR_CHOOSE; /* Recalculate the bonuses */ ! p_ptr->update |= PU_BONUS; /* Count the uncursings */ cnt++; *************** *** 321,327 **** */ bool remove_all_curse() { ! return (remove_curse_aux(TRUE)); } --- 330,336 ---- */ bool remove_all_curse() { ! return remove_curse_aux(TRUE); } *************** *** 344,354 **** check_experience(); /* Did something */ ! return (TRUE); } /* No effect */ ! return (FALSE); } --- 353,363 ---- check_experience(); /* Did something */ ! return TRUE; } /* No effect */ ! return FALSE; } *************** *** 368,378 **** void self_knowledge() { int i = 0, j, k; - u32b f1 = 0L, f2 = 0L, f3 = 0L; - object_type *i_ptr; - cptr info[128]; --- 377,384 ---- *************** *** 384,390 **** i_ptr = &inventory[k]; /* Skip empty items */ ! if (!i_ptr->k_idx) continue; /* Extract the flags */ object_flags(i_ptr, &t1, &t2, &t3); --- 390,396 ---- i_ptr = &inventory[k]; /* Skip empty items */ ! if (!i_ptr->exists()) continue; /* Extract the flags */ object_flags(i_ptr, &t1, &t2, &t3); *************** *** 697,703 **** i_ptr = &inventory[INVEN_WIELD]; /* Analyze the weapon */ ! if (i_ptr->k_idx) { /* Indicate Blessing */ if (f3 & TR3_BLESSED) --- 703,709 ---- i_ptr = &inventory[INVEN_WIELD]; /* Analyze the weapon */ ! if (i_ptr->exists()) { /* Indicate Blessing */ if (f3 & TR3_BLESSED) *************** *** 728,733 **** --- 734,743 ---- { info[i++] = "Your weapon freezes your foes."; } + if (f1 & TR1_BRAND_POIS) + { + info[i++] = "Your weapon poisons your foes."; + } /* Special "slay" flags */ if (f1 & TR1_SLAY_ANIMAL) *************** *** 821,833 **** object_type *i_ptr = &inventory[i]; /* Skip non-items */ ! if (!i_ptr->k_idx) continue; /* Allow "protection" by the MENTAL flag */ ! if (i_ptr->ident & ID_MENTAL) continue; /* Remove "default inscriptions" */ ! if (i_ptr->note && (i_ptr->ident & ID_SENSE)) { /* Access the inscription */ cptr q = quark_str(i_ptr->note); --- 831,843 ---- object_type *i_ptr = &inventory[i]; /* Skip non-items */ ! if (!i_ptr->exists()) continue; /* Allow "protection" by the MENTAL flag */ ! if (i_ptr->test_ident_flag(ID_MENTAL)) continue; /* Remove "default inscriptions" */ ! if (i_ptr->note && i_ptr->test_ident_flag(ID_SENSE)) { /* Access the inscription */ cptr q = quark_str(i_ptr->note); *************** *** 843,876 **** (streq(q, "terrible"))) { /* Forget the inscription */ ! i_ptr->note = 0; } } /* Hack -- Clear the "empty" flag */ ! i_ptr->ident &= ~ID_EMPTY; /* Hack -- Clear the "known" flag */ ! i_ptr->ident &= ~ID_KNOWN; /* Hack -- Clear the "felt" flag */ ! i_ptr->ident &= ~ID_SENSE; } /* Redraw the choice window */ ! p_ptr->redraw |= (PR_CHOOSE); /* Recalculate bonuses */ ! p_ptr->update |= (PU_BONUS); /* Combine / Reorder the pack (later) */ ! p_ptr->notice |= (PN_COMBINE | PN_REORDER); /* Mega-Hack -- Forget the map */ ! wiz_dark(); /* It worked */ ! return (TRUE); } --- 853,886 ---- (streq(q, "terrible"))) { /* Forget the inscription */ ! i_ptr->set_note(0); } } /* Hack -- Clear the "empty" flag */ ! i_ptr->clear_ident_flag(ID_EMPTY); /* Hack -- Clear the "known" flag */ ! i_ptr->clear_ident_flag(ID_KNOWN); /* Hack -- Clear the "felt" flag */ ! i_ptr->clear_ident_flag(ID_SENSE); } /* Redraw the choice window */ ! p_ptr->redraw |= PR_CHOOSE; /* Recalculate bonuses */ ! p_ptr->update |= PU_BONUS; /* Combine / Reorder the pack (later) */ ! p_ptr->notice |= PN_COMBINE | PN_REORDER; /* Mega-Hack -- Forget the map */ ! forget_map(); /* It worked */ ! return TRUE; } *************** *** 881,887 **** */ bool detect_treasure(void) { ! int y, x; bool detect = FALSE; cave_type *c_ptr; --- 891,897 ---- */ bool detect_treasure(void) { ! int x, y; bool detect = FALSE; cave_type *c_ptr; *************** *** 940,952 **** if (i_ptr->tval == TV_GOLD) { /* Notice new items */ ! if (!(i_ptr->marked)) { /* Detect */ detect = TRUE; /* Hack -- memorize the item */ ! i_ptr->marked = TRUE; /* Redraw */ lite_spot(y, x); --- 950,962 ---- if (i_ptr->tval == TV_GOLD) { /* Notice new items */ ! if (!i_ptr->marked) { /* Detect */ detect = TRUE; /* Hack -- memorize the item */ ! i_ptr->set_marked(TRUE); /* Redraw */ lite_spot(y, x); *************** *** 967,973 **** * ego-items, potions, scrolls, books, rods, wands, staves, amulets, rings, * and "enchanted" items of the "good" variety. * ! * It can probably be argued that this function is now too powerful. */ bool detect_magic() { --- 977,983 ---- * ego-items, potions, scrolls, books, rods, wands, staves, amulets, rings, * and "enchanted" items of the "good" variety. * ! * It can probably be argued that this function is now too powerful. (???) */ bool detect_magic() { *************** *** 994,1014 **** tv = i_ptr->tval; /* Artifacts, misc magic items, or enchanted wearables */ ! if (artifact_p(i_ptr) || ego_item_p(i_ptr) || (tv == TV_AMULET) || (tv == TV_RING) || (tv == TV_STAFF) || (tv == TV_WAND) || (tv == TV_ROD) || (tv == TV_SCROLL) || (tv == TV_POTION) || (tv == TV_MAGIC_BOOK) || (tv == TV_PRAYER_BOOK) || ! ((i_ptr->to_a > 0) || (i_ptr->to_h + i_ptr->to_d > 0))) { /* Note new items */ ! if (!(i_ptr->marked)) { /* Detect */ detect = TRUE; /* Memorize the item */ ! i_ptr->marked = TRUE; /* Redraw */ lite_spot(i, j); --- 1004,1025 ---- tv = i_ptr->tval; /* Artifacts, misc magic items, or enchanted wearables */ ! if (i_ptr->is_artifact() || i_ptr->is_ego_item() || (tv == TV_AMULET) || (tv == TV_RING) || (tv == TV_STAFF) || (tv == TV_WAND) || (tv == TV_ROD) || (tv == TV_SCROLL) || (tv == TV_POTION) || (tv == TV_MAGIC_BOOK) || (tv == TV_PRAYER_BOOK) || ! ((i_ptr->to_a > 0) || ! (i_ptr->to_h + i_ptr->to_d > 0))) { /* Note new items */ ! if (!i_ptr->marked) { /* Detect */ detect = TRUE; /* Memorize the item */ ! i_ptr->set_marked(TRUE); /* Redraw */ lite_spot(i, j); *************** *** 1018,1024 **** } /* Return result */ ! return (detect); } --- 1029,1035 ---- } /* Return result */ ! return detect; } *************** *** 1040,1047 **** monster_type *m_ptr = &m_list[i]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; - int fy = m_ptr->fy; int fx = m_ptr->fx; /* Paranoia -- Skip dead monsters */ if (!m_ptr->r_idx) continue; --- 1051,1058 ---- monster_type *m_ptr = &m_list[i]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; int fx = m_ptr->fx; + int fy = m_ptr->fy; /* Paranoia -- Skip dead monsters */ if (!m_ptr->r_idx) continue; *************** *** 1056,1062 **** r_ptr->r_flags2 |= RF2_INVISIBLE; /* Mega-Hack -- Show the monster */ ! m_ptr->ml = TRUE; lite_spot(fy, fx); flag = TRUE; } --- 1067,1073 ---- r_ptr->r_flags2 |= RF2_INVISIBLE; /* Mega-Hack -- Show the monster */ ! m_ptr->set_ml(TRUE); lite_spot(fy, fx); flag = TRUE; } *************** *** 1094,1101 **** monster_type *m_ptr = &m_list[i]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; - int fy = m_ptr->fy; int fx = m_ptr->fx; /* Paranoia -- Skip dead monsters */ if (!m_ptr->r_idx) continue; --- 1105,1112 ---- monster_type *m_ptr = &m_list[i]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; int fx = m_ptr->fx; + int fy = m_ptr->fy; /* Paranoia -- Skip dead monsters */ if (!m_ptr->r_idx) continue; *************** *** 1107,1113 **** if (panel_contains(fy, fx) && (r_ptr->flags3 & RF3_EVIL)) { /* Mega-Hack -- Show the monster */ ! m_ptr->ml = TRUE; lite_spot(fy, fx); flag = TRUE; } --- 1118,1124 ---- if (panel_contains(fy, fx) && (r_ptr->flags3 & RF3_EVIL)) { /* Mega-Hack -- Show the monster */ ! m_ptr->set_ml(TRUE); lite_spot(fy, fx); flag = TRUE; } *************** *** 1145,1152 **** monster_type *m_ptr = &m_list[i]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; - int fy = m_ptr->fy; int fx = m_ptr->fx; /* Paranoia -- Skip dead monsters */ if (!m_ptr->r_idx) continue; --- 1156,1163 ---- monster_type *m_ptr = &m_list[i]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; int fx = m_ptr->fx; + int fy = m_ptr->fy; /* Paranoia -- Skip dead monsters */ if (!m_ptr->r_idx) continue; *************** *** 1158,1164 **** if (panel_contains(fy, fx) && (!(r_ptr->flags2 & RF2_INVISIBLE))) { /* Mega-Hack -- Show the monster */ ! m_ptr->ml = TRUE; lite_spot(fy, fx); flag = TRUE; } --- 1169,1175 ---- if (panel_contains(fy, fx) && (!(r_ptr->flags2 & RF2_INVISIBLE))) { /* Mega-Hack -- Show the monster */ ! m_ptr->set_ml(TRUE); lite_spot(fy, fx); flag = TRUE; } *************** *** 1202,1209 **** { monster_type *m_ptr = &m_list[i]; - int fy = m_ptr->fy; int fx = m_ptr->fx; /* Paranoia -- Skip dead monsters */ if (!m_ptr->r_idx) continue; --- 1213,1220 ---- { monster_type *m_ptr = &m_list[i]; int fx = m_ptr->fx; + int fy = m_ptr->fy; /* Paranoia -- Skip dead monsters */ if (!m_ptr->r_idx) continue; *************** *** 1215,1221 **** if (panel_contains(fy, fx)) { /* Mega-Hack -- Show the monster */ ! m_ptr->ml = TRUE; lite_spot(fy, fx); flag = detect = TRUE; } --- 1226,1232 ---- if (panel_contains(fy, fx)) { /* Mega-Hack -- Show the monster */ ! m_ptr->set_ml(TRUE); lite_spot(fy, fx); flag = detect = TRUE; } *************** *** 1244,1252 **** { int i, j; bool detect = FALSE; - cave_type *c_ptr; - object_type *i_ptr; --- 1255,1261 ---- *************** *** 1266,1278 **** if (i_ptr->tval == TV_GOLD) continue; /* Note new objects */ ! if (!(i_ptr->marked)) { /* Detect */ detect = TRUE; /* Hack -- memorize it */ ! i_ptr->marked = TRUE; /* Redraw */ lite_spot(i, j); --- 1275,1287 ---- if (i_ptr->tval == TV_GOLD) continue; /* Note new objects */ ! if (!i_ptr->marked) { /* Detect */ detect = TRUE; /* Hack -- memorize it */ ! i_ptr->set_marked(TRUE); /* Redraw */ lite_spot(i, j); *************** *** 1290,1298 **** bool detect_trap(void) { int i, j; - bool detect = FALSE; - cave_type *c_ptr; --- 1299,1305 ---- *************** *** 1305,1311 **** c_ptr = &cave[i][j]; /* Detect invisible traps */ ! if (c_ptr->feat == 0x02) { /* Pick a trap */ pick_trap(i, j); --- 1312,1318 ---- c_ptr = &cave[i][j]; /* Detect invisible traps */ ! if (c_ptr->feat == CF_TRAP_INVIS) { /* Pick a trap */ pick_trap(i, j); *************** *** 1322,1328 **** } } ! return (detect); } --- 1329,1335 ---- } } ! return detect; } *************** *** 1334,1340 **** { int i, j; bool detect = FALSE; - cave_type *c_ptr; --- 1341,1346 ---- *************** *** 1347,1356 **** c_ptr = &cave[i][j]; /* Hack -- detect secret doors */ ! if (c_ptr->feat == 0x30) { /* Find the door XXX XXX XXX */ ! c_ptr->feat = 0x20; /* Memorize the door */ c_ptr->info |= CAVE_MARK; --- 1353,1362 ---- c_ptr = &cave[i][j]; /* Hack -- detect secret doors */ ! if (c_ptr->feat == CF_DOOR_SECRET) { /* Find the door XXX XXX XXX */ ! c_ptr->feat = CF_DOOR_LOCKED_0; /* Memorize the door */ c_ptr->info |= CAVE_MARK; *************** *** 1366,1373 **** if (c_ptr->info & CAVE_MARK) continue; /* Hack -- detect stairs */ ! if ((c_ptr->feat == 0x06) || ! (c_ptr->feat == 0x07)) { /* Memorize the stairs */ c_ptr->info |= CAVE_MARK; --- 1372,1379 ---- if (c_ptr->info & CAVE_MARK) continue; /* Hack -- detect stairs */ ! if ((c_ptr->feat == CF_STAIRS_DOWN) || ! (c_ptr->feat == CF_STAIRS_UP)) { /* Memorize the stairs */ c_ptr->info |= CAVE_MARK; *************** *** 1409,1427 **** /* Create a staircase */ if (!dun_level) { ! c_ptr->feat = 0x07; } else if (is_quest(dun_level) || (dun_level >= MAX_DEPTH-1)) { ! c_ptr->feat = 0x06; } ! else if (rand_int(100) < 50) { ! c_ptr->feat = 0x06; } else { ! c_ptr->feat = 0x07; } /* Notice */ --- 1415,1433 ---- /* Create a staircase */ if (!dun_level) { ! c_ptr->feat = CF_STAIRS_DOWN; } else if (is_quest(dun_level) || (dun_level >= MAX_DEPTH-1)) { ! c_ptr->feat = CF_STAIRS_UP; } ! else if (percent(50)) { ! c_ptr->feat = CF_STAIRS_UP; } else { ! c_ptr->feat = CF_STAIRS_DOWN; } /* Notice */ *************** *** 1449,1465 **** case TV_BOLT: case TV_ARROW: case TV_SHOT: ! return (TRUE); } ! return (FALSE); } /* ! * Hook to specify "armour" */ ! static bool item_tester_hook_armour(object_type *i_ptr) { switch (i_ptr->tval) { --- 1455,1471 ---- case TV_BOLT: case TV_ARROW: case TV_SHOT: ! return TRUE; } ! return FALSE; } /* ! * Hook to specify "armor" */ ! static bool item_tester_hook_armor(object_type *i_ptr) { switch (i_ptr->tval) { *************** *** 1472,1481 **** case TV_HELM: case TV_BOOTS: case TV_GLOVES: ! return (TRUE); } ! return (FALSE); } --- 1478,1487 ---- case TV_HELM: case TV_BOOTS: case TV_GLOVES: ! return TRUE; } ! return FALSE; } *************** *** 1498,1508 **** bool enchant(object_type *i_ptr, int n, int eflag) { int i, chance, prob; - bool res = FALSE; ! ! bool a = artifact_p(i_ptr); ! u32b f1, f2, f3; /* Extract the flags */ --- 1504,1511 ---- bool enchant(object_type *i_ptr, int n, int eflag) { int i, chance, prob; bool res = FALSE; ! bool a = i_ptr->is_artifact(); u32b f1, f2, f3; /* Extract the flags */ *************** *** 1533,1552 **** else if (i_ptr->to_h > 15) chance = 1000; else chance = enchant_table[i_ptr->to_h]; ! if ((randint(1000) > chance) && (!a || (rand_int(100) < 50))) { ! i_ptr->to_h++; res = TRUE; /* only when you get it above -1 -CFT */ ! if (cursed_p(i_ptr) && (!(f3 & TR3_PERMA_CURSE)) && ! (i_ptr->to_h >= 0) && (rand_int(100) < 25)) { msg_print("The curse is broken!"); ! i_ptr->ident &= ~ID_CURSED; ! i_ptr->ident |= ID_SENSE; ! i_ptr->note = quark_add("uncursed"); } } } --- 1536,1555 ---- else if (i_ptr->to_h > 15) chance = 1000; else chance = enchant_table[i_ptr->to_h]; ! if ((randint(1000) > chance) && (!a || percent(50))) { ! i_ptr->set_to_h(i_ptr->to_h + 1); res = TRUE; /* only when you get it above -1 -CFT */ ! if (i_ptr->is_cursed() && (!(f3 & TR3_PERMA_CURSE)) && ! (i_ptr->to_h >= 0) && percent(25)) { msg_print("The curse is broken!"); ! i_ptr->clear_ident_flag(ID_CURSED); ! i_ptr->set_ident_flag(ID_SENSE); ! i_ptr->set_note(quark_add("uncursed")); } } } *************** *** 1555,1577 **** if (eflag & ENCH_TODAM) { if (i_ptr->to_d < 0) chance = 0; ! else if (i_ptr->to_d > 15) chance = 1000; ! else chance = enchant_table[i_ptr->to_d]; ! if ((randint(1000) > chance) && (!a || (rand_int(100) < 50))) { ! i_ptr->to_d++; res = TRUE; /* only when you get it above -1 -CFT */ ! if (cursed_p(i_ptr) && (!(f3 & TR3_PERMA_CURSE)) && ! (i_ptr->to_d >= 0) && (rand_int(100) < 25)) { msg_print("The curse is broken!"); ! i_ptr->ident &= ~ID_CURSED; ! i_ptr->ident |= ID_SENSE; ! i_ptr->note = quark_add("uncursed"); } } } --- 1558,1596 ---- if (eflag & ENCH_TODAM) { if (i_ptr->to_d < 0) chance = 0; ! else if (i_ptr->to_d > 19) chance = 1000; ! else ! { ! if (i_ptr->tval == TV_BOW) ! { ! chance = enchant_table[i_ptr->to_d]; ! } ! else ! { ! /* Greg Wooledge -- generally limit +to-dam to weapons' ! natural damage limitation. E.g., a tulwar (2d4) can go ! to +8. Note the effect upon missiles.... */ ! chance = enchant_table_dam[i_ptr->to_d]; ! if ((i_ptr->dd * i_ptr->ds <= ! i_ptr->to_d) && ! (chance < 995)) chance = 995; ! } ! } ! if ((randint(1000) > chance) && (!a || percent(50))) { ! i_ptr->set_to_d(i_ptr->to_d + 1); res = TRUE; /* only when you get it above -1 -CFT */ ! if (i_ptr->is_cursed() && (!(f3 & TR3_PERMA_CURSE)) && ! (i_ptr->to_d >= 0) && percent(25)) { msg_print("The curse is broken!"); ! i_ptr->clear_ident_flag(ID_CURSED); ! i_ptr->set_ident_flag(ID_SENSE); ! i_ptr->set_note(quark_add("uncursed")); } } } *************** *** 1583,1602 **** else if (i_ptr->to_a > 15) chance = 1000; else chance = enchant_table[i_ptr->to_a]; ! if ((randint(1000) > chance) && (!a || (rand_int(100) < 50))) { ! i_ptr->to_a++; res = TRUE; /* only when you get it above -1 -CFT */ ! if (cursed_p(i_ptr) && (!(f3 & TR3_PERMA_CURSE)) && ! (i_ptr->to_a >= 0) && (rand_int(100) < 25)) { msg_print("The curse is broken!"); ! i_ptr->ident &= ~ID_CURSED; ! i_ptr->ident |= ID_SENSE; ! i_ptr->note = quark_add("uncursed"); } } } --- 1602,1621 ---- else if (i_ptr->to_a > 15) chance = 1000; else chance = enchant_table[i_ptr->to_a]; ! if ((randint(1000) > chance) && (!a || percent(50))) { ! i_ptr->set_to_a(i_ptr->to_a + 1); res = TRUE; /* only when you get it above -1 -CFT */ ! if (i_ptr->is_cursed() && (!(f3 & TR3_PERMA_CURSE)) && ! (i_ptr->to_a >= 0) && percent(25)) { msg_print("The curse is broken!"); ! i_ptr->clear_ident_flag(ID_CURSED); ! i_ptr->set_ident_flag(ID_SENSE); ! i_ptr->set_note(quark_add("uncursed")); } } } *************** *** 1603,1621 **** } /* Failure */ ! if (!res) return (FALSE); /* Redraw the choice window */ ! p_ptr->redraw |= (PR_CHOOSE); /* Recalculate bonuses */ ! p_ptr->update |= (PU_BONUS); /* Combine / Reorder the pack (later) */ ! p_ptr->notice |= (PN_COMBINE | PN_REORDER); /* Success */ ! return (TRUE); } --- 1622,1640 ---- } /* Failure */ ! if (!res) return FALSE; /* Redraw the choice window */ ! p_ptr->redraw |= PR_CHOOSE; /* Recalculate bonuses */ ! p_ptr->update |= PU_BONUS; /* Combine / Reorder the pack (later) */ ! p_ptr->notice |= PN_COMBINE | PN_REORDER; /* Success */ ! return TRUE; } *************** *** 1622,1628 **** /* * Enchant an item (in the inventory or on the floor) ! * Note that "num_ac" requires armour, else weapon * Returns TRUE if attempted, FALSE if cancelled */ bool enchant_spell(int num_hit, int num_dam, int num_ac) --- 1641,1647 ---- /* * Enchant an item (in the inventory or on the floor) ! * Note that "num_ac" requires armor, else weapon * Returns TRUE if attempted, FALSE if cancelled */ bool enchant_spell(int num_hit, int num_dam, int num_ac) *************** *** 1629,1637 **** { int item; bool okay = FALSE; - object_type *i_ptr; - char i_name[80]; --- 1648,1654 ---- *************** *** 1639,1645 **** item_tester_hook = item_tester_hook_weapon; /* Enchant armor if requested */ ! if (num_ac) item_tester_hook = item_tester_hook_armour; /* Get an item (from equip or inven or floor) */ if (!get_item(&item, "Enchant which item? ", TRUE, TRUE, TRUE)) --- 1656,1662 ---- item_tester_hook = item_tester_hook_weapon; /* Enchant armor if requested */ ! if (num_ac) item_tester_hook = item_tester_hook_armor; /* Get an item (from equip or inven or floor) */ if (!get_item(&item, "Enchant which item? ", TRUE, TRUE, TRUE)) *************** *** 1657,1663 **** /* Get the item (on the floor) */ else { ! i_ptr = &i_list[0 - item]; } --- 1674,1680 ---- /* Get the item (on the floor) */ else { ! i_ptr = &i_list[-item]; } *************** *** 1667,1673 **** /* Describe */ msg_format("%s %s glow%s brightly!", ((item >= 0) ? "Your" : "The"), i_name, ! ((i_ptr->number > 1) ? "" : "s")); /* Enchant */ if (enchant(i_ptr, num_hit, ENCH_TOHIT)) okay = TRUE; --- 1684,1690 ---- /* Describe */ msg_format("%s %s glow%s brightly!", ((item >= 0) ? "Your" : "The"), i_name, ! i_ptr->is_plural() ? "" : "s"); /* Enchant */ if (enchant(i_ptr, num_hit, ENCH_TOHIT)) okay = TRUE; *************** *** 1685,1691 **** } /* Something happened */ ! return (TRUE); } --- 1702,1708 ---- } /* Something happened */ ! return TRUE; } *************** *** 1697,1705 **** bool ident_spell() { int item; - object_type *i_ptr; - char i_name[80]; --- 1714,1720 ---- *************** *** 1724,1737 **** /* Identify it fully */ ! object_aware(i_ptr); ! object_known(i_ptr); /* Redraw the choice window */ ! p_ptr->redraw |= (PR_CHOOSE); /* Recalculate bonuses */ ! p_ptr->update |= (PU_BONUS); /* Combine / Reorder the pack (later) */ p_ptr->notice |= (PN_COMBINE | PN_REORDER); --- 1739,1752 ---- /* Identify it fully */ ! i_ptr->object_aware(); ! i_ptr->object_known(); /* Redraw the choice window */ ! p_ptr->redraw |= PR_CHOOSE; /* Recalculate bonuses */ ! p_ptr->update |= PU_BONUS; /* Combine / Reorder the pack (later) */ p_ptr->notice |= (PN_COMBINE | PN_REORDER); *************** *** 1769,1777 **** bool identify_fully() { int item; - object_type *i_ptr; - char i_name[80]; --- 1784,1790 ---- *************** *** 1791,1815 **** /* Get the item (on the floor) */ else { ! i_ptr = &i_list[0 - item]; } /* Identify it fully */ ! object_aware(i_ptr); ! object_known(i_ptr); /* Mark the item as fully known */ ! i_ptr->ident |= (ID_MENTAL); /* Redraw choice window */ ! p_ptr->redraw |= (PR_CHOOSE); /* Recalculate bonuses */ ! p_ptr->update |= (PU_BONUS); /* Combine / Reorder the pack (later) */ ! p_ptr->notice |= (PN_COMBINE | PN_REORDER); /* Handle stuff */ handle_stuff(); --- 1804,1828 ---- /* Get the item (on the floor) */ else { ! i_ptr = &i_list[-item]; } /* Identify it fully */ ! i_ptr->object_aware(); ! i_ptr->object_known(); /* Mark the item as fully known */ ! i_ptr->set_ident_flag(ID_MENTAL); /* Redraw choice window */ ! p_ptr->redraw |= PR_CHOOSE; /* Recalculate bonuses */ ! p_ptr->update |= PU_BONUS; /* Combine / Reorder the pack (later) */ ! p_ptr->notice |= PN_COMBINE | PN_REORDER; /* Handle stuff */ handle_stuff(); *************** *** 1830,1837 **** } else { ! msg_format("On the ground: %s.", ! i_name); } /* Describe it fully */ --- 1843,1849 ---- } else { ! msg_format("On the ground: %s.", i_name); } /* Describe it fully */ *************** *** 1838,1844 **** identify_fully_aux(i_ptr); /* Success */ ! return (TRUE); } --- 1850,1856 ---- identify_fully_aux(i_ptr); /* Success */ ! return TRUE; } *************** *** 1850,1865 **** static bool item_tester_hook_recharge(object_type *i_ptr) { /* Recharge staffs */ ! if (i_ptr->tval == TV_STAFF) return (TRUE); /* Recharge wands */ ! if (i_ptr->tval == TV_WAND) return (TRUE); /* Hack -- Recharge rods */ ! if (i_ptr->tval == TV_ROD) return (TRUE); /* Nope */ ! return (FALSE); } --- 1862,1877 ---- static bool item_tester_hook_recharge(object_type *i_ptr) { /* Recharge staffs */ ! if (i_ptr->tval == TV_STAFF) return TRUE; /* Recharge wands */ ! if (i_ptr->tval == TV_WAND) return TRUE; /* Hack -- Recharge rods */ ! if (i_ptr->tval == TV_ROD) return TRUE; /* Nope */ ! return FALSE; } *************** *** 1916,1927 **** /* Get the item (on the floor) */ else { ! i_ptr = &i_list[0 - item]; } /* Extract the object "level" */ ! lev = k_info[i_ptr->k_idx].level; /* Recharge a rod */ if (i_ptr->tval == TV_ROD) --- 1928,1939 ---- /* Get the item (on the floor) */ else { ! i_ptr = &i_list[-item]; } /* Extract the object "level" */ ! lev = i_ptr->obj_level; /* Recharge a rod */ if (i_ptr->tval == TV_ROD) *************** *** 1940,1964 **** msg_print("The recharge backfires, draining the rod further!"); /* Hack -- decharge the rod */ ! if (i_ptr->pval < 10000) i_ptr->pval = (i_ptr->pval + 100) * 2; } /* Recharge */ else { /* Rechange amount */ ! t = (num * damroll(2, 4)); /* Recharge by that amount */ if (i_ptr->pval > t) { ! i_ptr->pval -= t; } /* Fully recharged */ else { ! i_ptr->pval = 0; } } } --- 1952,1979 ---- msg_print("The recharge backfires, draining the rod further!"); /* Hack -- decharge the rod */ ! if (i_ptr->pval < 10000) ! { ! i_ptr->set_pval((i_ptr->pval + 100) * 2); } + } /* Recharge */ else { /* Rechange amount */ ! t = num * damroll(2, 4); /* Recharge by that amount */ if (i_ptr->pval > t) { ! i_ptr->set_pval(i_ptr->pval - t); } /* Fully recharged */ else { ! i_ptr->set_pval(0); } } } *************** *** 1989,1997 **** /* Reduce and describe floor item */ else { ! floor_item_increase(0 - item, -999); ! floor_item_describe(0 - item); ! floor_item_optimize(0 - item); } } --- 2004,2012 ---- /* Reduce and describe floor item */ else { ! floor_item_increase(-item, -999); ! floor_item_describe(-item); ! floor_item_optimize(-item); } } *************** *** 2003,2015 **** t = (num / (lev + 2)) + 1; /* Recharge based on the power */ ! if (t > 0) i_ptr->pval += 2 + randint(t); /* Hack -- we no longer "know" the item */ ! i_ptr->ident &= ~ID_KNOWN; /* Hack -- we no longer think the item is empty */ ! i_ptr->ident &= ~ID_EMPTY; } } --- 2018,2030 ---- t = (num / (lev + 2)) + 1; /* Recharge based on the power */ ! if (t > 0) i_ptr->set_pval(i_ptr->pval + 2 + randint(t)); /* Hack -- we no longer "know" the item */ ! i_ptr->clear_ident_flag(ID_KNOWN); /* Hack -- we no longer think the item is empty */ ! i_ptr->clear_ident_flag(ID_EMPTY); } } *************** *** 2051,2058 **** if (!m_ptr->r_idx) continue; /* Location */ - y = m_ptr->fy; x = m_ptr->fx; /* Require line of sight */ if (!player_has_los_bold(y, x)) continue; --- 2066,2073 ---- if (!m_ptr->r_idx) continue; /* Location */ x = m_ptr->fx; + y = m_ptr->fy; /* Require line of sight */ if (!player_has_los_bold(y, x)) continue; *************** *** 2151,2157 **** for (i = 1; i < m_max; i++) { monster_type *m_ptr = &m_list[i]; - monster_race *r_ptr = &r_info[m_ptr->r_idx]; /* Paranoia -- Skip dead monsters */ if (!m_ptr->r_idx) continue; --- 2166,2171 ---- *************** *** 2166,2172 **** if (m_ptr->csleep) { /* Wake up */ ! m_ptr->csleep = 0; sleep = TRUE; } } --- 2180,2186 ---- if (m_ptr->csleep) { /* Wake up */ ! m_ptr->set_csleep(0); sleep = TRUE; } } *************** *** 2174,2184 **** /* Speed up monsters in line of sight */ if (player_has_los_bold(m_ptr->fy, m_ptr->fx)) { ! /* Speed up (instantly) to racial base + 10 */ ! if (m_ptr->mspeed < r_ptr->speed + 10) { ! /* Speed up */ ! m_ptr->mspeed = r_ptr->speed + 10; speed = TRUE; } } --- 2188,2197 ---- /* Speed up monsters in line of sight */ if (player_has_los_bold(m_ptr->fy, m_ptr->fx)) { ! /* If not already hasted 10 turns, make hasted 10 turns */ ! if (m_ptr->temp_speed < 10) { ! m_ptr->set_temp_speed(10); speed = TRUE; } } *************** *** 2197,2208 **** bool genocide(void) { int i; - char typ; - bool result = FALSE; ! /* Mega-Hack -- Get a monster symbol */ (void)(get_com("Choose a monster race (by symbol) to genocide: ", &typ)); /* Delete the monsters of that "type" */ --- 2210,2219 ---- bool genocide(void) { int i; char typ; bool result = FALSE; ! /* Hack -- Get a monster symbol */ (void)(get_com("Choose a monster race (by symbol) to genocide: ", &typ)); /* Delete the monsters of that "type" */ *************** *** 2217,2230 **** /* Hack -- Skip Unique Monsters */ if (r_ptr->flags1 & RF1_UNIQUE) continue; ! /* Skip "wrong" monsters */ if (r_ptr->r_char != typ) continue; /* Delete the monster */ delete_monster_idx(i); /* Take damage */ ! take_hit(randint(4), "the strain of casting Genocide"); /* Visual feedback */ move_cursor_relative(py, px); --- 2228,2244 ---- /* Hack -- Skip Unique Monsters */ if (r_ptr->flags1 & RF1_UNIQUE) continue; ! /* Skip monsters with the incorrect symbol */ if (r_ptr->r_char != typ) continue; + /* Skip magic-resistant monsters */ + if (r_ptr->flags3 & RF3_RES_MAGIC) continue; + /* Delete the monster */ delete_monster_idx(i); /* Take damage */ ! take_hit_no_invuln(randint(4), "the strain of casting Genocide"); /* Visual feedback */ move_cursor_relative(py, px); *************** *** 2237,2243 **** result = TRUE; } ! return (result); } --- 2251,2257 ---- result = TRUE; } ! return result; } *************** *** 2262,2267 **** --- 2276,2284 ---- /* Hack -- Skip unique monsters */ if (r_ptr->flags1 & RF1_UNIQUE) continue; + /* Skip magic-resistant monsters */ + if (r_ptr->flags3 & RF3_RES_MAGIC) continue; + /* Skip distant monsters */ if (m_ptr->cdis > MAX_SIGHT) continue; *************** *** 2268,2275 **** /* Delete the monster */ delete_monster_idx(i); /* Hack -- visual feedback */ - take_hit(randint(3), "the strain of casting Mass Genocide"); move_cursor_relative(py, px); p_ptr->redraw |= (PR_HP); handle_stuff(); --- 2285,2294 ---- /* Delete the monster */ delete_monster_idx(i); + /* Take damage */ + take_hit_no_invuln(randint(3), "the strain of casting Mass Genocide"); + /* Hack -- visual feedback */ move_cursor_relative(py, px); p_ptr->redraw |= (PR_HP); handle_stuff(); *************** *** 2335,2341 **** } /* Result */ ! return (probe); } --- 2354,2360 ---- } /* Result */ ! return probe; } *************** *** 2403,2409 **** if (valid_grid(y, x)) { ! /* Delete the object (if any) */ delete_object(y, x); /* Wall (or floor) type */ --- 2422,2428 ---- if (valid_grid(y, x)) { ! /* Delete the objects (if any) */ delete_object(y, x); /* Wall (or floor) type */ *************** *** 2686,2699 **** for (i = 0; i < 8; i++) { /* Access the grid */ - y = yy + ddy[i]; x = xx + ddx[i]; /* Skip non-empty grids */ if (!empty_grid_bold(y, x)) continue; /* Hack -- no safety on glyph of warding */ ! if (cave[y][x].feat == 0x03) continue; /* Important -- Skip "quake" grids */ if (map[16+y-cy][16+x-cx]) continue; --- 2705,2718 ---- for (i = 0; i < 8; i++) { /* Access the grid */ x = xx + ddx[i]; + y = yy + ddy[i]; /* Skip non-empty grids */ if (!empty_grid_bold(y, x)) continue; /* Hack -- no safety on glyph of warding */ ! if (cave[y][x].feat == CF_GLYPH) continue; /* Important -- Skip "quake" grids */ if (map[16+y-cy][16+x-cx]) continue; *************** *** 2719,2728 **** damage = (sn ? damroll(4, 8) : 200); /* Monster is certainly awake */ ! m_ptr->csleep = 0; /* Apply damage directly */ ! m_ptr->hp -= damage; /* Delete (not kill) "dead" monsters */ if (m_ptr->hp < 0) --- 2738,2747 ---- damage = (sn ? damroll(4, 8) : 200); /* Monster is certainly awake */ ! m_ptr->set_csleep(0); /* Apply damage directly */ ! m_ptr->set_hp(m_ptr->hp - damage); /* Delete (not kill) "dead" monsters */ if (m_ptr->hp < 0) *************** *** 2749,2756 **** cave[yy][xx].m_idx = 0; /* Move the monster */ ! m_ptr->fy = sy; ! m_ptr->fx = sx; /* Update the monster (new location) */ update_mon(m_idx, TRUE); --- 2768,2774 ---- cave[yy][xx].m_idx = 0; /* Move the monster */ ! m_ptr->set_location(sx, sy); /* Update the monster (new location) */ update_mon(m_idx, TRUE); *************** *** 2790,2796 **** { bool floor = floor_grid_bold(yy, xx); ! /* Delete any object that is still there */ delete_object(yy, xx); /* Wall (or floor) type */ --- 2808,2814 ---- { bool floor = floor_grid_bold(yy, xx); ! /* Delete any objects that are still there */ delete_object(yy, xx); /* Wall (or floor) type */ *************** *** 2886,2892 **** if (c_ptr->m_idx) { monster_type *m_ptr = &m_list[c_ptr->m_idx]; - monster_race *r_ptr = &r_info[m_ptr->r_idx]; /* Update the monster */ --- 2904,2909 ---- *************** *** 2894,2905 **** /* Sometimes monsters wake up */ if (m_ptr->csleep && ! (((r_ptr->flags2 & RF2_STUPID) && (rand_int(100) < 10)) || ! (rand_int(100) < 25) || (r_ptr->flags2 & RF2_SMART))) { /* Wake up! */ ! m_ptr->csleep = 0; /* Notice the "waking up" */ if (m_ptr->ml) --- 2911,2922 ---- /* Sometimes monsters wake up */ if (m_ptr->csleep && ! (((r_ptr->flags2 & RF2_STUPID) && percent(10)) || ! percent(25) || (r_ptr->flags2 & RF2_SMART))) { /* Wake up! */ ! m_ptr->set_csleep(0); /* Notice the "waking up" */ if (m_ptr->ml) *************** *** 3199,3206 **** */ bool fire_bolt(int typ, int dir, int dam) { ! int flg = PROJECT_STOP | PROJECT_KILL; ! return (project_hook(typ, dir, dam, flg)); } /* --- 3216,3222 ---- */ bool fire_bolt(int typ, int dir, int dam) { ! return project_hook(typ, dir, dam, PROJECT_STOP | PROJECT_KILL); } /* *************** *** 3210,3217 **** */ bool fire_beam(int typ, int dir, int dam) { ! int flg = PROJECT_BEAM | PROJECT_KILL; ! return (project_hook(typ, dir, dam, flg)); } /* --- 3226,3232 ---- */ bool fire_beam(int typ, int dir, int dam) { ! return project_hook(typ, dir, dam, PROJECT_BEAM | PROJECT_KILL); } /* *************** *** 3249,3255 **** bool wall_to_mud(int dir) { int flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL; ! return (project_hook(GF_KILL_WALL, dir, 20 + randint(30), flg)); } bool destroy_door(int dir) --- 3264,3270 ---- bool wall_to_mud(int dir) { int flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL; ! return (project_hook(GF_KILL_WALL, dir, 50, flg)); } bool destroy_door(int dir) Only in utumno: spoilers.c diff -w -c -r ick-279/store.c utumno/store.c *** ick-279/store.c Thu May 15 17:12:23 1997 --- utumno/store.c Thu May 15 17:45:59 1997 *************** *** 14,24 **** ! #define MAX_COMMENT_1 6 static cptr comment_1[MAX_COMMENT_1] = { - "Okay.", "Fine.", "Accepted!", "Agreed!", --- 14,23 ---- ! #define MAX_COMMENT_1 5 static cptr comment_1[MAX_COMMENT_1] = { "Fine.", "Accepted!", "Agreed!", *************** *** 34,40 **** "My patience grows thin. %s is final." }; ! #define MAX_COMMENT_2B 12 static cptr comment_2b[MAX_COMMENT_2B] = { --- 33,39 ---- "My patience grows thin. %s is final." }; ! #define MAX_COMMENT_2B 11 static cptr comment_2b[MAX_COMMENT_2B] = { *************** *** 41,49 **** "I can take no less than %s gold pieces.", "I will accept no less than %s gold pieces.", "Ha! No less than %s gold pieces.", ! "You knave! No less than %s gold pieces.", "That's a pittance! I want %s gold pieces.", - "That's an insult! I want %s gold pieces.", "As if! How about %s gold pieces?", "My arse! How about %s gold pieces?", "May the fleas of 1000 orcs molest you! Try %s gold pieces.", --- 40,47 ---- "I can take no less than %s gold pieces.", "I will accept no less than %s gold pieces.", "Ha! No less than %s gold pieces.", ! "Thou knave! No less than %s gold pieces.", "That's a pittance! I want %s gold pieces.", "As if! How about %s gold pieces?", "My arse! How about %s gold pieces?", "May the fleas of 1000 orcs molest you! Try %s gold pieces.", *************** *** 61,72 **** }; ! #define MAX_COMMENT_3B 12 static cptr comment_3b[MAX_COMMENT_3B] = { "Perhaps %s gold pieces?", - "How about %s gold pieces?", "I will pay no more than %s gold pieces.", "I can afford no more than %s gold pieces.", "Be reasonable. How about %s gold pieces?", --- 59,69 ---- }; ! #define MAX_COMMENT_3B 11 static cptr comment_3b[MAX_COMMENT_3B] = { "Perhaps %s gold pieces?", "I will pay no more than %s gold pieces.", "I can afford no more than %s gold pieces.", "Be reasonable. How about %s gold pieces?", *************** *** 328,343 **** { /*Hum, HfE, Elf, Hal, Gno, Dwa, HfO, HfT, Dun, HiE*/ ! /* Human */ { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105}, ! /* Half-Elf */ { 110, 100, 100, 105, 110, 120, 125, 130, 110, 100}, ! /* Elf */ { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100}, ! /* Halfling */ { 115, 110, 105, 95, 105, 110, 115, 130, 115, 105}, ! /* Gnome */ { 115, 115, 110, 105, 95, 110, 115, 130, 115, 110}, ! /* Dwarf */ { 115, 120, 120, 110, 110, 95, 125, 135, 115, 120}, ! /* Half-Orc */ { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125}, ! /* Half-Troll */ { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115}, ! /* Dunedain */ { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105}, ! /* High_Elf */ { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100} }; --- 325,350 ---- { /*Hum, HfE, Elf, Hal, Gno, Dwa, HfO, HfT, Dun, HiE*/ ! /* Human */ ! { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105}, ! /* Half-Elf */ ! { 110, 100, 100, 105, 110, 120, 125, 130, 110, 100}, ! /* Elf */ ! { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100}, ! /* Halfling */ ! { 115, 110, 105, 95, 105, 110, 115, 130, 115, 105}, ! /* Gnome */ ! { 115, 115, 110, 105, 95, 110, 115, 130, 115, 110}, ! /* Dwarf */ ! { 115, 120, 120, 110, 110, 95, 125, 135, 115, 120}, ! /* Half-Orc */ ! { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125}, ! /* Half-Troll */ ! { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115}, ! /* Dunedain */ ! { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105}, ! /* High_Elf */ ! { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100} }; *************** *** 371,377 **** /* Get the value of one of the items */ ! price = object_value(i_ptr); /* Worthless items */ if (price <= 0) return (0L); --- 378,384 ---- /* Get the value of one of the items */ ! price = i_ptr->object_value(); /* Worthless items */ if (price <= 0) return (0L); *************** *** 392,400 **** /* Never get "silly" */ if (adjust > 100) adjust = 100; - - /* Mega-Hack -- Black market sucks */ - if (store_num == 6) price = price / 2; } /* Shop is selling */ --- 399,404 ---- *************** *** 406,413 **** /* Never get "silly" */ if (adjust < 100) adjust = 100; ! /* Mega-Hack -- Black market sucks */ ! if (store_num == 6) price = price * 2; } /* Compute the final price (with rounding) */ --- 410,417 ---- /* Never get "silly" */ if (adjust < 100) adjust = 100; ! /* Black market sucks */ ! if (store_num == 6) price *= 2; } /* Compute the final price (with rounding) */ *************** *** 414,423 **** price = (price * adjust + 50L) / 100L; /* Note -- Never become "free" */ ! if (price <= 0L) return (1L); /* Return the price */ ! return (price); } --- 418,427 ---- price = (price * adjust + 50L) / 100L; /* Note -- Never become "free" */ ! if (price <= 0L) return 1L; /* Return the price */ ! return price; } *************** *** 428,434 **** { int i, t = 0; for (i = 0; i < num; i++) t += rand_int(max); ! return (t); } --- 432,438 ---- { int i, t = 0; for (i = 0; i < num; i++) t += rand_int(max); ! return t; } *************** *** 441,447 **** int size = 1; int discount = 0; ! s32b cost = object_value(i_ptr); /* Analyze the type */ --- 445,451 ---- int size = 1; int discount = 0; ! s32b cost = i_ptr->object_value(); /* Analyze the type */ *************** *** 485,491 **** if (cost <= 100L) size += mass_roll(3,5); break; - case TV_SPIKE: case TV_SHOT: case TV_ARROW: case TV_BOLT: --- 489,494 ---- *************** *** 520,529 **** /* Save the discount */ ! i_ptr->discount = discount; /* Save the total pile size */ ! i_ptr->number = size - (size * discount / 100); } --- 523,532 ---- /* Save the discount */ ! i_ptr->set_discount(discount); /* Save the total pile size */ ! i_ptr->set_number(size - (size * discount / 100)); } *************** *** 541,575 **** static bool store_object_similar(object_type *i_ptr, object_type *j_ptr) { /* Hack -- Identical items cannot be stacked */ ! if (i_ptr == j_ptr) return (0); /* Different objects cannot be stacked */ ! if (i_ptr->k_idx != j_ptr->k_idx) return (0); /* Different charges (etc) cannot be stacked */ ! if (i_ptr->pval != j_ptr->pval) return (0); /* Require many identical values */ ! if (i_ptr->to_h != j_ptr->to_h) return (0); ! if (i_ptr->to_d != j_ptr->to_d) return (0); ! if (i_ptr->to_a != j_ptr->to_a) return (0); /* Require identical "artifact" names */ ! if (i_ptr->name1 != j_ptr->name1) return (0); /* Require identical "ego-item" names */ ! if (i_ptr->name2 != j_ptr->name2) return (0); /* Hack -- Never stack "powerful" items */ ! if (i_ptr->xtra1 || j_ptr->xtra1) return (0); /* Hack -- Never stack recharging items */ ! if (i_ptr->timeout || j_ptr->timeout) return (0); /* Require many identical values */ ! if (i_ptr->ac != j_ptr->ac) return (0); ! if (i_ptr->dd != j_ptr->dd) return (0); ! if (i_ptr->ds != j_ptr->ds) return (0); /* Hack -- Never stack chests */ if (i_ptr->tval == TV_CHEST) return (0); --- 544,578 ---- static bool store_object_similar(object_type *i_ptr, object_type *j_ptr) { /* Hack -- Identical items cannot be stacked */ ! if (i_ptr == j_ptr) return FALSE; /* Different objects cannot be stacked */ ! if (i_ptr->k_idx != j_ptr->k_idx) return FALSE; /* Different charges (etc) cannot be stacked */ ! if (i_ptr->pval != j_ptr->pval) return FALSE; /* Require many identical values */ ! if (i_ptr->to_h != j_ptr->to_h) return FALSE; ! if (i_ptr->to_d != j_ptr->to_d) return FALSE; ! if (i_ptr->to_a != j_ptr->to_a) return FALSE; /* Require identical "artifact" names */ ! if (i_ptr->name1 != j_ptr->name1) return FALSE; /* Require identical "ego-item" names */ ! if (i_ptr->name2 != j_ptr->name2) return FALSE; /* Hack -- Never stack "powerful" items */ ! if (i_ptr->xtra1 || j_ptr->xtra1) return FALSE; /* Hack -- Never stack recharging items */ ! if (i_ptr->timeout || j_ptr->timeout) return FALSE; /* Require many identical values */ ! if (i_ptr->ac != j_ptr->ac) return FALSE; ! if (i_ptr->dd != j_ptr->dd) return FALSE; ! if (i_ptr->ds != j_ptr->ds) return FALSE; /* Hack -- Never stack chests */ if (i_ptr->tval == TV_CHEST) return (0); *************** *** 578,584 **** if (i_ptr->discount != j_ptr->discount) return (0); /* They match, so they must be similar */ ! return (TRUE); } --- 581,587 ---- if (i_ptr->discount != j_ptr->discount) return (0); /* They match, so they must be similar */ ! return TRUE; } *************** *** 590,596 **** int total = i_ptr->number + j_ptr->number; /* Combine quantity, lose excess items */ ! i_ptr->number = (total > 99) ? 99 : total; } --- 593,599 ---- int total = i_ptr->number + j_ptr->number; /* Combine quantity, lose excess items */ ! i_ptr->set_number((total > 99) ? 99 : total); } *************** *** 650,656 **** static bool store_will_buy(object_type *i_ptr) { /* Hack -- The Home is simple */ ! if (store_num == 7) return (TRUE); /* Switch on the store */ switch (store_num) --- 653,659 ---- static bool store_will_buy(object_type *i_ptr) { /* Hack -- The Home is simple */ ! if (store_num == 7) return TRUE; /* Switch on the store */ switch (store_num) *************** *** 666,679 **** case TV_FOOD: case TV_FLASK: case TV_LITE: - case TV_SPIKE: break; default: ! return (FALSE); } break; ! /* Armoury */ case 1: /* Analyze the type */ --- 669,681 ---- case TV_FOOD: case TV_FLASK: case TV_LITE: break; default: ! return FALSE; } break; ! /* Armorer */ case 1: /* Analyze the type */ *************** *** 726,732 **** case TV_HAFTED: break; default: ! return (FALSE); } break; --- 728,734 ---- case TV_HAFTED: break; default: ! return FALSE; } break; *************** *** 760,775 **** case TV_POTION: break; default: ! return (FALSE); } break; } /* XXX XXX XXX Ignore "worthless" items */ ! if (object_value(i_ptr) <= 0) return (FALSE); /* Assume okay */ ! return (TRUE); } --- 762,777 ---- case TV_POTION: break; default: ! return FALSE; } break; } /* XXX XXX XXX Ignore "worthless" items */ ! if (i_ptr->object_value() <= 0) return FALSE; /* Assume okay */ ! return TRUE; } *************** *** 786,794 **** */ static int home_carry(object_type *i_ptr) { ! int slot; s32b value, j_value; - int i; object_type *j_ptr; --- 788,795 ---- */ static int home_carry(object_type *i_ptr) { ! int slot, i; s32b value, j_value; object_type *j_ptr; *************** *** 810,820 **** } /* No space? */ ! if (st_ptr->stock_num >= st_ptr->stock_size) return (-1); /* Determine the "value" of the item */ ! value = object_value(i_ptr); /* Check existing slots to see if we must "slide" */ for (slot = 0; slot < st_ptr->stock_num; slot++) --- 811,821 ---- } /* No space? */ ! if (st_ptr->stock_num >= st_ptr->stock_size) return -1; /* Determine the "value" of the item */ ! value = i_ptr->object_value(); /* Check existing slots to see if we must "slide" */ for (slot = 0; slot < st_ptr->stock_num; slot++) *************** *** 833,840 **** if (i_ptr->tval < j_ptr->tval) continue; /* Can happen in the home */ ! if (!object_aware_p(i_ptr)) continue; ! if (!object_aware_p(j_ptr)) break; /* Objects sort by increasing sval */ if (i_ptr->sval < j_ptr->sval) break; --- 834,841 ---- if (i_ptr->tval < j_ptr->tval) continue; /* Can happen in the home */ ! if (!i_ptr->is_aware()) continue; ! if (!j_ptr->is_aware()) break; /* Objects sort by increasing sval */ if (i_ptr->sval < j_ptr->sval) break; *************** *** 841,851 **** if (i_ptr->sval > j_ptr->sval) continue; /* Objects in the home can be unknown */ ! if (!object_known_p(i_ptr)) continue; ! if (!object_known_p(j_ptr)) break; /* Objects sort by decreasing value */ ! j_value = object_value(j_ptr); if (value > j_value) break; if (value < j_value) continue; } --- 842,860 ---- if (i_ptr->sval > j_ptr->sval) continue; /* Objects in the home can be unknown */ ! if (!i_ptr->is_known()) continue; ! if (!j_ptr->is_known()) break; + /* Hack -- otherwise identical rods sort by increasing + recharge time -- dsb */ + if (i_ptr->tval == TV_ROD) + { + if (i_ptr->pval < j_ptr->pval) break; + if (i_ptr->pval > j_ptr->pval) continue; + } + /* Objects sort by decreasing value */ ! j_value = j_ptr->object_value(); if (value > j_value) break; if (value < j_value) continue; } *************** *** 887,893 **** /* Evaluate the object */ ! value = object_value(i_ptr); /* Cursed/Worthless items "disappear" when sold */ if (value <= 0) return (-1); --- 896,902 ---- /* Evaluate the object */ ! value = i_ptr->object_value(); /* Cursed/Worthless items "disappear" when sold */ if (value <= 0) return (-1); *************** *** 894,900 **** /* Erase the inscription */ ! i_ptr->note = 0; /* Check each existing item (try to combine) */ for (slot = 0; slot < st_ptr->stock_num; slot++) --- 903,909 ---- /* Erase the inscription */ ! i_ptr->set_note(0); /* Check each existing item (try to combine) */ for (slot = 0; slot < st_ptr->stock_num; slot++) *************** *** 931,938 **** if (i_ptr->sval < j_ptr->sval) break; if (i_ptr->sval > j_ptr->sval) continue; /* Evaluate that slot */ ! j_value = object_value(j_ptr); /* Objects sort by decreasing value */ if (value > j_value) break; --- 940,955 ---- if (i_ptr->sval < j_ptr->sval) break; if (i_ptr->sval > j_ptr->sval) continue; + /* Hack -- otherwise identical rods sort by increasing + recharge time -- dsb */ + if (i_ptr->tval == TV_ROD) + { + if (i_ptr->pval < j_ptr->pval) break; + if (i_ptr->pval > j_ptr->pval) continue; + } + /* Evaluate that slot */ ! j_value = j_ptr->object_value(); /* Objects sort by decreasing value */ if (value > j_value) break; *************** *** 975,981 **** num = cnt - i_ptr->number; /* Save the new number */ ! i_ptr->number += num; } --- 992,998 ---- num = cnt - i_ptr->number; /* Save the new number */ ! i_ptr->set_number(i_ptr->number + num); } *************** *** 991,997 **** i_ptr = &st_ptr->stock[item]; /* Must exist */ ! if (!i_ptr->k_idx) return; /* Must have no items */ if (i_ptr->number) return; --- 1008,1014 ---- i_ptr = &st_ptr->stock[item]; /* Must exist */ ! if (!i_ptr->exists()) return; /* Must have no items */ if (i_ptr->number) return; *************** *** 1020,1031 **** int i, j; /* Ego items are never crap */ ! if (i_ptr->name2) return (FALSE); /* Good items are never crap */ ! if (i_ptr->to_a > 0) return (FALSE); ! if (i_ptr->to_h > 0) return (FALSE); ! if (i_ptr->to_d > 0) return (FALSE); /* Check the other "normal" stores */ for (i = 0; i < 6; i++) --- 1037,1048 ---- int i, j; /* Ego items are never crap */ ! if (i_ptr->name2) return FALSE; /* Good items are never crap */ ! if (i_ptr->to_a > 0) return FALSE; ! if (i_ptr->to_h > 0) return FALSE; ! if (i_ptr->to_d > 0) return FALSE; /* Check the other "normal" stores */ for (i = 0; i < 6; i++) *************** *** 1057,1063 **** what = rand_int(st_ptr->stock_num); /* Determine how many items are here */ ! num = st_ptr->stock[what].number; /* Hack -- sometimes, only destroy half the items */ if (rand_int(100) < 50) num = (num + 1) / 2; --- 1074,1080 ---- what = rand_int(st_ptr->stock_num); /* Determine how many items are here */ ! num = st_ptr->stock[what].get_number(); /* Hack -- sometimes, only destroy half the items */ if (rand_int(100) < 50) num = (num + 1) / 2; *************** *** 1121,1127 **** /* Create a new object of the chosen kind */ ! invcopy(i_ptr, i); /* Apply some "low-level" magic (no artifacts) */ apply_magic(i_ptr, level, FALSE, FALSE, FALSE); --- 1138,1144 ---- /* Create a new object of the chosen kind */ ! i_ptr->invcopy(i); /* Apply some "low-level" magic (no artifacts) */ apply_magic(i_ptr, level, FALSE, FALSE, FALSE); *************** *** 1129,1141 **** /* Hack -- Charge lite's */ if (i_ptr->tval == TV_LITE) { ! if (i_ptr->sval == SV_LITE_TORCH) i_ptr->pval = FUEL_TORCH / 2; ! if (i_ptr->sval == SV_LITE_LANTERN) i_ptr->pval = FUEL_LAMP / 2; } /* The item is "known" */ ! object_known(i_ptr); /* Mega-Hack -- no chests in stores */ if (i_ptr->tval == TV_CHEST) continue; --- 1146,1164 ---- /* Hack -- Charge lite's */ if (i_ptr->tval == TV_LITE) { ! if (i_ptr->sval == SV_LITE_TORCH) ! { ! i_ptr->set_pval(FUEL_TORCH / 2); } + if (i_ptr->sval == SV_LITE_LANTERN) + { + i_ptr->set_pval(FUEL_LAMP / 2); + } + } /* The item is "known" */ ! i_ptr->object_known(); /* Mega-Hack -- no chests in stores */ if (i_ptr->tval == TV_CHEST) continue; *************** *** 1147,1156 **** if (black_market_crap(i_ptr)) continue; /* Hack -- No "cheap" items */ ! if (object_value(i_ptr) < 10) continue; ! ! /* No "worthless" items */ ! /* if (object_value(i_ptr) <= 0) continue; */ } /* Prune normal stores */ --- 1170,1176 ---- if (black_market_crap(i_ptr)) continue; /* Hack -- No "cheap" items */ ! if (i_ptr->object_value() < 10) continue; } /* Prune normal stores */ *************** *** 1157,1163 **** else { /* No "worthless" items */ ! if (object_value(i_ptr) <= 0) continue; } --- 1177,1183 ---- else { /* No "worthless" items */ ! if (i_ptr->object_value() <= 0) continue; } *************** *** 1303,1309 **** } /* Display a "fixed" cost */ ! if (i_ptr->ident & ID_FIXED) { /* Extract the "minimum" price */ x = price_item(i_ptr, ot_ptr->min_inflate, FALSE); --- 1323,1329 ---- } /* Display a "fixed" cost */ ! if (i_ptr->test_ident_flag(ID_FIXED)) { /* Extract the "minimum" price */ x = price_item(i_ptr, ot_ptr->min_inflate, FALSE); *************** *** 1785,1791 **** max_per = min_per * 3; /* Mega-Hack -- artificial "last offer" value */ ! last_offer = object_value(i_ptr) * i_ptr->number; last_offer = last_offer * (200 - (int)(ot_ptr->max_inflate)) / 100L; if (last_offer <= 0) last_offer = 1; --- 1805,1811 ---- max_per = min_per * 3; /* Mega-Hack -- artificial "last offer" value */ ! last_offer = i_ptr->object_value() * i_ptr->number; last_offer = last_offer * (200 - (int)(ot_ptr->max_inflate)) / 100L; if (last_offer <= 0) last_offer = 1; *************** *** 1981,1987 **** max_per = min_per * 3; /* Mega-Hack -- artificial "last offer" value */ ! last_offer = object_value(i_ptr) * i_ptr->number; last_offer = last_offer * ot_ptr->max_inflate / 100L; /* No offer yet */ --- 2001,2007 ---- max_per = min_per * 3; /* Mega-Hack -- artificial "last offer" value */ ! last_offer = i_ptr->object_value() * i_ptr->number; last_offer = last_offer * ot_ptr->max_inflate / 100L; /* No offer yet */ *************** *** 2150,2156 **** /* Hack -- get a "sample" object */ sell_obj = *i_ptr; ! sell_obj.number = amt; /* Hack -- require room in pack */ if (!inven_carry_okay(&sell_obj)) --- 2170,2176 ---- /* Hack -- get a "sample" object */ sell_obj = *i_ptr; ! sell_obj.set_number(amt); /* Hack -- require room in pack */ if (!inven_carry_okay(&sell_obj)) *************** *** 2163,2173 **** best = price_item(&sell_obj, ot_ptr->min_inflate, FALSE); /* Find out how many the player wants */ ! if (i_ptr->number > 1) { /* Hack -- note cost of "fixed" items */ ! if ((store_num != 7) && (i_ptr->ident & ID_FIXED)) { msg_format("That costs %ld gold per item.", (long)(best)); } --- 2183,2193 ---- best = price_item(&sell_obj, ot_ptr->min_inflate, FALSE); /* Find out how many the player wants */ ! if (i_ptr->is_plural()) { /* Hack -- note cost of "fixed" items */ ! if ((store_num != 7) && i_ptr->test_ident_flag(ID_FIXED)) { msg_format("That costs %ld gold per item.", (long)(best)); } *************** *** 2181,2187 **** /* Create the object to be sold (structure copy) */ sell_obj = *i_ptr; ! sell_obj.number = amt; /* Hack -- require room in pack */ if (!inven_carry_okay(&sell_obj)) --- 2201,2207 ---- /* Create the object to be sold (structure copy) */ sell_obj = *i_ptr; ! sell_obj.set_number(amt); /* Hack -- require room in pack */ if (!inven_carry_okay(&sell_obj)) *************** *** 2194,2206 **** if (store_num != 7) { /* Fixed price, quick buy */ ! if (i_ptr->ident & ID_FIXED) { /* Assume accept */ choice = 0; /* Go directly to the "best" deal */ ! price = (best * sell_obj.number); } /* Haggle for it */ --- 2214,2226 ---- if (store_num != 7) { /* Fixed price, quick buy */ ! if (i_ptr->test_ident_flag(ID_FIXED)) { /* Assume accept */ choice = 0; /* Go directly to the "best" deal */ ! price = best * sell_obj.get_number(); } /* Haggle for it */ *************** *** 2225,2231 **** if (choice == 0) { /* Fix the item price (if "correctly" haggled) */ ! if (price == (best * sell_obj.number)) i_ptr->ident |= ID_FIXED; /* Player can afford it */ if (p_ptr->au >= price) --- 2245,2254 ---- if (choice == 0) { /* Fix the item price (if "correctly" haggled) */ ! if (price == (best * sell_obj.get_number())) ! { ! i_ptr->set_ident_flag(ID_FIXED); ! } /* Player can afford it */ if (p_ptr->au >= price) *************** *** 2243,2252 **** store_prt_gold(); /* Hack -- buying an item makes you aware of it */ ! object_aware(&sell_obj); /* Hack -- clear the "fixed" flag from the item */ ! sell_obj.ident &= ~ID_FIXED; /* Describe the transaction */ object_desc(i_name, &sell_obj, TRUE, 3); --- 2266,2275 ---- store_prt_gold(); /* Hack -- buying an item makes you aware of it */ ! sell_obj.object_aware(); /* Hack -- clear the "fixed" flag from the item */ ! sell_obj.clear_ident_flag(ID_FIXED); /* Describe the transaction */ object_desc(i_name, &sell_obj, TRUE, 3); *************** *** 2401,2407 **** amt = 1; /* Find out how many the player wants (letter means "all") */ ! if (i_ptr->number > 1) { /* Get a quantity */ amt = get_quantity(NULL, i_ptr->number); --- 2424,2430 ---- amt = 1; /* Find out how many the player wants (letter means "all") */ ! if (i_ptr->is_plural()) { /* Get a quantity */ amt = get_quantity(NULL, i_ptr->number); *************** *** 2413,2419 **** #if 0 /* Not gonna happen XXX inscribe */ ! if ((item >= INVEN_WIELD) && cursed_p(i_ptr)) { /* Oops */ msg_print("Hmmm, it seems to be cursed."); --- 2436,2442 ---- #if 0 /* Not gonna happen XXX inscribe */ ! if ((item >= INVEN_WIELD) && i_ptr->is_cursed()) { /* Oops */ msg_print("Hmmm, it seems to be cursed."); *************** *** 2426,2438 **** /* Create the object to be sold (structure copy) */ sold_obj = *i_ptr; ! sold_obj.number = amt; /* Get a full description */ object_desc(i_name, &sold_obj, TRUE, 3); /* Remove any inscription for stores */ ! if (store_num != 7) sold_obj.note = 0; /* Is there room in the store (or the home?) */ if (!store_check_num(&sold_obj)) --- 2449,2461 ---- /* Create the object to be sold (structure copy) */ sold_obj = *i_ptr; ! sold_obj.set_number(amt); /* Get a full description */ object_desc(i_name, &sold_obj, TRUE, 3); /* Remove any inscription for stores */ ! if (store_num != 7) sold_obj.set_note(0); /* Is there room in the store (or the home?) */ if (!store_check_num(&sold_obj)) *************** *** 2475,2494 **** i_ptr = &inventory[item]; /* Get the "apparent" value */ ! dummy = object_value(&sold_obj) * sold_obj.number; /* Become "aware" of the item */ ! object_aware(i_ptr); /* Know the item fully */ ! object_known(i_ptr); /* Re-Create the now-identified object that was sold */ sold_obj = *i_ptr; ! sold_obj.number = amt; /* Get the "actual" value */ ! value = object_value(&sold_obj) * sold_obj.number; /* Get the description all over again */ object_desc(i_name, &sold_obj, TRUE, 3); --- 2498,2517 ---- i_ptr = &inventory[item]; /* Get the "apparent" value */ ! dummy = sold_obj.object_value() * sold_obj.get_number(); /* Become "aware" of the item */ ! i_ptr->object_aware(); /* Know the item fully */ ! i_ptr->object_known(); /* Re-Create the now-identified object that was sold */ sold_obj = *i_ptr; ! sold_obj.set_number(amt); /* Get the "actual" value */ ! value = sold_obj.object_value() * sold_obj.get_number(); /* Get the description all over again */ object_desc(i_name, &sold_obj, TRUE, 3); *************** *** 2610,2620 **** /*** Inventory Commands ***/ /* Wear/wield equipment */ ! case '[': do_cmd_wield(); break; /* Take off equipment */ ! case ']': do_cmd_takeoff(); break; #if 0 --- 2633,2643 ---- /*** Inventory Commands ***/ /* Wear/wield equipment */ ! case 'w': do_cmd_wield(); break; /* Take off equipment */ ! case 't': do_cmd_takeoff(); break; #if 0 *************** *** 2723,2732 **** case 'c': do_cmd_close(); break; - /* Jam a door with spikes */ - case 'j': - do_cmd_spike(); break; - /* Bash a door */ case 'B': do_cmd_bash(); break; --- 2746,2751 ---- *************** *** 2767,2773 **** /*** Use various objects ***/ /* Inscribe an object */ ! case '{': do_cmd_inscribe(); break; /* Uninscribe an object */ --- 2786,2793 ---- /*** Use various objects ***/ /* Inscribe an object */ ! case ' ! {': do_cmd_inscribe(); break; /* Uninscribe an object */ *************** *** 3090,3099 **** switch (command_cmd) { /* Command "g" -> "get" (ignore) */ ! case 'g': command_cmd = '`'; break; /* Command "d" -> "drop" (ignore) */ ! case 'd': command_cmd = '`'; break; /* Command "p" -> "purchase" */ case 'p': command_cmd = 'g'; break; --- 3110,3121 ---- switch (command_cmd) { /* Command "g" -> "get" (ignore) */ ! case 'g': command_cmd = ' ! '; break; /* Command "d" -> "drop" (ignore) */ ! case 'd': command_cmd = ' ! '; break; /* Command "p" -> "purchase" */ case 'p': command_cmd = 'g'; break; *************** *** 3119,3125 **** handle_stuff(); /* XXX XXX XXX Pack Overflow */ ! if (inventory[INVEN_PACK].k_idx) { /* Hack -- Flee from the store */ if (store_num != 7) --- 3141,3147 ---- handle_stuff(); /* XXX XXX XXX Pack Overflow */ ! if (inventory[INVEN_PACK].exists()) { /* Hack -- Flee from the store */ if (store_num != 7) *************** *** 3215,3225 **** /* Update stuff */ ! p_ptr->update |= (PU_VIEW | PU_LITE); ! p_ptr->update |= (PU_MONSTERS); /* Redraw stuff */ ! p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA); /* Redraw map */ p_ptr->redraw |= (PR_MAP | PR_AROUND); --- 3237,3247 ---- /* Update stuff */ ! p_ptr->update |= PU_VIEW | PU_LITE; ! p_ptr->update |= PU_MONSTERS; /* Redraw stuff */ ! p_ptr->redraw |= PR_WIPE | PR_BASIC | PR_EXTRA; /* Redraw map */ p_ptr->redraw |= (PR_MAP | PR_AROUND); *************** *** 3267,3279 **** i_ptr = &st_ptr->stock[i]; /* Hack -- Sell all old items for "half price" */ ! i_ptr->discount = 50; /* Hack -- Items are no longer "fixed price" */ ! i_ptr->ident &= ~ID_FIXED; /* Mega-Hack -- Note that the item is "on sale" */ ! i_ptr->note = quark_add("on sale"); } /* Turn it all off */ --- 3289,3301 ---- i_ptr = &st_ptr->stock[i]; /* Hack -- Sell all old items for "half price" */ ! i_ptr->set_discount(50); /* Hack -- Items are no longer "fixed price" */ ! i_ptr->clear_ident_flag(ID_FIXED); /* Mega-Hack -- Note that the item is "on sale" */ ! i_ptr->set_note(quark_add("on sale")); } /* Turn it all off */ diff -w -c -r ick-279/tables.c utumno/tables.c *** ick-279/tables.c Thu May 15 17:12:23 1997 --- utumno/tables.c Thu May 15 17:45:59 1997 *************** *** 18,36 **** /* * Global array for looping through the "keypad directions" */ ! s16b ddd[9] = { 2, 8, 6, 4, 3, 1, 9, 7, 5 }; /* * Global arrays for converting "keypad direction" into offsets */ ! s16b ddx[10] = { 0, -1, 0, 1, -1, 0, 1, -1, 0, 1 }; ! s16b ddy[10] = { 0, 1, 1, 1, 0, 0, 0, -1, -1, -1 }; /* * Global arrays for optimizing "ddx[ddd[i]]" and "ddy[ddd[i]]" */ ! s16b ddx_ddd[9] = { 0, 0, 1, -1, 1, -1, 1, -1, 0 }; ! s16b ddy_ddd[9] = { 1, -1, 0, 0, 1, 1, -1, -1, 0 }; --- 18,41 ---- /* * Global array for looping through the "keypad directions" */ ! s16b ddd[9] = ! { 2, 8, 6, 4, 3, 1, 9, 7, 5 }; /* * Global arrays for converting "keypad direction" into offsets */ ! s16b ddx[10] = ! { 0, -1, 0, 1, -1, 0, 1, -1, 0, 1 }; ! s16b ddy[10] = ! { 0, 1, 1, 1, 0, 0, 0, -1, -1, -1 }; /* * Global arrays for optimizing "ddx[ddd[i]]" and "ddy[ddd[i]]" */ ! s16b ddx_ddd[9] = ! { 0, 0, 1, -1, 1, -1, 1, -1, 0 }; ! s16b ddy_ddd[9] = ! { 1, -1, 0, 0, 1, 1, -1, -1, 0 }; *************** *** 464,507 **** */ byte adj_dex_ta[] = { ! 128 + -4 /* 3 */, ! 128 + -3 /* 4 */, ! 128 + -2 /* 5 */, ! 128 + -1 /* 6 */, ! 128 + 0 /* 7 */, ! 128 + 0 /* 8 */, 128 + 0 /* 9 */, 128 + 0 /* 10 */, 128 + 0 /* 11 */, 128 + 0 /* 12 */, ! 128 + 0 /* 13 */, ! 128 + 0 /* 14 */, ! 128 + 1 /* 15 */, ! 128 + 1 /* 16 */, ! 128 + 1 /* 17 */, ! 128 + 2 /* 18/00-18/09 */, ! 128 + 2 /* 18/10-18/19 */, ! 128 + 2 /* 18/20-18/29 */, ! 128 + 2 /* 18/30-18/39 */, ! 128 + 2 /* 18/40-18/49 */, ! 128 + 3 /* 18/50-18/59 */, ! 128 + 3 /* 18/60-18/69 */, ! 128 + 3 /* 18/70-18/79 */, ! 128 + 4 /* 18/80-18/89 */, ! 128 + 5 /* 18/90-18/99 */, ! 128 + 6 /* 18/100-18/109 */, ! 128 + 7 /* 18/110-18/119 */, ! 128 + 8 /* 18/120-18/129 */, ! 128 + 9 /* 18/130-18/139 */, ! 128 + 9 /* 18/140-18/149 */, ! 128 + 10 /* 18/150-18/159 */, ! 128 + 11 /* 18/160-18/169 */, ! 128 + 12 /* 18/170-18/179 */, ! 128 + 13 /* 18/180-18/189 */, ! 128 + 14 /* 18/190-18/199 */, ! 128 + 15 /* 18/200-18/209 */, ! 128 + 15 /* 18/210-18/219 */, ! 128 + 15 /* 18/220+ */ }; --- 469,512 ---- */ byte adj_dex_ta[] = { ! 128 + -10 /* 3 */, ! 128 + -7 /* 4 */, ! 128 + -5 /* 5 */, ! 128 + -3 /* 6 */, ! 128 + -2 /* 7 */, ! 128 + -1 /* 8 */, 128 + 0 /* 9 */, 128 + 0 /* 10 */, 128 + 0 /* 11 */, 128 + 0 /* 12 */, ! 128 + 1 /* 13 */, ! 128 + 1 /* 14 */, ! 128 + 2 /* 15 */, ! 128 + 2 /* 16 */, ! 128 + 3 /* 17 */, ! 128 + 4 /* 18/00-18/09 */, ! 128 + 5 /* 18/10-18/19 */, ! 128 + 6 /* 18/20-18/29 */, ! 128 + 6 /* 18/30-18/39 */, ! 128 + 7 /* 18/40-18/49 */, ! 128 + 8 /* 18/50-18/59 */, ! 128 + 9 /* 18/60-18/69 */, ! 128 + 10 /* 18/70-18/79 */, ! 128 + 11 /* 18/80-18/89 */, ! 128 + 12 /* 18/90-18/99 */, ! 128 + 13 /* 18/100-18/109 */, ! 128 + 15 /* 18/110-18/119 */, ! 128 + 17 /* 18/120-18/129 */, ! 128 + 19 /* 18/130-18/139 */, ! 128 + 21 /* 18/140-18/149 */, ! 128 + 22 /* 18/150-18/159 */, ! 128 + 23 /* 18/160-18/169 */, ! 128 + 24 /* 18/170-18/179 */, ! 128 + 25 /* 18/180-18/189 */, ! 128 + 26 /* 18/190-18/199 */, ! 128 + 28 /* 18/200-18/209 */, ! 128 + 30 /* 18/210-18/219 */, ! 128 + 32 /* 18/220+ */ }; *************** *** 556,565 **** */ byte adj_dex_th[] = { ! 128 + -3 /* 3 */, ! 128 + -2 /* 4 */, ! 128 + -2 /* 5 */, ! 128 + -1 /* 6 */, 128 + -1 /* 7 */, 128 + 0 /* 8 */, 128 + 0 /* 9 */, --- 561,570 ---- */ byte adj_dex_th[] = { ! 128 + -6 /* 3 */, ! 128 + -4 /* 4 */, ! 128 + -3 /* 5 */, ! 128 + -2 /* 6 */, 128 + -1 /* 7 */, 128 + 0 /* 8 */, 128 + 0 /* 9 */, *************** *** 568,599 **** 128 + 0 /* 12 */, 128 + 0 /* 13 */, 128 + 0 /* 14 */, ! 128 + 0 /* 15 */, ! 128 + 1 /* 16 */, ! 128 + 2 /* 17 */, ! 128 + 3 /* 18/00-18/09 */, ! 128 + 3 /* 18/10-18/19 */, ! 128 + 3 /* 18/20-18/29 */, ! 128 + 3 /* 18/30-18/39 */, ! 128 + 3 /* 18/40-18/49 */, ! 128 + 4 /* 18/50-18/59 */, ! 128 + 4 /* 18/60-18/69 */, ! 128 + 4 /* 18/70-18/79 */, ! 128 + 4 /* 18/80-18/89 */, ! 128 + 5 /* 18/90-18/99 */, ! 128 + 6 /* 18/100-18/109 */, ! 128 + 7 /* 18/110-18/119 */, ! 128 + 8 /* 18/120-18/129 */, ! 128 + 9 /* 18/130-18/139 */, ! 128 + 9 /* 18/140-18/149 */, ! 128 + 10 /* 18/150-18/159 */, ! 128 + 11 /* 18/160-18/169 */, ! 128 + 12 /* 18/170-18/179 */, ! 128 + 13 /* 18/180-18/189 */, ! 128 + 14 /* 18/190-18/199 */, ! 128 + 15 /* 18/200-18/209 */, ! 128 + 15 /* 18/210-18/219 */, ! 128 + 15 /* 18/220+ */ }; --- 573,604 ---- 128 + 0 /* 12 */, 128 + 0 /* 13 */, 128 + 0 /* 14 */, ! 128 + 1 /* 15 */, ! 128 + 2 /* 16 */, ! 128 + 3 /* 17 */, ! 128 + 4 /* 18/00-18/09 */, ! 128 + 4 /* 18/10-18/19 */, ! 128 + 5 /* 18/20-18/29 */, ! 128 + 5 /* 18/30-18/39 */, ! 128 + 6 /* 18/40-18/49 */, ! 128 + 6 /* 18/50-18/59 */, ! 128 + 7 /* 18/60-18/69 */, ! 128 + 7 /* 18/70-18/79 */, ! 128 + 8 /* 18/80-18/89 */, ! 128 + 8 /* 18/90-18/99 */, ! 128 + 9 /* 18/100-18/109 */, ! 128 + 10 /* 18/110-18/119 */, ! 128 + 11 /* 18/120-18/129 */, ! 128 + 12 /* 18/130-18/139 */, ! 128 + 13 /* 18/140-18/149 */, ! 128 + 14 /* 18/150-18/159 */, ! 128 + 15 /* 18/160-18/169 */, ! 128 + 16 /* 18/170-18/179 */, ! 128 + 17 /* 18/180-18/189 */, ! 128 + 18 /* 18/190-18/199 */, ! 128 + 19 /* 18/200-18/209 */, ! 128 + 20 /* 18/210-18/219 */, ! 128 + 20 /* 18/220+ */ }; *************** *** 664,678 **** 18 /* 16 */, 19 /* 17 */, 20 /* 18/00-18/09 */, ! 22 /* 18/10-18/19 */, ! 24 /* 18/20-18/29 */, ! 26 /* 18/30-18/39 */, ! 28 /* 18/40-18/49 */, ! 30 /* 18/50-18/59 */, ! 30 /* 18/60-18/69 */, ! 30 /* 18/70-18/79 */, ! 30 /* 18/80-18/89 */, ! 30 /* 18/90-18/99 */, 30 /* 18/100-18/109 */, 30 /* 18/110-18/119 */, 30 /* 18/120-18/129 */, --- 669,683 ---- 18 /* 16 */, 19 /* 17 */, 20 /* 18/00-18/09 */, ! 21 /* 18/10-18/19 */, ! 22 /* 18/20-18/29 */, ! 23 /* 18/30-18/39 */, ! 24 /* 18/40-18/49 */, ! 25 /* 18/50-18/59 */, ! 26 /* 18/60-18/69 */, ! 27 /* 18/70-18/79 */, ! 28 /* 18/80-18/89 */, ! 29 /* 18/90-18/99 */, 30 /* 18/100-18/109 */, 30 /* 18/110-18/119 */, 30 /* 18/120-18/129 */, *************** *** 1043,1060 **** /* P/D 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11+ */ ! /* 0 */ { 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3 }, ! /* 1 */ { 1, 1, 1, 1, 2, 2, 3, 3, 3, 4, 4, 4 }, ! /* 2 */ { 1, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 5 }, ! /* 3 */ { 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 5, 5 }, ! /* 4 */ { 1, 2, 2, 3, 3, 4, 4, 5, 5, 5, 5, 5 }, ! /* 5 */ { 2, 2, 3, 3, 4, 4, 5, 5, 5, 5, 5, 6 }, ! /* 6 */ { 2, 2, 3, 3, 4, 4, 5, 5, 5, 5, 5, 6 }, ! /* 7 */ { 2, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 6 }, ! /* 8 */ { 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 6, 6 }, ! /* 9 */ { 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6 }, ! /* 10 */ { 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, 6, 6 }, ! /* 11+ */ { 3, 3, 4, 4, 4, 4, 5, 5, 6, 6, 6, 6 }, }; --- 1048,1077 ---- /* P/D 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11+ */ ! /* 0 */ ! { 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3 }, ! /* 1 */ ! { 1, 1, 1, 1, 2, 2, 3, 3, 3, 4, 4, 4 }, ! /* 2 */ ! { 1, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 5 }, ! /* 3 */ ! { 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 5, 5 }, ! /* 4 */ ! { 1, 2, 2, 3, 3, 4, 4, 5, 5, 5, 5, 5 }, ! /* 5 */ ! { 2, 2, 3, 3, 4, 4, 5, 5, 5, 5, 5, 6 }, ! /* 6 */ ! { 2, 2, 3, 3, 4, 4, 5, 5, 5, 5, 5, 6 }, ! /* 7 */ ! { 2, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 6 }, ! /* 8 */ ! { 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 6, 6 }, ! /* 9 */ ! { 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6 }, ! /* 10 */ ! { 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, 6, 6 }, ! /* 11+ */ ! { 3, 3, 4, 4, 4, 4, 5, 5, 6, 6, 6, 6 }, }; *************** *** 1072,1088 **** /* P/D 3, 10, /01, /50, /90,/100,/101,/110,/120,/130,/140,/150 */ ! /* 0+ */ { 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3}, ! /* 2+ */ { 1, 1, 1, 1, 2, 2, 3, 3, 3, 3, 3, 4}, ! /* 3+ */ { 1, 1, 1, 2, 2, 3, 4, 4, 4, 4, 4, 5}, ! /* 4+ */ { 1, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 5}, ! /* 6+ */ { 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 5, 5}, ! /* 8+ */ { 1, 2, 2, 3, 4, 4, 4, 5, 5, 5, 5, 5}, ! /* 10+ */ { 2, 2, 3, 3, 4, 4, 5, 5, 5, 5, 5, 6}, ! /* 13+ */ { 2, 3, 3, 3, 4, 4, 5, 5, 5, 5, 5, 6}, ! /* 15+ */ { 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 6, 6}, ! /* 18+ */ { 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 6, 6}, ! /* 20+ */ { 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, 6, 6} }; --- 1089,1116 ---- /* P/D 3, 10, /01, /50, /90,/100,/101,/110,/120,/130,/140,/150 */ ! /* 0+ */ ! { 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3}, ! /* 2+ */ ! { 1, 1, 1, 1, 2, 2, 3, 3, 3, 3, 3, 4}, ! /* 3+ */ ! { 1, 1, 1, 2, 2, 3, 4, 4, 4, 4, 4, 5}, ! /* 4+ */ ! { 1, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 5}, ! /* 6+ */ ! { 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 5, 5}, ! /* 8+ */ ! { 1, 2, 2, 3, 4, 4, 4, 5, 5, 5, 5, 5}, ! /* 10+ */ ! { 2, 2, 3, 3, 4, 4, 5, 5, 5, 5, 5, 6}, ! /* 13+ */ ! { 2, 3, 3, 3, 4, 4, 5, 5, 5, 5, 5, 6}, ! /* 15+ */ ! { 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 6, 6}, ! /* 18+ */ ! { 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 6, 6}, ! /* 20+ */ ! { 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, 6, 6} }; *************** *** 1092,1098 **** /* * Store owners (exactly four "possible" owners per store, chosen randomly) ! * { name, purse, max greed, min greed, haggle_per, tolerance, race, unused } */ owner_type owners[MAX_STORES][MAX_OWNERS] = { --- 1120,1127 ---- /* * Store owners (exactly four "possible" owners per store, chosen randomly) ! * ! { name, purse, max greed, min greed, haggle_per, tolerance, race, unused } */ owner_type owners[MAX_STORES][MAX_OWNERS] = { *************** *** 1104,1130 **** { "Lyar-el the Comely", 300, 165, 107, 6, 18, RACE_ELF}, }, { ! /* Armoury */ ! { "Kon-Dar the Ugly", 5000, 210, 115, 5, 7, RACE_HALF_ORC}, ! { "Darg-Low the Grim", 10000, 190, 111, 4, 9, RACE_HUMAN}, { "Decado the Handsome", 25000, 200, 112, 4, 10, RACE_DUNADAN}, { "Mauglin the Grumpy", 30000, 200, 112, 4, 5, RACE_DWARF}, }, { /* Weapon Smith */ ! { "Ithyl-Mak the Beastly", 5000, 210, 115, 6, 6, RACE_HALF_TROLL}, ! { "Arndal Beast-Slayer", 10000, 185, 110, 5, 9, RACE_HALF_ELF}, { "Tarl Beast-Master", 25000, 190, 115, 5, 7, RACE_HOBBIT}, { "Oglign Dragon-Slayer", 30000, 195, 112, 4, 8, RACE_DWARF}, }, { /* Temple */ ! { "Ludwig the Humble", 5000, 175, 109, 6, 15, RACE_HUMAN}, ! { "Gunnar the Paladin", 10000, 185, 110, 5, 23, RACE_HUMAN}, { "Delilah the Pure", 25000, 180, 107, 6, 20, RACE_ELF}, { "Bosk the Wise", 30000, 185, 109, 5, 15, RACE_DWARF}, }, { { "Mauser the Chemist", 10000, 190, 111, 5, 8, RACE_HALF_ELF}, { "Wizzle the Chaotic", 10000, 190, 110, 6, 8, RACE_HOBBIT}, { "Ga-nat the Greedy", 15000, 200, 116, 6, 9, RACE_GNOME}, --- 1133,1160 ---- { "Lyar-el the Comely", 300, 165, 107, 6, 18, RACE_ELF}, }, { ! /* Armorer */ ! { "Kon-Dar the Ugly", 10000, 210, 115, 5, 7, RACE_HALF_ORC}, ! { "Darg-Low the Grim", 15000, 190, 111, 4, 9, RACE_HUMAN}, { "Decado the Handsome", 25000, 200, 112, 4, 10, RACE_DUNADAN}, { "Mauglin the Grumpy", 30000, 200, 112, 4, 5, RACE_DWARF}, }, { /* Weapon Smith */ ! { "Ithyl-Mak the Beastly", 10000, 210, 115, 6, 6, RACE_HALF_TROLL}, ! { "Arndal Beast-Slayer", 15000, 185, 110, 5, 9, RACE_HALF_ELF}, { "Tarl Beast-Master", 25000, 190, 115, 5, 7, RACE_HOBBIT}, { "Oglign Dragon-Slayer", 30000, 195, 112, 4, 8, RACE_DWARF}, }, { /* Temple */ ! { "Ludwig the Humble", 10000, 175, 109, 6, 15, RACE_HUMAN}, ! { "Gunnar the Paladin", 15000, 185, 110, 5, 23, RACE_HUMAN}, { "Delilah the Pure", 25000, 180, 107, 6, 20, RACE_ELF}, { "Bosk the Wise", 30000, 185, 109, 5, 15, RACE_DWARF}, }, { + /* Alchemist */ { "Mauser the Chemist", 10000, 190, 111, 5, 8, RACE_HALF_ELF}, { "Wizzle the Chaotic", 10000, 190, 110, 6, 8, RACE_HOBBIT}, { "Ga-nat the Greedy", 15000, 200, 116, 6, 9, RACE_GNOME}, *************** *** 1139,1146 **** }, { /* Black Market */ ! { "Lo-Hak the Awful", 20000, 250, 150, 10, 5, RACE_HALF_TROLL}, ! { "Histor the Goblin", 20000, 250, 150, 10, 5, RACE_HALF_ORC}, { "Durwin the Shifty", 30000, 250, 150, 10, 5, RACE_HUMAN}, { "Drago the Fair", 30000, 250, 150, 10, 5, RACE_ELF}, }, --- 1169,1176 ---- }, { /* Black Market */ ! { "Lo-Hak the Awful", 30000, 250, 150, 10, 5, RACE_HALF_TROLL}, ! { "Histor the Goblin", 30000, 250, 150, 10, 5, RACE_HALF_ORC}, { "Durwin the Shifty", 30000, 250, 150, 10, 5, RACE_HUMAN}, { "Drago the Fair", 30000, 250, 150, 10, 5, RACE_ELF}, }, *************** *** 1233,1239 **** /* * Player Race Information: * Title, ! * {STR,INT,WIS,DEX,CON,CHR}, * r_dis, r_dev, r_sav, r_stl, r_srh, r_fos, r_thn, r_thb, * hitdie, exp base, * Age (Base, Mod), --- 1263,1270 ---- /* * Player Race Information: * Title, ! * ! {STR,INT,WIS,DEX,CON,CHR}, * r_dis, r_dev, r_sav, r_stl, r_srh, r_fos, r_thn, r_thb, * hitdie, exp base, * Age (Base, Mod), *************** *** 1320,1326 **** "Half-Orc", { 2, -1, 0, 0, 1, -4 }, -3, -3, -3, -1, 0, 7, 12, -5, ! 10, 110, 11, 4, 66, 1,150, 5, 62, 1,120, 5, --- 1351,1357 ---- "Half-Orc", { 2, -1, 0, 0, 1, -4 }, -3, -3, -3, -1, 0, 7, 12, -5, ! 11, 110, 11, 4, 66, 1,150, 5, 62, 1,120, 5, *************** *** 1332,1338 **** "Half-Troll", { 4, -4, -2, -4, 3, -6 }, -5, -8, -8, -2, -1, 5, 20,-10, ! 12, 120, 20, 10, 96, 10,250, 50, 84, 8,225, 40, --- 1363,1369 ---- "Half-Troll", { 4, -4, -2, -4, 3, -6 }, -5, -8, -8, -2, -1, 5, 20,-10, ! 13, 110, 20, 10, 96, 10,250, 50, 84, 8,225, 40, *************** *** 1370,1376 **** * Player Classes. * * Title, ! * {STR,INT,WIS,DEX,CON,CHR}, * c_dis, c_dev, c_sav, c_stl, c_srh, c_fos, c_thn, c_thb, * x_dis, x_dev, x_sav, x_stl, x_srh, x_fos, x_thn, x_thb, * HD, Exp --- 1401,1408 ---- * Player Classes. * * Title, ! * ! {STR,INT,WIS,DEX,CON,CHR}, * c_dis, c_dev, c_sav, c_stl, c_srh, c_fos, c_thn, c_thb, * x_dis, x_dev, x_sav, x_stl, x_srh, x_fos, x_thn, x_thb, * HD, Exp *************** *** 1445,1451 **** * Spell Level, * Spell Encumbrance, * ! * Array of { Lev, Mana, Fail, Exp/Lev } */ player_magic magic_info[MAX_CLASS] = { --- 1477,1484 ---- * Spell Level, * Spell Encumbrance, * ! * Array of ! { Lev, Mana, Fail, Exp/Lev } */ player_magic magic_info[MAX_CLASS] = { *************** *** 2169,2175 **** "Dispel Evil", "Banishment", "Word of Destruction", ! "Annihilation", /* Holy Infusions (sval 7) */ "Unbarring Ways", --- 2202,2208 ---- "Dispel Evil", "Banishment", "Word of Destruction", ! "Holy Bolt", /* Holy Infusions (sval 7) */ "Unbarring Ways", *************** *** 2176,2182 **** "Recharging", "Dispel Curse", "Enchant Weapon", ! "Enchant Armour", "Elemental Brand", /* Ethereal openings (sval 4) */ --- 2209,2215 ---- "Recharging", "Dispel Curse", "Enchant Weapon", ! "Enchant Armor", "Elemental Brand", /* Ethereal openings (sval 4) */ *************** *** 2377,2383 **** /* * Hack -- the "basic" color names (see "TERM_xxx") */ ! cptr color_names[16] = { "Dark", "White", "Slate", --- 2410,2417 ---- /* * Hack -- the "basic" color names (see "TERM_xxx") */ ! cptr color_names[16] = ! { "Dark", "White", "Slate", *************** *** 2400,2406 **** /* * Hack -- the "basic" sound names (see "SOUND_xxx") */ ! cptr sound_names[SOUND_MAX] = { "", "hit", "miss", --- 2434,2441 ---- /* * Hack -- the "basic" sound names (see "SOUND_xxx") */ ! cptr sound_names[SOUND_MAX] = ! { "", "hit", "miss", *************** *** 2416,2422 **** /* * Abbreviations of healthy stats */ ! cptr stat_names[6] = { "STR: ", "INT: ", "WIS: ", "DEX: ", "CON: ", "CHR: " }; --- 2451,2458 ---- /* * Abbreviations of healthy stats */ ! cptr stat_names[6] = ! { "STR: ", "INT: ", "WIS: ", "DEX: ", "CON: ", "CHR: " }; *************** *** 2423,2429 **** /* * Abbreviations of damaged stats */ ! cptr stat_names_reduced[6] = { "Str: ", "Int: ", "Wis: ", "Dex: ", "Con: ", "Chr: " }; --- 2459,2466 ---- /* * Abbreviations of damaged stats */ ! cptr stat_names_reduced[6] = ! { "Str: ", "Int: ", "Wis: ", "Dex: ", "Con: ", "Chr: " }; *************** *** 2439,2452 **** * Set 2: Disturbance * Set 3: Inventory * Set 4: Game Play * * Set 255: Cheating * ! * Bit pairs not used in savefiles: * ! * Set 1: 9, 16-19, 21-23, 26-31 * Set 2: 4-7, 25, 31 ! * Set 3: 12 * Set 4: 8-15, 28-31 * * XXX XXX XXX Note that the "cheating options" can only be set in --- 2476,2491 ---- * Set 2: Disturbance * Set 3: Inventory * Set 4: Game Play + * Set 5: Efficiency + * Set 6: Special * * Set 255: Cheating * ! * Bits not used in savefiles: * ! * Set 1: 16-19, 21-23, 26-31 * Set 2: 4-7, 25, 31 ! * Set 3: 15 * Set 4: 8-15, 28-31 * * XXX XXX XXX Note that the "cheating options" can only be set in *************** *** 2453,2459 **** * the "do_cmd_prefs()" function, since they must set the special * "I am a cheater" flags. */ ! option_type options[] = { /*** User-Interface ***/ --- 2492,2499 ---- * the "do_cmd_prefs()" function, since they must set the special * "I am a cheater" flags. */ ! option_type options[] = ! { /*** User-Interface ***/ *************** *** 2481,2492 **** { &always_repeat, TRUE, 1, 1, 4, "always_repeat", "Repeat obvious commands" }, ! { &depth_in_feet, FALSE, 1, 1, 14, "depth_in_feet", "Show dungeon level in feet" }, ! { &show_health_bar, FALSE, 1, 3, 19, "show_health_bar", "Display Monster Health Bar" }, { &ring_bell, TRUE, 1, 1, 11, "ring_bell", "Audible bell (on errors, etc)" }, --- 2521,2535 ---- { &always_repeat, TRUE, 1, 1, 4, "always_repeat", "Repeat obvious commands" }, ! { &depth_in_feet, TRUE, 1, 1, 14, "depth_in_feet", "Show dungeon level in feet" }, ! { &show_health_bar, TRUE, 1, 3, 19, "show_health_bar", "Display Monster Health Bar" }, + { &color_browse, FALSE, 1, 1, 9, + "color_browse", "Show colors in spellbook browsing" }, + { &ring_bell, TRUE, 1, 1, 11, "ring_bell", "Audible bell (on errors, etc)" }, *************** *** 2559,2565 **** { &stack_force_costs, FALSE, 3, 3, 27, "stack_force_costs", "Over-ride discounts when stacking" }, ! { &no_haggle_flag, FALSE, 3, 3, 16, "no_haggle_flag", "Disable haggling in stores" }, { &shuffle_owners, FALSE, 3, 3, 17, --- 2602,2608 ---- { &stack_force_costs, FALSE, 3, 3, 27, "stack_force_costs", "Over-ride discounts when stacking" }, ! { &no_haggle_flag, TRUE, 3, 3, 16, "no_haggle_flag", "Disable haggling in stores" }, { &shuffle_owners, FALSE, 3, 3, 17, *************** *** 2574,2584 **** { &view_torch_grids, FALSE, 4, 3, 5, "view_torch_grids", "Map remembers all torch-lit grids" }, ! { &scum_always, FALSE, 4, 3, 30, ! "scum_always", "Auto-scum for good levels (always)" }, ! { &scum_sometimes, FALSE, 4, 3, 31, ! "scum_sometimes", "Auto-scum for good levels (sometimes)" }, { &dungeon_align, TRUE, 4, 3, 0, "dungeon_align", "Generate dungeons with aligned rooms" }, --- 2617,2627 ---- { &view_torch_grids, FALSE, 4, 3, 5, "view_torch_grids", "Map remembers all torch-lit grids" }, ! { &autoscum, FALSE, 4, 3, 30, ! "autoscum", "Auto-scum for good levels" }, ! { &generate_artifacts, TRUE, 4, 3, 12, ! "generate_artifacts", "Generate artifacts" }, { &dungeon_align, TRUE, 4, 3, 0, "dungeon_align", "Generate dungeons with aligned rooms" }, *************** *** 2601,2610 **** { &smart_learn, FALSE, 4, 3, 14, "smart_learn", "Monsters learn from their mistakes" }, - { &smart_cheat, FALSE, 4, 3, 15, - "smart_cheat", "Monsters exploit players weaknesses" }, - /*** Efficiency ***/ { &view_reduce_lite, FALSE, 5, 3, 3, --- 2644,2650 ---- *************** *** 2637,2649 **** { &fresh_message, TRUE, 5, 2, 30, "fresh_message", "Flush output after every message" }, ! { &compress_savefile, TRUE, 5, 1, 20, "compress_savefile", "Compress savefiles" }, { &hilite_player, FALSE, 5, 1, 15, "hilite_player", "Hilite the player with the cursor" }, ! { &view_yellow_lite, FALSE, 5, 1, 24, "view_yellow_lite", "Draw Torch-Lite in yellow (slow)" }, { &view_bright_lite, FALSE, 5, 1, 25, --- 2677,2689 ---- { &fresh_message, TRUE, 5, 2, 30, "fresh_message", "Flush output after every message" }, ! { &compress_savefile, FALSE, 5, 1, 20, "compress_savefile", "Compress savefiles" }, { &hilite_player, FALSE, 5, 1, 15, "hilite_player", "Hilite the player with the cursor" }, ! { &view_yellow_lite, TRUE, 5, 1, 24, "view_yellow_lite", "Draw Torch-Lite in yellow (slow)" }, { &view_bright_lite, FALSE, 5, 1, 25, diff -w -c -r ick-279/types.h utumno/types.h *** ick-279/types.h Sat Apr 13 11:34:37 1996 --- utumno/types.h Wed May 14 20:28:52 1997 *************** *** 128,137 **** * Only "aware" and "tried" are saved in the savefile */ ! typedef struct object_kind object_kind; - struct object_kind { - u16b name; /* Name (offset) */ u16b text; /* Text (offset) */ --- 128,135 ---- * Only "aware" and "tried" are saved in the savefile */ ! typedef struct { u16b name; /* Name (offset) */ u16b text; /* Text (offset) */ *************** *** 182,188 **** bool aware; /* The player is "aware" of the item's effects */ bool tried; /* The player has "tried" one of the items */ ! }; --- 180,186 ---- bool aware; /* The player is "aware" of the item's effects */ bool tried; /* The player has "tried" one of the items */ ! } object_kind; *************** *** 314,320 **** byte hdice; /* Creatures hit dice count */ byte hside; /* Creatures hit dice sides */ ! s16b ac; /* Armour Class */ s16b sleep; /* Inactive counter (base) */ byte aaf; /* Area affect radius (1-100) */ --- 312,318 ---- byte hdice; /* Creatures hit dice count */ byte hside; /* Creatures hit dice sides */ ! s16b ac; /* Armor Class */ s16b sleep; /* Inactive counter (base) */ byte aaf; /* Area affect radius (1-100) */ *************** *** 429,437 **** struct cave_type { ! byte fdat; /* Hack -- cave flags */ ! byte ftyp; /* Hack -- feature type */ s16b i_idx; /* Item index (in i_list) or zero */ --- 427,435 ---- struct cave_type { ! byte info; /* Cave flags */ ! byte feat; /* Feature type */ s16b i_idx; /* Item index (in i_list) or zero */ *************** *** 462,485 **** * the artifact and ego-item indexes, and the two "xtra" fields. */ ! typedef struct object_type object_type; ! ! struct object_type { ! s16b k_idx; /* Kind index (zero if "dead") */ - byte iy; /* Y-position on map, or zero */ byte ix; /* X-position on map, or zero */ - byte tval; /* Item type (from kind) */ - byte sval; /* Item sub-type (from kind) */ - s16b pval; /* Item extra-parameter */ - byte discount; /* Discount (if any) */ - byte number; /* Number of items */ - s16b weight; /* Item weight */ byte name1; /* Artifact type, if any */ --- 460,475 ---- * the artifact and ego-item indexes, and the two "xtra" fields. */ ! class object_type { ! private: s16b k_idx; /* Kind index (zero if "dead") */ byte ix; /* X-position on map, or zero */ + byte iy; /* Y-position on map, or zero */ s16b pval; /* Item extra-parameter */ byte discount; /* Discount (if any) */ byte number; /* Number of items */ s16b weight; /* Item weight */ byte name1; /* Artifact type, if any */ *************** *** 491,497 **** s16b to_h; /* Plusses to hit */ s16b to_d; /* Plusses to damage */ s16b to_a; /* Plusses to AC */ - s16b ac; /* Normal AC */ byte dd, ds; /* Damage dice/sides */ --- 481,486 ---- *************** *** 498,512 **** s16b timeout; /* Timeout Counter */ ! byte ident; /* Special flags */ ! byte marked; /* Object is marked */ ! u16b note; /* Inscription index */ }; /* * Monster information, for a specific monster. * --- 487,597 ---- s16b timeout; /* Timeout Counter */ ! byte ident; // Special flags ! byte marked; // Object is marked ! u16b note; // Inscription index ! public: ! s16b next_i_idx; // Next object in pile ! ! s16b get_k_idx(void) { return k_idx; } ! byte get_ix(void) { return ix; } ! byte get_iy(void) { return iy; } ! byte get_tval(void) { return get_k_ptr()->tval; } ! byte get_sval(void) { return get_k_ptr()->sval; } ! s16b get_pval(void) { return pval; } ! byte get_discount(void) { return discount; } ! byte get_number(void) { return number; } ! s16b get_weight(void); ! byte get_name1(void) { return name1; } ! byte get_name2(void) { return name2; } ! byte get_xtra1(void) { return xtra1; } ! byte get_xtra2(void) { return xtra2; } ! s16b get_to_h(void) { return to_h; } ! s16b get_to_d(void) { return to_d; } ! s16b get_to_a(void) { return to_a; } ! s16b get_ac(void) { return ac; } ! byte get_dd(void) { return dd; } ! byte get_ds(void) { return ds; } ! s16b get_timeout(void) { return timeout; } ! byte get_ident(void) { return ident; } ! byte get_marked(void) { return marked; } ! u16b get_note(void) { return note; } ! ! void set_k_idx(s16b n) { k_idx = n; } ! void set_ix(byte n) { ix = n; } ! void set_iy(byte n) { iy = n; } ! void set_location(byte x, byte y) { ix = x; iy = y; } ! void set_pval(s16b n) { pval = n; } ! void set_discount(byte n) { discount = n; } ! void set_number(byte n) { number = n; } ! void set_name1(byte n) { name1 = n; } ! void set_name2(byte n) { name2 = n; } ! void set_xtra1(byte n) { xtra1 = n; } ! void set_xtra2(byte n) { xtra2 = n; } ! void set_to_h(s16b n) { to_h = n; } ! void set_to_d(s16b n) { to_d = n; } ! void set_to_a(s16b n) { to_a = n; } ! void set_ac(s16b n) { ac = n; } ! void set_dd(byte n) { dd = n; } ! void set_ds(byte n) { ds = n; } ! void set_timeout(s16b n) { timeout = n; } ! void set_ident(byte n) { ident = n; } ! void set_marked(byte n) { marked = n; } ! void set_note(u16b n) { note = n; } ! ! bool test_ident_flag(byte flag) { return (ident & flag) ? TRUE : FALSE; } ! void set_ident_flag(byte flags) { ident |= flags; } ! void clear_ident_flag(byte flags) { ident &= ~flags; } ! ! bool exists(void) { return k_idx ? TRUE : FALSE; } ! bool is_plural(void) { return (number > 1); } ! bool is_artifact(void) { return name1 ? TRUE : FALSE; } ! bool is_ego_item(void) { return name2 ? TRUE : FALSE; } ! bool is_cursed(void) { return test_ident_flag(ID_CURSED); } ! bool is_broken(void) { return test_ident_flag(ID_BROKEN); } ! bool is_aware(void) { return get_k_ptr()->aware; } ! bool is_tried(void) { return get_k_ptr()->tried; } ! bool is_known(void); ! bool hates_acid(void); ! bool hates_elec(void); ! bool hates_fire(void); ! bool hates_cold(void); ! ! cave_type *get_c_ptr(void); ! object_kind *get_k_ptr(void); ! artifact_type *get_a_ptr(void); ! ego_item_type *get_e_ptr(void); ! ! s16b get_damroll(void); ! byte get_obj_level(void) { return get_k_ptr()->level; } ! ! s32b object_value_base(void); ! s32b object_value_real(void); ! s32b object_value(void); ! ! void charge_wand(void); ! void charge_staff(void); ! ! void a_m_aux_1(int level, int power); ! void a_m_aux_2(int level, int power); ! void a_m_aux_3(int level, int power); ! void a_m_aux_4(int level, int power); ! ! void invcopy(int k_idx); ! ! void object_known(void); ! void object_tried(void); ! void object_aware(void); }; + /* Living object */ + class living_type { + }; + /* * Monster information, for a specific monster. * *************** *** 513,561 **** * Note: fy, fx constrain dungeon size to 256x256 */ ! typedef struct monster_type monster_type; ! struct monster_type { ! s16b r_idx; /* Monster race index */ ! byte fy; /* Y location on map */ ! byte fx; /* X location on map */ ! s16b hp; /* Current Hit points */ ! s16b maxhp; /* Max Hit points */ - s16b csleep; /* Inactive counter */ - - byte mspeed; /* Monster "speed" */ - byte energy; /* Monster "energy" */ - byte stunned; /* Monster is stunned */ byte confused; /* Monster is confused */ byte monfear; /* Monster is afraid */ byte cdis; /* Current dis from player */ ! bool los; /* Monster is "in sight" */ ! bool ml; /* Monster is "visible" */ ! #ifdef WDT_TRACK_OPTIONS ! byte ty; /* Y location of target */ ! byte tx; /* X location of target */ ! byte t_dur; /* How long are we tracking */ ! ! byte t_bit; /* Up to eight bit flags */ ! ! #endif ! ! #ifdef DRS_SMART_OPTIONS ! ! u32b smart; /* Field for "smart_learn" */ ! ! #endif ! }; --- 598,671 ---- * Note: fy, fx constrain dungeon size to 256x256 */ ! class monster_type : public living_type { ! private: ! s16b r_idx; // Monster race index ! byte fx; // X location on map ! byte fy; // Y location on map ! s16b hp; // Current Hit points ! s16b maxhp; // Max Hit points ! s16b csleep; // Inactive counter ! byte mspeed; // Monster "speed" ! byte energy; // Monster "energy" byte stunned; /* Monster is stunned */ byte confused; /* Monster is confused */ byte monfear; /* Monster is afraid */ + byte temp_speed; // Monster is temporarily hasted + byte temp_slow; // Monster is temporarily slowed + byte cdis; /* Current dis from player */ ! bool los; /* Monster is in sight */ ! bool ml; /* Monster is visible */ ! bool spawned; /* Monster was spawned */ ! public: ! s16b get_r_idx(void) { return r_idx; } ! byte get_fx(void) { return fx; } ! byte get_fy(void) { return fy; } ! s16b get_hp(void) { return hp; } ! s16b get_maxhp(void) { return maxhp; } ! s16b get_csleep(void) { return csleep; } ! byte get_mspeed(void) { return mspeed; } ! byte get_energy(void) { return energy; } ! byte get_stunned(void) { return stunned; } ! byte get_confused(void) { return confused; } ! byte get_monfear(void) { return monfear; } ! byte get_temp_speed(void) { return temp_speed; } ! byte get_temp_slow(void) { return temp_slow; } ! byte get_cdis(void) { return cdis; } ! bool get_los(void) { return los; } ! bool get_ml(void) { return ml; } ! bool get_spawned(void) { return spawned; } ! void set_r_idx(s16b n) { r_idx = n; } ! void set_fx(byte n) { fx = n; } ! void set_fy(byte n) { fy = n; } ! void set_location(byte x, byte y) { fx = x; fy = y; } ! void set_hp(s16b n) { hp = n; } ! void set_maxhp(s16b n) { maxhp = n; } ! void set_csleep(s16b n) { csleep = n; } ! void set_mspeed(byte n) { mspeed = n; } ! void set_energy(byte n) { energy = n; } ! void set_stunned(byte n) { stunned = n; } ! void set_confused(byte n) { confused = n; } ! void set_monfear(byte n) { monfear = n; } ! void set_temp_speed(byte n) { temp_speed = n; } ! void set_temp_slow(byte n) { temp_slow = n; } ! void set_cdis(byte n) { cdis = n; } ! void set_los(bool n) { los = n; } ! void set_ml(bool n) { ml = n; } ! void set_spawned(bool n) { spawned = n; } ! cave_type *get_c_ptr(void); ! monster_race *get_r_ptr(void); }; *************** *** 722,728 **** typedef struct magic_type magic_type; struct magic_type { - byte slevel; /* Required level (to learn) */ byte smana; /* Required mana (to cast) */ byte sfail; /* Minimum chance of failure */ --- 832,837 ---- *************** *** 804,810 **** typedef struct player_class player_class; struct player_class { - cptr title; /* Type of class */ s16b c_adj[6]; /* Class stat modifier */ --- 913,918 ---- *************** *** 849,901 **** * whenever anything important changes. */ ! typedef struct player_type player_type; ! struct player_type { ! byte prace; /* Race index */ ! byte pclass; /* Class index */ ! byte male; /* Sex of character */ ! byte oops; /* Unused */ ! byte hitdie; /* Hit dice (sides) */ ! byte expfact; /* Experience factor */ - byte maximize; /* Maximize stats */ - byte preserve; /* Preserve artifacts */ ! s16b age; /* Characters age */ ! s16b ht; /* Height */ ! s16b wt; /* Weight */ ! s16b sc; /* Social Class */ ! s32b au; /* Current Gold */ ! s32b max_exp; /* Max experience */ ! s32b exp; /* Cur experience */ ! u16b exp_frac; /* Cur exp frac (times 2^16) */ ! s16b lev; /* Level */ ! s16b mhp; /* Max hit pts */ ! s16b chp; /* Cur hit pts */ ! u16b chp_frac; /* Cur hit frac (times 2^16) */ ! s16b msp; /* Max mana pts */ ! s16b csp; /* Cur mana pts */ ! u16b csp_frac; /* Cur mana frac (times 2^16) */ ! s16b max_plv; /* Max Player Level */ ! s16b max_dlv; /* Max level explored */ ! s16b stat_max[6]; /* Current "maximal" stat values */ ! s16b stat_cur[6]; /* Current "natural" stat values */ ! ! s16b fast; /* Timed -- Fast */ ! s16b slow; /* Timed -- Slow */ ! s16b blind; /* Timed -- Blindness */ ! s16b paralyzed; /* Timed -- Paralysis */ s16b confused; /* Timed -- Confusion */ s16b afraid; /* Timed -- Fear */ s16b image; /* Timed -- Hallucination */ --- 957,1010 ---- * whenever anything important changes. */ ! class player_type : public living_type { ! public: ! byte prace; // Race index ! byte pclass; // Class index ! byte male; // Sex of character ! byte oops; // Unused ! byte hitdie; // Hit dice (sides) ! byte expfact; // Experience factor ! byte maximize; // Maximize stats ! byte preserve; // Preserve artifacts ! s16b age; // Characters age ! s16b ht; // Height ! s16b wt; // Weight ! s16b sc; // Social Class ! s16b px; // X location in dungeon ! s16b py; // Y location in dungeon + s32b au; // Current Gold ! s32b max_exp; // Max experience ! s32b exp; // Cur experience ! u16b exp_frac; // Cur exp frac (times 2^16) ! s16b lev; // Level ! s16b mhp; // Max hit pts ! s16b chp; // Cur hit pts ! u16b chp_frac; // Cur hit frac (times 2^16) ! s16b msp; // Max mana pts ! s16b csp; // Cur mana pts ! u16b csp_frac; // Cur mana frac (times 2^16) ! s16b max_plv; // Max Player Level ! s16b max_dlv; // Max level explored ! s16b stat_max[6]; // Current "maximal" stat values ! s16b stat_cur[6]; // Current "natural" stat values ! s16b fast; // Timed -- Fast ! s16b slow; // Timed -- Slow ! s16b blind; // Timed -- Blindness ! s16b paralyzed; // Timed -- Paralysis s16b confused; /* Timed -- Confusion */ s16b afraid; /* Timed -- Fear */ s16b image; /* Timed -- Hallucination */ *************** *** 999,1006 **** bool exp_drain; /* Experience draining */ bool ffall; /* No damage falling */ - bool lite; /* Permanent light */ bool free_act; /* Never paralyzed */ bool see_inv; /* Can see invisible */ bool regenerate; /* Regenerate hit pts */ bool hold_life; /* Resist life draining */ --- 1108,1115 ---- bool exp_drain; /* Experience draining */ bool ffall; /* No damage falling */ bool free_act; /* Never paralyzed */ + bool lite; /* Amount of permanent light */ bool see_inv; /* Can see invisible */ bool regenerate; /* Regenerate hit pts */ bool hold_life; /* Resist life draining */ *************** *** 1044,1048 **** s16b pspeed; /* Current speed */ }; - --- 1153,1156 ---- diff -w -c -r ick-279/util.c utumno/util.c *** ick-279/util.c Thu May 15 17:12:24 1997 --- utumno/util.c Thu May 15 17:45:59 1997 *************** *** 1077,1084 **** */ static char roguelike_commands(char command) { - char b1 = '[', b2 = ']'; - /* Process the command */ switch (command) { --- 1077,1082 ---- *************** *** 1128,1147 **** /* Browse a book (Peruse) */ case 'P': return ('b'); - /* Jam a door (Spike) */ - case 'S': return ('j'); - - /* Toggle search mode */ - case '#': return ('S'); - /* Use a staff (Zap) */ case 'Z': return ('u'); - /* Wear/Wield equipment */ - case 'w': return (b1); - /* Take off equipment */ ! case 'T': return (b2); /* Fire an item */ case 't': return ('f'); --- 1126,1136 ---- /* Browse a book (Peruse) */ case 'P': return ('b'); /* Use a staff (Zap) */ case 'Z': return ('u'); /* Take off equipment */ ! case 'T': return ('t'); /* Fire an item */ case 't': return ('f'); *************** *** 1191,1198 **** */ static char original_commands(char command) { - char b1 = '[', b2 = ']'; - /* Process the command */ switch (command) { --- 1180,1185 ---- *************** *** 1201,1212 **** case KTRL('M'): return ('\t'); case KTRL('I'): return ('\t'); - /* Wield */ - case 'w': return (b1); - - /* Take off */ - case 't': return (b2); - /* Tunnel */ case 'T': return ('+'); --- 1188,1193 ---- *************** *** 1230,1236 **** case '9': hack_dir = 9; return (';'); /* Hack -- Commit suicide */ - case KTRL('K'): return ('Q'); case KTRL('C'): return ('Q'); } --- 1211,1216 ---- *************** *** 1497,1503 **** /* * Mega-Hack -- Make a (relevant?) sound */ ! void sound(int val) { /* Make a sound (if allowed) */ if (use_sound) Term_xtra(TERM_XTRA_SOUND, val); --- 1477,1483 ---- /* * Mega-Hack -- Make a (relevant?) sound */ ! void game_sound(int val) { /* Make a sound (if allowed) */ if (use_sound) Term_xtra(TERM_XTRA_SOUND, val); *************** *** 1831,1837 **** switch (ch) { /* Hack -- convert back-quote into escape */ ! case '`': /* Convert to "Escape" */ ch = ESCAPE; --- 1811,1818 ---- switch (ch) { /* Hack -- convert back-quote into escape */ ! case ' ! ': /* Convert to "Escape" */ ch = ESCAPE; *************** *** 1944,1954 **** for (i = 1; i < quark__num; i++) { /* Check for equality */ ! if (streq(quark__str[i], str)) return (i); } /* Paranoia -- Require room */ ! if (quark__num == QUARK_MAX) return (0); /* Add a new quark */ quark__str[i] = string_make(str); --- 1925,1935 ---- for (i = 1; i < quark__num; i++) { /* Check for equality */ ! if (streq(quark__str[i], str)) return i; } /* Paranoia -- Require room */ ! if (quark__num == QUARK_MAX) return 0; /* Add a new quark */ quark__str[i] = string_make(str); *************** *** 2476,2481 **** --- 2457,2478 ---- /* + * Print a string to the screen in a color, clearing to end of line + */ + void c_prt(byte attr, cptr str, int row, int col) + { + /* Clear the line, position the cursor */ + Term_erase(col, row, 80, 1); + + /* Dump the text (in White) */ + Term_addstr(-1, attr, str); + } + + + + + + /* * Get some input at the cursor location. * Assume the buffer is initialized to a default string. * Note that this string is often "empty" (see below). *************** *** 3040,3045 **** #endif - - --- 3037,3040 ---- diff -w -c -r ick-279/variable.c utumno/variable.c *** ick-279/variable.c Thu May 15 17:12:24 1997 --- utumno/variable.c Thu May 15 17:46:00 1997 *************** *** 16,22 **** /* * Hack -- Link a copyright message into the executable */ ! cptr copyright[5] = { "Copyright (c) 1989 James E. Wilson, Robert A. Keoneke", "", "This software may be copied and distributed for educational, research,", --- 16,23 ---- /* * Hack -- Link a copyright message into the executable */ ! cptr copyright[5] = ! { "Copyright (c) 1989 James E. Wilson, Robert A. Keoneke", "", "This software may be copied and distributed for educational, research,", *************** *** 31,37 **** byte version_major = VERSION_MAJOR; byte version_minor = VERSION_MINOR; byte version_patch = VERSION_PATCH; ! byte version_extra = VERSION_EXTRA; /* --- 32,38 ---- byte version_major = VERSION_MAJOR; byte version_minor = VERSION_MINOR; byte version_patch = VERSION_PATCH; ! byte version_type = VERSION_TYPE; /* *************** *** 56,63 **** */ bool arg_wizard; /* Command arg -- Enter wizard mode */ bool arg_fiddle; /* Command arg -- Enter fiddle mode */ - bool arg_force_original; /* Command arg -- Force original keyset */ - bool arg_force_roguelike; /* Command arg -- Force roguelike keyset */ bool character_generated; /* The character exists */ bool character_dungeon; /* The character has a dungeon */ --- 57,62 ---- *************** *** 209,216 **** /* Gameplay options */ ! bool scum_always; /* Auto-scum for good levels (always) */ ! bool scum_sometimes; /* Auto-scum for good levels (sometimes) */ bool dungeon_align; /* Generate dungeons with align rooms */ bool dungeon_stair; /* Generate dungeons with connected stairs */ --- 208,215 ---- /* Gameplay options */ ! bool autoscum; /* Auto-scum for good levels */ ! bool generate_artifacts; /* Generate artifacts */ bool dungeon_align; /* Generate dungeons with align rooms */ bool dungeon_stair; /* Generate dungeons with connected stairs */ *************** *** 225,236 **** bool track_target; /* Monsters target the player */ bool smart_learn; /* Monsters learn from their mistakes */ - bool smart_cheat; /* Monsters exploit player weaknesses */ bool no_haggle_flag; /* Cancel haggling */ bool shuffle_owners; /* Shuffle store owners occasionally */ bool show_health_bar; /* Show monster health bar */ bool show_inven_weight; /* Show weights in inven */ bool show_equip_weight; /* Show weights in equip */ --- 224,235 ---- bool track_target; /* Monsters target the player */ bool smart_learn; /* Monsters learn from their mistakes */ bool no_haggle_flag; /* Cancel haggling */ bool shuffle_owners; /* Shuffle store owners occasionally */ bool show_health_bar; /* Show monster health bar */ + bool color_browse; /* Color spellbook browsing */ bool show_inven_weight; /* Show weights in inven */ bool show_equip_weight; /* Show weights in equip */ *************** *** 318,327 **** s16b panel_col_min, panel_col_max; s16b panel_col_prt, panel_row_prt; - /* Player location in dungeon */ - s16b py; - s16b px; - /* Targetting variables */ s16b target_who; s16b target_col; --- 317,322 ---- *************** *** 563,574 **** /* * More spell info */ ! u32b spell_learned1; /* bit mask of spells learned */ ! u32b spell_learned2; /* bit mask of spells learned */ ! u32b spell_worked1; /* bit mask of spells tried and worked */ ! u32b spell_worked2; /* bit mask of spells tried and worked */ ! u32b spell_forgotten1; /* bit mask of spells learned but forgotten */ ! u32b spell_forgotten2; /* bit mask of spells learned but forgotten */ byte spell_order[64]; /* order spells learned/remembered/forgotten */ --- 558,566 ---- /* * More spell info */ ! bool spell_learned[64]; /* spells learned */ ! bool spell_worked[64]; /* spells tried and worked */ ! bool spell_forgotten[64]; /* spells learned but forgotten */ byte spell_order[64]; /* order spells learned/remembered/forgotten */ *************** *** 750,754 **** * Hack -- function hook to check "validity" of given kind */ bool (*get_obj_num_hook)(int k_idx); - - --- 742,744 ---- Only in ick-279: wizard1.c diff -w -c -r ick-279/wizard2.c utumno/wizard2.c *** ick-279/wizard2.c Thu May 15 17:12:24 1997 --- utumno/wizard2.c Thu May 15 17:46:00 1997 *************** *** 1,6 **** ! /* File: wizard2.c */ ! /* Purpose: Wizard commands */ /* * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke --- 1,6 ---- ! /* File: debug.c */ ! /* Purpose: Debug commands */ /* * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke *************** *** 250,259 **** i_ptr->ac, i_ptr->dd, i_ptr->ds), 5, j); prt(format("pval = %-5d toac = %-5d tohit = %-4d todam = %-4d", ! i_ptr->pval, i_ptr->to_a, i_ptr->to_h, i_ptr->to_d), 6, j); prt(format("name1 = %-4d name2 = %-4d cost = %ld", ! i_ptr->name1, i_ptr->name2, (long)object_value(i_ptr)), 7, j); prt(format("ident = %04x timeout = %-d", i_ptr->ident, i_ptr->timeout), 8, j); --- 250,261 ---- i_ptr->ac, i_ptr->dd, i_ptr->ds), 5, j); prt(format("pval = %-5d toac = %-5d tohit = %-4d todam = %-4d", ! i_ptr->pval, i_ptr->to_a, i_ptr->to_h, ! i_ptr->to_d), 6, j); prt(format("name1 = %-4d name2 = %-4d cost = %ld", ! i_ptr->name1, i_ptr->name2, (long)i_ptr->object_value()), ! 7, j); prt(format("ident = %04x timeout = %-d", i_ptr->ident, i_ptr->timeout), 8, j); *************** *** 290,296 **** /* * A structure to hold a tval and its description */ ! typedef struct tval_desc { int tval; cptr desc; } tval_desc; --- 292,299 ---- /* * A structure to hold a tval and its description */ ! typedef struct tval_desc ! { int tval; cptr desc; } tval_desc; *************** *** 298,304 **** /* * A list of tvals and their textual names */ ! static tval_desc tvals[] = { { TV_SWORD, "Sword" }, { TV_POLEARM, "Polearm" }, { TV_HAFTED, "Hafted Weapon" }, --- 301,308 ---- /* * A list of tvals and their textual names */ ! static tval_desc tvals[] = ! { { TV_SWORD, "Sword" }, { TV_POLEARM, "Polearm" }, { TV_HAFTED, "Hafted Weapon" }, *************** *** 325,331 **** { TV_ROD, "Rod" }, { TV_PRAYER_BOOK, "Priest Book" }, { TV_MAGIC_BOOK, "Magic Book" }, - { TV_SPIKE, "Spikes" }, { TV_DIGGING, "Digger" }, { TV_CHEST, "Chest" }, { TV_FOOD, "Food" }, --- 329,334 ---- *************** *** 365,371 **** * * XXX XXX XXX This will not work with "EBCDIC", I would think. */ ! static char head[3] = { 'a', 'A', '0' }; /* --- 368,375 ---- * * XXX XXX XXX This will not work with "EBCDIC", I would think. */ ! static char head[3] = ! { 'a', 'A', '0' }; /* *************** *** 484,513 **** /* Hack -- leave artifacts alone */ ! if (artifact_p(i_ptr)) return; p = "Enter new 'pval' setting: "; sprintf(tmp_val, "%d", i_ptr->pval); if (!get_string(p, tmp_val, 5)) return; ! i_ptr->pval = atoi(tmp_val); wiz_display_item(i_ptr); p = "Enter new 'to_a' setting: "; sprintf(tmp_val, "%d", i_ptr->to_a); if (!get_string(p, tmp_val, 5)) return; ! i_ptr->to_a = atoi(tmp_val); wiz_display_item(i_ptr); p = "Enter new 'to_h' setting: "; sprintf(tmp_val, "%d", i_ptr->to_h); if (!get_string(p, tmp_val, 5)) return; ! i_ptr->to_h = atoi(tmp_val); wiz_display_item(i_ptr); p = "Enter new 'to_d' setting: "; sprintf(tmp_val, "%d", i_ptr->to_d); if (!get_string(p, tmp_val, 5)) return; ! i_ptr->to_d = atoi(tmp_val); wiz_display_item(i_ptr); } --- 488,517 ---- /* Hack -- leave artifacts alone */ ! if (i_ptr->is_artifact()) return; p = "Enter new 'pval' setting: "; sprintf(tmp_val, "%d", i_ptr->pval); if (!get_string(p, tmp_val, 5)) return; ! i_ptr->set_pval(atoi(tmp_val)); wiz_display_item(i_ptr); p = "Enter new 'to_a' setting: "; sprintf(tmp_val, "%d", i_ptr->to_a); if (!get_string(p, tmp_val, 5)) return; ! i_ptr->set_to_a(atoi(tmp_val)); wiz_display_item(i_ptr); p = "Enter new 'to_h' setting: "; sprintf(tmp_val, "%d", i_ptr->to_h); if (!get_string(p, tmp_val, 5)) return; ! i_ptr->set_to_h(atoi(tmp_val)); wiz_display_item(i_ptr); p = "Enter new 'to_d' setting: "; sprintf(tmp_val, "%d", i_ptr->to_d); if (!get_string(p, tmp_val, 5)) return; ! i_ptr->set_to_d(atoi(tmp_val)); wiz_display_item(i_ptr); } *************** *** 524,530 **** /* Hack -- leave artifacts alone */ ! if (artifact_p(i_ptr)) return; /* Copy the item to be modified. */ --- 528,534 ---- /* Hack -- leave artifacts alone */ ! if (i_ptr->is_artifact()) return; /* Copy the item to be modified. */ *************** *** 553,559 **** /* Apply normal magic, but first clear object */ else if (ch == 'n' || ch == 'N') { ! invcopy(&mod_item, i_ptr->k_idx); apply_magic(&mod_item, dun_level, FALSE, FALSE, FALSE); } --- 557,563 ---- /* Apply normal magic, but first clear object */ else if (ch == 'n' || ch == 'N') { ! mod_item.invcopy(i_ptr->k_idx); apply_magic(&mod_item, dun_level, FALSE, FALSE, FALSE); } *************** *** 560,566 **** /* Apply good magic, but first clear object */ else if (ch == 'g' || ch == 'g') { ! invcopy(&mod_item, i_ptr->k_idx); apply_magic(&mod_item, dun_level, FALSE, TRUE, FALSE); } --- 564,570 ---- /* Apply good magic, but first clear object */ else if (ch == 'g' || ch == 'g') { ! mod_item.invcopy(i_ptr->k_idx); apply_magic(&mod_item, dun_level, FALSE, TRUE, FALSE); } *************** *** 567,573 **** /* Apply great magic, but first clear object */ else if (ch == 'e' || ch == 'e') { ! invcopy(&mod_item, i_ptr->k_idx); apply_magic(&mod_item, dun_level, FALSE, TRUE, TRUE); } } --- 571,577 ---- /* Apply great magic, but first clear object */ else if (ch == 'e' || ch == 'e') { ! mod_item.invcopy(i_ptr->k_idx); apply_magic(&mod_item, dun_level, FALSE, TRUE, TRUE); } } *************** *** 632,638 **** /* XXX XXX XXX Mega-Hack -- allow multiple artifacts */ ! if (artifact_p(i_ptr)) a_info[i_ptr->name1].cur_num = 0; /* Interact */ --- 636,642 ---- /* XXX XXX XXX Mega-Hack -- allow multiple artifacts */ ! if (i_ptr->is_artifact()) (i_ptr->a_ptr)->cur_num = 0; /* Interact */ *************** *** 714,725 **** delete_object(y1, x1); /* XXX XXX XXX Mega-Hack -- allow multiple artifacts */ ! if (artifact_p(j_ptr)) a_info[j_ptr->name1].cur_num = 0; /* Test for the same tval and sval. */ ! if ((i_ptr->tval) != (j_ptr->tval)) continue; ! if ((i_ptr->sval) != (j_ptr->sval)) continue; /* Check for match */ if ((j_ptr->pval == i_ptr->pval) && --- 718,729 ---- delete_object(y1, x1); /* XXX XXX XXX Mega-Hack -- allow multiple artifacts */ ! if (j_ptr->is_artifact()) (j_ptr->a_ptr)->cur_num = 0; /* Test for the same tval and sval. */ ! if (i_ptr->tval != j_ptr->tval) continue; ! if (i_ptr->sval != j_ptr->sval) continue; /* Check for match */ if ((j_ptr->pval == i_ptr->pval) && *************** *** 762,768 **** /* Hack -- Normally only make a single artifact */ ! if (artifact_p(i_ptr)) a_info[i_ptr->name1].cur_num = 1; } --- 766,772 ---- /* Hack -- Normally only make a single artifact */ ! if (i_ptr->is_artifact()) (i_ptr->a_ptr)->cur_num = 1; } *************** *** 777,783 **** /* Never duplicate artifacts */ ! if (artifact_p(i_ptr)) return; /* Default */ --- 781,787 ---- /* Never duplicate artifacts */ ! if (i_ptr->is_artifact()) return; /* Default */ *************** *** 794,800 **** if (tmp_int > 99) tmp_int = 99; /* Accept modifications */ ! i_ptr->number = tmp_int; } } --- 798,804 ---- if (tmp_int > 99) tmp_int = 99; /* Accept modifications */ ! i_ptr->set_number(tmp_int); } } *************** *** 965,971 **** if (!k_idx) return; /* Create the item */ ! invcopy(&forge, k_idx); /* Apply magic (no messages, no artifacts) */ wizard = FALSE; --- 969,975 ---- if (!k_idx) return; /* Create the item */ ! forge.invcopy(k_idx); /* Apply magic (no messages, no artifacts) */ wizard = FALSE; *************** *** 1082,1089 **** if (k_ptr->level <= command_arg) { object_type inv; ! invcopy(&inv, i); ! object_aware(&inv); } } } --- 1086,1093 ---- if (k_ptr->level <= command_arg) { object_type inv; ! inv.invcopy(i); ! inv.object_aware(); } } } diff -w -c -r ick-279/xtra1.c utumno/xtra1.c *** ick-279/xtra1.c Thu May 15 17:12:25 1997 --- utumno/xtra1.c Thu May 15 17:46:01 1997 *************** *** 198,204 **** { char out_val[32]; ! (void)sprintf(out_val, "%8ld", (long)p_ptr->exp); if (p_ptr->exp >= p_ptr->max_exp) { --- 198,204 ---- { char out_val[32]; ! sprintf(out_val, "%8ld", (long)p_ptr->exp); if (p_ptr->exp >= p_ptr->max_exp) { *************** *** 695,703 **** */ static void health_redraw(void) { - - #ifdef DRS_SHOW_HEALTH_BAR - /* Disabled */ if (!show_health_bar) return; --- 695,700 ---- *************** *** 709,718 **** } /* Tracking an unseen monster */ ! else if (!m_list[health_who].ml) { /* Indicate that the monster health is "unknown" */ ! Term_putstr(COL_INFO, ROW_INFO, 12, TERM_WHITE, "[----------]"); } /* Tracking a hallucinatory monster */ --- 706,715 ---- } /* Tracking an unseen monster */ ! else if (!m_list[health_who].get_ml()) { /* Indicate that the monster health is "unknown" */ ! Term_putstr(COL_INFO, ROW_INFO, 12, TERM_WHITE, "[ no sight ]"); } /* Tracking a hallucinatory monster */ *************** *** 723,729 **** } /* Tracking a dead monster (???) */ ! else if (!m_list[health_who].hp < 0) { /* Indicate that the monster health is "unknown" */ Term_putstr(COL_INFO, ROW_INFO, 12, TERM_WHITE, "[----------]"); --- 720,726 ---- } /* Tracking a dead monster (???) */ ! else if (!m_list[health_who].get_hp() < 0) { /* Indicate that the monster health is "unknown" */ Term_putstr(COL_INFO, ROW_INFO, 12, TERM_WHITE, "[----------]"); *************** *** 770,777 **** Term_putstr(COL_INFO + 1, ROW_INFO, len, attr, "**********"); } - #endif - } --- 767,772 ---- *************** *** 1031,1038 **** if (levels < 0) levels = 0; /* Extract total allowed spells */ ! num_allowed = (adj_mag_study[p_ptr->stat_ind[mp_ptr->spell_stat]] * ! levels / 2); /* Assume none known */ num_known = 0; --- 1026,1033 ---- if (levels < 0) levels = 0; /* Extract total allowed spells */ ! num_allowed = adj_mag_study[p_ptr->stat_ind[mp_ptr->spell_stat]] * ! levels / 2; /* Assume none known */ num_known = 0; *************** *** 1041,1053 **** for (j = 0; j < 64; j++) { /* Count known spells */ ! if ((j < 32) ? ! (spell_learned1 & (1L << j)) : ! (spell_learned2 & (1L << (j - 32)))) ! { ! num_known++; } - } /* See how many spells we must forget or may learn */ p_ptr->new_spells = num_allowed - num_known; --- 1036,1043 ---- for (j = 0; j < 64; j++) { /* Count known spells */ ! if (spell_learned[j]) num_known++; } /* See how many spells we must forget or may learn */ p_ptr->new_spells = num_allowed - num_known; *************** *** 1057,1065 **** /* Forget spells which are too hard */ for (i = 63; i >= 0; i--) { - /* Efficiency -- all done */ - if (!spell_learned1 && !spell_learned2) break; - /* Access the spell */ j = spell_order[i]; --- 1047,1052 ---- *************** *** 1073,1101 **** if (s_ptr->slevel <= p_ptr->lev) continue; /* Is it known? */ ! if ((j < 32) ? ! (spell_learned1 & (1L << j)) : ! (spell_learned2 & (1L << (j - 32)))) { /* Mark as forgotten */ ! if (j < 32) ! { ! spell_forgotten1 |= (1L << j); ! } ! else ! { ! spell_forgotten2 |= (1L << (j - 32)); ! } /* No longer known */ ! if (j < 32) ! { ! spell_learned1 &= ~(1L << j); ! } ! else ! { ! spell_learned2 &= ~(1L << (j - 32)); ! } /* Message */ msg_format("You have forgotten the %s of %s.", p, --- 1060,1072 ---- if (s_ptr->slevel <= p_ptr->lev) continue; /* Is it known? */ ! if (spell_learned[j]) { /* Mark as forgotten */ ! spell_forgotten[j] = TRUE; /* No longer known */ ! spell_learned[j] = FALSE; /* Message */ msg_format("You have forgotten the %s of %s.", p, *************** *** 1113,1121 **** /* Stop when possible */ if (p_ptr->new_spells >= 0) break; - /* Efficiency -- all done */ - if (!spell_learned1 && !spell_learned2) break; - /* Get the (i+1)th spell learned */ j = spell_order[i]; --- 1084,1089 ---- *************** *** 1123,1151 **** if (j >= 99) continue; /* Forget it (if learned) */ ! if ((j < 32) ? ! (spell_learned1 & (1L << j)) : ! (spell_learned2 & (1L << (j - 32)))) { /* Mark as forgotten */ ! if (j < 32) ! { ! spell_forgotten1 |= (1L << j); ! } ! else ! { ! spell_forgotten2 |= (1L << (j - 32)); ! } /* No longer known */ ! if (j < 32) ! { ! spell_learned1 &= ~(1L << j); ! } ! else ! { ! spell_learned2 &= ~(1L << (j - 32)); ! } /* Message */ msg_format("You have forgotten the %s of %s.", p, --- 1091,1103 ---- if (j >= 99) continue; /* Forget it (if learned) */ ! if (spell_learned[j]) { /* Mark as forgotten */ ! spell_forgotten[j] = TRUE; /* No longer known */ ! spell_learned[j] = FALSE; /* Message */ msg_format("You have forgotten the %s of %s.", p, *************** *** 1163,1171 **** /* None left to remember */ if (p_ptr->new_spells <= 0) break; - /* Efficiency -- all done */ - if (!spell_forgotten1 && !spell_forgotten2) break; - /* Get the next spell we learned */ j = spell_order[i]; --- 1115,1120 ---- *************** *** 1179,1207 **** if (s_ptr->slevel > p_ptr->lev) continue; /* First set of spells */ ! if ((j < 32) ? ! (spell_forgotten1 & (1L << j)) : ! (spell_forgotten2 & (1L << (j - 32)))) { /* No longer forgotten */ ! if (j < 32) ! { ! spell_forgotten1 &= ~(1L << j); ! } ! else ! { ! spell_forgotten2 &= ~(1L << (j - 32)); ! } /* Known once more */ ! if (j < 32) ! { ! spell_learned1 |= (1L << j); ! } ! else ! { ! spell_learned2 |= (1L << (j - 32)); ! } /* Message */ msg_format("You have remembered the %s of %s.", --- 1128,1140 ---- if (s_ptr->slevel > p_ptr->lev) continue; /* First set of spells */ ! if (spell_forgotten[j]) { /* No longer forgotten */ ! spell_forgotten[j] = FALSE; /* Known once more */ ! spell_learned[j] = TRUE; /* Message */ msg_format("You have remembered the %s of %s.", *************** *** 1226,1237 **** if (s_ptr->slevel > p_ptr->lev) continue; /* Skip spells we already know */ ! if ((j < 32) ? ! (spell_learned1 & (1L << j)) : ! (spell_learned2 & (1L << (j - 32)))) ! { ! continue; ! } /* Count it */ k++; --- 1159,1165 ---- if (s_ptr->slevel > p_ptr->lev) continue; /* Skip spells we already know */ ! if (spell_learned[j]) continue; /* Count it */ k++; *************** *** 1271,1277 **** static void calc_mana(void) { int new_mana, levels, cur_wgt, max_wgt; - object_type *i_ptr; --- 1199,1204 ---- *************** *** 1307,1313 **** object_flags(i_ptr, &f1, &f2, &f3); /* Normal gloves hurt mage-type spells */ ! if (i_ptr->k_idx && !(f2 & TR2_FREE_ACT) && !((f1 & TR1_DEX) && (i_ptr->pval > 0))) { --- 1234,1240 ---- object_flags(i_ptr, &f1, &f2, &f3); /* Normal gloves hurt mage-type spells */ ! if (i_ptr->exists() && !(f2 & TR2_FREE_ACT) && !((f1 & TR1_DEX) && (i_ptr->pval > 0))) { *************** *** 1325,1336 **** /* Weigh the armor */ cur_wgt = 0; ! cur_wgt += inventory[INVEN_BODY].weight; ! cur_wgt += inventory[INVEN_HEAD].weight; ! cur_wgt += inventory[INVEN_ARM].weight; ! cur_wgt += inventory[INVEN_OUTER].weight; ! cur_wgt += inventory[INVEN_HANDS].weight; ! cur_wgt += inventory[INVEN_FEET].weight; /* Determine the weight allowance */ max_wgt = mp_ptr->spell_weight; --- 1252,1263 ---- /* Weigh the armor */ cur_wgt = 0; ! cur_wgt += inventory[INVEN_BODY].get_weight(); ! cur_wgt += inventory[INVEN_HEAD].get_weight(); ! cur_wgt += inventory[INVEN_ARM].get_weight(); ! cur_wgt += inventory[INVEN_OUTER].get_weight(); ! cur_wgt += inventory[INVEN_HANDS].get_weight(); ! cur_wgt += inventory[INVEN_FEET].get_weight(); /* Determine the weight allowance */ max_wgt = mp_ptr->spell_weight; *************** *** 1353,1392 **** /* Maximum mana has changed */ if (p_ptr->msp != new_mana) { ! /* Player has no mana now */ ! if (!new_mana) ! { ! /* No mana left */ ! p_ptr->csp = 0; ! p_ptr->csp_frac = 0; ! } ! /* Player had no mana, has some now */ ! else if (!p_ptr->msp) { ! /* Reset mana */ ! p_ptr->csp = new_mana; p_ptr->csp_frac = 0; } - /* Player had some mana, adjust current mana */ - else - { - s32b value; - - /* change current mana proportionately to change of max mana, */ - /* divide first to avoid overflow, little loss of accuracy */ - value = ((((long)p_ptr->csp << 16) + p_ptr->csp_frac) / - p_ptr->msp * new_mana); - - /* Extract mana components */ - p_ptr->csp = (value >> 16); - p_ptr->csp_frac = (value & 0xFFFF); - } - - /* Save new mana */ - p_ptr->msp = new_mana; - /* Display mana later */ p_ptr->redraw |= (PR_MANA); } --- 1280,1295 ---- /* Maximum mana has changed */ if (p_ptr->msp != new_mana) { ! /* Save new mana */ ! p_ptr->msp = new_mana; ! /* Check for SP overflow */ ! if (p_ptr->csp > p_ptr->msp) { ! p_ptr->csp = p_ptr->msp; p_ptr->csp_frac = 0; } /* Display mana later */ p_ptr->redraw |= (PR_MANA); } *************** *** 1457,1476 **** /* New maximum hitpoints */ if (mhp != p_ptr->mhp) { - s32b value; - - /* change current hit points proportionately to change of mhp */ - /* divide first to avoid overflow, little loss of accuracy */ - value = (((long)p_ptr->chp << 16) + p_ptr->chp_frac) / p_ptr->mhp; - value = value * mhp; - p_ptr->chp = (value >> 16); - p_ptr->chp_frac = (value & 0xFFFF); - /* Save the new max-hitpoints */ p_ptr->mhp = mhp; /* Display hitpoints (later) */ ! p_ptr->redraw |= (PR_HP); } } --- 1360,1377 ---- /* New maximum hitpoints */ if (mhp != p_ptr->mhp) { /* Save the new max-hitpoints */ p_ptr->mhp = mhp; + /* Check for HP overflow */ + if (p_ptr->chp > p_ptr->mhp) + { + p_ptr->chp = p_ptr->mhp; + p_ptr->chp_frac = 0; + } + /* Display hitpoints (later) */ ! p_ptr->redraw |= PR_HP; } } *************** *** 1505,1511 **** } /* Artifact Lites provide permanent, bright, lite */ ! if (artifact_p(i_ptr)) p_ptr->cur_lite = 3; } /* Reduce lite when running if requested */ --- 1406,1412 ---- } /* Artifact Lites provide permanent, bright, lite */ ! if (i_ptr->is_artifact()) p_ptr->cur_lite = 3; } /* Reduce lite when running if requested */ *************** *** 1519,1528 **** if (p_ptr->old_lite != p_ptr->cur_lite) { /* Update the lite */ ! p_ptr->update |= (PU_LITE); /* Update the monsters */ ! p_ptr->update |= (PU_MONSTERS); /* Remember the old lite */ p_ptr->old_lite = p_ptr->cur_lite; --- 1420,1429 ---- if (p_ptr->old_lite != p_ptr->cur_lite) { /* Update the lite */ ! p_ptr->update |= PU_LITE; /* Update the monsters */ ! p_ptr->update |= PU_MONSTERS; /* Remember the old lite */ p_ptr->old_lite = p_ptr->cur_lite; *************** *** 1542,1548 **** i = adj_str_wgt[p_ptr->stat_ind[A_STR]] * 100; /* Return the result */ ! return (i); } --- 1443,1449 ---- i = adj_str_wgt[p_ptr->stat_ind[A_STR]] * 100; /* Return the result */ ! return i; } *************** *** 1753,1759 **** i_ptr = &inventory[i]; /* Skip missing items */ ! if (!i_ptr->k_idx) continue; /* Extract the item flags */ object_flags(i_ptr, &f1, &f2, &f3); --- 1654,1660 ---- i_ptr = &inventory[i]; /* Skip missing items */ ! if (!i_ptr->exists()) continue; /* Extract the item flags */ object_flags(i_ptr, &f1, &f2, &f3); *************** *** 1770,1785 **** if (f1 & TR1_STEALTH) p_ptr->skill_stl += i_ptr->pval; /* Affect searching ability (factor of five) */ ! if (f1 & TR1_SEARCH) p_ptr->skill_srh += (i_ptr->pval * 5); /* Affect searching frequency (factor of five) */ ! if (f1 & TR1_SEARCH) p_ptr->skill_fos += (i_ptr->pval * 5); /* Affect infravision */ if (f1 & TR1_INFRA) p_ptr->see_infra += i_ptr->pval; /* Affect digging (factor of 20) */ ! if (f1 & TR1_TUNNEL) p_ptr->skill_dig += (i_ptr->pval * 20); /* Affect speed */ if (f1 & TR1_SPEED) p_ptr->pspeed += i_ptr->pval; --- 1671,1686 ---- if (f1 & TR1_STEALTH) p_ptr->skill_stl += i_ptr->pval; /* Affect searching ability (factor of five) */ ! if (f1 & TR1_SEARCH) p_ptr->skill_srh += i_ptr->pval * 5; /* Affect searching frequency (factor of five) */ ! if (f1 & TR1_SEARCH) p_ptr->skill_fos += i_ptr->pval * 5; /* Affect infravision */ if (f1 & TR1_INFRA) p_ptr->see_infra += i_ptr->pval; /* Affect digging (factor of 20) */ ! if (f1 & TR1_TUNNEL) p_ptr->skill_dig += i_ptr->pval * 20; /* Affect speed */ if (f1 & TR1_SPEED) p_ptr->pspeed += i_ptr->pval; *************** *** 1849,1855 **** p_ptr->to_a += i_ptr->to_a; /* Apply the mental bonuses to armor class, if known */ ! if (object_known_p(i_ptr)) p_ptr->dis_to_a += i_ptr->to_a; /* Hack -- do not apply "weapon" bonuses */ if (i == INVEN_WIELD) continue; --- 1750,1756 ---- p_ptr->to_a += i_ptr->to_a; /* Apply the mental bonuses to armor class, if known */ ! if (i_ptr->is_known()) p_ptr->dis_to_a += i_ptr->to_a; /* Hack -- do not apply "weapon" bonuses */ if (i == INVEN_WIELD) continue; *************** *** 1862,1869 **** p_ptr->to_d += i_ptr->to_d; /* Apply the mental bonuses tp hit/damage, if known */ ! if (object_known_p(i_ptr)) p_ptr->dis_to_h += i_ptr->to_h; ! if (object_known_p(i_ptr)) p_ptr->dis_to_d += i_ptr->to_d; } --- 1763,1770 ---- p_ptr->to_d += i_ptr->to_d; /* Apply the mental bonuses tp hit/damage, if known */ ! if (i_ptr->is_known()) p_ptr->dis_to_h += i_ptr->to_h; ! if (i_ptr->is_known()) p_ptr->dis_to_d += i_ptr->to_d; } *************** *** 1990,1996 **** p_ptr->dis_to_h += 12; } ! /* Temporary "Beserk" */ if (p_ptr->shero) { p_ptr->to_h += 24; --- 1891,1897 ---- p_ptr->dis_to_h += 12; } ! /* Temporary "Berserk" */ if (p_ptr->shero) { p_ptr->to_h += 24; *************** *** 2083,2090 **** /* Redraw armor (if needed) */ ! if (p_ptr->dis_ac != old_dis_ac) p_ptr->redraw |= (PR_ARMOR); ! if (p_ptr->dis_to_a != old_dis_to_a) p_ptr->redraw |= (PR_ARMOR); --- 1984,1991 ---- /* Redraw armor (if needed) */ ! if (p_ptr->dis_ac != old_dis_ac) p_ptr->redraw |= PR_ARMOR; ! if (p_ptr->dis_to_a != old_dis_to_a) p_ptr->redraw |= PR_ARMOR; *************** *** 2099,2105 **** /* Assume not heavy */ p_ptr->heavy_shoot = FALSE; ! /* It is hard to carholdry a heavy bow */ if (hold < i_ptr->weight / 10) { /* Hard to wield a heavy bow */ --- 2000,2006 ---- /* Assume not heavy */ p_ptr->heavy_shoot = FALSE; ! /* It is hard to hold a heavy bow */ if (hold < i_ptr->weight / 10) { /* Hard to wield a heavy bow */ *************** *** 2112,2118 **** /* Compute "extra shots" if needed */ ! if (i_ptr->k_idx && !p_ptr->heavy_shoot) { /* Take note of required "tval" for missiles */ switch (i_ptr->sval) --- 2013,2019 ---- /* Compute "extra shots" if needed */ ! if (i_ptr->exists() && !p_ptr->heavy_shoot) { /* Take note of required "tval" for missiles */ switch (i_ptr->sval) *************** *** 2133,2139 **** } /* Hack -- Reward High Level Rangers using Bows */ ! if ((p_ptr->pclass == 4) && (p_ptr->tval_ammo == TV_ARROW)) { /* Extra shot at level 20 */ if (p_ptr->lev >= 20) p_ptr->num_fire++; --- 2034,2040 ---- } /* Hack -- Reward High Level Rangers using Bows */ ! if ((p_ptr->pclass == CLASS_RANGER) && (p_ptr->tval_ammo == TV_ARROW)) { /* Extra shot at level 20 */ if (p_ptr->lev >= 20) p_ptr->num_fire++; *************** *** 2171,2177 **** /* Normal weapons */ ! if (i_ptr->k_idx && !p_ptr->heavy_wield) { int str_index, dex_index; --- 2072,2078 ---- /* Normal weapons */ ! if (i_ptr->exists() && !p_ptr->heavy_wield) { int str_index, dex_index; *************** *** 2200,2206 **** } /* Enforce a minimum "weight" (tenth pounds) */ ! div = ((i_ptr->weight < wgt) ? wgt : i_ptr->weight); /* Access the strength vs weight */ str_index = (adj_str_blow[p_ptr->stat_ind[A_STR]] * mul / div); --- 2101,2107 ---- } /* Enforce a minimum "weight" (tenth pounds) */ ! div = (i_ptr->weight < wgt) ? wgt : i_ptr->weight; /* Access the strength vs weight */ str_index = (adj_str_blow[p_ptr->stat_ind[A_STR]] * mul / div); *************** *** 2227,2233 **** if (p_ptr->num_blow < 1) p_ptr->num_blow = 1; /* Boost digging skill by weapon weight */ ! p_ptr->skill_dig += (i_ptr->weight / 10); } --- 2128,2134 ---- if (p_ptr->num_blow < 1) p_ptr->num_blow = 1; /* Boost digging skill by weapon weight */ ! p_ptr->skill_dig += i_ptr->weight / 10; } *************** *** 2235,2241 **** p_ptr->icky_wield = FALSE; /* Priest weapon penalty for non-blessed edged weapons */ ! if ((p_ptr->pclass == 2) && (!p_ptr->bless_blade) && ((i_ptr->tval == TV_SWORD) || (i_ptr->tval == TV_POLEARM))) { /* Reduce the real bonuses */ --- 2136,2142 ---- p_ptr->icky_wield = FALSE; /* Priest weapon penalty for non-blessed edged weapons */ ! if ((p_ptr->pclass == CLASS_PRIEST) && (!p_ptr->bless_blade) && ((i_ptr->tval == TV_SWORD) || (i_ptr->tval == TV_POLEARM))) { /* Reduce the real bonuses */ *************** *** 2315,2321 **** { msg_print("You have trouble wielding such a heavy bow."); } ! else if (inventory[INVEN_BOW].k_idx) { msg_print("You have no trouble wielding your bow."); } --- 2216,2222 ---- { msg_print("You have trouble wielding such a heavy bow."); } ! else if (inventory[INVEN_BOW].exists()) { msg_print("You have no trouble wielding your bow."); } *************** *** 2337,2343 **** { msg_print("You have trouble wielding such a heavy weapon."); } ! else if (inventory[INVEN_WIELD].k_idx) { msg_print("You have no trouble wielding your weapon."); } --- 2238,2244 ---- { msg_print("You have trouble wielding such a heavy weapon."); } ! else if (inventory[INVEN_WIELD].exists()) { msg_print("You have no trouble wielding your weapon."); } *************** *** 2359,2365 **** { msg_print("You do not feel comfortable with your weapon."); } ! else if (inventory[INVEN_WIELD].k_idx) { msg_print("You feel comfortable with your weapon."); } --- 2260,2266 ---- { msg_print("You do not feel comfortable with your weapon."); } ! else if (inventory[INVEN_WIELD].exists()) { msg_print("You feel comfortable with your weapon."); } *************** *** 2508,2514 **** /* Hack -- Redraw "recent" monster race */ if (p_ptr->redraw & PR_RECENT) { ! p_ptr->redraw &= ~(PR_RECENT); fix_recent(); } --- 2409,2415 ---- /* Hack -- Redraw "recent" monster race */ if (p_ptr->redraw & PR_RECENT) { ! p_ptr->redraw &= ~PR_RECENT; fix_recent(); } *************** *** 2515,2521 **** /* Hack -- Redraw "choices" or whatever */ if (p_ptr->redraw & PR_CHOOSE) { ! p_ptr->redraw &= ~(PR_CHOOSE); fix_choose(); } --- 2416,2422 ---- /* Hack -- Redraw "choices" or whatever */ if (p_ptr->redraw & PR_CHOOSE) { ! p_ptr->redraw &= ~PR_CHOOSE; fix_choose(); } *************** *** 2531,2537 **** /* Hack -- Redraw "around" the player */ if (p_ptr->redraw & PR_AROUND) { ! p_ptr->redraw &= ~(PR_AROUND); fix_around(); } --- 2432,2438 ---- /* Hack -- Redraw "around" the player */ if (p_ptr->redraw & PR_AROUND) { ! p_ptr->redraw &= ~PR_AROUND; fix_around(); } *************** *** 2554,2560 **** if (p_ptr->redraw & PR_BASIC) { ! p_ptr->redraw &= ~(PR_BASIC); p_ptr->redraw &= ~(PR_MISC | PR_TITLE | PR_STATS); p_ptr->redraw &= ~(PR_LEV | PR_EXP | PR_GOLD); p_ptr->redraw &= ~(PR_ARMOR | PR_HP | PR_MANA); --- 2455,2461 ---- if (p_ptr->redraw & PR_BASIC) { ! p_ptr->redraw &= ~PR_BASIC; p_ptr->redraw &= ~(PR_MISC | PR_TITLE | PR_STATS); p_ptr->redraw &= ~(PR_LEV | PR_EXP | PR_GOLD); p_ptr->redraw &= ~(PR_ARMOR | PR_HP | PR_MANA); *************** *** 2577,2589 **** if (p_ptr->redraw & PR_LEV) { ! p_ptr->redraw &= ~(PR_LEV); prt_level(); } if (p_ptr->redraw & PR_EXP) { ! p_ptr->redraw &= ~(PR_EXP); prt_exp(); } --- 2478,2490 ---- if (p_ptr->redraw & PR_LEV) { ! p_ptr->redraw &= ~PR_LEV; prt_level(); } if (p_ptr->redraw & PR_EXP) { ! p_ptr->redraw &= ~PR_EXP; prt_exp(); } *************** *** 2600,2618 **** if (p_ptr->redraw & PR_ARMOR) { ! p_ptr->redraw &= ~(PR_ARMOR); prt_ac(); } if (p_ptr->redraw & PR_HP) { ! p_ptr->redraw &= ~(PR_HP); prt_hp(); } if (p_ptr->redraw & PR_MANA) { ! p_ptr->redraw &= ~(PR_MANA); prt_sp(); } --- 2501,2519 ---- if (p_ptr->redraw & PR_ARMOR) { ! p_ptr->redraw &= ~PR_ARMOR; prt_ac(); } if (p_ptr->redraw & PR_HP) { ! p_ptr->redraw &= ~PR_HP; prt_hp(); } if (p_ptr->redraw & PR_MANA) { ! p_ptr->redraw &= ~PR_MANA; prt_sp(); } *************** *** 2630,2636 **** if (p_ptr->redraw & PR_HEALTH) { ! p_ptr->redraw &= ~(PR_HEALTH); if (show_health_bar) health_redraw(); } --- 2531,2537 ---- if (p_ptr->redraw & PR_HEALTH) { ! p_ptr->redraw &= ~PR_HEALTH; if (show_health_bar) health_redraw(); } *************** *** 2637,2645 **** if (p_ptr->redraw & PR_EXTRA) { ! p_ptr->redraw &= ~(PR_EXTRA); p_ptr->redraw &= ~(PR_CUT | PR_STUN); ! p_ptr->redraw &= ~(PR_HUNGER); p_ptr->redraw &= ~(PR_BLIND | PR_CONFUSED); p_ptr->redraw &= ~(PR_AFRAID | PR_POISONED); p_ptr->redraw &= ~(PR_STATE | PR_SPEED | PR_STUDY); --- 2538,2546 ---- if (p_ptr->redraw & PR_EXTRA) { ! p_ptr->redraw &= ~PR_EXTRA; p_ptr->redraw &= ~(PR_CUT | PR_STUN); ! p_ptr->redraw &= ~PR_HUNGER; p_ptr->redraw &= ~(PR_BLIND | PR_CONFUSED); p_ptr->redraw &= ~(PR_AFRAID | PR_POISONED); p_ptr->redraw &= ~(PR_STATE | PR_SPEED | PR_STUDY); *************** *** 2654,2678 **** if (p_ptr->redraw & PR_STUN) { ! p_ptr->redraw &= ~(PR_STUN); prt_stun(); } if (p_ptr->redraw & PR_HUNGER) { ! p_ptr->redraw &= ~(PR_HUNGER); prt_hunger(); } if (p_ptr->redraw & PR_BLIND) { ! p_ptr->redraw &= ~(PR_BLIND); prt_blind(); } if (p_ptr->redraw & PR_CONFUSED) { ! p_ptr->redraw &= ~(PR_CONFUSED); prt_confused(); } --- 2555,2579 ---- if (p_ptr->redraw & PR_STUN) { ! p_ptr->redraw &= ~PR_STUN; prt_stun(); } if (p_ptr->redraw & PR_HUNGER) { ! p_ptr->redraw &= ~PR_HUNGER; prt_hunger(); } if (p_ptr->redraw & PR_BLIND) { ! p_ptr->redraw &= ~PR_BLIND; prt_blind(); } if (p_ptr->redraw & PR_CONFUSED) { ! p_ptr->redraw &= ~PR_CONFUSED; prt_confused(); } *************** *** 2690,2696 **** if (p_ptr->redraw & PR_STATE) { ! p_ptr->redraw &= ~(PR_STATE); prt_state(); } --- 2591,2597 ---- if (p_ptr->redraw & PR_STATE) { ! p_ptr->redraw &= ~PR_STATE; prt_state(); } diff -w -c -r ick-279/xtra2.c utumno/xtra2.c *** ick-279/xtra2.c Thu May 15 17:12:25 1997 --- utumno/xtra2.c Thu May 15 17:46:01 1997 *************** *** 53,59 **** p_ptr->blind = v; /* Nothing to notice */ ! if (!notice) return (FALSE); /* Disturb */ if (disturb_other) disturb(0,0); --- 53,59 ---- p_ptr->blind = v; /* Nothing to notice */ ! if (!notice) return FALSE; /* Disturb */ if (disturb_other) disturb(0,0); *************** *** 77,87 **** handle_stuff(); /* Result */ ! return (TRUE); } /* * Set "p_ptr->confused", notice observable changes */ bool set_confused(int v) --- 77,96 ---- handle_stuff(); /* Result */ ! return TRUE; } /* + * Add to the blindness counter + */ + bool add_blind(int v) + { + return set_blind(p_ptr->blind + v); + } + + + /* * Set "p_ptr->confused", notice observable changes */ bool set_confused(int v) *************** *** 115,121 **** p_ptr->confused = v; /* Nothing to notice */ ! if (!notice) return (FALSE); /* Disturb */ if (disturb_other) disturb(0,0); --- 124,130 ---- p_ptr->confused = v; /* Nothing to notice */ ! if (!notice) return FALSE; /* Disturb */ if (disturb_other) disturb(0,0); *************** *** 127,137 **** handle_stuff(); /* Result */ ! return (TRUE); } /* * Set "p_ptr->poisoned", notice observable changes */ bool set_poisoned(int v) --- 136,155 ---- handle_stuff(); /* Result */ ! return TRUE; } /* + * Add to the confusion counter + */ + bool add_confused(int v) + { + return set_confused(p_ptr->confused + v); + } + + + /* * Set "p_ptr->poisoned", notice observable changes */ bool set_poisoned(int v) *************** *** 177,187 **** handle_stuff(); /* Result */ ! return (TRUE); } /* * Set "p_ptr->afraid", notice observable changes */ bool set_afraid(int v) --- 195,214 ---- handle_stuff(); /* Result */ ! return TRUE; } /* + * Add to the poison counter + */ + bool add_poisoned(int v) + { + return set_poisoned(p_ptr->poisoned + v); + } + + + /* * Set "p_ptr->afraid", notice observable changes */ bool set_afraid(int v) *************** *** 227,233 **** handle_stuff(); /* Result */ ! return (TRUE); } --- 254,260 ---- handle_stuff(); /* Result */ ! return TRUE; } *************** *** 277,283 **** handle_stuff(); /* Result */ ! return (TRUE); } --- 304,310 ---- handle_stuff(); /* Result */ ! return TRUE; } *************** *** 332,338 **** handle_stuff(); /* Result */ ! return (TRUE); } --- 359,365 ---- handle_stuff(); /* Result */ ! return TRUE; } *************** *** 382,388 **** handle_stuff(); /* Result */ ! return (TRUE); } --- 409,415 ---- handle_stuff(); /* Result */ ! return TRUE; } *************** *** 1584,1605 **** p_ptr->food = v; /* Nothing to notice */ ! if (!notice) return (FALSE); /* Disturb */ if (disturb_other) disturb(0,0); /* Recalculate bonuses */ ! p_ptr->update |= (PU_BONUS); /* Redraw hunger */ ! p_ptr->redraw |= (PR_HUNGER); /* Handle stuff */ handle_stuff(); /* Result */ ! return (TRUE); } --- 1611,1632 ---- p_ptr->food = v; /* Nothing to notice */ ! if (!notice) return FALSE; /* Disturb */ if (disturb_other) disturb(0, 0); /* Recalculate bonuses */ ! p_ptr->update |= PU_BONUS; /* Redraw hunger */ ! p_ptr->redraw |= PR_HUNGER; /* Handle stuff */ handle_stuff(); /* Result */ ! return TRUE; } *************** *** 1672,1678 **** if (p_ptr->lev > p_ptr->max_plv) p_ptr->max_plv = p_ptr->lev; /* Sound */ ! sound(SOUND_LEVEL); /* Message */ msg_format("Welcome to level %d.", p_ptr->lev); --- 1699,1705 ---- if (p_ptr->lev > p_ptr->max_plv) p_ptr->max_plv = p_ptr->lev; /* Sound */ ! game_sound(SOUND_LEVEL); /* Message */ msg_format("Welcome to level %d.", p_ptr->lev); *************** *** 1737,1744 **** { cptr name = (r_name + r_ptr->name); ! /* Analyze "coin" monsters */ ! if (r_ptr->r_char == '$') { /* Look for textual clues */ if (strstr(name, "copper")) return (2); --- 1764,1771 ---- { cptr name = (r_name + r_ptr->name); ! /* Analyze creeping coins and golems */ ! if ((r_ptr->r_char == '$') || (r_ptr->r_char == 'g')) { /* Look for textual clues */ if (strstr(name, "copper")) return (2); *************** *** 1788,1794 **** cave_type *c_ptr; monster_type *m_ptr = &m_list[m_idx]; - monster_race *r_ptr = &r_info[m_ptr->r_idx]; bool visible = (m_ptr->ml || (r_ptr->flags1 & RF1_UNIQUE)); --- 1815,1820 ---- *************** *** 1803,1810 **** /* Get the location */ - y = m_ptr->fy; x = m_ptr->fx; /* Determine how much we can drop */ if ((r_ptr->flags1 & RF1_DROP_60) && (rand_int(100) < 60)) number++; --- 1829,1836 ---- /* Get the location */ x = m_ptr->fx; + y = m_ptr->fy; /* Determine how much we can drop */ if ((r_ptr->flags1 & RF1_DROP_60) && (rand_int(100) < 60)) number++; *************** *** 1813,1818 **** --- 1839,1845 ---- if (r_ptr->flags1 & RF1_DROP_2D2) number += damroll(2, 2); if (r_ptr->flags1 & RF1_DROP_3D2) number += damroll(3, 2); if (r_ptr->flags1 & RF1_DROP_4D2) number += damroll(4, 2); + if (m_ptr->spawned) number = 0; /* Drop some objects */ for (j = 0; j < number; j++) *************** *** 1826,1838 **** scatter(&ny, &nx, y, x, d, 0); /* Must be "clean" floor grid */ ! if (!clean_grid_bold(ny, nx)) continue; /* Hack -- handle creeping coins */ coin_type = force_coin; /* Average dungeon and monster levels */ ! object_level = (dun_level + r_ptr->level) / 2; /* Place Gold */ if (do_gold && (!do_item || (rand_int(100) < 50))) --- 1853,1865 ---- scatter(&ny, &nx, y, x, d, 0); /* Must be "clean" floor grid */ ! if (!clean_stackable_grid_bold(ny, nx)) continue; /* Hack -- handle creeping coins */ coin_type = force_coin; /* Average dungeon and monster levels */ ! object_level = rand_range(dun_level, r_ptr->level); /* Place Gold */ if (do_gold && (!do_item || (rand_int(100) < 50))) *************** *** 1887,1896 **** /* Mega-Hack -- Prepare to make "Grond" */ ! invcopy(&prize, lookup_kind(TV_HAFTED, SV_GROND)); /* Mega-Hack -- Mark this item as "Grond" */ ! prize.name1 = ART_GROND; /* Mega-Hack -- Actually create "Grond" */ apply_magic(&prize, -1, TRUE, TRUE, TRUE); --- 1914,1923 ---- /* Mega-Hack -- Prepare to make "Grond" */ ! prize.invcopy(lookup_kind(TV_HAFTED, SV_GROND)); /* Mega-Hack -- Mark this item as "Grond" */ ! prize.set_name1(ART_GROND); /* Mega-Hack -- Actually create "Grond" */ apply_magic(&prize, -1, TRUE, TRUE, TRUE); *************** *** 1900,1909 **** /* Mega-Hack -- Prepare to make "Morgoth" */ ! invcopy(&prize, lookup_kind(TV_CROWN, SV_MORGOTH)); /* Mega-Hack -- Mark this item as "Morgoth" */ ! prize.name1 = ART_MORGOTH; /* Mega-Hack -- Actually create "Morgoth" */ apply_magic(&prize, -1, TRUE, TRUE, TRUE); --- 1927,1936 ---- /* Mega-Hack -- Prepare to make "Morgoth" */ ! prize.invcopy(lookup_kind(TV_CROWN, SV_MORGOTH)); /* Mega-Hack -- Mark this item as "Morgoth" */ ! prize.set_name1(ART_MORGOTH); /* Mega-Hack -- Actually create "Morgoth" */ apply_magic(&prize, -1, TRUE, TRUE, TRUE); *************** *** 1941,1947 **** y = ny; x = nx; } ! /* Delete any old object XXX XXX XXX */ delete_object(y, x); /* Explain the stairway */ --- 1968,1974 ---- y = ny; x = nx; } ! /* Delete any old objects XXX XXX XXX */ delete_object(y, x); /* Explain the stairway */ *************** *** 1951,1957 **** c_ptr = &cave[y][x]; /* Create stairs down */ ! c_ptr->feat = 0x07; /* Note the spot */ note_spot(y, x); --- 1978,1984 ---- c_ptr = &cave[y][x]; /* Create stairs down */ ! c_ptr->feat = CF_STAIRS_DOWN; /* Note the spot */ note_spot(y, x); *************** *** 2015,2021 **** bool mon_take_hit(int m_idx, int dam, bool *fear, cptr note) { monster_type *m_ptr = &m_list[m_idx]; - monster_race *r_ptr = &r_info[m_ptr->r_idx]; s32b new_exp, new_exp_frac; --- 2042,2047 ---- *************** *** 2026,2035 **** /* Wake it up */ ! m_ptr->csleep = 0; /* Hurt it */ ! m_ptr->hp -= dam; /* It is dead now */ if (m_ptr->hp < 0) --- 2052,2061 ---- /* Wake it up */ ! m_ptr->set_csleep(0); /* Hurt it */ ! m_ptr->set_hp(m_ptr->hp - dam); /* It is dead now */ if (m_ptr->hp < 0) *************** *** 2040,2046 **** monster_desc(m_name, m_ptr, 0); /* Make a sound */ ! sound(SOUND_KILL); /* Death by Missile/Spell attack */ if (note) --- 2066,2072 ---- monster_desc(m_name, m_ptr, 0); /* Make a sound */ ! game_sound(SOUND_KILL); /* Death by Missile/Spell attack */ if (note) *************** *** 2132,2138 **** if (tmp < m_ptr->monfear) { /* Reduce fear */ ! m_ptr->monfear -= tmp; } /* Cure all the fear */ --- 2158,2164 ---- if (tmp < m_ptr->monfear) { /* Reduce fear */ ! m_ptr->set_monfear(m_ptr->monfear - tmp); } /* Cure all the fear */ *************** *** 2139,2145 **** else { /* Cure fear */ ! m_ptr->monfear = 0; /* No more fear */ (*fear) = FALSE; --- 2165,2171 ---- else { /* Cure fear */ ! m_ptr->set_monfear(0); /* No more fear */ (*fear) = FALSE; *************** *** 2159,2171 **** * or (usually) when hit for half its current hit points */ if (((percentage <= 10) && (rand_int(10) < percentage)) || ! ((dam >= m_ptr->hp) && (rand_int(100) < 80))) { /* Hack -- note fear */ (*fear) = TRUE; /* XXX XXX XXX Hack -- Add some timed fear */ ! m_ptr->monfear = (randint(10) + (((dam >= m_ptr->hp) && (percentage > 7)) ? 20 : ((11 - percentage) * 5))); } --- 2185,2197 ---- * or (usually) when hit for half its current hit points */ if (((percentage <= 10) && (rand_int(10) < percentage)) || ! ((dam >= m_ptr->hp) && percent(80))) { /* Hack -- note fear */ (*fear) = TRUE; /* XXX XXX XXX Hack -- Add some timed fear */ ! m_ptr->set_monfear(randint(10) + (((dam >= m_ptr->hp) && (percentage > 7)) ? 20 : ((11 - percentage) * 5))); } *************** *** 2205,2212 **** */ void verify_panel(void) { - int y = py; int x = px; int prow = panel_row; int pcol = panel_col; --- 2231,2238 ---- */ void verify_panel(void) { int x = px; + int y = py; int prow = panel_row; int pcol = panel_col; *************** *** 2382,2416 **** /* * Determine is a monster makes a reasonable target * ! * The concept of "targetting" was stolen from "Morgul" (?) * ! * The player can target any location, or any "target-able" monster. * ! * Currently, a monster is "target_able" if it is visible, and if ! * the player can hit it with a projection, and the player is not ! * hallucinating. This allows use of "use closest target" macros. * * Future versions may restrict the ability to target "trappers" ! * and "mimics", but the semantics is a little bit weird. */ ! bool target_able(int m_idx) { monster_type *m_ptr = &m_list[m_idx]; /* Monster must be visible */ ! if (!m_ptr->ml) return (FALSE); - /* Monster must be projectable */ - if (!projectable(py, px, m_ptr->fy, m_ptr->fx)) return (FALSE); - /* Hack -- no targeting hallucinations */ ! if (p_ptr->image) return (FALSE); /* XXX XXX XXX Hack -- Never target trappers */ /* if (CLEAR_ATTR && CLEAR_CHAR) return (FALSE); */ /* Assume okay */ ! return (TRUE); } --- 2408,2438 ---- /* * Determine is a monster makes a reasonable target * ! * The concept of targetting was stolen from Morgul (?) * ! * The player can target any location, or any targetable monster. * ! * Currently, a monster is targetable if it is visible and the player ! * is not hallucinating. * * Future versions may restrict the ability to target "trappers" ! * and "mimics", but the semantics are a little bit weird. */ ! bool targetable(int m_idx) { monster_type *m_ptr = &m_list[m_idx]; /* Monster must be visible */ ! if (!m_ptr->ml) return FALSE; /* Hack -- no targeting hallucinations */ ! if (p_ptr->image) return FALSE; /* XXX XXX XXX Hack -- Never target trappers */ /* if (CLEAR_ATTR && CLEAR_CHAR) return (FALSE); */ /* Assume okay */ ! return TRUE; } *************** *** 2430,2442 **** if (target_who > 0) { /* Accept reasonable targets */ ! if (target_able(target_who)) { monster_type *m_ptr = &m_list[target_who]; /* Acquire monster location */ - target_row = m_ptr->fy; target_col = m_ptr->fx; /* Good target */ return (TRUE); --- 2452,2464 ---- if (target_who > 0) { /* Accept reasonable targets */ ! if (targetable(target_who)) { monster_type *m_ptr = &m_list[target_who]; /* Acquire monster location */ target_col = m_ptr->fx; + target_row = m_ptr->fy; /* Good target */ return (TRUE); *************** *** 2523,2530 **** { int i, d, m; - int y = py; int x = px; bool done = FALSE; --- 2545,2552 ---- { int i, d, m; int x = px; + int y = py; bool done = FALSE; *************** *** 2559,2565 **** if (!m_ptr->r_idx) continue; /* Ignore "unreasonable" monsters */ ! if (!target_able(i)) continue; /* Save this monster index */ temp_x[temp_n] = m_ptr->fx; --- 2581,2587 ---- if (!m_ptr->r_idx) continue; /* Ignore "unreasonable" monsters */ ! if (!targetable(i)) continue; /* Save this monster index */ temp_x[temp_n] = m_ptr->fx; *************** *** 2884,2890 **** * and place it into "command_dir", unless we already have one. * * This function should be used for all "repeatable" commands, such as ! * run, walk, open, close, bash, disarm, spike, tunnel, etc. * * This function tracks and uses the "global direction", and uses * that as the "desired direction", to which "confusion" is applied. --- 2906,2912 ---- * and place it into "command_dir", unless we already have one. * * This function should be used for all "repeatable" commands, such as ! * run, walk, open, close, bash, disarm, tunnel, etc. * * This function tracks and uses the "global direction", and uses * that as the "desired direction", to which "confusion" is applied. Only in utumno: xxx diff -w -c -r ick-279/z-rand.c utumno/z-rand.c *** ick-279/z-rand.c Thu May 15 17:12:26 1997 --- utumno/z-rand.c Thu May 15 17:46:02 1997 *************** *** 17,31 **** * This code provides (1) a "decent" RNG, based on the "BSD-degree-63-RNG" * used in Angband 2.7.8, but rather optimized, and (2) a "simple" RNG, * based on the simple "LCRNG" currently used in Angband, but "corrected" ! * to give slightly better values. Both of these are available in two ! * flavors, first, the simple "mod" flavor, which is fast, but slightly ! * biased at high values, and second, the simple "div" flavor, which is ! * less fast (and potentially non-terminating) but which is not biased ! * and is much less subject to low-bit-non-randomness problems. * - * You can select your favorite flavor by proper definition of the - * "rand_int()" macro in the "defines.h" file. - * * Note that, in Angband 2.8.0, the "state" table will be saved in the * savefile, so a special "initialization" will be necessary. * --- 17,24 ---- * This code provides (1) a "decent" RNG, based on the "BSD-degree-63-RNG" * used in Angband 2.7.8, but rather optimized, and (2) a "simple" RNG, * based on the simple "LCRNG" currently used in Angband, but "corrected" ! * to give slightly better values. * * Note that, in Angband 2.8.0, the "state" table will be saved in the * savefile, so a special "initialization" will be necessary. * *************** *** 98,149 **** /* - * Extract a "random" number from 0 to m-1, via "modulus" - * - * Note that "m" should probably be less than 500000, or the - * results may be rather biased towards low values. - */ - s32b Rand_mod(s32b m) - { - int j; - u32b r; - - /* Hack -- simple case */ - if (m <= 1) return (0); - - /* Use the "simple" RNG */ - if (Rand_quick) - { - /* Cycle the generator */ - r = (Rand_value = LCRNG(Rand_value)); - - /* Mutate a 28-bit "random" number */ - r = ((r >> 4) % m); - } - - /* Use the "complex" RNG */ - else - { - /* Acquire the next index */ - j = Rand_place + 1; - if (j == RAND_DEG) j = 0; - - /* Update the table, extract an entry */ - r = (Rand_state[j] += Rand_state[Rand_place]); - - /* Advance the index */ - Rand_place = j; - - /* Extract a "random" number */ - r = ((r >> 4) % m); - } - - /* Use the value */ - return (r); - } - - - /* * Extract a "random" number from 0 to m-1, via "division" * * This method selects "random" 28-bit numbers, and then uses --- 91,96 ---- *************** *** 151,157 **** * plus a small non-partition to reduce bias, taking as the final * value the first "good" partition that a number falls into. * ! * This method has no bias, and is much less affected by patterns * in the "low" bits of the underlying RNG's. */ s32b Rand_div(s32b m) --- 98,104 ---- * plus a small non-partition to reduce bias, taking as the final * value the first "good" partition that a number falls into. * ! * This method has no bias and is not much affected by patterns * in the "low" bits of the underlying RNG's. */ s32b Rand_div(s32b m) *************** *** 227,233 **** /* * The normal distribution table for the "randnor()" function (below) */ ! static s16b randnor_table[RANDNOR_NUM] = { 206, 613, 1022, 1430, 1838, 2245, 2652, 3058, 3463, 3867, 4271, 4673, 5075, 5475, 5874, 6271, --- 174,181 ---- /* * The normal distribution table for the "randnor()" function (below) */ ! static s16b randnor_table[RANDNOR_NUM] = ! { 206, 613, 1022, 1430, 1838, 2245, 2652, 3058, 3463, 3867, 4271, 4673, 5075, 5475, 5874, 6271, diff -w -c -r ick-279/z-rand.h utumno/z-rand.h *** ick-279/z-rand.h Sat Apr 13 11:36:22 1996 --- utumno/z-rand.h Sun May 4 03:03:58 1997 *************** *** 28,34 **** * For example, if M is 100, you get "percentile dice" */ #define rand_int(M) \ ! (Rand_mod(M)) /* * Generates a random long integer X where A<=X<=B --- 28,34 ---- * For example, if M is 100, you get "percentile dice" */ #define rand_int(M) \ ! (Rand_div(M)) /* * Generates a random long integer X where A<=X<=B *************** *** 58,65 **** /* * Evaluate to TRUE "P" percent of the time */ ! #define magik(P) \ ! (rand_int(100) < (P)) --- 58,64 ---- /* * Evaluate to TRUE "P" percent of the time */ ! #define percent(P) (rand_int(100) < (P)) *************** *** 77,83 **** extern void Rand_state_init(u32b seed); - extern s32b Rand_mod(s32b m); extern s32b Rand_div(s32b m); extern s16b randnor(int mean, int stand); extern s16b damroll(int num, int sides); --- 76,81 ---- diff -w -c -r ick-279/z-term.c utumno/z-term.c *** ick-279/z-term.c Thu May 15 17:12:27 1997 --- utumno/z-term.c Thu May 15 17:46:02 1997 *************** *** 1885,1891 **** if (Term_inkey_hook) { /* Special "Borg" hook (flush keys) */ ! return ((*Term_inkey_hook)(NULL, NULL, NULL)); } /* Hack -- Flush all events */ --- 1885,1891 ---- if (Term_inkey_hook) { /* Special "Borg" hook (flush keys) */ ! return ((*Term_inkey_hook)(NULL, 0, 0)); } /* Hack -- Flush all events */ diff -w -c -r ick-279/z-term.h utumno/z-term.h No differences encountered diff -w -c -r ick-279/z-util.c utumno/z-util.c *** ick-279/z-util.c Thu May 15 17:12:27 1997 --- utumno/z-util.c Thu May 15 17:46:03 1997 *************** *** 28,57 **** /* - * Constant bool meaning true - */ - bool bool_true = 1; - - /* - * Constant bool meaning false - */ - bool bool_false = 0; - - - /* - * Global NULL cptr - */ - cptr cptr_null = NULL; - - - /* - * Global NULL vptr - */ - vptr vptr_null = NULL; - - - - /* * Global SELF vptr */ vptr vptr_self = (vptr)(&vptr_self); --- 28,33 ---- *************** *** 64,126 **** cptr argv0 = NULL; - - /* - * A routine that does nothing - */ - void func_nothing(void) - { - /* Do nothing */ - } - - - /* - * A routine that always returns "success" - */ - errr func_success(void) - { - return (0); - } - - - /* - * A routine that always returns a simple "problem code" - */ - errr func_problem(void) - { - return (1); - } - - - /* - * A routine that always returns a simple "failure code" - */ - errr func_failure(void) - { - return (-1); - } - - - - /* - * A routine that always returns "true" - */ - bool func_true(void) - { - return (1); - } - - - /* - * A routine that always returns "false" - */ - bool func_false(void) - { - return (0); - } - - - /* * Determine if string "t" is equal to string "t" --- 40,45 ---- diff -w -c -r ick-279/z-util.h utumno/z-util.h *** ick-279/z-util.h Sat Apr 13 11:36:47 1996 --- utumno/z-util.h Sun Oct 6 18:56:42 1996 *************** *** 29,39 **** extern vptr vptr_tmp; - /* Constant pointers (NULL) */ - extern cptr cptr_null; - extern vptr vptr_null; - - /* A bizarre vptr that always points at itself */ extern vptr vptr_self; --- 29,34 ---- *************** *** 50,68 **** /**** Available Functions ****/ - /* Function that does nothing */ - extern void func_nothing(void); - - /* Functions that return basic "errr" codes */ - extern errr func_success(void); - extern errr func_problem(void); - extern errr func_failure(void); - - /* Functions that return bools */ - extern bool func_true(void); - extern bool func_false(void); - - /* Test equality, prefix, suffix */ extern bool streq(cptr s, cptr t); extern bool prefix(cptr s, cptr t); --- 45,50 ---- diff -w -c -r ick-279/z-virt.h utumno/z-virt.h No differences encountered