Jimbo16

Untitled

Mar 8th, 2016
96
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function delay(d) {
  2.     loop(d) { yield; }
  3. }
  4.  
  5. //-----------------------------------------------
  6.  
  7. task shockwave(tobj,color){
  8.     let obj = ObjPrim_Create(OBJ_SPRITE_2D);
  9.     let Xscale = 0.2;
  10.     let Yscale = 0.2;
  11.     let alpha = 255;
  12.    
  13.     ObjPrim_SetTexture(obj, GetCurrentScriptDirectory ~ "shockwave.png");
  14.     ObjSprite2D_SetSourceRect(obj,0, 0, 256, 256);
  15.     ObjRender_SetScaleXYZ(obj,Xscale,Yscale,0);
  16.     Obj_SetRenderPriorityI(obj,50);
  17.     ObjSprite2D_SetDestCenter(obj);
  18.     ObjRender_SetAlpha(obj,alpha);
  19.     ObjRender_SetColor(obj,color[0],color[1],color[2]);
  20.     ObjRender_SetBlendType(obj,BLEND_ADD_ARGB);
  21.     ObjRender_SetPosition(obj,ObjMove_GetX(tobj),ObjMove_GetY(tobj),0);
  22.     ObjRender_SetAngleXYZ(obj,0,0,0);
  23.     loop(30){
  24.         ObjRender_SetScaleXYZ(obj,Xscale,Yscale,0);
  25.         ObjRender_SetAlpha(obj,alpha);
  26.         Xscale+=0.1;
  27.         Yscale+=0.1;
  28.         alpha-=8.5;
  29.         yield;
  30.     }
  31.     Obj_Delete(obj);
  32. }
  33.  
  34. task chargeWave(target,size,color) {
  35.     let obj = ObjPrim_Create(OBJ_SPRITE_2D);
  36.     let alpha = 40;
  37.    
  38.     ObjPrim_SetTexture(obj, GetCurrentScriptDirectory ~ "shockwave.png");
  39.     ObjSprite2D_SetSourceRect(obj,0, 0, 256, 256);
  40.     ObjRender_SetScaleXYZ(obj,size,size,0);
  41.     Obj_SetRenderPriorityI(obj,50);
  42.     ObjSprite2D_SetDestCenter(obj);
  43.     ObjRender_SetAlpha(obj,alpha);
  44.     ObjRender_SetColor(obj,color[0],color[1],color[2]);
  45.     ObjRender_SetBlendType(obj,BLEND_ADD_ARGB);
  46.     ObjRender_SetPosition(obj,ObjMove_GetX(target),ObjMove_GetY(target),0);
  47.     ObjRender_SetAngleXYZ(obj,0,0,0);
  48.     loop(42){
  49.         size -= size/21;
  50.         alpha += 107/42;
  51.         ObjRender_SetScaleXYZ(obj,size,size,0);
  52.         ObjRender_SetAlpha(obj,alpha);
  53.         yield;
  54.     }
  55.     Obj_Delete(obj);
  56. }
  57.  
  58. task enemy_explode(tobj,expand,angle,color){
  59.     let obj = ObjPrim_Create(OBJ_SPRITE_2D);
  60.     let Xscale = 0.1;
  61.     let Yscale = 0.1;
  62.     let alpha = 255;
  63.    
  64.     ObjPrim_SetTexture(obj, GetCurrentScriptDirectory ~ "shockwave.png");
  65.     ObjSprite2D_SetSourceRect(obj,0, 0, 256, 256);
  66.     ObjRender_SetScaleXYZ(obj,Xscale,Yscale,0);
  67.     Obj_SetRenderPriorityI(obj,50);
  68.     ObjSprite2D_SetDestCenter(obj);
  69.     ObjRender_SetAlpha(obj,alpha);
  70.     ObjRender_SetColor(obj,color[0],color[1],color[2]);
  71.     ObjRender_SetBlendType(obj,BLEND_ADD_ARGB);
  72.     ObjRender_SetPosition(obj,ObjMove_GetX(tobj),ObjMove_GetY(tobj),0);
  73.     ObjRender_SetAngleXYZ(obj,angle,angle,0);
  74.     loop(30){
  75.         ObjRender_SetScaleXYZ(obj,Xscale,Yscale,0);
  76.         ObjRender_SetAlpha(obj,alpha);
  77.         Xscale+=expand;
  78.         Yscale+=expand;
  79.         alpha-=8.5;
  80.         yield;
  81.     }
  82.     Obj_Delete(obj);
  83. }
  84.  
  85. task RedMagicCircle(enemyID,delay) {
  86.     let circleobj = ObjPrim_Create(OBJ_SPRITE_2D);
  87.     let circleimg = GetCurrentScriptDirectory ~ "eff_magicsquare.png";
  88.     let scale = 0;
  89.     let scale1 = 1.4;
  90.     let scaleA = 0;
  91.     let angle = 0;
  92.     let angle1 = 3.6;
  93.     let speed = 0;
  94.     let speed1 = 0;
  95.     let speed2 = 0;
  96.     let speed3 = 0;
  97.     let alpha = 112;
  98.    
  99.     ObjPrim_SetTexture(circleobj, circleimg);
  100.     ObjRender_SetBlendType(circleobj, BLEND_ADD_ARGB );
  101.     ObjRender_SetAngleXYZ(circleobj, 0, 0, angle );
  102.     ObjRender_SetScaleXYZ(circleobj, scale, scale, 0 );
  103.     ObjSprite2D_SetSourceRect(circleobj, 0, 0, 256, 256 );
  104.     ObjSprite2D_SetDestCenter(circleobj);
  105.    
  106.     loop(delay) {
  107.         ObjRender_SetScaleXYZ(circleobj, scale, scale, 0 );
  108.     Obj_SetRenderPriorityI(circleobj, 1 );
  109.         ObjRender_SetAlpha(circleobj, 0 );
  110.         yield;
  111.     }
  112.    
  113.     while(!Obj_IsDeleted(enemyID)) {
  114.         ObjRender_SetAlpha(circleobj, alpha );
  115.         Obj_SetRenderPriorityI(circleobj, 32 );
  116.         ObjRender_SetPosition(circleobj,ObjMove_GetX(enemyID),ObjMove_GetY(enemyID),0);
  117.         if(scale<scale1) {
  118.             scale += scale1/28;
  119.             angle -= angle1;
  120.             angle1 += 0.02;
  121.             ObjRender_SetScaleXYZ(circleobj,scale,scale,0);
  122.             ObjRender_SetAngleXYZ(circleobj,25 - 25 * cos(speed),2 + 27 * sin(speed),angle);
  123.         }
  124.         //ObjRender_SetPosition(circleobj,ObjMove_GetX(enemyID),ObjMove_GetY(enemyID),0);
  125.         ObjRender_SetAngleXYZ(circleobj, 21 - 28 * cos(speed), 2 + 35 * sin(speed), angle - speed3*15 - speed*1.8 ); //Sets the angle and the rotation speed of the circle.
  126.         ObjRender_SetScaleXYZ(circleobj, scale1 - 0.1 * sin( speed*0 ), scale1 - 0.1 * sin( speed*0 ), 0 ); //Determines if the circle size changes while rotating. '0' means no change in size.
  127.         if( speed1 < 1 ){ speed2 += 2; }
  128.         speed1 = 1 * sin( speed2 );
  129.         if( scale1 < 1 ){ scaleA += 2; }
  130.         scale1 = 1 * sin( scaleA );
  131.         if( scale1 >= 1 && speed1 >= 1 ){ speed += 0.6; }
  132.    
  133.         yield;
  134.     }
  135.     Obj_Delete(circleobj);
  136. }
  137.  
  138.  
  139. //----- Following effect created with help of Python's codings
  140.  
  141. task Junko_Aura(target,r,g,b,angle,delay) {
  142.     let auraimg = "script/Sandbox/Kanjuden Boss Rush/Boss/Junko/enm6b.png";
  143.     let bsize = 0;
  144.     let fsize = 1.2;
  145.     let change = 0;
  146.    
  147.     let aura = ObjPrim_Create(OBJ_SPRITE_2D);
  148.     ObjPrim_SetTexture(aura,auraimg);
  149.     Obj_SetRenderPriorityI(aura,35);
  150.     ObjSprite2D_SetSourceRect(aura,0,0,128,84);
  151.     ObjSprite2D_SetDestRect(aura,0,-42,128,42);
  152.     ObjRender_SetBlendType(aura,BLEND_ADD_ARGB);
  153.     ObjRender_SetColor(aura,r,g,b);
  154.     ObjRender_SetAngleZ(aura,-90);
  155.     ObjRender_SetAngleX(aura,90);
  156.     ObjRender_SetScaleXYZ(aura,bsize,bsize,0);
  157.    
  158.     loop(delay){
  159.         ObjRender_SetScaleXYZ(aura,bsize,bsize,0);
  160.         yield;
  161.     }
  162.    
  163.     let asub = 90;
  164.     let aplus = -90;
  165.     while(!Obj_IsDeleted(target)){
  166.         ObjRender_SetPosition(aura,ObjMove_GetX(target),ObjMove_GetY(target),0);
  167.         if(bsize<fsize){
  168.             ObjRender_SetScaleXYZ(aura,bsize,bsize,0);
  169.             bsize += fsize/50;
  170.         }
  171.         if(ObjRender_GetAngleX(aura) > 0){
  172.             ObjRender_SetAngleX(aura, asub);
  173.             asub -= 15;
  174.         }
  175.         if(ObjRender_GetAngleZ(aura) < angle){
  176.             ObjRender_SetAngleZ(aura, aplus);
  177.             aplus += 15;
  178.         }
  179.         ObjRender_SetColor(aura,r,g,b);
  180.         r += 3*sin(change*3.6);
  181.         g += 2*sin(change*4);
  182.         b += 3*sin(change*3.6);
  183.         change++;
  184.        
  185.         yield;
  186.     }
  187.     Obj_Delete(aura);
  188. }
  189.  
  190.  
  191. //Following effects all by AJS
  192.  
  193.  
  194. task FlameAura(tobj,color,scale){  
  195.     let angle = rand(0,360);
  196.    
  197.     while(!Obj_IsDeleted(tobj)){
  198.         flame(tobj,color,scale);
  199.         flamebase(tobj,color,scale,angle);
  200.         angle+=rand(45,90);
  201.         delay(10);}
  202. }
  203.  
  204. task FlameAuraBase(tobj,color,scale){
  205.     let angle = rand(0,360);
  206.  
  207.     while(!Obj_IsDeleted(tobj)){
  208.         flamebase(tobj,color,scale,angle);
  209.         flamebase2(tobj,color,scale,angle);
  210.         angle+=rand(45,90);
  211.         delay(6);} 
  212. }
  213.  
  214. task FlameAuraBase2(tobj,color,scale,anchor){
  215.     let angle = rand(0,360);
  216.    
  217.     while(!Obj_IsDeleted(anchor)){
  218.         flamebase2(tobj,color,scale,angle);
  219.         angle+=rand(45,90);
  220.         delay(10);}
  221. }
  222.  
  223. task flame(tobj,color,scale){
  224.     let frame = 0;
  225.     let obj = ObjPrim_Create(OBJ_SPRITE_2D);
  226.     let Xscale = scale/2;
  227.     let Yscale = scale/6;
  228.     let trans = 255;
  229.    
  230.     ObjPrim_SetTexture(obj, GetCurrentScriptDirectory~"eff_aura.png");
  231.     ObjSprite2D_SetSourceRect(obj,0, 0, 51, 49);
  232.     ObjRender_SetScaleXYZ(obj,Xscale,Yscale,1);
  233.     Obj_SetRenderPriorityI(obj,34);
  234.     ObjSprite2D_SetDestCenter(obj);
  235.     ObjRender_SetBlendType(obj,BLEND_ADD_ARGB);
  236.     ObjRender_SetPosition(obj,ObjMove_GetX(tobj)-2,ObjMove_GetY(tobj)+8,0);
  237.     ObjRender_SetAngleXYZ(obj,0,0,rand(-5,5));
  238.     ObjRender_SetColor(obj,color[0],color[1],color[2]);
  239.     loop(30){
  240.         ObjRender_SetScaleXYZ(obj,Xscale,Yscale,1);
  241.         ObjRender_SetAlpha(obj,trans);
  242.         ObjRender_SetPosition(obj,ObjMove_GetX(tobj)-2,ObjMove_GetY(tobj)-20,0);
  243.         trans-=255/30;
  244.         Xscale+=(scale/4)/30;
  245.         Yscale+=(scale*2)/30;
  246.         yield;
  247.     }
  248.     Obj_Delete(obj);
  249. }
  250.  
  251. task flamebase(tobj,color,scale,angle){
  252.     let frame = 0;
  253.     let obj = ObjPrim_Create(OBJ_SPRITE_2D);
  254.     let Xscale = scale;
  255.     let Yscale = scale;
  256.     let trans = 12;
  257.    
  258.     ObjPrim_SetTexture(obj, GetCurrentScriptDirectory~"eff_aura.png");
  259.     ObjSprite2D_SetSourceRect(obj,51, 5, 91, 45);
  260.     ObjRender_SetScaleXYZ(obj,Xscale,Yscale,1);
  261.     Obj_SetRenderPriorityI(obj,34);
  262.     ObjSprite2D_SetDestCenter(obj);
  263.     ObjRender_SetBlendType(obj,BLEND_ADD_ARGB);
  264.     ObjRender_SetPosition(obj,ObjMove_GetX(tobj),ObjMove_GetY(tobj),0);
  265.     ObjRender_SetAngleXYZ(obj,0,0,angle);
  266.     ObjRender_SetColor(obj,color[0],color[1],color[2]);
  267.     loop(40){
  268.         ObjRender_SetScaleXYZ(obj,Xscale,Yscale,1);
  269.         ObjRender_SetAlpha(obj,trans);
  270.         ObjRender_SetPosition(obj,ObjMove_GetX(tobj),ObjMove_GetY(tobj),0);
  271.         trans+=255/40;
  272.         Xscale-=scale*1.1/40;
  273.         Yscale-=scale*1.1/40;
  274.         yield;
  275.     }
  276.     Obj_Delete(obj);
  277. }
  278.  
  279. task flamebase2(tobj,color,scale,angle){
  280.     let frame = 0;
  281.     let obj = ObjPrim_Create(OBJ_SPRITE_2D);
  282.     let Xscale = scale*1.3;
  283.     let Yscale = scale*1.3;
  284.     let trans = 16;
  285.    
  286.     ObjPrim_SetTexture(obj, GetCurrentScriptDirectory~"eff_aura.png");
  287.     ObjSprite2D_SetSourceRect(obj,51, 5, 91, 45);
  288.     ObjRender_SetScaleXYZ(obj,Xscale,Yscale,1);
  289.     Obj_SetRenderPriorityI(obj,24);
  290.     ObjSprite2D_SetDestCenter(obj);
  291.     ObjRender_SetBlendType(obj,BLEND_ADD_ARGB);
  292.     ObjRender_SetPosition(obj,ObjRender_GetX(tobj),ObjRender_GetY(tobj),0);
  293.     ObjRender_SetAngleXYZ(obj,0,0,angle);
  294.     ObjRender_SetColor(obj,color[0],color[1],color[2]);
  295.     loop(40){
  296.         ObjRender_SetScaleXYZ(obj,Xscale,Yscale,1);
  297.         ObjRender_SetAlpha(obj,trans);
  298.         ObjRender_SetPosition(obj,ObjRender_GetX(tobj),ObjRender_GetY(tobj),0);
  299.         trans+=250/40;
  300.         Xscale-=scale*1.15/40;
  301.         Yscale-=scale*1.15/40;
  302.         yield;
  303.     }
  304.     Obj_Delete(obj);
  305. }
  306.  
  307.  
  308. task MoonConcentration(tobj,frames,color){
  309. let spiral =0;
  310. let dir =0;
  311. loop(frames){
  312.     loop(1){
  313.         loop(3){
  314.             MoonCharge(tobj,ObjMove_GetX(tobj)+cos(dir+spiral)*rand(175,196),ObjMove_GetY(tobj)+sin(dir+spiral)*rand(175,196),dir+spiral,-rand(5.25,5.5),color);
  315.             dir+=360/3;
  316.         }
  317.     }
  318.     spiral+=rand(30,40);
  319.     yield;
  320. }
  321. }
  322.  
  323. task MoonExplosion(tobj,color){
  324.     let spiral =0;
  325.            
  326.     loop(8){
  327.         ascent(i in 0..15){
  328.             MoonCharge2(tobj,ObjMove_GetX(tobj),ObjMove_GetY(tobj),i*rand(360/16,360/6),rand(6,10),color);
  329.         }
  330.         wait(2);
  331.     }
  332. }
  333.  
  334.  
  335. //-----Aura Effect around the boss-----
  336.  
  337. task TWaveCircle(enemyID,color) {
  338.     //レンダリングターゲットに使用するテクスチャ
  339.     let renderTexture = GetReservedRenderTargetName(0);
  340.  
  341.     let frame = 0; //フレーム
  342.     let baseEffectRadius = 144; //基準エフェクト半径
  343.     let outerFluct = 16; //エフェクト半径の最大変化量
  344.     let effectRadius = 0; //エフェクト半径
  345.     let circleVertexCount = 16; //円をあらわすのに使用する頂点の数
  346.     let innerCircleCount = 4;
  347.  
  348.     let priEffectMin = 20; //エフェクトをかける最小優先度
  349.     let priEffectMax = 28; //エフェクトをかける最大優先度
  350.  
  351.     //背景のみエフェクトの対象とする
  352.     //エフェクトの描画でまかなえるため、
  353.     //優先度20~28の通常描画を無効にする。
  354.     SetInvalidRenderPriorityA1(priEffectMin, priEffectMax);
  355.  
  356.  
  357.     let frameWidth = GetStgFrameWidth();
  358.     let frameHeight = GetStgFrameHeight();
  359.     let frameLeft = GetStgFrameLeft();
  360.     let frameRight = frameLeft + frameWidth;
  361.     let frameTop = GetStgFrameTop();
  362.     let frameBottom = frameTop + frameHeight;
  363.  
  364.     //--------------------------------
  365.     //円形の影
  366.     let path = "script/Sandbox/Kanjuden Boss Rush/eff/aura.png";
  367.     let objShadow = ObjPrim_Create(OBJ_SPRITE_2D); //2Dスプライトオブジェクト生成
  368.     Obj_SetRenderPriorityI(objShadow, 25); //描画優先度を設定
  369.     ObjPrim_SetTexture(objShadow, path); //テクスチャを設定
  370.     ObjRender_SetBlendType(objShadow, BLEND_ALPHA);
  371.     ObjRender_SetAlpha(objShadow,120);
  372.     ObjRender_SetColor(objShadow,color[0],color[1],color[2]);
  373.     ObjSprite2D_SetSourceRect(objShadow, 0, 0, 512, 512); //描画元設定(44, 54)-(71,105)
  374.     ObjSprite2D_SetDestCenter(objShadow);
  375.     ObjRender_SetScaleXYZ(objShadow, 0.6, 0.6, 0);
  376.  
  377.  
  378.     //--------------------------------
  379.     //円内
  380.     let objInnerC = ObjPrim_Create(OBJ_PRIMITIVE_2D);
  381.     Obj_SetRenderPriorityI(objInnerC, priEffectMax + 1);
  382.     ObjPrim_SetTexture(objInnerC, renderTexture);
  383.     ObjPrim_SetVertexCount(objInnerC, 6 * circleVertexCount * innerCircleCount);
  384.  
  385.     //円外~エフェクト枠
  386.     let objOuterC = ObjPrim_Create(OBJ_PRIMITIVE_2D);
  387.     Obj_SetRenderPriorityI(objOuterC, priEffectMax + 1);
  388.     ObjPrim_SetTexture(objOuterC, renderTexture); //テクスチャを設定
  389.     ObjPrim_SetVertexCount(objOuterC, 3 * circleVertexCount);
  390.  
  391.     //エフェクト枠外オブジェクト
  392.     let objOuterE = ObjPrim_Create(OBJ_SPRITE_LIST_2D);
  393.     Obj_SetRenderPriorityI(objOuterE, priEffectMax + 1);
  394.     ObjPrim_SetTexture(objOuterE, renderTexture); //テクスチャを設定
  395.  
  396.  
  397.     //ボスのライフが0になるまでエフェクトをかける。
  398.     while(ObjEnemy_GetInfo(enemyID, INFO_LIFE) > 0)
  399.     {
  400.         //エフェクト半径
  401.         effectRadius = baseEffectRadius + outerFluct * sin(frame*4);
  402.  
  403.         let enemyX = ObjMove_GetX(enemyID); //敵座標X
  404.         let enemyY = ObjMove_GetY(enemyID); //敵座標Y
  405.         let circleLeft = enemyX - effectRadius + frameLeft; //エフェクト円の左端
  406.         let circleRight = enemyX + effectRadius + frameLeft; //エフェクト円の右端
  407.         let circleTop = enemyY - effectRadius + frameTop; //エフェクト円の上端
  408.         let circleBottom = enemyY + effectRadius + frameTop; //エフェクト円の下端
  409.  
  410.         //--------------------------------
  411.         //優先度20~28(背景)をエフェクト用のテクスチャに描画
  412.         RenderToTextureA1(renderTexture, priEffectMin, priEffectMax, true);
  413.  
  414.         //--------------------------------
  415.         //影
  416.         ObjRender_SetPosition(objShadow, enemyX, enemyY, 0);
  417.  
  418.         //--------------------------------
  419.         //円内
  420.         //エフェクト内円を描画
  421.         //ゆらいでいる部分
  422.         ObjRender_SetPosition(objInnerC, -frameLeft, -frameTop, 0);
  423.         ascent(let iPosI in 0 .. circleVertexCount)
  424.         {
  425.             let xyOldRadius = 0;
  426.             ascent(let iCircle in 0 .. innerCircleCount)
  427.             {
  428.                 let vertexIndex = (iPosI * innerCircleCount + iCircle) * 6;
  429.                 let angle1 =  iPosI * (360 / circleVertexCount);
  430.                 let angle2 =  (iPosI + 1) * (360 / circleVertexCount);
  431.  
  432.                 //テクスチャのUV座標
  433.                 let uvRadius1 = iCircle * effectRadius / innerCircleCount;
  434.                 let uvRadius2 = (iCircle + 1) * effectRadius / innerCircleCount;
  435.  
  436.                 //テクスチャのUV座標と描画先のXY座標を変化させることでゆらぎを表現する
  437.                 let xyRadius1t = iCircle * effectRadius / innerCircleCount;
  438.                 let xyRadius2t = (iCircle + 1) * effectRadius / innerCircleCount;
  439.                 let xyRadius1 = xyOldRadius;
  440.                 let xyBias = (xyRadius2t - xyRadius1t) / 2 + (xyRadius2t - xyRadius1t) * sin(frame*16 + (iCircle * 360 / innerCircleCount)) / 4;
  441.                 let xyRadius2 = xyRadius2t + xyBias / ((innerCircleCount - iCircle + 1) / 2);
  442.  
  443.                 xyOldRadius = xyRadius2;
  444.                 if(iCircle == innerCircleCount - 1)
  445.                 {
  446.                     xyRadius2 = uvRadius2;
  447.                 }
  448.  
  449.                 //上記の頂点座標を設定
  450.                 let leftBias = enemyX + frameLeft;
  451.                 let topBias = enemyY + frameTop;
  452.                 ObjPrim_SetVertexPosition(objInnerC, vertexIndex  , leftBias + xyRadius1 * cos(angle1), topBias + xyRadius1 * sin(angle1), 0);
  453.                 ObjPrim_SetVertexPosition(objInnerC, vertexIndex+1, leftBias + xyRadius2 * cos(angle1), topBias + xyRadius2 * sin(angle1), 0);
  454.                 ObjPrim_SetVertexPosition(objInnerC, vertexIndex+2, leftBias + xyRadius1 * cos(angle2), topBias + xyRadius1 * sin(angle2), 0);
  455.            
  456.                 ObjPrim_SetVertexPosition(objInnerC, vertexIndex+3, leftBias + xyRadius1 * cos(angle2), topBias + xyRadius1 * sin(angle2), 0);
  457.                 ObjPrim_SetVertexPosition(objInnerC, vertexIndex+4, leftBias + xyRadius2 * cos(angle1), topBias + xyRadius2 * sin(angle1), 0);
  458.                 ObjPrim_SetVertexPosition(objInnerC, vertexIndex+5, leftBias + xyRadius2 * cos(angle2), topBias + xyRadius2 * sin(angle2), 0);
  459.  
  460.                 ObjPrim_SetVertexUVT(objInnerC, vertexIndex  , leftBias + uvRadius1 * cos(angle1), topBias + uvRadius1 * sin(angle1));
  461.                 ObjPrim_SetVertexUVT(objInnerC, vertexIndex+1, leftBias + uvRadius2 * cos(angle1), topBias + uvRadius2 * sin(angle1));
  462.                 ObjPrim_SetVertexUVT(objInnerC, vertexIndex+2, leftBias + uvRadius1 * cos(angle2), topBias + uvRadius1 * sin(angle2));
  463.            
  464.                 ObjPrim_SetVertexUVT(objInnerC, vertexIndex+3, leftBias + uvRadius1 * cos(angle2), topBias + uvRadius1 * sin(angle2));
  465.                 ObjPrim_SetVertexUVT(objInnerC, vertexIndex+4, leftBias + uvRadius2 * cos(angle1), topBias + uvRadius2 * sin(angle1));
  466.                 ObjPrim_SetVertexUVT(objInnerC, vertexIndex+5, leftBias + uvRadius2 * cos(angle2), topBias + uvRadius2 * sin(angle2));
  467.  
  468.             }
  469.         }
  470.  
  471.  
  472.         //--------------------------------
  473.         //円外~エフェクト枠
  474.         //揺らいでいる円の外側から矩形までを埋める
  475.         ObjRender_SetPosition(objOuterC, -frameLeft, -frameTop, 0);
  476.         ascent(let iPosO in 0 .. circleVertexCount)
  477.         {
  478.             let angle1 = iPosO * (360 / circleVertexCount);
  479.             let angle2 = (iPosO + 1) * (360 / circleVertexCount);
  480.             let rectX = 0;
  481.             let rectY = 0;
  482.             if(angle1 >= 0 && angle1 < 90)
  483.             {
  484.                 rectX = circleRight;
  485.                 rectY = circleBottom;
  486.             }
  487.             else if(angle1 >= 90 && angle1 < 180)
  488.             {
  489.                 rectX = circleLeft;
  490.                 rectY = circleBottom;
  491.             }
  492.             else if(angle1 >= 180 && angle1 < 270)
  493.             {
  494.                 rectX = circleLeft;
  495.                 rectY = circleTop;
  496.             }
  497.             else if(angle1 >= 270 && angle1 < 360)
  498.             {
  499.                 rectX = circleRight;
  500.                 rectY = circleTop;
  501.             }
  502.             let vertexIndex = iPosO * 3;
  503.             ObjPrim_SetVertexPosition(objOuterC, vertexIndex, enemyX + effectRadius * cos(angle1) + frameLeft, enemyY + effectRadius * sin(angle1) + frameTop, 0);
  504.             ObjPrim_SetVertexPosition(objOuterC, vertexIndex+1, rectX, rectY, 0);
  505.             ObjPrim_SetVertexPosition(objOuterC, vertexIndex+2, enemyX + effectRadius * cos(angle2) + frameLeft, enemyY + effectRadius * sin(angle2) + frameTop, 0);
  506.  
  507.             ObjPrim_SetVertexUVT(objOuterC, vertexIndex, enemyX + effectRadius * cos(angle1) + frameLeft, enemyY + effectRadius * sin(angle1) + frameTop);
  508.             ObjPrim_SetVertexUVT(objOuterC, vertexIndex+1, rectX, rectY);
  509.             ObjPrim_SetVertexUVT(objOuterC, vertexIndex+2, enemyX + effectRadius * cos(angle2) + frameLeft, enemyY + effectRadius * sin(angle2) + frameTop);
  510.         }
  511.        
  512.  
  513.         //--------------------------------
  514.         //エフェクト枠外
  515.         //エフェクト枠外の背景を描画する
  516.         ObjSpriteList2D_ClearVertexCount(objOuterE);
  517.         ObjRender_SetPosition(objOuterE, -frameLeft, -frameTop, 0);
  518.         ObjSpriteList2D_SetSourceRect(objOuterE, frameLeft, frameTop, frameRight, circleTop + 1);
  519.         ObjSpriteList2D_SetDestRect(objOuterE, frameLeft, frameTop, frameRight, circleTop + 1);
  520.         ObjSpriteList2D_AddVertex(objOuterE);
  521.  
  522.         ObjSpriteList2D_SetSourceRect(objOuterE, frameLeft, circleTop, circleLeft + 1, circleBottom);
  523.         ObjSpriteList2D_SetDestRect(objOuterE, frameLeft, circleTop, circleLeft + 1, circleBottom);
  524.         ObjSpriteList2D_AddVertex(objOuterE);
  525.  
  526.         ObjSpriteList2D_SetSourceRect(objOuterE, circleRight, circleTop, frameRight, circleBottom);
  527.         ObjSpriteList2D_SetDestRect(objOuterE, circleRight, circleTop, frameRight, circleBottom);
  528.         ObjSpriteList2D_AddVertex(objOuterE);
  529.  
  530.         ObjSpriteList2D_SetSourceRect(objOuterE, frameLeft, circleBottom, frameRight, frameBottom);
  531.         ObjSpriteList2D_SetDestRect(objOuterE, frameLeft, circleBottom, frameRight, frameBottom);
  532.         ObjSpriteList2D_AddVertex(objOuterE);
  533.  
  534.         frame++;
  535.         yield;
  536.     }
  537.  
  538.     //エフェクト用オブジェクト削除
  539.     Obj_Delete(objInnerC);
  540.     Obj_Delete(objOuterC);
  541.     Obj_Delete(objOuterE);
  542.     Obj_Delete(objShadow);
  543.     ClearInvalidRenderPriority();
  544. }
  545.  
  546.  
  547.  
  548. // speed, mx, and my variables are used to make effect objects move across the screen
  549. task MoonCharge(tobj,xpos,ypos,angle,speed,color){
  550.         let mx = speed*cos(angle);
  551.         let my = speed*sin(angle);
  552.         let alpha = 20;
  553.         let s = 2;
  554.         let obj = ObjPrim_Create(OBJ_SPRITE_2D);
  555.         let angleX = rand(0,360);
  556.         let angleY = rand(0,360);
  557.         let angleZ = rand(0,360);
  558.         let Xrot = rand(-3,3);
  559.         let Yrot = rand(-3,3);
  560.         let Zrot = rand(-3,3);
  561.        
  562.         ObjPrim_SetTexture(obj, GetCurrentScriptDirectory~"loading.png");
  563.         ObjSprite2D_SetSourceRect(obj,0, 128, 60, 188);
  564.         ObjRender_SetBlendType(obj,BLEND_ADD_ARGB);
  565.         ObjRender_SetColor(obj,color[0],color[1],color[2]);
  566.         Obj_SetRenderPriorityI(obj,60);
  567.         ObjSprite2D_SetDestCenter(obj);
  568.         ObjRender_SetPosition(obj,xpos,ypos,0);
  569.         ObjRender_SetAngleZ(obj,angle);
  570.  
  571.         while(!Obj_IsDeleted(obj)&&alpha<192){
  572.         ObjRender_SetAlpha(obj,alpha);
  573.         ObjRender_SetScaleXYZ(obj,s,s,s);
  574.         ObjRender_SetAngleXYZ(obj,angleX,angleY,angleZ);
  575.        
  576.         angleX+=Xrot;
  577.         angleY+=Yrot;
  578.         angleZ+=Zrot;
  579.         alpha+=rand(5,6.4);
  580.         s-=0.04;
  581.         ObjRender_SetPosition(obj,ObjRender_GetX(obj)+mx,ObjRender_GetY(obj)+my,0);
  582.         wait(1);
  583.  
  584.                 }
  585.  
  586. Obj_Delete(obj);
  587.  
  588. }
  589.  
  590. task MoonCharge2(tobj,xpos,ypos,angle,speed,color){
  591.         let mx = speed*cos(angle);
  592.         let my = speed*sin(angle);
  593.         let alpha = 200;
  594.         let s = 1.1;
  595.         let obj = ObjPrim_Create(OBJ_SPRITE_2D);
  596.         let angleX = rand(0,360);
  597.         let angleY = rand(0,360);
  598.         let angleZ = rand(0,360);
  599.         let Xrot = rand(-3,3);
  600.         let Yrot = rand(-3,3);
  601.         let Zrot = rand(-3,3);
  602.        
  603.         ObjPrim_SetTexture(obj, GetCurrentScriptDirectory~"loading.png");
  604.         ObjSprite2D_SetSourceRect(obj,0, 128, 60, 188);
  605.         ObjRender_SetBlendType(obj,BLEND_ADD_ARGB);
  606.         ObjRender_SetColor(obj,color[0],color[1],color[2]);
  607.         Obj_SetRenderPriorityI(obj,60);
  608.         ObjSprite2D_SetDestCenter(obj);
  609.         ObjRender_SetPosition(obj,xpos,ypos,0);
  610.         ObjRender_SetAngleZ(obj,angle);
  611.  
  612.         while(!Obj_IsDeleted(obj)&&alpha>0){
  613.         ObjRender_SetAlpha(obj,alpha);
  614.         ObjRender_SetScaleXYZ(obj,s,s,s);
  615.         ObjRender_SetAngleXYZ(obj,angleX,angleY,angleZ);
  616.        
  617.         angleX+=Xrot;
  618.         angleY+=Yrot;
  619.         angleZ+=Zrot;
  620.         alpha-=rand(5,7);
  621.         s+=0.04;
  622.         ObjRender_SetPosition(obj,ObjRender_GetX(obj)+mx,ObjRender_GetY(obj)+my,0);
  623.         wait(1);
  624.  
  625.                 }
  626.  
  627. Obj_Delete(obj);
  628.  
  629. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×