var rad;\r
\r
if(kage.kShotai == kage.kMincho){\r
- switch(a1 % 100){\r
+ switch(a1 % 100){ // ... no need to divide\r
case 0:\r
break;\r
case 1:\r
tx1 = x2;\r
ty1 = y2 - kage.kMage * v;\r
}\r
- else if(y1 == y2){\r
+ else if(y1 == y2){ // ... no need\r
if(x1 < x2){ v = 1; } else{ v = -1; }\r
tx1 = x2 - kage.kMage * v;\r
ty1 = y2;\r
}\r
break;\r
case 2:\r
- case 12:\r
+ //case 12: // ... no need\r
if(a3 == 4){\r
if(x2 == x3){\r
tx1 = x3;\r
tx2 = x2 + kage.kMage * Math.cos(rad) * v;\r
ty2 = y2 + kage.kMage * Math.sin(rad) * v;\r
}\r
- tx3 = x3 - kage.kMage;\r
+ tx3 = x3;\r
ty3 = y3;\r
- tx4 = x3 + kage.kMage * 0.5;\r
- ty4 = y3 - kage.kMage * 2;\r
\r
cdDrawLine(kage, polygons, x1, y1, tx1, ty1, a2, 1);\r
cdDrawCurve(kage, polygons, tx1, ty1, x2, y2, tx2, ty2, 1, 1);\r
- cdDrawLine(kage, polygons, tx2, ty2, tx3, ty3, 6, 5); // bolder by force\r
+ if(tx3 - tx2 > 0){ // for closer position\r
+ cdDrawLine(kage, polygons, tx2, ty2, tx3, ty3, 6, 5); // bolder by force\r
+ }\r
}\r
else{\r
if(x1 == x2){\r
cdDrawLine(kage, polygons, tx2, ty2, x3, y3, 6, a3); // bolder by force\r
}\r
break;\r
+ case 12:\r
+ cdDrawCurve(kage, polygons, x1, y1, x2, y2, x3, y3, a2, 1);\r
+ cdDrawLine(kage, polygons, x3, y3, x4, y4, 6, a3);\r
+ break;\r
+ case 13:\r
+rate = 6;\r
+ if(a3 == 5){\r
+ if(x1 == x2){\r
+ if(y1 < y2){ v = 1; } else{ v = -1; }\r
+ tx1 = x2;\r
+ ty1 = y2 - kage.kMage * v * rate;\r
+ }\r
+ else if(y1 == y2){\r
+ if(x1 < x2){ v = 1; } else{ v = -1; }\r
+ tx1 = x2 - kage.kMage * v * rate;\r
+ ty1 = y2;\r
+ }\r
+ else{\r
+ rad = Math.atan((y2 - y1) / (x2 - x1));\r
+ if(x1 < x2){ v = 1; } else{ v = -1; }\r
+ tx1 = x2 - kage.kMage * Math.cos(rad) * v * rate;\r
+ ty1 = y2 - kage.kMage * Math.sin(rad) * v * rate;\r
+ }\r
+ if(x2 == x3){\r
+ if(y2 < y3){ v = 1; } else{ v = -1; }\r
+ tx2 = x2;\r
+ ty2 = y2 + kage.kMage * v * rate;\r
+ }\r
+ else if(y2 == y3){\r
+ if(x2 < x3){ v = 1; } else { v = -1; }\r
+ tx2 = x2 + kage.kMage * v * rate;\r
+ ty2 = y2;\r
+ }\r
+ else{\r
+ rad = Math.atan((y3 - y2) / (x3 - x2));\r
+ if(x2 < x3){ v = 1; } else{ v = -1; }\r
+ tx2 = x2 + kage.kMage * Math.cos(rad) * v * rate;\r
+ ty2 = y2 + kage.kMage * Math.sin(rad) * v * rate;\r
+ }\r
+ tx3 = x3;\r
+ ty3 = y3;\r
+ \r
+ cdDrawLine(kage, polygons, x1, y1, tx1, ty1, a2, 1);\r
+ cdDrawCurve(kage, polygons, tx1, ty1, x2, y2, tx2, ty2, 1, 1);\r
+ if(tx3 - tx2 > 0){ // for closer position\r
+ cdDrawLine(kage, polygons, tx2, ty2, tx3, ty3, 6, 5); // bolder by force\r
+ }\r
+ }\r
+ else{\r
+ if(x1 == x2){\r
+ if(y1 < y2){ v = 1; } else { v = -1; }\r
+ tx1 = x2;\r
+ ty1 = y2 - kage.kMage * v * rate;\r
+ }\r
+ else if(y1 == y2){\r
+ if(x1 < x2){ v = 1; } else{ v = -1; }\r
+ tx1 = x2 - kage.kMage * v * rate;\r
+ ty1 = y2;\r
+ }\r
+ else{\r
+ rad = Math.atan((y2 - y1) / (x2 - x1));\r
+ if(x1 < x2){ v = 1; } else{ v = -1; }\r
+ tx1 = x2 - kage.kMage * Math.cos(rad) * v * rate;\r
+ ty1 = y2 - kage.kMage * Math.sin(rad) * v * rate;\r
+ }\r
+ if(x2 == x3){\r
+ if(y2 < y3){ v = 1; } else{ v = -1; }\r
+ tx2 = x2;\r
+ ty2 = y2 + kage.kMage * v * rate;\r
+ }\r
+ else if(y2 == y3){\r
+ if(x2 < x3){ v = 1; } else{ v = -1; }\r
+ tx2 = x2 + kage.kMage * v * rate;\r
+ ty2 = y2;\r
+ }\r
+ else{\r
+ rad = Math.atan((y3 - y2) / (x3 - x2));\r
+ if(x2 < x3){ v = 1; } else{ v = -1; }\r
+ tx2 = x2 + kage.kMage * Math.cos(rad) * v * rate;\r
+ ty2 = y2 + kage.kMage * Math.sin(rad) * v * rate;\r
+ }\r
+ cdDrawLine(kage, polygons, x1, y1, tx1, ty1, a2, 1);\r
+ cdDrawCurve(kage, polygons, tx1, ty1, x2, y2, tx2, ty2, 1, 1);\r
+ cdDrawLine(kage, polygons, tx2, ty2, x3, y3, 6, a3); // bolder by force\r
+ }\r
+ break;\r
case 6:\r
if(a3 == 5){\r
/* only implimented for gothic\r
break;\r
case 7:\r
cdDrawLine(kage, polygons, x1, y1, x2, y2, a2, 1);\r
- cdDrawCurve(kage, polygons, x2, y2, x3, y3, x4, y4, 1, 7);\r
+ cdDrawCurve(kage, polygons, x2, y2, x3, y3, x4, y4, 1, a3);\r
break;\r
- case 9: // may not be exist\r
+ case 9: // may not be exist ... no need\r
//kageCanvas[y1][x1] = 0;\r
//kageCanvas[y2][x2] = 0;\r
break;\r