mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
- Improved AI of spells cast via copySpellontoStack.
This commit is contained in:
@@ -719,6 +719,13 @@ public class AbilityFactoryZoneAffecting {
|
||||
AbilityFactoryZoneAffecting.millResolve(af, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlayFromEffectAI(final boolean mandatory, final boolean withOutManaCost) {
|
||||
if (withOutManaCost) {
|
||||
return AbilityFactoryZoneAffecting.millTriggerNoCost(af, this, mandatory);
|
||||
}
|
||||
return AbilityFactoryZoneAffecting.millTrigger(af, this, mandatory);
|
||||
}
|
||||
};
|
||||
return spMill;
|
||||
}
|
||||
@@ -1015,6 +1022,10 @@ public class AbilityFactoryZoneAffecting {
|
||||
return false;
|
||||
}
|
||||
|
||||
return millTriggerNoCost(af, sa, mandatory);
|
||||
}
|
||||
|
||||
private static boolean millTriggerNoCost(final AbilityFactory af, final SpellAbility sa, final boolean mandatory) {
|
||||
if (!AbilityFactoryZoneAffecting.millTargetAI(af, sa, mandatory)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ import forge.CardCharacteristicName;
|
||||
import forge.CardUtil;
|
||||
import forge.Singletons;
|
||||
import forge.card.CardRules;
|
||||
import forge.card.spellability.Spell;
|
||||
import forge.card.spellability.SpellAbility;
|
||||
import forge.card.spellability.SpellPermanent;
|
||||
import forge.card.spellability.Target;
|
||||
@@ -212,6 +213,11 @@ public class CardFactory implements CardFactoryInterface {
|
||||
|
||||
if (controller.isHuman()) {
|
||||
Singletons.getModel().getGameAction().playSpellAbilityForFree(copySA);
|
||||
} else if (copySA instanceof Spell) {
|
||||
Spell spell = (Spell) copySA;
|
||||
if (spell.canPlayFromEffectAI(false, true)) {
|
||||
ComputerUtil.playStackFree(copySA);
|
||||
}
|
||||
} else if (copySA.canPlayAI()) {
|
||||
ComputerUtil.playStackFree(copySA);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user