mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
adjust some text, cleanup some variable access
This commit is contained in:
parent
8271686cb4
commit
577a3708fc
9 changed files with 25 additions and 34 deletions
|
|
@ -11,6 +11,7 @@ import mage.cards.SplitCard;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.SpellAbilityType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
|
|
@ -44,11 +45,8 @@ public final class BeckCall extends SplitCard {
|
|||
|
||||
class BeckTriggeredAbility extends DelayedTriggeredAbility {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent();
|
||||
|
||||
public BeckTriggeredAbility() {
|
||||
super(new DrawCardSourceControllerEffect(1), Duration.EndOfTurn, false);
|
||||
optional = true;
|
||||
BeckTriggeredAbility() {
|
||||
super(new DrawCardSourceControllerEffect(1), Duration.EndOfTurn, false, true);
|
||||
}
|
||||
|
||||
private BeckTriggeredAbility(final BeckTriggeredAbility ability) {
|
||||
|
|
@ -64,7 +62,7 @@ class BeckTriggeredAbility extends DelayedTriggeredAbility {
|
|||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
UUID targetId = event.getTargetId();
|
||||
Permanent permanent = game.getPermanent(targetId);
|
||||
return filter.match(permanent, getControllerId(), this, game);
|
||||
return StaticFilters.FILTER_PERMANENT_CREATURE.match(permanent, getControllerId(), this, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -39,9 +39,8 @@ public final class BredForTheHunt extends CardImpl {
|
|||
|
||||
class BredForTheHuntTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
public BredForTheHuntTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1));
|
||||
this.optional = true;
|
||||
BredForTheHuntTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), true);
|
||||
}
|
||||
|
||||
private BredForTheHuntTriggeredAbility(final BredForTheHuntTriggeredAbility ability) {
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ class OwenGradyRaptorTrainerEffect extends OneShotEffect {
|
|||
} else if (i == choices.size()-1){
|
||||
separator = "";
|
||||
}
|
||||
sb.append(choicesArray[i]).append(separator);
|
||||
sb.append(choicesArray[i].toLowerCase()).append(separator);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,9 +53,8 @@ class RiteOfHarmonyTriggeredAbility extends DelayedTriggeredAbility {
|
|||
filter.add(Predicates.or(CardType.CREATURE.getPredicate(), CardType.ENCHANTMENT.getPredicate()));
|
||||
}
|
||||
|
||||
public RiteOfHarmonyTriggeredAbility() {
|
||||
RiteOfHarmonyTriggeredAbility() {
|
||||
super(new DrawCardSourceControllerEffect(1), Duration.EndOfTurn, false);
|
||||
optional = false;
|
||||
}
|
||||
|
||||
private RiteOfHarmonyTriggeredAbility(final RiteOfHarmonyTriggeredAbility ability) {
|
||||
|
|
@ -83,4 +82,4 @@ class RiteOfHarmonyTriggeredAbility extends DelayedTriggeredAbility {
|
|||
public String getRule() {
|
||||
return "Whenever a creature or enchantment enters the battlefield under your control this turn, draw a card.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ public class ShaunFatherOfSynths extends CardImpl {
|
|||
Effect effect = new CreateTokenCopyTargetEffect(
|
||||
null, null,
|
||||
false, 1, true, true)
|
||||
.setPermanentModifier((token) -> {
|
||||
.setPermanentModifier(token -> {
|
||||
token.removeSuperType(SuperType.LEGENDARY);
|
||||
token.addCardType(CardType.CREATURE);
|
||||
token.addCardType(CardType.ARTIFACT);
|
||||
|
|
@ -78,4 +78,4 @@ public class ShaunFatherOfSynths extends CardImpl {
|
|||
return new ShaunFatherOfSynths(this);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,9 +58,8 @@ class VerdantSuccessionTriggeredAbility extends TriggeredAbilityImpl {
|
|||
filter.add(TokenPredicate.FALSE);
|
||||
}
|
||||
|
||||
public VerdantSuccessionTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new VerdantSuccessionEffect());
|
||||
this.optional = true;
|
||||
VerdantSuccessionTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new VerdantSuccessionEffect(), true);
|
||||
}
|
||||
|
||||
private VerdantSuccessionTriggeredAbility(final VerdantSuccessionTriggeredAbility ability) {
|
||||
|
|
|
|||
|
|
@ -10,22 +10,22 @@ import mage.game.Game;
|
|||
*/
|
||||
public abstract class DelayedTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
private Duration duration;
|
||||
private final Duration duration;
|
||||
protected boolean triggerOnlyOnce;
|
||||
|
||||
public DelayedTriggeredAbility(Effect effect) {
|
||||
protected DelayedTriggeredAbility(Effect effect) {
|
||||
this(effect, Duration.EndOfGame);
|
||||
}
|
||||
|
||||
public DelayedTriggeredAbility(Effect effect, Duration duration) {
|
||||
protected DelayedTriggeredAbility(Effect effect, Duration duration) {
|
||||
this(effect, duration, true);
|
||||
}
|
||||
|
||||
public DelayedTriggeredAbility(Effect effect, Duration duration, boolean triggerOnlyOnce) {
|
||||
protected DelayedTriggeredAbility(Effect effect, Duration duration, boolean triggerOnlyOnce) {
|
||||
this(effect, duration, triggerOnlyOnce, false);
|
||||
}
|
||||
|
||||
public DelayedTriggeredAbility(Effect effect, Duration duration, boolean triggerOnlyOnce, boolean optional) {
|
||||
protected DelayedTriggeredAbility(Effect effect, Duration duration, boolean triggerOnlyOnce, boolean optional) {
|
||||
super(Zone.ALL, effect, optional);
|
||||
this.duration = duration;
|
||||
this.triggerOnlyOnce = triggerOnlyOnce;
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ import java.util.UUID;
|
|||
*/
|
||||
public abstract class TriggeredAbilityImpl extends AbilityImpl implements TriggeredAbility {
|
||||
|
||||
protected boolean optional;
|
||||
protected boolean leavesTheBattlefieldTrigger;
|
||||
private boolean optional;
|
||||
private boolean leavesTheBattlefieldTrigger;
|
||||
private boolean triggersOnceEachTurn = false;
|
||||
private boolean doOnlyOnceEachTurn = false;
|
||||
protected boolean replaceRuleText = false; // if true, replace "{this}" with "it" in effect text
|
||||
|
|
@ -243,6 +243,7 @@ public abstract class TriggeredAbilityImpl extends AbilityImpl implements Trigge
|
|||
return ruleLow.startsWith("attach")
|
||||
|| ruleLow.startsWith("change")
|
||||
|| ruleLow.startsWith("counter")
|
||||
|| ruleLow.startsWith("create")
|
||||
|| ruleLow.startsWith("destroy")
|
||||
|| ruleLow.startsWith("distribute")
|
||||
|| ruleLow.startsWith("sacrifice")
|
||||
|
|
@ -367,9 +368,8 @@ public abstract class TriggeredAbilityImpl extends AbilityImpl implements Trigge
|
|||
public TriggeredAbility setOptional() {
|
||||
this.optional = true;
|
||||
|
||||
if (getEffects().stream().filter(
|
||||
effect -> effect instanceof DoIfCostPaid && (this.optional && ((DoIfCostPaid) effect).isOptional()))
|
||||
.findAny().isPresent()) {
|
||||
if (getEffects().stream().anyMatch(
|
||||
effect -> effect instanceof DoIfCostPaid && ((DoIfCostPaid) effect).isOptional())) {
|
||||
throw new IllegalArgumentException(
|
||||
"DoIfCostPaid effect must have only one optional settings, but it have two (trigger + DoIfCostPaid): "
|
||||
+ this.getClass().getSimpleName());
|
||||
|
|
|
|||
|
|
@ -48,12 +48,8 @@ public class AttacksWithCreaturesTriggeredAbility extends TriggeredAbilityImpl {
|
|||
if (minAttackers == 1 && StaticFilters.FILTER_PERMANENT_CREATURES.equals(filter)) {
|
||||
setTriggerPhrase("Whenever you attack, ");
|
||||
} else {
|
||||
StringBuilder sb = new StringBuilder("Whenever you attack with ");
|
||||
sb.append(CardUtil.numberToText(minAttackers));
|
||||
sb.append(" or more ");
|
||||
sb.append(filter.getMessage());
|
||||
sb.append(", ");
|
||||
setTriggerPhrase(sb.toString());
|
||||
setTriggerPhrase("Whenever you attack with " + CardUtil.numberToText(minAttackers)
|
||||
+ " or more " + filter.getMessage() + ", ");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue