Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
ca6f7a1
Auto-tap: Support for colorless cost filters
Eradev Jul 7, 2026
928b428
Auto-tap: Filter land support
Eradev Jul 7, 2026
e79c515
Auto-tap: Tighten useless filters
Eradev Jul 7, 2026
f118870
Auto-tap: Fix tests
Eradev Jul 7, 2026
70f5b33
Auto-tap: Line optimization
Eradev Jul 9, 2026
b131f3f
Auto-tap: Prevent mana from leaking in test
Eradev Jul 9, 2026
aaaa31b
Auto-tap: Optimization pass
Eradev Jul 9, 2026
1bb809c
Auto-tap: Large board optimization pass
Eradev Jul 9, 2026
53e3cf0
Auto-tap: Fix incorrect consolidator keeping
Eradev Jul 9, 2026
bf30a54
Auto-tap: Disable expensive castability probe in dry-run
Eradev Jul 9, 2026
e53b166
Auto-tap: Remove ThreadLocal
Eradev Jul 9, 2026
8982c51
Fix merge
Eradev Jul 10, 2026
ee6d434
Auto-tap: Optimization pass
Eradev Jul 10, 2026
91a6245
Auto-tap: Support Mana Flare and Utopia Sprawl
Eradev Jul 10, 2026
de14964
Auto-tap: Ensure prod meets test
Eradev Jul 10, 2026
6fbf8bb
Auto-tap: Payment plan
Eradev Jul 10, 2026
dd8c462
Auto-tap: Optimization pass
Eradev Jul 10, 2026
a14273e
Auto-tap: Skip calc on castability probe
Eradev Jul 11, 2026
ab1f158
Auto-tap: Extract part of the castability probe + option to disable f…
Eradev Jul 11, 2026
8099d1f
Auto-tap: Added SVar:AIManaReserve:True. Make cards less desirable fo…
Eradev Jul 11, 2026
c50e62b
Auto-tap: Avoid sac-others +disposables ordering for mana generated
Eradev Jul 11, 2026
2468398
Auto-tap: Support for type-specific bonus
Eradev Jul 11, 2026
dd4bd5f
Auto-tap: More sorting
Eradev Jul 11, 2026
633092d
Auto-tap: Support for Market Festival
Eradev Jul 11, 2026
5b4cf75
Auto-tap: Support for Gemstone Caverns
Eradev Jul 11, 2026
155bb43
Auto-tap: Optimization pass
Eradev Jul 11, 2026
68ff7b8
Auto-tap: Support for AnyDifferent
Eradev Jul 11, 2026
354ea72
Auto-tap: Support for Cabal Coffers
Eradev Jul 11, 2026
18f6b22
Auto-tap: Penalize non-untap rocks
Eradev Jul 11, 2026
2cbb4fc
Auto-tap: Mana waste detection
Eradev Jul 11, 2026
5d9543d
Auto-tap: NPE pass
Eradev Jul 11, 2026
2c05638
Auto-tap: Prevent M2 timeout
Eradev Jul 11, 2026
0d75cb2
Auto-tap: canPayManaCost caching
Eradev Jul 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions forge-ai/src/main/java/forge/ai/AiController.java
Original file line number Diff line number Diff line change
Expand Up @@ -1346,6 +1346,7 @@ private List<SpellAbility> singleSpellAbilityList(SpellAbility sa) {

public List<SpellAbility> chooseSpellAbilityToPlay() {
AiCache.clear();
ComputerUtilMana.beginAffordabilityCachePass();
// Reset cached predicted combat, as it may be stale. It will be
// re-created if needed and used for any AI logic that needs it.
predictedCombat = null;
Expand Down
404 changes: 404 additions & 0 deletions forge-ai/src/main/java/forge/ai/CastabilityProbe.java

Large diffs are not rendered by default.

6,122 changes: 5,599 additions & 523 deletions forge-ai/src/main/java/forge/ai/ComputerUtilMana.java

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions forge-ai/src/main/java/forge/ai/PlayerControllerAi.java
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,13 @@ public Map<GameEntity, Integer> divideShield(Card effectSource, Map<GameEntity,

@Override
public Map<Byte, Integer> specifyManaCombo(SpellAbility sa, ColorSet colorSet, int manaAmount, boolean different) {
if (sa.getApi() == ApiType.Mana) {
final Map<Byte, Integer> fromPayment = ComputerUtilMana.specifyComboFromActivePayment(player, sa,
manaAmount, different);
if (fromPayment != null) {
return fromPayment;
}
}
Map<Byte, Integer> result = new HashMap<>();
for (int i = 0; i < manaAmount; ++i) {
Byte chosen = chooseColor("", sa, colorSet);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,10 @@ public Score evaluateSa(final SimulationController controller, PhaseType phase,
simulator.setInterceptor(choicesIterator);
// I feel like something here is making a wrong assumption about what the target is
lastScore = simulator.simulateSpellAbility(sa);
final int castBonus = ComputerUtilMana.estimateCastBonusForSpell(sa, player);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you having a LLM go wild?

this is completely out of scope

if (castBonus != 0) {
lastScore = new Score(lastScore.value + castBonus, lastScore.summonSickValue + castBonus);
}
numSimulations++;
if (lastScore.value > bestScore.value) {
bestScore = lastScore;
Expand Down
2 changes: 2 additions & 0 deletions forge-gui-desktop/src/test/java/forge/ai/AITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ public void initializeModel() {
FModel.initialize(null, preferences -> {
preferences.setPref(FPref.LOAD_CARD_SCRIPTS_LAZILY, false);
preferences.setPref(FPref.UI_LANGUAGE, "en-US");
preferences.setPref(FPref.MANA_PAYMENT_CASTABILITY_PROBE, true);
return null;
});
CastabilityProbe.enableForTests();
initialized = true;
}

Expand Down
Loading
Loading