6 w1$="file:///C:/predefgallery/predefrecordings/location/":w2$="file:///E:/map1/":w3$="file:///E:/location/location/"
8 w4$="file:///E:/monster/":w5$="file:///C:/predefgallery/predefrecordings/state/_":w6$="file:///E:/monster_inf/":w7$="file:///E:/monster_ability/":sy$="|":sy2$="_"
10 gelload "r",w1$+"r.png"
11 gelload "sp",w1$+"sp.png"
12 gelload "h",w1$+"h.png":spritegel "h","h"
13 gelload "m",w1$+"m.png"
14 gelload "f",w1$+"field.png"
15 gelload "t",w1$+"tree.png"
16 gelload "cl1",w1$+"cl1.png":gelload "cl2",w1$+"cl2.png"
17 gelload "gk",w1$+"gk.png":spritegel "gk","gk":spritemove "gk",-40,0
18 gelload "c1",w1$+"c1.png":spritegel "c1","c1":spritemove "c1",-40,0
19 gelload "hm",w1$+"hm.png":spritegel "hm","hm"
20 gelload "tmn",w1$+"tmn.png"
21 gelload "tmi",w1$+"tmi.png"
22 gelload "thp",w1$+"thp.png"
23 gelload "thp2",w1$+"thp2.png"
24 gelload "t",w1$+"t.png"
25 gelload "agr",w1$+"agr.png"
30 sw%=screenwidth(0):sh%=screenheight(0):hx=120:hy=160:hsp=10:msp=3:hw=gelwidth("h"):hh=gelheight("h"):rw=gelwidth("r"):rh=gelheight("r"):mw=gelwidth("m"):mh=gelheight("m")
32 tw=gelwidth("t"):th=gelheight("t"):cx%=hx:cy%=hy:csp1%=12:csp2%=4:csp%=csp1%:cw%=gelwidth("c1"):ch%=gelheight("c1"):hmx=cx%:hmy=cy%
34 rx=sw%-rw-12:ry=12:spx=rx+14:spy=ry+rh+8:rwq=2650/rw:rhq=2650/rh:fw%=gelwidth("f"):fh%=gelheight("f"):hmw=gelwidth("hm"):hmh=gelheight("hm"):tmw=gelwidth("tmn"):tmh=gelheight("tmi"):agrh=gelheight("agr"):hst$="st":ha$="n":tar$="":cse$="n":ise$="off"
36 dt%=1:dcl%=1
38 gosub 370
40 gosub 480
42 slx%=sw%/2-hx:sly%=sh%/2-hy
44 gosub 200:gosub 630:gosub 1170:gosub 530:gosub 950
46 hrx=rx+rw/2:hry=ry+rh/2
48 for mr%=0 to am%-1
50 mrx(mr%)=hrx+(mx(mr%)-hx)/rwq:mry(mr%)=hry+(my(mr%)-hy)/rhq
52 next mr%
54 drawgel "r",rx,ry
56 drawgel "sp",spx,spy:spritemove "c1",cx%-7,cy%-4
60 IF UP(0) THEN cy%=cy%-csp%:hmy=hmy-csp%
61 IF DOWN(0) THEN cy%=cy%+csp%:hmy=hmy+csp%
62 IF LEFT(0) THEN cx%=cx%-csp%:hmx=hmx-csp%
63 IF RIGHT(0) THEN cx%=cx%+csp%:hmx=hmx+csp%
70 IF cx%<0 THEN slx%=slx%+csp%:cx%=cx%+csp%:clr$="l":clr=csp%:gosub 600
71 IF cy%<0 THEN sly%=sly%+csp%:cy%=cy%+csp%:clr$="u":clr=csp%:gosub 600
72 IF cx%+cw%>sw% THEN slx%=slx%-csp%:cx%=cx%-csp%:clr$="r":clr=-csp%:gosub 600
73 IF cy%+ch%>sh% THEN sly%=sly%-csp%:cy%=cy%-csp%:clr$="d":clr=-csp%:gosub 600
74 gosub 720
76 IF tar$="mob" THEN gosub 790
80 IF hx+hw>dx%*sc% THEN hx=dx%*sc%-hw:hst$="st"
82 IF hy+hh>dy%*sc% THEN hy=dy%*sc%-hh:hst$="st"
84 IF hx<0 THEN hx=0:hst$="st"
86 IF hy<0 THEN hy=0:hst$="st"
90 setcolor 220,102,102
92 for rr%=0 to am%-1
94 l%(rr%)=sqr ((mx(rr%)-hx)^2+(my(rr%)-hy)^2)
96 IF l%(rr%)<910 THEN fillrect mrx(rr%),mry(rr%),2,2
97 goto 102
98 setcolor 255,255,255
100 drawstring str$(l%(rr%)),spx+4+28*rr%,spy+18
102 next rr%
104 gosub 560
106 gosub 580
108 gosub 350:gosub 340
110 IF FIRE(0) AND cse$="n" THEN hst$="m":hmx2=hmx:hmy2=hmy
111 IF ha$="m" THEN hst$="m":hmx2=mx(tar%):hmy2=my(tar%)
112 IF hst$="m" THEN gosub 670
114 IF hst$="st" THEN spritemove "hm",-hmw,0
116 setcolor 255,255,255
118 drawstring nick$,slx%+hx-hw/2-stw(nick$)/4,sly%+hy-hh/2-18
120 re:sleep 70:goto 44
200 for fx%=0 to sw% step fw%
202 for fy%=0 to sh% step fh%
204 drawgel "f",fx%,fy%
206 next fy%
208 next fx%
210 setcolor 255,255,255:drawstring str$(hp%)+" / "+str$(mhp%),0,0
212 hp%=hp%+2
214 IF hp%>mhp% THEN hp%=mhp%
216 RETURN
218 tn%=milliseconds(0)
219 RETURN
220 OPEN #0,w$+fn$+".dat","input"
222 t$=""
224 GET #0,i%
226 IF i%=10 THEN CLOSE #0:goto 234
228 i$=chr$(i%)
230 t$=t$+i$
232 goto 224
234 dim n$(d%)
236 p%=1
238 for dn%=0 to d%-1
240 for l%=1 to len(t$)
242 n$(dn%)=mid$(t$,p%,l%)
244 IF RIGHT$(n$(dn%),1)=sy$ THEN n$(dn%)=mid$(t$,p%,l%-1):goto 248
246 next l%
248 p%=p%+l%
250 next dn%
252 RETURN
260 dx%=lw%/sc%:dy%=lh%/sc%
262 dim lx%(dx%)
264 for x%=0 to dx%-1
266 lx%(x%)=sc%*x%
268 next x%
270 dim ly%(dy%)
272 for y%=0 to dy%-1
274 ly%(y%)=sc%*y%
276 next y%
278 dim dtx%(dt%):dim dty%(dt%)
280 for wdtx%=0 to dt%-1
282 dtx%(wdtx%)=lw%/2+mod(rnd(0),lw%/2)
284 next wdtx%
286 for wdty%=0 to dt%-1
288 dty%(wdty%)=lh%/2+mod(rnd(0),lh%/2)
290 next wdty%
292 for dts%=0 to dt%-1
294 spritegel "t"+str$(dts%),"t"
296 spritemove "t"+str$(dts%),slx%+dtx%(dts%),sly%+dty%(dts%)-th
298 next dts%
300 dim clx%(dcl%):dim cly%(dcl%):dim clsp%(dcl%):dim clw(dcl%)
302 for dcls%=0 to dcl%-1
304 clx%(dcls%)=sw%+sw%/2+mod(rnd(0),sw%/2):cly%(dcls%)=sh%/2+mod(rnd(0),sh%/2):clsp%(dcls%)=3+mod(rnd(0),3)
306 rcl%=rand(1,3):clw(dcls%)=gelwidth("cl"+str$(rcl%))
308 spritegel "cl"+str$(dcls%),"cl"+str$(rcl%)
310 spritemove "cl"+str$(dcls%),clx%(dcls%),cly%(dcls%)
312 next dcls%
314 RETURN
320 for selx%=0 to dx%-1
322 IF hx>lx%(selx%) OR hx=lx%(selx%) THEN dlx%=selx%
324 next selx%
326 for sely%=0 to dy%-1
328 IF hy>ly%(sely%) OR hy=ly%(sely%) THEN dly%=sely%
330 next sely%
332 dl%=dlx%+dly%*dy%
334 RETURN
340 IF hx<lx%(dlx%) OR hx>lx%(dlx%)+sc%-1 OR hy<ly%(dly%) OR hy>ly%(dly%)+sc%-1 THEN tar$="":gosub 320:gosub 480
342 RETURN
350 iwy%=sh%-72
352 setcolor 0,0,0
354 fillrect 0,iwy%,72,72
356 setcolor 255,255,255
358 drawstring "hx: "+str$(hx),4,iwy%
360 drawstring "hy: "+str$(hy),4,iwy%+18
362 drawstring "hst: "+hst$,4,iwy%+36
364 drawstring "ha: "+ha$,4,iwy%+54
366 RETURN
370 w$=w5$:fn$="nick":d%=2:gosub 220
372 lvl%=val(n$(0)):nick$=n$(1)
374 fn$="state":d%=6:gosub 220
376 hp%=val(n$(0)):mhp%=val(n$(1)):mp%=val(n$(2)):mmp%=val(n$(3)):exp%=val(n$(4)):mexp%=val(n$(5))
378 fn$="reg":d%=2:gosub 220
380 hpr%=val(n$(0)):mpr%=val(n$(1))
382 fn$="state_ch":d%=4:gosub 220
384 pa%=val(n$(0)):ma%=val(n$(1)):pd%=val(n$(2)):md%=val(n$(3))
386 fn$="critical":d%=2:gosub 220
388 pcr%=val(n$(0)):mcr%=val(n$(1))
400 spritemove "h",-hw,0:spritemove "hm",-hmw,0
402 w$=w1$:fn$="sc":d%=1:gosub 220
404 sc%=val(n$(0))
406 fn$="loc":d%=3:gosub 220
408 lw%=(val(n$(0))/4)*sc%:lh%=(val(n$(1))/4)*sc%:lna$=n$(2)
410 gosub 260:gosub 320
412 w$=w3$+lna$+"/":fn$="_mn":d%=1:gosub 220
414 dmn%=val(n$(0))
416 d%=2
418 dim dmlvl%(dmn%):dim dmna$(dmn%):dim dmdr$(dmn%)
420 for wd%=0 to dmn%-1
422 fn$="m"+str$(wd%):gosub 220:dmlvl%(wd%)=val(n$(0)):dmna$(wd%)=n$(1)
424 fn$="dr"+str$(wd%):gosub 1350:t$=t$+"/"
426 dmdr$(wd%)=t$
428 next wd%
430 dim dmagr%(dmn%):dim dmhp%(dmn%):dim dmmp%(dmn%):dim dmexp%(dmn%):dim dmsp%(dmn%):dim dmpa%(dmn%):dim dmma%(dmn%):dim dmpd%(dmn%):dim dmmd%(dmn%)
432 w$=w4$
434 for wd2%=0 to dmn%-1
436 fn$=str$(dmlvl%(wd2%))+"/"+dmna$(wd2%):d%=7:gosub 220
438 IF n$(2)="-" THEN dmagr%(wd2%)=0:goto 442
440 dmagr%(wd2%)=val(n$(2))
442 dmhp%(wd2%)=val(n$(3)):dmmp%(wd2%)=val(n$(4)):dmexp%(wd2%)=val(n$(5)):dmsp%(wd2%)=val(n$(6))
444 dmpa%(wd2%)=dmlvl%(wd2%)*14:dmma%(wd2%)=dmlvl%(wd2%)*9:dmpd%(wd2%)=dmlvl%(wd2%)*24:dmmd%(wd2%)=dmlvl%(wd2%)*11
446 next wd2%
448 gosub 1000
450 dxy%=dx%*dy%
452 dim lxy%(dxy%):dim lm$(dxy%)
454 for wdm%=0 to dxy%-1
456 am%=rand(1,3)
458 lxy%(wdm%)=am%:lm$(wdm%)=""
460 dim mn%(am%)
462 for wam%=0 to am%-1
464 mn%(wam%)=rand(0,dmn%-1)
466 lm$(wdm%)=lm$(wdm%)+str$(mn%(wam%))+sy$
468 next wam%
470 next wdm%
472 gkx=lw%/2+mod(rnd(0),lw%/2):gky=lh%/2+mod(rnd(0),lh%/2)
474 spritemove "gk",slx%+gkx,sly%+gky:spritemove "h",sw%/2-hw/2,sh%/2-hh/2
476 RETURN
480 IF lxy%(dl%)=0 THEN RETURN
482 mv%=lxy%(dl%)
484 t$=lm$(dl%):d%=mv%:gosub 234
486 dim lm2%(mv%)
488 for wmv%=0 to mv%-1
490 lm2%(wmv%)=val(n$(wmv%))
492 next wmv%
494 dim rex(mv%):dim rey(mv%)
496 for v%=0 to mv%-1
498 xm%=lx%(dlx%)+sc%/2:ym%=ly%(dly%)+sc%/2
500 rex(v%)=xm%+mod(rnd(0),sc%/2-sc%/6):rey(v%)=ym%+mod(rnd(0),sc%/2-sc%/6)
502 next v%
504 am%=lxy%(dl%)*10
506 dim mhp%(am%):dim mmp%(am%):dim mpa%(am%):dim mma%(am%):dim mpd%(am%):dim mmd%(am%):dim magr%(am%):dim mx(am%):dim my(am%):dim l%(am%):dim mrx(am%):dim mry(am%):dim mst$(am%):dim ma$(am%):dim mtar$(am%):dim mmx(am%):dim mmy(am%):dim mdam%(am%):dim mdt%(am%):dim mrt%(am%)
508 for wam%=0 to am%-1
510 ncd%=wam%/10
512 mhp%(wam%)=dmhp%(ncd%):mmp%(wam%)=dmmp%(ncd%):mpa%(wam%)=dmpa%(ncd%):mma%(wam%)=dmma%(ncd%):mpd%(wam%)=dmpd%(ncd%):mmd%(wam%)=dmmd%(ncd%):magr%(wam%)=dmagr%(ncd%)
514 mx(wam%)=rex(ncd%)+mod(rnd(0),200):my(wam%)=rey(ncd%)+mod(rnd(0),199):l%(wam%)=40:mst$(wam%)="st":ma$(wam%)="n":mtar$(wam%)="":mmx(wam%)=mx(wam%):mmy(wam%)=my(wam%):mdam%(wam%)=0
516 spritegel "m"+str$(wam%),"m"
518 spritemove "m"+str$(wam%),-50,0
520 next wam%
522 RETURN
530 setfont 1
532 for mm%=0 to am%-1
534 IF mst$(mm%)="r" THEN goto 552
536 spritemove "m"+str$(mm%),slx%+mx(mm%),sly%+my(mm%)
538 mv%=lm2%(mm%/10)
540 setcolor 255,255,255
542 IF mhp%(mm%)=0 THEN drawstring "dead"+" "+mst$(mm%),slx%+mx(mm%)-8,sly%+my(mm%)-18:goto 552
544 drawstring dmna$(mv%),slx%+mx(mm%)-stw(dmna$(mv%))/2+mw/2,sly%+my(mm%)-18
546 drawstring str$(dmlvl%(mv%))+" "+mst$(mm%),slx%+mx(mm%),sly%+my(mm%)-36
548 setcolor 255,0,0
550 IF dmagr%(mv%)>0 THEN drawstring "*",slx%+mx(mm%)-stw(dmna$(mv%))/2+mw/2-8,sly%+my(mm%)-18
552 next mm%
554 RETURN
560 for drt%=0 to dt%-1
562 IF dtx%(drt%)>hx-sw%/2-tw*2 AND dtx%(drt%)<hx+sw%/2+tw*2 AND dty%(drt%)>hy-sh%/2-th*2 AND dty%(drt%)<hx+sh%/2+th*2 THEN spritemove "t"+str$(drt%),slx%+dtx%(drt%),sly%+dty%(drt%)-th
564 next drt%
566 setcolor 255,255,255
568 IF gkx>hx-sw%/2-hw*2 AND gkx<hx+sw%/2+hw*2 AND gky>hy-sh%/2-hh*2 AND gky<hx+sh%/2+hh*2 THEN spritemove "gk",slx%+gkx,sly%+gky:drawstring "Gatekeeper",slx%+gkx-28,sly%+gky-18
570 RETURN
580 for mcl%=0 to dcl%-1
582 IF clx%(mcl%)<-clw(mcl%)-10 THEN clsp%(mcl%)=0
584 IF clsp%(mcl%)=0 THEN gosub 594
586 clx%(mcl%)=clx%(mcl%)-clsp%(mcl%)
588 spritemove "cl"+str$(mcl%),clx%(mcl%),cly%(mcl%)
590 next mcl%
592 RETURN
594 rw%=rand(10,50):clx%(mcl%)=sw%+clw(mcl%)+rw%:cly%(mcl%)=sh%/2+mod(rnd(0),sh%/2):clsp%(mcl%)=3+mod(rnd(0),3):rcl%=rand(1,3)
596 clw(mcl%)=gelwidth("cl"+str$(rcl%)):spritegel "cl"+str$(mcl%),"cl"+str$(rcl%):spritemove "cl"+str$(mcl%),clx%(mcl%),cly%(mcl%)
598 RETURN
600 spritemove "h",slx%+hx-hw/2,sly%+hy-hh/2
602 for mcl2%=0 to dcl%-1
604 IF clr$="r" OR clr$="l" THEN clx%(mcl2%)=clx%(mcl2%)+clr
606 IF clr$="u" OR clr$="d" THEN cly%(mcl2%)=cly%(mcl2%)+clr
608 next mcl2%
610 RETURN
630 for bat%=0 to am%-1
632 setcolor 255,255,0
634 IF mst$(bat%)="d" OR mst$(bat%)="r" THEN goto 657
636 crch%=3+mod(rnd(0),4)
638 IF crch%<3 THEN cr%=0:goto 642
640 setcolor 255,128,0
642 cr%=pcr%/2-mod(rnd(0),pcr%/2)
644 dam%=mpd%(bat%)-pa%-cr%
646 IF dam%>0 THEN dam%=0
648 IF INKEY(0)=35 AND tar$="mob" AND tar%=bat% THEN ha$="m"
650 IF l%(bat%)<40 AND tar%=bat% AND ha$="m" THEN ha$="a"
652 IF tar%=bat% AND ha$="a" THEN hst$="st":ha$="n":mhp%(bat%)=mhp%(bat%)+dam%:drawstring str$(dam%),slx%+mx(bat%)+30,sly%+my(bat%)-36:mtar$(tar%)=nick$:ma$(tar%)="a"
654 IF (l%(bat%)<40 AND dmagr%(lm2%(bat%/10))>0 AND mst$(bat%)="st" AND ma$(bat%)="n") OR (l%(bat%)>42 AND ma$(bat%)="a") THEN mtar$(bat%)=nick$:ma$(bat%)="m":mmx(bat%)=hx:mmy(bat%)=hy:drawgel "agr",slx%+mx(bat%),sly%+my(bat%)-36-agrh
656 IF mhp%(bat%)<=0 AND mst$(bat%)="st" THEN mhp%(bat%)=0:ha$="n":mst$(tar%)="d":ma$(tar%)="n":mtar$(bat%)="":gosub 218:mdt%(bat%)=tn%
657 IF ma$(bat%)="m" THEN gosub 1120
658 IF ma$(bat%)="n" THEN goto 666
660 IF l%(bat%)<40 AND mtar$(bat%)=nick$ AND ma$(bat%)="a" THEN mst$(bat%)="st":mdam%(bat%)=pd%-mpa%(bat%)
662 IF mdam%(bat%)>0 THEN mdam%(bat%)=0
664 IF l%(bat%)<40 AND mtar$(bat%)=nick$ AND ma$(bat%)="a" AND mdam%(bat%)<=0 THEN mst$(bat%)="st":hp%=hp%+mdam%(bat%):drawstring str$(mdam%(bat%)),slx%+hx+30,sly%+hy-36
666 next bat%
668 RETURN
670 IF hx<hmx2 AND hy<hmy2 THEN gosub 700:goto 690
672 IF hx<hmx2 AND hy>hmy2 THEN gosub 700:goto 690
674 IF hx>hmx2 AND hy<hmy2 THEN gosub 700:goto 690
676 IF hx>hmx2 AND hy>hmy2 THEN gosub 700:goto 690
678 IF abs(hmx2-hx)<hsp THEN hx=hmx2
680 IF abs(hmy2-hy)<hsp THEN hy=hmy2
682 IF hx<hmx2 THEN hx=hx+hsp
684 IF hy<hmy2 THEN hy=hy+hsp
686 IF hx>hmx2 THEN hx=hx-hsp
688 IF hy>hmy2 THEN hy=hy-hsp
690 spritemove "h",slx%+hx-hw/2,sly%+hy-hh/2:spritemove "hm",slx%+hmx2-hmw/2,sly%+hmy2-hmh/2
692 IF hx=hmx2 AND hy=hmy2 THEN hst$="st"
694 RETURN
700 l%=sqr ((hmx2-hx)^2+(hmy2-hy)^2)
702 IF l%<hsp THEN hstx=hmx2-hx:hsty=hmy2-hy:goto 708
704 hstx=(hmx2-hx)/(l%/hsp)
706 hsty=(hmy2-hy)/(l%/hsp)
708 hx=hx+hstx
710 hy=hy+hsty
712 RETURN
720 for sm%=0 to am%-1
722 IF mst$(sm%)="r" THEN goto 726
724 IF INKEY(0)=48 AND hmx>mx(sm%) AND hmx<mx(sm%)+mw AND hmy>my(sm%) AND hmy<my(sm%)+mh THEN tar$="mob":tar%=sm%:tar2%=lm2%(tar%/10):mi$="off":gosub 900:gosub 1310:goto 728
726 next sm%
728 RETURN
730 mix%=tmx%:miy%=tmh
732 setcolor 0,0,0
734 fillrect mix%,miy%,tmw,18*13
736 mix%=mix%+8
738 setcolor 255,255,255
740 drawstring "Monster information:",mix%,miy%
742 drawstring "Name:",mix%,miy%+18
744 drawstring dmna$(tar2%),mix%,miy%+18*2
746 drawstring "Level: "+str$(dmlvl%(tar2%)),mix%,miy%+18*3
748 drawstring "Agression: "+str$(dmagr%(tar2%)),mix%,miy%+18*4
750 drawstring "HP: "+str$(mhp%(tar%))+"/"+str$(dmhp%(tar2%)),mix%,miy%+18*5
752 drawstring "MP: "+str$(mmp%(tar%))+"/"+str$(dmmp%(tar2%)),mix%,miy%+18*6
754 drawstring "EXP: "+str$(dmexp%(tar2%)),mix%,miy%+18*7
756 drawstring "SP: "+str$(dmsp%(tar2%)),mix%,miy%+18*8
758 drawstring "P.Atk: "+str$(mpa%(tar%)),mix%,miy%+18*9
760 drawstring "M.Atk: "+str$(mma%(tar%)),mix%,miy%+18*10
762 drawstring "P.Def: "+str$(mpd%(tar%)),mix%,miy%+18*11
764 drawstring "M.Def: "+str$(mmd%(tar%)),mix%,miy%+18*12
766 RETURN
790 tmx%=sw%/2-tmw/2:cse$="n":csp%=csp1%
792 IF mi$="on" THEN gosub 830:goto 796
794 drawgel "tmn",tmx%,0
796 st$=dmna$(tar2%)
798 setcolor 255,255,255
800 drawstring st$,tmx%+81-stw(st$)/2,6
802 w1%=(mhp%(tar%)*150)/dmhp%(tar2%)
804 for aa%=0 to w1%
806 drawgel "thp",tmx%+16+aa%,26
808 next aa%
810 for ab%=w1% to 149
812 drawgel "thp2",tmx%+16+ab%,26
814 next ab%
816 IF cx%>tmx% AND cx%<tmx%+tmw AND cy%>0 AND cy%<tmh THEN cse$="mi":csp%=csp2%
818 IF FIRE(0) AND cx%>tmx%+1 AND cx%<tmx%+12 AND cy%>7 AND cy%<18 THEN ise$="on"
820 IF ise$="on" AND mi$="off" THEN mi$="on":goto 824
822 IF ise$="on" AND mi$="on" THEN mi$="off"
824 ise$="off"
826 IF FIRE(0) AND cx%>tmx%+153 AND cx%<tmx%+168 AND cy%>6 AND cy%<21 THEN tar$="":csp%=csp1%
828 RETURN
830 drawgel "tmi",tmx%,0
832 ax%=18:drawgel dmr$(tar2%)+"s",tmx%+ax%,40
833 IF cx%>tmx%+ax% AND cx%<tmx%+ax%+16 AND cy%>40 AND cy%<56 THEN t$="Race: "+dmr$(tar2%)+sy2$+dmrd$(tar2%):gosub 1270
834 ax%=ax%+19:drawgel dmst$(tar2%)+"s",tmx%+ax%,40
835 IF cx%>tmx%+ax% AND cx%<tmx%+ax%+16 AND cy%>40 AND cy%<56 THEN t$="Strong type: "+dmst$(tar2%)+sy2$+dmstd$(tar2%):gosub 1270
836 IF dmskn%(tar2%)=0 THEN goto 844
838 for dr1%=0 to dmskn%(tar2%)-1
840 ax%=ax%+19:drawgel msk$(dr1%)+"s",tmx%+ax%,40
841 IF cx%>tmx%+ax% AND cx%<tmx%+ax%+16 AND cy%>40 AND cy%<56 THEN t$="Skill: "+msk$(dr1%)+sy2$+mskd$(dr1%):gosub 1270
842 next dr1%
844 IF dmren%(tar2%)=0 THEN goto 852
846 for dr2%=0 to dmren%(tar2%)-1
848 ax%=ax%+19:drawgel mre$(dr2%)+"s",tmx%+ax%,40
849 IF cx%>tmx%+ax% AND cx%<tmx%+ax%+16 AND cy%>40 AND cy%<56 THEN t$="Resist: "+mre$(dr2%)+sy2$+mred$(dr2%):gosub 1270
850 next dr2%
852 IF dmwn%(tar2%)=0 THEN goto 860
854 for dr3%=0 to dmwn%(tar2%)-1
856 ax%=ax%+19:drawgel mw$(dr3%)+"s",tmx%+ax%,40
857 IF cx%>tmx%+ax% AND cx%<tmx%+ax%+16 AND cy%>40 AND cy%<56 THEN t$="Weak: "+mw$(dr3%)+sy2$+mwd$(dr3%):gosub 1270
858 next dr3%
860 setcolor 255,255,255
862 drawstring "[i]",tmx%+153,38
864 IF cx%>tmx%+153 AND cx%<tmx%+168 AND cy%>40 AND cy%<58 THEN gosub 730
866 RETURN
890 setcolor 0,0,0:fillrect tmx%,tmh,tmw,40
892 setcolor 255,255,255:drawstring ait$,tmx%,tmh
894 drawstring ai$,tmx%,tmh+18
896 RETURN
900 IF dmskn%(tar2%)=0 THEN goto 914
902 skv%=dmskn%(tar2%)
904 t$=dmsk$(tar2%):d%=skv%:gosub 234:gosub 990:t$=dmskd$(tar2%):gosub 234
906 dim msk$(skv%):dim mskd$(skv%)
908 for wskv%=0 to skv%-1
910 msk$(wskv%)=d$(wskv%):mskd$(wskv%)=n$(wskv%)
912 next wskv%
914 IF dmren%(tar2%)=0 THEN goto 928
916 rev%=dmren%(tar2%)
918 t$=dmre$(tar2%):d%=rev%:gosub 234:gosub 990:t$=dmred$(tar2%):gosub 234
920 dim mre$(rev%):dim mred$(rev%)
922 for wrev%=0 to rev%-1
924 mre$(wrev%)=d$(wrev%):mred$(wrev%)=n$(wrev%)
926 next wrev%
928 IF dmwn%(tar2%)=0 THEN goto 942
930 wv%=dmwn%(tar2%)
932 t$=dmw$(tar2%):d%=wv%:gosub 234:gosub 990:t$=dmwd$(tar2%):gosub 234
934 dim mw$(wv%):dim mwd$(wv%)
936 for wwv%=0 to wv%-1
938 mw$(wwv%)=d$(wwv%):mwd$(wwv%)=n$(wwv%)
940 next wwv%
942 RETURN
950 IF tar$="" THEN cse$="n":RETURN
952 IF tar$="mob" THEN stw%=stw(dmna$(tar2%)):tarx%=slx%+mx(tar%)-stw%/2+mw/2-16:tary%=sly%+my(tar%)-18:tarx2%=tarx%+stw%+16
954 drawgel "t",tarx%,tary%
956 drawgel "t",tarx2%,tary%
958 RETURN
990 dim d$(d%)
992 for wd%=0 to d%-1
994 d$(wd%)=n$(wd%)
996 next wd%
998 RETURN
1000 dim dmr$(dmn%):dim dmrd$(dmn%):dim dmst$(dmn%):dim dmstd$(dmn%):dim dmskn%(dmn%):dim dmsk$(dmn%):dim dmskd$(dmn%):dim dmren%(dmn%):dim dmre$(dmn%):dim dmred$(dmn%):dim dmwn%(dmn%):dim dmw$(dmn%):dim dmwd$(dmn%)
1002 for wd3%=0 to dmn%-1
1004 w$=w6$
1006 mfn$=str$(dmlvl%(wd3%))+"/"+dmna$(wd3%):fn$=mfn$:d%=5:gosub 220:gosub 990:w$=w7$
1008 dmr$(wd3%)=d$(0):i$=dmr$(wd3%):f$="race":fn$=f$+"/"+i$:gosub 1060:d%=1:gosub 220:dmrd$(wd3%)=n$(0)
1010 dmst$(wd3%)=d$(1):i$=dmst$(wd3%):f$="strong":fn$=f$+"/"+i$:gosub 1060:d%=1:gosub 220:dmstd$(wd3%)=n$(0)
1012 IF d$(2)="-" THEN dmskn%(wd3%)=0:goto 1016
1014 dmskn%(wd3%)=val(d$(2))
1016 IF d$(3)="-" THEN dmren%(wd3%)=0:goto 1020
1018 dmren%(wd3%)=val(d$(3))
1020 IF d$(4)="-" THEN dmwn%(wd3%)=0:goto 1024
1022 dmwn%(wd3%)=val(d$(4))
1024 w$=w6$:fn$=mfn$:d%=5+dmskn%(wd3%)+dmren%(wd3%)+dmwn%(wd3%):gosub 220:gosub 990
1026 w$=w7$:dmsk$(wd3%)="":dmskd$(wd3%)="":dmre$(wd3%)="":dmred$(wd3%)="":dmw$(wd3%)="":dmwd$(wd3%)=""
1028 IF dmskn%(wd3%)=0 THEN goto 1036
1030 for ws%=0 to dmskn%(wd3%)-1
1032 dmsk$(wd3%)=dmsk$(wd3%)+d$(5+ws%)+sy$:i$=d$(5+ws%):f$="skill":fn$=f$+"/"+i$:gosub 1060:d%=1:gosub 220:dmskd$(wd3%)=dmskd$(wd3%)+n$(0)+sy$
1034 next ws%
1036 IF dmren%(wd3%)=0 THEN wre%=ws%:goto 1044
1038 for wre%=ws% to dmren%(wd3%)-1
1040 dmre$(wd3%)=dmre$(wd3%)+d$(5+wre%)+sy$:i$=d$(5+wre%):f$="resist":fn$=f$+"/"+i$:gosub 1060:d%=1:gosub 220:dmred$(wd3%)=dmred$(wd3%)+n$(0)+sy$
1042 next wre%
1044 IF dmwn%(wd3%)=0 THEN goto 1052
1046 for ww%=wre% to dmwn%(wd3%)-1
1048 dmw$(wd3%)=dmw$(wd3%)+d$(5+ww%)+sy$:i$=d$(5+ww%):f$="weak":fn$=f$+"/"+i$:gosub 1060:d%=1:gosub 220:dmwd$(wd3%)=dmwd$(wd3%)+n$(0)+sy$
1050 next ww%
1052 next wd3%
1054 RETURN
1060 is$=i$+"s":iw%=32:ih%=32
1062 gelload i$,w$+fn$+".png"
1064 gelload is$,w$+fn$+".png"
1066 iy%=ih%+2
1068 drawgel i$,0,0
1070 ix1%=0:ix2%=0:iy1%=0:iy2%=iy%
1072 for dr1%=0 to iw%-2
1074 gelgrab is$,ix1%,0,1,ih%
1076 drawgel is$,ix2%,iy%
1078 drawgel is$,ix2%+1,iy%
1080 ix1%=ix1%+2:ix2%=ix2%+1
1082 next dr1%
1084 re:gelgrab is$,0,iy%,iw%/2,ih%:gosub 1106
1086 drawgel is$,0,0
1088 for dr2%=0 to ih%-2
1090 gelgrab is$,0,iy1%,iw%/2,1
1092 drawgel is$,0,iy2%
1094 drawgel is$,0,iy2%+1
1096 iy1%=iy1%+2:iy2%=iy2%+1
1098 next dr2%
1100 re:gelgrab is$,0,iy%,iw%/2,ih%/2:gosub 1106
1102 RETURN
1106 setcolor 0,0,0
1108 fillrect 0,0,sw%,sh%
1110 re:RETURN
1120 IF mx(bat%)<mmx(bat%) AND my(bat%)<mmy(bat%) THEN gosub 1150:goto 1136
1122 IF mx(bat%)<mmx(bat%) AND my(bat%)>mmy(bat%) THEN gosub 1150:goto 1136
1124 IF mx(bat%)>mmx(bat%) AND my(bat%)<mmy(bat%) THEN gosub 1150:goto 1136
1126 IF mx(bat%)>mmx(bat%) AND my(bat%)>mmy(bat%) THEN gosub 1150:goto 1136
1128 IF mx(bat%)<mmx(bat%) THEN mx(bat%)=mx(bat%)+msp
1130 IF my(bat%)<mmy(bat%) THEN my(bat%)=my(bat%)+msp
1132 IF mx(bat%)>mmx(bat%) THEN mx(bat%)=mx(bat%)-msp
1134 IF my(bat%)>mmy(bat%) THEN my(bat%)=my(bat%)-msp
1136 spritemove "m"+str$(bat%),slx%+mx(bat%),sly%+my(bat%)
1138 IF (mx(bat%)=mmx(bat%) AND my(bat%)=mmy(bat%)) OR l%(bat%)<40 THEN mst$(bat%)="st":ma$(bat%)="a"
1140 RETURN
1150 l%=sqr ((mmx(bat%)-mx(bat%))^2+(mmy(bat%)-my(bat%))^2)
1152 IF l%<msp THEN mstx=mmx(bat%)-mx(bat%):msty=mmy(bat%)-my(bat%):goto 1158
1154 mstx=(mmx(bat%)-mx(bat%))/(l%/msp)
1156 msty=(mmy(bat%)-my(bat%))/(l%/msp)
1158 mx(bat%)=mx(bat%)+mstx
1160 my(bat%)=my(bat%)+msty
1162 RETURN
1170 for r%=0 to am%-1
1172 IF mst$(r%)="st" THEN goto 1182
1174 gosub 218:mrt%(r%)=tn%
1176 IF mst$(r%)="r" THEN goto 1180
1178 IF mrt%(r%)-mdt%(r%)>10000 THEN spritemove "m"+str$(r%),-mh,0:mst$(r%)="r":tar$=""
1180 IF mrt%(r%)-mdt%(r%)>20000 THEN mhp%(r%)=dmhp%(lm2%(r%/10)):mst$(r%)="st":mx(r%)=rex(r%/10)+mod(rnd(0),200):my(r%)=rey(r%/10)+mod(rnd(0),199)
1182 next r%
1184 RETURN
1190 dim dt$(br%):p%=1
1192 for wdt%=0 to br%-1
1194 for l%=1 to len(t$)
1196 dt$(wdt%)=mid$(t$,p%,l%)
1198 IF RIGHT$(dt$(wdt%),1)=sy2$ THEN dt$(wdt%)=mid$(t$,p%,l%-1):p%=p%+l%:goto 1202
1200 next l%
1202 next wdt%
1204 RETURN
1210 br%=0
1212 for sbr%=1 to len(t$)
1214 br$=mid$(t$,sbr%,1)
1216 IF br$=ssy$ THEN br$="_":br%=br%+1
1218 next sbr%
1220 RETURN
1230 setcolor 0,0,0
1232 fillrect tmx%,tmh,tmw,90
1234 setcolor 255,255,255
1236 for dw%=0 to br%-1
1238 t$=dt$(dw%):w%=21:s%=0
1240 IF len(t$)<w% THEN w%=len(t$)
1242 for t%=1 to len(t$)-w% step w%
1244 tp$=mid$(t$,t%,w%)
1246 drawstring tp$,tx%,ty%
1248 ty%=ty%+18:s%=s%+1
1250 next t%
1252 w%=len(t$)-w%*s%
1254 IF w%<=0 THEN goto 1264
1256 tp$=mid$(t$,t%,w%)
1258 s%=s%+1
1260 drawstring tp$,tx%,ty%
1262 ty%=ty%+18:s%=s%+1
1264 next dw%
1266 RETURN
1270 t$=t$+sy2$:ssy$=sy2$:gosub 1210
1272 gosub 1190
1274 tx%=tmx%+8:ty%=tmh:gosub 1230
1276 RETURN
1310 t$=dmdr$(tar2%)
1312 ssy$=chr$(10):gosub 1210
1314 i%=br%:p%=1
1316 dim ty$(i%):dim ty2$(i%):dim gr$(i%):dim na$(i%):dim ch%(i%):dim am%(i%):dim mam%(i%)
1318 for wdd%=0 to i%-1
1320 d%=6:gosub 234
1322 ty$(wdd%)=n$(0):ty2$(wdd%)="":gr$(wdd%)=n$(1):na$(wdd%)=n$(2):ch%(wdd%)=n$(3):am%(wdd%)=n$(4):mam%(wdd%)=n$(5)
1324 IF LEFT$(n$(0),6)="Weapon" THEN ty2$(wdd%)=mid$(n$(0),9,len(n$(0))-9):n$(0)="Weapon"
1326 iw$="file:///E:/M/grade/"+n$(1)+"/"+n$(0)+"/"+n$(2)
1328 IF n$(0)="Weapon" THEN itw$="file:///E:/M/grade/"+n$(1)+"/"+n$(0)+"/"+ty2$(wdd%)+"/"+n$(2)
1330 IF n$(0)="Material" OR n$(0)="Potion" OR n$(0)="Scroll" OR n$(0)="Shot" OR n$(0)="Recipe" THEN itw$="file:///E:/M/"+n$(0)+"/"+n$(1)+"/"+n$(2)
1332 gelload n$(2),iw$+".png"
1334 next wdd%
1336 RETURN
1350 OPEN #0,w$+fn$+".dat","input"
1352 t$=""
1354 GET #0,i%
1356 i$=chr$(i%)
1358 IF i$="/" THEN CLOSE #0:goto 1364
1360 t$=t$+i$
1362 goto 1354
1364 RETURN