forked from External/mage
[SLD] Implement Captain America, First Avenger (#13023)
* [SLD] Implement Captain America, First Avenger I made assumptions that WotC is going to fix the rules by adding "choose the equipment you're unattaching with Throw..." to rule 601.2b so that this card actually functions since you have to choose a TargetAnyTargetAmount in steps 601.2c/601.2d long before you actually pay the unattach cost in 601.2h. * Remove Target workaround, add proper 601.2b handling for choosing cost targets early using inheritance to avoid having a horrific brittle list of 'these costs must be paid early'.
This commit is contained in:
parent
6d84cee967
commit
f7f2d58081
5 changed files with 262 additions and 1 deletions
|
|
@ -6,6 +6,7 @@ import mage.abilities.common.EntersBattlefieldAbility;
|
|||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.costs.*;
|
||||
import mage.abilities.costs.common.PayLifeCost;
|
||||
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||
import mage.abilities.costs.mana.ManaCost;
|
||||
import mage.abilities.costs.mana.ManaCosts;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
|
|
@ -330,6 +331,10 @@ public abstract class AbilityImpl implements Ability {
|
|||
|
||||
handlePhyrexianManaCosts(game, controller);
|
||||
|
||||
// 20241022 - 601.2b
|
||||
// Not yet included in 601.2b but this is where it will be
|
||||
handleChooseCostTargets(game, controller);
|
||||
|
||||
/* 20130201 - 601.2b
|
||||
* If the spell is modal the player announces the mode choice (see rule 700.2).
|
||||
*/
|
||||
|
|
@ -649,6 +654,17 @@ public abstract class AbilityImpl implements Ability {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 601.2b Choose targets for costs that have to be chosen early.
|
||||
*/
|
||||
private void handleChooseCostTargets(Game game, Player controller) {
|
||||
for (Cost cost : getCosts()) {
|
||||
if (cost instanceof EarlyTargetCost && cost.getTargets().isEmpty()) {
|
||||
((EarlyTargetCost) cost).chooseTarget(game, this, controller);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles X mana costs and sets manaCostsToPay.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue