-+-+-+-+-+-+-+-+ START OF PART 48 -+-+-+-+-+-+-+-+ X flag := true; X CASE fval of X 10 : msg_print('You see a granite wall.'); X 11 : msg_print('You see some dark rock.'); X 12 : msg_print('You see a quartz vein.'); X 15 : msg_print('You see a granite wall.'); X otherwise ; X END; X END; X END; X END; X i1 := i1 + 1; X until ((not cave`5By,x`5D.fopen) or (i1 > max_sight)); X if (not flag) then X msg_print('You see nothing of interest in that direction.'); X END X else X msg_print('You can''t see a damn thing!'); X END; X`20 X`20 X`7B Add to the players food time `7D X procedure add_food(num : integer); X BEGIN X with py.flags do X BEGIN X if (food < 0) then food := 0; X food := food + num; X if (food > player_food_full) then msg_print('You are full.'); X if (food > player_food_max) then X BEGIN X msg_print('You''re getting fat from eating so much.'); X food := player_food_max X END X END X END; X`20 X`20 X`7B Describe number of remaining charges.`7D X procedure desc_charges(item_val : integer); X var X rem_num : integer; X out_val : vtype; X BEGIN X if (index(inventory`5Bitem_val`5D.name,'`5E') = 0) then X BEGIN X rem_num := inventory`5Bitem_val`5D.p1; X writev(out_val,'You have ',rem_num:1,' charges remaining.'); X msg_print(out_val) X END X END; X`20 X`20 X`7B Describe amount of item remaining.`7D X procedure desc_remain(item_val : integer); X var X out_val : vtype; X BEGIN X temporary_slot := inventory`5Bitem_val`5D; X with temporary_slot do X number := number - 1; X objdes(out_val,1,true,'t'); X out_val := 'You have ' + substr(out_val,1,(length(out_val)-1)) + '. V '; X msg_print(out_val); X END; X`20 X`7B General spells and misc routines `7D X %INCLUDE 'BOSS_INCLUDE:SKILLS.INC' X %INCLUDE 'BOSS_INCLUDE:WIERD.INC' X`7B Wizard and debug routines `7D X %INCLUDE 'BOSS_INCLUDE:WIZARD.INC' X`7B Creature movement and attacks using objects `7D X %INCLUDE 'BOSS_INCLUDE:CREATURE.INC' X %INCLUDE 'BOSS_INCLUDE:FLOPPY.INC' X %INCLUDE 'BOSS_INCLUDE:POTIONS.INC' X %INCLUDE 'BOSS_INCLUDE:EAT.INC' X %INCLUDE 'BOSS_INCLUDE:RAYGUN.INC' X %INCLUDE 'BOSS_INCLUDE:DEVICE.INC' X`7B Spell casting `7D X %INCLUDE 'BOSS_INCLUDE:TECH.INC' X %INCLUDE 'BOSS_INCLUDE:PRAYER.INC' X %INCLUDE 'BOSS_INCLUDE:TRICK.INC' X`20 X`7B Hurl an object across the dungeon. -if tval is thrown weapon, bonus to h Vit`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 temporary_slot := inventory`5Bitem_val`5D; X temporary_slot.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 i1 : wordint; X tmp_weight : integer; X BEGIN X with temporary_slot do X Begin X if (weight < 1) then X tmp_weight := 1 X else X tmp_weight := weight; X`09 if (tval = 82) then X`09 begin X tdam := damroll(damage) + todam*2; X tbth := py.misc.bthb; X tpth := py.misc.ptohit + tohit*2; X tdis := trunc(((py.stat.cstr+25)*10)/tmp_weight); X if (tdis > 18) then tdis := 18; X`09`09end X`09 else X`09 begin 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+25)*10)/tmp_weight); X if (tdis > 10) then tdis := 8; X`09`09end X End; X END; X`20 X`7Bif item misses or has no target, then drop it somewhere.`7D 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 := temporary_slot; X if (test_light(i1,i2)) then X lite_spot(i1,i2); X END X else X BEGIN X objdes(out_val,1,false,'t'); X msg_print('The ' + out_val + ' dissapears.'); X END; X END; X 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,'Hurl which item?', 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 temporary_slot 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`09`09 if (tval = 84) then X`09`09 fire_ball(p1,dir,char_row,char_col, X`09`09 `09`09 damroll(damage)+todam,2,true,'explosion') X else 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,1,false,'t'); X If (length(out_val+c_list`5Bi1`5D.name) > 60) then X`09 out_val := 'It' X`09else X`09 out_val := 'The ' + out_val;`09 `20 X msg_print(out_val + ' hits the ' + c_list`5Bi1`5D.name + '. '); X tdam := tot_dam(temporary_slot,tdam,c_list`5Bi1`5D); X with temporary_slot 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`7B Fire a Weapon that has ammo.`7D X procedure fire_object; X var X item_val,tbth,tpth,tdam,tdis: integer; X y_dumy,x_dumy,dumy,i2,i3 : integer; X y,x,oldy,oldx,dir,cur_dis: integer; X redraw,flag : boolean; X out_val: vtype; X`20 X`7Bsub-procedure`7D X procedure facts_fire(var tpth,tdam,tdis : integer); X var X rounds : integer; X out_val : vtype; X BEGIN X`09 rounds := 1; X with temporary_slot do `7Bammo bonuses`7D X Begin X`09 tpth := tohit; X`09 tdam := todam*dam_plus_adj; X`09 weight := 100 + 50*tohit; `7Bused for calculating critical hits.`7 VD X`09 End; X`09 with equipment`5B23`5D do `7Bgun bonuses`7D X`09 Begin X`09 tdis := p1; X`09 tpth := tpth + tohit + (p1 div 10); X`09 tdam := tdam + damroll(damage); X`09 if (tval = 19) then X`09 begin X`09`09 rounds := inventory`5Bitem_val`5D.number; X`09 if (rounds > todam) then X`09`09 rounds := todam; X`09`09 tdam := tdam*rounds; X`09`09end; X`09 End; X`09 with inventory`5Bitem_val`5D do X`09 begin X number := number - rounds; X`09 inven_weight := inven_weight - weight*rounds; X`09 objdes(out_val,item_val,true,'i'); X`09 out_val :=`20 X`09 'You have ' + substr(out_val,1,(length(out_val)-1)) + '. '; X`09 msg_print(out_val); X`09 if (number < 1) then X`09 inven_destroy(item_val); X`09 prt_cur_weight; X`09 end; X END; X`20 X`7Bfstart`7D X BEGIN X redraw := false; X if (inven_ctr = 0) then X msg_print('But you are not carrying anything.') X X`09else if (not(find_range(`5Bequipment`5B23`5D.subval`5D,i2,i3))) then X`09 msg_print('You are not carrying any compatible ammo.') X X else if (get_item(item_val,'Use which ammo clip?', X redraw,i2,i3)) 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 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 temporary_slot := inventory`5Bitem_val`5D; X temporary_slot.number := 1; X facts_fire(tpth,tdam,tdis); X y := char_row; X x := char_col; X`09`09if (temporary_slot.tval = 9) then `7Blaser weapon`7D X`09`09 light_line(dir,y,x,tdam,true) X`09`09else with temporary_slot do X BEGIN X flag := false; 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 := py.misc.bthb - 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,1,false,'t'); X msg_print('The ' + out_val + ' hits the ' + c_list`5Bi1`5D.name + '. V '); X tdam := tot_dam(temporary_slot,tdam,c_list`5Bi1`5D); X with temporary_slot do X tdam := critical_blow(weight,tpth,tdam); X i1 := mon_take_hit(cptr,tdam); +-+-+-+-+-+-+-+- END OF PART 48 +-+-+-+-+-+-+-+-