Merge branch 'decks' into 'master'

Revert Comment out some currently unsupported cards in Commander precons

See merge request core-developers/forge!5289
This commit is contained in:
Michael Kamensky
2021-09-04 18:44:43 +00:00
17 changed files with 21 additions and 25 deletions

View File

@@ -67,7 +67,7 @@ public final class CardRules implements ICardCharacteristics {
} }
void reinitializeFromRules(CardRules newRules) { void reinitializeFromRules(CardRules newRules) {
if(!newRules.getName().equals(this.getName())) if (!newRules.getName().equals(this.getName()))
throw new UnsupportedOperationException("You cannot rename the card using the same CardRules object"); throw new UnsupportedOperationException("You cannot rename the card using the same CardRules object");
splitType = newRules.splitType; splitType = newRules.splitType;
@@ -91,7 +91,7 @@ public final class CardRules implements ICardCharacteristics {
} }
} }
int len = oracleText.length(); int len = oracleText.length();
for(int i = 0; i < len; i++) { for (int i = 0; i < len; i++) {
char c = oracleText.charAt(i); // This is to avoid needless allocations performed by toCharArray() char c = oracleText.charAt(i); // This is to avoid needless allocations performed by toCharArray()
switch(c) { switch(c) {
case('('): isReminder = i > 0; break; // if oracle has only reminder, consider it valid rules (basic and true lands need this) case('('): isReminder = i > 0; break; // if oracle has only reminder, consider it valid rules (basic and true lands need this)
@@ -99,7 +99,7 @@ public final class CardRules implements ICardCharacteristics {
case('{'): isSymbol = true; break; case('{'): isSymbol = true; break;
case('}'): isSymbol = false; break; case('}'): isSymbol = false; break;
default: default:
if(isSymbol && !isReminder) { if (isSymbol && !isReminder) {
switch(c) { switch(c) {
case('W'): res |= MagicColor.WHITE; break; case('W'): res |= MagicColor.WHITE; break;
case('U'): res |= MagicColor.BLUE; break; case('U'): res |= MagicColor.BLUE; break;
@@ -317,7 +317,7 @@ public final class CardRules implements ICardCharacteristics {
/** Instantiates class, reads a card. For batch operations better create you own reader instance. */ /** Instantiates class, reads a card. For batch operations better create you own reader instance. */
public static CardRules fromScript(Iterable<String> script) { public static CardRules fromScript(Iterable<String> script) {
Reader crr = new Reader(); Reader crr = new Reader();
for(String line : script) { for (String line : script) {
crr.parseLine(line); crr.parseLine(line);
} }
return crr.getCard(); return crr.getCard();

View File

@@ -270,7 +270,6 @@ public final class CardRulesPredicates {
return new PredicateSuperType(type, isEqual); return new PredicateSuperType(type, isEqual);
} }
/** /**
* Checks for color. * Checks for color.
* *

View File

@@ -122,7 +122,7 @@ public class PaperToken implements InventoryItemFromSet, IPaperCard {
String formatEdition = null == edition || CardEdition.UNKNOWN == edition ? "" : "_" + edition.getCode().toLowerCase(); String formatEdition = null == edition || CardEdition.UNKNOWN == edition ? "" : "_" + edition.getCode().toLowerCase();
this.imageFileName.add(String.format("%s%s", imageFileName, formatEdition)); this.imageFileName.add(String.format("%s%s", imageFileName, formatEdition));
for(int idx = 2; idx <= this.artIndex; idx++) { for (int idx = 2; idx <= this.artIndex; idx++) {
this.imageFileName.add(String.format("%s%d%s", imageFileName, idx, formatEdition)); this.imageFileName.add(String.format("%s%d%s", imageFileName, idx, formatEdition));
} }
} }

View File

@@ -40,7 +40,7 @@ public class TokenDb implements ITokenDatabase {
} }
public void preloadTokens() { public void preloadTokens() {
for(CardEdition edition : this.editions) { for (CardEdition edition : this.editions) {
for (String name : edition.getTokens().keySet()) { for (String name : edition.getTokens().keySet()) {
try { try {
getToken(name, edition.getCode()); getToken(name, edition.getCode());

View File

@@ -166,7 +166,6 @@ public class ChangeZoneAllEffect extends SpellAbilityEffect {
Map<AbilityKey, Object> moveParams = Maps.newEnumMap(AbilityKey.class); Map<AbilityKey, Object> moveParams = Maps.newEnumMap(AbilityKey.class);
if (destination == ZoneType.Battlefield) { if (destination == ZoneType.Battlefield) {
if (sa.hasAdditionalAbility("AnimateSubAbility")) { if (sa.hasAdditionalAbility("AnimateSubAbility")) {
// need LKI before Animate does apply // need LKI before Animate does apply
moveParams.put(AbilityKey.CardLKI, CardUtil.getLKICopy(c)); moveParams.put(AbilityKey.CardLKI, CardUtil.getLKICopy(c));

View File

@@ -1,6 +1,5 @@
package forge.game.ability.effects; package forge.game.ability.effects;
import java.util.List; import java.util.List;
import forge.game.ability.AbilityUtils; import forge.game.ability.AbilityUtils;
@@ -40,7 +39,7 @@ public class LifeGainEffect extends SpellAbilityEffect {
final int lifeAmount = AbilityUtils.calculateAmount(sa.getHostCard(), sa.getParam("LifeAmount"), sa); final int lifeAmount = AbilityUtils.calculateAmount(sa.getHostCard(), sa.getParam("LifeAmount"), sa);
List<Player> tgtPlayers = getDefinedPlayersOrTargeted(sa); List<Player> tgtPlayers = getDefinedPlayersOrTargeted(sa);
if( tgtPlayers.isEmpty() ) { if (tgtPlayers.isEmpty()) {
tgtPlayers.add(sa.getActivatingPlayer()); tgtPlayers.add(sa.getActivatingPlayer());
} }

View File

@@ -33,20 +33,20 @@ public class TokenCreateTable extends ForwardingTable<Player, Card, Integer> {
this.put(p, c, newValue); this.put(p, c, newValue);
return newValue; return newValue;
} }
public int getFilterAmount(String validOwner, String validToken, final CardTraitBase ctb) { public int getFilterAmount(String validOwner, String validToken, final CardTraitBase ctb) {
final Card host = ctb.getHostCard(); final Card host = ctb.getHostCard();
int result = 0; int result = 0;
List<Card> filteredCards = null; List<Card> filteredCards = null;
List<Player> filteredPlayer = null; List<Player> filteredPlayer = null;
if (validOwner == null && validToken == null) { if (validOwner == null && validToken == null) {
for (Integer i : values()) { for (Integer i : values()) {
result += i; result += i;
} }
return result; return result;
} }
if (validOwner != null) { if (validOwner != null) {
filteredPlayer = Lists.newArrayList(Iterables.filter(rowKeySet(), filteredPlayer = Lists.newArrayList(Iterables.filter(rowKeySet(),
GameObjectPredicates.restriction(validOwner.split(","), host.getController(), host, ctb))); GameObjectPredicates.restriction(validOwner.split(","), host.getController(), host, ctb)));
@@ -78,7 +78,7 @@ public class TokenCreateTable extends ForwardingTable<Player, Card, Integer> {
} }
return result; return result;
} }
for (Table.Cell<Player, Card, Integer> c : this.cellSet()) { for (Table.Cell<Player, Card, Integer> c : this.cellSet()) {
if (!filteredPlayer.contains(c.getRowKey())) { if (!filteredPlayer.contains(c.getRowKey())) {
continue; continue;
@@ -89,7 +89,6 @@ public class TokenCreateTable extends ForwardingTable<Player, Card, Integer> {
result += c.getValue(); result += c.getValue();
} }
return result; return result;
} }
} }

View File

@@ -152,7 +152,7 @@ public class TokenInfo {
} }
static protected void protoTypeApplyTextChange(final Card result, final SpellAbility sa) { static protected void protoTypeApplyTextChange(final Card result, final SpellAbility sa) {
// update Token with CardTextChanges // update Token with CardTextChanges
Map<String, String> colorMap = sa.getChangedTextColors(); Map<String, String> colorMap = sa.getChangedTextColors();
Map<String, String> typeMap = sa.getChangedTextTypes(); Map<String, String> typeMap = sa.getChangedTextTypes();
if (!colorMap.isEmpty()) { if (!colorMap.isEmpty()) {

View File

@@ -4,6 +4,6 @@ Types:Land
A:AB$ Mana | Cost$ T | Produced$ C | SpellDescription$ Add {C}. A:AB$ Mana | Cost$ T | Produced$ C | SpellDescription$ Add {C}.
A:AB$ Mana | Cost$ T | Produced$ W | SubAbility$ DBPain | SpellDescription$ Add {W}. CARDNAME deals 1 damage to you. A:AB$ Mana | Cost$ T | Produced$ W | SubAbility$ DBPain | SpellDescription$ Add {W}. CARDNAME deals 1 damage to you.
A:AB$ Mana | Cost$ T | Produced$ G | SubAbility$ DBPain | SpellDescription$ Add {G}. CARDNAME deals 1 damage to you. A:AB$ Mana | Cost$ T | Produced$ G | SubAbility$ DBPain | SpellDescription$ Add {G}. CARDNAME deals 1 damage to you.
SVar:DBPain:DB$DealDamage | NumDmg$ 1 | Defined$ You SVar:DBPain:DB$ DealDamage | NumDmg$ 1 | Defined$ You
SVar:Picture:http://www.wizards.com/global/images/magic/general/brushland.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/brushland.jpg
Oracle:{T}: Add {C}.\n{T}: Add {G} or {W}. Brushland deals 1 damage to you. Oracle:{T}: Add {C}.\n{T}: Add {G} or {W}. Brushland deals 1 damage to you.

View File

@@ -2,7 +2,7 @@ Name:Chrome Mox
ManaCost:0 ManaCost:0
Types:Artifact Types:Artifact
T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | OptionalDecider$ You | Execute$ TrigExile | TriggerDescription$ Imprint — When CARDNAME enters the battlefield, you may exile a nonartifact, nonland card from your hand. T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | OptionalDecider$ You | Execute$ TrigExile | TriggerDescription$ Imprint — When CARDNAME enters the battlefield, you may exile a nonartifact, nonland card from your hand.
SVar:TrigExile:DB$ChangeZone | Imprint$ True | Origin$ Hand | Destination$ Exile | ChangeType$ Card.nonArtifact+nonLand | ChangeNum$ 1 SVar:TrigExile:DB$ ChangeZone | Imprint$ True | Origin$ Hand | Destination$ Exile | ChangeType$ Card.nonArtifact+nonLand | ChangeNum$ 1
A:AB$ ManaReflected | Cost$ T | Valid$ Defined.Imprinted | ColorOrType$ Color | ReflectProperty$ Is | SpellDescription$ Add one mana of any of the exiled card's colors. A:AB$ ManaReflected | Cost$ T | Valid$ Defined.Imprinted | ColorOrType$ Color | ReflectProperty$ Is | SpellDescription$ Add one mana of any of the exiled card's colors.
T:Mode$ ChangesZone | Origin$ Battlefield | ValidCard$ Card.Self | Destination$ Any | Execute$ DBCleanup | Static$ True T:Mode$ ChangesZone | Origin$ Battlefield | ValidCard$ Card.Self | Destination$ Any | Execute$ DBCleanup | Static$ True
T:Mode$ ChangesZone | Origin$ Exile | Destination$ Any | Static$ True | ValidCard$ Card.IsImprinted+ExiledWithSource | Execute$ DBForget T:Mode$ ChangesZone | Origin$ Exile | Destination$ Any | Static$ True | ValidCard$ Card.IsImprinted+ExiledWithSource | Execute$ DBForget

View File

@@ -3,6 +3,6 @@ ManaCost:no cost
Types:Land Types:Land
A:AB$ Mana | Cost$ T | Produced$ Any | Amount$ 1 | SpellDescription$ Add one mana of any color. A:AB$ Mana | Cost$ T | Produced$ Any | Amount$ 1 | SpellDescription$ Add one mana of any color.
T:Mode$ Taps | ValidCard$ Card.Self | Execute$ TrigDamage | TriggerZones$ Battlefield | TriggerDescription$ Whenever CARDNAME becomes tapped, it deals 1 damage to you. T:Mode$ Taps | ValidCard$ Card.Self | Execute$ TrigDamage | TriggerZones$ Battlefield | TriggerDescription$ Whenever CARDNAME becomes tapped, it deals 1 damage to you.
SVar:TrigDamage:DB$DealDamage | Defined$ You | NumDmg$ 1 SVar:TrigDamage:DB$ DealDamage | Defined$ You | NumDmg$ 1
SVar:Picture:http://www.wizards.com/global/images/magic/general/city_of_brass.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/city_of_brass.jpg
Oracle:Whenever City of Brass becomes tapped, it deals 1 damage to you.\n{T}: Add one mana of any color. Oracle:Whenever City of Brass becomes tapped, it deals 1 damage to you.\n{T}: Add one mana of any color.

View File

@@ -6,7 +6,7 @@ A:AB$ ChangeZoneAll | Cost$ Sac<1/CARDNAME> | ChangeType$ Card.Creature+IsRememb
T:Mode$ ChangesZone | Origin$ Exile | Destination$ Any | Static$ True | ValidCard$ Card.IsRemembered+ExiledWithSource | Execute$ DBForget T:Mode$ ChangesZone | Origin$ Exile | Destination$ Any | Static$ True | ValidCard$ Card.IsRemembered+ExiledWithSource | Execute$ DBForget
SVar:DBForget:DB$ Pump | ForgetObjects$ TriggeredCard SVar:DBForget:DB$ Pump | ForgetObjects$ TriggeredCard
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | Static$ True | ValidCard$ Card.Self | Execute$ DBCleanup T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | Static$ True | ValidCard$ Card.Self | Execute$ DBCleanup
SVar:DBCleanup:DB$Cleanup | ClearRemembered$ True SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:NonStackingEffect:True SVar:NonStackingEffect:True
AI:RemoveDeck:All AI:RemoveDeck:All
SVar:Picture:http://www.wizards.com/global/images/magic/general/cold_storage.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/cold_storage.jpg

View File

@@ -5,6 +5,6 @@ A:AB$ Mana | Cost$ T | Produced$ C | SpellDescription$ Add {C}.
A:AB$ Mana | Cost$ T | Produced$ U | SubAbility$ DBPain | SpellDescription$ Add {U}. CARDNAME deals 1 damage to you. A:AB$ Mana | Cost$ T | Produced$ U | SubAbility$ DBPain | SpellDescription$ Add {U}. CARDNAME deals 1 damage to you.
A:AB$ Mana | Cost$ T | Produced$ G | SubAbility$ DBPain | SpellDescription$ Add {G}. CARDNAME deals 1 damage to you. A:AB$ Mana | Cost$ T | Produced$ G | SubAbility$ DBPain | SpellDescription$ Add {G}. CARDNAME deals 1 damage to you.
K:CARDNAME enters the battlefield tapped. K:CARDNAME enters the battlefield tapped.
SVar:DBPain:DB$DealDamage | NumDmg$ 1 | Defined$ You SVar:DBPain:DB$ DealDamage | NumDmg$ 1 | Defined$ You
SVar:Picture:http://www.wizards.com/global/images/magic/general/skyshroud_forest.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/skyshroud_forest.jpg
Oracle:Skyshroud Forest enters the battlefield tapped.\n{T}: Add {C}.\n{T}: Add {G} or {U}. Skyshroud Forest deals 1 damage to you. Oracle:Skyshroud Forest enters the battlefield tapped.\n{T}: Add {C}.\n{T}: Add {G} or {U}. Skyshroud Forest deals 1 damage to you.

View File

@@ -32,7 +32,7 @@ Name=Built from Scratch (2018)
1 Great Furnace|CM2 1 Great Furnace|CM2
1 Hoard-Smelter Dragon|CM2 1 Hoard-Smelter Dragon|CM2
1 Ichor Wellspring|CM2 1 Ichor Wellspring|CM2
#1 Impact Resonance|CM2 1 Impact Resonance|CM2
1 Incite Rebellion|CM2 1 Incite Rebellion|CM2
1 Ingot Chewer|CM2 1 Ingot Chewer|CM2
1 Jalum Tome|CM2 1 Jalum Tome|CM2

View File

@@ -32,7 +32,7 @@ Name=Built from Scratch
1 Great Furnace|C14 1 Great Furnace|C14
1 Hoard-Smelter Dragon|C14 1 Hoard-Smelter Dragon|C14
1 Ichor Wellspring|C14 1 Ichor Wellspring|C14
#1 Impact Resonance|C14 1 Impact Resonance|C14
1 Incite Rebellion|C14 1 Incite Rebellion|C14
1 Ingot Chewer|C14 1 Ingot Chewer|C14
1 Jalum Tome|C14 1 Jalum Tome|C14

View File

@@ -83,6 +83,6 @@ Name=Entropic Uprising
1 Curtains' Call|C16 1 Curtains' Call|C16
1 Parting Thoughts|C16 1 Parting Thoughts|C16
1 Grave Upheaval|C16 1 Grave Upheaval|C16
#1 Cruel Entertainment|C16 1 Cruel Entertainment|C16
1 Treacherous Terrain|C16 1 Treacherous Terrain|C16
1 Ash Barrens|C16 1 Ash Barrens|C16

View File

@@ -77,7 +77,7 @@ Name=Feline Ferocity
1 Soul's Majesty|C17 1 Soul's Majesty|C17
1 Spirit of the Hearth|C17 1 Spirit of the Hearth|C17
1 Staff of Nin|C17 1 Staff of Nin|C17
#1 Stalking Leonin|C17 1 Stalking Leonin|C17
1 Stirring Wildwood|C17 1 Stirring Wildwood|C17
1 Sunspear Shikari|C17 1 Sunspear Shikari|C17
1 Swiftfoot Boots|C17 1 Swiftfoot Boots|C17