added Soltari Visionary and Stronghold Overseer

master
beholder 2011-10-21 09:56:11 +02:00
parent 1122ad2c29
commit a207ac624e
5 changed files with 168 additions and 0 deletions

View File

@ -16112,3 +16112,31 @@ cost={1}{W}
pt=1/1 pt=1/1
ability=shadow ability=shadow
timing=main timing=main
>Soltari Visionary
url=http://magiccards.info/ex/en/20.html
image=http://magiccards.info/scans/en/ex/20.jpg
value=3
rarity=C
type=Creature
subtype=Soltari,Cleric
color=w
converted=3
cost={1}{W}{W}
pt=2/2
ability=shadow
timing=main
>Stronghold Overseer
url=http://magiccards.info/ts/en/133.html
image=http://magiccards.info/scans/en/ts/133.jpg
value=5
rarity=R
type=Creature
subtype=Demon
color=b
converted=6
cost={3}{B}{B}{B}
pt=5/5
ability=shadow,flying
timing=fmain

View File

@ -0,0 +1,49 @@
package magic.card;
import magic.model.MagicDamage;
import magic.model.MagicGame;
import magic.model.MagicPermanent;
import magic.model.MagicPlayer;
import magic.model.MagicType;
import magic.model.action.MagicDestroyAction;
import magic.model.action.MagicPermanentAction;
import magic.model.choice.MagicTargetChoice;
import magic.model.event.MagicEvent;
import magic.model.target.MagicDestroyTargetPicker;
import magic.model.trigger.MagicWhenDamageIsDealtTrigger;
public class Soltari_Visionary {
public static final MagicWhenDamageIsDealtTrigger T = new MagicWhenDamageIsDealtTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicDamage damage) {
final MagicPlayer player = permanent.getController();
final MagicPlayer target = (MagicPlayer)damage.getTarget();
return (damage.getSource() == permanent &&
damage.getTarget().isPlayer() &&
target.controlsPermanentWithType(MagicType.Enchantment,game)) ?
new MagicEvent(
permanent,
player,
damage.getTarget() == player ?
MagicTargetChoice.TARGET_ENCHANTMENT_YOU_CONTROL :
MagicTargetChoice.TARGET_ENCHANTMENT_YOUR_OPPONENT_CONTROLS,
new MagicDestroyTargetPicker(false),
MagicEvent.NO_DATA,
this,
"Destroy target enchantment$."):
MagicEvent.NONE;
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object data[],
final Object[] choiceResults) {
event.processTargetPermanent(game,choiceResults,0,new MagicPermanentAction() {
public void doAction(final MagicPermanent perm) {
game.doAction(new MagicDestroyAction(perm));
}
});
}
};
}

View File

@ -0,0 +1,55 @@
package magic.card;
import java.util.Collection;
import magic.model.MagicGame;
import magic.model.MagicManaCost;
import magic.model.MagicPayedCost;
import magic.model.MagicPermanent;
import magic.model.MagicSource;
import magic.model.action.MagicChangeTurnPTAction;
import magic.model.condition.MagicCondition;
import magic.model.event.MagicActivationHints;
import magic.model.event.MagicEvent;
import magic.model.event.MagicPayManaCostEvent;
import magic.model.event.MagicPermanentActivation;
import magic.model.event.MagicTiming;
import magic.model.target.MagicTarget;
import magic.model.target.MagicTargetFilter;
public class Stronghold_Overseer {
public static final MagicPermanentActivation A = new MagicPermanentActivation(
new MagicCondition[]{MagicManaCost.BLACK_BLACK.getCondition()},
new MagicActivationHints(MagicTiming.Pump,false,1),
"Pump") {
@Override
public MagicEvent[] getCostEvent(final MagicSource source) {
return new MagicEvent[]{new MagicPayManaCostEvent(source,source.getController(),MagicManaCost.BLACK_BLACK)};
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
return new MagicEvent(
source,
source.getController(),
MagicEvent.NO_DATA,
this,
"Creatures with shadow get +1/+0 until end of turn and " +
"creatures without shadow get -1/-0 until end of turn.");
}
@Override
public void executeEvent(final MagicGame game,final MagicEvent event,final Object[] data,final Object[] choiceResults) {
Collection<MagicTarget> targets =
game.filterTargets(game.getPlayer(0),MagicTargetFilter.TARGET_CREATURE_WITH_SHADOW);
for (final MagicTarget target : targets) {
game.doAction(new MagicChangeTurnPTAction((MagicPermanent)target,1,0));
}
targets = game.filterTargets(game.getPlayer(0),MagicTargetFilter.TARGET_CREATURE_WITHOUT_SHADOW);
for (final MagicTarget target : targets) {
game.doAction(new MagicChangeTurnPTAction((MagicPermanent)target,-1,0));
}
}
};
}

View File

@ -123,6 +123,11 @@ public class MagicTargetChoice extends MagicChoice {
"target artifact creature"); "target artifact creature");
public static final MagicTargetChoice TARGET_ENCHANTMENT = public static final MagicTargetChoice TARGET_ENCHANTMENT =
new MagicTargetChoice(MagicTargetFilter.TARGET_ENCHANTMENT,true,MagicTargetHint.None,"target enchantment"); new MagicTargetChoice(MagicTargetFilter.TARGET_ENCHANTMENT,true,MagicTargetHint.None,"target enchantment");
public static final MagicTargetChoice TARGET_ENCHANTMENT_YOU_CONTROL =
new MagicTargetChoice(MagicTargetFilter.TARGET_ENCHANTMENT_YOU_CONTROL,true,MagicTargetHint.None,"target enchantment you control");
public static final MagicTargetChoice TARGET_ENCHANTMENT_YOUR_OPPONENT_CONTROLS =
new MagicTargetChoice(MagicTargetFilter.TARGET_ENCHANTMENT_YOUR_OPPONENT_CONTROLS,true,MagicTargetHint.None,
"target enchantment your opponent controls");
public static final MagicTargetChoice NEG_TARGET_ENCHANTMENT = public static final MagicTargetChoice NEG_TARGET_ENCHANTMENT =
new MagicTargetChoice(MagicTargetFilter.TARGET_ENCHANTMENT,true,MagicTargetHint.Negative,"target enchantment"); new MagicTargetChoice(MagicTargetFilter.TARGET_ENCHANTMENT,true,MagicTargetHint.Negative,"target enchantment");
public static final MagicTargetChoice NEG_TARGET_SPIRIT_OR_ENCHANTMENT = public static final MagicTargetChoice NEG_TARGET_SPIRIT_OR_ENCHANTMENT =

View File

@ -421,6 +421,26 @@ public interface MagicTargetFilter {
} }
}; };
MagicTargetFilter TARGET_ENCHANTMENT_YOU_CONTROL = new MagicTargetFilter() {
public boolean accept(final MagicGame game,final MagicPlayer player,final MagicTarget target) {
return target.getController() == player &&
((MagicPermanent)target).isEnchantment();
}
public boolean acceptType(final MagicTargetType targetType) {
return targetType == MagicTargetType.Permanent;
}
};
MagicTargetFilter TARGET_ENCHANTMENT_YOUR_OPPONENT_CONTROLS = new MagicTargetFilter() {
public boolean accept(final MagicGame game,final MagicPlayer player,final MagicTarget target) {
return target.getController() != player &&
((MagicPermanent)target).isEnchantment();
}
public boolean acceptType(final MagicTargetType targetType) {
return targetType == MagicTargetType.Permanent;
}
};
MagicTargetFilter TARGET_SPIRIT_OR_ENCHANTMENT = new MagicTargetFilter() { MagicTargetFilter TARGET_SPIRIT_OR_ENCHANTMENT = new MagicTargetFilter() {
public boolean accept(final MagicGame game,final MagicPlayer player,final MagicTarget target) { public boolean accept(final MagicGame game,final MagicPlayer player,final MagicTarget target) {
final MagicPermanent targetPermanent = (MagicPermanent)target; final MagicPermanent targetPermanent = (MagicPermanent)target;
@ -1230,6 +1250,17 @@ public interface MagicTargetFilter {
} }
}; };
MagicTargetFilter TARGET_CREATURE_WITHOUT_SHADOW = new MagicTargetFilter() {
public boolean accept(final MagicGame game,final MagicPlayer player,final MagicTarget target) {
final MagicPermanent permanent = (MagicPermanent)target;
return permanent.isCreature(game) &&
!permanent.hasAbility(game,MagicAbility.Shadow);
}
public boolean acceptType(final MagicTargetType targetType) {
return targetType == MagicTargetType.Permanent;
}
};
MagicTargetFilter TARGET_CREATURE_CONVERTED_3_OR_LESS=new MagicTargetFilter() { MagicTargetFilter TARGET_CREATURE_CONVERTED_3_OR_LESS=new MagicTargetFilter() {
public boolean accept(final MagicGame game,final MagicPlayer player,final MagicTarget target) { public boolean accept(final MagicGame game,final MagicPlayer player,final MagicTarget target) {