From f2797922731eb6b5dea33ff9660c88ceb6095dee Mon Sep 17 00:00:00 2001 From: Agetian Date: Tue, 15 Aug 2017 19:19:10 +0000 Subject: [PATCH] - AI should not overprioritize Gavony Township, otherwise it locks itself on mana too much. --- .../src/main/java/forge/ai/ability/CountersPutAllAi.java | 7 +++++++ forge-gui/res/cardsfolder/g/gavony_township.txt | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/forge-ai/src/main/java/forge/ai/ability/CountersPutAllAi.java b/forge-ai/src/main/java/forge/ai/ability/CountersPutAllAi.java index b844733bad8..48e8239118f 100644 --- a/forge-ai/src/main/java/forge/ai/ability/CountersPutAllAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/CountersPutAllAi.java @@ -37,6 +37,7 @@ public class CountersPutAllAi extends SpellAbilityAi { final String type = sa.getParam("CounterType"); final String amountStr = sa.getParam("CounterNum"); final String valid = sa.getParam("ValidCards"); + final String logic = sa.getParamOrDefault("AILogic", ""); final boolean curse = sa.isCurse(); final TargetRestrictions tgt = sa.getTargetRestrictions(); @@ -58,6 +59,12 @@ public class CountersPutAllAi extends SpellAbilityAi { } } + if (logic.equals("AtEOTOrBlock")) { + if (!ai.getGame().getPhaseHandler().is(PhaseType.END_OF_TURN) && !ai.getGame().getPhaseHandler().is(PhaseType.COMBAT_DECLARE_BLOCKERS)) { + return false; + } + } + if (tgt != null) { Player pl = curse ? ComputerUtil.getOpponentFor(ai) : ai; sa.getTargets().add(pl); diff --git a/forge-gui/res/cardsfolder/g/gavony_township.txt b/forge-gui/res/cardsfolder/g/gavony_township.txt index 53dd5f49c32..b246b2347bb 100644 --- a/forge-gui/res/cardsfolder/g/gavony_township.txt +++ b/forge-gui/res/cardsfolder/g/gavony_township.txt @@ -2,6 +2,6 @@ Name:Gavony Township ManaCost:no cost Types:Land A:AB$ Mana | Cost$ T | Produced$ C | SpellDescription$ Add {C} to your mana pool. -A:AB$ PutCounterAll | Cost$ 2 G W T | ValidCards$ Creature.YouCtrl | CounterType$ P1P1 | CounterNum$ 1 | SpellDescription$ Put a +1/+1 counter on each creature you control. +A:AB$ PutCounterAll | Cost$ 2 G W T | ValidCards$ Creature.YouCtrl | CounterType$ P1P1 | CounterNum$ 1 | AILogic$ AtEOTOrBlock | SpellDescription$ Put a +1/+1 counter on each creature you control. SVar:Picture:http://www.wizards.com/global/images/magic/general/gavony_township.jpg Oracle:{T}: Add {C} to your mana pool.\n{2}{G}{W}, {T}: Put a +1/+1 counter on each creature you control.