mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38: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"), /** */
|
||||
COMBAT_ASSAULT_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;
|
||||
|
||||
|
||||
@@ -830,7 +830,6 @@ public abstract class GameState {
|
||||
}
|
||||
|
||||
private void applyCountersToGameEntity(GameEntity entity, String counterString) {
|
||||
//entity.setCounters(new HashMap<CounterType, Integer>());
|
||||
entity.clearCounters();
|
||||
String[] allCounterStrings = counterString.split(",");
|
||||
for (final String counterPair : allCounterStrings) {
|
||||
|
||||
@@ -228,12 +228,14 @@ public class CountersPutAi extends SpellAbilityAi {
|
||||
if ("PayEnergyConservatively".equals(sa.getParam("AILogic"))) {
|
||||
boolean onlyInCombat = ai.getController().isAI()
|
||||
&& ((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) {
|
||||
// aggro profiles ignore conservative play for this AI logic
|
||||
return true;
|
||||
} 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;
|
||||
} 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
|
||||
|
||||
@@ -62,3 +62,6 @@ COMBAT_ATTRITION_ATTACK_EVASION_PREDICTION=false
|
||||
# AILogic$ PayEnergyConservatively (used for Britsling Hydra and Longtusk Cub) will only
|
||||
# be used in case the creature is engaged in favorable combat
|
||||
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
|
||||
|
||||
@@ -61,4 +61,7 @@ COMBAT_ATTRITION_ATTACK_EVASION_PREDICTION=false
|
||||
|
||||
# AILogic$ PayEnergyConservatively (used for Britsling Hydra and Longtusk Cub) will only
|
||||
# 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
|
||||
# be used in case the creature is engaged in favorable combat
|
||||
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
|
||||
# be used in case the creature is engaged in favorable combat
|
||||
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