mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
ClashAi & ManifestAi: use shorter form now for looking at TopCard of Library
This commit is contained in:
@@ -46,7 +46,7 @@ public class ClashAi extends SpellAbilityAi {
|
||||
}
|
||||
|
||||
CardCollectionView col = ai.getCardsIn(ZoneType.Library);
|
||||
if (!col.isEmpty() && col.getFirst().getView().mayPlayerLook(ai.getView())) {
|
||||
if (!col.isEmpty() && col.getFirst().mayPlayerLook(ai)) {
|
||||
final Card top = col.get(0);
|
||||
for (Player p : options) {
|
||||
final Card oppTop = p.getCardsIn(ZoneType.Library).getFirst();
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package forge.ai.ability;
|
||||
|
||||
import forge.ai.*;
|
||||
import forge.ai.ComputerUtil;
|
||||
import forge.ai.ComputerUtilMana;
|
||||
import forge.ai.SpellAbilityAi;
|
||||
import forge.game.Game;
|
||||
import forge.game.card.Card;
|
||||
import forge.game.card.CardCollectionView;
|
||||
@@ -34,6 +36,7 @@ public class ManifestAi extends SpellAbilityAi {
|
||||
/**
|
||||
* Checks if the AI will play a SpellAbility based on its phase restrictions
|
||||
*/
|
||||
@Override
|
||||
protected boolean checkPhaseRestrictions(final Player ai, final SpellAbility sa, final PhaseHandler ph) {
|
||||
final Card source = sa.getHostCard();
|
||||
// Only manifest things on your turn if sorcery speed, or would pump one of my creatures
|
||||
@@ -91,7 +94,7 @@ public class ManifestAi extends SpellAbilityAi {
|
||||
}
|
||||
|
||||
final Card topCard = library.getFirst();
|
||||
if (topCard.getView().mayPlayerLook(ai.getView())) {
|
||||
if (topCard.mayPlayerLook(ai)) {
|
||||
// try to avoid manifest a non Permanent
|
||||
if (!topCard.isPermanent())
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user