Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions Mage.Sets/src/mage/cards/u/UltronsAuxiliary.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
package mage.cards.u;

import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.ZoneChangeEvent;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.MenaceAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;

/**
*
* @author muz
*/
public final class UltronsAuxiliary extends CardImpl {

public UltronsAuxiliary(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{1}{B}");

this.subtype.add(SubType.ROBOT);
this.subtype.add(SubType.VILLAIN);
this.power = new MageInt(1);
this.toughness = new MageInt(1);

// Menace
this.addAbility(new MenaceAbility());

// Whenever another artifact is put into your graveyard from the battlefield or an artifact card is put into your graveyard from anywhere other than the battlefield, put a +1/+1 counter on this creature.
this.addAbility(new UltronsAuxiliaryTriggeredAbility());
}

private UltronsAuxiliary(final UltronsAuxiliary card) {
super(card);
}

@Override
public UltronsAuxiliary copy() {
return new UltronsAuxiliary(this);
}
}

class UltronsAuxiliaryTriggeredAbility extends TriggeredAbilityImpl {

UltronsAuxiliaryTriggeredAbility() {
super(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()));
setLeavesTheBattlefieldTrigger(true);
}

private UltronsAuxiliaryTriggeredAbility(final UltronsAuxiliaryTriggeredAbility ability) {
super(ability);
}

@Override
public UltronsAuxiliaryTriggeredAbility copy() {
return new UltronsAuxiliaryTriggeredAbility(this);
}

@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.ZONE_CHANGE;
}

@Override
public boolean checkTrigger(GameEvent event, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
// Whenever another artifact enters your graveyard from the battlefield
if (zEvent.isDiesEvent()
&& zEvent.isPermanentMoved()
&& !zEvent.getTargetId().equals(this.getSourceId())
&& zEvent.getTarget().isArtifact(game)) {
return true;
}
Card card = game.getCard(zEvent.getTargetId());
// Or an artifact card is put into a graveyard from anywhere other than the battlefield
if (card == null || !card.isArtifact(game)) {
return false;
}
if (zEvent.getToZone() == Zone.GRAVEYARD
&& zEvent.getFromZone() != Zone.BATTLEFIELD) {
return true;
}
return false;
}

@Override
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
}

@Override
public String getRule() {
return "Whenever another artifact is put into your graveyard from the battlefield " +
"or an artifact card is put into your graveyard from anywhere other than the battlefield, " +
"put a +1/+1 counter on this creature.";
}
}
1 change: 1 addition & 0 deletions Mage.Sets/src/mage/sets/MarvelSuperHeroesCommander.java
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@ private MarvelSuperHeroesCommander() {
cards.add(new SetCardInfo("Tragic Arrogance", 323, Rarity.RARE, mage.cards.t.TragicArrogance.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Ultimate Alliance", 611, Rarity.COMMON, mage.cards.u.UltimateAlliance.class));
cards.add(new SetCardInfo("Ultimo, Civilization's End", 540, Rarity.UNCOMMON, mage.cards.u.UltimoCivilizationsEnd.class));
cards.add(new SetCardInfo("Ultron's Auxiliary", 669, Rarity.UNCOMMON, mage.cards.u.UltronsAuxiliary.class));
cards.add(new SetCardInfo("Ultron the Annihilator", 668, Rarity.MYTHIC, mage.cards.u.UltronTheAnnihilator.class));
cards.add(new SetCardInfo("Ultron, Machine Overlord", 507, Rarity.RARE, mage.cards.u.UltronMachineOverlord.class));
cards.add(new SetCardInfo("Unclaimed Territory", 275, Rarity.UNCOMMON, mage.cards.u.UnclaimedTerritory.class));
Expand Down