-+-+-+-+-+-+-+-+ START OF PART 33 -+-+-+-+-+-+-+-+ X`09`09x_right := xval + randint(4); X`09 end X`09else if (house_type = 5) then X`09 begin X`09 yval := yval + 5; X`09 y_height := yval - 3; X`09 y_depth := yval + 3; X`09 x_left := xval - 5; X`09 x_right := xval + 5; X`09 end X`09else X`09 begin X`09`09y_height := yval - 3; X`09`09y_depth := yval + 3; X`09`09x_left := xval - 5; X`09`09x_right := xval + 5; X`09 end; X`09for i1 := y_height to y_depth do X`09 for i2 := x_left to x_right do X`09 begin X`09`09cave`5Bi1,i2`5D.fval := boundry_wall.ftval; X`09`09cave`5Bi1,i2`5D.fopen := boundry_wall.ftopen; X`09 end; X`09if (house_type = 4) then X`09 for i2 := x_left to x_right do X`09 begin X`09`09cave`5Byval,i2`5D.fval := dopen_floor.ftval; X`09`09cave`5Byval,i2`5D.fopen := dopen_floor.ftopen; X`09 end; X`09if (house_type = 5) then X`09 begin X`09dr_castle(0,5,water1); dr_castle(1,5,water1); dr_castle(1,6,water1); X`09dr_castle(2,6,water1); dr_castle(2,7,water1); dr_castle(3,7,water1); X`09dr_castle(4,7,water1); dr_castle(4,6,water1); dr_castle(5,6,water1); X`09dr_castle(5,5,water1); dr_castle(5,4,water1); dr_castle(5,3,water1); X`09dr_castle(4,3,water1); dr_castle(4,2,water1); dr_castle(3,2,water1); Xdr_castle(3,1,water1); dr_castle(3,0,water1); dr_castle(3,6,boundry_wall); Xdr_castle(4,5,boundry_wall);dr_castle(4,4,boundry_wall); X`09 end; X`09if (house_type = 3) then X`09 begin X`09 make_door(y_height,xval-2+randint(4)); X`09 make_door(y_depth,xval-2+randint(4)); X`09 make_door(yval-2+randint(3),x_left); X`09 make_door(yval-2+randint(3),x_right); X`09 end X`09else if (house_type = 4) then X`09 begin X`09 make_door(yval-1,xval-4); X`09 make_door(yval+1,xval-4); X`09 make_door(yval-1,xval+4); X`09 make_door(yval+1,xval+4); X`09 make_door(yval-1,xval); X`09 make_door(yval+1,xval); X`09 end X`09else if (house_type = 5) then X`09 begin X`09 i1 := 2*randint(2)-3; X`09 make_door(yval+2*i1,xval-1); X`09 make_door(yval+2*i1,xval); X`09 make_door(yval+2*i1,xval+1); X`09 blank_square(3*i1,-1); X`09 blank_square(3*i1,0); X`09 blank_square(3*i1,1); X`09 end`09 `20 X`09else X`09 begin X`09 case randint(4) of X`09 1 : begin X`09`09i1 := randint(y_depth-y_height) + y_height - 1; X`09`09i2 := x_left; X`09 end; X`09 2 : begin X`09`09i1 := randint(y_depth-y_height) + y_height - 1; X`09`09i2 := x_right; X`09 end; X`09 3 : begin X`09`09i1 := y_depth; X`09`09i2 := randint(x_right-x_left) + x_left - 1; X`09 end; X`09 4 : begin X`09`09i1 := y_height; X`09`09i2 := randint(x_right-x_left) + x_left - 1; X`09 end X`09 end; X`09 make_door(i1,i2); X`09 end X end; X X procedure build_house(house_num,where : integer); X begin X`09build_store(house_num+tot_stores,where); X end; X X`09`7B Build a fountain at row, column coordinate`09-dmf-`09`7D X procedure build_fountain (where : integer); X var X`09`09yval,y_height,y_depth`09: integer; X`09`09xval,x_left,x_right`09: integer; X`09`09i1,i2,cur_pos`09`09: integer; X`09`09count`09`09`09: integer; X`09`09flr`09`09`09: array `5B1..35`5D of integer; X`09`09old_seed`09`09: unsigned; X begin X`09yval := 10*(where div 9)+4+randint(3); X`09xval := 14*(where mod 9)+9+randint(3); X`09for i1 := 1 to 35 do X`09 flr`5Bi1`5D := 2; X`09flr`5B1`5D := 1; X`09flr`5B7`5D := 1; X`09for i1 := 10 to 12 do X`09 flr`5Bi1`5D := 3; X`09for i1 := 16 to 17 do X`09 flr`5Bi1`5D := 3; X`09for i1 := 19 to 20 do X`09 flr`5Bi1`5D := 3; X`09for i1 := 24 to 26 do X`09 flr`5Bi1`5D := 3; X`09flr`5B29`5D := 1; X`09flr`5B35`5D := 1; X`09y_height:= yval - 2; X`09y_depth`09:= yval + 2; X`09x_left`09:= xval - 3; X`09x_right`09:= xval + 3; X`09count := 0; X`09repeat X`09 i1 := randint(35); X`09until (flr`5Bi1`5D = 2) and (i1 <> 18); X`09flr`5Bi1`5D := 4; X`09for i1 := y_height to y_depth do X`09 for i2 := x_left to x_right do X`09 begin X`09 count := count + 1; X`09 case flr`5Bcount`5D of X`09`091 : begin X`09`09 cave`5Bi1,i2`5D.fval := dopen_floor.ftval; X`09`09 cave`5Bi1,i2`5D.fopen := dopen_floor.ftopen; X`09`09 end; X`09`092 : begin X`09`09 cave`5Bi1,i2`5D.fval := boundry_wall.ftval; X`09`09 cave`5Bi1,i2`5D.fopen := boundry_wall.ftopen; X`09`09 end; X`09`093 : begin X`09`09 cave`5Bi1,i2`5D.fval := water1.ftval; X`09`09 cave`5Bi1,i2`5D.fopen := water1.ftopen; X`09`09 mini_sleep(5); X`09`09 old_seed := seed; X`09`09 seed := get_seed; X`09`09 if (randint(12) = 1) then place_gold(i1,i2); X`09`09 seed := old_seed; X`09`09 end; X`09`094 : begin X`09`09 cave`5Bi1,i2`5D.fval := rock_wall2.ftval; X`09`09 cave`5Bi1,i2`5D.fopen := rock_wall2.ftopen; X`09`09 end; X`09 end; X`09 end; X end; X X`7B randomize array`5B0..num-1`5D `7D X procedure mixem(num : integer); X`09var i1,i2,i3 : integer; X`09begin X`09 for i1 := 0 to num-1 do X`09 begin X`09 i2 := i1-1+randint(num-i1); X`09 i3 := rooms`5Bi1`5D; X`09 rooms`5Bi1`5D := rooms`5Bi2`5D; X`09 rooms`5Bi2`5D := i3; X`09 end; X`09end; X X X`09`7B Town logic flow for generation of new town`09`09`7D X X begin `7Btown_gen`7D X`09seed := town_seed; X`09for i1 := 0 to 35 do X`09 roomdone`5Bi1`5D := false; X`09center := 10 + randint(5); X`09i3 := 0; X`09for i1 := -2 to 2 do X`09 for i2 := -1 to 2 do X`09 if (((i1<2) and (i1>-2)) or ((i2>-1) and (i2<2))) then X`09 begin X`09`09roomdone`5Bcenter+i1+i2*9`5D := true; X`09`09if ((i1<>0) or (i2=-1) or (i2=2)) then`09`7Bnot castle`7D X`09`09 begin X`09`09 rooms`5Bi3`5D := center+i1+i2*9; X`09`09 i3 := i3 + 1; X`09`09 end; X`09 end; X`09mixem(i3); X`09build_store(4,rooms`5B0`5D); X`09build_store(5,rooms`5B1`5D); X`09build_store(6,rooms`5B2`5D); X`09build_store(9,rooms`5B3`5D); X`09build_store(10,rooms`5B4`5D); X`09build_store(11,rooms`5B5`5D); X`09build_store(13,rooms`5B6`5D); X`09build_store(17,rooms`5B7`5D); X`09build_fountain(rooms`5B8`5D); X`09build_fountain(rooms`5B9`5D); X`09for i1 := 1 to max_house1 do X`09 build_house(1,rooms`5B9+i1`5D); X`09i3 := 0; X`09for i1 := 0 to 35 do X`09 if (not roomdone`5Bi1`5D) then X`09 begin X`09 rooms`5Bi3`5D := i1; X`09 i3 := i3 + 1; X`09 end; X`09mixem(i3); X`09build_store(1,rooms`5B0`5D); X`09build_store(2,rooms`5B1`5D); X`09build_store(3,rooms`5B2`5D); X`09build_store(7,rooms`5B3`5D); X`09build_store(8,rooms`5B4`5D); X`09build_store(15,rooms`5B5`5D); X`09build_store(16,rooms`5B6`5D); X`09build_fountain(rooms`5B8`5D); X`09build_fountain(rooms`5B9`5D); X`09build_house(4,rooms`5B10`5D); X`09for i1 := 1 to max_house2 do X`09 build_house(2,rooms`5B10+i1`5D); X`09fill_cave(dopen_floor); X`09repeat X`09 i1 := randint(4); X`09 i2 := randint(4); X`09until (i1 <> i2); X`09place_boundry; X`09if ((py.misc.cur_age.hour > 17) or (py.misc.cur_age.hour < 6)) then X`09 begin`09`09`7B Night`09`7D X`09 mugging_chance := night_mugging; X`09 for i1 := 1 to cur_height do X`09 for i2 := 1 to cur_width do X`09`09if (cave`5Bi1,i2`5D.fval <> dopen_floor.ftval) then X`09`09 cave`5Bi1,i2`5D.pl := true; X`09 place_stairs(down_staircase,2,0); X`09 place_stairs(down_steep_staircase,1,0); X`09 seed := get_seed; X`09 alloc_land_monster(`5B1,2`5D,min_malloc_tn,3,true,false); X`09 alloc_land_monster(`5B16,17,18`5D,7,0,true,true); X`09 store_maint; X`09 end X`09else X`09 begin`09`09`7B Day`09`7D X`09 mugging_chance := day_mugging; X for i1 := 1 to cur_height do X`09 for i2 := 1 to cur_width do X`09 cave`5Bi1,i2`5D.pl := true; X`09 place_stairs(down_staircase,2,0); X`09 place_stairs(down_steep_staircase,1,0); X`09 seed := get_seed; X`09 alloc_land_monster(`5B1,2`5D,min_malloc_td,3,true,false); X`09 alloc_land_monster(`5B16,17,18`5D,7,0,true,true); X`09 store_maint; X`09 end; X end; X X X begin X panel_row_min`09:= 0; X panel_row_max`09:= 0; X panel_col_min`09:= 0; X panel_col_max`09:= 0; X char_row`09`09:= -1; X char_col`09`09:= -1; X X tlink; X mlink; X blank_cave; X X if (dun_level = 0) then X`09begin X`09 cur_height := screen_height * 2; X`09 cur_width := screen_width * 2; X`09 max_panel_rows := trunc(cur_height/screen_height)*2 - 2; X`09 max_panel_cols := trunc(cur_width /screen_width )*2 - 2; X`09 panel_row := 0; X`09 panel_col := 0; X`09 town_gen; X`09end X else X`09begin X`09 cur_height := max_height; X`09 cur_width := max_width; X`09 max_panel_rows := trunc(cur_height/screen_height)*2 - 2; X`09 max_panel_cols := trunc(cur_width /screen_width )*2 - 2; X`09 panel_row := max_panel_rows; X`09 panel_col := max_panel_cols; X`09 cave_gen X`09end; X end; X XEnd. $ CALL UNPACK GENERATE.PAS;1 1400435367 $ create 'f' X`09.Title`09Get_Account X X X;`09Pascal calling sequence X; X;`09account : packed array `5B1..8`5D of char ; X; X;`09PROCEDURE get_account ( account : `5BSTDESC`5D Packed array `5B1..8`5D o Vf char ); X;`09EXTERN; X; X;`09`09get_account(account); X; X X`09$JPIDEF X Xjpi_list: X`09.WORD`098`09`09; buffer length X`09.WORD`09JPI$_ACCOUNT`09; jpi item code Xreturn_address: X`09.BLKL`091`09`09; return address (filled in later) X`09.LONG`090`09`09; return length (not used) X`09.LONG`09JPI$C_LISTEND`09; end of list X X X`09.Entry`09Get_Account, `5EM<> X X`09MOVL`094(AP), return_address X X`09$GETJPIW_S - X`09`09ITMLST = jpi_list X`09BLBS`09R0, ok X X`09$EXIT_S`09CODE = R0`09`09; exit with appropriate error message X Xok:`09RET X X`09.End $ CALL UNPACK GET_ACCOUNT.MAR;1 1902393908 $ create 'f' X`5BInherit('Moria.Env','Sys$Library:Starlet')`5D Module Help; X X`5Basynchronous`5D function lib$get_input( X var resultant_string: X `5Bclass_s,volatile`5D packed array `5B$l1..$u1:integer`5D of char; X prompt_string: X `5Bclass_s`5D packed array `5B$l2..$u2:integer`5D of char := %immed 0; X var resultant_length: X `5Bvolatile`5D wordint := %immed 0): Xinteger; external; X X`5Basynchronous`5D function lib$put_output( X message_string: X `5Bclass_s`5D packed array `5B$l1..$u1:integer`5D of char): Xinteger; external; X X`5Bexternal,asynchronous`5D Xfunction lbr$output_help( X %immed `5Bunbound`5D function routine1: unsigned := %immed 0; X length: integer := %immed 0; X ifile,topic: `5Bclass_s`5D packed array `5Bl3..u3:integer`5D of char; X flags: array `5Bl4..u4:integer`5D of integer; X %immed `5Bunbound`5D function routine2: unsigned := %immed 0): Xunsigned; extern; X X`5Bglobal,psect(misc2$code)`5D procedure ident_char; X var X`09command`09`09`09: char; X`09exit_flag,bleah_flag`09: boolean; X begin X repeat X`09exit_flag := false; X`09bleah_flag := true; X`09msg_print('Identify letter for what environ? (own, ungeon, ater) V '); X`09if (get_com('',command)) then X`09 case command of X`09 't','d','w' : exit_flag := true; X`09 end X`09else X`09 begin X`09 bleah_flag := false; X`09 exit_flag := true; X`09 end; X until (exit_flag); X if (bleah_flag) then X`09case command of X`09 't' : if (get_com('Enter character to be identified : ',command)) then X`09`09 case command of X`09`09 '#' : prt('# - A stone wall.',1,1); X`09`09 '+' : prt('+ - Entrance to a building.',1,1); X`09`09 '.' : prt('. - Ground.',1,1); X`09`09 '>' : prt('> - A down staircase.',1,1); X`09`09 '@' : prt(py.misc.name,1,1); X`09`09 'p' : prt('p - A townsperson.',1,1); X`09`09 'A' : prt('A - Alchemy Shop.',1,1); X`09`09 'B' : prt('B - First Moria National Bank.',1,1); X`09`09 'C' : prt('C - Casino.',1,1); X`09`09 'D' : prt('D - All-Nite Deli',1,1); X`09`09 'G' : prt('G - General Store.',1,1); X`09`09 'I' : prt('I - Inn.',1,1); X`09`09 'J' : prt('J - Gem and Jewelry Store.',1,1); X`09`09 'L' : prt('L - Library.',1,1); X`09`09 'M' : prt('M - Magic Shop.',1,1); X`09`09 'N' : prt('N - Insurance Shop.',1,1); X`09`09 'P' : prt('P - Trading Post.',1,1); X 'Q' : prt('Q - Home of the Questor.',1,1); X`09`09 'R' : prt('R - Armory.',1,1); X`09`09 'T' : prt('T - Temple.',1,1); X`09`09 'U' : prt('U - Music Shop.',1,1); X`09`09 'W' : prt('W - Weapon Smith.',1,1); X`09`09 'X' : prt('X - Money Exchange.',1,1); X`09`09 otherwise prt('Not normally used.',1,1); X`09`09 end; X`09 'd' : if (get_com('Enter character to be identified : ',command)) then X`09`09 case command of X`09`09 ' ' : prt(' - An open pit.',1,1); X`09`09 '!' : prt('! - A potion.',1,1); X`09`09 '"' : prt('" - An amulet, periapt, or necklace.',1,1); X`09`09 '#' : prt('# - A stone wall.',1,1); X`09`09 '$' : prt('$ - Treasure.',1,1); X`09`09 '%' : prt('% - A musical instrument or song book.',1,1); X`09`09 '&' : prt('& - Treasure chest.',1,1); X`09`09 '''': prt(''' - An open door.',1,1); X`09`09 '(' : prt('( - Soft armor.',1,1); X`09`09 ')' : prt(') - A shield.',1,1); X`09`09 '*' : prt('* - Gems or Jewelry.',1,1); X`09`09 '+' : prt('+ - A closed door.',1,1); X`09`09 ',' : prt(', - Food or mushroom patch.',1,1); X`09`09 '-' : prt('- - A wand',1,1); X`09`09 '.' : prt('. - Floor.',1,1); X`09`09 '/' : prt('/ - A pole weapon.',1,1); X`09`09 ':' : prt(': - Rubble.',1,1); X`09`09 ';' : prt('; - A loose rock.',1,1); X`09`09 '<' : prt('< - An up staircase.',1,1); X`09`09 '=' : prt('= - A ring.',1,1); X`09`09 '>' : prt('> - A down staircase.',1,1); X`09`09 '?' : prt('? - A scroll.',1,1); X`09`09 '@' : prt(py.misc.name,1,1); X`09`09 'A' : prt('A - Giant Ant Lion.',1,1); X`09`09 'B' : prt('B - Demon.',1,1); X`09`09 'C' : prt('C - Gelentanious Cube.',1,1); X`09`09 'D' : prt('D - An Ancient Dragon (Beware).',1,1); X`09`09 'E' : prt('E - Elemental.',1,1); X`09`09 'F' : prt('F - Giant Fly or Faerie Dragon.',1,1); X`09`09 'G' : prt('G - Ghost.',1,1); X`09`09 'H' : prt('H - Hobgoblin.',1,1); X`09`09 'J' : prt('J - Jelly.',1,1); X`09`09 'K' : prt('K - Killer Beetle.',1,1); X`09`09 'L' : prt('L - Lich.',1,1); X`09`09 'M' : prt('M - Mummy.',1,1); X`09`09 'N' : prt('N - Nymph',1,1); X`09`09 'O' : prt('O - Ooze.',1,1); X`09`09 'P' : prt('P - Giant humanoid.',1,1); X`09`09 'Q' : prt('Q - Quylthulg (Pulsing Flesh Mound).',1,1); +-+-+-+-+-+-+-+- END OF PART 33 +-+-+-+-+-+-+-+-