[NEO] Implemented Chainflail Centipede

This commit is contained in:
Evan Kranzler 2022-02-05 13:36:56 -05:00
parent b185a34494
commit dd775198ff
2 changed files with 94 additions and 0 deletions

View file

@ -0,0 +1,93 @@
package mage.cards.c;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.keyword.ReconfigureAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class ChainflailCentipede extends CardImpl {
public ChainflailCentipede(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{2}{B}");
this.subtype.add(SubType.EQUIPMENT);
this.subtype.add(SubType.INSECT);
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// Whenever Chainflail Centipede or equipped creature attacks, it gets +2/+0 until end of turn.
this.addAbility(new ChainflailCentipedeTriggeredAbility());
// Reconfigure {2}
this.addAbility(new ReconfigureAbility("{2}"));
}
private ChainflailCentipede(final ChainflailCentipede card) {
super(card);
}
@Override
public ChainflailCentipede copy() {
return new ChainflailCentipede(this);
}
}
class ChainflailCentipedeTriggeredAbility extends TriggeredAbilityImpl {
ChainflailCentipedeTriggeredAbility() {
super(Zone.BATTLEFIELD, new BoostTargetEffect(2, 0));
}
private ChainflailCentipedeTriggeredAbility(final ChainflailCentipedeTriggeredAbility ability) {
super(ability);
}
@Override
public ChainflailCentipedeTriggeredAbility copy() {
return new ChainflailCentipedeTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.DECLARED_ATTACKERS;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
UUID attacker;
if (!game.getCombat().getAttackers().contains(getSourceId())) {
Permanent permanent = getSourcePermanentOrLKI(game);
if (permanent != null && game.getCombat().getAttackers().contains(permanent.getAttachedTo())) {
attacker = permanent.getAttachedTo();
} else {
attacker = null;
}
} else {
attacker = getSourceId();
}
if (attacker == null) {
return false;
}
getEffects().setTargetPointer(new FixedTarget(attacker, game));
return true;
}
@Override
public String getRule() {
return "Whenever {this} or equipped creature attacks, it gets +2/+0 until end of turn.";
}
}

View file

@ -59,6 +59,7 @@ public final class KamigawaNeonDynasty extends ExpansionSet {
cards.add(new SetCardInfo("Bronzeplate Boar", 135, Rarity.UNCOMMON, mage.cards.b.BronzeplateBoar.class));
cards.add(new SetCardInfo("Brute Suit", 241, Rarity.COMMON, mage.cards.b.BruteSuit.class));
cards.add(new SetCardInfo("Careful Cultivation", 178, Rarity.COMMON, mage.cards.c.CarefulCultivation.class));
cards.add(new SetCardInfo("Chainflail Centipede", 90, Rarity.COMMON, mage.cards.c.ChainflailCentipede.class));
cards.add(new SetCardInfo("Circuit Mender", 242, Rarity.UNCOMMON, mage.cards.c.CircuitMender.class));
cards.add(new SetCardInfo("Clawing Torment", 91, Rarity.COMMON, mage.cards.c.ClawingTorment.class));
cards.add(new SetCardInfo("Cloudsteel Kirin", 8, Rarity.RARE, mage.cards.c.CloudsteelKirin.class));