memoscan
← all memos

Memo 0x3b6cfdda…08fe1d on Ethereum

569:(t,n,s)=>{const i=s(555),e=1.6,r=[[-5,89,-5,96,-4,98,-1,100,1,100,6,96,5,89,4,86,5,85,8,85,14,78,17,61,14,60,13,59,11,47,9,43,8,10,10,3,7,0,4,0,0,30,2,7,1,1,-5,1,-7,1,-3,6,-10,43,-13,58,-15,61,-17,66,-11,81,-4,85,-4,86],[-2,100,3,99,5,95,5,93,6,92,5,91,5,86,2,86,0,84,4,80,10,67,10,63,8,62,6,61,10,29,6,5,12,2,12,1,11,0,0,0,-2,1,2,27,2,34,-4,10,-1,4,-2,0,-7,0,-9,1,-9,3,-7,41,-12,77,-11,82,-6,87,-5,89,-8,94,-6,99,-3,100],[1,100,5,97,5,88,12,84,15,62,7,25,7,13,5,10,4,1,-5,1,-6,3,-6,40,-9,44,-11,46,-12,48,-15,79,-10,84,-8,88,-6,90,-6,98,-2,100],[1,101,6,98,6,93,5,89,5,88,14,77,14,44,11,43,6,6,7,2,7,0,-2,-1,-2,1,0,3,1,4,1,35,-1,40,-3,1,-4,0,-14,-1,-14,1,-11,2,-10,4,-11,58,-11,63,-12,64,-13,67,-6,84,-3,86,-4,87,-6,88,-6,97,-4,100],[-6,98,-8,86,-13,80,-13,64,-12,63,-9,10,-11,2,-11,1,-4,0,-5,9,-1,41,4,6,3,3,3,0,12,0,12,2,8,8,10,48,13,50,12,56,8,63,13,64,13,73,8,87,6,88,5,97,3,99,-2,100],[5,89,5,96,3,100,-2,99,-5,98,-5,95,-5,87,-14,81,-18,68,-16,65,-14,62,-11,62,-12,49,-9,25,-10,6,-15,1,-14,0,-4,1,-5,4,-4,6,-4,8,0,44,1,44,3,2,4,1,10,1,11,6,10,8,11,63,13,63,18,66,15,81,5,88],[-3,98,-1,100,5,100,6,97,6,88,7,86,7,85,10,82,11,47,9,43,10,6,11,3,11,1,-10,1,-11,3,-4,7,-9,62,-11,67,-6,79,-2,82,-1,84,-1,85,-2,87,-4,87,-4,95]];var h=new i.myRandom(1),o=new Array,a=new Array,l=new Array;function d(t,n,s,i,r){if(t.isEmpty&&t.roof)for(let o=0;o<n;o++)for(let a=0;a<n;a++)for(let d=0;d<10;d++){const d=t.x0+(.2+.6*h.rnd())*(t.x1-t.x0)/n+o*(t.x1-t.x0)/n,c=t.y0+(.2+.6*h.rnd())*(t.y1-t.y0)/n+a*(t.y1-t.y0)/n,f=t.z0+.1,M=t.z0+1.92+.1,p=CAM.planeX[0]*e/4,g=CAM.planeX[1]*e/4,m=new u(d,c,f,.02*(.5+.5*h.rnd())),C=new u(d-p,c-g,f,0),S=new u(d+p,c+g,f,0),R=new u(d-p,c-g,M,0),x=new u(d+p,c+g,M,0);if(m.BrighAndOp(s,i,r),C.BrighAndOp(s,i,r),S.BrighAndOp(s,i,r),R.BrighAndOp(s,i,r),x.BrighAndOp(s,i,r),m.UpdateColor((C.bright+S.bright+x.bright+R.bright)/4),m.isVis&&C.isVis&&S.isVis&&x.isVis&&R.isVis){m.rand.rnd()>.1+.4*m.bright&&l.push(m);break}}}class c{constructor(t,n,s){this.brease=!0,this.firstpass=!0,this.pos=[t,n,s],this.rPos=[t,n,s],this.scPos=[0,0,0],this.rand=new i.myRandom(Math.round(1e3*h.rnd())),this.speed=.25+1.5*this.rand.rnd(),this.bright=0,this.oldb=0,this.opacity=0;const e=this.rand.rnd();this.clr=[255,255,255],e<.4?this.clr=CUTCLR:e<.6&&(this.clr=[1.75*TERCLR[0],1.75*TERCLR[1],1.75*TERCLR[2]]),this.isVis=!1,this.die=0,this.alone=0}BrighAndOp(t,n,e){this.scPos=CAM.ScreenP(this.rPos,t,n,e);const r=1-.33*Math.max(0,Math.min(1,(this.scPos[2]-400)/350));if(this.isVis=!i.IsFrame(this.scPos[0],this.scPos[1],n,e,t,.5)&&i.IsVis(this.scPos,n,e),this.rand.rnd()<.05&&this.brease||this.firstpass){s.g.D=S/2;const t=this.brease?1:0,n=i.Trace(this.rPos,i.RotateXZ(LV[0],LV[1],LV[2],.2*t*(this.rand.rnd()-.5),.15*t*(this.rand.rnd()-.5)),.2*T,!0,!0),e=null==n?1:Math.min(1,n[0]/(.2*T));this.oldb=e*(this.brease?1.2+.6*this.rand.rnd():1)}const h=this.isVis&&this.die<.5&&this.alone<30?1:0;return this.opacity=this.opacity+(h-this.opacity)*(this.firstpass?1:.75),this.bright=this.bright+(this.oldb*(.5+.5*h)-this.bright)*(this.firstpass?1:.25),this.firstpass=!1,r}}class u extends c{constructor(t,n,s,i){super(t,n,s),this.delta=i,this.ind=Math.max(0,Math.min(r.length-1,Math.floor(.999*this.rand.rnd()*r.length))),this.flip=this.rand.rnd()>.5?1.25:-1.25,this.brease=!1,this.age=20*this.rand.rnd()}UpdateColor(t){this.bright=t,this.rand.rnd()<.6*this.bright+.2&&(this.clr=[TERCLR[0]/1.6,TERCLR[1]/1.6,TERCLR[2]/1.6])}Render(t,n,s){this.age-=this.delta,this.age<=0&&(this.age=20);const h=this.BrighAndOp(t,n,s),o=.8*Math.min(this.age,10-this.age,.5)*2;if(o>.01){const n=h/t,s=.016*n;birdCtx.beginPath(),birdCtx.moveTo(this.scPos[0]+this.flip*s*r[this.ind][0],this.scPos[1]-s*r[this.ind][1]);for(let t=2;t<r[this.ind].length-1;t+=2)birdCtx.lineTo(this.scPos[0]+this.flip*s*r[this.ind][t],this.scPos[1]-s*r[this.ind][t+1]);birdCtx.closePath();const a=birdCtx.createLinearGradient(this.scPos[0],this.scPos[1]-n*e,this.scPos[0],this.scPos[1]);a.addColorStop(0,i.hashColor([this.clr[0],this.clr[1],this.clr[2],.95*o])),a.addColorStop(1,i.hashColor([this.clr[0],this.clr[1],this.clr[2],.05*o]));const l=birdCtx.createLinearGradient(this.scPos[0],this.scPos[1]-n*e,this.scPos[0],this.scPos[1]);l.addColorStop(0,i.hashColor([0,0,0,.95*o])),l.addColorStop(.5,i.hashColor([0,0,0,.9*o])),l.addColorStop(1,i.hashColor([0,0,0,.05*o])),birdCtx.lineWidth=.04/t,birdCtx.strokeStyle=l;for(let t=0;t<2;t++)birdCtx.stroke();birdCtx.fillStyle=a,birdCtx.fill()}}}class f extends c{constructor(t,n,s){super(t,n,s),this.neigh=new Array,this.RDir(),this.towards=[0,1,0],this.right=[1,0,0]}RDir(){this.forward=[0,1,0];const t=2*Math.PI*this.rand.rnd()-Math.PI,n=2*Math.PI*this.rand.rnd()-Math.PI;this.forward=i.RotateXZ(0,1,0,t,n)}Render(t,n,s){let e=!1;for(let t=0;t<25;t++){e=!0;let t=[this.pos[0],this.pos[1],this.pos[2]];if(this.pos=i.addVec(this.pos,this.forward,.08*this.speed*4),(this.pos[2]>U/1.4&&this.forward[2]>0||this.pos[0]>T&&this.forward[0]>0||this.pos[0]<0&&this.forward[0]<0||this.pos[1]<0&&this.forward[1]<0||this.pos[1]>T&&this.forward[1]>0||this.pos[2]<0&&this.forward[2]<0||null!=i.GetBlock(this.pos))&&(e=!1,this.pos=t,this.RDir()),e){this.die=0;break}}e||this.die++;const r=[.08*(this.pos[0]-this.rPos[0]),.08*(this.pos[1]-this.rPos[1]),.08*(this.pos[2]-this.rPos[2])];this.towards=i.lerp(this.towards,r,.8),this.rPos=i.addVec(this.rPos,this.towards,1);const h=this.BrighAndOp(t,n,s);if(this.opacity>.1){const e=this.bright*(1+.45*this.rand.rnd()),r=i.hashColor([this.clr[0]*e,this.clr[1]*e,this.clr[2]*e,this.opacity]);let o=i.normalize(this.towards),a=[0,0,1],l=[1,0,0];Math.abs(o[2])>.999?(o=[0,0,o[2]>.5?1:-1],l=[this.right[0],this.right[1],0],l=Math.sqrt(l[0]*l[0]+l[1]*l[1])<.1?i.RotateXZ(1,0,0,0,2*Math.PI*this.rand.rnd()):i.normalize(l)):l=i.CrossProduct(o,a),this.right=l,a=i.CrossProduct(l,o);const d=.65*Math.PI*this.rand.rnd()-.35,c=CAM.ScreenP(i.addVec(this.rPos,o,.36*h),t,n,s);for(let e=-1;e<1.2;e+=2){let o=i.RotateZ(e,0,0,e*d);const u=CAM.ScreenP(i.addVec(this.rPos,i.normalize(i.addVec(i.addVec([0,0,0],l,o[0]),a,o[1])),.35*h),t,n,s);birdCtx.fillStyle=r,birdCtx.beginPath(),birdCtx.moveTo(this.scPos[0],this.scPos[1]),birdCtx.lineTo(u[0],u[1]),birdCtx.lineTo(c[0],c[1]),birdCtx.strokeStyle=r,birdCtx.lineWidth=.07/t,birdCtx.stroke(),birdCtx.fill()}}}}t.exports={SetUpEffects:function(){h=new i.myRandom(Math.round(1e3*R.random_dec())),o=new Array,a=new Array;for(let t=0;t<45;t++){const t=new Array;let n=1,s=4;h.rnd()<.08&&(n=8,s=14);const e=n+Math.round(s*h.rnd());for(let n=0;n<150;n++){const n=Math.floor(h.rnd()*T/S)*S+S/2,s=Math.floor(h.rnd()*T/S)*S+S/2,r=Math.floor(h.rnd()*U*.5/S)*S+S/2;if(null==i.GetBlock([n,s,r])){for(let i=0;i<e;i++)t.push(new f(n+2*h.rnd()-1,s+2*h.rnd()-1,r+2*h.rnd()-1));break}}0!=t.length&&(o.push(t),a.push(.1+.5*h.rnd()))}},SetUpPeople:function(t,n,s){l=new Array;for(let i of BLOCKS)for(let e of i)for(let i of e)try{d(i,2,t,n,s)}catch{}l.length<1||l.sort((function(t,n){return t.rPos[2]-n.rPos[2]}))},RenderBirds:function(t,n,s){birdCtx.imageSmoothingEnabled=!1,birdCtx.lineJoin="round";for(let i of l)i.Render(t,n,s);for(let e=0;e<o.length;e++){const r=o[e];for(let t=0;t<r.length;t++)r[t].neigh.splice(0,r[t].neigh.length),0==t&&r[t].rand.rnd()<.005&&r[t].RDir();for(let t=0;t<r.length;t++)try{const n=r[t],s=n.pos[0],i=n.pos[1],h=n.pos[2];if(n.die>5||n.alone>50)for(let t of r)if(!(t.die>0||t.alone>10)){n.die=0,n.alone=0,n.pos=[t.pos[0]+n.rand.rnd()+.01,t.pos[1]+n.rand.rnd()+.01,t.pos[2]+n.rand.rnd()+.01];break}if(t>=r.length-1)continue;for(let o=t+1;o<r.length;o++){if(n.rand.rnd()<a[e])continue;const l=r[o],d=l.pos[0],c=l.pos[1],u=l.pos[2],f=Math.abs(s-d);if(t>0&&f>4)continue;const M=Math.abs(i-c);if(t>0&&M>4)continue;const p=Math.abs(h-u);if(t>0&&p>4)continue;const g=Math.sqrt(f*f+M*M+p*p);t>0&&g>4||(l.neigh.push([t,g]),0==t&&(g>60?(l.alone++,l.alone>99999&&(l.alone=99999)):l.alone=0))}}catch{}for(let e of r)try{let h=[0,0,0],o=[0,0,0],a=!0;for(let t of e.neigh){e.rand.rnd()<.25&&(e.forward=i.lerp(e.forward,r[t[0]].forward,.08));const n=[r[t[0]].pos[0]-e.pos[0],r[t[0]].pos[1]-e.pos[1],r[t[0]].pos[2]-e.pos[2]];(a||e.rand.rnd()<.25)&&(h=i.addVec(h,n,.33)),a=!1;const s=3.5-t[1];s>0&&(o=i.addVec(o,i.normalize(n),-s))}e.forward=i.clamp(e.forward,3.3),e.forward=i.addVec(i.addVec(e.forward,h,.02),o,.04),e.Render(t,n,s)}catch{}}}}},