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