mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
- Improved implementation of searching for targets in SpellAbilityTargetingCards + a better comment.
This commit is contained in:
@@ -1166,7 +1166,9 @@ public class AbilityUtils {
|
|||||||
final Object o = root.getTriggeringObject(triggeringType);
|
final Object o = root.getTriggeringObject(triggeringType);
|
||||||
if (o instanceof SpellAbility) {
|
if (o instanceof SpellAbility) {
|
||||||
s = (SpellAbility) o;
|
s = (SpellAbility) o;
|
||||||
// if there is no target information in SA, look in SpellAbilityTargetingCards triggering object before giving up
|
// if there is no target information in SA but targets are listed in SpellAbilityTargeting cards, copy that
|
||||||
|
// information so it's not lost if the calling code is interested in targets of the triggered SA.
|
||||||
|
if (triggeringType.equals("SpellAbility")) {
|
||||||
final CardCollectionView tgtList = (CardCollectionView)root.getTriggeringObject("SpellAbilityTargetingCards");
|
final CardCollectionView tgtList = (CardCollectionView)root.getTriggeringObject("SpellAbilityTargetingCards");
|
||||||
if (s.getTargets() != null && s.getTargets().getNumTargeted() == 0) {
|
if (s.getTargets() != null && s.getTargets().getNumTargeted() == 0) {
|
||||||
if (tgtList != null && tgtList.size() > 0) {
|
if (tgtList != null && tgtList.size() > 0) {
|
||||||
@@ -1179,6 +1181,7 @@ public class AbilityUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (defined.equals("Remembered")) {
|
else if (defined.equals("Remembered")) {
|
||||||
for (final Object o : card.getRemembered()) {
|
for (final Object o : card.getRemembered()) {
|
||||||
if (o instanceof Card) {
|
if (o instanceof Card) {
|
||||||
|
|||||||
Reference in New Issue
Block a user