mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- Some more fine-grained control over AILogic PayEnergyConservatively.
This commit is contained in:
@@ -56,7 +56,8 @@ public enum AiProps { /** */
|
|||||||
TOKEN_GENERATION_ALWAYS_IF_OPP_ATTACKS ("true"), /** */
|
TOKEN_GENERATION_ALWAYS_IF_OPP_ATTACKS ("true"), /** */
|
||||||
COMBAT_ASSAULT_ATTACK_EVASION_PREDICTION ("true"), /** */
|
COMBAT_ASSAULT_ATTACK_EVASION_PREDICTION ("true"), /** */
|
||||||
COMBAT_ATTRITION_ATTACK_EVASION_PREDICTION ("true"), /** */
|
COMBAT_ATTRITION_ATTACK_EVASION_PREDICTION ("true"), /** */
|
||||||
CONSERVATIVE_ENERGY_PAYMENT_ONLY_IN_COMBAT ("true"); /** */
|
CONSERVATIVE_ENERGY_PAYMENT_ONLY_IN_COMBAT ("true"), /** */
|
||||||
|
CONSERVATIVE_ENERGY_PAYMENT_ONLY_DEFENSIVELY ("true"); /** */
|
||||||
|
|
||||||
private final String strDefaultVal;
|
private final String strDefaultVal;
|
||||||
|
|
||||||
|
|||||||
@@ -830,7 +830,6 @@ public abstract class GameState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void applyCountersToGameEntity(GameEntity entity, String counterString) {
|
private void applyCountersToGameEntity(GameEntity entity, String counterString) {
|
||||||
//entity.setCounters(new HashMap<CounterType, Integer>());
|
|
||||||
entity.clearCounters();
|
entity.clearCounters();
|
||||||
String[] allCounterStrings = counterString.split(",");
|
String[] allCounterStrings = counterString.split(",");
|
||||||
for (final String counterPair : allCounterStrings) {
|
for (final String counterPair : allCounterStrings) {
|
||||||
|
|||||||
@@ -228,12 +228,14 @@ public class CountersPutAi extends SpellAbilityAi {
|
|||||||
if ("PayEnergyConservatively".equals(sa.getParam("AILogic"))) {
|
if ("PayEnergyConservatively".equals(sa.getParam("AILogic"))) {
|
||||||
boolean onlyInCombat = ai.getController().isAI()
|
boolean onlyInCombat = ai.getController().isAI()
|
||||||
&& ((PlayerControllerAi) ai.getController()).getAi().getBooleanProperty(AiProps.CONSERVATIVE_ENERGY_PAYMENT_ONLY_IN_COMBAT);
|
&& ((PlayerControllerAi) ai.getController()).getAi().getBooleanProperty(AiProps.CONSERVATIVE_ENERGY_PAYMENT_ONLY_IN_COMBAT);
|
||||||
|
boolean onlyDefensive = ai.getController().isAI()
|
||||||
|
&& ((PlayerControllerAi) ai.getController()).getAi().getBooleanProperty(AiProps.CONSERVATIVE_ENERGY_PAYMENT_ONLY_DEFENSIVELY);
|
||||||
|
|
||||||
if (playAggro) {
|
if (playAggro) {
|
||||||
// aggro profiles ignore conservative play for this AI logic
|
// aggro profiles ignore conservative play for this AI logic
|
||||||
return true;
|
return true;
|
||||||
} else if (ai.getGame().getCombat() != null && sa.getHostCard() != null) {
|
} else if (ai.getGame().getCombat() != null && sa.getHostCard() != null) {
|
||||||
if (ai.getGame().getCombat().isAttacking(sa.getHostCard())) {
|
if (ai.getGame().getCombat().isAttacking(sa.getHostCard()) && !onlyDefensive) {
|
||||||
return true;
|
return true;
|
||||||
} else if (ai.getGame().getCombat().isBlocking(sa.getHostCard())) {
|
} else if (ai.getGame().getCombat().isBlocking(sa.getHostCard())) {
|
||||||
// when blocking, consider this if it's possible to save the blocker and/or kill at least one attacker
|
// when blocking, consider this if it's possible to save the blocker and/or kill at least one attacker
|
||||||
|
|||||||
@@ -62,3 +62,6 @@ COMBAT_ATTRITION_ATTACK_EVASION_PREDICTION=false
|
|||||||
# AILogic$ PayEnergyConservatively (used for Britsling Hydra and Longtusk Cub) will only
|
# AILogic$ PayEnergyConservatively (used for Britsling Hydra and Longtusk Cub) will only
|
||||||
# be used in case the creature is engaged in favorable combat
|
# be used in case the creature is engaged in favorable combat
|
||||||
CONSERVATIVE_ENERGY_PAYMENT_ONLY_IN_COMBAT=true
|
CONSERVATIVE_ENERGY_PAYMENT_ONLY_IN_COMBAT=true
|
||||||
|
# If true, the conservative energy payment will not be used when the creature is attacking,
|
||||||
|
# only when it's blocking (for more controlling AIs)
|
||||||
|
CONSERVATIVE_ENERGY_PAYMENT_ONLY_DEFENSIVELY=true
|
||||||
|
|||||||
@@ -62,3 +62,6 @@ COMBAT_ATTRITION_ATTACK_EVASION_PREDICTION=false
|
|||||||
# AILogic$ PayEnergyConservatively (used for Britsling Hydra and Longtusk Cub) will only
|
# AILogic$ PayEnergyConservatively (used for Britsling Hydra and Longtusk Cub) will only
|
||||||
# be used in case the creature is engaged in favorable combat
|
# be used in case the creature is engaged in favorable combat
|
||||||
CONSERVATIVE_ENERGY_PAYMENT_ONLY_IN_COMBAT=true
|
CONSERVATIVE_ENERGY_PAYMENT_ONLY_IN_COMBAT=true
|
||||||
|
# If true, the conservative energy payment will not be used when the creature is attacking,
|
||||||
|
# only when it's blocking (for more controlling AIs)
|
||||||
|
CONSERVATIVE_ENERGY_PAYMENT_ONLY_DEFENSIVELY=false
|
||||||
@@ -62,3 +62,6 @@ COMBAT_ATTRITION_ATTACK_EVASION_PREDICTION=true
|
|||||||
# AILogic$ PayEnergyConservatively (used for Britsling Hydra and Longtusk Cub) will only
|
# AILogic$ PayEnergyConservatively (used for Britsling Hydra and Longtusk Cub) will only
|
||||||
# be used in case the creature is engaged in favorable combat
|
# be used in case the creature is engaged in favorable combat
|
||||||
CONSERVATIVE_ENERGY_PAYMENT_ONLY_IN_COMBAT=true
|
CONSERVATIVE_ENERGY_PAYMENT_ONLY_IN_COMBAT=true
|
||||||
|
# If true, the conservative energy payment will not be used when the creature is attacking,
|
||||||
|
# only when it's blocking (for more controlling AIs)
|
||||||
|
CONSERVATIVE_ENERGY_PAYMENT_ONLY_DEFENSIVELY=false
|
||||||
|
|||||||
@@ -62,3 +62,6 @@ COMBAT_ATTRITION_ATTACK_EVASION_PREDICTION=false
|
|||||||
# AILogic$ PayEnergyConservatively (used for Britsling Hydra and Longtusk Cub) will only
|
# AILogic$ PayEnergyConservatively (used for Britsling Hydra and Longtusk Cub) will only
|
||||||
# be used in case the creature is engaged in favorable combat
|
# be used in case the creature is engaged in favorable combat
|
||||||
CONSERVATIVE_ENERGY_PAYMENT_ONLY_IN_COMBAT=false
|
CONSERVATIVE_ENERGY_PAYMENT_ONLY_IN_COMBAT=false
|
||||||
|
# If true, the conservative energy payment will not be used when the creature is attacking,
|
||||||
|
# only when it's blocking (for more controlling AIs)
|
||||||
|
CONSERVATIVE_ENERGY_PAYMENT_ONLY_DEFENSIVELY=false
|
||||||
|
|||||||
Reference in New Issue
Block a user