home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-10-03 | 20.2 KB | 1,046 lines |
- APP Sled
- path "\app\stigma\"
- ext "lev"
- icon "\opd\sled.pic"
- type $1003
- ENDA
-
- PROC sled:
- global graphic%,drive$(1),ep%,cp%
- global cx%,cy%,disp%,tle%,l$(120),sx%,sy%,ex%
- global gw%,id$(60,15),pid%,comm%,tg$(30),dr$(1)
- local c$(1),f$(128),ev%(6),dmode%,smode%
- local gcx%,gcy%,gcw%,gch%,wv%,chg%
- local t%,t&,a,f,d%,n$(5),f2$(128)
- local jx%,jy%
- callme:("Sled")
- defaultwin 0
- tg$=":\app\stigma\"
- IF EXIST("M"+tg$+"stigma.gfx")
- tg$="M"+tg$
- ELSEIF EXIST("A"+tg$+"stigma.gfx")
- tg$="A"+tg$
- ELSEIF EXIST("B"+tg$+"stigma.gfx")
- tg$="B"+tg$
- ENDIF
- graphic%=gloadbit(tg$+"stigma.gfx",0,0)
- if graphic%<2
- raise -33
- endif
- IF EXIST("M:\app\stigma.app")
- comm%=1
- dr$="M"
- ELSEIF EXIST("A:\app\stigma.app")
- comm%=1
- dr$="A"
- ELSEIF EXIST("B:\app\stigma.app")
- comm%=1
- dr$="B"
- ENDIF
- IF EXIST("M:\app\stigma_s.gam")
- dr$="M"
- ELSEIF EXIST("A:\app\stigma_s.gam")
- dr$="A"
- ELSEIF EXIST("B:\app\stigma_s.gam")
- dr$="B"
- ENDIF
- if dr$=""
- raise -33
- endif
- disp%=gCREATE(299,54,122,52,0,1)
- gXBORDER 1,$403
- setstr:
- setpick:
- gUSE 1
- gSETWIN 0,0,416,160
- screen 30,12
- statuswin ON,2
- wv%=1
- ep%=1
- cp%=1
- dmode%=1
- diaminit 1,"Levels","Editor"
- c$=cmd$(3)
- f$=cmd$(2)
- if c$="O"
- xopen:(f$)
- else
- xcreate:(f$)
- endif
- tle%=1
- update:(1,3)
- gcx%=4
- gcy%=4
- gcw%=168
- gch%=72
- do
- gAT gcx%,gcy%
- cursor 1,0,gcw%,gch%,1
- getevent ev%()
- cursor off
- if ev%(1)=$404
- f$=getcmd$
- c$=left$(f$,1)
- f$=mid$(f$,2,128)
- if c$="C"
- close
- xcreate:(f$)
- elseif c$="O"
- close
- xopen:(f$)
- elseif c$="X"
- close
- return
- endif
- elseif (ev%(1) and $400)=0 :rem keypress
- if ev%(1)=292
- dmode%=3-dmode%
- diampos dmode%
- if dmode%=1
- gUSE disp%
- gvisible off
- gUSE 1
- gcx%=4
- gcw%=168
- gch%=72
- statuswin on,2
- gSETWIN 0,0,416,160
- position cp%
- if chg%
- a.layout$=l$
- a.startx%=sx%
- a.starty%=sy%
- a.exit%=ex%
- update
- churn:(0,cp%)
- endif
- else
- cx%=0
- cy%=0
- jx%=1
- jy%=1
- gcw%=24
- gch%=24
- smode%=1
- chg%=0
- statuswin off
- gSETWIN 0,0,480,160
- position cp%
- l$=a.layout$
- sx%=a.startx%
- sy%=a.starty%
- ex%=a.exit%
- if wv%
- gUSE disp%
- gSETWIN 299,54
- gvisible on
- endif
- gUSE 1
- endif
- update:(dmode%,3)
- else
- if dmode%=1 :rem level viewer
- if ev%(1)=290
- mINIT
- mCARD "File","New file",%n,"Open file",%o,"Play file",%P
- mCARD "Edit","Insert level",%i,"Append level",%a,"Merge level",%m,"Duplicate level",%d,"Move level to",%s
- mCARD "Multiple","Insert levels",%I,"Append levels",%A,"Duplicate levels",%D
- mCARD "Level","Parameters",%p,"Jump to",%j
- mCARD "Special","Exit",%x
- ev%(1)=MENU
- endif
- if ev%(1)>512
- ev%(1)=ev%(1)-512
- endif
- if ev%(2) and 2 and ev%(1)>=%a and ev%(1)<=%z
- ev%(1)=ev%(1)-32
- endif
- if ev%(1)=13
- dmode%=2
- diampos 2
- cx%=0
- cy%=0
- jx%=1
- jy%=1
- gcw%=24
- gch%=24
- smode%=1
- chg%=0
- statuswin off
- gSETWIN 0,0,480,160
- position cp%
- l$=a.layout$
- sx%=a.startx%
- sy%=a.starty%
- ex%=a.exit%
- if wv%
- gUSE disp%
- gSETWIN 299,54
- gvisible on
- endif
- gUSE 1
- update:(dmode%,3)
- elseif ev%(1)=%P
- play:(f$)
- elseif ev%(1)=%x
- close
- return
- elseif ev%(1)=%o
- f$="\app\stigma\*.lev"
- dINIT "Open file"
- dfile f$,"File:",72
- lock on
- d%=dialog
- lock off
- if d%
- close
- xopen:(f$)
- ep%=1
- cp%=1
- update:(1,3)
- endif
- elseif ev%(1)=%n
- f$="\app\stigma\*.lev"
- dINIT "New file"
- dfile f$,"File:",81
- lock on
- d%=dialog
- lock off
- if d%
- close
- xcreate:(f$)
- ep%=1
- cp%=1
- update:(1,3)
- endif
- elseif ev%(1)=%p
- position cp%
- t&=a.time%
- a=a.accel
- f=a.frict
- n$=a.code$
- dINIT "Level parameters"
- dEDIT n$,"Name"
- dLONG t&,"Timer",0,998
- dFLOAT a,"Accel",0,3
- dFLOAT f,"Frict",0,3
- lock on
- d%=dialog
- lock off
- if d%
- a.time%=t&
- a.accel=a
- a.frict=f
- a.code$=n$
- update
- churn:(0,cp%)
- update:(1,cp%-ep%+1)
- endif
- elseif ev%(1)=%m :rem merge
- f2$="\app\stigma\*.lev"
- t%=2
- dINIT "Open file"
- dfile f2$,"File:",72
- dCHOICE t%,"Levels:","One,All"
- lock on
- d%=dialog
- lock off
- if d%
- open f2$,B,layout$,code$,time%,startx%,starty%,frict,accel,exit%
- if t%=1
- t&=1
- dINIT
- dLONG t&,"Level:",1,count
- lock on
- dialog
- lock off
- t%=t&
- else
- t%=0
- endif
- if t%=0 :rem all levels
- use A
- t&=count
- use B
- t%=count
- do
- A.layout$=B.layout$
- A.code$=B.code$
- A.time%=B.time%
- A.startx%=B.startx%
- A.starty%=B.starty%
- A.frict=B.frict
- A.accel=B.accel
- A.exit%=B.exit%
- use A
- append
- use B
- next
- t%=t%-1
- until t%=0
- use A
- t%=t&-cp%+1
- churn:(t%,cp%)
- else :rem just level t%
- use B
- position t%
- A.layout$=B.layout$
- A.code$=B.code$
- A.time%=B.time%
- A.startx%=B.startx%
- A.starty%=B.starty%
- A.frict=B.frict
- A.accel=B.accel
- A.exit%=B.exit%
- use A
- append
- churn:(0,cp%)
- endif
- use B
- close
- use A
- update:(1,3)
- endif
- elseif ev%(1)=%s :rem shift level1
- t&=cp%
- dINIT "Move level"
- dLONG t&,"New position:",1,count
- lock on
- d%=dialog
- lock off
- if d%
- position cp%
- update
- cp%=t&
- churn:(0,cp%)
- if cp%<count
- ep%=cp%
- else
- ep%=cp%-1
- endif
- update:(1,3)
- endif
- elseif ev%(1)=%j :rem jump to
- t&=cp%
- dINIT "Jump to level"
- dLONG t&,"Level",1,count
- lock on
- d%=dialog
- lock off
- if d%
- cp%=t&
- if cp%=count
- ep%=cp%-1
- else
- ep%=cp%
- endif
- update:(1,3)
- endif
- elseif ev%(1)=%d :rem duplicate
- position cp%
- append
- churn:(0,cp%)
- cp%=cp%+1
- if ep%<cp%-1
- ep%=ep%+1
- endif
- update:(1,3)
- elseif ev%(1)=%D :rem duplicate multi
- d%=multi%:("Duplicate")
- t%=count-cp%+1
- do
- position cp%
- append
- d%=d%-1
- until d%<1
- churn:(t%,cp%)
- update:(1,3)
- elseif ev%(1)=%i :rem insert
- blank:
- append
- churn:(0,cp%)
- update:(1,3)
- elseif ev%(1)=%I :rem insert multi
- d%=multi%:("Insert")
- t%=count-cp%+1
- blank:
- do
- append
- d%=d%-1
- until d%<1
- churn:(t%,cp%)
- update:(1,3)
- elseif ev%(1)=%a :rem append
- blank:
- append
- cp%=count
- ep%=cp%-1
- update:(1,3)
- elseif ev%(1)=%A :rem append multi
- d%=multi%:("Append")
- blank:
- do
- append
- d%=d%-1
- until d%<1
- cp%=count
- ep%=cp%-1
- update:(1,3)
- elseif ev%(1)=8 :rem delete
- position cp%
- if count=1
- giprint "Can't delete last level!"
- else
- dINIT "Delete level "+a.code$+"?"
- dBUTTONS "No",%N,"Yes",%y
- lock on
- d%=dialog
- lock off
- if d%=%y
- erase
- ep%=min(ep%,max(count-1,1))
- cp%=min(cp%,count)
- update:(1,3)
- endif
- endif
- elseif ev%(1)=257 :rem down
- if ev%(2) and 2
- if cp%<count
- position cp%
- update
- cp%=cp%+1
- churn:(0,cp%)
- if cp%>ep%+1
- ep%=ep%+1
- endif
- update:(1,3)
- endif
- else
- cp%=min(cp%+1,count)
- if cp%>ep%+1
- ep%=ep%+1
- gSCROLL 0,-80
- update:(1,2)
- endif
- endif
- elseif ev%(1)=256 :rem up
- if ev%(2) and 2
- if cp%>1
- position cp%
- update
- cp%=cp%-1
- churn:(0,cp%)
- if cp%<ep%
- ep%=cp%
- endif
- update:(1,3)
- endif
- else
- cp%=max(cp%-1,1)
- if cp%<ep%
- ep%=ep%-1
- gSCROLL 0,80
- update:(1,1)
- endif
- endif
- elseif ev%(1)=260 :rem PgUp
- cp%=max(cp%-10,1)
- ep%=cp%
- update:(1,3)
- elseif ev%(1)=261 :rem PgDn
- cp%=min(cp%+10,count)
- ep%=cp%-1
- update:(1,3)
- elseif ev%(1)=262 :rem home
- ep%=1
- cp%=1
- update:(1,3)
- elseif ev%(1)=263 :rem end
- ep%=count-1
- cp%=count
- update:(1,3)
- endif
- else :rem editor
- if ev%(1)=290
- mINIT
- mCARD "Layout","Revert",%v,"Fill with tile",%f
- mCARD "Tile","Get current",%g,"Toggle tile display",%w
- mCARD "Level","Place start",%s,"Place exit",%e,"Next",%n,"Previous",%p,"Jump to",%j
- ev%(1)=MENU
- endif
- if ev%(1)>512
- ev%(1)=ev%(1)-512
- endif
- if ev%(2) and 2 and ev%(1)>=%a and ev%(1)<=%z
- ev%(1)=ev%(1)-32
- endif
- if ev%(1)=%v
- position cp%
- l$=a.layout$
- sx%=a.startx%
- sy%=a.starty%
- ex%=a.exit%
- chg%=0
- update:(2,2)
- elseif ev%(1)=%n or ev%(1)=%p or ev%(1)=%j
- if chg%
- a.layout$=l$
- a.startx%=sx%
- a.starty%=sy%
- a.exit%=ex%
- update
- churn:(0,cp%)
- endif
- if ev%(1)=%n
- cp%=min(cp%+1,count)
- if ep%<cp%-1
- ep%=ep%+1
- endif
- elseif ev%(1)=%p
- cp%=max(cp%-1,1)
- if cp%<ep%
- ep%=cp%
- endif
- else
- t&=cp%
- dINIT "Jump to level"
- dLONG t&,"Level",1,count
- lock on
- d%=dialog
- lock off
- if d%
- cp%=t&
- if cp%=count
- ep%=cp%-1
- else
- ep%=cp%
- endif
- endif
- endif
- chg%=0
- position cp%
- l$=a.layout$
- sx%=a.startx%
- sy%=a.starty%
- ex%=a.exit%
- update:(2,2)
- elseif ev%(1)=%s
- smode%=2
- cx%=sx%
- cy%=sy%
- jx%=1
- jy%=1
- gcw%=24
- gch%=24
- giprint ""
- busy "Placing start"+chr$(1)
- elseif ev%(1)=%e
- smode%=3
- cy%=ex%/20
- cx%=ex%-cy%*20
- jx%=1
- jy%=1
- gcw%=24
- gch%=24
- giprint ""
- busy "Placing exit"+chr$(1)
- elseif ev%(1)=27
- busy off
- smode%=1
- elseif ev%(1)=%f
- l$=rept$(chr$(34+tle%),120)
- update:(2,2)
- chg%=1
- elseif ev%(1)=%w
- wv%=1-wv%
- gUSE disp%
- if wv%=1
- gVISIBLE ON
- else
- gVISIBLE OFF
- endif
- gUSE 1
- elseif ev%(1)=9
- tle%=pickt%:
- update:(2,1)
- elseif ev%(1)=%g
- tle%=asc(mid$(l$,cx%+cy%*20+1,1))-34
- update:(2,1)
- elseif ev%(1)=256 :rem up
- if ev%(2) and 4
- tle%=min(tle%+1,60)
- update:(2,1)
- else
- if ev%(2) and 2
- jy%=max(1,jy%-1)
- gch%=jy%*24
- else
- cy%=max(cy%-1,0)
- endif
- endif
- elseif ev%(1)=257 :rem down
- if ev%(2) and 4
- tle%=max(tle%-1,1)
- update:(2,1)
- else
- if ev%(2) and 2
- jy%=min(6-cy%,jy%+1)
- gch%=jy%*24
- else
- cy%=min(cy%+1,6-jy%)
- endif
- endif
- elseif ev%(1)=258 :rem right
- if ev%(2) and 4
- tle%=min(tle%+1,60)
- update:(2,1)
- else
- if ev%(2) and 2
- jx%=min(20-cx%,jx%+1,10)
- gcw%=jx%*24
- else
- cx%=min(cx%+1,20-jx%)
- endif
- endif
- elseif ev%(1)=259 :rem left
- if ev%(2) and 4
- tle%=max(tle%-1,1)
- update:(2,1)
- else
- if ev%(2) and 2
- jx%=max(1,jx%-1)
- gcw%=jx%*24
- else
- cx%=max(cx%-1,0)
- endif
- endif
- elseif ev%(1)=260 :rem PgUp
- cy%=0
- elseif ev%(1)=261 :rem PgDn
- cy%=6-jy%
- elseif ev%(1)=262 :rem Home
- cx%=0
- elseif ev%(1)=263 :rem End
- cx%=20-jx%
- elseif ev%(1)=13 or ev%(1)=32
- if smode%=1
- l$=ins$:(l$,cx%,cy%,jx%,jy%,tle%)
- elseif smode%=2
- sx%=cx%
- sy%=cy%
- smode%=1
- busy off
- giprint "Placed start",1
- elseif smode%=3
- ex%=cx%+20*cy%
- smode%=1
- busy off
- giprint "Placed exit",1
- endif
- chg%=1
- endif
- gUSE disp%
- if cx%<10
- gSETWIN 299,54
- else
- gSETWIN 59,54
- endif
- gUSE 1
- gAT 372,158
- gprintb id$(asc(mid$(l$,cx%+cy%*20+1,1))-34),108,1
- endif
- endif
- if dmode%=1
- if cp%=ep%+1
- gcy%=84
- else
- gcy%=4
- endif
- else
- gcx%=cx%*24
- gcy%=cy%*24
- endif
- endif
- until 0
- ENDP
-
- PROC xopen:(file$)
- open file$,A,layout$,code$,time%,startx%,starty%,frict,accel,exit%
- setname file$
- ENDP
-
- PROC xcreate:(file$)
- trap delete file$
- create file$,A,layout$,code$,time%,startx%,starty%,frict,accel,exit%
- blank:
- append
- setname file$
- ENDP
-
- PROC draw:(pic%)
- LOCAL picX%,picY%,temp%
- temp%=pic%-1
- picY%=INT(temp%/20)
- picX%=temp%-picY%*20
- picX%=picX%*24
- picY%=picY%*24
- gCOPY graphic%,picX%,picY%,24,24,3
- ENDP
-
- PROC drawlev:(lev$,xb%,yb%)
- local dx%,dy%,ctr%,tile%,sy%,sx%
- dx%=0
- dy%=0
- ctr%=1
- DO
- gAT dx%+xb%,dy%+yb%
- tile%=ASC(MID$(lev$,ctr%,1))-35
- sy%=INT(tile%/20)
- sx%=tile%-sy%*20
- gCOPY graphic%,sx%*12,sy%*12+119,12,12,3
- dx%=dx%+12
- IF dx%>228
- dx%=0
- dy%=dy%+12
- ENDIF
- ctr%=ctr%+1
- UNTIL ctr%=121
- ENDP
-
- PROC churn:(ka%,v%)
- local k%
- k%=ka%
- if k%=0
- k%=count-v%
- endif
- busy "Churning file"+chr$(1),1,3
- while k%>0
- position v%
- update
- k%=k%-1
- endwh
- busy off
- ENDP
-
- PROC update:(m%,k%)
- gUPDATE OFF
- if k%=3
- gCLS
- endif
- if m%=1
- if k% and 1
- slev:(ep%,0)
- endif
- if k% and 2
- slev:(ep%+1,1)
- endif
- else
- if k% and 1
- position cp%
- gUSE disp%
- gAT 49,7
- draw:(tle%)
- gAT 7,42
- gprintb id$(tle%),108,3
- gUSE 1
- endif
- if k% and 2
- gAT 0,144
- gFILL 480,16,1
- position cp%
- gAT 0,158
- gPRINT cp%,a.code$,"T";a.time%,"A";a.accel,"F";a.frict
- llev:
- gAT 372,158
- gprintb id$(asc(mid$(l$,cx%+cy%*20+1,1))-34),108,1
- endif
- endif
- gUPDATE ON
- ENDP
-
- PROC slev:(lev%,pos%)
- global ay%
- ay%=pos%*80
- if lev%>count
- gAT 0,ay%
- gFILL 416,80,1
- else
- position lev%
- gtxt:(gen$(lev%,3)+": "+a.code$,0)
- gtxt:("Timer: "+gen$(a.time%,3),1)
- gtxt:("Accel: "+gen$(a.accel,5),2)
- gtxt:("Friction: "+gen$(a.frict,5),3)
- drawlev:(a.layout$,176,ay%+4)
- endif
- ENDP
-
- PROC gtxt:(v$,y%)
- local x%
- x%=gTWIDTH(v$)
- gAT 0,y%*15+ay%+23-13
- gFILL 176,13,1
- gAT 88-x%/2,y%*15+ay%+23
- gPRINT v$
- ENDP
-
- PROC llev:
- LOCAL ctr%,wkx%,wky%,glyph%
- ctr%=1
- wkx%=0
- wky%=0
- DO
- glyph%=ASC(MID$(l$,ctr%,1))-34
- gAT wkx%*24,wky%*24
- Draw:(glyph%)
- wkx%=wkx%+1
- IF wkx%>19
- wkx%=0
- wky%=wky%+1
- ENDIF
- ctr%=ctr%+1
- UNTIL ctr%=121
- ENDP
-
- PROC ins$:(a$,x%,y%,vx%,vy%,v%)
- local d%,k$(120),tx%,ty%
- k$=a$
- tx%=x%
- do
- ty%=y%
- do
- gAT tx%*24,ty%*24
- draw:(v%)
- d%=tx%+ty%*20+1
- k$=left$(k$,d%-1)+chr$(v%+34)+mid$(k$,d%+1,120)
- ty%=ty%+1
- until ty%>y%+vy%-1
- tx%=tx%+1
- until tx%>x%+vx%-1
- return k$
- ENDP
-
- PROC setpick:
- local t%,x%,y%
- if gw%=0
- gw%=gCREATE(54,26,372,108,0,1)
- gXBORDER 1,$403
- t%=1
- y%=0
- do
- x%=0
- do
- gAT x%*24+6,y%*24+6
- draw:(t%)
- t%=t%+1
- x%=x%+1
- until x%=15
- y%=y%+1
- until y%=4
- gUSE 1
- endif
- ENDP
-
- PROC pickt%:
- local t%,x%,y%,k%
- lock on
- gUSE gw%
- gVISIBLE ON
- t%=tle%
- y%=(t%-1)/15
- x%=t%-(y%*15)-1
- cursor gw%,0,24,24
- do
- gAT x%*24+6,y%*24+6
- k%=get
- if k%=256
- y%=max(y%-1,0)
- elseif k%=257
- y%=min(y%+1,3)
- elseif k%=258
- x%=min(x%+1,14)
- elseif k%=259
- x%=max(x%-1,0)
- elseif k%=260
- y%=0
- elseif k%=261
- y%=3
- elseif k%=262
- x%=0
- elseif k%=263
- x%=14
- endif
- t%=x%+y%*15+1
- giprint id$(t%)
- until k%=27 or k%=9 or k%=32 or k%=13
- cursor off
- gVISIBLE OFF
- gUSE 1
- lock off
- return t%
- ENDP
-
- PROC blank:
- a.layout$="&"+rept$(chr$(35),119)
- a.code$="Blank"
- a.time%=350
- a.startx%=0
- a.starty%=0
- a.accel=.59
- a.frict=.18
- a.exit%=0
- ENDP
-
- PROC multi%:(p$)
- local k&,k%
- k&=1
- dINIT p$+" levels"
- dLONG k&,"Number:",1,100
- dialog
- k%=k&
- return k%
- ENDP
-
- PROC setstr:
- id$(1)="Clear"
- id$(2)="Ex wall "+chr$(27)+chr$(26)
- id$(3)="Ex wall "+chr$(24)+chr$(25)
- id$(4)="Orb"
- id$(5)="Space"
- id$(6)="Ice"
- id$(7)="Mud"
- id$(8)="Rubber"
- id$(9)="Wall "+chr$(27)+chr$(26)
- id$(10)="Wall "+chr$(24)+chr$(25)
- id$(11)="Wall "+chr$(25)+chr$(26)
- id$(12)="Wall "+chr$(27)+chr$(25)
- id$(13)="Wall "+chr$(24)+chr$(26)
- id$(14)="Wall "+chr$(27)+chr$(24)
- id$(15)="Wall "+chr$(27)+chr$(25)+chr$(26)
- id$(16)="Wall "+chr$(27)+chr$(24)+chr$(26)
- id$(17)="Wall "+chr$(27)+chr$(24)+chr$(25)
- id$(18)="Wall "+chr$(24)+chr$(25)+chr$(26)
- id$(19)="Wall "+chr$(24)
- id$(20)="Wall "+chr$(25)
- id$(21)="Wall "+chr$(27)
- id$(22)="Wall "+chr$(26)
- id$(23)="Cracked wall "+chr$(27)+chr$(26)
- id$(24)="Cracked wall "+chr$(24)+chr$(25)
- id$(25)="Arrow "+chr$(27)
- id$(26)="Arrow "+chr$(26)
- id$(27)="Arrow "+chr$(24)
- id$(28)="Arrow "+chr$(25)
- id$(29)="Rebounder"
- id$(30)="Wall zapper"
- id$(31)="Cracked tower"
- id$(32)="Ex tower"
- id$(33)="Tower"
- id$(34)="Attractor "+chr$(27)
- id$(35)="Attractor "+chr$(26)
- id$(36)="Attractor "+chr$(24)
- id$(37)="Attractor "+chr$(25)
- id$(38)="Magnet"
- id$(39)="Attractor "+chr$(24)+chr$(27)
- id$(40)="Attractor "+chr$(24)+chr$(26)
- id$(41)="Attractor "+chr$(25)+chr$(27)
- id$(42)="Attractor "+chr$(25)+chr$(26)
- id$(43)="Studded"
- id$(44)="Door switch"
- id$(45)="Key"
- id$(46)="Locked door "+chr$(24)+chr$(25)
- id$(47)="Locked door "+chr$(27)+chr$(26)
- id$(48)="Open door "+chr$(24)+chr$(25)
- id$(49)="Open door "+chr$(27)+chr$(26)
- id$(50)="Teleport"
- id$(51)="Spiked wall"
- id$(52)="Cracked tile"
- id$(53)="Grating"
- id$(54)="Pseudo-exit"
- id$(55)="Exit"
- id$(56)="Skull"
- id$(57)="1-way door "+chr$(25)
- id$(58)="1-way door "+chr$(24)
- id$(59)="1-way door "+chr$(27)
- id$(60)="1-way door "+chr$(26)
- ENDP
-
- PROC play:(f$)
- local b$(20),d%
- local c$(30),rec$(40),hi$(40),wk$(30),fn$(8)
- local b%,c%,i%,pid%,v%(6)
- lock on
- close
- trap mkdir "\app\stigma"
- parse$(f$,"",v%())
- wk$=mid$(f$,v%(1),v%(4)-v%(1))
- fn$=mid$(f$,v%(4),v%(5)-v%(4))
- rem locate stigma resources
- if comm%=1
- rec$="m:\gpk\"
- hi$="m:\gpk\"
- else
- rec$="\"
- hi$="m:\"
- endif
- trap mkdir rec$
- trap mkdir hi$
- rem if not exist original, copy stigma to original (hi/rec too)
- if not exist("\app\stigma\original.lev")
- copy tg$+"stigma.lev","\app\stigma\original.lev"
- trap copy rec$+"stigma.rec","\app\stigma\original.rec"
- trap copy hi$+"stigma.hi","\app\stigma\stigma.hi"
- endif
- rem get filename
- rem copy level file
- copy f$,tg$+"stigma.lev"
- rem copy *.hi, *.rec
- if exist (wk$+fn$+".hi")
- copy wk$+fn$+".hi",hi$+"stigma.hi"
- else
- trap delete hi$+"stigma.hi"
- endif
- if exist (wk$+fn$+".rec")
- copy wk$+fn$+".rec",rec$+"stigma.rec"
- else
- trap delete rec$+"stigma.rec"
- endif
- rem launch stigma
- i%=addr(pid%)
- b%=addr(b$)+1
- c%=addr(c$)
- rem stigma_s.gam, stigma.app
- b$="ROM::sys$prgo"+chr$(0)
- if comm%
- c$="RunOpl"+rept$(chr$(0),2)+dr$+":\app\stigma.app"+chr$(0)
- else
- c$="RunOpl"+rept$(chr$(0),2)+dr$+":\app\stigma_s.gam"+chr$(0)
- endif
- call($0187,b%,c%,d%,0,i%)
- call($0688,pid%)
- rem wait
- v%(6)=0
- do
- getevent v%()
- if v%(1)=$401
- v%(2)=call($0288,pid%)
- if (v%(2) and 255)<>$70
- v%(6)=1
- else
- call($998d,0,pid%)
- endif
- endif
- until v%(6)=1
- rem copy back
- copy rec$+"stigma.rec",wk$+fn$+".rec"
- copy hi$+"stigma.hi",wk$+fn$+".hi"
- xopen:(f$)
- lock off
- ENDP
-
- PROC callme:(v$)
- local k$(9),m%
- pid%=call($88)
- k$=v$+chr$(0)
- m%=addr(k$)+1
- call($c88,pid%,0,0,0,m%)
- ENDP
-