Helepolis

h

Apr 4th, 2014
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.60 KB | None | 0 0
  1. #TouhouDanmakufu
  2. #Title[Knife Sign "Tick Of the Eternal Clock" ]
  3. #Text[first independent script]
  4. #Image[.\img\Danmakufu_sample01.png]
  5. #Player[FREE]
  6. #ScriptVersion[2]
  7.  
  8. script_enemy_main {
  9.     let Name        = "Knife Sign"\""The Tick Of Time"\";
  10.     let ImgBoss     = "script\img\ExRumia.png";
  11.    
  12.     // start position
  13.         let XIni     = GetClipMaxX - 32;
  14.         let YIni     = GetClipMaxY - 32;
  15.    
  16.     // Start attack position
  17.         let XStart   = GetClipMinX + 48;
  18.         let YStart   = GetClipMinY + 96;
  19.     }
  20.    
  21.     @intialize{
  22.         SetLife(6000);
  23.         SetTimer(150);
  24.         SetScore(9000000);
  25.         SetDamageRate(10,10);
  26.        
  27.         LoadGraphic(ImgBoss);
  28.         SetTexture(ImgBoss);
  29.         setGraphicsStop;
  30.        
  31.         Concentration01(90);
  32.        
  33.         Cutin(SAKUYA, NAME, "", 0, 0);
  34.        
  35.        
  36.         TMain;
  37.    
  38.     }
  39.  
  40.     @MainLoop{
  41.         SetCollisionA (GetX, GetY, 32);
  42.         SetCollisionB (GetX, GetY, 16);
  43.         yield;
  44.  
  45.     }
  46.  
  47.     @DrawLoop{
  48.         DrawGraphic(GetX, GetY);
  49.  
  50.     }
  51.  
  52.     @BackGround{
  53.  
  54.     }
  55.  
  56.     @Finalize{
  57.         DeleteGraphic(ImgBoss);
  58.        
  59.         loop(500) {
  60.            let x = GetX + rand(-64, 64);
  61.            let y = GetY + rand(-64, 64);
  62.            CreateItem(ITEM_SCORE, x, y);
  63.        }
  64.  
  65.     }
  66.    // Meat and Potatoes?
  67.     task TMain {
  68.         yield;
  69.        
  70.     //Prepare
  71.         appear;
  72.         levitate;
  73.         ready;
  74.        
  75.         loop{
  76.             move;
  77.             concentrate;
  78.             fire;
  79.         }
  80.     }
  81.     // The slow beginning
  82.     sub appear {
  83.         let wIni =120;
  84.        
  85.         SetMovePosition02(XIni, YIni, wIni);
  86.        setGraphicMove;
  87.     }
  88.     //Levi
  89.         sub levitate{
  90.             let wLev = 30;
  91.  
  92.        setGraphicStop;
  93.        SetMovePosition02(XIni, YIni + 10, wLev);
  94.        wait(wLev);
  95.        SetMovePosition02(XIni, YIni, wLev);
  96.        wait(wLev);
  97.     }
  98.     // ready
  99.         sub ready{
  100.             let wMove = 120;
  101.             let wStop = 60;
  102.  
  103.             SetMovePosition02(XStart, YStart, wMove);
  104.             setGraphicMove;
  105.             wait(wMove);
  106.  
  107.             setGraphicStop;
  108.             wait(wStop);
  109.  
  110.         `   SetDamageRate(40, 40);
  111.     }
  112.     //Movement
  113.         sub move{
  114.             let wMove = 60;
  115.  
  116.             moveToPlayer(rand(40, 80), rand(-40, 40), wMove,
  117.                 GetClipMinX + 48, GetClipMinY +  32,
  118.                 GetClipMaxX - 48, GetClipMinY + 128);
  119.             setGraphicMove;
  120.     }
  121.     // Lock and load
  122.         sub fire{
  123.         let base     = GetAngleToPlayer;      // base direction
  124.        let interval = 10;                    // interval of the aiming shot
  125.        let nShot    = 130;                     // number of the shots
  126.        let wFire    = 1;                     // firing interval
  127.        let delay    = wFire * nShot/8;         // delay frames
  128.        let wBefore  = 60 - delay;            // waiting frames before firing
  129.        let v        = 10;                   // velocity
  130.        
  131.         setGraphicPose;
  132.        wait(wBefore);
  133.        
  134.         loop(nShot)
  135.     }
Advertisement
Add Comment
Please, Sign In to add comment