1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-12 17:00:08 -09:00

[ONE] Implement Geth, Thane of Contracts ()

This commit is contained in:
Merlingilb 2023-02-20 00:29:12 +01:00 committed by GitHub
parent 83842ccdea
commit ea5ad0524b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 100 additions and 0 deletions

View file

@ -0,0 +1,99 @@
package mage.cards.g;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.ActivateAsSorceryActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.CompositeCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
import mage.abilities.effects.common.continuous.BoostControlledEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.ZoneChangeEvent;
import mage.target.common.TargetCardInYourGraveyard;
import java.util.UUID;
public class GethThaneOfContracts extends CardImpl {
public GethThaneOfContracts(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{B}");
this.addSuperType(SuperType.LEGENDARY);
this.addSubType(SubType.PHYREXIAN);
this.addSubType(SubType.ZOMBIE);
this.power = new MageInt(3);
this.toughness = new MageInt(4);
//Other creatures you control get -1/-1.
this.addAbility(new SimpleStaticAbility(
new BoostControlledEffect(-1, -1, Duration.WhileOnBattlefield, true)
));
//{1}{B}{B}, {T}: Return target creature card from your graveyard to the battlefield. It gains If this creature
//would leave the battlefield, exile it instead of putting it anywhere else. Activate only as a sorcery.
Ability ability = new ActivateAsSorceryActivatedAbility(
new ReturnFromGraveyardToBattlefieldTargetEffect(false, false)
.setText("Return target creature card from your graveyard to the battlefield."),
new ManaCostsImpl<>("{1}{B}{B}")
);
ability.addCost(new TapSourceCost());
ability.addEffect(new GainAbilityTargetEffect(
new SimpleStaticAbility(new GethThaneOfContractsReplacementEffect()),
Duration.Custom
).setText("It gains \"If this creature would leave the battlefield, exile it instead of putting it anywhere else.\""));
ability.addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD));
this.addAbility(ability);
}
private GethThaneOfContracts(final GethThaneOfContracts card) {
super(card);
}
@Override
public GethThaneOfContracts copy() {
return new GethThaneOfContracts(this);
}
}
class GethThaneOfContractsReplacementEffect extends ReplacementEffectImpl {
public GethThaneOfContractsReplacementEffect() {
super(Duration.Custom, Outcome.Exile);
this.staticText = "If {this} would leave the battlefield, exile it instead of putting it anywhere else.";
}
private GethThaneOfContractsReplacementEffect(final GethThaneOfContractsReplacementEffect effect) {
super(effect);
}
@Override
public GethThaneOfContractsReplacementEffect copy() {
return new GethThaneOfContractsReplacementEffect(this);
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
((ZoneChangeEvent) event).setToZone(Zone.EXILED);
return false;
}
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.ZONE_CHANGE;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
UUID targetId = zEvent.getTargetId();
return targetId != null && targetId.equals(source.getSourceId())
&& zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() != Zone.EXILED;
}
}

View file

@ -91,6 +91,7 @@ public final class PhyrexiaAllWillBeOne extends ExpansionSet {
cards.add(new SetCardInfo("Furnace Punisher", 132, Rarity.UNCOMMON, mage.cards.f.FurnacePunisher.class));
cards.add(new SetCardInfo("Furnace Skullbomb", 228, Rarity.COMMON, mage.cards.f.FurnaceSkullbomb.class));
cards.add(new SetCardInfo("Furnace Strider", 133, Rarity.COMMON, mage.cards.f.FurnaceStrider.class));
cards.add(new SetCardInfo("Geth, Thane of Contracts", 95, Rarity.RARE, mage.cards.g.GethThaneOfContracts.class));
cards.add(new SetCardInfo("Gitaxian Anatomist", 52, Rarity.COMMON, mage.cards.g.GitaxianAnatomist.class));
cards.add(new SetCardInfo("Gitaxian Raptor", 53, Rarity.COMMON, mage.cards.g.GitaxianRaptor.class));
cards.add(new SetCardInfo("Gleeful Demolition", 134, Rarity.UNCOMMON, mage.cards.g.GleefulDemolition.class));