mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
- Simplify source lookup
This commit is contained in:
@@ -472,16 +472,14 @@ public class AiCostDecision extends CostDecisionMakerBase {
|
|||||||
|
|
||||||
if (cost.getRevealFrom().size() == 2 && cost.getRevealFrom().containsAll(Arrays.asList(ZoneType.Hand, ZoneType.Battlefield))) { // RevealOrChoose
|
if (cost.getRevealFrom().size() == 2 && cost.getRevealFrom().containsAll(Arrays.asList(ZoneType.Hand, ZoneType.Battlefield))) { // RevealOrChoose
|
||||||
String aiLogic = ability.getParamOrDefault("AILogic", "");
|
String aiLogic = ability.getParamOrDefault("AILogic", "");
|
||||||
CardCollection battlefieldOrHand = CardLists.getValidCards(player.getCardsIn(ZoneType.Battlefield),
|
hand = CardLists.getValidCards(hand, type.split(";"), player, source, ability);
|
||||||
type.split(";"), player, source, ability);
|
|
||||||
battlefieldOrHand.addAll(CardLists.getValidCards(hand, type.split(";"), player, source, ability));
|
|
||||||
|
|
||||||
if (aiLogic.startsWith("PowerAtLeast.")) {
|
if (aiLogic.startsWith("PowerAtLeast.")) {
|
||||||
int minPower = Integer.parseInt(aiLogic.substring(aiLogic.indexOf(".") + 1));
|
int minPower = Integer.parseInt(aiLogic.substring(aiLogic.indexOf(".") + 1));
|
||||||
battlefieldOrHand = CardLists.filterPower(battlefieldOrHand, minPower);
|
hand = CardLists.filterPower(hand, minPower);
|
||||||
}
|
}
|
||||||
|
|
||||||
return battlefieldOrHand.isEmpty() ? null : PaymentDecision.card(getBestCreatureAI(battlefieldOrHand));
|
return hand.isEmpty() ? null : PaymentDecision.card(getBestCreatureAI(hand));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cost.getType().equals("SameColor")) {
|
if (cost.getType().equals("SameColor")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user