Applying some code review comments

This commit is contained in:
Chris H
2024-06-02 21:23:16 -04:00
parent 7c9cf7f587
commit b57ed2b165
7 changed files with 14 additions and 14 deletions

View File

@@ -1,6 +1,5 @@
package forge.card;
import com.google.common.collect.Lists;
import forge.card.mana.ManaCost;
import org.apache.commons.lang3.StringUtils;
@@ -47,7 +46,7 @@ final class CardFace implements ICardFace, Cloneable {
private List<String> abilities = null;
private List<String> staticAbilities = null;
private List<String> triggers = null;
private List<String> draftActions = Lists.newArrayList();
private List<String> draftActions = null;
private List<String> replacements = null;
private Map<String, String> variables = null;

View File

@@ -370,7 +370,9 @@ public class CardFactory {
// keywords not before variables
c.addIntrinsicKeywords(face.getKeywords(), false);
face.getDraftActions().forEach(c::addDraftAction);
if (face.getDraftActions() != null) {
face.getDraftActions().forEach(c::addDraftAction);
}
c.setManaCost(face.getManaCost());
c.setText(face.getNonAbilityText());

View File

@@ -2098,7 +2098,8 @@ public class CardProperty {
}
return false;
} else if (property.equals("NotedColor")) {
String colors = sourceController.getDraftNotes().get(spellAbility.getHostCard().getName());
// Should Regicide be hardcoded here or part of the property?
String colors = sourceController.getDraftNotes().get("Regicide");
if (colors == null) {
return false;
}
@@ -2108,13 +2109,15 @@ public class CardProperty {
(colors.contains("red") && card.getColor().hasRed()) ||
(colors.contains("green") && card.getColor().hasGreen());
} else if (property.equals("NotedName")) {
String names = sourceController.getDraftNotes().get(spellAbility.getHostCard().getName());
// Should Noble Banneret be hardcoded here or part of the property?
String names = sourceController.getDraftNotes().get("Noble Banneret");
if (names == null || names.isEmpty()) {
return false;
}
return names.contains(card.getName());
} else if (property.equals("NotedTypes")) {
String types = sourceController.getDraftNotes().get(spellAbility.getHostCard().getName());
// Should Paliano Vanguard be hardcoded here or part of the property?
String types = sourceController.getDraftNotes().get("Paliano Vanguard");
if (types == null || types.isEmpty()) {
return false;
}

View File

@@ -522,9 +522,6 @@ public class AbilityManaPart implements java.io.Serializable {
return getComboColors(sa);
}
String produced = this.getOrigProduced();
if (produced.contains("NotedColor")) {
produced = produced.replace("NotedColor", sa.getActivatingPlayer().getDraftNotes().get(""));
}
if (produced.contains("Chosen")) {
produced = produced.replace("Chosen", this.getChosenColor(sa));
}
@@ -665,11 +662,12 @@ public class AbilityManaPart implements java.io.Serializable {
origProduced = origProduced.replace("Chosen", getChosenColor(sa));
}
if (origProduced.contains("NotedColors")) {
// Should only be used for Paliano, the High City
if (sa.getActivatingPlayer() == null) {
return "";
}
String colors = sa.getActivatingPlayer().getDraftNotes().get(sa.getHostCard().getName());
String colors = sa.getActivatingPlayer().getDraftNotes().get("Paliano, the High City");
if (colors == null) {
return "";
}

View File

@@ -3,6 +3,6 @@ Types:Legendary Land
Draft:Reveal CARDNAME as you draft it.
Draft:As you draft CARDNAME, the player to your right chooses a color, you choose another color, then the player to your left chooses a third color.
A:AB$ Mana | Cost$ T | Produced$ Combo NotedColors | Condition$ Add one mana of any color chosen as you drafted cards named CARDNAME. | SpellDescription$ Add one mana of any color chosen as you drafted cards named Paliano, the High City.
Oracle:Reveal CARDNAME as you draft it. As you draft CARDNAME, the player to your right chooses a color, you choose another color, then the player to your left chooses a third color.\n{T}: Add one mana of any color chosen as you drafted cards named Paliano, the High City.
Oracle:Reveal Paliano, the High City as you draft it. As you draft Paliano, the High City, the player to your right chooses a color, you choose another color, then the player to your left chooses a third color.\n{T}: Add one mana of any color chosen as you drafted cards named Paliano, the High City.

View File

@@ -251,6 +251,7 @@ Natural Unity
Noble Banneret
Paliano Vanguard
Pyretic Hunter
Regicide
Sovereign's Realm
Summoner's Bond
Weight Advantage

View File

@@ -159,9 +159,6 @@ public class LimitedPlayer {
showRevealedCard(bestPick);
}
// TODO Paliano Vanguard
// As you draft a VALID, you may Note its [name/type/], and turn this face down
if (Iterables.contains(draftActions, "As you draft a card, you may remove it from the draft face up. (It isnt in your card pool.)")) {
// Animus of Predation
playerFlags |= AnimusRemoveFromPool;