normalize card scripts

master
melvin 2014-08-08 09:07:13 +08:00
commit 92c726ecdc
17 changed files with 138 additions and 19 deletions

View File

@ -471,7 +471,6 @@ find_nulls: $(MAG)
# meta check
checks: \
check_missing \
check_aura \
check_requires_groovy_code \
check_script_name \
@ -486,8 +485,8 @@ checks: \
check_rarity \
check_decks
check_missing:
join <(ls -1 release/Magarena/scripts | sort) <(ls -1 release/Magarena/scripts_missing | sort) | ${NO_OUTPUT}
remove_extra_missing:
hg rm `join <(ls -1 release/Magarena/scripts | sort) <(ls -1 release/Magarena/scripts_missing | sort)`
# check rarity using meta.xml
check_rarity: scripts/fix_rarity.scala cards/meta.xml
@ -668,6 +667,8 @@ normalize_files:
make img-mtgimage
# use magiccard.info query for text
make url-magiccard
# remove extra scripts_missing
-make remove_extra_missing
%.post:
@echo "[img]"`grep -o "http.*jpg" release/Magarena/scripts/$*.txt`"[/img]"

View File

@ -5,7 +5,7 @@ rarity=C
type=Enchantment
subtype=Aura
cost={1}{W}{W}
ability=Enchant creature;\
Enchanted creature gets +1/+1 for each card in your hand.
timing=main
timing=aura
enchant=pump,pos creature
requires_groovy_code=Empyrial_Plate
oracle=Enchant creature. Enchanted creature gets +1/+1 for each card in your hand.

View File

@ -4,6 +4,6 @@ value=2.500
rarity=R
type=Artifact
cost={3}
ability=At the beginning of each opponent's upkeep, SN deals X damage to that player, where X is the number of cards in his or her hand minus 4.
timing=main
timing=smain
requires_groovy_code=Viseling
oracle=At the beginning of each opponent's upkeep, Iron Maiden deals X damage to that player, where X is the number of cards in his or her hand minus 4.

View File

@ -0,0 +1,20 @@
[
new MagicStatic(
MagicLayer.SetPT,
MagicTargetFilterFactory.LAND
) {
@Override
public void modPowerToughness(final MagicPermanent source,final MagicPermanent permanent,final MagicPowerToughness pt) {
pt.set(2,2);
}
},
new MagicStatic(
MagicLayer.Type,
MagicTargetFilterFactory.LAND
) {
@Override
public int getTypeFlags(final MagicPermanent permanent,final int flags) {
return flags|MagicType.Creature.getMask();
}
}
]

View File

@ -4,6 +4,6 @@ value=2.500
rarity=R
type=Enchantment
cost={3}{G}{G}
ability=All lands are 2/2 creatures that are still lands.
timing=main
requires_groovy_code
oracle=All lands are 2/2 creatures that are still lands.

View File

@ -0,0 +1,26 @@
[
new MagicAtUpkeepTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game, final MagicPermanent permanent, final MagicPlayer player) {
return permanent.isOpponent(player) ?
new MagicEvent(
permanent,
player,
this,
"SN deals X damage to PN, where X is 3 minus the number of cards in his or her hand."
):
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final MagicPlayer player = event.getPlayer();
final int amount = 3 - player.getHandSize();
final MagicDamage damage = new MagicDamage(
event.getSource(),
player,
amount
);
game.doAction(new MagicDealDamageAction(damage));
}
}
]

View File

@ -6,6 +6,6 @@ type=Artifact,Creature
subtype=Construct
cost={4}
pt=2/2
ability=At the beginning of each opponent's upkeep, SN deals X damage to that player, where X is 3 minus the number of cards in his or her hand.
timing=main
requires_groovy_code
oracle=At the beginning of each opponent's upkeep, Rackling deals X damage to that player, where X is 3 minus the number of cards in his or her hand.

View File

@ -4,6 +4,6 @@ value=2.500
rarity=U
type=Sorcery
cost={2}{W}
effect=Target creature deals damage to itself equal to its power.
timing=main
timing=removal
requires_groovy_code=Wrack_with_Madness
oracle=Target creature deals damage to itself equal to its power.

View File

@ -0,0 +1,11 @@
[
new MagicWhenOtherComesIntoPlayTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent otherPermanent) {
if (otherPermanent.isArtifact() || otherPermanent.isLand()) {
game.doAction(new MagicTapAction(otherPermanent,false));
}
return MagicEvent.NONE;
}
}
]

View File

@ -4,6 +4,6 @@ value=2.500
rarity=R
type=Enchantment
cost={G}
ability=Artifacts and lands enter the battlefield tapped.
timing=main
requires_groovy_code
oracle=Artifacts and lands enter the battlefield tapped.

View File

@ -0,0 +1,24 @@
[
new MagicAtUpkeepTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game, final MagicPermanent permanent, final MagicPlayer upkeepPlayer) {
return new MagicEvent(
permanent,
upkeepPlayer,
this,
"SN deals X damage to PN, where X is 4 minus the number of cards in his or her hand."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final MagicPlayer player = event.getPlayer();
final int amount = 4 - player.getHandSize();
final MagicDamage damage = new MagicDamage(
event.getSource(),
player,
amount
);
game.doAction(new MagicDealDamageAction(damage));
}
}
]

View File

@ -4,6 +4,6 @@ value=2.500
rarity=R
type=World,Enchantment
cost={R}
ability=At the beginning of each player's upkeep, SN deals X damage to that player, where X is 4 minus the number of cards in his or her hand.
timing=main
timing=smain
requires_groovy_code
oracle=At the beginning of each player's upkeep, Storm World deals X damage to that player, where X is 4 minus the number of cards in his or her hand.

View File

@ -0,0 +1,11 @@
[
new MagicWhenOtherComesIntoPlayTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent otherPermanent) {
if (otherPermanent.isEnemy(permanent) && otherPermanent.isCreature()) {
game.doAction(new MagicTapAction(otherPermanent,false));
}
return MagicEvent.NONE;
}
}
]

View File

@ -4,6 +4,6 @@ value=2.500
rarity=U
type=Enchantment
cost={2}{R}
ability=Creatures played by your opponents enter the battlefield tapped.
timing=main
requires_groovy_code
oracle=Creatures played by your opponents enter the battlefield tapped.

View File

@ -0,0 +1,26 @@
[
new MagicAtUpkeepTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game, final MagicPermanent permanent, final MagicPlayer player) {
return permanent.isOpponent(player) ?
new MagicEvent(
permanent,
player,
this,
"SN deals X damage to PN, where X is the number of cards in his or her hand minus 4."
):
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final MagicPlayer player = event.getPlayer();
final int amount = player.getHandSize() - 4;
final MagicDamage damage = new MagicDamage(
event.getSource(),
player,
amount
);
game.doAction(new MagicDealDamageAction(damage));
}
}
]

View File

@ -6,6 +6,6 @@ type=Artifact,Creature
subtype=Construct
cost={4}
pt=2/2
ability=At the beginning of each opponent's upkeep, SN deals X damage to that player, where X is the number of cards in his or her hand minus 4.
timing=main
requires_groovy_code
oracle=At the beginning of each opponent's upkeep, Viseling deals X damage to that player, where X is the number of cards in his or her hand minus 4.

View File

@ -4,6 +4,6 @@ value=2.500
rarity=R
type=Artifact
cost={3}
ability=At the beginning of each opponent's upkeep, SN deals X damage to that player, where X is 3 minus the number of cards in his or her hand.
timing=main
timing=smain
requires_groovy_code=Rackling
oracle=At the beginning of each opponent's upkeep, Wheel of Torture deals X damage to that player, where X is 3 minus the number of cards in his or her hand.