- Converted Spirit of Resistance to script.

This commit is contained in:
Sloth
2012-11-24 10:47:15 +00:00
parent 406f7c1c85
commit 161350dae1
4 changed files with 17 additions and 14 deletions

View File

@@ -1,7 +1,8 @@
Name:Spirit of Resistance Name:Spirit of Resistance
ManaCost:2 W ManaCost:2 W
Types:Enchantment Types:Enchantment
Text:As long as you control a permanent of each color, prevent all damage that would be dealt to you. Text:no text
S:Mode$ PreventDamage | Target$ You | Condition$ PermanentOfEachColor | Description$ As long as you control a permanent of each color, prevent all damage that would be dealt to you.
SVar:RemRandomDeck:True SVar:RemRandomDeck:True
SVar:Rarity:Rare SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/spirit_of_resistance.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/spirit_of_resistance.jpg

View File

@@ -7997,7 +7997,8 @@ public class Card extends GameEntity implements Comparable<Card> {
return 0; return 0;
} }
if ((source.isCreature() && Singletons.getModel().getGame().isCardInPlay("Well-Laid Plans") && source.sharesColorWith(this))) { if (source.isCreature() && Singletons.getModel().getGame().isCardInPlay("Well-Laid Plans")
&& source.sharesColorWith(this)) {
return 0; return 0;
} }
} // Creature end } // Creature end

View File

@@ -22,6 +22,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import forge.Card; import forge.Card;
import forge.Constant;
import forge.GameEntity; import forge.GameEntity;
import forge.Singletons; import forge.Singletons;
import forge.card.abilityfactory.AbilityFactory; import forge.card.abilityfactory.AbilityFactory;
@@ -494,6 +495,18 @@ public class StaticAbility {
} }
} }
if (params.containsKey("Condition")) {
if (params.get("Condition").equals("PermanentOfEachColor")) {
if ((controller.getColoredCardsInPlay(Constant.Color.BLACK).isEmpty()
|| controller.getColoredCardsInPlay(Constant.Color.BLUE).isEmpty()
|| controller.getColoredCardsInPlay(Constant.Color.GREEN).isEmpty()
|| controller.getColoredCardsInPlay(Constant.Color.RED).isEmpty()
|| controller.getColoredCardsInPlay(Constant.Color.WHITE).isEmpty())) {
return false;
}
}
}
if (this.params.containsKey("FatefulHour") && controller.getLife() > 5) { if (this.params.containsKey("FatefulHour") && controller.getLife() > 5) {
return false; return false;
} }

View File

@@ -39,7 +39,6 @@ import forge.CardLists;
import forge.CardPredicates; import forge.CardPredicates;
import forge.CardPredicates.Presets; import forge.CardPredicates.Presets;
import forge.CardUtil; import forge.CardUtil;
import forge.Constant;
import forge.Constant.Preferences; import forge.Constant.Preferences;
import forge.CounterType; import forge.CounterType;
import forge.GameActionUtil; import forge.GameActionUtil;
@@ -679,17 +678,6 @@ public abstract class Player extends GameEntity implements Comparable<Player> {
} }
} }
// specific cards
if (this.isCardInPlay("Spirit of Resistance")) {
if ((this.getColoredCardsInPlay(Constant.Color.BLACK).size() > 0)
&& (this.getColoredCardsInPlay(Constant.Color.BLUE).size() > 0)
&& (this.getColoredCardsInPlay(Constant.Color.GREEN).size() > 0)
&& (this.getColoredCardsInPlay(Constant.Color.RED).size() > 0)
&& (this.getColoredCardsInPlay(Constant.Color.WHITE).size() > 0)) {
return 0;
}
}
if (restDamage > 0) { if (restDamage > 0) {
return restDamage; return restDamage;
} else { } else {