mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 02:38:02 +00:00
Add more logic
This commit is contained in:
@@ -433,17 +433,22 @@ public class AiController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// don't play the land if it has cycling and enough lands are available
|
|
||||||
final FCollectionView<SpellAbility> spellAbilities = c.getSpellAbilities();
|
|
||||||
|
|
||||||
final CardCollectionView hand = player.getCardsIn(ZoneType.Hand);
|
final CardCollectionView hand = player.getCardsIn(ZoneType.Hand);
|
||||||
CardCollection lands = new CardCollection(battlefield);
|
CardCollection lands = new CardCollection(battlefield);
|
||||||
lands.addAll(hand);
|
lands.addAll(hand);
|
||||||
lands = CardLists.filter(lands, CardPredicates.Presets.LANDS);
|
lands = CardLists.filter(lands, CardPredicates.Presets.LANDS);
|
||||||
int maxCmcInHand = Aggregates.max(hand, CardPredicates.Accessors.fnGetCmc);
|
int maxCmcInHand = Aggregates.max(hand, CardPredicates.Accessors.fnGetCmc);
|
||||||
for (final SpellAbility sa : spellAbilities) {
|
|
||||||
if (sa.isCycling()) {
|
if (lands.size() >= Math.max(maxCmcInHand, 6)) {
|
||||||
if (lands.size() >= Math.max(maxCmcInHand, 6)) {
|
// don't play MDFC land if other side is spell and enough lands are available
|
||||||
|
if (!c.isLand() || (c.isModal() && !c.getState(CardStateName.Modal).getType().isLand())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// don't play the land if it has cycling and enough lands are available
|
||||||
|
final FCollectionView<SpellAbility> spellAbilities = c.getSpellAbilities();
|
||||||
|
for (final SpellAbility sa : spellAbilities) {
|
||||||
|
if (sa.isCycling()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user