added Quest for Renewal

master
beholder 2011-09-09 10:59:50 +02:00
parent 96b4ca22de
commit f7334bcac8
2 changed files with 79 additions and 0 deletions

View File

@ -5958,6 +5958,16 @@ converted=4
cost={2}{B}{B}
timing=removal
>Quest for Renewal
image=http://magiccards.info/scans/en/wwk/110.jpg
value=3
rarity=U
type=Enchantment
color=g
converted=2
cost={1}{G}
timing=enchantment
>Elephant Guide
image=http://magiccards.info/scans/en/gvl/18.jpg
value=4

View File

@ -0,0 +1,69 @@
package magic.card;
import java.util.Collection;
import magic.model.MagicCounterType;
import magic.model.MagicGame;
import magic.model.MagicPermanent;
import magic.model.MagicPlayer;
import magic.model.action.MagicChangeCountersAction;
import magic.model.action.MagicUntapAction;
import magic.model.event.MagicEvent;
import magic.model.target.MagicTarget;
import magic.model.target.MagicTargetFilter;
import magic.model.trigger.MagicAtUpkeepTrigger;
import magic.model.trigger.MagicWhenBecomesTappedTrigger;
public class Quest_for_Renewal {
public static final MagicWhenBecomesTappedTrigger T1 = new MagicWhenBecomesTappedTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent data) {
final MagicPlayer player = permanent.getController();
return (data.getController() == player && data.isCreature()) ?
new MagicEvent(
permanent,
player,
new Object[]{permanent},
this,
"Put a quest counter on " + permanent + ".") :
MagicEvent.NONE;
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object data[],
final Object[] choiceResults) {
game.doAction(new MagicChangeCountersAction((MagicPermanent)data[0],MagicCounterType.Charge,1,true));
}
};
public static final MagicAtUpkeepTrigger T2 = new MagicAtUpkeepTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer data) {
final MagicPlayer player = permanent.getController();
return (player != data &&
permanent.getCounters(MagicCounterType.Charge) >= 4) ?
new MagicEvent(
permanent,
player,
new Object[]{player},
this,
"Untap all creatures you control."):
MagicEvent.NONE;
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object[] data,
final Object[] choiceResults) {
final MagicPlayer player = (MagicPlayer)data[0];
final Collection<MagicTarget> targets =
game.filterTargets(player,MagicTargetFilter.TARGET_CREATURE_YOU_CONTROL);
for (final MagicTarget target : targets) {
game.doAction(new MagicUntapAction((MagicPermanent)target));
}
}
};
}