forked from External/mage
Implemented Endling
This commit is contained in:
parent
33efe86500
commit
22658ff2cd
2 changed files with 108 additions and 0 deletions
107
Mage.Sets/src/mage/cards/e/Endling.java
Normal file
107
Mage.Sets/src/mage/cards/e/Endling.java
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
package mage.cards.e;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
|
||||
import mage.abilities.keyword.DeathtouchAbility;
|
||||
import mage.abilities.keyword.MenaceAbility;
|
||||
import mage.abilities.keyword.UndyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class Endling extends CardImpl {
|
||||
|
||||
public Endling(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}{B}");
|
||||
|
||||
this.subtype.add(SubType.ZOMBIE);
|
||||
this.subtype.add(SubType.SHAPESHIFTER);
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// {B}: Endling gains menace until end of turn.
|
||||
this.addAbility(new SimpleActivatedAbility(
|
||||
new GainAbilitySourceEffect(
|
||||
new MenaceAbility(),
|
||||
Duration.EndOfTurn
|
||||
), new ManaCostsImpl("{B}")
|
||||
));
|
||||
|
||||
// {B}: Endling gains deathtouch until end of turn.
|
||||
this.addAbility(new SimpleActivatedAbility(
|
||||
new GainAbilitySourceEffect(
|
||||
DeathtouchAbility.getInstance(),
|
||||
Duration.EndOfTurn
|
||||
), new ManaCostsImpl("{B}")
|
||||
));
|
||||
|
||||
// {B}: Endling gains undying until end of turn.
|
||||
this.addAbility(new SimpleActivatedAbility(
|
||||
new GainAbilitySourceEffect(
|
||||
new UndyingAbility(),
|
||||
Duration.EndOfTurn
|
||||
), new ManaCostsImpl("{B}")
|
||||
));
|
||||
|
||||
// {1}: Endling gets +1/-1 or -1/+1 until end of turn.
|
||||
this.addAbility(new SimpleActivatedAbility(
|
||||
new EndlingEffect(),
|
||||
new GenericManaCost(1)
|
||||
));
|
||||
}
|
||||
|
||||
private Endling(final Endling card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Endling copy() {
|
||||
return new Endling(this);
|
||||
}
|
||||
}
|
||||
|
||||
class EndlingEffect extends OneShotEffect {
|
||||
|
||||
EndlingEffect() {
|
||||
super(Outcome.BoostCreature);
|
||||
this.staticText = "{this} gets +1/-1 or -1/+1 until end of turn";
|
||||
}
|
||||
|
||||
private EndlingEffect(final EndlingEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EndlingEffect copy() {
|
||||
return new EndlingEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (player == null || permanent == null) {
|
||||
return false;
|
||||
}
|
||||
int boost = player.chooseUse(outcome, "Give +1/-1 or -1/+1?", null, "+1/-1", "-1/+1", source, game) ? 1 : -1;
|
||||
game.addEffect(new BoostSourceEffect(boost, -1 * boost, Duration.EndOfTurn), source);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -52,6 +52,7 @@ public final class ModernHorizons extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Dregscape Sliver", 88, Rarity.UNCOMMON, mage.cards.d.DregscapeSliver.class));
|
||||
cards.add(new SetCardInfo("Eladamri's Call", 197, Rarity.RARE, mage.cards.e.EladamrisCall.class));
|
||||
cards.add(new SetCardInfo("Elvish Fury", 162, Rarity.COMMON, mage.cards.e.ElvishFury.class));
|
||||
cards.add(new SetCardInfo("Endling", 89, Rarity.RARE, mage.cards.e.Endling.class));
|
||||
cards.add(new SetCardInfo("Enduring Sliver", 8, Rarity.COMMON, mage.cards.e.EnduringSliver.class));
|
||||
cards.add(new SetCardInfo("Etchings of the Chosen", 198, Rarity.UNCOMMON, mage.cards.e.EtchingsOfTheChosen.class));
|
||||
cards.add(new SetCardInfo("Exclude", 48, Rarity.UNCOMMON, mage.cards.e.Exclude.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue