[THS] Added Glare of Heresy and Gods Willing.

This commit is contained in:
LevelX2 2013-09-05 17:14:10 +02:00
parent 6066cc2308
commit e9f0ad3f7d
3 changed files with 143 additions and 5 deletions

View file

@ -44,16 +44,12 @@ import mage.game.permanent.Permanent;
*/
public class GainProtectionFromColorTargetEffect extends GainAbilityTargetEffect {
FilterCard protectionFilter;
public GainProtectionFromColorTargetEffect(Duration duration) {
super(new ProtectionAbility(new FilterCard()), duration);
protectionFilter = (FilterCard)((ProtectionAbility)ability).getFilter();
}
public GainProtectionFromColorTargetEffect(final GainProtectionFromColorTargetEffect effect) {
super(effect);
this.protectionFilter = effect.protectionFilter.copy();
}
@Override
@ -66,10 +62,11 @@ public class GainProtectionFromColorTargetEffect extends GainAbilityTargetEffect
Permanent creature = game.getPermanent(source.getFirstTarget());
if (creature != null) {
ChoiceColor choice = (ChoiceColor) source.getChoices().get(0);
FilterCard protectionFilter = (FilterCard)((ProtectionAbility)ability).getFilter();
protectionFilter.add(new ColorPredicate(choice.getColor()));
protectionFilter.setMessage(choice.getChoice());
((ProtectionAbility)ability).setFilter(protectionFilter);
creature.addAbility(ability, game);
creature.addAbility(ability, source.getSourceId(), game);
return true;
}
return false;