|
4 | 4 | } else { |
5 | 5 | pzpr.classmgr.makeCustom(pidlist, classbase); |
6 | 6 | } |
7 | | -})(["kurarin"], { |
| 7 | +})(["kurarin", "tetrochaink"], { |
8 | 8 | //--------------------------------------------------------- |
9 | 9 | // マウス入力系 |
10 | 10 | MouseEvent: { |
|
95 | 95 | } |
96 | 96 | } |
97 | 97 | }, |
| 98 | + "MouseEvent@tetrochaink": { |
| 99 | + inputModes: { |
| 100 | + edit: ["info-blk"], |
| 101 | + play: ["shade", "unshade", "info-blk"] |
| 102 | + }, |
| 103 | + mouseinputAutoPlay: function() { |
| 104 | + this.inputShade(); |
| 105 | + }, |
| 106 | + dispInfoBlk: function() { |
| 107 | + var cell = this.getcell(); |
| 108 | + this.mousereset(); |
| 109 | + if (cell.isnull || !cell.isShade()) { |
| 110 | + return; |
| 111 | + } |
| 112 | + cell.blk8.clist.setinfo(1); |
| 113 | + this.board.hasinfo = true; |
| 114 | + this.puzzle.redraw(); |
| 115 | + } |
| 116 | + }, |
98 | 117 |
|
99 | 118 | //--------------------------------------------------------- |
100 | 119 | // キーボード入力系 |
|
177 | 196 | } |
178 | 197 | }, |
179 | 198 |
|
180 | | - LineGraph: { |
| 199 | + "LineGraph@kurarin": { |
| 200 | + enabled: true |
| 201 | + }, |
| 202 | + "AreaShadeGraph@tetrochaink": { |
| 203 | + enabled: true |
| 204 | + }, |
| 205 | + "AreaShade8Graph@tetrochaink": { |
181 | 206 | enabled: true |
182 | 207 | }, |
183 | 208 |
|
184 | 209 | //--------------------------------------------------------- |
185 | 210 | // 画像表示系 |
186 | 211 | Graphic: { |
187 | | - gridcolor_type: "LIGHT", |
188 | | - irowake: true, |
189 | | - |
190 | 212 | shadecolor: "#444444", |
191 | 213 | enablebcolor: true, |
192 | 214 |
|
193 | 215 | paint: function() { |
194 | 216 | this.drawBGCells(); |
195 | 217 |
|
196 | 218 | this.drawShadedCells(); |
197 | | - this.drawDotCells(); |
| 219 | + if (this.pid === "kurarin") { |
| 220 | + this.drawDotCells(); |
| 221 | + } |
198 | 222 | this.drawGrid(); |
199 | 223 |
|
200 | 224 | this.drawDots(); |
201 | 225 |
|
202 | 226 | this.drawChassis(); |
203 | 227 |
|
204 | | - this.drawLines(); |
205 | | - |
206 | | - this.drawPekes(); |
| 228 | + if (this.pid === "kurarin") { |
| 229 | + this.drawLines(); |
| 230 | + this.drawPekes(); |
| 231 | + } |
207 | 232 |
|
208 | 233 | this.drawCursor(false, this.puzzle.editmode); |
209 | 234 | }, |
|
231 | 256 | return null; |
232 | 257 | } |
233 | 258 | }, |
| 259 | + "Graphic@kurarin": { |
| 260 | + gridcolor_type: "LIGHT", |
| 261 | + irowake: true |
| 262 | + }, |
| 263 | + "Graphic@tetrochaink": { |
| 264 | + bgcellcolor_func: "qsub1" |
| 265 | + }, |
234 | 266 |
|
235 | 267 | //--------------------------------------------------------- |
236 | 268 | // URLエンコード/デコード処理 |
|
269 | 301 | decodeData: function() { |
270 | 302 | this.decodeDotFile(); |
271 | 303 | this.decodeCellAns(); |
272 | | - this.decodeBorderLine(); |
| 304 | + if (this.pid === "kurarin") { |
| 305 | + this.decodeBorderLine(); |
| 306 | + } |
273 | 307 | }, |
274 | 308 | encodeData: function() { |
275 | 309 | this.encodeDotFile(); |
276 | 310 | this.encodeCellAns(); |
277 | | - this.encodeBorderLine(); |
| 311 | + if (this.pid === "kurarin") { |
| 312 | + this.encodeBorderLine(); |
| 313 | + } |
278 | 314 | } |
279 | 315 | }, |
280 | 316 |
|
|
342 | 378 | }, "ceEmpty"); |
343 | 379 | } |
344 | 380 | }, |
| 381 | + "AnsCheck@tetrochaink": { |
| 382 | + checklist: [ |
| 383 | + "checkOverShadeCell", |
| 384 | + "checkAdjacentShapes", |
| 385 | + |
| 386 | + "checkShadeWhite", |
| 387 | + "checkUnderShadeCell", |
| 388 | + "checkShadeBlack", |
| 389 | + "checkShadeGray", |
| 390 | + |
| 391 | + "checkConnect8Shade", |
| 392 | + "doneShadingDecided" |
| 393 | + ], |
| 394 | + |
| 395 | + checkOverShadeCell: function() { |
| 396 | + this.checkAllArea( |
| 397 | + this.board.sblkmgr, |
| 398 | + function(w, h, a, n) { |
| 399 | + return a <= 4; |
| 400 | + }, |
| 401 | + "csGt4" |
| 402 | + ); |
| 403 | + }, |
| 404 | + checkUnderShadeCell: function() { |
| 405 | + this.checkAllArea( |
| 406 | + this.board.sblkmgr, |
| 407 | + function(w, h, a, n) { |
| 408 | + return a >= 4; |
| 409 | + }, |
| 410 | + "csLt4" |
| 411 | + ); |
| 412 | + }, |
| 413 | + checkConnect8Shade: function() { |
| 414 | + this.checkOneArea(this.board.sblk8mgr, "csDivide"); |
| 415 | + }, |
| 416 | + |
| 417 | + checkAdjacentShapes: function() { |
| 418 | + var bd = this.board; |
| 419 | + for (var c = 0; c < bd.cell.length; c++) { |
| 420 | + var cell = bd.cell[c]; |
| 421 | + if (cell.bx === bd.maxbx - 1 || cell.by === bd.maxby - 1) { |
| 422 | + continue; |
| 423 | + } |
| 424 | + |
| 425 | + var i, |
| 426 | + adc = cell.adjacent; |
| 427 | + var cells = [ |
| 428 | + [cell, adc.right.adjacent.bottom], |
| 429 | + [adc.right, adc.bottom] |
| 430 | + ]; |
| 431 | + for (i = 0; i < 2; i++) { |
| 432 | + if (cells[i][0].isShade() && cells[i][1].isShade()) { |
| 433 | + break; |
| 434 | + } |
| 435 | + } |
| 436 | + if (i === 2) { |
| 437 | + continue; |
| 438 | + } |
| 439 | + |
| 440 | + var block1 = cells[i][0].sblk, |
| 441 | + block2 = cells[i][1].sblk; |
| 442 | + if ( |
| 443 | + block1 === block2 || |
| 444 | + block1.clist.length !== 4 || |
| 445 | + this.isDifferentShapeBlock(block1, block2) |
| 446 | + ) { |
| 447 | + continue; |
| 448 | + } |
| 449 | + |
| 450 | + this.failcode.add("bsSameShape"); |
| 451 | + if (this.checkOnly) { |
| 452 | + break; |
| 453 | + } |
| 454 | + block1.clist.seterr(1); |
| 455 | + block2.clist.seterr(1); |
| 456 | + } |
| 457 | + } |
| 458 | + }, |
345 | 459 | FailCode: { |
346 | 460 | ceEmpty: "ceEmpty.yajilin" |
347 | 461 | } |
|
0 commit comments