mirror of
https://github.com/magefree/mage.git
synced 2025-12-27 22:12:03 -08:00
[THS] Added Glare of Heresy and Gods Willing.
This commit is contained in:
parent
6066cc2308
commit
e9f0ad3f7d
3 changed files with 143 additions and 5 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue