mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
CardProperty: implement generic "attacking DefinedGameEntity"
This commit is contained in:
@@ -25,6 +25,7 @@ import forge.game.zone.ZoneType;
|
|||||||
import forge.item.PaperCard;
|
import forge.item.PaperCard;
|
||||||
import forge.util.Expressions;
|
import forge.util.Expressions;
|
||||||
import forge.util.TextUtil;
|
import forge.util.TextUtil;
|
||||||
|
import forge.util.collect.FCollection;
|
||||||
import forge.util.collect.FCollectionView;
|
import forge.util.collect.FCollectionView;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
@@ -1467,6 +1468,14 @@ public class CardProperty {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (property.startsWith("attacking ")) { // generic "attacking [DefinedGameEntity]"
|
||||||
|
FCollection<GameEntity> defined = AbilityUtils.getDefinedEntities(source, property.split(" ")[1],
|
||||||
|
spellAbility);
|
||||||
|
final GameEntity defender = combat.getDefenderByAttacker(card);
|
||||||
|
if (!defined.contains(defender)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if (property.startsWith("notattacking")) {
|
} else if (property.startsWith("notattacking")) {
|
||||||
return null == combat || !combat.isAttacking(card);
|
return null == combat || !combat.isAttacking(card);
|
||||||
} else if (property.equals("attackedThisCombat")) {
|
} else if (property.equals("attackedThisCombat")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user