home *** CD-ROM | disk | FTP | other *** search
/ ring.yamanashi.ac.jp/pub/pc/freem/action/ / action.zip / TQAP.zip / Usr / Sungeki.tonyu < prev    next >
Text File  |  2007-06-09  |  5KB  |  282 lines

  1. extends SpriteChar;
  2.  
  3. $screenWidth =32*15;
  4. $screenHeight=32*12;
  5. $map.setbgcolor(color(0,0,0));
  6. $map.scrollTo(32,32);
  7.  
  8. type=p;
  9. p=-1;
  10.  
  11. $Location.sungeki=1;
  12.  
  13.  
  14. for (e in $chars){
  15.   if (e is Effect ) e.die();
  16.   if (e is Enemy  ) e.die();
  17.   if (e is Key    ) e.die();
  18.   if (e is Door   ) e.die();
  19.   if (e is Mychar ) e.die();
  20.   if (e is Opening) e.die();
  21.   if (e is Magic  ) e.die();
  22. }
  23.  
  24. //âXâeü[âW1
  25.  
  26. if (type==1){
  27.   sungeki_init("sungeki_001");
  28.   Mychar=appear(new Puppet(100,200));
  29.   key_input();
  30.   
  31.   updateEx(20);
  32.   key_input();
  33.   updateEx(20);
  34.   key_input();
  35.   Mychar_right(500);
  36.   updateEx(150);
  37.   key_input();
  38.   updateEx(50);
  39.   clear_all();
  40.   
  41.   file=new FileReader($Location.stagefile);
  42.   while(1){
  43.     blockline=file.readLn();
  44.     if (blockline=="*init") break;
  45.   }
  46.   $Location.stage =valueOf(file.readLn().substring(8));
  47.   $Location.set_x =valueOf(file.readLn().substring(8));
  48.   $Location.set_y =valueOf(file.readLn().substring(8));
  49.   $Location.nokori=valueOf(file.readLn().substring(8));
  50.   file.close();
  51.  
  52.   appear(new load());
  53.   $Location.sungeki=0;
  54.   die();
  55. }
  56.  
  57.  
  58. //âQü[âÇé╠Éαû╛
  59.  
  60. if (type==0){
  61.   sungeki_init("sungeki_howtoplay");
  62.   Mychar=appear(new Puppet(100,200));
  63.   
  64.   key_input();
  65.   
  66.   updateEx(10);
  67.   key_input();
  68.   
  69.   updateEx(10);
  70.   key_input();
  71.   
  72.   Mychar_right(50);
  73.   updateEx(100);
  74.   Mychar_left(20);
  75.   updateEx(100);
  76.   key_input();
  77.   
  78.   Mychar_up(30);
  79.   updateEx(50);
  80.   Mychar_down(20);
  81.   updateEx(50);
  82.   Mychar_up(50);
  83.   Mychar_right(1);
  84.   updateEx(100);
  85.   key_input();
  86.   
  87.   Mychar_right(20);
  88.   updateEx(20);
  89.   Mychar_jump();
  90.   updateEx(50);
  91.   key_input();
  92.   
  93.   Mychar_magic();
  94.   updateEx(250);
  95.   key_input();
  96.   
  97.   Mychar_magic();
  98.   updateEx(10);
  99.   Mychar_jump();
  100.   Mychar_right(5);
  101.   updateEx(200);
  102.   key_input();
  103.   
  104.   Mychar_right(100);
  105.   Mychar_magic();
  106.   updateEx(200);
  107.   key_input();
  108.   
  109.   Mychar_right(150);
  110.   updateEx(10);
  111.   Mychar_magic();
  112.   updateEx(100);
  113.   key_input();
  114.   
  115.   Mychar_right(50);
  116.   Mychar_jump();
  117.   updateEx(100);
  118.   key_input();
  119.   
  120.   Mychar_right(45);
  121.   updateEx(50);
  122.   Mychar_jump();
  123.   updateEx(100);
  124.   key_input();
  125.   
  126.   Mychar_left(50);
  127.   updateEx(50);
  128.   Mychar_magic();
  129.   updateEx(100);
  130.   Mychar_left(30);
  131.   updateEx(50);
  132.   Mychar_magic();
  133.   updateEx(100);
  134.   key_input();
  135.   
  136.   
  137.   Mychar_left(100);
  138.   updateEx(100);
  139.   Mychar_right(1);
  140.   key_input();
  141.   
  142.   updateEx(10);
  143.   key_input();
  144.   
  145.   updateEx(10);
  146.   key_input();
  147.   
  148.   clear_all();
  149.   
  150.   $projectManager.loadPage($page_index);
  151.   
  152. }
  153.  
  154. //âGâôâfâBâôâO
  155.  
  156. if (type==99){
  157.   sungeki_init("sungeki_ending");
  158.   Mychar=appear(new Puppet(100,200));
  159.   
  160.   key_input();
  161.   
  162.   Mychar_right(70);
  163.   updateEx(100);
  164.   Mychar_jump();
  165.   updateEx(30);
  166.   key_input();
  167.  
  168.   Mychar_right(110);
  169.   updateEx(120);
  170.   Mychar_left(1);
  171.   updateEx(100);
  172.   key_input();
  173.   updateEx(100);
  174.   key_input();
  175.   
  176.   key_input();
  177.   
  178.   clear_all();
  179.   
  180.   $projectManager.loadPage($page_index);
  181. }
  182.  
  183. //æÇéΦÉlî`ê┌ô«--------------------------------------------------
  184.  
  185. function Mychar_right(_time){
  186.   
  187.   move=appear(new Effect(0,0,"puppet_move_right",_time));
  188.   move.puppet=Mychar;
  189. }
  190.  
  191. function Mychar_left(_time){
  192.   
  193.   move=appear(new Effect(100,100,"puppet_move_left",_time));
  194.   move.puppet=Mychar;
  195. }
  196.  
  197. function Mychar_up(_time){
  198.   move=appear(new Effect(100,100,"puppet_move_up",_time));
  199.   move.puppet=Mychar;
  200.   
  201. }
  202.  
  203. function Mychar_down(_time){
  204.   move=appear(new Effect(100,100,"puppet_move_down",_time));
  205.   move.puppet=Mychar;
  206.   
  207. }
  208. function Mychar_magic(){
  209.   move=appear(new Effect(100,100,"puppet_magic"));
  210.   move.puppet=Mychar;
  211. }
  212.  
  213. function Mychar_jump(){
  214.   move=appear(new Effect(100,100,"puppet_move_jump"));
  215.   move.puppet=Mychar;
  216.   
  217. }
  218.  
  219. function wait_puppet(_page){
  220.   
  221.   while(1){
  222.     if (narration.page==_page) break;
  223.     update();
  224.   }
  225.   
  226. }
  227.  
  228. function key_input(){
  229.   
  230.   narration.okuri=1;
  231.   
  232.   while(narration.okuri==1){
  233.     update();
  234.   }
  235.   
  236. }
  237.  
  238. //Åëè·Åêù¥üiâ}âbâvô╟é▌ì₧é▌üAâüâbâZü[âWèiö[é╚é╟üj------------------
  239.  
  240. function sungeki_init(filename){
  241.   
  242.   file=new FileReader(filename+".txt");
  243.   blockzero=$pat_block+0;
  244.   
  245.   for (_y=1;_y<25;_y++){
  246.     blockline=file.readLn();
  247.     for  (_x=1;_x<31;_x++){
  248.       block=blockzero+valueOf(blockline.substring((_x-1)*2,_x*2));
  249.       $map.set(_x,_y,block);
  250.     }  
  251.   }
  252.   message="";
  253.   read="";
  254.   file.readLn();
  255.   while(1){
  256.     read=file.readLn();
  257.     message=message+read+"#";
  258.     if(read==null) break;
  259.   }
  260.   
  261.   file.close();
  262.   
  263.   appear(new Effect(x,y,"sungeki_black"));
  264.   narration=appear(new Effect(0,0,"narration",message));
  265.   wait(1);
  266.   
  267. }
  268.  
  269. function clear_all(){
  270.   
  271.   for (e in $chars){
  272.     if (e is Effect) e.die();
  273.     if (e is Puppet) e.die();
  274.   }
  275.   
  276.   for (_y=1;_y<25;_y++){
  277.     for  (_x=1;_x<31;_x++){
  278.       $map.set(_x,_y,$pat_block+0);
  279.     }  
  280.   }
  281.   
  282. }