-+-+-+-+-+-+-+-+ START OF PART 67 -+-+-+-+-+-+-+-+ X if (index(name,'`5E') = 0) then `7Bobj already identified` V7D X insert_str(name,' (%P1',' (%P1') X`7Bobj not ident'd`7D else X insert_str(name,'`5E (%P1','`5E (%P1') X END; X if (redraw) then X BEGIN X msg_print(' '); X draw_cave X END X END; X`20 X`7B Increase or decrease a creatures hit points `7D X`5Bpsect(misc6$code)`5D function hp_monster(dir,y,x,dam : integer) : boolean V; X VAR X i1 : integer; X flag : boolean; X BEGIN X hp_monster := false; X flag := false; X repeat X move(dir,y,x); X with cave`5By,x`5D do X BEGIN X if (fopen) then X BEGIN X if (cptr > 1) then X BEGIN X flag := true; X `09`09 with m_list`5Bcptr`5D, c_list`5Bmptr`5D do X BEGIN X hp_monster := true; X i1 := mon_take_hit(cptr,dam); X if (i1 > 0) then X msg_print('The ' + c_list`5Bi1`5D.name + ' suffers from a major coro Vnary.') X else X msg_print('The '+name+' says "thanks, buddy!"' V) X END X END X END X else X flag := true X END; X until (flag) X END; X X`7B Drains life `7D `20 X`5Bpsect(misc6$code)`5D function drain_life(dir,y,x : integer) : boolean; X VAR X i1 : integer; X flag : boolean; X BEGIN X drain_life := false; X flag := false; X repeat X move(dir,y,x); X with cave`5By,x`5D do X BEGIN X if (fopen) then X BEGIN X if (cptr > 1) then X BEGIN X flag := true; X `09`09 with m_list`5Bcptr`5D, c_list`5Bmptr`5D do X if (uand(cdefense,%X'0008') = 0) then X BEGIN X drain_life := true; X i1 := mon_take_hit(cptr,50); X if (i1 > 0) then X msg_print('The ' + c_list`5Bi1`5D.name + ' dies smiling.') X else X msg_print('The ' + name + ' gets a boo-boo too big for a band-aid.') X END X END X END X else X flag := true X END; X until (flag) X END; X`20 X`7B Increase or decrease a creatures speed `7D X`5Bpsect(misc6$code)`5D function speed_monster(dir,y,x,spd : integer) : bool Vean; X VAR X flag : boolean; X BEGIN X speed_monster := false; X flag := false; X repeat X move(dir,y,x); X with cave`5By,x`5D do X BEGIN X if (fopen) then X BEGIN X if (cptr > 1) then X BEGIN X flag := true; X `09`09 with m_list`5Bcptr`5D, c_list`5Bmptr`5D do X if (spd > 0) then X BEGIN X cspeed := cspeed + spd; X csleep := 0; X END X else if (randint(max_mons_level) > level) then X BEGIN X cspeed := cspeed + spd; X csleep := 0; X`09`09`09 msg_print('The '+name+' looks blurry.'); X END X else X msg_print('The ' + name + ' is unaffected.'); X speed_monster := true; X END X END X else X flag := true X END; X until (flag) X END; X`20 X`7B Confuse a creature `7D X`5Bpsect(misc6$code)`5D function confuse_monster(dir,y,x : integer) : boolea Vn; X VAR X flag : boolean; X BEGIN X confuse_monster := false; X flag := false; X repeat X move(dir,y,x); X with cave`5By,x`5D do X if (fopen) then X BEGIN X if (cptr > 1) then X `09`09 with m_list`5Bcptr`5D, c_list`5Bmptr`5D do X BEGIN X confuse_monster := true; X flag := true; X if ((randint(max_mons_level) < level) or X (uand(%X'1000',cdefense) <> 0)) then X msg_print('The ' + name + ' is unaffected.') X else X BEGIN X confused := true; X csleep := 0; X msg_print('The ' + name + ' appears confused.') X END X END X END X else X flag := true; X until (flag) X END; X`20 X`7B Sleep a creature. `7D X`5Bpsect(misc6$code)`5D function sleep_monster(dir,y,x : integer) : boolean; X VAR X flag : boolean; X BEGIN X sleep_monster := false; X flag := false; X repeat X move(dir,y,x); X with cave`5By,x`5D do X if (fopen) then X BEGIN X if (cptr > 1) then X `09`09 with m_list`5Bcptr`5D, c_list`5Bmptr`5D do X BEGIN X sleep_monster := true; X flag := true; X if ((randint(max_mons_level) < level) or X (uand(%X'1000',cdefense) <> 0)) then X msg_print('The ' + name + ' is unaffected.') X else X BEGIN X csleep := 500; X msg_print('The ' + name + ' snores blissfuly...' V) X END X END X END X else X flag := true; X until (flag) X END; X`20 X`7B Turn stone to mud, delete wall. `7D X`5Bpsect(misc6$code)`5D function wall_to_mud(dir,y,x : integer) : boolean; X VAR X i1 : integer;`20 X out_val : vtype; X flag : boolean; X BEGIN X wall_to_mud := false; X flag := false; X repeat X move(dir,y,x); X with cave`5By,x`5D do X if (in_bounds(y,x)) then X BEGIN X if (fval in wall_set) then X BEGIN X flag := true; X twall(y,x,1,0); X if (test_light(y,x)) then X BEGIN X msg_print('The wall erodes away'); X wall_to_mud := true X END X END X else if ((tptr > 0) and (not(fopen))) then X BEGIN X flag := true; X if (panel_contains(y,x)) then X if (test_light(y,x)) then X BEGIN X temporary_slot := t_list`5Btptr`5D; X objdes(out_val,1,false,'t'); X msg_print('The ' + out_val + ' erodes away.'); X wall_to_mud := true X END; X delete_object(y,x) X END; X if (cptr > 1) then X `09`09 with m_list`5Bcptr`5D, c_list`5Bmptr`5D do X if (uand(%X'0200',cdefense) <> 0) then X BEGIN X i1 := mon_take_hit(cptr,100); X flag := true; X if (ml) then X if (i1 > 0) then X msg_print('The ' + name + ' flops once, and dies.') X else X msg_print('The ' + name + ' melts away.'); X END X END X else X flag := true; X until (flag) X END; X`20 X`20 X`7B Destroy all traps and doors in a given direction `7D X`5Bpsect(misc6$code)`5D function td_destroy2(dir,y,x : integer) : boolean; X BEGIN X td_destroy2 := false; X repeat X move(dir,y,x); X with cave`5By,x`5D do X if (tptr > 0) then X with t_list`5Btptr`5D do X if (tval in `5B2,101,102,105,109`5D) then X BEGIN X if (delete_object(y,x)) then X BEGIN X msg_print('There is a bright flash of light!'); X fopen := true; X td_destroy2 := true X END X END; X until (not(cave`5By,x`5D.fopen)) X END; X`20 X`7B Polymorph a monster `7D X`5Bpsect(misc6$code)`5D function poly_monster(dir,y,x : integer) : boolean; X VAR X dist : integer; X flag : boolean; X BEGIN X poly_monster := false; X flag := false; X dist := 0; X repeat X move(dir,y,x); X dist := dist + 1; X if (dist < obj$bolt_range) then X BEGIN X with cave`5By,x`5D do X BEGIN X if (fopen) then X BEGIN X if (cptr > 1) then X with c_list`5Bm_list`5Bcptr`5D.mptr`5D do X if (randint(max_mons_level) > level) then X BEGIN X flag := true; X delete_monster(cptr); X place_monster(y,x, X randint(m_level`5Bmax_mons_level`5D)+ m_level`5B0`5D V,false); X if (panel_contains(y,x)) then X if (test_light(y,x)) then X poly_monster := true; X END X else X msg_print('The ' + name + ' is unaffected.') X END X else X flag := true X END X END X else X flag := true; X until (flag) X END; X`20 X`7B Create a wall. `7D X`5Bpsect(misc6$code)`5D function build_wall(dir,y,x : integer) : boolean; X VAR X i1 : integer; X BEGIN X build_wall := false; X i1 := 0; X move(dir,y,x); X while ((cave`5By,x`5D.fopen) and (i1 < 10)) do X with cave`5By,x`5D do X BEGIN X if (tptr > 0) then X delete_object(y,x); X if (cptr > 1) then X mon_take_hit(cptr,damroll('2d8')); X fval := rock_wall2.ftval; X fopen := rock_wall2.ftopen; X fm := false; X if (test_light(y,x)) then X lite_spot(y,x); X i1 := i1 + 1; X build_wall := true; X move(dir,y,x) X END X END; `20 X`20 X`7B Replicate a creature `7D X`5Bpsect(misc6$code)`5D function clone_monster(dir,y,x : integer) : boolean; X VAR X flag : boolean; X BEGIN X flag := false; X clone_monster := false; X repeat X move(dir,y,x); X with cave`5By,x`5D do X if (cptr > 1) then X`09 with m_list`5Bcptr`5D do X Begin X multiply_monster(y,x,mptr,cur_reprod,false); X if (panel_contains(y,x)) then X if (ml) then X clone_monster := true; X flag := true X End X until ((not(cave`5By,x`5D.fopen)) or (flag)) X END; X`20 X`7B Move the creature record to a new location `7D X`5Bpsect(misc6$code)`5D function teleport_away(monptr,dis : integer) : boole Van; X VAR X yn,xn,ctr : integer; X BEGIN X with m_list`5Bmonptr`5D do X BEGIN X ctr := 0; X repeat X repeat X yn := fy + (randint(2*dis+1) - (dis + 1)); X xn := fx + (randint(2*dis+1) - (dis + 1)); X until(in_bounds(yn,xn)); X ctr := ctr + 1; X if (ctr > 9) then X BEGIN X ctr := 0; X dis := dis + 5 X END; X until ((cave`5Byn,xn`5D.fopen) and (cave`5Byn,xn`5D.cptr = 0)); X move_rec(fy,fx,yn,xn); X if (test_light(fy,fx)) then X lite_spot(fy,fx); X fy := yn; X fx := xn; X ml := false; X teleport_away := true X END X END; X`20 X`7B Teleport player to spell casting creature `7D X`5Bpsect(misc6$code)`5D function teleport_to(ny,nx : integer) : boolean; X VAR X dis,ctr,y,x,i1,i2 : integer; X BEGIN X teleport_to := true; X dis := 1; X ctr := 0; X repeat X y := ny + (randint(2*dis+1) - (dis + 1)); X x := nx + (randint(2*dis+1) - (dis + 1)); X ctr := ctr + 1; X if (ctr > 9) then X BEGIN X ctr := 0; X dis := dis + 1 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 END; X`20 X`7B Teleport all creatures in a given direction away `7D X`5Bpsect(misc6$code)`5D function teleport_monster(dir,y,x : integer) : boole Van; +-+-+-+-+-+-+-+- END OF PART 67 +-+-+-+-+-+-+-+-