mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
* Mindswipe - Fixed that it didn't deal damage, if the X cost was paid by target spell controller.
This commit is contained in:
parent
2977cd27ea
commit
116100461f
1 changed files with 6 additions and 3 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue