home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 September / VPR9709A.ISO / Ffilly / Ftile_ca / FTILE_CA.TFY < prev    next >
Text File  |  1996-12-28  |  17KB  |  742 lines

  1. #info INAM    ふらっとタイル
  2. #info ISBJ    パズルゲーム ふらっとタイル Ver 4.00+
  3. #info IART    迎 亮
  4. #info ICOP    迎 亮
  5. #info IKEY    flat
  6. #info GENR    joy
  7. #info MDFY    Ask me
  8. #info TRNS    Ask me
  9. #info JINT    Ask me
  10. #info INST    Other
  11. #info VIDO    640x480;256
  12. #info GRPC    迎 亮,"MXE05170@niftyserve.or.jp"
  13. #info EFCT    迎 亮,"MXE05170@niftyserve.or.jp"
  14. #info PROD    迎 亮,"MXE05170@niftyserve.or.jp"
  15. #info CONT    迎 亮,"MXE05170@niftyserve.or.jp"
  16.  
  17. #define VER 4.00+
  18.  
  19. #define XWIDTH 80
  20. #define YWIDTH 20
  21. #define XSTPOS 60
  22. #define YSTPOS 90
  23. #define XNO 6
  24. #define YNO 10
  25. #define MAXGAMENO 29
  26.  
  27. int openwinno,basewinno,reportwinno,sortwinno,helpwinno,profilewinno,movewinno;
  28. int rulewinno,aboutwinno,clearwinno,endingwinno;
  29. int openingpic,basepic,reportpic,reportclspic,sortpic,rulepic;
  30. int bigflatpic,uppic,rightpic,leftpic,downpic;
  31. int whitepic,greenpic,bluepic,redpic,yellowpic;
  32. int bottunpic;
  33. int helppic,helpprofilepic,helpmovepic,helprulepic,helpaboutpic,clearpic,clearokpic,endingpic;
  34. int color;
  35. int placeX,placeY,dir;
  36. int count,clearsum,stepsum,check,redocheck;
  37. int dirsave,placeXsave,placeYsave,p2save,p3save,countsave,openwinnosave;
  38. int saveflag;
  39. int tile[],redo[],save[],sortarray[],stagearray[];
  40.  
  41.  
  42. #include "wave.tfy"
  43. #include "picture.tfy"
  44. #include "question.tfy"
  45. #include "flatman.tfy"
  46. #include "help.tfy"
  47. #include "report.tfy"
  48. #include "cotton.tfy"
  49. #include "security.tfy"
  50.  
  51. dummy(){
  52.     return;
  53. }
  54.  
  55. reverse(){
  56.     int i;
  57.     i=placeX+9*placeY;
  58.  
  59.     if(dir==0){        //下向きタイル戻し
  60.         if(check==1){
  61.             movewave();
  62.             tile[i+9]=tile[i+9]+1;
  63.             tile[i+18]=tile[i+18]-1;
  64.             MovePic(tile[i+9]-48,0,0,32,32,basepic,12+35*placeX,12+35*(placeY+1));
  65.             MovePic(tile[i+18]-48,0,0,32,32,basepic,12+35*placeX,12+35*(placeY+2));
  66.             countstep();
  67.             check=0;
  68.         }
  69.         else{
  70.             warnwave();
  71.             MsgBox("  ルール違反です",0x30);
  72.         }
  73.     }
  74.  
  75.     if(dir==1){        //右向きタイル戻し
  76.         if(check==1){
  77.             movewave();
  78.             tile[i+1]=tile[i+1]+1;
  79.             tile[i+2]=tile[i+2]-1;
  80.             MovePic(tile[i+1]-48,0,0,32,32,basepic,12+35*(placeX+1),12+35*placeY);
  81.             MovePic(tile[i+2]-48,0,0,32,32,basepic,12+35*(placeX+2),12+35*placeY);
  82.             countstep();
  83.             check=0;
  84.         }
  85.         else{
  86.             warnwave();
  87.             MsgBox("  ルール違反です",0x30);
  88.         }
  89.     }
  90.     if(dir==2){        //上向きタイル戻し
  91.         if(check==1){
  92.             movewave();
  93.             tile[i-9]=tile[i-9]+1;
  94.             tile[i-18]=tile[i-18]-1;
  95.             MovePic(tile[i-9]-48,0,0,32,32,basepic,12+35*(placeX),12+35*(placeY-1));
  96.             MovePic(tile[i-18]-48,0,0,32,32,basepic,12+35*(placeX),12+35*(placeY-2));
  97.             countstep();
  98.             check=0;
  99.         }
  100.         else{
  101.             warnwave();
  102.             MsgBox("  ルール違反です",0x30);
  103.         }
  104.     }
  105.     if(dir==3){        //左向きタイル戻し
  106.         if(check==1){
  107.             movewave();
  108.             tile[i-1]=tile[i-1]+1;
  109.             tile[i-2]=tile[i-2]-1;
  110.             MovePic(tile[i-1]-48,0,0,32,32,basepic,12+35*(placeX-1),12+35*placeY);
  111.             MovePic(tile[i-2]-48,0,0,32,32,basepic,12+35*(placeX-2),12+35*placeY);
  112.             countstep();
  113.             check=0;
  114.         }
  115.         else{
  116.             warnwave();
  117.             MsgBox("  ルール違反です",0x30);
  118.         }
  119.     }
  120. }
  121.  
  122. move(stageno){
  123.     real x,y;
  124.     int i,j,msgno;
  125.     int p2,p3;
  126.     str string;
  127.  
  128.     p2=46;    p3=46;        //ふらっとマンの初期位置
  129.  
  130.     mes(LBDOWN){
  131.  
  132.         p2=11+placeX*35;    p3=11+placeY*35;
  133.  
  134.  
  135.         //やり直し
  136.         if((MesP2>360 && MesP3>275 && MesP2<420 && MesP3<295) && MesP1==(basewinno)){
  137.             MovePic(bottunpic,59,133,59,19,basepic,360,275);
  138.  
  139.             openwave();
  140.             msgno=MsgBox("やり直してもいいですか?",0x20+1);
  141.  
  142.             if(msgno==1){
  143.                 for(i=0;i<81;i=i+1){
  144.                     j=i/9;
  145.                     MovePic(yellowpic,0,0,32,32,basepic,12+35*(i-9*j),12+35*j);
  146.                 }
  147.             stageredo();
  148.             check=0;
  149.             count=-1;
  150.             countstep();
  151.             startwave();
  152.             }
  153.             MovePic(bottunpic,0,133,59,19,basepic,360,275);    
  154.  
  155.             if(msgno==2)    closewave();
  156.  
  157.         }
  158.  
  159.         //一手戻し
  160.         if((MesP2>450 && MesP3>275 && MesP2<510 && MesP3<295) && MesP1==(basewinno)){
  161.             MovePic(bottunpic,59,171,59,19,basepic,450,275);
  162.             reverse();
  163.             MovePic(bottunpic,0,171,59,19,basepic,450,275);
  164.             closewave();
  165.         }
  166.  
  167.         //セーブ
  168.         if((MesP2>360 && MesP3>300 && MesP2<420 && MesP3<320) && MesP1==(basewinno)){
  169.             MovePic(bottunpic,59,209,59,19,basepic,360,300);
  170.  
  171.             openwave();
  172.             msgno=MsgBox("セーブしました",0x40);
  173.  
  174.             if(msgno==1){
  175.                 saveflag=1;
  176.                 for(i=0;i<81;i=i+1){
  177.                     save[i]=tile[i];
  178.                 }
  179.                 dirsave=dir;
  180.                 placeXsave=placeX;
  181.                 placeYsave=placeY;
  182.                 p2save=p2;
  183.                 p3save=p3;
  184.                 countsave=count;
  185.                 check=0;
  186.             }
  187.  
  188.             MovePic(bottunpic,0,209,59,19,basepic,360,300);
  189.             closewave();
  190.         }
  191.  
  192.         //ロード
  193.         if((MesP2>450 && MesP3>300 && MesP2<510 && MesP3<320) && MesP1==(basewinno)){
  194.             MovePic(bottunpic,59,228,59,19,basepic,450,300);
  195.  
  196.             if(saveflag==1){
  197.                 openwave();
  198.                 msgno=MsgBox("ロードしてもいいですか?",0x20+1);
  199.                 if(msgno==1){
  200.                     for(i=0;i<81;i=i+1){
  201.                         for(i=0;i<81;i=i+1){
  202.                             j=i/9;
  203.                             MovePic(yellowpic,0,0,32,32,basepic,12+35*(i-9*j),12+35*j);
  204.                             tile[i]=save[i];
  205.                         }
  206.                     }
  207.                     dir=dirsave;
  208.                     placeX=placeXsave;
  209.                     placeY=placeYsave;
  210.                     p2=p2save;
  211.                     p3=p3save;
  212.                     count=countsave-1;
  213.                     countstep();
  214.                     check=0;
  215.                     tiledraw();
  216.  
  217.                     if(dir==0)    MovePic(downpic,0,0,33,33,basepic,p2,p3,0,color);
  218.                     if(dir==1)    MovePic(rightpic,0,0,33,33,basepic,p2,p3,0,color);
  219.                     if(dir==2)    MovePic(uppic,0,0,33,33,basepic,p2,p3,0,color);
  220.                     if(dir==3)    MovePic(leftpic,0,0,33,33,basepic,p2,p3,0,color);
  221.                 }
  222.             }
  223.             else{
  224.                 warnwave();
  225.                 MsgBox("セーブデータがありません",0x10+1);
  226.             }
  227.  
  228.             MovePic(bottunpic,0,228,59,19,basepic,450,300);
  229.             closewave();
  230.         }
  231.  
  232.         //ヘルプ
  233.         if((MesP2>360 && MesP3>325 && MesP2<420 && MesP3<345) && MesP1==(basewinno)){
  234.             MovePic(bottunpic,59,19,59,19,basepic,360,325);
  235.             CapTitle("ふらっとタイル Ver 3.00 ヘルプ");
  236.             helpwinno=OpenWin(helppic,60,60);
  237.             help();
  238.             MovePic(bottunpic,0,19,59,19,basepic,360,325);
  239.         }
  240.  
  241.         //ステージ終了
  242.         if((MesP2>450 && MesP3>325 && MesP2<510 && MesP3<345) && MesP1==(basewinno)){
  243.             MovePic(bottunpic,59,152,59,19,basepic,450,325);
  244.             openwave();
  245.             MovePic(bottunpic,0,152,59,19,basepic,450,325);
  246.             CloseWin(basewinno);
  247.             for(i=0;i<81;i=i+1){
  248.                 j=i/9;
  249.                 MovePic(yellowpic,0,0,32,32,basepic,12+35*(i-9*j),12+35*j);
  250.             }
  251.             redocheck=0;
  252.             saveflag=0;
  253.             openwinno=openwinnosave;
  254.             openingwave();
  255.             del_me;
  256.         }
  257.  
  258.         if((MesP2>p2 && MesP3>p3+35 && MesP2<p2+33 && MesP3<281+33) && MesP1==(basewinno)){
  259.             if(check=1)    check=0;
  260.             countstep(stageno);
  261.             if(dir==0)    flatmanmovedown(p2,p3);    //下
  262.             else{
  263.                 dir=0;
  264.                 flatmanchange(p2,p3);
  265.             }
  266.         }
  267.         if((MesP2>p2+35 && MesP3>p3 && MesP2<281+33 && MesP3<p3+33) && MesP1==(basewinno)){
  268.             if(check=1)    check=0;
  269.             countstep(stageno);
  270.             if(dir==1)    flatmanmoveright(p2,p3);    //右
  271.             else{
  272.                 dir=1;
  273.                 flatmanchange(p2,p3);
  274.             }
  275.         }
  276.         if((MesP2>p2 && MesP3>11 && MesP2<p2+33 && MesP3<p3-2) && MesP1==(basewinno)){
  277.             if(check=1)    check=0;
  278.             countstep(stageno);
  279.             if(dir==2)    flatmanmoveup(p2,p3);    //上
  280.             else{
  281.                 dir=2;
  282.                 flatmanchange(p2,p3);
  283.             }
  284.         }    
  285.         if((MesP2>11 && MesP3>p3 && MesP2<p2-2 && MesP3<p3+35) && MesP1==(basewinno)){
  286.             if(check=1)    check=0;
  287.             countstep(stageno);
  288.             if(dir==3)    flatmanmoveleft(p2,p3);    //左
  289.             else{
  290.                 dir=3;
  291.                 flatmanchange(p2,p3);
  292.             }
  293.         }
  294.     }
  295.  
  296.     mes(RBDOWN){
  297.         tilemovecheck(stageno);
  298.     }
  299.  
  300.     mes(RBDBLCLK){
  301.         dummy();
  302.     }    
  303. }
  304.  
  305.  
  306. tilemovecheck(stageno){
  307.     int i;
  308.     i=placeX+placeY*9;
  309.     
  310.     if(dir==0){    //下向きチェック
  311.         if(i<63){
  312.             tilemove(i,stageno);
  313.         }
  314.     }
  315.     if(dir==1){    //右向きチェック
  316.         if(i%9!=7 && i%9!=8){
  317.             tilemove(i,stageno);
  318.         }
  319.     }
  320.     if(dir==2){    //上向きチェック
  321.         if(i>17){
  322.             tilemove(i,stageno);
  323.         }
  324.     }
  325.     if(dir==3){    //左向きチェック
  326.         if(i%9!=0 && i%9!=1){
  327.             tilemove(i,stageno);
  328.         }
  329.     }
  330. }
  331.  
  332. tilemove(i,stageno){
  333.     if(dir==0 && tile[i+9]-tile[i]==1 && tile[i+18]<tile[i+9]){    //下向きタイル移動
  334.         movewave();
  335.         tile[i+9]=tile[i+9]-1;
  336.         tile[i+18]=tile[i+18]+1;
  337.         MovePic(tile[i+9]-48,0,0,32,32,basepic,12+35*placeX,12+35*(placeY+1));
  338.         MovePic(tile[i+18]-48,0,0,32,32,basepic,12+35*placeX,12+35*(placeY+2));
  339.         countstep();    
  340.         clearcheck(stageno);
  341.         check=1;
  342.     }
  343.     if(dir==1 && tile[i+1]-tile[i]==1 && tile[i+2]<tile[i+1]){    //右向きタイル移動
  344.         movewave();
  345.         tile[i+1]=tile[i+1]-1;
  346.         tile[i+2]=tile[i+2]+1;
  347.         MovePic(tile[i+1]-48,0,0,32,32,basepic,12+35*(placeX+1),12+35*placeY);
  348.         MovePic(tile[i+2]-48,0,0,32,32,basepic,12+35*(placeX+2),12+35*placeY);
  349.         countstep();
  350.         clearcheck(stageno);
  351.         check=1;
  352.     }
  353.     if(dir==2 && tile[i-9]-tile[i]==1 && tile[i-18]<tile[i-9]){    //上向きタイル移動
  354.         movewave();
  355.         tile[i-9]=tile[i-9]-1;
  356.         tile[i-18]=tile[i-18]+1;
  357.         MovePic(tile[i-9]-48,0,0,32,32,basepic,12+35*(placeX),12+35*(placeY-1));
  358.         MovePic(tile[i-18]-48,0,0,32,32,basepic,12+35*(placeX),12+35*(placeY-2));
  359.         countstep();
  360.         clearcheck(stageno);
  361.         check=1;
  362.     }
  363.     if(dir==3 && tile[i-1]-tile[i]==1 && tile[i-2]<tile[i-1]){    //左向きタイル移動
  364.         movewave();
  365.         tile[i-1]=tile[i-1]-1;
  366.         tile[i-2]=tile[i-2]+1;
  367.         MovePic(tile[i-1]-48,0,0,32,32,basepic,12+35*(placeX-1),12+35*placeY);
  368.         MovePic(tile[i-2]-48,0,0,32,32,basepic,12+35*(placeX-2),12+35*placeY);
  369.         countstep();
  370.         clearcheck(stageno);
  371.         check=1;
  372.     }
  373. }
  374.  
  375. ending()
  376. {
  377.  
  378.     mes(TIME){
  379.         step(20){,,,,,
  380.             CapTitle("");
  381.             endingwinno=OpenWin(endingpic,200,150);
  382.  
  383.  
  384.  
  385.             ,,,,,
  386.             CloseWin(endingwinno);
  387.             end_step;
  388.             del_me;
  389.         }
  390.     }
  391.  
  392.  
  393.  
  394.  
  395. }
  396.  
  397. clearcheck(stageno){        //クリアーチェック
  398.     int i,j,n;
  399.     str stagestring;
  400.  
  401.     for(i=0;i<81;i=i+1){
  402.         if(tile[i]>49)    return;
  403.     }
  404.  
  405.     stagestring=StrPrint("stage_%ld",stageno+1);
  406.     n=GetIniInt("report",stagestring,-1,"flattile.ini");
  407.  
  408.     CapTitle("");
  409.     clearwave();
  410.  
  411.     if(n>count || n==0)    clearwinno=OpenWin(clearpic,200,150);
  412.     else            clearwinno=OpenWin(clearpic,200,150,240,100);
  413.  
  414.     mes(TIME){
  415.         step(20){,,,
  416.             if(n>count || n==0){
  417.                 WriteIniInt("report",stagestring,count,"flattile.ini");
  418.  
  419.                 clearbmp();
  420.                 stagewrite();
  421.             }
  422.             CloseWin(basewinno);
  423.             basewinno=-1;
  424.             openwinno=openwinnosave;
  425.             CloseWin(clearwinno);
  426.  
  427.             end_step;
  428.             del_me;
  429.         }
  430.     }
  431.  
  432.  
  433.  
  434.     mes(TIME){
  435.         step(20){,,,
  436.             for(i=0;i<81;i=i+1){
  437.                 j=i/9;
  438.                 MovePic(yellowpic,0,0,32,32,basepic,12+35*(i-9*j),12+35*j);
  439.             }
  440.             ,,
  441.             if(n>count || n==0){
  442.  
  443.                 MovePic(reportclspic,0,0,540,335,reportpic,0,0);
  444.                 MovePic(reportclspic,0,0,540,335,sortpic,0,0);
  445.                 MovePic(bottunpic,0,266,59,19,reportpic,270,300);    //成績表ソートボタン
  446.                 MovePic(bottunpic,0,247,59,19,reportpic,360,300);    //成績表ファイルボタン
  447.                 MovePic(bottunpic,0,76,59,19,reportpic,450,300);    //成績表OKボタン
  448.                 MovePic(bottunpic,0,76,59,19,sortpic,450,300);    //成績表ソートOKボタン
  449.                 reporttitle();                    //成績表新規作成
  450.                 sorttitle(stepsum,clearsum);                //成績表ソート新規作成
  451.                 security(stageno+1);                //暗号化
  452.             }
  453.             end_step;
  454.             del_me;
  455.         }
  456.     }
  457.  
  458.     if(stageno==59)
  459.         ending();
  460.  
  461. }
  462.  
  463.  
  464.  
  465. stagewrite()
  466. {
  467.     int stageno;
  468.     int i,j;
  469.     str string;
  470.     
  471.     stageno=0;
  472.  
  473.     for(i=0;i<6;i=i+1){
  474.         for(j=0;j<10;j=j+1){
  475.             stageno=stageno+1;
  476.             SetLineSize(2);
  477.             DrawRect(openingpic,60,90,541,291,0,1);
  478.             SetLineSize(1);
  479.             DrawLine(openingpic,60,90+20*j,541,90+20*j);
  480.             DrawLine(openingpic,140+80*i,90,140+80*i,291);
  481.             BackMode(1);
  482.             SetFont(16, "MS ゴシック",128,0,0,0,400);
  483.             TextColor(0,0,0);
  484.             string=StrPrint("%2d",stageno);
  485.             TextWrite("STAGE",openingpic,68+80*i,92+20*j);
  486.             TextWrite(string,openingpic,118+80*i,92+20*j);
  487.         }
  488.     }
  489. }
  490.  
  491. opening(){
  492.     int i,j;
  493.  
  494.     SetLineSize(2);
  495.     DrawRect(openingpic,60,90,541,291,0,1);
  496.     SetLineSize(1);
  497.     SetPaintColor(0x000000);
  498.  
  499.     stagewrite();
  500.  
  501.     SetFont(16, "MS ゴシック",128,0,0,0,800);
  502.     TextColor(0,0,255);
  503.     TextWrite("Filly data by 迎  亮",openingpic,360,330);
  504.     SetFont(44, "MS ゴシック",128,0,0,0,500);
  505.     TextColor(255,0,0);
  506.     TextWrite("ふらっとタイル",openingpic,40,10);
  507.     SetFont(20, "MS ゴシック",128,0,0,0,500);
  508.     TextColor(255,0,255);
  509.     TextWrite("遊びたいステージを選択して下さい",openingpic,140,60);
  510.     SetFont(24, "MS ゴシック",0,0,0,0,600);
  511.     TextColor(255,0,0);
  512.     TextWrite("Ver 4.00+",openingpic,400,25);
  513. }
  514.  
  515. clearbmp()
  516. {
  517.     int i,j,k,size,stageno,stepsum,clearsum;
  518.     str string,nostring,stagestring,stepstring,clearstring;
  519.     j=0;    stageno=0;    stepsum=0;    clearsum=0;
  520.  
  521.     for(j=0;j<6;j=j+1){
  522.         for(i=0;i<10;i=i+1){
  523.             stageno=stageno+1;
  524.             stagestring=StrPrint("stage_%ld",stageno);
  525.             k=GetIniInt("report",stagestring,100,"flattile.ini");
  526.             if(k>0)
  527.             {
  528.                 MovePic(clearokpic,j*80,i*20,80,20,openingpic,60+j*80,90+i*20);
  529.             }
  530.         }
  531.     }
  532. }
  533.  
  534. select(){
  535.     int msgno,stageno;
  536.  
  537.     mes(LBDOWN){
  538.  
  539.         stageno=retgameno(MesP1,MesP2,MesP3);
  540.  
  541.         if((MesP2>230 && MesP3>300 && MesP2<290 && MesP3<320) && MesP1==(openwinno)){
  542.             MovePic(bottunpic,59,190,59,19,openingpic,230,300);
  543.             CapTitle("ふらっとタイル Ver 4.00+ 成績表");
  544.             reportwinno=OpenWin(reportpic,40,40);
  545.             MovePic(bottunpic,0,190,59,19,openingpic,230,300);
  546.             report();
  547.  
  548.         }
  549.         if((MesP2>320 && MesP3>300 && MesP2<380 && MesP3<320) && MesP1==(openwinno)){
  550.             MovePic(bottunpic,59,57,59,19,openingpic,320,300);
  551.             CapTitle("ふらっとタイル Ver 4.00+ 操作方法");
  552.             movewinno=OpenWin(helpmovepic,80,80);
  553.             MovePic(bottunpic,0,57,59,19,openingpic,320,300);
  554.             helpmove();
  555.         }
  556.  
  557.         if((MesP2>410 && MesP3>300 && MesP2<470 && MesP3<320) && MesP1==(openwinno)){
  558.             MovePic(bottunpic,59,95,59,19,openingpic,410,300);
  559.             CapTitle("ふらっとタイル Ver 4.00+ ルール");
  560.             rulewinno=OpenWin(helprulepic,80,80);
  561.             MovePic(bottunpic,0,95,59,19,openingpic,410,300);
  562.             helprule();            
  563.         }
  564.  
  565.  
  566.         if((MesP2>500 && MesP3>300 && MesP2<560 && MesP3<320) && MesP1==(openwinno)){
  567.             openwave();
  568.             MovePic(bottunpic,59,152,59,19,openingpic,500,300);
  569.             msgno=MsgBox("ふらっとタイルを終了してもいいですか?",0x20+1);
  570.             MovePic(bottunpic,0,152,59,19,openingpic,500,300);
  571.             if(msgno==1){
  572.                 CloseWin(openwinno);
  573.                 ExitTitle();
  574.             }
  575.             if(msgno==2)    closewave();
  576.         }
  577.  
  578.         if(stageno!=(-1)){        //選択画面の領域内である
  579.             if(stageno<=MAXGAMENO){
  580.             //登録されているゲームの面数以内である
  581.                 if(stageno<58){
  582.                     game(stageno);
  583.                 }
  584.                 else{
  585.                     if(stageno==58){
  586.                         if(clearsum>=58){
  587.                             game(58);
  588.                         }
  589.                         else{
  590.                             warnwave();
  591.                             MsgBox("ステージ58までを全部クリアしてください",0x30);
  592.                         }
  593.                     }
  594.                     if(stageno==59){
  595.                         if(clearsum>=59){
  596.                             game(59);
  597.                         }
  598.                         else{
  599.                             warnwave();
  600.                             MsgBox("ステージ59をクリアしてください",0x30);
  601.                         }
  602.                     }
  603.                 }
  604.             }
  605.             else{
  606.             //登録されていないゲーム面の場合
  607.                 warnwave();
  608.                 MsgBox("このバージョンでは遊べません m(_ _)m",0x30);
  609.             }
  610.         }
  611.     }
  612. }
  613.  
  614. game(stageno){
  615.     del_all;
  616.     int i,fileno;
  617.     str string;
  618.  
  619.     saveflag=0;            //セーブフラグ初期化
  620.     openwinnosave=openwinno;        //オープニング画面番号待避
  621.     openwinno=-2;
  622.     count=-1;            //カウント数のリセット
  623.     check=0;            //チェックの初期値
  624.     countstep();
  625.  
  626.     SetFont(24, "MS ゴシック",128,0,0,0,600);
  627.     TextColor(255,0,0);
  628.     TextWrite("ふらっとタイル",basepic,350,10);
  629.     string=StrPrint("STAGE %2d",stageno+1);
  630.     MovePic(yellowpic,0,0,50,30,basepic,450,40);
  631.     SetFont(30, "MS ゴシック",128,0,0,0,500);
  632.     TextColor(0,255,0);
  633.     TextWrite(string,basepic,375,40);
  634.  
  635.     fileno=OpenF("question.dat");    
  636.     tiledataread(stageno,fileno);
  637.  
  638.     tiledraw();
  639.     CloseF(fileno);
  640.  
  641.     placeX=1;placeY=1;dir=2;    //スタートのふらっとマンの場所、向き
  642.     MovePic(uppic,0,0,33,33,basepic,46,46,0,color);
  643.  
  644.     CapTitle("ふらっとタイル Ver 4.00+ ゲーム盤");
  645.     basewinno=OpenWin(basepic,40,40);
  646.     startwave();
  647.  
  648.     move(stageno);
  649. }
  650.  
  651.  
  652. countstep(){
  653.     real i;
  654.     str string;
  655.  
  656.     count=count+1;
  657.     string=StrPrint("STEP = %4ld",count);
  658.     MovePic(yellowpic,0,0,50,18,basepic,440,252);
  659.     SetFont(20, "MS ゴシック",0,0,0,0,600);
  660.     TextColor(0,0,255);
  661.     BackMode(1);
  662.     TextWrite(string,basepic,390,252);
  663. }
  664.  
  665.  
  666.  
  667. openmainwindow(){
  668.     openwinno=OpenWin(openingpic,20,20);
  669.     PlayWAVE("opening.wav");
  670. }
  671.  
  672.  
  673.  
  674. inifilecheck(){
  675.     int i;
  676.     str stagestring;
  677.  
  678.     if(GetIniInt("check","flag",0,"flattile.ini")==0){
  679.         WriteIniInt("check","flag",1,"flattile.ini");
  680.         for(i=0;i<60;i=i+1){
  681.             stagestring=StrPrint("stage_%d",i+1);
  682.             WriteIniInt("report",stagestring,0,"flattile.ini");
  683.         }
  684.     }
  685.     if(GetIniInt("check","flag",0,"flattile.ini")==1){
  686.         WriteIniInt("check","flag",2,"flattile.ini");
  687.         for(i=0;i<60;i=i+1){
  688.             stagestring=StrPrint("pass_%d",i+1);
  689.             WriteIniInt("pass",stagestring,123456789,"flattile.ini");
  690.             security(i+1);
  691.         }
  692.     }
  693. }
  694.  
  695. int passcheck()
  696. {
  697.     int i,password;
  698.     str string;
  699.  
  700.     for(i=0;i<30;i=i+1){
  701.  
  702.         password=passget(i+1);
  703.  
  704.         if(password!=0){
  705.             warnwave();
  706.             string=StrPrint("STAGE %ldのパスワードが違います",i+1);
  707.             MsgBox(string,0x30);
  708.             return(-1);
  709.         }
  710.     }
  711.  
  712.     return(0);
  713.  
  714. }
  715.  
  716. main(){
  717.  
  718.     int c;
  719.  
  720.     inifilecheck();
  721.     c=passcheck();
  722.  
  723.     if(c==0)
  724.     {
  725.         CapTitle("ふらっとタイル Ver 4.00+");
  726.         loadpicture();            //画像の読み込み
  727.         color=GetColor(yellowpic,1,1);
  728.  
  729.         clearbmp();
  730.  
  731.         drawpic();            //画像の描き込み
  732.         opening();            //オープニング関係の描き込み
  733.  
  734.         openmainwindow();
  735.         select();
  736.     }
  737.  
  738.     if(c!=0)    ExitTitle();
  739. }
  740.  
  741.  
  742.