forked from External/mage
simplify "you gained life this turn" condition constructor
This commit is contained in:
parent
a3842aecf3
commit
233d714e00
14 changed files with 22 additions and 15 deletions
|
|
@ -24,7 +24,7 @@ import java.util.UUID;
|
|||
*/
|
||||
public final class BloodsoakedReveler extends CardImpl {
|
||||
|
||||
private static final Condition condition = new YouGainedLifeCondition(ComparisonType.MORE_THAN, 0);
|
||||
private static final Condition condition = new YouGainedLifeCondition();
|
||||
private static final Hint hint = new ConditionHint(condition, "You gained life this turn");
|
||||
|
||||
public BloodsoakedReveler(UUID ownerId, CardSetInfo setInfo) {
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import java.util.UUID;
|
|||
*/
|
||||
public final class BrackishTrudge extends CardImpl {
|
||||
|
||||
private static final Condition condition = new YouGainedLifeCondition(ComparisonType.MORE_THAN, 0);
|
||||
private static final Condition condition = new YouGainedLifeCondition();
|
||||
private static final Hint hint = new ConditionHint(condition, "You gained life this turn");
|
||||
|
||||
public BrackishTrudge(UUID ownerId, CardSetInfo setInfo) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package mage.cards.c;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
|
|
@ -18,7 +19,6 @@ import mage.target.common.TargetCardInYourGraveyard;
|
|||
import mage.watchers.common.PlayerGainedLifeWatcher;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author weirddan455
|
||||
*/
|
||||
public final class CourierBat extends CardImpl {
|
||||
|
|
@ -36,7 +36,7 @@ public final class CourierBat extends CardImpl {
|
|||
// When Courier Bat enters the battlefield, if you gained life this turn, return up to one target creature card from your graveyard to your hand.
|
||||
Ability ability = new ConditionalInterveningIfTriggeredAbility(
|
||||
new EntersBattlefieldTriggeredAbility(new ReturnFromGraveyardToHandTargetEffect()),
|
||||
new YouGainedLifeCondition(ComparisonType.MORE_THAN, 0),
|
||||
new YouGainedLifeCondition(),
|
||||
"When {this} enters the battlefield, if you gained life this turn, return up to one target creature card from your graveyard to your hand."
|
||||
);
|
||||
ability.addTarget(new TargetCardInYourGraveyard(0, 1, StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD));
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ public final class CrestedSunmare extends CardImpl {
|
|||
new BeginningOfEndStepTriggeredAbility(
|
||||
new CreateTokenEffect(new CrestedSunmareToken()),
|
||||
TargetController.ANY, false
|
||||
), new YouGainedLifeCondition(ComparisonType.MORE_THAN, 0),
|
||||
), new YouGainedLifeCondition(),
|
||||
"At the beginning of each end step, if you gained life this turn, " +
|
||||
"create a 5/5 white Horse creature token."
|
||||
).addHint(ControllerGainedLifeCount.getHint()), new PlayerGainedLifeWatcher());
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import java.util.UUID;
|
|||
*/
|
||||
public final class LathielTheBounteousDawn extends CardImpl {
|
||||
|
||||
private static final Condition condition = new YouGainedLifeCondition(ComparisonType.MORE_THAN, 0);
|
||||
private static final Condition condition = new YouGainedLifeCondition();
|
||||
|
||||
public LathielTheBounteousDawn(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}{W}");
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package mage.cards.m;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.abilities.condition.common.YouGainedLifeCondition;
|
||||
|
|
@ -14,7 +15,6 @@ import mage.cards.CardSetInfo;
|
|||
import mage.watchers.common.PlayerGainedLifeWatcher;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author weirddan455
|
||||
*/
|
||||
public final class MarkovPurifier extends CardImpl {
|
||||
|
|
@ -34,7 +34,7 @@ public final class MarkovPurifier extends CardImpl {
|
|||
this.addAbility(new BeginningOfEndStepTriggeredAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
new DoIfCostPaid(new DrawCardSourceControllerEffect(1), new GenericManaCost(2)),
|
||||
TargetController.YOU, new YouGainedLifeCondition(ComparisonType.MORE_THAN, 0), false
|
||||
TargetController.YOU, new YouGainedLifeCondition(), false
|
||||
), new PlayerGainedLifeWatcher());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import java.util.UUID;
|
|||
*/
|
||||
public final class MortalitySpear extends CardImpl {
|
||||
|
||||
private static final Condition condition = new YouGainedLifeCondition(ComparisonType.MORE_THAN, 0);
|
||||
private static final Condition condition = new YouGainedLifeCondition();
|
||||
|
||||
public MortalitySpear(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{B}{G}");
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ import java.util.UUID;
|
|||
*/
|
||||
public final class OcelotPride extends CardImpl {
|
||||
|
||||
private static final Condition condition = new YouGainedLifeCondition(ComparisonType.MORE_THAN, 0);
|
||||
private static final Condition condition = new YouGainedLifeCondition();
|
||||
private static final Hint hint = new ConditionHint(condition, "You gained life this turn");
|
||||
|
||||
public OcelotPride(UUID ownerId, CardSetInfo setInfo) {
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ public final class RegalBloodlord extends CardImpl {
|
|||
new CreateTokenEffect(new BatToken()),
|
||||
TargetController.ANY, false
|
||||
),
|
||||
new YouGainedLifeCondition(ComparisonType.MORE_THAN, 0),
|
||||
new YouGainedLifeCondition(),
|
||||
"At the beginning of each end step, "
|
||||
+ "if you gained life this turn, "
|
||||
+ "create a 1/1 black Bat creature token with flying."
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import java.util.UUID;
|
|||
*/
|
||||
public final class RestlessBloodseeker extends CardImpl {
|
||||
|
||||
private static final Condition condition = new YouGainedLifeCondition(ComparisonType.MORE_THAN, 0);
|
||||
private static final Condition condition = new YouGainedLifeCondition();
|
||||
private static final Hint hint = new ConditionHint(condition, "You gained life this turn");
|
||||
private static final FilterControlledPermanent filter
|
||||
= new FilterControlledPermanent(SubType.BLOOD, "Blood tokens");
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import java.util.UUID;
|
|||
*/
|
||||
public final class SproutbackTrudge extends CardImpl {
|
||||
|
||||
private static final Condition condition = new YouGainedLifeCondition(ComparisonType.MORE_THAN, 0);
|
||||
private static final Condition condition = new YouGainedLifeCondition();
|
||||
|
||||
public SproutbackTrudge(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{7}{G}{G}");
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import java.util.UUID;
|
|||
*/
|
||||
public final class TivashGloomSummoner extends CardImpl {
|
||||
|
||||
private static final Condition condition = new YouGainedLifeCondition(ComparisonType.MORE_THAN, 0);
|
||||
private static final Condition condition = new YouGainedLifeCondition();
|
||||
|
||||
public TivashGloomSummoner(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}");
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import java.util.UUID;
|
|||
*/
|
||||
public final class WitchOfTheMoors extends CardImpl {
|
||||
|
||||
private static final Condition condition = new YouGainedLifeCondition(ComparisonType.MORE_THAN, 0);
|
||||
private static final Condition condition = new YouGainedLifeCondition();
|
||||
|
||||
public WitchOfTheMoors(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}");
|
||||
|
|
|
|||
|
|
@ -13,6 +13,13 @@ import mage.watchers.common.PlayerGainedLifeWatcher;
|
|||
*/
|
||||
public class YouGainedLifeCondition extends IntCompareCondition {
|
||||
|
||||
/**
|
||||
* "if you gained life this turn"
|
||||
*/
|
||||
public YouGainedLifeCondition() {
|
||||
super(ComparisonType.MORE_THAN, 0);
|
||||
}
|
||||
|
||||
public YouGainedLifeCondition(ComparisonType type, int value) {
|
||||
super(type, value);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue