Code cleanup: protect all copy constructors (#10750)

* apply regex to change public copy constructors to protected
* cleanup code using now protected constructors
* fix manaBuilder weird casting of Mana into ConditionalMana
This commit is contained in:
Susucre 2023-08-05 01:34:58 +02:00 committed by GitHub
parent b04b13d530
commit f75b1c9f0a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1565 changed files with 2412 additions and 2731 deletions

View file

@ -177,7 +177,7 @@ public class CardView extends SimpleCardView {
this.defense = cardView.defense;
this.startingDefense = cardView.startingDefense;
this.cardTypes = new ArrayList<>(cardView.cardTypes);
this.subTypes = new SubTypes(cardView.subTypes);
this.subTypes = cardView.subTypes.copy();
this.superTypes = cardView.superTypes;
this.expansionSetCode = cardView.expansionSetCode;
@ -484,7 +484,7 @@ public class CardView extends SimpleCardView {
this.power = Integer.toString(card.getPower().getValue());
this.toughness = Integer.toString(card.getToughness().getValue());
this.cardTypes = new ArrayList<>(card.getCardType(game));
this.subTypes = new SubTypes(card.getSubtype(game));
this.subTypes = card.getSubtype(game).copy();
this.superTypes = card.getSuperType(game);
this.color = card.getColor(game).copy();
this.flipCard = card.isFlipCard();
@ -631,7 +631,7 @@ public class CardView extends SimpleCardView {
this.defense = "";
}
this.cardTypes = new ArrayList<>(object.getCardType(game));
this.subTypes = new SubTypes(object.getSubtype(game));
this.subTypes = object.getSubtype(game).copy();
this.superTypes = new ArrayList<>(object.getSuperType(game));
this.color = object.getColor(game).copy();
this.manaCostLeftStr = String.join("", object.getManaCostSymbols());
@ -848,7 +848,7 @@ public class CardView extends SimpleCardView {
this.defense = "";
this.startingDefense = "";
this.cardTypes = new ArrayList<>(token.getCardType(game));
this.subTypes = new SubTypes(token.getSubtype(game));
this.subTypes = token.getSubtype(game).copy();
this.superTypes = new ArrayList<>(token.getSuperType(game));
this.color = token.getColor(game).copy();
this.frameColor = token.getFrameColor(game).copy();

View file

@ -1,7 +1,6 @@
package mage.cards.a;
import java.util.UUID;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.AttachEffect;
@ -15,12 +14,13 @@ import mage.filter.predicate.mageobject.AnotherPredicate;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author fireshoes
*/
public final class AncestralMask extends CardImpl {
private static final FilterEnchantmentPermanent filter = new FilterEnchantmentPermanent("each other enchantment on the battlefield");
static {
@ -28,7 +28,7 @@ public final class AncestralMask extends CardImpl {
}
public AncestralMask(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{G}");
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}");
this.subtype.add(SubType.AURA);
// Enchant creature
@ -36,9 +36,9 @@ public final class AncestralMask extends CardImpl {
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
this.addAbility(new EnchantAbility(auraTarget));
// Enchanted creature gets +2/+2 for each other enchantment on the battlefield.
PermanentsOnBattlefieldCount countEnchantments = new PermanentsOnBattlefieldCount(new FilterEnchantmentPermanent(filter), 2);
PermanentsOnBattlefieldCount countEnchantments = new PermanentsOnBattlefieldCount(filter, 2);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(countEnchantments, countEnchantments, Duration.WhileOnBattlefield)));
}

View file

@ -1,7 +1,6 @@
package mage.cards.c;
import java.util.UUID;
import mage.abilities.Mode;
import mage.abilities.effects.common.DestroyAllEffect;
import mage.cards.CardImpl;
@ -11,8 +10,9 @@ import mage.constants.SubType;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class CruxOfFate extends CardImpl {
@ -24,13 +24,13 @@ public final class CruxOfFate extends CardImpl {
}
public CruxOfFate(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{B}{B}");
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{B}{B}");
// Choose one -
// * Destroy all Dragon creatures.
this.getSpellAbility().addEffect(new DestroyAllEffect(new FilterCreaturePermanent(SubType.DRAGON, "Dragon creatures")));
// * Destroy all non-Dragon creatures.
Mode mode = new Mode(new DestroyAllEffect(new FilterCreaturePermanent(filterNonDragon)));
Mode mode = new Mode(new DestroyAllEffect(filterNonDragon));
this.getSpellAbility().addMode(mode);
}

View file

@ -23,7 +23,6 @@ import mage.target.common.TargetCardInYourGraveyard;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class EmeriaShepherd extends CardImpl {
@ -35,7 +34,7 @@ public final class EmeriaShepherd extends CardImpl {
}
public EmeriaShepherd(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{W}{W}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{W}{W}");
this.subtype.add(SubType.ANGEL);
this.power = new MageInt(4);
this.toughness = new MageInt(4);
@ -45,7 +44,7 @@ public final class EmeriaShepherd extends CardImpl {
// <i>Landfall</i> &mdash; Whenever a land enters the battlefield under your control, you may return target nonland permanent card from your graveyard to your hand.
// If that land is a Plains, you may return that nonland permanent card to the battlefield instead.
Ability ability = new LandfallAbility(Zone.BATTLEFIELD, new EmeriaShepherdReturnToHandTargetEffect(), true);
ability.addTarget(new TargetCardInYourGraveyard(new FilterPermanentCard(filter)));
ability.addTarget(new TargetCardInYourGraveyard(filter));
this.addAbility(ability);
}

View file

@ -1,7 +1,6 @@
package mage.cards.f;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.TriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
@ -15,17 +14,18 @@ import mage.abilities.keyword.TributeAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.SubType;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class FanaticOfXenagos extends CardImpl {
public FanaticOfXenagos(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{R}{G}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}{G}");
this.subtype.add(SubType.CENTAUR);
this.subtype.add(SubType.WARRIOR);
@ -37,8 +37,8 @@ public final class FanaticOfXenagos extends CardImpl {
// Tribute 1
this.addAbility(new TributeAbility(1));
// When Fanatic of Xenagos enters the battlefield, if its tribute wasn't paid, it gets +1/+1 and gains haste until end of turn.
TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new BoostSourceEffect(1,1, Duration.EndOfTurn));
ability.addEffect( new GainAbilitySourceEffect(new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.EndOfTurn)));
TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new BoostSourceEffect(1, 1, Duration.EndOfTurn));
ability.addEffect(new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.EndOfTurn));
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, TributeNotPaidCondition.instance,
"When {this} enters the battlefield, if its tribute wasn't paid, it gets +1/+1 and gains haste until end of turn."));
}

View file

@ -1,7 +1,6 @@
package mage.cards.f;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
@ -10,16 +9,17 @@ import mage.abilities.effects.common.PreventDamageToTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.permanent.TappedPredicate;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author LoneFox
*/
public final class FieldSurgeon extends CardImpl {
@ -31,7 +31,7 @@ public final class FieldSurgeon extends CardImpl {
}
public FieldSurgeon(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{W}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.CLERIC);
this.power = new MageInt(1);
@ -39,7 +39,7 @@ public final class FieldSurgeon extends CardImpl {
// Tap an untapped creature you control: Prevent the next 1 damage that would be dealt to target creature this turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageToTargetEffect(Duration.EndOfTurn, 1),
new TapTargetCost(new TapTargetCost(new TargetControlledCreaturePermanent(filter))));
new TapTargetCost(new TargetControlledCreaturePermanent(filter)));
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
}

View file

@ -1,7 +1,6 @@
package mage.cards.g;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
@ -16,8 +15,9 @@ import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetCardInYourGraveyard;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class GrimCaptainsCall extends CardImpl {
@ -71,7 +71,7 @@ class GrimCaptainsCallEffect extends OneShotEffect {
private void returnToHand(Game game, SubType subType, Player controller, Ability source) {
FilterCreatureCard filter = new FilterCreatureCard(subType.getDescription() + " card");
filter.add(subType.getPredicate());
TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(new FilterCreatureCard(filter));
TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(filter);
if (target.canChoose(source.getControllerId(), source, game)) {
if (controller.chooseTarget(outcome, target, source, game)) {
Card card = game.getCard(target.getFirstTarget());

View file

@ -1,7 +1,6 @@
package mage.cards.h;
import java.util.UUID;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
@ -10,15 +9,12 @@ import mage.abilities.effects.common.continuous.BoostEquippedEffect;
import mage.abilities.keyword.EquipAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.constants.*;
import mage.filter.common.FilterEnchantmentPermanent;
import java.util.UUID;
/**
*
* @author fireshoes
*/
public final class HelmOfTheGods extends CardImpl {
@ -30,11 +26,11 @@ public final class HelmOfTheGods extends CardImpl {
}
public HelmOfTheGods(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{1}");
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}");
this.subtype.add(SubType.EQUIPMENT);
// Equipped creature gets +1/+1 for each enchantment you control.
PermanentsOnBattlefieldCount countEnchantments = new PermanentsOnBattlefieldCount(new FilterEnchantmentPermanent(filter));
PermanentsOnBattlefieldCount countEnchantments = new PermanentsOnBattlefieldCount(filter);
Effect effect = new BoostEquippedEffect(countEnchantments, countEnchantments);
effect.setText("Equipped creature gets +1/+1 for each enchantment you control");
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));

View file

@ -1,7 +1,6 @@
package mage.cards.h;
import java.util.UUID;
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageAllEffect;
@ -13,8 +12,9 @@ import mage.counters.CounterType;
import mage.filter.common.FilterCreaturePermanent;
import mage.target.common.TargetOpponentsCreaturePermanent;
import java.util.UUID;
/**
*
* @author Styxo
*/
public final class HuntToExtinction extends CardImpl {
@ -26,7 +26,7 @@ public final class HuntToExtinction extends CardImpl {
}
public HuntToExtinction(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{B}{R}{G}");
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{B}{R}{G}");
// Put a bounty counter on up to one target creature an opponent controls.
this.getSpellAbility().addEffect(new AddCountersTargetEffect(CounterType.BOUNTY.createInstance()));
@ -36,7 +36,7 @@ public final class HuntToExtinction extends CardImpl {
this.getSpellAbility().addEffect(new DamageAllEffect(ManacostVariableValue.REGULAR, new FilterCreaturePermanent()));
// Hunt to Exctinction deals an additional X damage to each creature with a bounty counter on it.
Effect effect = new DamageAllEffect(ManacostVariableValue.REGULAR, new FilterCreaturePermanent(filter));
Effect effect = new DamageAllEffect(ManacostVariableValue.REGULAR, filter);
effect.setText("Hunt to Exctinction deals an additional X damage to each creature with a bounty counter on it");
this.getSpellAbility().addEffect(effect);

View file

@ -91,7 +91,7 @@ public final class KyrenToy extends CardImpl {
numberOfMana = ((RemoveVariableCountersSourceCost) cost).getAmount();
}
}
return new Mana(Mana.ColorlessMana(numberOfMana + 1));
return Mana.ColorlessMana(numberOfMana + 1);
}
@Override

View file

@ -1,7 +1,6 @@
package mage.cards.l;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldAllTriggeredAbility;
@ -15,19 +14,15 @@ import mage.abilities.keyword.LifelinkAbility;
import mage.abilities.keyword.VigilanceAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.SuperType;
import mage.constants.Zone;
import mage.constants.*;
import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
*
* @author Styxo
*/
public final class LukeSkywalker extends CardImpl {
@ -48,7 +43,7 @@ public final class LukeSkywalker extends CardImpl {
// Whenever another creature enters the battlefield under your conrol, put a +1/+1 counter on Luke Skywalker.
this.addAbility(new EntersBattlefieldAllTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()),
new FilterControlledCreaturePermanent(StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE)));
StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE));
// Remove all +1/+1 counters from Luke Skywalker: Luke gains hexproof until end of turn. Activate this ability only if at least one +1/+1 counter is removed this way.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(HexproofAbility.getInstance(), Duration.EndOfTurn), new LukeSkywalkerCost()));

View file

@ -1,8 +1,6 @@
package mage.cards.o;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
@ -17,18 +15,18 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author LevelX
*/
public final class OniPossession extends CardImpl {
public OniPossession(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{B}");
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}");
this.subtype.add(SubType.AURA);
// Enchant creature
@ -40,7 +38,7 @@ public final class OniPossession extends CardImpl {
// At the beginning of your upkeep, sacrifice a creature.
Ability ability2 = new BeginningOfUpkeepTriggeredAbility(
new SacrificeControllerEffect(new FilterControlledCreaturePermanent(StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT), 1, ""), TargetController.YOU, false);
new SacrificeControllerEffect(StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT, 1, ""), TargetController.YOU, false);
this.addAbility(ability2);
// Enchanted creature gets +3/+3 and has trample.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(3, 3, Duration.WhileOnBattlefield)));

View file

@ -1,7 +1,6 @@
package mage.cards.o;
import java.util.UUID;
import mage.abilities.effects.common.DestroyAllEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -10,8 +9,9 @@ import mage.constants.SubType;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import java.util.UUID;
/**
*
* @author Styxo
*/
public final class OrbitalBombardment extends CardImpl {
@ -23,10 +23,10 @@ public final class OrbitalBombardment extends CardImpl {
}
public OrbitalBombardment(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{W}{W}");
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{W}{W}");
// Destroy all non-Starship creatuers.
getSpellAbility().getEffects().add(new DestroyAllEffect(new FilterCreaturePermanent(filter)));
getSpellAbility().getEffects().add(new DestroyAllEffect(filter));
}
private OrbitalBombardment(final OrbitalBombardment card) {

View file

@ -1,7 +1,6 @@
package mage.cards.p;
import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
@ -15,19 +14,16 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.constants.*;
import mage.filter.FilterCard;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetCardInHand;
import mage.target.common.TargetCardInLibrary;
import java.util.UUID;
/**
*
* @author spjspj
*/
public final class PriestOfTheWakeningSun extends CardImpl {
@ -52,7 +48,7 @@ public final class PriestOfTheWakeningSun extends CardImpl {
// {3}{W}{W}, Sacrifice Priest of the Wakening Sun: Search your library for a Dinosaur card, reveal it, put it into your hand, then shuffle your library.
TargetCardInLibrary target = new TargetCardInLibrary(filter);
Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryPutInHandEffect(new TargetCardInLibrary(target), true), new ManaCostsImpl<>("{3}{W}{W}"));
Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryPutInHandEffect(target, true), new ManaCostsImpl<>("{3}{W}{W}"));
ability2.addCost(new SacrificeSourceCost());
this.addAbility(ability2);
}

View file

@ -1,7 +1,6 @@
package mage.cards.s;
import java.util.UUID;
import mage.MageInt;
import mage.Mana;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
@ -14,8 +13,9 @@ import mage.constants.SubType;
import mage.constants.TargetController;
import mage.constants.Zone;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class SakuraTribeSpringcaller extends CardImpl {
@ -29,7 +29,7 @@ public final class SakuraTribeSpringcaller extends CardImpl {
this.toughness = new MageInt(4);
// At the beginning of your upkeep, add {G}. Until end of turn, you don't lose this mana as steps and phases end.
Effect effect = new AddManaToManaPoolTargetControllerEffect(new Mana(Mana.GreenMana(1)), "your", true);
Effect effect = new AddManaToManaPoolTargetControllerEffect(Mana.GreenMana(1), "your", true);
effect.setText("add {G}. Until end of turn, you don't lose this mana as steps and phases end");
this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, TargetController.YOU, false));
}

View file

@ -70,9 +70,9 @@ public final class SkullbriarTheWalkingGrave extends CardImpl {
Counters copyFrom = null;
if (skullBriarEffectApplied) {
if (event.getTarget() != null && event.getFromZone() == Zone.BATTLEFIELD) {
copyFrom = new Counters(event.getTarget().getCounters(game));
copyFrom = event.getTarget().getCounters(game).copy();
} else {
copyFrom = new Counters(this.getCounters(game));
copyFrom = this.getCounters(game).copy();
}
}
super.updateZoneChangeCounter(game, event);

View file

@ -2,7 +2,6 @@
package mage.cards.s;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.SimpleActivatedAbility;
@ -18,15 +17,16 @@ import mage.constants.Zone;
import mage.counters.CounterType;
import mage.target.common.TargetArtifactPermanent;
import java.util.UUID;
/**
*
* @author Loki
*/
public final class SurgeNode extends CardImpl {
public SurgeNode (UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{1}");
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(new AddCountersSourceEffect(CounterType.CHARGE.createInstance(6))), "{this} gets six charge counters"));
public SurgeNode(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}");
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.CHARGE.createInstance(6)), "{this} gets six charge counters"));
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.CHARGE.createInstance()), new GenericManaCost(1));
ability.addCost(new TapSourceCost());
ability.addCost(new RemoveCountersSourceCost(CounterType.CHARGE.createInstance()));
@ -34,7 +34,7 @@ public final class SurgeNode extends CardImpl {
this.addAbility(ability);
}
public SurgeNode (final SurgeNode card) {
public SurgeNode(final SurgeNode card) {
super(card);
}

View file

@ -1,7 +1,6 @@
package mage.cards.t;
import java.util.UUID;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageEverythingEffect;
@ -15,12 +14,13 @@ import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.AbilityPredicate;
import java.util.UUID;
/**
*
* @author fireshoes
*/
public final class ThunderOfHooves extends CardImpl {
private static final FilterCreaturePermanent filterNotFlying = new FilterCreaturePermanent();
private static final FilterPermanent filterBeasts = new FilterPermanent();
@ -30,10 +30,10 @@ public final class ThunderOfHooves extends CardImpl {
}
public ThunderOfHooves(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{R}");
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{R}");
// Thunder of Hooves deals X damage to each creature without flying and each player, where X is the number of Beasts on the battlefield.
Effect effect = new DamageEverythingEffect(new PermanentsOnBattlefieldCount(new FilterPermanent(filterBeasts)), new FilterCreaturePermanent(filterNotFlying));
Effect effect = new DamageEverythingEffect(new PermanentsOnBattlefieldCount(filterBeasts), filterNotFlying);
effect.setText("{this} deals X damage to each creature without flying and each player, where X is the number of Beasts on the battlefield");
this.getSpellAbility().addEffect(effect);
}

View file

@ -1,7 +1,6 @@
package mage.cards.t;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.AttacksOrBlocksTriggeredAbility;
@ -16,18 +15,15 @@ import mage.abilities.effects.common.LoseLifeSourceControllerEffect;
import mage.abilities.effects.common.SacrificeSourceEffect;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.constants.SubType;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.AbilityWord;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.constants.*;
import mage.target.common.TargetCardInYourGraveyard;
import java.util.UUID;
/**
*
* @author TheElk801
*/
public final class TreacherousVampire extends CardImpl {
@ -46,7 +42,7 @@ public final class TreacherousVampire extends CardImpl {
this.addAbility(new AttacksOrBlocksTriggeredAbility(
new DoUnlessControllerPaysEffect(
new SacrificeSourceEffect(),
new ExileFromGraveCost(new ExileFromGraveCost(new TargetCardInYourGraveyard()))
new ExileFromGraveCost(new TargetCardInYourGraveyard())
), false
));

View file

@ -1,8 +1,5 @@
package mage.cards.t;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
@ -13,14 +10,7 @@ import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.TargetController;
import mage.constants.WatcherScope;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.constants.*;
import mage.filter.FilterSpell;
import mage.filter.common.FilterEnchantmentPermanent;
import mage.game.Game;
@ -28,8 +18,11 @@ import mage.game.events.GameEvent;
import mage.game.stack.Spell;
import mage.watchers.Watcher;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
/**
*
* @author TheElk801
*/
public final class TuvasaTheSunlit extends CardImpl {
@ -48,7 +41,7 @@ public final class TuvasaTheSunlit extends CardImpl {
= new FilterEnchantmentPermanent("enchantment you control");
filter.add(TargetController.YOU.getControllerPredicate());
DynamicValue value
= new PermanentsOnBattlefieldCount(new FilterPermanent(filter));
= new PermanentsOnBattlefieldCount(filter);
Ability ability = new SimpleStaticAbility(
Zone.BATTLEFIELD,
new BoostSourceEffect(
@ -117,7 +110,7 @@ class TuvasaTheSunlitWatcher extends Watcher {
private final Map<UUID, UUID> firstEnchantmentThisTurn = new HashMap<>();
public TuvasaTheSunlitWatcher() {
super( WatcherScope.GAME);
super(WatcherScope.GAME);
}
@Override

View file

@ -1,7 +1,6 @@
package mage.cards.w;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BlocksSourceTriggeredAbility;
@ -18,19 +17,20 @@ import mage.abilities.keyword.DefenderAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.counters.CounterType;
import java.util.UUID;
/**
*
* @author LoneFox
*/
public final class WoollyRazorback extends CardImpl {
public WoollyRazorback(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}{W}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}{W}");
this.subtype.add(SubType.BOAR);
this.subtype.add(SubType.BEAST);
this.power = new MageInt(7);
@ -38,14 +38,14 @@ public final class WoollyRazorback extends CardImpl {
// Woolly Razorback enters the battlefield with three ice counters on it.
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.ICE.createInstance(3)),
"with three ice counters on it"));
"with three ice counters on it"));
// As long as Woolly Razorback has an ice counter on it, prevent all combat damage it would deal and it has defender.
ConditionalReplacementEffect effect = new ConditionalReplacementEffect(new PreventCombatDamageBySourceEffect(Duration.WhileOnBattlefield),
new SourceHasCounterCondition(CounterType.ICE));
new SourceHasCounterCondition(CounterType.ICE));
effect.setText("as long as {this} has an ice counter on it, prevent all combat damage it would deal");
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalReplacementEffect(effect));
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect);
ability.addEffect(new ConditionalContinuousEffect(new GainAbilitySourceEffect(DefenderAbility.getInstance()),
new SourceHasCounterCondition(CounterType.ICE), "and it has defender"));
new SourceHasCounterCondition(CounterType.ICE), "and it has defender"));
this.addAbility(ability);
// Whenever Woolly Razorback blocks, remove an ice counter from it.
this.addAbility(new BlocksSourceTriggeredAbility(new RemoveCounterSourceEffect(CounterType.ICE.createInstance()).setText("remove an ice counter from it"), false));

View file

@ -53,7 +53,7 @@ public class ConditionalMana extends Mana implements Serializable, Emptiable {
super(mana);
}
public ConditionalMana(final ConditionalMana conditionalMana) {
protected ConditionalMana(final ConditionalMana conditionalMana) {
super(conditionalMana);
conditions.addAll(conditionalMana.conditions);
scope = conditionalMana.scope;

View file

@ -67,7 +67,7 @@ public abstract class MageObjectImpl implements MageObject {
abilities = new AbilitiesImpl<>();
}
public MageObjectImpl(final MageObjectImpl object) {
protected MageObjectImpl(final MageObjectImpl object) {
objectId = object.objectId;
name = object.name;
manaCost = object.manaCost.copy();

View file

@ -77,7 +77,7 @@ public class Mana implements Comparable<Mana>, Serializable, Copyable<Mana> {
*
* @param mana object to create copy from.
*/
public Mana(final Mana mana) {
protected Mana(final Mana mana) {
Objects.requireNonNull(mana, "The passed in mana can not be null");
this.white = mana.white;
this.blue = mana.blue;
@ -166,8 +166,8 @@ public class Mana implements Comparable<Mana>, Serializable, Copyable<Mana> {
/**
* Creates a {@link Mana} object of #num mana of the passed {@link ManaType}.
*
* @param manaType The type of mana to set.
* @param num The number of mana available of the passed ManaType.
* @param manaType The type of mana to set.
* @param num The number of mana available of the passed ManaType.
**/
public Mana(final ManaType manaType, int num) {
this();
@ -338,6 +338,7 @@ public class Mana implements Comparable<Mana>, Serializable, Copyable<Mana> {
/**
* Helper function for increase and decrease to not have the code duplicated.
*
* @param manaType
* @param increase
*/
@ -420,6 +421,7 @@ public class Mana implements Comparable<Mana>, Serializable, Copyable<Mana> {
public void increaseAny() {
any = CardUtil.overflowInc(any, 1);
}
public void decreaseAny() {
any = CardUtil.overflowDec(any, 1);
}
@ -697,7 +699,7 @@ public class Mana implements Comparable<Mana>, Serializable, Copyable<Mana> {
* Returns if the cost (this) can be paid by the mana provided by the passed in {@link Mana} object.
*
* @param avail The mana to compare too.
* @return boolean indicating if there is enough available mana to pay.
* @return boolean indicating if there is enough available mana to pay.
*/
public boolean enough(final Mana avail) {
Mana compare = avail.copy();
@ -769,11 +771,11 @@ public class Mana implements Comparable<Mana>, Serializable, Copyable<Mana> {
/**
* Returns the total mana needed to meet the cost of this given the available mana passed in
* as a {@link Mana} object.
*
* <p>
* Used by the AI to calculate what mana it needs to obtain for a spell to become playable.
*
* @param avail the mana available to pay the cost
* @return the total mana needed to pay this given the available mana passed in as a {@link Mana} object.
* @return the total mana needed to pay this given the available mana passed in as a {@link Mana} object.
*/
public Mana needed(final Mana avail) {
Mana compare = avail.copy();
@ -1239,19 +1241,19 @@ public class Mana implements Comparable<Mana>, Serializable, Copyable<Mana> {
* not contain one less mana in any type but generic.
* <p>
* See tests ManaTest.moreValuableManaTest for several examples
*
* <p>
* Examples:
* {1} and {R} -> {R}
* {2} and {1}{W} -> {1}{W}
* {3} and {1}{W} -> {1}{W}
* {1}{W}{R} and {G}{W}{R} -> {G}{W}{R}
* {G}{W}{R} and {G}{W}{R} -> null
* {G}{W}{B} and {G}{W}{R} -> null
* {C} and {ANY} -> null
* {1} and {R} -> {R}
* {2} and {1}{W} -> {1}{W}
* {3} and {1}{W} -> {1}{W}
* {1}{W}{R} and {G}{W}{R} -> {G}{W}{R}
* {G}{W}{R} and {G}{W}{R} -> null
* {G}{W}{B} and {G}{W}{R} -> null
* {C} and {ANY} -> null
*
* @param mana1 The 1st mana to compare.
* @param mana2 The 2nd mana to compare.
* @return The greater of the two manas, or null if they're the same OR they cannot be compared
* @param mana1 The 1st mana to compare.
* @param mana2 The 2nd mana to compare.
* @return The greater of the two manas, or null if they're the same OR they cannot be compared
*/
public static Mana getMoreValuableMana(final Mana mana1, final Mana mana2) {
if (mana1.equals(mana2)) {
@ -1279,8 +1281,8 @@ public class Mana implements Comparable<Mana>, Serializable, Copyable<Mana> {
|| mana2.colorless > mana1.colorless
|| mana2.countColored() > mana1.countColored()
|| (mana2.countColored() == mana1.countColored()
&& mana2.colorless == mana1.colorless
&& mana2.count() > mana1.count())) {
&& mana2.colorless == mana1.colorless
&& mana2.count() > mana1.count())) {
moreMana = mana2;
lessMana = mana1;
} else {

View file

@ -94,7 +94,7 @@ public abstract class AbilityImpl implements Ability {
this.modes = new Modes();
}
public AbilityImpl(final AbilityImpl ability) {
protected AbilityImpl(final AbilityImpl ability) {
this.id = ability.id;
this.originalId = ability.originalId;
this.abilityType = ability.abilityType;

View file

@ -48,7 +48,7 @@ public abstract class ActivatedAbilityImpl extends AbilityImpl implements Activa
super(abilityType, zone);
}
public ActivatedAbilityImpl(final ActivatedAbilityImpl ability) {
protected ActivatedAbilityImpl(final ActivatedAbilityImpl ability) {
super(ability);
timing = ability.timing;
mayActivate = ability.mayActivate;

View file

@ -18,7 +18,7 @@ public class CompoundAbility extends AbilitiesImpl<Ability> {
addAll(Arrays.asList(abilities));
}
public CompoundAbility(final CompoundAbility compoundAbility) {
protected CompoundAbility(final CompoundAbility compoundAbility) {
for (Ability ability : compoundAbility) {
add(ability);
}

View file

@ -14,7 +14,7 @@ public class DelayedTriggeredAbilities extends AbilitiesImpl<DelayedTriggeredAbi
public DelayedTriggeredAbilities() {
}
public DelayedTriggeredAbilities(final DelayedTriggeredAbilities abilities) {
protected DelayedTriggeredAbilities(final DelayedTriggeredAbilities abilities) {
super(abilities);
}

View file

@ -31,7 +31,7 @@ public abstract class DelayedTriggeredAbility extends TriggeredAbilityImpl {
this.triggerOnlyOnce = triggerOnlyOnce;
}
public DelayedTriggeredAbility(final DelayedTriggeredAbility ability) {
protected DelayedTriggeredAbility(final DelayedTriggeredAbility ability) {
super(ability);
this.duration = ability.duration;
this.triggerOnlyOnce = ability.triggerOnlyOnce;

View file

@ -16,7 +16,7 @@ public abstract class EvasionAbility extends StaticAbility {
super(AbilityType.EVASION, zone);
}
public EvasionAbility(final EvasionAbility ability) {
protected EvasionAbility(final EvasionAbility ability) {
super(ability);
}

View file

@ -27,7 +27,7 @@ public class Mode implements Serializable {
}
}
public Mode(final Mode mode) {
protected Mode(final Mode mode) {
this.id = mode.id;
this.targets = mode.targets.copy();
this.effects = mode.effects.copy();

View file

@ -53,7 +53,7 @@ public class Modes extends LinkedHashMap<UUID, Mode> {
this.eachModeMoreThanOnce = false;
}
public Modes(final Modes modes) {
protected Modes(final Modes modes) {
for (Map.Entry<UUID, Mode> entry : modes.entrySet()) {
this.put(entry.getKey(), entry.getValue().copy());
}

View file

@ -33,7 +33,7 @@ public abstract class SpecialAction extends ActivatedAbilityImpl {
this.manaAbility = manaAbility;
}
public SpecialAction(final SpecialAction action) {
protected SpecialAction(final SpecialAction action) {
super(action);
this.unpaidMana = action.unpaidMana;
this.manaAbility = action.manaAbility;

View file

@ -7,27 +7,26 @@ import java.util.Map;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class SpecialActions extends AbilitiesImpl<SpecialAction> {
public SpecialActions() {}
public SpecialActions() {
}
public SpecialActions(final SpecialActions actions) {
protected SpecialActions(final SpecialActions actions) {
super(actions);
}
/**
*
* @param controllerId
* @param manaAction true = if mana actions should get returned
* false = only non mana actions get returned
* @param manaAction true = if mana actions should get returned
* false = only non mana actions get returned
* @return
*/
public Map<UUID, SpecialAction> getControlledBy(UUID controllerId, boolean manaAction) {
LinkedHashMap<UUID, SpecialAction> controlledBy = new LinkedHashMap<>();
for (SpecialAction action: this) {
for (SpecialAction action : this) {
if (action.isControlledBy(controllerId) && action.isManaAction() == manaAction) {
controlledBy.put(action.id, action);
}

View file

@ -48,7 +48,7 @@ public class SpellAbility extends ActivatedAbilityImpl {
setSpellName();
}
public SpellAbility(final SpellAbility ability) {
protected SpellAbility(final SpellAbility ability) {
super(ability);
this.spellAbilityType = ability.spellAbilityType;
this.spellAbilityCastMode = ability.spellAbilityCastMode;

View file

@ -25,7 +25,7 @@ public abstract class StateTriggeredAbility extends TriggeredAbilityImpl {
super(zone, effect);
}
public StateTriggeredAbility(final StateTriggeredAbility ability) {
protected StateTriggeredAbility(final StateTriggeredAbility ability) {
super(ability);
}

View file

@ -30,7 +30,7 @@ public class TriggeredAbilities extends ConcurrentHashMap<String, TriggeredAbili
public TriggeredAbilities() {
}
public TriggeredAbilities(final TriggeredAbilities abilities) {
protected TriggeredAbilities(final TriggeredAbilities abilities) {
for (Map.Entry<String, TriggeredAbility> entry : abilities.entrySet()) {
this.put(entry.getKey(), entry.getValue().copy());
}

View file

@ -36,7 +36,7 @@ public class ConstellationAbility extends TriggeredAbilityImpl {
+ " enchantment enters the battlefield under your control, ");
}
public ConstellationAbility(final ConstellationAbility ability) {
protected ConstellationAbility(final ConstellationAbility ability) {
super(ability);
this.thisOr = ability.thisOr;
}

View file

@ -31,7 +31,7 @@ public class GrandeurAbility extends ActivatedAbilityImpl {
setAbilityWord(AbilityWord.GRANDEUR);
}
public GrandeurAbility(final GrandeurAbility ability) {
protected GrandeurAbility(final GrandeurAbility ability) {
super(ability);
this.cardName = ability.cardName;
}

View file

@ -30,7 +30,7 @@ public class KinshipAbility extends TriggeredAbilityImpl {
setTriggerPhrase("At the beginning of your upkeep, ");
}
public KinshipAbility(final KinshipAbility ability) {
protected KinshipAbility(final KinshipAbility ability) {
super(ability);
}
@ -69,7 +69,7 @@ class KinshipBaseEffect extends OneShotEffect {
this.staticText = "you may look at the top card of your library. If it shares a creature type with {this}, you may reveal it. If you do, ";
}
public KinshipBaseEffect(final KinshipBaseEffect effect) {
protected KinshipBaseEffect(final KinshipBaseEffect effect) {
super(effect);
this.kinshipEffects.addAll(effect.kinshipEffects.copy());
}

View file

@ -13,7 +13,6 @@ import mage.constants.Duration;
import mage.constants.Zone;
/**
*
* @author emerald000
*/
@ -23,7 +22,7 @@ public class LieutenantAbility extends SimpleStaticAbility {
super(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield), CommanderInPlayCondition.instance, "<i>Lieutenant</i> &mdash; As long as you control your commander, {this} gets +2/+2"));
this.addEffect(new ConditionalContinuousEffect(effect, CommanderInPlayCondition.instance, effect.getText(null)));
}
public LieutenantAbility(Effects effects) {
super(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield), CommanderInPlayCondition.instance, "<i>Lieutenant</i> &mdash; As long as you control your commander, {this} gets +2/+2"));
for (Effect effect : effects) {
@ -31,7 +30,7 @@ public class LieutenantAbility extends SimpleStaticAbility {
}
}
public LieutenantAbility(final LieutenantAbility ability) {
protected LieutenantAbility(final LieutenantAbility ability) {
super(ability);
}

View file

@ -25,7 +25,7 @@ public class StriveAbility extends SimpleStaticAbility {
setAbilityWord(AbilityWord.STRIVE);
}
public StriveAbility(final StriveAbility ability) {
protected StriveAbility(final StriveAbility ability) {
super(ability);
this.striveCost = ability.striveCost;
}

View file

@ -18,7 +18,7 @@ public class ActivateAsSorceryActivatedAbility extends ActivatedAbilityImpl {
timing = TimingRule.SORCERY;
}
public ActivateAsSorceryActivatedAbility(final ActivateAsSorceryActivatedAbility ability) {
protected ActivateAsSorceryActivatedAbility(final ActivateAsSorceryActivatedAbility ability) {
super(ability);
}

View file

@ -8,7 +8,6 @@ import mage.constants.Zone;
import mage.constants.TargetController;
/**
*
* @author jeffwadsworth
*/
@ -18,7 +17,7 @@ public class ActivateOnlyByOpponentActivatedAbility extends ActivatedAbilityImpl
mayActivate = TargetController.OPPONENT;
}
public ActivateOnlyByOpponentActivatedAbility(final ActivateOnlyByOpponentActivatedAbility ability) {
protected ActivateOnlyByOpponentActivatedAbility(final ActivateOnlyByOpponentActivatedAbility ability) {
super(ability);
}

View file

@ -8,7 +8,6 @@ import mage.constants.EnterEventType;
import mage.constants.Zone;
/**
*
* @author North
*/
public class AsEntersBattlefieldAbility extends StaticAbility {
@ -25,7 +24,7 @@ public class AsEntersBattlefieldAbility extends StaticAbility {
super(Zone.ALL, new EntersBattlefieldEffect(effect, null, text, true, false, enterEventType));
}
public AsEntersBattlefieldAbility(final AsEntersBattlefieldAbility ability) {
protected AsEntersBattlefieldAbility(final AsEntersBattlefieldAbility ability) {
super(ability);
}

View file

@ -17,7 +17,7 @@ public class AttachedToCreatureSourceTriggeredAbility extends TriggeredAbilityIm
setTriggerPhrase("Whenever {this} becomes attached to a creature, ");
}
public AttachedToCreatureSourceTriggeredAbility(final AttachedToCreatureSourceTriggeredAbility ability) {
protected AttachedToCreatureSourceTriggeredAbility(final AttachedToCreatureSourceTriggeredAbility ability) {
super(ability);
}

View file

@ -2,6 +2,7 @@
package mage.abilities.common;
import java.util.UUID;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.constants.SetTargetPointer;
@ -14,7 +15,6 @@ import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author LevelX2
*/
public class AttackedByCreatureTriggeredAbility extends TriggeredAbilityImpl {
@ -45,7 +45,7 @@ public class AttackedByCreatureTriggeredAbility extends TriggeredAbilityImpl {
setTriggerPhrase("Whenever " + filter.getMessage() + " attacks you, ");
}
public AttackedByCreatureTriggeredAbility(final AttackedByCreatureTriggeredAbility ability) {
protected AttackedByCreatureTriggeredAbility(final AttackedByCreatureTriggeredAbility ability) {
super(ability);
this.setTargetPointer = ability.setTargetPointer;
this.filter = ability.filter;

View file

@ -43,10 +43,10 @@ public class AttacksAllTriggeredAbility extends TriggeredAbilityImpl {
this.setTargetPointer = setTargetPointer;
this.controller = controller;
setTriggerPhrase("Whenever " + CardUtil.addArticle(filter.getMessage()) + " attacks"
+ (attacksYouOrYourPlaneswalker ? " you or a planeswalker you control" : "") + ", ");
+ (attacksYouOrYourPlaneswalker ? " you or a planeswalker you control" : "") + ", ");
}
public AttacksAllTriggeredAbility(final AttacksAllTriggeredAbility ability) {
protected AttacksAllTriggeredAbility(final AttacksAllTriggeredAbility ability) {
super(ability);
this.filter = ability.filter; // TODO: Does this have to be a copy?
this.attacksYouOrYourPlaneswalker = ability.attacksYouOrYourPlaneswalker;

View file

@ -26,7 +26,7 @@ public class AttacksAndIsNotBlockedTriggeredAbility extends TriggeredAbilityImpl
setTriggerPhrase("Whenever {this} attacks and isn't blocked, ");
}
public AttacksAndIsNotBlockedTriggeredAbility(final AttacksAndIsNotBlockedTriggeredAbility ability) {
protected AttacksAndIsNotBlockedTriggeredAbility(final AttacksAndIsNotBlockedTriggeredAbility ability) {
super(ability);
this.setTargetPointer = ability.setTargetPointer;
}

View file

@ -11,7 +11,6 @@ import mage.game.permanent.Permanent;
import mage.watchers.common.AttackedThisTurnWatcher;
/**
*
* @author TheElk801
*/
public class AttacksFirstTimeTriggeredAbility extends TriggeredAbilityImpl {
@ -22,7 +21,7 @@ public class AttacksFirstTimeTriggeredAbility extends TriggeredAbilityImpl {
setTriggerPhrase("Whenever {this} attacks for the first time each turn, ");
}
public AttacksFirstTimeTriggeredAbility(final AttacksFirstTimeTriggeredAbility ability) {
protected AttacksFirstTimeTriggeredAbility(final AttacksFirstTimeTriggeredAbility ability) {
super(ability);
}

View file

@ -22,7 +22,7 @@ public class AttacksOrBlocksAttachedTriggeredAbility extends TriggeredAbilityImp
setTriggerPhrase("Whenever " + attachmentType.verb().toLowerCase() + " creature attacks or blocks, ");
}
public AttacksOrBlocksAttachedTriggeredAbility(final AttacksOrBlocksAttachedTriggeredAbility ability) {
protected AttacksOrBlocksAttachedTriggeredAbility(final AttacksOrBlocksAttachedTriggeredAbility ability) {
super(ability);
this.attachmentType = ability.attachmentType;
}

View file

@ -18,7 +18,7 @@ public class AttacksOrBlocksTriggeredAbility extends TriggeredAbilityImpl {
}
}
public AttacksOrBlocksTriggeredAbility(final AttacksOrBlocksTriggeredAbility ability) {
protected AttacksOrBlocksTriggeredAbility(final AttacksOrBlocksTriggeredAbility ability) {
super(ability);
}

View file

@ -53,7 +53,7 @@ public class AttacksWithCreaturesTriggeredAbility extends TriggeredAbilityImpl {
}
}
public AttacksWithCreaturesTriggeredAbility(final AttacksWithCreaturesTriggeredAbility ability) {
protected AttacksWithCreaturesTriggeredAbility(final AttacksWithCreaturesTriggeredAbility ability) {
super(ability);
this.filter = ability.filter;
this.minAttackers = ability.minAttackers;

View file

@ -10,7 +10,6 @@ import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
/**
*
* @author LevelX2
*/
public class AuraAttachedTriggeredAbility extends TriggeredAbilityImpl {
@ -20,7 +19,7 @@ public class AuraAttachedTriggeredAbility extends TriggeredAbilityImpl {
setTriggerPhrase("Whenever an Aura becomes attached to {this}, ");
}
public AuraAttachedTriggeredAbility(final AuraAttachedTriggeredAbility ability) {
protected AuraAttachedTriggeredAbility(final AuraAttachedTriggeredAbility ability) {
super(ability);
}
@ -44,5 +43,5 @@ public class AuraAttachedTriggeredAbility extends TriggeredAbilityImpl {
public AuraAttachedTriggeredAbility copy() {
return new AuraAttachedTriggeredAbility(this);
}
}

View file

@ -15,7 +15,6 @@ import mage.target.Target;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LevelX2
*/
public class BecomesAuraAttachToManifestSourceEffect extends OneShotEffect {
@ -25,7 +24,7 @@ public class BecomesAuraAttachToManifestSourceEffect extends OneShotEffect {
this.staticText = "it becomes an Aura with enchant creature. Manifest the top card of your library and attach {this} to it";
}
public BecomesAuraAttachToManifestSourceEffect(final BecomesAuraAttachToManifestSourceEffect effect) {
protected BecomesAuraAttachToManifestSourceEffect(final BecomesAuraAttachToManifestSourceEffect effect) {
super(effect);
}

View file

@ -29,7 +29,7 @@ public class BecomesBlockedAllTriggeredAbility extends TriggeredAbilityImpl {
setTriggerPhrase("Whenever " + filter.getMessage() + " becomes blocked, ");
}
public BecomesBlockedAllTriggeredAbility(final BecomesBlockedAllTriggeredAbility ability) {
protected BecomesBlockedAllTriggeredAbility(final BecomesBlockedAllTriggeredAbility ability) {
super(ability);
this.filter = ability.filter;
this.setTargetPointer = ability.setTargetPointer;

View file

@ -28,7 +28,7 @@ public class BecomesBlockedAttachedTriggeredAbility extends TriggeredAbilityImpl
setTriggerPhrase("Whenever enchanted creature becomes blocked, ");
}
public BecomesBlockedAttachedTriggeredAbility(final BecomesBlockedAttachedTriggeredAbility ability) {
protected BecomesBlockedAttachedTriggeredAbility(final BecomesBlockedAttachedTriggeredAbility ability) {
super(ability);
this.setTargetPointer = ability.setTargetPointer;
}

View file

@ -28,7 +28,7 @@ public class BecomesBlockedByCreatureTriggeredAbility extends TriggeredAbilityIm
setTriggerPhrase("Whenever {this} becomes blocked by " + CardUtil.addArticle(filter.getMessage()) + ", ");
}
public BecomesBlockedByCreatureTriggeredAbility(final BecomesBlockedByCreatureTriggeredAbility ability) {
protected BecomesBlockedByCreatureTriggeredAbility(final BecomesBlockedByCreatureTriggeredAbility ability) {
super(ability);
this.filter = ability.filter;
}

View file

@ -8,7 +8,6 @@ import mage.game.events.GameEvent;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author North
*/
public class BecomesBlockedSourceTriggeredAbility extends TriggeredAbilityImpl {
@ -25,7 +24,7 @@ public class BecomesBlockedSourceTriggeredAbility extends TriggeredAbilityImpl {
setTriggerPhrase("Whenever {this} becomes blocked, ");
}
public BecomesBlockedSourceTriggeredAbility(final BecomesBlockedSourceTriggeredAbility ability) {
protected BecomesBlockedSourceTriggeredAbility(final BecomesBlockedSourceTriggeredAbility ability) {
super(ability);
this.setTargetPointer = ability.setTargetPointer;
}

View file

@ -8,7 +8,6 @@ import mage.game.Game;
import mage.game.events.GameEvent;
/**
*
* @author LevelX2
*/
public class BecomesExertSourceTriggeredAbility extends TriggeredAbilityImpl {
@ -18,7 +17,7 @@ public class BecomesExertSourceTriggeredAbility extends TriggeredAbilityImpl {
setTriggerPhrase("When {this} becomes exerted, ");
}
public BecomesExertSourceTriggeredAbility(final BecomesExertSourceTriggeredAbility ability) {
protected BecomesExertSourceTriggeredAbility(final BecomesExertSourceTriggeredAbility ability) {
super(ability);
}

View file

@ -8,7 +8,6 @@ import mage.game.Game;
import mage.game.events.GameEvent;
/**
*
* @author LevelX2
*/
public class BecomesMonstrousSourceTriggeredAbility extends TriggeredAbilityImpl {
@ -24,7 +23,7 @@ public class BecomesMonstrousSourceTriggeredAbility extends TriggeredAbilityImpl
this(effect, false);
}
public BecomesMonstrousSourceTriggeredAbility(final BecomesMonstrousSourceTriggeredAbility ability) {
protected BecomesMonstrousSourceTriggeredAbility(final BecomesMonstrousSourceTriggeredAbility ability) {
super(ability);
this.monstrosityValue = ability.monstrosityValue;
}

View file

@ -9,7 +9,6 @@ import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author Styxo
*/
public class BecomesMonstrousTriggeredAbility extends TriggeredAbilityImpl {
@ -19,7 +18,7 @@ public class BecomesMonstrousTriggeredAbility extends TriggeredAbilityImpl {
setTriggerPhrase("Whenever a creature you control becomes monstrous, ");
}
public BecomesMonstrousTriggeredAbility(final BecomesMonstrousTriggeredAbility ability) {
protected BecomesMonstrousTriggeredAbility(final BecomesMonstrousTriggeredAbility ability) {
super(ability);
}

View file

@ -7,7 +7,6 @@ import mage.game.Game;
import mage.game.events.GameEvent;
/**
*
* @author LevelX2
*/
public class BecomesRenownedSourceTriggeredAbility extends TriggeredAbilityImpl {
@ -19,7 +18,7 @@ public class BecomesRenownedSourceTriggeredAbility extends TriggeredAbilityImpl
setTriggerPhrase("When {this} becomes renowned, ");
}
public BecomesRenownedSourceTriggeredAbility(final BecomesRenownedSourceTriggeredAbility ability) {
protected BecomesRenownedSourceTriggeredAbility(final BecomesRenownedSourceTriggeredAbility ability) {
super(ability);
this.renownValue = ability.renownValue;
}

View file

@ -9,7 +9,6 @@ import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
/**
*
* @author LoneFox
*/
public class BecomesTappedAttachedTriggeredAbility extends TriggeredAbilityImpl {
@ -23,7 +22,7 @@ public class BecomesTappedAttachedTriggeredAbility extends TriggeredAbilityImpl
setTriggerPhrase("Whenever " + description + " becomes tapped, ");
}
public BecomesTappedAttachedTriggeredAbility(final BecomesTappedAttachedTriggeredAbility ability) {
protected BecomesTappedAttachedTriggeredAbility(final BecomesTappedAttachedTriggeredAbility ability) {
super(ability);
}
@ -40,7 +39,7 @@ public class BecomesTappedAttachedTriggeredAbility extends TriggeredAbilityImpl
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Permanent enchantment = game.getPermanent(this.getSourceId());
if(enchantment == null) {
if (enchantment == null) {
return false;
}
Permanent enchanted = game.getPermanent(enchantment.getAttachedTo());

View file

@ -21,7 +21,7 @@ public class BecomesTappedSourceTriggeredAbility extends TriggeredAbilityImpl {
setTriggerPhrase("Whenever {this} becomes tapped, ");
}
public BecomesTappedSourceTriggeredAbility(final BecomesTappedSourceTriggeredAbility ability) {
protected BecomesTappedSourceTriggeredAbility(final BecomesTappedSourceTriggeredAbility ability) {
super(ability);
}

View file

@ -38,7 +38,7 @@ public class BecomesTappedTriggeredAbility extends TriggeredAbilityImpl {
setTriggerPhrase("Whenever " + CardUtil.addArticle(filter.getMessage()) + " becomes tapped, ");
}
public BecomesTappedTriggeredAbility(final BecomesTappedTriggeredAbility ability) {
protected BecomesTappedTriggeredAbility(final BecomesTappedTriggeredAbility ability) {
super(ability);
this.filter = ability.filter.copy();
this.setTargetPointer = ability.setTargetPointer;

View file

@ -11,7 +11,6 @@ import mage.game.stack.StackObject;
import mage.game.permanent.Permanent;
/**
*
* @author LoneFox
*/
public class BecomesTargetAttachedTriggeredAbility extends TriggeredAbilityImpl {
@ -32,7 +31,7 @@ public class BecomesTargetAttachedTriggeredAbility extends TriggeredAbilityImpl
setTriggerPhrase("When enchanted " + enchantType + " becomes the target of " + filter.getMessage() + ", ");
}
public BecomesTargetAttachedTriggeredAbility(final BecomesTargetAttachedTriggeredAbility ability) {
protected BecomesTargetAttachedTriggeredAbility(final BecomesTargetAttachedTriggeredAbility ability) {
super(ability);
this.filter = ability.filter.copy();
}

View file

@ -19,7 +19,7 @@ public class BecomesTargetControllerSpellTriggeredAbility extends TriggeredAbili
setTriggerPhrase("When you become the target of a spell, ");
}
public BecomesTargetControllerSpellTriggeredAbility(final BecomesTargetControllerSpellTriggeredAbility ability) {
protected BecomesTargetControllerSpellTriggeredAbility(final BecomesTargetControllerSpellTriggeredAbility ability) {
super(ability);
}

View file

@ -34,10 +34,10 @@ public class BecomesTargetTriggeredAbility extends TriggeredAbilityImpl {
this.filterTarget = filterTarget;
this.filterStack = filterStack;
setTriggerPhrase("Whenever " + filterTarget.getMessage() + " becomes the target of "
+ filterStack.getMessage() + ", ");
+ filterStack.getMessage() + ", ");
}
public BecomesTargetTriggeredAbility(final BecomesTargetTriggeredAbility ability) {
protected BecomesTargetTriggeredAbility(final BecomesTargetTriggeredAbility ability) {
super(ability);
this.filterTarget = ability.filterTarget;
this.filterStack = ability.filterStack;
@ -57,12 +57,12 @@ public class BecomesTargetTriggeredAbility extends TriggeredAbilityImpl {
public boolean checkTrigger(GameEvent event, Game game) {
StackObject sourceObject = game.getStack().getStackObject(event.getSourceId());
if (sourceObject == null
|| !filterStack.match(sourceObject, getControllerId(), this, game)) {
|| !filterStack.match(sourceObject, getControllerId(), this, game)) {
return false;
}
Permanent permanent = game.getPermanentOrLKIBattlefield(event.getTargetId());
if (permanent == null
|| !filterTarget.match(permanent, getControllerId(), this, game)) {
|| !filterTarget.match(permanent, getControllerId(), this, game)) {
return false;
}

View file

@ -24,7 +24,7 @@ public class BeginningOfCombatTriggeredAbility extends TriggeredAbilityImpl {
setTriggerPhrase(generateTriggerPhrase());
}
public BeginningOfCombatTriggeredAbility(final BeginningOfCombatTriggeredAbility ability) {
protected BeginningOfCombatTriggeredAbility(final BeginningOfCombatTriggeredAbility ability) {
super(ability);
this.targetController = ability.targetController;
this.setTargetPointer = ability.setTargetPointer;

View file

@ -31,7 +31,7 @@ public class BeginningOfDrawTriggeredAbility extends TriggeredAbilityImpl {
setTriggerPhrase(generateTriggerPhrase());
}
public BeginningOfDrawTriggeredAbility(final BeginningOfDrawTriggeredAbility ability) {
protected BeginningOfDrawTriggeredAbility(final BeginningOfDrawTriggeredAbility ability) {
super(ability);
this.targetController = ability.targetController;
}

View file

@ -30,7 +30,7 @@ public class BeginningOfEndStepTriggeredAbility extends TriggeredAbilityImpl {
setTriggerPhrase(generateTriggerPhrase());
}
public BeginningOfEndStepTriggeredAbility(final BeginningOfEndStepTriggeredAbility ability) {
protected BeginningOfEndStepTriggeredAbility(final BeginningOfEndStepTriggeredAbility ability) {
super(ability);
this.targetController = ability.targetController;
this.interveningIfClauseCondition = ability.interveningIfClauseCondition;

View file

@ -27,7 +27,7 @@ public class BeginningOfPostCombatMainTriggeredAbility extends TriggeredAbilityI
setTriggerPhrase(generateTriggerPhrase());
}
public BeginningOfPostCombatMainTriggeredAbility(final BeginningOfPostCombatMainTriggeredAbility ability) {
protected BeginningOfPostCombatMainTriggeredAbility(final BeginningOfPostCombatMainTriggeredAbility ability) {
super(ability);
this.targetController = ability.targetController;
this.setTargetPointer = ability.setTargetPointer;

View file

@ -32,7 +32,7 @@ public class BeginningOfPreCombatMainTriggeredAbility extends TriggeredAbilityIm
setTriggerPhrase(generateTriggerPhrase());
}
public BeginningOfPreCombatMainTriggeredAbility(final BeginningOfPreCombatMainTriggeredAbility ability) {
protected BeginningOfPreCombatMainTriggeredAbility(final BeginningOfPreCombatMainTriggeredAbility ability) {
super(ability);
this.targetController = ability.targetController;
this.setTargetPointer = ability.setTargetPointer;

View file

@ -38,7 +38,7 @@ public class BeginningOfUpkeepTriggeredAbility extends TriggeredAbilityImpl {
setTriggerPhrase(generateTriggerPhrase());
}
public BeginningOfUpkeepTriggeredAbility(final BeginningOfUpkeepTriggeredAbility ability) {
protected BeginningOfUpkeepTriggeredAbility(final BeginningOfUpkeepTriggeredAbility ability) {
super(ability);
this.targetController = ability.targetController;
this.setTargetPointer = ability.setTargetPointer;

View file

@ -21,7 +21,7 @@ public class BeginningOfYourEndStepTriggeredAbility extends TriggeredAbilityImpl
setTriggerPhrase("At the beginning of your end step, ");
}
public BeginningOfYourEndStepTriggeredAbility(final BeginningOfYourEndStepTriggeredAbility ability) {
protected BeginningOfYourEndStepTriggeredAbility(final BeginningOfYourEndStepTriggeredAbility ability) {
super(ability);
}

View file

@ -10,7 +10,6 @@ import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author garnold
*/
public class BlocksAttachedTriggeredAbility extends TriggeredAbilityImpl {
@ -33,7 +32,7 @@ public class BlocksAttachedTriggeredAbility extends TriggeredAbilityImpl {
setTriggerPhrase("Whenever " + attachedDescription + " creature blocks" + (setFixedTargetPointerToBlocked ? " a creature, " : ", "));
}
public BlocksAttachedTriggeredAbility(final BlocksAttachedTriggeredAbility ability) {
protected BlocksAttachedTriggeredAbility(final BlocksAttachedTriggeredAbility ability) {
super(ability);
this.setFixedTargetPointer = ability.setFixedTargetPointer;
this.setFixedTargetPointerToBlocked = ability.setFixedTargetPointerToBlocked;

View file

@ -31,7 +31,7 @@ public class BlocksCreatureTriggeredAbility extends TriggeredAbilityImpl {
setTriggerPhrase("Whenever {this} blocks " + CardUtil.addArticle(filter.getMessage()) + ", ");
}
public BlocksCreatureTriggeredAbility(final BlocksCreatureTriggeredAbility ability) {
protected BlocksCreatureTriggeredAbility(final BlocksCreatureTriggeredAbility ability) {
super(ability);
this.filter = ability.filter;
}

View file

@ -37,7 +37,7 @@ public class BlocksOrBecomesBlockedByOneOrMoreTriggeredAbility extends Triggered
setTriggerPhrase("Whenever {this} blocks or becomes blocked by one or more " + (filter != null ? filter.getMessage() : "creatures") + ", ");
}
public BlocksOrBecomesBlockedByOneOrMoreTriggeredAbility(final BlocksOrBecomesBlockedByOneOrMoreTriggeredAbility ability) {
protected BlocksOrBecomesBlockedByOneOrMoreTriggeredAbility(final BlocksOrBecomesBlockedByOneOrMoreTriggeredAbility ability) {
super(ability);
this.filter = ability.filter;
this.rule = ability.rule;

View file

@ -27,7 +27,7 @@ public class BlocksOrBlockedAttachedTriggeredAbility extends TriggeredAbilityImp
this.attachmentType = attachmentType;
}
public BlocksOrBlockedAttachedTriggeredAbility(final BlocksOrBlockedAttachedTriggeredAbility ability) {
protected BlocksOrBlockedAttachedTriggeredAbility(final BlocksOrBlockedAttachedTriggeredAbility ability) {
super(ability);
this.attachmentType = ability.attachmentType;
}

View file

@ -31,7 +31,7 @@ public class BlocksOrBlockedByCreatureAttachedTriggeredAbility extends Triggered
this.selfTarget = selfTarget;
}
public BlocksOrBlockedByCreatureAttachedTriggeredAbility(final BlocksOrBlockedByCreatureAttachedTriggeredAbility ability) {
protected BlocksOrBlockedByCreatureAttachedTriggeredAbility(final BlocksOrBlockedByCreatureAttachedTriggeredAbility ability) {
super(ability);
this.attachmentType = ability.attachmentType;
this.selfTarget = ability.selfTarget;

View file

@ -36,7 +36,7 @@ public class BlocksOrBlockedByCreatureSourceTriggeredAbility extends TriggeredAb
setTriggerPhrase("Whenever {this} blocks or becomes blocked by " + CardUtil.addArticle(filter.getMessage()) + ", ");
}
public BlocksOrBlockedByCreatureSourceTriggeredAbility(final BlocksOrBlockedByCreatureSourceTriggeredAbility ability) {
protected BlocksOrBlockedByCreatureSourceTriggeredAbility(final BlocksOrBlockedByCreatureSourceTriggeredAbility ability) {
super(ability);
this.filter = ability.filter;
}

View file

@ -14,12 +14,13 @@ public class BlocksOrBlockedSourceTriggeredAbility extends TriggeredAbilityImpl
public BlocksOrBlockedSourceTriggeredAbility(Effect effect) {
this(effect, false);
}
public BlocksOrBlockedSourceTriggeredAbility(Effect effect, boolean optional) {
super(Zone.BATTLEFIELD, effect, optional);
setTriggerPhrase("Whenever {this} blocks or becomes blocked, ");
}
public BlocksOrBlockedSourceTriggeredAbility(final BlocksOrBlockedSourceTriggeredAbility ability) {
protected BlocksOrBlockedSourceTriggeredAbility(final BlocksOrBlockedSourceTriggeredAbility ability) {
super(ability);
}

View file

@ -7,7 +7,6 @@ import mage.game.Game;
import mage.game.events.GameEvent;
/**
*
* @author North
*/
public class BlocksSourceTriggeredAbility extends TriggeredAbilityImpl {
@ -21,7 +20,7 @@ public class BlocksSourceTriggeredAbility extends TriggeredAbilityImpl {
setTriggerPhrase("Whenever {this} blocks, ");
}
public BlocksSourceTriggeredAbility(final BlocksSourceTriggeredAbility ability) {
protected BlocksSourceTriggeredAbility(final BlocksSourceTriggeredAbility ability) {
super(ability);
}

View file

@ -20,7 +20,7 @@ public class CastCommanderAbility extends SpellAbility {
this.ruleText = spellTemplate.getRule(); // need to support custom rule texts like OverloadAbility
}
public CastCommanderAbility(final CastCommanderAbility ability) {
protected CastCommanderAbility(final CastCommanderAbility ability) {
super(ability);
this.ruleText = ability.ruleText;
}

View file

@ -15,7 +15,6 @@ import mage.game.Game;
import mage.players.Player;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class ChancellorAbility extends StaticAbility implements OpeningHandAction {
@ -28,7 +27,7 @@ public class ChancellorAbility extends StaticAbility implements OpeningHandActio
super(Zone.HAND, effect);
}
public ChancellorAbility(final ChancellorAbility ability) {
protected ChancellorAbility(final ChancellorAbility ability) {
super(ability);
}

View file

@ -21,7 +21,7 @@ public class ControlsPermanentsControllerTriggeredAbility extends StateTriggered
protected final ComparisonType type;
protected final int value;
public ControlsPermanentsControllerTriggeredAbility(FilterPermanent filter, Effect effect){
public ControlsPermanentsControllerTriggeredAbility(FilterPermanent filter, Effect effect) {
this(filter, ComparisonType.MORE_THAN, 0, effect);
}
@ -30,10 +30,10 @@ public class ControlsPermanentsControllerTriggeredAbility extends StateTriggered
this.filter = filter;
this.value = value;
this.type = type;
setTriggerPhrase("When you control " + filter.getMessage() + ", " );
setTriggerPhrase("When you control " + filter.getMessage() + ", ");
}
public ControlsPermanentsControllerTriggeredAbility(final ControlsPermanentsControllerTriggeredAbility ability) {
protected ControlsPermanentsControllerTriggeredAbility(final ControlsPermanentsControllerTriggeredAbility ability) {
super(ability);
this.filter = ability.filter;
this.type = ability.type;

View file

@ -11,7 +11,6 @@ import mage.game.stack.StackAbility;
import mage.game.stack.StackObject;
/**
*
* @author LevelX2
*/
public class CycleAllTriggeredAbility extends TriggeredAbilityImpl {
@ -21,7 +20,7 @@ public class CycleAllTriggeredAbility extends TriggeredAbilityImpl {
setTriggerPhrase("Whenever a player cycles a card, ");
}
public CycleAllTriggeredAbility(final CycleAllTriggeredAbility ability) {
protected CycleAllTriggeredAbility(final CycleAllTriggeredAbility ability) {
super(ability);
}

View file

@ -8,7 +8,6 @@ import mage.game.Game;
import mage.game.events.GameEvent;
/**
*
* @author fireshoes
*/
public class CycleOrDiscardControllerTriggeredAbility extends TriggeredAbilityImpl {
@ -22,7 +21,7 @@ public class CycleOrDiscardControllerTriggeredAbility extends TriggeredAbilityIm
setTriggerPhrase("Whenever you cycle or discard a card, ");
}
public CycleOrDiscardControllerTriggeredAbility(final CycleOrDiscardControllerTriggeredAbility ability) {
protected CycleOrDiscardControllerTriggeredAbility(final CycleOrDiscardControllerTriggeredAbility ability) {
super(ability);
}

View file

@ -47,7 +47,7 @@ public class DealCombatDamageControlledTriggeredAbility extends TriggeredAbility
+ (onlyOpponents ? "an opponent" : "a player") + ", ");
}
public DealCombatDamageControlledTriggeredAbility(final DealCombatDamageControlledTriggeredAbility ability) {
protected DealCombatDamageControlledTriggeredAbility(final DealCombatDamageControlledTriggeredAbility ability) {
super(ability);
this.setTargetPointer = ability.setTargetPointer;
this.onlyOpponents = ability.onlyOpponents;

View file

@ -23,7 +23,7 @@ public class DealsCombatDamageEquippedTriggeredAbility extends TriggeredAbilityI
setTriggerPhrase("Whenever equipped creature deals combat damage, ");
}
public DealsCombatDamageEquippedTriggeredAbility(final DealsCombatDamageEquippedTriggeredAbility ability) {
protected DealsCombatDamageEquippedTriggeredAbility(final DealsCombatDamageEquippedTriggeredAbility ability) {
super(ability);
}

View file

@ -28,7 +28,7 @@ public class DealsCombatDamageToACreatureTriggeredAbility extends TriggeredAbili
setTriggerPhrase("Whenever {this} deals combat damage to a creature, ");
}
public DealsCombatDamageToACreatureTriggeredAbility(final DealsCombatDamageToACreatureTriggeredAbility ability) {
protected DealsCombatDamageToACreatureTriggeredAbility(final DealsCombatDamageToACreatureTriggeredAbility ability) {
super(ability);
this.setTargetPointer = ability.setTargetPointer;
}

View file

@ -24,7 +24,7 @@ public class DealsCombatDamageTriggeredAbility extends TriggeredAbilityImpl {
setTriggerPhrase("Whenever {this} deals combat damage, ");
}
public DealsCombatDamageTriggeredAbility(final DealsCombatDamageTriggeredAbility ability) {
protected DealsCombatDamageTriggeredAbility(final DealsCombatDamageTriggeredAbility ability) {
super(ability);
this.usedInPhase = ability.usedInPhase;
}

View file

@ -18,7 +18,7 @@ public class DealsDamageAttachedTriggeredAbility extends TriggeredAbilityImpl {
setTriggerPhrase("Whenever enchanted creature deals damage, ");
}
public DealsDamageAttachedTriggeredAbility(final DealsDamageAttachedTriggeredAbility ability) {
protected DealsDamageAttachedTriggeredAbility(final DealsDamageAttachedTriggeredAbility ability) {
super(ability);
}

View file

@ -9,7 +9,6 @@ import mage.game.Game;
import mage.game.events.GameEvent;
/**
*
* @author LevelX2
*/
@ -20,7 +19,7 @@ public class DealsDamageGainLifeSourceTriggeredAbility extends TriggeredAbilityI
setTriggerPhrase("Whenever {this} deals damage, ");
}
public DealsDamageGainLifeSourceTriggeredAbility(final DealsDamageGainLifeSourceTriggeredAbility ability) {
protected DealsDamageGainLifeSourceTriggeredAbility(final DealsDamageGainLifeSourceTriggeredAbility ability) {
super(ability);
}
@ -28,10 +27,11 @@ public class DealsDamageGainLifeSourceTriggeredAbility extends TriggeredAbilityI
public DealsDamageGainLifeSourceTriggeredAbility copy() {
return new DealsDamageGainLifeSourceTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.DAMAGED_PERMANENT
|| event.getType() == GameEvent.EventType.DAMAGED_PLAYER;
|| event.getType() == GameEvent.EventType.DAMAGED_PLAYER;
}
@Override

View file

@ -41,10 +41,10 @@ public class DealsDamageToACreatureAllTriggeredAbility extends TriggeredAbilityI
this.setTargetPointer = setTargetPointer;
this.filterPermanent = filterPermanent;
setTriggerPhrase("Whenever " + filterPermanent.getMessage() + " deals "
+ (combatOnly ? "combat " : "") + "damage to a creature, ");
+ (combatOnly ? "combat " : "") + "damage to a creature, ");
}
public DealsDamageToACreatureAllTriggeredAbility(final DealsDamageToACreatureAllTriggeredAbility ability) {
protected DealsDamageToACreatureAllTriggeredAbility(final DealsDamageToACreatureAllTriggeredAbility ability) {
super(ability);
this.combatOnly = ability.combatOnly;
this.filterPermanent = ability.filterPermanent;

View file

@ -26,10 +26,10 @@ public class DealsDamageToACreatureAttachedTriggeredAbility extends TriggeredAbi
this.setTargetPointer = setTargetPointer;
this.attachedDescription = attachedDescription;
setTriggerPhrase("Whenever " + attachedDescription + " deals "
+ (combatOnly ? "combat " : "") + "damage to a creature, ");
+ (combatOnly ? "combat " : "") + "damage to a creature, ");
}
public DealsDamageToACreatureAttachedTriggeredAbility(final DealsDamageToACreatureAttachedTriggeredAbility ability) {
protected DealsDamageToACreatureAttachedTriggeredAbility(final DealsDamageToACreatureAttachedTriggeredAbility ability) {
super(ability);
this.combatOnly = ability.combatOnly;
this.setTargetPointer = ability.setTargetPointer;

View file

@ -33,7 +33,7 @@ public class DealsDamageToACreatureTriggeredAbility extends TriggeredAbilityImpl
setTriggerPhrase("Whenever {this} deals " + (combatOnly ? "combat " : "") + "damage to " + filter.getMessage() + ", ");
}
public DealsDamageToACreatureTriggeredAbility(final DealsDamageToACreatureTriggeredAbility ability) {
protected DealsDamageToACreatureTriggeredAbility(final DealsDamageToACreatureTriggeredAbility ability) {
super(ability);
this.setTargetPointer = ability.setTargetPointer;
this.combatOnly = ability.combatOnly;

View file

@ -47,7 +47,7 @@ public class DealsDamageToAPlayerAllTriggeredAbility extends TriggeredAbilityImp
+ (targetController == TargetController.OPPONENT ? "an opponent" : "a player") + ", ");
}
public DealsDamageToAPlayerAllTriggeredAbility(final DealsDamageToAPlayerAllTriggeredAbility ability) {
protected DealsDamageToAPlayerAllTriggeredAbility(final DealsDamageToAPlayerAllTriggeredAbility ability) {
super(ability);
this.setTargetPointer = ability.setTargetPointer;
this.filter = ability.filter;

View file

@ -41,7 +41,7 @@ public class DealsDamageToAPlayerAttachedTriggeredAbility extends TriggeredAbili
setTriggerPhrase(generateTriggerPhrase());
}
public DealsDamageToAPlayerAttachedTriggeredAbility(final DealsDamageToAPlayerAttachedTriggeredAbility ability) {
protected DealsDamageToAPlayerAttachedTriggeredAbility(final DealsDamageToAPlayerAttachedTriggeredAbility ability) {
super(ability);
this.setFixedTargetPointer = ability.setFixedTargetPointer;
this.attachedDescription = ability.attachedDescription;

Some files were not shown because too many files have changed in this diff Show more