mirror of
https://github.com/magefree/mage.git
synced 2025-12-29 23:12:10 -08:00
* Runed Halo - Fixed a bug that controlling player had protection from every name.
This commit is contained in:
parent
6bc5cf538b
commit
98eb510228
3 changed files with 52 additions and 13 deletions
|
|
@ -53,6 +53,11 @@ public class GainAbilityControllerEffect extends ContinuousEffectImpl<GainAbilit
|
|||
this(ability, Duration.WhileOnBattlefield);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param ability
|
||||
* @param duration custom - effect will be discarded as soon there is no sourceId - permanent on the battlefield
|
||||
*/
|
||||
public GainAbilityControllerEffect(Ability ability, Duration duration) {
|
||||
super(duration, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility);
|
||||
this.ability = ability;
|
||||
|
|
@ -74,7 +79,14 @@ public class GainAbilityControllerEffect extends ContinuousEffectImpl<GainAbilit
|
|||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
player.addAbility(ability);
|
||||
if (duration.equals(Duration.Custom)) {
|
||||
if (game.getPermanent(source.getSourceId()) == null) {
|
||||
discard();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
discard();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue