mirror of
https://github.com/magefree/mage.git
synced 2026-01-10 04:42:07 -08:00
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 {
|
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");
|
private static final Hint hint = new ConditionHint(condition, "You gained life this turn");
|
||||||
|
|
||||||
public BloodsoakedReveler(UUID ownerId, CardSetInfo setInfo) {
|
public BloodsoakedReveler(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ import java.util.UUID;
|
||||||
*/
|
*/
|
||||||
public final class BrackishTrudge extends CardImpl {
|
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");
|
private static final Hint hint = new ConditionHint(condition, "You gained life this turn");
|
||||||
|
|
||||||
public BrackishTrudge(UUID ownerId, CardSetInfo setInfo) {
|
public BrackishTrudge(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package mage.cards.c;
|
package mage.cards.c;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||||
|
|
@ -18,7 +19,6 @@ import mage.target.common.TargetCardInYourGraveyard;
|
||||||
import mage.watchers.common.PlayerGainedLifeWatcher;
|
import mage.watchers.common.PlayerGainedLifeWatcher;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author weirddan455
|
* @author weirddan455
|
||||||
*/
|
*/
|
||||||
public final class CourierBat extends CardImpl {
|
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.
|
// 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(
|
Ability ability = new ConditionalInterveningIfTriggeredAbility(
|
||||||
new EntersBattlefieldTriggeredAbility(new ReturnFromGraveyardToHandTargetEffect()),
|
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."
|
"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));
|
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 BeginningOfEndStepTriggeredAbility(
|
||||||
new CreateTokenEffect(new CrestedSunmareToken()),
|
new CreateTokenEffect(new CrestedSunmareToken()),
|
||||||
TargetController.ANY, false
|
TargetController.ANY, false
|
||||||
), new YouGainedLifeCondition(ComparisonType.MORE_THAN, 0),
|
), new YouGainedLifeCondition(),
|
||||||
"At the beginning of each end step, if you gained life this turn, " +
|
"At the beginning of each end step, if you gained life this turn, " +
|
||||||
"create a 5/5 white Horse creature token."
|
"create a 5/5 white Horse creature token."
|
||||||
).addHint(ControllerGainedLifeCount.getHint()), new PlayerGainedLifeWatcher());
|
).addHint(ControllerGainedLifeCount.getHint()), new PlayerGainedLifeWatcher());
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ import java.util.UUID;
|
||||||
*/
|
*/
|
||||||
public final class LathielTheBounteousDawn extends CardImpl {
|
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) {
|
public LathielTheBounteousDawn(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}{W}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}{W}");
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package mage.cards.m;
|
package mage.cards.m;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
|
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
|
||||||
import mage.abilities.condition.common.YouGainedLifeCondition;
|
import mage.abilities.condition.common.YouGainedLifeCondition;
|
||||||
|
|
@ -14,7 +15,6 @@ import mage.cards.CardSetInfo;
|
||||||
import mage.watchers.common.PlayerGainedLifeWatcher;
|
import mage.watchers.common.PlayerGainedLifeWatcher;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author weirddan455
|
* @author weirddan455
|
||||||
*/
|
*/
|
||||||
public final class MarkovPurifier extends CardImpl {
|
public final class MarkovPurifier extends CardImpl {
|
||||||
|
|
@ -34,7 +34,7 @@ public final class MarkovPurifier extends CardImpl {
|
||||||
this.addAbility(new BeginningOfEndStepTriggeredAbility(
|
this.addAbility(new BeginningOfEndStepTriggeredAbility(
|
||||||
Zone.BATTLEFIELD,
|
Zone.BATTLEFIELD,
|
||||||
new DoIfCostPaid(new DrawCardSourceControllerEffect(1), new GenericManaCost(2)),
|
new DoIfCostPaid(new DrawCardSourceControllerEffect(1), new GenericManaCost(2)),
|
||||||
TargetController.YOU, new YouGainedLifeCondition(ComparisonType.MORE_THAN, 0), false
|
TargetController.YOU, new YouGainedLifeCondition(), false
|
||||||
), new PlayerGainedLifeWatcher());
|
), new PlayerGainedLifeWatcher());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ import java.util.UUID;
|
||||||
*/
|
*/
|
||||||
public final class MortalitySpear extends CardImpl {
|
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) {
|
public MortalitySpear(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{B}{G}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{B}{G}");
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ import java.util.UUID;
|
||||||
*/
|
*/
|
||||||
public final class OcelotPride extends CardImpl {
|
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");
|
private static final Hint hint = new ConditionHint(condition, "You gained life this turn");
|
||||||
|
|
||||||
public OcelotPride(UUID ownerId, CardSetInfo setInfo) {
|
public OcelotPride(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ public final class RegalBloodlord extends CardImpl {
|
||||||
new CreateTokenEffect(new BatToken()),
|
new CreateTokenEffect(new BatToken()),
|
||||||
TargetController.ANY, false
|
TargetController.ANY, false
|
||||||
),
|
),
|
||||||
new YouGainedLifeCondition(ComparisonType.MORE_THAN, 0),
|
new YouGainedLifeCondition(),
|
||||||
"At the beginning of each end step, "
|
"At the beginning of each end step, "
|
||||||
+ "if you gained life this turn, "
|
+ "if you gained life this turn, "
|
||||||
+ "create a 1/1 black Bat creature token with flying."
|
+ "create a 1/1 black Bat creature token with flying."
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ import java.util.UUID;
|
||||||
*/
|
*/
|
||||||
public final class RestlessBloodseeker extends CardImpl {
|
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 Hint hint = new ConditionHint(condition, "You gained life this turn");
|
||||||
private static final FilterControlledPermanent filter
|
private static final FilterControlledPermanent filter
|
||||||
= new FilterControlledPermanent(SubType.BLOOD, "Blood tokens");
|
= new FilterControlledPermanent(SubType.BLOOD, "Blood tokens");
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ import java.util.UUID;
|
||||||
*/
|
*/
|
||||||
public final class SproutbackTrudge extends CardImpl {
|
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) {
|
public SproutbackTrudge(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{7}{G}{G}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{7}{G}{G}");
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ import java.util.UUID;
|
||||||
*/
|
*/
|
||||||
public final class TivashGloomSummoner extends CardImpl {
|
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) {
|
public TivashGloomSummoner(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}");
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ import java.util.UUID;
|
||||||
*/
|
*/
|
||||||
public final class WitchOfTheMoors extends CardImpl {
|
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) {
|
public WitchOfTheMoors(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}");
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,13 @@ import mage.watchers.common.PlayerGainedLifeWatcher;
|
||||||
*/
|
*/
|
||||||
public class YouGainedLifeCondition extends IntCompareCondition {
|
public class YouGainedLifeCondition extends IntCompareCondition {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* "if you gained life this turn"
|
||||||
|
*/
|
||||||
|
public YouGainedLifeCondition() {
|
||||||
|
super(ComparisonType.MORE_THAN, 0);
|
||||||
|
}
|
||||||
|
|
||||||
public YouGainedLifeCondition(ComparisonType type, int value) {
|
public YouGainedLifeCondition(ComparisonType type, int value) {
|
||||||
super(type, value);
|
super(type, value);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue