|
7 | 7 | } else { |
8 | 8 | pzpr.classmgr.makeCustom(pidlist, classbase); |
9 | 9 | } |
10 | | -})(["bonsan", "heyabon", "rectslider", "satogaeri", "timebomb"], { |
| 10 | +})(["bonsan", "heyabon", "rectslider", "satogaeri", "timebomb", "hamlepaths"], { |
11 | 11 | //--------------------------------------------------------- |
12 | 12 | // マウス入力系 |
13 | 13 | "MouseEvent@bonsan,heyabon": { |
|
22 | 22 | play: ["line", "clear", "completion"] |
23 | 23 | } |
24 | 24 | }, |
25 | | - "MouseEvent@rectslider": { |
| 25 | + "MouseEvent@rectslider,hamlepaths": { |
26 | 26 | inputModes: { |
27 | 27 | edit: ["number", "clear"], |
28 | 28 | play: ["line", "bgcolor", "subcircle", "subcross", "clear"] |
|
123 | 123 | } |
124 | 124 |
|
125 | 125 | var puzzle = this.puzzle; |
126 | | - if (puzzle.pid !== "rectslider" && this.inputdark(cell, 1)) { |
| 126 | + if ( |
| 127 | + puzzle.pid !== "rectslider" && |
| 128 | + puzzle.pid !== "hamlepaths" && |
| 129 | + this.inputdark(cell, 1) |
| 130 | + ) { |
127 | 131 | return; |
128 | 132 | } |
129 | 133 | if (puzzle.pid === "satogaeri") { |
|
522 | 526 | this.setEdgeByNodeObj(border.sidecell[1]); |
523 | 527 | } |
524 | 528 | }, |
| 529 | + "AreaUnshadeGraph@hamlepaths": { |
| 530 | + enabled: true, |
| 531 | + relation: { "cell.qnum": "node", "border.line": "move" }, |
| 532 | + isnodevalid: function(cell) { |
| 533 | + return cell.base.qnum === -1; |
| 534 | + }, |
| 535 | + |
| 536 | + modifyOtherInfo: function(border, relation) { |
| 537 | + this.setEdgeByNodeObj(border.sidecell[0]); |
| 538 | + this.setEdgeByNodeObj(border.sidecell[1]); |
| 539 | + } |
| 540 | + }, |
525 | 541 |
|
526 | 542 | //--------------------------------------------------------- |
527 | 543 | // 画像表示系 |
528 | | - "Graphic@bonsan,heyabon,rectslider": { |
| 544 | + "Graphic@bonsan,heyabon,rectslider,hamlepaths": { |
529 | 545 | bgcellcolor_func: "qsub2", |
530 | 546 | autocmp: "number" |
531 | 547 | }, |
|
576 | 592 | this.drawTarget(); |
577 | 593 | } |
578 | 594 | }, |
579 | | - "Graphic@rectslider": { |
| 595 | + "Graphic@rectslider,hamlepaths": { |
580 | 596 | fontShadecolor: "white", |
581 | 597 | qcmpcolor: "gray", |
582 | 598 |
|
583 | 599 | paint: function() { |
| 600 | + this.drawBGCells(); |
| 601 | + |
584 | 602 | this.drawDashedGrid(); |
585 | 603 |
|
586 | 604 | this.drawTip(); |
|
607 | 625 | } |
608 | 626 |
|
609 | 627 | var info = cell.error || cell.qinfo; |
610 | | - if (info === 0) { |
611 | | - return this.quescolor; |
612 | | - } else if (info === 1) { |
613 | | - return this.errcolor1; |
614 | | - } |
615 | | - return null; |
| 628 | + return info > 0 ? this.errcolor1 : this.quescolor; |
616 | 629 | }, |
617 | 630 | getQuesNumberColor: function(cell) { |
618 | 631 | return cell.isCmp() ? this.qcmpcolor : this.fontShadecolor; |
|
758 | 771 | this.fio.encodeQnum_PBox_Sato(); |
759 | 772 | } |
760 | 773 | }, |
761 | | - "Encode@rectslider,timebomb": { |
| 774 | + "Encode@rectslider,timebomb,hamlepaths": { |
762 | 775 | decodePzpr: function(type) { |
763 | 776 | this.decodeNumber16(); |
764 | 777 | }, |
|
771 | 784 | decodeData: function() { |
772 | 785 | this.decodeCellQnum(); |
773 | 786 | this.decodeCellQsubQcmp(); |
774 | | - if (this.pid !== "rectslider" && this.pid !== "timebomb") { |
| 787 | + if ( |
| 788 | + this.pid !== "rectslider" && |
| 789 | + this.pid !== "timebomb" && |
| 790 | + this.pid !== "hamlepaths" |
| 791 | + ) { |
775 | 792 | this.decodeBorderQues(); |
776 | 793 | } |
777 | 794 | this.decodeBorderLine(); |
778 | 795 | }, |
779 | 796 | encodeData: function() { |
780 | 797 | this.encodeCellQnum(); |
781 | 798 | this.encodeCellQsubQcmp(); |
782 | | - if (this.pid !== "rectslider" && this.pid !== "timebomb") { |
| 799 | + if ( |
| 800 | + this.pid !== "rectslider" && |
| 801 | + this.pid !== "timebomb" && |
| 802 | + this.pid !== "hamlepaths" |
| 803 | + ) { |
783 | 804 | this.encodeBorderQues(); |
784 | 805 | } |
785 | 806 | this.encodeBorderLine(); |
|
890 | 911 | "checkMovedBlockRect@rectslider", |
891 | 912 | "checkMovedBlockSize@rectslider", |
892 | 913 |
|
| 914 | + "checkMovedAdjacent@hamlepaths", |
| 915 | + "checkConnectUnshade@hamlepaths", |
| 916 | + |
893 | 917 | "checkLineLength", |
894 | 918 |
|
895 | 919 | "checkFractal@bonsan,heyabon", |
|
1032 | 1056 | }); |
1033 | 1057 | }, "ceNoBomb"); |
1034 | 1058 | } |
| 1059 | + }, |
| 1060 | + "AnsCheck@hamlepaths": { |
| 1061 | + checkMovedAdjacent: function() { |
| 1062 | + this.checkSideCell(function(cell1, cell2) { |
| 1063 | + return cell1.base.isNum() && cell2.base.isNum(); |
| 1064 | + }, "csAdjacent"); |
| 1065 | + } |
| 1066 | + }, |
| 1067 | + "FailCode@hamlepaths": { |
| 1068 | + nmConnected: "nmConnected.rectslider", |
| 1069 | + laOnNum: "laOnNum.rectslider", |
| 1070 | + laIsolate: "laIsolate.rectslider", |
| 1071 | + nmNoMove: "nmNoMove.rectslider" |
1035 | 1072 | } |
1036 | 1073 | }); |
0 commit comments