|
4 | 4 | } else { |
5 | 5 | pzpr.classmgr.makeCustom(pidlist, classbase); |
6 | 6 | } |
7 | | -})(["nuriloop"], { |
| 7 | +})(["nuriloop", "golemgrad"], { |
8 | 8 | MouseEvent: { |
9 | 9 | use: true, |
10 | 10 | inputModes: { |
|
14 | 14 | autoedit_func: "qnum", |
15 | 15 | autoplay_func: "lineMB" |
16 | 16 | }, |
| 17 | + "MouseEvent@golemgrad": { |
| 18 | + inputModes: { |
| 19 | + edit: ["number", "circle-unshade", "clear", "info-blk"], |
| 20 | + play: ["line", "peke", "bgcolor", "bgcolor1", "bgcolor2", "info-blk"] |
| 21 | + }, |
| 22 | + mouseinput: function() { |
| 23 | + if (this.inputMode === "circle-unshade") { |
| 24 | + this.inputFixedNumber(0); |
| 25 | + } else { |
| 26 | + this.common.mouseinput.call(this); |
| 27 | + } |
| 28 | + } |
| 29 | + }, |
17 | 30 |
|
18 | 31 | KeyEvent: { |
19 | 32 | enablemake: true |
|
25 | 38 | Border: { |
26 | 39 | enableLineNG: true |
27 | 40 | }, |
| 41 | + "Cell@golemgrad": { |
| 42 | + minnum: 0 |
| 43 | + }, |
28 | 44 | Cell: { |
29 | 45 | maxnum: function() { |
30 | 46 | return this.board.cols * this.board.rows; |
31 | 47 | }, |
32 | 48 | noLP: function() { |
33 | | - return this.isNum(); |
| 49 | + return this.isNum() && this.qnum !== 0; |
| 50 | + }, |
| 51 | + isShade: function() { |
| 52 | + return this.lcnt > 0 || this.qnum === 0; |
34 | 53 | }, |
35 | 54 | isUnshade: function() { |
36 | | - return this.lcnt === 0; |
| 55 | + return this.lcnt === 0 && this.qnum !== 0; |
37 | 56 | } |
38 | 57 | }, |
39 | 58 | LineGraph: { |
40 | 59 | enabled: true |
41 | 60 | }, |
| 61 | + "AreaShadeGraph@golemgrad": { |
| 62 | + enabled: true, |
| 63 | + relation: { "cell.qnum": "node", "border.line": "block" }, |
| 64 | + modifyOtherInfo: function(border, relation) { |
| 65 | + this.setEdgeByNodeObj(border.sidecell[0]); |
| 66 | + this.setEdgeByNodeObj(border.sidecell[1]); |
| 67 | + } |
| 68 | + }, |
42 | 69 | AreaUnshadeGraph: { |
43 | 70 | enabled: true, |
44 | | - relation: { "border.line": "block" }, |
| 71 | + relation: { "cell.qnum": "node", "border.line": "block" }, |
45 | 72 | modifyOtherInfo: function(border, relation) { |
46 | 73 | this.setEdgeByNodeObj(border.sidecell[0]); |
47 | 74 | this.setEdgeByNodeObj(border.sidecell[1]); |
|
64 | 91 | this.drawLines(); |
65 | 92 | this.drawPekes(); |
66 | 93 |
|
| 94 | + if (this.pid === "golemgrad") { |
| 95 | + this.drawCircles(); |
| 96 | + } |
| 97 | + |
67 | 98 | this.drawChassis(); |
68 | 99 |
|
69 | 100 | this.drawTarget(); |
70 | 101 | } |
71 | 102 | }, |
| 103 | + "Graphic@golemgrad": { |
| 104 | + lwratio: 8, |
| 105 | + circleratio: [0.25, 0.2], |
| 106 | + getCircleFillColor: function(cell) { |
| 107 | + return cell.qnum === 0 ? "white" : null; |
| 108 | + }, |
| 109 | + getCircleStrokeColor: function(cell) { |
| 110 | + return cell.qnum === 0 ? this.quescolor : null; |
| 111 | + }, |
| 112 | + getNumberTextCore: function(num) { |
| 113 | + return num > 0 ? "" + num : num === -2 ? "?" : ""; |
| 114 | + } |
| 115 | + }, |
72 | 116 |
|
73 | 117 | Encode: { |
74 | 118 | decodePzpr: function(type) { |
|
97 | 141 | "checkBranchLine", |
98 | 142 | "checkCrossLine", |
99 | 143 | "checkLineOverlap", |
| 144 | + "checkLoop@golemgrad", |
| 145 | + "check2x2PathCell@golemgrad", |
| 146 | + "checkLineOverObject@golemgrad", |
100 | 147 |
|
101 | | - "checkNoNumberInUnshade", |
| 148 | + "checkNoNumberInUnshade@nuriloop", |
102 | 149 | "checkDoubleNumberInUnshade", |
103 | 150 | "checkNumberAndUnshadeSize", |
| 151 | + "checkConnectShade@golemgrad", |
| 152 | + "checkNoLineObject@golemgrad", |
104 | 153 |
|
105 | 154 | "checkDeadendLine+", |
106 | | - "checkOneLoop" |
| 155 | + "checkOneLoop@nuriloop" |
107 | 156 | ], |
108 | 157 |
|
109 | 158 | checkLineOverlap: function() { |
110 | 159 | this.checkAllCell(function(cell) { |
111 | | - return cell.lcnt > 0 && cell.qnum !== -1; |
| 160 | + return cell.lcnt > 0 && cell.isNum() && cell.qnum !== 0; |
112 | 161 | }, "lnOverlap"); |
113 | 162 | }, |
114 | 163 |
|
|
126 | 175 | }, |
127 | 176 | checkNumberAndUnshadeSize: function() { |
128 | 177 | this.checkAllCell(function(cell) { |
129 | | - if (!cell.isValidNum()) { |
| 178 | + if (cell.qnum <= 0) { |
130 | 179 | return false; |
131 | 180 | } |
132 | 181 | if (!cell.ublk) { |
|
154 | 203 | ); |
155 | 204 | } |
156 | 205 | }, |
| 206 | + "AnsCheck@golemgrad": { |
| 207 | + check2x2PathCell: function() { |
| 208 | + this.check2x2Block(function(cell) { |
| 209 | + return cell.qnum === 0 || cell.lcnt > 0; |
| 210 | + }, "ln2x2"); |
| 211 | + }, |
| 212 | + checkDeadendLine: function() { |
| 213 | + this.checkAllCell(function(cell) { |
| 214 | + return cell.lcnt === 1 && cell.qnum !== 0; |
| 215 | + }, "lnDeadEnd"); |
| 216 | + }, |
| 217 | + checkLoop: function() { |
| 218 | + var bd = this.board; |
| 219 | + var paths = bd.linegraph.components; |
| 220 | + for (var r = 0; r < paths.length; r++) { |
| 221 | + if (paths[r].circuits === 0) { |
| 222 | + continue; |
| 223 | + } |
| 224 | + this.failcode.add("laLoop"); |
| 225 | + if (this.checkOnly) { |
| 226 | + break; |
| 227 | + } |
| 228 | + this.board.border.setnoerr(); |
| 229 | + paths[r].setedgeerr(1); |
| 230 | + } |
| 231 | + }, |
| 232 | + checkNoLineObject: function() { |
| 233 | + this.checkAllCell(function(cell) { |
| 234 | + return cell.qnum === 0 && cell.lcnt === 0; |
| 235 | + }, "nmNoLine"); |
| 236 | + }, |
| 237 | + checkLineOverObject: function() { |
| 238 | + this.checkAllCell(function(cell) { |
| 239 | + return cell.qnum === 0 && cell.lcnt >= 2; |
| 240 | + }, "lcOnNum"); |
| 241 | + } |
| 242 | + }, |
157 | 243 | FailCode: { |
158 | | - lnOverlap: "lnOverlap.tontti" |
| 244 | + lnOverlap: "lnOverlap.tontti", |
| 245 | + lcOnNum: "lcOnNum.kusabi", |
| 246 | + nmNoLine: "nmNoLine.kusabi" |
159 | 247 | } |
160 | 248 | }); |
0 commit comments