simplify "you gained life this turn" condition constructor

This commit is contained in:
Susucre 2024-07-12 17:42:00 +02:00
parent a3842aecf3
commit 233d714e00
14 changed files with 22 additions and 15 deletions

View file

@ -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) {

View file

@ -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) {

View file

@ -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));

View file

@ -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());

View file

@ -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}");

View file

@ -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());
}

View file

@ -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}");

View file

@ -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) {

View file

@ -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."

View file

@ -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");

View file

@ -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}");

View file

@ -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}");

View file

@ -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}");

View file

@ -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);
}