-+-+-+-+-+-+-+-+ START OF PART 13 -+-+-+-+-+-+-+-+ X`09 msg_print("Your skin returns to normal."); X`09 `7D X`09`7D X /* Heroism */ X if (f_ptr->hero > 0) X`09`7B X`09 if ((PY_HERO & f_ptr->status) == 0) X`09 `7B X`09 f_ptr->status `7C= PY_HERO; X`09 disturb (0, 0); X`09 p_ptr->mhp += 10; X`09 p_ptr->chp += 10; X`09 p_ptr->bth += 12; X`09 p_ptr->bthb+= 12; X`09 msg_print("You feel like a HERO!"); X`09 prt_mhp(); X`09 prt_chp(); X`09 `7D X`09 f_ptr->hero--; X`09 if (f_ptr->hero == 0) X`09 `7B X#ifdef ATARIST_MWC X`09 f_ptr->status &= `7E(holder = PY_HERO); X#else X`09 f_ptr->status &= `7EPY_HERO; X#endif X`09 disturb (0, 0); X`09 p_ptr->mhp -= 10; X`09 if (p_ptr->chp > p_ptr->mhp) X`09`09`7B X`09`09 p_ptr->chp = p_ptr->mhp; X`09`09 p_ptr->chp_frac = 0; X`09`09 prt_chp(); X`09`09`7D X`09 p_ptr->bth -= 12; X`09 p_ptr->bthb-= 12; X`09 msg_print("The heroism wears off."); X`09 prt_mhp(); X`09 `7D X`09`7D X /* Super Heroism */ X if (f_ptr->shero > 0) X`09`7B X`09 if ((PY_SHERO & f_ptr->status) == 0) X`09 `7B X`09 f_ptr->status `7C= PY_SHERO; X`09 disturb (0, 0); X`09 p_ptr->mhp += 20; X`09 p_ptr->chp += 20; X`09 p_ptr->bth += 24; X`09 p_ptr->bthb+= 24; X`09 msg_print("You feel like a SUPER HERO!"); X`09 prt_mhp(); X`09 prt_chp(); X`09 `7D X`09 f_ptr->shero--; X`09 if (f_ptr->shero == 0) X`09 `7B X#ifdef ATARIST_MWC X`09 f_ptr->status &= `7E(holder = PY_SHERO); X#else X`09 f_ptr->status &= `7EPY_SHERO; X#endif X`09 disturb (0, 0); X`09 p_ptr->mhp -= 20; X`09 if (p_ptr->chp > p_ptr->mhp) X`09`09`7B X`09`09 p_ptr->chp = p_ptr->mhp; X`09`09 p_ptr->chp_frac = 0; X`09`09 prt_chp(); X`09`09`7D X`09 p_ptr->bth -= 24; X`09 p_ptr->bthb-= 24; X`09 msg_print("The super heroism wears off."); X`09 prt_mhp(); X`09 `7D X`09`7D X /* Blessed */ X if (f_ptr->blessed > 0) X`09`7B X`09 if ((PY_BLESSED & f_ptr->status) == 0) X`09 `7B X`09 f_ptr->status `7C= PY_BLESSED; X`09 disturb (0, 0); X`09 p_ptr->bth += 5; X`09 p_ptr->bthb+= 5; X`09 p_ptr->pac += 2; X`09 p_ptr->dis_ac+= 2; X`09 msg_print("You feel righteous!"); X`09 prt_pac(); X`09 `7D X`09 f_ptr->blessed--; X`09 if (f_ptr->blessed == 0) X`09 `7B X#ifdef ATARIST_MWC X`09 f_ptr->status &= `7E(holder = PY_BLESSED); X#else X`09 f_ptr->status &= `7EPY_BLESSED; X#endif X`09 disturb (0, 0); X`09 p_ptr->bth -= 5; X`09 p_ptr->bthb-= 5; X`09 p_ptr->pac -= 2; X`09 p_ptr->dis_ac -= 2; X`09 msg_print("The prayer has expired."); X`09 prt_pac(); X`09 `7D X`09`7D X /* Resist Heat */ X if (f_ptr->resist_heat > 0) X`09`7B X`09 f_ptr->resist_heat--; X`09 if (f_ptr->resist_heat == 0) X`09 msg_print ("You no longer feel safe from flame."); X`09`7D X /* Resist Cold */ X if (f_ptr->resist_cold > 0) X`09`7B X`09 f_ptr->resist_cold--; X`09 if (f_ptr->resist_cold == 0) X`09 msg_print ("You no longer feel safe from cold."); X`09`7D X /* Detect Invisible */ X if (f_ptr->detect_inv > 0) X`09`7B X#ifdef ATARIST_MWC X`09 if (((holder = PY_DET_INV) & f_ptr->status) == 0) X#else X`09 if ((PY_DET_INV & f_ptr->status) == 0) X#endif X`09 `7B X#ifdef ATARIST_MWC X`09 f_ptr->status `7C= holder; X#else X`09 f_ptr->status `7C= PY_DET_INV; X#endif X`09 f_ptr->see_inv = TRUE; X`09 /* light but don't move creatures */ X`09 creatures (FALSE); X`09 `7D X`09 f_ptr->detect_inv--; X`09 if (f_ptr->detect_inv == 0) X`09 `7B X#ifdef ATARIST_MWC X`09 f_ptr->status &= `7Eholder; X#else X`09 f_ptr->status &= `7EPY_DET_INV; X#endif X`09 /* may still be able to see_inv if wearing magic item */ X`09 calc_bonuses(); X`09 /* unlight but don't move creatures */ X`09 creatures (FALSE); X`09 `7D X`09`7D X /* Timed infra-vision */ X if (f_ptr->tim_infra > 0) X`09`7B X#ifdef ATARIST_MWC X`09 if (((holder = PY_TIM_INFRA) & f_ptr->status) == 0) X#else X`09 if ((PY_TIM_INFRA & f_ptr->status) == 0) X#endif X`09 `7B X#ifdef ATARIST_MWC X`09 f_ptr->status `7C= holder; X#else X`09 f_ptr->status `7C= PY_TIM_INFRA; X#endif X`09 f_ptr->see_infra++; X`09 /* light but don't move creatures */ X`09 creatures (FALSE); X`09 `7D X`09 f_ptr->tim_infra--; X`09 if (f_ptr->tim_infra == 0) X`09 `7B X#ifdef ATARIST_MWC X`09 f_ptr->status &= `7Eholder; X#else X`09 f_ptr->status &= `7EPY_TIM_INFRA; X#endif X`09 f_ptr->see_infra--; X`09 /* unlight but don't move creatures */ X`09 creatures (FALSE); X`09 `7D X`09`7D X`09/* Word-of-Recall Note: Word-of-Recall is a delayed action`09 */ X if (f_ptr->word_recall > 0) X`09if (f_ptr->word_recall == 1) X`09 `7B X`09 new_level_flag = TRUE; X`09 f_ptr->paralysis++; X`09 f_ptr->word_recall = 0; X`09 if (dun_level > 0) X`09 `7B X`09`09dun_level = 0; X`09`09msg_print("You feel yourself yanked upwards!"); X`09 `7D X`09 else if (py.misc.max_dlv != 0) X`09 `7B X`09`09dun_level = py.misc.max_dlv; X`09`09msg_print("You feel yourself yanked downwards!"); X`09 `7D X`09 `7D X`09else X`09 f_ptr->word_recall--; X X /* Random teleportation */ X if ((py.flags.teleport) && (randint(100) == 1)) X`09`7B X`09 disturb (0, 0); X`09 teleport(40); X`09`7D X X /* See if we are too weak to handle the weapon or pack. -CJS- */ X#ifdef ATARIST_MWC X if (py.flags.status & (holder = PY_STR_WGT)) X#else X if (py.flags.status & PY_STR_WGT) X#endif X`09check_strength(); X if (py.flags.status & PY_STUDY) X`09prt_study(); X#ifdef ATARIST_MWC X if (py.flags.status & (holder = PY_SPEED)) X#else X if (py.flags.status & PY_SPEED) X#endif X`09`7B X#ifdef ATARIST_MWC X`09 py.flags.status &= `7Eholder; X#else X`09 py.flags.status &= `7EPY_SPEED; X#endif X`09 prt_speed(); X`09`7D X#ifdef ATARIST_MWC X if ((py.flags.status & (holder = PY_PARALYSED)) X`09 && (py.flags.paralysis < 1)) X#else X if ((py.flags.status & PY_PARALYSED) && (py.flags.paralysis < 1)) X#endif X`09`7B X`09 prt_state(); X#ifdef ATARIST_MWC X`09 py.flags.status &= `7Eholder; X#else X`09 py.flags.status &= `7EPY_PARALYSED; X#endif X`09`7D X else if (py.flags.paralysis > 0) X`09`7B X`09 prt_state(); X#ifdef ATARIST_MWC X`09 py.flags.status `7C= (holder = PY_PARALYSED); X#else X`09 py.flags.status `7C= PY_PARALYSED; X#endif X`09`7D X else if (py.flags.rest != 0) X`09prt_state(); X X#ifdef ATARIST_MWC X if ((py.flags.status & (holder = PY_ARMOR)) != 0) X#else X if ((py.flags.status & PY_ARMOR) != 0) X#endif X`09`7B X`09 prt_pac(); X#ifdef ATARIST_MWC X`09 py.flags.status &= `7Eholder; X#else X`09 py.flags.status &= `7EPY_ARMOR; X#endif X`09`7D X#ifdef ATARIST_MWC X if ((py.flags.status & (holder = PY_STATS)) != 0) X#else X if ((py.flags.status & PY_STATS) != 0) X#endif X`09`7B X`09 for (i = 0; i < 6; i++) X#ifdef ATARIST_MWC X`09 if (((holder = PY_STR) << i) & py.flags.status) X#else X`09 if ((PY_STR << i) & py.flags.status) X#endif X`09 prt_stat(i); X#ifdef ATARIST_MWC X`09 py.flags.status &= `7E(holder = PY_STATS); X#else X`09 py.flags.status &= `7EPY_STATS; X#endif X`09`7D X#ifdef ATARIST_MWC X if (py.flags.status & (holder = PY_HP)) X#else X if (py.flags.status & PY_HP) X#endif X`09`7B X`09 prt_mhp(); X`09 prt_chp(); X#ifdef ATARIST_MWC X`09 py.flags.status &= `7Eholder; X#else X`09 py.flags.status &= `7EPY_HP; X#endif X`09`7D X#ifdef ATARIST_MWC X if (py.flags.status & (holder = PY_MANA)) X#else X if (py.flags.status & PY_MANA) X#endif X`09`7B X`09 prt_cmana(); X#ifdef ATARIST_MWC X`09 py.flags.status &= `7Eholder; X#else X`09 py.flags.status &= `7EPY_MANA; X#endif X`09`7D X X /* Allow for a slim chance of detect enchantment -CJS- */ X /* for 1st level char, check once every 2160 turns X`09 for 40th level char, check once every 416 turns */ X if (((turn & 0xF) == 0) && (f_ptr->confused == 0) X`09 && (randint((int)(10 + 750 / (5 + py.misc.lev))) == 1)) X`09`7B X`09 vtype tmp_str; X X`09 for (i = 0; i < INVEN_ARRAY_SIZE; i++) X`09 `7B X`09 if (i == inven_ctr) X`09`09i = 22; X`09 i_ptr = &inventory`5Bi`5D; X`09 /* if in inventory, succeed 1 out of 50 times, X`09`09 if in equipment list, success 1 out of 10 times */ X`09 if ((i_ptr->tval != TV_NOTHING) && enchanted(i_ptr) && X`09`09 (randint(i < 22 ? 50 : 10) == 1)) X`09`09`7B X`09`09 extern char *describe_use(); X X`09`09 (void) sprintf(tmp_str, X`09`09`09`09 "There's something about what you are %s...", X`09`09`09`09 describe_use(i)); X`09`09 disturb(0, 0); X`09`09 msg_print(tmp_str); X`09`09 add_inscribe(i_ptr, ID_MAGIK); X`09`09`7D X`09 `7D X`09`7D X X /* Check the state of the monster list, and delete some monsters if X`09 the monster list is nearly full. This helps to avoid problems in X`09 creature.c when monsters try to multiply. Compact_monsters() is X`09 much more likely to succeed if called from here, than if called X`09 from within creatures(). */ X if (MAX_MALLOC - mfptr < 10) X`09(void) compact_monsters (); X X if ((py.flags.paralysis < 1) &&`09 /* Accept a command? */ X`09 (py.flags.rest == 0) && X`09 (!death)) X`09/* Accept a command and execute it`09`09`09`09 */ X`09`7B X`09 do X`09 `7B X#ifdef ATARIST_MWC X`09 if (py.flags.status & (holder = PY_REPEAT)) X#else X`09 if (py.flags.status & PY_REPEAT) X#endif X`09`09prt_state (); X`09 default_dir = FALSE; X`09 free_turn_flag = FALSE; X X`09 if (find_flag) X`09`09`7B X`09`09 find_run(); X`09`09 find_count--; X`09`09 if (find_count == 0) X`09`09 end_find(); X`09`09 put_qio(); X`09`09`7D X`09 else if (doing_inven) X`09`09inven_command (doing_inven); X`09 else X`09`09`7B X`09`09 /* move the cursor to the players character */ X`09`09 move_cursor_relative (char_row, char_col); X`09`09 if (command_count > 0) X`09`09 `7B X`09`09 msg_flag = FALSE; X`09`09 default_dir = TRUE; X`09`09 `7D X`09`09 else X`09`09 `7B X`09`09 msg_flag = FALSE; X#ifdef MAC X`09`09 unloadsegments(); X`09`09 enablesavecmd(TRUE); X`09`09 command = inkeydir(); X`09`09 enablesavecmd(FALSE); X#else X`09`09 command = inkey(); X#endif X`09`09 i = 0; X`09`09 /* Get a count for a command. */ X`09`09 if ((rogue_like_commands X`09`09`09 && command >= '0' && command <= '9') X`09`09`09 `7C`7C (!rogue_like_commands && command == '#')) X`09`09`09`7B X`09`09`09 char tmp`5B8`5D; X X`09`09`09 prt("Repeat count:", 0, 0); X`09`09`09 if (command == '#') X`09`09`09 command = '0'; X`09`09`09 i = 0; X`09`09`09 while (TRUE) X`09`09`09 `7B X`09`09`09 if (command == DELETE `7C`7C command == CTRL('H')) X`09`09`09`09`7B X`09`09`09`09 i = i / 10; X`09`09`09`09 (void) sprintf(tmp, "%d", i); X`09`09`09`09 prt (tmp, 0, 14); X`09`09`09`09`7D X`09`09`09 else if (command >= '0' && command <= '9') X`09`09`09`09`7B X`09`09`09 if (i > 99) X`09`09`09`09 bell (); X`09`09`09`09 else X`09`09`09`09 `7B X`09`09`09`09 i = i * 10 + command - '0'; X`09`09`09`09 (void) sprintf (tmp, "%d", i); X`09`09`09`09 prt (tmp, 0, 14); X`09`09`09`09 `7D X`09`09`09`09`7D X`09`09`09 else X`09`09`09`09break; X#ifdef MAC X`09`09`09 command = inkeydir(); X#else X`09`09`09 command = inkey(); X#endif X`09`09`09 `7D X`09`09`09 if (i == 0) X`09`09`09 `7B X`09`09`09 i = 99; X`09`09`09 (void) sprintf (tmp, "%d", i); X`09`09`09 prt (tmp, 0, 14); X`09`09`09 `7D X`09`09`09 /* a special hack to allow numbers as commands */ X`09`09`09 if (command == ' ') X`09`09`09 `7B X`09`09`09 prt ("Command:", 0, 20); X#ifdef MAC X`09`09`09 command = inkeydir(); X#else X`09`09`09 command = inkey(); X#endif X`09`09`09 `7D X`09`09`09`7D X`09`09 /* Another way of typing control codes -CJS- */ X`09`09 if (command == '`5E') X`09`09`09`7B X`09`09`09 if (command_count > 0) X`09`09`09 prt_state(); X`09`09`09 if (get_com("Control-", &command)) X`09`09`09 `7B X`09`09`09 if (command >= 'A' && command <= 'Z') X`09`09`09`09command -= 'A' - 1; X`09`09`09 else if (command >= 'a' && command <= 'z') X`09`09`09`09command -= 'a' - 1; X`09`09`09 else X`09`09`09`09`7B X`09`09`09 msg_print("Type `5E for a control char"); X`09`09`09`09 command = ' '; X`09`09`09`09`7D X`09`09`09 `7D X`09`09`09 else X`09`09`09 command = ' '; X`09`09`09`7D X`09`09 /* move cursor to player char again, in case it moved */ X`09`09 move_cursor_relative (char_row, char_col); X`09`09 /* Commands are always converted to rogue form. -CJS- */ X`09`09 if (rogue_like_commands == FALSE) X`09`09`09command = original_commands (command); X`09`09 if (i > 0) X`09`09`09`7B X`09`09`09 if (!valid_countcommand(command)) X`09`09`09 `7B X`09`09`09 free_turn_flag = TRUE; X`09`09`09 msg_print ("Invalid command with a count."); X`09`09`09 command = ' '; X`09`09`09 `7D X`09`09`09 else X`09`09`09 `7B X`09`09`09 command_count = i; X`09`09`09 prt_state (); X`09`09`09 `7D X`09`09`09`7D X`09`09 `7D X`09`09 /* Flash the message line. */ X`09`09 erase_line(MSG_LINE, 0); X`09`09 move_cursor_relative(char_row, char_col); X`09`09 put_qio(); X X`09`09 do_command (command); X`09`09 /* Find is counted differently, as the command changes. */ X`09`09 if (find_flag) X`09`09 `7B X`09`09 find_count = command_count - 1; X`09`09 command_count = 0; X`09`09 `7D X`09`09 else if (free_turn_flag) X`09`09 command_count = 0; X`09`09 else if (command_count) X`09`09 command_count--; X`09`09`7D X`09 /* End of commands`09`09`09`09 */ X`09 `7D X`09 while (free_turn_flag && !new_level_flag && !eof_flag); X`09`7D X else X`09`7B X`09 /* if paralyzed, resting, or dead, flush output */ +-+-+-+-+-+-+-+- END OF PART 13 +-+-+-+-+-+-+-+-