mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +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> 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 randomTradeIfBehindOnBoard = false;
|
||||
int minRandomTradeChance = 0;
|
||||
int maxRandomTradeChance = 0;
|
||||
|
||||
if (ai.getController().isAI()) {
|
||||
AiController aic = ((PlayerControllerAi) ai.getController()).getAi();
|
||||
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);
|
||||
}
|
||||
|
||||
for (final Card attacker : attackersLeft) {
|
||||
|
||||
if (attacker.hasStartOfKeyword("CantBeBlockedByAmount LT")
|
||||
|| attacker.hasKeyword("Menace")
|
||||
|| attacker.hasKeyword("CARDNAME can't be blocked unless all creatures defending player controls block it.")) {
|
||||
|
||||
Reference in New Issue
Block a user