-+-+-+-+-+-+-+-+ START OF PART 46 -+-+-+-+-+-+-+-+ X inventory`5Binven_max`5D := inventory`5Bitem_val`5D; X with inventory`5Binven_max`5D do X number := number - 1; X objdes(out_val,inven_max,true); X out_val := 'You have ' + substr(out_val,1,(length(out_val)-1)) + '. V '; X msg_print(out_val); X END; X`20 X`20 X`7B Throw an object across the dungeon. X Note: Flasks of oil do fire damage X Note: Extra damage and chance of hitting when missles are used X with correct weapon. I.E. wield bow and throw arrow.`7D X procedure throw_object; X var X item_val,tbth,tpth,tdam,tdis: integer; X y_dumy,x_dumy,dumy : integer; X y,x,oldy,oldx,dir,cur_dis: integer; X redraw,flag : boolean; X out_val: vtype; X`20 X procedure inven_throw(item_val : integer); X BEGIN X inventory`5Binven_max`5D := inventory`5Bitem_val`5D; X inventory`5Binven_max`5D.number := 1; X with inventory`5Bitem_val`5D do X BEGIN X if ((number > 1) and (subval > 511)) then X BEGIN X number := number - 1; X inven_weight := inven_weight - weight; X END X else X inven_destroy(item_val); X prt_cur_weight; X END; X END; X`20 X procedure facts(var tbth,tpth,tdam,tdis : integer); X var X tmp_weight : integer; X BEGIN X with inventory`5Binven_max`5D do X BEGIN X if (weight < 1) then X tmp_weight := 1 X else X tmp_weight := weight; X`20 X`7B Throwing objects `7D X tdam := damroll(damage) + todam; X tbth := trunc(py.misc.bthb*0.75); X tpth := py.misc.ptohit + tohit; X tdis := trunc(((py.stat.cstr+20)*10)/tmp_weight); X if (tdis > 10) then tdis := 10; X`20 X`7B Using Bows, slings, or crossbows `7D X if (inventory`5B23`5D.tval = 20) then X CASE inventory`5B23`5D.p1 of X 1 : if (tval = 10) then `7B Sling and Bullet `7D X BEGIN X tbth := py.misc.bthb; X tpth := tpth + inventory`5B23`5D.tohit; X tdam := tdam + 2; X tdis := 20; X END; X 2 : if (tval = 12) then `7B Short Bow and Arrow `7D X BEGIN X tbth := py.misc.bthb; X tpth := tpth + inventory`5B23`5D.tohit; X tdam := tdam + 2; X tdis := 25; X END; X 3 : if (tval = 12) then `7B Long Bow and Arrow `7D X BEGIN X tbth := py.misc.bthb; X tpth := tpth + inventory`5B23`5D.tohit; X tdam := tdam + 3; X tdis := 30; X END; X 4 : if (tval = 12) then `7B Composite Bow and Arrow`7D X BEGIN X tbth := py.misc.bthb; X tpth := tpth + inventory`5B23`5D.tohit; X tdam := tdam + 4; X tdis := 35; X END; X 5 : if (tval = 11) then `7B Light Crossbow and Bolt`7D X BEGIN X tbth := py.misc.bthb; X tpth := tpth + inventory`5B23`5D.tohit; X tdam := tdam + 2; X tdis := 25; X END; X 6 : if (tval = 11) then `7B Heavy Crossbow and Bolt`7D X BEGIN X tbth := py.misc.bthb; X tpth := tpth + inventory`5B23`5D.tohit; X tdam := tdam + 4; X tdis := 35; X END; X END X END; X END; X`20 X procedure drop_throw(y,x : integer); X var X i1,i2,i3,cur_pos : integer; X flag : boolean; X out_val : vtype; X BEGIN X flag := false; X i1 := y; X i2 := x; X i3 := 0; X if (randint(10) > 1) then X repeat X if (in_bounds(i1,i2)) then X with cave`5Bi1,i2`5D do X if (fopen) then X if (tptr = 0) then X flag := true; X if (not(flag)) then X BEGIN X i1 := y + randint(3) - 2; X i2 := x + randint(3) - 2; X i3 := i3 + 1; X END; X until((flag) or (i3 > 9)); X if (flag) then X BEGIN X popt(cur_pos); X cave`5Bi1,i2`5D.tptr := cur_pos; X t_list`5Bcur_pos`5D := inventory`5Binven_max`5D; X if (test_light(i1,i2)) then X lite_spot(i1,i2); X END X else X BEGIN X objdes(out_val,inven_max,false); X msg_print('The ' + out_val + ' dissapears.'); X END; X END; X`20 X BEGIN X redraw := false; X if (inven_ctr = 0) then X msg_print('But you are not carrying anything.') X else if (get_item(item_val,'Fire/Throw which one?', X redraw,1,inven_ctr)) then X BEGIN X if (redraw) then X draw_cave; X y_dumy := char_row; X x_dumy := char_col; X if (get_dir('Which direction?',dir,dumy,y_dumy,x_dumy)) then X BEGIN X desc_remain(item_val); X if (py.flags.confused > 0) then X BEGIN X msg_print('You are confused...'); X repeat X dir := randint(9); X until(dir <> 5); X END; X inven_throw(item_val); X facts(tbth,tpth,tdam,tdis); X with inventory`5Binven_max`5D do X BEGIN X flag := false; X y := char_row; X x := char_col; X oldy := char_row; X oldx := char_col; X cur_dis := 0; X repeat X move(dir,y,x); X cur_dis := cur_dis + 1; X if (test_light(oldy,oldx)) then X lite_spot(oldy,oldx); X if (cur_dis > tdis) then flag := true; X with cave`5By,x`5D do X BEGIN X if ((fopen) and (not(flag))) then X BEGIN X if (cptr > 1) then X BEGIN X flag := true; X with m_list`5Bcptr`5D do X BEGIN X tbth := tbth - cur_dis; X if (test_hit(tbth,py.misc.lev,tpth, X c_list`5Bmptr`5D.ac) V) then X BEGIN X i1 := mptr; X objdes(out_val,inven_max,false); X msg_print('The ' + out_val + ' hits the ' + c_list`5Bi1`5D.name + '. V '); X tdam := tot_dam(inventory`5Binven_max`5D,tdam,c_list`5Bi1`5D); X with inventory`5Binven_max`5D do X tdam := critical_blow(weight,tpth,tdam); X i1 := mon_take_hit(cptr,tdam); X if (i1 > 0) then X msg_print('You have killed the ' + c_list`5Bi1`5D.name + '. '); X END X else X drop_throw(oldy,oldx); X END; X END X else X BEGIN X if (panel_contains(y,x)) then X if (test_light(y,x)) then X print(tchar,y,x); X END; X END X else X BEGIN X flag := true; X drop_throw(oldy,oldx); X END; X END; X oldy := y; X oldx := x; X until (flag); X END; X END X END X else X if (redraw) then X draw_cave; X END; X`20 X`20 X`7B Bash open a door or chest X Note: Affected by strength and weight of character `7D X procedure bash; X var X y,x,tmp: integer; X old_ptodam,old_ptohit,old_bth : integer; X BEGIN X y := char_row; X x := char_col; X if (get_dir('Which direction?',tmp,tmp,y,x)) then X BEGIN X with cave`5By,x`5D do X if (cptr > 1) then X BEGIN X if (py.flags.afraid > 0) then X msg_print('You are afraid!') X else X BEGIN X`7B Save old values of attacking`7D X inventory`5Binven_max`5D := inventory`5B23`5D; X old_ptohit := py.misc.ptohit; X old_ptodam := py.misc.ptodam; X old_bth := py.misc.bth; X`7B Use these values `7D X inventory`5B23`5D := blank_treasure; X with inventory`5B23`5D do X BEGIN X damage := inventory`5B27`5D.damage; X weight := py.stat.cstr; X tval:= 1; X END; X with py do X BEGIN X misc.bth := trunc((stat.cstr+misc.wt)/6.0); X misc.ptohit := 0; X misc.ptodam := trunc(misc.wt/75.0) + 1; X END; X if (py_attack(y,x)) then X with m_list`5Bcptr`5D do X BEGIN X stuned := randint(2) + 1; X if (stuned > 24) then stuned := 24; X msg_print('The ' + c_list`5Bmptr`5D.name X + ' appears stunned!'); X END; X`7B Restore old values `7D X inventory`5B23`5D := inventory`5Binven_max`5D; X py.misc.ptohit := old_ptohit; X py.misc.ptodam := old_ptodam; X py.misc.bth := old_bth; X if (randint(140) > py.stat.cdex) then X BEGIN X msg_print('You are off-balance.'); X py.flags.paralysis := randint(3); X END; X END; X END X else if (tptr > 0) then X with t_list`5Btptr`5D do X if (tval = 105) then X BEGIN X msg_print('You smash into the door!'); X with py do X if (test_hit(misc.wt+stat.cstr,0,0,abs(p1)+150)) the Vn X BEGIN X msg_print('The door crashes open!'); X t_list`5Btptr`5D := door_list`5B1`5D; X p1 := 1; X fopen := true; X lite_spot(y,x); X END X else X BEGIN X msg_print('The door holds firm.'); X py.flags.paralysis := 2; X END; X END X else if (tval = 2) then X BEGIN X if (randint(10) = 1) then X BEGIN X msg_print('You have destroyed the chest...'); X msg_print('and it''s contents!'); X name := '& ruined chest'; X flags := 0; X END X else if (uand(%X'00000001',flags) <> 0) then X if (randint(10) = 1) then X BEGIN X msg_print('The lock breaks open!'); X flags := uand(%X'FFFFFFFE',flags); X END; X END X else X msg_print('I do not see anything you can bash there.') X else X msg_print('I do not see anything you can bash there.'); X END; X END; X`20 X`20 X`7B Jam a closed door `7D X procedure jamdoor; X var X y,x,tmp: integer; X BEGIN X y := char_row; X x := char_col; X if (get_dir('Which direction?',tmp,tmp,y,x)) then X BEGIN X with cave`5By,x`5D do X if (tptr > 0) then X with t_list`5Btptr`5D do X if (tval = 105) then X if (cptr = 0) then X BEGIN X if (find_range(`5B13`5D,i1,i2)) then X BEGIN X msg_print('You jam the door with a spike.'); X with inventory`5Bi1`5D do X if (number > 1) then X number := number - 1 X else X inven_destroy(i1); X p1 := -abs(p1) - 20; X END X else X msg_print('But you have no spikes...'); X END X else +-+-+-+-+-+-+-+- END OF PART 46 +-+-+-+-+-+-+-+-