?login_element?

Subversion Repositories NedoOS

Rev

Rev 957 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. #ifndef INT_FRAGMENTS
  2. #define INT_FRAGMENTS
  3. #include "sprite_pool.c"
  4. #include "engine.c"
  5. #include "interpreter.c"
  6.  
  7. extern u8 exec_cnt;
  8.  
  9. i16 yy;
  10. i16 xx;
  11.  
  12. void int_enemies_pair(u8 type, u16 tile, u16 hp)
  13. {
  14.     switch (exec_cnt)
  15.     {
  16.         case 0:
  17.             push_npc(32, -32, 0, 2, tile, type, hp, 0);
  18.             push_npc(266, -32, 0, 2, tile, type, hp, 0);
  19.             break;
  20.         case 10:
  21.             npc_by_type_set_speed(type, 0, 0);
  22.             break;
  23.         case  11:
  24.             npc_type_star(type);
  25.             break;
  26.         case 15:
  27.             npc_by_type_set_speed(type, 0, 5);
  28.             break;
  29.     }
  30. }
  31.  
  32. void int_make_left_flyers(u8 type, i16 y, u16 tile, u16 hp, u16 bonus)
  33. {
  34.     switch (exec_cnt)
  35.     {
  36.         case 0:                                  
  37.         case 3:                              
  38.         case 6:                              
  39.             push_npc(320, y, -3, 0, tile, 30, hp, bonus);
  40.             break;
  41.     }
  42. }
  43.  
  44. void int_make_right_flyers(u8 type, i16 y, u16 tile, u16 hp, u16 bonus)
  45. {
  46.     switch (exec_cnt)
  47.     {
  48.         case 0:                                  
  49.         case 3:                              
  50.         case 6:                              
  51.             push_npc(0, y, 3, 0, tile, 30, hp, bonus);
  52.             break;
  53.     }
  54. }
  55.  
  56. void int_make_boom_fairy(i16 x, u16 hp, u16 bonus)
  57. {
  58.     switch (exec_cnt) {
  59.         case 0:                                    
  60.             push_npc(x, -32, 0, 5, FIARY3, 100, hp, bonus);
  61.             break;                                          
  62.         case 3:                                
  63.             npc_by_type_set_speed(100, 0, 0);              
  64.             break;                                          
  65.         case 5:                                
  66.             npc_type_star(100);                            
  67.             break;                                          
  68.         case 7:                                
  69.             npc_type_star(100);                            
  70.             break;                                          
  71.         case 11:                              
  72.             npc_by_type_set_speed(100, 2, 2);              
  73.             break;
  74.     }
  75. }
  76.  
  77. void int_make_caravan(u8 type, i16 x, i16 tile, i16 hp, i16 bonus)
  78. {
  79.     switch (exec_cnt)
  80.     {
  81.         case 0:                                            
  82.             push_npc(x, -32, 0, 2, tile, type, hp, bonus);          
  83.             push_npc(x + 32, -32, 0, 2, tile, type, hp, bonus);    
  84.             break;                                                  
  85.         case 5:                                        
  86.             push_npc(x, -32, 0, 2, tile, type + 1, hp, bonus);      
  87.             push_npc(x + 32, -32, 0, 2, tile, type + 1, hp, bonus);
  88.             break;                                                  
  89.         case 10:                                      
  90.             push_npc(x, -32, 0, 2, tile, type + 2, hp, bonus);      
  91.             push_npc(x + 32, -32, 0, 2, tile, type + 2, hp, bonus);
  92.             break;                                                  
  93.         case 15:                                      
  94.             npc_by_type_set_speed(type, (x > 160) ? -4 : 4, 0);    
  95.             break;                                                  
  96.         case 20:                                      
  97.             npc_by_type_set_speed(type + 1, (x > 160) ? -4 : 4, 0);
  98.             break;                                                  
  99.         case 25:                                      
  100.             npc_type_shoot(type, 3, 3);                            
  101.             npc_type_shoot(type + 1, 4, 3);                        
  102.             npc_type_shoot(type + 2, 5, 3);                        
  103.             npc_by_type_set_speed(type + 2, (x > 160) ? -4 : 4, 0);
  104.             break;                                                  
  105.         case 27:                                      
  106.             npc_type_shoot(type, 2, 3);                            
  107.             npc_type_shoot(type + 1, 1, 3);                        
  108.             npc_type_shoot(type + 2, 0, 3);                        
  109.             break;                                                  
  110.         case  29:                                      
  111.             npc_type_shoot(type, 1, 3);                            
  112.             npc_type_shoot(type + 1, 0, 3);                        
  113.             npc_type_shoot(type + 2, -1, 3);                        
  114.             break;                                                  
  115.         case 35:                                      
  116.             npc_by_type_set_speed(type, 1, 3);                      
  117.             npc_by_type_set_speed(type + 1, 0, 3);                  
  118.             npc_by_type_set_speed(type + 2, -2, 3);                
  119.             break;
  120.     }
  121. }
  122.  
  123. void int_enemy_wave(u16 tile, u8 type, u16 hp)
  124. {
  125.     switch (exec_cnt) {
  126.         case 0:                                    
  127.             push_npc(144, -32, 2, 2, tile, type, hp, 0);    
  128.             push_npc(176, -32, 2, 2, tile, type, hp, 0);    
  129.             break;                                          
  130.         case 0 + 5:                                
  131.             push_npc(144, -32, 2, 2, tile, type + 1, hp, 0);
  132.             push_npc(176, -32, 2, 2, tile, type + 1, hp, 0);
  133.             npc_by_type_set_speed(type, 0, 2);              
  134.             break;                                          
  135.         case 0 + 10:                                
  136.             push_npc(144, -32, 2, 2, tile, type + 2, hp, 0);
  137.             push_npc(176, -32, 2, 2, tile, type + 2, hp, 0);
  138.             npc_by_type_set_speed(type, -2, 2);              
  139.             npc_by_type_set_speed(type + 1, 0, 2);          
  140.             break;                                          
  141.         case 0 + 15:                                
  142.             push_npc(144, -32, 2, 2, tile, type, hp, 0);    
  143.             push_npc(176, -32, 2, 2, tile, type, hp, 0);    
  144.             npc_type_shoot(type, 3, 0);                      
  145.             npc_type_shoot(type, -3, 0);                    
  146.             npc_type_shoot(type + 1, 3, 0);                  
  147.             npc_type_shoot(type + 1, -3, 0);                
  148.             npc_type_shoot(type + 2, 3, 0);                  
  149.             npc_type_shoot(type + 2, -3, 0);                
  150.             npc_by_type_set_speed(type, 0, 2);              
  151.             npc_by_type_set_speed(type + 1, -2, 2);          
  152.             npc_by_type_set_speed(type + 2, 0, 2);          
  153.             break;                                          
  154.         case 0 + 20:                                
  155.             npc_by_type_set_speed(type, 2, 2);              
  156.             npc_by_type_set_speed(type + 1, 0, 2);          
  157.             npc_by_type_set_speed(type + 2, -2, 2);          
  158.             npc_type_shoot(type, 3, 3);                      
  159.             npc_type_shoot(type, -3, 3);                    
  160.             npc_type_shoot(type + 1, 3, 0);                  
  161.             npc_type_shoot(type + 1, -3, 0);                
  162.             npc_type_shoot(type + 2, 3, -3);                
  163.             npc_type_shoot(type + 2, -3, -3);                
  164.             break;                                          
  165.         case 0 + 25:                                
  166.             npc_by_type_set_speed(type, 0, 2);              
  167.             npc_by_type_set_speed(type + 1, 2, 2);          
  168.             npc_by_type_set_speed(type + 2, 0, 2);          
  169.             npc_type_shoot(type, 3, 3);                      
  170.             npc_type_shoot(type, -3, 3);                    
  171.             npc_type_shoot(type + 1, 3, 0);                  
  172.             npc_type_shoot(type + 1, -3, 0);                
  173.             npc_type_shoot(type + 2, 3, -3);                
  174.             npc_type_shoot(type + 2, -3, -3);                
  175.             break;                                          
  176.         case 0 + 30:                                
  177.             npc_by_type_set_speed(type, -2, 2);              
  178.             npc_by_type_set_speed(type + 1, 0, 2);          
  179.             npc_by_type_set_speed(type + 2, 2, 2);          
  180.             npc_type_shoot(type, 3, -3);                    
  181.             npc_type_shoot(type, -3, -3);                    
  182.             npc_type_shoot(type + 1, 3, -3);                
  183.             npc_type_shoot(type + 1, -3, -3);                
  184.             npc_type_shoot(type + 2, 3, -3);                
  185.             npc_type_shoot(type + 2, -3, -3);                
  186.             break;                                          
  187.         case 0 + 35:                                
  188.             npc_by_type_set_speed(type, 0, 2);              
  189.             npc_by_type_set_speed(type + 1, 0, 2);          
  190.             npc_by_type_set_speed(type + 2, 0, 2);          
  191.             break;
  192.     }
  193. }
  194.  
  195. void int_mid_boss1(u16 tile, u16 hp) {
  196.     switch(exec_cnt) {
  197.     case 0:
  198.         scroll_speed = 0;
  199.         push_npc(176/*160*/, -32, 0, 5, tile, 200, hp, 0);
  200.         break;
  201.     case 0 + 3:
  202.         npc_by_type_set_speed(200, 2, 0);
  203.         scroll_speed = 0;
  204.         break;
  205.     case 5:
  206.         push_star(find_npc_by_type(200)->sprite.x + 16, find_npc_by_type(200)->sprite.y + 16);
  207.         break;
  208.     case 0 + 6:
  209.         if (find_npc_by_type(200) == 0) exec_cnt = 0 + 24;
  210.         break;
  211.     case 7:
  212.         push_star(find_npc_by_type(200)->sprite.x + 16, find_npc_by_type(200)->sprite.y + 16);
  213.         break;
  214.     case 0 + 8:
  215.         if (find_npc_by_type(200) == 0) exec_cnt = 0 + 24;
  216.         break;
  217.     case 9:
  218.         push_star(find_npc_by_type(200)->sprite.x + 16, find_npc_by_type(200)->sprite.y + 16);
  219.         break;
  220.     case 0 + 10:
  221.         if (find_npc_by_type(200) == 0) exec_cnt = 0 + 24;
  222.         break;
  223.     case 11:
  224.         push_star(find_npc_by_type(200)->sprite.x + 16, find_npc_by_type(200)->sprite.y + 16);
  225.         break;
  226.     case 0 + 12:
  227.         if (find_npc_by_type(200) == 0) exec_cnt = 0 + 24;
  228.         break;
  229.     case 0 + 13:
  230.         npc_by_type_set_speed(200, -2, 0);
  231.         break;
  232.     case 15:
  233.         push_star(find_npc_by_type(200)->sprite.x + 16, find_npc_by_type(200)->sprite.y + 16);
  234.         break;
  235.     case 0 + 16:
  236.         if (find_npc_by_type(200) == 0) exec_cnt = 0 + 24;
  237.         break;
  238.     case 19:
  239.         push_star(find_npc_by_type(200)->sprite.x + 16, find_npc_by_type(200)->sprite.y + 16);
  240.         break;
  241.     case 0 + 20:
  242.         if (find_npc_by_type(200) == 0) exec_cnt = 0 + 24;
  243.         break;
  244.     case 21:
  245.         push_star(find_npc_by_type(200)->sprite.x + 16, find_npc_by_type(200)->sprite.y + 16);
  246.         break;
  247.     case 0 + 22:
  248.         if (find_npc_by_type(200) == 0) exec_cnt = 0 + 24;
  249.         break;
  250.     case 23:
  251.         push_star(find_npc_by_type(200)->sprite.x + 16, find_npc_by_type(200)->sprite.y + 16);
  252.         break;
  253.     case 0 + 24:
  254.         if (find_npc_by_type(200)) exec_cnt = 0 + 2;
  255.         break;
  256.     case 0 + 25:
  257.         scroll_speed = 1;
  258.         for (push_counter = 0;push_counter < 5;push_counter ++)
  259.             push_bonus((push_counter % 2) == 1 ? BONUS_CARD : HEALTH_CARD, 160, 70, 3 - (push_counter * 2), 3);
  260.         break;
  261.     }
  262. }
  263.  
  264. void int_double_caravan(u16 tile, u16 type, u16 hp, u16 bonus)
  265. {
  266.     switch(exec_cnt)
  267.     {
  268.         case 0:                                          
  269.             push_npc(32, -32, 0, 2, tile, type, hp, bonus);        
  270.             push_npc(270, -32, 0, 2, tile, type + 10, hp, bonus);  
  271.             break;                                                
  272.         case 0 + 4:                                      
  273.             push_npc(32, -32, 0, 2, tile, type + 1, hp, bonus);    
  274.             push_npc(270, -32, 0, 2, tile, type + 11, hp, bonus);  
  275.             break;                                                
  276.         case 0 + 8:                                      
  277.             push_npc(32, -32, 0, 2, tile, type + 2, hp, bonus);    
  278.             push_npc(270, -32, 0, 2, tile, type + 12, hp, bonus);  
  279.             break;                                                
  280.         case 0 + 9:                                      
  281.             npc_by_type_set_speed(type, 2, 0);                    
  282.             npc_by_type_set_speed(type + 10, -2, 0);              
  283.             break;                                                
  284.         case 0 + 14:                                      
  285.             npc_by_type_set_speed(type + 1, 2, 0);                
  286.             npc_by_type_set_speed(type + 11, -2, 0);              
  287.             break;                                                
  288.         case 0 + 19:                                      
  289.             npc_by_type_set_speed(type + 2, 2, 0);                
  290.             npc_by_type_set_speed(type + 12, -2, 0);              
  291.             break;                                                
  292.         case 0 + 20:                                      
  293.             npc_aimed_shoot(type);                            
  294.             npc_aimed_shoot(type + 1);                        
  295.             npc_aimed_shoot(type + 2);                        
  296.             npc_aimed_shoot(type + 10);                      
  297.             npc_aimed_shoot(type + 11);                      
  298.             npc_aimed_shoot(type + 12);                      
  299.             break;                                                
  300.         case 0 + 21:                                      
  301.             npc_by_type_set_speed(type + 10, 0, 2);                
  302.             npc_by_type_set_speed(type + 11, 0, 2);                
  303.             npc_by_type_set_speed(type + 12, 0, 2);                
  304.             npc_by_type_set_speed(type, 0, 2);                    
  305.             npc_by_type_set_speed(type + 1, 0, 2);                
  306.             npc_by_type_set_speed(type + 2, 0, 2);                
  307.             break;
  308.     }
  309. }
  310.  
  311. void int_make_shooting_star(u8 type,u16 x, u16 y, u16 tile, u16 hp)
  312. {
  313.     switch(exec_cnt)
  314.     {
  315.         case 0:                                          
  316.             push_npc(x - 56/*52*/, y, 0, 0, tile, type, hp, BONUS_CARD);  
  317.             break;                                                
  318.         case 0 + 1:                                      
  319.             push_npc(x - 50/*51*/, y - 37, 0, 0, tile, type, hp, BONUS_CARD);  
  320.             break;                                                
  321.         case 0 + 2:                                      
  322.             push_npc(x - 19, (y<76)?16:y-60/*y - 60*/, 0, 0, tile, type, hp, BONUS_CARD);  
  323.             break;                                                
  324.         case 0 + 3:                                      
  325.             push_npc(x + 20, (y<76)?16:y-60/*y - 60*/, 0, 0, tile, type, hp, BONUS_CARD);  
  326.             break;                                                
  327.         case 0 + 4:                                      
  328.             push_npc(x + 50/*52*/, y - 37, 0, 0, tile, type, hp, BONUS_CARD);  
  329.             break;                                                
  330.         case 0 + 5:                                      
  331.             push_npc(/*(x>(304-56))?304:*/x+56/*64*/, y, 0, 0, tile, type, hp, BONUS_CARD);
  332.             break;                                                
  333.         case 0 + 7:                                      
  334.             push_npc(x + 50/*52*/, y + 38, 0, 0, tile, type, hp, BONUS_CARD);
  335.             break;                                                
  336.         case 0 + 8:                                      
  337.             push_npc(x + 20, y + 61, 0, 0, tile, type, hp, BONUS_CARD);
  338.             break;                                                
  339.         case 0 + 9:                                      
  340.             push_npc(x - 19, y + 61, 0, 0, tile, type, hp, BONUS_CARD);
  341.             break;                                                
  342.         case 0 + 10:                                    
  343.             push_npc(x - 50/*51*/, y + 38/*30*/, 0, 0, tile, type, hp, BONUS_CARD);
  344.             break;                                                
  345.         case 0 + 15:                                    
  346.         case 0 + 20:                                    
  347.         case 0 + 25:                                    
  348.             push_star(x + 10, y + 10);                                  
  349.             break;                                                
  350.         case 0 + 30:                                    
  351.             npc_by_type_set_speed(type, 0, 5);                    
  352.             break;
  353.     }
  354. }
  355.  
  356. void int_push_npc(u8 type, i16 x, i16 y, i16 dx, i16 dy, u16 tile, u16 bonus, u16 hp)
  357. {
  358.     push_npc(x, y, dx, dy, tile, type, hp, bonus);
  359. }
  360.  
  361. void int_triangle(u8 hp, u16 tile, u16 bonus)
  362. {
  363.     switch (exec_cnt)
  364.     {
  365.         case 0:
  366.             push_npc(160, -10, 0, 2, tile, 10, hp, bonus);
  367.             break;
  368.         case 0 + 2:
  369.             push_npc(128, -10, 0, 2, tile, 11, hp, bonus);
  370.             push_npc(192, -10, 0, 2, tile, 11, hp, bonus);
  371.             break;
  372.         case 0 + 4:
  373.             push_npc(96, -10, 0, 2, tile, 12, hp, bonus);
  374.             push_npc(224, -10, 0, 2, tile, 12, hp, bonus);
  375.             break;
  376.         case 0 + 8:
  377.             push_npc(64, -10, 0, 2, tile, 13, hp, bonus);
  378.             push_npc(256, -10, 0, 2, tile, 13, hp, bonus);
  379.             break;
  380.         case 0 + 12:
  381.             push_npc(32, -10, 0, 2, tile, 14, hp, bonus);
  382.             push_npc(288, -10, 0, 2, tile, 14, hp, bonus);
  383.             break;
  384.         case 0 + 14:
  385.             npc_by_type_set_speed(10, 0, 0);
  386.             npc_by_type_set_speed(11, 0, 0);
  387.             npc_by_type_set_speed(12, 0, 0);
  388.             npc_by_type_set_speed(13, 0, 0);
  389.             npc_by_type_set_speed(14, 0, 0);
  390.             npc_type_shoot(12, 0, 4);
  391.             npc_type_shoot(13, 0, 4);
  392.             npc_type_shoot(11, 0, 4);
  393.             npc_type_shoot(10, 0, 4);
  394.             break;
  395.         case 0 + 15:
  396.         case 0 + 16:
  397.         case 0 + 17:
  398.         case 0 + 18:
  399.             npc_type_shoot(12, 0, 4);
  400.             npc_type_shoot(13, 0, 4);
  401.             npc_type_shoot(14, 0, 4);
  402.             npc_type_shoot(11, 0, 4);
  403.             npc_type_shoot(10, 0, 4);
  404.             break;
  405.         case 0 + 25:
  406.             npc_by_type_set_speed(10, 0, 2);
  407.             npc_by_type_set_speed(11, 0, 2);
  408.             npc_by_type_set_speed(12, 0, 2);
  409.             npc_by_type_set_speed(13, 0, 2);
  410.             npc_by_type_set_speed(14, 0, 2);
  411.             break;
  412.     }
  413. }
  414.  
  415. void int_make_corridor(u8 type, u16 tile, u16 hp, u16 bonus)
  416. {
  417.     switch(exec_cnt)
  418.     {
  419.         case 0:                                        
  420.         case 0 + 3:                                    
  421.         case 0 + 6:                                    
  422.         case 0 + 9:                                    
  423.             push_npc(10, -32, 0, 3, tile, type, hp, bonus);      
  424.             push_npc(290, -32, 0, 3, tile, type + 1, hp, bonus);
  425.             break;                                              
  426.         case 0 + 16:                                    
  427.             npc_by_type_set_speed(type, 0, 0);                  
  428.             npc_by_type_set_speed(type + 1, 0, 0);              
  429.             break;                                              
  430.         case 0 + 18:                                    
  431.             npc_aimed_shoot(type);                              
  432.             npc_aimed_shoot(type + 1);                            
  433.             break;                                              
  434.         case 0 + 19:                                    
  435.             npc_by_type_set_speed(type, 0, 3);                  
  436.             npc_by_type_set_speed(type + 1, 0, 3);              
  437.             break;
  438.     }
  439. }
  440.  
  441. void int_make_triangle_half(u8 isLeft, u16 tile, u8 hp, u16 bonus)
  442. {
  443.     switch (exec_cnt)
  444.     {
  445.     case 0:
  446.         push_npc(160, -10, 0, 2, tile, 10, hp, bonus);
  447.         break;
  448.     case 0 + 2:
  449.         push_npc(isLeft ? 128 : 188, -10, 0, 2, tile, 11, hp, bonus);
  450.         break;
  451.     case 0 + 4:
  452.         push_npc(isLeft ? 96 : 220, -10, 0, 2, tile, 12, hp, bonus);
  453.         break;
  454.     case 0 + 8:
  455.         push_npc(isLeft ? 64 : 252, -10, 0, 2, tile, 13, hp, bonus);
  456.         break;
  457.     case 0 + 12:
  458.         push_npc(isLeft ? 32 : 284, -10, 0, 2, tile, 14, hp, bonus);
  459.         break;
  460.     case 0 + 14:
  461.         npc_by_type_set_speed(10, 0, 0);
  462.         npc_by_type_set_speed(11, 0, 0);
  463.         npc_by_type_set_speed(12, 0, 0);
  464.         npc_by_type_set_speed(13, 0, 0);
  465.         npc_by_type_set_speed(14, 0, 0);
  466.         npc_aimed_shoot(10);
  467.         npc_aimed_shoot(11);
  468.         npc_aimed_shoot(12);
  469.         npc_aimed_shoot(13);
  470.         npc_aimed_shoot(14);
  471.         break;
  472.     case 0 + 15:
  473.     case 0 + 16:
  474.     case 0 + 17:
  475.     case 0 + 18:
  476.         npc_aimed_shoot(10);
  477.         npc_aimed_shoot(11);
  478.         npc_aimed_shoot(12);
  479.         npc_aimed_shoot(13);
  480.         npc_aimed_shoot(14);
  481.         break;
  482.     case 0 + 25:
  483.         npc_by_type_set_speed(10, isLeft ? 2 : -2, 2);
  484.         npc_by_type_set_speed(11, isLeft ? 2 : -2, 2);
  485.         npc_by_type_set_speed(12, isLeft ? 2 : -2, 2);
  486.         npc_by_type_set_speed(13, isLeft ? 2 : -2, 2);
  487.         npc_by_type_set_speed(14, isLeft ? 2 : -2, 2);
  488.         break;
  489.     }
  490. }
  491.  
  492. void int_dropped_enemy(u8 hp, u16 x,u16 tile)
  493. {
  494.     push_npc(x, -10, 0, 4, tile, 1, hp, 0);
  495.     push_npc(x + 96, -10, 0, 4, tile, 1, hp, 0);
  496. }
  497.  
  498. void int_firing_trap(u16 tile)
  499. {
  500.     switch(exec_cnt) {
  501.         case 0:
  502.             push_npc(32, 32, 0 ,0, tile, 50, 60, BONUS_CARD);
  503.             push_npc(288, 32, 0 ,0, tile, 50, 60, HEALTH_CARD);
  504.             push_npc(32, 120, 0 ,0, tile, 50, 60, HEALTH_CARD);
  505.             push_npc(288, 120, 0 ,0, tile, 50, 60, BONUS_CARD);
  506.             break;
  507.         case 5:
  508.         case 10:
  509.         case 15:
  510.         case 20:
  511.         case 25:
  512.         case 30:
  513.         case 35:
  514.         case 40:
  515.         case 45:
  516.         case 50:
  517.         case 55:
  518.         case 60:
  519.         case 65:
  520.         case 70:
  521.         case 75:
  522.         case 80:
  523.             npc_aimed_shoot(50);
  524.             break;
  525.         case 0 + 85:
  526.             npc_by_type_set_speed(50, 0, 3);
  527.             break;
  528.     }
  529. }
  530.  
  531. void int_mid_boss2(u16 tile, u16 hp)
  532. {
  533.     switch(exec_cnt) {
  534.         case 0:
  535.             push_npc(176/*160*/, 32, 2, 0, tile, 200, hp, HEALTH_CARD);
  536.             scroll_speed = 0;
  537.             break;
  538.         case 0 + 2:
  539.         case 0 + 4:
  540.         case 0 + 7:
  541.         case 0 + 9:
  542.             npc_aimed_shoot(200);
  543.             if (find_npc_by_type(200) == 0) exec_cnt = 0 + 24;
  544.             break;
  545.         case 10:
  546.             push_star(find_npc_by_type(200)->sprite.x + 16, find_npc_by_type(200)->sprite.y + 16);
  547.             break;
  548.         case 0 + 11:
  549.             npc_by_type_set_speed(200, -2, 0);
  550.             if (find_npc_by_type(200) == 0) exec_cnt = 0 + 24;
  551.             break;
  552.         case 0 + 12:
  553.         case 0 + 14:
  554.         case 0 + 18:
  555.             npc_aimed_shoot(200);
  556.             if (find_npc_by_type(200) == 0) exec_cnt = 0 + 24;
  557.             break;
  558.         case 22:
  559.             push_star(find_npc_by_type(200)->sprite.x + 16, find_npc_by_type(200)->sprite.y + 16);
  560.             break;
  561.         case 0 + 23:
  562.             npc_by_type_set_speed(200, 2, 0);
  563.             exec_cnt = 0;
  564.             if (find_npc_by_type(200) == 0) exec_cnt = 0 + 24;
  565.             break;
  566.         case 0 + 25:
  567.             scroll_speed = 1;
  568.             push_bonus(HEALTH_CARD, 160, 120, 0, -5);
  569.             push_bonus(BONUS_CARD, 170, 110, 0, -5);
  570.             push_bonus(HEALTH_CARD, 150, 150, 0, -5);
  571.             push_bonus(BONUS_CARD, 130, 100, 0, -5);
  572.             push_bonus(BONUS_CARD, 140, 110, 0, -5);
  573.             push_bonus(HEALTH_CARD, 150, 140, 0, -5);
  574.             push_bonus(BONUS_CARD, 130, 120, 0, -5);
  575.             break;
  576.     }
  577. }
  578.  
  579. void int_aimed_side_enemies(u8 hp, u16 tile)
  580. {
  581.    if (exec_cnt % 5 == 0) {
  582.             yy = player.y;
  583.             push_npc(1, yy, 5, 0, tile, 100, hp, BONUS_CARD);
  584.             push_npc(1, yy - 32, 5, 0, tile, 100, hp, BONUS_CARD);
  585.             push_npc(300, yy + 16, -5, 0, tile, 100, hp, BONUS_CARD);
  586.    }
  587. }
  588.  
  589. void int_aimed_circle(u8 hp, u16 tile)
  590. {
  591.     u8 type = 10 + (exec_cnt / 10);
  592.     switch (exec_cnt % 10)
  593.     {
  594.         case 0:  
  595.             xx = player.x;
  596.             yy = player.y - 16;                                      
  597.             push_npc(xx - 56/*52*/, yy, 0, 0, tile, type, hp, BONUS_CARD);                                
  598.             push_npc(xx - 50/*51*/, yy - 37, 0, 0, tile, type, hp, BONUS_CARD);                                  
  599.             push_npc(xx - 19, yy - 60, 0, 0, tile, type, hp, BONUS_CARD);                                      
  600.             push_npc(xx + 20, yy - 60, 0, 0, tile, type, hp, BONUS_CARD);                                      
  601.             push_npc(xx + 52, yy - 37, 0, 0, tile, type, hp, BONUS_CARD);                                      
  602.             push_npc(xx + 56/*64*/, yy, 0, 0, tile, type, hp, BONUS_CARD);          
  603.             break;        
  604.         case 9:
  605.             npc_by_type_set_speed(type, 0, 5);
  606.             break;
  607.     }
  608. }
  609.  
  610. void int_marisa_help()
  611. {
  612.     switch (exec_cnt)
  613.     {
  614.     case 0:
  615.         push_npc(300, 60, -5, 0, MARISA, 200, 1024, HEALTH_CARD);
  616.         break;
  617.     case 7:
  618.         npc_by_type_set_speed(200, 0, 0);
  619.         break;
  620.     case 8:
  621.         xx = find_npc_by_type(200)->sprite.x;
  622.         yy = find_npc_by_type(200)->sprite.y;
  623.         push_bonus(HEALTH_CARD, xx - 16, yy + 16, 0, 3);
  624.         push_bonus(HEALTH_CARD, xx, yy + 16, 0, 3);
  625.         push_bonus(HEALTH_CARD, xx + 16, yy + 16, 0, 3);
  626.         break;
  627.     case 9:
  628.         npc_by_type_set_speed(200, 0, -5);
  629.         break;
  630.     default:
  631.         break;
  632.     }
  633. }
  634.  
  635. void int_set_speed(u8 type, i16 dx, i16 dy)
  636. {
  637.     npc_by_type_set_speed(type, dx, dy);
  638. }
  639.  
  640. void int_aimed_shoot(u8 type)
  641. {
  642.     npc_aimed_shoot(type);
  643. }
  644. #endif