* Fixed problem with possibility to undo payed effects.

This commit is contained in:
LevelX2 2018-02-05 14:01:07 +01:00
parent f8208523ae
commit e35dd31b4e
2 changed files with 6 additions and 5 deletions

View file

@ -43,9 +43,9 @@ import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.game.Game;
import mage.game.events.GameEvent;
@ -57,9 +57,9 @@ import mage.target.targetpointer.FixedTarget;
* @author LevelX2 & L_J
*/
public class AzorTheLawbringer extends CardImpl {
public AzorTheLawbringer(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}{W}{U}{U}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}{W}{U}{U}");
addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.SPHINX);
this.power = new MageInt(6);
@ -70,7 +70,7 @@ public class AzorTheLawbringer extends CardImpl {
// When Azor, the Lawbringer enters the battlefield, each opponent cant cast instant or sorcery spells during that players next turn.
this.addAbility(new EntersBattlefieldTriggeredAbility(new AzorTheLawbringerEntersBattlefieldEffect(), false));
// Whenever Azor attacks, you may pay {X}{W}{U}{U}. If you do, you gain X life and draw X cards.
this.addAbility(new AttacksTriggeredAbility(new AzorTheLawbringerAttacksEffect(), false));
}
@ -192,6 +192,7 @@ class AzorTheLawbringerAttacksEffect extends OneShotEffect {
int costX = controller.announceXMana(0, Integer.MAX_VALUE, "Announce the value for {X}", game, source);
cost.add(new GenericManaCost(costX));
if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) {
controller.resetStoredBookmark(game); // otherwise you can undo the payment
controller.gainLife(costX, game);
controller.drawCards(costX, game);
return true;

View file

@ -111,7 +111,7 @@ class TilonallisSummonerEffect extends OneShotEffect {
int costX = controller.announceXMana(0, Integer.MAX_VALUE, "Announce the value for {X}", game, source);
cost.add(new GenericManaCost(costX));
if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) {
game.undo(id);
controller.resetStoredBookmark(game); // otherwise you can undo the payment
CreateTokenEffect effect = new CreateTokenEffect(new TilonallisSummonerElementalToken(), costX, true, true);
effect.apply(game, source);
Effect exileEffect = new ExileTargetEffect(null, "", Zone.BATTLEFIELD)