mirror of
https://github.com/correl/mage.git
synced 2024-11-14 19:19:32 +00:00
[AFC] Implemented Valiant Endeavor (#8035)
* [AFC] implemented Valiant Endeavor * matching existing implementation
This commit is contained in:
parent
f8d030bef4
commit
5e08c5d279
2 changed files with 104 additions and 0 deletions
103
Mage.Sets/src/mage/cards/v/ValiantEndeavor.java
Normal file
103
Mage.Sets/src/mage/cards/v/ValiantEndeavor.java
Normal file
|
@ -0,0 +1,103 @@
|
|||
package mage.cards.v;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CreateTokenTargetEffect;
|
||||
import mage.abilities.effects.common.DestroyAllEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.choices.Choice;
|
||||
import mage.choices.ChoiceImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ComparisonType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.PowerPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.token.KnightToken;
|
||||
import mage.players.Player;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author zeffirojoe
|
||||
*/
|
||||
public final class ValiantEndeavor extends CardImpl {
|
||||
|
||||
public ValiantEndeavor(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[] { CardType.SORCERY }, "{4}{W}{W}");
|
||||
|
||||
// Roll two d6 and choose on result. Destroy each creature with power greater
|
||||
// than or equal to that result. Then create a number of 2/2 white Knight
|
||||
// creature tokens with vigilance equal to the other result.
|
||||
this.getSpellAbility().addEffect(new ValiantEndeavorEffect());
|
||||
}
|
||||
|
||||
private ValiantEndeavor(final ValiantEndeavor card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ValiantEndeavor copy() {
|
||||
return new ValiantEndeavor(this);
|
||||
}
|
||||
}
|
||||
|
||||
class ValiantEndeavorEffect extends OneShotEffect {
|
||||
|
||||
ValiantEndeavorEffect() {
|
||||
super(Outcome.PutCardInPlay);
|
||||
this.staticText = "Roll two d6 and choose one result. Destroy each creature with power greater than or equal to that result."
|
||||
+ "Then create a number of 2/2/ white Knight creature tokens with vigilance equal to the other result.";
|
||||
}
|
||||
|
||||
private ValiantEndeavorEffect(final ValiantEndeavorEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ValiantEndeavorEffect copy() {
|
||||
return new ValiantEndeavorEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
List<Integer> results = controller.rollDice(source, game, 6, 2);
|
||||
int firstResult = results.get(0);
|
||||
int secondResult = results.get(1);
|
||||
int first, second;
|
||||
if (firstResult != secondResult
|
||||
&& controller.chooseUse(outcome, "Destroy each creature with power greater than or equal to your choice",
|
||||
"The other number will be the amount of 2/2 white Knight tokens with vigilance.",
|
||||
"" + firstResult, "" + secondResult, source, game)) {
|
||||
first = firstResult;
|
||||
second = secondResult;
|
||||
} else {
|
||||
first = secondResult;
|
||||
second = firstResult;
|
||||
}
|
||||
|
||||
final FilterCreaturePermanent filter = new FilterCreaturePermanent(
|
||||
String.format("creatures with power greater than or equal to %s", first));
|
||||
filter.add(new PowerPredicate(ComparisonType.MORE_THAN, first - 1));
|
||||
|
||||
Effect wrathEffect = new DestroyAllEffect(filter);
|
||||
wrathEffect.apply(game, source);
|
||||
|
||||
Effect tokenEffect = new CreateTokenTargetEffect(new KnightToken(), second);
|
||||
tokenEffect.setTargetPointer(new FixedTarget(controller.getId()));
|
||||
tokenEffect.apply(game, source);
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
|
@ -265,6 +265,7 @@ public final class ForgottenRealmsCommander extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Unstable Obelisk", 220, Rarity.UNCOMMON, mage.cards.u.UnstableObelisk.class));
|
||||
cards.add(new SetCardInfo("Utopia Sprawl", 172, Rarity.UNCOMMON, mage.cards.u.UtopiaSprawl.class));
|
||||
cards.add(new SetCardInfo("Utter End", 195, Rarity.RARE, mage.cards.u.UtterEnd.class));
|
||||
cards.add(new SetCardInfo("Valiant Endeavor", 13, Rarity.RARE, mage.cards.v.ValiantEndeavor.class));
|
||||
cards.add(new SetCardInfo("Valorous Stance", 76, Rarity.UNCOMMON, mage.cards.v.ValorousStance.class));
|
||||
cards.add(new SetCardInfo("Vandalblast", 148, Rarity.UNCOMMON, mage.cards.v.Vandalblast.class));
|
||||
cards.add(new SetCardInfo("Vanish into Memory", 196, Rarity.UNCOMMON, mage.cards.v.VanishIntoMemory.class));
|
||||
|
|
Loading…
Reference in a new issue