1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-01 09:05:59 -09:00

* Spells with multiple modes resolve in the order the modes are added on the card (fixes ).

This commit is contained in:
LevelX2 2020-07-02 17:23:00 +02:00
parent 509bca7224
commit 2a31e8063b

View file

@ -35,6 +35,7 @@ import mage.util.SubTypeList;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map.Entry;
import java.util.Set;
import java.util.UUID;
@ -222,13 +223,15 @@ public class Spell extends StackObjImpl implements Card {
for (SpellAbility spellAbility : this.spellAbilities) {
// legality of targets is checked only as the spell begins to resolve, not in between modes (spliced spells handeled correctly?)
if (spellAbilityCheckTargetsAndDeactivateModes(spellAbility, game)) {
for (UUID modeId : spellAbility.getModes().getSelectedModes()) {
spellAbility.getModes().setActiveMode(modeId);
for (Mode mode : spellAbility.getModes().values()) {
if (spellAbility.getModes().getSelectedModes().contains(mode.getId())) {
spellAbility.getModes().setActiveMode(mode.getId());
if (spellAbility.getSpellAbilityType() != SpellAbilityType.SPLICE) {
updateOptionalCosts(index);
}
result |= spellAbility.resolve(game);
}
}
index++;
}
}
@ -319,9 +322,10 @@ public class Spell extends StackObjImpl implements Card {
}
/**
* Legality of the targets of all modes are only checked as the spell begins to resolve
* A mode without any legal target (if it has targets at all) won't resolve.
* So modes with targets without legal targets are unselected.
* Legality of the targets of all modes are only checked as the spell begins
* to resolve A mode without any legal target (if it has targets at all)
* won't resolve. So modes with targets without legal targets are
* unselected.
*
* @param spellAbility
* @param game