forked from External/mage
Costs Tag Tracking part 4: Convoke (#11446)
* Switch Convoke to using costs tag system * Add Convoke copy/clone tests * update author name on sufficiently changed files * Remove now-unused CONVOKED event
This commit is contained in:
parent
31f028d41e
commit
2cc9957753
11 changed files with 141 additions and 103 deletions
|
|
@ -1,27 +1,26 @@
|
|||
package mage.abilities.dynamicvalue.common;
|
||||
|
||||
import mage.MageObjectReference;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.keyword.ConvokeAbility;
|
||||
import mage.game.Game;
|
||||
import mage.watchers.common.ConvokeWatcher;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
* @author notgreat
|
||||
*/
|
||||
public enum ConvokedSourceCount implements DynamicValue {
|
||||
PERMANENT(-1),
|
||||
SPELL(0);
|
||||
private final int offset;
|
||||
instance;
|
||||
|
||||
ConvokedSourceCount(int offset) {
|
||||
this.offset = offset;
|
||||
ConvokedSourceCount() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
return ConvokeWatcher.getConvokingCreatures(new MageObjectReference(game.getObject(sourceAbility), game, offset), game).size();
|
||||
return CardUtil.getSourceCostsTag(game, sourceAbility, ConvokeAbility.convokingCreaturesKey, new HashSet<>(0)).size();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue