[NCC] Implement Skyboon Evangelist (#9333)

This commit is contained in:
PurpleCrowbar 2022-07-30 02:04:30 +01:00 committed by GitHub
parent 2b52cdd81b
commit d2ac4c3b3d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 119 additions and 8 deletions

View file

@ -0,0 +1,105 @@
package mage.cards.s;
import mage.MageInt;
import mage.abilities.common.AttacksAllTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.SupportAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SetTargetPointer;
import mage.constants.SubType;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.CounterAnyPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
import java.util.Set;
import java.util.UUID;
/**
* @author PurpleCrowbar
*/
public final class SkyboonEvangelist extends CardImpl {
public SkyboonEvangelist(UUID ownerID, CardSetInfo setInfo) {
super(ownerID, setInfo, new CardType[]{CardType.CREATURE}, "{4}{W}");
this.subtype.add(SubType.BIRD);
this.subtype.add(SubType.ADVISOR);
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// FLying
this.addAbility(FlyingAbility.getInstance());
// When Skyboon Evangelist enters the battlefield, support 6.
this.addAbility(new SupportAbility(this, 6));
// Whenever a creature with a counter on it attacks one of your opponents, that creature gains flying until end of turn.
this.addAbility(new SkyboonEvangelistTriggeredAbility());
}
private SkyboonEvangelist(final SkyboonEvangelist card) {
super(card);
}
@Override
public SkyboonEvangelist copy() {
return new SkyboonEvangelist(this);
}
}
class SkyboonEvangelistTriggeredAbility extends AttacksAllTriggeredAbility {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with a counter on it");
static {
filter.add(CounterAnyPredicate.instance);
}
SkyboonEvangelistTriggeredAbility() {
super(new GainAbilityTargetEffect(
FlyingAbility.getInstance(),
Duration.EndOfTurn
).setText("that creature gains flying until end of turn"), false, filter, SetTargetPointer.PERMANENT, false);
}
SkyboonEvangelistTriggeredAbility(final SkyboonEvangelistTriggeredAbility effect) {
super(effect);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (super.checkTrigger(event,game)) {
Player defender = game.getPlayer(event.getTargetId());
if (defender == null) {
return false;
}
Set<UUID> opponents = game.getOpponents(this.getControllerId());
if (opponents != null && opponents.contains(defender.getId())) {
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getSourceId(), game));
}
return true;
}
}
return false;
}
@Override
public String getRule() {
return "Whenever a creature with a counter on it attacks one of your opponents, that creature gains flying until end of turn.";
}
@Override
public SkyboonEvangelistTriggeredAbility copy() {
return new SkyboonEvangelistTriggeredAbility(this);
}
}

View file

@ -1,9 +1,11 @@
package mage.cards.s;
import java.util.Set;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.AttacksAllTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.keyword.DeathtouchAbility;
import mage.abilities.keyword.PartnerWithAbility;
@ -16,7 +18,6 @@ import mage.constants.SubType;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
@ -69,14 +70,17 @@ class SoulbladeCorrupterTriggeredAbility extends AttacksAllTriggeredAbility {
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (super.checkTrigger(event, game)) {
Permanent permanent = game.getPermanent(event.getSourceId());
if (permanent != null) {
Player player = game.getPlayer(permanent.getControllerId());
if (player != null && player.hasOpponent(getControllerId(), game)) {
getEffects().setTargetPointer(new FixedTarget(permanent, game));
return true;
if (super.checkTrigger(event,game)) {
Player defender = game.getPlayer(event.getTargetId());
if (defender == null) {
return false;
}
Set<UUID> opponents = game.getOpponents(this.getControllerId());
if (opponents != null && opponents.contains(defender.getId())) {
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getSourceId(), game));
}
return true;
}
}
return false;

View file

@ -263,6 +263,8 @@ public final class NewCapennaCommander extends ExpansionSet {
cards.add(new SetCardInfo("Shadowmage Infiltrator", 351, Rarity.UNCOMMON, mage.cards.s.ShadowmageInfiltrator.class));
cards.add(new SetCardInfo("Shamanic Revelation", 311, Rarity.RARE, mage.cards.s.ShamanicRevelation.class));
cards.add(new SetCardInfo("Silent-Blade Oni", 352, Rarity.RARE, mage.cards.s.SilentBladeOni.class));
cards.add(new SetCardInfo("Skyboon Evangelist", 20, Rarity.RARE, mage.cards.s.SkyboonEvangelist.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Skyboon Evangelist", 121, Rarity.RARE, mage.cards.s.SkyboonEvangelist.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Skyclave Shade", 260, Rarity.RARE, mage.cards.s.SkyclaveShade.class));
cards.add(new SetCardInfo("Skycloud Expanse", 427, Rarity.RARE, mage.cards.s.SkycloudExpanse.class));
cards.add(new SetCardInfo("Skyship Plunderer", 232, Rarity.UNCOMMON, mage.cards.s.SkyshipPlunderer.class));