Fixed hive mind and Chalice of the Void interaction.

This commit is contained in:
Nathaniel Brandes 2015-04-30 21:00:34 -07:00
parent ef7a001ce5
commit ac1b4ab7b9

View file

@ -29,8 +29,10 @@ package mage.sets.magic2010;
import java.util.Set;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
@ -90,7 +92,11 @@ class HiveMindTriggeredAbility extends TriggeredAbilityImpl {
Spell spell = game.getStack().getSpell(event.getTargetId());
if (spell != null && (spell.getCardType().contains(CardType.INSTANT)
|| spell.getCardType().contains(CardType.SORCERY))) {
this.getEffects().get(0).setTargetPointer(new FixedTarget(spell.getId()));
for(Effect effect : getEffects()) {
if(effect instanceof HiveMindEffect) {
((HiveMindEffect)effect).setTargetPointer(new FixedTarget(spell.getId()));
}
}
return true;
}
}
@ -105,6 +111,8 @@ class HiveMindTriggeredAbility extends TriggeredAbilityImpl {
class HiveMindEffect extends OneShotEffect {
private Spell _spell;
public HiveMindEffect() {
super(Outcome.Benefit);
this.staticText = "each other player copies that spell. Each of those players may choose new targets for his or her copy";
@ -121,7 +129,7 @@ class HiveMindEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, source));
Spell spell = (Spell) game.getLastKnownInformation(((FixedTarget) getTargetPointer()).getTarget(), Zone.STACK);
Player player = game.getPlayer(source.getControllerId());
if (spell != null && player != null) {
Set<UUID> players = player.getInRange();