Merge remote-tracking branch 'remotes/core/master'

This commit is contained in:
Anthony Calosa
2021-08-19 11:46:12 +08:00
5 changed files with 19 additions and 18 deletions

View File

@@ -1473,8 +1473,7 @@ public class AbilityUtils {
if (sa.metConditions()) {
if (sa.isWrapper() || StringUtils.isBlank(sa.getParam("UnlessCost"))) {
sa.resolve();
}
else {
} else {
handleUnlessCost(sa, game);
return;
}

View File

@@ -243,7 +243,7 @@ public class Cost implements Serializable {
} else {
CostPart cp = parseCostPart(part, tapCost, untapCost);
if (null != cp )
if (cp instanceof CostPartMana ) {
if (cp instanceof CostPartMana) {
parsedMana = (CostPartMana) cp;
} else {
this.costParts.add(cp);

View File

@@ -47,19 +47,22 @@ public class CostAdjustment {
Cost result = cost.copy();
boolean isStateChangeToFaceDown = false;
if (sa.isSpell() && sa.isCastFaceDown()) {
// Turn face down to apply cost modifiers correctly
host.turnFaceDownNoUpdate();
isStateChangeToFaceDown = true;
} // isSpell
// Commander Tax there
if (sa.isSpell() && host.isCommander() && ZoneType.Command.equals(host.getCastFrom())) {
int n = player.getCommanderCast(host) * 2;
if (n > 0) {
result.add(new Cost(ManaCost.get(n), false));
if (sa.isSpell()) {
if (sa.isCastFaceDown()) {
// Turn face down to apply cost modifiers correctly
host.turnFaceDownNoUpdate();
isStateChangeToFaceDown = true;
}
}
// Commander Tax there
if (host.isCommander() && ZoneType.Command.equals(host.getCastFrom())) {
int n = player.getCommanderCast(host) * 2;
if (n > 0) {
result.add(new Cost(ManaCost.get(n), false));
}
}
} // isSpell
CardCollection cardsOnBattlefield = new CardCollection(game.getCardsIn(ZoneType.Battlefield));
cardsOnBattlefield.addAll(game.getCardsIn(ZoneType.Stack));

View File

@@ -1118,8 +1118,7 @@ public class PhaseHandler implements java.io.Serializable {
else if (!game.getStack().hasSimultaneousStackEntries()) {
game.getStack().resolveStack();
}
}
else {
} else {
// pass the priority to other player
pPlayerPriority = nextPlayer;
}
@@ -1134,7 +1133,7 @@ public class PhaseHandler implements java.io.Serializable {
// update Priority for all players
for (final Player p : game.getPlayers()) {
if(getPriorityPlayer() == p)
if (getPriorityPlayer() == p)
p.setHasPriority(true);
else
p.setHasPriority(false);

View File

@@ -5,7 +5,7 @@ K:Enchant creature
A:SP$ Attach | Cost$ 2 R | ValidTgts$ Creature | AILogic$ Pump | SubAbility$ RememberSelf | SpellDescription$ Enchanted creature has haste and "At the beginning of your upkeep, destroy this creature. Reveal cards from the top of your library until you reveal a creature card. Put that card onto the battlefield and attach CARDNAME to it, then put all other cards revealed this way on the bottom of your library in a random order."
SVar:RememberSelf:DB$ Pump | Defined$ Creature.EnchantedBy | ImprintCards$ Self
S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddKeyword$ Haste | AddTrigger$ ShadowUpkeepTrig | AddSVar$ ShadowRememberSelf,ShadowDestroyEnchanted,ShadowRevealCards,ShadowReattach,DBCleanup
T:Mode$ ChangesZone | Affected$ Self | Origin$ Battlefield | Destination$ Any | Execute$ DBCleanup | Static$ True
T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Battlefield | Destination$ Any | Execute$ DBCleanup | Static$ True
SVar:ShadowUpkeepTrig:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ ShadowRememberSelf | TriggerDescription$ At the beginning of your upkeep, destroy this creature. Reveal cards from the top of your library until you reveal a creature card. Put that card onto the battlefield and attach CARDNAME to it, then put all other cards revealed this way on the bottom of your library in a random order.
SVar:ShadowRememberSelf:DB$ Pump | ImprintCards$ OriginalHost | SubAbility$ ShadowDestroyEnchanted
SVar:ShadowDestroyEnchanted:DB$ Destroy | Defined$ Self | SubAbility$ ShadowRevealCards