Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src-ui/changes.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
<main>
<div style="margin-bottom: 5px;"><b>Latest types</b> (<em><a href="/list.html" target="_parent">all types</a></em>)</div>
<ul>
<li><a href="/p?sashikabe" target="_parent">Sashikabe</a></li>
<li><a href="/p?blindrush" target="_parent">Blind Rush 猪突猛進</a></li>
<li><a href="/p?cityspace" target="_parent">City Space</a></li>
<li><a href="/p?numcity" target="_parent">Number City ナンバーシティ一</a></li>
<li><a href="/p?distopia" target="_parent">Distopia</a></li>
<li><a href="/p?uturns" target="_parent">U-Turns</a></li>
<li><a href="/p?isowatari" target="_parent">Isowatari イソワタリ</a></li>
<li><a href="/p?narrow" target="_parent">Narrowfence</a></li>
</ul>
</main>
</body>
Binary file added src-ui/img/sashikabe.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src-ui/js/ui/Misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ function toBGimage(pid) {
"retsurin",
"roundtrip",
"sananko",
"sashikabe",
"sashikazune",
"satogaeri",
"scrin",
Expand Down
1 change: 1 addition & 0 deletions src-ui/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ <h2 id="title"><span lang="ja">パズルの種類のリスト</span><span lang="
<li data-pid="island"></li>
<li data-pid="isowatari"></li>
<li data-pid="cityspace"></li>
<li data-pid="sashikabe"></li>
</ul>
</div>
<div class="lists blocks">
Expand Down
1 change: 1 addition & 0 deletions src/pzpr/variety.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@
roma: [0, 0, "ろーま", "Roma", "", { alias: "rome" }],
roundtrip: [0, 0, "Round Trip", "Round Trip"],
sananko: [0, 0, "サンアンコー", "San-Anko", "kakuru"],
sashikabe: [0, 0, "Sashikabe", "Sashikabe", "loute"],
sashigane: [0, 0, "さしがね", "Sashigane", "loute"],
sashikazune: [0, 0, "さしカズね", "Sashikazune", "loute"],
satogaeri: [
Expand Down
177 changes: 135 additions & 42 deletions src/variety/loute.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,37 @@
} else {
pzpr.classmgr.makeCustom(pidlist, classbase);
}
})(["loute", "sashigane", "sashikazune"], {
})(["loute", "sashigane", "sashikazune", "sashikabe"], {
//---------------------------------------------------------
// マウス入力系
"MouseEvent@loute": {
autoplay_func: "border",
inputModes: {
edit: ["arrow", "circle-unshade", "undef", "clear"],
play: ["border", "subline"]
}
},
"MouseEvent@sashigane": {
autoplay_func: "border",
inputModes: {
edit: ["arrow", "number", "undef", "clear"],
play: ["border", "subline"]
},
}
},
"MouseEvent@sashikabe": {
use: true,
autoplay_func: "cell",
inputModes: {
edit: ["arrow", "number", "undef", "clear", "info-blk"],
play: ["shade", "unshade", "info-blk"]
}
},
"MouseEvent@loute,sashigane,sashikabe#1": {
mouseinput_number: function() {
if (this.mousestart) {
this.inputqnum_loute();
}
}
},
"MouseEvent@loute,sashigane#1": {
},
mouseinput: function() {
// オーバーライド
if (this.inputMode === "undef" || this.inputMode === "circle-unshade") {
Expand All @@ -38,21 +48,11 @@
this.common.mouseinput.call(this);
}
},
mouseinput_auto: function() {
if (this.puzzle.playmode) {
if (this.mousestart || this.mousemove) {
if (this.btn === "left" && this.isBorderMode()) {
this.inputborder();
} else {
this.inputQsubLine();
}
}
} else if (this.puzzle.editmode) {
if (this.mousestart || this.mousemove) {
this.inputarrow_cell();
} else if (this.mouseend && this.notInputted()) {
this.inputqnum_loute();
}
mouseinputAutoEdit: function() {
if (this.mousestart || this.mousemove) {
this.inputarrow_cell();
} else if (this.mouseend && this.notInputted()) {
this.inputqnum_loute();
}
},

Expand Down Expand Up @@ -157,7 +157,7 @@
KeyEvent: {
enablemake: true
},
"KeyEvent@loute,sashigane": {
"KeyEvent@loute,sashigane,sashikabe": {
moveTarget: function(ca) {
if (ca.match(/shift/)) {
return false;
Expand All @@ -172,7 +172,7 @@

if (this.pid === "loute") {
this.key_arrow_loute(ca);
} else if (this.pid === "sashigane") {
} else {
this.key_inputqnum_sashigane(ca);
}
},
Expand Down Expand Up @@ -251,6 +251,13 @@
//---------------------------------------------------------
// 盤面管理系
Cell: {
allowShade: function() {
return !this.qdir;
},
allowUnshade: function() {
return !this.qdir;
},

maxnum: function() {
var bd = this.board,
bx = this.bx,
Expand All @@ -269,6 +276,16 @@
return this.qdir === 5;
}
},
"Cell@sashikabe": {
posthook: {
qdir: function(num) {
if (num) {
this.setQans(0);
this.setQsub(0);
}
}
}
},
"Cell@sashikazune": {
minnum: 1,
maxnum: function() {
Expand All @@ -280,16 +297,41 @@
cols: 8,
rows: 8,

hasborder: 1
hasborder: 1,
addExtraInfo: function() {
this.lgraph = this.addInfoList(this.klass.AreaLGraph);
}
},
"BoardExec@loute,sashigane": {
"BoardExec@loute,sashigane,sashikabe": {
adjustBoardData: function(key, d) {
this.adjustNumberArrow(key, d);
}
},

AreaRoomGraph: {
"AreaShadeGraph@sashikabe": {
enabled: true,
coloring: true
},
"AreaLGraph:AreaUnshadeGraph@sashikabe#1": {
enabled: true
},
"AreaLGraph:AreaRoomGraph@loute,sashigane,sashikazune#1": {
enabled: true
},

"AreaLGraph#3": {
getComponentRefs: function(obj) {
return obj.lcomp;
}, // getSideAreaInfo用
setComponentRefs: function(obj, component) {
obj.lcomp = component;
},
getObjNodeList: function(nodeobj) {
return nodeobj.lcompnodes;
},
resetObjNodeList: function(nodeobj) {
nodeobj.lcompnodes = [];
},

// オーバーライド
resetExtraData: function(cell) {
Expand All @@ -306,7 +348,7 @@
var subclist = this.board
.cellinside(d.x1, d.y1, d.x2, d.y2)
.filter(function(cell) {
return cell.room !== component;
return cell.lcomp !== component;
});
var dl = subclist.getRectSize();
if (
Expand Down Expand Up @@ -357,7 +399,7 @@
}
},

"AreaRoomGraph@sashikazune": {
"AreaLGraph@sashikazune#2": {
setCellPlaces: function(clist, d, dl) {
var bd = this.board;
var corner = null;
Expand Down Expand Up @@ -395,12 +437,18 @@

paint: function() {
this.drawBGCells();
this.drawDashedGrid();
this.drawBorders();
if (this.pid === "sashikabe") {
this.drawShadedCells();
this.drawDotCells();
this.drawGrid();
} else {
this.drawDashedGrid();
this.drawBorders();
}

this.drawCellArrows();
this.drawHatenas_loute();
if (this.pid === "sashigane") {
if (this.pid === "sashigane" || this.pid === "sashikabe") {
this.drawCircledNumbers();
} else if (this.pid === "loute") {
this.drawCircles();
Expand Down Expand Up @@ -439,6 +487,10 @@
}
}
},
"Graphic@sashikabe": {
gridcolor_type: "DARK",
irowakeblk: true
},
"Graphic@sashikazune": {
fontsizeratio: 0.75,
drawArrowAuxMarks: function() {
Expand Down Expand Up @@ -553,7 +605,7 @@
this.outbstr += cm;
}
},
"Encode@sashigane": {
"Encode@sashigane,sashikabe": {
decodePzpr: function(type) {
this.decodeSashigane();
},
Expand Down Expand Up @@ -651,28 +703,40 @@
}
} else if (ca === "-") {
cell.qdir = -2;
} else if (ca === "#") {
cell.qans = 1;
} else if (ca === "_") {
cell.qsub = 1;
} else if (ca !== ".") {
cell.qdir = +ca;
}
});

this.decodeBorderAns();
if (this.pid !== "sashikabe") {
this.decodeBorderAns();
}
},
encodeData: function() {
var pid = this.pid;
this.encodeCell(function(cell) {
if (pid === "sashigane" && cell.qdir === 5) {
if ((pid === "sashigane" || pid === "sashikabe") && cell.qdir === 5) {
return "o" + (cell.qnum !== -1 ? cell.qnum : "") + " ";
} else if (cell.qdir === -2) {
return "- ";
} else if (cell.qdir !== 0) {
return cell.qdir + " ";
} else if (cell.qsub) {
return "_ ";
} else if (cell.qans) {
return "# ";
} else {
return ". ";
}
});

this.encodeBorderAns();
if (pid !== "sashikabe") {
this.encodeBorderAns();
}
}
},
"FileIO@sashikazune": {
Expand All @@ -692,16 +756,29 @@
// 正解判定処理実行部
AnsCheck: {
checklist: [
"check2x2ShadeCell@sashikabe",
"checkArrowCorner1",
"checkArrowCorner2",
"checkCircleCorner",
"checkNumberAndSize+@sashigane",
"checkBorderDeadend",
"checkLblock"
"checkNumberAndSize+@sashigane,sashikabe",
"checkBorderDeadend@!sashikabe",
"checkLblock",
"checkConnectShade@sashikabe",
"doneShadingDecided@sashikabe"
],

checkNumberAndSize: function() {
this.checkAllArea(
this.board.lgraph,
function(w, h, a, n) {
return n <= 0 || n === a;
},
"bkSizeNe"
);
},

checkArrowCorner1: function() {
var rooms = this.board.roommgr.components;
var rooms = this.board.lgraph.components;
allloop: for (var id = 0; id < rooms.length; id++) {
if (rooms[id].shape === 0) {
continue;
Expand All @@ -726,7 +803,7 @@
},

checkArrowCorner2: function() {
var rooms = this.board.roommgr.components;
var rooms = this.board.lgraph.components;
allloop: for (var id = 0; id < rooms.length; id++) {
if (rooms[id].shape === 0) {
continue;
Expand Down Expand Up @@ -761,7 +838,7 @@
},

checkCircleCorner: function() {
var rooms = this.board.roommgr.components;
var rooms = this.board.lgraph.components;
allloop: for (var id = 0; id < rooms.length; id++) {
if (rooms[id].shape === 0) {
continue;
Expand All @@ -785,7 +862,7 @@
},

checkLblock: function() {
var rooms = this.board.roommgr.components;
var rooms = this.board.lgraph.components;
for (var id = 0; id < rooms.length; id++) {
if (rooms[id].shape !== 0) {
continue;
Expand All @@ -799,6 +876,22 @@
}
}
},
"AnsCheck@sashikabe": {
checkArrowCorner2: function() {
this.checkAllCell(function(cell) {
var dir = cell.getObjNum();
if (dir < 1 || dir > 4) {
return false;
}

var next = cell
.getaddr()
.movedir(dir, 2)
.getc();
return next.isnull || next.isShade();
}, "arNotPtCnr");
}
},
"AnsCheck@sashikazune": {
checklist: [
"checkNumberDistance",
Expand All @@ -817,7 +910,7 @@

checkNumber3Count: function() {
this.checkAllBlock(
this.board.roommgr,
this.board.lgraph,
function(cell) {
return cell.isNum() && cell.place !== 0;
},
Expand Down
Loading