From 25ecd1d801a12588e07867c02ad8a10fcd9eb5fd Mon Sep 17 00:00:00 2001 From: Not-A-Normal-Robot Date: Sat, 27 Jan 2024 17:37:57 +0700 Subject: [PATCH] finish modeicons --- data/img/modeicons/zen.png | Bin 0 -> 1520 bytes js/modeicon.js | 155 ++++++++++++++++++++++++++++++++----- 2 files changed, 134 insertions(+), 21 deletions(-) create mode 100644 data/img/modeicons/zen.png diff --git a/data/img/modeicons/zen.png b/data/img/modeicons/zen.png new file mode 100644 index 0000000000000000000000000000000000000000..de30aa359aef60898565586e5e7686d0a4c9fe8e GIT binary patch literal 1520 zcmVd?E76Dwf{9VocpDLe zi6WwjXH*cus4>QCBVLFi;vE+iQ3Tut{5-3e|IQxl?9S-U@lC$@&9bxa`#it*of%+r zS(Q^OfK^Sc09G}%0$A153Sd=JD}X->Z`Z$EC${2t?9VOPhwItM75tJPaQUF!hQyzj zoRSw{@lD0wc^G%%AK6g>@AD1LQ_vLu*%=o%HtYO>{llZVA;%+G#MJvGKajYE}SL}c6#bVOLM|dWeC?f8VZWBWn z1qH}{*A-9EC0;) zXyAT)UJ>hLmx+^i3k3`o(>R1}@j0hwS#~EE8F-~^7su->qKu<{bZfT7i#*Qp7RWBs ztpW@?K+NN=%;#Iq=IMs~P!^2i4;0sMZ*IYS>N(8uqvS5p-Vvet41WF_`%zaWgwZ+yU|Om|&0hI)N1vGikiz)GU>bqn`V8@(zn*U--^LxOT9&E*wQx$NdtQhQh zftbvcPosc^9_+}Js}yjytQhP$THMZ*HBrFb9*ktl8~m#h*2#*%o})#Z1;mw}!j!cf zqJRamBCuz>FM)r0FpJwUCGLz9m9RpVHFnI2XSfGb=0*YW1~`MmnG$b~V-+w{mNj|s+!=cRQHOBu3JSNKy zyG;>exj9qja#V8xfhX=R?&Kim)5JK?-CUrIb+X4|m)L7C$8j|CY2^RyF*lyrj34SP z4(IgDKa-hHl<+Pe=X}1v&m3g6{KYYUynOpHep@w+2lFrN#eDALNV7M!TGWBg664vQ zmB<{PZ22X!^_5mYUvVU_WxO|35{nuCCH9(Zrd0tOP{dGi0sqUmy~>$J&f-OukC*XJ zbW}im@An+T<2jJ!$cMb1Q!O9AzidG)xlxp{nK*>;=CTV1aBId(q&Is4>)FH=Y~Vu9 z<82mSDcht|1#CbOn}~rNz@A>f5{rK$JEWijDv??NtZHfnu&SvQz^bNJ0IQm+FW`G{ Wm*m}1rpuK80000 { ctx.save(); ctx.translate(x, y); ctx.translate(-size / 2, -size / 2); - ctx.scale(2 * size / 128, 2 * size / 128); // rescale from 128x128 - // insert code here + ctx.scale(2 * size / 256, 2 * size / 256); + ctx.translate(72, 20); // {'move',72,20}, + ctx.rotate(0.26); // {'rotate',0.26}, + ctx.fillRect(0, 80, 160, 80); // {'fRect',0,80,160,80}, + ctx.fillRect(80, 0, 80, 81); // {'fRect',80,0,80,80}, ctx.restore(); }, ultra: (ctx, x, y, size) => { ctx.save(); ctx.translate(x, y); ctx.translate(-size / 2, -size / 2); - ctx.scale(2 * size / 128, 2 * size / 128); // rescale from 128x128 - // insert code here + ctx.scale(2 * size / 128, 2 * size / 128); + ctx.lineWidth = 12; // {'setLW',12}, + ctx.fillRect(46, 0, 36, 12); // {'fRect',46,0,36,12}, + ctx.beginPath(); // {'dCirc',64,72,48}, + ctx.arc(64, 72, 48, -0.8, 2 * Math.PI); + ctx.stroke(); + ctx.fillRect(58, 42, 12, 38); // {'fRect',58,42,12,38,4,4}, + ctx.fillRect(58, 68, 24, 12); // {'fRect',58,68,24,12,4,4}, + ctx.rotate(Math.PI / 4); // {'rotate',math.pi/4}, + ctx.fillRect(90, -64, 16, 24); // {'fRect',90,-64,16,24,4,4} ctx.restore(); }, big: (ctx, x, y, size) => { ctx.save(); ctx.translate(x, y); ctx.translate(-size / 2, -size / 2); - ctx.scale(2 * size / 128, 2 * size / 128); // rescale from 128x128 - // insert code here - ctx.restore(); - }, - zen: (ctx, x, y, size) => { - ctx.save(); - ctx.translate(x, y); - ctx.translate(-size / 2, -size / 2); - ctx.scale(2 * size / 128, 2 * size / 128); // rescale from 128x128 - // insert code here + ctx.scale(2 * size / 100, 2 * size / 100); + ctx.lineWidth = 2; // {'setLW',2}, + ctx.fillRect(0, 80, 60, 20); // {'fRect',00,80,60,20}, + ctx.fillRect(20, 60, 20, 20); // {'fRect',20,60,20,20}, + ctx.fillStyle = '#dbcfce'; // {'setCL',unpack(COLOR.lX)}, + ctx.strokeStyle = '#dbcfce'; + ctx.strokeRect(0, 80, 20, 20); // {'dRect',00,80,20,20}, + ctx.strokeRect(20, 80, 20, 20); // {'dRect',20,80,20,20}, + ctx.strokeRect(40, 80, 20, 20); // {'dRect',40,80,20,20}, + ctx.strokeRect(20, 60, 20, 20); // {'dRect',20,60,20,20}, + + // Draw grid + ctx.fillStyle = 'rgba(255,255,255,0.5)'; // {'setCL',1,1,1,.5}, + ctx.translate(0, -2); // not present in original game + ctx.fillRect(15, 20, 8, 2); // {'fRect',15,20,8,2},{'fRect',35,20,8,2},{'fRect',55,20,8,2},{'fRect',75,20,8,2}, + ctx.fillRect(35, 20, 8, 2); + ctx.fillRect(55, 20, 8, 2); + ctx.fillRect(75, 20, 8, 2); + ctx.fillRect(15, 40, 8, 2); // {'fRect',15,40,8,2},{'fRect',35,40,8,2},{'fRect',55,40,8,2},{'fRect',75,40,8,2}, + ctx.fillRect(35, 40, 8, 2); + ctx.fillRect(55, 40, 8, 2); + ctx.fillRect(75, 40, 8, 2); + ctx.fillRect(15, 60, 8, 2); // {'fRect',15,60,8,2},{'fRect',35,60,8,2},{'fRect',55,60,8,2},{'fRect',75,60,8,2}, + ctx.fillRect(35, 60, 8, 2); + ctx.fillRect(55, 60, 8, 2); + ctx.fillRect(75, 60, 8, 2); + ctx.fillRect(15, 80, 8, 2); // {'fRect',15,80,8,2},{'fRect',35,80,8,2},{'fRect',55,80,8,2},{'fRect',75,80,8,2}, + ctx.fillRect(35, 80, 8, 2); + ctx.fillRect(55, 80, 8, 2); + ctx.fillRect(75, 80, 8, 2); + + ctx.fillRect(18, 17, 2, 8); // {'fRect',18,17,2,8},{'fRect',38,17,2,8},{'fRect',58,17,2,8},{'fRect',78,17,2,8}, + ctx.fillRect(38, 17, 2, 8); + ctx.fillRect(58, 17, 2, 8); + ctx.fillRect(78, 17, 2, 8); + ctx.fillRect(18, 37, 2, 8); // {'fRect',18,37,2,8},{'fRect',38,37,2,8},{'fRect',58,37,2,8},{'fRect',78,37,2,8}, + ctx.fillRect(38, 37, 2, 8); + ctx.fillRect(58, 37, 2, 8); + ctx.fillRect(78, 37, 2, 8); + ctx.fillRect(18, 57, 2, 8); // {'fRect',18,57,2,8},{'fRect',38,57,2,8},{'fRect',58,57,2,8},{'fRect',78,57,2,8}, + ctx.fillRect(38, 57, 2, 8); + ctx.fillRect(58, 57, 2, 8); + ctx.fillRect(78, 57, 2, 8); + ctx.fillRect(18, 77, 2, 8); // {'fRect',18,77,2,8},{'fRect',38,77,2,8},{'fRect',58,77,2,8},{'fRect',78,77,2,8}, + ctx.fillRect(38, 77, 2, 8); + ctx.fillRect(58, 77, 2, 8); + ctx.fillRect(78, 77, 2, 8); ctx.restore(); }, tech: (ctx, x, y, size) => { ctx.save(); ctx.translate(x, y); ctx.translate(-size / 2, -size / 2); - ctx.scale(2 * size / 128, 2 * size / 128); // rescale from 128x128 - // insert code here + ctx.scale(2 * size / 128, 2 * size / 128); + ctx.lineWidth = 4; // {'setLW',4}, + + // Draw Erlenmeyer flask + ctx.beginPath(); // {'dPoly',51,12, 75,12, 75,43, 109,117, 17,117, 51,43}, + ctx.moveTo(51, 12); + ctx.lineTo(75, 12); + ctx.lineTo(75, 43); + ctx.lineTo(109, 117); + ctx.lineTo(17, 117); + ctx.lineTo(51, 43); + ctx.closePath(); + ctx.stroke(); + + // Draw flask rim + ctx.beginPath(); // {'fPoly',42,10, 52,10, 52,20}, + ctx.moveTo(42, 10); + ctx.lineTo(52, 10); + ctx.lineTo(52, 20); + ctx.closePath(); + ctx.fill(); + ctx.beginPath(); // {'fPoly',74,10, 84,10, 74,20}, + ctx.moveTo(74, 10); + ctx.lineTo(84, 10); + ctx.lineTo(74, 20); + ctx.closePath(); + ctx.fill(); + + // Draw flask measurement marks + ctx.beginPath(); // {'line',42,105, 62,105}, + ctx.moveTo(42, 105); + ctx.lineTo(62, 105); + ctx.moveTo(46, 91); // {'line',46,91, 62,91}, + ctx.lineTo(62, 91); + ctx.moveTo(50, 75); // {'line',50,75, 62,75}, + ctx.lineTo(62, 75); + ctx.moveTo(54, 57); // {'line',54,57, 62,57}, + ctx.lineTo(62, 57); + ctx.stroke(); ctx.restore(); }, tech_plus: (ctx, x, y, size) => { + // Draw tech icon + MODE_ICON_DRAW_FUNCTIONS.tech(ctx, x, y, size); + ctx.save(); ctx.translate(x, y); ctx.translate(-size / 2, -size / 2); - ctx.scale(2 * size / 128, 2 * size / 128); // rescale from 128x128 - // insert code here + ctx.scale(2 * size / 128, 2 * size / 128); + ctx.lineWidth = 4; + + // Draw plus icon + ctx.beginPath();// {'line',105,16, 105,38}, + ctx.moveTo(105, 16); + ctx.lineTo(105, 38); + ctx.moveTo(94, 27); // {'line',94,27, 116,27}, + ctx.lineTo(116, 27); + ctx.stroke(); ctx.restore(); }, none: ()=>{} @@ -208,7 +320,8 @@ const MODE_ICON_IMAGE_NAMES = [ // NOTE: Update this list whenever you add a new 'round', 'solo', 'sprint1','sprint2','sprint3', - 'survivor' + 'survivor', + 'zen' ];