-+-+-+-+-+-+-+-+ START OF PART 15 -+-+-+-+-+-+-+-+ V7B`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B=======`7B`7B`7B`7B= V==============`7B`7B`7B`7B"`7B`7B`7B`7B"`7B`7B`7B`7B# #### #### X# # # # # ######## # # # #`7B`7B`7B`7B`7B`7B`7B V=======`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B"`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B`7 VB`7B`7B`7B"`7B`7B`7B`7B`7B`7B`7B`7B"`7B`7B`7B`7B======`7B`7B`7B`7B# # V # X# # ## ## ## ##### # # # #`7B`7B`7B`7B`7B`7B"` V7B`7B`7B`7B`7B"`7B`7B`7B============`7B`7B`7B`7B`7B`7B`7B======`7B`7B`7B`7B` V7B`7B##"##`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B# #### # X# # # ## ## ##### ######### # #`7B`7B`7B====`7B`7B` V7B`7B`7B"`7B`7B`7B`7B`7B`7B"`7B`7B`7B`7B`7B`7B`7B"`7B######"#######`7B`7B`7B V`7B`7B`7B"`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B# # # X# # # ## ## ##### # # # =====`7B`7B`7B`7B`7B` V7B`7B=====`7B`7B`7B"`7B`7B`7B`7B`7B`7B`7B"`7B`7B`7B=====`7B`7B`7B`7B`7B`7B`7 VB`7B`7B####"############### ## #### X# # # # # ### ##### ### # ###################`7B`7B= V====`7B`7B`7B`7B`7B`7B`7B=====`7B`7B`7B`7B`7B`7B########### ##### V # # X#### ## # # # ## ## # ########################## V#######"############################### ##### # # # X# # ###### #### # ## ###### - # # ### # # ## V # # # # # # # # - # # # X# # # # #### ## # # # # # # # # # # - #- # # V - # # # # # # # # # # # # X# # # ### ## # # # - # ### - - # # # # ### V# # # ####### # ### # # - # # # X#### ##### ## # # # # # # # # ### - # # # # # # V - ### # #----- # - # # # # # # X# # #### # # # - - # # # ## # # # V # # # #--$-- # # # # # # - # # # X# # # # - # # -# - - # # # V # # #----- # # # # # # # # X# ################### ###################################################### V############ ######## ## ######################## ##### X# ################## ############## ######### #################### V ##### ### ### ### ##### X## ####Underground### ### ######## ## ## ##### # ## #### V ########### ########`7B### # ########## ### ### ####### X## #################### # #The####### ########### # ## ## ### V ## ## ##`7B`7B`7B## ########### ### ### ### X## ########Caverns####### ###Olaqch## #####`7B`7B`7B##### ############ V############### ## ### ###`7B## ### #### ### ### ### X## ### ############## ##Mines# #####`7B`7B`7B`7B`7B########`7B`7B` V7B`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B#### #### # V#`7B`7B`7B`7B# ## ## ############ ### ### X## ##### #### ## ########$$$### #####`7B`7B`7B`7B`7B#####`7B`7B`7B`7B V`7B`7B`7BAraluvian`7BSwamp`7B`7B`7B`7B`7B######### #### ####`7B`7B## ## ## V ####### ## ### X# ##### # ##### ## ### #$$ $$ $### ###########`7B`7B`7B`7B`7B`7B`7B"===` V7B`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B#####`7B`7B`7B`7B`7B#`7B`7B`7B### V ###`7B`7B`7B## #### #### ## ## #### X# ######### #### ## ### #$-$$-$$### ########`7B`7B`7B`7B`7B====`7B"`7B`7B V"======================="`7B`7B`7B`7B`7B`7B#### ######`7B`7B#### ## #### V ### ## #### X# # # ## ### # ########### ==========##===`7B`7B#`7B`7B`7B`7 VB`7B"`7B`7B`7B####`7B`7B"`7B`7B`7B`7B`7B`7B`7B"========== `7B`7B`7B`7 VB`7B## ## ### ## ## #### X# # ### # ## ####### ### ## #########`7B`7B`7B`7B`7B##`7B`7B"`7B`7 VB`7B`7B`7B"==========##=======`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B###########`7B`7 VB`7B##### ### ## ## #### X# # #### ### ####### #### ## # ## ########`7B`7B`7B`7B`7B"`7B`7B#`7 VB`7B"`7B`7B`7B`7B`7B#`7B`7B"`7B`7B##`7B"`7B`7B`7B`7B`7B`7B`7B##`7B`7B######` V7B`7B`7B`7B####`7B`7B###### #### ## ### ## ### X# ## ###### -#### #### ## ## ## ###########`7B`7B"======`7B`7B`7B V`7B`7B#####`7B`7B===`7B`7B`7B`7B#`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B` V7B`7B`7B`7B`7B`7B`7B`7B`7B`7B`7B# ##### ### ## ## X# ## ######-######## ## ### ## ### ##### `7B`7B`7B##`7B`7B`7 VB`7B##`7B`7B`7B`7B`7B`7B`7B"`7B`7B`7B`7B#################`7B`7B############# V####### ### ## ## X# ######$$$$########## #### #### ################### V ############ ## X############################################################################ V######################################################## $ CALL UNPACK SCREEN.9;1 542901059 $ create 'f' X#include stdio X#include smgdef X#include descrip X#include "aralu.h" X X/* Handle the windows stuff */ X Xcreate_windows() X`7B Xsmg$create_pasteboard(&pb); Xsmg$create_virtual_keyboard(&kboard); Xsmg$set_cursor_mode(&pb,&SMG$M_SCROLL_JUMP); Xsmg$create_virtual_display(&10,&37,&dsp_status,&SMG$M_BORDER); Xsmg$create_virtual_display(&10,&37,&dsp_inven,&SMG$M_BORDER); Xsmg$create_virtual_display(&10,&78,&dsp_command,&SMG$M_BORDER); Xsmg$create_virtual_display(&21,&78,&dsp_help,&SMG$M_BORDER); Xsmg$create_virtual_display(&MAXROWS,&MAXCOLS,&dsp_main,&SMG$M_BORDER); Xsmg$create_viewport(&dsp_main,&1,&1,&10,&40); Xsmg$set_keypad_mode(&kboard,&SMG$M_KEYPAD_APPLICATION); X`7D X X Xput_windows() X`7B X$DESCRIPTOR( statlabel, "Character Stats"); X$DESCRIPTOR( invenlabel, "Inventory"); X Xsmg$begin_pasteboard_update(&pb); Xsmg$paste_virtual_display(&dsp_status,&pb,&2,&43); Xsmg$paste_virtual_display(&dsp_main,&pb,&2,&2); Xsmg$paste_virtual_display(&dsp_command,&pb,&13,&2); Xsmg$label_border(&dsp_status,&statlabel); Xsmg$label_border(&dsp_inven,&invenlabel); Xsmg$end_pasteboard_update(&pb); X`7D X X Xdelete_windows() X`7B Xsmg$delete_virtual_keyboard(&kboard); Xsmg$delete_pasteboard(&pb); X`7D X X Xprt_in_disp( display, message, y, x) Xint display, y, x; Xchar *message; X`7B X$DESCRIPTOR( mess_d, message); Xmess_d.dsc$w_length = strlen(message); Xif ( (y==0) && (x==0))`09`09/* default to the next line, col */ X smg$put_line(&display,&mess_d,0,0,0,&SMG$M_WRAP_WORD); Xelse`20 X smg$put_chars(&display,&mess_d,&y,&x); X`7D X Xprt_msg( message) Xchar *message; X`7B X$DESCRIPTOR( mess_d, message); Xmess_d.dsc$w_length = strlen(message); Xsmg$put_line(&dsp_command,&mess_d,0,0,0,&SMG$M_WRAP_WORD); X`7D X Xprt_char( ch, row, col) Xchar ch; Xint row, col; X`7B Xchar ch_c`5B1`5D; X$DESCRIPTOR( p_char, ch_c); Xch_c`5B0`5D = ch; Xrow++; Xcol++; X Xp_char.dsc$w_length = 1; Xif ( ch == KEY) X smg$put_chars(&dsp_main,&p_char,&row,&col,0,&(SMG$M_BOLD+SMG$M_BLINK)); Xelse if ( ch == '*') X smg$put_chars(&dsp_main,&p_char,&row,&col,0,&SMG$M_BOLD); Xelse smg$put_chars(&dsp_main,&p_char,&row,&col); X`7D X X Xchange_viewport( rowoff, coloff) Xint rowoff, coloff; X`7B Xif ( rowoff) X if ( rowoff - SCRATIOV > 0) `7B X if ( rowoff + SCRATIOV >= MAXROWS) rowoff = MAXROWS-9; X else rowoff -= SCRATIOV; X `7D X else rowoff = 1; X Xif ( coloff)`20 X if ( coloff - SCRATIOH > 0) `7B X if ( coloff + SCRATIOH+3 >= MAXCOLS) coloff = MAXCOLS-39; X else coloff -= SCRATIOH; X `7D X else coloff = 1; X Xif ( rowoff && !coloff) X smg$change_viewport(&dsp_main,&rowoff,0,&10,&40); Xelse if ( !rowoff && coloff) X smg$change_viewport(&dsp_main,0,&coloff,&10,&40); Xelse X smg$change_viewport(&dsp_main,&rowoff,&coloff,&10,&40); X`7D $ CALL UNPACK WINDOWS.C;1 1681531896 $ create 'f' X#include stdio X#include "aralu.h" X X Xkill_mon()`09`09`09`09`09/* kill a monster */ X`7B Xint i, j, y, x, n, k; Xint limit; Xshort found; Xchar msg`5B80`5D; X Xprt_msg("Which monster to kill? `5B'?' for listing`5D"); Xif ( (j = getkey()) == '?') `7B X where(); X kill_mon(); X return; X`7D Xfound = FALSE; Xk = 0; Xn = 0; Xwhile( n++ < MAXMONSTERS*level) `7B X limit = monsters`5Bk`5D.max_mon; X for ( i=0; i< limit; i++) `7B X if ( monsters`5Bk`5D.mon_char == j) `7B`20 X monsters`5Bk`5D.dead = TRUE; X y = monsters`5Bk`5D.posy; X x = monsters`5Bk`5D.posx; X map`5By`5D`5Bx`5D.mapchar = SPACE; X map`5By`5D`5Bx`5D.number = 1; X prt_char( map`5By`5D`5Bx`5D.mapchar, y, x); X found = TRUE; X `7D X k++; X `7D /* End FOR */ X`7D /* End while */ Xif ( !found) prt_msg("No such monster exists on this level."); X`7D X X Xwhere()`09`09`09`09`09/* tells where the monsters are */ X`7B Xint i, j, dummy, k, limit; Xchar you`5B80`5D; Xchar position`5B80`5D; X Xj = 0; Xk = 0; Xwhile( j++ < MAXMONSTERS*level) `7B X limit = monsters`5Bk`5D.max_mon; X for ( i=0; i< limit; i++) `7B X sprintf(position,"(%d) %15s at (%d,%d)`5Bspd:%d`5D(hel:%d)`5Bded:%d`5D(ma Vg:%d)`5Bhlsp:%d`5D", X k,mon_names`5Bmonsters`5Bk`5D.n_num`5D,monsters`5Bk`5D.posx,monste Vrs`5Bk`5D.posy, X`09 monsters`5Bk`5D.speed,monsters`5Bk`5D.health,monsters`5Bk`5D.dead,monst Vers`5Bk`5D.magic,monsters`5Bk`5D.hlspd); X prt_msg(position); X if ( k != 0 && k % 8 == 0) `7B X prt_msg("Press any key for more ('q' to end listing)."); X dummy = 0; X smg$read_keystroke(&kboard,&dummy); X if ( dummy == 'q') `7B X sprintf(you,"You are at (%d,%d). Stopmonst: %d",ppos.x,ppos.y,stop_m Vonst); X prt_msg(you); X return; X `7D X `7D X k++; X `7D /* End FOR(i) loop */ X`7D /* End while */ Xsprintf(you,"You are at (%d,%d). Stopmonst: %d",ppos.x,ppos.y,stop_monst); Xprt_msg(you); X`7D X X Xcreate_object()`09`09`09`09/* create any object where you are */ X`7B Xchar obj; X Xprt_msg("Create which object character?"); Xsmg$read_keystroke(&kboard,&obj); Xmap`5Bppos.y`5D`5Bppos.x`5D.number = 5; /* perfect condition OR 5 quantity V */ Xunderchar = obj; Xprt_msg("Created."); X`7D X X Xdelete_object()`09`09`09`09/* delete object on map */ X`7B Xint dx, dy; Xchar dir; X Xprt_msg("Remove object which direction?"); Xsmg$read_keystroke(&kboard,&dir); Xswitch( dir) `7B X`09case UP: dy = -1; dx = 0; break; X`09case DOWN: dy = 1; dx = 0; break; X`09case LEFT: dx = -1; dy = 0; break; X`09case RIGHT: dx = 1; dy = 0; break; X`09default: prt_msg("Invalid direction."); return; break; X`7D Xmap`5Bppos.y+dy`5D`5Bppos.x+dx`5D.mapchar = SPACE; Xmap`5Bppos.y+dy`5D`5Bppos.x+dx`5D.number = 1; Xprt_char( SPACE, ppos.y+dy, ppos.x+dx); Xprt_msg("Deleted."); X`7D X X Xset_stats() `09/* make a nice character */ X`7B X XSTR = grab_num("STR? "); XINT = grab_num("INT? "); XDEX = grab_num("DEX? "); XCON = grab_num("CON? "); XBUSE = grab_num("BUSE? "); Xkills = grab_num("Kills? "); Xwealth = grab_num("wealth? "); Xhealth = grab_num("health? "); Xexperience = grab_num("experience? "); Xprt_status(); X`7D X Xfly()`09`09`09`09`09/* teleport */ X`7B X Xmap`5Bppos.y`5D`5Bppos.x`5D.mapchar = SPACE; Xmap`5Bppos.y`5D`5Bppos.x`5D.number = 1; Xprt_char( map`5Bppos.y`5D`5Bppos.x`5D.mapchar, ppos.y, ppos.x); Xwhile( 1) `7B X ppos.x = grab_num("X-position? \0"); X ppos.y = grab_num("Y-position? \0"); X if ( !ISCLEAR( map`5Bppos.y`5D`5Bppos.x`5D.mapchar))`20 X prt_in_disp(dsp_command,"Something there. Try again.",9,1); X else break; X`7D Xmap`5Bppos.y`5D`5Bppos.x`5D.mapchar = '@'; Xmap`5Bppos.y`5D`5Bppos.x`5D.number = 1; Xunderchar = SPACE; Xprt_char( map`5Bppos.y`5D`5Bppos.x`5D.mapchar, ppos.y, ppos.x); Xchange_viewport( ppos.y, ppos.x); Xdely = delx = 0; X`7D X X Xgoto_level()`09`09`09`09/* go to 'n' level in dungeon */ X`7B X Xlevel = grab_num( "Go to which level? " ) - 1; XGAINLEVEL = TRUE; X`7D X X Xcure_all()`09`09`09`09/* cure all ailments from potions */ X`7B Xint j; X Xfor ( j = 0; j < NUMFLAGS; j++) X flags`5Bj`5D.moves = 0; X`7D $ CALL UNPACK WIZARD.C;1 1780778206 $ v=f$verify(v) $ EXIT