mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- Converted Spirit of Resistance to script.
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
Name:Spirit of Resistance
|
||||
ManaCost:2 W
|
||||
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:Rarity:Rare
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/spirit_of_resistance.jpg
|
||||
|
||||
@@ -7997,7 +7997,8 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
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;
|
||||
}
|
||||
} // Creature end
|
||||
|
||||
@@ -22,6 +22,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import forge.Card;
|
||||
import forge.Constant;
|
||||
import forge.GameEntity;
|
||||
import forge.Singletons;
|
||||
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) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,6 @@ import forge.CardLists;
|
||||
import forge.CardPredicates;
|
||||
import forge.CardPredicates.Presets;
|
||||
import forge.CardUtil;
|
||||
import forge.Constant;
|
||||
import forge.Constant.Preferences;
|
||||
import forge.CounterType;
|
||||
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) {
|
||||
return restDamage;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user