mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +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) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
MageObject object = game.getLastKnownInformation(getTargetPointer().getFirst(game, source), Zone.STACK);
|
||||
if (object instanceof Spell) {
|
||||
MageObject object = game.getStack().getSpell(getTargetPointer().getFirst(game, source));
|
||||
if (object == null) {
|
||||
object = game.getLastKnownInformation(getTargetPointer().getFirst(game, source), Zone.STACK);
|
||||
}
|
||||
if (object != null && object instanceof Spell) {
|
||||
Spell spell = (Spell) object;
|
||||
Player spellController = game.getPlayer(spell.getControllerId());
|
||||
if (spellController != null) {
|
||||
int damage = new ManacostVariableValue().calculate(game, source, this);
|
||||
spellController.damage(damage, source.getSourceId(), game, false, true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue