add Goad Effect, add it to AttackRequirement and CombatUtil

also add it to Ai logic
This commit is contained in:
Hanmac
2016-08-25 12:15:54 +00:00
parent 198c6d4a04
commit 453c1e7f9f
10 changed files with 111 additions and 12 deletions

View File

@@ -125,7 +125,7 @@ public class AiAttackController {
if (sa.getApi() == ApiType.Animate) {
if (ComputerUtilCost.canPayCost(sa, defender)
&& sa.getRestrictions().checkOtherRestrictions(c, sa, defender)) {
Card animatedCopy = CardFactory.copyCard(c, true);
Card animatedCopy = CardFactory.copyCard(c, false);
AnimateAi.becomeAnimated(animatedCopy, c.hasSickness(), sa);
defenders.add(animatedCopy);
}
@@ -542,7 +542,9 @@ public class AiAttackController {
continue;
}
boolean mustAttack = false;
if (attacker.getSVar("MustAttack").equals("True")) {
if (attacker.isGoaded()) {
mustAttack = true;
} else if (attacker.getSVar("MustAttack").equals("True")) {
mustAttack = true;
} else if (attacker.getSVar("EndOfTurnLeavePlay").equals("True")
&& isEffectiveAttacker(ai, attacker, combat)) {

View File

@@ -1206,7 +1206,7 @@ public class AiController {
* 5. needs to be updated to ensure that the net toughness is
* still positive after static effects.
*/
final Card creature = CardFactory.copyCard(card, true);
final Card creature = CardFactory.copyCard(card, false);
ComputerUtilCard.applyStaticContPT(game, creature, null);
if (creature.getNetToughness() <= 0 && !creature.hasStartOfKeyword("etbCounter") && mana.countX() == 0
&& !creature.hasETBTrigger(false) && !creature.hasETBReplacement()

View File

@@ -1240,7 +1240,7 @@ public class ComputerUtilCard {
public static Card getPumpedCreature(final Player ai, final SpellAbility sa,
final Card c, final int toughness, final int power,
final List<String> keywords) {
Card pumped = CardFactory.copyCard(c, true);
Card pumped = CardFactory.copyCard(c, false);
pumped.setSickness(c.hasSickness());
final long timestamp = c.getGame().getNextTimestamp();
final List<String> kws = new ArrayList<String>();

View File

@@ -27,6 +27,7 @@ public enum SpellApiToAi {
.put(ApiType.AnimateAll, AnimateAllAi.class)
.put(ApiType.Attach, AttachAi.class)
.put(ApiType.Balance, BalanceAi.class)
.put(ApiType.BecomeMonarch, AlwaysPlayAi.class)
.put(ApiType.BecomesBlocked, BecomesBlockedAi.class)
.put(ApiType.BidLife, BidLifeAi.class)
.put(ApiType.Bond, BondAi.class)
@@ -77,6 +78,7 @@ public enum SpellApiToAi {
.put(ApiType.GainLife, LifeGainAi.class)
.put(ApiType.GainOwnership, CannotPlayAi.class)
.put(ApiType.GenericChoice, ChooseGenericEffectAi.class)
.put(ApiType.Goad, AlwaysPlayAi.class)
.put(ApiType.LoseLife, LifeLoseAi.class)
.put(ApiType.LosesGame, GameLossAi.class)
.put(ApiType.Mana, ManaEffectAi.class)