Sasaya, Orochi Ascendant: fixed the SetState, SpellAbilityAi now does check for Restrictions and Conditions

This commit is contained in:
Hanmac
2016-05-24 17:30:01 +00:00
parent 52ff7515a3
commit 395cc70b3e

View File

@@ -38,6 +38,15 @@ public abstract class SpellAbilityAi {
protected boolean canPlayAI(final Player ai, final SpellAbility sa) { protected boolean canPlayAI(final Player ai, final SpellAbility sa) {
final Card source = sa.getHostCard(); final Card source = sa.getHostCard();
final Cost cost = sa.getPayCosts(); final Cost cost = sa.getPayCosts();
if (sa.getRestrictions() != null && !sa.getRestrictions().canPlay(source, sa)) {
return false;
}
if (sa.getConditions() != null && !sa.getConditions().areMet(sa)) {
return false;
}
if (sa.hasParam("AILogic") && !checkAiLogic(ai, sa, sa.getParam("AILogic"))) { if (sa.hasParam("AILogic") && !checkAiLogic(ai, sa, sa.getParam("AILogic"))) {
return false; return false;
} }