mirror of
https://github.com/correl/mage.git
synced 2024-11-14 19:19:32 +00:00
[MID] fix Light Up the Night damaging battles
This commit is contained in:
parent
3e5b392287
commit
94e81b6801
1 changed files with 9 additions and 15 deletions
|
@ -1,7 +1,5 @@
|
||||||
package mage.cards.l;
|
package mage.cards.l;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.costs.common.RemoveVariableCountersTargetCost;
|
import mage.abilities.costs.common.RemoveVariableCountersTargetCost;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
|
@ -19,8 +17,9 @@ import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.common.TargetAnyTarget;
|
import mage.target.common.TargetAnyTarget;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author weirddan455
|
* @author weirddan455
|
||||||
*/
|
*/
|
||||||
public final class LightUpTheNight extends CardImpl {
|
public final class LightUpTheNight extends CardImpl {
|
||||||
|
@ -69,21 +68,16 @@ class LightUpTheNightEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
// Normal cast
|
// Normal cast + Flashback cast
|
||||||
int damage = source.getManaCostsToPay().getX();
|
int damage = source.getManaCostsToPay().getX() + GetXValue.instance.calculate(game, source, this);
|
||||||
// Flashback cast
|
UUID targetId = getTargetPointer().getFirst(game, source);
|
||||||
damage += GetXValue.instance.calculate(game, source, this);
|
|
||||||
UUID targetId = source.getFirstTarget();
|
|
||||||
Player player = game.getPlayer(targetId);
|
Player player = game.getPlayer(targetId);
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
player.damage(damage, source.getSourceId(), source, game);
|
return player.damage(damage, source.getSourceId(), source, game) > 0;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
Permanent permanent = game.getPermanent(targetId);
|
Permanent permanent = game.getPermanent(targetId);
|
||||||
if (permanent != null) {
|
return permanent != null && permanent.damage(damage + ((
|
||||||
permanent.damage(damage + 1, source.getSourceId(), source, game);
|
permanent.isCreature(game) || permanent.isPlaneswalker(game)
|
||||||
return true;
|
) ? 1 : 0), source.getSourceId(), source, game) > 0;
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue