- Some improvements to AnimateAi.

- Fixed Myth Realized ability text. Also, it shouldn't be a characteristic-defining ability since it's an ability granted to itself (point 4 in rule 604.3a), otherwise it doesn't interact correctly, for example, with Starfield of Nyx in presence of five enchantments.
This commit is contained in:
Agetian
2017-09-19 17:37:57 +00:00
parent 085732868c
commit e06ea82f62
2 changed files with 18 additions and 17 deletions

View File

@@ -1,28 +1,15 @@
package forge.ai.ability; package forge.ai.ability;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import com.google.common.collect.Iterables; import com.google.common.collect.Iterables;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import forge.ai.AiCardMemory; import forge.ai.*;
import forge.ai.ComputerUtil;
import forge.ai.ComputerUtilCard;
import forge.ai.ComputerUtilCost;
import forge.ai.SpellAbilityAi;
import forge.card.CardType; import forge.card.CardType;
import forge.game.Game; import forge.game.Game;
import forge.game.ability.AbilityFactory; import forge.game.ability.AbilityFactory;
import forge.game.ability.AbilityUtils; import forge.game.ability.AbilityUtils;
import forge.game.ability.ApiType; import forge.game.ability.ApiType;
import forge.game.card.Card; import forge.game.card.*;
import forge.game.card.CardCollection;
import forge.game.card.CardCollectionView;
import forge.game.card.CardLists;
import forge.game.card.CardPredicates;
import forge.game.card.CardUtil;
import forge.game.phase.PhaseHandler; import forge.game.phase.PhaseHandler;
import forge.game.phase.PhaseType; import forge.game.phase.PhaseType;
import forge.game.player.Player; import forge.game.player.Player;
@@ -38,6 +25,10 @@ import forge.game.trigger.TriggerHandler;
import forge.game.zone.ZoneType; import forge.game.zone.ZoneType;
import forge.util.collect.FCollectionView; import forge.util.collect.FCollectionView;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/** /**
* <p> * <p>
@@ -186,9 +177,19 @@ public class AnimateAi extends SpellAbilityAi {
&& !ComputerUtilCard.doesSpecifiedCreatureBlock(aiPlayer, animatedCopy)) { && !ComputerUtilCard.doesSpecifiedCreatureBlock(aiPlayer, animatedCopy)) {
return false; return false;
} }
this.rememberAnimatedThisTurn(aiPlayer, c); // also check if maybe there are static effects applied to the animated copy that would matter
// (e.g. Myth Realized)
if (animatedCopy.getCurrentPower() + animatedCopy.getCurrentToughness() >
c.getCurrentPower() + c.getCurrentToughness()) {
if (!isAnimatedThisTurn(aiPlayer, sa.getHostCard())) {
bFlag = true;
}
}
} }
} }
if (bFlag) {
this.rememberAnimatedThisTurn(aiPlayer, sa.getHostCard());
}
return bFlag; // All of the defined stuff is animated, not very useful return bFlag; // All of the defined stuff is animated, not very useful
} else { } else {
sa.resetTargets(); sa.resetTargets();

View File

@@ -5,7 +5,7 @@ T:Mode$ SpellCast | ValidCard$ Card.nonCreature | ValidActivatingPlayer$ You | E
SVar:TrigPutCounter:AB$PutCounter | Cost$ 0 | Defined$ Self | CounterType$ LORE | CounterNum$ 1 SVar:TrigPutCounter:AB$PutCounter | Cost$ 0 | Defined$ Self | CounterType$ LORE | CounterNum$ 1
A:AB$ PutCounter | Cost$ 2 W | CounterType$ LORE | CounterNum$ 1 | SpellDescription$ Put a lore counter on CARDNAME. A:AB$ PutCounter | Cost$ 2 W | CounterType$ LORE | CounterNum$ 1 | SpellDescription$ Put a lore counter on CARDNAME.
A:AB$ Animate | Cost$ W | Defined$ Self | Types$ Creature,Monk,Avatar | staticAbilities$ Static | SpellDescription$ Until end of turn, CARDNAME becomes a Monk Avatar creature in addition to its other types and gains "This creature's power and toughness are each equal to the number of lore counters on it." A:AB$ Animate | Cost$ W | Defined$ Self | Types$ Creature,Monk,Avatar | staticAbilities$ Static | SpellDescription$ Until end of turn, CARDNAME becomes a Monk Avatar creature in addition to its other types and gains "This creature's power and toughness are each equal to the number of lore counters on it."
SVar:Static:Mode$ Continuous | EffectZone$ Battlefield | CharacteristicDefining$ True | SetPower$ X | SetToughness$ X | Description$ This creature's power and toughness are each equal to the number of charge counters on it. SVar:Static:Mode$ Continuous | EffectZone$ Battlefield | Affected$ Card.Self | SetPower$ X | SetToughness$ X | Description$ This creature's power and toughness are each equal to the number of lore counters on it.
SVar:X:Count$CardCounters.LORE SVar:X:Count$CardCounters.LORE
SVar:Picture:http://www.wizards.com/global/images/magic/general/myth_realized.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/myth_realized.jpg
Oracle:Whenever you cast a noncreature spell, put a lore counter on Myth Realized.\n{2}{W}: Put a lore counter on Myth Realized.\n{W}: Until end of turn, Myth Realized becomes a Monk Avatar creature in addition to its other types and gains "This creature's power and toughness are each equal to the number of lore counters on it." Oracle:Whenever you cast a noncreature spell, put a lore counter on Myth Realized.\n{2}{W}: Put a lore counter on Myth Realized.\n{W}: Until end of turn, Myth Realized becomes a Monk Avatar creature in addition to its other types and gains "This creature's power and toughness are each equal to the number of lore counters on it."