* Added some trace output for continous effects and triggered abilities. Changed duration of AffinityEffect to WhileOnStack to prevent wrong handling for removement of the effect.

This commit is contained in:
LevelX2 2021-01-13 09:14:29 +01:00
parent 8c85c0dbad
commit 9fc0e2f25a
10 changed files with 323 additions and 48 deletions

View file

@ -10,12 +10,18 @@ import mage.filter.common.FilterControlledPermanent;
import mage.game.Game;
import mage.util.CardUtil;
/**
* 702.40. Affinity
702.40a Affinity is a static ability that functions while the spell with affinity is on the stack.
Affinity for [text] means This spell costs you {1} less to cast for each [text] you control.
702.40b If a spell has multiple instances of affinity, each of them applies.
*/
public class AffinityEffect extends CostModificationEffectImpl {
private final FilterControlledPermanent filter;
public AffinityEffect(FilterControlledPermanent affinityFilter) {
super(Duration.Custom, Outcome.Benefit, CostModificationType.REDUCE_COST);
super(Duration.WhileOnStack, Outcome.Benefit, CostModificationType.REDUCE_COST);
this.filter = affinityFilter;
staticText = "Affinity for " + filter.getMessage();
}