forked from External/mage
[OTJ] Implementing "spree" mechanic (#12018)
* [OTJ] Implement Unfortunate Accident * fix errors * a few more things * [OTJ] Implement Three Steps Ahead * [OTJ] Implement Caught in the Crossfire * [OTJ] Implement Insatiable Avarice * add test * [OTJ] Implement Explosive Derailment * [OTJ] Implement Requisition Raid * [OTJ] Implement Rustler Rampage * add comment to test * [OTJ] Implement Metamorphic Blast * [OTJ] Implement Final Showdown * rework cost addition, add test * move cost application to its own loop
This commit is contained in:
parent
fa67b0450f
commit
ba20e97b71
18 changed files with 740 additions and 2 deletions
|
|
@ -311,6 +311,16 @@ public abstract class AbilityImpl implements Ability {
|
|||
return false;
|
||||
}
|
||||
|
||||
// apply mode costs if they have them
|
||||
for (UUID modeId : this.getModes().getSelectedModes()) {
|
||||
Cost cost = this.getModes().get(modeId).getCost();
|
||||
if (cost instanceof ManaCost) {
|
||||
this.addManaCostsToPay((ManaCost) cost.copy());
|
||||
} else if (cost != null) {
|
||||
this.costs.add(cost.copy());
|
||||
}
|
||||
}
|
||||
|
||||
// unit tests only: it allows to add targets/choices by two ways:
|
||||
// 1. From cast/activate command params (process it here)
|
||||
// 2. From single addTarget/setChoice, it's a preffered method for tests (process it in normal choose dialogs like human player)
|
||||
|
|
@ -1141,6 +1151,12 @@ public abstract class AbilityImpl implements Ability {
|
|||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Ability withFirstModeCost(Cost cost) {
|
||||
this.modes.getMode().withCost(cost);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGameLogMessage(Game game) {
|
||||
if (game.isSimulation()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue