Implemented Chariot of the Sun

This commit is contained in:
Evan Kranzler 2018-06-05 17:52:33 -04:00
parent 291f14dea1
commit 0eb1825e16
2 changed files with 83 additions and 0 deletions

View file

@ -0,0 +1,82 @@
package mage.cards.c;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.SubLayer;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetControlledCreaturePermanent;
/**
*
* @author TheElk801
*/
public final class ChariotOfTheSun extends CardImpl {
public ChariotOfTheSun(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
// {2}, {tap}: Until end of turn, target creature you control gains flying and its toughness becomes 1.
Ability ability = new SimpleActivatedAbility(
new GainAbilityTargetEffect(
FlyingAbility.getInstance(),
Duration.EndOfTurn,
"until end of turn, target creature you control gains flying"
),
new GenericManaCost(2)
);
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetControlledCreaturePermanent());
ability.addEffect(new ChariotOfTheSunEffect());
this.addAbility(ability);
}
public ChariotOfTheSun(final ChariotOfTheSun card) {
super(card);
}
@Override
public ChariotOfTheSun copy() {
return new ChariotOfTheSun(this);
}
}
class ChariotOfTheSunEffect extends ContinuousEffectImpl {
public ChariotOfTheSunEffect() {
super(Duration.EndOfTurn, Layer.PTChangingEffects_7, SubLayer.SetPT_7b, Outcome.UnboostCreature);
staticText = "and its toughness becomes 1";
}
public ChariotOfTheSunEffect(final ChariotOfTheSunEffect effect) {
super(effect);
}
@Override
public ChariotOfTheSunEffect copy() {
return new ChariotOfTheSunEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
if (permanent == null) {
this.discard();
return false;
}
permanent.getToughness().setValue(1);
return true;
}
}

View file

@ -65,6 +65,7 @@ public final class Mirage extends ExpansionSet {
cards.add(new SetCardInfo("Chaos Charm", 163, Rarity.COMMON, mage.cards.c.ChaosCharm.class));
cards.add(new SetCardInfo("Chaosphere", 164, Rarity.RARE, mage.cards.c.Chaosphere.class));
cards.add(new SetCardInfo("Charcoal Diamond", 296, Rarity.UNCOMMON, mage.cards.c.CharcoalDiamond.class));
cards.add(new SetCardInfo("Chariot of the Sun", 262, Rarity.UNCOMMON, mage.cards.c.ChariotOfTheSun.class));
cards.add(new SetCardInfo("Choking Sands", 113, Rarity.COMMON, mage.cards.c.ChokingSands.class));
cards.add(new SetCardInfo("Cinder Cloud", 165, Rarity.UNCOMMON, mage.cards.c.CinderCloud.class));
cards.add(new SetCardInfo("Civic Guildmage", 7, Rarity.COMMON, mage.cards.c.CivicGuildmage.class));