mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- Some style and logic fixes.
This commit is contained in:
@@ -1314,17 +1314,14 @@ public class AttachAi extends SpellAbilityAi {
|
|||||||
|
|
||||||
// Don't play if would choose a color the target is already protected from
|
// Don't play if would choose a color the target is already protected from
|
||||||
if (sa.getHostCard().hasSVar("ChosenProtection")) {
|
if (sa.getHostCard().hasSVar("ChosenProtection")) {
|
||||||
CardCollectionView oppAllCards = CardCollection.combine
|
CardCollectionView oppAllCards = ai.getOpponents().getCardsIn(ZoneType.Battlefield);
|
||||||
(ComputerUtil.getOpponentFor(ai).getAllCards());
|
|
||||||
String cc = ComputerUtilCard.getMostProminentColor(oppAllCards);
|
String cc = ComputerUtilCard.getMostProminentColor(oppAllCards);
|
||||||
if (card.hasKeyword("Protection from " + cc.toLowerCase())) {
|
if (card.hasKeyword("Protection from " + cc.toLowerCase())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Also don't play if it would destroy own Aura
|
// Also don't play if it would destroy own Aura
|
||||||
for (Card c : card.getEnchantedBy(false)) {
|
for (Card c : card.getEnchantedBy(false)) {
|
||||||
if ((c.getController().equals(ai))
|
if ((c.getController().equals(ai)) && (c.isOfColor(cc))) {
|
||||||
&& (c.isOfColor(cc))
|
|
||||||
) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user