diff --git a/forge-ai/src/main/java/forge/ai/AiBlockController.java b/forge-ai/src/main/java/forge/ai/AiBlockController.java index c7b7b713999..d6377661d1d 100644 --- a/forge-ai/src/main/java/forge/ai/AiBlockController.java +++ b/forge-ai/src/main/java/forge/ai/AiBlockController.java @@ -1232,6 +1232,7 @@ public class AiBlockController { boolean enableRandomTrades = false; boolean randomTradeIfBehindOnBoard = false; boolean randomTradeIfCreatInHand = false; + int chanceModForEmbalm = 0; int chanceToTradeToSaveWalker = 0; int chanceToTradeDownToSaveWalker = 0; int minRandomTradeChance = 0; @@ -1247,6 +1248,7 @@ public class AiBlockController { randomTradeIfCreatInHand = aic.getBooleanProperty(AiProps.ALSO_TRADE_WHEN_HAVE_A_REPLACEMENT_CREAT); minRandomTradeChance = aic.getIntProperty(AiProps.MIN_CHANCE_TO_RANDOMLY_TRADE_ON_BLOCK); maxRandomTradeChance = aic.getIntProperty(AiProps.MAX_CHANCE_TO_RANDOMLY_TRADE_ON_BLOCK); + chanceModForEmbalm = aic.getIntProperty(AiProps.CHANCE_DECREASE_TO_TRADE_VS_EMBALM); maxCreatDiff = aic.getIntProperty(AiProps.MAX_DIFF_IN_CREATURE_COUNT_TO_TRADE); maxCreatDiffWithRepl = aic.getIntProperty(AiProps.MAX_DIFF_IN_CREATURE_COUNT_TO_TRADE_WITH_REPL); chanceToTradeToSaveWalker = aic.getIntProperty(AiProps.CHANCE_TO_TRADE_TO_SAVE_PLANESWALKER); @@ -1278,6 +1280,14 @@ public class AiBlockController { int evalAtk = ComputerUtilCard.evaluateCreature(attacker, true, false); int evalBlk = ComputerUtilCard.evaluateCreature(blocker, true, false); + boolean atkEmbalm = (attacker.hasStartOfKeyword("Embalm") || attacker.hasStartOfKeyword("Eternalize")) && !attacker.isToken(); + boolean blkEmbalm = (blocker.hasStartOfKeyword("Embalm") || blocker.hasStartOfKeyword("Eternalize")) && !blocker.isToken(); + + if (atkEmbalm && !blkEmbalm) { + // The opponent will eventually get his creature back, while the AI won't + chance = Math.min(0, chance - chanceModForEmbalm); + } + if (blocker.isFaceDown() && blocker.getState(CardStateName.Original).getType().isCreature()) { // if the blocker is a face-down creature (e.g. cast via Morph, Manifest), evaluate it // in relation to the original state, not to the Morph state diff --git a/forge-ai/src/main/java/forge/ai/AiProps.java b/forge-ai/src/main/java/forge/ai/AiProps.java index b1caabbc854..fde316c8604 100644 --- a/forge-ai/src/main/java/forge/ai/AiProps.java +++ b/forge-ai/src/main/java/forge/ai/AiProps.java @@ -51,6 +51,7 @@ public enum AiProps { /** */ MAX_DIFF_IN_CREATURE_COUNT_TO_TRADE_WITH_REPL ("1"), /** */ MIN_CHANCE_TO_RANDOMLY_TRADE_ON_BLOCK ("30"), /** */ MAX_CHANCE_TO_RANDOMLY_TRADE_ON_BLOCK ("70"), /** */ + CHANCE_DECREASE_TO_TRADE_VS_EMBALM ("30"), /** */ CHANCE_TO_TRADE_TO_SAVE_PLANESWALKER ("70"), /** */ CHANCE_TO_TRADE_DOWN_TO_SAVE_PLANESWALKER ("0"), /** */ THRESHOLD_TOKEN_CHUMP_TO_SAVE_PLANESWALKER ("135"), /** */ diff --git a/forge-gui/res/ai/Cautious.ai b/forge-gui/res/ai/Cautious.ai index d5564a18cb8..d1a0da2613d 100644 --- a/forge-gui/res/ai/Cautious.ai +++ b/forge-gui/res/ai/Cautious.ai @@ -47,6 +47,9 @@ MAX_DIFF_IN_CREATURE_COUNT_TO_TRADE_WITH_REPL=0 # Min and max chance to randomly aggressively trade when blocking (note that it will become 100 if the AI is in danger) MIN_CHANCE_TO_RANDOMLY_TRADE_ON_BLOCK=40 MAX_CHANCE_TO_RANDOMLY_TRADE_ON_BLOCK=65 +# The decrease amount for the trade chance when trading against a non-token Embalm/Eternalize creature with a non-token +# creature that does not have Embalm/Eternalize +CHANCE_DECREASE_TO_TRADE_VS_EMBALM=50 # Options to save / preserve loyalty of planeswalkers # Chance to trade a (worse or roughly equal) creature in order to save a planeswalker or preserve its loyalty @@ -68,7 +71,7 @@ CHEAT_WITH_MANA_ON_SHUFFLE=true # The chance for the AI to attempt to hold land drops until Main 2 when it's safe and when it has nothing to potentially # do with the extra mana -HOLD_LAND_DROP_FOR_MAIN2_IF_UNUSED=0 +HOLD_LAND_DROP_FOR_MAIN2_IF_UNUSED=100 # Planechase logic DEFAULT_MAX_PLANAR_DIE_ROLLS_PER_TURN=1 diff --git a/forge-gui/res/ai/Default.ai b/forge-gui/res/ai/Default.ai index e4746f315a2..28ea9b09e5e 100644 --- a/forge-gui/res/ai/Default.ai +++ b/forge-gui/res/ai/Default.ai @@ -47,6 +47,9 @@ MAX_DIFF_IN_CREATURE_COUNT_TO_TRADE_WITH_REPL=1 # Min and max chance to randomly aggressively trade when blocking (note that it will become 100 if the AI is in danger) MIN_CHANCE_TO_RANDOMLY_TRADE_ON_BLOCK=30 MAX_CHANCE_TO_RANDOMLY_TRADE_ON_BLOCK=70 +# The decrease amount for the trade chance when trading against a non-token Embalm/Eternalize creature with a non-token +# creature that does not have Embalm/Eternalize +CHANCE_DECREASE_TO_TRADE_VS_EMBALM=30 # Options to save / preserve loyalty of planeswalkers # Chance to trade a (worse or roughly equal) creature in order to save a planeswalker or preserve its loyalty @@ -68,7 +71,7 @@ CHEAT_WITH_MANA_ON_SHUFFLE=true # The chance for the AI to attempt to hold land drops until Main 2 when it's safe and when it has nothing to potentially # do with the extra mana -HOLD_LAND_DROP_FOR_MAIN2_IF_UNUSED=0 +HOLD_LAND_DROP_FOR_MAIN2_IF_UNUSED=100 # Planechase logic DEFAULT_MAX_PLANAR_DIE_ROLLS_PER_TURN=1 diff --git a/forge-gui/res/ai/Experimental.ai b/forge-gui/res/ai/Experimental.ai index d1514f298d4..e54bb925384 100644 --- a/forge-gui/res/ai/Experimental.ai +++ b/forge-gui/res/ai/Experimental.ai @@ -47,6 +47,9 @@ MAX_DIFF_IN_CREATURE_COUNT_TO_TRADE_WITH_REPL=1 # Min and max chance to randomly aggressively trade when blocking (note that it will become 100 if the AI is in danger) MIN_CHANCE_TO_RANDOMLY_TRADE_ON_BLOCK=30 MAX_CHANCE_TO_RANDOMLY_TRADE_ON_BLOCK=70 +# The decrease amount for the trade chance when trading against a non-token Embalm/Eternalize creature with a non-token +# creature that does not have Embalm/Eternalize +CHANCE_DECREASE_TO_TRADE_VS_EMBALM=30 # Options to save / preserve loyalty of planeswalkers # Chance to trade a (worse or roughly equal) creature in order to save a planeswalker or preserve its loyalty diff --git a/forge-gui/res/ai/Reckless.ai b/forge-gui/res/ai/Reckless.ai index bb9d78336fe..6bb65394dcd 100644 --- a/forge-gui/res/ai/Reckless.ai +++ b/forge-gui/res/ai/Reckless.ai @@ -47,6 +47,9 @@ MAX_DIFF_IN_CREATURE_COUNT_TO_TRADE_WITH_REPL=1 # Min and max chance to randomly aggressively trade when blocking (note that it will become 100 if the AI is in danger) MIN_CHANCE_TO_RANDOMLY_TRADE_ON_BLOCK=0 MAX_CHANCE_TO_RANDOMLY_TRADE_ON_BLOCK=50 +# The decrease amount for the trade chance when trading against a non-token Embalm/Eternalize creature with a non-token +# creature that does not have Embalm/Eternalize +CHANCE_DECREASE_TO_TRADE_VS_EMBALM=10 # Options to save / preserve loyalty of planeswalkers # Chance to trade a (worse or roughly equal) creature in order to save a planeswalker or preserve its loyalty @@ -68,7 +71,7 @@ CHEAT_WITH_MANA_ON_SHUFFLE=true # The chance for the AI to attempt to hold land drops until Main 2 when it's safe and when it has nothing to potentially # do with the extra mana -HOLD_LAND_DROP_FOR_MAIN2_IF_UNUSED=0 +HOLD_LAND_DROP_FOR_MAIN2_IF_UNUSED=30 # Planechase logic DEFAULT_MAX_PLANAR_DIE_ROLLS_PER_TURN=1