0x983f10b6…313dsent to0xa7d8d9ef…d270·#13,376,010·view on Etherscan
drawStyle(allPattP, pattI, true);
let cMem = col[2];
if (showShape == true) {
if (shapeI == 1) {
noFill();
} else {
fill(col[3]);
}
if (shape == 1) {
rect(hW, hH, cW * def, cH * def);
}
if (shape == 4) {
rect(hW, hH, tEC, cH * def);
}
if (shape == 7) {
rect(hW, hH, cW * def, wEC);
}
if (shape == 2 || shape == 5 || shape == 8) {
quad(hW, hCalc, cW - wCalc, hH, hW, cH - hCalc, wCalc, hH);
}
if (shape == 3) {
circle(hW, hH, cW * def);
}
if (shape == 6) {
if (shapeI != 1) {
strokeWeight(u * 2);
stroke(col[3]);
line(hW, hCalc + 2 * u, hW, cH - hCalc - 2 * u);
strokeWeight(u * 0.8);
stroke(col[1]);
}
dTE(0);
}
if (shape == 9) {
if (shapeI != 1) {
strokeWeight(u * 2);
stroke(col[3]);
line(wCalc + 2 * u, hH, cW - wCalc - 2 * u, hH);
strokeWeight(u * 0.8);
stroke(col[1]);
}
dWE(0);
}
if (shapeI == 5) {
drawStyle(allSP, 4, false);
}
if (rS == 2) {
if (col[0] != col[3]) {
col[2] = col[0];
}
}
if (shapeI == 1 || shapeI == 3 || rS == 2) {
if (shapeI !=1) {
noStroke();
} else {
noFill();
}
if (shape != 3 && shape != 6 && shape != 9) {
for (let i = 1; i < allSP.length; i++) {
if (shapeI != 1) {
fill(col[3 - (i % 2)]);
}
quad(allSP[i][0][0][0], allSP[i][0][0][1], allSP[i][1][0][0], allSP[i][1][0][1], allSP[i][2][0][0], allSP[i][2][0][1], allSP[i][3][0][0], allSP[i][3][0][1]);
}
} else if (shape == 3) {
let rr = cW * def;
for (let i = 1; i < rS; i++) {
rr = rr - rr / 4;
if (shapeI != 1) {
fill(col[3 - (i % 2)]);
}
circle(hW, hH, rr);
}
} else {
let fdist = Math.max(Math.abs(allSP[0][0][0][0] - allSP[0][1][0][0]), Math.abs(allSP[0][0][0][1] - allSP[0][1][0][1])) / 4;
rr = 0;
let fMem;
for (let i = 1; i < rS; i++) {
rr = rr - fdist;
fMem = col[3 - (i % 2)];
fill(fMem);
strokeWeight(u * 2);
stroke(fMem);
if (shape == 6) {
line(hW, hCalc + 2 * u, hW, cH - hCalc - 2 * u);
strokeWeight(u * 0.8);
stroke(col[3]);
dTE(rr);
}
if (shape == 9) {
line(wCalc + 2 * u, hH, cW - wCalc - 2 * u, hH);
strokeWeight(u * 0.8);
stroke(col[3]);
dWE(rr);
}
}
stroke(col[1]);
noFill();
if (shape == 9) {
dWE(0);
}
if (shape == 6) {
dTE(0);
}
}
}
function dTE(v) {
curve(cW + wEC + v, 0, hW, hCalc, hW, cH - hCalc, cW + wEC + v, cH);
curve(-wEC - v, 0, hW, hCalc, hW, cH - hCalc, -wEC - v, cH);
}
function dWE(v) {
curve(0, cH + tEC + v, wCalc, hH, cW - wCalc, hH, cW, cH + tEC + v);
curve(0, - tEC - v, wCalc, hH, cW - wCalc, hH, cW, - tEC - v);
}
}
function drawStyle(allP, m, patt) {
strokeJoin(BEVEL);
fill(col[2]);
let dir;
for (let i = 0; i < allP.length; i++) {
let ls;
if (ar == 2) {
ls = 1;
} else {
ls = 0;
}
let size = Math.max((Math.abs(allP[i][ls][0][0] - allP[i][ls][allP[i][ls].length - 1][0])), Math.abs((allP[i][ls][0][1] - allP[i][ls][allP[i][ls].length - 1][1]))) / 110;
if (patt == true && m < 4 ) {
fill(col[0]);
rect(hW, hH, allP[i][0][allP[i][0].length - 1][0] - allP[i][0][0][0], allP[i][1][allP[i][1].length - 1][1] - allP[i][1][0][1]);
dir = getBin();
fill(col[2]);
}
for (let j = 0; j < allP[i].length; j++) {
if (patt == true && pattB == 1) {
line(allP[i][j][0][0], allP[i][j][0][1], allP[i][j][allP[i][j].length -1][0], allP[i][j][allP[i][j].length - 1][1]);
}
for (let k = 0; k < allP[i][j].length; k++) {
let aPx = allP[i][j][k][0];
let aPy = allP[i][j][k][1];
if (m == 1 && k + 1 < allP[i][j].length && (j < 2)) {
line(aPx, aPy, allP[i][j + 2][allP[i][j].length - k - 2][0], allP[i][j + 2][allP[i][j].length - k - 2][1]);
}
if (m == 2 && j == dir && k + 1 < allP[i][j].length) {
if (dir == 0) {
line(aPx, aPy, allP[i][j + 2][allP[i][j].length - k - 2][0], allP[i][j + 2][allP[i][j].length - k - 2][1]);
} else {
line(aPx, aPy, allP[i][j + 2][allP[i][j].length - k - 2][0], allP[i][j + 2][allP[i][j].length - k - 2][1]);
}
}
if (m == 3) {
let len, leg2;
let p1 = [allP[i][j][0][0], allP[i][j][0][1]];
let p2 = [allP[i][j][allP[i][j].length - 1][0], allP[i][j][allP[i][j].length - 1][1]];
let md = j % 2;
let leg = Math.min(Math.abs(allP[i][j][k][md] - p1[md]), Math.abs(p2[md] - allP[i][j][k][md]));
if (j == 0) {
leg2 = leg / arm;
len = Math.min(aPy + leg2, hH);
line(aPx, aPy, aPx, len);
} else if (j == 1) {
leg2 = leg * arm;
len = Math.max(aPx - leg2, hW);
line(aPx, aPy, len, aPy);
} else if (j == 2) {
leg2 = leg / arm;
len = Math.max(aPy - leg2, hH);
line(aPx, aPy, aPx, len);
} else if (j == 3) {
leg2 = leg * arm;
len = Math.min(aPx + leg2, hW);
line(aPx, aPy, len, aPy);
}
}
if (m == 4 && i + 1 < allP.length) {
line(aPx, aPy, allP[i+1][j][k][0], allP[i+1][j][k][1]);
}
if (m == 5 && i + 1 < allP.length && k + 2 < allP[i][j].length) {
line(aPx, aPy, allP[i+1][j][k+1][0], allP[i+1][j][k+1][1]);
}
if (m == 6 && i + 1 < allP.length && getBin() == 1) {
line(aPx, aPy, allP[i + 1][j][k][0], allP[i + 1][j][k][1]);
}
if (m == 7 && i + 1 < allP.length && k + 2 < allP[i][j].length && (k % 2 == 0)) {
quad(aPx, aPy, allP[i][j][k+1][0], allP[i][j][k+1][1], allP[i+1][j][k+1][0], allP[i+1][j][k+1][1], allP[i+1][j][k][0], allP[i+1][j][k][1]);
}
if (m == 8 && i + 1 < allP.length && k + 2 < allP[i][j].length && (k % 2 == i % 2)) {
quad(aPx, aPy, allP[i][j][k+1][0], allP[i][j][k+1][1], allP[i+1][j][k+1][0], allP[i+1][j][k+1][1], allP[i+1][j][k][0], allP[i+1][j][k][1]);
}
if (m == 9 && i + 1 < allP.length && k + 2 < allP[i][j].length && (k % 2 == i % 2) && getBin() == 1) {
quad(aPx, aPy, allP[i][j][k+1][0], allP[i][j][k+1][1], allP[i+1][j][k+1][0], allP[i+1][j][k+1][1], allP[i+1][j][k][0], allP[i+1][j][k][1]);
}
if (m == 10 && i + 1 < allP.length && k + 2 < allP[i][j].length) {
if (tkB == 0) {
quad(aPx, aPy, allP[i][j][k+1][0], allP[i][j][k+1][1], allP[i+1][j][k][0], allP[i+1][j][k][1], aPx, aPy);
} else {
quad(aPx, aPy, allP[i][j][k+1][0], allP[i][j][k+1][1], allP[i+1][j][k+1][0], allP[i+1][j][k+1][1], aPx, aPy);
}
}
if (patt == true) {
noFill();
if (pattB == 3) {
let fS = size;
if (u * 0.8 > size) {
noStroke();
fill(col[1]);
fS = size + 0.8 * u;
}
circle(aPx, aPy, fS);
}
if (pattB == 4) {
rect(aPx, aPy, size);
}
if (pattB == 2 && k % 2 == 1 && k + 1 < allP[i][j].length) {
line(aPx, aPy, allP[i][j][k + 1][0], allP[i][j][k + 1][1]);
}
stroke(col[1]);
fill(col[2]);
}
}
}
}
}
if (isS == "Portal") {
stroke(col[1]);
let bW, bSY;
if (shape == 1 || shape == 4 || shape == 7) {
bW = cW * def + 2*u;
bSY = allSP[0][2][0][1];
} else if (shape == 3) {
bW = 40 * u;
bSY = hW + (cW * def /2);
} else if (shape == 9) {
bW = 15 * u;
bSY = allSP[0][1][(allSP[0][1].length - 1)/2][1];
} else if (shape == 6) {
bW = 2*u;
bSY = allSP[0][1][0][1];
} else {
bW = Math.abs(allSP[0][0][0][0] - allSP[0][2][0][0]) / 10;
bSY = allSP[0][3][0][1];
}
let space = 4 * u;
let bX1 = (hW) - (bW/2);
let bX2 = (hW) + (bW/2);
let yG = (cH - bSY);
xD = bX1/(yG/space);
line(bX1, bSY + space, bX2, bSY + space);
for (let c = 2; c < yG / space; c++) {
bX1 = bX1 - xD;
bX2 = bX2 + xD;
let xD1 = getBin() * space/2 * ((getBin() * 2) - 1);
let xD2 = getBin() * space/2 * ((getBin() * 2) - 1);
line(bX1 - xD1, bSY + c * space, bX2 + xD2, bSY + c * space);
}
}
col[2] = cMem;
noLoop();
}