-+-+-+-+-+-+-+-+ START OF PART 66 -+-+-+-+-+-+-+-+ X`09`09`09`09end X`09`09`09 end X`09`09 end X`09`09 else X`09`09 if (redraw) then draw_cave; X`09`09end X`09 else X`09`09msg_print('But you are not carrying any Instruments!'); X`09 end X`09 else X`09 msg_print('But you are not carrying any Instruments!') X`09else X`09 case bard_adj of X`09 0 : msg_print('You utter a gutteral cry.'); X`09 1 : msg_print('You utter a gutteral cry.'); X`09 2 : msg_print('You attempt to sing.'); X`09 3 : msg_print('You attempt to sing.'); X`09 4 : msg_print('You sing a song.'); X`09 5 : msg_print('You sing a song.'); X`09 6 : msg_print('You sing a nice song.'); X`09 7 : msg_print('You sing a very nice song.'); X`09 end; X end; X`20 X`20 $ CALL UNPACK PLAY.INC;1 2139065369 $ create 'f' X`5Binherit('moria.env','dungeon.env')`5D module player; X X`09`7B Moves player from one space to another...`09`09-RAK-`09`7D X `5Bglobal,psect(creature$code)`5D procedure move_char(dir : integer); X var X`09`09test_row,test_col : integer; X`09`09panrow,pancol : integer; X`09`09i1,i2 : integer; X begin X`09test_row := char_row; X`09test_col := char_col; X`09if (dir=5) then find_flag:=false; X`09if (py.flags.confused > 0) then `7B Confused? `7D X`09 if (randint(4) > 1) then `7B 75% random movement `7D X`09 if (dir <> 5) then `7B Never random if sitting`7D X`09 begin X`09`09dir := randint(9); X`09`09find_flag := false; X`09 end; X`09if (move(dir,test_row,test_col)) then `7B Legal move? `7D X`09 with cave`5Btest_row,test_col`5D do X`09 if (cptr < 2) then `7B No creature? `7D X`09 begin X`09`09if (fopen) then `7B Open floor spot `7D X`09`09 if ((find_flag) and X`09`09 ((cave`5Bchar_row,char_col`5D.fval in earth_set) = X`09`09`09(cave`5Btest_row,test_col`5D.fval in water_set))) then X`09`09 begin X`09`09 find_flag := false; X`09`09 move_char(5); X`09`09 end X`09`09 else X`09`09 begin X`09`09`09`7B Move character record (-1) `7D X`09`09 move_rec(char_row,char_col,test_row,test_col); X`09`09`09`7B Check for new panel `7D X`09`09 if (get_panel(test_row,test_col)) then X`09`09 prt_map; X`09`09`09`7B Check to see if he should stop `7D X`09`09 if (find_flag) then X`09`09 area_affect(dir,test_row,test_col); X`09`09`09`7B Check to see if he notices something `7D X`09`09 if (py.flags.blind < 1) then X`09`09 if ((randint(py.misc.fos) = 1) or (search_flag)) then X`09`09`09search(test_row,test_col,py.misc.srh); X`09`09`09`7B An object is beneath him... `7D X`09`09 if (tptr > 0) then X`09`09 carry(test_row,test_col); X`09`09`09`7B Move the light source `7D X`09`09 move_light(char_row,char_col,test_row,test_col); X`09`09`09`7B A room of light should be lit... `7D X`09`09 if (fval = lopen_floor.ftval) then X`09`09 begin X`09`09`09if (py.flags.blind < 1) then X`09`09`09 if (not(pl)) then X`09`09`09 light_room(test_row,test_col); X`09`09 end X`09`09`09`7B In doorway of light-room? `7D X`09`09 else if (fval in `5B5,6`5D) then X`09`09 if (py.flags.blind < 1) then X`09`09`09begin X`09`09`09 for i1 := (test_row - 1) to (test_row + 1) do X`09`09`09 for i2 := (test_col - 1) to (test_col + 1) do X`09`09`09 if (in_bounds(i1,i2)) then X`09`09`09`09with cave`5Bi1,i2`5D do X`09`09`09`09 if (fval = lopen_floor.ftval) then X`09`09`09`09 if (not(pl)) then X`09`09`09`09 light_room(i1,i2); X`09`09`09end; X`09`09`09`7B Make final assignments of char co-ords`7D X`09`09 char_row := test_row; X`09`09 char_col := test_col; X`09`09 end X`09`09else `7BCan't move onto floor space`7D X`09`09`09`7B Try a new direction if in find mode `7D X`09`09 if (not(pick_dir(dir))) then X`09`09 begin X`09`09 if (find_flag) then X`09`09`09begin X`09`09`09 find_flag := false; X`09`09`09 move_char(5); X`09`09`09end X`09`09 else if (tptr > 0) then X`09`09`09begin X`09`09`09 reset_flag := true; X`09`09`09 if (t_list`5Btptr`5D.tval = Rubble) then X`09`09`09 msg_print('There is rubble blocking your way.') X`09`09`09 else if (t_list`5Btptr`5D.tval = Closed_door) then X`09`09`09 msg_print('There is a closed door blocking your way.'); X`09`09`09end X`09`09 else X`09`09`09reset_flag := true; X`09`09 end X`09 end X`09 else `7B Attacking a creature! `7D X`09 begin X`09`09if (find_flag) then X`09`09 begin X`09`09 find_flag := false; X`09`09 move_light(char_row,char_col,char_row,char_col); X`09`09 end; X`09`09if (py.flags.afraid < 1) then `7B Coward? `7D X`09`09 py_attack(test_row,test_col) X`09`09else `7B Coward! `7D X`09`09 msg_print('You are too afraid!'); X`09 end X end; X X X `5Bglobal,psect(moria$code)`5D procedure search_off; X begin X`09search_flag := false; X`09find_flag := false; X`09move_char(5); X`09change_speed(-1); X`09py.flags.status := uand(py.flags.status,%X'FFFFFEFF'); X`09prt_search; X`09with py.flags do X`09 food_digested := food_digested - 1; X end; X X `5Bglobal,psect(moria$code)`5D procedure rest_off; X begin X`09py.flags.rest := 0; X`09py.flags.status := uand(py.flags.status,%X'FFFFFDFF'); X`09erase_line(1,1); X`09prt_rest; X`09with py.flags do X`09 food_digested := food_digested + 1; X end; X X`09`7B Decreases players hit points and sets death flag if neccessary`7D X `5Bglobal,psect(moria$code)`5D procedure take_hit(damage : integer; hit_ Vfrom : vtype); X begin X`09if (py.flags.invuln > 0) then damage := 0; X`09py.misc.chp := py.misc.chp - damage; X`09if (search_flag) then search_off; X`09if (py.flags.rest > 0) then rest_off; X`09flush; X`09if (py.misc.chp <= -1) then X`09 begin X`09 if (not(death)) then X`09 begin `7B Hee, hee... Ain't I mean? `7D X`09`09death := true; X`09`09died_from := hit_from; X`09`09total_winner := false; X`09 end; X`09 moria_flag := true; X`09 end X`09else X`09 prt_hp; X end; X X`09`7B Regenerate hit points`09`09`09`09`09-RAK-`09`7D X `5Bglobal,psect(moria$code)`5D procedure regenhp(percent : real); X begin X`09with py.misc do X`09 chp := chp + mhp*percent + player$regen_hpbase; X end; X X`09`7B Regenerate mana points`09`09`09`09-RAK-`09`7D X `5Bglobal,psect(moria$code)`5D procedure regenmana(percent : real); X begin X`09with py.misc do X`09 cmana := cmana + mana*percent + player$regen_mnbase; X end; X Xend. $ CALL UNPACK PLAYER.PAS;1 942151747 $ create 'f' X`09`7B Potions for the quaffing`09`09`09`09-RAK-`09`7D X`5Bpsect(misc2$code)`5D procedure quaff; X var X`09`09i1`09`09`09`09: unsigned; X`09`09i3,i4,i5,i6`09`09`09: integer; X`09`09i2,item_ptr`09`09`09: treas_ptr; X`09`09out_val`09`09`09`09: vtype; X`09`09redraw,ident`09`09`09: boolean; X begin X`09reset_flag := true; X`09if (inven_ctr > 0) then X`09 begin X`09 if (find_range(`5Bpotion1,potion2`5D,false,i2,i3)) then X`09 begin X`09`09redraw := false; X`09`09if (get_item(item_ptr,'Quaff which potion?',redraw,i3,trash_char,false V)) then X`09`09 with item_ptr`5E.data do X`09`09 begin X`09`09 if (redraw) then draw_cave; X`09`09 reset_flag := false; X`09`09 i1 := flags; X`09`09 ident := false; X`09`09 while (i1 > 0) do X`09`09`09begin X`09`09`09 i6 := bit_pos(i1); X`09`09`09 if (tval = potion2) then i6 := i6 + 31; X`09`7B Potions`09`09`09`09`09`09`7D X`09case (i6) of X`7B Gain Str `7D X`09 1 :`09ident := gain_stat(sr,'X'); X`7B Lose Str `7D X`09 2 :`09ident := lose_stat(sr,'X','X'); X`7B Restore Str `7D X`09 3 :`09ident := restore_stat(sr,'X'); X`7B Gain Int `7D X`09 4 :`09ident := gain_stat(iq,'X'); X`7B Lose Int `7D X`09 5 :`09begin X`09`09 msg_print('This potion tastes very dull.'); X`09`09 ident := lose_stat(iq,'X','X'); X`09`09end; X`7B Restore Int `7D X`09 6 :`09ident := restore_stat(iq,'X'); X`7B Gain Wis `7D X`09 7 :`09ident := gain_stat(ws,'X'); X`7B Lose Wis `7D X`09 8 :`09ident := lose_stat(ws,'X','X'); X`7B Restore Wis `7D X`09 9 :`09ident := restore_stat(ws,'X'); X`7B Gain Chr `7D X`09 10 :`09ident := gain_stat(ca,'X'); X`7B Lose Chr `7D X`09 11 :`09ident := lose_stat(ca,'X','X'); X`7B Restore Chr `7D X`09 12 :`09ident := restore_stat(ca,'X'); X`7B Cures and healing `7D X`09 13 :`09ident := hp_player(damroll('2d7'),'a potion.'); X`09 14 :`09ident := hp_player(damroll('4d7'),'a potion.'); X`09 15 :`09ident := hp_player(damroll('6d7'),'a potion.'); X`09 16 :`09ident := hp_player(1000,'a potion.'); X`7B Gain Con `7D X`09 17 :`09begin X`09`09 py.misc.mhp := py.misc.mhp + 1; X`09`09 py.misc.chp := py.misc.chp + py.misc.mhp; X`09`09 ident := gain_stat(cn,'X'); X`09`09 prt_hp; X`09`09end; X`7B Gain Experience `7D X`09 18 :`09with py.misc do X`09`09 begin X`09`09 i5 := (exp div 2) + 10; X`09`09 if (i5 > 100000) then i5 := 100000; X`09`09 exp := exp + i5; X`09`09 msg_print('You feel more experienced.'); X`09`09 prt_experience; X`09`09 ident := true; X`09`09 end; X`7B Sleep `7D X`09 19 :`09with py.flags do X`09`09 if (not (py.flags.free_act)) then X`09`09 begin X`09`09 msg_print('You fall asleep.'); X`09`09 py.flags.paralysis := py.flags.paralysis +`20 X`09`09`09`09`09`09`09`09randint(4) + 4; X`09`09 ident := true; X`09`09 end; X`7B Darkness `7D X`09 20 :`09with py.flags do X`09`09 begin X`09`09 msg_print('You are covered by a veil of darkness.'); X`09`09 blind := blind + randint(100) + 100; X`09`09 ident := true; X`09`09 end; X`7B Confusion `7D X`09 21 :`09with py.flags do X`09`09 begin X`09`09 msg_print('Hey! This is good stuff! * Hick! *'); X`09`09 confused := confused + randint(20) + 12; X`09`09 ident := true; X`09`09 end; X`7B Poison `7D X`09 22 :`09with py.flags do X`09`09 begin X`09`09 msg_print('You feel very sick.'); X`09`09 poisoned := poisoned + randint(15) + 10; X`09`09 ident := true; X`09`09 end; X`7B Haste Self `7D X`09 23 :`09begin X`09`09 py.flags.fast := py.flags.fast + randint(25) + 15; X`09`09 ident := true; X`09`09end; X`7B Slowness `7D X`09 24 :`09begin X`09`09 py.flags.slow := py.flags.slow + randint(25) + 15; X`09`09 ident := true; X`09`09end; X`09 25 :`09ident := detect_creatures(c_monster); X`7B Increase Dex `7D X`09 26 :`09ident := gain_stat(dx,'X'); X`7B Restore Dex `7D X`09 27 :`09ident := restore_stat(dx,'X'); X`7B Restore Con `7D X`09 28 :`09ident := restore_stat(cn,'X'); X`7B Cure Blindness `7D X`09 29 :`09cure_me(py.flags.blind); X`7B Cure Confusion `7D X`09 30 :`09cure_me(py.flags.confused); X`7B Cure Poison `7D X`09 31 :`09cure_me(py.flags.poisoned); X`7B Learning `7D X`09 32 :`09with py.misc do X`09`09 with class`5Bpclass`5D do X`09`09 if (mspell) then X`09`09 begin X`09`09 ident := learn_spell(redraw); X`09`09`09if (redraw) then draw_cave; X`09`09 end X`09`09 else if (bspell) then X`09`09 begin X`09`09`09ident := learn_song(redraw); X`09`09`09if (redraw) then draw_cave; X`09`09 end X`09`09 else if (pspell) then X`09`09 ident := learn_prayer X`09`09 else if (dspell) then X`09`09 ident := learn_druid; X`7B Lose Memories `7D X`09 33 :`09begin X`09`09 msg_print('You feel your memories fade...'); X`09`09 msg_print(''); X`09`09 i4 := trunc(py.misc.exp/5.0);`20 X`09`09 lose_exp(randint(i4)+i4); X`09`09 ident := true; X`09`09end; X`7B Salt Water `7D X`09 34 :`09with py.flags do X`09`09 begin X`09`09 poisoned := 0; X`09`09 py.flags.status := uand(py.flags.status,%X'FFFFFFDF'); X`09`09 prt_poisoned; X`09`09 if (food > 150) then food := 150; X`09`09 paralysis := 4; X`09`09 msg_print('The potion makes you vomit!'); X`09`09 ident := true; X`09`09 end; X`7B Invulnerability `7D X`09 35 :`09begin X`09`09 py.flags.invuln := py.flags.invuln + randint(10) + 10; X`09`09 ident := true; X`09`09end; X`7B Heroism `7D X`09 36 :`09begin X`09`09 py.flags.hero := py.flags.hero + randint(25) + 25; X`09`09 ident := true; X`09`09end; X`7B Super-Heroism `7D X`09 37 :`09begin X`09`09 py.flags.shero := py.flags.shero + randint(25) + 25; X`09`09 ident := true; X`09`09end; X`7B Remove Fear `7D X`09 38 :`09ident := cure_me(py.flags.afraid); X`7B Restore Level `7D X`09 39 : begin X`09`09 ident := restore_level; X`09`09 add_food(5000); X`09`09 py.flags.status := uand(%X'FFFFFFFC',py.flags.status); X`09`09 prt_hunger; X`09`09end; X`7B Resist Heat `7D X`09 40 :`09with py.flags do X`09`09 resist_heat := resist_heat + randint(10) + 10; X`7B Resist Cold `7D X`09 41 :`09with py.flags do X`09`09 resist_cold := resist_cold + randint(10) + 10; X`09 42 :`09detect_inv2(randint(12)+12); X`7B Slow Poison `7D X`09 43 :`09ident := slow_poison; X`7B Cure Poison `7D X`09 44 : ident := cure_me(py.flags.poisoned); X`7B Restore Mana `7D X`09 45 :`09with py.misc do X`09`09 if (cmana < mana) then X`09`09 begin X`09`09 cmana := mana; X`09`09 ident := true; X`09`09 msg_print('Your feel your head clear...'); X`09`09 end; X`7B Infra-Vision `7D X`09 46 :`09with py.flags do X`09`09 begin X`09`09 tim_infra := tim_infra + 100 + randint(100); X`09`09 ident := true; X`09`09 msg_print('Your eyes begin to tingle.'); X`09`09 end; X`09 47 :`09; X`09 48 :`09; X`09 49 :`09; X`09 50 :`09; X`09 51 :`09; X`09 52 :`09; X`09 53 :`09; X`09 54 :`09; X`09 55 :`09; X`09 56 :`09; X`09 57 :`09; X`09 58 :`09; X`09 59 :`09; X`09 60 :`09; X`09 61 :`09; X`09 62 :`09; X`09 otherwise ; X`09end; X`09`7B End of Potions...`09`09`09`09`09`7D X`09`09`09end; X`09`09 if (ident) then X`09`09`09identify(item_ptr`5E.data); X`09`09 if (flags <> 0) then X`09`09`09begin X`09`09 with py.misc do X`09`09`09 exp := exp + round(level/lev); X`09`09 prt_experience; X`09`09`09end; X`09`09 add_food(p1); X`09`09 desc_remain(item_ptr); X`09`09 inven_destroy(item_ptr); X`09`09 prt_weight; X`09`09 end X`09`09else X`09`09 if (redraw) then draw_cave; X`09 end X`09 else X`09 msg_print('You are not carrying any potions.'); +-+-+-+-+-+-+-+- END OF PART 66 +-+-+-+-+-+-+-+-