forked from External/mage
Token's zone change counter (ZCC) improves:
* Now token's zcc uses same logic as card's zcc: enters to battlefield with +1 zcc instead +0 zcc * It can improve support of copied spells that store zcc related data (bug example: lost kicked status for copied spell/token); * Kicker abilities - improved support with copied creature spells (example: Verazol, the Split Current, #7431, #7433); * Refactor: simplified kicker code;
This commit is contained in:
parent
3eb57eade9
commit
f38639e1db
24 changed files with 262 additions and 177 deletions
|
|
@ -10,6 +10,8 @@ import mage.game.stack.Spell;
|
|||
|
||||
|
||||
/**
|
||||
* Kicker {X}
|
||||
*
|
||||
* @author JayDi85
|
||||
*/
|
||||
public enum GetKickerXValue implements DynamicValue {
|
||||
|
|
@ -23,7 +25,7 @@ public enum GetKickerXValue implements DynamicValue {
|
|||
// only one X value per card possible
|
||||
// kicker can be calls multiple times (use getKickedCounter)
|
||||
|
||||
int finalValue = 0;
|
||||
int countX = 0;
|
||||
Spell spell = game.getSpellOrLKIStack(sourceAbility.getSourceId());
|
||||
if (spell != null && spell.getSpellAbility() != null) {
|
||||
int xValue = spell.getSpellAbility().getManaCostsToPay().getX();
|
||||
|
|
@ -39,13 +41,13 @@ public enum GetKickerXValue implements DynamicValue {
|
|||
if (haveVarCost) {
|
||||
int kickedCount = ((KickerAbility) ability).getKickedCounter(game, sourceAbility);
|
||||
if (kickedCount > 0) {
|
||||
finalValue += kickedCount * xValue;
|
||||
countX += kickedCount * xValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return finalValue;
|
||||
return countX;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue