forked from External/mage
Implemented Setessan Champion
This commit is contained in:
parent
582ac00238
commit
447002ee67
3 changed files with 61 additions and 8 deletions
45
Mage.Sets/src/mage/cards/s/SetessanChampion.java
Normal file
45
Mage.Sets/src/mage/cards/s/SetessanChampion.java
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
package mage.cards.s;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.abilityword.ConstellationAbility;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.counters.CounterType;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class SetessanChampion extends CardImpl {
|
||||
|
||||
public SetessanChampion(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}");
|
||||
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.subtype.add(SubType.WARRIOR);
|
||||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// Constellation — Whenever an enchantment enters the battlefield under your control, put a +1/+1 counter on Setessan Champion and draw a card.
|
||||
Ability ability = new ConstellationAbility(
|
||||
new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false, false
|
||||
);
|
||||
ability.addEffect(new DrawCardSourceControllerEffect(1).concatBy("and"));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
private SetessanChampion(final SetessanChampion card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SetessanChampion copy() {
|
||||
return new SetessanChampion(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -32,6 +32,7 @@ public final class TherosBeyondDeath extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Klothys's Design", 176, Rarity.UNCOMMON, mage.cards.k.KlothyssDesign.class));
|
||||
cards.add(new SetCardInfo("Mountain", 253, Rarity.LAND, mage.cards.basiclands.Mountain.class, FULL_ART_BFZ_VARIOUS));
|
||||
cards.add(new SetCardInfo("Plains", 250, Rarity.LAND, mage.cards.basiclands.Plains.class, FULL_ART_BFZ_VARIOUS));
|
||||
cards.add(new SetCardInfo("Setessan Champion", 198, Rarity.RARE, mage.cards.s.SetessanChampion.class));
|
||||
cards.add(new SetCardInfo("Swamp", 252, Rarity.LAND, mage.cards.basiclands.Swamp.class, FULL_ART_BFZ_VARIOUS));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,22 +12,29 @@ import mage.game.permanent.Permanent;
|
|||
/**
|
||||
* Constellation
|
||||
*
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class ConstellationAbility extends TriggeredAbilityImpl {
|
||||
|
||||
private final boolean thisOr;
|
||||
|
||||
public ConstellationAbility(Effect effect) {
|
||||
this(effect, false);
|
||||
}
|
||||
|
||||
public ConstellationAbility(Effect effect, boolean optional) {
|
||||
this(effect, optional, true);
|
||||
}
|
||||
|
||||
public ConstellationAbility(Effect effect, boolean optional, boolean thisOr) {
|
||||
super(Zone.BATTLEFIELD, effect, optional);
|
||||
this.thisOr = thisOr;
|
||||
}
|
||||
|
||||
public ConstellationAbility(final ConstellationAbility ability) {
|
||||
super(ability);
|
||||
this.thisOr = ability.thisOr;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -42,17 +49,17 @@ public class ConstellationAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getPlayerId().equals(this.getControllerId())) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent != null && permanent.isEnchantment()) {
|
||||
return true;
|
||||
}
|
||||
if (!event.getPlayerId().equals(this.getControllerId())) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
return permanent != null && permanent.isEnchantment();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return new StringBuilder("<i>Constellation</i> — Whenever {this} or another enchantment enters the battlefield under your control, ").append(super.getRule()).toString();
|
||||
return "<i>Constellation</i> — Whenever "
|
||||
+ (thisOr ? "{this} or another" : "an")
|
||||
+ " enchantment enters the battlefield under your control, " + super.getRule();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue