- Converted the following card abilities to Keyword for possible use with other cards: Platinum Angel, Abyssal Persecutor, Ali From Cairo (and friends), Lich

- Added Angel's Grace using newly converted keywords and AF_Effect
This commit is contained in:
jendave
2011-08-06 22:20:21 +00:00
parent ead7553187
commit 58dbd7729b
12 changed files with 67 additions and 24 deletions

View File

@@ -905,23 +905,36 @@ public abstract class Player extends MyObservable{
}
public boolean cantLose(){
if ((AllZoneUtil.getPlayerCardsInPlay(this, "Platinum Angel").size() > 0) ||
(AllZoneUtil.getPlayerCardsInPlay(getOpponent(), "Abyssal Persecutor").size() > 0)){
CardList list = AllZoneUtil.getPlayerCardsInPlay(this);
list = list.getKeyword("You can't lose the game.");
if (list.size() > 0)
return true;
}
return false;
CardList oppList = AllZoneUtil.getPlayerCardsInPlay(getOpponent());
oppList = oppList.getKeyword("Your opponents can't win the game.");
return oppList.size() > 0;
}
public boolean cantLoseForZeroOrLessLife() {
return AllZoneUtil.isCardInPlay("Lich", this);
CardList list = AllZoneUtil.getPlayerCardsInPlay(this);
list = list.getKeyword("You don't lose the game for having 0 or less life.");
return list.size() > 0;
}
public boolean cantWin(){
if ((AllZoneUtil.getPlayerCardsInPlay(getOpponent(), "Platinum Angel").size() > 0) ||
(AllZoneUtil.getPlayerCardsInPlay(this, "Abyssal Persecutor").size() > 0)){
CardList list = AllZoneUtil.getPlayerCardsInPlay(getOpponent());
list = list.getKeyword("You can't win the game.");
if (list.size() > 0)
return true;
}
return false;
CardList oppList = AllZoneUtil.getPlayerCardsInPlay(this);
oppList = oppList.getKeyword("Your opponents can't lose the game.");
return oppList.size() > 0;
}
public boolean hasLost(){

View File

@@ -4,14 +4,15 @@ package forge;
public class PlayerUtil {
public static boolean worshipFlag(Player player) {
if( AllZoneUtil.isCardInPlay("Ali from Cairo", player)
|| (AllZoneUtil.isCardInPlay("Worship", player) && AllZoneUtil.getCreaturesInPlay(player).size() > 0)
|| AllZoneUtil.isCardInPlay("Fortune Thief", player)
|| AllZoneUtil.isCardInPlay("Sustaining Spirit", player)) {
return true;
}
else {
return false;
}
// Instead of hardcoded Ali from Cairo like cards, it is now a Keyword
CardList list = AllZoneUtil.getPlayerCardsInPlay(player);
list = list.getKeyword("Damage that would reduce your life total to less than 1 reduces it to 1 instead.");
list = list.filter(new CardListFilter() {
public boolean addCard(Card c) {
return !c.isFaceDown();
}
});
return list.size() > 0;
}
}

View File

@@ -112,6 +112,11 @@ public class AbilityFactory_Effect {
public static String effectStackDescription(AbilityFactory af, SpellAbility sa){
StringBuilder sb = new StringBuilder();
if (sa instanceof Ability_Sub)
sb.append(" ");
else
sb.append(sa.getSourceCard().getName()).append(" - ");
sb.append(sa.getDescription());
Ability_Sub abSub = sa.getSubAbility();
@@ -186,6 +191,7 @@ public class AbilityFactory_Effect {
eff.setController(controller);
eff.setOwner(controller);
eff.setImageName(card.getImageName());
eff.setColor(card.getColor());
// Effects should be Orange or something probably