diff --git a/src-ui/changes.html b/src-ui/changes.html index 3d0827e84..b0c4b0b14 100644 --- a/src-ui/changes.html +++ b/src-ui/changes.html @@ -33,13 +33,13 @@
Latest types (all types)
diff --git a/src-ui/img/hamlepaths.png b/src-ui/img/hamlepaths.png new file mode 100644 index 000000000..85f0e3b75 Binary files /dev/null and b/src-ui/img/hamlepaths.png differ diff --git a/src-ui/js/ui/KeyPopup.js b/src-ui/js/ui/KeyPopup.js index 46a8d458b..49787a589 100644 --- a/src-ui/js/ui/KeyPopup.js +++ b/src-ui/js/ui/KeyPopup.js @@ -69,6 +69,7 @@ ui.keypopup = { bonsan: [10, 0], heyabon: [10, 0], rectslider: [10, 0], + hamlepaths: [10, 0], satogaeri: [10, 0], yosenabe: [10, 0], herugolf: [10, 0], @@ -496,6 +497,7 @@ ui.keypopup = { cap = "□"; } else if ( pid === "rectslider" || + pid === "hamlepaths" || pid === "aquapelago" || pid === "mrtile" ) { diff --git a/src-ui/js/ui/Misc.js b/src-ui/js/ui/Misc.js index 50b67da31..60ae9b970 100755 --- a/src-ui/js/ui/Misc.js +++ b/src-ui/js/ui/Misc.js @@ -152,6 +152,7 @@ function toBGimage(pid) { "firewalk", "forestwalk", "geradeweg", + "hamlepaths", "hasunomura", "heteromino", "heyapin", diff --git a/src-ui/list.html b/src-ui/list.html index 4af89749c..a294602a9 100644 --- a/src-ui/list.html +++ b/src-ui/list.html @@ -273,6 +273,7 @@

パズルの種類のリスト
  • +
  • diff --git a/src/pzpr/variety.js b/src/pzpr/variety.js index 799b6fbd2..e8c9a2c51 100755 --- a/src/pzpr/variety.js +++ b/src/pzpr/variety.js @@ -187,6 +187,7 @@ guidearrow: [0, 0, "ガイドアロー", "Guide Arrow"], haisu: [0, 0, "Haisu", "Haisu"], hakoiri: [1, 0, "はこいり○△□", "Hakoiri-masashi"], + hamlepaths: [0, 0, "Hamle Paths", "Hamle Paths", "bonsan"], hanare: [0, 0, "はなれ組", "Hanare-gumi", "hanare"], hashikake: [ 0, diff --git a/src/variety/bonsan.js b/src/variety/bonsan.js index 52dbd6531..28898bdf9 100644 --- a/src/variety/bonsan.js +++ b/src/variety/bonsan.js @@ -7,7 +7,7 @@ } else { pzpr.classmgr.makeCustom(pidlist, classbase); } -})(["bonsan", "heyabon", "rectslider", "satogaeri", "timebomb"], { +})(["bonsan", "heyabon", "rectslider", "satogaeri", "timebomb", "hamlepaths"], { //--------------------------------------------------------- // マウス入力系 "MouseEvent@bonsan,heyabon": { @@ -22,7 +22,7 @@ play: ["line", "clear", "completion"] } }, - "MouseEvent@rectslider": { + "MouseEvent@rectslider,hamlepaths": { inputModes: { edit: ["number", "clear"], play: ["line", "bgcolor", "subcircle", "subcross", "clear"] @@ -123,7 +123,11 @@ } var puzzle = this.puzzle; - if (puzzle.pid !== "rectslider" && this.inputdark(cell, 1)) { + if ( + puzzle.pid !== "rectslider" && + puzzle.pid !== "hamlepaths" && + this.inputdark(cell, 1) + ) { return; } if (puzzle.pid === "satogaeri") { @@ -522,10 +526,22 @@ this.setEdgeByNodeObj(border.sidecell[1]); } }, + "AreaUnshadeGraph@hamlepaths": { + enabled: true, + relation: { "cell.qnum": "node", "border.line": "move" }, + isnodevalid: function(cell) { + return cell.base.qnum === -1; + }, + + modifyOtherInfo: function(border, relation) { + this.setEdgeByNodeObj(border.sidecell[0]); + this.setEdgeByNodeObj(border.sidecell[1]); + } + }, //--------------------------------------------------------- // 画像表示系 - "Graphic@bonsan,heyabon,rectslider": { + "Graphic@bonsan,heyabon,rectslider,hamlepaths": { bgcellcolor_func: "qsub2", autocmp: "number" }, @@ -576,11 +592,13 @@ this.drawTarget(); } }, - "Graphic@rectslider": { + "Graphic@rectslider,hamlepaths": { fontShadecolor: "white", qcmpcolor: "gray", paint: function() { + this.drawBGCells(); + this.drawDashedGrid(); this.drawTip(); @@ -607,12 +625,7 @@ } var info = cell.error || cell.qinfo; - if (info === 0) { - return this.quescolor; - } else if (info === 1) { - return this.errcolor1; - } - return null; + return info > 0 ? this.errcolor1 : this.quescolor; }, getQuesNumberColor: function(cell) { return cell.isCmp() ? this.qcmpcolor : this.fontShadecolor; @@ -758,7 +771,7 @@ this.fio.encodeQnum_PBox_Sato(); } }, - "Encode@rectslider,timebomb": { + "Encode@rectslider,timebomb,hamlepaths": { decodePzpr: function(type) { this.decodeNumber16(); }, @@ -771,7 +784,11 @@ decodeData: function() { this.decodeCellQnum(); this.decodeCellQsubQcmp(); - if (this.pid !== "rectslider" && this.pid !== "timebomb") { + if ( + this.pid !== "rectslider" && + this.pid !== "timebomb" && + this.pid !== "hamlepaths" + ) { this.decodeBorderQues(); } this.decodeBorderLine(); @@ -779,7 +796,11 @@ encodeData: function() { this.encodeCellQnum(); this.encodeCellQsubQcmp(); - if (this.pid !== "rectslider" && this.pid !== "timebomb") { + if ( + this.pid !== "rectslider" && + this.pid !== "timebomb" && + this.pid !== "hamlepaths" + ) { this.encodeBorderQues(); } this.encodeBorderLine(); @@ -890,6 +911,9 @@ "checkMovedBlockRect@rectslider", "checkMovedBlockSize@rectslider", + "checkMovedAdjacent@hamlepaths", + "checkConnectUnshade@hamlepaths", + "checkLineLength", "checkFractal@bonsan,heyabon", @@ -1032,5 +1056,18 @@ }); }, "ceNoBomb"); } + }, + "AnsCheck@hamlepaths": { + checkMovedAdjacent: function() { + this.checkSideCell(function(cell1, cell2) { + return cell1.base.isNum() && cell2.base.isNum(); + }, "csAdjacent"); + } + }, + "FailCode@hamlepaths": { + nmConnected: "nmConnected.rectslider", + laOnNum: "laOnNum.rectslider", + laIsolate: "laIsolate.rectslider", + nmNoMove: "nmNoMove.rectslider" } }); diff --git a/test/script/hamlepaths.js b/test/script/hamlepaths.js new file mode 100644 index 000000000..1e7a29e4d --- /dev/null +++ b/test/script/hamlepaths.js @@ -0,0 +1,56 @@ +/* hamlepaths.js */ + +ui.debug.addDebugData("hamlepaths", { + url: "5/5/h2j1g10m3h.h2", + failcheck: [ + [ + "brNoLine", + "pzprv3/hamlepaths/5/5/. . 2 . . /. . 1 . 1 /0 . . . . /. . . 3 . /. - . . 2 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /" + ], + [ + "lnBranch", + "pzprv3/hamlepaths/5/5/. . 2 . . /. . 1 . 1 /0 . . . . /. . . 3 . /. - . . 2 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 /0 0 0 0 /1 1 1 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 0 /0 1 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /" + ], + [ + "lnCross", + "pzprv3/hamlepaths/5/5/. . 2 . . /. . 1 . 1 /0 . . . . /. . . 3 . /. - . . 2 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /1 1 1 0 /0 0 0 0 /0 1 0 0 0 /0 1 0 0 0 /0 1 0 0 0 /0 1 0 0 0 /" + ], + [ + "nmConnected", + "pzprv3/hamlepaths/5/5/. . 2 . . /. . 1 . 1 /0 . . . . /. . . 3 . /. - . . 2 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 1 1 1 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /" + ], + [ + "laOnNum", + "pzprv3/hamlepaths/5/5/. . 2 . . /. . 1 . 1 /0 . . . . /. . . 3 . /. - . . 2 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /1 1 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /" + ], + [ + "laCurve", + "pzprv3/hamlepaths/5/5/. . 2 . . /. . 1 . 1 /0 . . . . /. . . 3 . /. - . . 2 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 1 1 0 /0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 1 0 0 0 /0 0 0 0 0 /" + ], + [ + "laIsolate", + "pzprv3/hamlepaths/5/5/. . 2 . . /. . 1 . 1 /0 . . . . /. . . 3 . /. - . . 2 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /1 1 0 0 /0 0 0 0 /0 0 0 0 /1 1 0 0 /1 0 1 1 /0 0 0 1 0 /0 0 1 1 1 /0 0 0 1 0 /0 0 0 0 0 /" + ], + [ + "nmNoMove", + "pzprv3/hamlepaths/5/5/. . 2 . . /. . 1 . 1 /0 . . . . /. . . 3 . /. - . . 2 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /1 1 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /1 0 1 1 /0 0 0 0 1 /0 0 1 0 0 /0 0 0 0 0 /0 0 0 0 0 /" + ], + [ + "laLenNe", + "pzprv3/hamlepaths/5/5/. . 2 . . /. . 1 . 1 /0 . . . . /. . . 3 . /. - . . 2 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /1 1 0 0 /0 0 1 0 /0 0 0 0 /0 0 1 0 /1 0 0 1 /0 0 0 0 0 /0 0 0 0 1 /0 0 0 0 0 /0 0 0 0 0 /" + ], + [ + "csAdjacent", + "pzprv3/hamlepaths/5/5/. . 2 . . /. . 1 . 1 /0 . . . . /. . . 3 . /. - . . 2 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /1 1 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /1 0 1 1 /0 0 0 1 1 /0 0 1 1 0 /0 0 0 1 0 /0 0 0 0 0 /" + ], + [ + "cuDivide", + "pzprv3/hamlepaths/5/5/. . 2 . . /. . 1 . 1 /0 . . . . /. . . 3 . /. - . . 2 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /1 1 0 0 /0 1 0 0 /0 0 0 0 /0 0 0 0 /1 0 1 1 /0 0 0 1 0 /0 0 0 1 1 /0 0 0 1 0 /0 0 0 0 0 /" + ], + [ + null, + "pzprv3/hamlepaths/5/5/. . 2 . . /. . 1 . 1 /0 . . . . /. . . 3 . /. - . . 2 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /1 1 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /1 0 1 1 /0 0 0 1 0 /0 0 1 1 1 /0 0 0 1 0 /0 0 0 0 0 /" + ] + ], + inputs: [] +});