mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
Applying some code review comments
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 "";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user