|
110 | 110 | numberRemainsUnshaded: true, |
111 | 111 |
|
112 | 112 | maxnum: function() { |
113 | | - return Math.max(this.board.cols, this.board.rows) >> 1; |
| 113 | + var liar = this.puzzle.getConfig("lapaz_liar") ? 1 : 0; |
| 114 | + return liar + (Math.max(this.board.cols, this.board.rows) >> 1); |
114 | 115 | }, |
115 | 116 | minnum: 0, |
116 | 117 |
|
117 | 118 | allowUnshade: function() { |
118 | 119 | return this.isValid(); |
119 | 120 | }, |
120 | 121 | allowShade: function() { |
121 | | - return this.isValid() && !this.isNum(); |
| 122 | + var isLiar = this.puzzle.getConfig("lapaz_liar"); |
| 123 | + return this.isValid() && (isLiar || !this.isNum()); |
122 | 124 | }, |
123 | 125 |
|
124 | 126 | posthook: { |
|
265 | 267 | decodePzpr: function(type) { |
266 | 268 | this.decodeNumber16(); |
267 | 269 | this.decodeEmpty(); |
268 | | - this.puzzle.setConfig("trizone_ghost", this.checkpflag("g")); |
| 270 | + if (this.pid === "lapaz") { |
| 271 | + this.puzzle.setConfig("lapaz_liar", this.checkpflag("l")); |
| 272 | + } else { |
| 273 | + this.puzzle.setConfig("trizone_ghost", this.checkpflag("g")); |
| 274 | + } |
269 | 275 | }, |
270 | 276 | encodePzpr: function(type) { |
271 | | - this.outpflag = this.puzzle.getConfig("trizone_ghost") ? "g" : null; |
| 277 | + if (this.pid === "lapaz") { |
| 278 | + this.outpflag = this.puzzle.getConfig("lapaz_liar") ? "l" : null; |
| 279 | + } else { |
| 280 | + this.outpflag = this.puzzle.getConfig("trizone_ghost") ? "g" : null; |
| 281 | + } |
272 | 282 | this.encodeNumber16(); |
273 | 283 | this.encodeEmpty(); |
274 | 284 | } |
275 | 285 | }, |
276 | 286 | //--------------------------------------------------------- |
277 | 287 | FileIO: { |
278 | 288 | decodeData: function() { |
279 | | - this.decodeConfigFlag("g", "trizone_ghost"); |
| 289 | + if (this.pid === "lapaz") { |
| 290 | + this.decodeConfigFlag("l", "lapaz_liar"); |
| 291 | + } else { |
| 292 | + this.decodeConfigFlag("g", "trizone_ghost"); |
| 293 | + } |
280 | 294 | this.decodeCellQnum(); |
281 | 295 | this.decodeBorderAns(1); |
282 | 296 | this.decodeCellAns(); |
283 | 297 | }, |
284 | 298 | encodeData: function() { |
285 | | - this.encodeConfigFlag("g", "trizone_ghost"); |
| 299 | + if (this.pid === "lapaz") { |
| 300 | + this.encodeConfigFlag("l", "lapaz_liar"); |
| 301 | + } else { |
| 302 | + this.encodeConfigFlag("g", "trizone_ghost"); |
| 303 | + } |
286 | 304 | this.encodeCellQnum(); |
287 | 305 | this.encodeBorderAns(1); |
288 | 306 | this.encodeCellAns(); |
|
335 | 353 | }, |
336 | 354 |
|
337 | 355 | checkNumberRegionSize: function() { |
| 356 | + if (this.puzzle.getConfig("lapaz_liar")) { |
| 357 | + return; |
| 358 | + } |
| 359 | + |
338 | 360 | this.checkAllCell(function(cell) { |
339 | 361 | return cell.qnum !== -1 && cell.room.clist.length === 1; |
340 | 362 | }, "nmLt1"); |
|
0 commit comments