mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
- Fixed Bronze Horse
- Fixed a crash when Precursor Golem is targeted with an Electrolyze
This commit is contained in:
@@ -101,7 +101,7 @@ public class CopySpellAbilityEffect extends SpellAbilityEffect {
|
||||
mayChoseNewTargets = false;
|
||||
for (GameObject o : candidates) {
|
||||
SpellAbility copy = CardFactory.copySpellAbilityAndSrcCard(card, chosenSA.getHostCard(), chosenSA, true);
|
||||
copy.resetFirstTarget(o);
|
||||
copy.resetFirstTarget(o, chosenSA);
|
||||
copies.add(copy);
|
||||
}
|
||||
} else {// Precursor Golem, Ink-Treader Nephilim
|
||||
@@ -118,7 +118,7 @@ public class CopySpellAbilityEffect extends SpellAbilityEffect {
|
||||
mayChoseNewTargets = false;
|
||||
for (Card c : valid) {
|
||||
SpellAbility copy = CardFactory.copySpellAbilityAndSrcCard(card, chosenSA.getHostCard(), chosenSA, true);
|
||||
copy.resetFirstTarget(c);
|
||||
copy.resetFirstTarget(c, chosenSA);
|
||||
copies.add(copy);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1409,12 +1409,16 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
|
||||
* Reset the first target.
|
||||
*
|
||||
*/
|
||||
public void resetFirstTarget(GameObject c) {
|
||||
public void resetFirstTarget(GameObject c, SpellAbility originalSA) {
|
||||
SpellAbility sa = this;
|
||||
while (sa != null) {
|
||||
if (sa.targetRestricions != null) {
|
||||
sa.targetChosen = new TargetChoices();
|
||||
sa.targetChosen.add(c);
|
||||
if (!originalSA.targetRestricions.getDividedMap().isEmpty()) {
|
||||
sa.targetRestricions.addDividedAllocation(c,
|
||||
Iterables.getFirst(originalSA.targetRestricions.getDividedMap().values(), null));
|
||||
}
|
||||
break;
|
||||
}
|
||||
sa = sa.subAbility;
|
||||
|
||||
@@ -709,4 +709,9 @@ public class TargetRestrictions {
|
||||
public int getDividedValue(Object tgt) {
|
||||
return this.dividedMap.get(tgt);
|
||||
}
|
||||
|
||||
public HashMap<Object, Integer> getDividedMap() {
|
||||
return this.dividedMap;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user