[NEO] Implemented Mechtitan Core

This commit is contained in:
Evan Kranzler 2022-02-08 18:38:40 -05:00
parent 33ba01e093
commit b100890cdf
5 changed files with 264 additions and 30 deletions

View file

@ -1,7 +1,6 @@
package mage.abilities.costs.common;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.costs.Cost;
@ -11,23 +10,23 @@ import mage.game.Game;
import mage.players.Player;
import mage.util.CardUtil;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class ExileSourceCost extends CostImpl {
private boolean toUniqueExileZone;
private final boolean toUniqueExileZone;
public ExileSourceCost() {
this.text = "exile {this}";
this(false);
}
/**
*
* @param toUniqueExileZone moves the card to a source object dependant
* unique exile zone, so another effect of the same source object (e.g.
* Deadeye Navigator) can identify the card
* unique exile zone, so another effect of the same source object (e.g.
* Deadeye Navigator) can identify the card
*/
public ExileSourceCost(boolean toUniqueExileZone) {
this.text = "exile {this}";
@ -52,7 +51,7 @@ public class ExileSourceCost extends CostImpl {
game.getState().setValue(sourceObject.getId().toString(), ability.getSourceObjectZoneChangeCounter());
}
controller.moveCardToExileWithInfo((Card) sourceObject, exileZoneId, exileZoneName, source, game, game.getState().getZone(sourceObject.getId()), true);
// 117.11. The actions performed when paying a cost may be modified by effects.
// 117.11. The actions performed when paying a cost may be modified by effects.
// Even if they are, meaning the actions that are performed don't match the actions
// that are called for, the cost has still been paid.
// so return state here is not important because the user indended to exile the target anyway

View file

@ -2,20 +2,23 @@
package mage.abilities.costs.common;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.costs.Cost;
import mage.abilities.costs.CostImpl;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetControlledPermanent;
import mage.util.CardUtil;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author emerald000
*/
public class ExileTargetCost extends CostImpl {
@ -26,35 +29,43 @@ public class ExileTargetCost extends CostImpl {
this.addTarget(target);
this.text = "Exile " + target.getTargetName();
}
public ExileTargetCost(TargetControlledPermanent target, boolean noText) {
this.addTarget(target);
}
public ExileTargetCost(ExileTargetCost cost) {
super(cost);
for (Permanent permanent: cost.permanents) {
for (Permanent permanent : cost.permanents) {
this.permanents.add(permanent.copy());
}
}
@Override
public boolean pay(Ability ability, Game game, Ability source, UUID controllerId, boolean noMana, Cost costToPay) {
if (targets.choose(Outcome.Exile, controllerId, source.getSourceId(), game)) {
for (UUID targetId: targets.get(0).getTargets()) {
Permanent permanent = game.getPermanent(targetId);
if (permanent == null) {
return false;
}
permanents.add(permanent.copy());
// 117.11. The actions performed when paying a cost may be modified by effects.
// Even if they are, meaning the actions that are performed don't match the actions
// that are called for, the cost has still been paid.
// so return state here is not important because the user indended to exile the target anyway
game.getPlayer(ability.getControllerId()).moveCardToExileWithInfo(permanent, null, null, source, game, Zone.BATTLEFIELD, true);
}
paid = true;
Player player = game.getPlayer(ability.getControllerId());
if (player == null || !targets.choose(Outcome.Exile, controllerId, source.getSourceId(), game)) {
return paid;
}
Cards cards = new CardsImpl();
for (UUID targetId : targets.get(0).getTargets()) {
Permanent permanent = game.getPermanent(targetId);
if (permanent == null) {
return false;
}
cards.add(permanent);
permanents.add(permanent.copy());
// 117.11. The actions performed when paying a cost may be modified by effects.
// Even if they are, meaning the actions that are performed don't match the actions
// that are called for, the cost has still been paid.
// so return state here is not important because the user indended to exile the target anyway
}
player.moveCardsToExile(
cards.getCards(game), source, game, false,
CardUtil.getExileZoneId(game, source),
CardUtil.getSourceName(game, source)
);
paid = true;
return paid;
}
@ -71,5 +82,4 @@ public class ExileTargetCost extends CostImpl {
public List<Permanent> getPermanents() {
return permanents;
}
}

View file

@ -0,0 +1,41 @@
package mage.game.permanent.token;
import mage.MageInt;
import mage.abilities.keyword.*;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
/**
* @author TheElk801
*/
public final class MechtitanToken extends TokenImpl {
public MechtitanToken() {
super("Mechtitan", "Mechtitan, a legendary 10/10 Construct artifact creature token with flying, vigilance, trample, lifelink, and haste that's all colors");
addSuperType(SuperType.LEGENDARY);
cardType.add(CardType.ARTIFACT);
cardType.add(CardType.CREATURE);
subtype.add(SubType.CONSTRUCT);
color.setWhite(true);
color.setBlue(true);
color.setBlack(true);
color.setRed(true);
color.setGreen(true);
power = new MageInt(10);
toughness = new MageInt(10);
addAbility(FlyingAbility.getInstance());
addAbility(VigilanceAbility.getInstance());
addAbility(TrampleAbility.getInstance());
addAbility(LifelinkAbility.getInstance());
addAbility(HasteAbility.getInstance());
}
public MechtitanToken(final MechtitanToken token) {
super(token);
}
public MechtitanToken copy() {
return new MechtitanToken(this);
}
}