-+-+-+-+-+-+-+-+ START OF PART 44 -+-+-+-+-+-+-+-+ X END; X`20 X`20 X`7B Burn the fool up.`7D X procedure fire_dam(dam : integer; kb_str : vtype); X BEGIN X if (py.flags.fire_resist)then X dam := trunc(dam*0.5); X if (py.flags.resist_heat > 0) then X dam := trunc(dam*0.5); X take_hit(dam,kb_str); X print_stat := uor(%X'0080',print_stat); X if (inven_damage(`5B12,20,21,22,30,31,32,36,55,70,71`5D,3) > 0) then X msg_print('There is smoke coming from your pack!'); X END; X`20 X`20 X`7B Freeze him to death.`7D X procedure cold_dam(dam : integer; kb_str : vtype); X BEGIN X if (py.flags.cold_resist)then X dam := trunc(dam*0.5); X if (py.flags.resist_cold > 0) then X dam := trunc(dam*0.5); X take_hit(dam,kb_str); X print_stat := uor(%X'0080',print_stat); X if (inven_damage(`5B75,76`5D,5) > 0) then X msg_print('Something shatters inside your pack!'); X END; X`20 X`20 X`7B Lightning bolt the sucker away.`7D X procedure light_dam(dam : integer; kb_str : vtype); X BEGIN X if (py.flags.lght_resist) then X take_hit(trunc(dam*0.5),kb_str) X else X take_hit(dam,kb_str); X print_stat := uor(%X'0080',print_stat); X END; X`20 X`20 X`7B Throw acid on the hapless victim `7D X procedure acid_dam(dam : integer; kb_str : vtype); X var X flag: integer; X BEGIN X flag := 0; X if (minus_ac(%X'00100000')) then X flag := 1; X if (py.flags.acid_resist) then X flag := flag + 2; X CASE flag of X 0 : take_hit(dam,kb_str); X 1 : take_hit(trunc(dam*0.75),kb_str); X 2 : take_hit(trunc(dam*0.5),kb_str); X 3 : take_hit(trunc(dam*0.25),kb_str); X END; X print_stat := uor(%X'00C0',print_stat); X if (inven_damage(`5B1,2,11,12,20,21,22,30,31,32,36`5D,3) > 0) then X msg_print('There is an acrid smell coming from your pack!'); X END; X`20 X`20 X`7B Teleport the player to a new location `7D X procedure teleport(dis : integer); X var X y,x : integer; X BEGIN X repeat X y := randint(cur_height); X x := randint(cur_width); X while (distance(y,x,char_row,char_col) > dis) do X BEGIN X y := y + trunc((char_row-y)/2); X x := x + trunc((char_col-x)/2); X END; X until ((cave`5By,x`5D.fopen) and (cave`5By,x`5D.cptr < 2)); X move_rec(char_row,char_col,y,x); X for i1 := char_row-1 to char_row+1 do X for i2 := char_col-1 to char_col+1 do X with cave`5Bi1,i2`5D do X BEGIN X tl := false; X if (not(test_light(i1,i2))) then X unlite_spot(i1,i2); X END; X if (test_light(char_row,char_col)) then X lite_spot(char_row,char_col); X char_row := y; X char_col := x; X move_char(5); X creatures(false); X teleport_flag := false; X END; X`20 X`20 X`7B Player hit a trap... (Chuckle)`7D X procedure hit_trap(var y,x : integer); X var X alloc_level,i1,i2,ty,tx,dam : integer; X`20 X BEGIN X change_trap(y,x); X lite_spot(char_row,char_col); X find_flag := false; X with cave`5By,x`5D do X with py.misc do X BEGIN X dam := damroll(t_list`5Btptr`5D.damage); X CASE t_list`5Btptr`5D.subval of X`7B Open pit`7D 1 : BEGIN X msg_print('You fell into a pit!'); X if (py.flags.ffall) then X msg_print('You gently float down.') X else X take_hit(dam,'an open pit.'); X END; X`7B Arrow trap`7D 2 : BEGIN X if (test_hit(125,0,0,pac+ptoac)) then X BEGIN X take_hit(dam,'an arrow trap.'); X msg_print('An arrow hits you.'); X END X else X msg_print('An arrow barely misses you.'); X END; X`7B Covered pit`7D3 : BEGIN X msg_print('You fell into a covered pit.'); X if (py.flags.ffall) then X msg_print('You gently float down.') X else X take_hit(dam,'a covered pit.'); X place_trap(y,x,2,1); X END; X`7B Trap door`7D 4 : BEGIN X msg_print('You fell through a trap door!'); X msg_print(' '); X moria_flag := true; X dun_level := dun_level + 1; X if (dun_level > townlist`5Btown_num`5D.max_depth) X`09`09 then dun_level := townlist`5Btown_num`5D.max_depth; X if (py.flags.ffall) then X msg_print('You gently float down.') X else X take_hit(dam,'a trap door.'); X END; X`7B Sleep gas`7D 5 : if (py.flags.paralysis = 0) then X BEGIN X msg_print('A strange white mist surrounds you!'); X if (py.flags.free_act) then X msg_print('You are unaffected.') X else X BEGIN X msg_print('You fall asleep.'); X py.flags.paralysis := py.flags.paralysis + X randint(10) + 4; X END X END; X`7B Hid Obj`7D 6 : BEGIN X fm := false; X pusht(tptr); X place_object(y,x); X msg_print('Hey, there was something under this rock.'); X END; X `7B STR Dart`7D 7 : BEGIN X if (test_hit(125,0,0,pac+ptoac)) then X BEGIN X if (not py.flags.sustain_str) then X BEGIN X py.stat.cstr := de_statp(py.stat.cstr); X take_hit(dam,'a dart trap.'); X print_stat := uor(%X'0001',print_stat); X msg_print('A small dart weakens you!'); X END X else X msg_print('A small dart hits you.'); X END X else X msg_print('A small dart barely misses you.'); X END; X`7B Teleport`7D 8 : BEGIN X teleport_flag := true; X msg_print('You hit a teleport trap!'); X END; X`7B Rockfall`7D 9 : BEGIN X take_hit(dam,'falling rock.'); X pusht(tptr); X place_rubble(y,x); X msg_print('You are hit by falling rock'); X END; X`7B Corrode gas`7D10: BEGIN X corrode_gas('corrosion gas.'); X msg_print('A strange red gas surrounds you.'); X END; X`7B Summon mon`7D 11: BEGIN X fm := false; `7B Rune disappears...`7D X pusht(tptr); X tptr := 0; X for i1 := 1 to (2+randint(3)) do X BEGIN X ty := char_row; X tx := char_col; X summon_monster(ty,tx,false); X END; X END; X`7B Fire trap`7D 12: BEGIN X`09`09 explosion(5,char_row,char_col,dam,2,true,'a fire trap.'); X msg_print('You are enveloped in flames!'); X END; X`7B Acid trap`7D 13: BEGIN X`09`09 explosion(3,char_row,char_col,dam,2,true,'an acid trap.'); X msg_print('You are splashed with acid!'); X END; X`7B Poison gas`7D 14: BEGIN X`09 explosion(2,char_row,char_col,dam,2,true,'a poison gas trap.'); X msg_print('A pungent green gas surrounds you!'); X Opusii_vomit(5); X END; X`7B Blind Gas `7D 15: BEGIN X msg_print('A black gas surrounds you!'); X with py.flags do X blind := blind + randint(50) + 50; X END; X`7B H-Bomb `7D 16: begin X`09`09 explosion(0,char_row,char_col,dam,5,true,'a bomb.'); X msg_print('You have set off a bomb!'); X with py.flags do X begin X blind := 1 + randint(10); X confused := 5 + randint(10); X end X end; X`7B Slow Dart`7D 17: BEGIN X if (test_hit(125,0,0,pac+ptoac)) then X BEGIN X take_hit(dam,'a dart trap.'); X msg_print('A small dart hits you!'); X with py.flags do X slow := slow + randint(20) + 10; X END X else X msg_print('A small dart barely misses you.'); X END; X`7B CON Dart`7D 18: BEGIN X if (test_hit(125,0,0,pac+ptoac)) then X BEGIN X if (not py.flags.sustain_con) then X BEGIN X py.stat.ccon := de_statp(py.stat.ccon); X take_hit(dam,'a dart trap.'); X print_stat := uor(%X'0004',print_stat); X msg_print('A small dart weakens you!'); X END X else X msg_print('A small dart hits you.'); X END X else X msg_print('A small dart barely misses you.'); X END; X`20 X`7BSecret Door`7D 19: ; X`20 X`7BTeleport levels`7D20: begin X msg_print('You have a strange feeling...'); X msg_print('You slip into unconsciousness...'); X py.flags.paralysis := py.flags.paralysis+4+randint(4) V; X msg_print('You wake up confused.'); X py.flags.confused := py.flags.confused+10+randint(20) V; X case randint(6) of X 1: dun_level := dun_level + 5; X 2,3: dun_level := dun_level + 2; X 4,5: dun_level := dun_level - 2; X 6: dun_level := dun_level - 5; X end; X if (dun_level<0) then dun_level := 0; X if (dun_level>townlist`5Btown_num`5D.max_depth) then X`09`09 dun_level := townlist`5Btown_num`5D.max_depth; X moria_flag := true; X end; X`20 X`20 X`20 X`7BScare Mon`7D 99: ; X`20 X`20 X`7BTown level traps are special, the stores.`7D X`7BK-Mart `7D 101: enter_store(1); X`7BLeather `7D 102: enter_store(2); X`7BWeapons `7D 103: enter_store(3); X`7BTemple `7D 104: enter_store(4); X`7BDrug Store`7D 105: enter_store(5); X`7BCurio Store`7D 106: enter_store(6); X`7BBlack Market`7D 107: enter_store(7); X`7BCafeteria`7D 108: enter_store(8); X`7BPro Shop `7D 109: enter_store(9); X`7BComputer `7D 110: enter_store(10); X`7BGuild`7D 111: enter_store(11); X`7BBuilding`7D 112: begin X`09`09 office_char_row := char_row; X`09`09 office_char_col := char_col; X`09`09 exited_office := true; X`09`09 dun_level := -1; X`09`09 moria_flag := true; X`09 msg_print('You climb the front steps and enter a large lobby.'); X`09`09 end; X`7BHotel Desk`7D 201: enter_inn; X`7BBank Teller`7D`09202: enter_bank; X`7BHealth Clinic`7D 203: enter_clinic; X`7BLotto`7D`09`09204: newsinc; X otherwise msg_print('You see a ''Space for Rent'' sign.') V; X END X END X END; X`20 X`20 X`7B Return skill number and failure chance `7D X function use_skill( prompt : vtype; X item_val : integer; X var sn,sc : integer; X var redraw : boolean) : boolean; X VAR X i1,i3 : integer; X spell : spl_type; X BEGIN X i1 := 0; X `7B Check skill book for any known skills. ac-toac is a kludge -RLG` V7D X for i3 := inventory`5Bitem_val`5D.ac to inventory`5Bitem_val`5D.toac d Vo X begin X with skill_list`5Bi3`5D do X if (slevel <= py.misc.lev) then X if (learned) then X begin X i1 := i1 + 1; X spell`5Bi1`5D.splnum := i3; X end; X end; X if (i1 > 0) then X use_skill := get_skill(spell,i1,sn,sc,prompt,redraw); X if (redraw) then X draw_cave; X END; X`20 X`20 X`7B Examine a Book `7D X procedure examine_book; X var X i1,i3,item_val : integer; X redraw`09 : boolean; X dummy`09 : char; X out_val`09 : vtype; X BEGIN X redraw := false; X if (not(find_range(`5B90,91,92`5D,i1,i3))) then X msg_print('You are not carrying any books.') X else if (get_item(item_val,'Browse which book?',redraw,i1,i3)) then X BEGIN X with inventory`5Bitem_val`5D do X`09 BEGIN X if ((not (py.misc.pskill in `5B1,2,7`5D) ) and (tval = 90)) then X msg_print('You can''t read technical books.') X else if ((not (py.misc.pskill in `5B3,4`5D) ) and (tval = 91)) t Vhen X`09 msg_print('The words in this book boggle your mind.') X`09 else if ((not (py.misc.pskill in `5B5,6`5D) ) and (tval=92)) then X msg_print('The slang in this book confounds you.') X`09 else X Begin X redraw := true; X i1 := 0; X clear(1,1); X writev(out_val,' Name Level Rsrc Known' V); X prt(out_val,1,1); +-+-+-+-+-+-+-+- END OF PART 44 +-+-+-+-+-+-+-+-