* Mindswipe - Fixed that it didn't deal damage, if the X cost was paid by target spell controller.

This commit is contained in:
LevelX2 2014-09-30 13:01:00 +02:00
parent 2977cd27ea
commit 116100461f

View file

@ -95,16 +95,19 @@ class MindswipeEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
if (controller != null) { if (controller != null) {
MageObject object = game.getLastKnownInformation(getTargetPointer().getFirst(game, source), Zone.STACK); MageObject object = game.getStack().getSpell(getTargetPointer().getFirst(game, source));
if (object instanceof Spell) { if (object == null) {
object = game.getLastKnownInformation(getTargetPointer().getFirst(game, source), Zone.STACK);
}
if (object != null && object instanceof Spell) {
Spell spell = (Spell) object; Spell spell = (Spell) object;
Player spellController = game.getPlayer(spell.getControllerId()); Player spellController = game.getPlayer(spell.getControllerId());
if (spellController != null) { if (spellController != null) {
int damage = new ManacostVariableValue().calculate(game, source, this); int damage = new ManacostVariableValue().calculate(game, source, this);
spellController.damage(damage, source.getSourceId(), game, false, true); spellController.damage(damage, source.getSourceId(), game, false, true);
} }
return true;
} }
return true;
} }
return false; return false;
} }