added Skyshroud Ranger

master
beholder 2011-09-22 14:20:09 +02:00
parent e7f91f20c2
commit 69aca9426d
4 changed files with 94 additions and 1 deletions

View File

@ -1,3 +1,15 @@
>Skyshroud Ranger
image=http://magiccards.info/scans/en/10e/297.jpg
value=2
rarity=C
type=Creature
subtype=Elf
color=g
converted=1
cost={G}
pt=1/1
timing=main
>Skyhunter Patrol
image=http://magiccards.info/scans/en/10e/41.jpg
value=3

View File

@ -0,0 +1,67 @@
package magic.card;
import magic.model.MagicCard;
import magic.model.MagicGame;
import magic.model.MagicPayedCost;
import magic.model.MagicPlayer;
import magic.model.MagicLocationType;
import magic.model.MagicPermanent;
import magic.model.MagicSource;
import magic.model.action.MagicCardAction;
import magic.model.action.MagicPlayCardAction;
import magic.model.action.MagicRemoveCardAction;
import magic.model.choice.MagicMayChoice;
import magic.model.choice.MagicTargetChoice;
import magic.model.condition.MagicCondition;
import magic.model.event.MagicActivationHints;
import magic.model.event.MagicEvent;
import magic.model.event.MagicPermanentActivation;
import magic.model.event.MagicTapEvent;
import magic.model.event.MagicTiming;
import magic.model.target.MagicGraveyardTargetPicker;
public class Skyshroud_Ranger {
public static final MagicPermanentActivation A = new MagicPermanentActivation(
new MagicCondition[]{
MagicCondition.CAN_TAP_CONDITION,
MagicCondition.SORCERY_CONDITION},
new MagicActivationHints(MagicTiming.Land),
"Land") {
@Override
public MagicEvent[] getCostEvent(final MagicSource source) {
return new MagicEvent[]{new MagicTapEvent((MagicPermanent)source)};
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
final MagicPlayer player = source.getController();
return new MagicEvent(
source,
player,
new MagicMayChoice(
player + " may put a land card from his or her hand into play.",
MagicTargetChoice.TARGET_LAND_CARD_FROM_HAND),
new MagicGraveyardTargetPicker(true),
new Object[]{player},
this,
player + " may$ put a land card$ from his or her hand into play.");
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object data[],
final Object[] choiceResults) {
if (MagicMayChoice.isYesChoice(choiceResults[0])) {
event.processTargetCard(game,choiceResults,1,new MagicCardAction() {
public void doAction(final MagicCard card) {
game.doAction(new MagicRemoveCardAction(card,MagicLocationType.OwnersHand));
game.doAction(new MagicPlayCardAction(card,(MagicPlayer)data[0],MagicPlayCardAction.NONE));
}
});
}
}
};
}

View File

@ -228,7 +228,11 @@ public class MagicTargetChoice extends MagicChoice {
public static final MagicTargetChoice TARGET_MULTICOLOR_CREATURE_CARD_FROM_HAND =
new MagicTargetChoice(MagicTargetFilter.TARGET_MULTICOLOR_CREATURE_CARD_FROM_HAND,false,MagicTargetHint.None,"a multicolored creature card from your hand");
public static final MagicTargetChoice TARGET_BASIC_LAND_CARD_FROM_HAND =
new MagicTargetChoice(MagicTargetFilter.TARGET_BASIC_LAND_CARD_FROM_HAND,false,MagicTargetHint.None,"a basic land card from your hand");
new MagicTargetChoice(MagicTargetFilter.TARGET_BASIC_LAND_CARD_FROM_HAND,false,MagicTargetHint.None,
"a basic land card from your hand");
public static final MagicTargetChoice TARGET_LAND_CARD_FROM_HAND =
new MagicTargetChoice(MagicTargetFilter.TARGET_LAND_CARD_FROM_HAND,false,MagicTargetHint.None,
"a land card from your hand");
private final String targetDescription;
private final MagicTargetFilter targetFilter;

View File

@ -1217,6 +1217,16 @@ public interface MagicTargetFilter {
}
};
MagicTargetFilter TARGET_LAND_CARD_FROM_HAND = new MagicTargetFilter() {
public boolean accept(final MagicGame game,final MagicPlayer player,final MagicTarget target) {
final MagicCardDefinition cardDefinition = ((MagicCard)target).getCardDefinition();
return cardDefinition.isLand();
}
public boolean acceptType(final MagicTargetType targetType) {
return targetType == MagicTargetType.Hand;
}
};
// Permanent reference can not be used because game is copied.
public static final class MagicOtherPermanentTargetFilter implements MagicTargetFilter {