mirror of
https://github.com/correl/mage.git
synced 2024-12-26 11:09:27 +00:00
* Price of glory - Fixed that ability only triggers if the non active player uses a land to produce a mana (intervening if clause).
This commit is contained in:
parent
f83fbaa8ff
commit
b76102b0cd
1 changed files with 9 additions and 4 deletions
|
@ -39,6 +39,7 @@ import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
|
import mage.players.Player;
|
||||||
import mage.target.targetpointer.FixedTarget;
|
import mage.target.targetpointer.FixedTarget;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -86,7 +87,8 @@ class PriceOfGloryAbility extends TriggeredAbilityImpl {
|
||||||
if (permanent == null) {
|
if (permanent == null) {
|
||||||
permanent = (Permanent) game.getLastKnownInformation(event.getSourceId(), Zone.BATTLEFIELD);
|
permanent = (Permanent) game.getLastKnownInformation(event.getSourceId(), Zone.BATTLEFIELD);
|
||||||
}
|
}
|
||||||
if (permanent != null && permanent.getCardType().contains(CardType.LAND)) {
|
if (permanent != null && permanent.getCardType().contains(CardType.LAND)
|
||||||
|
&& !permanent.getControllerId().equals(game.getActivePlayerId())) { // intervening if clause
|
||||||
getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId()));
|
getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId()));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -118,9 +120,12 @@ class PriceOfGloryEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Permanent land = game.getPermanent(this.targetPointer.getFirst(game, source));
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (land != null && !land.getControllerId().equals(game.getActivePlayerId())) {
|
if (controller != null) {
|
||||||
|
Permanent land = game.getPermanentOrLKIBattlefield(this.targetPointer.getFirst(game, source));
|
||||||
|
if (land != null && !land.getControllerId().equals(game.getActivePlayerId())) { // intervening if clause has to be checked again
|
||||||
land.destroy(source.getSourceId(), game, false);
|
land.destroy(source.getSourceId(), game, false);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue