-+-+-+-+-+-+-+-+ START OF PART 74 -+-+-+-+-+-+-+-+ X`5Bglobal,psect(screen1$code)`5D procedure prt_search; X begin X if (uand(%X'000100',py.flags.status) <> 0) then X`09put_buffer('Searching',status_row,searching_column) X else X`09put_buffer(' ',status_row,searching_column); X end; X X`09`7B Prints Resting status`09`09`09`09`09-RAK-`09`7D X`5Bglobal,psect(screen1$code)`5D procedure prt_rest; X begin X if (uand(%X'000200',py.flags.status) <> 0) then X`09put_buffer('Resting ',status_row,resting_column) X else X`09put_buffer(' ',status_row,resting_column); X end; X X`09`7B Prints Quested status`09`09`09`09`09-RAD-`09`7D X`5Bglobal,psect(screen1$code)`5D procedure prt_quested; X begin X if (py.flags.quested) then`20 X`09put_buffer(' Quest ',status_row,quested_column) X else if (py.misc.cur_quest > 0) then X `09put_buffer(' Done ',status_row,quested_column) X else`20 X put_buffer(' ',status_row,quested_column); X end; X X`09`7B Prints winner status on display`09`09`09-RAK-`09`7D X`5Bglobal,psect(screen1$code)`5D procedure prt_winner; X begin X put_buffer('*Winner*',winner_row,winner_column); X end; X X`5Bglobal,psect(screen2$code)`5D procedure prt_experience; X var X`09tmp_exp`09`09: integer; X begin X with py.misc do X`09begin X`09 if (exp > player_max_exp) then exp := player_max_exp; X`09 if (lev < max_player_level) then X`09 begin X`09 while (trunc(player_exp`5Blev`5D*expfact) <= exp) do gain_level; X`09 if (exp > max_exp) then max_exp := exp; X`09 end; X`09end; X prt_num('',py.misc.exp,exp_row,stat_column+6); X end; X X`5Bglobal,psect(screen1$code)`5D procedure prt_6_stats(p : stat_s_type; X`09`09`09`09`09`09row,col : byteint); X begin X`09prt_stat('STR : ',p`5Bsr`5D,row ,col); X`09prt_stat('INT : ',p`5Biq`5D,row+1,col); X`09prt_stat('WIS : ',p`5Bws`5D,row+2,col); X`09prt_stat('DEX : ',p`5Bdx`5D,row+3,col); X`09prt_stat('CON : ',p`5Bcn`5D,row+4,col); X`09prt_stat('CHR : ',p`5Bca`5D,row+5,col); X end; X X`09`7B Prints character-screen info`09`09`09`09-RAK-`09`7D X`5Bglobal,psect(screen1$code)`5D procedure prt_stat_block; X begin X prt_field(py.misc.race,`09`09 race_row,stat_column); X prt_field(py.misc.tclass,`09`09 class_row,stat_column); X prt_title; X prt_6_stats(py.stat.c,str_row,stat_column); X prt_num( 'LEV : ',py.misc.lev,`09 level_row,stat_column); X prt_num( 'EXP : ',py.misc.exp,`09 exp_row,stat_column); X if is_magii then X`09begin X`09 prt_field('MANA: ',`09`09 mana_row,stat_column); X`09 prt_mana; X`09end; X prt_field('HP : ',`09`09 hp_row,stat_column); X prt_hp; X prt_num( 'QST : ',py.misc.quests, quest_row,stat_column); X prt_num( 'AC : ',py.misc.dis_ac,`09 ac_row,stat_column); X prt_num( 'GOLD: ',py.misc.money`5Btotal$`5D, gold_row,stat_column); X prt_field('WGHT:',`09`09 weight_row,stat_column); X prt_field('M_WT:',`09`09 weight_row+1,stat_column); X prt_weight; X prt_time; X if (total_winner) then prt_winner; X prt_hunger; `7B'If' statements here redundant and unnecessary, so`7D X prt_blind; `7B removed per Dean's suggestion -MAV`7D X prt_confused; X prt_afraid; X prt_poisoned; X prt_search; X prt_rest; X prt_quested; X end; X X`09`7B Draws entire screen`09`09`09`09`09-RAK-`09`7D X`5Bglobal,psect(screen1$code)`5D procedure draw_cave; X begin X clear(1,1); X prt_stat_block; X prt_map; X prt_depth; X prt_search; X end; Xend. $ CALL UNPACK SCREEN.PAS;1 621357912 $ create 'f' X`09`7B Scrolls for the reading`09`09`09`09-RAK-`09`7D X`5Bpsect(misc2$code)`5D procedure read_scroll; X var X`09`09i1`09`09`09`09: unsigned; X`09`09i3,i4,i5`09`09`09: integer; X`09`09i2,item_ptr,temp_ptr`09`09: treas_ptr; X`09`09thit,tdam,y,x`09`09`09: integer; X`09`09tmp`09`09`09`09: array `5B1..8`5D of integer; X`09`09out_val,str1,str2`09`09: vtype; X`09`09redraw,ident,first,flag`09`09: boolean; X begin X`09first := true; X`09reset_flag := true; X`09if (inven_ctr > 0) then X`09 begin X`09 if (find_range(`5Bscroll1,scroll2`5D,false,i2,i3)) then X`09 if (py.flags.blind > 0) then X`09`09msg_print('You can''t see to read the scroll.') X`09 else if (no_light) then X`09`09msg_print('You have no light to read by.') X`09 else if (py.flags.confused > 0) then X`09`09begin X`09`09 msg_print('The text seems to swim about the page!'); X`09`09 msg_print('You are too confused to read...'); X`09`09end X`09 else X`09`09begin X`09`09 redraw := false; X`09`09 if (get_item(item_ptr,'Read which scroll?',redraw,i3,trash_char,fals Ve)) then X`09`09 with item_ptr`5E.data do X`09`09 begin X`09`09`09if (redraw) then draw_cave; X`09`09`09reset_flag := false; X`09`09`09i1 := flags; X`09`09`09ident := false; X`09`09`09while (i1 > 0) do X`09`09`09 begin X`09`09`09 i5 := bit_pos(i1); X`09`09`09 if (tval = scroll2) then i5 := i5 + 31; X`09`09`09 if (first) then X`09`09`09 if (not(i5 in `5B4,25,42`5D)) then X`09`09`09`09begin X`09`09`09msg_print('As you read the scroll it vanishes.'); X`09`09`09`09 first := false; X`09`09`09`09end; X X`09`7B Scrolls...`09`09`09`09`09`09`7D X`09case (i5) of X`7B Enchant to Hit `7D X`09 1 :`09with equipment`5BEquipment_primary`5D do X`09`09 begin X`09`09 if (tval > 0) then X`09`09 begin X`09`09 inven_temp`5E.data := equipment`5BEquipment_primary`5D; X`09`09 objdes(out_val,inven_temp,false); X`09`09 msg_print('Your ' + out_val + ' glows faintly!'); X`09`09 if (enchant(tohit)) then X`09`09`09begin X`09`09`09 flags := uand(Everything_flag-Cursed_worn_bit,flags); X`09`09`09`09`7BUn-curse the object`7D X`09`09`09 py_bonuses(blank_treasure,0); X`09`09`09end X`09`09 else X`09`09`09msg_print('The enchantment fails...'); X`09`09 end; X`09`09 ident := true; X`09`09 end; X`7B Enchant to Damage `7D X`09 2 :`09with equipment`5BEquipment_primary`5D do X`09`09 begin X`09`09 if (tval > 0) then X`09`09 begin X`09`09 inven_temp`5E.data := equipment`5BEquipment_primary`5D; X`09`09 objdes(out_val,inven_temp,false); X`09`09 msg_print('Your ' + out_val + ' glows faintly!'); X`09`09 if (enchant(todam)) then X`09`09`09begin X`09`09`09 flags := uand(Everything_flag-Cursed_worn_bit,flags); X`09`09`09 py_bonuses(blank_treasure,0); X`09`09`09end X`09`09 else X`09`09`09msg_print('The enchantment fails...'); X`09`09 end; X`09`09 ident := true; X`09`09 end; X`7B Enchant Armor `7D X`09 3 :`09begin X`09`09 i3 := 0; X`09`09 i4 := 0; X`09`09 if (equipment`5BEquipment_armor`5D.tval > 0) then X`09`09 begin X`09`09 i3 := i3 + 1; X`09`09 tmp`5Bi3`5D := Equipment_armor; X`09`09 end; X`09`09 if (equipment`5BEquipment_shield`5D.tval > 0) then X`09`09 begin X`09`09 i3 := i3 + 1; X`09`09 tmp`5Bi3`5D := Equipment_shield; X`09`09 end; X`09`09 if (equipment`5BEquipment_cloak`5D.tval > 0) then X`09`09 begin X`09`09 i3 := i3 + 1; X`09`09 tmp`5Bi3`5D := Equipment_cloak; X`09`09 end; X`09`09 if (equipment`5BEquipment_gloves`5D.tval > 0) then X`09`09 begin X`09`09 i3 := i3 + 1; X`09`09 tmp`5Bi3`5D := Equipment_gloves; X`09`09 end; X`09`09 if (equipment`5BEquipment_helm`5D.tval > 0) then X`09`09 begin X`09`09 i3 := i3 + 1; X`09`09 tmp`5Bi3`5D := Equipment_helm; X`09`09 end; X`09`09 if (equipment`5BEquipment_boots`5D.tval > 0) then X`09`09 begin X`09`09 i3 := i3 + 1; X`09`09 tmp`5Bi3`5D := Equipment_boots; X`09`09 end; X`09`09 if (equipment`5BEquipment_belt`5D.tval > 0) then X`09`09 begin X`09`09 i3 := i3 + 1; X`09`09 tmp`5Bi3`5D := Equipment_belt; X`09`09 end; X`09`09 if (equipment`5BEquipment_bracers`5D.tval > 0) then X`09`09 begin X`09`09 i3 := i3 + 1; X`09`09 tmp`5Bi3`5D := Equipment_bracers; X`09`09 end; X`09`09 if (i3 > 0) then i4 := tmp`5Brandint(i3)`5D; X`09`09 if (uand(Cursed_worn_bit,equipment`5BEquipment_armor`5D.flags) <> 0) V then X`09`09 i4 := Equipment_armor X`09`09 else if (uand(Cursed_worn_bit,equipment`5BEquipment_shield`5D.flags) V <> 0) then X`09`09 i4 := Equipment_shield X`09`09 else if (uand(Cursed_worn_bit,equipment`5BEquipment_cloak`5D.flags) V <> 0) then X`09`09 i4 := Equipment_cloak X`09`09 else if (uand(Cursed_worn_bit,equipment`5BEquipment_helm`5D.flags) < V> 0) then X`09`09 i4 := Equipment_helm X`09`09 else if (uand(Cursed_worn_bit,equipment`5BEquipment_gloves`5D.flags) V <> 0) then X`09`09 i4 := Equipment_gloves X`09`09 else if (uand(Cursed_worn_bit,equipment`5BEquipment_boots`5D.flags) V <> 0) then X`09`09 i4 := Equipment_boots X`09`09 else if (uand(Cursed_worn_bit,equipment`5BEquipment_belt`5D.flags) < V> 0) then X`09`09 i4 := Equipment_belt X`09`09 else if (uand(Cursed_worn_bit,equipment`5BEquipment_bracers`5D.flags V) <> 0) then X`09`09 i4 := Equipment_bracers; X`09`09 if (i4 > 0) then X`09`09 with equipment`5Bi4`5D do X`09`09 begin X`09`09`09inven_temp`5E.data := equipment`5Bi4`5D; X`09`09`09objdes(out_val,inven_temp,false); X`09`09`09msg_print('Your ' + out_val + ' glows faintly!'); X`09`09`09if (enchant(toac)) then X`09`09`09 begin X`09`09`09 flags := uand(Everything_flag-Cursed_worn_bit,flags); X`09`09`09 py_bonuses(blank_treasure,0); X`09`09`09 end X`09`09`09else X`09`09`09 msg_print('The enchantment fails...'); X`09`09 end; X`09`09 ident := true; X`09`09end; X`7B Identify `7D X`09 4 :`09begin X`09`09 identify(item_ptr`5E.data); X`09`09 msg_print('This is an identify scroll'); X`09`09 msg_print(' '); X`09`09 if (ident_spell) then first := false; X`09`09end; X`7B Remove Curse `7D X`09 5 :`09if (remove_curse) then X`09`09 begin X`09`09 msg_print('You feel as if someone is watching over you.'); X`09`09 ident := true; X`09`09 end; X`7B Light `7D X`09 6 :`09ident := light_area(char_row,char_col); X`7B Summon Monster `7D X`09 7 :`09begin X`09`09 for i3 := 1 to randint(3) do X`09`09 begin X`09`09 y := char_row; X`09`09 x := char_col; X`09`09 if (cave`5By,x`5D.fval in water_set) then X`09`09`09summon_water_monster(y,x,false) X`09`09 else X`09`09`09summon_land_monster(y,x,false); X`09`09 end; X`09`09 ident := true; X`09`09end; X`7B Phase Door `7D X`09 8 :`09begin X`09`09 teleport(10); X`09`09 ident := true; X`09`09end; X`7B Teleport `7D X`09 9 :`09begin X`09`09 teleport(100); X`09`09 ident := true; X`09`09end; X`7B Teleport Level `7D X`09 10 :`09begin X`09`09 dun_level := dun_level - 3 + 2*randint(2); X`09`09 if (dun_level < 1) then X`09`09 dun_level := 1; X`09`09 moria_flag := true; X`09`09 ident := true; X`09`09end; X`7B Confuse Monster `7D X`09 11 :`09begin X`09`09 msg_print('Your hands begin to glow.'); X`09`09 py.flags.confuse_monster := true; X`09`09 ident := true; X`09`09end; X`7B Magic Mapping `7D X`09 12 :`09ident := map_area; X`7B Sleep Monster `7D X`09 13 :`09ident := sleep_monsters1(char_row,char_col); X`7B Rune of Protection `7D X`09 14 :`09ident := warding_glyph; X`7B Detect Treasure `7D X`09 15 :`09ident := detect_item(c_treasure); X`7B Detect Object `7D X`09 16 :`09ident := detect_item(c_object); X`7B Detect Trap `7D X`09 17 :`09ident := detect_trap; X`7B Detect Secret Door `7D X`09 18 :`09ident := detect_sdoor; X`7B Mass Genocide `7D X`09 19 :`09begin X`09`09 msg_print('This is a mass genocide scroll.'); X`09`09 msg_print(' '); X`09`09 ident := mass_genocide; X`09`09end; X`7B Detect Invisible `7D X`09 20 :`09ident := detect_creatures(c_invisible); X`7B Aggravate Monster `7D X`09 21 :`09begin X`09`09 ident := aggravate_monster(20); X`09`09 msg_print('There is a high pitched humming noise'); X`09`09end; X`7B Create Trap `7D X`09 22 :`09ident := trap_creation; X`09 23 :`09ident := td_destroy; X`7B Create Door `7D X`09 24 :`09ident := door_creation; X`7B Recharge Item `7D X`09 25 :`09begin X`09`09 identify(item_ptr`5E.data); X`09`09 msg_print('This is a Recharge-Item scroll.'); X`09`09 msg_print(' '); X`09`09 if (recharge(60)) then first := false; X`09`09end; X`7B Genocide `7D X`09 26 :`09begin X`09`09 msg_print('This is a genocide scroll.'); X`09`09 msg_print(' '); X`09`09 ident := genocide; X`09`09end; X`7B Darkness `7D X`09 27 :`09ident := unlight_area(char_row,char_col); X`7B Prot vs Evil `7D X`09 28 :`09ident := protect_evil; X`7B Create Food `7D X`09 29 :`09ident := create_food(3,2,1,0,0); X`7B Dispell Creature `7D X`09 30 :`09ident := zap_area(%X'0008',60,c_hp); X`7B Blank `7D X`09 31 :`09begin X`09`09 msg_print('That scroll appeared to be blank.'); X`09`09 ident := true; X`09`09end; X`7B Enchant Weapon `7D X`09 32 :`09with equipment`5BEquipment_primary`5D do X`09`09 begin X`09`09 if (tval > 0) then X`09`09 begin X`09`09 inven_temp`5E.data := equipment`5BEquipment_primary`5D; X`09`09 objdes(out_val,inven_temp,false); X`09`09 msg_print('Your ' + out_val + ' glows brightly!'); X`09`09 flag := false; X`09`09 for i3 := 1 to randint(2) do X`09`09`09if (enchant(tohit)) then X`09`09`09 flag := true; X`09`09 for i3 := 1 to randint(2) do X`09`09`09if (enchant(todam)) then X`09`09`09 flag := true; X`09`09 if (flag) then X`09`09`09begin X`09`09`09 flags := uand(Everything_flag-Cursed_worn_bit,flags); X`09`09`09 py_bonuses(blank_treasure,0); X`09`09`09end X`09`09 else X`09`09`09msg_print('The enchantment fails...'); X`09`09 end; X`09`09 ident := true; X`09`09 end; X`7B Curse Weapon `7D X`09 33 :`09with equipment`5BEquipment_primary`5D do X`09`09 begin X`09`09 if (tval > 0) then X`09`09 begin X`09`09`09inven_temp`5E.data := equipment`5BEquipment_primary`5D; X`09`09`09objdes(out_val,inven_temp,false); X`09`09`09msg_print('Your ' + out_val + X`09`09`09`09' glows black, then fades.'); X`09`09`09tohit := -randint(5) - randint(5); X`09`09`09todam := -randint(5) - randint(5); X`09`09`09flags := Cursed_worn_bit; X`09`09`09py_bonuses(inven_temp`5E.data,-1); X`09`09`09ident := true; X`09`09 end; X`09`09 end; X`09 34 :`09begin X`09`09 if (uand(Cursed_worn_bit,equipment`5BEquipment_armor`5D.flags) <> 0) V then X`09`09 i3 := Equipment_armor +-+-+-+-+-+-+-+- END OF PART 74 +-+-+-+-+-+-+-+-