Changes related to Cascade ability (#7583):

* Cascade: added correct spell ability choose for forced cast of mdf and adventure cards (can contains one or both sides);
* Cascade: added tests from latest oracle changes;
* AI: improved spell ability choose for forced cast (example: cast target card without mana cost);
* GUI: improved spell ability choose for forced cast (now you can see only castable spells to choose);
* Other: fixed wrong PlayFromNotOwnHandZone in some cards, fixed NPE;
This commit is contained in:
Oleg Agafonov 2021-02-23 02:00:38 +04:00
parent 0c65a6fb7e
commit 91f4d78992
12 changed files with 178 additions and 43 deletions

View file

@ -2781,6 +2781,12 @@ public class ComputerPlayer extends PlayerImpl implements Player {
return randomOpponentId;
}
@Override
public SpellAbility chooseAbilityForCast(Card card, Game game, boolean noMana) {
Map<UUID, ActivatedAbility> useable = PlayerImpl.getSpellAbilities(this.getId(), card, game.getState().getZone(card.getId()), game);
return (SpellAbility) useable.values().stream().findFirst().orElse(null);
}
@Override
public boolean equals(Object o) {
if (this == o) {