java code for Ward Sliver

I'm trying to create java code for the card "Ward Sliver" and I am having some issues. The following is what I have so far:
If anyone has some suggestions I would be glad to hear. I have been stubbornly trying to resolve this myself but I am not a java programmer and I've reached the limit of what I can figure out quickly by looking at scripts for other cards. Thanks!!
- Code: Select all
public class Ward_Sliver {
public static final MagicWhenComesIntoPlayTrigger T = new MagicWhenComesIntoPlayTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent, final MagicPlayer player) {
return new MagicEvent(
permanent,
player,
new MagicMayChoice(
"Choose a color",
MagicColorChoice.ALL_INSTANCE),
new Object[]{player},
this,
"You may$ Choose a color$." +
" All Slivers have protection from chosen color.");
}
@Override
public void executeEvent(final MagicGame game,final MagicEvent event,final Object data[],final Object[] choiceResults) {
//final MagicColor color=(MagicColor)choiceResults[1];
//MagicAbility ability = color.getProtectionAbility();
//final long givenAbilityFlags = ability.getMask();
};
};
/* public static MagicStatic genABStatic(final long givenAbilityFlags) {
return new MagicStatic(MagicLayer.Ability, MagicTargetFilter.TARGET_SLIVER) {
@Override
public long getAbilityFlags(
final MagicPermanent source,
final MagicPermanent permanent,
final long flags) {
return flags | givenAbilityFlags;
//return flags | MagicAbility.ProtectionFromRed.getMask();
}
};
}*/
public static final MagicStatic S = new MagicStatic(
MagicLayer.Ability,
MagicTargetFilter.TARGET_SLIVER) {
@Override
public long getAbilityFlags(final MagicPermanent source,final MagicPermanent permanent,final long flags) {
//return flags | ability.getMask();
return flags | MagicAbility.ProtectionFromRed.getMask();
}
};
};
If anyone has some suggestions I would be glad to hear. I have been stubbornly trying to resolve this myself but I am not a java programmer and I've reached the limit of what I can figure out quickly by looking at scripts for other cards. Thanks!!