mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
This should work?
This commit is contained in:
@@ -32,28 +32,6 @@ public class DestroyAi extends SpellAbilityAi {
|
||||
final String logic = sa.getParam("AILogic");
|
||||
boolean hasXCost = false;
|
||||
|
||||
// Ability that's intended to destroy own useless token to trigger Grave Pacts
|
||||
// should be fired at end of turn or when under attack after blocking to make opponent sac something
|
||||
boolean havepact = false;
|
||||
for (Card cardInPlay : ai.getGame().getCardsIn(ZoneType.Battlefield)) {
|
||||
if ((cardInPlay.getController().equals(ai))
|
||||
&& ("Grave Pact".equals(cardInPlay.getName()))) {
|
||||
havepact = true;
|
||||
}
|
||||
}
|
||||
if (("Pactivator".equals(logic)) && (havepact)) {
|
||||
if (
|
||||
(!ai.getGame().getPhaseHandler().isPlayerTurn(ai)) &&
|
||||
((ai.getGame().getPhaseHandler().is(PhaseType.END_OF_TURN))
|
||||
|| (ai.getGame().getPhaseHandler().is(PhaseType.COMBAT_DECLARE_BLOCKERS)))
|
||||
&&
|
||||
(ai.getOpponents().get(0).getCreaturesInPlay().size() > 0)
|
||||
) {
|
||||
sa.getTargetRestrictions().setMandatory(true);
|
||||
return true; //ai.getController().chooseTargetsFor(sa);
|
||||
}
|
||||
}
|
||||
|
||||
CardCollection list;
|
||||
|
||||
if (abCost != null) {
|
||||
@@ -93,6 +71,28 @@ public class DestroyAi extends SpellAbilityAi {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Ability that's intended to destroy own useless token to trigger Grave Pacts
|
||||
// should be fired at end of turn or when under attack after blocking to make opponent sac something
|
||||
boolean havepact = false;
|
||||
for (Card cardInPlay : ai.getGame().getCardsIn(ZoneType.Battlefield)) {
|
||||
if ((cardInPlay.getController().equals(ai))
|
||||
&& ("Grave Pact".equals(cardInPlay.getName()))) {
|
||||
havepact = true;
|
||||
}
|
||||
}
|
||||
if (("Pactivator".equals(logic)) && (havepact)) {
|
||||
if (
|
||||
(!ai.getGame().getPhaseHandler().isPlayerTurn(ai)) &&
|
||||
((ai.getGame().getPhaseHandler().is(PhaseType.END_OF_TURN))
|
||||
|| (ai.getGame().getPhaseHandler().is(PhaseType.COMBAT_DECLARE_BLOCKERS)))
|
||||
&&
|
||||
(ai.getOpponents().get(0).getCreaturesInPlay().size() > 0)
|
||||
) {
|
||||
ai.getController().chooseTargetsFor(sa);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Targeting
|
||||
if (abTgt != null) {
|
||||
sa.resetTargets();
|
||||
|
||||
Reference in New Issue
Block a user