mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
- AI will now sacrifice creatures for mana before losing control EOT.
This commit is contained in:
@@ -3,12 +3,17 @@ package forge.card.ability.ai;
|
||||
|
||||
import forge.card.ability.SpellAbilityAi;
|
||||
import forge.card.spellability.SpellAbility;
|
||||
import forge.game.ai.ComputerUtil;
|
||||
import forge.game.phase.PhaseType;
|
||||
import forge.game.player.Player;
|
||||
|
||||
public class ManaEffectAi extends SpellAbilityAi {
|
||||
|
||||
@Override
|
||||
protected boolean canPlayAI(Player aiPlayer, SpellAbility sa) {
|
||||
protected boolean canPlayAI(Player ai, SpellAbility sa) {
|
||||
if (ai.getGame().getPhaseHandler().is(PhaseType.MAIN2) && ComputerUtil.ActivateForSacCost(sa, ai)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -169,7 +169,7 @@ public class AiController {
|
||||
private ArrayList<SpellAbility> getSpellAbilities(final List<Card> l) {
|
||||
final ArrayList<SpellAbility> spellAbilities = new ArrayList<SpellAbility>();
|
||||
for (final Card c : l) {
|
||||
for (final SpellAbility sa : c.getNonManaSpellAbilities()) {
|
||||
for (final SpellAbility sa : c.getAllSpellAbilities()) {
|
||||
spellAbilities.add(sa);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1164,6 +1164,9 @@ public class ComputerUtil {
|
||||
final String type = sac.getType();
|
||||
|
||||
if (type.equals("CARDNAME")) {
|
||||
if (source.getSVar("SacMe").equals("6")) {
|
||||
return true;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user