forked from mirrors/webxoss-core
implement virus
This commit is contained in:
parent
fb615375a0
commit
09e42d6252
4 changed files with 42 additions and 22 deletions
4
Card.js
4
Card.js
|
@ -1634,4 +1634,8 @@ Card.prototype.canGainAbility = function (source) {
|
||||||
return !canNotGainAbility;
|
return !canNotGainAbility;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Card.prototype.isInfected = function() {
|
||||||
|
return this.zone.virus;
|
||||||
|
};
|
||||||
|
|
||||||
global.Card = Card;
|
global.Card = Card;
|
36
CardInfo.js
36
CardInfo.js
|
@ -128943,11 +128943,12 @@ var CardInfo = {
|
||||||
constEffects: [{
|
constEffects: [{
|
||||||
auto: 'onBanish',
|
auto: 'onBanish',
|
||||||
actionAsyn: function () {
|
actionAsyn: function () {
|
||||||
// TODO...
|
var zones = this.player.opponent.getInfectedZones();
|
||||||
var cards = this.player.opponent.getVirusCards();
|
if (zones.length < 2) return;
|
||||||
if (cards.length < 2) return;
|
return this.player.selectSomeAsyn('TRASH',zones,2,2).callback(this,function (zones) {
|
||||||
return this.player.selectSomeAsyn('TRASH',cards,2,2).callback(this,function (cards) {
|
zones.forEach(function (zone) {
|
||||||
this.game.trashCards(cards);
|
zone.virus = false;
|
||||||
|
},this);
|
||||||
if (this.zone !== this.player.enerZone) return;
|
if (this.zone !== this.player.enerZone) return;
|
||||||
if (!this.canSummon()) return;
|
if (!this.canSummon()) return;
|
||||||
return this.summonAsyn();
|
return this.summonAsyn();
|
||||||
|
@ -128968,9 +128969,11 @@ var CardInfo = {
|
||||||
],
|
],
|
||||||
startUpEffects: [{
|
startUpEffects: [{
|
||||||
actionAsyn: function () {
|
actionAsyn: function () {
|
||||||
// TODO...
|
var cards = this.player.opponent.signis;
|
||||||
// Not optional
|
return this.player.selectTextAsyn(cards).callback(this,function (card) {
|
||||||
return this.decreasePowerAsyn(10000);
|
if (!card) return;
|
||||||
|
this.game.tillTurnEndAdd(this,card,'power',-10000);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
}],
|
}],
|
||||||
// ======================
|
// ======================
|
||||||
|
@ -128989,7 +128992,6 @@ var CardInfo = {
|
||||||
actionAsyn: function () {
|
actionAsyn: function () {
|
||||||
return this.player.selectOpponentSigniAsyn().callback(this,function (card) {
|
return this.player.selectOpponentSigniAsyn().callback(this,function (card) {
|
||||||
if (!card) return;
|
if (!card) return;
|
||||||
// TODO...
|
|
||||||
var value = card.isInfected() ? -8000 : -12000;
|
var value = card.isInfected() ? -8000 : -12000;
|
||||||
this.game.tillTurnEndAdd(this,card,'power',value);
|
this.game.tillTurnEndAdd(this,card,'power',value);
|
||||||
});
|
});
|
||||||
|
@ -130133,14 +130135,10 @@ var CardInfo = {
|
||||||
actionEffects: [{
|
actionEffects: [{
|
||||||
costDown: true,
|
costDown: true,
|
||||||
actionAsyn: function () {
|
actionAsyn: function () {
|
||||||
// TODO...
|
|
||||||
var cards = this.player.opponent.getInfectedCards();
|
var cards = this.player.opponent.getInfectedCards();
|
||||||
return this.player.selectTargetOptionalAsyn(cards).callback(this,function (card) {
|
return this.player.selectTargetOptionalAsyn(cards).callback(this,function (card) {
|
||||||
if (!card) return;
|
if (!card) return;
|
||||||
// TODO...
|
card.zone.virus = false;
|
||||||
var virus = card.getVirus();
|
|
||||||
if (!virus) return;
|
|
||||||
virus.trash();
|
|
||||||
this.game.tillTurnEndAdd(this,card,'power',-7000);
|
this.game.tillTurnEndAdd(this,card,'power',-7000);
|
||||||
if (card.power <= 0) {
|
if (card.power <= 0) {
|
||||||
this.player.draw(1);
|
this.player.draw(1);
|
||||||
|
@ -131483,7 +131481,6 @@ var CardInfo = {
|
||||||
constEffects: [{
|
constEffects: [{
|
||||||
auto: 'onBanish',
|
auto: 'onBanish',
|
||||||
actionAsyn: function () {
|
actionAsyn: function () {
|
||||||
// TODO...
|
|
||||||
return this.player.infectZoneAsyn();
|
return this.player.infectZoneAsyn();
|
||||||
},
|
},
|
||||||
}],
|
}],
|
||||||
|
@ -134406,7 +134403,6 @@ var CardInfo = {
|
||||||
"Until end of turn, 1 of your opponent's SIGNI gets −7000 power.",
|
"Until end of turn, 1 of your opponent's SIGNI gets −7000 power.",
|
||||||
],
|
],
|
||||||
costChange: function () {
|
costChange: function () {
|
||||||
// TODO...
|
|
||||||
var zones = this.player.opponent.getInfectedZones();
|
var zones = this.player.opponent.getInfectedZones();
|
||||||
var count = zones.length*2;
|
var count = zones.length*2;
|
||||||
var obj = Object.create(this);
|
var obj = Object.create(this);
|
||||||
|
@ -136107,7 +136103,7 @@ var CardInfo = {
|
||||||
source: this,
|
source: this,
|
||||||
description: '2182-attached-1',
|
description: '2182-attached-1',
|
||||||
actionAsyn: function () {
|
actionAsyn: function () {
|
||||||
this.player.opponent.getInfectedCards.forEach(function (card) {
|
this.player.opponent.getInfectedCards().forEach(function (card) {
|
||||||
this.game.tillTurnEndAdd(this,card,'power',-5000);
|
this.game.tillTurnEndAdd(this,card,'power',-5000);
|
||||||
},this);
|
},this);
|
||||||
}
|
}
|
||||||
|
@ -136170,10 +136166,7 @@ var CardInfo = {
|
||||||
var cards = this.player.opponent.getInfectedCards();
|
var cards = this.player.opponent.getInfectedCards();
|
||||||
return this.player.selectTargetOptionalAsyn(cards).callback(this,function (card) {
|
return this.player.selectTargetOptionalAsyn(cards).callback(this,function (card) {
|
||||||
if (!card) return;
|
if (!card) return;
|
||||||
// TODO...
|
card.zone.virus = false;
|
||||||
var virus = card.getVirus();
|
|
||||||
if (!virus) return;
|
|
||||||
virus.trash();
|
|
||||||
this.game.tillTurnEndAdd(this,card,'power',-5000);
|
this.game.tillTurnEndAdd(this,card,'power',-5000);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -136227,7 +136220,6 @@ var CardInfo = {
|
||||||
constEffects: [{
|
constEffects: [{
|
||||||
auto: 'onBanish',
|
auto: 'onBanish',
|
||||||
actionAsyn: function () {
|
actionAsyn: function () {
|
||||||
// TODO...
|
|
||||||
return this.player.infectZoneAsyn();
|
return this.player.infectZoneAsyn();
|
||||||
},
|
},
|
||||||
}],
|
}],
|
||||||
|
|
22
Player.js
22
Player.js
|
@ -2317,4 +2317,26 @@ Player.prototype.putCardToLifeCloth = function (arg) {
|
||||||
return card;
|
return card;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Player.prototype.getInfectedZones = function() {
|
||||||
|
return this.signiZones.filter(function (zone) {
|
||||||
|
return zone.virus;
|
||||||
|
},this);
|
||||||
|
};
|
||||||
|
|
||||||
|
Player.prototype.getInfectedCards = function() {
|
||||||
|
return this.signis.filter(function (signi) {
|
||||||
|
return signi.isInfected();
|
||||||
|
},this);
|
||||||
|
};
|
||||||
|
|
||||||
|
Player.prototype.infectZoneAsyn = function() {
|
||||||
|
var zones = this.opponent.signiZones.filter(function (zone) {
|
||||||
|
return !zone.virus;
|
||||||
|
},this);
|
||||||
|
return this.selectAsyn('TARGET',zones).callback(this,function (zone) {
|
||||||
|
if (!zone) return;
|
||||||
|
zone.virus = true;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
global.Player = Player;
|
global.Player = Player;
|
2
Zone.js
2
Zone.js
|
@ -35,6 +35,7 @@ function Zone (game,player,name,args,pids) {
|
||||||
// 附加的属性
|
// 附加的属性
|
||||||
this.disabled = false; // <ワーム・ホール>
|
this.disabled = false; // <ワーム・ホール>
|
||||||
this.powerDown = false; // <黒幻蟲 サソリス>
|
this.powerDown = false; // <黒幻蟲 サソリス>
|
||||||
|
this.virus = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Zone.prototype.getTopCards = function (n) {
|
Zone.prototype.getTopCards = function (n) {
|
||||||
|
@ -81,6 +82,7 @@ Zone.prototype.getStates = function () {
|
||||||
var states = [];
|
var states = [];
|
||||||
if (this.powerDown) states.push('powerDown');
|
if (this.powerDown) states.push('powerDown');
|
||||||
if (this.disabled) states.push('disabled');
|
if (this.disabled) states.push('disabled');
|
||||||
|
if (this.virus) states.push('infected');
|
||||||
return states;
|
return states;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue