diff --git a/ConcerningEdgeCases.md b/ConcerningEdgeCases.md index 61b3110..0c01e20 100644 --- a/ConcerningEdgeCases.md +++ b/ConcerningEdgeCases.md @@ -47,3 +47,23 @@ renderFrameId | toApplyInputFrameId ..., ..., ..., 368 | 90 369, 370, 371, 372 | 91 373, 374, 375, ... | 92 + +# Would using UDP instead of TCP yield better synchronization performance? +Yes, but with non-trivial efforts. + +## Neat advantage using UDP +Let's check an actual use case. As soon as an inputFrame becomes all-confirmed, the server should downsync it to all active players -- and upon reception loss of the packet containing this "all-confirmed downsync inputFrame" to a certain player, the server MUST retransmit another packet containing the same inputFrame to that player. + +To apply UDP on this use case, additional `ack & retransmission mechanism` would be required, which is a moderately difficult task -- don't just pick a 3rd party lib using TCP flow-control alike `sliding window mechanism`, e.g. [RUDP](https://www.geeksforgeeks.org/reliable-user-datagram-protocol-rudp/)! Here's why. + +Assume that the server is downsyncing `sequence of packets[#1, #2, #3, #4, #5, #6, #7, #8, #9, #10]`, when using TCP we get the advantage that each active player is guaranteed to receive that same sequence in the same order -- however in a bad, lossy network when `packet#2` got lost several times for a certain player whose reception window size is just 5, it has to wait for the arrival of `packet#2` at `[_, #3, #4, #5, #6]`, thus unable to process `[#7, #8, #9, #10]` which could contain `unpredictable inputFrame` while `#2` being `correct prediction` for that player. + +That's so neat but still an advantage for using UDP! Yet if the TCP flow-control alike `sliding window mechanism` is employed on UDP, such advantage'd be compromised. + +To summarize, if UDP is used we need +- an `ack & retransmission mechanism` built on top of it to guarantee reception of critical packets for active players, and +- reception order is not necessary to be reserved (mimic [markConfirmationIfApplicable](https://github.com/genxium/DelayNoMore/blob/v0.9.14/battle_srv/models/room.go#L1085) to maintain `lastAllConfirmedInputFrameId`), but +- TCP flow-control alike `sliding window mechanism` should be avoided to gain advantage over TCP. + +## Additional hassles to care about using UDP +When using UDP, it's also necessary to verify authorization of each incoming packet, e.g. by simple time limited symmetric key, due to being connectionless. diff --git a/README.md b/README.md index cbe434a..cfa6f07 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Preface -This project is a demo for a websocket-based rollback netcode inspired by [GGPO](https://github.com/pond3r/ggpo/blob/master/doc/README.md). +This project is a demo for a websocket-based rollback netcode inspired by [GGPO](https://github.com/pond3r/ggpo/blob/master/doc/README.md). As lots of feedbacks ask for a discussion on using UDP instead, I tried to summarize my personal opinion about it in [ConcerningEdgeCases](./ConcerningEdgeCases.md) -- not necessarily correct but that's indeed a question to face :) The following video is recorded over INTERNET using an input delay of 4 frames and it feels SMOOTH when playing! Please also checkout [this demo video](https://pan.baidu.com/s/1ML6hNupaPHPJRd5rcTvQvw?pwd=8ruc) to see how this demo carries out a full 60fps synchronization with the help of _batched input upsync/downsync_ for satisfying network I/O performance. diff --git a/frontend/assets/plugin_scripts/jsexport.js b/frontend/assets/plugin_scripts/jsexport.js index 6b9881a..e7eccf0 100644 --- a/frontend/assets/plugin_scripts/jsexport.js +++ b/frontend/assets/plugin_scripts/jsexport.js @@ -9,7 +9,7 @@ $packages["runtime"]=(function(){var $pkg={},$init,A,C,D,AT,AZ,BD,AM,E,AU;A=$pac $packages["math/bits"]=(function(){var $pkg={},$init;$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); $packages["math"]=(function(){var $pkg={},$init,B,A,IT,IU,IV,IW,FL,FM,FN,FO,FP,HH,EI,EX,EY,FK,GA,GH,GK,GL,GM,GS,GT,GW,GX,GZ,HA,HD,HI,HL,HM;B=$packages["github.com/gopherjs/gopherjs/js"];A=$packages["math/bits"];IT=$arrayType($Uint32,2);IU=$arrayType($Float32,2);IV=$arrayType($Float64,1);IW=$structType("math",[{prop:"uint32array",name:"uint32array",embedded:false,exported:false,typ:IT,tag:""},{prop:"float32array",name:"float32array",embedded:false,exported:false,typ:IU,tag:""},{prop:"float64array",name:"float64array",embedded:false,exported:false,typ:IV,tag:""}]);EI=function(av){var av,aw,ax,ay,az,ba,bb;aw=HL(av);ax=((($shiftRightUint64(aw,52).$low>>>0))&2047)>>>0;if(ax<1023){aw=(ay=new $Uint64(2147483648,0),new $Uint64(aw.$high&ay.$high,(aw.$low&ay.$low)>>>0));if(ax===1022){aw=(az=new $Uint64(1072693248,0),new $Uint64(aw.$high|az.$high,(aw.$low|az.$low)>>>0));}}else if(ax<1075){ax=ax-(1023)>>>0;aw=(ba=$shiftRightUint64(new $Uint64(524288,0),ax),new $Uint64(aw.$high+ba.$high,aw.$low+ba.$low));aw=(bb=$shiftRightUint64(new $Uint64(1048575,4294967295),ax),new $Uint64(aw.$high&~bb.$high,(aw.$low&~bb.$low)>>>0));}return HM(aw);};$pkg.Round=EI;EX=function(av,aw){var av,aw;if(GL(av,1)||GL(aw,1)){return GK(1);}else if(GM(av)||GM(aw)){return GW();}else if((av===0)&&(av===aw)){if(GZ(av)){return aw;}return av;}if(av>aw){return av;}return aw;};EY=function(av,aw){var av,aw;if(GL(av,-1)||GL(aw,-1)){return GK(-1);}else if(GM(av)||GM(aw)){return GW();}else if((av===0)&&(av===aw)){if(GZ(av)){return av;}return aw;}if(av>>0)));};$pkg.Abs=FK;GA=function(av){var av;return $parseFloat(FL.cos(av));};$pkg.Cos=GA;GH=function(av){var av;return $parseFloat(FL.floor(av));};$pkg.Floor=GH;GK=function(av){var av;if(av>=0){return FN;}else{return FO;}};$pkg.Inf=GK;GL=function(av,aw){var av,aw;if(av===FN){return aw>=0;}if(av===FO){return aw<=0;}return false;};$pkg.IsInf=GL;GM=function(av){var av,aw;aw=false;aw=!((av===av));return aw;};$pkg.IsNaN=GM;GS=function(av,aw){var av,aw;return EX(av,aw);};$pkg.Max=GS;GT=function(av,aw){var av,aw;return EY(av,aw);};$pkg.Min=GT;GW=function(){return FP;};$pkg.NaN=GW;GX=function(av,aw){var av,aw;if((av===1)||((av===-1)&&((aw===FN)||(aw===FO)))){return 1;}return $parseFloat(FL.pow(av,aw));};$pkg.Pow=GX;GZ=function(av){var av;return av<0||(1/av===FO);};$pkg.Signbit=GZ;HA=function(av){var av;return $parseFloat(FL.sin(av));};$pkg.Sin=HA;HD=function(av){var av;return $parseFloat(FL.sqrt(av));};$pkg.Sqrt=HD;HI=function(){var av;av=new($global.ArrayBuffer)(8);HH.uint32array=new($global.Uint32Array)(av);HH.float32array=new($global.Float32Array)(av);HH.float64array=new($global.Float64Array)(av);};HL=function(av){var av,aw,ax;HH.float64array[0]=av;return(aw=$shiftLeft64((new $Uint64(0,HH.uint32array[1])),32),ax=(new $Uint64(0,HH.uint32array[0])),new $Uint64(aw.$high+ax.$high,aw.$low+ax.$low));};$pkg.Float64bits=HL;HM=function(av){var av;HH.uint32array[0]=((av.$low>>>0));HH.uint32array[1]=(($shiftRightUint64(av,32).$low>>>0));return HH.float64array[0];};$pkg.Float64frombits=HM;$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=B.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=A.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}HH=new IW.ptr(IT.zero(),IU.zero(),IV.zero());FL=$global.Math;FM=0;FN=1/FM;FO=-1/FM;FP=$parseFloat($NaN);HI();}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); $packages["resolv"]=(function(){var $pkg={},$init,A,B,C,N,P,Q,S,U,X,Z,AA,AE,AG,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR,AS,AT,AU,AV,AW,AX,AY,K,O,R,T,V,W,Y,AB,AC,AD,AF,AH;A=$packages["math"];B=$pkg.Vector=$newType(12,$kindSlice,"resolv.Vector",true,"resolv",true,null);C=$pkg.Axis=$newType(4,$kindInt,"resolv.Axis",true,"resolv",true,null);N=$pkg.Space=$newType(0,$kindStruct,"resolv.Space",true,"resolv",true,function(Cells_,CellWidth_,CellHeight_){this.$val=this;if(arguments.length===0){this.Cells=AL.nil;this.CellWidth=0;this.CellHeight=0;return;}this.Cells=Cells_;this.CellWidth=CellWidth_;this.CellHeight=CellHeight_;});P=$pkg.Shape=$newType(8,$kindInterface,"resolv.Shape",true,"resolv",true,null);Q=$pkg.Line=$newType(0,$kindStruct,"resolv.Line",true,"resolv",true,function(Start_,End_){this.$val=this;if(arguments.length===0){this.Start=B.nil;this.End=B.nil;return;}this.Start=Start_;this.End=End_;});S=$pkg.ConvexPolygon=$newType(0,$kindStruct,"resolv.ConvexPolygon",true,"resolv",true,function(Points_,X_,Y_,Closed_){this.$val=this;if(arguments.length===0){this.Points=AP.nil;this.X=0;this.Y=0;this.Closed=false;return;}this.Points=Points_;this.X=X_;this.Y=Y_;this.Closed=Closed_;});U=$pkg.ContactSet=$newType(0,$kindStruct,"resolv.ContactSet",true,"resolv",true,function(Points_,MTV_,Center_){this.$val=this;if(arguments.length===0){this.Points=AP.nil;this.MTV=B.nil;this.Center=B.nil;return;}this.Points=Points_;this.MTV=MTV_;this.Center=Center_;});X=$pkg.Circle=$newType(0,$kindStruct,"resolv.Circle",true,"resolv",true,function(X_,Y_,Radius_){this.$val=this;if(arguments.length===0){this.X=0;this.Y=0;this.Radius=0;return;}this.X=X_;this.Y=Y_;this.Radius=Radius_;});Z=$pkg.Projection=$newType(0,$kindStruct,"resolv.Projection",true,"resolv",true,function(Min_,Max_){this.$val=this;if(arguments.length===0){this.Min=0;this.Max=0;return;}this.Min=Min_;this.Max=Max_;});AA=$pkg.Object=$newType(0,$kindStruct,"resolv.Object",true,"resolv",true,function(Shape_,Space_,X_,Y_,W_,H_,TouchingCells_,Data_,ignoreList_,tags_){this.$val=this;if(arguments.length===0){this.Shape=$ifaceNil;this.Space=AM.nil;this.X=0;this.Y=0;this.W=0;this.H=0;this.TouchingCells=AK.nil;this.Data=$ifaceNil;this.ignoreList=false;this.tags=AV.nil;return;}this.Shape=Shape_;this.Space=Space_;this.X=X_;this.Y=Y_;this.W=W_;this.H=H_;this.TouchingCells=TouchingCells_;this.Data=Data_;this.ignoreList=ignoreList_;this.tags=tags_;});AE=$pkg.Collision=$newType(0,$kindStruct,"resolv.Collision",true,"resolv",true,function(checkingObject_,dx_,dy_,Objects_,Cells_){this.$val=this;if(arguments.length===0){this.checkingObject=AN.nil;this.dx=0;this.dy=0;this.Objects=AO.nil;this.Cells=AK.nil;return;}this.checkingObject=checkingObject_;this.dx=dx_;this.dy=dy_;this.Objects=Objects_;this.Cells=Cells_;});AG=$pkg.Cell=$newType(0,$kindStruct,"resolv.Cell",true,"resolv",true,function(X_,Y_,Objects_){this.$val=this;if(arguments.length===0){this.X=0;this.Y=0;this.Objects=AO.nil;return;}this.X=X_;this.Y=Y_;this.Objects=Objects_;});AI=$sliceType($Float64);AJ=$ptrType(AG);AK=$sliceType(AJ);AL=$sliceType(AK);AM=$ptrType(N);AN=$ptrType(AA);AO=$sliceType(AN);AP=$sliceType(B);AQ=$ptrType(Q);AR=$sliceType(AQ);AS=$ptrType(X);AT=$ptrType(S);AU=$ptrType(U);AV=$sliceType($String);AW=$ptrType(AE);AX=$sliceType(C);AY=$mapType(AN,$Bool);B.prototype.Clone=function(){var a,b;a=this;b=$makeSlice(B,a.$length);$copySlice(b,a);return b;};$ptrType(B).prototype.Clone=function(){return this.$get().Clone();};B.prototype.Add=function(a){var a,b,c,d,e,f;b=this;c=b.$length;d=a;e=0;while(true){if(!(e=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]).$length>c){AC($convertSliceType(b,AI),1,$convertSliceType(b,AI),$convertSliceType($subslice(((f<0||f>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]),0,c),AI));}else{AC($convertSliceType(b,AI),1,$convertSliceType(b,AI),$convertSliceType(((f<0||f>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]),AI));}e++;}return b;};$ptrType(B).prototype.Add=function(a){return this.$get().Add(a);};B.prototype.Sub=function(a){var a,b,c,d,e,f;b=this;c=b.$length;d=a;e=0;while(true){if(!(e=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]).$length>c){AC($convertSliceType(b,AI),-1,$convertSliceType($subslice(((f<0||f>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]),0,c),AI),$convertSliceType(b,AI));}else{AC($convertSliceType(b,AI),-1,$convertSliceType(((f<0||f>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]),AI),$convertSliceType(b,AI));}e++;}return b;};$ptrType(B).prototype.Sub=function(a){return this.$get().Sub(a);};B.prototype.Scale=function(a){var a,b;b=this;AD($convertSliceType(b,AI),a,$convertSliceType(b,AI));return b;};$ptrType(B).prototype.Scale=function(a){return this.$get().Scale(a);};B.prototype.Equal=function(a){var a,b,c,d,e;b=this;if(!((b.$length===a.$length))){return false;}c=b;d=0;while(true){if(!(d=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+e])-((e<0||e>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+e]))>1e-08){return false;}d++;}return true;};$ptrType(B).prototype.Equal=function(a){return this.$get().Equal(a);};B.prototype.Magnitude=function(){var a;a=this;return A.Sqrt(a.Magnitude2());};$ptrType(B).prototype.Magnitude=function(){return this.$get().Magnitude();};B.prototype.Magnitude2=function(){var a,b,c,d,e;a=this;b=0;c=a;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);b=b+(e*e);d++;}return b;};$ptrType(B).prototype.Magnitude2=function(){return this.$get().Magnitude2();};B.prototype.Unit=function(){var a,b,c,d,e;a=this;b=a.Magnitude();if(b<1e-08){return a;}c=a;d=0;while(true){if(!(d=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+e]=((e<0||e>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+e])/b);d++;}return a;};$ptrType(B).prototype.Unit=function(){return this.$get().Unit();};K=function(a,b){var a,b,c,d,e,f,g,h,i,j,k;c=0;d=a.$length;e=b.$length;f=c;g=d;h=e;if(g>h){b=$appendSlice(b,$convertSliceType($makeSlice(B,(g-h>>0)),AI));}if(g>0)),AI));}i=a;j=0;while(true){if(!(j=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+k])*((k<0||k>=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+k]));j++;}return f;};$pkg.Dot=K;B.prototype.Dot=function(a){var a,b;b=this;return K(b,a);};$ptrType(B).prototype.Dot=function(a){return this.$get().Dot(a);};B.prototype.Cross=function(a){var a,b;b=this;if(!((b.$length===3))||!((a.$length===3))){return B.nil;}return new B([(1>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+1])*(2>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+2])-(2>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+2])*(1>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+1]),(2>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+2])*(0>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+0])-(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])*(2>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+2]),(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])*(2>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+2])-(2>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+2])*(0>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+0])]);};$ptrType(B).prototype.Cross=function(a){return this.$get().Cross(a);};B.prototype.Rotate=function(a,b){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;c=this;d=2;e=c.$length;f=d;g=e;if(g===0){return c;}if(b.$length>0){f=(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0]);}if((g===1)&&!((f===2))){c=$append(c,0,0);}if((g<2&&(f===2))||((g===2)&&!((f===2)))){c=$append(c,0);}h=(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]);i=(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]);j=h;k=i;l=A.Cos(a);m=A.Sin(a);n=l;o=m;p=f;if(p===(0)){q=(2>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+2]);(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]=k*n-q*o);(2>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+2]=k*o+q*n);}else if(p===(1)){r=(2>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+2]);(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]=j*n+r*o);(2>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+2]=-j*o+r*n);}else if(p===(2)){(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]=j*n-k*o);(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]=j*o+k*n);}if(g>3){return $subslice(c,0,3);}return c;};$ptrType(B).prototype.Rotate=function(a,b){return this.$get().Rotate(a,b);};B.prototype.X=function(){var a;a=this;if(a.$length<1){return 0;}return(0>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+0]);};$ptrType(B).prototype.X=function(){return this.$get().X();};B.prototype.Y=function(){var a;a=this;if(a.$length<2){return 0;}return(1>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+1]);};$ptrType(B).prototype.Y=function(){return this.$get().Y();};B.prototype.Z=function(){var a;a=this;if(a.$length<3){return 0;}return(2>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+2]);};$ptrType(B).prototype.Z=function(){return this.$get().Z();};O=function(a,b,c,d){var a,b,c,d,e,f,g;e=new N.ptr(AL.nil,c,d);e.Resize((f=a/c,(f===f&&f!==1/0&&f!==-1/0)?f>>0:$throwRuntimeError("integer divide by zero")),(g=b/d,(g===g&&g!==1/0&&g!==-1/0)?g>>0:$throwRuntimeError("integer divide by zero")));return e;};$pkg.NewSpace=O;N.ptr.prototype.Add=function(a){var{a,b,c,d,e,$s,$r,$c}=$restore(this,{a});$s=$s||0;s:while(true){switch($s){case 0:b=this;if(b===AM.nil){$panic(new $String("ERROR: space is nil"));}c=a;d=0;case 1:if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);e.Space=b;$r=e.Update();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}d++;$s=1;continue;case 2:$s=-1;return;}return;}var $f={$blk:N.ptr.prototype.Add,$c:true,$r,a,b,c,d,e,$s};return $f;};N.prototype.Add=function(a){return this.$val.Add(a);};N.ptr.prototype.Remove=function(a){var a,b,c,d,e,f,g,h;b=this;if(b===AM.nil){$panic(new $String("ERROR: space is nil"));}c=a;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);f=e.TouchingCells;g=0;while(true){if(!(g=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+g]);h.unregister(e);g++;}e.TouchingCells=new AK([]);e.Space=AM.nil;d++;}};N.prototype.Remove=function(a){return this.$val.Remove(a);};N.ptr.prototype.Objects=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;a=this;b=$makeMap(AN.keyFor,[]);c=new AO([]);d=a.Cells;e=0;while(true){if(!(e=h.$length)?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+f]));i=0;while(true){if(!(i=m.$length)?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+f])),((j<0||j>=l.$length)?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+j])).Objects;n=0;while(true){if(!(n=k.$length)?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+n]);p=(q=b[AN.keyFor(o)],q!==undefined?[q.v,true]:[false,false]);r=p[1];if(!r){c=$append(c,o);s=o;(b||$throwRuntimeError("assignment to entry in nil map"))[AN.keyFor(s)]={k:s,v:true};}n++;}i++;}e++;}return c;};N.prototype.Objects=function(){return this.$val.Objects();};N.ptr.prototype.Resize=function(a,b){var a,b,c,d,e,f,g;c=this;c.Cells=new AL([]);d=0;while(true){if(!(d=g.$length)?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+d]=$append((f=c.Cells,((d<0||d>=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+d])),AH(e,d))));e=e+(1)>>0;}d=d+(1)>>0;}};N.prototype.Resize=function(a,b){return this.$val.Resize(a,b);};N.ptr.prototype.Cell=function(a,b){var a,b,c,d,e,f;c=this;if(b>=0&&b=0&&a<(d=c.Cells,((b<0||b>=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+b])).$length){return(e=(f=c.Cells,((b<0||b>=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+b])),((a<0||a>=e.$length)?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+a]));}return AJ.nil;};N.prototype.Cell=function(a,b){return this.$val.Cell(a,b);};N.ptr.prototype.CheckCells=function(a,b,c,d,e){var a,b,c,d,e,f,g,h,i,j,k,l,m;f=this;g=a;while(true){if(!(g<(a+c>>0))){break;}h=b;while(true){if(!(h<(b+d>>0))){break;}i=f.Cell(g,h);if(!(i===AJ.nil)){if(e.$length>0){if(i.ContainsTags(e)){j=i.Objects;k=0;while(true){if(!(k=j.$length)?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+k]);if(l.HasTags(e)){return l;}k++;}}}else if(i.Occupied()){return(m=i.Objects,(0>=m.$length?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+0]));}}h=h+(1)>>0;}g=g+(1)>>0;}return AN.nil;};N.prototype.CheckCells=function(a,b,c,d,e){return this.$val.CheckCells(a,b,c,d,e);};N.ptr.prototype.CheckCellsWorld=function(a,b,c,d,e){var a,b,c,d,e,f,g,h,i,j,k,l;f=this;g=f.WorldToSpace(a,b);h=g[0];i=g[1];j=f.WorldToSpace(c,d);k=j[0];l=j[1];return f.CheckCells(h,i,k,l,e);};N.prototype.CheckCellsWorld=function(a,b,c,d,e){return this.$val.CheckCellsWorld(a,b,c,d,e);};N.ptr.prototype.UnregisterAllObjects=function(){var a,b,c,d,e,f,g;a=this;b=0;while(true){if(!(b=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+b])).$length)){break;}g=(e=(f=a.Cells,((b<0||b>=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+b])),((c<0||c>=e.$length)?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+c]));a.Remove(g.Objects);c=c+(1)>>0;}b=b+(1)>>0;}};N.prototype.UnregisterAllObjects=function(){return this.$val.UnregisterAllObjects();};N.ptr.prototype.WorldToSpace=function(a,b){var a,b,c,d,e;c=this;d=((A.Floor(a/(c.CellWidth))>>0));e=((A.Floor(b/(c.CellHeight))>>0));return[d,e];};N.prototype.WorldToSpace=function(a,b){return this.$val.WorldToSpace(a,b);};N.ptr.prototype.SpaceToWorld=function(a,b){var a,b,c,d,e;c=this;d=(($imul(a,c.CellWidth)));e=(($imul(b,c.CellHeight)));return[d,e];};N.prototype.SpaceToWorld=function(a,b){return this.$val.SpaceToWorld(a,b);};N.ptr.prototype.Height=function(){var a;a=this;return a.Cells.$length;};N.prototype.Height=function(){return this.$val.Height();};N.ptr.prototype.Width=function(){var a,b;a=this;if(a.Cells.$length>0){return(b=a.Cells,(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])).$length;}return 0;};N.prototype.Width=function(){return this.$val.Width();};N.ptr.prototype.CellsInLine=function(a,b,c,d){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v;e=this;f=new AK([]);g=e.Cell(a,b);h=e.Cell(c,d);if(!(g===AJ.nil)&&!(h===AJ.nil)){i=new B([((c-a>>0)),((d-b>>0))]).Unit();(0>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+0]=(0>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+0])*(((j=e.CellWidth/2,(j===j&&j!==1/0&&j!==-1/0)?j>>0:$throwRuntimeError("integer divide by zero")))));(1>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+1]=(1>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+1])*(((k=e.CellHeight/2,(k===k&&k!==1/0&&k!==-1/0)?k>>0:$throwRuntimeError("integer divide by zero")))));l=e.SpaceToWorld(a,b);m=l[0];n=l[1];q=new B([m+((o=e.CellWidth/2,(o===o&&o!==1/0&&o!==-1/0)?o>>0:$throwRuntimeError("integer divide by zero"))),n+((p=e.CellHeight/2,(p===p&&p!==1/0&&p!==-1/0)?p>>0:$throwRuntimeError("integer divide by zero")))]);r=false;while(true){if(!(!(g===AJ.nil))){break;}if(g===h){f=$append(f,g);break;}f=$append(f,g);if(r){(1>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+1]=(1>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+1])+((1>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+1])));}else{(0>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+0]=(0>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+0])+((0>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+0])));}s=e.WorldToSpace((0>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+0]),(1>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+1]));t=s[0];u=s[1];v=e.Cell(t,u);if(!(v===g)){g=v;}r=!r;}}return f;};N.prototype.CellsInLine=function(a,b,c,d){return this.$val.CellsInLine(a,b,c,d);};R=function(a,b,c,d){var a,b,c,d;return new Q.ptr(new B([a,b]),new B([c,d]));};$pkg.NewLine=R;Q.ptr.prototype.Project=function(a){var a,b;b=this;return b.Vector().Scale(a.Dot(b.Start.Sub(new AP([b.End]))));};Q.prototype.Project=function(a){return this.$val.Project(a);};Q.ptr.prototype.Normal=function(){var a,b;a=this;b=a.Vector();return new B([(1>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+1]),-(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])]).Unit();};Q.prototype.Normal=function(){return this.$val.Normal();};Q.ptr.prototype.Vector=function(){var a;a=this;return a.End.Clone().Sub(new AP([a.Start])).Unit();};Q.prototype.Vector=function(){return this.$val.Vector();};Q.ptr.prototype.IntersectionPointsLine=function(a){var a,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;b=this;k=((c=b.End,(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]))-(d=b.Start,(0>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+0])))*((e=a.End,(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1]))-(f=a.Start,(1>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+1])))-((g=a.End,(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0]))-(h=a.Start,(0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0])))*((i=b.End,(1>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+1]))-(j=b.Start,(1>=j.$length?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+1])));if(!((k===0))){t=((((l=b.Start,(1>=l.$length?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+1]))-(m=a.Start,(1>=m.$length?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+1])))*((n=a.End,(0>=n.$length?($throwRuntimeError("index out of range"),undefined):n.$array[n.$offset+0]))-(o=a.Start,(0>=o.$length?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+0]))))-(((p=b.Start,(0>=p.$length?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+0]))-(q=a.Start,(0>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+0])))*((r=a.End,(1>=r.$length?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+1]))-(s=a.Start,(1>=s.$length?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+1]))))+1)/k;ac=((((u=b.Start,(1>=u.$length?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+1]))-(v=a.Start,(1>=v.$length?($throwRuntimeError("index out of range"),undefined):v.$array[v.$offset+1])))*((w=b.End,(0>=w.$length?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+0]))-(x=b.Start,(0>=x.$length?($throwRuntimeError("index out of range"),undefined):x.$array[x.$offset+0]))))-(((y=b.Start,(0>=y.$length?($throwRuntimeError("index out of range"),undefined):y.$array[y.$offset+0]))-(z=a.Start,(0>=z.$length?($throwRuntimeError("index out of range"),undefined):z.$array[z.$offset+0])))*((aa=b.End,(1>=aa.$length?($throwRuntimeError("index out of range"),undefined):aa.$array[aa.$offset+1]))-(ab=b.Start,(1>=ab.$length?($throwRuntimeError("index out of range"),undefined):ab.$array[ab.$offset+1]))))+1)/k;if((0=ad.$length?($throwRuntimeError("index out of range"),undefined):ad.$array[ad.$offset+0]))-(ae=b.Start,(0>=ae.$length?($throwRuntimeError("index out of range"),undefined):ae.$array[ae.$offset+0]));ai=(ag=b.End,(1>=ag.$length?($throwRuntimeError("index out of range"),undefined):ag.$array[ag.$offset+1]))-(ah=b.Start,(1>=ah.$length?($throwRuntimeError("index out of range"),undefined):ah.$array[ah.$offset+1]));return new B([(aj=b.Start,(0>=aj.$length?($throwRuntimeError("index out of range"),undefined):aj.$array[aj.$offset+0]))+(t*af),(ak=b.Start,(1>=ak.$length?($throwRuntimeError("index out of range"),undefined):ak.$array[ak.$offset+1]))+(t*ai)]);}}return B.nil;};Q.prototype.IntersectionPointsLine=function(a){return this.$val.IntersectionPointsLine(a);};Q.ptr.prototype.IntersectionPointsCircle=function(a){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;b=this;c=new AP([]);d=new B([a.X,a.Y]);e=b.Start.Sub(new AP([d]));f=b.End.Sub(new AP([d]));g=f.Sub(new AP([e]));h=(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0])*(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0])+(1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1])*(1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1]);i=2*(((0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0])*(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0]))+((1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1])*(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1])));j=((0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0])*(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0]))+((1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1])*(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1]))-(a.Radius*a.Radius);k=i*i-(4*h*j);if(k<0){}else if(k===0){l=-i/(2*h);if(l>=0&&l<=1){c=$append(c,new B([(m=b.Start,(0>=m.$length?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+0]))+l*(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0]),(n=b.Start,(1>=n.$length?($throwRuntimeError("index out of range"),undefined):n.$array[n.$offset+1]))+l*(1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1])]));}}else{o=(-i+A.Sqrt(k))/(2*h);if(o>=0&&o<=1){c=$append(c,new B([(p=b.Start,(0>=p.$length?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+0]))+o*(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0]),(q=b.Start,(1>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+1]))+o*(1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1])]));}o=(-i-A.Sqrt(k))/(2*h);if(o>=0&&o<=1){c=$append(c,new B([(r=b.Start,(0>=r.$length?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+0]))+o*(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0]),(s=b.Start,(1>=s.$length?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+1]))+o*(1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1])]));}}return c;};Q.prototype.IntersectionPointsCircle=function(a){return this.$val.IntersectionPointsCircle(a);};T=function(a){var a,b;b=new S.ptr(new AP([]),0,0,true);b.AddPoints(a);return b;};$pkg.NewConvexPolygon=T;S.ptr.prototype.Clone=function(){var a,b,c,d,e,f;a=this;b=new AP([]);c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);b=$append(b,e.Clone());d++;}f=T(AI.nil);f.X=a.X;f.Y=a.Y;f.AddPointsVec(b);f.Closed=a.Closed;return f;};S.prototype.Clone=function(){return this.$val.Clone();};S.ptr.prototype.AddPointsVec=function(a){var a,b;b=this;b.Points=$appendSlice(b.Points,a);};S.prototype.AddPointsVec=function(a){return this.$val.AddPointsVec(a);};S.ptr.prototype.AddPoints=function(a){var a,b,c,d;b=this;c=0;while(true){if(!(c=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+c]),(d=c+1>>0,((d<0||d>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+d]))]));c=c+(2)>>0;}};S.prototype.AddPoints=function(a){return this.$val.AddPoints(a);};S.ptr.prototype.Lines=function(){var a,b,c,d,e,f,g,h,i,j;a=this;b=new AR([]);c=a.Transformed();d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);f=(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]);g=e;h=f;if(d<(c.$length-1>>0)){h=(i=d+1>>0,((i<0||i>=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+i]));}else if(!a.Closed){break;}j=R((0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0]),(1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1]),(0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0]),(1>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+1]));b=$append(b,j);d=d+(1)>>0;}return b;};S.prototype.Lines=function(){return this.$val.Lines();};S.ptr.prototype.Transformed=function(){var a,b,c,d,e;a=this;b=new AP([]);c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);b=$append(b,new B([(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0])+a.X,(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1])+a.Y]));d++;}return b;};S.prototype.Transformed=function(){return this.$val.Transformed();};S.ptr.prototype.Bounds=function(){var a,b,c,d,e,f,g,h;a=this;b=a.Transformed();e=new B([(c=(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0]),(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0])),(d=(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0]),(1>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+1]))]);f=e.Clone();g=0;while(true){if(!(g=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+g]);if((0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0])<(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0])){(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0]=(0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0]));}else if((0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0])>(0>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+0])){(0>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+0]=(0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0]));}if((1>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+1])<(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1])){(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1]=(1>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+1]));}else if((1>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+1])>(1>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+1])){(1>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+1]=(1>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+1]));}g=g+(1)>>0;}return[e,f];};S.prototype.Bounds=function(){return this.$val.Bounds();};S.ptr.prototype.Position=function(){var a;a=this;return[a.X,a.Y];};S.prototype.Position=function(){return this.$val.Position();};S.ptr.prototype.SetPosition=function(a,b){var a,b,c;c=this;c.X=a;c.Y=b;};S.prototype.SetPosition=function(a,b){return this.$val.SetPosition(a,b);};S.ptr.prototype.SetPositionVec=function(a){var a,b;b=this;b.X=a.X();b.Y=a.Y();};S.prototype.SetPositionVec=function(a){return this.$val.SetPositionVec(a);};S.ptr.prototype.Move=function(a,b){var a,b,c;c=this;c.X=c.X+(a);c.Y=c.Y+(b);};S.prototype.Move=function(a,b){return this.$val.Move(a,b);};S.ptr.prototype.MoveVec=function(a){var a,b;b=this;b.X=b.X+(a.X());b.Y=b.Y+(a.Y());};S.prototype.MoveVec=function(a){return this.$val.MoveVec(a);};S.ptr.prototype.Center=function(){var a,b,c,d,e;a=this;b=new B([0,0]);c=a.Transformed();d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);b.Add(new AP([e]));d++;}(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0]=(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])/((a.Transformed().$length)));(1>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+1]=(1>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+1])/((a.Transformed().$length)));return b;};S.prototype.Center=function(){return this.$val.Center();};S.ptr.prototype.Project=function(a){var a,b,c,d,e,f,g,h,i,j,k;b=this;a=a.Unit();c=b.Transformed();f=a.Dot(new B([(d=(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]),(0>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+0])),(e=(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]),(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1]))]));g=f;h=1;while(true){if(!(h=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+h]),(0>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+0])),(j=((h<0||h>=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+h]),(1>=j.$length?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+1]))]));if(kg){g=k;}h=h+(1)>>0;}return new Z.ptr(f,g);};S.prototype.Project=function(a){return this.$val.Project(a);};S.ptr.prototype.SATAxes=function(){var a,b,c,d,e;a=this;b=new AP([]);c=a.Lines();d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);b=$append(b,e.Normal());d++;}return b;};S.prototype.SATAxes=function(){return this.$val.SATAxes();};S.ptr.prototype.PointInside=function(a){var a,b,c,d,e,f,g;b=this;c=R((0>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+0]),(1>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+1]),(0>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+0])+9.99999999999e+11,(1>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+1]));d=0;e=b.Lines();f=0;while(true){if(!(f=e.$length)?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+f]);if(!(g.IntersectionPointsLine(c)===B.nil)){d=d+(1)>>0;}f++;}return d===1;};S.prototype.PointInside=function(a){return this.$val.PointInside(a);};V=function(){return new U.ptr(new AP([]),new B([0,0]),new B([0,0]));};$pkg.NewContactSet=V;U.ptr.prototype.LeftmostPoint=function(){var a,b,c,d,e;a=this;b=B.nil;c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(b===B.nil||(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0])<(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])){b=e;}d++;}return b;};U.prototype.LeftmostPoint=function(){return this.$val.LeftmostPoint();};U.ptr.prototype.RightmostPoint=function(){var a,b,c,d,e;a=this;b=B.nil;c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(b===B.nil||(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0])>(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])){b=e;}d++;}return b;};U.prototype.RightmostPoint=function(){return this.$val.RightmostPoint();};U.ptr.prototype.TopmostPoint=function(){var a,b,c,d,e;a=this;b=B.nil;c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(b===B.nil||(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1])<(1>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+1])){b=e;}d++;}return b;};U.prototype.TopmostPoint=function(){return this.$val.TopmostPoint();};U.ptr.prototype.BottommostPoint=function(){var a,b,c,d,e;a=this;b=B.nil;c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(b===B.nil||(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1])>(1>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+1])){b=e;}d++;}return b;};U.prototype.BottommostPoint=function(){return this.$val.BottommostPoint();};S.ptr.prototype.Intersection=function(a,b,c){var a,aa,ab,ac,ad,ae,af,ag,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;d=this;e=V();f=d.X;g=d.Y;d.X=d.X+(a);d.Y=d.Y+(b);h=$assertType(c,AS,true);i=h[0];j=h[1];if(j){k=d.Lines();l=0;while(true){if(!(l=k.$length)?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+l]);e.Points=$appendSlice(e.Points,m.IntersectionPointsCircle(i));l++;}}else{n=$assertType(c,AT,true);o=n[0];p=n[1];if(p){q=d.Lines();r=0;while(true){if(!(r=q.$length)?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+r]);t=o.Lines();u=0;while(true){if(!(u=t.$length)?($throwRuntimeError("index out of range"),undefined):t.$array[t.$offset+u]);w=s.IntersectionPointsLine(v);if(!(w===B.nil)){e.Points=$append(e.Points,w);}u++;}r++;}}}if(e.Points.$length>0){x=e.Points;y=0;while(true){if(!(y=x.$length)?($throwRuntimeError("index out of range"),undefined):x.$array[x.$offset+y]);e.Center=e.Center.Add(new AP([z]));y++;}(ab=e.Center,(0>=ab.$length?($throwRuntimeError("index out of range"),undefined):ab.$array[ab.$offset+0]=(aa=e.Center,(0>=aa.$length?($throwRuntimeError("index out of range"),undefined):aa.$array[aa.$offset+0]))/((e.Points.$length))));(ad=e.Center,(1>=ad.$length?($throwRuntimeError("index out of range"),undefined):ad.$array[ad.$offset+1]=(ac=e.Center,(1>=ac.$length?($throwRuntimeError("index out of range"),undefined):ac.$array[ac.$offset+1]))/((e.Points.$length))));ae=d.calculateMTV(e,c);if(!(ae===B.nil)){e.MTV=ae;}}else{e=AU.nil;}if(!(e===AU.nil)&&(!((a===0))||!((b===0)))){af=new B([a,b]).Magnitude();ag=e.MTV.Magnitude();e.MTV=e.MTV.Unit().Scale(ag-af);}d.X=f;d.Y=g;return e;};S.prototype.Intersection=function(a,b,c){return this.$val.Intersection(a,b,c);};S.ptr.prototype.calculateMTV=function(a,b){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o;c=this;d=new B([0,0]);e=new B([1.7976931348623157e+308,0]);f=b;if($assertType(f,AT,true)[1]){g=f.$val;h=c.SATAxes();i=0;while(true){if(!(i=h.$length)?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+i]);if(!$clone(c.Project(j),Z).Overlapping($clone(g.Project(j),Z))){return B.nil;}k=$clone(c.Project(j),Z).Overlap($clone(g.Project(j),Z));if(e.Magnitude()>k){e=j.Scale(k);}i++;}l=g.SATAxes();m=0;while(true){if(!(m=l.$length)?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+m]);if(!$clone(c.Project(n),Z).Overlapping($clone(g.Project(n),Z))){return B.nil;}o=$clone(c.Project(n),Z).Overlap($clone(g.Project(n),Z));if(e.Magnitude()>o){e=n.Scale(o);}m++;}}(0>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+0]=(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0]));(1>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+1]=(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1]));return d;};S.prototype.calculateMTV=function(a,b){return this.$val.calculateMTV(a,b);};S.ptr.prototype.ContainedBy=function(a){var a,b,c,d,e,f,g,h,i,j;b=this;c=a;if($assertType(c,AT,true)[1]){d=c.$val;e=b.SATAxes();f=0;while(true){if(!(f=e.$length)?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+f]);if(!$clone(b.Project(g),Z).IsInside($clone(d.Project(g),Z))){return false;}f++;}h=d.SATAxes();i=0;while(true){if(!(i=h.$length)?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+i]);if(!$clone(b.Project(j),Z).IsInside($clone(d.Project(j),Z))){return false;}i++;}}return true;};S.prototype.ContainedBy=function(a){return this.$val.ContainedBy(a);};S.ptr.prototype.FlipH=function(){var a,b,c,d;a=this;b=a.Points;c=0;while(true){if(!(c=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+c]);(0>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+0]=-(0>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+0]));c++;}a.ReverseVertexOrder();};S.prototype.FlipH=function(){return this.$val.FlipH();};S.ptr.prototype.FlipV=function(){var a,b,c,d;a=this;b=a.Points;c=0;while(true){if(!(c=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+c]);(1>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+1]=-(1>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+1]));c++;}a.ReverseVertexOrder();};S.prototype.FlipV=function(){return this.$val.FlipV();};S.ptr.prototype.ReverseVertexOrder=function(){var a,b,c,d,e;a=this;c=new AP([(b=a.Points,(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0]))]);d=a.Points.$length-1>>0;while(true){if(!(d>=1)){break;}c=$append(c,(e=a.Points,((d<0||d>=e.$length)?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+d])));d=d-(1)>>0;}a.Points=c;};S.prototype.ReverseVertexOrder=function(){return this.$val.ReverseVertexOrder();};W=function(a,b,c,d){var a,b,c,d;return T(new AI([a,b,a+c,b,a+c,b+d,a,b+d]));};$pkg.NewRectangle=W;Y=function(a,b,c){var a,b,c,d;d=new X.ptr(a,b,c);return d;};$pkg.NewCircle=Y;X.ptr.prototype.Clone=function(){var a;a=this;return Y(a.X,a.Y,a.Radius);};X.prototype.Clone=function(){return this.$val.Clone();};X.ptr.prototype.Bounds=function(){var a;a=this;return[new B([a.X-a.Radius,a.Y-a.Radius]),new B([a.X+a.Radius,a.Y+a.Radius])];};X.prototype.Bounds=function(){return this.$val.Bounds();};X.ptr.prototype.Intersection=function(a,b,c){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;d=this;e=AU.nil;f=d.X;g=d.Y;d.X=d.X+(a);d.Y=d.Y+(b);h=c;if($assertType(h,AT,true)[1]){i=h.$val;e=i.Intersection(-a,-b,d);if(!(e===AU.nil)){e.MTV=e.MTV.Scale(-1);}}else if($assertType(h,AS,true)[1]){j=h.$val;e=V();e.Points=d.IntersectionPointsCircle(j);if(e.Points.$length===0){return AU.nil;}e.MTV=new B([d.X-j.X,d.Y-j.Y]);k=e.MTV.Magnitude();e.MTV=e.MTV.Unit().Scale(d.Radius+j.Radius-k);l=e.Points;m=0;while(true){if(!(m=l.$length)?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+m]);e.Center=e.Center.Add(new AP([n]));m++;}(p=e.Center,(0>=p.$length?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+0]=(o=e.Center,(0>=o.$length?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+0]))/((e.Points.$length))));(r=e.Center,(1>=r.$length?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+1]=(q=e.Center,(1>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+1]))/((e.Points.$length))));}d.X=f;d.Y=g;return e;};X.prototype.Intersection=function(a,b,c){return this.$val.Intersection(a,b,c);};X.ptr.prototype.Move=function(a,b){var a,b,c;c=this;c.X=c.X+(a);c.Y=c.Y+(b);};X.prototype.Move=function(a,b){return this.$val.Move(a,b);};X.ptr.prototype.MoveVec=function(a){var a,b;b=this;b.X=b.X+(a.X());b.Y=b.Y+(a.Y());};X.prototype.MoveVec=function(a){return this.$val.MoveVec(a);};X.ptr.prototype.SetPosition=function(a,b){var a,b,c;c=this;c.X=a;c.Y=b;};X.prototype.SetPosition=function(a,b){return this.$val.SetPosition(a,b);};X.ptr.prototype.SetPositionVec=function(a){var a,b;b=this;b.X=a.X();b.Y=a.Y();};X.prototype.SetPositionVec=function(a){return this.$val.SetPositionVec(a);};X.ptr.prototype.Position=function(){var a;a=this;return[a.X,a.Y];};X.prototype.Position=function(){return this.$val.Position();};X.ptr.prototype.PointInside=function(a){var a,b;b=this;return a.Sub(new AP([new B([b.X,b.Y])])).Magnitude()<=b.Radius;};X.prototype.PointInside=function(a){return this.$val.PointInside(a);};X.ptr.prototype.IntersectionPointsCircle=function(a){var a,b,c,d,e,f,g;b=this;c=A.Sqrt(A.Pow(a.X-b.X,2)+A.Pow(a.Y-b.Y,2));if(c>b.Radius+a.Radius||c0;};Z.prototype.Overlapping=function(a){return this.$val.Overlapping(a);};Z.ptr.prototype.Overlap=function(a){var a,b;b=this;return A.Min(b.Max,a.Max)-A.Max(b.Min,a.Min);};Z.prototype.Overlap=function(a){return this.$val.Overlap(a);};Z.ptr.prototype.IsInside=function(a){var a,b;b=this;return b.Min>=a.Min&&b.Max<=a.Max;};Z.prototype.IsInside=function(a){return this.$val.IsInside(a);};AB=function(a,b,c,d,e){var a,b,c,d,e,f;f=new AA.ptr($ifaceNil,AM.nil,a,b,c,d,AK.nil,$ifaceNil,$makeMap(AN.keyFor,[]),new AV([]));if(e.$length>0){f.AddTags(e);}return f;};$pkg.NewObject=AB;AA.ptr.prototype.Clone=function(){var{a,b,c,d,e,f,g,h,$s,$r,$c}=$restore(this,{});$s=$s||0;s:while(true){switch($s){case 0:a=this;b=AB(a.X,a.Y,a.W,a.H,a.Tags());b.Data=a.Data;if(!($interfaceIsEqual(a.Shape,$ifaceNil))){$s=1;continue;}$s=2;continue;case 1:c=a.Shape.Clone();$s=3;case 3:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}$r=b.SetShape(c);$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 2:d=a.ignoreList;e=0;f=$keys(d);while(true){if(!(e>0;}h=h+(1)>>0;}}if(!($interfaceIsEqual(a.Shape,$ifaceNil))){$s=1;continue;}$s=2;continue;case 1:$r=a.Shape.SetPosition(a.X,a.Y);$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 2:$s=-1;return;}return;}var $f={$blk:AA.ptr.prototype.Update,$c:true,$r,a,b,c,d,e,f,g,h,i,j,$s};return $f;};AA.prototype.Update=function(){return this.$val.Update();};AA.ptr.prototype.AddTags=function(a){var a,b;b=this;b.tags=$appendSlice(b.tags,a);};AA.prototype.AddTags=function(a){return this.$val.AddTags(a);};AA.ptr.prototype.RemoveTags=function(a){var a,b,c,d,e,f,g,h,i;b=this;c=a;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);f=b.tags;g=0;while(true){if(!(g=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+g]);if(i===e){b.tags=$appendSlice($subslice(b.tags,0,h),$subslice(b.tags,(h+1>>0)));break;}g++;}d++;}};AA.prototype.RemoveTags=function(a){return this.$val.RemoveTags(a);};AA.ptr.prototype.HasTags=function(a){var a,b,c,d,e,f,g,h;b=this;c=a;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);f=b.tags;g=0;while(true){if(!(g=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+g]);if(h===e){return true;}g++;}d++;}return false;};AA.prototype.HasTags=function(a){return this.$val.HasTags(a);};AA.ptr.prototype.Tags=function(){var a;a=this;return $appendSlice(new AV([]),a.tags);};AA.prototype.Tags=function(){return this.$val.Tags();};AA.ptr.prototype.SetShape=function(a){var{a,b,$s,$r,$c}=$restore(this,{a});$s=$s||0;s:while(true){switch($s){case 0:b=this;if(!($interfaceIsEqual(b.Shape,a))){$s=1;continue;}$s=2;continue;case 1:b.Shape=a;$r=b.Update();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 2:$s=-1;return;}return;}var $f={$blk:AA.ptr.prototype.SetShape,$c:true,$r,a,b,$s};return $f;};AA.prototype.SetShape=function(a){return this.$val.SetShape(a);};AA.ptr.prototype.BoundsToSpace=function(a,b){var a,b,c,d,e,f,g,h,i;c=this;d=c.Space.WorldToSpace(c.X+a,c.Y+b);e=d[0];f=d[1];g=c.Space.WorldToSpace(c.X+c.W+a-1,c.Y+c.H+b-1);h=g[0];i=g[1];return[e,f,h,i];};AA.prototype.BoundsToSpace=function(a,b){return this.$val.BoundsToSpace(a,b);};AA.ptr.prototype.SharesCells=function(a){var a,b,c,d,e;b=this;c=b.TouchingCells;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(e.Contains(a)){return true;}d++;}return false;};AA.prototype.SharesCells=function(a){return this.$val.SharesCells(a);};AA.ptr.prototype.SharesCellsTags=function(a){var a,b,c,d,e;b=this;c=b.TouchingCells;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(e.ContainsTags(a)){return true;}d++;}return false;};AA.prototype.SharesCellsTags=function(a){return this.$val.SharesCellsTags(a);};AA.ptr.prototype.Center=function(){var a;a=this;return[a.X+(a.W/2),a.Y+(a.H/2)];};AA.prototype.Center=function(){return this.$val.Center();};AA.ptr.prototype.SetCenter=function(a,b){var a,b,c;c=this;c.X=a-(c.W/2);c.Y=b-(c.H/2);};AA.prototype.SetCenter=function(a,b){return this.$val.SetCenter(a,b);};AA.ptr.prototype.CellPosition=function(){var a,b;a=this;b=a.Center();return a.Space.WorldToSpace(b[0],b[1]);};AA.prototype.CellPosition=function(){return this.$val.CellPosition();};AA.ptr.prototype.SetRight=function(a){var a,b;b=this;b.X=a-b.W;};AA.prototype.SetRight=function(a){return this.$val.SetRight(a);};AA.ptr.prototype.SetBottom=function(a){var a,b;b=this;b.Y=a-b.H;};AA.prototype.SetBottom=function(a){return this.$val.SetBottom(a);};AA.ptr.prototype.Bottom=function(){var a;a=this;return a.Y+a.H;};AA.prototype.Bottom=function(){return this.$val.Bottom();};AA.ptr.prototype.Right=function(){var a;a=this;return a.X+a.W;};AA.prototype.Right=function(){return this.$val.Right();};AA.ptr.prototype.SetBounds=function(a,b){var a,b,c;c=this;c.X=(0>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+0]);c.Y=(1>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+1]);c.W=(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])-c.X;c.H=(1>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+1])-c.Y;};AA.prototype.SetBounds=function(a,b){return this.$val.SetBounds(a,b);};AA.ptr.prototype.Check=function(a,b,c){var a,aa,ab,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;d=this;if(d.Space===AM.nil){return AW.nil;}e=AF();e.checkingObject=d;if(a<0){a=A.Min(a,-1);}else if(a>0){a=A.Max(a,1);}if(b<0){b=A.Min(b,-1);}else if(b>0){b=A.Max(b,1);}e.dx=a;e.dy=b;f=d.BoundsToSpace(a,b);g=f[0];h=f[1];i=f[2];j=f[3];k=$makeMap(AN.keyFor,[]);l=$makeMap(AJ.keyFor,[]);m=h;while(true){if(!(m<=j)){break;}n=g;while(true){if(!(n<=i)){break;}o=d.Space.Cell(n,m);if(!(o===AJ.nil)){p=o.Objects;q=0;while(true){if(!(q=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+q]);t=(s=d.ignoreList[AN.keyFor(r)],s!==undefined?s.v:false);if(r===d||t){q++;continue;}u=(v=k[AN.keyFor(r)],v!==undefined?[v.v,true]:[false,false]);w=u[1];if(((c.$length===0)||r.HasTags(c))&&!w){e.Objects=$append(e.Objects,r);x=r;(k||$throwRuntimeError("assignment to entry in nil map"))[AN.keyFor(x)]={k:x,v:true};y=(z=l[AJ.keyFor(o)],z!==undefined?[z.v,true]:[false,false]);aa=y[1];if(!aa){e.Cells=$append(e.Cells,o);ab=o;(l||$throwRuntimeError("assignment to entry in nil map"))[AJ.keyFor(ab)]={k:ab,v:true};}q++;continue;}q++;}}n=n+(1)>>0;}m=m+(1)>>0;}if(e.Objects.$length===0){return AW.nil;}return e;};AA.prototype.Check=function(a,b,c){return this.$val.Check(a,b,c);};AA.ptr.prototype.Overlaps=function(a){var a,b;b=this;return a.X<=b.X+b.W&&a.X+a.W>=b.X&&a.Y<=b.Y+b.H&&a.Y+a.H>=b.Y;};AA.prototype.Overlaps=function(a){return this.$val.Overlaps(a);};AA.ptr.prototype.AddToIgnoreList=function(a){var a,b,c;b=this;c=a;(b.ignoreList||$throwRuntimeError("assignment to entry in nil map"))[AN.keyFor(c)]={k:c,v:true};};AA.prototype.AddToIgnoreList=function(a){return this.$val.AddToIgnoreList(a);};AA.ptr.prototype.RemoveFromIgnoreList=function(a){var a,b;b=this;delete b.ignoreList[AN.keyFor(a)];};AA.prototype.RemoveFromIgnoreList=function(a){return this.$val.RemoveFromIgnoreList(a);};AC=function(a,b,c,d){var a,b,c,d,e,f,g,h,i;e=d.$length;f=c;g=0;while(true){if(!(g=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+g]);if(h===e){return;}((h<0||h>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+h]=b*i+((h<0||h>=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+h]));g++;}};AD=function(a,b,c){var a,b,c,d,e,f;d=c;e=0;while(true){if(!(e=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]=((f<0||f>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f])*(b));e++;}};AF=function(){return new AE.ptr(AN.nil,0,0,new AO([]),AK.nil);};$pkg.NewCollision=AF;AE.ptr.prototype.HasTags=function(a){var a,b,c,d,e;b=this;c=b.Objects;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(e===b.checkingObject){d++;continue;}if(e.HasTags(a)){return true;}d++;}return false;};AE.prototype.HasTags=function(a){return this.$val.HasTags(a);};AE.ptr.prototype.ObjectsByTags=function(a){var a,b,c,d,e,f;b=this;c=new AO([]);d=b.Objects;e=0;while(true){if(!(e=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+e]);if(f===b.checkingObject){e++;continue;}if(f.HasTags(a)){c=$append(c,f);}e++;}return c;};AE.prototype.ObjectsByTags=function(a){return this.$val.ObjectsByTags(a);};AE.ptr.prototype.ContactWithObject=function(a){var a,b,c;b=this;c=new B([0,0]);if(b.dx<0){(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]=a.X+a.W-b.checkingObject.X);}else if(b.dx>0){(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]=a.X-b.checkingObject.W-b.checkingObject.X);}if(b.dy<0){(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]=a.Y+a.H-b.checkingObject.Y);}else if(b.dy>0){(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]=a.Y-b.checkingObject.H-b.checkingObject.Y);}return c;};AE.prototype.ContactWithObject=function(a){return this.$val.ContactWithObject(a);};AE.ptr.prototype.ContactWithCell=function(a){var a,b,c,d,e;b=this;c=new B([0,0]);d=(($imul(a.X,b.checkingObject.Space.CellWidth)));e=(($imul(a.Y,b.checkingObject.Space.CellHeight)));if(b.dx<0){(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]=d+(b.checkingObject.Space.CellWidth)-b.checkingObject.X);}else if(b.dx>0){(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]=d-b.checkingObject.W-b.checkingObject.X);}if(b.dy<0){(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]=e+(b.checkingObject.Space.CellHeight)-b.checkingObject.Y);}else if(b.dy>0){(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]=e-b.checkingObject.H-b.checkingObject.Y);}return c;};AE.prototype.ContactWithCell=function(a){return this.$val.ContactWithCell(a);};AE.ptr.prototype.SlideAgainstCell=function(a,b){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;c=this;d=c.checkingObject.Space;f=(e=c.Cells,(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0]));g=d.SpaceToWorld(f.X,f.Y);h=g[0];i=g[1];j=(d.CellWidth)/2;k=(d.CellHeight)/2;h=h+(j);i=i+(k);l=c.checkingObject.Center();m=l[0];n=l[1];o=m-h;p=n-i;q=d.Cell(f.X-1>>0,f.Y);r=d.Cell(f.X+1>>0,f.Y);s=d.Cell(f.X,f.Y-1>>0);t=d.Cell(f.X,f.Y+1>>0);u=new B([0,0]);if(!((c.dy===0))){if(o>0&&(r===AJ.nil||!r.ContainsTags(b))){(0>=u.$length?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+0]=h+j-c.checkingObject.X);}else if(o<0&&(q===AJ.nil||!q.ContainsTags(b))){(0>=u.$length?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+0]=h-j-(c.checkingObject.X+c.checkingObject.W));}else{return B.nil;}}if(!((c.dx===0))){if(p>0&&(t===AJ.nil||!t.ContainsTags(b))){(1>=u.$length?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+1]=i+k-c.checkingObject.Y);}else if(p<0&&(s===AJ.nil||!s.ContainsTags(b))){(1>=u.$length?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+1]=i-k-(c.checkingObject.Y+c.checkingObject.H));}else{return B.nil;}}return u;};AE.prototype.SlideAgainstCell=function(a,b){return this.$val.SlideAgainstCell(a,b);};AH=function(a,b){var a,b;return new AG.ptr(a,b,new AO([]));};AG.ptr.prototype.register=function(a){var a,b;b=this;if(!b.Contains(a)){b.Objects=$append(b.Objects,a);}};AG.prototype.register=function(a){return this.$val.register(a);};AG.ptr.prototype.unregister=function(a){var a,b,c,d,e,f,g,h,i;b=this;c=b.Objects;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(f===a){(i=b.Objects,((e<0||e>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+e]=(g=b.Objects,h=b.Objects.$length-1>>0,((h<0||h>=g.$length)?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+h]))));b.Objects=$subslice(b.Objects,0,(b.Objects.$length-1>>0));break;}d++;}};AG.prototype.unregister=function(a){return this.$val.unregister(a);};AG.ptr.prototype.Contains=function(a){var a,b,c,d,e;b=this;c=b.Objects;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(e===a){return true;}d++;}return false;};AG.prototype.Contains=function(a){return this.$val.Contains(a);};AG.ptr.prototype.ContainsTags=function(a){var a,b,c,d,e;b=this;c=b.Objects;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(e.HasTags(a)){return true;}d++;}return false;};AG.prototype.ContainsTags=function(a){return this.$val.ContainsTags(a);};AG.ptr.prototype.Occupied=function(){var a;a=this;return a.Objects.$length>0;};AG.prototype.Occupied=function(){return this.$val.Occupied();};B.methods=[{prop:"Clone",name:"Clone",pkg:"",typ:$funcType([],[B],false)},{prop:"Add",name:"Add",pkg:"",typ:$funcType([AP],[B],true)},{prop:"Sub",name:"Sub",pkg:"",typ:$funcType([AP],[B],true)},{prop:"Scale",name:"Scale",pkg:"",typ:$funcType([$Float64],[B],false)},{prop:"Equal",name:"Equal",pkg:"",typ:$funcType([B],[$Bool],false)},{prop:"Magnitude",name:"Magnitude",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"Magnitude2",name:"Magnitude2",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"Unit",name:"Unit",pkg:"",typ:$funcType([],[B],false)},{prop:"Dot",name:"Dot",pkg:"",typ:$funcType([B],[$Float64],false)},{prop:"Cross",name:"Cross",pkg:"",typ:$funcType([B],[B],false)},{prop:"Rotate",name:"Rotate",pkg:"",typ:$funcType([$Float64,AX],[B],true)},{prop:"X",name:"X",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"Y",name:"Y",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"Z",name:"Z",pkg:"",typ:$funcType([],[$Float64],false)}];AM.methods=[{prop:"Add",name:"Add",pkg:"",typ:$funcType([AO],[],true)},{prop:"Remove",name:"Remove",pkg:"",typ:$funcType([AO],[],true)},{prop:"Objects",name:"Objects",pkg:"",typ:$funcType([],[AO],false)},{prop:"Resize",name:"Resize",pkg:"",typ:$funcType([$Int,$Int],[],false)},{prop:"Cell",name:"Cell",pkg:"",typ:$funcType([$Int,$Int],[AJ],false)},{prop:"CheckCells",name:"CheckCells",pkg:"",typ:$funcType([$Int,$Int,$Int,$Int,AV],[AN],true)},{prop:"CheckCellsWorld",name:"CheckCellsWorld",pkg:"",typ:$funcType([$Float64,$Float64,$Float64,$Float64,AV],[AN],true)},{prop:"UnregisterAllObjects",name:"UnregisterAllObjects",pkg:"",typ:$funcType([],[],false)},{prop:"WorldToSpace",name:"WorldToSpace",pkg:"",typ:$funcType([$Float64,$Float64],[$Int,$Int],false)},{prop:"SpaceToWorld",name:"SpaceToWorld",pkg:"",typ:$funcType([$Int,$Int],[$Float64,$Float64],false)},{prop:"Height",name:"Height",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Width",name:"Width",pkg:"",typ:$funcType([],[$Int],false)},{prop:"CellsInLine",name:"CellsInLine",pkg:"",typ:$funcType([$Int,$Int,$Int,$Int],[AK],false)}];AQ.methods=[{prop:"Project",name:"Project",pkg:"",typ:$funcType([B],[B],false)},{prop:"Normal",name:"Normal",pkg:"",typ:$funcType([],[B],false)},{prop:"Vector",name:"Vector",pkg:"",typ:$funcType([],[B],false)},{prop:"IntersectionPointsLine",name:"IntersectionPointsLine",pkg:"",typ:$funcType([AQ],[B],false)},{prop:"IntersectionPointsCircle",name:"IntersectionPointsCircle",pkg:"",typ:$funcType([AS],[AP],false)}];AT.methods=[{prop:"Clone",name:"Clone",pkg:"",typ:$funcType([],[P],false)},{prop:"AddPointsVec",name:"AddPointsVec",pkg:"",typ:$funcType([AP],[],true)},{prop:"AddPoints",name:"AddPoints",pkg:"",typ:$funcType([AI],[],true)},{prop:"Lines",name:"Lines",pkg:"",typ:$funcType([],[AR],false)},{prop:"Transformed",name:"Transformed",pkg:"",typ:$funcType([],[AP],false)},{prop:"Bounds",name:"Bounds",pkg:"",typ:$funcType([],[B,B],false)},{prop:"Position",name:"Position",pkg:"",typ:$funcType([],[$Float64,$Float64],false)},{prop:"SetPosition",name:"SetPosition",pkg:"",typ:$funcType([$Float64,$Float64],[],false)},{prop:"SetPositionVec",name:"SetPositionVec",pkg:"",typ:$funcType([B],[],false)},{prop:"Move",name:"Move",pkg:"",typ:$funcType([$Float64,$Float64],[],false)},{prop:"MoveVec",name:"MoveVec",pkg:"",typ:$funcType([B],[],false)},{prop:"Center",name:"Center",pkg:"",typ:$funcType([],[B],false)},{prop:"Project",name:"Project",pkg:"",typ:$funcType([B],[Z],false)},{prop:"SATAxes",name:"SATAxes",pkg:"",typ:$funcType([],[AP],false)},{prop:"PointInside",name:"PointInside",pkg:"",typ:$funcType([B],[$Bool],false)},{prop:"Intersection",name:"Intersection",pkg:"",typ:$funcType([$Float64,$Float64,P],[AU],false)},{prop:"calculateMTV",name:"calculateMTV",pkg:"resolv",typ:$funcType([AU,P],[B],false)},{prop:"ContainedBy",name:"ContainedBy",pkg:"",typ:$funcType([P],[$Bool],false)},{prop:"FlipH",name:"FlipH",pkg:"",typ:$funcType([],[],false)},{prop:"FlipV",name:"FlipV",pkg:"",typ:$funcType([],[],false)},{prop:"ReverseVertexOrder",name:"ReverseVertexOrder",pkg:"",typ:$funcType([],[],false)}];AU.methods=[{prop:"LeftmostPoint",name:"LeftmostPoint",pkg:"",typ:$funcType([],[B],false)},{prop:"RightmostPoint",name:"RightmostPoint",pkg:"",typ:$funcType([],[B],false)},{prop:"TopmostPoint",name:"TopmostPoint",pkg:"",typ:$funcType([],[B],false)},{prop:"BottommostPoint",name:"BottommostPoint",pkg:"",typ:$funcType([],[B],false)}];AS.methods=[{prop:"Clone",name:"Clone",pkg:"",typ:$funcType([],[P],false)},{prop:"Bounds",name:"Bounds",pkg:"",typ:$funcType([],[B,B],false)},{prop:"Intersection",name:"Intersection",pkg:"",typ:$funcType([$Float64,$Float64,P],[AU],false)},{prop:"Move",name:"Move",pkg:"",typ:$funcType([$Float64,$Float64],[],false)},{prop:"MoveVec",name:"MoveVec",pkg:"",typ:$funcType([B],[],false)},{prop:"SetPosition",name:"SetPosition",pkg:"",typ:$funcType([$Float64,$Float64],[],false)},{prop:"SetPositionVec",name:"SetPositionVec",pkg:"",typ:$funcType([B],[],false)},{prop:"Position",name:"Position",pkg:"",typ:$funcType([],[$Float64,$Float64],false)},{prop:"PointInside",name:"PointInside",pkg:"",typ:$funcType([B],[$Bool],false)},{prop:"IntersectionPointsCircle",name:"IntersectionPointsCircle",pkg:"",typ:$funcType([AS],[AP],false)}];Z.methods=[{prop:"Overlapping",name:"Overlapping",pkg:"",typ:$funcType([Z],[$Bool],false)},{prop:"Overlap",name:"Overlap",pkg:"",typ:$funcType([Z],[$Float64],false)},{prop:"IsInside",name:"IsInside",pkg:"",typ:$funcType([Z],[$Bool],false)}];AN.methods=[{prop:"Clone",name:"Clone",pkg:"",typ:$funcType([],[AN],false)},{prop:"Update",name:"Update",pkg:"",typ:$funcType([],[],false)},{prop:"AddTags",name:"AddTags",pkg:"",typ:$funcType([AV],[],true)},{prop:"RemoveTags",name:"RemoveTags",pkg:"",typ:$funcType([AV],[],true)},{prop:"HasTags",name:"HasTags",pkg:"",typ:$funcType([AV],[$Bool],true)},{prop:"Tags",name:"Tags",pkg:"",typ:$funcType([],[AV],false)},{prop:"SetShape",name:"SetShape",pkg:"",typ:$funcType([P],[],false)},{prop:"BoundsToSpace",name:"BoundsToSpace",pkg:"",typ:$funcType([$Float64,$Float64],[$Int,$Int,$Int,$Int],false)},{prop:"SharesCells",name:"SharesCells",pkg:"",typ:$funcType([AN],[$Bool],false)},{prop:"SharesCellsTags",name:"SharesCellsTags",pkg:"",typ:$funcType([AV],[$Bool],true)},{prop:"Center",name:"Center",pkg:"",typ:$funcType([],[$Float64,$Float64],false)},{prop:"SetCenter",name:"SetCenter",pkg:"",typ:$funcType([$Float64,$Float64],[],false)},{prop:"CellPosition",name:"CellPosition",pkg:"",typ:$funcType([],[$Int,$Int],false)},{prop:"SetRight",name:"SetRight",pkg:"",typ:$funcType([$Float64],[],false)},{prop:"SetBottom",name:"SetBottom",pkg:"",typ:$funcType([$Float64],[],false)},{prop:"Bottom",name:"Bottom",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"Right",name:"Right",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"SetBounds",name:"SetBounds",pkg:"",typ:$funcType([B,B],[],false)},{prop:"Check",name:"Check",pkg:"",typ:$funcType([$Float64,$Float64,AV],[AW],true)},{prop:"Overlaps",name:"Overlaps",pkg:"",typ:$funcType([AN],[$Bool],false)},{prop:"AddToIgnoreList",name:"AddToIgnoreList",pkg:"",typ:$funcType([AN],[],false)},{prop:"RemoveFromIgnoreList",name:"RemoveFromIgnoreList",pkg:"",typ:$funcType([AN],[],false)}];AW.methods=[{prop:"HasTags",name:"HasTags",pkg:"",typ:$funcType([AV],[$Bool],true)},{prop:"ObjectsByTags",name:"ObjectsByTags",pkg:"",typ:$funcType([AV],[AO],true)},{prop:"ContactWithObject",name:"ContactWithObject",pkg:"",typ:$funcType([AN],[B],false)},{prop:"ContactWithCell",name:"ContactWithCell",pkg:"",typ:$funcType([AJ],[B],false)},{prop:"SlideAgainstCell",name:"SlideAgainstCell",pkg:"",typ:$funcType([AJ,AV],[B],true)}];AJ.methods=[{prop:"register",name:"register",pkg:"resolv",typ:$funcType([AN],[],false)},{prop:"unregister",name:"unregister",pkg:"resolv",typ:$funcType([AN],[],false)},{prop:"Contains",name:"Contains",pkg:"",typ:$funcType([AN],[$Bool],false)},{prop:"ContainsTags",name:"ContainsTags",pkg:"",typ:$funcType([AV],[$Bool],true)},{prop:"Occupied",name:"Occupied",pkg:"",typ:$funcType([],[$Bool],false)}];B.init($Float64);N.init("",[{prop:"Cells",name:"Cells",embedded:false,exported:true,typ:AL,tag:""},{prop:"CellWidth",name:"CellWidth",embedded:false,exported:true,typ:$Int,tag:""},{prop:"CellHeight",name:"CellHeight",embedded:false,exported:true,typ:$Int,tag:""}]);P.init([{prop:"Bounds",name:"Bounds",pkg:"",typ:$funcType([],[B,B],false)},{prop:"Clone",name:"Clone",pkg:"",typ:$funcType([],[P],false)},{prop:"Intersection",name:"Intersection",pkg:"",typ:$funcType([$Float64,$Float64,P],[AU],false)},{prop:"Position",name:"Position",pkg:"",typ:$funcType([],[$Float64,$Float64],false)},{prop:"SetPosition",name:"SetPosition",pkg:"",typ:$funcType([$Float64,$Float64],[],false)}]);Q.init("",[{prop:"Start",name:"Start",embedded:false,exported:true,typ:B,tag:""},{prop:"End",name:"End",embedded:false,exported:true,typ:B,tag:""}]);S.init("",[{prop:"Points",name:"Points",embedded:false,exported:true,typ:AP,tag:""},{prop:"X",name:"X",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Y",name:"Y",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Closed",name:"Closed",embedded:false,exported:true,typ:$Bool,tag:""}]);U.init("",[{prop:"Points",name:"Points",embedded:false,exported:true,typ:AP,tag:""},{prop:"MTV",name:"MTV",embedded:false,exported:true,typ:B,tag:""},{prop:"Center",name:"Center",embedded:false,exported:true,typ:B,tag:""}]);X.init("",[{prop:"X",name:"X",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Y",name:"Y",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Radius",name:"Radius",embedded:false,exported:true,typ:$Float64,tag:""}]);Z.init("",[{prop:"Min",name:"Min",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Max",name:"Max",embedded:false,exported:true,typ:$Float64,tag:""}]);AA.init("resolv",[{prop:"Shape",name:"Shape",embedded:false,exported:true,typ:P,tag:""},{prop:"Space",name:"Space",embedded:false,exported:true,typ:AM,tag:""},{prop:"X",name:"X",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Y",name:"Y",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"W",name:"W",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"H",name:"H",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"TouchingCells",name:"TouchingCells",embedded:false,exported:true,typ:AK,tag:""},{prop:"Data",name:"Data",embedded:false,exported:true,typ:$emptyInterface,tag:""},{prop:"ignoreList",name:"ignoreList",embedded:false,exported:false,typ:AY,tag:""},{prop:"tags",name:"tags",embedded:false,exported:false,typ:AV,tag:""}]);AE.init("resolv",[{prop:"checkingObject",name:"checkingObject",embedded:false,exported:false,typ:AN,tag:""},{prop:"dx",name:"dx",embedded:false,exported:false,typ:$Float64,tag:""},{prop:"dy",name:"dy",embedded:false,exported:false,typ:$Float64,tag:""},{prop:"Objects",name:"Objects",embedded:false,exported:true,typ:AO,tag:""},{prop:"Cells",name:"Cells",embedded:false,exported:true,typ:AK,tag:""}]);AG.init("",[{prop:"X",name:"X",embedded:false,exported:true,typ:$Int,tag:""},{prop:"Y",name:"Y",embedded:false,exported:true,typ:$Int,tag:""},{prop:"Objects",name:"Objects",embedded:false,exported:true,typ:AO,tag:""}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); -$packages["jsexport/battle"]=(function(){var $pkg={},$init,A,B,C,D,E,F,H,I,J,K,L,M,N,O,P,Q,S,T,AH,BE,BF,BG,BH,BI,BJ,BK,BL,BM,BN,BO,BP,BQ,BR,BS,BT,BU,BV,BW,BX,BY,BZ,CA,CB,CC,CD,CE,CF,CG,CH,U,V,W,X,Y,R,Z,AB,AC,AD,AE,AF,AG,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR,AS,AT,AV,AW,AX,AY,AZ,BA,BB,BC,BD;A=$packages["math"];B=$packages["resolv"];C=$pkg.Vec2D=$newType(0,$kindStruct,"battle.Vec2D",true,"jsexport/battle",true,function(X_,Y_){this.$val=this;if(arguments.length===0){this.X=0;this.Y=0;return;}this.X=X_;this.Y=Y_;});D=$pkg.Polygon2D=$newType(0,$kindStruct,"battle.Polygon2D",true,"jsexport/battle",true,function(Anchor_,Points_){this.$val=this;if(arguments.length===0){this.Anchor=CD.nil;this.Points=CE.nil;return;}this.Anchor=Anchor_;this.Points=Points_;});E=$pkg.PlayerDownsync=$newType(0,$kindStruct,"battle.PlayerDownsync",true,"jsexport/battle",true,function(Id_,VirtualGridX_,VirtualGridY_,DirX_,DirY_,VelX_,VelY_,Speed_,BattleState_,JoinIndex_,ColliderRadius_,Removed_,Score_,LastMoveGmtMillis_,FramesToRecover_,FramesInChState_,Hp_,MaxHp_,CharacterState_,InAir_,OnWall_,OnWallNormX_,OnWallNormY_,ActiveSkillId_,ActiveSkillHit_,FramesInvinsible_,BulletTeamId_,ChCollisionTeamId_){this.$val=this;if(arguments.length===0){this.Id=0;this.VirtualGridX=0;this.VirtualGridY=0;this.DirX=0;this.DirY=0;this.VelX=0;this.VelY=0;this.Speed=0;this.BattleState=0;this.JoinIndex=0;this.ColliderRadius=0;this.Removed=false;this.Score=0;this.LastMoveGmtMillis=0;this.FramesToRecover=0;this.FramesInChState=0;this.Hp=0;this.MaxHp=0;this.CharacterState=0;this.InAir=false;this.OnWall=false;this.OnWallNormX=0;this.OnWallNormY=0;this.ActiveSkillId=0;this.ActiveSkillHit=0;this.FramesInvinsible=0;this.BulletTeamId=0;this.ChCollisionTeamId=0;return;}this.Id=Id_;this.VirtualGridX=VirtualGridX_;this.VirtualGridY=VirtualGridY_;this.DirX=DirX_;this.DirY=DirY_;this.VelX=VelX_;this.VelY=VelY_;this.Speed=Speed_;this.BattleState=BattleState_;this.JoinIndex=JoinIndex_;this.ColliderRadius=ColliderRadius_;this.Removed=Removed_;this.Score=Score_;this.LastMoveGmtMillis=LastMoveGmtMillis_;this.FramesToRecover=FramesToRecover_;this.FramesInChState=FramesInChState_;this.Hp=Hp_;this.MaxHp=MaxHp_;this.CharacterState=CharacterState_;this.InAir=InAir_;this.OnWall=OnWall_;this.OnWallNormX=OnWallNormX_;this.OnWallNormY=OnWallNormY_;this.ActiveSkillId=ActiveSkillId_;this.ActiveSkillHit=ActiveSkillHit_;this.FramesInvinsible=FramesInvinsible_;this.BulletTeamId=BulletTeamId_;this.ChCollisionTeamId=ChCollisionTeamId_;});F=$pkg.InputFrameDecoded=$newType(0,$kindStruct,"battle.InputFrameDecoded",true,"jsexport/battle",true,function(Dx_,Dy_,BtnALevel_,BtnBLevel_){this.$val=this;if(arguments.length===0){this.Dx=0;this.Dy=0;this.BtnALevel=0;this.BtnBLevel=0;return;}this.Dx=Dx_;this.Dy=Dy_;this.BtnALevel=BtnALevel_;this.BtnBLevel=BtnBLevel_;});H=$pkg.Barrier=$newType(0,$kindStruct,"battle.Barrier",true,"jsexport/battle",true,function(Boundary_){this.$val=this;if(arguments.length===0){this.Boundary=CF.nil;return;}this.Boundary=Boundary_;});I=$pkg.BulletConfig=$newType(0,$kindStruct,"battle.BulletConfig",true,"jsexport/battle",true,function(StartupFrames_,CancellableStFrame_,CancellableEdFrame_,ActiveFrames_,HitStunFrames_,BlockStunFrames_,PushbackVelX_,PushbackVelY_,Damage_,SelfLockVelX_,SelfLockVelY_,HitboxOffsetX_,HitboxOffsetY_,HitboxSizeX_,HitboxSizeY_,BlowUp_,ExplosionFrames_,SpeciesId_,CancelTransit_){this.$val=this;if(arguments.length===0){this.StartupFrames=0;this.CancellableStFrame=0;this.CancellableEdFrame=0;this.ActiveFrames=0;this.HitStunFrames=0;this.BlockStunFrames=0;this.PushbackVelX=0;this.PushbackVelY=0;this.Damage=0;this.SelfLockVelX=0;this.SelfLockVelY=0;this.HitboxOffsetX=0;this.HitboxOffsetY=0;this.HitboxSizeX=0;this.HitboxSizeY=0;this.BlowUp=false;this.ExplosionFrames=0;this.SpeciesId=0;this.CancelTransit=false;return;}this.StartupFrames=StartupFrames_;this.CancellableStFrame=CancellableStFrame_;this.CancellableEdFrame=CancellableEdFrame_;this.ActiveFrames=ActiveFrames_;this.HitStunFrames=HitStunFrames_;this.BlockStunFrames=BlockStunFrames_;this.PushbackVelX=PushbackVelX_;this.PushbackVelY=PushbackVelY_;this.Damage=Damage_;this.SelfLockVelX=SelfLockVelX_;this.SelfLockVelY=SelfLockVelY_;this.HitboxOffsetX=HitboxOffsetX_;this.HitboxOffsetY=HitboxOffsetY_;this.HitboxSizeX=HitboxSizeX_;this.HitboxSizeY=HitboxSizeY_;this.BlowUp=BlowUp_;this.ExplosionFrames=ExplosionFrames_;this.SpeciesId=SpeciesId_;this.CancelTransit=CancelTransit_;});J=$pkg.BulletBattleAttr=$newType(0,$kindStruct,"battle.BulletBattleAttr",true,"jsexport/battle",true,function(BulletLocalId_,OriginatedRenderFrameId_,OffenderJoinIndex_,TeamId_){this.$val=this;if(arguments.length===0){this.BulletLocalId=0;this.OriginatedRenderFrameId=0;this.OffenderJoinIndex=0;this.TeamId=0;return;}this.BulletLocalId=BulletLocalId_;this.OriginatedRenderFrameId=OriginatedRenderFrameId_;this.OffenderJoinIndex=OffenderJoinIndex_;this.TeamId=TeamId_;});K=$pkg.MeleeBullet=$newType(0,$kindStruct,"battle.MeleeBullet",true,"jsexport/battle",true,function(BlState_,FramesInBlState_,BattleAttr_,Bullet_){this.$val=this;if(arguments.length===0){this.BlState=0;this.FramesInBlState=0;this.BattleAttr=BH.nil;this.Bullet=BI.nil;return;}this.BlState=BlState_;this.FramesInBlState=FramesInBlState_;this.BattleAttr=BattleAttr_;this.Bullet=Bullet_;});L=$pkg.FireballBullet=$newType(0,$kindStruct,"battle.FireballBullet",true,"jsexport/battle",true,function(VirtualGridX_,VirtualGridY_,DirX_,DirY_,VelX_,VelY_,Speed_,BlState_,FramesInBlState_,BattleAttr_,Bullet_){this.$val=this;if(arguments.length===0){this.VirtualGridX=0;this.VirtualGridY=0;this.DirX=0;this.DirY=0;this.VelX=0;this.VelY=0;this.Speed=0;this.BlState=0;this.FramesInBlState=0;this.BattleAttr=BH.nil;this.Bullet=BI.nil;return;}this.VirtualGridX=VirtualGridX_;this.VirtualGridY=VirtualGridY_;this.DirX=DirX_;this.DirY=DirY_;this.VelX=VelX_;this.VelY=VelY_;this.Speed=Speed_;this.BlState=BlState_;this.FramesInBlState=FramesInBlState_;this.BattleAttr=BattleAttr_;this.Bullet=Bullet_;});M=$pkg.Skill=$newType(0,$kindStruct,"battle.Skill",true,"jsexport/battle",true,function(BattleLocalId_,RecoveryFrames_,RecoveryFramesOnBlock_,RecoveryFramesOnHit_,ReleaseTriggerType_,BoundChState_,Hits_){this.$val=this;if(arguments.length===0){this.BattleLocalId=0;this.RecoveryFrames=0;this.RecoveryFramesOnBlock=0;this.RecoveryFramesOnHit=0;this.ReleaseTriggerType=0;this.BoundChState=0;this.Hits=BG.nil;return;}this.BattleLocalId=BattleLocalId_;this.RecoveryFrames=RecoveryFrames_;this.RecoveryFramesOnBlock=RecoveryFramesOnBlock_;this.RecoveryFramesOnHit=RecoveryFramesOnHit_;this.ReleaseTriggerType=ReleaseTriggerType_;this.BoundChState=BoundChState_;this.Hits=Hits_;});N=$pkg.RoomDownsyncFrame=$newType(0,$kindStruct,"battle.RoomDownsyncFrame",true,"jsexport/battle",true,function(Id_,PlayersArr_,CountdownNanos_,MeleeBullets_,FireballBullets_,BackendUnconfirmedMask_,ShouldForceResync_,BulletLocalIdCounter_){this.$val=this;if(arguments.length===0){this.Id=0;this.PlayersArr=BV.nil;this.CountdownNanos=new $Int64(0,0);this.MeleeBullets=BW.nil;this.FireballBullets=BX.nil;this.BackendUnconfirmedMask=new $Uint64(0,0);this.ShouldForceResync=false;this.BulletLocalIdCounter=0;return;}this.Id=Id_;this.PlayersArr=PlayersArr_;this.CountdownNanos=CountdownNanos_;this.MeleeBullets=MeleeBullets_;this.FireballBullets=FireballBullets_;this.BackendUnconfirmedMask=BackendUnconfirmedMask_;this.ShouldForceResync=ShouldForceResync_;this.BulletLocalIdCounter=BulletLocalIdCounter_;});O=$pkg.InputFrameDownsync=$newType(0,$kindStruct,"battle.InputFrameDownsync",true,"jsexport/battle",true,function(InputFrameId_,InputList_,ConfirmedList_){this.$val=this;if(arguments.length===0){this.InputFrameId=0;this.InputList=BU.nil;this.ConfirmedList=new $Uint64(0,0);return;}this.InputFrameId=InputFrameId_;this.InputList=InputList_;this.ConfirmedList=ConfirmedList_;});P=$pkg.NpcPatrolCue=$newType(0,$kindStruct,"battle.NpcPatrolCue",true,"jsexport/battle",true,function(FlAct_,FrAct_,X_,Y_){this.$val=this;if(arguments.length===0){this.FlAct=new $Uint64(0,0);this.FrAct=new $Uint64(0,0);this.X=0;this.Y=0;return;}this.FlAct=FlAct_;this.FrAct=FrAct_;this.X=X_;this.Y=Y_;});Q=$pkg.RingBuffer=$newType(0,$kindStruct,"battle.RingBuffer",true,"jsexport/battle",true,function(Ed_,St_,EdFrameId_,StFrameId_,N_,Cnt_,Eles_){this.$val=this;if(arguments.length===0){this.Ed=0;this.St=0;this.EdFrameId=0;this.StFrameId=0;this.N=0;this.Cnt=0;this.Eles=BG.nil;return;}this.Ed=Ed_;this.St=St_;this.EdFrameId=EdFrameId_;this.StFrameId=StFrameId_;this.N=N_;this.Cnt=Cnt_;this.Eles=Eles_;});S=$pkg.SkillMapperType=$newType(4,$kindFunc,"battle.SkillMapperType",true,"jsexport/battle",true,null);T=$pkg.CharacterConfig=$newType(0,$kindStruct,"battle.CharacterConfig",true,"jsexport/battle",true,function(SpeciesId_,SpeciesName_,InAirIdleFrameIdxTurningPoint_,InAirIdleFrameIdxTurnedCycle_,LayDownFrames_,LayDownFramesToRecover_,GetUpInvinsibleFrames_,GetUpFramesToRecover_,Speed_,JumpingInitVelY_,DashingEnabled_,OnWallEnabled_,WallJumpingFramesToRecover_,WallJumpingInitVelX_,WallJumpingInitVelY_,WallSlidingVelY_,SkillMapper_){this.$val=this;if(arguments.length===0){this.SpeciesId=0;this.SpeciesName="";this.InAirIdleFrameIdxTurningPoint=0;this.InAirIdleFrameIdxTurnedCycle=0;this.LayDownFrames=0;this.LayDownFramesToRecover=0;this.GetUpInvinsibleFrames=0;this.GetUpFramesToRecover=0;this.Speed=0;this.JumpingInitVelY=0;this.DashingEnabled=false;this.OnWallEnabled=false;this.WallJumpingFramesToRecover=0;this.WallJumpingInitVelX=0;this.WallJumpingInitVelY=0;this.WallSlidingVelY=0;this.SkillMapper=$throwNilPointerError;return;}this.SpeciesId=SpeciesId_;this.SpeciesName=SpeciesName_;this.InAirIdleFrameIdxTurningPoint=InAirIdleFrameIdxTurningPoint_;this.InAirIdleFrameIdxTurnedCycle=InAirIdleFrameIdxTurnedCycle_;this.LayDownFrames=LayDownFrames_;this.LayDownFramesToRecover=LayDownFramesToRecover_;this.GetUpInvinsibleFrames=GetUpInvinsibleFrames_;this.GetUpFramesToRecover=GetUpFramesToRecover_;this.Speed=Speed_;this.JumpingInitVelY=JumpingInitVelY_;this.DashingEnabled=DashingEnabled_;this.OnWallEnabled=OnWallEnabled_;this.WallJumpingFramesToRecover=WallJumpingFramesToRecover_;this.WallJumpingInitVelX=WallJumpingInitVelX_;this.WallJumpingInitVelY=WallJumpingInitVelY_;this.WallSlidingVelY=WallSlidingVelY_;this.SkillMapper=SkillMapper_;});AH=$pkg.SatResult=$newType(0,$kindStruct,"battle.SatResult",true,"jsexport/battle",true,function(Overlap_,OverlapX_,OverlapY_,AContainedInB_,BContainedInA_,Axis_){this.$val=this;if(arguments.length===0){this.Overlap=0;this.OverlapX=0;this.OverlapY=0;this.AContainedInB=false;this.BContainedInA=false;this.Axis=B.Vector.nil;return;}this.Overlap=Overlap_;this.OverlapX=OverlapX_;this.OverlapY=OverlapY_;this.AContainedInB=AContainedInB_;this.BContainedInA=BContainedInA_;this.Axis=Axis_;});BE=$sliceType($Int32);BF=$sliceType(BE);BG=$sliceType($emptyInterface);BH=$ptrType(J);BI=$ptrType(I);BJ=$ptrType(M);BK=$ptrType(K);BL=$ptrType(AH);BM=$sliceType(C);BN=$sliceType($String);BO=$ptrType(B.Collision);BP=$ptrType(BM);BQ=$ptrType(E);BR=$ptrType(L);BS=$ptrType(B.ConvexPolygon);BT=$ptrType(O);BU=$sliceType($Uint64);BV=$sliceType(BQ);BW=$sliceType(BK);BX=$sliceType(BR);BY=$sliceType(BP);BZ=$sliceType($Bool);CA=$ptrType(B.Object);CB=$sliceType(CA);CC=$sliceType($Float64);CD=$ptrType(C);CE=$sliceType(CD);CF=$ptrType(D);CG=$mapType($Int,$Int);CH=$ptrType(Q);R=function(a){var a;return new Q.ptr(0,0,0,0,a,0,$makeSlice(BG,a));};$pkg.NewRingBuffer=R;Q.ptr.prototype.Put=function(a){var a,b,c,d;b=this;while(true){if(!(0=b.N)){break;}b.Pop();}(c=b.Eles,d=b.Ed,((d<0||d>=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]=a));b.EdFrameId=b.EdFrameId+(1)>>0;b.Cnt=b.Cnt+(1)>>0;b.Ed=b.Ed+(1)>>0;if(b.Ed>=b.N){b.Ed=b.Ed-(b.N)>>0;}};Q.prototype.Put=function(a){return this.$val.Put(a);};Q.ptr.prototype.Pop=function(){var a,b,c,d;a=this;if(0===a.Cnt){return $ifaceNil;}d=(b=a.Eles,c=a.St,((c<0||c>=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+c]));a.StFrameId=a.StFrameId+(1)>>0;a.Cnt=a.Cnt-(1)>>0;a.St=a.St+(1)>>0;if(a.St>=a.N){a.St=a.St-(a.N)>>0;}return d;};Q.prototype.Pop=function(){return this.$val.Pop();};Q.ptr.prototype.GetArrIdxByOffset=function(a){var a,b,c;b=this;if((0===b.Cnt)||0>a){return-1;}c=b.St+a>>0;if(b.St=b.N){c=c-(b.N)>>0;}if(c>=b.St||c=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+c]));};Q.prototype.GetByOffset=function(a){return this.$val.GetByOffset(a);};Q.ptr.prototype.GetByFrameId=function(a){var a,b;b=this;if(a>=b.EdFrameId||a>0);};Q.prototype.GetByFrameId=function(a){return this.$val.GetByFrameId(a);};Q.ptr.prototype.SetByFrameId=function(a,b){var a,b,c,d,e,f,g,h,i,j,k,l,m,n;c=this;d=c.StFrameId;e=c.EdFrameId;f=d;g=e;if(bb){h=c.GetArrIdxByOffset(b-c.StFrameId>>0);if(!((-1===h))){(i=c.Eles,((h<0||h>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+h]=a));return[0,f,g];}}j=0;if(g>0))>>2>>0);};$pkg.ConvertToDelayedInputFrameId=AC;AD=function(a){var a;return(a>>2>>0);};$pkg.ConvertToNoDelayInputFrameId=AD;AE=function(a){var a;return(((a<<2>>0))+4>>0);};$pkg.ConvertToFirstUsedRenderFrameId=AE;AF=function(a){var a;return(((((a<<2>>0))+4>>0)+4>>0)-1>>0);};$pkg.ConvertToLastUsedRenderFrameId=AF;AG=function(a){var a,b,c,d,e,f,g,h;b=new $Uint64(a.$high&0,(a.$low&15)>>>0);d=(((c=$shiftRightUint64(a,4),new $Uint64(c.$high&0,(c.$low&1)>>>0)).$low>>0));f=(((e=$shiftRightUint64(a,5),new $Uint64(e.$high&0,(e.$low&1)>>>0)).$low>>0));return new F.ptr((g=(($flatten64(b)<0||$flatten64(b)>=$pkg.DIRECTION_DECODER.$length)?($throwRuntimeError("index out of range"),undefined):$pkg.DIRECTION_DECODER.$array[$pkg.DIRECTION_DECODER.$offset+$flatten64(b)]),(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0])),(h=(($flatten64(b)<0||$flatten64(b)>=$pkg.DIRECTION_DECODER.$length)?($throwRuntimeError("index out of range"),undefined):$pkg.DIRECTION_DECODER.$array[$pkg.DIRECTION_DECODER.$offset+$flatten64(b)]),(1>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+1])),d,f);};AI=function(a,b,c,d){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,$s,$deferred,$r,$c}=$restore(this,{a,b,c,d});$s=$s||0;var $err=null;try{s:while(true){switch($s){case 0:$deferred=[];$curGoroutine.deferStack.push($deferred);c=[c];e=[e];f=[f];g=c[0].Position();e[0]=g[0];f[0]=g[1];$deferred.push([(function(c,e,f){return function(){c[0].SetPosition(e[0],f[0]);};})(c,e,f),[]]);c[0].SetPosition(e[0]+a,f[0]+b);h=new AH.ptr(0,0,0,true,true,new B.Vector([0,0]));i=AJ(c[0],d,h);if(i){$s=1;continue;}$s=2;continue;case 1:j=h.Overlap*h.OverlapX;k=h.Overlap*h.OverlapY;l=j;m=k;n=[true,l,m,h];$s=4;case 4:return n;case 2:o=[false,0,0,h];$s=5;case 5:return o;case 3:$s=-1;return[false,0,0,BL.nil];}return;}}catch(err){$err=err;$s=-1;return[false,0,0,BL.nil];}finally{$callDeferred($deferred,$err);if($curGoroutine.asleep){var $f={$blk:AI,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,$s,$deferred};return $f;}}};AJ=function(a,b,c){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;d=a.Points.$length;e=b.Points.$length;f=d;g=e;if((1===f)&&(1===g)){if(!(BL.nil===c)){c.Overlap=0;}return((h=(i=a.Points,(0>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+0])),(0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0]))===(j=(k=b.Points,(0>=k.$length?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+0])),(0>=j.$length?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+0])))&&((l=(m=a.Points,(0>=m.$length?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+0])),(1>=l.$length?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+1]))===(n=(o=b.Points,(0>=o.$length?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+0])),(1>=n.$length?($throwRuntimeError("index out of range"),undefined):n.$array[n.$offset+1])));}if(1=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+q]);if(AO(a,b,r.Unit(),c)){return false;}q++;}}if(1=s.$length)?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+t]);if(AO(a,b,u.Unit(),c)){return false;}t++;}}return true;};AK=function(a,b){var a,b;if(2===a.BlState){return false;}return((a.BattleAttr.OriginatedRenderFrameId+a.Bullet.StartupFrames>>0)<=b.Id)&&(((a.BattleAttr.OriginatedRenderFrameId+a.Bullet.StartupFrames>>0)+a.Bullet.ActiveFrames>>0)>b.Id);};$pkg.IsMeleeBulletActive=AK;AL=function(a,b){var a,b;if(2===a.BlState){return a.FramesInBlState>0)+a.Bullet.ActiveFrames>>0)>b.Id;};$pkg.IsMeleeBulletAlive=AL;AM=function(a,b){var a,b;if(2===a.BlState){return false;}return((a.BattleAttr.OriginatedRenderFrameId+a.Bullet.StartupFrames>>0)>0)+a.Bullet.ActiveFrames>>0)>b.Id);};$pkg.IsFireballBulletActive=AM;AN=function(a,b){var a,b;if(2===a.BlState){return a.FramesInBlState>0)+a.Bullet.ActiveFrames>>0)>b.Id;};$pkg.IsFireballBulletAlive=AN;AO=function(a,b,c,d){var a,aa,ab,ac,ad,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;e=1.7e+308;f=-1.7e+308;g=1.7e+308;h=-1.7e+308;i=e;j=f;k=g;l=h;m=a.Points;n=0;while(true){if(!(n=m.$length)?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+n]);p=((0>=o.$length?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+0])+a.X)*(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0])+((1>=o.$length?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+1])+a.Y)*(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]);if(i>p){i=p;}if(j=q.$length)?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+r]);t=((0>=s.$length?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+0])+b.X)*(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0])+((1>=s.$length?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+1])+b.Y)*(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]);if(k>t){k=t;}if(ll||jl){u=i-l;d.AContainedInB=false;}else{x=j-k;y=l-i;if(x=ab.$length?($throwRuntimeError("index out of range"),undefined):ab.$array[ab.$offset+0])))&&(0===(ac=d.Axis,(1>=ac.$length?($throwRuntimeError("index out of range"),undefined):ac.$array[ac.$offset+1]))))||z>aa){ad=1;if(u<0){ad=-1;}d.Overlap=aa;d.OverlapX=(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0])*ad;d.OverlapY=(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1])*ad;}d.Axis=c;}return false;};AP=function(a,b){var a,b,c,d;c=((A.Round(a*100)>>0));d=((A.Round(b*100)>>0));return[c,d];};$pkg.WorldToVirtualGridPos=AP;AQ=function(a,b){var a,b,c,d;c=(a)*0.01;d=(b)*0.01;return[c,d];};$pkg.VirtualGridToWorldPos=AQ;AR=function(a,b,c,d,e,f,g,h,i,j){var a,b,c,d,e,f,g,h,i,j;return[a-c-g+i,b-d-f+j];};$pkg.WorldToPolygonColliderBLPos=AR;AS=function(a,b,c,d,e,f,g,h,i,j){var a,b,c,d,e,f,g,h,i,j;return[a+c+g-i,b+d+f-j];};$pkg.PolygonColliderBLToWorldPos=AS;AT=function(a,b,c,d,e,f,g,h,i,j){var a,b,c,d,e,f,g,h,i,j,k,l,m;k=AS(a,b,c,d,e,f,g,h,i,j);l=k[0];m=k[1];return AP(l,m);};$pkg.PolygonColliderBLToVirtualGridPos=AT;AV=function(a,b,c,d,e,f,g){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,$s,$r,$c}=$restore(this,{a,b,c,d,e,f,g});$s=$s||0;s:while(true){switch($s){case 0:h=[h];h[0]=$makeSlice(BM,0,10);i=0;if((16===b.CharacterState)&&(0===c.VelX)&&(b.DirX===c.DirX)){j=1;if(0>c.DirX){j=-j;}i=j*(b.Speed)*0.01;}k=d.Check(i,0,new BN([]));if(BO.nil===k){$s=-1;return(h.$ptr||(h.$ptr=new BP(function(){return this.$target[0];},function($v){this.$target[0]=$v;},h)));}l=k.Objects;m=0;case 1:if(!(m=l.$length)?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+m]);o=false;p=n.Data;if($assertType(p,BQ,true)[1]||$assertType(p,BK,true)[1]||$assertType(p,BR,true)[1]){}else{o=true;}if(!o){m++;$s=1;continue;}q=$assertType(n.Shape,BS);s=AI(0,0,e,q);$s=3;case 3:if($c){$c=false;s=s.$blk();}if(s&&s.$blk!==undefined){break s;}r=s;t=r[0];u=r[1];v=r[2];w=r[3];if(!t){m++;$s=1;continue;}x=(w.Overlap-f)*w.OverlapX;y=(w.Overlap-f)*w.OverlapY;u=x;v=y;h[0]=$append(h[0],new C.ptr(w.OverlapX,w.OverlapY));g.X=g.X+(u);g.Y=g.Y+(v);m++;$s=1;continue;case 2:$s=-1;return(h.$ptr||(h.$ptr=new BP(function(){return this.$target[0];},function($v){this.$target[0]=$v;},h)));}return;}var $f={$blk:AV,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,$s};return $f;};AW=function(a,b,c,d){var a,aa,ab,ac,ad,ae,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;e=AC(c.Id);f=AC(c.Id-1>>0);if(0>=e){return[-2,false,0,0];}g=(h=W[$Int32.keyFor(a.CharacterState)],h!==undefined?[h.v,true]:[false,false]);i=g[1];if(i){return[-2,false,0,0];}j=$assertType(d.GetByFrameId(e),BT).InputList;k=BU.nil;if(0>0,((n<0||n>=j.$length)?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+n])));p=0;q=0;r=p;s=q;t=0;u=0;v=t;w=u;if(!(BU.nil===k)){y=AG((x=m-1>>0,((x<0||x>=k.$length)?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+x])));v=y.BtnALevel;w=y.BtnBLevel;}if(0===a.FramesToRecover){z=o.Dx;aa=o.Dy;r=z;s=aa;if(o.BtnBLevel>w){ab=(ac=V[$Int32.keyFor(a.CharacterState)],ac!==undefined?[ac.v,true]:[false,false]);ad=ab[1];if(!ad){l=true;}else if(16===a.CharacterState){l=true;}}}ae=-1;if(o.BtnALevel>v){if(0>s){ae=3;}else if(0=j.$length)?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+k]);((l<0||l>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+l]=new E.ptr(m.Id,m.VirtualGridX,m.VirtualGridY,m.DirX,m.DirY,m.VelX,m.VelY,m.Speed,m.BattleState,m.JoinIndex,m.ColliderRadius,m.Removed,m.Score,0,m.FramesToRecover-1>>0,m.FramesInChState+1>>0,m.Hp,m.MaxHp,m.CharacterState,true,false,m.OnWallNormX,m.OnWallNormY,m.ActiveSkillId,m.ActiveSkillHit,m.FramesInvinsible-1>>0,0,0));if(((l<0||l>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+l]).FramesToRecover<0){((l<0||l>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+l]).FramesToRecover=0;}if(((l<0||l>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+l]).FramesInvinsible<0){((l<0||l>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+l]).FramesInvinsible=0;}k++;}n=$makeSlice(BW,0,b.MeleeBullets.$length);o=$makeSlice(BX,0,b.FireballBullets.$length);p=$makeSlice(BM,h);q=$makeSlice(BY,h);r=$makeSlice(BZ,h);s=b.BulletLocalIdCounter;t=b.PlayersArr;u=0;case 1:if(!(u=t.$length)?($throwRuntimeError("index out of range"),undefined):t.$array[t.$offset+u]);z=((x<0||x>=g.$length)?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+x]);aa=((x<0||x>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+x]);ab=AW(y,aa,b,a);ac=ab[0];ad=ab[1];ae=ab[2];af=ab[3];((x<0||x>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+x]=ad);ag=y.JoinIndex;ah=z.SkillMapper(ac,y);$s=3;case 3:if($c){$c=false;ah=ah.$blk();}if(ah&&ah.$blk!==undefined){break s;}ai=ah;aj=(ak=U[$Int.keyFor(ai)],ak!==undefined?[ak.v,true]:[BJ.nil,false]);al=aj[0];am=aj[1];if(am){aa.ActiveSkillId=((ai>>0));aa.ActiveSkillHit=0;aa.FramesToRecover=al.RecoveryFrames;an=1;if(0>aa.DirX){an=-an;}ao=false;ap=(aq=al.Hits,ar=aa.ActiveSkillHit,((ar<0||ar>=aq.$length)?($throwRuntimeError("index out of range"),undefined):aq.$array[aq.$offset+ar]));if($assertType(ap,BK,true)[1]){as=ap.$val;v[0]=$clone(as,K);v[0].BattleAttr=new J.ptr(s,b.Id,ag,y.BulletTeamId);s=s+(1)>>0;v[0].BlState=0;n=$append(n,v[0]);if(!((-1===as.Bullet.SelfLockVelX))){ao=true;aa.VelX=$imul(an,as.Bullet.SelfLockVelX);}if(!((-1===as.Bullet.SelfLockVelY))){ao=true;aa.VelY=as.Bullet.SelfLockVelY;}}else if($assertType(ap,BR,true)[1]){at=ap.$val;w[0]=$clone(at,L);w[0].BattleAttr=new J.ptr(s,b.Id,ag,y.BulletTeamId);s=s+(1)>>0;au=y.VirtualGridX+($imul(an,w[0].Bullet.HitboxOffsetX))>>0;av=y.VirtualGridY+w[0].Bullet.HitboxOffsetY>>0;w[0].VirtualGridX=au;w[0].VirtualGridY=av;w[0].DirX=an;w[0].DirY=0;w[0].VelX=$imul(w[0].Speed,an);w[0].VelY=0;w[0].BlState=0;o=$append(o,w[0]);if(!((-1===at.Bullet.SelfLockVelX))){ao=true;aa.VelX=$imul(an,at.Bullet.SelfLockVelX);}if(!((-1===at.Bullet.SelfLockVelY))){ao=true;aa.VelY=at.Bullet.SelfLockVelY;}}if(false===ao&&false===y.InAir){aa.VelX=0;}aa.CharacterState=al.BoundChState;u++;$s=1;continue;}if(0===y.FramesToRecover){if(!((0===ae))){aw=1;if(0>ae){aw=-aw;}aa.DirX=ae;aa.DirY=af;aa.VelX=$imul(aw,y.Speed);if(Z(aa.VelX)=ay.$length)?($throwRuntimeError("index out of range"),undefined):ay.$array[ay.$offset+az]);bc=bb.JoinIndex;bd=0;be=0;(bf=bc-1>>0,((bf<0||bf>=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+bf])).X=bd;(bg=bc-1>>0,((bg<0||bg>=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+bg])).Y=be;bh=((ba<0||ba>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+ba]);bi=((ba<0||ba>=g.$length)?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+ba]);bj=bb.VirtualGridX+bb.VelX>>0;bk=bb.VirtualGridY+bb.VelY>>0;bl=bj;bm=bk;if(((ba<0||ba>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+ba])){if(16===bb.CharacterState){if(0<($imul(bb.VelX,bb.OnWallNormX))){bl=bl-(bb.VelX)>>0;}bn=-1;if(0>bb.OnWallNormX){bn=-bn;}bl=bl+(($imul(bn,bi.WallJumpingInitVelX)))>>0;bm=bm+(bi.WallJumpingInitVelY)>>0;bh.VelX=(($imul(bn,bi.WallJumpingInitVelX)));bh.VelY=(bi.WallJumpingInitVelY);bh.FramesToRecover=bi.WallJumpingFramesToRecover;}else{bh.VelY=(bi.JumpingInitVelY);bm=bm+(bi.JumpingInitVelY)>>0;}}bo=AQ(bl,bm);bp=bo[0];bq=bo[1];br=$imul(bb.ColliderRadius,2);bs=$imul(bb.ColliderRadius,4);bt=br;bu=bs;bv=bb.CharacterState;if(bv===(9)){bw=$imul(bb.ColliderRadius,4);bx=$imul(bb.ColliderRadius,2);bt=bw;bu=bx;}else if((bv===(8))||(bv===(4))||(bv===(5))||(bv===(16))){by=$imul(bb.ColliderRadius,2);bz=$imul(bb.ColliderRadius,2);bt=by;bu=bz;}ca=AQ(bt,bu);cb=ca[0];cc=ca[1];cd=AY(bp,bq,cb,cc,0.1,0.1,0.1,0.1,e,f,bb,"Player");$s=6;case 6:if($c){$c=false;cd=cd.$blk();}if(cd&&cd.$blk!==undefined){break s;}ce=cd;((ba<0||ba>=ax.$length)?($throwRuntimeError("index out of range"),undefined):ax.$array[ax.$offset+ba]=ce);$r=c.Add(new CB([ce]));$s=7;case 7:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}if(bb.InAir){if((16===bb.CharacterState)&&!((ba<0||ba>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+ba])){bh.VelX=bh.VelX+(0)>>0;bh.VelY=bi.WallSlidingVelY;}else{bh.VelX=bh.VelX+(0)>>0;bh.VelY=bh.VelY+(-50)>>0;}}az++;$s=4;continue;case 5:cf=$makeSlice(CB,0,b.MeleeBullets.$length);cg=b.MeleeBullets;ch=0;case 8:if(!(ch=cg.$length)?($throwRuntimeError("index out of range"),undefined):cg.$array[cg.$offset+ch]);cj=new K.ptr(ci.BlState,ci.FramesInBlState+1>>0,ci.BattleAttr,ci.Bullet);if(AL(cj,b)){$s=10;continue;}$s=11;continue;case 10:if(AK(cj,b)){$s=12;continue;}$s=13;continue;case 12:cm=(ck=b.PlayersArr,cl=cj.BattleAttr.OffenderJoinIndex-1>>0,((cl<0||cl>=ck.$length)?($throwRuntimeError("index out of range"),undefined):ck.$array[ck.$offset+cl]));cn=1;if(0>cm.DirX){cn=-cn;}co=AQ(cm.VirtualGridX+($imul(cn,cj.Bullet.HitboxOffsetX))>>0,cm.VirtualGridY);cp=co[0];cq=co[1];cr=AQ(cj.Bullet.HitboxSizeX,cj.Bullet.HitboxSizeY);cs=cr[0];ct=cr[1];cu=AY(cp,cq,cs,ct,0.1,0.1,0.1,0.1,e,f,cj,"MeleeBullet");$s=14;case 14:if($c){$c=false;cu=cu.$blk();}if(cu&&cu.$blk!==undefined){break s;}cv=cu;$r=c.Add(new CB([cv]));$s=15;case 15:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}cf=$append(cf,cv);cj.BlState=1;if(!((cj.BlState===ci.BlState))){cj.FramesInBlState=0;}case 13:n=$append(n,cj);case 11:ch++;$s=8;continue;case 9:cw=b.FireballBullets;cx=0;case 16:if(!(cx=cw.$length)?($throwRuntimeError("index out of range"),undefined):cw.$array[cw.$offset+cx]);cz=new L.ptr(cy.VirtualGridX,cy.VirtualGridY,cy.DirX,cy.DirY,cy.VelX,cy.VelY,cy.Speed,cy.BlState,cy.FramesInBlState+1>>0,cy.BattleAttr,cy.Bullet);if(AN(cz,b)){$s=18;continue;}$s=19;continue;case 18:if(AM(cz,b)){$s=20;continue;}$s=21;continue;case 20:da=AQ(cz.VirtualGridX,cz.VirtualGridY);db=da[0];dc=da[1];dd=AQ(cz.Bullet.HitboxSizeX,cz.Bullet.HitboxSizeY);de=dd[0];df=dd[1];dg=AY(db,dc,de,df,0.1,0.1,0.1,0.1,e,f,cz,"FireballBullet");$s=23;case 23:if($c){$c=false;dg=dg.$blk();}if(dg&&dg.$blk!==undefined){break s;}dh=dg;$r=c.Add(new CB([dh]));$s=24;case 24:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}cf=$append(cf,dh);cz.BlState=1;if(!((cz.BlState===cy.BlState))){cz.FramesInBlState=0;}di=cz.VirtualGridX+cz.VelX>>0;dj=cz.VirtualGridY+cz.VelY>>0;cz.VirtualGridX=di;cz.VirtualGridY=dj;$s=22;continue;case 21:case 22:o=$append(o,cz);case 19:cx++;$s=16;continue;case 17:dk=b.PlayersArr;dl=0;case 25:if(!(dl=dk.$length)?($throwRuntimeError("index out of range"),undefined):dk.$array[dk.$offset+dl]);dp=dn.JoinIndex;dq=((dm<0||dm>=ax.$length)?($throwRuntimeError("index out of range"),undefined):ax.$array[ax.$offset+dm]);dr=$assertType(dq.Shape,BS);ds=((dm<0||dm>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+dm]);du=AV(dp,dn,ds,dq,dr,0.1,(dt=dp-1>>0,((dt<0||dt>=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+dt])));$s=27;case 27:if($c){$c=false;du=du.$blk();}if(du&&du.$blk!==undefined){break s;}(dv=dp-1>>0,((dv<0||dv>=q.$length)?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+dv]=du));dw=((dm<0||dm>=g.$length)?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+dm]);dx=false;dy=dq.Check(0,0,new BN([]));if(!(BO.nil===dy)){$s=28;continue;}$s=29;continue;case 28:dz=dy.Objects;ea=0;case 30:if(!(ea=dz.$length)?($throwRuntimeError("index out of range"),undefined):dz.$array[dz.$offset+ea]);ec=false;ed=false;ee=false;ef=ec;eg=ed;eh=ee;ei=eb.Data;if($assertType(ei,BQ,true)[1]){eg=true;}else if($assertType(ei,BK,true)[1]||$assertType(ei,BR,true)[1]){eh=true;}else{ef=true;}if(eh){ea++;$s=30;continue;}ej=$assertType(eb.Shape,BS);el=AI(0,0,dr,ej);$s=32;case 32:if($c){$c=false;el=el.$blk();}if(el&&el.$blk!==undefined){break s;}ek=el;em=ek[0];en=ek[1];eo=ek[2];ep=ek[3];if(!em){ea++;$s=30;continue;}eq=ep.OverlapX*0+ep.OverlapY*-1;if(eg){er=(ep.Overlap-0.2)*ep.OverlapX;es=(ep.Overlap-0.2)*ep.OverlapY;en=er;eo=es;}et=(eu=dp-1>>0,((eu<0||eu>=q.$length)?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+eu])).$get();ev=0;while(true){if(!(ev=et.$length)?($throwRuntimeError("index out of range"),undefined):et.$array[et.$offset+ev]),C);ex=en*ew.X+eo*ew.Y;if(ef||(eg&&0>ex)){en=en-(ex*ew.X);eo=eo-(ex*ew.Y);}ev++;}ey=dp-1>>0;((ey<0||ey>=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+ey]).X=((ey<0||ey>=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+ey]).X+(en);ez=dp-1>>0;((ez<0||ez>=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+ez]).Y=((ez<0||ez>=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+ez]).Y+(eo);if(0.5=dn.VelY;if(fa){ds.VelY=0;ds.VelX=0;if(8===ds.CharacterState){ds.CharacterState=9;ds.FramesToRecover=dw.LayDownFramesToRecover;}else{fb=dn.CharacterState;if((fb===(8))||(fb===(4))||(fb===(5))||(fb===(16))){fc=0;fd=dn.ColliderRadius;fe=fc;ff=fd;fg=AQ(fe,ff);fh=fg[1];fi=dp-1>>0;((fi<0||fi>=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+fi]).Y=((fi<0||fi>=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+fi]).Y-(fh);}ds.CharacterState=0;ds.FramesToRecover=0;}}else{fj=(fk=Y[$Int32.keyFor(ds.CharacterState)],fk!==undefined?[fk.v,true]:[false,false]);fl=fj[1];if(fl){if(9===ds.CharacterState){if(0===ds.FramesToRecover){ds.CharacterState=10;ds.FramesToRecover=dw.GetUpFramesToRecover;}}else if(10===ds.CharacterState){if(0===ds.FramesToRecover){ds.CharacterState=0;ds.FramesInvinsible=dw.GetUpInvinsibleFrames;}}}}}if(dw.OnWallEnabled){if(ds.InAir){fm=(fn=W[$Int32.keyFor(dn.CharacterState)],fn!==undefined?[fn.v,true]:[false,false]);fo=fm[1];if(!fo){fp=(fq=dp-1>>0,((fq<0||fq>=q.$length)?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+fq])).$get();fr=0;while(true){if(!(fr=fp.$length)?($throwRuntimeError("index out of range"),undefined):fp.$array[fp.$offset+fr]),C);ft=fs.X*1+fs.Y*0;fu=fs.X*-1+fs.Y*0;if(0.9>0));fw=((fs.Y>>0));ds.OnWallNormX=fv;ds.OnWallNormY=fw;break;}if(0.9>0));fy=((fs.Y>>0));ds.OnWallNormX=fx;ds.OnWallNormY=fy;break;}fr++;}if(!dn.OnWall&&ds.OnWall){ds.VelY=0;}}}if(!ds.OnWall){fz=0;ga=0;ds.OnWallNormX=fz;ds.OnWallNormY=ga;}}dl++;$s=25;continue;case 26:gb=cf;gc=0;case 33:if(!(gc=gb.$length)?($throwRuntimeError("index out of range"),undefined):gb.$array[gb.$offset+gc]);ge=gd.Check(0,0,new BN([]));gd.Space.Remove(new CB([gd]));gf=false;if(!(BO.nil===ge)){$s=35;continue;}$s=36;continue;case 35:gg=gd.Data;if($assertType(gg,BK,true)[1]){$s=37;continue;}if($assertType(gg,BR,true)[1]){$s=38;continue;}$s=39;continue;case 37:gh=gg.$val;gj=$assertType(gd.Shape,BS);gm=(gk=b.PlayersArr,gl=gh.BattleAttr.OffenderJoinIndex-1>>0,((gl<0||gl>=gk.$length)?($throwRuntimeError("index out of range"),undefined):gk.$array[gk.$offset+gl]));gn=ge.Objects;go=0;case 40:if(!(go=gn.$length)?($throwRuntimeError("index out of range"),undefined):gn.$array[gn.$offset+go]);gq=$assertType(gp.Shape,BS);gr=gp.Data;if($assertType(gr,BQ,true)[1]){$s=42;continue;}$s=43;continue;case 42:gs=gr.$val;if(gh.BattleAttr.OffenderJoinIndex===gs.JoinIndex){go++;$s=40;continue;}gu=AI(0,0,gj,gq);$s=44;case 44:if($c){$c=false;gu=gu.$blk();}if(gu&&gu.$blk!==undefined){break s;}gt=gu;gv=gt[0];if(!gv){go++;$s=40;continue;}gf=true;gw=(gx=X[$Int32.keyFor(gs.CharacterState)],gx!==undefined?[gx.v,true]:[false,false]);gy=gw[1];if(gy){go++;$s=40;continue;}if(0gm.DirX){gz=-gz;}ha=$imul(gz,gh.Bullet.PushbackVelX);hb=gh.Bullet.PushbackVelY;hc=ha;hd=hb;hf=(he=gs.JoinIndex-1>>0,((he<0||he>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+he]));hf.VelX=hc;hf.VelY=hd;if(gh.Bullet.BlowUp){hf.CharacterState=8;}else{hf.CharacterState=3;}hh=(hg=gs.JoinIndex-1>>0,((hg<0||hg>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+hg])).FramesToRecover;if(gh.Bullet.HitStunFrames>hh){hf.FramesToRecover=gh.Bullet.HitStunFrames;}case 43:go++;$s=40;continue;case 41:$s=39;continue;case 38:gi=gg.$val;hi=$assertType(gd.Shape,BS);hl=(hj=b.PlayersArr,hk=gi.BattleAttr.OffenderJoinIndex-1>>0,((hk<0||hk>=hj.$length)?($throwRuntimeError("index out of range"),undefined):hj.$array[hj.$offset+hk]));hm=ge.Objects;hn=0;case 45:if(!(hn=hm.$length)?($throwRuntimeError("index out of range"),undefined):hm.$array[hm.$offset+hn]);hp=$assertType(ho.Shape,BS);hq=ho.Data;if($assertType(hq,BQ,true)[1]){$s=47;continue;}$s=48;continue;case 47:hr=hq.$val;if(gi.BattleAttr.OffenderJoinIndex===hr.JoinIndex){hn++;$s=45;continue;}hu=AI(0,0,hi,hp);$s=50;case 50:if($c){$c=false;hu=hu.$blk();}if(hu&&hu.$blk!==undefined){break s;}ht=hu;hv=ht[0];if(!hv){hn++;$s=45;continue;}gf=true;hw=(hx=X[$Int32.keyFor(hr.CharacterState)],hx!==undefined?[hx.v,true]:[false,false]);hy=hw[1];if(hy){hn++;$s=45;continue;}if(0hl.DirX){hz=-hz;}ia=$imul(hz,gi.Bullet.PushbackVelX);ib=gi.Bullet.PushbackVelY;ic=ia;id=ib;ig=(ie=hr.JoinIndex-1>>0,((ie<0||ie>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+ie]));ig.VelX=ic;ig.VelY=id;if(gi.Bullet.BlowUp){ig.CharacterState=8;}else{ig.CharacterState=3;}ii=(ih=hr.JoinIndex-1>>0,((ih<0||ih>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+ih])).FramesToRecover;if(gi.Bullet.HitStunFrames>ii){ig.FramesToRecover=gi.Bullet.HitStunFrames;}$s=49;continue;case 48:hs=hq;gf=true;case 49:hn++;$s=45;continue;case 46:case 39:case 36:if(gf){ij=gd.Data;if($assertType(ij,BK,true)[1]){ik=ij.$val;ik.BlState=2;ik.FramesInBlState=0;}else if($assertType(ij,BR,true)[1]){il=ij.$val;il.BlState=2;il.FramesInBlState=0;}}gc++;$s=33;continue;case 34:im=b.PlayersArr;io=0;while(true){if(!(io=im.$length)?($throwRuntimeError("index out of range"),undefined):im.$array[im.$offset+io]);ir=iq.JoinIndex;is=((ip<0||ip>=ax.$length)?($throwRuntimeError("index out of range"),undefined):ax.$array[ax.$offset+ip]);it=((ip<0||ip>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+ip]);iu=AT(is.X-(iv=ir-1>>0,((iv<0||iv>=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+iv])).X,is.Y-(iw=ir-1>>0,((iw<0||iw>=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+iw])).Y,is.W*0.5,is.H*0.5,0,0,0,0,e,f);it.VirtualGridX=iu[0];it.VirtualGridY=iu[1];if(it.InAir){ix=it.CharacterState;iy=ix;if((iy===(0))||(iy===(1))){if(it.OnWall){it.CharacterState=16;}else if(((ip<0||ip>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+ip])||(5===iq.CharacterState)){it.CharacterState=5;}else{it.CharacterState=4;}}else if(iy===(2)){it.CharacterState=6;}else if(iy===(3)){it.CharacterState=7;}}if(!((it.CharacterState===iq.CharacterState))){it.FramesInChState=0;}iz=(ja=Y[$Int32.keyFor(it.CharacterState)],ja!==undefined?[ja.v,true]:[false,false]);jb=iz[1];if(jb){it.ActiveSkillId=-1;it.ActiveSkillHit=-1;}io++;}jc=ax;jd=0;while(true){if(!(jd=jc.$length)?($throwRuntimeError("index out of range"),undefined):jc.$array[jc.$offset+jd]);je.Space.Remove(new CB([je]));jd++;}$s=-1;return new N.ptr(b.Id+1>>0,i,new $Int64(0,0),n,o,new $Uint64(0,0),false,s);}return;}var $f={$blk:AX,$c:true,$r,a,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,az,b,ba,bb,bc,bd,be,bf,bg,bh,bi,bj,bk,bl,bm,bn,bo,bp,bq,br,bs,bt,bu,bv,bw,bx,by,bz,c,ca,cb,cc,cd,ce,cf,cg,ch,ci,cj,ck,cl,cm,cn,co,cp,cq,cr,cs,ct,cu,cv,cw,cx,cy,cz,d,da,db,dc,dd,de,df,dg,dh,di,dj,dk,dl,dm,dn,dp,dq,dr,ds,dt,du,dv,dw,dx,dy,dz,e,ea,eb,ec,ed,ee,ef,eg,eh,ei,ej,ek,el,em,en,eo,ep,eq,er,es,et,eu,ev,ew,ex,ey,ez,f,fa,fb,fc,fd,fe,ff,fg,fh,fi,fj,fk,fl,fm,fn,fo,fp,fq,fr,fs,ft,fu,fv,fw,fx,fy,fz,g,ga,gb,gc,gd,ge,gf,gg,gh,gi,gj,gk,gl,gm,gn,go,gp,gq,gr,gs,gt,gu,gv,gw,gx,gy,gz,h,ha,hb,hc,hd,he,hf,hg,hh,hi,hj,hk,hl,hm,hn,ho,hp,hq,hr,hs,ht,hu,hv,hw,hx,hy,hz,i,ia,ib,ic,id,ie,ig,ih,ii,ij,ik,il,im,io,ip,iq,ir,is,it,iu,iv,iw,ix,iy,iz,j,ja,jb,jc,jd,je,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s};return $f;};$pkg.ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame=AX;AY=function(a,b,c,d,e,f,g,h,i,j,k,l){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,$s,$r,$c}=$restore(this,{a,b,c,d,e,f,g,h,i,j,k,l});$s=$s||0;s:while(true){switch($s){case 0:m=AR(a,b,c*0.5,d*0.5,e,f,g,h,i,j);n=m[0];o=m[1];p=AZ(n,o,g+c+h,f+d+e,k,l);$s=1;case 1:if($c){$c=false;p=p.$blk();}if(p&&p.$blk!==undefined){break s;}q=p;$s=2;case 2:return q;}return;}var $f={$blk:AY,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,$s};return $f;};$pkg.GenerateRectCollider=AY;AZ=function(a,b,c,d,e,f){var{a,b,c,d,e,f,g,h,$s,$r,$c}=$restore(this,{a,b,c,d,e,f});$s=$s||0;s:while(true){switch($s){case 0:g=B.NewObject(a,b,c,d,new BN([f]));h=B.NewRectangle(0,0,c,d);$r=g.SetShape(h);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}g.Data=e;$s=-1;return g;}return;}var $f={$blk:AZ,$c:true,$r,a,b,c,d,e,f,g,h,$s};return $f;};BA=function(a,b,c,d,e){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,$s,$r,$c}=$restore(this,{a,b,c,d,e});$s=$s||0;s:while(true){switch($s){case 0:f=BB(a);g=0;h=0;i=g;j=h;k=B.NewConvexPolygon(CC.nil);l=f.Points;m=0;while(true){if(!(m=l.$length)?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+m]);p=f.Points;q=0;while(true){if(!(q=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+q]);if(n===r){q++;continue;}if(A.Abs(s.X-o.X)>i){i=A.Abs(s.X-o.X);}if(A.Abs(s.Y-o.Y)>j){j=A.Abs(s.Y-o.Y);}q++;}m++;}t=0;while(true){if(!(t=u.$length)?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+t]));k.AddPoints(new CC([v.X,v.Y]));t=t+(1)>>0;}w=B.NewObject(f.Anchor.X+b,f.Anchor.Y+c,i,j,new BN([e]));$r=w.SetShape(k);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}w.Data=d;$s=-1;return w;}return;}var $f={$blk:BA,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,$s};return $f;};$pkg.GenerateConvexPolygonCollider=BA;BB=function(a){var a,b,c,d,e,f,g,h,i,j,k;b=new C.ptr(1.7e+308,1.7e+308);c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(e.X=g.$length)?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+h]);(k=f.Points,((i<0||i>=k.$length)?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+i]=new C.ptr(j.X-b.X,j.Y-b.Y)));h++;}return f;};$pkg.AlignPolygon2DToBoundingBox=BB;BC=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x;return new K.ptr(u,v,new J.ptr(a,b,c,t),new I.ptr(d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,w,x,false));};$pkg.NewMeleeBullet=BC;BD=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ab,ac,ad,ae){var a,aa,ab,ac,ad,ae,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;return new L.ptr(u,v,w,x,y,z,aa,0,0,new J.ptr(a,b,c,t),new I.ptr(d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,ad,ae,false));};$pkg.NewFireballBullet=BD;CH.methods=[{prop:"Put",name:"Put",pkg:"",typ:$funcType([$emptyInterface],[],false)},{prop:"Pop",name:"Pop",pkg:"",typ:$funcType([],[$emptyInterface],false)},{prop:"GetArrIdxByOffset",name:"GetArrIdxByOffset",pkg:"",typ:$funcType([$Int32],[$Int32],false)},{prop:"GetByOffset",name:"GetByOffset",pkg:"",typ:$funcType([$Int32],[$emptyInterface],false)},{prop:"GetByFrameId",name:"GetByFrameId",pkg:"",typ:$funcType([$Int32],[$emptyInterface],false)},{prop:"SetByFrameId",name:"SetByFrameId",pkg:"",typ:$funcType([$emptyInterface,$Int32],[$Int32,$Int32,$Int32],false)}];C.init("",[{prop:"X",name:"X",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Y",name:"Y",embedded:false,exported:true,typ:$Float64,tag:""}]);D.init("",[{prop:"Anchor",name:"Anchor",embedded:false,exported:true,typ:CD,tag:""},{prop:"Points",name:"Points",embedded:false,exported:true,typ:CE,tag:""}]);E.init("",[{prop:"Id",name:"Id",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VirtualGridX",name:"VirtualGridX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VirtualGridY",name:"VirtualGridY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"DirX",name:"DirX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"DirY",name:"DirY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VelX",name:"VelX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VelY",name:"VelY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Speed",name:"Speed",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BattleState",name:"BattleState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"JoinIndex",name:"JoinIndex",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"ColliderRadius",name:"ColliderRadius",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Removed",name:"Removed",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"Score",name:"Score",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"LastMoveGmtMillis",name:"LastMoveGmtMillis",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"FramesToRecover",name:"FramesToRecover",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"FramesInChState",name:"FramesInChState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Hp",name:"Hp",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"MaxHp",name:"MaxHp",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"CharacterState",name:"CharacterState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"InAir",name:"InAir",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"OnWall",name:"OnWall",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"OnWallNormX",name:"OnWallNormX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"OnWallNormY",name:"OnWallNormY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"ActiveSkillId",name:"ActiveSkillId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"ActiveSkillHit",name:"ActiveSkillHit",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"FramesInvinsible",name:"FramesInvinsible",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BulletTeamId",name:"BulletTeamId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"ChCollisionTeamId",name:"ChCollisionTeamId",embedded:false,exported:true,typ:$Int32,tag:""}]);F.init("",[{prop:"Dx",name:"Dx",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Dy",name:"Dy",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BtnALevel",name:"BtnALevel",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BtnBLevel",name:"BtnBLevel",embedded:false,exported:true,typ:$Int32,tag:""}]);H.init("",[{prop:"Boundary",name:"Boundary",embedded:false,exported:true,typ:CF,tag:""}]);I.init("",[{prop:"StartupFrames",name:"StartupFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"CancellableStFrame",name:"CancellableStFrame",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"CancellableEdFrame",name:"CancellableEdFrame",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"ActiveFrames",name:"ActiveFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"HitStunFrames",name:"HitStunFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BlockStunFrames",name:"BlockStunFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"PushbackVelX",name:"PushbackVelX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"PushbackVelY",name:"PushbackVelY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Damage",name:"Damage",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"SelfLockVelX",name:"SelfLockVelX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"SelfLockVelY",name:"SelfLockVelY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"HitboxOffsetX",name:"HitboxOffsetX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"HitboxOffsetY",name:"HitboxOffsetY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"HitboxSizeX",name:"HitboxSizeX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"HitboxSizeY",name:"HitboxSizeY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BlowUp",name:"BlowUp",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"ExplosionFrames",name:"ExplosionFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"SpeciesId",name:"SpeciesId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"CancelTransit",name:"CancelTransit",embedded:false,exported:true,typ:CG,tag:""}]);J.init("",[{prop:"BulletLocalId",name:"BulletLocalId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"OriginatedRenderFrameId",name:"OriginatedRenderFrameId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"OffenderJoinIndex",name:"OffenderJoinIndex",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"TeamId",name:"TeamId",embedded:false,exported:true,typ:$Int32,tag:""}]);K.init("",[{prop:"BlState",name:"BlState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"FramesInBlState",name:"FramesInBlState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BattleAttr",name:"BattleAttr",embedded:false,exported:true,typ:BH,tag:""},{prop:"Bullet",name:"Bullet",embedded:false,exported:true,typ:BI,tag:""}]);L.init("",[{prop:"VirtualGridX",name:"VirtualGridX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VirtualGridY",name:"VirtualGridY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"DirX",name:"DirX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"DirY",name:"DirY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VelX",name:"VelX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VelY",name:"VelY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Speed",name:"Speed",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BlState",name:"BlState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"FramesInBlState",name:"FramesInBlState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BattleAttr",name:"BattleAttr",embedded:false,exported:true,typ:BH,tag:""},{prop:"Bullet",name:"Bullet",embedded:false,exported:true,typ:BI,tag:""}]);M.init("",[{prop:"BattleLocalId",name:"BattleLocalId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"RecoveryFrames",name:"RecoveryFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"RecoveryFramesOnBlock",name:"RecoveryFramesOnBlock",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"RecoveryFramesOnHit",name:"RecoveryFramesOnHit",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"ReleaseTriggerType",name:"ReleaseTriggerType",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BoundChState",name:"BoundChState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Hits",name:"Hits",embedded:false,exported:true,typ:BG,tag:""}]);N.init("",[{prop:"Id",name:"Id",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"PlayersArr",name:"PlayersArr",embedded:false,exported:true,typ:BV,tag:""},{prop:"CountdownNanos",name:"CountdownNanos",embedded:false,exported:true,typ:$Int64,tag:""},{prop:"MeleeBullets",name:"MeleeBullets",embedded:false,exported:true,typ:BW,tag:""},{prop:"FireballBullets",name:"FireballBullets",embedded:false,exported:true,typ:BX,tag:""},{prop:"BackendUnconfirmedMask",name:"BackendUnconfirmedMask",embedded:false,exported:true,typ:$Uint64,tag:""},{prop:"ShouldForceResync",name:"ShouldForceResync",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"BulletLocalIdCounter",name:"BulletLocalIdCounter",embedded:false,exported:true,typ:$Int32,tag:""}]);O.init("",[{prop:"InputFrameId",name:"InputFrameId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"InputList",name:"InputList",embedded:false,exported:true,typ:BU,tag:""},{prop:"ConfirmedList",name:"ConfirmedList",embedded:false,exported:true,typ:$Uint64,tag:""}]);P.init("",[{prop:"FlAct",name:"FlAct",embedded:false,exported:true,typ:$Uint64,tag:""},{prop:"FrAct",name:"FrAct",embedded:false,exported:true,typ:$Uint64,tag:""},{prop:"X",name:"X",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Y",name:"Y",embedded:false,exported:true,typ:$Float64,tag:""}]);Q.init("",[{prop:"Ed",name:"Ed",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"St",name:"St",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"EdFrameId",name:"EdFrameId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"StFrameId",name:"StFrameId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"N",name:"N",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Cnt",name:"Cnt",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Eles",name:"Eles",embedded:false,exported:true,typ:BG,tag:""}]);S.init([$Int,BQ],[$Int],false);T.init("",[{prop:"SpeciesId",name:"SpeciesId",embedded:false,exported:true,typ:$Int,tag:""},{prop:"SpeciesName",name:"SpeciesName",embedded:false,exported:true,typ:$String,tag:""},{prop:"InAirIdleFrameIdxTurningPoint",name:"InAirIdleFrameIdxTurningPoint",embedded:false,exported:true,typ:$Int,tag:""},{prop:"InAirIdleFrameIdxTurnedCycle",name:"InAirIdleFrameIdxTurnedCycle",embedded:false,exported:true,typ:$Int,tag:""},{prop:"LayDownFrames",name:"LayDownFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"LayDownFramesToRecover",name:"LayDownFramesToRecover",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"GetUpInvinsibleFrames",name:"GetUpInvinsibleFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"GetUpFramesToRecover",name:"GetUpFramesToRecover",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Speed",name:"Speed",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"JumpingInitVelY",name:"JumpingInitVelY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"DashingEnabled",name:"DashingEnabled",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"OnWallEnabled",name:"OnWallEnabled",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"WallJumpingFramesToRecover",name:"WallJumpingFramesToRecover",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"WallJumpingInitVelX",name:"WallJumpingInitVelX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"WallJumpingInitVelY",name:"WallJumpingInitVelY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"WallSlidingVelY",name:"WallSlidingVelY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"SkillMapper",name:"SkillMapper",embedded:false,exported:true,typ:S,tag:""}]);AH.init("",[{prop:"Overlap",name:"Overlap",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"OverlapX",name:"OverlapX",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"OverlapY",name:"OverlapY",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"AContainedInB",name:"AContainedInB",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"BContainedInA",name:"BContainedInA",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"Axis",name:"Axis",embedded:false,exported:true,typ:B.Vector,tag:""}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$pkg.DIRECTION_DECODER=new BF([new BE([0,0]),new BE([0,2]),new BE([0,-2]),new BE([2,0]),new BE([-2,0]),new BE([1,1]),new BE([-1,-1]),new BE([1,-1]),new BE([-1,1])]);U=$makeMap($Int.keyFor,[{k:1,v:new M.ptr(0,30,30,30,1,2,new BG([new K.ptr(0,0,BH.nil,new I.ptr(7,13,30,22,13,9,50,0,5,5,-1,1200,0,2400,3200,false,9,1,$makeMap($Int.keyFor,[{k:1,v:2}])))]))},{k:2,v:new M.ptr(0,36,36,36,1,11,new BG([new K.ptr(0,0,BH.nil,new I.ptr(18,22,36,18,18,9,50,0,5,10,-1,1800,0,2400,3200,false,9,1,$makeMap($Int.keyFor,[{k:1,v:3}])))]))},{k:3,v:new M.ptr(0,50,50,50,1,12,new BG([new K.ptr(0,0,BH.nil,new I.ptr(8,0,0,30,999999999,9,200,700,10,50,500,1600,800,3200,3200,true,9,1,false))]))},{k:4,v:new M.ptr(0,30,30,30,1,2,new BG([new K.ptr(0,0,BH.nil,new I.ptr(7,13,30,22,13,9,50,0,5,5,-1,1200,0,2400,3200,false,15,2,$makeMap($Int.keyFor,[{k:1,v:5}])))]))},{k:5,v:new M.ptr(0,36,36,36,1,11,new BG([new K.ptr(0,0,BH.nil,new I.ptr(18,22,36,18,18,9,50,0,5,10,-1,1800,0,2400,3200,false,15,2,$makeMap($Int.keyFor,[{k:1,v:6}])))]))},{k:6,v:new M.ptr(0,45,45,45,1,12,new BG([new K.ptr(0,0,BH.nil,new I.ptr(8,0,0,28,999999999,9,200,300,10,-1,-1,2400,0,3200,3200,true,15,2,false))]))},{k:7,v:new M.ptr(0,30,30,30,1,2,new BG([new K.ptr(0,0,BH.nil,new I.ptr(7,13,30,22,13,9,50,0,5,-1,-1,1200,0,2400,3200,false,9,1,$makeMap($Int.keyFor,[{k:1,v:8}])))]))},{k:8,v:new M.ptr(0,36,36,36,1,11,new BG([new K.ptr(0,0,BH.nil,new I.ptr(18,22,36,18,18,9,50,0,5,10,-1,1800,0,2400,3200,false,9,1,$makeMap($Int.keyFor,[{k:1,v:9}])))]))},{k:9,v:new M.ptr(0,40,40,40,1,12,new BG([new K.ptr(0,0,BH.nil,new I.ptr(7,0,0,30,999999999,9,200,400,10,100,-1,1000,0,3200,3200,true,9,1,false))]))},{k:10,v:new M.ptr(0,40,40,40,1,13,new BG([new L.ptr(0,0,0,0,0,0,500,0,0,BH.nil,new I.ptr(12,0,0,999999999,15,9,200,0,20,-1,-1,2400,500,4800,3200,false,5,1,false))]))},{k:11,v:new M.ptr(0,60,60,60,1,14,new BG([new K.ptr(0,0,BH.nil,new I.ptr(3,0,0,25,999999999,9,200,700,30,100,800,800,0,4000,6400,true,15,3,false))]))},{k:255,v:new M.ptr(0,30,30,30,1,6,new BG([new K.ptr(0,0,BH.nil,new I.ptr(3,0,0,20,18,9,50,0,5,-1,-1,1200,0,3200,2400,false,9,1,false))]))},{k:256,v:new M.ptr(0,20,20,20,1,6,new BG([new K.ptr(0,0,BH.nil,new I.ptr(3,0,0,10,15,9,50,0,5,-1,-1,1200,0,3200,2400,false,15,2,false))]))},{k:257,v:new M.ptr(0,30,30,30,1,6,new BG([new K.ptr(0,0,BH.nil,new I.ptr(3,0,0,20,18,9,50,0,5,-1,-1,1200,0,3200,2400,false,9,1,false))]))}]);$pkg.Characters=$makeMap($Int.keyFor,[{k:0,v:new T.ptr(0,"MonkGirl",11,1,16,16,10,27,300,800,false,false,0,0,0,0,(function(a,b){var a,b,c,d,e,f,g,h,i,j,k,l,m,n;if(1===a){if(0===b.FramesToRecover){if(b.InAir){return 255;}else{return 1;}}else{c=(d=U[$Int.keyFor(((b.ActiveSkillId>>0)))],d!==undefined?[d.v,true]:[BJ.nil,false]);e=c[0];f=c[1];if(f){g=(h=e.Hits,i=b.ActiveSkillHit,((i<0||i>=h.$length)?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+i]));if($assertType(g,BK,true)[1]){j=g.$val;if(j.Bullet.CancellableStFrame<=b.FramesInChState&&b.FramesInChState>0)))],d!==undefined?[d.v,true]:[BJ.nil,false]);e=c[0];f=c[1];if(f){g=(h=e.Hits,i=b.ActiveSkillHit,((i<0||i>=h.$length)?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+i]));if($assertType(g,BK,true)[1]){j=g.$val;if(j.Bullet.CancellableStFrame<=b.FramesInChState&&b.FramesInChState>0)))],d!==undefined?[d.v,true]:[BJ.nil,false]);e=c[0];f=c[1];if(f){g=(h=e.Hits,i=b.ActiveSkillHit,((i<0||i>=h.$length)?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+i]));if($assertType(g,BK,true)[1]){j=g.$val;if(j.Bullet.CancellableStFrame<=b.FramesInChState&&b.FramesInChState=b.N)){break;}b.Pop();}(c=b.Eles,d=b.Ed,((d<0||d>=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]=a));b.EdFrameId=b.EdFrameId+(1)>>0;b.Cnt=b.Cnt+(1)>>0;b.Ed=b.Ed+(1)>>0;if(b.Ed>=b.N){b.Ed=b.Ed-(b.N)>>0;}};Q.prototype.Put=function(a){return this.$val.Put(a);};Q.ptr.prototype.Pop=function(){var a,b,c,d;a=this;if(0===a.Cnt){return $ifaceNil;}d=(b=a.Eles,c=a.St,((c<0||c>=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+c]));a.StFrameId=a.StFrameId+(1)>>0;a.Cnt=a.Cnt-(1)>>0;a.St=a.St+(1)>>0;if(a.St>=a.N){a.St=a.St-(a.N)>>0;}return d;};Q.prototype.Pop=function(){return this.$val.Pop();};Q.ptr.prototype.GetArrIdxByOffset=function(a){var a,b,c;b=this;if((0===b.Cnt)||0>a){return-1;}c=b.St+a>>0;if(b.St=b.N){c=c-(b.N)>>0;}if(c>=b.St||c=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+c]));};Q.prototype.GetByOffset=function(a){return this.$val.GetByOffset(a);};Q.ptr.prototype.GetByFrameId=function(a){var a,b;b=this;if(a>=b.EdFrameId||a>0);};Q.prototype.GetByFrameId=function(a){return this.$val.GetByFrameId(a);};Q.ptr.prototype.SetByFrameId=function(a,b){var a,b,c,d,e,f,g,h,i,j,k,l,m,n;c=this;d=c.StFrameId;e=c.EdFrameId;f=d;g=e;if(bb){h=c.GetArrIdxByOffset(b-c.StFrameId>>0);if(!((-1===h))){(i=c.Eles,((h<0||h>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+h]=a));return[0,f,g];}}j=0;if(g>0))>>3>>0);};$pkg.ConvertToDelayedInputFrameId=AC;AD=function(a){var a;return(a>>3>>0);};$pkg.ConvertToNoDelayInputFrameId=AD;AE=function(a){var a;return(((a<<3>>0))+4>>0);};$pkg.ConvertToFirstUsedRenderFrameId=AE;AF=function(a){var a;return(((((a<<3>>0))+4>>0)+8>>0)-1>>0);};$pkg.ConvertToLastUsedRenderFrameId=AF;AG=function(a){var a,b,c,d,e,f,g,h;b=new $Uint64(a.$high&0,(a.$low&15)>>>0);d=(((c=$shiftRightUint64(a,4),new $Uint64(c.$high&0,(c.$low&1)>>>0)).$low>>0));f=(((e=$shiftRightUint64(a,5),new $Uint64(e.$high&0,(e.$low&1)>>>0)).$low>>0));return new F.ptr((g=(($flatten64(b)<0||$flatten64(b)>=$pkg.DIRECTION_DECODER.$length)?($throwRuntimeError("index out of range"),undefined):$pkg.DIRECTION_DECODER.$array[$pkg.DIRECTION_DECODER.$offset+$flatten64(b)]),(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0])),(h=(($flatten64(b)<0||$flatten64(b)>=$pkg.DIRECTION_DECODER.$length)?($throwRuntimeError("index out of range"),undefined):$pkg.DIRECTION_DECODER.$array[$pkg.DIRECTION_DECODER.$offset+$flatten64(b)]),(1>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+1])),d,f);};AI=function(a,b,c,d){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,$s,$deferred,$r,$c}=$restore(this,{a,b,c,d});$s=$s||0;var $err=null;try{s:while(true){switch($s){case 0:$deferred=[];$curGoroutine.deferStack.push($deferred);c=[c];e=[e];f=[f];g=c[0].Position();e[0]=g[0];f[0]=g[1];$deferred.push([(function(c,e,f){return function(){c[0].SetPosition(e[0],f[0]);};})(c,e,f),[]]);c[0].SetPosition(e[0]+a,f[0]+b);h=new AH.ptr(0,0,0,true,true,new B.Vector([0,0]));i=AJ(c[0],d,h);if(i){$s=1;continue;}$s=2;continue;case 1:j=h.Overlap*h.OverlapX;k=h.Overlap*h.OverlapY;l=j;m=k;n=[true,l,m,h];$s=4;case 4:return n;case 2:o=[false,0,0,h];$s=5;case 5:return o;case 3:$s=-1;return[false,0,0,BL.nil];}return;}}catch(err){$err=err;$s=-1;return[false,0,0,BL.nil];}finally{$callDeferred($deferred,$err);if($curGoroutine.asleep){var $f={$blk:AI,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,$s,$deferred};return $f;}}};AJ=function(a,b,c){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;d=a.Points.$length;e=b.Points.$length;f=d;g=e;if((1===f)&&(1===g)){if(!(BL.nil===c)){c.Overlap=0;}return((h=(i=a.Points,(0>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+0])),(0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0]))===(j=(k=b.Points,(0>=k.$length?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+0])),(0>=j.$length?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+0])))&&((l=(m=a.Points,(0>=m.$length?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+0])),(1>=l.$length?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+1]))===(n=(o=b.Points,(0>=o.$length?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+0])),(1>=n.$length?($throwRuntimeError("index out of range"),undefined):n.$array[n.$offset+1])));}if(1=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+q]);if(AO(a,b,r.Unit(),c)){return false;}q++;}}if(1=s.$length)?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+t]);if(AO(a,b,u.Unit(),c)){return false;}t++;}}return true;};AK=function(a,b){var a,b;if(2===a.BlState){return false;}return((a.BattleAttr.OriginatedRenderFrameId+a.Bullet.StartupFrames>>0)<=b.Id)&&(((a.BattleAttr.OriginatedRenderFrameId+a.Bullet.StartupFrames>>0)+a.Bullet.ActiveFrames>>0)>b.Id);};$pkg.IsMeleeBulletActive=AK;AL=function(a,b){var a,b;if(2===a.BlState){return a.FramesInBlState>0)+a.Bullet.ActiveFrames>>0)>b.Id;};$pkg.IsMeleeBulletAlive=AL;AM=function(a,b){var a,b;if(2===a.BlState){return false;}return((a.BattleAttr.OriginatedRenderFrameId+a.Bullet.StartupFrames>>0)>0)+a.Bullet.ActiveFrames>>0)>b.Id);};$pkg.IsFireballBulletActive=AM;AN=function(a,b){var a,b;if(2===a.BlState){return a.FramesInBlState>0)+a.Bullet.ActiveFrames>>0)>b.Id;};$pkg.IsFireballBulletAlive=AN;AO=function(a,b,c,d){var a,aa,ab,ac,ad,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;e=1.7e+308;f=-1.7e+308;g=1.7e+308;h=-1.7e+308;i=e;j=f;k=g;l=h;m=a.Points;n=0;while(true){if(!(n=m.$length)?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+n]);p=((0>=o.$length?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+0])+a.X)*(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0])+((1>=o.$length?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+1])+a.Y)*(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]);if(i>p){i=p;}if(j=q.$length)?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+r]);t=((0>=s.$length?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+0])+b.X)*(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0])+((1>=s.$length?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+1])+b.Y)*(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]);if(k>t){k=t;}if(ll||jl){u=i-l;d.AContainedInB=false;}else{x=j-k;y=l-i;if(x=ab.$length?($throwRuntimeError("index out of range"),undefined):ab.$array[ab.$offset+0])))&&(0===(ac=d.Axis,(1>=ac.$length?($throwRuntimeError("index out of range"),undefined):ac.$array[ac.$offset+1]))))||z>aa){ad=1;if(u<0){ad=-1;}d.Overlap=aa;d.OverlapX=(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0])*ad;d.OverlapY=(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1])*ad;}d.Axis=c;}return false;};AP=function(a,b){var a,b,c,d;c=((A.Round(a*100)>>0));d=((A.Round(b*100)>>0));return[c,d];};$pkg.WorldToVirtualGridPos=AP;AQ=function(a,b){var a,b,c,d;c=(a)*0.01;d=(b)*0.01;return[c,d];};$pkg.VirtualGridToWorldPos=AQ;AR=function(a,b,c,d,e,f,g,h,i,j){var a,b,c,d,e,f,g,h,i,j;return[a-c-g+i,b-d-f+j];};$pkg.WorldToPolygonColliderBLPos=AR;AS=function(a,b,c,d,e,f,g,h,i,j){var a,b,c,d,e,f,g,h,i,j;return[a+c+g-i,b+d+f-j];};$pkg.PolygonColliderBLToWorldPos=AS;AT=function(a,b,c,d,e,f,g,h,i,j){var a,b,c,d,e,f,g,h,i,j,k,l,m;k=AS(a,b,c,d,e,f,g,h,i,j);l=k[0];m=k[1];return AP(l,m);};$pkg.PolygonColliderBLToVirtualGridPos=AT;AV=function(a,b,c,d,e,f,g){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,$s,$r,$c}=$restore(this,{a,b,c,d,e,f,g});$s=$s||0;s:while(true){switch($s){case 0:h=[h];h[0]=$makeSlice(BM,0,10);i=0;if((16===b.CharacterState)&&(0===c.VelX)&&(b.DirX===c.DirX)){j=1;if(0>c.DirX){j=-j;}i=j*(b.Speed)*0.01;}k=d.Check(i,0,new BN([]));if(BO.nil===k){$s=-1;return(h.$ptr||(h.$ptr=new BP(function(){return this.$target[0];},function($v){this.$target[0]=$v;},h)));}l=k.Objects;m=0;case 1:if(!(m=l.$length)?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+m]);o=false;p=n.Data;if($assertType(p,BQ,true)[1]||$assertType(p,BK,true)[1]||$assertType(p,BR,true)[1]){}else{o=true;}if(!o){m++;$s=1;continue;}q=$assertType(n.Shape,BS);s=AI(0,0,e,q);$s=3;case 3:if($c){$c=false;s=s.$blk();}if(s&&s.$blk!==undefined){break s;}r=s;t=r[0];u=r[1];v=r[2];w=r[3];if(!t){m++;$s=1;continue;}x=(w.Overlap-f)*w.OverlapX;y=(w.Overlap-f)*w.OverlapY;u=x;v=y;h[0]=$append(h[0],new C.ptr(w.OverlapX,w.OverlapY));g.X=g.X+(u);g.Y=g.Y+(v);m++;$s=1;continue;case 2:$s=-1;return(h.$ptr||(h.$ptr=new BP(function(){return this.$target[0];},function($v){this.$target[0]=$v;},h)));}return;}var $f={$blk:AV,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,$s};return $f;};AW=function(a,b,c,d){var a,aa,ab,ac,ad,ae,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;e=AC(c.Id);f=AC(c.Id-1>>0);if(0>=e){return[-2,false,0,0];}g=(h=W[$Int32.keyFor(a.CharacterState)],h!==undefined?[h.v,true]:[false,false]);i=g[1];if(i){return[-2,false,0,0];}j=$assertType(d.GetByFrameId(e),BT).InputList;k=BU.nil;if(0>0,((n<0||n>=j.$length)?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+n])));p=0;q=0;r=p;s=q;t=0;u=0;v=t;w=u;if(!(BU.nil===k)){y=AG((x=m-1>>0,((x<0||x>=k.$length)?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+x])));v=y.BtnALevel;w=y.BtnBLevel;}if(0===a.FramesToRecover){z=o.Dx;aa=o.Dy;r=z;s=aa;if(o.BtnBLevel>w){ab=(ac=V[$Int32.keyFor(a.CharacterState)],ac!==undefined?[ac.v,true]:[false,false]);ad=ab[1];if(!ad){l=true;}else if(16===a.CharacterState){l=true;}}}ae=-1;if(o.BtnALevel>v){if(0>s){ae=3;}else if(0=j.$length)?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+k]);((l<0||l>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+l]=new E.ptr(m.Id,m.VirtualGridX,m.VirtualGridY,m.DirX,m.DirY,m.VelX,m.VelY,m.Speed,m.BattleState,m.JoinIndex,m.ColliderRadius,m.Removed,m.Score,0,m.FramesToRecover-1>>0,m.FramesInChState+1>>0,m.Hp,m.MaxHp,m.CharacterState,true,false,m.OnWallNormX,m.OnWallNormY,m.ActiveSkillId,m.ActiveSkillHit,m.FramesInvinsible-1>>0,0,0));if(((l<0||l>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+l]).FramesToRecover<0){((l<0||l>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+l]).FramesToRecover=0;}if(((l<0||l>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+l]).FramesInvinsible<0){((l<0||l>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+l]).FramesInvinsible=0;}k++;}n=$makeSlice(BW,0,b.MeleeBullets.$length);o=$makeSlice(BX,0,b.FireballBullets.$length);p=$makeSlice(BM,h);q=$makeSlice(BY,h);r=$makeSlice(BZ,h);s=b.BulletLocalIdCounter;t=b.PlayersArr;u=0;case 1:if(!(u=t.$length)?($throwRuntimeError("index out of range"),undefined):t.$array[t.$offset+u]);z=((x<0||x>=g.$length)?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+x]);aa=((x<0||x>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+x]);ab=AW(y,aa,b,a);ac=ab[0];ad=ab[1];ae=ab[2];af=ab[3];((x<0||x>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+x]=ad);ag=y.JoinIndex;ah=z.SkillMapper(ac,y);$s=3;case 3:if($c){$c=false;ah=ah.$blk();}if(ah&&ah.$blk!==undefined){break s;}ai=ah;aj=(ak=U[$Int.keyFor(ai)],ak!==undefined?[ak.v,true]:[BJ.nil,false]);al=aj[0];am=aj[1];if(am){aa.ActiveSkillId=((ai>>0));aa.ActiveSkillHit=0;aa.FramesToRecover=al.RecoveryFrames;an=1;if(0>aa.DirX){an=-an;}ao=false;ap=(aq=al.Hits,ar=aa.ActiveSkillHit,((ar<0||ar>=aq.$length)?($throwRuntimeError("index out of range"),undefined):aq.$array[aq.$offset+ar]));if($assertType(ap,BK,true)[1]){as=ap.$val;v[0]=$clone(as,K);v[0].BattleAttr=new J.ptr(s,b.Id,ag,y.BulletTeamId);s=s+(1)>>0;v[0].BlState=0;n=$append(n,v[0]);if(!((-1===as.Bullet.SelfLockVelX))){ao=true;aa.VelX=$imul(an,as.Bullet.SelfLockVelX);}if(!((-1===as.Bullet.SelfLockVelY))){ao=true;aa.VelY=as.Bullet.SelfLockVelY;}}else if($assertType(ap,BR,true)[1]){at=ap.$val;w[0]=$clone(at,L);w[0].BattleAttr=new J.ptr(s,b.Id,ag,y.BulletTeamId);s=s+(1)>>0;au=y.VirtualGridX+($imul(an,w[0].Bullet.HitboxOffsetX))>>0;av=y.VirtualGridY+w[0].Bullet.HitboxOffsetY>>0;w[0].VirtualGridX=au;w[0].VirtualGridY=av;w[0].DirX=an;w[0].DirY=0;w[0].VelX=$imul(w[0].Speed,an);w[0].VelY=0;w[0].BlState=0;o=$append(o,w[0]);if(!((-1===at.Bullet.SelfLockVelX))){ao=true;aa.VelX=$imul(an,at.Bullet.SelfLockVelX);}if(!((-1===at.Bullet.SelfLockVelY))){ao=true;aa.VelY=at.Bullet.SelfLockVelY;}}if(false===ao&&false===y.InAir){aa.VelX=0;}aa.CharacterState=al.BoundChState;u++;$s=1;continue;}if(0===y.FramesToRecover){if(!((0===ae))){aw=1;if(0>ae){aw=-aw;}aa.DirX=ae;aa.DirY=af;aa.VelX=$imul(aw,y.Speed);if(Z(aa.VelX)=ay.$length)?($throwRuntimeError("index out of range"),undefined):ay.$array[ay.$offset+az]);bc=bb.JoinIndex;bd=0;be=0;(bf=bc-1>>0,((bf<0||bf>=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+bf])).X=bd;(bg=bc-1>>0,((bg<0||bg>=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+bg])).Y=be;bh=((ba<0||ba>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+ba]);bi=((ba<0||ba>=g.$length)?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+ba]);bj=bb.VirtualGridX+bb.VelX>>0;bk=bb.VirtualGridY+bb.VelY>>0;bl=bj;bm=bk;if(((ba<0||ba>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+ba])){if(16===bb.CharacterState){if(0<($imul(bb.VelX,bb.OnWallNormX))){bl=bl-(bb.VelX)>>0;}bn=-1;if(0>bb.OnWallNormX){bn=-bn;}bl=bl+(($imul(bn,bi.WallJumpingInitVelX)))>>0;bm=bm+(bi.WallJumpingInitVelY)>>0;bh.VelX=(($imul(bn,bi.WallJumpingInitVelX)));bh.VelY=(bi.WallJumpingInitVelY);bh.FramesToRecover=bi.WallJumpingFramesToRecover;}else{bh.VelY=(bi.JumpingInitVelY);bm=bm+(bi.JumpingInitVelY)>>0;}}bo=AQ(bl,bm);bp=bo[0];bq=bo[1];br=$imul(bb.ColliderRadius,2);bs=$imul(bb.ColliderRadius,4);bt=br;bu=bs;bv=bb.CharacterState;if(bv===(9)){bw=$imul(bb.ColliderRadius,4);bx=$imul(bb.ColliderRadius,2);bt=bw;bu=bx;}else if((bv===(8))||(bv===(4))||(bv===(5))||(bv===(16))){by=$imul(bb.ColliderRadius,2);bz=$imul(bb.ColliderRadius,2);bt=by;bu=bz;}ca=AQ(bt,bu);cb=ca[0];cc=ca[1];cd=AY(bp,bq,cb,cc,0.1,0.1,0.1,0.1,e,f,bb,"Player");$s=6;case 6:if($c){$c=false;cd=cd.$blk();}if(cd&&cd.$blk!==undefined){break s;}ce=cd;((ba<0||ba>=ax.$length)?($throwRuntimeError("index out of range"),undefined):ax.$array[ax.$offset+ba]=ce);$r=c.Add(new CB([ce]));$s=7;case 7:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}if(bb.InAir){if((16===bb.CharacterState)&&!((ba<0||ba>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+ba])){bh.VelX=bh.VelX+(0)>>0;bh.VelY=bi.WallSlidingVelY;}else{bh.VelX=bh.VelX+(0)>>0;bh.VelY=bh.VelY+(-50)>>0;}}az++;$s=4;continue;case 5:cf=$makeSlice(CB,0,b.MeleeBullets.$length);cg=b.MeleeBullets;ch=0;case 8:if(!(ch=cg.$length)?($throwRuntimeError("index out of range"),undefined):cg.$array[cg.$offset+ch]);cj=new K.ptr(ci.BlState,ci.FramesInBlState+1>>0,ci.BattleAttr,ci.Bullet);if(AL(cj,b)){$s=10;continue;}$s=11;continue;case 10:if(AK(cj,b)){$s=12;continue;}$s=13;continue;case 12:cm=(ck=b.PlayersArr,cl=cj.BattleAttr.OffenderJoinIndex-1>>0,((cl<0||cl>=ck.$length)?($throwRuntimeError("index out of range"),undefined):ck.$array[ck.$offset+cl]));cn=1;if(0>cm.DirX){cn=-cn;}co=AQ(cm.VirtualGridX+($imul(cn,cj.Bullet.HitboxOffsetX))>>0,cm.VirtualGridY);cp=co[0];cq=co[1];cr=AQ(cj.Bullet.HitboxSizeX,cj.Bullet.HitboxSizeY);cs=cr[0];ct=cr[1];cu=AY(cp,cq,cs,ct,0.1,0.1,0.1,0.1,e,f,cj,"MeleeBullet");$s=14;case 14:if($c){$c=false;cu=cu.$blk();}if(cu&&cu.$blk!==undefined){break s;}cv=cu;$r=c.Add(new CB([cv]));$s=15;case 15:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}cf=$append(cf,cv);cj.BlState=1;if(!((cj.BlState===ci.BlState))){cj.FramesInBlState=0;}case 13:n=$append(n,cj);case 11:ch++;$s=8;continue;case 9:cw=b.FireballBullets;cx=0;case 16:if(!(cx=cw.$length)?($throwRuntimeError("index out of range"),undefined):cw.$array[cw.$offset+cx]);cz=new L.ptr(cy.VirtualGridX,cy.VirtualGridY,cy.DirX,cy.DirY,cy.VelX,cy.VelY,cy.Speed,cy.BlState,cy.FramesInBlState+1>>0,cy.BattleAttr,cy.Bullet);if(AN(cz,b)){$s=18;continue;}$s=19;continue;case 18:if(AM(cz,b)){$s=20;continue;}$s=21;continue;case 20:da=AQ(cz.VirtualGridX,cz.VirtualGridY);db=da[0];dc=da[1];dd=AQ(cz.Bullet.HitboxSizeX,cz.Bullet.HitboxSizeY);de=dd[0];df=dd[1];dg=AY(db,dc,de,df,0.1,0.1,0.1,0.1,e,f,cz,"FireballBullet");$s=23;case 23:if($c){$c=false;dg=dg.$blk();}if(dg&&dg.$blk!==undefined){break s;}dh=dg;$r=c.Add(new CB([dh]));$s=24;case 24:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}cf=$append(cf,dh);cz.BlState=1;if(!((cz.BlState===cy.BlState))){cz.FramesInBlState=0;}di=cz.VirtualGridX+cz.VelX>>0;dj=cz.VirtualGridY+cz.VelY>>0;cz.VirtualGridX=di;cz.VirtualGridY=dj;$s=22;continue;case 21:case 22:o=$append(o,cz);case 19:cx++;$s=16;continue;case 17:dk=b.PlayersArr;dl=0;case 25:if(!(dl=dk.$length)?($throwRuntimeError("index out of range"),undefined):dk.$array[dk.$offset+dl]);dp=dn.JoinIndex;dq=((dm<0||dm>=ax.$length)?($throwRuntimeError("index out of range"),undefined):ax.$array[ax.$offset+dm]);dr=$assertType(dq.Shape,BS);ds=((dm<0||dm>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+dm]);du=AV(dp,dn,ds,dq,dr,0.1,(dt=dp-1>>0,((dt<0||dt>=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+dt])));$s=27;case 27:if($c){$c=false;du=du.$blk();}if(du&&du.$blk!==undefined){break s;}(dv=dp-1>>0,((dv<0||dv>=q.$length)?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+dv]=du));dw=((dm<0||dm>=g.$length)?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+dm]);dx=false;dy=dq.Check(0,0,new BN([]));if(!(BO.nil===dy)){$s=28;continue;}$s=29;continue;case 28:dz=dy.Objects;ea=0;case 30:if(!(ea=dz.$length)?($throwRuntimeError("index out of range"),undefined):dz.$array[dz.$offset+ea]);ec=false;ed=false;ee=false;ef=ec;eg=ed;eh=ee;ei=eb.Data;if($assertType(ei,BQ,true)[1]){eg=true;}else if($assertType(ei,BK,true)[1]||$assertType(ei,BR,true)[1]){eh=true;}else{ef=true;}if(eh){ea++;$s=30;continue;}ej=$assertType(eb.Shape,BS);el=AI(0,0,dr,ej);$s=32;case 32:if($c){$c=false;el=el.$blk();}if(el&&el.$blk!==undefined){break s;}ek=el;em=ek[0];en=ek[1];eo=ek[2];ep=ek[3];if(!em){ea++;$s=30;continue;}eq=ep.OverlapX*0+ep.OverlapY*-1;if(eg){er=(ep.Overlap-0.2)*ep.OverlapX;es=(ep.Overlap-0.2)*ep.OverlapY;en=er;eo=es;}et=(eu=dp-1>>0,((eu<0||eu>=q.$length)?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+eu])).$get();ev=0;while(true){if(!(ev=et.$length)?($throwRuntimeError("index out of range"),undefined):et.$array[et.$offset+ev]),C);ex=en*ew.X+eo*ew.Y;if(ef||(eg&&0>ex)){en=en-(ex*ew.X);eo=eo-(ex*ew.Y);}ev++;}ey=dp-1>>0;((ey<0||ey>=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+ey]).X=((ey<0||ey>=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+ey]).X+(en);ez=dp-1>>0;((ez<0||ez>=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+ez]).Y=((ez<0||ez>=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+ez]).Y+(eo);if(0.5=dn.VelY;if(fa){ds.VelY=0;ds.VelX=0;if(8===ds.CharacterState){ds.CharacterState=9;ds.FramesToRecover=dw.LayDownFramesToRecover;}else{fb=dn.CharacterState;if((fb===(8))||(fb===(4))||(fb===(5))||(fb===(16))){fc=0;fd=dn.ColliderRadius;fe=fc;ff=fd;fg=AQ(fe,ff);fh=fg[1];fi=dp-1>>0;((fi<0||fi>=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+fi]).Y=((fi<0||fi>=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+fi]).Y-(fh);}ds.CharacterState=0;ds.FramesToRecover=0;}}else{fj=(fk=Y[$Int32.keyFor(ds.CharacterState)],fk!==undefined?[fk.v,true]:[false,false]);fl=fj[1];if(fl){if(9===ds.CharacterState){if(0===ds.FramesToRecover){ds.CharacterState=10;ds.FramesToRecover=dw.GetUpFramesToRecover;}}else if(10===ds.CharacterState){if(0===ds.FramesToRecover){ds.CharacterState=0;ds.FramesInvinsible=dw.GetUpInvinsibleFrames;}}}}}if(dw.OnWallEnabled){if(ds.InAir){fm=(fn=W[$Int32.keyFor(dn.CharacterState)],fn!==undefined?[fn.v,true]:[false,false]);fo=fm[1];if(!fo){fp=(fq=dp-1>>0,((fq<0||fq>=q.$length)?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+fq])).$get();fr=0;while(true){if(!(fr=fp.$length)?($throwRuntimeError("index out of range"),undefined):fp.$array[fp.$offset+fr]),C);ft=fs.X*1+fs.Y*0;fu=fs.X*-1+fs.Y*0;if(0.9>0));fw=((fs.Y>>0));ds.OnWallNormX=fv;ds.OnWallNormY=fw;break;}if(0.9>0));fy=((fs.Y>>0));ds.OnWallNormX=fx;ds.OnWallNormY=fy;break;}fr++;}if(!dn.OnWall&&ds.OnWall){ds.VelY=0;}}}if(!ds.OnWall){fz=0;ga=0;ds.OnWallNormX=fz;ds.OnWallNormY=ga;}}dl++;$s=25;continue;case 26:gb=cf;gc=0;case 33:if(!(gc=gb.$length)?($throwRuntimeError("index out of range"),undefined):gb.$array[gb.$offset+gc]);ge=gd.Check(0,0,new BN([]));gd.Space.Remove(new CB([gd]));gf=false;if(!(BO.nil===ge)){$s=35;continue;}$s=36;continue;case 35:gg=gd.Data;if($assertType(gg,BK,true)[1]){$s=37;continue;}if($assertType(gg,BR,true)[1]){$s=38;continue;}$s=39;continue;case 37:gh=gg.$val;gj=$assertType(gd.Shape,BS);gm=(gk=b.PlayersArr,gl=gh.BattleAttr.OffenderJoinIndex-1>>0,((gl<0||gl>=gk.$length)?($throwRuntimeError("index out of range"),undefined):gk.$array[gk.$offset+gl]));gn=ge.Objects;go=0;case 40:if(!(go=gn.$length)?($throwRuntimeError("index out of range"),undefined):gn.$array[gn.$offset+go]);gq=$assertType(gp.Shape,BS);gr=gp.Data;if($assertType(gr,BQ,true)[1]){$s=42;continue;}$s=43;continue;case 42:gs=gr.$val;if(gh.BattleAttr.OffenderJoinIndex===gs.JoinIndex){go++;$s=40;continue;}gu=AI(0,0,gj,gq);$s=44;case 44:if($c){$c=false;gu=gu.$blk();}if(gu&&gu.$blk!==undefined){break s;}gt=gu;gv=gt[0];if(!gv){go++;$s=40;continue;}gf=true;gw=(gx=X[$Int32.keyFor(gs.CharacterState)],gx!==undefined?[gx.v,true]:[false,false]);gy=gw[1];if(gy){go++;$s=40;continue;}if(0gm.DirX){gz=-gz;}ha=$imul(gz,gh.Bullet.PushbackVelX);hb=gh.Bullet.PushbackVelY;hc=ha;hd=hb;hf=(he=gs.JoinIndex-1>>0,((he<0||he>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+he]));hf.VelX=hc;hf.VelY=hd;if(gh.Bullet.BlowUp){hf.CharacterState=8;}else{hf.CharacterState=3;}hh=(hg=gs.JoinIndex-1>>0,((hg<0||hg>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+hg])).FramesToRecover;if(gh.Bullet.HitStunFrames>hh){hf.FramesToRecover=gh.Bullet.HitStunFrames;}case 43:go++;$s=40;continue;case 41:$s=39;continue;case 38:gi=gg.$val;hi=$assertType(gd.Shape,BS);hl=(hj=b.PlayersArr,hk=gi.BattleAttr.OffenderJoinIndex-1>>0,((hk<0||hk>=hj.$length)?($throwRuntimeError("index out of range"),undefined):hj.$array[hj.$offset+hk]));hm=ge.Objects;hn=0;case 45:if(!(hn=hm.$length)?($throwRuntimeError("index out of range"),undefined):hm.$array[hm.$offset+hn]);hp=$assertType(ho.Shape,BS);hq=ho.Data;if($assertType(hq,BQ,true)[1]){$s=47;continue;}$s=48;continue;case 47:hr=hq.$val;if(gi.BattleAttr.OffenderJoinIndex===hr.JoinIndex){hn++;$s=45;continue;}hu=AI(0,0,hi,hp);$s=50;case 50:if($c){$c=false;hu=hu.$blk();}if(hu&&hu.$blk!==undefined){break s;}ht=hu;hv=ht[0];if(!hv){hn++;$s=45;continue;}gf=true;hw=(hx=X[$Int32.keyFor(hr.CharacterState)],hx!==undefined?[hx.v,true]:[false,false]);hy=hw[1];if(hy){hn++;$s=45;continue;}if(0hl.DirX){hz=-hz;}ia=$imul(hz,gi.Bullet.PushbackVelX);ib=gi.Bullet.PushbackVelY;ic=ia;id=ib;ig=(ie=hr.JoinIndex-1>>0,((ie<0||ie>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+ie]));ig.VelX=ic;ig.VelY=id;if(gi.Bullet.BlowUp){ig.CharacterState=8;}else{ig.CharacterState=3;}ii=(ih=hr.JoinIndex-1>>0,((ih<0||ih>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+ih])).FramesToRecover;if(gi.Bullet.HitStunFrames>ii){ig.FramesToRecover=gi.Bullet.HitStunFrames;}$s=49;continue;case 48:hs=hq;gf=true;case 49:hn++;$s=45;continue;case 46:case 39:case 36:if(gf){ij=gd.Data;if($assertType(ij,BK,true)[1]){ik=ij.$val;ik.BlState=2;ik.FramesInBlState=0;}else if($assertType(ij,BR,true)[1]){il=ij.$val;il.BlState=2;il.FramesInBlState=0;}}gc++;$s=33;continue;case 34:im=b.PlayersArr;io=0;while(true){if(!(io=im.$length)?($throwRuntimeError("index out of range"),undefined):im.$array[im.$offset+io]);ir=iq.JoinIndex;is=((ip<0||ip>=ax.$length)?($throwRuntimeError("index out of range"),undefined):ax.$array[ax.$offset+ip]);it=((ip<0||ip>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+ip]);iu=AT(is.X-(iv=ir-1>>0,((iv<0||iv>=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+iv])).X,is.Y-(iw=ir-1>>0,((iw<0||iw>=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+iw])).Y,is.W*0.5,is.H*0.5,0,0,0,0,e,f);it.VirtualGridX=iu[0];it.VirtualGridY=iu[1];if(it.InAir){ix=it.CharacterState;iy=ix;if((iy===(0))||(iy===(1))){if(it.OnWall){it.CharacterState=16;}else if(((ip<0||ip>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+ip])||(5===iq.CharacterState)){it.CharacterState=5;}else{it.CharacterState=4;}}else if(iy===(2)){it.CharacterState=6;}else if(iy===(3)){it.CharacterState=7;}}if(!((it.CharacterState===iq.CharacterState))){it.FramesInChState=0;}iz=(ja=Y[$Int32.keyFor(it.CharacterState)],ja!==undefined?[ja.v,true]:[false,false]);jb=iz[1];if(jb){it.ActiveSkillId=-1;it.ActiveSkillHit=-1;}io++;}jc=ax;jd=0;while(true){if(!(jd=jc.$length)?($throwRuntimeError("index out of range"),undefined):jc.$array[jc.$offset+jd]);je.Space.Remove(new CB([je]));jd++;}$s=-1;return new N.ptr(b.Id+1>>0,i,new $Int64(0,0),n,o,new $Uint64(0,0),false,s);}return;}var $f={$blk:AX,$c:true,$r,a,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,az,b,ba,bb,bc,bd,be,bf,bg,bh,bi,bj,bk,bl,bm,bn,bo,bp,bq,br,bs,bt,bu,bv,bw,bx,by,bz,c,ca,cb,cc,cd,ce,cf,cg,ch,ci,cj,ck,cl,cm,cn,co,cp,cq,cr,cs,ct,cu,cv,cw,cx,cy,cz,d,da,db,dc,dd,de,df,dg,dh,di,dj,dk,dl,dm,dn,dp,dq,dr,ds,dt,du,dv,dw,dx,dy,dz,e,ea,eb,ec,ed,ee,ef,eg,eh,ei,ej,ek,el,em,en,eo,ep,eq,er,es,et,eu,ev,ew,ex,ey,ez,f,fa,fb,fc,fd,fe,ff,fg,fh,fi,fj,fk,fl,fm,fn,fo,fp,fq,fr,fs,ft,fu,fv,fw,fx,fy,fz,g,ga,gb,gc,gd,ge,gf,gg,gh,gi,gj,gk,gl,gm,gn,go,gp,gq,gr,gs,gt,gu,gv,gw,gx,gy,gz,h,ha,hb,hc,hd,he,hf,hg,hh,hi,hj,hk,hl,hm,hn,ho,hp,hq,hr,hs,ht,hu,hv,hw,hx,hy,hz,i,ia,ib,ic,id,ie,ig,ih,ii,ij,ik,il,im,io,ip,iq,ir,is,it,iu,iv,iw,ix,iy,iz,j,ja,jb,jc,jd,je,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s};return $f;};$pkg.ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame=AX;AY=function(a,b,c,d,e,f,g,h,i,j,k,l){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,$s,$r,$c}=$restore(this,{a,b,c,d,e,f,g,h,i,j,k,l});$s=$s||0;s:while(true){switch($s){case 0:m=AR(a,b,c*0.5,d*0.5,e,f,g,h,i,j);n=m[0];o=m[1];p=AZ(n,o,g+c+h,f+d+e,k,l);$s=1;case 1:if($c){$c=false;p=p.$blk();}if(p&&p.$blk!==undefined){break s;}q=p;$s=2;case 2:return q;}return;}var $f={$blk:AY,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,$s};return $f;};$pkg.GenerateRectCollider=AY;AZ=function(a,b,c,d,e,f){var{a,b,c,d,e,f,g,h,$s,$r,$c}=$restore(this,{a,b,c,d,e,f});$s=$s||0;s:while(true){switch($s){case 0:g=B.NewObject(a,b,c,d,new BN([f]));h=B.NewRectangle(0,0,c,d);$r=g.SetShape(h);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}g.Data=e;$s=-1;return g;}return;}var $f={$blk:AZ,$c:true,$r,a,b,c,d,e,f,g,h,$s};return $f;};BA=function(a,b,c,d,e){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,$s,$r,$c}=$restore(this,{a,b,c,d,e});$s=$s||0;s:while(true){switch($s){case 0:f=BB(a);g=0;h=0;i=g;j=h;k=B.NewConvexPolygon(CC.nil);l=f.Points;m=0;while(true){if(!(m=l.$length)?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+m]);p=f.Points;q=0;while(true){if(!(q=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+q]);if(n===r){q++;continue;}if(A.Abs(s.X-o.X)>i){i=A.Abs(s.X-o.X);}if(A.Abs(s.Y-o.Y)>j){j=A.Abs(s.Y-o.Y);}q++;}m++;}t=0;while(true){if(!(t=u.$length)?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+t]));k.AddPoints(new CC([v.X,v.Y]));t=t+(1)>>0;}w=B.NewObject(f.Anchor.X+b,f.Anchor.Y+c,i,j,new BN([e]));$r=w.SetShape(k);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}w.Data=d;$s=-1;return w;}return;}var $f={$blk:BA,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,$s};return $f;};$pkg.GenerateConvexPolygonCollider=BA;BB=function(a){var a,b,c,d,e,f,g,h,i,j,k;b=new C.ptr(1.7e+308,1.7e+308);c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(e.X=g.$length)?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+h]);(k=f.Points,((i<0||i>=k.$length)?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+i]=new C.ptr(j.X-b.X,j.Y-b.Y)));h++;}return f;};$pkg.AlignPolygon2DToBoundingBox=BB;BC=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x;return new K.ptr(u,v,new J.ptr(a,b,c,t),new I.ptr(d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,w,x,false));};$pkg.NewMeleeBullet=BC;BD=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ab,ac,ad,ae){var a,aa,ab,ac,ad,ae,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;return new L.ptr(u,v,w,x,y,z,aa,0,0,new J.ptr(a,b,c,t),new I.ptr(d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,ad,ae,false));};$pkg.NewFireballBullet=BD;CH.methods=[{prop:"Put",name:"Put",pkg:"",typ:$funcType([$emptyInterface],[],false)},{prop:"Pop",name:"Pop",pkg:"",typ:$funcType([],[$emptyInterface],false)},{prop:"GetArrIdxByOffset",name:"GetArrIdxByOffset",pkg:"",typ:$funcType([$Int32],[$Int32],false)},{prop:"GetByOffset",name:"GetByOffset",pkg:"",typ:$funcType([$Int32],[$emptyInterface],false)},{prop:"GetByFrameId",name:"GetByFrameId",pkg:"",typ:$funcType([$Int32],[$emptyInterface],false)},{prop:"SetByFrameId",name:"SetByFrameId",pkg:"",typ:$funcType([$emptyInterface,$Int32],[$Int32,$Int32,$Int32],false)}];C.init("",[{prop:"X",name:"X",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Y",name:"Y",embedded:false,exported:true,typ:$Float64,tag:""}]);D.init("",[{prop:"Anchor",name:"Anchor",embedded:false,exported:true,typ:CD,tag:""},{prop:"Points",name:"Points",embedded:false,exported:true,typ:CE,tag:""}]);E.init("",[{prop:"Id",name:"Id",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VirtualGridX",name:"VirtualGridX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VirtualGridY",name:"VirtualGridY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"DirX",name:"DirX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"DirY",name:"DirY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VelX",name:"VelX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VelY",name:"VelY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Speed",name:"Speed",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BattleState",name:"BattleState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"JoinIndex",name:"JoinIndex",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"ColliderRadius",name:"ColliderRadius",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Removed",name:"Removed",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"Score",name:"Score",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"LastMoveGmtMillis",name:"LastMoveGmtMillis",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"FramesToRecover",name:"FramesToRecover",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"FramesInChState",name:"FramesInChState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Hp",name:"Hp",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"MaxHp",name:"MaxHp",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"CharacterState",name:"CharacterState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"InAir",name:"InAir",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"OnWall",name:"OnWall",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"OnWallNormX",name:"OnWallNormX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"OnWallNormY",name:"OnWallNormY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"ActiveSkillId",name:"ActiveSkillId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"ActiveSkillHit",name:"ActiveSkillHit",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"FramesInvinsible",name:"FramesInvinsible",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BulletTeamId",name:"BulletTeamId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"ChCollisionTeamId",name:"ChCollisionTeamId",embedded:false,exported:true,typ:$Int32,tag:""}]);F.init("",[{prop:"Dx",name:"Dx",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Dy",name:"Dy",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BtnALevel",name:"BtnALevel",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BtnBLevel",name:"BtnBLevel",embedded:false,exported:true,typ:$Int32,tag:""}]);H.init("",[{prop:"Boundary",name:"Boundary",embedded:false,exported:true,typ:CF,tag:""}]);I.init("",[{prop:"StartupFrames",name:"StartupFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"CancellableStFrame",name:"CancellableStFrame",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"CancellableEdFrame",name:"CancellableEdFrame",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"ActiveFrames",name:"ActiveFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"HitStunFrames",name:"HitStunFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BlockStunFrames",name:"BlockStunFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"PushbackVelX",name:"PushbackVelX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"PushbackVelY",name:"PushbackVelY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Damage",name:"Damage",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"SelfLockVelX",name:"SelfLockVelX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"SelfLockVelY",name:"SelfLockVelY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"HitboxOffsetX",name:"HitboxOffsetX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"HitboxOffsetY",name:"HitboxOffsetY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"HitboxSizeX",name:"HitboxSizeX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"HitboxSizeY",name:"HitboxSizeY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BlowUp",name:"BlowUp",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"ExplosionFrames",name:"ExplosionFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"SpeciesId",name:"SpeciesId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"CancelTransit",name:"CancelTransit",embedded:false,exported:true,typ:CG,tag:""}]);J.init("",[{prop:"BulletLocalId",name:"BulletLocalId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"OriginatedRenderFrameId",name:"OriginatedRenderFrameId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"OffenderJoinIndex",name:"OffenderJoinIndex",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"TeamId",name:"TeamId",embedded:false,exported:true,typ:$Int32,tag:""}]);K.init("",[{prop:"BlState",name:"BlState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"FramesInBlState",name:"FramesInBlState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BattleAttr",name:"BattleAttr",embedded:false,exported:true,typ:BH,tag:""},{prop:"Bullet",name:"Bullet",embedded:false,exported:true,typ:BI,tag:""}]);L.init("",[{prop:"VirtualGridX",name:"VirtualGridX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VirtualGridY",name:"VirtualGridY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"DirX",name:"DirX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"DirY",name:"DirY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VelX",name:"VelX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VelY",name:"VelY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Speed",name:"Speed",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BlState",name:"BlState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"FramesInBlState",name:"FramesInBlState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BattleAttr",name:"BattleAttr",embedded:false,exported:true,typ:BH,tag:""},{prop:"Bullet",name:"Bullet",embedded:false,exported:true,typ:BI,tag:""}]);M.init("",[{prop:"BattleLocalId",name:"BattleLocalId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"RecoveryFrames",name:"RecoveryFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"RecoveryFramesOnBlock",name:"RecoveryFramesOnBlock",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"RecoveryFramesOnHit",name:"RecoveryFramesOnHit",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"ReleaseTriggerType",name:"ReleaseTriggerType",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BoundChState",name:"BoundChState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Hits",name:"Hits",embedded:false,exported:true,typ:BG,tag:""}]);N.init("",[{prop:"Id",name:"Id",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"PlayersArr",name:"PlayersArr",embedded:false,exported:true,typ:BV,tag:""},{prop:"CountdownNanos",name:"CountdownNanos",embedded:false,exported:true,typ:$Int64,tag:""},{prop:"MeleeBullets",name:"MeleeBullets",embedded:false,exported:true,typ:BW,tag:""},{prop:"FireballBullets",name:"FireballBullets",embedded:false,exported:true,typ:BX,tag:""},{prop:"BackendUnconfirmedMask",name:"BackendUnconfirmedMask",embedded:false,exported:true,typ:$Uint64,tag:""},{prop:"ShouldForceResync",name:"ShouldForceResync",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"BulletLocalIdCounter",name:"BulletLocalIdCounter",embedded:false,exported:true,typ:$Int32,tag:""}]);O.init("",[{prop:"InputFrameId",name:"InputFrameId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"InputList",name:"InputList",embedded:false,exported:true,typ:BU,tag:""},{prop:"ConfirmedList",name:"ConfirmedList",embedded:false,exported:true,typ:$Uint64,tag:""}]);P.init("",[{prop:"FlAct",name:"FlAct",embedded:false,exported:true,typ:$Uint64,tag:""},{prop:"FrAct",name:"FrAct",embedded:false,exported:true,typ:$Uint64,tag:""},{prop:"X",name:"X",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Y",name:"Y",embedded:false,exported:true,typ:$Float64,tag:""}]);Q.init("",[{prop:"Ed",name:"Ed",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"St",name:"St",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"EdFrameId",name:"EdFrameId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"StFrameId",name:"StFrameId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"N",name:"N",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Cnt",name:"Cnt",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Eles",name:"Eles",embedded:false,exported:true,typ:BG,tag:""}]);S.init([$Int,BQ],[$Int],false);T.init("",[{prop:"SpeciesId",name:"SpeciesId",embedded:false,exported:true,typ:$Int,tag:""},{prop:"SpeciesName",name:"SpeciesName",embedded:false,exported:true,typ:$String,tag:""},{prop:"InAirIdleFrameIdxTurningPoint",name:"InAirIdleFrameIdxTurningPoint",embedded:false,exported:true,typ:$Int,tag:""},{prop:"InAirIdleFrameIdxTurnedCycle",name:"InAirIdleFrameIdxTurnedCycle",embedded:false,exported:true,typ:$Int,tag:""},{prop:"LayDownFrames",name:"LayDownFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"LayDownFramesToRecover",name:"LayDownFramesToRecover",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"GetUpInvinsibleFrames",name:"GetUpInvinsibleFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"GetUpFramesToRecover",name:"GetUpFramesToRecover",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Speed",name:"Speed",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"JumpingInitVelY",name:"JumpingInitVelY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"DashingEnabled",name:"DashingEnabled",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"OnWallEnabled",name:"OnWallEnabled",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"WallJumpingFramesToRecover",name:"WallJumpingFramesToRecover",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"WallJumpingInitVelX",name:"WallJumpingInitVelX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"WallJumpingInitVelY",name:"WallJumpingInitVelY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"WallSlidingVelY",name:"WallSlidingVelY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"SkillMapper",name:"SkillMapper",embedded:false,exported:true,typ:S,tag:""}]);AH.init("",[{prop:"Overlap",name:"Overlap",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"OverlapX",name:"OverlapX",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"OverlapY",name:"OverlapY",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"AContainedInB",name:"AContainedInB",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"BContainedInA",name:"BContainedInA",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"Axis",name:"Axis",embedded:false,exported:true,typ:B.Vector,tag:""}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$pkg.DIRECTION_DECODER=new BF([new BE([0,0]),new BE([0,2]),new BE([0,-2]),new BE([2,0]),new BE([-2,0]),new BE([1,1]),new BE([-1,-1]),new BE([1,-1]),new BE([-1,1])]);U=$makeMap($Int.keyFor,[{k:1,v:new M.ptr(0,30,30,30,1,2,new BG([new K.ptr(0,0,BH.nil,new I.ptr(7,13,30,22,13,9,50,0,5,5,-1,1200,0,2400,3200,false,9,1,$makeMap($Int.keyFor,[{k:1,v:2}])))]))},{k:2,v:new M.ptr(0,36,36,36,1,11,new BG([new K.ptr(0,0,BH.nil,new I.ptr(18,22,36,18,18,9,50,0,5,10,-1,1800,0,2400,3200,false,9,1,$makeMap($Int.keyFor,[{k:1,v:3}])))]))},{k:3,v:new M.ptr(0,50,50,50,1,12,new BG([new K.ptr(0,0,BH.nil,new I.ptr(8,0,0,30,999999999,9,200,700,10,50,500,1600,800,3200,3200,true,9,1,false))]))},{k:4,v:new M.ptr(0,30,30,30,1,2,new BG([new K.ptr(0,0,BH.nil,new I.ptr(7,13,30,22,13,9,50,0,5,5,-1,1200,0,2400,3200,false,15,2,$makeMap($Int.keyFor,[{k:1,v:5}])))]))},{k:5,v:new M.ptr(0,36,36,36,1,11,new BG([new K.ptr(0,0,BH.nil,new I.ptr(18,22,36,18,18,9,50,0,5,10,-1,1800,0,2400,3200,false,15,2,$makeMap($Int.keyFor,[{k:1,v:6}])))]))},{k:6,v:new M.ptr(0,45,45,45,1,12,new BG([new K.ptr(0,0,BH.nil,new I.ptr(8,0,0,28,999999999,9,200,300,10,-1,-1,2400,0,3200,3200,true,15,2,false))]))},{k:7,v:new M.ptr(0,30,30,30,1,2,new BG([new K.ptr(0,0,BH.nil,new I.ptr(7,13,30,22,13,9,50,0,5,-1,-1,1200,0,2400,3200,false,9,1,$makeMap($Int.keyFor,[{k:1,v:8}])))]))},{k:8,v:new M.ptr(0,36,36,36,1,11,new BG([new K.ptr(0,0,BH.nil,new I.ptr(18,22,36,18,18,9,50,0,5,10,-1,1800,0,2400,3200,false,9,1,$makeMap($Int.keyFor,[{k:1,v:9}])))]))},{k:9,v:new M.ptr(0,40,40,40,1,12,new BG([new K.ptr(0,0,BH.nil,new I.ptr(7,0,0,30,999999999,9,200,400,10,100,-1,1000,0,3200,3200,true,9,1,false))]))},{k:10,v:new M.ptr(0,40,40,40,1,13,new BG([new L.ptr(0,0,0,0,0,0,500,0,0,BH.nil,new I.ptr(12,0,0,999999999,15,9,200,0,20,-1,-1,2400,500,4800,3200,false,5,1,false))]))},{k:11,v:new M.ptr(0,60,60,60,1,14,new BG([new K.ptr(0,0,BH.nil,new I.ptr(3,0,0,25,999999999,9,200,700,30,100,800,800,0,4000,6400,true,15,3,false))]))},{k:255,v:new M.ptr(0,30,30,30,1,6,new BG([new K.ptr(0,0,BH.nil,new I.ptr(3,0,0,20,18,9,50,0,5,-1,-1,1200,0,3200,2400,false,9,1,false))]))},{k:256,v:new M.ptr(0,20,20,20,1,6,new BG([new K.ptr(0,0,BH.nil,new I.ptr(3,0,0,10,15,9,50,0,5,-1,-1,1200,0,3200,2400,false,15,2,false))]))},{k:257,v:new M.ptr(0,30,30,30,1,6,new BG([new K.ptr(0,0,BH.nil,new I.ptr(3,0,0,20,18,9,50,0,5,-1,-1,1200,0,3200,2400,false,9,1,false))]))}]);$pkg.Characters=$makeMap($Int.keyFor,[{k:0,v:new T.ptr(0,"MonkGirl",11,1,16,16,10,27,300,800,false,false,0,0,0,0,(function(a,b){var a,b,c,d,e,f,g,h,i,j,k,l,m,n;if(1===a){if(0===b.FramesToRecover){if(b.InAir){return 255;}else{return 1;}}else{c=(d=U[$Int.keyFor(((b.ActiveSkillId>>0)))],d!==undefined?[d.v,true]:[BJ.nil,false]);e=c[0];f=c[1];if(f){g=(h=e.Hits,i=b.ActiveSkillHit,((i<0||i>=h.$length)?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+i]));if($assertType(g,BK,true)[1]){j=g.$val;if(j.Bullet.CancellableStFrame<=b.FramesInChState&&b.FramesInChState>0)))],d!==undefined?[d.v,true]:[BJ.nil,false]);e=c[0];f=c[1];if(f){g=(h=e.Hits,i=b.ActiveSkillHit,((i<0||i>=h.$length)?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+i]));if($assertType(g,BK,true)[1]){j=g.$val;if(j.Bullet.CancellableStFrame<=b.FramesInChState&&b.FramesInChState>0)))],d!==undefined?[d.v,true]:[BJ.nil,false]);e=c[0];f=c[1];if(f){g=(h=e.Hits,i=b.ActiveSkillHit,((i<0||i>=h.$length)?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+i]));if($assertType(g,BK,true)[1]){j=g.$val;if(j.Bullet.CancellableStFrame<=b.FramesInChState&&b.FramesInChState=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+e]);g=A.MakeFullWrapper(f);$s=3;case 3:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}c=$append(c,g);e++;$s=1;continue;case 2:$s=-1;return c;}return;}var $f={$blk:O,$c:true,$r,a,b,c,d,e,f,g,$s};return $f;};$pkg.GetCollisionSpaceObjsJs=O;P=function(a,b,c,d,e,f,g,h){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,$s,$r,$c}=$restore(this,{a,b,c,d,e,f,g,h});$s=$s||0;s:while(true){switch($s){case 0:i=0.1;j=0.1;k=0.1;l=0.1;m=i;n=j;o=k;p=l;q=B.GenerateRectCollider(a,b,c,d,m,n,o,p,e,f,g,h);$s=1;case 1:if($c){$c=false;q=q.$blk();}if(q&&q.$blk!==undefined){break s;}r=A.MakeFullWrapper(q);$s=2;case 2:if($c){$c=false;r=r.$blk();}if(r&&r.$blk!==undefined){break s;}s=r;$s=3;case 3:return s;}return;}var $f={$blk:P,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,$s};return $f;};$pkg.GenerateRectColliderJs=P;Q=function(a,b,c,d,e){var{a,b,c,d,e,f,g,h,$s,$r,$c}=$restore(this,{a,b,c,d,e});$s=$s||0;s:while(true){switch($s){case 0:f=B.GenerateConvexPolygonCollider(a,b,c,d,e);$s=1;case 1:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}g=A.MakeFullWrapper(f);$s=2;case 2:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}h=g;$s=3;case 3:return h;}return;}var $f={$blk:Q,$c:true,$r,a,b,c,d,e,f,g,h,$s};return $f;};$pkg.GenerateConvexPolygonColliderJs=Q;R=function(a){var{a,b,c,d,e,f,g,h,$s,$r,$c}=$restore(this,{a});$s=$s||0;s:while(true){switch($s){case 0:b=$makeSlice(AF,a.$length,a.$length);c=a;d=0;case 1:if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);h=A.MakeFullWrapper((g=B.Characters[$Int.keyFor(f)],g!==undefined?g.v:AG.nil));$s=3;case 3:if($c){$c=false;h=h.$blk();}if(h&&h.$blk!==undefined){break s;}((e<0||e>=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+e]=h);d++;$s=1;continue;case 2:$s=-1;return b;}return;}var $f={$blk:R,$c:true,$r,a,b,c,d,e,f,g,h,$s};return $f;};$pkg.GetCharacterConfigsOrderedByJoinIndex=R;S=function(a,b,c,d,e,f,g){var{a,b,c,d,e,f,g,h,i,j,$s,$r,$c}=$restore(this,{a,b,c,d,e,f,g});$s=$s||0;s:while(true){switch($s){case 0:h=B.ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame(a,b,c,d,e,f,g);$s=1;case 1:if($c){$c=false;h=h.$blk();}if(h&&h.$blk!==undefined){break s;}i=A.MakeFullWrapper(h);$s=2;case 2:if($c){$c=false;i=i.$blk();}if(i&&i.$blk!==undefined){break s;}j=i;$s=3;case 3:return j;}return;}var $f={$blk:S,$c:true,$r,a,b,c,d,e,f,g,h,i,j,$s};return $f;};$pkg.ApplyInputFrameDownsyncDynamicsOnSingleRenderFrameJs=S;T=function(){$global.gopkgs=$externalize($makeMap($String.keyFor,[{k:"NewVec2DJs",v:new AH(G)},{k:"NewPolygon2DJs",v:new AI(H)},{k:"NewBarrierJs",v:new AJ(I)},{k:"NewPlayerDownsyncJs",v:new AK(J)},{k:"NewMeleeBulletJs",v:new AL(K)},{k:"NewFireballBulletJs",v:new AM(L)},{k:"NewNpcPatrolCue",v:new AN(M)},{k:"NewRoomDownsyncFrameJs",v:new AO(N)},{k:"NewCollisionSpaceJs",v:new AP(F)},{k:"NewInputFrameDownsync",v:new AQ(D)},{k:"NewRingBufferJs",v:new AR(E)},{k:"GenerateRectColliderJs",v:new AS(P)},{k:"GenerateConvexPolygonColliderJs",v:new AT(Q)},{k:"GetCollisionSpaceObjsJs",v:new AV(O)},{k:"WorldToPolygonColliderBLPos",v:new AW(B.WorldToPolygonColliderBLPos)},{k:"PolygonColliderBLToWorldPos",v:new AW(B.PolygonColliderBLToWorldPos)},{k:"WorldToVirtualGridPos",v:new AX(B.WorldToVirtualGridPos)},{k:"VirtualGridToWorldPos",v:new AY(B.VirtualGridToWorldPos)},{k:"GetCharacterConfigsOrderedByJoinIndex",v:new BA(R)},{k:"ApplyInputFrameDownsyncDynamicsOnSingleRenderFrameJs",v:new BG(S)},{k:"ConvertToDelayedInputFrameId",v:new BH(B.ConvertToDelayedInputFrameId)},{k:"ConvertToNoDelayInputFrameId",v:new BH(B.ConvertToNoDelayInputFrameId)},{k:"ConvertToFirstUsedRenderFrameId",v:new BH(B.ConvertToFirstUsedRenderFrameId)},{k:"ConvertToLastUsedRenderFrameId",v:new BH(B.ConvertToLastUsedRenderFrameId)},{k:"ShouldGenerateInputFrameUpsync",v:new BI(B.ShouldGenerateInputFrameUpsync)},{k:"IsMeleeBulletActive",v:new BJ(B.IsMeleeBulletActive)},{k:"IsMeleeBulletAlive",v:new BJ(B.IsMeleeBulletAlive)},{k:"IsFireballBulletActive",v:new BK(B.IsFireballBulletActive)},{k:"IsFireballBulletAlive",v:new BK(B.IsFireballBulletAlive)}]),BL);};$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=C.$init();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}if($pkg===$mainPkg){T();$mainFinished=true;}}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); $synthesizeMethods(); $initAllLinknames(); diff --git a/frontend/assets/scenes/offline_map.fire b/frontend/assets/scenes/offline_map.fire index a7293f2..dd91141 100644 --- a/frontend/assets/scenes/offline_map.fire +++ b/frontend/assets/scenes/offline_map.fire @@ -464,7 +464,7 @@ "array": [ 0, 0, - 211.36523796872766, + 210.4441731196186, 0, 0, 0, diff --git a/frontend/assets/scripts/TouchEventsManager.js b/frontend/assets/scripts/TouchEventsManager.js index 85bd01b..12932f5 100644 --- a/frontend/assets/scripts/TouchEventsManager.js +++ b/frontend/assets/scripts/TouchEventsManager.js @@ -106,6 +106,7 @@ cc.Class({ this.cachedBtnDownLevel = 0; this.cachedBtnLeftLevel = 0; this.cachedBtnRightLevel = 0; + this.cachedBtnALevel = 0; this.cachedBtnBLevel = 0; @@ -167,11 +168,11 @@ cc.Class({ evt.target.runAction(cc.scaleTo(0.1, 0.3)); }); self.btnA.on(cc.Node.EventType.TOUCH_END, function(evt) { - self.cachedBtnALevel = 0; + //self.cachedBtnALevel = 0; evt.target.runAction(cc.scaleTo(0.1, 1.0)); }); self.btnA.on(cc.Node.EventType.TOUCH_CANCEL, function(evt) { - self.cachedBtnALevel = 0; + //self.cachedBtnALevel = 0; evt.target.runAction(cc.scaleTo(0.1, 1.0)); }); } @@ -182,11 +183,11 @@ cc.Class({ evt.target.runAction(cc.scaleTo(0.1, 0.3)); }); self.btnB.on(cc.Node.EventType.TOUCH_END, function(evt) { - self.cachedBtnBLevel = 0; + //self.cachedBtnBLevel = 0; evt.target.runAction(cc.scaleTo(0.1, 1.0)); }); self.btnB.on(cc.Node.EventType.TOUCH_CANCEL, function(evt) { - self.cachedBtnBLevel = 0; + //self.cachedBtnBLevel = 0; evt.target.runAction(cc.scaleTo(0.1, 1.0)); }); } @@ -247,12 +248,14 @@ cc.Class({ case cc.macro.KEY.d: self.cachedBtnRightLevel = 0; break; + /* case cc.macro.KEY.h: self.cachedBtnALevel = 0; break; case cc.macro.KEY.j: self.cachedBtnBLevel = 0; break; + */ default: break; } @@ -464,6 +467,9 @@ cc.Class({ const discretizedDir = this.discretizeDirection(this.stickhead.x, this.stickhead.y, this.joyStickEps).encodedIdx; // There're only 9 dirs, thus using only the lower 4-bits const btnALevel = (this.cachedBtnALevel << 4); const btnBLevel = (this.cachedBtnBLevel << 5); + + this.cachedBtnALevel = 0; + this.cachedBtnBLevel = 0; return (btnBLevel + btnALevel + discretizedDir); }, diff --git a/jsexport/battle/battle.go b/jsexport/battle/battle.go index b80600f..a07c88c 100644 --- a/jsexport/battle/battle.go +++ b/jsexport/battle/battle.go @@ -23,7 +23,7 @@ const ( GRAVITY_Y = -int32(float64(0.5) * WORLD_TO_VIRTUAL_GRID_RATIO) // makes all "playerCollider.Y" a multiple of 0.5 in all cases INPUT_DELAY_FRAMES = int32(4) // in the count of render frames - INPUT_SCALE_FRAMES = uint32(2) // inputDelayedAndScaledFrameId = ((originalFrameId - InputDelayFrames) >> InputScaleFrames) + INPUT_SCALE_FRAMES = uint32(3) // inputDelayedAndScaledFrameId = ((originalFrameId - InputDelayFrames) >> InputScaleFrames) NST_DELAY_FRAMES = int32(16) // network-single-trip delay in the count of render frames, proposed to be (InputDelayFrames >> 1) because we expect a round-trip delay to be exactly "InputDelayFrames" SP_ATK_LOOKUP_FRAMES = int32(5)