2013-05-19 01:15:01 -07:00
|
|
|
[
|
|
|
|
new MagicWhenComesIntoPlayTrigger() {
|
2012-09-22 22:57:48 -07:00
|
|
|
@Override
|
2013-06-19 07:23:35 -07:00
|
|
|
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent, final MagicPayedCost payedCost) {
|
2012-09-22 22:57:48 -07:00
|
|
|
return new MagicEvent(
|
|
|
|
permanent,
|
|
|
|
MagicColorChoice.ALL_INSTANCE,
|
|
|
|
this,
|
2013-05-19 01:15:01 -07:00
|
|
|
"Choose a color\$. " +
|
|
|
|
"All Slivers have protection from chosen color."
|
2012-09-22 22:57:48 -07:00
|
|
|
);
|
|
|
|
}
|
|
|
|
@Override
|
2013-03-22 22:00:53 -07:00
|
|
|
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
2013-03-22 19:50:55 -07:00
|
|
|
final MagicColor color = event.getChosenColor();
|
2012-09-22 22:57:48 -07:00
|
|
|
final MagicAbility protection = color.getProtectionAbility();
|
2012-10-11 05:31:58 -07:00
|
|
|
game.doAction(new MagicAddStaticAction(event.getPermanent(), new MagicStatic(
|
2012-09-22 22:57:48 -07:00
|
|
|
MagicLayer.Ability,
|
|
|
|
MagicTargetFilter.TARGET_SLIVER) {
|
|
|
|
@Override
|
2013-01-19 03:13:47 -08:00
|
|
|
public void modAbilityFlags(final MagicPermanent source,final MagicPermanent permanent,final Set<MagicAbility> flags) {
|
|
|
|
flags.add(protection);
|
2012-09-22 22:57:48 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
));
|
|
|
|
}
|
2013-05-19 01:15:01 -07:00
|
|
|
}
|
|
|
|
]
|