drawfigure.js 63 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032
  1. /* Copyright 2012 tuatha */
  2. /* This function was originally written by Tuatha for the game Persephone. */
  3. /* After Tuatha left the TF Games Site community, the code was given to */
  4. /* Narse. If you use this, you should acknowledge Tuatha for making it and */
  5. /* Narse for sharing it. Some other people did some bug fixes and other */
  6. /* modifications, but they make no claims and do not require attributions. */
  7. /* */
  8. function drawfigure(canvasname, avatar) {
  9. function shadeCylinder(context, x, y, wid, hei, clr) {
  10. var gradient = context.createLinearGradient(x, y, x + wid, y);
  11. gradient.addColorStop(0, clr);
  12. gradient.addColorStop(0.25, $.xcolor.lighten(clr, 0.75));
  13. gradient.addColorStop(0.5, clr);
  14. gradient.addColorStop(0.75, $.xcolor.darken(clr, 0.33));
  15. gradient.addColorStop(1, clr);
  16. context.fillStyle = gradient;
  17. context.fill();
  18. }
  19. function drawEllipseByCenter(ctx, cx, cy, w, h) {
  20. drawEllipse(ctx, cx - w/2.0, cy - h/2.0, w, h);
  21. }
  22. function drawEllipse(ctx, x, y, w, h)
  23. {
  24. var kappa = 0.5522848,
  25. ox = (w / 2) * kappa, // control point offset horizontal
  26. oy = (h / 2) * kappa, // control point offset vertical
  27. xe = x + w, // x-end
  28. ye = y + h, // y-end
  29. xm = x + w / 2, // x-middle
  30. ym = y + h / 2; // y-middle
  31. ctx.beginPath();
  32. ctx.moveTo(x, ym);
  33. ctx.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);
  34. ctx.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);
  35. ctx.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);
  36. ctx.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);
  37. //ctx.closePath(); // not used correctly, see comments (use to close off open path)
  38. ctx.stroke();
  39. }
  40. function drawNippleRings(ctx, bsize, ypos)
  41. {
  42. ctx.strokeStyle = skin > 28 && skin < 100 ? SKINCB : "black";
  43. drawNippleRingsSingle(ctx, bsize, ypos, 0, 3);
  44. ctx.stroke();
  45. ctx.strokeStyle = "grey";
  46. drawNippleRingsSingle(ctx, bsize, ypos, 0.25, 1);
  47. ctx.stroke();
  48. }
  49. function drawNippleRingsSingle(ctx, bsize, ypos, offset, wid)
  50. {
  51. ctx.beginPath();
  52. ctx.lineWidth = wid;
  53. var xpos = bLeft ? -1 * offset : offset;
  54. /*Nipples*/
  55. var a = bsize;
  56. if (bsize >= 11) {
  57. if (bsize < 20) a = bsize - 11;
  58. else a = bsize-20;
  59. }
  60. a = a * 0.9;
  61. var b = a / 2;
  62. var c = a / 3;
  63. var d = a / 5;
  64. var e = a / 10;
  65. var x = 0;
  66. if (shoulders < 10) x=shoulders * 6.3;
  67. else if (shoulders > 20) x = 33;
  68. else x = 73 - (shoulders * 2);
  69. var y = nipples / 3.5;
  70. if (y < 2) y = 2;
  71. var z = 18 / 3.5;
  72. if (bsize < 11) {
  73. xpos = 60 + (x / 10) - (e + (e / 2)) + xpos;
  74. ypos = 113 + b + e - (x / 3) + ypos + z/2 + y/4 + offset;
  75. } else if (bsize < 20) {
  76. xpos = 60.01 + (x / 10) - (b + (nipples / 10)) + xpos;
  77. ypos = 116.94 + a + d + (nipples / 10) - (x / 3) + ypos + z/2 + y/4 + offset;
  78. } else {
  79. xpos = 55.96 + (x / 10) - (c + (nipples / 10)) + xpos;
  80. ypos = 126.66 + (nipples / 10) + b - (x / 3) + ypos + z/2 + y/4 + offset;
  81. }
  82. ctx.arc(xpos, ypos, z, 1.6 * Math.PI, 1.4 * Math.PI, false);
  83. }
  84. function drawCollar(ctx)
  85. {
  86. ctx.strokeStyle = "black";
  87. if (avatar.items.collar == 1) ctx.fillStyle = "gold";
  88. else if (avatar.items.collar == 2) ctx.fillStyle = "copper";
  89. else ctx.fillStyle = "bronze";
  90. ctx.beginPath();
  91. ctx.lineWidth = 1.5;
  92. /*Collar*/
  93. var a = shoulders;
  94. if (a >= 11) {
  95. a = shoulders - 11;
  96. if (shoulders > 20) a = 9;
  97. }
  98. var b = a / 2;
  99. var c = a / 3;
  100. var d = a / 5;
  101. var e = a / 10;
  102. var f = a * 2;
  103. var y = 6;
  104. if (a < 11) {
  105. ctx.moveTo(60 + e + b + d, 58 - b + y);
  106. ctx.quadraticCurveTo(65 + e + b + d, 65 - b + y, 78, 65 - b + y);
  107. ctx.lineTo(78, 68 - b + y);
  108. } else {
  109. ctx.moveTo(69, 53 + y);
  110. ctx.quadraticCurveTo(74, 60 + y, 78, 74 + y);
  111. ctx.lineTo(78, 77 + y);
  112. }
  113. y += 3;
  114. if (a < 11) {
  115. ctx.quadraticCurveTo(65 + e + b + d, 65 - b + y, 60 + e + b + d, 58 - b + y);
  116. ctx.lineTo(60 + e + b + d, 58 - b + y - 3);
  117. } else {
  118. ctx.quadraticCurveTo(74, 60 + y, 69, 53 + y);
  119. ctx.lineTo(69, 53 + y - 3);
  120. }
  121. ctx.stroke();
  122. ctx.fill();
  123. ctx.beginPath();
  124. ctx.lineWidth = 0.5;
  125. ctx.fillStyle = avatar == player ? "blue" : "red";
  126. if (a < 11) ctx.arc(78, 63 - b + y, 2, 0, 2 * Math.PI, false);
  127. else ctx.arc(78, 72 + y, 2, 0, 2 * Math.PI, false);
  128. ctx.stroke();
  129. ctx.fill();
  130. }
  131. function drawHeadBand(ctx)
  132. {
  133. ctx.strokeStyle = "black";
  134. if (avatar.items.headband == 1) ctx.fillStyle = "silver";
  135. else if (avatar.items.headband == 2) ctx.fillStyle = "gold";
  136. else ctx.fillStyle = "copper";
  137. ctx.beginPath();
  138. ctx.lineWidth = 1.5;
  139. /* Head Band */
  140. var a = face;
  141. if (a >= 11) {
  142. a = face - 11;
  143. if (face > 20) a = 9;
  144. }
  145. var b = a / 2;
  146. var c = a / 3;
  147. var d = a / 5;
  148. var e = a / 10;
  149. var y = 14;
  150. if (a < 11) {
  151. ctx.moveTo(59, 5 + c + y);
  152. ctx.quadraticCurveTo(64, 7 + c + y, 79, 7 + c + y);
  153. ctx.lineTo(79, 7 + c + y + 2);
  154. } else {
  155. ctx.moveTo(59 + d, 8.4 + e + y);
  156. ctx.quadraticCurveTo(64, 10.4 + c + y, 78, 8.4 + e + y);
  157. ctx.lineTo(79, 8.4 + e + y + 2);
  158. }
  159. y += 2;
  160. if (a < 11) {
  161. ctx.quadraticCurveTo(64, 7 + c + y, 59, 5 + c + y);
  162. ctx.lineTo(59, 5 + c + y - 2);
  163. } else {
  164. ctx.quadraticCurveTo(64, 10.4 + c + y, 59 + d, 8.4 + e + y);
  165. ctx.lineTo(59 + d, 8.4 + e + y - 2);
  166. }
  167. ctx.stroke();
  168. ctx.fill();
  169. ctx.beginPath();
  170. if (avatar.items.headband == 1) ctx.strokeStyle = "silver";
  171. else if (avatar.items.headband == 2) ctx.strokeStyle = "gold";
  172. else ctx.strokeStyle = "copper";
  173. ctx.lineWidth = 2;
  174. y -= 2;
  175. if (a < 11) {
  176. ctx.moveTo(79, 7 + c + y);
  177. ctx.lineTo(79, 7 + c + y + 2);
  178. } else {
  179. ctx.moveTo(78, 8.4 + e + y);
  180. ctx.lineTo(79, 8.4 + e + y + 2);
  181. }
  182. ctx.stroke();
  183. }
  184. function drawBellyButtonStud(ctx)
  185. {
  186. /*Belly Button Stud*/
  187. var a = 21 - waist;
  188. ctx.beginPath();
  189. ctx.lineWidth = 0.5;
  190. ctx.fillStyle = avatar == player ? "blue" : "red";
  191. ctx.strokeStyle = "black";
  192. ctx.arc(80, 162 + a/5, 3, 0, 2 * Math.PI, false);
  193. ctx.stroke();
  194. ctx.fill();
  195. }
  196. function drawClitCockRing(ctx, rot, size, cock)
  197. {
  198. ctx.strokeStyle = skin > 28 && skin < 100 ? SKINCB : "black";
  199. drawClitCockRingSingle(ctx, rot, size, cock, 0, 3);
  200. ctx.stroke();
  201. ctx.strokeStyle = "grey";
  202. drawClitCockRingSingle(ctx, rot, size, cock, 0.25, 1);
  203. ctx.stroke();
  204. }
  205. function drawClitCockRingSingle(ctx, rot, size, cock, offset, wid)
  206. {
  207. ctx.save();
  208. var erect = avatar.desire > 50 && cock === true;
  209. var xoff = 80;
  210. var yoff = 215;
  211. if (erect) yoff = yoff - 12;
  212. ctx.translate(xoff - (rot / 3), yoff);
  213. if (erect) ctx.scale(1, -1);
  214. ctx.rotate(rot*Math.PI/180);
  215. ctx.beginPath();
  216. var ap = size;
  217. if (cock) {
  218. if (avatar.isFutanari() && size > 10) ap = 11;
  219. ap -= avatar.Mods.cock;
  220. }
  221. var a = (21 - ap) / 13;
  222. if (a < 1) a = 1;
  223. else if (a > 2) a = 2;
  224. ctx.lineWidth = 2;
  225. // Sizings
  226. a = ap;
  227. a = a/1.15;
  228. var b = a / 2;
  229. var c = a / 7;
  230. var d = a / 5;
  231. var l = avatar.Mods.cock;
  232. var e;
  233. if (cock) e = a / (5 + (l / 2)); // width
  234. else e = a / 10;
  235. ctx.fillStyle = LIPCOLOR;
  236. ctx.strokeStyle = LIPCOLOR;
  237. ctx.beginPath();
  238. var xpos;
  239. var ypos;
  240. if (cock) {
  241. if (ap < 11) {
  242. xpos = 75 + d;
  243. xpos += (84 - (d + e) - xpos) / 2 - 0.5;
  244. ypos = 231 - (a + b) + 1;
  245. ypos += (241 - (a + b + b) + l - ypos) / 2;
  246. //ctx.arc(75 + d - (xoff + (84 - (d + e) - (75+d)) / 2 - 0.5),
  247. // 230 + f - (a + b) + 1 - yoff + (240 + f - (a + b + b) + l - (230+f - (a + b) + 1)) / 2, 4, 1.6 * Math.PI, 1.4 * Math.PI, false);
  248. } else {
  249. xpos = 76.7 + d - 0.5;
  250. ypos = 235 - (a + a + d);
  251. }
  252. } else {
  253. a = testes - 10;
  254. if (waist < 0) a += waist;
  255. if (a < 0) a = 0;
  256. b = a / 2;
  257. c = 0;
  258. if (legs > 10 && legs <= 20) c = (legs - 10) / 10;
  259. else if (legs > 20) c = 10 / 10;
  260. xpos = 79 + c - 1;
  261. ypos = 205 - b / 2;
  262. }
  263. ctx.arc(xpos - xoff, ypos - yoff, 4, 1.6 * Math.PI, 1.4 * Math.PI, false);
  264. ctx.stroke();
  265. ctx.restore();
  266. }
  267. function drawBracelet(ctx, left, off)
  268. {
  269. if (bLeft && left) return;
  270. ctx.beginPath();
  271. ctx.strokeStyle = "gold";
  272. ctx.lineWidth = 3;
  273. var a = shoulders;
  274. if (a >= 11) {
  275. a = shoulders - 11;
  276. if (shoulders > 20) a = 9;
  277. }
  278. var b = a / 2;
  279. var c = a / 3;
  280. var d = a / 5;
  281. var e = a / 10;
  282. var g = 0;
  283. var x = 0;
  284. var y = 0;
  285. var z = 0;
  286. if (shoulders < 11) {
  287. ctx.moveTo(9 + d + d - g, 211 - (a + d + b) - off);
  288. ctx.lineTo(19 + d - g, 202 - (b + c) - off);
  289. } else {
  290. if ((hips * 3) + (ass * 1.5) > 40) g = ((((hips * 3) + (ass * 1.5)) - 40) / 5);
  291. if (7 - legs > 0) g += (7 - legs);
  292. g *= a / 9;
  293. if (g > 13.5) g = 13.5;
  294. g += ((20 - waist) / 10) * (a / 9);
  295. z = g / 2;
  296. x = a;
  297. y = a / 2;
  298. var m = 0;
  299. if (shoulders > 10) m = (shoulders - 10) / 20;
  300. ctx.moveTo(14 + x + c + b - g + off / 2, 193 - z - off);
  301. ctx.lineTo(23 + x + y + c - (g + (z/2)) + off / 2, 194 + a + d - z - off);
  302. }
  303. ctx.stroke();
  304. ctx.beginPath();
  305. ctx.lineWidth = 0.5;
  306. ctx.fillStyle = "red";
  307. if (shoulders < 11) ctx.arc(19 + d - g, 202 - (b + c) - off, 2, 0, 2 * Math.PI, false);
  308. else ctx.arc(23 + x + y + c - (g + (z/2)) + off /2, 194 + a + d - z - off, 2, 0, 2 * Math.PI, false);
  309. ctx.stroke();
  310. ctx.fill();
  311. }
  312. function drawGenitals(ctx)
  313. {
  314. ctx.strokeStyle = SKINCB;
  315. ctx.fillStyle = SKINC;
  316. drawTestes(ctx);
  317. var hasc = avatar.hasCock();
  318. var ev = avatar.physique.gentialscnt - (Math.floor(avatar.physique.gentialscnt / 2) * 2);
  319. for (var i = avatar.physique.gentialscnt; i > 0; i--) {
  320. var evi = i - (Math.floor(i / 2) * 2);
  321. var ab = (evi == 1) ? 10 : -10;
  322. var ang = ev == 1 ? ab * Math.floor(i / 2) : ab * Math.floor((i + 1) / 2);
  323. drawPenis(ctx, ang, penis, hasc);
  324. if (avatar.items.clitcockring > 0) drawClitCockRing(ctx, ang, penis, hasc);
  325. }
  326. }
  327. function drawTestes(ctx)
  328. {
  329. ctx.beginPath();
  330. var a = (21 - testes) / 13;
  331. if (a < 1) a = 1;
  332. ctx.lineWidth = a;
  333. /*Testes*/
  334. a = testes;
  335. a = a/1.4;
  336. var b = a / 2; //size
  337. var c = a / 3;
  338. var d = a / 5;
  339. var e = a / 10;
  340. var f = 1;
  341. var z;
  342. if (testes < 11)
  343. {
  344. // Balls
  345. ctx.lineWidth = 1.5;
  346. z = 0;
  347. if (waist < 0) z = waist * -0.15;
  348. ctx.moveTo(76 - d, 202 + f + z);
  349. // left
  350. ctx.bezierCurveTo(75 + b,
  351. 204 + z + f - e,
  352. 67 + a + b,
  353. 215 + z + f - (a + b),
  354. 70 + (c * 3),
  355. 222 + z + f - (a + a + b)
  356. );
  357. ctx.quadraticCurveTo(74 + b,
  358. 225 + z + f - (a + a + b + c),
  359. 78 + e,
  360. 220 + z + f - (a + b + c) - c
  361. );
  362. // right
  363. ctx.quadraticCurveTo(83 - a,
  364. 224 + z + f - (a + a + b + d) - b,
  365. 87 - a,
  366. 219 + z + f - (a + b + d)
  367. );
  368. ctx.bezierCurveTo(87 - (b + c),
  369. 214 + z + f - (a + d),
  370. 84 - b,
  371. 203 + z + f - e,
  372. 83 + d,
  373. 204 + z + f);
  374. // central line
  375. ctx.moveTo(78 + e, 220 + z + f - (a + b + c) - c);
  376. ctx.quadraticCurveTo(81 - d,
  377. 218 + z + f - (a + a + a) + a,
  378. 79,
  379. 212 + z + f - a + a);
  380. } else {
  381. // Pussy
  382. if (testes>11) ctx.lineWidth = (testes-10) / 4.5;
  383. if (ctx.lineWidth < 1) ctx.lineWidth = 1;
  384. if (ctx.lineWidth > 2) ctx.lineWidth = 2;
  385. a = testes - 10;
  386. if (waist < 0) a += waist;
  387. if (a < 0) a = 0;
  388. b = a / 2;
  389. d = a / 5;
  390. e = a / 10;
  391. c = 0;
  392. z = 0;
  393. if (legs > 10 && legs <= 20) c = (legs - 10) / 10;
  394. else if (legs > 20) c = 10 / 10;
  395. ctx.moveTo(79, 204 + (f / 1.2));
  396. ctx.quadraticCurveTo(79 + c, 204 + (f / 1.2) - d, 79 + c, 204 + (f / 1.2) - b);
  397. }
  398. ctx.fill();
  399. ctx.stroke();
  400. }
  401. function drawPenis(ctx, rot, size, cock)
  402. {
  403. ctx.save();
  404. var erect = avatar.desire > 50 && cock === true;
  405. var xoff = 80;
  406. var yoff = 215;
  407. if (erect) yoff = yoff - 12;
  408. ctx.translate(xoff - (rot / 3), yoff);
  409. if (erect) ctx.scale(1, -1);
  410. ctx.rotate(rot*Math.PI/180);
  411. ctx.beginPath();
  412. var ap = size;
  413. if (cock) {
  414. if (avatar.isFutanari() && size > 10) ap = 11;
  415. ap -= avatar.Mods.cock;
  416. }
  417. var a = (21 - ap) / 13;
  418. if (a < 1) a = 1;
  419. else if (a > 2) a = 2;
  420. ctx.lineWidth = a;
  421. // Sizings
  422. a = ap;
  423. a = a/1.15;
  424. var b = a / 2;
  425. var c = a / 7;
  426. var d = a / 5;
  427. var l = avatar.Mods.cock;
  428. var e;
  429. if (cock) e = a / (5 + (l / 2)); // width
  430. else e = a / 10;
  431. var f = 1;
  432. var y = 0;
  433. var g = 0;
  434. /*Penis*/
  435. if (cock === true) {
  436. ctx.moveTo(75 + e - xoff, 200 + f - yoff);
  437. ctx.quadraticCurveTo(72 + e - xoff, 202 + f + l - yoff,
  438. 73 + d + e - xoff, 230 + f - (a + b) + l - yoff);
  439. ctx.lineTo(84 - (d + e) - xoff, 230 + f - (a + b) + l - yoff);
  440. ctx.quadraticCurveTo(83 - d - xoff, 202 + f + l - yoff,
  441. 83 - d - xoff, 200 + f - yoff);
  442. shadeCylinder(ctx, 75+e - xoff, 200+f - yoff, 84 - (d + e) - (75+e), 230 + f - (a + b) + l - (200+f), SKINC);
  443. } else {
  444. x = 0;
  445. ctx.moveTo(75 + e - xoff, 200 + f - yoff);
  446. ctx.quadraticCurveTo(76 + d - xoff, 202 + f - (d + d) - yoff, 73 + d + e - xoff, 234 + f - (a + a + d) - yoff);
  447. ctx.lineTo(84 - (d + e) - xoff, 234 + f - (a + a + d) - yoff);
  448. ctx.quadraticCurveTo(83 - d - xoff, 202 + f - (d + d) - yoff, 84 - d - xoff, 200 + f - yoff);
  449. ctx.fill();
  450. }
  451. ctx.stroke();
  452. /*Penis Head*/
  453. ctx.fillStyle = LIPCOLOR;
  454. ctx.strokeStyle = LIPCOLOR;
  455. ctx.beginPath();
  456. if (ap < 11) {
  457. ctx.moveTo(75 + d - xoff, 230 + f - (a + b) + l - yoff);
  458. ctx.lineTo(84 - (d + e) - xoff, 230 - (a + b) + l - yoff);
  459. ctx.quadraticCurveTo(78 + d - xoff, 240 + f - (a + b + b) + l - yoff, 73 + d - xoff, 230 + f - (a + b) + l - yoff);
  460. shadeCylinder(ctx, 75 + d - xoff, 230 + f - (a + b) + 1 - yoff, 84 - (d + e) - (75+d), 240 + f - (a + b + b) + l - (230+f - (a + b) + 1), LIPCOLOR);
  461. } else if (ap<20) {
  462. ctx.moveTo(76.7 + d - xoff, 234 + f - (a + a + d) - yoff);
  463. ctx.lineTo(84 - (d + e) - xoff, 234 - (a + a + d) - yoff);
  464. ctx.quadraticCurveTo(79 - xoff, 241 + f - (a + b + b + d + d) - yoff, 72 + d + e - xoff, 234 + f - (a + a + d) - yoff);
  465. ctx.fill();
  466. }
  467. ctx.stroke();
  468. ctx.restore();
  469. }
  470. function drawPecs(ctx)
  471. {
  472. ctx.beginPath();
  473. /*Pecs*/
  474. var a = shoulders;
  475. var b = a / 2;
  476. var c = a / 3;
  477. var d = a / 5;
  478. var e = a / 10;
  479. var x = shoulders * 1.43;
  480. var y = shoulders * 0.43;
  481. var z = (breasts*((11-shoulders)*2))/20;
  482. if (shoulders <= 10) {
  483. ctx.lineWidth = (11-shoulders) / 10;
  484. ctx.moveTo(33 + x + y + (z/4), 95 + b + (z / 3));
  485. ctx.quadraticCurveTo(30 + x + y + c + c + (z / 4), 105 + z - y, 50 + c + y + (z / 4), 120 + z - (a + b + y));
  486. if (breasts < 14) ctx.quadraticCurveTo(63 + x - (c + (z / 2)), 120 + (z * 1.3) - (a + b + y), 78 - (a + c + (z / 4)), 117 + z + (z / 4) - (a + c + y));
  487. }
  488. }
  489. function drawAbs(ctx)
  490. {
  491. ctx.beginPath();
  492. /*Abs*/
  493. if (shoulders < 11) {
  494. var a = shoulders;
  495. var b = a / 2;
  496. var c = a / 3;
  497. var d = a / 5;
  498. var e = a / 10;
  499. var x = shoulders * 1.43;
  500. var y = shoulders * 0.43;
  501. var z = (breasts * ((11 - shoulders) * 2)) / 20;
  502. ctx.lineWidth = (12 - shoulders) / 12;
  503. if (waist < 1) ctx.lineWidth = 0.00001;
  504. else if (waist < 10 && ctx.lineWidth > waist / 10) ctx.lineWidth = waist / 10;
  505. ctx.moveTo(79, 125 - a);
  506. ctx.quadraticCurveTo(63 + c, 132 - a, 60 + c, 140 - a);
  507. ctx.quadraticCurveTo(62 + c, 146 - a, 63 + c, 160);
  508. }
  509. }
  510. function drawBelly(ctx)
  511. {
  512. ctx.beginPath();
  513. ctx.strokeStyle = SKINCB;
  514. ctx.fillStyle = SKINC;
  515. /*Belly*/
  516. var z = legs - 10;
  517. if (z < 0) z = 0;
  518. var a = ((waist - 10) + z) / 2;
  519. if (a < 0) a = 0;
  520. var b = a;
  521. if (legs >= 20) b = a / 5;
  522. else if (legs >= 19) b = a / 5;
  523. else if (legs >= 18) b = a / 2.8;
  524. else if (legs >= 17) b = a / 2.2;
  525. else if (legs >= 16) b = a / 1.8;
  526. else if (legs >= 15) b = a / 1.6;
  527. else if (legs >= 14) b = a / 1.5;
  528. else if (legs >= 13) b = a / 1.3;
  529. else if (legs >= 12) b = a / 1.2;
  530. else if (legs >= 11) b = a / 1.1;
  531. var c = hips / 4;
  532. ctx.lineWidth = 1;
  533. if (waist < -9) ctx.lineWidth = 0.00001;
  534. else if (waist < 0) ctx.lineWidth = (10 + waist) / 10;
  535. ctx.moveTo(85 + b + c, 200 - a);
  536. ctx.quadraticCurveTo(79, 209 + a, 74 - (b + c), 200 - a);
  537. }
  538. function drawPregs(ctx){
  539. ctx.beginPath();
  540. //Pregnancy
  541. if (waist<0){/*Upper Waist*/
  542. ctx.lineWidth = (waist * -1) / 10;
  543. if (ctx.lineWidth < 1) ctx.lineWidth = 1;
  544. else if (ctx.lineWidth > 1.8) ctx.lineWidth = 1.8;
  545. var a = shoulders;
  546. var b = a / 2;
  547. var c = a / 3;
  548. var d = a / 5;
  549. var e = a / 10;
  550. var f = a * 2;
  551. var g = 0;
  552. var x = 0;
  553. var y = 0;
  554. var z = 0;
  555. var h = 0;
  556. if (waist < 0) h = waist * -0.5;
  557. if (a < 11){
  558. ctx.moveTo(47 + (c * 3) - (h / 4), 149 - (h + a));
  559. }
  560. else{
  561. a = shoulders - 11;
  562. if (shoulders > 20) a = 9;
  563. a = a * 0.9;
  564. b = a / 2;
  565. c = a / 3;
  566. d = a / 5;
  567. e = a / 10;
  568. f = a * 2;
  569. g = 0;
  570. if ((hips * 3) + ass > 70) g = (a / 9) * ((((hips * 3) + ass) - 70) / 5);
  571. if (7 - legs > 0) g += (7 - legs);
  572. if (g > 14) g = 14;
  573. z = g / 2;
  574. x = a;
  575. y = x / 2;
  576. var m = 0;
  577. if (shoulders > 20) m = (shoulders - 20) / 10;
  578. ctx.moveTo(56 - (d + (h / 4)), 138 - (b + h));
  579. }
  580. /*Waist*/
  581. a = 0;
  582. if (shoulders < 11) {
  583. a = (11 - shoulders);
  584. if (waist < 1) {
  585. a += waist / 4;
  586. if (a < 0) a = 0;
  587. }
  588. }
  589. b = (hips + ass) * 3;
  590. if (ass > 20) b += (ass - 20) * 8;
  591. c = waist / 3;
  592. if (c < -5) c = -5;
  593. d = hips / 2;
  594. if (hips > 20) d = 10;
  595. f = 0;
  596. y = b;
  597. if (y > 100) y = 100;
  598. ctx.bezierCurveTo(53 + c - ((a / 1.2) + (y / 40.7) + (f / 5) + (b / 60)), 145 + (c / 5) + (y / 27.5), 52 + c - ((a / 1.6) + (f / 2) + (b / 40)), 161 - ((y / 6.875)),50.3 + (c / 2) - ((a / 2) + (b / 20) + (f / 2)), 175 - ((y / 22) + d));
  599. a = (hips + ass) / 2;
  600. if (a > 25) a = 25;
  601. if (legs < 5) a += 5 - legs;
  602. b = a / 2;
  603. c = a / 3;
  604. d = a / 5;
  605. e = a / 10;
  606. g = hips / 20;
  607. var h = waist * -1.7;
  608. var i = 0;
  609. var j = 0.0001;
  610. if (legs > 11) j = ((legs - 11) / 2) - ((21 - hips) / 4);
  611. if (j < 0.0001) j = 0.0001;
  612. if (legs > 11) i = (legs - 11) * 2;
  613. if (i > 9) i = 9;
  614. if (ass > hips) g = ass / 20;
  615. if (g > 1) g = 1;
  616. x = ass / 5;
  617. y = ass / 15;
  618. z = 0;
  619. if (legs < 11) z = (11 - legs) / 2;
  620. if (a > 15 && z > 20 - a) z = 20 - a;
  621. ctx.quadraticCurveTo(65 - ((ass / 8) + (hips / 12) + (h / 2) + f), 197 + f + f, 79, 206);
  622. }
  623. return ctx;
  624. }
  625. function drawBellyButton(ctx)
  626. {
  627. ctx.beginPath();
  628. /*BellyButton*/
  629. var a = 21 - waist;
  630. var b = a / 2;
  631. var c = a / 3;
  632. var d = a / 5;
  633. ctx.moveTo(80,160 + d);
  634. ctx.quadraticCurveTo(82, 162 + d, 80, 163 + d);
  635. ctx.stroke();
  636. if (avatar.items.bellybuttonstud > 0) drawBellyButtonStud(ctx);
  637. }
  638. function drawHips(ctx)
  639. {
  640. ctx.beginPath();
  641. //Hips
  642. if (legs <= 10) {
  643. var a = ((hips / 1) + ((10 - legs) / 4)) / 3;
  644. if (shoulders < 10) a -= shoulders / 1.2;
  645. else a -= 8.33;
  646. if (legs < 5) a += 5 - legs;
  647. var b = a / 2;
  648. var c = a / 3;
  649. var d = a / 5;
  650. var e = a / 10;
  651. var g = hips / 20;
  652. var h = 0;
  653. var i = 0;
  654. var j = 0.0001;
  655. if (legs > 11) j = ((legs - 11) / 2) - ((21 - hips) / 4);
  656. if (j < 0.0001) j = 0.0001;
  657. if (legs > 11) i = (legs - 11) * 2;
  658. if (i > 9) i = 9;
  659. if (waist < 11) h = (21 - waist) / 10;
  660. if (ass > hips) g = ass / 20;
  661. if (g > 1) g = 1;
  662. var x = ass / 5;
  663. var y = ass / 15;
  664. var z = 0;
  665. if (legs < 11) z = (11 - legs) / 2;
  666. ctx.lineWidth = 1;
  667. if (legs > 5) ctx.lineWidth = (11 - legs) / 6;
  668. if (waist < -9) ctx.lineWidth = 0.00001;
  669. else if (waist < 0 && ctx.lineWidth > (10 + waist) / 10) ctx.lineWidth = (10 + waist) / 10;
  670. ctx.moveTo(46+j - (b + d + (y / 3)), 174 + j - ((b / 2) + (y * 0.4) + g));
  671. ctx.quadraticCurveTo(55 + (hips / 4) - (b + d + (y / 3)), 180+h + (i / 2) - ((b / 2) + (y * 0.4) + g + (j / 1.2)), 60 + (hips / 4) - (b + d + (y / 3)), 180 + (i / 2) - ((b / 2) + (y * 0.4) + g));
  672. ctx.quadraticCurveTo(60 + (hips / 4) - (b + d + (y / 3)), 185 - ((i / 7) + (b / 2) + (y * 0.4) + g), 65 + (hips / 4) - ((i / 2) + b + d + (y / 3)), 195 - (i + (i / 4) + (b / 2) + (y * 0.4) + g));
  673. }
  674. }
  675. function drawLegMuscles(ctx)
  676. {
  677. ctx.beginPath();
  678. if (legs <= 8) {
  679. ctx.lineWidth = (9 - legs) / 9;
  680. var a = legs;
  681. var b = a / 2;
  682. var d = a / 5;
  683. var e = a / 10;
  684. ctx.moveTo(61 + e, 276 - a);
  685. ctx.quadraticCurveTo(67 - d, 260, 67 - d, 236);
  686. ctx.moveTo(61 + e, 276 - a);
  687. ctx.quadraticCurveTo(58 - e, 283 + b, 58 - e, 290 + b);
  688. }
  689. }
  690. function drawBoobs(ctx, bsize, ypos, row)
  691. {
  692. ctx.strokeStyle = SKINCB;
  693. ctx.fillStyle = SKINC;
  694. ctx.lineWidth = 1;
  695. drawBreastBlock(ctx, bsize, ypos);
  696. ctx.fill();
  697. drawBreasts(ctx, bsize, ypos);
  698. ctx.fill();
  699. drawBreasts(ctx, bsize, ypos);
  700. ctx.stroke();
  701. ctx.lineWidth = 1;
  702. ctx.fillStyle = LIPCOLOR;
  703. ctx.strokeStyle = LIPCOLOR;
  704. drawAreola(ctx, bsize, ypos);
  705. ctx.fill();
  706. drawAreola(ctx, bsize, ypos);
  707. ctx.stroke();
  708. ctx.strokeStyle = NIPPLESHADOW;
  709. drawNipples(ctx, bsize, ypos);
  710. ctx.stroke();
  711. if (avatar.items.nipplerings > row) drawNippleRings(ctx, bsize, ypos);
  712. }
  713. function drawBreasts(ctx, bsize, ypos)
  714. {
  715. ctx.beginPath();
  716. ctx.lineWidth = bsize / 13;
  717. if (ctx.lineWidth < 1) ctx.lineWidth = 1;
  718. else if (ctx.lineWidth > 1.8) ctx.lineWidth = 1.8;
  719. /*Breasts*/
  720. var a = bsize * 1.5;
  721. var b = a / 2;
  722. var c = a / 3;
  723. var d = a / 5;
  724. var e = a / 10;
  725. var x = 0;
  726. if (shoulders < 10) x = shoulders * 6.3;
  727. else if (shoulders > 20) x = 33;
  728. else x = 73 - (shoulders * 2);
  729. if (bsize < 2) return;
  730. if (bsize < 11) {
  731. ctx.moveTo(60 + (x / 10) - b, 110 - (c + (x / 3)) + ypos);
  732. ctx.bezierCurveTo(60 + (x / 10) - (b + c), 110 - (d + (x / 3)) + ypos,
  733. 60 + (x / 10) - (a + c), 110 + (a - (x / 3)) + ypos,
  734. 60 + (x / 10) - d, 110 + (a + c - (x / 3)) + ypos
  735. );
  736. ctx.bezierCurveTo(60 + b, 110 + (a + c + e - (x / 3)) + ypos,
  737. 60 + (b + c), 110 + (a + d + (e / 2) - (x / 3)) + ypos,
  738. 60 + (b + c), 110 + (a + d + (e / 2) - (x / 3)) + ypos
  739. );
  740. } else if (bsize < 20) {
  741. a = (bsize - 11) * 1.5;
  742. b = a / 2;
  743. c = a / 3;
  744. d = a / 5;
  745. e = a / 10;
  746. ctx.moveTo(51.75 + (x / 10) - (e / 2), 104.5 - (x / 3) + ypos);
  747. ctx.bezierCurveTo(46.25 + (x / 10) - (e / 2), 106.7 + b - (x / 3) + ypos,
  748. 38 + (x / 10) - d, 126.5 + d + d - (x / 3) + ypos,
  749. 56.7 + (x / 10) - d, 132 + b + c - (x / 3) + ypos
  750. );
  751. var z = 73.75 + b;
  752. if (z > 78) z = 78;
  753. ctx.bezierCurveTo(68.25 - e, 133.65 + a - (x / 3) + ypos,
  754. 73.75 - e, 130.625 + a - (x / 3) + ypos,
  755. z, 130.625 + b + d - (x / 3) + ypos
  756. );
  757. } else {
  758. a = (bsize - 20) / 2;
  759. b = a / 2;
  760. c = a / 3;
  761. d = a / 5;
  762. e = a / 10;
  763. f = a * 1.5;
  764. if (f > 20) f = 20;
  765. var g = a / 2;
  766. if (g > 30) g = 30;
  767. ctx.moveTo(51.075 + (x / 10), 104.5 - (x / 3) + ypos);
  768. ctx.bezierCurveTo(45.575 - a + (x / 10), 113.45 + a - (x / 3) + ypos,
  769. 35.5 - a + (x / 10), 131.9 + a - (x / 3) + f + ypos,
  770. 54 - a + (x / 10) + d, 143.25 + a + e - (x / 3) + f + ypos + d
  771. );
  772. ctx.bezierCurveTo(66.9 - a/2, 147.15 + a + a/2 - (x / 3) + f + ypos,
  773. 72.4 - a/2 + f, 144.125 + a + a/2 - (x / 3) + (f * 1.5) + ypos,
  774. 79.5, 140.075 + a - (x / 3) + ypos - g
  775. );
  776. }
  777. }
  778. function drawBreastBlock(ctx, bsize, ypos)
  779. {
  780. ctx.beginPath();
  781. var a = bsize*1.5;
  782. var b = a / 2;
  783. var c = a / 3;
  784. var d = a / 5;
  785. var e = a / 10;
  786. var x = 0;
  787. if (shoulders < 10) x = shoulders * 6.3;
  788. else if (shoulders > 20) x = 33;
  789. else x = 73 - (shoulders * 2);
  790. if (bsize<2) return;
  791. if (bsize < 11) {
  792. ctx.moveTo(60 + (x / 10) - (b), 110 - (c + (x / 3)) + ypos);
  793. ctx.bezierCurveTo(60 + (x / 10) - (b + c), 110 - (d + (x / 3)) + ypos,
  794. 60 + (x / 10) - (a + c), 110 + (a - (x / 3)) + ypos,
  795. 60 + (x / 10) - d, 110 + (a + c - (x / 3)) + ypos
  796. );
  797. ctx.bezierCurveTo(60 + (b), 110 + (a + c + e - (x / 3)) + ypos,
  798. 60 + (b + c), 110 + (a + d + (e / 2) - (x / 3)) + ypos,
  799. 79, 110 + (a + d + (e / 2) - (x / 3)) + ypos
  800. );
  801. ctx.lineTo(79,110);
  802. } else if (bsize < 20) {
  803. a = (bsize - 11) * 1.5;
  804. b = a / 2;
  805. c = a / 3;
  806. d = a / 5;
  807. e = a / 10;
  808. ctx.moveTo(51.75 + (x / 10) - (e / 2), 104.5 - (x / 3) + ypos);
  809. ctx.bezierCurveTo(46.25 + (x / 10) - (e / 2), 106.7 + b - (x / 3) + ypos,
  810. 38 + (x / 10) - d, 126.5 + d + d - (x / 3) + ypos,
  811. 56.7 + (x / 10) - d, 132 + b + c - (x / 3) + ypos
  812. );
  813. ctx.bezierCurveTo(68.25 - e, 133.65 + a - (x / 3) + ypos,
  814. 73.75 - e, 130.625 + a - (x / 3) + ypos,
  815. 79, 130.625 + b + d - (x / 3) + ypos
  816. );
  817. ctx.lineTo(79,110 + ypos);
  818. } else {
  819. a = (bsize-20)/2;
  820. //a = (bsize-11)*1.5;
  821. b = a / 2;
  822. c = a / 3;
  823. d = a / 5;
  824. e = a / 10;
  825. f = a * 2;
  826. if (f > 10) f = 10;
  827. ctx.moveTo(51.075 + (x / 10),104.5 - (x / 3) + ypos);
  828. ctx.bezierCurveTo(45.575 + (x / 10), 113.45 - (x / 3) + ypos,
  829. 35.5 + (x / 10), 131.9 - (x / 3) + f + ypos,
  830. 54 + (x / 10),143.25 - (x / 3) + f + ypos
  831. );
  832. ctx.bezierCurveTo(66.9,147.15 - (x / 3) + f + ypos,
  833. 72.4, 144.125 - (x / 3) + f + f + ypos,
  834. 79, 140.075 - (x / 3) + ypos
  835. );
  836. ctx.lineTo(79,110 + ypos);
  837. }
  838. }
  839. function drawCleavage(ctx) {
  840. ctx.beginPath();
  841. ctx.lineWidth = breasts/15;
  842. if (ctx.lineWidth < 1) ctx.lineWidth = 1;
  843. else if (ctx.lineWidth > 1.5) ctx.lineWidth = 1.5;
  844. /*Cleavage*/
  845. var a = (breasts - 11) * 1.5;
  846. var b = a / 2;
  847. var c = a / 3;
  848. var d = a / 5;
  849. var e = a / 10;
  850. var f = a / 1.2;
  851. var x = 0;
  852. if (shoulders < 10) x = shoulders * 6.3;
  853. else if (shoulders > 20) x = 33;
  854. else x = 73 - (shoulders * 2);
  855. if (breasts < 14) return;
  856. else if (breasts < 20) {
  857. ctx.moveTo(78.5, 121 + b + d - (x / 3));
  858. ctx.bezierCurveTo(79.5, 118 + b - (x / 3),
  859. 79.5, 108 + b - (x / 3),
  860. 78 - (e / 2), 105 + c - (x / 3)
  861. );
  862. ctx.moveTo(79.5, 121 + b + d - (x / 3));
  863. ctx.bezierCurveTo(78.5, 118 + b - (x / 3),
  864. 78.5, 108 + b - (x / 3),
  865. 80 + (e / 2), 105 + c - (x / 3)
  866. );
  867. } else {
  868. if (breasts >= 20) a = (breasts - 20) / 2;
  869. var g = a / 2;
  870. if (g > 30) g = 30;
  871. ctx.moveTo(78.5, 130.45 - (x / 3));
  872. ctx.bezierCurveTo(79.5, 124.75 - (x / 3) + f - g,
  873. 79.5, 114.75 - (x / 3),
  874. 77.325, 109.5 - (x / 3)
  875. );
  876. ctx.moveTo(79.5,130.45 - (x / 3));
  877. ctx.bezierCurveTo(78.5, 124.75 - (x / 3) + f - g,
  878. 78.5, 114.75 - (x / 3),
  879. 80.675, 109.5 - (x / 3));
  880. }
  881. ctx.stroke();
  882. }
  883. function drawAreola(ctx, bsize, ypos)
  884. {
  885. ctx.beginPath();
  886. /*Areola */
  887. ctx.lineWidth = (nipples - 11) / 7;
  888. if (ctx.lineWidth < 1) ctx.lineWidth = 1;
  889. else if (ctx.lineWidth > 1.5) ctx.lineWidth = 1.5;
  890. var a = bsize;
  891. a = a * 0.9;
  892. var b = a / 2;
  893. var c = a / 3;
  894. var d = a / 5;
  895. var e = a / 10;
  896. var x = 0;
  897. if (shoulders < 10) x=shoulders * 6.3;
  898. else if (shoulders > 20) x = 33;
  899. else x = 73 - (shoulders * 2);
  900. var y = nipples / 3;
  901. if (y < 2) y = 2;
  902. if (bsize < 11) ctx.arc(60 + (x / 10) - e, 110 + b + e - (x / 3) + ypos, y, 0, Math.PI + (Math.PI), false);
  903. else if (bsize < 20) {
  904. var a = bsize-11;
  905. a = a * 0.9;
  906. var b = a / 2;
  907. var c = a / 3;
  908. var d = a / 5;
  909. var e = a / 10;
  910. ctx.arc(59.01 + (x / 10) - b, 115.94 + a + d - (x / 3) + ypos, y, 0, Math.PI + Math.PI, false);
  911. } else {
  912. var a = bsize-20;
  913. a = a * 0.9;
  914. var b = a / 2;
  915. var c = a / 3;
  916. var d = a / 5;
  917. var e = a / 10;
  918. ctx.arc(54.96 + (x / 10) - c, 125.66 + b - (x / 3) + ypos, y, 0 ,Math.PI + Math.PI, false);
  919. }
  920. }
  921. function drawNipples(ctx, bsize, ypos)
  922. {
  923. ctx.beginPath();
  924. /*Nipples*/
  925. var a = bsize;
  926. a = a * 0.9;
  927. var b = a / 2;
  928. var c = a / 3;
  929. var d = a / 5;
  930. var e = a / 10;
  931. var x = 0;
  932. if (shoulders < 10) x=shoulders * 6.3;
  933. else if (shoulders > 20) x = 33;
  934. else x = 73 - (shoulders * 2);
  935. var y = nipples / 3.5;
  936. if (y < 2) y = 2;
  937. if (bsize < 11)ctx.arc(60 + (x / 10) - (e + (e / 2)), 111 + b + e - (x / 3) + ypos, y / 2 , 1 - (nipples / 20), 3 + (nipples / 20), false);
  938. else if (bsize < 20) {
  939. var a = bsize - 11;
  940. a = a * 0.9;
  941. var b = a / 2;
  942. var c = a / 3;
  943. var d = a / 5;
  944. var e = a / 10;
  945. ctx.arc(60.01 + (x / 10) - (b + (nipples / 10)), 114.94 + a + d + (nipples / 10) - (x / 3) + ypos, y / 2, 1.3 - (nipples / 20) ,3 + (nipples / 20), false);
  946. } else {
  947. var a = bsize-20;
  948. a = a * 0.9;
  949. var b = a / 2;
  950. var c = a / 3;
  951. var d = a / 5;
  952. var e = a / 10;
  953. ctx.arc(55.96 + (x / 10) - (c + (nipples / 10)), 124.66 + (nipples / 10) + b - (x / 3) + ypos, y / 2, 1.3 - (nipples / 20), 3 + (nipples / 20), false);
  954. }
  955. }
  956. function drawHead(ctx)
  957. {
  958. ctx.beginPath();
  959. ctx.lineWidth = (21 - face) / 10;
  960. if (ctx.lineWidth < 1.4) ctx.lineWidth = 1.4;
  961. /*Face*/
  962. var a = face;
  963. var b = a / 2;
  964. var c = a / 3;
  965. var d = a / 5;
  966. var e = a / 10;
  967. var earbottom = 37;
  968. if (a < 11) {
  969. ctx.moveTo(79, 63 - e);
  970. ctx.quadraticCurveTo(75, 64 - d, 70 + b, 64 - d);
  971. ctx.quadraticCurveTo(68, 62 - b, 59, 47 - c);
  972. ctx.lineTo(59, earbottom);
  973. ctx.bezierCurveTo(56, earbottom, 55, earbottom - 8, 59, earbottom - 10);
  974. ctx.quadraticCurveTo(59, 5 + c, 79, 5 + c);
  975. } else {
  976. var a = face - 11;
  977. if (face > 20) a = 9;
  978. var b = a / 2;
  979. var c = a / 3;
  980. var d = a / 5;
  981. var e = a / 10;
  982. var earbottom = 37;
  983. var z = 0;
  984. if (face > 20) {
  985. z = face - 20;
  986. z = z / 2;
  987. }
  988. ctx.moveTo(79,62 - d);
  989. ctx.quadraticCurveTo(75 + d + d - (z / 3),62 - d, 75 + d + d - (z / 3), 62 - d);
  990. ctx.quadraticCurveTo(68 - e, 57 + b - z, 59 + d, 44 - c);
  991. ctx.lineTo(59 + d, earbottom + c);
  992. ctx.bezierCurveTo(56 + d, earbottom, 55 + d, earbottom-7, 59 + d, earbottom - 10);
  993. ctx.quadraticCurveTo(59 + d, 8.4 + e, 79, 8.4 + e);
  994. }
  995. }
  996. function drawEyes(ctx)
  997. {
  998. ctx.beginPath();
  999. ctx.lineWidth = 1;
  1000. /*Eyes*/
  1001. var a = eyes / 6;
  1002. var b = a / 2;
  1003. var c = a / 3;
  1004. var d = a / 5;
  1005. var e = a / 10;
  1006. var x = face / 20;
  1007. var y = 27;
  1008. ctx.moveTo(73 + x + c, y + 8);//(74.1111,28)
  1009. ctx.quadraticCurveTo(69.333 + x,
  1010. y + 11,
  1011. 64.666 + x,
  1012. y + 9); //(69.3333,29,66.666,29)
  1013. ctx.quadraticCurveTo(62.333 + x,
  1014. y + 8 - b,
  1015. 64.333 + x,
  1016. y + 7.5 - c); //(65.333,26.83333,64.333,26.888)
  1017. ctx.bezierCurveTo(65.333 + x,
  1018. y + 5.5 - (b + c) - 2,
  1019. 71 + x,
  1020. y + 5.5 - (b + c) - 2,
  1021. 73.666 + x,
  1022. y + 8.5 - d); //(65.333,23.222,71,23.2222,72.666,25.888)
  1023. ctx.lineTo(73 + x, y + 8); //73,28)
  1024. }
  1025. function drawIris(ctx)
  1026. {
  1027. ctx.beginPath();
  1028. /*Iris*/
  1029. var a = eyes / 5.3;
  1030. var b = a / 2;
  1031. var c = a / 3;
  1032. var d = a / 5;
  1033. var e = eyes / 80;
  1034. var x = face / 20;
  1035. var y = 27;
  1036. ctx.moveTo(71.2 + x + e, y + 8);
  1037. ctx.lineTo(67.5 + x - e, y + 8.8);
  1038. ctx.quadraticCurveTo(65.4 + x - e, y + 6 - c, 66.8 + x - e, y + 6 - b);
  1039. ctx.quadraticCurveTo(68.1 + x + e, y + 6 - (b + d), 71.2 + x + e, y + 6 - b);
  1040. ctx.lineTo(71.2 + x + e, y + 8);
  1041. }
  1042. function drawLips(ctx)
  1043. {
  1044. ctx.fillStyle = LIPCOLOR;
  1045. ctx.strokeStyle = LIPCOLOR;
  1046. ctx.beginPath();
  1047. /*Lips*/
  1048. var a = lips / 2.4;
  1049. if (a < 0.6) a = 0.6;
  1050. var b = a / 2;
  1051. var c = a / 3;
  1052. var d = a / 5;
  1053. var e = a / 10;
  1054. var y = -0.17;
  1055. var ypos = 50;
  1056. ctx.moveTo(79, ypos);
  1057. ctx.quadraticCurveTo(77 + e, ypos - (e * 1.2), 76 - d, ypos - (y + (e / 2)));
  1058. ctx.quadraticCurveTo(79, ypos + 1.1 + d, 82 + d, ypos - (y + (e / 2)));
  1059. ctx.quadraticCurveTo(81 - e, ypos - (e * 1.2), 79, ypos);
  1060. ctx.lineWidth = 2.3 + (lips / 40);
  1061. ctx.stroke();
  1062. }
  1063. function drawNose(ctx)
  1064. {
  1065. ctx.beginPath();
  1066. ctx.strokeStyle = SKINCB;
  1067. ctx.fillStyle = SKINC;
  1068. ctx.lineWidth = (21 - face) / 15;
  1069. if (ctx.lineWidth < 1) ctx.lineWidth = 1;
  1070. /*Nose*/
  1071. var a = face;
  1072. var b = a / 2;
  1073. var c = a / 3;
  1074. var d = a / 5;
  1075. var e = a / 10;
  1076. var y = 23;
  1077. if (a < 11) {
  1078. ctx.moveTo(80, y + 8 + e);
  1079. ctx.lineTo(83 - e, y + 20 - e);
  1080. ctx.lineTo(80, y + 22 - e);
  1081. } else{
  1082. var a = face - 11;
  1083. if (face > 20) a = 9;
  1084. var b = a / 2;
  1085. var c = a / 3;
  1086. var d = a / 5;
  1087. var e = a / 10;
  1088. var z = 0;
  1089. if (face > 20) {
  1090. z = face - 20;
  1091. z = z / 10;
  1092. }
  1093. ctx.moveTo(80, y + 9 + e);
  1094. ctx.lineTo(82 - z, y + 19 - (e + z));
  1095. ctx.lineTo(80 - e, y + 20 - z);
  1096. }
  1097. ctx.stroke();
  1098. }
  1099. function drawHairBack(ctx)
  1100. {
  1101. if (avatar.physique.hairstyle == 0) return; // Bald
  1102. ctx.fillStyle = HAIRCOLOR;
  1103. ctx.strokeStyle = HAIRCOLORB;
  1104. ctx.beginPath();
  1105. /*Hairback*/
  1106. var a = hairlength;
  1107. if (a < 1) a = 1;
  1108. var b = a / 2;
  1109. var c = a / 3;
  1110. var d = a / 5;
  1111. var e = a / 10;
  1112. ctx.moveTo(61, 26);
  1113. ctx.quadraticCurveTo(60 - (c + e), 26 + (a + b), 60 - (d + e), 26 + (a * 3));
  1114. ctx.quadraticCurveTo(79, 26 + (a * 4), 97 + d + e, 26 + (a * 3));
  1115. ctx.quadraticCurveTo(97 + c + e, 26 + (a + b), 96, 26);
  1116. ctx.lineTo(61,26);
  1117. ctx.fill();
  1118. ctx.stroke();
  1119. }
  1120. function drawHairFront(ctx)
  1121. {
  1122. if (avatar.physique.hairstyle == 0) return; // Bald
  1123. ctx.beginPath();
  1124. ctx.fillStyle = HAIRCOLOR;
  1125. ctx.strokeStyle = HAIRCOLORB;
  1126. ctx.lineWidth = 1;
  1127. /*Hairfront*/
  1128. var a = hairlength;
  1129. var b = a / 2;
  1130. var c = a / 3;
  1131. var d = a / 5;
  1132. var e = a / 10;
  1133. var x = face / 7;
  1134. if (hairlength < 2) {
  1135. var z = (hairlength - 1) * 2;
  1136. if (z > 1) z = 1;
  1137. var facea = face - 11;
  1138. if (face < 11) facea = face;
  1139. var faceb = facea / 2;
  1140. var facec = facea / 3;
  1141. var faced = facea / 5;
  1142. var facee = facea / 10;
  1143. ctx.moveTo(79,8 + x + x);
  1144. ctx.quadraticCurveTo(55 + (x * 3), 15 + b, 59, 27);
  1145. ctx.quadraticCurveTo(59 + e, 27 + a + b, 59, 24 + (a * 3));
  1146. if (face < 11) {
  1147. ctx.lineTo(59 - a, 27);
  1148. ctx.quadraticCurveTo(59 - (a + a), 5 + facec, 79, 5 + facec - (b + c));
  1149. } else {
  1150. ctx.lineTo(59 + faced - a, 27);
  1151. ctx.quadraticCurveTo(59 + faced - (a + a), 8.4 + facee, 79, 8.4 + facee - (b + c));
  1152. }
  1153. } else {
  1154. ctx.moveTo(79, 8 + x + x);
  1155. if (a > 20) ctx.quadraticCurveTo(55 + (x * 3), 25, 59, 27);
  1156. else ctx.quadraticCurveTo(55 + (x * 3), 15 + b, 59, 27);
  1157. ctx.quadraticCurveTo(59 + e, 27 + a + b, 59, 24 + (a * 3));
  1158. ctx.lineTo(57, 22 + (a * 3));
  1159. ctx.quadraticCurveTo(57 - e, 25 + a + b, 57, 22);
  1160. ctx.quadraticCurveTo(58 + x, 5 + x - (e / 2), 79, 5 + x - (e / 2));
  1161. ctx.lineTo(79, 8 + x + x);
  1162. }
  1163. ctx.fill();
  1164. ctx.stroke();
  1165. }
  1166. function drawThighLine(ctx)
  1167. {
  1168. ctx.beginPath();
  1169. /*Thighline*/
  1170. var hipthick = ((hips * 3) + ass) / 4;
  1171. if (hipthick > 14) {
  1172. ctx.lineWidth = hipthick / 14;
  1173. /*Waist*/
  1174. a = 0;
  1175. if (shoulders < 11) {
  1176. a = (11 - shoulders);
  1177. if (waist < 1) {
  1178. a += waist / 4;
  1179. if (a < 0) a = 0;
  1180. }
  1181. }
  1182. b = (hips + ass) * 3;
  1183. if (ass > 20) b += (ass - 20) * 8;
  1184. c = waist / 3;
  1185. if (c < -5) c = -5;
  1186. d = hips / 2;
  1187. if (hips > 20) d = 10;
  1188. f = 0;
  1189. y = b;
  1190. if (y > 100) y = 100;
  1191. ctx.lineTo(50.3 + (c / 2) - ((a / 2) + (b / 20) + (f / 2)), 175 - ((y / 22) + d));
  1192. /*Outer Leg*/
  1193. if (legs < 11) {
  1194. a = legs;
  1195. b = a / 2;
  1196. c = a / 3;
  1197. var d = a / 5;
  1198. var e = a / 10;
  1199. f = hips / 5.5;
  1200. var g = f * (1 / 9);
  1201. ctx.quadraticCurveTo(25 + a + b + c - ((f * 4.5)), 227 - (a + b + (f * 2) + (ass / 10)), 36 + b + c, 269 + (d * 3));
  1202. }
  1203. else{
  1204. if (legs <= 20) a = legs - 11;
  1205. else a = 9;
  1206. a = a * 0.8;
  1207. b = a / 2;
  1208. c = a / 3;
  1209. var d = a / 5;
  1210. var e = a / 10;
  1211. f = hips / 5.5;
  1212. var g = f * (a / 9);
  1213. var z = 0;
  1214. if (legs > 20) {
  1215. z = legs - 20;
  1216. z /= 2;
  1217. }
  1218. ctx.quadraticCurveTo(43.3 - (c + d + (f * 4.5) + z), 202 + a + z - ((f * 2) + (ass / 10)), 44 + (a + a + d) - e, 275);
  1219. }
  1220. }
  1221. }
  1222. function drawHipLine(ctx)
  1223. {
  1224. ctx.beginPath();
  1225. /*Hipline*/
  1226. var hipthick = ((hips * 3) + ass) / 4;
  1227. if (hipthick > 17) {
  1228. ctx.lineWidth = hipthick / 17;
  1229. /*Upper Waist*/
  1230. var a = shoulders;
  1231. var b = a / 2;
  1232. var c = a / 3;
  1233. var d = a / 5;
  1234. var e = a / 10;
  1235. var f = a * 2;
  1236. var g = 0;
  1237. var x = 0;
  1238. var y = 0;
  1239. var z = 0;
  1240. var h = 0;
  1241. if (waist < 0) h = waist * -0.5;
  1242. if (a < 11) ctx.moveTo(47 + (c * 3) - (h / 4), 149 - (h + a));
  1243. else{
  1244. a = shoulders - 11;
  1245. if (shoulders > 20) a = 9;
  1246. a = a * 0.9;
  1247. b = a / 2;
  1248. c = a / 3;
  1249. d = a / 5;
  1250. e = a / 10;
  1251. f = a * 2;
  1252. g = 0;
  1253. if ((hips * 3) + ass > 70) g = (a / 9) * ((((hips * 3) + ass) - 70) / 5);
  1254. if (7 - legs > 0) g += (7 - legs);
  1255. if (g > 14) g = 14;
  1256. z = g / 2;
  1257. x = a;
  1258. y = x / 2;
  1259. var m = 0;
  1260. if (shoulders > 20) m = (shoulders - 20) / 10;
  1261. ctx.moveTo(56 - (d + (h / 4)), 138 - (b + h));
  1262. }
  1263. /*Waist*/
  1264. a = 0;
  1265. if (shoulders < 11) {
  1266. a = (11 - shoulders);
  1267. if (waist < 1) {
  1268. a += waist / 4;
  1269. if (a < 0) a = 0;
  1270. }
  1271. }
  1272. b = (hips + ass) * 3;
  1273. if (ass > 20) b += (ass - 20) * 8;
  1274. c = waist / 3;
  1275. if (c < -5) c =- 5;
  1276. d = hips / 2;
  1277. if (hips > 20) d = 10;
  1278. f = 0;
  1279. y = b;
  1280. if (y > 100) y = 100;
  1281. ctx.bezierCurveTo(53 + c - ((a / 1.2) + (y / 40.7) + (f / 5) + (b / 60)), 145 + (c / 5) + (y / 27.5), 52 + c - ((a / 1.6) + (f / 2) + (b / 40)), 161 - ((y / 6.875)), 50.3 + (c / 2) - ((a / 2) + (b / 20) + (f / 2)), 175 - ((y / 22) + d));
  1282. /*Outer Leg*/
  1283. if (legs < 11) {
  1284. a = legs;
  1285. b = a / 2;
  1286. c = a / 3;
  1287. d = a / 5;
  1288. e = a / 10;
  1289. f = hips / 5.5;
  1290. g = f * (1 / 9);
  1291. ctx.quadraticCurveTo(25 + a + b + c - ((f * 4.5)), 227 - (a + b + (f * 2) + (ass / 10)),36 + b + c,269 + (d * 3));
  1292. ctx.quadraticCurveTo(26 + a, 307 - c, 34 + (d * 2), 319 + a + d);
  1293. }
  1294. else{
  1295. if (legs <= 20) a = legs - 11;
  1296. else a = 9;
  1297. a = a * 0.8;
  1298. b = a / 2;
  1299. c = a / 3;
  1300. d = a / 5;
  1301. e = a / 10;
  1302. f = hips / 5.5;
  1303. g = f * (a / 9);
  1304. z = 0;
  1305. if (legs > 20) {
  1306. z = legs - 20;
  1307. z /= 2;
  1308. }
  1309. ctx.quadraticCurveTo(43.3 - (c + d + (f * 4.5) + z), 202 + a + z - ((f * 2) + (ass / 10)),44 + (a + a + d) - e, 275);
  1310. ctx.quadraticCurveTo(36 + (a + a + c + d) - (b + f), 304 - (a + f), 38 + (a + a + b + d), 332);
  1311. }
  1312. }
  1313. }
  1314. function drawBody(ctx)
  1315. {
  1316. /*MAIN BODY*/
  1317. ctx.beginPath();
  1318. ctx.lineWidth = (41 - (shoulders+legs)) / 20;
  1319. if (ctx.lineWidth < 1.4) ctx.lineWidth = 1.4;
  1320. /*Neck*/
  1321. var a = shoulders;
  1322. var b = a / 2;
  1323. var c = a / 3;
  1324. var d = a / 5;
  1325. var e = a / 10;
  1326. var f = a * 2;
  1327. var g = 0;
  1328. var x = 0;
  1329. var y = 0;
  1330. var z = 0;
  1331. if (a < 11) {
  1332. ctx.moveTo(79, 48);
  1333. ctx.lineTo(62 + b + d, 48);
  1334. ctx.quadraticCurveTo(61 + e + b + d, 58 - b, 62 + b + d, 68 - b);
  1335. ctx.lineTo(62 + b + d, 58 + b);
  1336. ctx.quadraticCurveTo(50 + b, 64 + b, 41 + b, 72 - d);
  1337. if (a < 6) ctx.quadraticCurveTo(39 + b, 70 + d + d, 37 + b, 72 + d);
  1338. /*Outer Arm*/
  1339. ctx.bezierCurveTo(16 + f, 74, 9 + f + a, 88 - a, 14 + f, 110 - (a + d));
  1340. ctx.lineTo(13 + f + e, 100 - d);
  1341. ctx.bezierCurveTo(4 + f + d + d + d, 127 - b - d, 14 + a + e, 130, 10 + a + b, 144 - (d * 3));
  1342. ctx.quadraticCurveTo(0 + a + b + d - (g / 2), 160 - b, 9 + d + d - g, 211 - (a + d + b));
  1343. /*Hands*/
  1344. ctx.quadraticCurveTo(13-g,223 - (b + b + c), 20 - ((d*4) + g), 226 - (b + (d * 4)));
  1345. ctx.quadraticCurveTo(23 - (d + g), 223 - (b + d), 26-g,222 - (b + c));
  1346. ctx.quadraticCurveTo(22 + c - g, 212 + (d - b), 19 + e-g,213 - (b + e));
  1347. ctx.lineTo(26 - g, 222 - (b + c));
  1348. ctx.quadraticCurveTo(32 - g, 222 - (b + d), 19 + d - g, 202 - (b + c));
  1349. /*Inner Arm*/
  1350. ctx.quadraticCurveTo(17 + d - g, 195 + b, 19 + d - g, 186 + b);
  1351. ctx.quadraticCurveTo(28 + b + d - (g / 2), 167 - (b + (c * 3)), 27 + a, 150 - (a + d + b));
  1352. ctx.quadraticCurveTo(40, 140 - a, 44 + b + e, 115 - (a + a));
  1353. ctx.lineTo(39 + (b + c), 132 - (f + b + d));
  1354. var h = 0;
  1355. if (waist < 0) h = waist * -0.5;
  1356. ctx.quadraticCurveTo(43 + (c * 3), 145 - (h + a + b), 47 + (c * 3) - (h / 4), 149 - (h + a));
  1357. } else {
  1358. a = shoulders - 11;
  1359. if (shoulders > 20) a = 9;
  1360. a = a * 0.9;
  1361. b = a / 2;
  1362. c = a / 3;
  1363. d = a / 5;
  1364. e = a / 10;
  1365. f = a * 2;
  1366. g = 0;
  1367. if ((hips * 3) + (ass * 1.5) > 40) g = ((((hips * 3) + (ass * 1.5)) - 40) / 5);
  1368. if (7 - legs > 0) g += (7 - legs);
  1369. g *= a / 9;
  1370. if (g > 13.5) g = 13.5;
  1371. g += ((20 - waist) / 10) * (a / 9);
  1372. z = g / 2;
  1373. x = a;
  1374. y = x / 2;
  1375. var m = 0;
  1376. if (shoulders > 10) m = (shoulders - 10) / 20;
  1377. ctx.moveTo(79, 48);
  1378. ctx.lineTo(69, 48);
  1379. ctx.quadraticCurveTo(69, 53, 69, 63);
  1380. ctx.quadraticCurveTo(55 + c, 69 + c, 46 + a, 70 + b);
  1381. /*Outer Arm*/
  1382. ctx.bezierCurveTo(36 + m, 74 + a + e, 40 + m,77 + a, 34 + d + m + m + m, 97);
  1383. ctx.quadraticCurveTo(28 + m + m + m + d + b, 115, 24 + b + m + m + b, 138);
  1384. ctx.quadraticCurveTo(17 + a + c + m + m + m + b - (g / 2), 155 - z, 14 + x + m + m + c + b-g, 193 - z);
  1385. /*Hands*/
  1386. ctx.quadraticCurveTo(16 + x + y + (y/4) - (g + z),209 - (b + z), 15 + x + y + (y/3) - (g + z), 213 - (b + z));
  1387. ctx.quadraticCurveTo(21 + x + y + (y/1.2) - (a + b + g + z + (z / 10)), 216 + b - (z/10),29 + x + y + (y/1.2) - (a + b + g + z + (z / 3)), 214 + a - z);
  1388. ctx.quadraticCurveTo(28 + x + y - (g + z), 209 - z, 23 + x + (y * 1.5) - (b + g + z),207 - (e + z));
  1389. ctx.lineTo(29 + x + (y*1.5) - (a + g + z), 214 - (b + c + z));
  1390. ctx.quadraticCurveTo(35 + x + y - (a + e + g + z), 215 + e - z, 23 + x + y + c - (g + (z/2)),194 + a + d - z);
  1391. /*Inner Arm*/
  1392. ctx.quadraticCurveTo(22 + x + a - (d + g), 200 - z, 22 + (x / 2) + b + b + a - (g / 2),191 - (f + z));
  1393. ctx.quadraticCurveTo(35 + c + b + b + c - ((x / 4)), 153 - b, 38 + b + d + b + d, 132);
  1394. ctx.lineTo(50 + d - e, 95 + (c * 3));
  1395. ctx.lineTo(46 + d + d + e, 108 + b);
  1396. var h = 0;
  1397. if (waist < 0) h = waist * -0.5;
  1398. ctx.quadraticCurveTo(52 + d, 129 - h, 56 - (d + (h / 4)), 138 - (b + h));
  1399. }
  1400. /*Waist*/
  1401. a = 0;
  1402. if (shoulders < 11) {
  1403. a = (11 - shoulders);
  1404. if (waist < 1) {
  1405. a+=waist / 4;
  1406. if (a<0) a = 0;
  1407. }
  1408. }
  1409. b = (hips + ass) * 3;
  1410. if (ass > 20) b += (ass - 20) * 8;
  1411. c = waist / 3;
  1412. if (c < -5) c = -5;
  1413. d = hips / 2;
  1414. if (hips > 20) d = 10;
  1415. f = 0;
  1416. y = b;
  1417. if (y > 100) y = 100;
  1418. ctx.bezierCurveTo(53 + c - ((a / 1.2) + (y / 40.7) + (f / 5) + (b / 60)), 145 + (c / 5) + (y / 27.5), 52 + c - ((a / 1.6) + (f / 2) + (b / 40)), 161 - ((y / 6.875)),50.3 + (c / 2) - ((a / 2) + (b/20) + (f / 2)),175 - ((y / 22) + d));
  1419. /*Outer Leg*/
  1420. if (legs < 11) {
  1421. a = legs;
  1422. b = a / 2;
  1423. c = a / 3;
  1424. d = a / 5;
  1425. e = a / 10;
  1426. f = hips / 5.5;
  1427. g = f * (1 / 9);
  1428. ctx.quadraticCurveTo(25 + a + b + c - ((f * 4.5)), 227 - (a + b + (f * 2) + (ass / 10)),36 + b + c,269 + (d * 3));
  1429. ctx.quadraticCurveTo(26 + a, 307 - c, 34 + (d * 2), 319 + a + d);
  1430. ctx.quadraticCurveTo(34 + (d * 2), 335 + c, 41 - c, 354 - c);
  1431. ctx.quadraticCurveTo(42 - c, 360 - c, 41 - d, 365 - e);
  1432. ctx.quadraticCurveTo(39 - e, 367 - d, 41 - d, 370 - c);
  1433. /*Foot*/
  1434. ctx.quadraticCurveTo(34 + d, 386 - (a + c), 29 + e, 388 - (d * 2));
  1435. ctx.quadraticCurveTo(29 + c, 389 - c, 29 + (d * 2), 390 - c);
  1436. ctx.quadraticCurveTo(43 - c, 394 - c, 59 - (b + d), 389 - c);
  1437. ctx.quadraticCurveTo(58 - (d * 2), 384, 58 - (d * 3), 383 - d);
  1438. ctx.quadraticCurveTo(54 - (d * 3), 380 - c, 53 - b, 371 - c);
  1439. /*Inner-Leg*/
  1440. ctx.quadraticCurveTo(56 - b, 366 - d, 53 - c, 363 - d);
  1441. ctx.lineTo(54 - (d * 2), 342 + a);
  1442. ctx.bezierCurveTo(64, 308 - a, 67 - a, 297 - a, 61 + e, 276 - a);
  1443. ctx.quadraticCurveTo(65 - d, 260 + d, 70 - (b + d), 250 + a);
  1444. ctx.quadraticCurveTo(78 - (b + d), 230 + c, 78 - d, 205 - d);
  1445. ctx.quadraticCurveTo(79, 208 - d, 79, 205 - d);
  1446. } else {
  1447. if (legs <= 20) a = legs - 11;
  1448. else a = 9;
  1449. a = a * 0.8;
  1450. b = a / 2;
  1451. c = a / 3;
  1452. d = a / 5;
  1453. e = a / 10;
  1454. f = hips / 5.5;
  1455. g = f * (a / 9);
  1456. z = 0;
  1457. if (legs > 20) {
  1458. z = legs - 20;
  1459. z /= 2;
  1460. }
  1461. ctx.quadraticCurveTo(43.3 - (c + d + (f * 4.5) + z), 202 + z - ((f * 2) + (ass / 10)), 44 + (a + a + d) - e, 275);
  1462. ctx.quadraticCurveTo(36 + (a + a + c + d) - (b + f), 304 - (a + f), 38 + (a + a + b + d), 332);
  1463. ctx.quadraticCurveTo(37 + e + (a + b + b + d + b), 338, 38 + e + (a + b + b + d + b), 351);
  1464. ctx.quadraticCurveTo(38 + (a + b + b + d + b), 357, 39 + (a + b + b + d + b), 364);
  1465. ctx.quadraticCurveTo(38 + (a + b + b + d + b), 365, 39 + (a + b + b + d + b), 367);
  1466. /*Foot*/
  1467. ctx.quadraticCurveTo(36 + (a + a + b + d + b), 372, 30 + (a + a + b + d + b), 384);
  1468. ctx.quadraticCurveTo(32 + (a + a + b + d + b), 386, 33 + (a + a + b + d + b), 387);
  1469. ctx.quadraticCurveTo(40 + (a + a + b + d + b), 391, 52 + (a + a + b + d + b), 386);
  1470. ctx.quadraticCurveTo(54 + (a + a + b + d + b), 384, 52 + (a + a + b + d + b), 381);
  1471. ctx.quadraticCurveTo(49 + (a + a + b + d + b), 377, 49 + (a + a + b + d + b), 368);
  1472. /*Inner-Leg*/
  1473. ctx.quadraticCurveTo(50 + (a + a + b + b + c), 364, 50 + (a + a + b + b + c), 361);
  1474. ctx.lineTo(50 + b + (a + b + c + b), 353 - a);
  1475. ctx.bezierCurveTo(64 + a + b + e + b + b, 297 - a, 56 + a + b + e + b, 286, 63 + a + b + e + b, 265);
  1476. ctx.quadraticCurveTo(63 + a + b + e + b, 262, 63 + a + b + e + b, 261);
  1477. ctx.quadraticCurveTo(71 + a + b + (z / 3), 233 + (z / 3) - b, 75 + d, 203);
  1478. ctx.quadraticCurveTo(79, 206, 79, 203);
  1479. }
  1480. }
  1481. function drawHorns(ctx)
  1482. {
  1483. var a = avatar.physique.horns;
  1484. if (a == 0) return;
  1485. ctx.lineWidth = 1.5;
  1486. ctx.fillStyle = IRISCOLOR;
  1487. ctx.strokeStyle = NIPPLESHADOW;
  1488. ctx.beginPath();
  1489. var b = a / 2;
  1490. var c = avatar.physique.hornstype;
  1491. if (c == 1) {
  1492. // Cow
  1493. ctx.moveTo(62, 1 - b);
  1494. ctx.quadraticCurveTo(61, 20, 65, 20);
  1495. ctx.moveTo(62, 8 - b);
  1496. ctx.quadraticCurveTo(65, 15, 71, 15);
  1497. ctx.lineTo(65, 20);
  1498. } else if (c == 2) {
  1499. // Demon
  1500. ctx.moveTo(62, 1 - b);
  1501. ctx.lineTo(65, 20);
  1502. ctx.moveTo(62, 1 - b);
  1503. ctx.lineTo(71, 15);
  1504. ctx.lineTo(65, 20);
  1505. }
  1506. ctx.stroke();
  1507. ctx.fill();
  1508. }
  1509. function drawTail(ctx)
  1510. {
  1511. var a = avatar.physique.tail;
  1512. if (a == 0) return;
  1513. ctx.lineWidth = 1.5;
  1514. ctx.strokeStyle = SKINCB;
  1515. ctx.fillStyle = SKINC;
  1516. ctx.beginPath();
  1517. var b = a * 2;
  1518. var c = avatar.physique.tailtype;
  1519. ctx.moveTo(75, 190);
  1520. // 'Body' of tail
  1521. if (c == 1 || c == 3) {
  1522. // Cow
  1523. ctx.quadraticCurveTo(20 - b, 280 + a, 20 - b, 240);
  1524. ctx.lineTo(20 - b - 2, 245);
  1525. ctx.quadraticCurveTo(20 - b, 285 + a, 75, 195);
  1526. ctx.lineTo(75, 190);
  1527. } else {
  1528. // Demon
  1529. ctx.quadraticCurveTo(20 - b, 280 + a, 20 - b, 240);
  1530. ctx.lineTo(20 - b - 2, 245);
  1531. ctx.quadraticCurveTo(20 - b, 285 + a, 75, 195);
  1532. ctx.lineTo(75, 190);
  1533. }
  1534. ctx.stroke();
  1535. ctx.fill();
  1536. // 'End' of tail
  1537. if (c == 1) {
  1538. // Cow
  1539. ctx.moveTo(20 - b, 242);
  1540. ctx.lineTo(15 - b, 236);
  1541. ctx.moveTo(20 - b, 242);
  1542. ctx.lineTo(13 - b, 234);
  1543. ctx.moveTo(20 - b, 242);
  1544. ctx.lineTo(17 - b, 230);
  1545. ctx.moveTo(20 - b, 242);
  1546. ctx.lineTo(11 - b, 241);
  1547. ctx.stroke();
  1548. } else if (c == 2) {
  1549. // Demon
  1550. ctx.moveTo(22 - b, 243);
  1551. ctx.lineTo(12 - b, 248);
  1552. ctx.lineTo(12 - b, 235);
  1553. ctx.lineTo(24 - b, 238);
  1554. ctx.lineTo(22 - b, 243);
  1555. ctx.stroke();
  1556. ctx.fill();
  1557. }
  1558. }
  1559. function drawWings(ctx)
  1560. {
  1561. var a = avatar.physique.wings;
  1562. if (a == 0) return;
  1563. ctx.lineWidth = 1.5;
  1564. ctx.strokeStyle = "black";
  1565. ctx.fillStyle = SKINC;
  1566. ctx.beginPath();
  1567. ctx.moveTo(73, 75);
  1568. ctx.lineTo(3, 20);
  1569. ctx.lineTo(22, 290);
  1570. ctx.lineTo(60, 150);
  1571. ctx.lineTo(63, 95);
  1572. ctx.stroke();
  1573. ctx.fill();
  1574. ctx.stroke();
  1575. ctx.fill();
  1576. }
  1577. function drawHalfFigure1(ctx)
  1578. {
  1579. ctx.fillStyle = SKINC;
  1580. ctx.strokeStyle = SKINCB;
  1581. drawBody(ctx);
  1582. ctx.fill();
  1583. ctx.stroke();
  1584. drawHead(ctx);
  1585. ctx.fill();
  1586. ctx.stroke();
  1587. drawPecs(ctx);
  1588. ctx.fill();
  1589. ctx.stroke();
  1590. drawAbs(ctx);
  1591. ctx.stroke();
  1592. drawLegMuscles(ctx);
  1593. ctx.stroke();
  1594. drawHips(ctx);
  1595. ctx.stroke();
  1596. drawHipLine(ctx);
  1597. ctx.stroke();
  1598. drawThighLine(ctx);
  1599. ctx.stroke();
  1600. ctx.fillStyle = EYECOLOR;
  1601. drawEyes(ctx);
  1602. ctx.fill();
  1603. ctx.fillStyle = IRISCOLOR;
  1604. drawIris(ctx);
  1605. ctx.fill();
  1606. ctx.strokeStyle = EYELINER;
  1607. drawEyes(ctx);
  1608. ctx.stroke();
  1609. }
  1610. function drawHalfFigure2(ctx)
  1611. {
  1612. ctx.strokeStyle = SKINCB;
  1613. ctx.fillStyle = SKINC;
  1614. drawPregs(ctx);
  1615. ctx.fill();
  1616. drawPregs(ctx);
  1617. ctx.stroke();
  1618. for (var i = avatar.physique.breastrows; i > 0; i--) {
  1619. var sz = breasts * (1.0 - (i * 0.1));
  1620. if (sz < (breasts / 2)) sz = breasts / 2;
  1621. var pos = (18 - i) * i;
  1622. if (pos < 4) pos = 4;
  1623. drawBoobs(ctx, sz, pos, i);
  1624. }
  1625. drawBoobs(ctx, breasts, 0, 0);
  1626. if (avatar.items.headband > 0) drawHeadBand(ctx);
  1627. if (avatar.items.collar > 0) drawCollar(ctx);
  1628. drawHairFront(ctx);
  1629. drawHorns(ctx);
  1630. for (var i = 0; i < avatar.items.leftbracelet; i++) drawBracelet(ctx, true, i * 4.5);
  1631. }
  1632. var canvas = document.getElementById(canvasname);
  1633. if (typeof canvas !== 'undefined') {
  1634. var missingData = false;
  1635. avatar.calcPhysique();
  1636. var stats = avatar.physique;
  1637. var height = typeof stats["height"] !== 'undefined' ? stats["height"] : missingData = true; //I apologize for bizarre way to do this, but it assigns missingData and height at the same time.
  1638. var face = typeof stats["face"] !== 'undefined' ? stats["face"] : missingData = true;
  1639. var eyes = typeof stats["eyes"] !== 'undefined' ? stats["eyes"] : missingData = true;
  1640. var irisc = typeof stats["irisc"] !== 'undefined' ? stats["irisc"] : missingData = true;
  1641. var lips = typeof stats["lips"] !== 'undefined' ? stats["lips"] : missingData = true;
  1642. var skin = typeof stats["skin"] !== 'undefined' ? stats["skin"] : missingData = true;
  1643. var hairlength = typeof stats["hairlength"] !== 'undefined' ? stats["hairlength"] : missingData = true;
  1644. var hairc = typeof stats["hairc"] !== 'undefined' ? stats["hairc"] : missingData = true;
  1645. var shoulders = typeof stats["shoulders"] !== 'undefined' ? stats["shoulders"] : missingData = true;
  1646. var breasts = typeof stats["breasts"] !== 'undefined' ? stats["breasts"] : missingData = true;
  1647. var nipples = typeof stats["nipples"] !== 'undefined' ? stats["nipples"] : missingData = true;
  1648. var testes = typeof stats["testes"] !== 'undefined' ? stats["testes"] : missingData = true;
  1649. var penis = typeof stats["penis"] !== 'undefined' ? stats["penis"] : missingData = true;
  1650. var waist = typeof stats["waist"] !== 'undefined' ? stats["waist"] : missingData = true;
  1651. var hips = typeof stats["hips"] !== 'undefined' ? stats["hips"] : missingData = true;
  1652. var ass = typeof stats["ass"] !== 'undefined' ? stats["ass"] : missingData = true;
  1653. var legs = typeof stats["legs"] !== 'undefined' ? stats["legs"] : missingData = true;
  1654. if (missingData === false) {
  1655. if (canvas.getContext) {
  1656. var ctx = canvas.getContext("2d");
  1657. canvas.width = canvas.width;
  1658. var SKINC = "black";
  1659. var SKINCB = "black";
  1660. var LIPCOLOR = "black";
  1661. var HAIRCOLOR = "black";
  1662. var HAIRCOLORB = "black";
  1663. var EYECOLOR = "white";
  1664. var IRISCOLOR = "brown";
  1665. var EYELINER = "black";
  1666. var NIPPLESHADOW = "black";
  1667. if (isNaN(irisc)) {
  1668. IRISCOLOR = irisc;
  1669. } else if (irisc < 11) {
  1670. IRISCOLOR = "rgb(" + Math.floor(92 - (irisc*5.2)) + "," + Math.floor(64 + (irisc*5.1)) + "," + Math.floor(51 - (irisc*1.1)) + ")";
  1671. } else if (irisc < 100) {
  1672. var a = irisc - 10;
  1673. IRISCOLOR = "rgb(" + Math.floor(40 + (a * 4.9)) + "," + Math.floor(115 - (a * 2.6)) + "," + Math.floor(40 + (a * 13.1)) + ")";
  1674. }
  1675. if (isNaN(skin)) {
  1676. SKINC = skin;
  1677. SKINCB = skin;
  1678. LIPCOLOR = skin;
  1679. NIPPLESHADOW = skin;
  1680. EYELINER = SKINCB;
  1681. } else if (skin < 11) {
  1682. SKINC = "rgb(" + Math.floor(255 - (skin*2.8)) + "," + Math.floor(214 - (skin*5.3)) + "," + Math.floor(180 - (skin*6.5)) + ")";
  1683. SKINCB = "rgb(" + Math.floor(214 - (skin*5.1)) + "," + Math.floor(156 - (skin*4)) + "," + Math.floor(147 - (skin*6.4)) + ")";
  1684. LIPCOLOR = "rgb(" + Math.floor(194 - (skin*4.1)) + "," + Math.floor(123 - (skin*4.1)) + "," + Math.floor(119 - (skin*4.1)) + ")";
  1685. NIPPLESHADOW = "rgb(" + Math.floor(140 - (skin*4.1)) + "," + Math.floor(89 - (skin*4.1)) + "," + Math.floor(86 - (skin*4.1)) + ")";
  1686. EYELINER = "rgb(" + Math.floor(128 - (skin*2.6)) + "," + Math.floor(91 - (skin*2.3)) + "," + Math.floor(65 - (skin*1.8)) + ")";
  1687. } else if (skin < 100) {
  1688. var a = skin - 11;
  1689. SKINC = "rgb(" + Math.floor(227 - (a * 9.6)) + "," + Math.floor(161 - (a * 9.1)) + "," + Math.floor(115 - (a * 6.3)) + ")";
  1690. if (skin > 28) a = a - ((skin - 23) * 2.5); // change colours to lighter so we do not get black on near black effects
  1691. SKINCB = "rgb(" + Math.floor(163 - (a * 12)) + "," + Math.floor(116 - (a * 10.8)) + "," + Math.floor(83 - (a * 7.3)) + ")";
  1692. LIPCOLOR = "rgb(" + Math.floor(153 - (a * 8.9)) + "," + Math.floor(82 - (a * 6.2)) + "," + Math.floor(78 - (a * 6.4)) + ")";
  1693. NIPPLESHADOW = "rgb(" + Math.floor(99 - (a * 9.9)) + "," + Math.floor(48 - (a * 7.2)) + "," + Math.floor(45 - (a * 7.4)) + ")";
  1694. EYELINER = "rgb(" + Math.floor(102 - (a * 8.9)) + "," + Math.floor(68 - (a * 6.6)) + "," + Math.floor(47 - (a * 4.4)) + ")";
  1695. } else if (skin == 100) {
  1696. SKINC = "rgb(211,130,136)";
  1697. SKINCB = "rgb(184,45,45)";
  1698. LIPCOLOR = SKINCB;
  1699. NIPPLESHADOW = SKINCB;
  1700. EYELINER = SKINCB;
  1701. } else if (skin == 101) {
  1702. SKINC = "rgb(174,187,254)";
  1703. SKINCB = "rgb(32,40,64)";
  1704. LIPCOLOR = SKINCB;
  1705. NIPPLESHADOW = SKINCB;
  1706. EYELINER = SKINCB;
  1707. } else if (skin == 102) {
  1708. SKINC = "rgb(114,224,114)";
  1709. SKINCB = "rgb(82,115,84)";
  1710. LIPCOLOR = SKINCB;
  1711. NIPPLESHADOW = SKINCB;
  1712. EYELINER = SKINCB;
  1713. }
  1714. if (isNaN(hairc)) {
  1715. HAIRCOLOR = hairc;
  1716. HAIRCOLORB = hairc;
  1717. } else if (hairc < 6) {
  1718. HAIRCOLOR = "rgb(" + Math.floor(36 + (hairc * 17.2)) + "," + Math.floor(7 + (hairc*10.6)) + "," + Math.floor(11 + (hairc*8.8)) + ")";
  1719. HAIRCOLORB = "rgb(" + Math.floor(0 + (hairc * 11.8)) + "," + Math.floor(0 + (hairc*5.8)) + "," + Math.floor(0 + (hairc*5.2)) + ")";
  1720. } else if (hairc < 11) {
  1721. var a = hairc - 6;
  1722. HAIRCOLOR = "rgb(" + Math.floor(122 + (a * 8.2)) + "," + Math.floor(60 - (a * 12)) + "," + Math.floor(55 - (a * 10.8)) + ")";
  1723. HAIRCOLORB = "rgb(" + Math.floor(59 + (a * 8.6)) + "," + Math.floor(29 - (a * 5.8)) + "," + Math.floor(26 - (a * 5)) + ")";
  1724. } else if (hairc < 16) {
  1725. var a = hairc - 11;
  1726. HAIRCOLOR = "rgb(" + Math.floor(163 + (a * 11.8)) + "," + Math.floor(0 + (a * 37.6)) + "," + Math.floor(1 + (a * 30.4)) + ")";
  1727. HAIRCOLORB = "rgb(" + Math.floor(102 + (a * 11.2)) + "," + Math.floor(0 + (a * 26.8)) + "," + Math.floor(1 + (a * 21.6)) + ")";
  1728. } else {
  1729. var a = hairc - 16;
  1730. HAIRCOLOR = "rgb(" + Math.floor(222 + (a * 5.8)) + "," + Math.floor(188 + (a * 12.6)) + "," + Math.floor(153 + (a * 6.2)) + ")";
  1731. HAIRCOLORB = "rgb(" + Math.floor(158 + (a * 6.2)) + "," + Math.floor(134 + (a * 5.8)) + "," + Math.floor(109 + (a * 0.4)) + ")";
  1732. }
  1733. var heightread = (height * 0.7) + 60;
  1734. if (face < 10) heightread += ((11 - face) / 10);
  1735. var heightft = "" + Math.floor(heightread / 12) + "\'";
  1736. var heightin = "" + Math.floor(heightread - (Math.floor(heightread / 12) * 12)) + "\"";
  1737. heightread = heightft + heightin;
  1738. ctx.font = "bold 400 12px/2 Unknown Font, serif";
  1739. ctx.fillText(heightread, 136, 19);
  1740. ctx.font = "bold 18px Unknown Font, serif";
  1741. ctx.fillText(avatar.isFutanari() ? String.fromCharCode(0x26a5) : avatar.isMale() ? String.fromCharCode(0x2642) : String.fromCharCode(0x2640), 6, 24);
  1742. if (avatar.name != "Rival man" && avatar.name != "Rival woman") {
  1743. ctx.font = "bold 18px Unknown Font, serif";
  1744. ctx.fillText(avatar.name, 22, 24);
  1745. }
  1746. ctx.beginPath();
  1747. var pos = 20;
  1748. ctx.moveTo(130 + pos, 20);
  1749. ctx.lineTo(158 + pos, 20);
  1750. ctx.lineTo(158 + pos, 390);
  1751. var dashes = 370 / 72;
  1752. var i = 1;
  1753. for (i = 1; i < 72; i++) {
  1754. var v = 390 - (i * dashes);
  1755. ctx.moveTo(158 + pos,v);
  1756. if (i % 12 == 0) ctx.lineTo(144 + pos,v);
  1757. else if (i % 6 == 0) ctx.lineTo(151 + pos,v);
  1758. else if (i % 3 == 0) ctx.lineTo(153 + pos,v);
  1759. else ctx.lineTo(155 + pos,v);
  1760. }
  1761. ctx.stroke();
  1762. ctx.beginPath();
  1763. ctx.strokeStyle = "red";
  1764. ctx.lineWidth = 3;
  1765. ctx.moveTo(159 + pos, 20);
  1766. ctx.lineTo(159 + pos, 20 + (370 * (avatar.femininity() / 100)));
  1767. ctx.stroke();
  1768. var heightheight = (height*.0095) + 0.81;
  1769. var heightscale = 1 - ((30 - height) / 250);
  1770. var heightoffset = (0.3 * (30 - height)) + 4;
  1771. ctx.translate(heightoffset, 400 - (heightheight * 400));
  1772. ctx.scale(heightscale, heightheight);
  1773. // Draw Wings
  1774. drawWings(ctx);
  1775. ctx.translate(78.6, 200);
  1776. ctx.scale(-1, 1);
  1777. ctx.translate(-78.6, -200);
  1778. drawWings(ctx);
  1779. ctx.translate(0, 0);
  1780. // Draw Tail
  1781. drawTail(ctx);
  1782. // Draw hair
  1783. drawHairBack(ctx)
  1784. // Draw left side, part 1
  1785. var bLeft = true;
  1786. drawHalfFigure1(ctx);
  1787. // Draw right side, part 1
  1788. bLeft = false;
  1789. ctx.translate(78.6, 200);
  1790. ctx.scale(-1, 1);
  1791. ctx.translate(-78.6, -200);
  1792. drawHalfFigure1(ctx);
  1793. ctx.translate(0, 0);
  1794. // Draw central/common parts of the body, part 1
  1795. drawBelly(ctx);
  1796. ctx.fill();
  1797. ctx.stroke();
  1798. var hasc = avatar.hasCock();
  1799. var erect = avatar.desire > 50 && hasc == true;
  1800. if (hasc == true && erect == false) {
  1801. if (avatar.physique.breasts < 80) drawBellyButton(ctx);
  1802. drawGenitals(ctx);
  1803. }
  1804. // Draw left side, part 2
  1805. bLeft = true;
  1806. drawHalfFigure2(ctx);
  1807. // Draw right side, part 2
  1808. bLeft = false;
  1809. ctx.translate(78.6, 200);
  1810. ctx.scale(-1, 1);
  1811. ctx.translate(-78.6, -200);
  1812. drawHalfFigure2(ctx);
  1813. ctx.translate(0,0);
  1814. // Draw central/common parts of the body, part 2
  1815. drawNose(ctx);
  1816. drawCleavage(ctx)
  1817. drawLips(ctx);
  1818. if (hasc == false || erect) {
  1819. drawGenitals(ctx);
  1820. if (avatar.physique.breasts < 80) drawBellyButton(ctx);
  1821. }
  1822. }
  1823. }
  1824. }
  1825. }