mirror of
https://github.com/webxoss/webxoss-core.git
synced 2024-11-20 06:49:53 +01:00
double sided resona
This commit is contained in:
parent
32979b97c4
commit
690dbd07c6
7 changed files with 61 additions and 11 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,3 +2,4 @@ node_modules
|
|||
trash
|
||||
.DS_Store
|
||||
*.sublime-*
|
||||
yarn.lock
|
27
Card.js
27
Card.js
|
@ -1,6 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
function Card (game,player,zone,pid) {
|
||||
function Card (game,player,zone,pid,side) {
|
||||
// 引用
|
||||
this.game = game;
|
||||
this.player = player;
|
||||
|
@ -85,7 +85,16 @@ function Card (game,player,zone,pid) {
|
|||
this.crossIcon = !!(info.crossLeft || info.crossRight);
|
||||
this.crossed = null;
|
||||
|
||||
// 双面
|
||||
if (side) {
|
||||
this.sideA = info.sideA? side : null;
|
||||
this.sideB = info.sideB? side : null;
|
||||
} else {
|
||||
this.sideA = info.sideA? new Card(game,player,zone,info.sideA,this) : null;
|
||||
this.sideB = info.sideB? new Card(game,player,zone,info.sideB,this) : null;
|
||||
}
|
||||
|
||||
// 杂项
|
||||
this.effectFilters = [];
|
||||
this.registeredEffects = [];
|
||||
this.charm = null; // 魅饰卡
|
||||
|
@ -728,7 +737,7 @@ Card.prototype.moveTo = function (zone,arg) {
|
|||
zone.player.signis.push(card);
|
||||
}
|
||||
}
|
||||
}else if ((zone.name === 'LrigZone') && !arg.bottom) {
|
||||
} else if ((zone.name === 'LrigZone') && !arg.bottom) {
|
||||
// 进入 LrigZone
|
||||
lrigChangeEvent = {
|
||||
oldLrig: zone.player.lrig,
|
||||
|
@ -836,6 +845,20 @@ Card.prototype.moveTo = function (zone,arg) {
|
|||
card.onStartUp.trigger(enterFieldEvent);
|
||||
}
|
||||
}
|
||||
// 双面共鸣
|
||||
var side = card.sideA || card.sideB;
|
||||
if (side && !arg.isSide) {
|
||||
var arg = {
|
||||
isSide: true,
|
||||
};
|
||||
if (enterFieldEvent) {
|
||||
side.moveTo(card.player.excludedZone,arg);
|
||||
} else if (zone === card.player.lrigTrashZone) {
|
||||
side.moveTo(zone,arg);
|
||||
} else if (zone === card.player.lrigDeck) {
|
||||
side.moveTo(zone,arg);
|
||||
}
|
||||
}
|
||||
card.game.frameEnd();
|
||||
|
||||
return true;
|
||||
|
|
26
CardInfo.js
26
CardInfo.js
|
@ -17607,7 +17607,11 @@ var CardInfo = {
|
|||
}
|
||||
},{
|
||||
condition: function () {
|
||||
return this.player.lrigTrashZone.cards.length >= 7;
|
||||
// 双面共鸣
|
||||
var cards = this.player.lrigTrashZone.cards.filter(function (card) {
|
||||
return !card.sideA;
|
||||
},this);
|
||||
return cards.length >= 7;
|
||||
},
|
||||
action: function (set,add) {
|
||||
set(this,'doubleCrash',true);
|
||||
|
@ -17752,7 +17756,7 @@ var CardInfo = {
|
|||
}
|
||||
},{
|
||||
condition: function () {
|
||||
return this.player.lrigDeck.cards.length === 0;
|
||||
return !this.player.lrigDeck.cards.length;
|
||||
},
|
||||
action: function (set,add) {
|
||||
set(this,'power',18000);
|
||||
|
@ -107117,7 +107121,7 @@ var CardInfo = {
|
|||
],
|
||||
constEffects: [{
|
||||
action: function (set,add) {
|
||||
set(this.player.opponent,'oneArtEachTurn',effect);
|
||||
set(this.player.opponent,'oneArtEachTurn',true);
|
||||
}
|
||||
}],
|
||||
// ======================
|
||||
|
@ -107172,6 +107176,7 @@ var CardInfo = {
|
|||
cid: 1768,
|
||||
"timestamp": 1468055282143,
|
||||
"wxid": "WX13-005B",
|
||||
sideA: 1769,
|
||||
name: "白羅星 ニュームーン",
|
||||
name_zh_CN: "黑幻虫 大王具足虫【HS】",
|
||||
name_en: "New Moon, White Natural Star",
|
||||
|
@ -107344,6 +107349,7 @@ var CardInfo = {
|
|||
cid: 1769,
|
||||
"timestamp": 1468055282847,
|
||||
"wxid": "WX13-005A",
|
||||
sideB: 1768,
|
||||
name: "白羅星 フルムーン",
|
||||
name_zh_CN: "白罗星 满月",
|
||||
name_en: "Full Moon, White Natural Star",
|
||||
|
@ -107391,6 +107397,7 @@ var CardInfo = {
|
|||
};
|
||||
var signis = this.player.signis.filter(filter);
|
||||
var hands = this.player.hands.filter(filter);
|
||||
var cards_trash = [];
|
||||
if (concat(signis,hands).length < 3) return null;
|
||||
if (this.canSummon()) {
|
||||
return function () {
|
||||
|
@ -107462,7 +107469,7 @@ var CardInfo = {
|
|||
],
|
||||
constEffects: [{
|
||||
action: function (set,add) {
|
||||
this.player.signis.forEach(function (signis) {
|
||||
this.player.signis.forEach(function (signi) {
|
||||
if (!signi.resona) return;
|
||||
add(signi,'effectFilters',function (card) {
|
||||
return (card.player === this.player) || (card.type !== 'SIGNI');
|
||||
|
@ -108113,6 +108120,7 @@ var CardInfo = {
|
|||
cid: 1778,
|
||||
"timestamp": 1468055302872,
|
||||
"wxid": "WX13-006A",
|
||||
sideB: 1779,
|
||||
name: "黒幻蟲 オウグソク【FA】",
|
||||
name_zh_CN: "黑幻虫 大王具足虫【FA】",
|
||||
name_en: "Ougusoku, Black Phantom Insect (FA)",
|
||||
|
@ -108161,6 +108169,7 @@ var CardInfo = {
|
|||
};
|
||||
var signis = this.player.signis.filter(filter);
|
||||
var hands = this.player.hands.filter(filter);
|
||||
var cards_trash = [];
|
||||
if (concat(signis,hands).length < 3) return null;
|
||||
if (this.canSummon()) {
|
||||
return function () {
|
||||
|
@ -108285,6 +108294,7 @@ var CardInfo = {
|
|||
cid: 1779,
|
||||
"timestamp": 1468055304948,
|
||||
"wxid": "WX13-006B",
|
||||
sideA: 1768,
|
||||
name: "黒幻蟲 オウグソク【HS】",
|
||||
name_zh_CN: "黑幻虫 大王具足虫【HS】",
|
||||
name_en: "Ougusoku, Black Phantom Insect (HS)",
|
||||
|
@ -108515,11 +108525,14 @@ var CardInfo = {
|
|||
startUpEffects: [{
|
||||
actionAsyn: function () {
|
||||
var cards = this.player.trashZone.cards.filter(function (card) {
|
||||
// 注意这里不要 card.canSummon() ,因为可以通过选择不满足的SIGNI达成空发。
|
||||
return (card.type === 'SIGNI') && card.hasColor('white');
|
||||
},this);
|
||||
return this.player.selectAsyn('SUMMON_SIGNI',cards).callback(this,function (card) {
|
||||
if (!card.canSummon()) return;
|
||||
return card.summonAsyn();
|
||||
return card.summonAsyn().callback(this,function () {
|
||||
card.trashWhenTurnEnd();
|
||||
});
|
||||
});
|
||||
}
|
||||
}],
|
||||
|
@ -109109,6 +109122,7 @@ var CardInfo = {
|
|||
};
|
||||
var signis = this.player.signis.filter(filter);
|
||||
var hands = this.player.hands.filter(filter);
|
||||
var cards_trash = [];
|
||||
if (concat(signis,hands).length < 3) return null;
|
||||
if (this.canSummon()) {
|
||||
return function () {
|
||||
|
@ -109855,7 +109869,7 @@ var CardInfo = {
|
|||
});
|
||||
}
|
||||
});
|
||||
add(this,'onAttackPhaseStart',effect);
|
||||
add(this.player,'onAttackPhaseStart',effect);
|
||||
}
|
||||
}],
|
||||
// ======================
|
||||
|
|
|
@ -411,6 +411,7 @@ Player.prototype.summonSigniAsyn = function () {
|
|||
|
||||
// 玩家召唤共鸣SIGNI
|
||||
Player.prototype.summonResonaSigniAsyn = function (arg) {
|
||||
if (!arg) arg = {};
|
||||
var cards = this.getResonas(arg);
|
||||
if (!cards.length) {
|
||||
return Callback.never();
|
||||
|
|
5
Zone.js
5
Zone.js
|
@ -25,7 +25,10 @@ function Zone (game,player,name,args,pids) {
|
|||
this.cards = [];
|
||||
if (isArr(pids)) {
|
||||
pids.forEach(function (pid) {
|
||||
this.cards.push(new Card(game,player,this,pid));
|
||||
var card = new Card(game,player,this,pid);
|
||||
this.cards.push(card);
|
||||
if (card.sideA) this.cards.push(card.sideA);
|
||||
if (card.sideB) this.cards.push(card.sideB);
|
||||
},this);
|
||||
}
|
||||
|
||||
|
|
8
package.json
Normal file
8
package.json
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"dependencies": {
|
||||
"compression": "^1.6.2",
|
||||
"express": "^4.14.0",
|
||||
"random-js": "^1.0.8",
|
||||
"socket.io": "^1.5.0"
|
||||
}
|
||||
}
|
|
@ -1 +1 @@
|
|||
Subproject commit 1129c71e168857fee9416066f7f64b7fdb8f7491
|
||||
Subproject commit a309b946d29d9a29f2ba1f69b07f3c0162665c8b
|
Loading…
Reference in a new issue