mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38: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
|
||||
if (sa.getHostCard().hasSVar("ChosenProtection")) {
|
||||
CardCollectionView oppAllCards = CardCollection.combine
|
||||
(ComputerUtil.getOpponentFor(ai).getAllCards());
|
||||
CardCollectionView oppAllCards = ai.getOpponents().getCardsIn(ZoneType.Battlefield);
|
||||
String cc = ComputerUtilCard.getMostProminentColor(oppAllCards);
|
||||
if (card.hasKeyword("Protection from " + cc.toLowerCase())) {
|
||||
return false;
|
||||
}
|
||||
// Also don't play if it would destroy own Aura
|
||||
for (Card c : card.getEnchantedBy(false)) {
|
||||
if ((c.getController().equals(ai))
|
||||
&& (c.isOfColor(cc))
|
||||
) {
|
||||
if ((c.getController().equals(ai)) && (c.isOfColor(cc))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user