Add cards that have Ascend ability (#1510)

* Add Deadeye Brawler

* Add Pride of Conquerors

* Add Secrets of the Golden City

* Add status to Radiant Destiny

* Add Wayward Swordtooth

* Add Snubhorn Sentry

* Add Dusk Charger

* Add Spire Winder

* Add Skymarcher Aspirant

* Add Resplendent Griffin

* Add groovy code for Pride of Conquerors

* Add Storm Fleet Swashbuckler

* Add Mausoleum Harpy

* Add Tendershoot Dryad

* Add Orazca Relic

* Add Slippery Scoundrel

* Add Arch of Orazca

* Add Timestream Navigator

* Fix addEvent in Pride of Conquerors

* Add ride to Orazca Relic

* Add put self on bottom of owner's library to MagicCostEvent

* Cast source to MagicPermanent

* Add groovy script for Secrets of the Golden City

* Add Twilight Prophet

* Add Kumena's Awakening

* Add Expel from Orazca

* Add Golden Demise

* Fix may choice in Expel from Orazca

* Fix missing parenthesis

* Add missing player local variable in Golden Demise

* Add Tilonalli's Summoner

* Fix playmod in Tilonalli's Summoner

* Add Vona's Hunger

* Change timing of Pride of Conquerors to Pump

* Add removal of exile trigger in Tilonalli's Summoner

* Convert the half number of permanents in Vona's Hunger to integer

* Add checking event.getChosen().length in Expel from Orazca

This avoids ArrayIndexOutOfBoundException in event.isYes()
master
Ada Joule 2018-03-20 08:38:52 +07:00 committed by Melvin Zhang
parent 583813407f
commit acf6d97960
33 changed files with 338 additions and 14 deletions

View File

@ -0,0 +1,46 @@
def action = {
final MagicGame game, final MagicEvent event ->
final MagicLocationType toLocation = event.getChosen().length > 0 && event.isYes() ?
MagicLocationType.TopOfOwnersLibrary :
MagicLocationType.OwnersHand;
game.doAction(new RemoveFromPlayAction(event.getRefPermanent(), toLocation));
}
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
NEG_TARGET_NONLAND_PERMANENT,
this,
"Ascend. Return target nonland permanent\$ to its owner's hand."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
game.addEvent(MagicRuleEventAction.create("ascend").getEvent(event));
event.processTargetPermanent(game, {
if (event.getPlayer().hasState(MagicPlayerState.CitysBlessing)) {
game.addEvent(new MagicEvent(
event.getSource(),
new MagicMayChoice("Put that permanent on top of its owner's library instead?"),
it,
action,
"If PN has the city's blessing, " +
"PN may\$ put that permanent on top of its owner's library instead."
));
} else {
game.addEvent(new MagicEvent(
event.getSource(),
it,
action,
""
));
}
});
}
}
]

View File

@ -4,6 +4,6 @@ value=2.500
rarity=U
type=Instant
cost={1}{U}
effect=Ascend~Return target nonland permanent to its owner's hand. If you have the city's blessing, you may put that permanent on top of its owner's library instead.
timing=removal
requires_groovy_code
oracle=Ascend\nReturn target nonland permanent to its owner's hand. If you have the city's blessing, you may put that permanent on top of its owner's library instead.

View File

@ -0,0 +1,33 @@
def action = {
final MagicGame game, final MagicEvent event ->
final MagicPlayer player = event.getPlayer();
final Control control = player.hasState(MagicPlayerState.CitysBlessing) ? Control.Opp : Control.Any;
permanent(MagicType.Creature, control).filter(player).each {
game.doAction(new ChangeTurnPTAction(it, -2, -2));
}
}
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
this,
"Ascend."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
game.addEvent(MagicRuleEventAction.create("ascend").getEvent(event));
game.addEvent(new MagicEvent(
event.getSource(),
action,
"All creatures get -2/-2 until end of turn. " +
"If PN has the city's blessing, instead only creatures PN's opponent controls get -2/-2 until end of turn."
));
}
}
]

View File

@ -4,6 +4,6 @@ value=2.500
rarity=U
type=Sorcery
cost={1}{B}{B}
effect=Ascend~All creatures get -2/-2 until end of turn. If you have the city's blessing, instead only creatures your opponents control get -2/-2 until end of turn.
timing=main
requires_groovy_code
oracle=Ascend\nAll creatures get -2/-2 until end of turn. If you have the city's blessing, instead only creatures your opponents control get -2/-2 until end of turn.

View File

@ -0,0 +1,27 @@
[
new AtUpkeepTrigger() {
@Override
public boolean accept(final MagicPermanent permanent, final MagicPlayer player) {
return permanent.isController(player);
}
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent, final MagicPlayer player) {
return new MagicEvent(
permanent,
this,
player.hasState(MagicPlayerState.CitysBlessing) ?
"PN draws a card." :
"Each player draws a card."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final MagicPlayer player = event.getPlayer();
game.doAction(new DrawAction(player));
if (!player.hasState(MagicPlayerState.CitysBlessing))
game.doAction(new DrawAction(player.getOpponent()));
}
}
]

View File

@ -4,7 +4,7 @@ value=2.500
rarity=R
type=Enchantment
cost={2}{U}{U}
ability=Ascend;\
At the beginning of your upkeep, each player draws a card. If you have the city's blessing, instead only you draw a card.
ability=Ascend
timing=enchantment
requires_groovy_code
oracle=Ascend\nAt the beginning of your upkeep, each player draws a card. If you have the city's blessing, instead only you draw a card.

View File

@ -6,6 +6,6 @@ type=Artifact
cost={3}
ability=Ascend;\
{T}: Add {C} to your mana pool.;\
{T}, Sacrifice SN: You gain 3 life and draw a card. Activate this ability only if you have the city's blessing.
{T}, Sacrifice SN: You gain 3 life~and draw a card. Activate this ability only if you have the city's blessing.
timing=artifact
oracle=Ascend\n{T}: Add {C} to your mana pool.\n{T}, Sacrifice Orazca Relic: You gain 3 life and draw a card. Activate this ability only if you have the city's blessing.

View File

@ -0,0 +1,32 @@
def action = {
final MagicGame game, final MagicEvent event ->
final MagicPlayer player = event.getPlayer();
final int amount = player.hasState(MagicPlayerState.CitysBlessing) ? 2 : 1;
CREATURE_YOU_CONTROL.filter(player).each {
game.doAction(new ChangeTurnPTAction(it, amount, amount));
}
}
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
this,
"Ascend."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
game.addEvent(MagicRuleEventAction.create("ascend").getEvent(event));
game.addEvent(new MagicEvent(
event.getSource(),
action,
"Creatures PN controls get +1/+1 until end of turn. " +
"If PN has the city's blessing, those creatures get +2/+2 until end of turn instead."
));
}
}
]

View File

@ -4,6 +4,6 @@ value=2.500
rarity=U
type=Instant
cost={1}{W}
effect=Ascend~Creatures you control get +1/+1 until end of turn. If you have the city's blessing, those creatures get +2/+2 until end of turn instead.
timing=removal
timing=pump
requires_groovy_code
oracle=Ascend\nCreatures you control get +1/+1 until end of turn. If you have the city's blessing, those creatures get +2/+2 until end of turn instead.

View File

@ -0,0 +1,31 @@
def action = {
final MagicGame game, final MagicEvent event ->
final MagicPlayer player = event.getPlayer();
final int amount = player.hasState(MagicPlayerState.CitysBlessing) ? 3 : 2;
game.doAction(new DrawAction(player, amount));
}
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
this,
"Ascend."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
game.addEvent(MagicRuleEventAction.create("ascend").getEvent(event));
game.addEvent(new MagicEvent(
event.getSource(),
action,
"PN draws two cards." +
"If PN has the city's blessing, PN draws three cards instead."
));
}
}
]

View File

@ -4,6 +4,6 @@ value=2.500
rarity=C
type=Sorcery
cost={1}{U}{U}
effect=Ascend~Draw two cards. If you have the city's blessing, draw three cards instead.
timing=main
requires_groovy_code
oracle=Ascend\nDraw two cards. If you have the city's blessing, draw three cards instead.

View File

@ -0,0 +1,51 @@
def trigger = new AtEndOfTurnTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer eotPlayer) {
return new MagicEvent(
permanent,
this,
"Exile SN unless PN has the city's blessing."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (!event.getPlayer().hasState(MagicPlayerState.CitysBlessing)) {
game.doAction(new RemoveFromPlayAction(event.getPermanent(), MagicLocationType.Exile));
}
game.doAction(new RemoveTriggerAction(event.getPermanent(), this));
}
}
def playMod = {
final MagicGame game, final MagicPermanent perm ->
game.doAction(new AddTriggerAction(perm, trigger));
}
[
new ThisAttacksTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent, final MagicPermanent attacker) {
return new MagicEvent(
permanent,
new MagicMayChoice(new MagicPayManaCostChoice(MagicManaCost.create("{X}{R}"))),
this,
"PN may\$ pay {X}{R}\$. " +
"If PN does, create X 1/1 red Elemental creature tokens that are tapped and attacking."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.isYes()) {
event.getPaidMana().getX().times {
game.doAction(new PlayTokenAction(
event.getPlayer(),
CardDefinitions.getToken("1/1 red Elemental creature token"),
MagicPlayMod.TAPPED_AND_ATTACKING,
playMod
));
}
}
}
}
]

View File

@ -6,7 +6,7 @@ type=Creature
subtype=Human,Shaman
cost={1}{R}
pt=1/1
ability=Ascend;\
Whenever SN attacks, you may pay {X}{R}. If you do, create X 1/1 red Elemental creature tokens that are tapped and attacking. At the beginning of the next end step, exile those tokens unless you have the city's blessing.
ability=Ascend
timing=main
requires_groovy_code
oracle=Ascend\nWhenever Tilonalli's Summoner attacks, you may pay {X}{R}. If you do, create X 1/1 red Elemental creature tokens that are tapped and attacking. At the beginning of the next end step, exile those tokens unless you have the city's blessing.

View File

@ -0,0 +1,30 @@
[
new AtUpkeepTrigger() {
@Override
public boolean accept(final MagicPermanent permanent, final MagicPlayer player) {
return permanent.isController(player) && player.hasState(MagicPlayerState.CitysBlessing);
}
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent, final MagicPlayer player) {
return new MagicEvent(
permanent,
this,
"PN reveals the top card of PN's library and put it into PN's hand. " +
"Each of PN's opponents loses X life and PN gains X life, " +
"where X is that card's converted mana cost."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final MagicPlayer player = event.getPlayer();
player.getLibrary().getCardsFromTop(1).each {
game.doAction(new RevealAction(it));
game.doAction(new ShiftCardAction(it, MagicLocationType.OwnersLibrary, MagicLocationType.OwnersHand));
final int amount = it.getConvertedCost();
game.doAction(new ChangeLifeAction(player.getOpponent(), -amount));
game.doAction(new ChangeLifeAction(player, amount));
}
}
}
]

View File

@ -7,7 +7,7 @@ subtype=Vampire,Cleric
cost={2}{B}{B}
pt=2/4
ability=Flying;\
Ascend;\
At the beginning of your upkeep, if you have the city's blessing, reveal the top card of your library and put it into your hand. Each opponent loses X life and you gain X life, where X is that card's converted mana cost.
Ascend
timing=main
requires_groovy_code
oracle=Flying\nAscend\nAt the beginning of your upkeep, if you have the city's blessing, reveal the top card of your library and put it into your hand. Each opponent loses X life and you gain X life, where X is that card's converted mana cost.

View File

@ -0,0 +1,43 @@
def action = {
final MagicGame game, final MagicEvent event ->
final MagicPlayer opponent = event.getPlayer();
final int amount = event.getSource().getController().hasState(MagicPlayerState.CitysBlessing) ?
(opponent.getNrOfPermanents(MagicType.Creature) + 1).intdiv(2).toInteger() :
1;
amount.times {
game.addEvent(new MagicSacrificePermanentEvent(
event.getSource(),
opponent,
SACRIFICE_CREATURE
));
}
}
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
this,
"Ascend."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
game.addEvent(MagicRuleEventAction.create("ascend").getEvent(event));
final MagicPlayer opponent = event.getSource().getOpponent();
game.addEvent(new MagicEvent(
event.getSource(),
opponent,
event.getPlayer(),
action,
"PN sacrifices a creature. " +
"If RN has the city's blessing, instead PN sacrifices half the creatures PN controls, rounded up."
));
}
}
]

View File

@ -4,6 +4,6 @@ value=2.500
rarity=R
type=Instant
cost={2}{B}
effect=Ascend~Each opponent sacrifices a creature. If you have the city's blessing, instead each opponent sacrifices half the creatures he or she controls, rounded up.
timing=removal
requires_groovy_code
oracle=Ascend\nEach opponent sacrifices a creature. If you have the city's blessing, instead each opponent sacrifices half the creatures he or she controls, rounded up.

View File

@ -7,7 +7,7 @@ subtype=Dinosaur
cost={2}{G}
pt=5/5
ability=Ascend;\
You may play an additional land on each of your turns.;\
SN can't attack or block unless you have the city's blessing.
timing=main
requires_groovy_code=Exploration
oracle=Ascend\nYou may play an additional land on each of your turns.\nWayward Swordtooth can't attack or block unless you have the city's blessing.

View File

@ -9,3 +9,4 @@ ability=Ascend;\
Creatures you control of the chosen type get +1/+1. As long as you have the city's blessing, they also have vigilance.
timing=enchantment
oracle=Ascend\nAs Radiant Destiny enters the battlefield, choose a creature type.\nCreatures you control of the chosen type get +1/+1. As long as you have the city's blessing, they also have vigilance.
status=not supported: choose-creature-type

View File

@ -311,6 +311,16 @@ public enum MagicCostEvent {
public MagicEvent toEvent(final Matcher arg, final MagicSource source) {
return new MagicProcessorEvent(source);
}
},
PutSelfOnBottomLibrary("Put SN on the bottom of its owner's library") {
@Override
public MagicEvent toEvent(final Matcher arg, final MagicSource source) {
return new MagicPutOnBottomLibraryEvent((MagicPermanent)source);
}
@Override
public boolean isIndependent() {
return false;
}
}
;

View File

@ -0,0 +1,20 @@
package magic.model.event;
import magic.model.MagicGame;
import magic.model.MagicLocationType;
import magic.model.MagicPermanent;
import magic.model.action.RemoveFromPlayAction;
public class MagicPutOnBottomLibraryEvent extends MagicEvent {
public MagicPutOnBottomLibraryEvent(final MagicPermanent permanent) {
super(
permanent,
EVENT_ACTION,
"Put SN on the bottom of its owner's library."
);
}
private static final MagicEventAction EVENT_ACTION = (final MagicGame game, final MagicEvent event) ->
game.doAction(new RemoveFromPlayAction(event.getPermanent(),MagicLocationType.BottomOfOwnersLibrary));
}