Skip to content

Commit fe484fd

Browse files
committed
Add Disconnection
1 parent 28d47f5 commit fe484fd

6 files changed

Lines changed: 73 additions & 14 deletions

File tree

src-ui/list.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ <h2 id="title"><span lang="ja">パズルの種類のリスト</span><span lang="
103103
<li data-pid="marutaring"></li>
104104
<li data-pid="tetroctb"></li>
105105
<li data-pid="bramble"></li>
106+
<li data-pid="disco"></li>
106107
</ul>
107108
</div>
108109
<div class="lists blocks">

src/pzpr/variety.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@
150150
dbchoco: [0, 0, "ダブルチョコ", "Double Choco", "cbblock"],
151151
detour: [0, 0, "Detour", "Detour", "country"],
152152
diamond: [0, 0, "Diamond Chain", "Diamond Chain"],
153+
disco: [0, 0, "ディスコネクション", "Disconnection", "shimaguni"],
153154
disloop: [0, 0, "Disorderly Loop", "Disorderly Loop", "tapaloop"],
154155
distopia: [0, 0, "Distopia", "Distopia", "statuepark"],
155156
dominion: [0, 0, "ドミニオン", "Dominion"],

src/res/failcode.en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@
335335
"bkSumNeBn.yosenabe": "Sum of filling is not equal to a crock.",
336336
"bkUCGe2.dosufuwa": "An area has two or more balloons.",
337337
"bkUnitNe2.kuroclone": "There is an area without exactly two units.",
338-
"bkUnitNe2.nuritwin": "An area doesn't have exactly two blocks.",
338+
"bkUnitNe2": "An area doesn't have exactly two blocks.",
339339
"bkUnknown.lohkous": "A room has a segment of invalid length.",
340340
"bkUnshade.lapaz": "A 1x1 region is unshaded.",
341341
"bkUnshadeConsecGt3": "There is a line of consecutive unshaded cells that goes through 2 region borders.",

src/res/failcode.ja.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@
845845
"lnAdjacent.tjunction": "同じ方向の枝分かれした線が隣接しています。",
846846
"bkMaxSizeNe.tilecity": "県の中で最も大きい市の面積と数字が違います。",
847847
"bkSizeNe.balloon": "風船の大きさと数字が一致していません。",
848-
"bkUnitNe2.nuritwin": "領域に置かれているブロックの数が2つではありません。",
848+
"bkUnitNe2": "領域に置かれているブロックの数が2つではありません。",
849849
"lcDivided.tjunction": "線が分断されています。",
850850
"csSameJunction": "黒マスが同じ方向をした複数の枝分かれした線に触れています。",
851851
"haisuSG.recoil": "菱形から複数本の線が伸びています。",

src/variety/shimaguni.js

Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
"nuritwin",
2020
"marutaring",
2121
"tetroctb",
22-
"bramble"
22+
"bramble",
23+
"disco"
2324
],
2425
{
2526
//---------------------------------------------------------
@@ -45,6 +46,15 @@
4546
play: ["shade", "unshade", "info-blk"]
4647
}
4748
},
49+
"MouseEvent@disco": {
50+
inputModes: {
51+
edit: ["info-blk"],
52+
play: ["shade", "unshade", "info-blk"]
53+
},
54+
mouseinputAutoEdit: function() {
55+
this.inputborder();
56+
}
57+
},
4858
"MouseEvent@cocktail,martini,tetroctb,bramble#2": {
4959
dispInfoBlk: function() {
5060
var cell = this.getcell();
@@ -184,7 +194,7 @@
184194
Board: {
185195
hasborder: 1
186196
},
187-
"Board@shimaguni,stostone,heyablock,cocktail,martini,nuritwin,marutaring,tetroctb": {
197+
"Board@shimaguni,stostone,heyablock,cocktail,martini,nuritwin,marutaring,tetroctb,disco": {
188198
addExtraInfo: function() {
189199
this.stonegraph = this.addInfoList(this.klass.AreaStoneGraph);
190200
}
@@ -306,7 +316,7 @@
306316
"AreaShadeGraph@chocona,tetroctb,bramble": {
307317
enabled: true
308318
},
309-
"AreaShadeGraph@nuritwin,marutaring": {
319+
"AreaShadeGraph@nuritwin,marutaring,disco": {
310320
enabled: true,
311321
coloring: true
312322
},
@@ -318,7 +328,7 @@
318328
component.hinge = null;
319329
}
320330
},
321-
"AreaStoneGraph:AreaShadeGraph@shimaguni,stostone,heyablock,cocktail,martini,nuritwin,marutaring,tetroctb": {
331+
"AreaStoneGraph:AreaShadeGraph@shimaguni,stostone,heyablock,cocktail,martini,nuritwin,marutaring,tetroctb,disco": {
322332
// Same as LITS AreaTetrominoGraph
323333
enabled: true,
324334
relation: { "cell.qans": "node", "border.ques": "separator" },
@@ -374,20 +384,21 @@
374384
paint: function() {
375385
this.drawBGCells();
376386

377-
if (this.pid !== "nuritwin") {
387+
if (this.pid !== "nuritwin" && this.pid !== "disco") {
378388
this.drawGrid();
379389
}
380390

381391
if (
382392
this.pid === "stostone" ||
383393
this.pid === "nuritwin" ||
394+
this.pid === "disco" ||
384395
this.pid === "marutaring"
385396
) {
386397
this.drawDotCells_stostone();
387398
}
388399
this.drawShadedCells();
389400

390-
if (this.pid === "nuritwin") {
401+
if (this.pid === "nuritwin" || this.pid === "disco") {
391402
this.drawGrid();
392403
}
393404

@@ -423,7 +434,7 @@
423434
);
424435
}
425436
},
426-
"Graphic@stostone,nuritwin,marutaring#1": {
437+
"Graphic@stostone,nuritwin,marutaring,disco#1": {
427438
irowakeblk: true,
428439
bgcellcolor_func: "error1",
429440
bcolor: "rgb(80, 204, 80)",
@@ -534,7 +545,7 @@
534545
: this.getCircleFillColor_qnum(cell);
535546
}
536547
},
537-
"Graphic@martini,nuritwin#2": {
548+
"Graphic@martini,nuritwin,disco#2": {
538549
shadecolor: "#444444"
539550
},
540551

@@ -560,6 +571,14 @@
560571
this.encodeNumber16();
561572
}
562573
},
574+
"Encode@disco": {
575+
decodePzpr: function(type) {
576+
this.decodeBorder();
577+
},
578+
encodePzpr: function(type) {
579+
this.encodeBorder();
580+
}
581+
},
563582
//---------------------------------------------------------
564583
FileIO: {
565584
decodeData: function() {
@@ -584,6 +603,16 @@
584603
}
585604
}
586605
},
606+
"FileIO@disco": {
607+
decodeData: function() {
608+
this.decodeBorderQues();
609+
this.decodeCellAns();
610+
},
611+
encodeData: function() {
612+
this.encodeBorderQues();
613+
this.encodeCellAns();
614+
}
615+
},
587616

588617
//---------------------------------------------------------
589618
// 正解判定処理実行部
@@ -631,11 +660,11 @@
631660
"checkShadeCellCount"
632661
]
633662
},
634-
"AnsCheck@nuritwin#1": {
663+
"AnsCheck@nuritwin,disco#1": {
635664
checklist: [
636665
"check2x2ShadeCell",
637-
"checkShadeBlockSize",
638-
"checkSizesEqual",
666+
"checkShadeBlockSize@nuritwin",
667+
"checkSizesEqual@nuritwin",
639668
"checkTwoBlocks",
640669
"checkConnectShade",
641670
"checkNoShadeCellInArea",
@@ -987,7 +1016,7 @@
9871016
this.checkOneArea(this.board.sblk8mgr, "csDivide");
9881017
}
9891018
},
990-
"AnsCheck@nuritwin": {
1019+
"AnsCheck@nuritwin,disco": {
9911020
checkShadeBlockSize: function() {
9921021
var blocks = this.board.stonegraph.components;
9931022
for (var id = 0; id < blocks.length; id++) {

test/script/disco.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/* disco.js */
2+
3+
ui.debug.addDebugData("disco", {
4+
url: "5/5/d552apfg",
5+
failcheck: [
6+
[
7+
"bkNoShade",
8+
"pzprv3/disco/5/5/0 1 1 0 /1 0 0 1 /0 1 0 0 /1 0 1 0 /0 0 1 0 /0 1 0 1 0 /1 1 0 0 1 /0 1 1 1 1 /1 0 0 0 0 /. . . # . /. # # # # /. # . . # /# # # . # /# . # # . /"
9+
],
10+
[
11+
"bkUnitNe2",
12+
"pzprv3/disco/5/5/0 1 1 0 /1 0 0 1 /0 1 0 0 /1 0 1 0 /0 0 1 0 /0 1 0 1 0 /1 1 0 0 1 /0 1 1 1 1 /1 0 0 0 0 /. # # # . /# # . # # /. # . . # /# # # . # /# . # # . /"
13+
],
14+
[
15+
"csDivide",
16+
"pzprv3/disco/5/5/0 1 1 0 /1 0 0 1 /0 1 0 0 /1 0 1 0 /0 0 1 0 /0 1 0 1 0 /1 1 0 0 1 /0 1 1 1 1 /1 0 0 0 0 /. # . # . /# # # # # /. # . . # /# # # # . /# . # . # /"
17+
],
18+
[
19+
"cs2x2",
20+
"pzprv3/disco/5/5/0 1 1 0 /1 0 0 1 /0 1 0 0 /1 0 1 0 /0 0 1 0 /0 1 0 1 0 /1 1 0 0 1 /0 1 1 1 1 /1 0 0 0 0 /. # # # . /# # # . # /. # . . # /# # # . # /# . # # . /"
21+
],
22+
[
23+
null,
24+
"pzprv3/disco/5/5/0 1 1 0 /1 0 0 1 /0 1 0 0 /1 0 1 0 /0 0 1 0 /0 1 0 1 0 /1 1 0 0 1 /0 1 1 1 1 /1 0 0 0 0 /. # . # . /# # # # # /. # . . # /# # # . # /# . # # . /"
25+
]
26+
],
27+
inputs: []
28+
});

0 commit comments

Comments
 (0)