-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbundle.js
More file actions
1 lines (1 loc) · 61.8 KB
/
bundle.js
File metadata and controls
1 lines (1 loc) · 61.8 KB
1
(()=>{"use strict";var t,n,e={349:(t,n,e)=>{e.d(n,{SH:()=>r,ZP:()=>i,Fy:()=>o,bE:()=>a,OK:()=>s,ZA:()=>u,io:()=>h,ax:()=>p});var r=192,i=224,o=360,a=240;function s(t){return t/o}function u(t){return t/a}var c=1/64;function h(t){t.rect([-r,-i,2*r,2*i],c)}function p(t){var n=function(n){return t.rect(n,c)};n([-r,a-16,2*r,16]),n([-r,-a,2*r,16]),n([-o,-a,o-r,2*a]),n([r,-a,o-r,2*a])}},81:(t,n,e)=>{e.r(n);var r=e(745),i=document.getElementById("stage_start"),o=document.getElementById("stage_dec"),a=document.getElementById("stage_inc"),s=document.getElementById("ability_set"),u=document.getElementById("ability_dec"),c=document.getElementById("ability_inc"),h=r.A,p=function(){o.disabled=0==h.stage,a.disabled=h.stage==h.stage_list.length-1,i.value=""+h.stage_list[h.stage].name,u.disabled=0==h.ability,c.disabled=h.ability==h.ability_list.length-1,s.value=""+h.ability_list[h.ability].name,h.scale=h.stage_list[h.stage].default_scale};o.onclick=function(){h.stage--,p()},a.onclick=function(){h.stage++,p()},u.onclick=function(){h.ability--,p()},c.onclick=function(){h.ability++,p()},p()},86:(t,n,e)=>{e.r(n),e.d(n,{global_gl:()=>i,setup:()=>o,setMode:()=>a,loadImage:()=>s,draw:()=>u,loadTexture:()=>c,clear:()=>h,drawRects:()=>v,drawSnake:()=>m});var r=e(349),i={gl:null,shader:{program:0,attribute:{coord:0,tex:0,alpha:0},uniform:{uSampler:0}}};function o(){var t=document.getElementById("glcanvas"),n=t.getContext("webgl");if(null!==n){i.gl=n;var e=n.createShader(n.VERTEX_SHADER),r=n.createShader(n.FRAGMENT_SHADER);n.shaderSource(e,"\nattribute vec2 coord;\nattribute vec2 tex;\nattribute float alpha;\nvarying highp vec2 vTexCoord;\nvarying highp float vTexAlpha;\nvoid main() {\n gl_Position = vec4(coord, 0.0, 1.0);\n vTexCoord = tex;\n vTexAlpha = alpha;\n}\n"),n.shaderSource(r,"\nprecision highp float;\nvarying highp vec2 vTexCoord;\nvarying highp float vTexAlpha;\nuniform sampler2D uSampler;\nvoid main() {\n vec4 col = texture2D(uSampler, vTexCoord);\n col.a *= vTexAlpha;\n col.rgb *= col.a;\n gl_FragColor = col;\n}\n"),n.compileShader(e),n.compileShader(r);var o=n.createProgram();n.attachShader(o,e),n.attachShader(o,r),n.linkProgram(o),n.useProgram(o);var a=i.shader;a.program=o,a.attribute.coord=n.getAttribLocation(o,"coord"),a.attribute.tex=n.getAttribLocation(o,"tex"),a.attribute.alpha=n.getAttribLocation(o,"alpha"),a.uniform.uSampler=n.getUniformLocation(o,"uSampler"),n.enable(n.BLEND),n.blendEquationSeparate(n.FUNC_ADD,n.FUNC_ADD),n.blendFuncSeparate(n.ONE,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA),n.disable(n.DEPTH_TEST),n.viewport(0,0,t.width,t.height)}else alert("Unable to initialize WebGL. Your browser or machine may not support it.")}function a(t){var n=i.gl;0==t?n.blendFuncSeparate(n.ONE,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA):n.blendFuncSeparate(n.ONE,n.ONE,n.ONE,n.ONE_MINUS_SRC_ALPHA)}function s(t){return new Promise((function(n,e){var r=new Image;r.onload=function(){return n(r)},r.onerror=e,r.src=t}))}function u(t,n,e,r,o){var a=i.gl,s=a.createBuffer(),u=i.shader.attribute.coord;a.bindBuffer(a.ARRAY_BUFFER,s),a.bufferData(a.ARRAY_BUFFER,t,a.STATIC_DRAW),a.vertexAttribPointer(u,2,a.FLOAT,!1,0,0),a.enableVertexAttribArray(u);var c=a.createBuffer(),h=i.shader.attribute.tex;a.bindBuffer(a.ARRAY_BUFFER,c),a.bufferData(a.ARRAY_BUFFER,n,a.STATIC_DRAW),a.vertexAttribPointer(h,2,a.FLOAT,!1,0,0),a.enableVertexAttribArray(h);var p=a.createBuffer(),l=i.shader.attribute.alpha;a.bindBuffer(a.ARRAY_BUFFER,p),a.bufferData(a.ARRAY_BUFFER,e,a.STATIC_DRAW),a.vertexAttribPointer(l,1,a.FLOAT,!1,0,0),a.enableVertexAttribArray(l),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,r),a.uniform1i(i.shader.uniform.uSampler,0),a.drawArrays(a.TRIANGLES,0,o)}function c(t,n,e){void 0===n&&(n=!0),void 0===e&&(e=!1);var r=i.gl,o=r.createTexture();return r.bindTexture(r.TEXTURE_2D,o),r.bindTexture(r.TEXTURE_2D,o),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_SHORT_4_4_4_4,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,n?r.LINEAR:r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,n?r.LINEAR:r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,e?r.REPEAT:r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,e?r.REPEAT:r.CLAMP_TO_EDGE),o}function h(){var t=i.gl;t.clearColor(0,0,0,1),t.clear(t.COLOR_BUFFER_BIT),t.clearColor(0,0,1,1)}var p=[-1,-1,1,-1,1,1],l=[-1,1,1,-1,-1,1],f=[0,0,1,0,1,1],d=[0,1,1,0,0,1];function y(t){for(var n=0;n<t.length/2;n++)t[2*n]=(0,r.OK)(t[2*n]),t[2*n+1]=(0,r.ZA)(t[2*n+1])}function v(t,n,e){for(var r=new Float32Array(12*n),i=new Float32Array(12*n),o=new Float32Array(6*n),a=0;a<n;a++)for(var s=0;s<6;s++){var c=t[10*a+2],h=t[10*a+3]*p[s],v=t[10*a+4]*l[s];r[12*a+2*s+0]=t[10*a+0]+h*Math.cos(c)-v*Math.sin(c),r[12*a+2*s+1]=t[10*a+1]+h*Math.sin(c)+v*Math.cos(c),i[12*a+2*s+0]=t[10*a+5]+f[s]*t[10*a+7],i[12*a+2*s+1]=t[10*a+6]+d[s]*t[10*a+8],o[6*a+s]=t[10*a+9]}y(r),u(r,i,o,e,6*n)}function _(t,n,e,r,i,o,a,s,u,c){var h=2*n+4*r,p=2*n+8*(e-1)-4*(r+1);t[h+0]=a,t[h+1]=s,t[p+0]=u,t[p+1]=c,0==r?(h>0&&(t[h-2]=a,t[h-1]=s),t[p+2]=t[h+0],t[p+3]=t[h+1],t[p+4]=t[h+0],t[p+5]=t[h+1]):r==e-2?(t[h-2]=i,t[h-1]=o,t[p+2]=i,t[p+3]=o,t[h+2]=t[p+0],t[h+3]=t[p+1]):(t[h-2]=i,t[h-1]=o,t[p+2]=i,t[p+3]=o)}function m(t,n,e){for(var r=n.reduce((function(t,n){return n.len.reduce((function(t,n){return t+4*(n-1)+2}),t)}),0),o=new Float32Array(2*r),a=new Float32Array(2*r),s=new Float32Array(r),u=new Float32Array(n.reduce((function(t,n){return n.len.reduce((function(t,n){return Math.max(t,n)}),t)}),0)),c=0,h=0,p=0,l=n;p<l.length;p++)for(var f=l[p],d=0,v=f.len;d<v.length;d++){for(var m=v[d],w=0,g=0;g<m-1;g++){var x=t[2*c+2*g],b=t[2*c+2*g+1],M=t[2*c+2*g+2],A=t[2*c+2*g+3],E=(x+M)/2,I=(b+A)/2,T=Math.sqrt((M-x)*(M-x)+(A-b)*(A-b));u[g]=T,w+=T,_(o,h,m,g,x,b,E-(I-b)/T*f.w,I+(E-x)/T*f.w,E+(I-b)/T*f.w,I-(E-x)/T*f.w)}w-=u[0]/2+u[m-2]/2;var P=-u[0]/2;for(g=0;g<m-1;g++)_(a,h,m,g,f.tx+f.tw*P/w,f.ty+f.th/2,f.tx+f.tw*(P+u[g]/2)/w,f.ty,f.tx+f.tw*(P+u[g]/2)/w,f.ty+f.th),P+=u[g];c+=m,h+=4*(m-1)+2}for(g=0;g<r;g++)s[g]=1;y(o);var S=i.gl,N=S.createBuffer(),R=i.shader.attribute.coord;S.bindBuffer(S.ARRAY_BUFFER,N),S.bufferData(S.ARRAY_BUFFER,o,S.STATIC_DRAW),S.vertexAttribPointer(R,2,S.FLOAT,!1,0,0),S.enableVertexAttribArray(R);var k=S.createBuffer(),O=i.shader.attribute.tex;S.bindBuffer(S.ARRAY_BUFFER,k),S.bufferData(S.ARRAY_BUFFER,a,S.STATIC_DRAW),S.vertexAttribPointer(O,2,S.FLOAT,!1,0,0),S.enableVertexAttribArray(O);var C=S.createBuffer(),U=i.shader.attribute.alpha;S.bindBuffer(S.ARRAY_BUFFER,C),S.bufferData(S.ARRAY_BUFFER,s,S.STATIC_DRAW),S.vertexAttribPointer(U,1,S.FLOAT,!1,0,0),S.enableVertexAttribArray(U),S.activeTexture(S.TEXTURE0),S.bindTexture(S.TEXTURE_2D,e),S.uniform1i(i.shader.uniform.uSampler,0),S.drawArrays(S.TRIANGLE_STRIP,0,r-2)}},780:(t,n,e)=>{e.d(n,{l:()=>o});var r=e(86),i=e(349),o=function(){function t(){this.ver=[],this.tex=[],this.alp=[],this.n=0}return t.prototype.bind=function(t){this.img=t},t.prototype.rect=function(t,n){var e,r,i=t[0],o=t[1],a=t[2],s=t[3],u=[i,o,i,o+s,i+a,o,i,o+s,i+a,o,i+a,o+s];(e=this.ver).push.apply(e,u),(r=this.tex).push.apply(r,u.map((function(t){return t*n}))),this.alp.push(1,1,1,1,1,1),this.n+=6},t.prototype.fan=function(t,n){for(var e=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],h=t[8],p=t[9],l=t[10],f=Math.ceil(Math.abs(e)/(2*Math.PI)*n),d=function(t,n,e,r,i,o,a){return t.push(n,e,n+r*Math.cos(o),e+i*Math.sin(o),n+r*Math.cos(a),e+i*Math.sin(a))},y=0;y<f;y++)d(this.ver,i,o,a,a,r+e/f*y,r+e/f*(y+1)),d(this.tex,u,c,h,p,s+e/f*y,s+e/f*(y+1)),this.alp.push(l,l,l);this.n+=3*f},t.prototype.flush=function(){for(var t=new Float32Array(this.ver),n=0;n<t.length;n+=2)t[n]=(0,i.OK)(t[n]),t[n+1]=(0,i.ZA)(t[n+1]);r.draw(t,new Float32Array(this.tex),new Float32Array(this.alp),this.img,this.n),this.ver=[],this.tex=[],this.alp=[],this.n=0},t}()},506:(t,n,e)=>{e.d(n,{rW:()=>U,OJ:()=>C,Uv:()=>m,fx:()=>_,Mw:()=>D,XP:()=>T,pF:()=>M,dB:()=>N,Jz:()=>I,wW:()=>P,a:()=>A});var r,i,o=e(86),a=e(822),s=e(533),u=e(349),c=e(780),h=!1,p=!1,l=0,f=0,d=0,y=0;function v(){return t=this,n=void 0,a=function(){var t,n,e,a;return function(t,n){var e,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;a;)try{if(e=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=n.call(t,a)}catch(t){o=[6,t],r=0}finally{e=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(s){switch(s.label){case 0:return n=(t=o).loadTexture,[4,o.loadImage("assets/ui_bg.png")];case 1:return r=n.apply(t,[s.sent(),!1,!0]),a=(e=o).loadTexture,[4,o.loadImage("assets/scene_bg.png")];case 2:return i=a.apply(e,[s.sent(),!1,!0]),[2]}}))},new((e=void 0)||(e=Promise))((function(r,i){function o(t){try{u(a.next(t))}catch(t){i(t)}}function s(t){try{u(a.throw(t))}catch(t){i(t)}}function u(t){var n;t.done?r(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(o,s)}u((a=a.apply(t,n||[])).next())}));var t,n,e,a}var _,m,w=0,g=0,x=null,b=1,M=1;function A(){return w=performance.now(),g=31,E(),new Promise((function(t,n){x=t}))}function E(){if(--g)requestAnimationFrame(E);else{var t=(performance.now()-w)/30;M=Math.round(t/(1e3/60)),x(M)}}var I={x:0,y:0},T={};function P(){document.onmousemove=function(t){I.x=t.pageX,I.y=t.pageY},document.onmousedown=function(t){T._press=3},document.onmouseup=function(t){T._press=1},document.addEventListener("keydown",(function(t){var n=t.key;1==n.length&&(n=n.toLowerCase()),T[n]=3}),!1),document.addEventListener("keyup",(function(t){var n=t.key;1==n.length&&(n=n.toLowerCase()),T[n]=1}),!1);var t=window.innerWidth,n=window.innerHeight,e=.95*Math.min(t/u.Fy,n/u.bE),r=document.getElementById("glcanvas");_=e*u.Fy,m=e*u.bE,r.style.width=_+"px",r.style.height=m+"px",b=window.devicePixelRatio||1,r.width=_*b,r.height=m*b,o.setup()}var S=!1;function N(){return t=this,n=void 0,r=function(){return function(t,n){var e,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;a;)try{if(e=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=n.call(t,a)}catch(t){o=[6,t],r=0}finally{e=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(t){switch(t.label){case 0:return S?[2]:(S=!0,[4,v()]);case 1:return t.sent(),O(),[2]}}))},new((e=void 0)||(e=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var n;t.done?i(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(a,s)}u((r=r.apply(t,n||[])).next())}));var t,n,e,r}var R=0,k=0;function O(){R=performance.now(),k&&R-k>33&&console.log("Violation: interval takes "+Math.round(100*(R-k))/100+" ms"),function(){var t=a.n.INSTANCE;if(t){var n=function(){if(T.Escape==U&&(h=!h),h)return p=!1,null;var t=0,n=0;T.Shift>=C||T._touch>=C||T._press>=C?(p||(p=!0,l=I.x,f=I.y,d=0,y=0),t=I.x-l-d,n=I.y-f-y,d+=t,y+=n):p=!1,t=t/_*u.Fy*2,n=-n/m*u.bE*2;var e=T.Shift>=C?2:3;return(T.w>=C||T.ArrowUp>=C)&&(n+=e),(T.s>=C||T.ArrowDown>=C)&&(n-=e),(T.a>=C||T.ArrowLeft>=C)&&(t-=e),(T.d>=C||T.ArrowRight>=C)&&(t+=e),{pos_x:t,pos_y:n,key_z:T.z>=C,key_x:T.x==U,key_c:T.c==U}}();if(!h&&(s.U.updateState(n),!h))for(var e=0;e<M;e++)t.update();o.clear();var v=new c.l;v.bind(i),u.io(v),v.flush(),t.render(),o.setMode(0),v.bind(r),u.ax(v),v.flush()}}(),function(){for(var t in T)3==T[t]&&(T[t]=2),1==T[t]&&(T[t]=0)}(),S&&requestAnimationFrame(O),(k=performance.now())-R>16&&console.log("Violation: loop takes "+Math.round(100*(k-R))/100+" ms")}var C=2,U=3,F=window,D={pool:null,stage:null};F.debug_info=D},869:(t,n,e)=>{e.d(n,{T:()=>r,ZE:()=>i,yR:()=>o,A4:()=>a,t_:()=>s,T7:()=>u,KZ:()=>c,DV:()=>h,P4:()=>p,k8:()=>l,Gs:()=>f,Io:()=>d,NH:()=>y,t4:()=>v,bm:()=>_,$7:()=>m,d9:()=>w,S:()=>g});var r=0,i=1,o=2,a=3,s=4,u=5,c=0,h=1,p=1,l=1,f=14,d=0,y=0,v=100,_=500,m=700;function w(t){return Object.assign({},t)}var g={render_layer:m,collide_group:r,collide_mask:c}},533:(t,n,e)=>{e.d(n,{f:()=>p,U:()=>l});var r,i=e(566),o=e(68),a=e(349),s=e(869),u=e(822),c=e(86),h=(r=function(t,n){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(t,n)},function(t,n){function e(){this.constructor=t}r(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}),p=function(){function t(t,n,e){this.shoot=t,this.bomb=n,this.ability=e}return t.prototype.updateShoot=function(t,n){var e;null===(e=this.shoot)||void 0===e||e.updateEnable(t,n)},t.prototype.updateBomb=function(t,n){var e;return null===(e=this.bomb)||void 0===e?void 0:e.updateEnable(t,n)},t.prototype.updateAbility=function(t,n){var e;return null===(e=this.ability)||void 0===e?void 0:e.updateEnable(t,n)},t.prototype.render=function(t,n){var e,r,i;null===(e=this.shoot)||void 0===e||e.render(t,n),null===(r=this.bomb)||void 0===r||r.render(t,n),null===(i=this.ability)||void 0===i||i.render(t,n)},t.prototype.layers=function(){var t=[];return this.shoot&&(t=t.concat(this.shoot.layers())),this.bomb&&(t=t.concat(this.bomb.layers())),this.ability&&(t=t.concat(this.ability.layers())),t},t}(),l=function(t){function n(e,r,i,o,a){var u=t.call(this,2,null)||this;return u.config=s.S,u.state=1,u.time=0,u.missed=!1,u.bombed=0,u.grazed=!1,u.post_grazed=!1,u.pre_miss=0,u.miss_time=0,u.invince_time=0,u.px=0,u.py=0,u.dir=0,u.prex=0,u.prey=0,u.graze_total=0,u.graze_current=0,u.magn=1,u.collideCheck=function(t){for(var n=Math.sqrt(Math.pow(u.px-u.prex,2)+Math.pow(u.py-u.prey,2)),e=Math.max(1,Math.ceil(n/2)),r=1/0,i=0;i<e;i++){var o=u.px+(u.prex-u.px)*i/e,a=u.py+(u.prey-u.py)*i/e;r=Math.min(r,t.distanceTo(o,a))}var s=u.sprite.shape.radius*u.ability.radius*u.magn;return r-s<u.ability.graze_radius&&(u.grazed=!0),r<s},n.INSTANCE=u,u.proto=r,u.ability=i,u.sprite=e,u.px=o,u.py=a,u.dir=0,u.bomb_count=i.init_bomb,u.life_count=i.init_life,u.ability_count=i.init_ability,u.renderType=2,u}return h(n,t),n.updateState=function(t){n.action=t},n.prototype.update=function(t){if(n.action){this.prex=this.px,this.prey=this.py;var e=u.n.INSTANCE.special_effects.time_rate;this.time+=e,this.px+=n.action.pos_x,this.py+=n.action.pos_y,this.px<-a.SH&&(this.px=-a.SH),this.px>a.SH&&(this.px=a.SH),this.py<-a.ZP&&(this.py=-a.ZP),this.py>a.ZP&&(this.py=a.ZP),this.dir=this.time*this.sprite.sprite.omega,this.proto.updateShoot(this,n.action.key_z),this.bombed=this.proto.updateBomb(this,n.action.key_x),this.bombed||(this.bombed=this.proto.updateAbility(this,n.action.key_c))}},n.prototype.postUpdate=function(t){this.post_grazed=this.grazed,this.grazed&&(this.graze_current<this.ability.max_graze&&(this.graze_current+=u.n.INSTANCE.special_effects.time_rate),this.graze_total++,this.graze_current>=this.ability.max_graze&&this.ability_count<this.ability.max_ability&&(this.ability_count++,this.graze_current=0),this.grazed=!1),this.miss_time>0&&this.miss_time--,this.pre_miss>0&&(this.pre_miss--,0==this.pre_miss&&(console.log("missed"),this.miss_time=this.ability.miss_time)),this.missed&&(this.missed=!1,this.pre_miss=this.ability.pre_miss),this.bombed&&(this.miss_time=this.bombed,this.bombed=0,this.pre_miss>0&&(console.log("bomb after miss"),this.pre_miss=0)),this.miss_time>0||this.pre_miss>0?(this.state=2,this.invince_time++,Math.floor(this.invince_time/6)%2==0?this.shaped_sprite=null:this.shaped_sprite=this.sprite):(this.state=1,this.invince_time=0,this.shaped_sprite=this.sprite)},n.prototype.attack=function(t,n){},n.prototype.damaged=function(t,n){return 0==this.pre_miss&&0==this.miss_time&&(this.missed=!0),n.damaged(n,this)},n.prototype.layers=function(){return function(){for(var t=0,n=0,e=arguments.length;n<e;n++)t+=arguments[n].length;var r=Array(t),i=0;for(n=0;n<e;n++)for(var o=arguments[n],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}(this.proto.layers(),[s.$7])},n.prototype.render=function(t){var n,e=[],r=0,i=null;this.proto.render(t,this),t==s.$7&&(null===(n=this.shaped_sprite)||void 0===n?void 0:n.sprite)&&(function(t,n,a,s,u){e.push(t),e.push(n),e.push(a+Math.PI/2),e.push(u.w/2),e.push(u.h/2);var c=u.sprite;e.push(c.tx/c.sprite.w),e.push(c.ty/c.sprite.h),e.push(c.tw/c.sprite.w),e.push(c.th/c.sprite.h),e.push(1),r++,i=o.Z.get(c.sprite.path).img}(this.px,this.py,this.dir,0,this.shaped_sprite),c.setMode(0),c.drawRects(new Float32Array(e),r,i))},n.INSTANCE=null,n.action=null,n}(i.hE)},822:(t,n,e)=>{e.d(n,{n:()=>s});var r=e(869),i=e(566),o=e(68),a=function(){function t(){this.time_rate=1,this.list=[]}return t.prototype.process=function(){this.time_rate=this.list.reduce((function(t,n){return t*n.rate}),1),this.list=this.list.filter((function(t){return--t.duration>0}))},t.prototype.time_slowdown=function(t,n){this.list.push({rate:t,duration:n})},t}(),s=function(){function t(){this.groups=[],this.pending=[],this.update_stage=0,this.time=0,this.special_effects=new a,t.INSTANCE=this,this.groups.push({id:r.T,mask:r.KZ,list:[]}),this.groups.push({id:r.ZE,mask:r.DV,list:[]}),this.groups.push({id:r.yR,mask:r.P4,list:[]}),this.groups.push({id:r.A4,mask:r.k8,list:[]}),this.groups.push({id:r.t_,mask:r.Gs,list:[]}),this.groups.push({id:r.T7,mask:r.Io,list:[]})}return t.prototype.registerGroup=function(t){var n=this.groups.length;return this.groups.push({id:n,mask:t,list:[]}),n},t.prototype.add=function(t){3!=this.update_stage&&0!=this.update_stage?this.pending.push(t):this.groups[t.config.collide_group].list.push(t)},t.prototype.update=function(){var t=this;this.update_stage=1,this.groups.forEach((function(t){return t.list.forEach((function(t){return t.update(t)}))}));for(var n=0;n<this.groups.length;n++)for(var e=0;e<this.groups.length;e++)if(this.groups[n].mask&1<<e)for(var r=0,o=this.groups[n].list;r<o.length;r++){var a=o[r];if(1==a.state&&a.shaped_sprite&&a.shaped_sprite.shape)for(var s=0,u=this.groups[e].list;s<u.length;s++){var c=u[s];1==c.state&&c.shaped_sprite&&c.shaped_sprite.shape&&(0,i._R)(a,c)&&a.attack(a,c)}}this.update_stage=2,this.groups.forEach((function(t){return t.list.forEach((function(t){return t.postUpdate(t)}))})),this.groups.forEach((function(t){return t.list=t.list.filter((function(t){return 3!=t.state}))})),this.update_stage=3,this.special_effects.process(),this.pending.forEach((function(n){return t.add(n)})),this.pending=[],this.time++},t.prototype.render=function(){var t,n,e,r,i,a,s,u;return i=this,a=void 0,u=function(){var i,a,s,u,c,h,p,l,f,d,y,v;return function(t,n){var e,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;a;)try{if(e=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=n.call(t,a)}catch(t){o=[6,t],r=0}finally{e=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(_){for(i=new Map,a=[],s=0,u=this.groups;s<u.length;s++)for(c=u[s],h=0,p=c.list;h<p.length;h++)2!=(l=p[h]).renderType?l.config.render_layer&&(null===(t=l.shaped_sprite)||void 0===t?void 0:t.sprite)&&(i.has(l.config.render_layer)||i.set(l.config.render_layer,new Map),d=i.get(l.config.render_layer),y=null===(r=null===(e=null===(n=l.shaped_sprite)||void 0===n?void 0:n.sprite)||void 0===e?void 0:e.sprite)||void 0===r?void 0:r.path,d.has(y)||d.set(y,[]),d.get(y).push(l)):(f=l,a.push(f),f.layers().forEach((function(t){return i.set(t,new Map)})));return v=[],i.forEach((function(t,n){return v.push({rl:n,v:t})})),v.sort((function(t,n){return t.rl-n.rl})),v.forEach((function(t){a.forEach((function(n){return n.render(t.rl)})),t.v.forEach((function(t,n){return o.Z.get(n).draw(t)}))})),[2]}))},new((s=void 0)||(s=Promise))((function(t,n){function e(t){try{o(u.next(t))}catch(t){n(t)}}function r(t){try{o(u.throw(t))}catch(t){n(t)}}function o(n){var i;n.done?t(n.value):(i=n.value,i instanceof s?i:new s((function(t){t(i)}))).then(e,r)}o((u=u.apply(i,a||[])).next())}))},t}()},745:(t,n,e)=>{e.d(n,{S:()=>Ft,A:()=>Ut});var r={};e.r(r),e.d(r,{ability_invinc:()=>q,ability_slow:()=>B,ability_small:()=>X,ability_stop:()=>H});var i={};e.r(i),e.d(i,{stage_000:()=>lt,stage_001:()=>ft,stage_002:()=>dt,stage_003:()=>mt,stage_004:()=>wt,stage_005:()=>gt,stage_006:()=>xt,test_000:()=>bt,test_001:()=>Mt,test_002:()=>Nt});var o,a,s=e(533),u=e(822),c=e(566),h=(o=function(t,n){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(t,n)},function(t,n){function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}),p=function(t){function n(n){var e=t.call(this)||this;return e.func=n,e}return h(n,t),n.prototype.distanceTo=function(t,n,e){return Math.min(this.func(t,n,e),t.shaped_sprite.base.shape.rawDistanceTo(t.px,t.py,1,n,e),t.shaped_sprite.end.shape.rawDistanceTo(t.px+t.len*Math.cos(t.dir),t.py+t.len*Math.sin(t.dir),1,n,e))},n.line_circle=function(t,n,e){var r=t.px+t.shaped_sprite.hitbox_width*Math.cos(t.dir),i=t.py+t.shaped_sprite.hitbox_width*Math.sin(t.dir),o=t.px+(t.len-t.shaped_sprite.hitbox_width)*Math.cos(t.dir),a=t.py+(t.len-t.shaped_sprite.hitbox_width)*Math.sin(t.dir),s=Math.sqrt(Math.pow(r-o,2)+Math.pow(i-a,2)),u=Math.abs((o-r)*(i-e)-(r-n)*(a-i)),c=Math.sqrt(Math.pow(r-n,2)+Math.pow(i-e,2)),h=Math.sqrt(Math.pow(o-n,2)+Math.pow(a-e,2));return Math.pow(Math.max(c,h),2)>Math.pow(Math.min(c,h),2)+Math.pow(s,2)?Math.min(c,h)-t.shaped_sprite.hitbox_width*t.w:Math.min(u/s,c,h)-t.shaped_sprite.hitbox_width*t.w},n.double_arc=function(t,n,e){var r=n-t.px,i=e-t.py,o=r*Math.cos(-t.dir)-i*Math.sin(-t.dir),a=r*Math.sin(-t.dir)+i*Math.cos(-t.dir);return c.HC.orthDis(o-t.len/2,a,t.len/2,t.w*t.shaped_sprite.hitbox_width)},n.half_arc=function(t,n,e){var r=n-t.px,i=e-t.py,o=r*Math.cos(-t.dir)-i*Math.sin(-t.dir),a=r*Math.sin(-t.dir)+i*Math.cos(-t.dir);return o<0?Math.sqrt(Math.pow(o,2)+Math.pow(a,2)):c.HC.orthDis(o,a,t.len,t.w*t.shaped_sprite.hitbox_width)},n}(c.bn),l=(a=c.Yw,h((function(){return null!==a&&a.apply(this,arguments)||this}),a),function(t){function n(n,e,r){var i=t.call(this,n)||this;return i.state=0,i.rstate=0,i.time=0,i.custom_fields={},i.config=e,i.motion=r,i}return h(n,t),n.prototype.init=function(t,n,e,r){return this.len=r,this.dir=e,this.px=t,this.py=n,this.checkState(),this},n.prototype.checkState=function(){var t,n,e,r,i,o,a,s,u,c,h=this;0==this.state&&(this.state=2,null===(n=null===(t=this.config.listener)||void 0===t?void 0:t.onInit)||void 0===n||n.forEach((function(t){return t(h)})));var p=this.config.warning_time,l=this.config.open_time+p,f=this.config.alive_time+l,d=this.config.close_time+f;0==this.rstate&&this.time>=p&&(this.rstate=1,null===(r=null===(e=this.config.listener)||void 0===e?void 0:e.onStateChange)||void 0===r||r.forEach((function(t){return t(h)}))),1==this.rstate&&(this.w=Math.min(1,(this.time-p)/(l-p)),this.time>=l&&(this.rstate=2,this.state=1,this.w=1,null===(o=null===(i=this.config.listener)||void 0===i?void 0:i.onStateChange)||void 0===o||o.forEach((function(t){return t(h)})))),2==this.rstate&&this.time>=f&&(this.rstate=3,this.state=2,null===(s=null===(a=this.config.listener)||void 0===a?void 0:a.onStateChange)||void 0===s||s.forEach((function(t){return t(h)}))),3==this.rstate&&(this.w=Math.max(0,1-(this.time-f)/(d-f)),this.time>=d&&(this.state=3,null===(c=null===(u=this.config.listener)||void 0===u?void 0:u.onDestroy)||void 0===c||c.forEach((function(t){return t(h)}))))},n.prototype.update=function(t){var n,e,r,i,o,a,s=this;0==this.state&&(this.state=2,null===(e=null===(n=this.config.listener)||void 0===n?void 0:n.onInit)||void 0===e||e.forEach((function(t){return t(s)})));var c=u.n.INSTANCE.special_effects.time_rate;this.time+=c,this.checkState(),null===(i=null===(r=this.config.listener)||void 0===r?void 0:r.onUpdate)||void 0===i||i.forEach((function(t){return t(s,c)})),this.motion(this,c),null===(a=null===(o=this.config.listener)||void 0===o?void 0:o.onPostMotion)||void 0===a||a.forEach((function(t){return t(s,c)}))},n.prototype.postUpdate=function(t){var n,e,r=this;null===(e=null===(n=this.config.listener)||void 0===n?void 0:n.onPostUpdate)||void 0===e||e.forEach((function(t){return t(r)}))},n.prototype.attack=function(t,n){var e,r,i=this;null===(r=null===(e=this.config.listener)||void 0===e?void 0:e.onAttack)||void 0===r||r.forEach((function(t){return t(i,n)})),n.damaged(n,this)},n.prototype.damaged=function(t,n){var e,r,i=this;return null===(r=null===(e=this.config.listener)||void 0===e?void 0:e.onContact)||void 0===r||r.forEach((function(t){return t(i,n)})),!1},n}(function(t){function n(n){var e=t.call(this,0,n)||this;return e.w=0,e}return h(n,t),n.prototype.rectCount=function(){return 3},n.prototype.render=function(t,n){var e=this.shaped_sprite.l_ratio*this.len/2;t[10*n+0]=this.px+e*Math.cos(this.dir),t[10*n+1]=this.py+e*Math.sin(this.dir),t[10*n+2]=this.dir+Math.PI/2,t[10*n+3]=Math.max(1,this.shaped_sprite.sprite_width*this.w),t[10*n+4]=e;var r=this.shaped_sprite.sprite;t[10*n+5]=r.tx/r.sprite.w,t[10*n+6]=r.ty/r.sprite.h,t[10*n+7]=r.tw/r.sprite.w,t[10*n+8]=r.th/r.sprite.h,t[10*n+9]=1,n++;var i=this.shaped_sprite.base;t[10*n+0]=this.px,t[10*n+1]=this.py,t[10*n+2]=this.dir+Math.PI/2,t[10*n+3]=i.w/2,t[10*n+4]=i.h/2,r=i.sprite,t[10*n+5]=r.tx/r.sprite.w,t[10*n+6]=r.ty/r.sprite.h,t[10*n+7]=r.tw/r.sprite.w,t[10*n+8]=r.th/r.sprite.h,t[10*n+9]=1,n++,i=this.shaped_sprite.end,t[10*n+0]=this.px+this.len*Math.cos(this.dir),t[10*n+1]=this.py+this.len*Math.sin(this.dir),t[10*n+2]=this.dir+Math.PI/2,t[10*n+3]=i.w/2,t[10*n+4]=i.h/2,r=i.sprite,t[10*n+5]=r.tx/r.sprite.w,t[10*n+6]=r.ty/r.sprite.h,t[10*n+7]=r.tw/r.sprite.w,t[10*n+8]=r.th/r.sprite.h,t[10*n+9]=1},n}(c.hE))),f=[0,0,1,1,0,0,0,0,0,1,1,1,1,0,0],d=[1,1,1,0,0,0,1,0],y=2*Math.PI/600,v={path:"assets/bullet_000.png",w:516,h:772};function _(t){return t.tx+=.5,t.ty+=.5,t.tw-=1,t.th-=1,t}function m(t,n,e){return _({sprite:v,tx:t<12?1+16*n:t<14?1+n%8*8:t<15?1:258+16*n,ty:t<12?1+16*t:t<14?(t<13?193:241)+8*(n>>3):n<15?515+16*n:449,tw:t<12?16:t<14?8:t<15?256:16,th:t<12?16:t<14?8:16,mode:e,category:1,type:t,color:n,omega:f[t]*y})}function w(t,n,e){return _({sprite:v,tx:(t<7?1:258)+32*n,ty:0==t?209:t<7?226+32*t:257,tw:32,th:32,mode:e,category:2,type:t,color:n,omega:d[t]*y})}function g(t,n,e){return _({sprite:v,tx:(0==t?1:258)+64*n,ty:0==t?449:290,tw:64,th:64,mode:e,category:3,type:t,color:n,omega:y})}var x=_({sprite:v,tx:258,ty:17,tw:64,th:64,mode:0,category:0,type:0,color:0,omega:y}),b=(_({sprite:v,tx:322,ty:17,tw:64,th:64,mode:0,category:0,type:1,color:0,omega:y}),_({sprite:v,tx:386,ty:81,tw:128,th:128,mode:0,category:0,type:2,color:0,omega:y})),M=[[Math.sqrt(27),0],[2.4,2.4,4,4,2.4,2.4,2.4,2.8,2.4,2.4,4,2.4,2.4,2.4,2.4,2.4],[6,7,8.5,7,6,7,0,10],[14,14]],A=.75;function E(t){return Math.sqrt(Math.pow(t,2)+Math.pow(3,2))-3}function I(t,n){return n*=A,{sprite:t,shape:new c.D8(E(M[t.category][t.type])*n),w:t.tw*n,h:t.th*n,renderType:0}}function T(t,n,e,r,i,o,a){var s=m(t,n,r);return s.ty+=0==t?4:4==t||1==t?1:NaN,s.th-=0==t?8:4==t?2:1==t?1:NaN,{sprite:s,shape:new p(0==t?p.line_circle:1==t?p.half_arc:4==t?p.double_arc:null),renderType:0,sprite_width:s.tw*A/2*a,hitbox_width:E(2.4)*A*a,l_ratio:0==t||o>0?1:4==t?1.15:1==t?1.2:NaN,base:I(w(0,e,r),i*a),end:I(w(0,e,r),o*a)}}function P(t,n,e){var r=m(14,t,n),i=E(M[1][14])*A;return{sprite:r,shape:e,renderType:1,w:i,sp_w:r.th*A,radius:function(t,n,e){if(n<=2||e/(n-1)*16<.5||e/(n-1)*16>15.5)return-1/0;var r=((e+.5)/n-.5)*i*16,o=255*i/2;return(Math.sqrt(Math.pow(o+i,2)-Math.pow(r,2))-o)/i}}}var S=e(68),N=e(86),R=e(780),k=e(869),O=function(){for(var t=0,n=0,e=arguments.length;n<e;n++)t+=arguments[n].length;var r=Array(t),i=0;for(n=0;n<e;n++)for(var o=arguments[n],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r},C=I(b,1),U=function(){function t(t){this.special_duration=t,this.special_remain=0}return t.prototype.updateEnable=function(t,n){return this.special_remain>0&&(this.special_remain--,this.update(t)),this.special_remain>0?0:n&&t.ability_count>0&&this.onActivate(t)?(t.ability_count--,this.special_remain=this.special_duration,0):0},t.prototype.render=function(t,n){if(t==k.t4+50){var e=new R.l;N.setMode(0);var r=C.sprite,i=[(r.tx+r.tw/2)/r.sprite.w,(r.ty+r.th/2)/r.sprite.h,r.tw/2/r.sprite.w,r.th/2/r.sprite.h];if(e.bind(S.Z.get(r.sprite.path).img),0==this.special_remain){var o=2*Math.PI*n.ability_count/(n.ability.max_ability+1),a=2*Math.PI*(n.graze_current/n.ability.max_graze)/(n.ability.max_ability+1),s=n.post_grazed?.7:.5,u=n.graze_current==n.ability.max_graze?s:n.post_grazed?.7:.2;e.fan(O([o,Math.PI/2,n.px,n.py,C.w/2,Math.PI/6],i,[s]),32),e.fan(O([a,Math.PI/2+o,n.px,n.py,C.w/2,Math.PI/6+o],i,[u]),32)}else o=2*Math.PI*this.special_remain/this.special_duration,e.fan(O([o,-o+Math.PI/2,n.px,n.py,C.w/2,-o+Math.PI/6],i,[1]),32);e.flush()}},t.prototype.layers=function(){return[k.t4+50]},t}(),F=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),D=function(t){function n(){return t.call(this,240)||this}return F(n,t),n.prototype.update=function(){},n.prototype.onActivate=function(){return u.n.INSTANCE.special_effects.time_slowdown(.5,240),!0},n}(U),B={name:"slow",init:function(){return new D}},j=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),L=function(t){function n(){return t.call(this,120)||this}return j(n,t),n.prototype.update=function(){},n.prototype.onActivate=function(){return u.n.INSTANCE.special_effects.time_slowdown(0,120),!0},n}(U),H={name:"stop",init:function(){return new L}},z=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Z=function(t){function n(){return t.call(this,30)||this}return z(n,t),n.prototype.update=function(t){t.magn=this.special_remain>0?-1/0:1},n.prototype.onActivate=function(){return!0},n}(U),q={name:"invincibility",init:function(){return new Z}},Y=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),G=function(t){function n(){return t.call(this,300)||this}return Y(n,t),n.prototype.update=function(t){t.magn=this.special_remain>0?0:1},n.prototype.onActivate=function(){return!0},n}(U),X={name:"small hitbox",init:function(){return new G}},W=e(349),V=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),K={render_layer:k.bm,collide_group:k.A4,collide_mask:k.A4,init_stall:0,exit_margin:0,kill_on_exit:!0,kill_by:function(t){return t==k.t_||t==k.T},auto_direction:!0,life:0,listener:null},$=function(t,n){return!0},J=function(t){function n(n,e){var r=t.call(this,n)||this;return r.state=0,r.motion=$,r.custom_fields={},r.config=e,r.time=0,r}return V(n,t),n.prototype.setMotion=function(t){return this.motion=t,this.simpleInit(0,0,0,0)},n.prototype.simpleInit=function(t,n,e,r){return this.px=t,this.py=n,this.vx=e*Math.cos(r),this.vy=e*Math.sin(r),this.dir=r,this.motion(this,0)&&this.config.auto_direction&&(this.dir=Math.atan2(this.vy,this.vx)),this},n.prototype.init=function(t){return t(this),this},n.prototype.update=function(t){var n,e,r,i,o,a,s,c,h=this;0==this.state&&(this.state=1,null===(e=null===(n=this.config.listener)||void 0===n?void 0:n.onInit)||void 0===e||e.forEach((function(t){return t(h)})));var p=u.n.INSTANCE.special_effects.time_rate;this.time+=p,null===(i=null===(r=this.config.listener)||void 0===r?void 0:r.onUpdate)||void 0===i||i.forEach((function(t){return t(h,p)})),this.motion(this,p)&&(this.time>this.config.init_stall&&(this.px+=this.vx*p,this.py+=this.vy*p),this.config.auto_direction&&(this.dir=Math.atan2(this.vy,this.vx))),(null===(a=null===(o=this.shaped_sprite)||void 0===o?void 0:o.sprite)||void 0===a?void 0:a.omega)&&(this.dir=this.time*this.shaped_sprite.sprite.omega),null===(c=null===(s=this.config.listener)||void 0===s?void 0:s.onPostMotion)||void 0===c||c.forEach((function(t){return t(h,p)}))},n.prototype.postUpdate=function(t){var n,e,r,i,o,a,s,u,c=this,h=(null===(e=null===(n=this.shaped_sprite)||void 0===n?void 0:n.shape)||void 0===e?void 0:e.exitScreen(this))+this.config.exit_margin,p=this.px>W.SH+h,l=-this.px>W.SH+h,f=this.py>W.ZP+h,d=-this.py>W.ZP+h;this.motion||(p&&(p=this.vx>0),l&&(l=this.vx<0),f&&(f=this.vy>0),d&&(d=this.vy<0)),(p||l||f||d)&&this.config.kill_on_exit&&(this.state=2,null===(i=null===(r=this.config.listener)||void 0===r?void 0:r.onExitScreen)||void 0===i||i.forEach((function(t){return t(c)}))),this.config.life&&this.time>=this.config.life&&(this.state=2),null===(a=null===(o=this.config.listener)||void 0===o?void 0:o.onPostUpdate)||void 0===a||a.forEach((function(t){return t(c)})),2==this.state&&(null===(u=null===(s=this.config.listener)||void 0===s?void 0:s.onDestroy)||void 0===u||u.forEach((function(t){return t(c)})),this.state=3)},n.prototype.attack=function(t,n){var e,r,i=this;null===(r=null===(e=this.config.listener)||void 0===e?void 0:e.onAttack)||void 0===r||r.forEach((function(t){return t(i,n)})),n.damaged(n,this)},n.prototype.damaged=function(t,n){var e,r,i=this;return!!this.config.kill_by(n.config.collide_group)&&(this.state=2,null===(r=null===(e=this.config.listener)||void 0===e?void 0:e.onKill)||void 0===r||r.forEach((function(t){return t(i,n)})),!0)},n}(c.eY),Q=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),tt=function(){for(var t=0,n=0,e=arguments.length;n<e;n++)t+=arguments[n].length;var r=Array(t),i=0;for(n=0;n<e;n++)for(var o=arguments[n],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r},nt=function(){},et=function(t){function n(n){var e=t.call(this)||this;return e.remain=n,e}return Q(n,t),n.prototype.update=function(t){return this.remain-=t,this.remain<0?-this.remain:0},n}(nt),rt=function(t){function n(n){var e=t.call(this)||this;return e.time=0,e.init=n,e}return Q(n,t),n.random=function(t,e){return function(){return new n((function(n){var r=Math.max(e.px0-t.px,-e.dx1),i=Math.min(e.px1-t.px,e.dx1),o=Math.max(e.py0-t.py,-e.dy1),a=Math.min(e.py1-t.py,e.dy1),s=r+Math.random()*(i-r),u=o+Math.random()*(a-o);n.target=t,n.duration=e.duration,n.dx=s,n.dy=u,n.x0=t.px,n.y0=t.py,n.ease=e.ease}))}},n.prototype.update=function(t){0==this.time&&this.init(this),this.time+=t;var n=Math.min(1,this.time/this.duration),e=this.ease(n);return this.target.px=this.x0+this.dx*e,this.target.py=this.y0+this.dy*e,this.time>this.duration?this.time-this.duration:0},n}(nt),it=function(t){function n(n){var e=t.call(this)||this;return e.todo=n,e}return Q(n,t),n.prototype.update=function(t,n){var e=this.todo();return void 0===e?t:"number"==typeof e?(n.list[0]=new et(e),n.list[0].update(t,n)):(n.list.unshift(n.list[0]),n.list[1]=e,t)},n}(nt),ot=function(){};function at(t){return t.map((function(t){return"number"==typeof t?new et(t):"function"==typeof t?new it(t):t}))}var st=function(t){function n(n,e){var r=t.call(this)||this;return r.index=0,r.todo=n,r.total=e,r}return Q(n,t),n.prototype.supply=function(){return this.index>=this.total?null:(t="function"==typeof this.todo?this.todo(this.index):this.todo,this.index++,at(t));var t},n}(ot),ut={render_layer:k.NH,collide_group:k.T7,collide_mask:k.Io},ct=function(t){function n(n){var e=t.call(this)||this;return e.custom_fields={},e.config=ut,e.state=0,e.time=0,e.list=at("object"==typeof n?n:n(e)),e}return Q(n,t),n.prototype.init=function(t){return t(this),this},n.prototype.update=function(t){0==this.state&&(this.state=1);var n=u.n.INSTANCE.special_effects.time_rate;for(this.time+=n;this.list.length>0&&n;){var e=this.list[0];if(e instanceof ot){var r=e.supply();r&&r.length?this.list=tt(r,this.list):this.list.shift()}else(n=e.update(n,this))>0&&this.list.shift()}0==this.list.length&&(this.state=2)},n.prototype.postUpdate=function(t){2==this.state&&(this.state=3)},n.prototype.attack=function(t){},n.prototype.damaged=function(t,n){return!1},n}(c.u5),ht=function(t,n){return void 0===n&&(n=1/0),function(){return new st(t,n)}},pt=function(t){return function(){return u.n.INSTANCE.add(new ct(t))}},lt={name:"波与粒的境界",default_scale:3,init:function(t){var n=I(w(5,1,0),1);return[new ct([30*t,ht((function(e){return[ht((function(r){return[function(){return u.n.INSTANCE.add(new J(n,K).simpleInit(0,0,8/t,.003/t*e*e+2*Math.PI/5*r))}]}),5),1*t]}),1/0)])]}},ft={name:"龙纹弹",default_scale:3,init:function(t){var n=function(t){return I(m(1,t,0),1)},e=(0,k.d9)(K);e.life=180*t,e.kill_on_exit=!1;var r={duration:100*t,px0:-96,px1:96,py0:32,py1:112,dx1:64,dy1:64,ease:function(t){return(1-Math.cos(Math.PI*t))/2}},i=1*t,o=3/t,a=-o/70,s=.06/t,c=new J(I(b,2),K).setMotion((function(t){return t.dir=t.time*Math.PI*2/600,!1})).simpleInit(0,64,0,0),h=null,p=function(t,n,r,p){return u.n.INSTANCE.add(new ct([ht((function(l){return[function(){return u.n.INSTANCE.add(h=new J(null,e).simpleInit(c.px,c.py,o,2*Math.PI/47*l*n*t))},ht((function(n){return[function(){return u.n.INSTANCE.add(new J(l%2==0?r:p,K).setMotion((e=h,i=2*Math.PI/30*n,o=s*t,70,c=a,function(t,n){var r=i+o*t.time,a=70*Math.sin(c*t.time);return t.px=e.px+a*Math.cos(r),t.py=e.py+a*Math.sin(r),t.dir=Math.atan2(a*o,70*c*Math.cos(c*t.time))+r,!1})));var e,i,o,c}]}),30),i]}),47)]))};return[new ct([function(){return u.n.INSTANCE.add(c)},30*t,ht((function(e){return[function(){return p(e%2*2-1,7,n(2),n(10))},50*t,function(){return p(e%2*2-1,5,n(13),n(6))},50*t,function(){return p(e%2*2-1,1,n(8),n(4))},rt.random(c,r)]}))])]}},dt={name:"rotating long bullet",default_scale:3,init:function(t){var n,e=(64,{sprite:n=m(4,2,0),shape:new c.HC(64,E(M[1][4])*A),renderType:0,w:n.tw*A,h:80}),r=(0,k.d9)(K);r.auto_direction=!1;var i={duration:50*t,px0:-96,px1:96,py0:32,py1:112,dx1:64,dy1:64,ease:function(t){return(1-Math.cos(Math.PI*t))/2}},o=new J(I(b,2),K).setMotion((function(t){return t.dir=t.time*Math.PI*2/600,!1})).simpleInit(0,64,0,0),a=function(t){return ht((function(n){return[function(){return u.n.INSTANCE.add(new J(e,r).setMotion((function(n,e){return n.dir+=e*t,!0})).simpleInit(o.px,o.py,l,f+2*Math.PI/s*n).init((function(t){return t.dir+=2*Math.PI*h/s*n})))}]}),s)},s=50,h=2.5,p=2*Math.PI/60/t,l=6/t,f=0;return[o,new ct([30*t,ht((function(n){return[function(){return f=Math.random()*Math.PI*2},a(p),20*t,a(-p),rt.random(o,i)]}))])]}},yt={w0:-W.SH,w1:W.SH,h0:-W.ZP,h1:W.ZP,max:1/0,inner_bound:!0,outer_bound:!1},vt=function(t){return function(n){n.onInit.push((function(n){var e=n.custom_fields;e.in_screen=n.px>t.w0&&n.px<t.w1&&n.py>t.h0&&n.py<t.h1,e.ref_count=0})),n.onPostMotion.push((function(n,e){var r=n.custom_fields,i=r.in_screen;r.in_screen=n.px>t.w0&&n.px<t.w1&&n.py>t.h0&&n.py<t.h1,i&&!r.in_screen&&t.inner_bound&&(r.ref_count<t.max&&n.px<=t.w0&&(r.ref_count++,n.vx=-n.vx,n.px=2*t.w0-n.px),r.ref_count<t.max&&n.px>=t.w1&&(r.ref_count++,n.vx=-n.vx,n.px=2*t.w1-n.px),r.ref_count<t.max&&n.py<=t.h0&&(r.ref_count++,n.vy=-n.vy,n.py=2*t.h0-n.py),r.ref_count<t.max&&n.py>=t.h1&&(r.ref_count++,n.vy=-n.vy,n.py=2*t.h1-n.py),n.dir=Math.atan2(n.vy,n.vx),r.in_screen=!0),!i&&r.in_screen&&t.outer_bound&&(r.ref_count<t.max&&n.px>=t.w0&&(r.ref_count++,n.vx=-n.vx,n.px=2*t.w0-n.px),r.ref_count<t.max&&n.px<=t.w1&&(r.ref_count++,n.vx=-n.vx,n.px=2*t.w1-n.px),r.ref_count<t.max&&n.py>=t.h0&&(r.ref_count++,n.vy=-n.vy,n.py=2*t.h0-n.py),r.ref_count<t.max&&n.py<=t.h1&&(r.ref_count++,n.vy=-n.vy,n.py=2*t.h1-n.py),n.dir=Math.atan2(n.vy,n.vx),r.in_screen=!1)}))}},_t={name:"",w0:-W.SH,w1:W.SH,h0:-W.ZP,h1:W.ZP,max:1/0,maxlen:NaN,v:NaN,body:null,cf:null},mt={name:"reflect and delayed altering",default_scale:3,init:function(t){var n=I(m(4,2,0),1),e=(0,k.d9)(K);e.listener={onInit:[],onUpdate:[],onPostMotion:[],onPostUpdate:[],onAttack:[],onDestroy:[],onExitScreen:[],onKill:[]};var r=(0,k.d9)(yt);r.max=100,vt(r)(e.listener);var i=Math.PI/24,o=6/t,a=100*t,s=1*t,c=1*t,h={duration:a-40*c-20*s,px0:-96,px1:96,py0:32,py1:112,dx1:64,dy1:64,ease:function(t){return(1-Math.cos(Math.PI*t))/2}},p=new J(I(b,2),K).setMotion((function(t){return t.dir=t.time*Math.PI*2/600,!1})).simpleInit(0,64,0,0),l=0;return[p,new ct([30*t,ht((function(t){return[function(){return l=Math.random()*Math.PI*2},ht((function(t){return[pt([ht((function(){return[function(){return u.n.INSTANCE.add(new J(n,e).setMotion((function(n,e){var s,u=a-t*c;return n.time-e<u&&n.time>=u&&((s=r,function(t){return t.custom_fields.ref_count=s.max})(n),n.simpleInit(n.px,n.py,o,n.dir+(2*Math.random()-1)*i)),!0})).simpleInit(p.px,p.py,o,l+2*Math.PI/40*t))},s]}),20)]),c]}),40),20*s,rt.random(p,h)]}))])]}},wt={name:"finite reflect",default_scale:3,init:function(t){var n=[I(m(4,2,0),1),I(m(4,6,0),1)],e=(0,k.d9)(K),r=(0,k.d9)(K);e.listener={onInit:[],onUpdate:[],onPostMotion:[],onPostUpdate:[],onAttack:[],onDestroy:[],onExitScreen:[],onKill:[]},r.listener={onInit:[],onUpdate:[],onPostMotion:[],onPostUpdate:[],onAttack:[],onDestroy:[],onExitScreen:[],onKill:[]};var i=(0,k.d9)(yt),o=(0,k.d9)(yt);i.max=2,i.h0=-1/0,o.max=1,o.h0=-1/0,vt(i)(e.listener),vt(o)(r.listener);var a=6/t,s=1*t,c=3*t,h={duration:40*t,px0:-96,px1:96,py0:32,py1:112,dx1:64,dy1:64,ease:function(t){return(1-Math.cos(Math.PI*t))/2}},p=new J(I(b,2),K).setMotion((function(t){return t.dir=t.time*Math.PI*2/600,!1})).simpleInit(0,64,0,0),l=0,f=function(t,n,e,r){return ht((function(i){return[pt([ht((function(o){return[ht((function(s){return[function(){return u.n.INSTANCE.add(new J(t,r).simpleInit(p.px,p.py,a,l+e*Math.PI*2*(i/8/4+s/4+o/4/8/n*.5)))}]}),8),s]}),n)]),c]}),8)};return[p,new ct([30*t,ht((function(t){return[function(){return l=Math.random()*Math.PI*2},f(n[0],10,1,e),10*s,rt.random(p,h),f(n[1],15,-1,r),20*s,rt.random(p,h)]}))])]}},gt={name:"reflect laser",default_scale:3,init:function(t){var n=function(n,e){var r=T(4,n,e,1,1,1,.75),i={render_layer:K.render_layer,collide_group:K.collide_group,collide_mask:K.collide_mask,warning_time:0,open_time:0,alive_time:1/0,close_time:0,listener:null},o=(0,k.d9)(i);i.listener={onInit:[],onUpdate:[],onPostMotion:[],onStateChange:[],onPostUpdate:[],onAttack:[],onContact:[],onDestroy:[]};var a,s=(0,k.d9)(_t);return s.max=2,s.v=8/t,s.maxlen=128,s.body=r,s.cf=o,s.name=n+"-"+e,(a=s,function(t){var n=function(t,n){var e=t.custom_fields;if(e.togrow>0){var r=Math.min(e.togrow,a.v*n);n-=r/a.v,t.len+=r,e.togrow-=r}n>0&&(t.px+=n*e.vx,t.py+=n*e.vy),t.shaped_sprite.end.shape.rawExitScreen(t.px+t.len*Math.cos(t.dir),t.py+t.len*Math.sin(t.dir),t.shaped_sprite.base,W.SH,W.ZP)&&t.shaped_sprite.base.shape.rawExitScreen(t.px,t.py,t.shaped_sprite.base,W.SH,W.ZP)&&(t.state=3)},e=function(t,n){return t>a.w0&&t<a.w1&&n>a.h0&&n<a.h1},r=function(t,n){var e=t.custom_fields;if(e.toshrink>0){var r=Math.min(e.toshrink,a.v*n);t.len-=r,e.toshrink-=r,e.toshrink<=0&&(t.state=3)}e.togrow>0&&(n-=(r=Math.min(e.togrow,a.v*n))/a.v,t.len+=r,e.togrow-=r),n>0&&(t.px+=n*e.vx,t.py+=n*e.vy),t.shaped_sprite.base.shape.rawExitScreen(t.px,t.py,t.shaped_sprite.base,W.SH,W.ZP)&&(t.state=3)};t.onInit.push((function(t){var e=t.custom_fields;e.ref_count=0,e.vx=a.v*Math.cos(t.dir),e.vy=a.v*Math.sin(t.dir),e.togrow=a.maxlen,e.toshrink=0,t.motion=n})),t.onPostMotion.push((function(t,n){var i=t.custom_fields,o=(e(t.px,t.py),t.px+t.len*Math.cos(t.dir)),s=t.py+t.len*Math.sin(t.dir);if(!e(o,s)&&i.ref_count<a.max){var c=new l(a.body,a.cf,r);c.init(t.px,t.py,t.dir,t.len);var h=c.custom_fields;h.vx=i.vx,h.vy=i.vy,h.togrow=i.togrow,u.n.INSTANCE.add(c);var p=0,f=0;i.ref_count<a.max&&o<=a.w0&&(p=a.w0,f=t.py+(a.w0-t.px)*i.vy/i.vx,i.ref_count++,i.vx=-i.vx,t.px=2*a.w0-t.px),i.ref_count<a.max&&o>=a.w1&&(p=a.w1,f=t.py+(a.w1-t.px)*i.vy/i.vx,i.ref_count++,i.vx=-i.vx,t.px=2*a.w1-t.px),i.ref_count<a.max&&s<=a.h0&&(f=a.h0,p=t.px+(a.h0-t.py)*i.vx/i.vy,i.ref_count++,i.vy=-i.vy,t.py=2*a.h0-t.py),i.ref_count<a.max&&s>=a.h1&&(f=a.h1,p=t.px+(a.h1-t.py)*i.vx/i.vy,i.ref_count++,i.vy=-i.vy,t.py=2*a.h1-t.py);var d=Math.sqrt(Math.pow(t.px-p,2)+Math.pow(t.py-f,2));t.len-=d,t.px=p,t.py=f,i.togrow+=d,c.len=d,h.toshrink=d+h.togrow,t.dir=Math.atan2(i.vy,i.vx)}}))})(i.listener),[r,i,s]},e=[n(6,3),n(2,1)],r=2*Math.PI/t,i=t,o=function(t,n,r,i,o,a){return ht((function(t){return[ht((function(o){return[function(){return u.n.INSTANCE.add(new l(e[n][0],e[n][1],null).init(0,0,a+2*Math.PI/r*o+i*t,0))}]}),r),o]}),t)};return[new ct([30*t,ht((function(n){return[o(20,0,3,(n%2*2-1)*r*.0678,6*i,2*Math.random()*Math.PI),100*t,o(120,1,1,(n%2*2-1)*r*.0234,i,2*Math.random()*Math.PI),100*t]}))])]}},xt={name:"Test Special Effect",default_scale:1,init:function(t){var n=I(m(1,2,0),1),e=I(m(1,1,0),1),r=I(g(0,0,1),1),i=K,o=(0,k.d9)(K);o.life=160*t,o.kill_on_exit=!1,o.kill_by=function(){return!1};var a=6/t,c=.4*a,h=2*t,p=6*t,l=Math.PI/3;return[new ct([30*t,ht((function(f){return[function(){return u.n.INSTANCE.special_effects.time_slowdown(1/4,4*(8*p+160/a))},(d=f%2*2-1,y=l,void 0===v&&(v=Math.PI/2),ht((function(t){return[pt((function(p,l){return void 0===l&&(l=p.custom_fields),[function(){l.a1=v+2*Math.PI*t/8*d;var n=l.a1+Math.PI/2*d;u.n.INSTANCE.add(l.host=new J(r,o).simpleInit(160*Math.cos(l.a1)-240*Math.cos(n),160*Math.sin(l.a1)-240*Math.sin(n),a,n))},pt([ht((function(){return[ht((function(t){return[ht((function(n){return[function(){return u.n.INSTANCE.add(new J(e,i).simpleInit(l.host.px,l.host.py,c*(2+t)/4,l.a1+(n-1)*Math.PI/3))}]}),3)]}),3),h]}),Math.round(480/a/h))]),Math.round(80/a),function(){l.plx=s.U.INSTANCE.px,l.ply=s.U.INSTANCE.py},ht((function(){return[function(){l.dir=Math.atan2(l.ply-l.host.py,l.plx-l.host.px)},ht((function(t){return[ht((function(e){return[function(){return u.n.INSTANCE.add(new J(n,i).simpleInit(l.host.px,l.host.py,c*(2+t)/4,l.dir+(e-1)*y))}]}),3)]}),3),h]}),Math.round(320/a/h))]})),p]}),8)),240*t];var d,y,v}))])]}},bt={name:"RayLaser Hitbox Test",default_scale:3,init:function(t){var n=function(t,n,e){return T(t,2,1,1,n,e,1)},e=[n(0,0,0),n(0,1,1),n(0,0,1),n(0,1,0),n(4,0,0),n(4,1,1),n(4,0,1),n(4,1,0),n(1,0,0),n(1,1,0)],r={render_layer:K.render_layer,collide_group:K.collide_group,collide_mask:K.collide_mask,warning_time:30*t,open_time:10*t,alive_time:6e3*t,close_time:10*t,listener:null},i=0*Math.PI*2/240/t;return[new ct([30*t,ht((function(n){return[ht((function(t){return[function(){return u.n.INSTANCE.add(new l(e[t],r,(o=i*(n%2*2-1),function(t,n){return t.dir+=n*o})).init(50*Math.cos(2*Math.PI/10*t),50*Math.sin(2*Math.PI/10*t),2*Math.PI/10*t,100));var o}]}),10),6e3*t]}))])]}},Mt={name:"Local Variable Test",default_scale:1,init:function(t){var n=(0,k.d9)(K);n.listener={onInit:[],onUpdate:[],onPostMotion:[],onPostUpdate:[],onAttack:[],onDestroy:[],onExitScreen:[],onKill:[]},n.listener.onAttack.push((function(t){return t.custom_fields.callback()}));var e=[[I(m(3,6,0),1),I(g(0,1,1),1)],[I(m(3,2,0),1),I(g(0,0,1),1)],[I(m(3,13,0),1),I(g(0,3,1),1)],[I(m(3,10,0),1),I(g(0,2,1),1)]],r={duration:40*t,px0:-96,px1:96,py0:32,py1:112,dx1:64,dy1:64,ease:function(t){return(1-Math.cos(Math.PI*t))/2}},i=2.5/t;return[new ct([60*t,ht((function(o){return[pt((a=o,function(t,o){return void 0===o&&(o=t.custom_fields),[function(){var t=Math.random()*Math.PI*2;o.px=50*Math.cos(t),o.py=64+50*Math.sin(t),o.count=0},ht([ht((function(t){return[function(){return u.n.INSTANCE.add(new J(0==o.count?e[a][0]:e[a][1],n).simpleInit(o.px,o.py,i,2*Math.PI/40*t).init((function(t,n){void 0===n&&(n=t.custom_fields),n.callback=function(){return o.count++}})))}]}),40),function(){return o.count=0},rt.random(o,r)])]})),150*t];var a}),4)])]}},At=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Et=(function(t){function n(){return null!==t&&t.apply(this,arguments)||this}At(n,t),n.prototype.distanceTo=function(t,n,e){var r=this;return t.getStat().list.reduce((function(i,o){return Math.min(i,r._distanceTo(t,o.start,o.len,n,e))}),1/0)}}(c.bn),function(t){At((function(){return null!==t&&t.apply(this,arguments)||this}),t)}(c.Yw),function(){function t(){this.exist=!1,this.list=[],this.start=-1,this.count=0}return t.prototype.reduce=function(t,n){return t&&1==t.state?(this.exist||(this.start=n),this.exist=!0,this.count++):this.exist&&(this.exist=!1,this.list.push({start:this.start,len:this.count}),this.count=0),this},t}()),It=function(t){function n(n){var e=t.call(this,1,n)||this;return e.list=[],e}return At(n,t),n.prototype.getStat=function(){return this.list.reduce((function(t,n,e){return t.reduce(n,e)}),new Et).reduce(null,0)},n.prototype.preRender=function(){return{curve:this,list:this.getStat().list}},n.prototype.getSprite=function(){return this.shaped_sprite},n}(c.hE),Tt=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Pt={collide_group:k.T7,collide_mask:k.Io,render_layer:k.bm,kill_on_empty:!0,protect:0,life:0},St=function(t){function n(n,e){var r=t.call(this,n)||this;return r.state=0,r.time=0,r.config=e,r}return Tt(n,t),n.prototype.add=function(t){return this.list.push(t),t},n.prototype.update=function(t){0==this.state&&(this.state=1);var n=u.n.INSTANCE.special_effects.time_rate;this.time+=n;for(var e=0,r=this.getStat().list;e<r.length;e++)for(var i=r[e],o=0;o<i.len;o++)this.list[o+i.start].magn=this.shaped_sprite.radius(i.start,i.len,o)},n.prototype.attack=function(t,n){},n.prototype.postUpdate=function(t){for(;this.list.length&&3==this.list[0].state;)this.list.shift();this.time>this.config.protect&&this.config.kill_on_empty&&!this.list.length&&(this.state=3)},n.prototype.damaged=function(t,n){return!1},n.prototype.distanceTo=function(t,n){return 1/0},n}(It),Nt={name:"curve test",default_scale:1,init:function(t){var n=I(m(9,2,0),1),e=[P(1,1,null),P(12,1,null)],r=(0,k.d9)(K),i=(0,k.d9)(Pt);r.init_stall=5*t,r.exit_margin=100,n.sprite=null;var o=2.5/t,a=2*Math.PI*.3,s=2*Math.PI/240/t,c=140*t,h=5*t,p=.17*Math.PI,l=function(t,n,e){return function(r,i){var a=t+n*Math.sin(r.time*e+p);return r.vx=o*Math.cos(a),r.vy=o*Math.sin(a),!0}};return[new ct([60*t,ht((function(t){return[pt((function(c,p){return void 0===p&&(p=c.custom_fields),[function(){p.n=Math.min(24,Math.floor(12+t/4)),p.a0=2*Math.PI*Math.random()},pt((function(c,f){return void 0===f&&(f=c.custom_fields),[function(){f.curve=[];for(var n=0;n<p.n;n++){var r=new St(e[t%2],i);u.n.INSTANCE.add(r),f.curve.push(r)}},ht((function(){return[function(){for(var e=0;e<p.n;e++){var i=p.a0+(Math.floor((t+1)/2)%2*2-1)*Math.PI*2/p.n*e,c=new J(n,r);c.setMotion(l(i,(Math.floor((t+1)/2)%2*2-1)*a,(t%2*2-1)*s)),c.simpleInit(0,0,o,i),f.curve[e].add(c),u.n.INSTANCE.add(c)}},h]}),32)]}))]})),c]}))])]}},Rt=Object.values(r),kt=Object.values(i),Ot=e(506),Ct={radius:1,pre_miss:30,miss_time:60,graze_radius:24,max_graze:600,init_bomb:3,init_life:3,init_ability:5,max_bomb:10,max_life:10,max_ability:5},Ut={init:Ft,stage:6,scale:1,ability:1,stage_list:kt,ability_list:Rt};function Ft(){return t=this,n=void 0,r=function(){var t;return function(t,n){var e,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;a;)try{if(e=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=n.call(t,a)}catch(t){o=[6,t],r=0}finally{e=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(n){switch(n.label){case 0:return[4,S.Z.get(v.path).load()];case 1:return n.sent(),(t=new u.n).add(new s.U(I(x,1),new s.f(null,null,Rt[Ut.ability].init()),Ct,0,-192)),kt[Ut.stage].init(Ut.scale).forEach((function(n){return t.add(n)})),Ot.Mw.pool=t,Ot.Mw.stage=Ut,[2]}}))},new((e=void 0)||(e=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var n;t.done?i(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(a,s)}u((r=r.apply(t,n||[])).next())}));var t,n,e,r}},566:(t,n,e)=>{e.d(n,{bn:()=>a,D8:()=>u,HC:()=>c,Yw:()=>h,hE:()=>p,eY:()=>l,u5:()=>f,_R:()=>d});var r,i,o=(r=function(t,n){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(t,n)},function(t,n){function e(){this.constructor=t}r(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}),a=function(){},s=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return o(n,t),n}(a),u=function(t){function n(n){var e=t.call(this)||this;return e.radius=n,e}return o(n,t),n.prototype.exitScreen=function(t){var n=Math.sqrt(Math.pow(t.shaped_sprite.w,2)+Math.pow(t.shaped_sprite.h,2));return Math.max(0,n*t.magn)},n.prototype.distanceTo=function(t,n,e){return Math.sqrt(Math.pow(n-t.px,2)+Math.pow(e-t.py,2))-this.radius*t.magn},n.prototype.rawDistanceTo=function(t,n,e,r,i){return Math.sqrt(Math.pow(r-t,2)+Math.pow(i-n,2))-this.radius*e},n.prototype.rawExitScreen=function(t,n,e,r,i){var o=Math.sqrt(Math.pow(e.w,2)+Math.pow(e.h,2));return Math.abs(t)>r+o||Math.abs(n)>i+o},n}(s),c=function(t){function n(n,e){var r=t.call(this)||this;return r.len=n,r.rad=e,r}return o(n,t),n.orthDis=function(t,n,e,r){var i=r/2;t=Math.abs(t);var o=e*e/i/2+i/2-i;return(n=Math.abs(n))>=0&&e*(n+o)>t*o?Math.sqrt(Math.pow(t,2)+Math.pow(n+o,2))-o-i:Math.sqrt(Math.pow(t-e,2)+Math.pow(n,2))-i},n.prototype.exitScreen=function(t){return Math.sqrt(Math.pow(t.shaped_sprite.w,2)+Math.pow(t.shaped_sprite.h,2))*t.magn},n.prototype.distanceTo=function(t,e,r){var i=e-t.px,o=r-t.py,a=i*Math.cos(-t.dir)-o*Math.sin(-t.dir),s=i*Math.sin(-t.dir)+o*Math.cos(-t.dir);return n.orthDis(a,s,this.len/2*t.magn,this.rad*t.magn)},n}(s),h=function(){},p=(o((function(){return null!==i&&i.apply(this,arguments)||this}),i=h),function(){function t(t,n){this.collideCheck=null,this.renderType=t,this.shaped_sprite=n}return t.prototype.distanceTo=function(t,n){var e;return(null===(e=this.shaped_sprite)||void 0===e?void 0:e.shape)?this.shaped_sprite.shape.distanceTo(this,t,n):1/0},t}()),l=function(t){function n(n){var e=t.call(this,0,n)||this;return e.magn=1,e.alpha=1,e}return o(n,t),n.prototype.rectCount=function(){return 1},n.prototype.render=function(t,n){t[10*n+0]=this.px,t[10*n+1]=this.py,t[10*n+2]=this.dir+Math.PI/2,t[10*n+3]=this.shaped_sprite.w/2*this.magn,t[10*n+4]=this.shaped_sprite.h/2*this.magn;var e=this.shaped_sprite.sprite;t[10*n+5]=e.tx/e.sprite.w,t[10*n+6]=e.ty/e.sprite.h,t[10*n+7]=e.tw/e.sprite.w,t[10*n+8]=e.th/e.sprite.h,t[10*n+9]=this.alpha},n}(p),f=function(t){function n(){return t.call(this,null,null)||this}return o(n,t),n}(p);function d(t,n){if(t.collideCheck)return t.collideCheck(n);if(n.collideCheck)return n.collideCheck(t);if(t instanceof l&&t.shaped_sprite.shape instanceof u)return n.distanceTo(t.px,t.py)<t.shaped_sprite.shape.radius;if(n instanceof l&&n.shaped_sprite.shape instanceof u)return d(n,t);throw new Error("non-circle non-circle collision not found")}},68:(t,n,e)=>{e.d(n,{Z:()=>i});var r=e(86),i=function(){function t(t){this.img=null,this.path=t}return t.prototype.loaded=function(){return this.img},t.prototype.load=function(){return t=this,n=void 0,i=function(){var t;return function(t,n){var e,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;a;)try{if(e=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=n.call(t,a)}catch(t){o=[6,t],r=0}finally{e=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(n){switch(n.label){case 0:return[4,r.loadImage(this.path)];case 1:return t=n.sent(),this.img=r.loadTexture(t),[2]}}))},new((e=void 0)||(e=Promise))((function(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var n;t.done?r(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(a,s)}u((i=i.apply(t,n||[])).next())}));var t,n,e,i},t.get=function(n){return t.INS[n]?t.INS[n]:t.INS[n]=new t(n)},t.prototype.draw=function(t){this.drawRect(t,0),this.drawRect(t,1),this.drawCurve(t,0),this.drawCurve(t,1)},t.prototype.drawRect=function(t,n){var e=t.reduce((function(t,e){return 0==e.renderType&&e.shaped_sprite.sprite.mode==n?t+e.rectCount():t}),0);if(e){r.setMode(n);for(var i=new Float32Array(10*e),o=0,a=0,s=t;a<s.length;a++){var u=s[a];if(0==u.renderType&&u.shaped_sprite.sprite.mode==n){var c=u;c.render(i,o),o+=c.rectCount()}}r.drawRects(i,e,this.img)}},t.prototype.drawCurve=function(t,n){var e=t.filter((function(t){return 1==t.renderType&&t.shaped_sprite.sprite.mode==n})).map((function(t){return t.preRender()})),i=e.reduce((function(t,n){return n.list.reduce((function(t,n){return n.len<=1?t:t+n.len}),t)}),0);if(0!=i){r.setMode(n);for(var o=new Float32Array(2*i),a=0,s=0,u=e;s<u.length;s++)for(var c=u[s],h=0,p=c.list;h<p.length;h++){var l=p[h];if(!(l.len<=1))for(var f=0;f<l.len;f++)o[a++]=c.curve.list[f+l.start].px,o[a++]=c.curve.list[f+l.start].py}var d=e.map((function(t){return{w:t.curve.shaped_sprite.sp_w,len:t.list.map((function(t){return t.len})).filter((function(t){return t>1})),tx:t.curve.shaped_sprite.sprite.tx/t.curve.shaped_sprite.sprite.sprite.w,ty:t.curve.shaped_sprite.sprite.ty/t.curve.shaped_sprite.sprite.sprite.h,tw:t.curve.shaped_sprite.sprite.tw/t.curve.shaped_sprite.sprite.sprite.w,th:t.curve.shaped_sprite.sprite.th/t.curve.shaped_sprite.sprite.sprite.h}})).filter((function(t){return t.len.length>0}));r.drawSnake(o,d,this.img)}},t.INS={},t}()}},r={};function i(t){if(r[t])return r[t].exports;var n=r[t]={exports:{}};return e[t](n,n.exports,i),n.exports}i.d=(t,n)=>{for(var e in n)i.o(n,e)&&!i.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:n[e]})},i.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},t=i(745),n=i(506),window.onload=async function(){n.wW();const e=n.a(),r=t.S();await e,await r,document.getElementById("loading").hidden=!0,i(81),n.dB()}})();