From 95db50f07be6a57ce1b720ab7deb6fbf712978df Mon Sep 17 00:00:00 2001 From: Agetian Date: Wed, 12 Dec 2018 08:47:36 +0300 Subject: [PATCH] - Renamed a few things for clarity. --- forge-ai/src/main/java/forge/ai/AiCardMemory.java | 10 +++++----- forge-ai/src/main/java/forge/ai/AiController.java | 10 +++++----- forge-ai/src/main/java/forge/ai/ComputerUtilMana.java | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/forge-ai/src/main/java/forge/ai/AiCardMemory.java b/forge-ai/src/main/java/forge/ai/AiCardMemory.java index a94287e549e..17a58d5eaf1 100644 --- a/forge-ai/src/main/java/forge/ai/AiCardMemory.java +++ b/forge-ai/src/main/java/forge/ai/AiCardMemory.java @@ -51,7 +51,7 @@ public class AiCardMemory { HELD_MANA_SOURCES_FOR_MAIN2, // These mana sources will not be used before Main 2 HELD_MANA_SOURCES_FOR_DECLBLK, // These mana sources will not be used before Combat - Declare Blockers HELD_MANA_SOURCES_FOR_ENEMY_DECLBLK, // These mana sources will not be used before the opponent's Combat - Declare Blockers - HELD_MANA_SOURCES_FOR_NEXT_PRIORITY, // These mana sources will not be used until the next time the AI receives priority + HELD_MANA_SOURCES_FOR_NEXT_SPELL, // These mana sources will not be used until the next time the AI chooses a spell to cast ATTACHED_THIS_TURN, // These equipments were attached to something already this turn ANIMATED_THIS_TURN, // These cards had their AF Animate effect activated this turn BOUNCED_THIS_TURN, // These cards were bounced this turn @@ -66,7 +66,7 @@ public class AiCardMemory { private final Set memHeldManaSources; private final Set memHeldManaSourcesForCombat; private final Set memHeldManaSourcesForEnemyCombat; - private final Set memHeldManaSourcesForNextPriority; + private final Set memHeldManaSourcesForNextSpell; private final Set memAttachedThisTurn; private final Set memAnimatedThisTurn; private final Set memBouncedThisTurn; @@ -86,7 +86,7 @@ public class AiCardMemory { this.memTrickAttackers = new HashSet<>(); this.memChosenFogEffect = new HashSet<>(); this.memMarkedToAvoidReentry = new HashSet<>(); - this.memHeldManaSourcesForNextPriority = new HashSet<>(); + this.memHeldManaSourcesForNextSpell = new HashSet<>(); } private Set getMemorySet(MemorySet set) { @@ -101,8 +101,8 @@ public class AiCardMemory { return memHeldManaSourcesForCombat; case HELD_MANA_SOURCES_FOR_ENEMY_DECLBLK: return memHeldManaSourcesForEnemyCombat; - case HELD_MANA_SOURCES_FOR_NEXT_PRIORITY: - return memHeldManaSourcesForNextPriority; + case HELD_MANA_SOURCES_FOR_NEXT_SPELL: + return memHeldManaSourcesForNextSpell; case ATTACHED_THIS_TURN: return memAttachedThisTurn; case ANIMATED_THIS_TURN: diff --git a/forge-ai/src/main/java/forge/ai/AiController.java b/forge-ai/src/main/java/forge/ai/AiController.java index bf60b900916..1c6e1a00276 100644 --- a/forge-ai/src/main/java/forge/ai/AiController.java +++ b/forge-ai/src/main/java/forge/ai/AiController.java @@ -641,7 +641,7 @@ public class AiController { return reserveManaSources(sa, phaseType, enemy, true, null); } - public boolean reserveManaSources(SpellAbility sa, PhaseType phaseType, boolean enemy, boolean nextPriority, SpellAbility exceptForThisSa) { + public boolean reserveManaSources(SpellAbility sa, PhaseType phaseType, boolean enemy, boolean forNextSpell, SpellAbility exceptForThisSa) { ManaCostBeingPaid cost = ComputerUtilMana.calculateManaCost(sa, true, 0); CardCollection manaSources = ComputerUtilMana.getManaSourcesToPayCost(cost, sa, player); @@ -655,8 +655,8 @@ public class AiController { } AiCardMemory.MemorySet memSet; - if (phaseType == null && nextPriority) { - memSet = AiCardMemory.MemorySet.HELD_MANA_SOURCES_FOR_NEXT_PRIORITY; + if (phaseType == null && forNextSpell) { + memSet = AiCardMemory.MemorySet.HELD_MANA_SOURCES_FOR_NEXT_SPELL; } else { switch (phaseType) { case MAIN2: @@ -1334,8 +1334,8 @@ public class AiController { // re-created if needed and used for any AI logic that needs it. predictedCombat = null; - // Reset priority mana reservation - AiCardMemory.clearMemorySet(player, AiCardMemory.MemorySet.HELD_MANA_SOURCES_FOR_NEXT_PRIORITY); + // Reset priority mana reservation that's meant to work for one spell only + AiCardMemory.clearMemorySet(player, AiCardMemory.MemorySet.HELD_MANA_SOURCES_FOR_NEXT_SPELL); if (useSimulation) { return singleSpellAbilityList(simPicker.chooseSpellAbilityToPlay(null)); diff --git a/forge-ai/src/main/java/forge/ai/ComputerUtilMana.java b/forge-ai/src/main/java/forge/ai/ComputerUtilMana.java index 9bbdc3a56a6..7ad1d8a9a3e 100644 --- a/forge-ai/src/main/java/forge/ai/ComputerUtilMana.java +++ b/forge-ai/src/main/java/forge/ai/ComputerUtilMana.java @@ -857,7 +857,7 @@ public class ComputerUtilMana { int chanceToReserve = aic.getIntProperty(AiProps.RESERVE_MANA_FOR_MAIN2_CHANCE); // Mana reserved for spell synchronization - if (AiCardMemory.isRememberedCard(ai, sourceCard, AiCardMemory.MemorySet.HELD_MANA_SOURCES_FOR_NEXT_PRIORITY)) { + if (AiCardMemory.isRememberedCard(ai, sourceCard, AiCardMemory.MemorySet.HELD_MANA_SOURCES_FOR_NEXT_SPELL)) { return true; }