mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
- Implemented AI for Atarka's Command
This commit is contained in:
@@ -290,6 +290,11 @@ public class ChangeZoneAi extends SpellAbilityAi {
|
||||
if (!activateForCost && list.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
if ("Atarka's Command".equals(source.getName())
|
||||
&& (list.size() < 2 || ai.getLandsPlayedThisTurn() < 1)) {
|
||||
// be strict on playing lands off charms
|
||||
return false;
|
||||
}
|
||||
|
||||
String num = sa.getParam("ChangeNum");
|
||||
if (num != null) {
|
||||
|
||||
@@ -213,7 +213,10 @@ public class DamageDealAi extends DamageAiBase {
|
||||
*/
|
||||
private boolean damageTargetAI(final Player ai, final SpellAbility saMe, final int dmg, final boolean immediately) {
|
||||
final TargetRestrictions tgt = saMe.getTargetRestrictions();
|
||||
|
||||
if ("Atarka's Command".equals(saMe.getHostCard().getName())) {
|
||||
// playReusable in damageChooseNontargeted wrongly assumes that CharmEffect options are re-usable
|
||||
return this.shouldTgtP(ai, saMe, dmg, false);
|
||||
}
|
||||
if (tgt == null) {
|
||||
return this.damageChooseNontargeted(ai, saMe, dmg);
|
||||
}
|
||||
|
||||
@@ -149,6 +149,17 @@ public class EffectAi extends SpellAbilityAi {
|
||||
}
|
||||
}
|
||||
randomReturn = threatened;
|
||||
} else if (logic.equals("NoGain")) {
|
||||
// basic logic to cancel GainLife on stack
|
||||
if (game.getStack().isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
final SpellAbility topStack = game.getStack().peekAbility();
|
||||
if (topStack.getActivatingPlayer() == ai.getOpponent() && topStack.getApi() == ApiType.GainLife) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else if (logic.equals("Fight")) {
|
||||
CardCollection humCreatures = ai.getOpponent().getCreaturesInPlay();
|
||||
humCreatures = CardLists.getTargetableCards(humCreatures, sa);
|
||||
|
||||
Reference in New Issue
Block a user