New Card Scripts + Groovy

master
ShawnieBoy 2014-01-04 01:03:42 +00:00
parent 7bb2be2e5c
commit aff66014d5
19 changed files with 319 additions and 0 deletions

View File

@ -0,0 +1,20 @@
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
this,
"Return all attacking creatures to their owners' hands."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final Collection<MagicPermanent> targets=
game.filterPermanents(event.getPlayer(),MagicTargetFilter.TARGET_ATTACKING_CREATURE);
for (final MagicPermanent target : targets) {
game.doAction(new MagicRemoveFromPlayAction(target,MagicLocationType.OwnersHand));
}
}
}
]

View File

@ -0,0 +1,9 @@
name=Aetherize
url=http://magiccards.info/gtc/en/29.html
image=http://mtgimage.com/card/aetherize.jpg
value=3.711
rarity=U
type=Instant
cost={3}{U}
timing=removal
requires_groovy_code

View File

@ -0,0 +1,23 @@
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack, final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
MagicTargetChoice.POS_TARGET_CREATURE,
MagicPumpTargetPicker.create(),
this,
"Target creature\$ gets +1/+1 and gains flying and first strike until end of turn."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game, {
final MagicPermanent creature ->
game.doAction(new MagicGainAbilityAction(creature, MagicAbility.Flying));
game.doAction(new MagicGainAbilityAction(creature, MagicAbility.FirstStrike));
game.doAction(new MagicChangeTurnPTAction(creature, 1, 1));
});
}
}
]

View File

@ -0,0 +1,9 @@
name=Aerial Maneuver
url=http://magiccards.info/gtc/en/1.html
image=http://mtgimage.com/card/aerial%20maneuver.jpg
value=2.6
rarity=C
type=Instant
cost={1}{W}
timing=pump
requires_groovy_code

View File

@ -0,0 +1,23 @@
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack, final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
MagicTargetChoice.NEG_TARGET_CREATURE_WITH_FLYING,
MagicDestroyTargetPicker.Destroy,
this,
"Destroy target creature\$ with flying. " +
"PN gains 2 life."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game, {
final MagicPermanent creature ->
game.doAction(new MagicDestroyAction(creature));
game.doAction(new MagicChangeLifeAction(event.getPlayer(),2));
});
}
}
]

View File

@ -0,0 +1,9 @@
name=Aerial Predation
url=http://magiccards.info/rtr/en/113.html
image=http://mtgimage.com/card/aerial%20predation.jpg
value=1.942
rarity=C
type=Instant
cost={2}{G}
timing=removal
requires_groovy_code

View File

@ -0,0 +1,24 @@
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack, final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
MagicColorChoice.ALL_INSTANCE,
this,
"Choose a color\$. " +
"Creatures PN controls have protection from the chosen color until end of turn."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final MagicColor color = event.getChosenColor();
final MagicAbility protection = color.getProtectionAbility();
final Collection<MagicPermanent> targets =
game.filterPermanents(event.getPlayer(),MagicTargetFilter.TARGET_CREATURE_YOU_CONTROL);
for (final MagicPermanent target : targets) {
game.doAction(new MagicGainAbilityAction(target, protection));
}
}
}
]

View File

@ -0,0 +1,10 @@
name=Akroma's Blessing
url=http://magiccards.info/on/en/1.html
image=http://mtgimage.com/card/akroma's%20blessing.jpg
value=3.766
rarity=U
type=Instant
cost={2}{W}
ability=cycling {W}
timing=pump
requires_groovy_code

View File

@ -0,0 +1,10 @@
name=Altar's Reap
url=http://magiccards.info/m14/en/84.html
image=http://mtgimage.com/card/altar's%20reap.jpg
value=3.675
rarity=C
type=Instant
cost={1}{B}
effect=PN draws two cards.
timing=draw
requires_groovy_code=Bone Splinters

View File

@ -0,0 +1,20 @@
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
this,
"Blocking creatures gain first strike until end of turn."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final Collection<MagicPermanent> targets=
game.filterPermanents(event.getPlayer(),MagicTargetFilter.TARGET_BLOCKING_CREATURE);
for (final MagicPermanent target : targets) {
game.doAction(new MagicGainAbilityAction(target, MagicAbility.FirstStrike));
}
}
}
]

View File

@ -0,0 +1,9 @@
name=Ambush
url=http://magiccards.info/hl/en/78.html
image=http://mtgimage.com/card/ambush.jpg
value=1.817
rarity=C
type=Instant
cost={3}{R}
timing=pump
requires_groovy_code

View File

@ -0,0 +1,34 @@
def PT = new MagicStatic(MagicLayer.SetPT, MagicStatic.UntilEOT) {
@Override
public void modPowerToughness(final MagicPermanent source,final MagicPermanent permanent,final MagicPowerToughness pt) {
pt.set(3,3);
}
};
def ST = new MagicStatic(MagicLayer.Type, MagicStatic.UntilEOT) {
@Override
public int getTypeFlags(final MagicPermanent permanent,final int flags) {
return flags|MagicType.Creature.getMask();
}
};
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack, final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
MagicTargetChoice.POS_TARGET_LAND,
this,
"Target land\$ becomes a 3/3 creature until end of turn."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game, {
final MagicPermanent land ->
game.doAction(new MagicBecomesCreatureAction(land,PT,ST));
});
}
}
]

View File

@ -0,0 +1,9 @@
name=Animate Land
url=http://magiccards.info/ne/en/101.html
image=http://mtgimage.com/card/animate%20land.jpg
value=3.961
rarity=U
type=Instant
cost={G}
timing=pump
requires_groovy_code

View File

@ -0,0 +1,29 @@
def ST = new MagicStatic(MagicLayer.Type, MagicStatic.UntilEOT) {
@Override
public int getTypeFlags(final MagicPermanent permanent,final int flags) {
return flags|MagicType.Artifact.getMask();
}
};
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack, final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
MagicTargetChoice.TARGET_PERMANENT,
this,
"Target permanent\$ becomes an artifact in addition to its other types until end of turn. " +
"PN draws a card."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game, {
final MagicPermanent land ->
game.doAction(new MagicAddStaticAction(land, ST));
game.doAction(new MagicDrawAction(event.getPlayer()));
});
}
}
]

View File

@ -0,0 +1,9 @@
name=Argent Mutation
url=http://magiccards.info/nph/en/27.html
image=http://mtgimage.com/card/argent%20mutation.jpg
value=1.766
rarity=U
type=Instant
cost={2}{U}
timing=pump
requires_groovy_code

View File

@ -0,0 +1,28 @@
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
MagicTargetChoice.NEG_TARGET_ATTACKING_CREATURE,
this,
"SN deals damage to target attacking creature\$ equal to the" +
"number of Equipment PN controls."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final MagicPlayer player = event.getPlayer();
final int amount = player.getNrOfPermanents(MagicSubType.Equipment);
event.processTargetPermanent(game, {
final MagicPermanent creature ->
final MagicDamage damage = new MagicDamage(
event.getSource(),
creature,
amount
);
game.doAction(new MagicDealDamageAction(damage));
});
}
}
]

View File

@ -0,0 +1,9 @@
name=Armed Response
url=http://magiccards.info/5dn/en/2.html
image=http://mtgimage.com/card/armed%20response.jpg
value=1.597
rarity=C
type=Instant
cost={2}{W}
timing=removal
requires_groovy_code

View File

@ -0,0 +1,25 @@
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
MagicTargetChoice.TARGET_ENCHANTMENT,
MagicBounceTargetPicker.create(),
this,
"Put target enchantment\$ on top of its owner's library."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game, {
final MagicPermanent enchantment ->
game.doAction(new MagicRemoveFromPlayAction(
enchantment,
MagicLocationType.TopOfOwnersLibrary
));
});
}
}
]

View File

@ -0,0 +1,10 @@
name=Aura Extraction
url=http://magiccards.info/on/en/5.html
image=http://mtgimage.com/card/aura%20extraction.jpg
value=2.312
rarity=U
type=Instant
cost={1}{W}
ability=cycling {2}
timing=removal
requires_groovy_code