mirror of
https://github.com/magefree/mage.git
synced 2026-01-23 03:39:54 -08:00
I can stop refactoring ConditionalInterveningIfTriggeredAbility whenever I want
This commit is contained in:
parent
15d4ca2edc
commit
9fb082d656
61 changed files with 590 additions and 770 deletions
|
|
@ -7,6 +7,7 @@ import mage.constants.ComparisonType;
|
|||
import mage.constants.SubType;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
|
@ -50,6 +51,6 @@ public class EnchantedSourceCondition implements Condition {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "{this} is enchanted";
|
||||
return "{this} is enchanted" + (numberOfEnchantments > 1 ? " by " + CardUtil.numberToText(numberOfEnchantments) + " or more Auras" : "");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
package mage.abilities.condition.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
|
|
@ -10,25 +8,23 @@ import mage.players.Player;
|
|||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author fireshoes
|
||||
*/
|
||||
|
||||
public enum OpponentHasMoreLifeCondition implements Condition {
|
||||
|
||||
instance;
|
||||
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
for (UUID uuid : game.getOpponents(controller.getId())) {
|
||||
Player opponent = game.getPlayer(uuid);
|
||||
if (opponent != null) {
|
||||
if (opponent.getLife() > controller.getLife()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
for (UUID uuid : game.getOpponents(controller.getId())) {
|
||||
Player opponent = game.getPlayer(uuid);
|
||||
if (opponent != null && opponent.getLife() > controller.getLife()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
package mage.filter.common;
|
||||
|
||||
import mage.constants.CardType;
|
||||
|
|
@ -16,7 +14,11 @@ public class FilterPlaneswalkerPermanent extends FilterPermanent {
|
|||
}
|
||||
|
||||
public FilterPlaneswalkerPermanent(SubType subType) {
|
||||
this(subType.getDescription() + " planeswalker");
|
||||
this(subType, subType.getDescription() + " planeswalker");
|
||||
}
|
||||
|
||||
public FilterPlaneswalkerPermanent(SubType subType, String name) {
|
||||
this(name);
|
||||
this.add(subType.getPredicate());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue