Fixed Computer Player treating unprevented moves as unplayable.

(First time contributing so please excuse my noobness) Card not prevented by an effect should be playable ("&& !prevented"), but currently AI says card not prevented is NOT playable ("&& prevented"). Also, not sure why AI doesn't add to unplayable even though its not contained by playableInstants or playableNonInstants. I'm not even sure if we're maintaining ComputerPlayer's decision logic (as opposed to Computer Player7).
This commit is contained in:
Adonis Pujols 2020-01-01 14:44:45 -05:00 committed by GitHub
parent de07960ee5
commit 56eef2b563
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1303,7 +1303,7 @@ public class ComputerPlayer extends PlayerImpl implements Player {
if (mana.enough(avail)) {
SpellAbility ability = card.getSpellAbility();
if (ability != null && ability.canActivate(playerId, game).canActivate()
&& game.getContinuousEffects().preventedByRuleModification(GameEvent.getEvent(GameEvent.EventType.CAST_SPELL, ability.getSourceId(), ability.getSourceId(), playerId), ability, game, true)) {
&& !game.getContinuousEffects().preventedByRuleModification(GameEvent.getEvent(GameEvent.EventType.CAST_SPELL, ability.getSourceId(), ability.getSourceId(), playerId), ability, game, true)) {
if (card.getCardType().contains(CardType.INSTANT)
|| card.hasAbility(FlashAbility.getInstance().getId(), game)) {
playableInstant.add(card);