Refactor: improved emblem rules generation;

This commit is contained in:
Oleg Agafonov 2019-01-03 11:41:34 +04:00
parent e1630b3c6f
commit a4e374f96a
11 changed files with 63 additions and 91 deletions

View file

@ -1,8 +1,5 @@
package mage.cards.a;
import java.util.List;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
@ -27,8 +24,10 @@ import mage.players.Player;
import mage.target.TargetPlayer;
import mage.target.common.TargetCreaturePermanent;
import java.util.List;
import java.util.UUID;
/**
*
* @author Styxo
*/
public final class AurraSingBaneOfJedi extends CardImpl {
@ -39,17 +38,17 @@ public final class AurraSingBaneOfJedi extends CardImpl {
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3));
// +1:You may have {this} deal 2 damage to target creature. If you don't, {this} deals 1 damage to you.
// +1: You may have {this} deal 2 damage to target creature. If you don't, {this} deals 1 damage to you.
Ability ability = new LoyaltyAbility(new AurraSingBaneOfJediEffect(), +1);
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
// -4:Target player gets an emblem wiht "Whenever a nontoken creature you control leave the battlefied, discard a card.".
// -4: Target player gets an emblem wiht "Whenever a nontoken creature you control leave the battlefied, discard a card.".
ability = new LoyaltyAbility(new GetEmblemTargetPlayerEffect(new AurraSingBaneOfJediEmblem()), -4);
ability.addTarget(new TargetPlayer());
this.addAbility(ability);
// -6:Each player discards their hand and sacrificies all creatures he or she controls. Each player's life total becomes 1."
// -6: Each player discards their hand and sacrificies all creatures he or she controls. Each player's life total becomes 1."
ability = new LoyaltyAbility(new DiscardHandAllEffect(), -6);
ability.addEffect(new SacrificeAllEffect());
Effect effect = new SetPlayerLifeAllEffect(1, TargetController.ANY);

View file

@ -1,7 +1,5 @@
package mage.cards.g;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
@ -12,7 +10,10 @@ import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.GetEmblemTargetPlayerEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.permanent.AnotherPredicate;
@ -25,8 +26,9 @@ import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import mage.target.common.TargetOpponent;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class GarrukApexPredator extends CardImpl {
@ -62,7 +64,6 @@ public final class GarrukApexPredator extends CardImpl {
// -8: Target opponent gets an emblem with "Whenever a creature attacks you, it gets +5/+5 and gains trample until end of turn."
Effect effect = new GetEmblemTargetPlayerEffect(new GarrukApexPredatorEmblem());
effect.setText("Target opponent gets an emblem with \"Whenever a creature attacks you, it gets +5/+5 and gains trample until end of turn.\"");
ability = new LoyaltyAbility(effect, -8);
ability.addTarget(new TargetOpponent());
this.addAbility(ability);

View file

@ -1,22 +1,16 @@
package mage.cards.r;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility;
import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CopyTargetSpellEffect;
import mage.abilities.effects.common.DoIfCostPaid;
import mage.abilities.effects.common.CreateTokenCopyTargetEffect;
import mage.abilities.effects.common.DoIfCostPaid;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SetTargetPointer;
import mage.constants.SuperType;
import mage.constants.Zone;
import mage.constants.*;
import mage.filter.FilterSpell;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.Predicates;
@ -24,8 +18,9 @@ import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.filter.predicate.permanent.TokenPredicate;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class RikuOfTwoReflections extends CardImpl {
@ -53,7 +48,6 @@ public final class RikuOfTwoReflections extends CardImpl {
// Whenever you cast an instant or sorcery spell, you may pay {U}{R}. If you do, copy that spell. You may choose new targets for the copy.
Effect effect = new CopyTargetSpellEffect(true);
effect.setText("copy that spell. You may choose new targets for the copy");
this.addAbility(new SpellCastControllerTriggeredAbility(new DoIfCostPaid(effect, new ManaCostsImpl("{U}{R}")), filter, false, true));
// Whenever another nontoken creature enters the battlefield under your control, you may pay {G}{U}. If you do, create a token that's a copy of that creature.

View file

@ -1,7 +1,5 @@
package mage.cards.r;
import java.util.UUID;
import mage.MageObjectReference;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
@ -13,14 +11,9 @@ import mage.abilities.effects.RequirementEffect;
import mage.abilities.effects.common.DamageAllEffect;
import mage.abilities.effects.common.GetEmblemTargetPlayerEffect;
import mage.abilities.keyword.PartnerWithAbility;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.TurnPhase;
import mage.constants.*;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.filter.predicate.permanent.TappedPredicate;
@ -29,8 +22,9 @@ import mage.game.command.emblems.RowanKenrithEmblem;
import mage.game.permanent.Permanent;
import mage.target.TargetPlayer;
import java.util.UUID;
/**
*
* @author TheElk801
*/
public final class RowanKenrith extends CardImpl {
@ -54,11 +48,6 @@ public final class RowanKenrith extends CardImpl {
// -8: Target player gets an emblem with "Whenever you activate an ability that isn't a mana ability, copy it. You may choose new targets for the copy."
Effect effect = new GetEmblemTargetPlayerEffect(new RowanKenrithEmblem());
effect.setText(
"Target player gets an emblem with "
+ "\"Whenever you activate an ability that isn't a mana ability, "
+ "copy it. You may choose new targets for the copy.\""
);
ability = new LoyaltyAbility(effect, -8);
ability.addTarget(new TargetPlayer());
this.addAbility(ability);

View file

@ -1,7 +1,5 @@
package mage.cards.w;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.CanBeYourCommanderAbility;
@ -16,11 +14,7 @@ import mage.abilities.effects.common.cost.SpellsCostReductionAllEffect;
import mage.abilities.keyword.PartnerWithAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.*;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
@ -29,8 +23,9 @@ import mage.game.command.emblems.WillKenrithEmblem;
import mage.target.TargetPlayer;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author TheElk801
*/
public final class WillKenrith extends CardImpl {
@ -60,11 +55,6 @@ public final class WillKenrith extends CardImpl {
// -8: Target player gets an emblem with "Whenever you cast an instant or sorcery spell, copy it. You may choose new targets for the copy."
Effect effect = new GetEmblemTargetPlayerEffect(new WillKenrithEmblem());
effect.setText(
"Target player gets an emblem with "
+ "\"Whenever you cast an instant or sorcery spell, "
+ "copy it. You may choose new targets for the copy.\""
);
ability = new LoyaltyAbility(effect, -8);
ability.addTarget(new TargetPlayer());
this.addAbility(ability);