Test framework: fixed support of chooseAbilityForCast for commanders, added destroy target custom effect (#7593);

This commit is contained in:
Oleg Agafonov 2021-02-22 16:05:48 +04:00
parent a377999f57
commit 650acf9e1e
4 changed files with 30 additions and 3 deletions

View file

@ -1521,7 +1521,14 @@ public abstract class PlayerImpl implements Player, Serializable {
public static LinkedHashMap<UUID, ActivatedAbility> getSpellAbilities(UUID playerId, MageObject object, Zone zone, Game game) {
LinkedHashMap<UUID, ActivatedAbility> useable = new LinkedHashMap<>();
for (Ability ability : object.getAbilities()) {
Abilities<Ability> allAbilities;
if (object instanceof Card) {
allAbilities = ((Card) object).getAbilities(game);
} else {
allAbilities = object.getAbilities();
}
for (Ability ability : allAbilities) {
if (ability instanceof SpellAbility) {
switch (((SpellAbility) ability).getSpellAbilityType()) {
case BASE_ALTERNATE: