mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- Some minor refactoring in AiBlockController related to the previous commit.
This commit is contained in:
@@ -540,13 +540,11 @@ public class AiBlockController {
|
|||||||
List<Card> currentAttackers = new ArrayList<>(attackersLeft);
|
List<Card> currentAttackers = new ArrayList<>(attackersLeft);
|
||||||
List<Card> killingBlockers;
|
List<Card> killingBlockers;
|
||||||
|
|
||||||
for (final Card attacker : attackersLeft) {
|
// Parameters related to randomly trading when blocking (need to be enabled in the AI profile)
|
||||||
|
|
||||||
boolean enableRandomTrades = false;
|
boolean enableRandomTrades = false;
|
||||||
boolean randomTradeIfBehindOnBoard = false;
|
boolean randomTradeIfBehindOnBoard = false;
|
||||||
int minRandomTradeChance = 0;
|
int minRandomTradeChance = 0;
|
||||||
int maxRandomTradeChance = 0;
|
int maxRandomTradeChance = 0;
|
||||||
|
|
||||||
if (ai.getController().isAI()) {
|
if (ai.getController().isAI()) {
|
||||||
AiController aic = ((PlayerControllerAi) ai.getController()).getAi();
|
AiController aic = ((PlayerControllerAi) ai.getController()).getAi();
|
||||||
enableRandomTrades = aic.getBooleanProperty(AiProps.ENABLE_RANDOM_FAVORABLE_TRADES_ON_BLOCK);
|
enableRandomTrades = aic.getBooleanProperty(AiProps.ENABLE_RANDOM_FAVORABLE_TRADES_ON_BLOCK);
|
||||||
@@ -555,6 +553,8 @@ public class AiBlockController {
|
|||||||
maxRandomTradeChance = aic.getIntProperty(AiProps.MAX_CHANCE_TO_RANDOMLY_TRADE_ON_BLOCK);
|
maxRandomTradeChance = aic.getIntProperty(AiProps.MAX_CHANCE_TO_RANDOMLY_TRADE_ON_BLOCK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (final Card attacker : attackersLeft) {
|
||||||
|
|
||||||
if (attacker.hasStartOfKeyword("CantBeBlockedByAmount LT")
|
if (attacker.hasStartOfKeyword("CantBeBlockedByAmount LT")
|
||||||
|| attacker.hasKeyword("Menace")
|
|| attacker.hasKeyword("Menace")
|
||||||
|| attacker.hasKeyword("CARDNAME can't be blocked unless all creatures defending player controls block it.")) {
|
|| attacker.hasKeyword("CARDNAME can't be blocked unless all creatures defending player controls block it.")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user