mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
- 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:
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user