-+-+-+-+-+-+-+-+ START OF PART 24 -+-+-+-+-+-+-+-+ X`09 end; X`09`7B Confusion `7D X`09 if (confused > 0) then X`09 begin X`09`09if (uand(%X'00000008',status) = 0) then X`09`09 begin X`09`09 status := uor(%X'00000008',status); X`09`09 prt_confused; X`09`09 end; X`09`09confused := confused - 1; X`09`09if (confused = 0) then X`09`09 begin X`09`09 status := uand(%X'FFFFFFF7',status); X`09`09 prt_confused; X`09`09 msg_print('You feel less confused now.'); X`09`09 if (find_flag) then X`09`09 move_char(5); X`09`09 end; X`09 end; X`7B Resist Lightning `7D X If (resist_lght > 0) then resist_lght := resist_lght - 1; X`7B Protection from Monsters `7D X If (protmon > 0) then protmon := protmon - 1; X`7B Ring of Fire `7D X If (ring_fire > 0) then X begin X msg_print('Flames arise!'); X explode(c_fire,char_row,char_col,20+randint(20),'Ring of Fire'); X ring_fire := ring_fire - 1; X end; X`7B Ring of Frost `7D X`09if (ring_ice > 0) then X`09 begin X`09 explode(c_cold,char_row,char_col,10+randint(20),'Ring of Frost'); X`09 ring_ice := ring_ice - 1; X`09 end; X`7B Blade Barrier `7D X`09if (blade_ring > 0) then X`09 begin X`09 explode(c_null,char_row,char_col,12+randint(py.misc.lev) X`09`09,'Blade Barrier'); X`09 blade_ring := blade_ring - 1; X`09 end; X`7B Magic protection `7D X If (magic_prot > 0) then X begin X if (uand(%X'40000000',status) = 0) then X begin X status := uor(%X'40000000',status); X py.misc.save := py.misc.save + 25; X end; X magic_prot := magic_prot - 1; X if (magic_prot = 0) then X begin X`09 py.misc.save := py.misc.save - 25; X`09 status := uand(%X'BFFFFFFF',status); X end; X end; X`7BTimed resist Petrification`7D X if (resist_petri > 0) then X resist_petri := resist_petri - 1; X `7B Timed Stealth `7D X if (temp_stealth > 0) then X begin X if (uand(%X'20000000',status) = 0) then X begin X status := uor(%X'20000000',status); X py.misc.stl := py.misc.stl + 3; X end; X temp_stealth := temp_stealth - 1; X if (temp_stealth = 0) then X begin X status := uand(%X'DFFFFFFF',status); X py.misc.stl := py.misc.stl - 3; X msg_print('The monsters can once again detect you with e Vase.') X end; X end; X `7B Resist Charm `7D X If (free_time > 0) then X begin X If (uand(%X'00800000',status)=0) then X begin X status := uor(%X'00800000',status); X free_time := free_time - 1; X If (free_time = 0) then X begin X status := uand(%X'FF7FFFFF',status); X If (find_flag) then X`09`09 move_char(5); X end; X end; X end; X`09`7B Hoarse`09`09`7D X`09 if (hoarse > 0) then X`09 begin X`09 hoarse := hoarse - 1; X`09`09if (hoarse = 0) then X`09`09 msg_print('You feel your voice returning.'); X`09 end; X`09`7B Afraid `7D X`09 if (afraid > 0) then X`09 begin X`09`09if (uand(%X'00000010',status) = 0) then X`09`09 begin X`09`09 if ((shero+hero) > 0) then X`09`09 afraid := 0 X`09`09 else X`09`09 begin X`09`09`09status := uor(%X'00000010',status); X`09`09`09prt_afraid; X`09`09 end; X`09`09 end X`09`09else if ((shero+hero) > 0) then X`09`09 afraid := 1; X`09`09afraid := afraid - 1; X`09`09if (afraid = 0) then X`09`09 begin X`09`09 status := uand(%X'FFFFFFEF',status); X`09`09 prt_afraid; X`09`09 msg_print('You feel bolder now.'); X`09`09 if (find_flag) then X`09`09 move_char(5); X`09`09 end; X`09 end; X`09`7B Poisoned `7D X`09 if (poisoned > 0) then X`09 begin X`09`09if (uand(%X'00000020',status) = 0) then X`09`09 begin X`09`09 status := uor(%X'00000020',status); X`09`09 prt_poisoned; X`09`09 end; X`09`09poisoned := poisoned - 1; X`09`09if (poisoned = 0) then X`09`09 begin X`09`09 status := uand(%X'FFFFFFDF',status); X`09`09 prt_poisoned; X`09`09 msg_print('You feel better.'); X`09`09 if (find_flag) then X`09`09 move_char(5); X`09`09 end X`09`09else X`09`09 begin X`09`09 case con_adj of X`09`09`09-4 : take_hit(4,'poison.'); X`09`09`09-3,-2 : take_hit(3,'poison.'); X`09`09`09-1 : take_hit(2,'poison.'); X`09`09`090 : take_hit(1,'poison.'); X`09`09`091,2,3 : if ((turn mod 2) = 0) then X`09`09`09`09 take_hit(1,'poison.'); X`09`09`094,5 : if ((turn mod 3) = 0) then X`09`09`09`09 take_hit(1,'poison.'); X`09`09`096 : if ((turn mod 4) = 0) then X`09`09`09`09 take_hit(1,'poison.'); X`09`09 end; X`09`09 end; X`09 end; X`09`7B Fast `7D X`09 if (fast > 0) then X`09 begin X`09`09if (uand(%X'00000040',status) = 0) then X`09`09 begin X`09`09 status := uor(%X'00000040',status); X`09`09 msg_print('You feel yourself moving faster.'); X`09`09 change_speed(-1); X`09`09 if (find_flag) then X`09`09 move_char(5); X`09`09 end; X`09`09fast := fast - 1; X`09`09if (fast = 0) then X`09`09 begin X`09`09 status := uand(%X'FFFFFFBF',status); X`09`09 msg_print('You feel yourself slow down.'); X`09`09 change_speed(+1); X`09`09 if (find_flag) then X`09`09 move_char(5); X`09`09 end; X`09 end; X`09`7B Slow `7D X`09 if (slow > 0) then X`09 begin X`09`09if (uand(%X'00000080',status) = 0) then X`09`09 begin X`09`09 status := uor(%X'00000080',status); X`09`09 msg_print('You feel yourself moving slower.'); X`09`09 change_speed(+1); X`09`09 if (find_flag) then X`09`09 move_char(5); X`09`09 end; X`09`09slow := slow - 1; X`09`09if (slow = 0) then X`09`09 begin X`09`09 status := uand(%X'FFFFFF7F',status); X`09`09 msg_print('You feel yourself speed up.'); X`09`09 change_speed(-1); X`09`09 if (find_flag) then X`09`09 move_char(5); X`09`09 end; X`09 end; X`09`7B Resting is over? `7D X`09 if (rest > 0) then X`09 begin X`09`09 `7B Hibernate every 20 iterations so that process does `7D X`09`09 `7B not eat up system... `7D X`09`09 `7B NOTE: Remove comments for VMS version 4.0 or greater`7D X`09`09 `7B INKEY_DELAY takes care of hibernation for `7D X`09`09 `7B VMS 3.7 or less `7D X`09`09if ((rest mod 20) = 1) then X`09`09 begin X`09`09 sleep(1); X if (uand(equipment`5Bequipment_primary`5D.flags2,soul_sword_worn_bit) <> V 0) X`09`09 then X`09`09 begin X`09`09 bother(randint(10)); X`09`09 rest := 1 X`09`09 end; X`09`09 end; X`09`09rest := rest - 1; X`09`09 `7B Test for any key being hit to abort rest. Also, `7D X`09`09 `7B this will do a PUT_QIO which updates the screen... `7D X`09`09 `7B One more side benifit; since inkey_delay hibernates `7D X`09`09 `7B small amount before executing, this makes resting `7D X`09`09 `7B less CPU intensive... `7D X`09`09inkey_delay(command,0); X`09`09if (want_trap) then dump_ast_mess; X`09`09if (rest = 0) then `7B Resting over `7D X`09`09 rest_off X`09`09else if (command <> null) then `7B Resting aborted `7D X`09`09 rest_off X`09 end; X`09`7B Hallucinating? (Random characters appear!)`7D X`09 if (image > 0) then X`09 begin X`09`09image := image - 1; X`09`09if (image = 0) then X`09`09 draw_cave; X`09 end; X`7B`09if (speed > 0) and (paral_init = speed_paral) then X`09 paralysis := paralysis + paral_init + 1; X`7D`09`7B Paralysis `7D X`09 if (paralysis > 0) then X`09 begin X`09`09paralysis := paralysis - 1; X`09`09if (rest > 0) then X`09`09 rest_off; X`09`09if (search_flag) and (paralysis > paral_init) then X`09`09 search_off; X`09 end; X`09`7B`09if (speed > 0) and (speed_flag) then X`09`09 begin X`09`09 speed_flag := false; X`09`09 speed_paral := paral_init; X`09`09 end X`09`09else if (speed_paral > 1) then X`09`09 speed_paral := speed_paral - 1 X`09`09else X`09`09 begin X`09`09 speed_paral := 0; X`09`09 speed_flag := true; X`09`09 end;`7D X`09`7B Protection from evil counter`7D X`09 if (protevil > 0) then protevil := protevil - 1; X`09`7B Inulnerability `7D X`09 if (invuln > 0) then X`09 begin X`09`09if (uand(%X'00001000',status) = 0) then X`09`09 begin X`09`09 status := uor(%X'00001000',status); X`09`09 if (find_flag) then X`09`09 move_char(5); X`09`09 msg_print('Your skin turns into steel!'); X`09`09 py.misc.pac := py.misc.pac + 100; X`09`09 py.misc.dis_ac := py.misc.dis_ac + 100; X`09`09 prt_pac; X`09`09 end; X`09`09invuln := invuln - 1; X`09`09if (invuln = 0) then X`09`09 begin X`09`09 status := uand(%X'FFFFEFFF',status); X`09`09 if (find_flag) then X`09`09 move_char(5); X`09`09 msg_print('Your skin returns to normal...'); X`09`09 py.misc.pac := py.misc.pac - 100; X`09`09 py.misc.dis_ac := py.misc.dis_ac - 100; X`09`09 prt_pac; X`09`09 end; X`09 end; X`09`7B Heroism `7D X`09 if (hero > 0) then X`09 begin X`09`09if (uand(%X'00002000',status) = 0) then X`09`09 begin X`09`09 status := uor(%X'00002000',status); X`09`09 if (find_flag) then X`09`09 move_char(5); X`09`09 with py.misc do X`09`09 begin X`09`09`09mhp := mhp + 10; X`09`09`09chp := chp + 10; X`09`09`09bth := bth + 12; X`09`09`09bthb:= bthb+ 12; X`09`09 end; X`09`09 msg_print('You feel like a HERO!'); X`09`09 prt_hp; X`09`09 end; X`09`09hero := hero - 1; X`09`09if (hero = 0) then X`09`09 begin X`09`09 status := uand(%X'FFFFDFFF',status); X`09`09 if (find_flag) then X`09`09 move_char(5); X`09`09 with py.misc do X`09`09 begin X`09`09`09mhp := mhp - 10; X`09`09`09if (chp > mhp) then chp := mhp; X`09`09`09bth := bth - 12; X`09`09`09bthb:= bthb- 12; X`09`09 end; X`09`09 msg_print('The heroism wears off.'); X`09`09 prt_hp; X`09`09 end; X`09 end; X`09`7B Super Heroism `7D X`09 if (shero > 0) then X`09 begin X`09`09if (uand(%X'00004000',status) = 0) then X`09`09 begin X`09`09 status := uor(%X'00004000',status); X`09`09 if (find_flag) then X`09`09 move_char(5); X`09`09 with py.misc do X`09`09 begin X`09`09`09mhp := mhp + 20; X`09`09`09chp := chp + 20; X`09`09`09bth := bth + 24; X`09`09`09bthb:= bthb+ 24; X`09`09 end; X`09`09 msg_print('You feel like a SUPER HERO!'); X`09`09 prt_hp; X`09`09 end; X`09`09shero := shero - 1; X`09`09if (shero = 0) then X`09`09 begin X`09`09 status := uand(%X'FFFFBFFF',status); X`09`09 if (find_flag) then X`09`09 move_char(5); X`09`09 with py.misc do X`09`09 begin X`09`09`09mhp := mhp - 20; X`09`09`09if (chp > mhp) then chp := mhp; X`09`09`09bth := bth - 24; X`09`09`09bthb:= bthb- 24; X`09`09 end; X`09`09 msg_print('The super heroism wears off.'); X`09`09 prt_hp; X`09`09 end; X`09 end; X`09`7B Blessed `7D X`09 if (blessed > 0) then X`09 begin X`09`09if (uand(%X'00008000',status) = 0) then X`09`09 begin X`09`09 status := uor(%X'00008000',status); X`09`09 if (find_flag) then X`09`09 move_char(5); X`09`09 with py.misc do X`09`09 begin X`09`09`09bth := bth + 5; X`09`09`09bthb:= bthb+ 5; X`09`09`09pac := pac + 5; X`09`09`09dis_ac := dis_ac + 5; X`09`09 end; X`09`09 msg_print('You feel righteous!'); X`09`09 prt_hp; X`09`09 prt_pac; X`09`09 end; X`09`09blessed := blessed - 1; X`09`09if (blessed = 0) then X`09`09 begin X`09`09 status := uand(%X'FFFF7FFF',status); X`09`09 if (find_flag) then X`09`09 move_char(5); X`09`09 with py.misc do X`09`09 begin X`09`09`09bth := bth - 5; X`09`09`09bthb:= bthb- 5; X`09`09`09pac := pac - 5; X`09`09`09dis_ac := dis_ac - 5; X`09`09 end; X`09`09 msg_print('The prayer has expired.'); X`09`09 prt_hp; X`09`09 prt_pac; X`09`09 end; X`09 end; X`09`7B Resist Heat `7D X`09 if (resist_heat > 0) then resist_heat := resist_heat - 1; X`09`7B Resist Cold `7D X`09 if (resist_cold > 0) then resist_cold := resist_cold - 1; X`09`7B Detect Invisible `7D X`09 if (detect_inv > 0) then X`09 begin X`09`09if (uand(%X'00010000',status) = 0) then X`09`09 begin X`09`09 status := uor(%X'00010000',status); X`09`09 see_inv := true; X`09`09 end; X`09`09detect_inv := detect_inv - 1; X`09`09if (detect_inv = 0) then X`09`09 begin X`09`09 status := uand(%X'FFFEFFFF',status); X`09`09 see_inv := false; X`09`09 py_bonuses(blank_treasure,0); X`09`09 end; X`09 end; X`09`7B Timed infra-vision `7D X`09 if (tim_infra > 0) then X`09 begin X`09`09if (uand(%X'00020000',status) = 0) then X`09`09 begin X`09`09 status := uor(%X'00020000',status); X`09`09 see_infra := see_infra + 1; X`09`09 end; X`09`09tim_infra := tim_infra - 1; X`09`09if (tim_infra = 0) then X`09`09 begin X`09`09 status := uand(%X'FFFDFFFF',status); X`09`09 see_infra := see_infra - 1; X`09`09 msg_print('Your eyes stop tingling.'); X`09`09 end; X`09 end; X`09`7B Word-of-Recall Note: Word-of-Recall is a delayed action `7D X`09 if (word_recall > 0) then X`09 if (word_recall = 1) then X`09`09begin X`09`09 if (dun_level > 0) then X`09`09 begin X`09`09 msg_print('You feel yourself yanked upwards!'); X`09`09 dun_level := 0; X`09`09 end X`09`09 else if (py.misc.max_lev > 0) then X`09`09 begin X`09`09 msg_print('You feel yourself yanked downwards!'); X`09`09 dun_level := py.misc.max_lev; X`09`09 end; X`09`09 moria_flag := true; X`09`09 paralysis := paralysis + 1; X`09`09 word_recall := 0; X`09`09end X`09 else X`09`09word_recall := word_recall - 1; X X`09`7B Check hit points for adjusting...`09`09`09`7D X`09 with py.misc do X`09`09if (not(find_flag)) then X`09`09 if (py.flags.rest < 1) then X`09`09 begin X`09`09 if (old_chp <> trunc(chp)) then X`09`09`09begin X`09`09`09 if (chp > mhp) then chp := mhp; +-+-+-+-+-+-+-+- END OF PART 24 +-+-+-+-+-+-+-+-