Additional and alternative costs improved:

* Now player must choose additional costs before ability's modes;
* Fixed broken kicker ability from ZNR (see comments from d4ca287f0f);
* Improved compatibility of additional cost with cost modification effects (fixed that optional multi-costs doesn't affected by cost modification);
* Improved compatibility of additional cost with alternative cost (some cards ignores additional cost on alternative usage, e.g. on play free);
This commit is contained in:
Oleg Agafonov 2020-09-13 09:56:55 +04:00
parent 586538a66c
commit 6e0c7e868c
17 changed files with 504 additions and 156 deletions

View file

@ -0,0 +1,40 @@
package mage.abilities.keyword;
import mage.abilities.Ability;
import mage.abilities.costs.Cost;
import mage.abilities.costs.OptionalAdditionalModeSourceCosts;
import mage.game.Game;
/**
* Same as KickerAbility, but can enable any number modes in spell ability
*
* @author JayDi85
*/
public class KickerWithAnyNumberModesAbility extends KickerAbility implements OptionalAdditionalModeSourceCosts {
public KickerWithAnyNumberModesAbility(Cost cost) {
super(cost);
}
public KickerWithAnyNumberModesAbility(final KickerWithAnyNumberModesAbility ability) {
super(ability);
}
@Override
public void changeModes(Ability ability, Game game) {
if (!isKicked(game, ability, "")) {
return;
}
// activate any number modes
int maxModes = ability.getModes().size();
ability.getModes().setMinModes(0);
ability.getModes().setMaxModes(maxModes);
}
@Override
public KickerWithAnyNumberModesAbility copy() {
return new KickerWithAnyNumberModesAbility(this);
}
}