mirror of
https://github.com/magefree/mage.git
synced 2026-01-17 17:06:45 -08:00
Added generic AlternateCostSourceAbility. Some adjustments to alternate cost handling.
This commit is contained in:
parent
0074f2a487
commit
6049a69348
7 changed files with 209 additions and 14 deletions
|
|
@ -58,6 +58,7 @@ import mage.game.command.Emblem;
|
|||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
* @param <T>
|
||||
*/
|
||||
public abstract class AbilityImpl<T extends AbilityImpl<T>> implements Ability {
|
||||
|
||||
|
|
@ -204,9 +205,12 @@ public abstract class AbilityImpl<T extends AbilityImpl<T>> implements Ability {
|
|||
if (card != null) {
|
||||
for (Ability ability : card.getAbilities()) {
|
||||
if (ability instanceof AlternativeSourceCosts) {
|
||||
if (((AlternativeSourceCosts)ability).askToActivateAlternativeCosts(this, game)) {
|
||||
// only one alternative costs may be activated
|
||||
break;
|
||||
AlternativeSourceCosts alternativeSpellCosts = (AlternativeSourceCosts) ability;
|
||||
if (alternativeSpellCosts.isAvailable(this, game)) {
|
||||
if (alternativeSpellCosts.askToActivateAlternativeCosts(this, game)) {
|
||||
// only one alternative costs may be activated
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ability instanceof OptionalAdditionalSourceCosts) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue