1
0
mirror of https://github.com/exane/not-gwent-online synced 2024-11-23 19:36:53 +00:00

remove weather on round end

This commit is contained in:
exane 2015-06-23 15:01:39 +02:00
parent 4ff67ec868
commit bf66e9f2ef
3 changed files with 52 additions and 35 deletions

View File

@ -22,7 +22,7 @@ module.exports = {
discard = this.filter(discard, { discard = this.filter(discard, {
"ability": "hero", "ability": "hero",
"type": card.constructor.TYPE.SPECIAL "type": [card.constructor.TYPE.SPECIAL, card.constructor.TYPE.WEATHER]
}) })
this.send("played:medic", { this.send("played:medic", {

View File

@ -62,11 +62,15 @@ var Battle = (function(){
this.p1.draw(10); this.p1.draw(10);
this.p2.draw(10); this.p2.draw(10);
/*this.p1.hand.add(Card("commanders_horn")); /*this.p1.hand.add(Card("commanders_horn"));
this.p2.hand.add(Card("commanders_horn"));*//* this.p2.hand.add(Card("commanders_horn"));*/
/*
this.p1.hand.add(Card("ciaran_aep_easnillien")); this.p1.hand.add(Card("ciaran_aep_easnillien"));
this.p2.hand.add(Card("ciaran_aep_easnillien"));*//* this.p2.hand.add(Card("ciaran_aep_easnillien"));*/
*//*this.p1.hand.add(Card("decoy")); /*
this.p2.hand.add(Card("decoy"));*//* */
/*this.p1.hand.add(Card("decoy"));
this.p2.hand.add(Card("decoy"));*/
/*
this.p1.hand.add(Card("milva")); this.p1.hand.add(Card("milva"));
this.p2.hand.add(Card("milva")); this.p2.hand.add(Card("milva"));
this.p1.hand.add(Card("havekar_healer")); this.p1.hand.add(Card("havekar_healer"));
@ -87,7 +91,8 @@ var Battle = (function(){
this.p1.hand.add(Card("torrential_rain")); this.p1.hand.add(Card("torrential_rain"));
this.p2.hand.add(Card("torrential_rain")); this.p2.hand.add(Card("torrential_rain"));
this.p1.hand.add(Card("clear_weather")); this.p1.hand.add(Card("clear_weather"));
this.p2.hand.add(Card("clear_weather"));*//* this.p2.hand.add(Card("clear_weather"));*/
/*
this.p1.hand.add(Card("kaedweni_siege_expert")); this.p1.hand.add(Card("kaedweni_siege_expert"));
this.p2.hand.add(Card("kaedweni_siege_expert")); this.p2.hand.add(Card("kaedweni_siege_expert"));
this.p1.hand.add(Card("ballista")); this.p1.hand.add(Card("ballista"));
@ -127,6 +132,8 @@ var Battle = (function(){
r.switchTurn = function(side, __flag){ r.switchTurn = function(side, __flag){
__flag = typeof __flag == "undefined" ? 0 : 1; __flag = typeof __flag == "undefined" ? 0 : 1;
/*side.foe.wait();*/
if(!(side instanceof Battleside)){ if(!(side instanceof Battleside)){
console.trace("side is not a battleside!"); console.trace("side is not a battleside!");
@ -140,7 +147,10 @@ var Battle = (function(){
} }
this.runEvent("EachTurn"); this.runEvent("EachTurn");
//setTimeout(function() {
this.runEvent("Turn" + side.getID()); this.runEvent("Turn" + side.getID());
//}.bind(this), 1000);
console.log("current Turn: ", side.getName()); console.log("current Turn: ", side.getName());
} }

View File

@ -143,6 +143,10 @@ Battleside = (function(){
return this._passing; return this._passing;
} }
r.isWaiting = function() {
return this._isWaiting;
}
r.setUpWeatherFieldWith = function(p2){ r.setUpWeatherFieldWith = function(p2){
this.field[Card.TYPE.WEATHER] = p2.field[Card.TYPE.WEATHER] = Field(this); this.field[Card.TYPE.WEATHER] = p2.field[Card.TYPE.WEATHER] = Field(this);
} }
@ -277,6 +281,8 @@ Battleside = (function(){
r.playCard = function(card){ r.playCard = function(card){
if(card === null || card === -1) return; if(card === null || card === -1) return;
if(this.isWaiting()) return;
if(this.isPassing()) return;
if(!this.placeCard(card)) return; if(!this.placeCard(card)) return;
@ -409,7 +415,7 @@ Battleside = (function(){
if(ability.onBeforePlace){ if(ability.onBeforePlace){
ability.onBeforePlace.apply(this, [card]); ability.onBeforePlace.apply(this, [card]);
} }
if(ability.isCommandersHornCard && !obj.isHorn){ if(ability.isCommandersHornCard && typeof obj.isHorn === "undefined"){
this.setHorn(card); this.setHorn(card);
} }
if(ability.commandersHorn){ if(ability.commandersHorn){
@ -529,8 +535,9 @@ Battleside = (function(){
var cards1 = this.field[Card.TYPE.CLOSE_COMBAT].removeAll(); var cards1 = this.field[Card.TYPE.CLOSE_COMBAT].removeAll();
var cards2 = this.field[Card.TYPE.RANGED].removeAll(); var cards2 = this.field[Card.TYPE.RANGED].removeAll();
var cards3 = this.field[Card.TYPE.SIEGE].removeAll(); var cards3 = this.field[Card.TYPE.SIEGE].removeAll();
var cards4 = this.field[Card.TYPE.WEATHER].removeAll();
var cards = cards1.concat(cards2.concat(cards3)); var cards = cards1.concat(cards2.concat(cards3.concat(cards4)));
this.addToDiscard(cards); this.addToDiscard(cards);
} }