mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
Sasaya, Orochi Ascendant: fixed the SetState, SpellAbilityAi now does check for Restrictions and Conditions
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user