-+-+-+-+-+-+-+-+ START OF PART 68 -+-+-+-+-+-+-+-+ X VAR X yn,xn : integer; X flag : boolean; X BEGIN X flag := false; X teleport_monster := false; X repeat X move(dir,y,x); X with cave`5By,x`5D do X if (cptr > 1) then X BEGIN X teleport_away(cptr,max_sight); X teleport_monster := true X END; X until ((not(cave`5By,x`5D.fopen)) or (flag)) X END; X `20 X`7B Delete all creatures within MAX_SIGHT distance `7D X`5Bpsect(misc6$code)`5D function mass_genocide : boolean; X VAR `20 X i1,i2 : integer; X BEGIN X mass_genocide := false; X i1 := muptr; X repeat X with m_list`5Bi1`5D, c_list`5Bmptr`5D do X BEGIN X i2 := nptr; X if (cdis <= max_sight) then X if (uand(cdefense,%X'80000000') = 0) then X BEGIN X delete_monster(i1); X mass_genocide := true X END X END; X i1 := i2; X until(i1 = 0) X END; X`20 X`7B Delete all creatures of a given type from level. `7D X`5Bpsect(misc6$code)`5D function genocide : boolean; X VAR X i1,i2 : integer; X typ : char; X BEGIN X genocide := true; X i1 := muptr; X if (get_com('Which type of creature do wish exterminated?',typ)) the Vn X repeat X`09 with m_list`5Bi1`5D, c_list`5Bmptr`5D do X BEGIN X i2 := nptr; X if (typ = c_list`5Bmptr`5D.cchar) then X if (uand(cdefense,%X'80000000') = 0) then X delete_monster(i1) X else X msg_print('The ' + name + ' is unaffected.') X END; X i1 := i2; X until(i1 = 0) X END; X`20 X`7B Change speed of any creature player can see. `7D X`5Bpsect(misc6$code)`5D function speed_monsters(spd : integer) : boolean; X VAR X i1,i2 : integer; X BEGIN X i1 := muptr; X speed_monsters := false; X repeat X with m_list`5Bi1`5D do X BEGIN X i2 := nptr; X if (ml) then X with c_list`5Bmptr`5D do X if (spd > 0) then X BEGIN X cspeed := cspeed + spd; X csleep := 0; X speed_monsters := true X END X else if (randint(max_mons_level) > level) then X BEGIN X cspeed := cspeed + spd; X csleep := 0; X speed_monsters := true X END X else X msg_print('The ' + name + ' changes speed...'); X END; X i1 := i2; X until(i1 = 0) X END; X `20 X`7B Polymorph any creature that player can see. `7D X`5Bpsect(misc6$code)`5D function mass_poly : boolean; X VAR X i1,i2,y,x : integer; X BEGIN X i1 := muptr; X mass_poly := false; X repeat X with m_list`5Bi1`5D do X BEGIN X i2 := nptr; X if (cdis < max_sight) then X with c_list`5Bmptr`5D do X if (uand(cdefense,%X'80000000') = 0) then X BEGIN X y := fy; X x := fx; X delete_monster(i1); X place_monster(y,x,randint(m_level`5Bmax_mons_level`5D) + m_level`5B0` V5D,false); X mass_poly := true X END X END; X i1 := i2; X until(i1 = 0) X END; X`20 X`7B Display evil creatures on current panel `7D X`5Bpsect(misc6$code)`5D function detect_evil : boolean; X VAR X i1 : integer; X dummy : char; X flag : boolean; X BEGIN X flag := false; X i1 := muptr; X repeat X with m_list`5Bi1`5D do X if (panel_contains(fy,fx)) then X if (uand(%X'0004',c_list`5Bmptr`5D.cdefense) <> 0) then X BEGIN X ml := true; X print(c_list`5Bmptr`5D.cchar,fy,fx); X flag := true X END; X i1 := m_list`5Bi1`5D.nptr; X until(i1 = 0); X if (flag) then X BEGIN X msg_print('You detect scum nearby!'); X msg_print(' '); X msg_flag := false X END; X detect_evil := flag X END; X`20 X`7B Change players hit points in some manner `7D X`5Bpsect(misc6$code)`5D function hp_player(num : integer; kind : vtype) : bo Volean; X BEGIN X hp_player := false; X with py.misc do X BEGIN X if (num < 0) then X BEGIN X take_hit(abs(num),kind); X if (chp < 0) then X msg_print('You feel your life slipping away!'); X hp_player := true X END X else if (chp < mhp) then X BEGIN X chp := chp + num; X if (chp > mhp) then X chp := mhp; X prt_chp; X CASE trunc(num/5) of X 0 : msg_print('You feel a little better.'); X 1,2 : msg_print('You feel better.'); X 3,4,5,6: msg_print('You feel much better.'); X otherwise msg_print('You feel very good.') X END; X hp_player := true X END X END X END; X`20 X`7B Cure players confusion `7D X`5Bpsect(misc6$code)`5D function cure_confusion : boolean; X BEGIN X cure_confusion := false; X with py.flags do X if (confused > 1) then X BEGIN X confused := 1; X cure_confusion := true X END X END; X`20 X`7B Cure players blindness `7D X`5Bpsect(misc6$code)`5D function cure_blindness : boolean; X BEGIN X cure_blindness := false; X with py.flags do X if (blind > 1) then X BEGIN X blind := 1; X cure_blindness := true X END X END; X`20 X`7B Cure poisoning `7D X`5Bpsect(misc6$code)`5D function cure_poison : boolean; X BEGIN X cure_poison := false; X with py.flags do X if (poisoned > 1) then X BEGIN X poisoned := 1; X cure_poison := true X END X END; X X`7B Cure disease. - RLG`7D X`5Bpsect(misc6$code)`5D function cure_disease : boolean; X BEGIN X cure_disease := false; X with py.flags do X if (diseased > 1) then X BEGIN X diseased := 1; X cure_disease := true X END X END; X`20 X`7B Cure the players fear `7D X`5Bpsect(misc6$code)`5D function remove_fear : boolean; X BEGIN X remove_fear := false; X with py.flags do X if (afraid > 1) then X BEGIN X afraid := 1; X remove_fear := true X END X END; X`20 X`7B This is a fun one. In a given block, pick some walls and X turn them into open spots. Pick some open spots and turn X them into walls. An "Earthquake" effect.`7D X`5Bpsect(misc6$code)`5D function earthquake : boolean; X VAR X i1,i2 : integer; X BEGIN X earthquake := true; X for i1 := char_row-8 to char_row+8 do X for i2 := char_col-8 to char_col+8 do X if ((i1 <> char_row) or (i2 <> char_col)) then X if (in_bounds(i1,i2)) then X if (randint(8) = 1) then X BEGIN X with cave`5Bi1,i2`5D do X BEGIN X if (tptr > 0) then X delete_object(i1,i2); X if (cptr > 1) then X mon_take_hit(cptr,damroll('2d8')); X if (fval in wall_set) then X BEGIN X if (next_to4(i1,i2,`5B1,2`5D) > 0) then X BEGIN X fval := corr_floor2.ftval; X fopen := corr_floor2.ftopen X END X else X BEGIN X fval := corr_floor1.ftval; X fopen := corr_floor1.ftopen X END; X if (test_light(i1,i2)) then unlite_spot(i1,i2); X pl := false; X fm := false; X if (tl) then lite_spot(i1,i2) X END X else if (fval in floor_set) then X BEGIN X CASE randint(10) of X 1,2,3,4,5 : BEGIN X fval := rock_wall3.ftval; X fopen := rock_wall3.ftopen X END; X 6,7,8 : BEGIN X fval := rock_wall2.ftval; X fopen := rock_wall2.ftopen X END; X 9,10 : BEGIN X fval := rock_wall1.ftval; X fopen := rock_wall1.ftopen X END X END; X fm := false X END X END; X if (test_light(i1,i2)) then X lite_spot(i1,i2) X END X END; X`20 X`7B Evil creatures don't like this.`7D X`5Bpsect(misc6$code)`5D function protect_evil : boolean; X BEGIN X protect_evil := true; X with py.flags do X protevil := protevil + randint(25) + 3*py.misc.lev X END; X`20 X`7B Create some high quality mush for the player. `7D X`5Bpsect(misc6$code)`5D function create_food : boolean; X BEGIN X create_food := true; X with cave`5Bchar_row,char_col`5D do X BEGIN X if (tptr > 0) then X delete_object(char_row,char_col); X place_object(char_row,char_col); X t_list`5Btptr`5D := mush X END X END; X`20 X `20 X`7B Attempts to destroy a type of creature. Success depends on X the creatures level VS. the player's level`7D X`5Bpsect(misc6$code)`5D function dispell_creature( X cflag : integer; X damage : integer) : boolean; X VAR X i1,m_next : integer; X BEGIN X i1 := muptr; X dispell_creature := false; X repeat X m_next := m_list`5Bi1`5D.nptr; X with m_list`5Bi1`5D do X if (ml) then X if (uand(cflag,c_list`5Bmptr`5D.cdefense) <> 0) then X BEGIN X hp := hp - randint(damage); X csleep := 0; X if (hp < 0) then X BEGIN X msg_print('The ' + c_list`5Bmptr`5D.name + ' dissolv Ves!'); X monster_death(fy,fx,c_list`5Bmptr`5D.cmove); X with c_list`5Bmptr`5D do X with py.misc do X exp := exp + round(mexp*(level/lev)); X delete_monster(i1) X END X else X msg_print('The ' + c_list`5Bmptr`5D.name + ' shudders. V'); X dispell_creature := true X END; X i1 := m_next; X until(i1 = 0) X END; X`20 X`7B Attempt to turn (confuse) undead creatures.`7D X`5Bpsect(misc6$code)`5D function turn_undead : boolean; X VAR X i1 : integer; X BEGIN X i1 := muptr; X turn_undead := false; X repeat X with m_list`5Bi1`5D do X if (panel_contains(fy,fx)) then X if (ml) then X if (uand(%X'0008',c_list`5Bmptr`5D.cdefense) <> 0) then X BEGIN X if (((py.misc.lev+1) > c_list`5Bmptr`5D.level) or X (randint(5) = 1)) then X BEGIN X msg_print('The ' + c_list`5Bmptr`5D.name + ' runs frantica Vlly!'); X confused := true X END X else X msg_print('The ' + c_list`5Bmptr`5D.name +' is unaffec Vted.'); X turn_undead := true X END; X i1 := m_list`5Bi1`5D.nptr; X until(i1 = 0) X END; X`20 X`7B Leave a glyph of warding... Creatures will not pass over!`7D X`5Bpsect(misc6$code)`5D function warding_glyph : boolean; X VAR X i1 : integer; X BEGIN X warding_glyph := true; X with cave`5Bchar_row,char_col`5D do X if (tptr = 0) then X BEGIN X popt(i1); X tptr := i1; X t_list`5Bi1`5D := scare_monster X END X END; X`20 X`7B Lose a strength point. `7D X`5Bpsect(misc6$code)`5D function lose_str : boolean; X BEGIN X lose_str := true; X if (not(py.flags.sustain_str)) then X BEGIN X with py.stat do X cstr := de_statp(cstr); X msg_print('You feel rather sick.'); X prt_strength X END X else X msg_print('You feel sick for a moment, then it passes.') X END; X`20 X`7B Lose an intelligence point. `7D X`5Bpsect(misc6$code)`5D function lose_int : boolean; X BEGIN X lose_int := true; X if (not(py.flags.sustain_int)) then X BEGIN X with py.stat do X cint := de_statp(cint); X msg_print('You become very dizzy.'); +-+-+-+-+-+-+-+- END OF PART 68 +-+-+-+-+-+-+-+-