added Experiment One

master
melvin 2013-03-12 13:47:41 +08:00
parent c8268e8982
commit 4d28eda3c5
4 changed files with 55 additions and 3 deletions

View File

@ -0,0 +1,31 @@
[
new MagicPermanentActivation(
[
MagicConditionFactory.PlusOneCounterAtLeast(2),
MagicCondition.CAN_REGENERATE_CONDITION,
],
new MagicActivationHints(MagicTiming.Pump),
"Regen") {
@Override
public MagicEvent[] getCostEvent(final MagicPermanent source) {
return [
new MagicRemoveCounterEvent(source,MagicCounterType.PlusOne,2)
];
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
return new MagicEvent(
source,
this,
"Regenerate SN."
);
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object[] choiceResults) {
game.doAction(new MagicRegenerateAction(event.getPermanent()));
}
}
]

View File

@ -0,0 +1,12 @@
name=Experiment One
url=http://magiccards.info/gtc/en/119.html
image=http://magiccards.info/scans/en/gtc/119.jpg
value=3.059
rarity=U
type=Creature
subtype=Human,Ooze
cost={G}
pt=1/1
ability=evolve
timing=main
requires_groovy_code

View File

@ -25,4 +25,12 @@ public class MagicConditionFactory {
public static MagicCondition ManaCost(String manaCost) {
return MagicManaCost.create(manaCost).getCondition();
}
public static MagicCondition PlusOneCounterAtLeast(final int n) {
return new MagicCondition() {
public boolean accept(final MagicSource source) {
final MagicPermanent permanent = (MagicPermanent)source;
return permanent.getCounters(MagicCounterType.PlusOne) >= n;
}
};
}
}

View File

@ -28,18 +28,19 @@ class TestEvolve extends TestGameBuilder {
P.setLife(20);
addToLibrary(P, "Plains", 10);
createPermanent(game,P,"Rupture Spire",false,8);
addToHand(P, "Shambleshark", 1);
addToHand(P, "Adaptive Snapjaw", 1);
addToHand(P, "Cloudfin Raptor", 1);
addToHand(P, "Crocanura", 1);
addToHand(P, "Clinging Anemones", 1);
addToHand(P, "Elusive Krasis", 1);
addToHand(P, "Experiment One", 1);
P = opponent;
P.setLife(1);
addToLibrary(P, "Plains", 10);
createPermanent(game,P,"Rupture Spire",false,8);
addToHand(P, "Shambleshark", 1);
addToHand(P, "Adaptive Snapjaw", 1);
addToHand(P, "Cloudfin Raptor", 1);
return game;
}