- Fixed Bronze Horse

- Fixed a crash when Precursor Golem is targeted with an Electrolyze
This commit is contained in:
swordshine
2014-05-08 04:56:36 +00:00
parent e03b435154
commit ae382760d0
4 changed files with 13 additions and 4 deletions

View File

@@ -101,7 +101,7 @@ public class CopySpellAbilityEffect extends SpellAbilityEffect {
mayChoseNewTargets = false; mayChoseNewTargets = false;
for (GameObject o : candidates) { for (GameObject o : candidates) {
SpellAbility copy = CardFactory.copySpellAbilityAndSrcCard(card, chosenSA.getHostCard(), chosenSA, true); SpellAbility copy = CardFactory.copySpellAbilityAndSrcCard(card, chosenSA.getHostCard(), chosenSA, true);
copy.resetFirstTarget(o); copy.resetFirstTarget(o, chosenSA);
copies.add(copy); copies.add(copy);
} }
} else {// Precursor Golem, Ink-Treader Nephilim } else {// Precursor Golem, Ink-Treader Nephilim
@@ -118,7 +118,7 @@ public class CopySpellAbilityEffect extends SpellAbilityEffect {
mayChoseNewTargets = false; mayChoseNewTargets = false;
for (Card c : valid) { for (Card c : valid) {
SpellAbility copy = CardFactory.copySpellAbilityAndSrcCard(card, chosenSA.getHostCard(), chosenSA, true); SpellAbility copy = CardFactory.copySpellAbilityAndSrcCard(card, chosenSA.getHostCard(), chosenSA, true);
copy.resetFirstTarget(c); copy.resetFirstTarget(c, chosenSA);
copies.add(copy); copies.add(copy);
} }
} }

View File

@@ -1409,12 +1409,16 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
* Reset the first target. * Reset the first target.
* *
*/ */
public void resetFirstTarget(GameObject c) { public void resetFirstTarget(GameObject c, SpellAbility originalSA) {
SpellAbility sa = this; SpellAbility sa = this;
while (sa != null) { while (sa != null) {
if (sa.targetRestricions != null) { if (sa.targetRestricions != null) {
sa.targetChosen = new TargetChoices(); sa.targetChosen = new TargetChoices();
sa.targetChosen.add(c); sa.targetChosen.add(c);
if (!originalSA.targetRestricions.getDividedMap().isEmpty()) {
sa.targetRestricions.addDividedAllocation(c,
Iterables.getFirst(originalSA.targetRestricions.getDividedMap().values(), null));
}
break; break;
} }
sa = sa.subAbility; sa = sa.subAbility;

View File

@@ -709,4 +709,9 @@ public class TargetRestrictions {
public int getDividedValue(Object tgt) { public int getDividedValue(Object tgt) {
return this.dividedMap.get(tgt); return this.dividedMap.get(tgt);
} }
public HashMap<Object, Integer> getDividedMap() {
return this.dividedMap;
}
} }

View File

@@ -3,7 +3,7 @@ ManaCost:7
Types:Artifact Creature Horse Types:Artifact Creature Horse
PT:4/4 PT:4/4
K:Trample K:Trample
S:Mode$ Continuous | Affected$ Card.Self | AddKeyword$ PreventAllDamageBy Spell.IsTargetingSource | CheckSVar$ X | SVarCompare$ GE1 | Description$ Prevent all damage that would be dealt to CARDNAME by spells that target it. S:Mode$ Continuous | Affected$ Card.Self | AddKeyword$ PreventAllDamageBy Spell.IsTargetingSource | CheckSVar$ X | SVarCompare$ GE1 | Description$ As long as you control another creature, prevent all damage that would be dealt to CARDNAME by spells that target it.
SVar:X:Count$Valid Creature.YouCtrl+Other SVar:X:Count$Valid Creature.YouCtrl+Other
SVar:BuffedBy:Creature SVar:BuffedBy:Creature
SVar:Picture:http://www.wizards.com/global/images/magic/general/bronze_horse.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/bronze_horse.jpg