mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
Fixed hive mind and Chalice of the Void interaction.
This commit is contained in:
parent
ef7a001ce5
commit
ac1b4ab7b9
1 changed files with 11 additions and 3 deletions
|
@ -29,8 +29,10 @@ package mage.sets.magic2010;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.TriggeredAbilityImpl;
|
import mage.abilities.TriggeredAbilityImpl;
|
||||||
|
import mage.abilities.effects.Effect;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
|
@ -90,7 +92,11 @@ class HiveMindTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
Spell spell = game.getStack().getSpell(event.getTargetId());
|
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||||
if (spell != null && (spell.getCardType().contains(CardType.INSTANT)
|
if (spell != null && (spell.getCardType().contains(CardType.INSTANT)
|
||||||
|| spell.getCardType().contains(CardType.SORCERY))) {
|
|| 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;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -105,6 +111,8 @@ class HiveMindTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
class HiveMindEffect extends OneShotEffect {
|
class HiveMindEffect extends OneShotEffect {
|
||||||
|
|
||||||
|
private Spell _spell;
|
||||||
|
|
||||||
public HiveMindEffect() {
|
public HiveMindEffect() {
|
||||||
super(Outcome.Benefit);
|
super(Outcome.Benefit);
|
||||||
this.staticText = "each other player copies that spell. Each of those players may choose new targets for his or her copy";
|
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
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
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());
|
Player player = game.getPlayer(source.getControllerId());
|
||||||
if (spell != null && player != null) {
|
if (spell != null && player != null) {
|
||||||
Set<UUID> players = player.getInRange();
|
Set<UUID> players = player.getInRange();
|
||||||
|
|
Loading…
Reference in a new issue