-+-+-+-+-+-+-+-+ START OF PART 53 -+-+-+-+-+-+-+-+ X`09 lose_int(); X`09 break; X`09 case 6: X`09 if (res_stat (A_INT)) X`09`09`7B X`09`09 msg_print("You have have a warm feeling."); X`09`09 ident = TRUE; X`09`09`7D X`09 break; X`09 case 7: X`09 if (inc_stat (A_WIS)) X`09`09`7B X`09`09 msg_print("You suddenly have a profound thought!"); X`09`09 ident = TRUE; X`09`09`7D X`09 break; X`09 case 8: X`09 ident = TRUE; X`09 lose_wis(); X`09 break; X`09 case 9: X`09 if (res_stat (A_WIS)) X`09`09`7B X`09`09 msg_print("You feel your wisdom returning."); X`09`09 ident = TRUE; X`09`09`7D X`09 break; X`09 case 10: X`09 if (inc_stat (A_CHR)) X`09`09`7B X`09`09 msg_print("Gee, ain't you cute!"); X`09`09 ident = TRUE; X`09`09`7D X`09 break; X`09 case 11: X`09 ident = TRUE; X`09 lose_chr(); X`09 break; X`09 case 12: X`09 if (res_stat (A_CHR)) X`09`09`7B X`09`09 msg_print("You feel your looks returning."); X`09`09 ident = TRUE; X`09`09`7D X`09 break; X`09 case 13: X`09 ident = hp_player(damroll(2, 7)); X`09 break; X`09 case 14: X`09 ident = hp_player(damroll(4, 7)); X`09 break; X`09 case 15: X`09 ident = hp_player(damroll(6, 7)); X`09 break; X`09 case 16: X`09 ident = hp_player(1000); X`09 break; X`09 case 17: X`09 if (inc_stat (A_CON)) X`09`09`7B X`09`09 msg_print("You feel tingly for a moment."); X`09`09 ident = TRUE; X`09`09`7D X`09 break; X`09 case 18: X`09 m_ptr = &py.misc; X`09 if (m_ptr->exp < MAX_EXP) X`09`09`7B X`09`09 l = (m_ptr->exp / 2) + 10; X`09`09 if (l > 100000L) l = 100000L; X`09`09 m_ptr->exp += l; X`09`09 msg_print("You feel more experienced."); X`09`09 prt_experience(); X`09`09 ident = TRUE; X`09`09`7D X`09 break; X`09 case 19: X`09 f_ptr = &py.flags; X`09 if (!f_ptr->free_act) X`09`09`7B X`09`09 /* paralysis must == 0, otherwise could not drink potion */ X`09`09 msg_print("You fall asleep."); X`09`09 f_ptr->paralysis += randint(4) + 4; X`09`09 ident = TRUE; X`09`09`7D X`09 break; X`09 case 20: X`09 f_ptr = &py.flags; X`09 if (f_ptr->blind == 0) X`09`09`7B X`09`09 msg_print("You are covered by a veil of darkness."); X`09`09 ident = TRUE; X`09`09`7D X`09 f_ptr->blind += randint(100) + 100; X`09 break; X`09 case 21: X`09 f_ptr = &py.flags; X`09 if (f_ptr->confused == 0) X`09`09`7B X`09`09 msg_print("Hey! This is good stuff! * Hick! *"); X`09`09 ident = TRUE; X`09`09`7D X`09 f_ptr->confused += randint(20) + 12; X`09 break; X`09 case 22: X`09 f_ptr = &py.flags; X`09 if (f_ptr->poisoned == 0) X`09`09`7B X`09`09 msg_print("You feel very sick."); X`09`09 ident = TRUE; X`09`09`7D X`09 f_ptr->poisoned += randint(15) + 10; X`09 break; X`09 case 23: X`09 if (py.flags.fast == 0) X`09`09ident = TRUE; X`09 py.flags.fast += randint(25) + 15; X`09 break; X`09 case 24: X`09 if (py.flags.slow == 0) X`09`09ident = TRUE; X`09 py.flags.slow += randint(25) + 15; X`09 break; X`09 case 26: X`09 if (inc_stat (A_DEX)) X`09`09`7B X`09`09 msg_print("You feel more limber!"); X`09`09 ident = TRUE; X`09`09`7D X`09 break; X`09 case 27: X`09 if (res_stat (A_DEX)) X`09`09`7B X`09`09 msg_print("You feel less clumsy."); X`09`09 ident = TRUE; X`09`09`7D X`09 break; X`09 case 28: X`09 if (res_stat (A_CON)) X`09`09`7B X`09`09 msg_print("You feel your health returning!"); X`09`09 ident = TRUE; X`09`09`7D X`09 break; X`09 case 29: X`09 ident = cure_blindness(); X`09 break; X`09 case 30: X`09 ident = cure_confusion(); X`09 break; X`09 case 31: X`09 ident = cure_poison(); X`09 break; X#if 0 X`09 case 33: X`09 /* this is no longer useful, now that there is a 'G'ain magic X`09`09 spells command */ X`09 m_ptr = &py.misc; X`09 c_ptr = &class`5Bm_ptr->pclass`5D; X`09 if (c_ptr->spell == MAGE) X`09`09`7B X`09`09 calc_spells(A_INT); X`09`09 calc_mana(A_INT); X`09`09`7D X`09 else if (c_ptr->spell == PRIEST) X`09`09`7B X`09`09 calc_spells(A_WIS); X`09`09 calc_mana(A_WIS); X`09`09`7D X`09 else X`09`09`7B X`09`09 /* A warrior learns something about his equipment. -CJS- */ X`09`09 inven_type *w_ptr; X`09`09 vtype tmp_str; X`09`09 extern char *describe_use (); X X`09`09 for (k = 22; k < INVEN_ARRAY_SIZE; k++) X`09`09 `7B X`09`09 w_ptr = &inventory`5Bk`5D; X`09`09 if (w_ptr->tval != TV_NOTHING && enchanted (w_ptr)) X`09`09`09`7B X`09`09`09 (void) sprintf (tmp_str, X`09`09`09`09 "There's something about what you are %s...", X`09`09`09`09`09 describe_use(k)); X`09`09`09 msg_print (tmp_str); X`09`09`09 add_inscribe(w_ptr, ID_MAGIK); X`09`09`09 ident = TRUE; X`09`09`09`7D X`09`09 `7D X`09`09`7D X`09 break; X#endif X`09 case 34: X`09 if (py.misc.exp > 0) X`09`09`7B X`09`09 int32 m, scale; X`09`09 msg_print("You feel your memories fade."); X`09`09 /* Lose between 1/5 and 2/5 of your experience */ X`09`09 m = py.misc.exp / 5; X`09`09 if (py.misc.exp > MAX_SHORT) X`09`09 `7B X`09`09 scale = MAX_LONG / py.misc.exp; X`09`09 m += (randint((int)scale) * py.misc.exp) / (scale * 5); X`09`09 `7D X`09`09 else X`09`09 m += randint((int)py.misc.exp) / 5; X`09`09 lose_exp(m); X`09`09 ident = TRUE; X`09`09`7D X`09 break; X`09 case 35: X`09 f_ptr = &py.flags; X`09 (void) cure_poison(); X`09 if (f_ptr->food > 150) f_ptr->food = 150; X`09 f_ptr->paralysis = 4; X`09 msg_print("The potion makes you vomit!"); X`09 ident = TRUE; X`09 break; X`09 case 36: X`09 if (py.flags.invuln == 0) X`09`09ident = TRUE; X`09 py.flags.invuln += randint(10) + 10; X`09 break; X`09 case 37: X`09 if (py.flags.hero == 0) X`09`09ident = TRUE; X`09 py.flags.hero += randint(25) + 25; X`09 break; X`09 case 38: X`09 if (py.flags.shero == 0) X`09`09ident = TRUE; X`09 py.flags.shero += randint(25) + 25; X`09 break; X`09 case 39: X`09 ident = remove_fear(); X`09 break; X`09 case 40: X`09 ident = restore_level(); X`09 break; X`09 case 41: X`09 f_ptr = &py.flags; X`09 if (f_ptr->resist_heat == 0) X`09`09ident = TRUE; X`09 f_ptr->resist_heat += randint(10) + 10; X`09 break; X`09 case 42: X`09 f_ptr = &py.flags; X`09 if (f_ptr->resist_cold == 0) X`09`09ident = TRUE; X`09 f_ptr->resist_cold += randint(10) + 10; X`09 break; X`09 case 43: X`09 if (py.flags.detect_inv == 0) X`09`09ident = TRUE; X`09 detect_inv2(randint(12)+12); X`09 break; X`09 case 44: X`09 ident = slow_poison(); X`09 break; X`09 case 45: X`09 ident = cure_poison(); X`09 break; X`09 case 46: X`09 m_ptr = &py.misc; X`09 if (m_ptr->cmana < m_ptr->mana) X`09`09`7B X`09`09 m_ptr->cmana = m_ptr->mana; X`09`09 ident = TRUE; X`09`09 msg_print("Your feel your head clear."); X`09`09 prt_cmana(); X`09`09`7D X`09 break; X`09 case 47: X`09 f_ptr = &py.flags; X`09 if (f_ptr->tim_infra == 0) X`09`09`7B X`09`09 msg_print("Your eyes begin to tingle."); X`09`09 ident = TRUE; X`09`09`7D X`09 f_ptr->tim_infra += 100 + randint(100); X`09 break; X`09 default: X`09 msg_print ("Internal error in potion()"); X`09 break; X`09 `7D X`09 /* End of Potions.`09`09`09`09`09*/ X`09`7D X if (ident) X`09`7B X`09 if (!known1_p(i_ptr)) X`09 `7B X`09 m_ptr = &py.misc; X`09 /* round half-way case up */ X`09 m_ptr->exp += (i_ptr->level + (m_ptr->lev >> 1)) / m_ptr->lev; X`09 prt_experience(); X X`09 identify(&item_val); X`09 i_ptr = &inventory`5Bitem_val`5D; X`09 `7D X`09`7D X else if (!known1_p(i_ptr)) X`09sample (i_ptr); X X add_food(i_ptr->p1); X desc_remain(item_val); X inven_destroy(item_val); X `7D X`7D $ CALL UNPACK POTIONS.C;1 2093507 $ create 'f' X/* source/prayer.c: code for priest spells X X Copyright (c) 1989-92 James E. Wilson, Robert A. Koeneke X X This software may be copied and distributed for educational, research, an Vd X not for profit purposes provided that this copyright and statement are X included in all such copies. */ X X#include "config.h" X#include "constant.h" X#include "types.h" X#include "externs.h" X X X/* Pray like HELL.`09`09`09`09`09-RAK-`09*/ Xvoid pray() X`7B X int i, j, item_val, dir; X int choice, chance, result; X register spell_type *s_ptr; X register struct misc *m_ptr; X register struct flags *f_ptr; X register inven_type *i_ptr; X#ifdef ATARIST_MWC X int32u holder; X#endif X X free_turn_flag = TRUE; X if (py.flags.blind > 0) X msg_print("You can't see to read your prayer!"); X else if (no_light()) X msg_print("You have no light to read by."); X else if (py.flags.confused > 0) X msg_print("You are too confused."); X else if (class`5Bpy.misc.pclass`5D.spell != PRIEST) X msg_print("Pray hard enough and your prayers may be answered."); X else if (inven_ctr == 0) X msg_print ("But you are not carrying anything!"); X else if (!find_range(TV_PRAYER_BOOK, TV_NEVER, &i, &j)) X msg_print ("You are not carrying any Holy Books!"); X else if (get_item(&item_val, "Use which Holy Book?", i, j, CNIL, CNIL)) X `7B X result = cast_spell("Recite which prayer?", item_val, &choice, &chance V); X if (result < 0) X`09msg_print("You don't know any prayers in that book."); X else if (result > 0) X`09`7B X`09 s_ptr = &magic_spell`5Bpy.misc.pclass-1`5D`5Bchoice`5D; X`09 free_turn_flag = FALSE; X X`09 if (randint(100) < chance) X`09 msg_print("You lost your concentration!"); X`09 else X`09 `7B X`09 /* Prayers.`09`09`09`09`09*/ X`09 switch(choice+1) X`09`09`7B X`09`09case 1: X`09`09 (void) detect_evil(); X`09`09 break; X`09`09case 2: X`09`09 (void) hp_player(damroll(3, 3)); X`09`09 break; X`09`09case 3: X`09`09 bless(randint(12)+12); X`09`09 break; X`09`09case 4: X`09`09 (void) remove_fear(); X`09`09 break; X`09`09case 5: X`09`09 (void) light_area(char_row, char_col); X`09`09 break; X`09`09case 6: X`09`09 (void) detect_trap(); X`09`09 break; X`09`09case 7: X`09`09 (void) detect_sdoor(); X`09`09 break; X`09`09case 8: X`09`09 (void) slow_poison(); X`09`09 break; X`09`09case 9: X`09`09 if (get_dir(CNIL, &dir)) X`09`09 (void) confuse_monster(dir, char_row, char_col); X`09`09 break; X`09`09case 10: X`09`09 teleport((int)(py.misc.lev*3)); X`09`09 break; X`09`09case 11: X`09`09 (void) hp_player(damroll(4, 4)); X`09`09 break; X`09`09case 12: X`09`09 bless(randint(24)+24); X`09`09 break; X`09`09case 13: X`09`09 (void) sleep_monsters1(char_row, char_col); X`09`09 break; X`09`09case 14: X`09`09 create_food(); X`09`09 break; X`09`09case 15: X`09`09 for (i = 0; i < INVEN_ARRAY_SIZE; i++) X`09`09 `7B X`09`09 i_ptr = &inventory`5Bi`5D; X`09`09 /* only clear flag for items that are wielded or worn */ X`09`09 if (i_ptr->tval >= TV_MIN_WEAR X`09`09`09 && i_ptr->tval <= TV_MAX_WEAR) X#ifdef ATARIST_MWC X`09`09`09i_ptr->flags &= `7E(holder = TR_CURSED); X#else X`09`09`09i_ptr->flags &= `7ETR_CURSED; X#endif X`09`09 `7D X`09`09 break; X`09`09case 16: X`09`09 f_ptr = &py.flags; X`09`09 f_ptr->resist_heat += randint(10) + 10; X`09`09 f_ptr->resist_cold += randint(10) + 10; X`09`09 break; X`09`09case 17: X`09`09 (void) cure_poison(); X`09`09 break; X`09`09case 18: X`09`09 if (get_dir(CNIL, &dir)) X`09`09 fire_ball(GF_HOLY_ORB, dir, char_row, char_col, X`09`09`09 (int)(damroll(3, 6)+py.misc.lev), X`09`09`09 "Black Sphere"); X`09`09 break; X`09`09case 19: X`09`09 (void) hp_player(damroll(8, 4)); X`09`09 break; X`09`09case 20: X`09`09 detect_inv2(randint(24)+24); X`09`09 break; X`09`09case 21: X`09`09 (void) protect_evil(); X`09`09 break; X`09`09case 22: X`09`09 earthquake(); X`09`09 break; X`09`09case 23: X`09`09 map_area(); X`09`09 break; X`09`09case 24: X`09`09 (void) hp_player(damroll(16, 4)); X`09`09 break; X`09`09case 25: X`09`09 (void) turn_undead(); X`09`09 break; X`09`09case 26: X`09`09 bless(randint(48)+48); X`09`09 break; X`09`09case 27: X`09`09 (void) dispel_creature(CD_UNDEAD, (int)(3*py.misc.lev)); X`09`09 break; X`09`09case 28: X`09`09 (void) hp_player(200); X`09`09 break; X`09`09case 29: X`09`09 (void) dispel_creature(CD_EVIL, (int)(3*py.misc.lev)); X`09`09 break; X`09`09case 30: X`09`09 warding_glyph(); X`09`09 break; X`09`09case 31: X`09`09 (void) dispel_creature(CD_EVIL, (int)(4*py.misc.lev)); X`09`09 (void) remove_fear(); X`09`09 (void) cure_poison(); X`09`09 (void) hp_player(1000); X`09`09 break; X`09`09default: X`09`09 break; X`09`09`7D X`09 /* End of prayers.`09`09`09`09*/ X`09 if (!free_turn_flag) X`09`09`7B X`09`09 m_ptr = &py.misc; X`09`09 if ((spell_worked & (1L << choice)) == 0) X`09`09 `7B X`09`09 m_ptr->exp += s_ptr->sexp << 2; X`09`09 prt_experience(); X`09`09 spell_worked `7C= (1L << choice); X`09`09 `7D X`09`09`7D X`09 `7D X`09 m_ptr = &py.misc; X`09 if (!free_turn_flag) X`09 `7B X`09 if (s_ptr->smana > m_ptr->cmana) X`09`09`7B X`09`09 msg_print("You faint from fatigue!"); X`09`09 py.flags.paralysis = X`09`09 randint((int)(5 * (s_ptr->smana-m_ptr->cmana))); X`09`09 m_ptr->cmana = 0; X`09`09 m_ptr->cmana_frac = 0; X`09`09 if (randint(3) == 1) X`09`09 `7B X`09`09 msg_print("You have damaged your health!"); X`09`09 (void) dec_stat (A_CON); X`09`09 `7D X`09`09`7D X`09 else X`09`09m_ptr->cmana -= s_ptr->smana; X`09 prt_cmana(); X`09 `7D X`09`7D X `7D X`7D $ CALL UNPACK PRAYER.C;1 760453518 $ create 'f' XNOTE: ESCAPE is defined as Control-Z in constant.h to be more like the Xoriginal VMS moria, this is not documented anyplace, so whenever the Xdoc/program says escape type control_Z instead. If you don't like this, Xdelete the define for escape in constant.h (but you will probably have to Xhit escape twice for it to work). X +-+-+-+-+-+-+-+- END OF PART 53 +-+-+-+-+-+-+-+-