-+-+-+-+-+-+-+-+ START OF PART 19 -+-+-+-+-+-+-+-+ X`09for j := 1 to maxunique do object.parm`5Bj`5D := 0; X`09loc.x := 0; X`09loc.y := 0; X`09hidden := 0; X end; X for i := 1 to maxfg do X with effect`5Bi`5D do X begin X`09kind`09:= 0; X`09base`09:= 0; X`09altitude:= 0; X rendition := 0; X`09fparm1`09:= 0; X`09fparm2`09:= 0; X`09dsc`09:= ''; X`09on`09:= false; X`09walk_through := true; X`09walk_on := true; X`09climb`09:= true; X end; X end; X putfg; X end; Xend; X Xprocedure custom_room_menu; Xvar X d_st,s:string; X d_ss:shortstring; X d_ic,fg_ico:char; X d_bo:boolean; X d_in,i:integer; Xbegin X mc := 1; X set_menu('Room name',,k_sst,,name`5Bna_room`5D.id`5Bpl`5Bnow`5D.where.r`5D V); X set_menu('Room level',,k_int,here.level); X set_menu('Kind ','0 - Normal, 1 - Random',k_int,here.kind); X set_menu('Size x',,k_int,here.size.x); X set_menu('Size y',,k_int,here.size.y); X for i := 1 to maxexit do X begin X writev(s,dir`5Bi`5D); X set_menu('`5B'+s+'`5DTo room ',,k_roo,here.exit`5Bi`5D.toroom); X set_menu('`5B'+s+'`5DFace x ',,k_int,here.exit`5Bi`5D.face); X end; X do_menu('room.help'); X getname(na_room); X get_menu_sst(name`5Bna_room`5D.id`5Bpl`5Bnow`5D.where.r`5D); X putname(na_room); X getroom; X get_menu_int(here.level); X get_menu_int(here.kind); X get_menu_int(here.size.x); X get_menu_int(here.size.y); X for i := 1 to maxexit do X begin X get_menu_int(here.exit`5Bi`5D.toroom); X get_menu_int(here.exit`5Bi`5D.face); X end; X putroom; Xend; X Xprocedure custom_room; Xvar X textfile:text; X s:string := ''; X file_data:$udata; X i,j,endscreen:integer; Xbegin X if not grab_yes('Read from file') then custom_room_menu X else X grab_line('Enter filename',s); X if s <> '' then X begin X open(textfile,'sys$login:'+s,history := readonly, X`09access_method := sequential,error := continue); X if status(textfile) = 0 then X begin X reset(textfile); X j := pl`5Bnow`5D.where.y; X while not eof(textfile) and (j <= 1 + here.size.y - pl`5Bnow`5D.where. Vy) do X begin X`09readln(textfile,file_data); X`09if pl`5Bnow`5D.where.x - 1 + length(file_data) > here.size.x then X`09endscreen := 1 + here.size.x - pl`5Bnow`5D.where.x X`09else endscreen := length(file_data); X`09for i := 1 to endscreen do X`09here.background`5Bpl`5Bnow`5D.where.x+i-1,j`5D := file_data`5Bi`5D; X`09j := j + 1; X end; X draw_screen(false); X end X else wl('I could not open that file.'); X end; Xend; X Xprocedure do_save_room; Xvar X save:packed array`5B1..maxhoriz,1..maxvert`5D of char; X fg_save:packed array`5B1..maxhoriz,1..maxvert,1..fg_layers`5D of 1..maxfg; X i,j:integer; Xbegin X for j := 1 to maxvert do X for i := 1 to maxhoriz do X save`5Bi,j`5D := here.background`5Bi,j`5D; X fg_save := fg.map; X getroom; X here.background := save; X putroom; X getfg; X fg.map := fg_save; X putfg; X wl('Background saved.'); Xend; X Xprocedure custom_foreground; Xvar X d_st,s:string; X d_ss:shortstring; X d_ic,fg_ico:char; X geom,xx1,xx2,yy1,yy2, X fg_type,fg_slot,d_in:integer; X d_bo:boolean; Xbegin X mc := 1; X if not get_name(fg.name,'Enter foreground to customize:',fg_slot) X then fg_slot := empty_foreground; X writev(s,'Foreground (',fg_slot:0,') name'); X set_menu(s,,k_sst,,fg.name`5Bfg_slot`5D); X with fg.effect`5Bfg_slot`5D do X begin X set_menu('Fg icon',,k_ico,,icon); X set_menu('Fg icon stats', X`09'Normal = 0, Bold = 1, Reverse = 2, Blink = 4, Underline = 8', X`09k_int,rendition); X set_menu('FG type',,k_int,kind,,,,,,na_fg_type); X set_menu('Base (altitude)',,k_int,base); X set_menu('Height',,k_int,altitude); X set_menu('Foreground parm1',,k_int,fparm1,,,-1); X set_menu('Foreground parm2',,k_int,fparm2,,,-1); X set_menu('Foreground parm3',,k_int,fparm3,,,-1); X set_menu('Foreground parm4',,k_int,fparm4,,,-1); X set_menu('Description',,k_dsc,,dsc); X set_menu('Initial status',,k_boo,,,on); X set_menu('Can walk through',,k_boo,,,walk_through); X set_menu('Can walk on',,k_boo,,,walk_on); X set_menu('Can climb',,k_boo,,,climb); X set_menu('Destination room',,k_roo,dest.r); X set_menu('Destination x loc', X`09'Use -1 for a room face, otherwise enter x loc',k_int,dest.x); X set_menu('Destination y loc', X`09'For face use (n=1 s=2 e=3 w=4) otherwise enter y loc',k_int,dest.y); X end; X do_menu('fg.help'); X getfg; X get_menu_sst(fg.name`5Bfg_slot`5D); X with fg.effect`5Bfg_slot`5D do X begin X get_menu_ico(icon); X get_menu_int(rendition); X get_menu_int(kind); X get_menu_int(base); X get_menu_int(altitude); X get_menu_int(fparm1); X get_menu_int(fparm2); X get_menu_int(fparm3); X get_menu_int(fparm4); X get_menu_sst(dsc); X get_menu_boo(on); X get_menu_boo(walk_through); X get_menu_boo(walk_on); X get_menu_boo(climb); X get_menu_int(dest.r); X get_menu_int(dest.x); X get_menu_int(dest.y); X end; X putfg; Xend; X Xprocedure create_object(s:string); Xvar X objnum,i:integer; Xbegin X if allocate(i_object,objnum) then X begin X getobj(objnum); X with obj do X begin X icon`09:= '?'; X wear`09:= 0; X weight`09:= 0; X worth`09:= 0; X line_d`09:= ''; X examine_d`09:= ''; X get_d`09:= ''; X use_d`09:= ''; X howprint`09:= 0; X for i := 1 to maxcomponent do component`5Bi`5D := 0; X for i := 1 to maxparm do X begin X`09parm`5Bi`5D := 0; X`09mag`5Bi`5D := 0; X end; X grab_num('Shall the object be a `5B1 - Weapon`5D`5B2 - Armor`5D`5B3 - V Misc`5D',i,1,2,1); X case i of X`091:begin X`09 parm`5B1`5D := ef_largest; X`09 parm`5B2`5D := ef_smallest; X`09 parm`5B3`5D := ef_weapon; X`09 end; X`092:begin X`09 parm`5B1`5D := ef_largest; X`09 parm`5B2`5D := ef_smallest; X`09 parm`5B3`5D := ef_noise; X`09 parm`5B4`5D := 0; X`09 parm`5B5`5D := ef_c_weapon; X`09 parm`5B6`5D := ef_m_weapon; X`09 parm`5B7`5D := ef_c_missile; X`09 parm`5B8`5D := ef_m_missile; X`09 parm`5B9`5D := ef_c_self; X`09 parm`5B10`5D := ef_m_self; X`09 parm`5B11`5D := ef_c_fire; X`09 parm`5B12`5D := ef_m_fire; X`09 parm`5B13`5D := ef_c_magic; X`09 parm`5B14`5D := ef_m_magic; X`09 parm`5B15`5D := ef_c_holy; X`09 parm`5B16`5D := ef_m_holy; X`09 parm`5B17`5D := ef_c_force; X`09 parm`5B18`5D := ef_m_force; X`09 parm`5B19`5D := ef_c_electric; X`09 parm`5B20`5D := ef_m_electric; X`09 end; X`093:begin X`09 parm`5B1`5D := ef_largest; X`09 parm`5B2`5D := ef_smallest; X`09 for i := 3 to 20 do parm`5Bi`5D := i-2; X`09 end; X end; X end; X putobj; X getname(na_obj); X name`5Bna_obj`5D.id`5Bobjnum`5D := s; X putname(na_obj); X wl('Object created.'); X end; Xend; X Xprocedure create_spell(s:string); Xvar X spellnum,i:integer; Xbegin X if allocate(i_spell,spellnum) then X begin X getspell(spellnum); X with spell do X begin X icon`09:= '*'; X effect`09:= 0; X element`09:= 0; X caster`09:= false; X prompt`09:= false; X mana`09:= 0; X difficulty:= 100; X castingtime := 0; X geometry`09:= 0; X geo1`09:= 0; X geo2`09:= 0; X for i := 1 to 4 do parm`5Bi`5D := 0; X end; X putspell; X getname(na_spell); X name`5Bna_spell`5D.id`5Bspellnum`5D := s; X putname(na_spell); X wl('Spell created.'); X end; Xend; X Xprocedure custom_spell(spellnum:integer); Xvar X d_in:integer; X d_st:string; X d_bo:boolean; X d_ic:char; X d_ss:shortstring; X obj_name:string; X s:string; X i:integer; Xbegin X mc := 1; X getspell(spellnum); X freespell; X with spell do X begin X set_menu('Name of spell',,k_sst,,name`5Bna_spell`5D.id`5Bvalid`5D); X set_menu('Offensive spell',,k_boo,,,indx`5Bi_offense`5D.on`5Bvalid`5D); X set_menu('Effect',,k_int,effect,,,,,,na_spell_ef); X set_menu('Element',,k_int,element,,,,,,na_elements); X set_menu('Caster',,k_boo,,,caster); X set_menu('Prompt',,k_boo,,,prompt); X set_menu('Icon',,k_ico,,icon); X set_menu('Icon rendition', X`09'Normal = 0, Bold = 1, Reverse = 2, Blink = 4, Underline = 8', X`09k_int,rendition); X set_menu('Mana',,k_int,mana); X set_menu('Difficulty',,k_int,difficulty); X set_menu('Time',,k_int,castingtime); X set_menu('Duration',,k_int,duration); X set_menu('Caster desc',,k_dsc,,casterdesc); X set_menu('Victim desc',,k_dsc,,victimdesc); X set_menu('Geometry', X`09'`5B1 point`5D `5B2 line`5D `5B3 blip`5D `5B4 rectangle`5D `5B5 circle`5D V',k_int,geometry); X set_menu('Geo parm 1',,k_int,geo1); X set_menu('Geo parm 2',,k_int,geo2); X end; X for i := 1 to 4 do X begin X writev(s,'Parm',i:0); X set_menu(s,,k_int,spell.parm`5Bi`5D,,,-999); X end; X do_menu('spell.help'); X X getname(na_spell); X get_menu_sst(name`5Bna_spell`5D.id`5Bspellnum`5D); X putname(na_spell); X X getindex(i_offense); X get_menu_boo(d_bo); X indx`5Bi_offense`5D.on`5Bspellnum`5D := d_bo; X putindex(i_offense); X X getspell(spellnum); X with spell do X begin X get_menu_int(effect); X get_menu_int(element); X get_menu_boo(caster); X get_menu_boo(prompt); X get_menu_ico(icon); X get_menu_int(rendition); X get_menu_int(mana); X get_menu_int(difficulty); X get_menu_int(castingtime); X get_menu_int(duration); X get_menu_sst(casterdesc); X get_menu_sst(victimdesc); X get_menu_int(geometry); X get_menu_int(geo1); X get_menu_int(geo2); X end; X for i := 1 to 4 do get_menu_int(spell.parm`5Bi`5D); X putspell; X act_out(plr`5Bnow`5D.log,e_msg,pl`5Bnow`5D.where.x,pl`5Bnow`5D.where.y,nor Vmal,,,, X`09name`5Bna_player`5D.id`5Bplr`5Bnow`5D.log`5D+' is done customizing an obj Vect.'); Xend; X Xprocedure custom_object(objnum:integer); Xvar X d_in:integer; X d_st:string; X d_bo:boolean; X d_ic:char; X d_ss:shortstring; X obj_name:string; X s:string; X i:integer; Xbegin X mc := 1; X read_object(objnum); X set_menu('Name of object',,k_sst,,name`5Bna_obj`5D.id`5Bobj.valid`5D); X set_menu('Object''s icon',,k_ico,,obj.icon); X set_menu('Icon stats', X`09'Normal = 0, Bold = 1, Reverse = 2, Blink = 4, Underline = 8', X`09k_int,obj.rendition); X set_menu('Attack spell ',,k_spe,obj.spell); X set_menu('Examine description','examine',k_dsc,,obj.examine_d); X set_menu('Get description','get',k_dsc,,obj.get_d); X set_menu('Use description','use',k_dsc,,obj.use_d); X set_menu('Ground description','ground',k_dsc,,obj.line_d); X set_menu('Cost of object',,k_int,obj.worth); X set_menu('Size of object',,k_int,obj.size); X set_menu('Weight of object',,k_int,obj.weight); X set_menu('How object prints', X'`5B0 - ""`5D`5B1 - a`5D`5B2 - an`5D`5B3 - some`5D`5B4 - the`5D',k_int,obj.h Vowprint,,,0,4,1); X writev(s,'Wear slot `5B',0:0,'..',maxparm:0,'`5D'); X set_menu('Wear slot',s,k_int,obj.wear,,,0,maxparm, X`09`09obj.wear,na_equipment); X for i := 1 to maxparm do X begin X writev(s,'Parameter',i:0); X set_menu(s,'Enter corresponding numnber',k_sta,obj.parm`5Bi`5D,,, X`09`090,ef_max,obj.parm`5Bi`5D,na_weapon); X writev(s,'Magnitude',i:0); X set_menu(s,,k_int,obj.mag`5Bi`5D,,,-999); X end; X do_menu('object.help'); X getname(na_obj); X get_menu_sst(name`5Bna_obj`5D.id`5Bobjnum`5D); X putname(na_obj); X getobj(objnum); X with obj do X begin X get_menu_ico(icon); X get_menu_int(rendition); X get_menu_int(spell); X get_menu_sst(examine_d); X get_menu_sst(get_d); X get_menu_sst(use_d); X get_menu_sst(line_d); X get_menu_int(worth); X get_menu_int(size); X get_menu_int(weight); X get_menu_int(howprint); X get_menu_int(wear); X end; X for i := 1 to maxparm do X with obj do X begin X get_menu_int(parm`5Bi`5D); X get_menu_int(mag`5Bi`5D); X end; X putobj; X act_out(plr`5Bnow`5D.log,e_msg,pl`5Bnow`5D.where.x,pl`5Bnow`5D.where.y,nor Vmal,,,,name`5Bna_player`5D.id`5Bplr`5Bnow`5D.log`5D+' is done customizing an V object.'); Xend; X Xprocedure custom_fg_geometry; Xvar X add_fg:boolean; X plotted_icon:char; X s:string; X fg_slot,geom,xx1,xx2,yy1,yy2:integer; Xbegin X if get_name(fg.name,'Enter foreground:',fg_slot) then X begin X add_fg := not grab_yes('Delete foreground'); X wl('1 - Point 4 - Rectangle'); X wl('2 - Line 5 - Circle'); X wl('3 - Blip 6 - Face'); X grab_num('Enter geometry:',geom,1,5,1); X wl('When you are at a destination coordinate, hit "."'); X case geom of Xg_face: X begin X`09xx1 := -1; X`09grab_num('Enter face n=1,s=2,e=3,w=4:',yy1,1,4,1); X end; Xg_rectangle,g_line: X begin X wl('Go to the upper left corner.'); X getkey(key_move_only); X xx1 := pl`5Bnow`5D.where.x; X yy1 := pl`5Bnow`5D.where.y; X wl('Go to the lower right corner.'); X getkey(key_move_only); X xx2 := pl`5Bnow`5D.where.x; X yy2 := pl`5Bnow`5D.where.y; X end; Xg_point:begin X`09wl('Go to the point.'); X`09getkey(key_move_only); X`09xx1 := pl`5Bnow`5D.where.x; X`09yy1 := pl`5Bnow`5D.where.y; X end; Xg_circle: X begin X`09wl('Go to the center of the circle.'); X`09getkey(key_move_only); X`09xx1 := pl`5Bnow`5D.where.x; X`09yy1 := pl`5Bnow`5D.where.y; X`09wl('Go east/west to determine the inner circle radius.'); X`09getkey(key_move_only); X xx2 := abs(pl`5Bnow`5D.where.x - xx1); X`09wl('Go east/west to determine the outer circle radius.'); X`09getkey(key_move_only); X`09yy2 := abs(pl`5Bnow`5D.where.x - xx1); X end; X end; X if add_fg then plotted_icon := fg.effect`5Bfg_slot`5D.icon X else plotted_icon := chr(0); X g_plot(geom,xx1,yy1,xx2,yy2,fg.effect`5Bfg_slot`5D.base, X`09fg.effect`5Bfg_slot`5D.altitude,plotted_icon,fg.effect`5Bfg_slot`5D.rendi Vtion); X map_foreground(fg_slot,geom,xx1,yy1,xx2,yy2,add_fg); X end; Xend; X Xprocedure do_custom; Xvar X s,thename:string; X n,kind:integer; Xbegin X grab_kind('Edit (?):',kind); X if kind <> 0 then X case kind of Xna_obj:if checkprivs(8,true) then X`09if get_name(name`5Bkind`5D.id,names`5Bkind`5D,n) then custom_object(n); Xna_spell:if checkprivs(8,true) then +-+-+-+-+-+-+-+- END OF PART 19 +-+-+-+-+-+-+-+-