From aa91b0d9508c301a0bd3000863c6591ed0aeb0eb Mon Sep 17 00:00:00 2001 From: WEBXOSS Date: Sun, 6 Aug 2017 17:46:59 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20implement=20WX16-006=20cost?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CardInfo.js | 11 +++++++---- Player.js | 9 +++++++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/CardInfo.js b/CardInfo.js index 1036164..bfaf0ae 100644 --- a/CardInfo.js +++ b/CardInfo.js @@ -117259,9 +117259,12 @@ var CardInfo = { "ターン終了時まで、あなたのシグニ1体は「バニッシュされない。」を得る。", "あなたのトラッシュからあなたのルリグと同じ色を持つシグニを2枚まで手札に加える。", ], - // costChange: function () { - // TODO... - // }, + costChange: function () { + var obj = Object.create(this); + obj.costChange = null; + obj._2286 = true; + return obj; + }, useCondition: function () { return !this.player.lrig.hasColor('colorless'); }, @@ -117293,7 +117296,7 @@ var CardInfo = { },{ actionAsyn: function () { var filter = function (card) { - return card.hasSameColorWith(this.player.lrig); + return card.hasSameColorWith(card.player.lrig); }; return this.player.pickCardAsyn(filter,0,2); }, diff --git a/Player.js b/Player.js index a759d5a..4002257 100644 --- a/Player.js +++ b/Player.js @@ -479,7 +479,6 @@ Player.prototype.summonResonaAsyn = function (card) { Player.prototype.selectSummonZoneAsyn = function (optional,rise) { var zones = this.getSummonZones(null,rise); if (!zones.length) { - debugger; return Callback.immediately(null); } if (optional) return this.selectOptionalAsyn('SUMMON_SIGNI_ZONE',zones); @@ -1542,7 +1541,13 @@ Player.prototype.encodeCard = function (card, costObj) { Player.prototype.encodeCost = function (cost, withoutFilter) { // cost => [{ count: 3, mask: 0b00001, filter: () => ... }, ...] var requirements = [] - if (cost.costColorless) requirements.push({ count: cost.costRed, mask: 31 }) + if (cost.costColorless) { + if (cost._2286) { + requirements.push({ count: cost.costColorless, mask: this.cardToInteger(this.lrig) }) + } else { + requirements.push({ count: cost.costColorless, mask: 31 }) + } + } if (cost.costWhite) requirements.push({ count: cost.costWhite, mask: 1 }) if (cost.costBlack) requirements.push({ count: cost.costBlack, mask: 3 }) if (cost.costGreen) requirements.push({ count: cost.costGreen, mask: 4 })