[DMU] Karn's Sylex (#9507)

This commit is contained in:
Alex Vasile 2022-09-17 22:37:56 -04:00 committed by GitHub
parent adbebfdd3e
commit b14af42280
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 285 additions and 30 deletions

View file

@ -83,6 +83,9 @@ public class ComputerPlayer extends PlayerImpl implements Player {
private transient ManaCost currentUnpaidMana;
// For stopping infinite loops when trying to pay Phyrexian mana when the player can't spend life and no other sources are available
private transient boolean alreadyTryingToPayPhyrexian;
public ComputerPlayer(String name, RangeOfInfluence range) {
super(name, range);
human = false;
@ -1664,9 +1667,16 @@ public class ComputerPlayer extends PlayerImpl implements Player {
}
}
if (alreadyTryingToPayPhyrexian) {
return false;
}
// pay phyrexian life costs
if (cost.isPhyrexian()) {
return cost.pay(ability, game, ability, playerId, false, null) || approvingObject != null;
alreadyTryingToPayPhyrexian = true;
boolean paidPhyrexian = cost.pay(ability, game, ability, playerId, false, null) || approvingObject != null;
alreadyTryingToPayPhyrexian = false;
return paidPhyrexian;
}
// pay special mana like convoke cost (tap for pay)