- Converted "Damage that would reduce your life total to less than 1 reduces it to 1 instead." to a player keyword.

- Fixed Angel's Grace.
This commit is contained in:
Sloth
2012-12-01 22:53:26 +00:00
parent c2cab7fb91
commit 8d0e665900
7 changed files with 8 additions and 35 deletions

View File

@@ -548,7 +548,8 @@ public abstract class Player extends GameEntity implements Comparable<Player> {
} else {
// Worship does not reduce the damage dealt but changes the effect
// of the damage
if (PlayerUtil.worshipFlag(this) && (this.life <= damageToDo)) {
if (this.hasKeyword("Damage that would reduce your life total to less than 1 reduces it to 1 instead.")
&& this.life <= damageToDo) {
this.loseLife(Math.min(damageToDo, this.life - 1));
} else {
// rule 118.2. Damage dealt to a player normally causes that

View File

@@ -19,10 +19,7 @@ package forge.game.player;
import java.util.List;
import com.google.common.base.Predicate;
import forge.Card;
import forge.CardLists;
import forge.Singletons;
import forge.card.spellability.SpellAbility;
@@ -47,29 +44,6 @@ public final class PlayerUtil {
throw new AssertionError();
}
/**
* <p>
* worshipFlag.
* </p>
*
* @param player
* a {@link forge.game.player.Player} object.
* @return a boolean.
*/
public static boolean worshipFlag(final Player player) {
// Instead of hardcoded Ali from Cairo like cards, it is now a Keyword
List<Card> list = player.getCardsIn(ZoneType.Battlefield);
list = CardLists.getKeyword(list, "Damage that would reduce your life total to less than 1 reduces it to 1 instead.");
list = CardLists.filter(list, new Predicate<Card>() {
@Override
public boolean apply(final Card c) {
return !c.isFaceDown();
}
});
return list.size() > 0;
}
/**
* <p>
* input_discardNumUnless.